Skip to content

Effectify ToolRegistry service#18269

Closed
kitlangton wants to merge 8 commits into
devfrom
kit/effectify-tool-registry
Closed

Effectify ToolRegistry service#18269
kitlangton wants to merge 8 commits into
devfrom
kit/effectify-tool-registry

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Migrate ToolRegistry from legacy Instance.state() pattern to the Effect service pattern (Interface / Service / Layer / promise facades)
  • Replace Instance.directory / Instance.worktree in fromPlugin with InstanceContext closure variables
  • Register ToolRegistry.Service in the Instances layer map
  • Mark ToolRegistry as done in effect-migration.md

Test plan

  • Verify bun run typecheck shows no new errors (all errors are pre-existing effect/zod version mismatches)
  • Verify bun run test shows no new failures
  • Confirm Instance.state no longer appears in tool/registry.ts
  • Confirm external callers (prompt.ts, experimental.ts, batch.ts, agent.ts) work unchanged via promise facades

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.
… pattern

Replace the legacy Instance.state() lazy init with an Effect Layer that
yields InstanceContext, defines Interface/Service/layer, and exposes
promise facades for backward compat. Register ToolRegistry.Service in
the Instances layer map.
@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