fix: resolve state variable shadowing in command, plugin, and tool/registry

The cache→state rename caused inner InstanceState.get() results to
shadow the outer state handle, breaking type inference. Rename inner
bindings to `s` to match the convention used in the other files.
This commit is contained in:
Kit Langton
2026-03-31 22:08:30 -04:00
parent 86c76b60de
commit 5ce8fd27aa
3 changed files with 16 additions and 16 deletions
+4 -4
View File
@@ -164,13 +164,13 @@ export namespace Command {
const state = yield* InstanceState.make<State>((ctx) => init(ctx))
const get = Effect.fn("Command.get")(function* (name: string) {
const state = yield* InstanceState.get(state)
return state.commands[name]
const s = yield* InstanceState.get(state)
return s.commands[name]
})
const list = Effect.fn("Command.list")(function* () {
const state = yield* InstanceState.get(state)
return Object.values(state.commands)
const s = yield* InstanceState.get(state)
return Object.values(s.commands)
})
return Service.of({ get, list })