/** * Bridge hook emulation for non-interactive mode. * * When --bridge-hooks is set, emulates lifecycle hooks (session-start, stop * with block-continue, session-end) that the underlying CLI harness may not * support natively. The emulator shells out to the babysitter CLI to trigger * hook handling and run-status queries. */ export interface BridgeHookContext { harness: string; cwd: string; env: Record; sessionId?: string; runsDir?: string; verbose?: boolean; } export interface SessionStartResult { runId?: string; emulated: boolean; } export interface StopResult { shouldContinue: boolean; resumeId?: string; emulated: boolean; } export declare class BridgeHookEmulator { private readonly ctx; private readonly bin; private runId; constructor(ctx: BridgeHookContext); /** * Emulate the session-start lifecycle hook. * * If the harness supports session-start natively, this is a no-op. * If emulated, it invokes `babysitter hook:run --hook-type session-start` * which creates a bare run and initializes session state. */ emulateSessionStart(): Promise; /** * Emulate the stop lifecycle hook. * * If the harness supports stop natively, this is a no-op. * If emulated: * 1. Queries `babysitter run:status --json` to check run state * 2. If run has pending effects or is not completed: shouldContinue=true * 3. If run is completed: shouldContinue=false * 4. Returns a resumeId for session resume if continuing */ emulateStop(runId?: string): Promise; /** * Emulate the session-end lifecycle hook. * * If the harness supports session-end natively, this is a no-op. * If emulated, invokes `babysitter hook:run --hook-type session-end`. */ emulateSessionEnd(): Promise; /** Return the current run ID, if one was created during session-start. */ getRunId(): string | undefined; }