import type { AnyHookOutcome, HookInput, HookOutcome } from '../types/hooks.js'; import type { Logger } from '../types/logger.js'; export interface ShellHookSpec { command: string; timeoutMs?: number | undefined; } export type HookExecutionFailureKind = 'aborted' | 'error' | 'exit' | 'invalid_output' | 'rejected' | 'timeout'; export interface HookExecutionFailure { kind: HookExecutionFailureKind; message: string; } export interface HookExecutionResult { outcome: AnyHookOutcome | null; failure?: HookExecutionFailure | undefined; } export interface HookExecutionOptions { signal?: AbortSignal | undefined; } /** * Run a shell hook (Claude-compatible). The `HookInput` JSON is written to the * command's stdin. Resolution rules, in order: * - exit code 2 → `{ decision: 'block', reason: }` * - stdout parses as a JSON object → returned verbatim as a `HookOutcome` * - otherwise → no-op (`null`) * * The hook never throws into the agent loop: spawn errors and timeouts resolve * to `null` and are logged. Output is capped at 64 KiB. */ export declare function runShellHook(spec: ShellHookSpec, input: HookInput, logger?: Logger | undefined): Promise; /** Detailed executor used by HookRunner to apply per-hook failure policy. */ export declare function runShellHookDetailed(spec: ShellHookSpec, input: HookInput, logger?: Logger | undefined, options?: HookExecutionOptions): Promise; export declare function parseHookOutcome(stdout: string): AnyHookOutcome | null; //# sourceMappingURL=shell-executor.d.ts.map