/** * Bounded live-region cockpit for optional Harness work. * * It never commits rows: finished transcript output remains in the terminal's * native scrollback while this temporary inspection view is open. Every stage — * the grouped overview, a workflow and its members, one subagent, one job — is * an internal submode of the same frame, so inspecting a row never creates a * detached modal. * * All four stages are built from the same primitive: a flat list of rows, some * of which carry a focus identity. That is what makes a detail view a real * inspectable list rather than a text page with an incidental highlight, and it * is why the arrow keys move a visible cursor everywhere instead of scrolling * underneath a stuck one. * @module dshline/work/overlay */ import type { TuiOverlay } from '../slots.ts'; import type { JobWorkItem, SubagentWorkItem, WorkConversationTarget, WorkflowWorkItem, WorkSnapshot, WorkInterruptResult } from './model.ts'; import type { JobOutputObservation } from './jobs.ts'; /** Inputs the Work overlay needs from its owner. */ export interface WorkOverlaySpec { /** Current read-only capability projection. */ readonly snapshot: () => WorkSnapshot; /** Ask Harness to interrupt one subagent, which is the only interruptible kind. */ readonly interruptSubagent: (item: SubagentWorkItem | WorkflowWorkItem) => WorkInterruptResult; /** * Ask Harness to stop one running Job, on a human's behalf. * * Separate from {@link interruptSubagent} rather than folded into one * `control(item)`: a subagent interrupt cancels a turn and a Job stop cancels * a producer, and a union whose meaning has to be rediscovered from `source` * is how a control ends up applied to the wrong authority. */ readonly stopJob: (item: JobWorkItem) => WorkInterruptResult; /** * Begin observing one Job's retained output, non-consumingly. Called only * when a Job detail stage actually opens, and the returned handle is disposed * the moment that stage closes. */ readonly observeJob?: (id: string) => JobOutputObservation | undefined; /** * Open the durable subagent-conversation catalog, when `ctx.subagents` is * mounted. The catalog belongs to a separate presenter: Work hands off and * keeps no durable conversation state of its own, and this is absent exactly * when that authority is. */ readonly conversations?: () => void; /** * Open the subagent detail stage's selected child conversation directly, when * Work holds the complete durable descriptor for it. Offered only on that * stage: the overview keeps `c` as the catalog, because a focused list row is * not yet an inspected subject. Mounted with the same seam as * {@link conversations}, and the catalog remains the fallback whenever the * selection is not addressable. */ readonly conversation?: (target: WorkConversationTarget) => void; /** Remove this overlay from the live region. */ readonly close: () => void; /** Redraw after selection, a result, or a timer tick. */ readonly invalidate: () => void; } /** * Create the bounded Work overlay. * @param spec - current projection and overlay controls. * @returns a temporary live-region overlay. */ export declare function createWorkOverlay(spec: WorkOverlaySpec): TuiOverlay; //# sourceMappingURL=overlay.d.ts.map