Commit Graph

1 Commits

Author SHA1 Message Date
root
bdf04ab426 Wire up before_tool_call and after_tool_call hooks in agent execution loop
- Add pi-tools.hooks.ts: wraps tool execute methods to fire plugin hooks
- before_tool_call runs before each tool, supports blocking and param modification
- after_tool_call fires as fire-and-forget after tool returns with timing data
- Hook errors are caught and logged, never breaking tool execution
- Tools are only wrapped when hooks are actually registered (zero overhead otherwise)
- Move hookRunner initialization earlier in attempt.ts for tool wrapping access
- Extract hookAgentId to avoid repeated string splitting
2026-01-26 19:12:04 +00:00