import { type Theme } from "@earendil-works/pi-coding-agent"; import { type AwaitingCheckpoint, type PersistedRun, type RunStore, type WorktreeReference } from "./persistence.js"; import { type AgentAttemptAction, type AgentAttemptActionContext, type AgentRecord, type LaunchSnapshot, type StandaloneAgentAttemptActionContext } from "./types.js"; import { type WorkflowPhaseSelection } from "./host-phases.js"; export { SETTLED_AGENT_STATES } from "./types.js"; export interface WorkflowProgressStyles { accent(text: string): string; success(text: string): string; error(text: string): string; warning(text: string): string; muted(text: string): string; dim(text: string): string; bold(text: string): string; } export declare function formatWorkflowProgress(run: PersistedRun, spinner?: string, styles?: WorkflowProgressStyles, now?: number, expanded?: boolean, width?: number, showHint?: boolean): string; export declare function textBlock(text: string): { render(width: number): string[]; invalidate(): void; }; export declare function styledTextBlock(text: string): { render(width: number): string[]; invalidate(): void; }; export declare function workflowCatalogBlock(text: string, expanded: boolean): { render(width: number): string[]; invalidate(): void; }; type WorkflowControlResult = { details?: unknown; content?: readonly { type: string; text?: string; }[]; }; export declare function workflowControlCall(name: string, args: Record, theme: Theme): string; export declare function workflowControlResult(name: string, args: Record, result: WorkflowControlResult, expanded: boolean, theme: Theme, isError: boolean): string; type CatalogToolResult = { details?: unknown; content?: readonly { type: string; text?: string; }[]; }; export declare function catalogResultValue(result: CatalogToolResult): unknown; export declare function formatWorkflowCatalog(value: unknown, expanded: boolean, theme: Theme): string; export declare function truncateWorkflowProgress(text: string, width: number): string[]; export declare function themeWorkflowProgressStyles(theme: Theme): WorkflowProgressStyles; export type WorkflowProgressRefreshState = { runId: string; inputRun: PersistedRun; run: PersistedRun; lastRefreshAt: number; runtimeStartedAt: number; runtimeBaseMs: number; refresh?: Promise; }; export type WorkflowProgressRenderState = { workflowSpinner?: ReturnType; workflowProgress?: WorkflowProgressRefreshState; workflowProgressComponent?: ReturnType; workflowProgressFrozenAt?: number; }; export declare function workflowProgressBlock(run: PersistedRun, theme: Theme, progress?: WorkflowProgressRefreshState, refresh?: () => Promise, invalidate?: () => void, prefix?: string, freezeAt?: number): { render(width: number): string[]; setExpanded(value: boolean): void; invalidate(): void; }; export declare function formatBudgetStatus(run: Pick): string[]; export declare function navigatorAttentionSortByState(entries: readonly T[], stateOf: (entry: T) => string, resolvedAtOf: (entry: T) => number | undefined, stateOrder?: Readonly>): T[]; export declare function navigatorAttentionSort(entries: readonly T[]): T[]; export declare function navigatorRunLabels(entries: readonly { store: RunStore; loaded: { run: PersistedRun; }; }[]): string[]; export declare function agentBreadcrumbParts(agent: AgentRecord, byId: Map, includeStructuralPath?: boolean): string[]; export declare function agentBreadcrumb(agent: AgentRecord, byId: Map, includeStructuralPath?: boolean): string; export declare function formatStalledDuration(durationMs: number): string; export interface AgentDetailPresentation { readonly state: string; readonly activity?: AgentRecord["activity"]; readonly lastEventAt?: number; readonly structuralPath?: readonly string[]; readonly model?: AgentRecord["model"]; readonly role?: string; readonly tools?: readonly string[]; readonly attempts?: number; readonly startedAt?: number; readonly finishedAt?: number; readonly durationMs?: number; readonly accounting?: NonNullable; readonly error?: { readonly code: string; readonly message: string; }; } export declare function formatAgentDetail(agent: Readonly, styles?: WorkflowProgressStyles, now?: number, options?: Readonly<{ includeError?: boolean; }>): string[]; export interface AgentActionPresentation { readonly extensionLabels: readonly string[]; readonly hasWorktree: boolean; readonly openPrompt: boolean; readonly openSystemPrompt: boolean; readonly openResult: boolean; readonly standaloneState?: "running" | "completed" | "failed" | "stopped"; } export declare function agentActionLabels(options: Readonly): string[]; export declare function visibleAgentAttemptActions(actions: Readonly>, context: Readonly): readonly [string, AgentAttemptAction][]; export declare function visibleStandaloneAgentAttemptActions(actions: Readonly>, context: Readonly): readonly [string, AgentAttemptAction][]; export declare function formatNavigatorDashboard(run: PersistedRun, checkpoints: readonly AwaitingCheckpoint[], worktrees: readonly WorktreeReference[], now?: number): string; export declare function formatNavigatorRun(loaded: { run: PersistedRun; snapshot: Readonly; }, checkpoints: readonly AwaitingCheckpoint[], worktrees: readonly WorktreeReference[], now?: number): string; export declare function formatWorkflowPhaseDashboard(run: PersistedRun, snapshot: Readonly, width: number, selection?: WorkflowPhaseSelection, styles?: WorkflowProgressStyles, now?: number): string[]; export declare function formatCheckpointReview(checkpoint: AwaitingCheckpoint): string;