import { type ExtensionContext } from "@lpb-work/pi-coding-agent"; import { type Component, type MarkdownTheme } from "@lpb-work/pi-tui"; import { type AsyncRunSummary } from "../runs/background/async-status.ts"; import type { SteerDeliveryMode } from "../runs/background/control-channel.ts"; import { type ForegroundChildControl, type ForegroundResumeChild, type ForegroundResumeRun, type ForegroundRunControl, type SubagentState } from "../shared/types.ts"; type Theme = ExtensionContext["ui"]["theme"]; type FleetTui = { terminal?: { rows: number; }; requestRender(): void; }; type AsyncStep = AsyncRunSummary["steps"][number]; export type FleetItem = ({ key: string; kind: "foreground-active"; runId: string; index?: number; agent: string; state: "running"; updatedAt: number; control: ForegroundRunControl; activeChild?: ForegroundChildControl; } | { key: string; kind: "foreground-recent"; runId: string; index: number; agent: string; state: ForegroundResumeChild["status"]; updatedAt: number; run: ForegroundResumeRun; child: ForegroundResumeChild; } | { key: string; kind: "async"; runId: string; index?: number; agent: string; state: string; updatedAt: number; run: AsyncRunSummary; step?: AsyncStep; }) & { description?: string; }; export interface FleetSnapshot { items: FleetItem[]; error?: string; } export interface FleetActionResult { text: string; isError?: boolean; } export interface FleetActionHandlers { steer(input: { runId: string; asyncDir: string; index?: number; message: string; mode: SteerDeliveryMode; }): Promise; stop(input: { runId: string; asyncDir: string; index?: number; }): Promise | FleetActionResult; inspect?(input: { runId: string; asyncDir: string; index?: number; }): Promise; } export interface FleetViewOptions { asyncDirRoot?: string; resultsDir?: string; refreshMs?: number; initialKey?: string; markdownTheme?: MarkdownTheme; actions?: FleetActionHandlers; } export declare function collectFleetSnapshot(state: SubagentState, options?: { asyncDirRoot?: string; resultsDir?: string; limit?: number; }): FleetSnapshot; export declare class SubagentFleetComponent implements Component { private snapshot; private selected; private selectedKey; private detailScroll; private detailAutoFollow; private detailLineCount; private detailViewportHeight; private bodyHeight; private expandedTools; private actionNotice; private steerDraft; private steerMode; private stopConfirming; private actionBusy; private transcriptCache; private disposed; private readonly timer; private readonly tui; private readonly theme; private readonly markdownTheme; private readonly state; private readonly done; private readonly options; constructor(tui: FleetTui, theme: Theme, state: SubagentState, done: (result: undefined) => void, options?: FleetViewOptions); private refresh; private moveSelection; private resetActionInput; private selectedAsyncAction; private actionLines; private withActionLines; private setActionNotice; private runAction; private scrollDetail; handleInput(data: string): void; private rosterLines; private renderedTranscript; private wrappedDetail; render(width: number): string[]; invalidate(): void; dispose(): void; } export declare function openSubagentFleet(ctx: ExtensionContext, state: SubagentState, options?: FleetViewOptions): Promise; export {}; //# sourceMappingURL=fleet.d.ts.map