/** * Claude Code hook I/O protocol. Hooks are spawned as subprocesses; they * receive a JSON envelope on stdin and may write a JSON decision on stdout. * * Reference: https://docs.claude.com/en/docs/claude-code/hooks (subject to * change; the fields below are what sigil's hooks read and write). */ export interface HookEnvelope { session_id?: string; transcript_path?: string; hook_event_name?: string; tool_name?: string; tool_input?: Record; tool_response?: Record | string; [key: string]: unknown; } /** * Decision emitted by a PreToolUse hook. Returning `{ decision: "block" }` * stops the tool call and surfaces `reason` to the model. */ export interface BlockDecision { decision: 'block'; reason: string; } /** * Output from a PostToolUse hook that wants to modify the tool's response * (e.g., redact secrets). The exact shape Claude Code accepts is in flux; * we emit a structure that has been stable in recent versions. */ export interface PostToolModification { hookSpecificOutput: { hookEventName: 'PostToolUse'; updatedToolResponse: Record | string; }; } /** * Read the entire stdin stream and parse it as JSON. Returns an empty * object if stdin closes without data. */ export declare function readHookEnvelope(stdin?: NodeJS.ReadableStream): Promise; //# sourceMappingURL=protocol.d.ts.map