import { type ExtensionUIContext, type ExtensionAPI } from "@earendil-works/pi-coding-agent"; import { RunStore, type PersistedRun } from "./persistence.js"; import { type WorkflowRegistryApi } from "./registry.js"; import { type WorkflowRecoveryContext, type createWorkflowRecovery } from "./host-recovery.js"; import { type WorkflowRunRecord } from "./host-runtime.js"; import { type TrajectoryPublisherProvider } from "./trajectory-host-handle.js"; import { type HardTerminalRunState, type JsonValue, type LaunchSnapshot, type LiveSessionHandoff, type PreparedAgentSession, type WorkflowAgentSession } from "./types.js"; type UiSelect = (title: string, options: string[]) => Promise; type UiInput = (title: string, placeholder?: string) => Promise; type UiSetStatus = (key: string, text?: string) => void; type UiCustom = ExtensionUIContext["custom"]; type NavigatorStoredRun = { store: RunStore; loaded: { run: PersistedRun; snapshot: Readonly; }; resolvedAt: number | undefined; }; type NavigatorRunDependencies = ReadonlyMap; type ManualDeletionPlan = { ordered: readonly NavigatorStoredRun[]; skipped: readonly { entry: NavigatorStoredRun; dependentIds: readonly string[]; }[]; }; export declare function manualDeletionPlan(entries: readonly NavigatorStoredRun[], state: "completed" | "failed", dependencies: NavigatorRunDependencies): ManualDeletionPlan; export type UiHostCapabilities = { select?: UiSelect; input?: UiInput; setStatus?: UiSetStatus; custom?: UiCustom; }; type ReportBlocked = (active: boolean, label?: string) => void; export declare function uiHostCapabilities(ui: unknown): UiHostCapabilities | undefined; export type WorkflowNavigatorDependencies = { pi: Pick; home: string | undefined; clipboard: (value: string) => Promise; extensionAgentDir: string; runs: Map; terminalRunStates: Map; hardTerminalRunStates: ReadonlySet; ensureSessionLease: (cwd: string, sessionId: string) => Promise; answerCheckpoint: (runId: string, name: string, approved: boolean, silent?: boolean) => Promise; recovery: ReturnType; stopWorkflowRun: (runId: string) => Promise<{ runId: string; state: string; stopped: boolean; reason?: "unknown_run" | "already_terminal"; }>; moveForegroundToBackground: (runId: string) => Promise<{ runId: string; state: "running"; detached: true; }>; isForegroundAttached: (runId: string) => boolean; liveAgents: { get(runId: string, agentId: string): Readonly<{ session?: WorkflowAgentSession; prepared?: Readonly; handoff?: LiveSessionHandoff; }> | undefined; overlay(run: PersistedRun): PersistedRun; }; registry: WorkflowRegistryApi; projectTrusted: (context: unknown) => boolean; resumeHostContext: (context: unknown) => WorkflowRecoveryContext; resumeSelectedWorkflow: (runId: string, foreground: boolean, context: unknown, budgetPatch?: unknown) => Promise<{ workflowName: string; state: "running" | "completed" | "awaiting_approval"; attached: boolean; value?: JsonValue; }>; reportBlocked?: ReportBlocked; setNavigatorOpen?: (open: boolean) => void; trajectoryProvider: TrajectoryPublisherProvider; coordinateRunMutation?: (task: () => Promise) => Promise; }; export declare function registerWorkflowNavigator(deps: WorkflowNavigatorDependencies): void; export {};