/** * Mission Control TUI Dashboard * * Main dashboard component that composes: * - Header (run ID, timer, phase) * - Phases panel (left) * - Tasks panel (right) * - Progress bar (bottom) * * Features: * - Keyboard navigation (Up/Down/Left/Right) * - Esc to close * - Enter to init new mission when idle * - Timed refresh for clock/file state * - Overlay support via ctx.ui.custom(..., { overlay: true }) */ import type { Theme } from "@mariozechner/pi-coding-agent"; import type { TUI } from "@mariozechner/pi-tui"; import type { Run } from "../state.js"; type DashboardMode = "idle" | "active"; export interface DashboardProps { onClose: () => void; onInitMission?: () => void; } /** * Mission Control Dashboard Component * * Usage: * ```typescript * const handle = ctx.ui.custom( * (tui, theme, keybindings, done) => new MissionDashboard({ onClose: done }), * { overlay: true } * ); * ``` */ export declare class MissionDashboard { private header; private phasesPanel; private tasksPanel; private progressBar; private idleView; private pastRuns; private mode; private run; private state; private refreshInterval; private cachedWidth?; private cachedLines?; private tui; private theme; private onClose; private onInitMission?; constructor(props: DashboardProps); /** * Start the refresh interval for clock/timer updates */ startRefresh(tui: TUI): void; /** * Stop the refresh interval */ stopRefresh(): void; /** * Refresh data from files */ refreshData(): void; /** * Handle init mission action (Enter in idle mode) */ private handleInitMission; /** * Handle keyboard input */ handleInput(data: string): void; /** * Request a re-render from TUI */ private requestRender; /** * Render the dashboard */ render(width: number, theme: Theme): string[]; private renderShortcutLegend; /** * Render idle mode */ private renderIdle; /** * Render active mode with a simple 40/60 split */ private renderActive; /** * Invalidate cached render output */ invalidate(): void; /** * Get current mode */ getMode(): DashboardMode; /** * Get active run (if any) */ getRun(): Run | null; /** * Dispose of resources */ dispose(): void; } /** * Open the Mission Control dashboard * * Usage in extension: * ```typescript * pi.registerCommand("mission", { * handler: async (_args, ctx) => { * const result = await ctx.ui.custom( * (tui, theme, _kb, done) => { * const dashboard = new MissionDashboard({ * onClose: () => done(null), * onInitMission: () => { * // Trigger mission_init tool * done("init"); * } * }); * dashboard.startRefresh(tui); * return dashboard; * }, * { overlay: true } * ); * * if (result === "init") { * // Handle init action * } * } * }); * ``` */ export declare function openMissionControl(ctx: { ui: { custom: (factory: (tui: TUI, theme: Theme, keybindings: unknown, done: (result: string | null) => void) => MissionDashboard, options: { overlay: boolean; }) => Promise; notify: (message: string, type: "info" | "warning" | "error") => void; }; }): Promise; export default MissionDashboard; //# sourceMappingURL=dashboard.d.ts.map