feat(simulation): control arbitrary tool lifecycles (#37816)
This commit is contained in:
parent
925c2423de
commit
6d32bc9cb0
13 changed files with 1567 additions and 80 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue