/** What a blocked run waits on: an approval prompt or an `ask` question. */ export type BlockedKind = "permission" | "question"; /** * The agent's run status, in OSC 7501 terms: * - `idle`: at the prompt waiting for an instruction, including after the user interrupts a run; * - `working`: running; * - `blocked`: waiting on the user; `msg` says for what; * - `done`: finished a turn whose result the user has not looked at yet; * - `error`: the turn failed; `msg` says why. */ export type RunStatus = { readonly state: "idle" | "working" | "done"; } | { readonly state: "blocked"; readonly kind: BlockedKind; readonly msg?: string; } | { readonly state: "error"; readonly msg?: string; }; /** * Publish a run status transition from the interactive event flow: the title * separator (`tui.titleState`) and, unless `terminal.programStatus` is off, the * OSC 7501 root record. */ export declare function setRunStatus(status: RunStatus): void; /** Turn OSC 7501 reporting on or off (`terminal.programStatus`); off removes the record. */ export declare function setProgramStatusEnabled(enabled: boolean): void; /** * Re-send the record after resuming from a suspend: the shell prompt shown * meanwhile made the terminal drop `working` and `blocked` records. `done` and * `error` survive a prompt, so they are left alone rather than reported twice. */ export declare function resendProgramStatus(): void; /** * Claim the terminal's status record when the UI takes over the terminal: the * counterpart to {@link disposeProgramStatus} and the only release of its latch. * * `startupRun` marks a command-line prompt that runs once startup ends: the * first report is then `working`, not the `idle` that a supervisor waiting on * this terminal would take as "finished" before the prompt even starts. * {@link settleStartupRun} ends that hold. */ export declare function initProgramStatus(options?: { startupRun?: boolean; }): void; /** * End the startup hold once the command-line prompts are dispatched. A prompt * that ran reported its own status, which stays; one that failed or ran no turn * leaves the startup `working`, which goes back to `idle`. */ export declare function settleStartupRun(): void; /** * Remove omp's record and latch reporting off at UI teardown, before the * terminal goes back to the shell. A `done` record would otherwise survive the * exit and advertise a result nobody is left to show. */ export declare function disposeProgramStatus(): void;