Expose full tool result content and details in hook tool_result event

Breaking change: ToolResultEvent now exposes content and typed details
instead of just a result string. Hook handlers returning { result: ... }
must change to { content: [...] }.

- ToolResultEvent is now a discriminated union based on toolName
- Each built-in tool has typed details (BashToolDetails, etc.)
- Export tool details types and TruncationResult
- Update hooks.md documentation

Closes #233
This commit is contained in:
Mario Zechner 2025-12-19 00:42:08 +01:00
parent 05b7b81338
commit 3d9bad8fb6
12 changed files with 187 additions and 34 deletions

View file

@ -21,7 +21,7 @@ const bashSchema = Type.Object({
timeout: Type.Optional(Type.Number({ description: "Timeout in seconds (optional, no default timeout)" })),
});
interface BashToolDetails {
export interface BashToolDetails {
truncation?: TruncationResult;
fullOutputPath?: string;
}