import type { SubagentManager } from "../managers/subagentManager.js"; import { ConcurrencyLimiter } from "./concurrencyLimiter.js"; import { BudgetTracker } from "./budgetTracker.js"; import { ProgressReporter } from "./progressReporter.js"; import { Journal } from "./journal.js"; import type { BudgetInfo } from "./types.js"; interface WorkflowApiContext { subagentManager: SubagentManager; concurrencyLimiter: ConcurrencyLimiter; budgetTracker: BudgetTracker; progressReporter: ProgressReporter; journal: Journal; abortSignal: AbortSignal; args: unknown; onLog?: (message: string) => void; /** When resuming, offset the agent counter by this many existing entries */ initialAgentCount?: number; /** Session directory for computing transcript paths */ sessionDir: string; /** Per-run directory for writing agent metadata sidecars */ runDir: string; /** Per-agent abort controllers for kill/skip support */ agentControllers: Map; } interface AgentOpts { label?: string; phase?: string; schema?: object; model?: string; isolation?: string; agentType?: string; } export interface WorkflowApis { agent: (prompt: string, opts?: AgentOpts) => Promise; parallel: (thunks: Array<() => Promise>) => Promise; pipeline: (items: unknown[], ...stages: Array<(prev: unknown, item: unknown, index: number) => Promise>) => Promise; phase: (title: string) => void; log: (message: string) => void; args: unknown; budget: BudgetInfo; } export declare function createWorkflowApis(ctx: WorkflowApiContext): WorkflowApis; export {};