/** * [WHO]: TaskStatusPanelComponent - renders persistent task status with checkboxes * [FROM]: Depends on @catui/tui, extensions/builtin/task/task-store * [TO]: Consumed by StreamRenderController * [HERE]: modes/interactive/components/task-status-panel.ts - CC-style task status TUI panel * * Completed tasks stay visible (no auto-dispose) and are visually de-emphasized * via dim + strikethrough. Tasks that just transitioned to completed are * prioritized for the RECENT_COMPLETED_TTL_MS window so the user can see what * just finished before it ages out. */ import { Container, type TUI } from "@catui/tui"; import type { Theme } from "../theme/theme.js"; export interface TaskStatusEntry { id: string; subject: string; status: "pending" | "in_progress" | "completed"; activeForm?: string; blockedBy?: string[]; } export declare class TaskStatusPanelComponent extends Container { private tui; private theme; private spinnerFrame; private spinnerTimer; private headerText; private taskLines; private overflowLine; private lastTasks; /** Tracks when each task was last observed transitioning to `completed`. * Only newly-completed tasks are recorded; tasks that go back to pending * have their entry removed by `pruneCompletionTimestamps()`. */ private completionTimestamps; /** Last task ID set we saw as completed. Used to detect transitions. */ private previousCompletedIds; /** Whether the snapshot has been seeded yet (first update call). */ private snapshotSeeded; constructor(tui: TUI, theme: Theme); /** * Update completion timestamp tracking: a task only gets a fresh timestamp * the first time we see it transition from non-completed → completed within * this component's lifetime. Initial seed does not count as a transition so * re-rendering a session that boots up with completed tasks does not * promote them to "recent". */ private updateCompletionTimestamps; private getSummaryText; private updateHeader; private startSpinner; private stopSpinner; dispose(): void; /** Rebuild the panel from current task list. */ update(tasks: TaskStatusEntry[]): void; /** * Prioritize tasks for display: * 1. in_progress (most important — user needs to see what's happening) * 2. pending (what's next) * 3. completed, split into: * 3a. recently completed (within RECENT_COMPLETED_TTL_MS) — promoted * 3b. older completed * Within each bucket, stable id order. */ private prioritizeTasks; /** Get the last known tasks. */ getLastTasks(): TaskStatusEntry[]; }