import type { Theme, ThemeColor } from '@earendil-works/pi-coding-agent'; import type { TUI } from '@earendil-works/pi-tui'; import type { LoadedWorkflow } from './config.ts'; import type { StepExecutionAttempt, UsageAggregate, WorkflowRun, WorkflowRunStatus, } from './state.ts'; export type StepTranscriptLog = | { readonly status: 'available'; readonly lines: ReadonlyArray; readonly truncated: boolean; } | { readonly status: 'unavailable'; readonly reason: string; }; export type WorkflowStatusExecution = | { readonly kind: 'main'; } | { readonly kind: 'agent'; readonly agent: string; readonly requestId: string; readonly progress: string; readonly model?: string; readonly activityLog?: ReadonlyArray; }; export type WorkflowStatusSnapshot = { readonly run: WorkflowRun; readonly workflow?: LoadedWorkflow; readonly execution?: WorkflowStatusExecution; readonly now: number; }; export type SnapshotProvider = () => WorkflowStatusSnapshot | undefined; export type StepDisplayStatus = WorkflowRunStatus | 'failed'; export type StatusViewTui = Pick & { readonly terminal?: { readonly rows: number }; }; export type PathEntry = { readonly index: number; readonly historyIndex?: number; readonly stepId: string; readonly title: string; readonly status: StepDisplayStatus; readonly visit: number; readonly outcome?: string; readonly usage?: UsageAggregate; readonly isCurrent: boolean; }; export type StepTranscriptLoader = ( attempt: Extract, ) => Promise; export type WorkflowStatusThemeColor = ThemeColor; export type WorkflowStatusTheme = Pick;