Conversation
Audit summary before implementation:\n- runtime/core currently exposed only entity/spatial/world and had no reusable runtime-level event helpers for libraries.\n- runtime/server/client entrypoints are surfaced through runtime/*/api.ts and package exports ./server + ./client, with no ./core subpath export.\n- logging patterns are centralized in kernel/logger via coreLogger and child logger factories; runtime uses those loggers directly.\n- no dedicated runtime config accessor pattern exists in server/client/core, so this change adds a minimal namespaced accessor for library APIs.\n\nImplementation:\n- Added runtime/core library primitives: tiny Map/Set internal bus, createLibraryBase, shared library types, and namespaced config accessor.\n- Added createServerLibrary and createClientLibrary wrappers with namespaced external bridges and logger/config helpers.\n- Exported library APIs via runtime/server and runtime/client barrels and exported core library primitives from runtime/core.\n- Added unit tests covering event bus behavior, name building, and server/client wrapper usage.
…y its shared client/server functionality
…tors, and processors for cross-side communication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
runtime/*(notkernel).events,fs, etc.).Description
src/runtime/core/library:types.ts, a tiny Map/SetcreateLibraryBus()(on/once/off/emit),createLibraryBase()andcreateLibraryConfigAccessor()with TSDoc explaining internal vs external events.createServerLibrary()insrc/runtime/server/librarythat composes the base and exposesemitExternal(),emitNetExternal(),getLogger()andgetConfig()and follows the exact naming conventionopencore:<libName>:<eventName>.createClientLibrary()insrc/runtime/client/librarythat composes the base and exposesemitServer(),getLogger()andgetConfig()using the same namespaced convention.runtime/core,runtime/serverandruntime/clientbarrels and added lightweight tests/examples demonstrating internal bus behavior,buildEventName()and server/client wrapper usage.Testing
pnpm -r buildand the TypeScript build completed successfully.pnpm -r test(unit + integration via Vitest) and the test suite passed: all tests executed successfully (including the new unit tests).opencore:<libName>:<eventName>as enforced bybuildEventName().Codex Task