(config: SessionConfig, action: () => Promise<void>)
| 2 | |
| 3 | /** Runs the actor before a successful tool result is released back to the agent. */ |
| 4 | export function afterSuccessfulTool(config: SessionConfig, action: () => Promise<void>): SessionConfig { |
| 5 | return { |
| 6 | ...config, |
| 7 | hooks: { |
| 8 | ...config.hooks, |
| 9 | async onPostToolUse(input, invocation) { |
| 10 | const output = await config.hooks?.onPostToolUse?.(input, invocation); |
| 11 | await action(); |
| 12 | return output; |
| 13 | }, |
| 14 | }, |
| 15 | }; |
| 16 | } |
no outgoing calls
no test coverage detected