Skip to content

feat(server): add plugin kernel MVP with extensible server API#44

Merged
Flussen merged 6 commits intov1.0-betafrom
codex/add-plugin-system-to-opencore-v1
Feb 17, 2026
Merged

feat(server): add plugin kernel MVP with extensible server API#44
Flussen merged 6 commits intov1.0-betafrom
codex/add-plugin-system-to-opencore-v1

Conversation

@Flussen
Copy link
Member

@Flussen Flussen commented Feb 17, 2026

Motivation

  • Provide a simple, compile-time plugin kernel so libraries can integrate formally into the server runtime and register decorators, DI services and server API extensions.
  • Allow safe, typeable server API extensions via TypeScript module augmentation while keeping existing runtime behavior and client bundle unchanged.

Description

  • Added a small plugin kernel under src/runtime/core/plugin with OpenCorePlugin, PluginInstallContext and PluginRegistry that prevents duplicate installs (PluginRegistry.installAll).
  • Introduced a server extension surface: src/runtime/server/plugin/server-plugin-api.ts (marker interface for augmentation), ServerApi typing, createServerRuntime() and registerApiExtension() runtime wiring in src/runtime/server/server.runtime.ts to attach extensions to the server surface.
  • Integrated plugin installation into server bootstrap by extending init() with OpenCoreInitOptions.plugins?: OpenCorePlugin[] and installing plugins before initServer() using an install context exposing server, di.register (backs to GLOBAL_CONTAINER.registerInstance) and a config.get accessor in src/runtime/server/core.ts.
  • Exported plugin surface from runtime/core/index.ts and updated runtime/server/index.ts exports, and added focused unit tests for installation ordering, duplicate detection, runtime extension behavior and module-augmentation typing.

Testing

  • Ran the new unit tests with pnpm -s test:unit tests/unit/runtime/core/plugin-registry.test.ts tests/unit/runtime/core/plugin-typing.test.ts and both tests passed.
  • Ran type checking with pnpm -s typecheck and confirmed the final run passed after adjusting runtime typing surface to avoid type errors.
  • Built the package with pnpm -s build and the build completed successfully.

Codex Task

@Flussen Flussen merged commit 5d0f8dd into v1.0-beta Feb 17, 2026
@Flussen Flussen deleted the codex/add-plugin-system-to-opencore-v1 branch February 17, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant