/** * CLI I/O Utilities. * * Handles stdin/stdout communication for CLI hooks. * Used by hook commands to read input and write output. */ import type { Readable, Writable } from 'stream'; import type { SessionTrigger } from '../../domain'; /** * Read JSON input from stdin with timeout. * * Returns empty object if stdin is empty or times out. * * @param stdin - Input stream (defaults to process.stdin) * @param timeoutMs - Timeout in milliseconds */ export declare function readJsonFromStdin(stdin?: Readable, timeoutMs?: number): Promise; /** * Write JSON output to stdout. * * Handles backpressure properly. * * @param data - Data to serialize and write * @param stdout - Output stream (defaults to process.stdout) */ export declare function writeJsonToStdout(data: T, stdout?: Writable): Promise; /** * Write text to a stream, handling backpressure. * * @param stream - Output stream * @param text - Text to write */ export declare function writeToStream(stream: Writable, text: string): Promise; /** * Write a status message to stderr. * * Status messages are shown to the user in Claude Code. * * @param message - Message to write * @param stderr - Error stream (defaults to process.stderr) */ export declare function writeStatus(message: string, stderr?: Writable): Promise; /** * Parse session trigger from Claude Code hook input. * * Claude Code sends different values depending on the event: * - source: "startup", "resume" * - session_type: "new", "existing" * * @param source - The source field from hook input * @param sessionType - The session_type field from hook input */ export declare function parseTrigger(source?: string, sessionType?: string, trigger?: string): SessionTrigger; /** * Claude Code hook input for session start. */ export interface ISessionStartInput { source?: string; trigger?: string; session_type?: string; cwd?: string; session_id?: string; } /** * Claude Code hook input for session stop. */ export interface ISessionStopInput { session_id?: string; transcript_path?: string; cwd?: string; } /** * Claude Code hook input for prompt submit. */ export interface IPromptSubmitInput { prompt?: string; content?: string; permission_mode?: string; permissionMode?: string; session_id?: string; } /** * Claude Code hook output format. */ export interface IHookOutput { hookSpecificOutput?: { hookEventName: string; additionalContext?: string; }; } //# sourceMappingURL=io.d.ts.map