import type { FocusController } from "./focus-controller.js"; import type { PickerOption } from "../rendering/picker-filter.js"; import type { ArtifactPagerSource } from "../rendering/artifact-pager-source.js"; export type ConfirmKind = "tool" | "pentest" | "reset" | "continue" | "plan" | "switch" | "mcp-oauth"; export type PlanConfirmResult = "implement" | "discard" | "suggest" | "dismiss"; export interface ConfirmRequest { readonly kind: ConfirmKind; readonly prompt: string; readonly viewPath?: string | undefined; } export interface PickerRowAction { readonly chord: string; readonly hint: string; } export interface PickerRequest { readonly title: string; readonly options: readonly PickerOption[]; readonly rowAction?: PickerRowAction | undefined; readonly searchDescription?: boolean | undefined; readonly twoLine?: boolean | undefined; readonly historyStyle?: boolean | undefined; } export interface SecretRequestView { readonly title: string; readonly prompt: string; readonly reveal?: boolean | undefined; readonly initialValue?: string | undefined; } export interface ScopeEditorRequest { readonly initialTargets: readonly string[]; } export interface TextEditorRequest { readonly title: string; readonly prompt: string; readonly initialValue?: string | undefined; readonly placeholder?: string | undefined; readonly submitLabel?: string | undefined; } export interface KeysEditorSlotView { readonly id: string; readonly masked: string; readonly disabled?: boolean | undefined; } export interface KeysEditorRequest { readonly provider: string; readonly initialKeys: readonly KeysEditorSlotView[]; readonly activeIndex?: number | undefined; readonly itemLabel?: string | undefined; readonly heading?: string | undefined; } /** * Save rows: empty `value` + `slotId` keeps the stored secret; non-empty value * is a new/replacement plaintext key. Reset clears all keys for the provider. */ export type KeysEditorAnswer = { readonly action: "save"; readonly rows: readonly { slotId?: string; value: string; disabled?: boolean; }[]; readonly activeIndex?: number | undefined; } | { readonly action: "reset"; }; export interface PromptActionsRequest { readonly prompt: string; readonly onResend: () => void; } export type OverlayState = { readonly kind: "none"; } | { readonly kind: "picker"; readonly request: PickerRequest; readonly onSelect: (value: string) => void; readonly onRowAction?: ((value: string) => void) | undefined; } | { readonly kind: "confirm"; readonly request: ConfirmRequest; readonly resolve: (ok: boolean | PlanConfirmResult) => void; readonly onViewPlan?: (() => void) | undefined; readonly onViewFile?: (() => void) | undefined; readonly planResolve?: ((result: PlanConfirmResult) => void) | undefined; } | { readonly kind: "secret"; readonly request: SecretRequestView; readonly resolve: (value: string | undefined) => void; } | { readonly kind: "text-editor"; readonly request: TextEditorRequest; readonly resolve: (value: string | undefined) => void; } | { readonly kind: "scope-editor"; readonly request: ScopeEditorRequest; readonly resolve: (targets: string[] | undefined) => void; } | { readonly kind: "keys-editor"; readonly request: KeysEditorRequest; readonly resolve: (answer: KeysEditorAnswer | undefined) => void; } | { readonly kind: "prompt-actions"; readonly request: PromptActionsRequest; } | { readonly kind: "pager"; readonly title: string; readonly body: string; readonly source?: ArtifactPagerSource | undefined; readonly highlightPath?: string | undefined; readonly markdown?: "auto" | "force" | "plain" | undefined; } | { readonly kind: "jobs"; }; export type OverlayListener = () => void; export declare class OverlayController { private readonly focus; private state; private suspended; private readonly listeners; private closeFocus; constructor(focus: FocusController); getState(): OverlayState; isOpen(): boolean; subscribe(listener: OverlayListener): () => void; openPicker(request: PickerRequest, onSelect: (value: string) => void, onRowAction?: (value: string) => void): boolean; replacePickerOptions(options: readonly PickerOption[], title?: string): void; openPager(title: string, body: string, source?: ArtifactPagerSource, highlightPath?: string, markdown?: "auto" | "force" | "plain"): boolean; openJobs(): boolean; openPromptActions(request: PromptActionsRequest): boolean; openConfirm(request: ConfirmRequest, onViewPlan?: () => void, onViewFile?: () => void): Promise; openPlanConfirm(request: ConfirmRequest, onViewPlan?: () => void): Promise; openSecret(request: SecretRequestView): Promise; openTextEditor(request: TextEditorRequest): Promise; answerTextEditor(value: string | undefined): void; openScopeEditor(request: ScopeEditorRequest): Promise; answerScope(targets: string[] | undefined): void; openKeysEditor(request: KeysEditorRequest): Promise; answerKeys(answer: KeysEditorAnswer | undefined): void; answerConfirm(ok: boolean): void; answerPlanConfirm(result: PlanConfirmResult): void; answerSecret(value: string | undefined): void; cancelBlockingPrompt(): boolean; selectPicker(value: string): void; actOnPickerRow(value: string): void; close(): void; dispose(): void; private activeConfirm; private open; private suspendUnder; private restoreSuspended; private forceClose; private notify; }