/** * Hook input parsing */ import type { HookInput, PreToolUseInput, SubagentHookInput } from './types.js'; /** * Discriminated union for stdin input types */ export type StdinInput = { kind: 'prompt'; input: HookInput; } | { kind: 'tooluse'; input: PreToolUseInput; }; /** * Parses stdin JSON and dispatches to the appropriate parser based on shape. * * If the data contains a `tool_name` field, it's treated as PreToolUse input. * Otherwise, it's treated as a prompt-based hook input (UserPromptSubmit/SubagentStart). * * @param jsonString - Raw JSON string from stdin * @returns Discriminated StdinInput union * @throws Error if input is empty, invalid JSON, or validation fails */ export declare function parseStdinInput(jsonString: string): StdinInput; /** * Parses hook input from JSON string. * * @param jsonString - Raw JSON string from stdin * @returns Validated HookInput * @throws Error if input is empty, invalid JSON, or missing required fields */ export declare function parseHookInput(jsonString: string): HookInput; /** * Builds a SubagentHookInput from a parsed stdin payload, keeping only * string-typed fields and defaulting session_id. */ export declare function buildSubagentInput(obj: Record): SubagentHookInput; /** * Reads input from stdin synchronously. * * @returns Raw string from stdin */ export declare function readStdin(): string; //# sourceMappingURL=input.d.ts.map