import type { HookConfig } from '../config/schema.js'; export type HookKind = 'pre_start' | 'post_start' | 'pre_stop' | 'post_stop'; export interface HookContext { cwd?: string; env?: Record; timeoutMs?: number; /** * Optional line sink. When provided, the hook's stdout/stderr is streamed * line-by-line as it runs (so a reporter can pipe it live) instead of being * buffered and discarded. The failure path still captures stderr for the * thrown HookError regardless. */ onLine?: (line: string, stream: 'stdout' | 'stderr') => void; /** * When aborted, the hook subprocess is terminated (SIGTERM via execa's * cancelSignal) and the hook rejects. The orchestrator wires its per-startup * abort into `pre_start`/`post_start` so a shutdown or restart that lands * mid-hook (a long `pnpm install`) kills the hook instead of letting it — * and the process spawn queued behind it — outlive the teardown. */ cancelSignal?: AbortSignal; } export declare class HookError extends Error { readonly hook: HookKind; readonly command: string; readonly exitCode: number | null; readonly stderr: string; constructor(hook: HookKind, command: string, exitCode: number | null, stderr: string); } export declare function runHook(hook: HookKind, hooks: HookConfig | undefined, ctx?: HookContext): Promise; //# sourceMappingURL=hooks.d.ts.map