feat(simulation): control arbitrary tool lifecycles (#37816)

This commit is contained in:
Kit Langton 2026-07-19 17:40:30 -04:00 committed by GitHub
commit 6d32bc9cb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1567 additions and 80 deletions

View file

@ -365,11 +365,14 @@ export const make = Effect.fn("PluginHost.make")(function* (plugin: PluginV2.Int
},
}),
)
yield* Effect.forEach(
registrations,
(registration) => tools.register({ [registration.name]: registration.tool }, registration.options),
{ discard: true },
).pipe(Effect.orDie)
yield* tools
.registerBatch(
registrations.map((registration) => ({
tools: { [registration.name]: registration.tool },
...(registration.options === undefined ? {} : { options: registration.options }),
})),
)
.pipe(Effect.orDie)
return { dispose: Effect.void }
}),
hook: (name, callback) => {