/** * [WHO]: ApprovalSelectorComponent, ApprovalDecision, ApprovalChoice, CliApprovalClient, APPROVAL_TIMEOUT_MS * [FROM]: Depends on @catui/tui, ../theme/theme.js, node:process * [TO]: Consumed by modes/interactive/interactive-mode.ts (ApprovalSelectorComponent, Layer 2 TUI surface) and * main.ts (CliApprovalClient, Layer 2 runtime wire) — both honor ADR bash-pre-execution-approval-decision. * [HERE]: modes/interactive/components/approval-selector.ts - TUI selector + minimal CLI client for * dangerous bash commands. ApprovalSelectorComponent is the polished Layer 3 surface; CliApprovalClient * is the Layer 2 wiring proof-of-life (does not mount to TUI, reads stdin directly + 60s timeout -> deny). */ import { Container } from "@catui/tui"; export type ApprovalChoice = "once" | "session" | "always" | "deny"; export interface ApprovalDecision { command: string; description: string; reason: string; } declare const TIMEOUT_MS = 60000; export declare class ApprovalSelectorComponent extends Container { private listContainer; private allChoices; private selectedIndex; private onResolve; private resolved; private choiceLabels; constructor(decision: ApprovalDecision, onResolve: (choice: ApprovalChoice) => void); private updateList; private resolve; /** Implement the keypress handler required by selector pattern. */ handleInput(keyData: string): void; } export { TIMEOUT_MS as APPROVAL_TIMEOUT_MS }; /** * Minimal CLI approval client — emits a short prompt on stdout and reads a * single character from stdin. NOT a polished TUI; this is the layer-2 * "the chain works end-to-end" client used by main.ts wiring without taking * a hard dependency on @catui/tui or PromptHost. Polished TUI selector is * implemented by `ApprovalSelectorComponent` above; a follow-up will wire * that as the interactive-mode runtime client. * * Timeout: 60s. Defaults to "deny" (fail-closed). */ export declare class CliApprovalClient { private approvalPrompted; request(decision: ApprovalDecision): Promise; private readLine; private timeout; private mapChar; }