Skip to content

Effectify Plugin service#18270

Closed
kitlangton wants to merge 8 commits intodevfrom
kit/effectify-plugin
Closed

Effectify Plugin service#18270
kitlangton wants to merge 8 commits intodevfrom
kit/effectify-plugin

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Migrate Plugin from legacy Instance.state() pattern to Effect service pattern (Interface, Service class, Layer, promise facades)
  • Register Plugin.Service in InstanceServices and add Plugin.layer to the instance lookup in instances.ts
  • Mark Plugin as done in effect-migration.md

Test plan

  • Verify Instance.state no longer appears in plugin/index.ts
  • Run bun run typecheck in packages/opencode -- no new errors (all existing are pre-existing)
  • Run bun run test in packages/opencode -- no new failures

Constrain BusEvent.define to ZodObject instead of ZodType so TS knows
event properties are always a record. Type GlobalBus payload as
{ type: string; properties: Record<string, unknown> } instead of any.

Refactor watcher test to use Bus.subscribe instead of raw GlobalBus
listener, removing hand-rolled event types and unnecessary casts.
…ce pattern

Replace the legacy Instance.state() lazy-init pattern with the standard
Effect service pattern (Interface, Service class, Layer, promise facades).
Register Plugin.Service in InstanceServices and add its layer to the
instance lookup.
@kitlangton kitlangton closed this Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant