/** * Bounded live-region presentation of durable subagent conversations. * * Three surfaces over the shared kernel, and the stack IS the navigation model: * the catalog opens over `/work`, Enter pushes a conversation inspector over * the catalog, and `m`/`s` push a small message composer over that. Escape pops * exactly one level, so there is no "sometimes back" state anywhere. None of * them writes the transcript: native scrollback stays the transcript, and the * inspector draws only the bounded window it read. * * The composer is the renderer's own `Composer` instance, not a second editor: * the same buffer, cursor model, undo semantics, and key handling the main * input uses, rendered into this surface's bounded body with a block cursor * because a live-region overlay cannot own the terminal caret. * @module dshline/subagents/overlay */ import type { TuiOverlay } from '../slots.ts'; import { SurfaceNotice } from '../surface.ts'; import type { HumanPromptDelivery, SubagentPromptOutcome } from './control.ts'; import type { SubagentCatalogReading, SubagentChildRow } from './model.ts'; import type { SubagentTranscriptReading } from './transcript.ts'; /** How long a conversation's outcome notice remains readable. */ export declare const CONVERSATION_NOTICE_MS = 4000; /** Inputs the durable-child catalog surface needs from its presenter. */ export interface SubagentCatalogOverlaySpec { /** The current discovery reading, fresh on every paint. */ readonly reading: () => SubagentCatalogReading; /** How this catalog was opened; decides ONLY the truthful Escape wording. */ readonly origin: 'root' | 'work'; /** Open the conversation inspector for one durable child id. */ readonly inspect: (childId: string) => void; /** Re-run discovery. */ readonly refresh: () => void; /** Remove this temporary surface. */ readonly close: () => void; /** Redraw after a keystroke that changed selection. */ readonly invalidate: () => void; } /** * Create the bounded durable-child catalog surface. * @param spec - discovery reading, inspection opener, and surface controls. * @returns a live-region overlay that never writes the transcript. */ export declare function createSubagentCatalogOverlay(spec: SubagentCatalogOverlaySpec): TuiOverlay; /** Inputs the read-only conversation inspector needs from its presenter. */ export interface SubagentConversationOverlaySpec { /** The durable child being inspected, read fresh so a refresh updates its facts. */ readonly child: () => SubagentChildRow; /** The current transcript reading, fresh on every paint. */ readonly reading: () => SubagentTranscriptReading; /** Whether a human queue/steer follow-up is authorized. */ readonly followUp: boolean; /** Whether a human steer is authorized. */ readonly steer: boolean; /** Read one older page if the child has one. */ readonly loadOlder: () => void; /** Read one newer captured page if the child has one. */ readonly loadNewer: () => void; /** Re-read the newest page. */ readonly refresh: () => void; /** Open the message composer with this delivery. */ readonly message: (delivery: HumanPromptDelivery) => void; /** The presenter-owned outcome notice. */ readonly notice: SurfaceNotice; /** Remove this temporary surface. */ readonly close: () => void; /** Redraw after a keystroke that scrolled or acted. */ readonly invalidate: () => void; } /** * Create the bounded read-only conversation inspector. * @param spec - the addressed child, transcript reading, and surface controls. * @returns a live-region overlay that never resumes the child or writes scrollback. */ export declare function createSubagentConversationOverlay(spec: SubagentConversationOverlaySpec): TuiOverlay; /** Inputs the bounded message composer needs from its presenter. */ export interface SubagentMessageOverlaySpec { /** The addressed child's display name. */ readonly childLabel: string; /** Which Harness scheduling this message asks for. */ readonly delivery: HumanPromptDelivery; /** Deliver through Harness's human prompt authority. */ readonly submit: (text: string, signal: AbortSignal) => Promise; /** Called once with the accepted receipt, before the surface closes. */ readonly onAccepted: (messageId: string) => void; /** Remove this temporary surface. */ readonly close: () => void; /** Redraw after an edit or a submission edge. */ readonly invalidate: () => void; } /** * Create the bounded text composer for one human follow-up. * * The buffer is the renderer's `Composer`. On Enter the composer clears its own * buffer, so this surface restores the submitted text while the call is in * flight and only leaves it cleared once Harness accepted — a refusal keeps the * draft and shows Harness's own reason. * @param spec - the addressed child, delivery, submission, and surface controls. * @returns a live-region overlay that never writes the transcript. */ export declare function createSubagentMessageOverlay(spec: SubagentMessageOverlaySpec): TuiOverlay; //# sourceMappingURL=overlay.d.ts.map