import { Type } from "@earendil-works/pi-ai"; import { copyToClipboard, type ExtensionAPI } from "@earendil-works/pi-coding-agent"; import { type BackgroundWidgetAPI } from "./background-widget.js"; import { type AgentTransport } from "./types.js"; export type WorkflowExtensionAPI = Pick & Pick; export { agentBreadcrumb, agentBreadcrumbParts, formatBudgetStatus, formatNavigatorDashboard, formatNavigatorRun, formatStalledDuration, formatWorkflowPhaseDashboard, formatWorkflowProgress, navigatorAttentionSort, truncateWorkflowProgress, } from "./host-view.js"; export { buildWorkflowPhaseModel, buildWorkflowPhaseTree, navigateWorkflowPhaseTree, preserveWorkflowPhaseSelection, preserveWorkflowPhaseTreeSelection, workflowPhaseTreeInitialExpanded, workflowPhaseTreeVisibleNodes } from "./host-phases.js"; export type { WorkflowPhaseAgentCounts, WorkflowPhaseModel, WorkflowPhaseSelection, WorkflowPhaseState, WorkflowPhaseTree, WorkflowPhaseTreeDirection, WorkflowPhaseTreeNode, WorkflowPhaseTreeNodeKind, WorkflowPhaseTreeSelection, WorkflowPhaseView, } from "./host-phases.js"; export type { WorkflowProgressStyles } from "./host-view.js"; export { formatWorkflowFailure, formatWorkflowFailureDelivery, formatWorkflowFailureDiagnostics } from "./host-delivery.js"; export { RunLifecycle } from "./host-runtime.js"; export declare function formatWorkflowPreview(args: { script?: unknown; scriptPath?: unknown; name?: unknown; description?: unknown; }): string; export declare const WORKFLOW_TOOL_LABEL = "Workflow"; export declare const WORKFLOW_TOOL_DESCRIPTION = "Run a deterministic JavaScript workflow with a named inline or file-backed parallel-to-summary path by default"; export declare const WORKFLOW_TOOL_PROMPT_SNIPPET = "Run a deterministic, resumable JavaScript workflow. Prefer a named inline script that fans out independent work with parallel(...), awaits the keyed results before interpolating them into one summarizing agent(...), and returns. Provide exactly one of script or scriptPath and a non-empty name. Registered catalog functions are available as globals inside the script; call them there, for example return await someFunction(args). Advanced controls include registered functions, outputSchema, budgets, checkpoints, worktrees, retry/resume, CLI export, and pipelines. Runs are in the background by default; completion arrives as a follow-up message. Set foreground: true when the caller must wait for the final value. Manage runs from the interactive /workflow picker; use workflow_status, workflow_resume, workflow_retry, workflow_stop, and workflow_respond for explicit tool controls. If a foreground call detaches before its result is accepted, its terminal success or failure is promoted to one follow-up message. Foreground results include the completed run ID. Recovery inherits the source launch mode; legacy snapshots without launchMode recover in the background. Set foreground: true or false on workflow_resume/workflow_retry to override it; foreground recovery waits for terminal value and run details, while background recovery returns immediately and delivers completion or failure as a follow-up. After failure follow-ups, especially CANCELLED or interrupted runs, call workflow_status({ runId }) before recovery or replacement work, then pass its state as expectedState to workflow_retry/workflow_resume so recovery cannot act on a state that changed. Recovery map: agent(..., { retries }) reruns one agent call in the same run for transient failures; workflow_retry({ runId, expectedState?, foreground? }) replays a failed run into a child; workflow_resume({ runId, expectedState?, budget?, foreground? }) continues a budget_exhausted run; parentRunId on a new launch only borrows named worktrees and never replays or resumes."; export declare const WORKFLOW_TOOL_PARAMETERS: Type.TObject<{ name: Type.TString; description: Type.TOptional; script: Type.TOptional; scriptPath: Type.TOptional; args: Type.TOptional; foreground: Type.TOptional; concurrency: Type.TOptional; budget: Type.TOptional; parentRunId: Type.TOptional; }>; export declare const WORKFLOW_STATUS_PARAMETERS: Type.TObject<{ runId: Type.TString; }>; export declare const WORKFLOW_RETRY_PARAMETERS: Type.TObject<{ runId: Type.TString; expectedState: Type.TOptional; foreground: Type.TOptional; }>; export default function workflowExtension(pi: WorkflowExtensionAPI, home?: string, clipboard?: typeof copyToClipboard, transport?: AgentTransport, agentDir?: string, additionalSkillPaths?: readonly string[]): void;