Skip to content

feat(plugin): publish reusable PluginServiceContext host factory #1452

Description

@rickylabs

Consumer evidence

NetScript 0.0.5 plugin services require a host-provided createPluginServiceContext(pluginName) bootstrap. The CLI-generated consumer owns roughly 100 LOC of LazyPluginKv plus DB/KV/contracts/logger/env composition, while the published package exposes the PluginServiceContext contract but no generic factory.

EIS-Chat must retain services/_shared/plugin-service-context.ts for workers and other packaged plugin services even though this is framework host glue rather than product behavior.

Impact

Every application consumer duplicates lifecycle-sensitive lazy DB/KV bootstrap code, which can drift from the service runtime and prevents the framework seam from reducing consumer LOC.

Acceptance

  • Publish a generic host-context factory (or smaller composable host primitives) covering lazy DB/KV, contracts, logger, env, and appsettings.
  • Preserve consumer override points for project DB adapters and environment resolution.
  • Add a generated-consumer test proving workers/auth/sagas services boot with the public factory.
  • The CLI scaffold delegates to that public seam instead of emitting a full LazyPluginKv implementation.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions