Add optional hook callbacks to AgentConfig for cross-cutting concerns (guardrails, logging, token budgets) without modifying framework internals. - beforeRun: receives prompt + agent config, can modify or throw to abort - afterRun: receives AgentRunResult, can modify or throw to fail - Works with all three execution modes: run(), prompt(), stream() - 15 test cases covering modify, throw, async, composition, and history integrity |
||
|---|---|---|
| .. | ||
| agent-hooks.test.ts | ||
| grok-adapter.test.ts | ||
| semaphore.test.ts | ||
| shared-memory.test.ts | ||
| structured-output.test.ts | ||
| task-queue.test.ts | ||
| task-retry.test.ts | ||
| task-utils.test.ts | ||
| tool-executor.test.ts | ||
| trace.test.ts | ||