/** * Host-neutral adapter for the complete v3 Node runtime. * * The action realization remains single-sourced in shared-node-runtime.ts; * this adapter only translates execution profiles and agent calls. */ import type { ValidateManifest } from './artifact-contract.js'; import { type V3Dag } from './dag.js'; import type { PortableWorkflowFinalOutput } from './portable-final-outputs.js'; import type { AgentExecutor, AttemptLeaseProvider, ExecutionContextSnapshot, ExecutionProfileSnapshot, GateResolver, HostExecutorRegistry, HostExecutorPolicy, ProviderReconciler } from './runtime-host-contract.js'; export interface PortableWorkflowPendingGate { nodeId: string; waitId: string; prompt: string; options: string[]; approveOptions: string[]; approvers: string[]; hostApproval?: { attemptId: string; approvalDigest: string; inputHash: string; }; } export { readPortableWorkflowFinalOutputs, } from './portable-final-outputs.js'; export type { PortableWorkflowFinalOutput, } from './portable-final-outputs.js'; export type PortableWorkflowRunOutcome = { reason: 'terminal'; runStatus: 'succeeded' | 'failed' | 'blocked' | 'cancelled'; failedNodeId?: string; blockedNodeId?: string; failureReason?: 'allSinksSkipped'; failureDetail?: string; uncertainHostEffects?: Array<{ nodeId: string; instanceId: string; attemptId: string; executor: string; errorCode: string; }>; finalOutputs: PortableWorkflowFinalOutput[]; runDir: string; } | { reason: 'awaitingGate'; pendingWaits: PortableWorkflowPendingGate[]; runDir: string; }; export interface PortableWorkflowRuntimeDeps { executeAgent: AgentExecutor; validateManifest: ValidateManifest; resolveExecutionProfile: (selector: string | undefined) => ExecutionProfileSnapshot; validateExecutionProfile?: (profile: ExecutionProfileSnapshot, selector: string) => void; /** * Optional only for fresh process-local runs. The default provider cannot * prove old attempts closed after recovery and therefore returns `unknown`. * Desktop and other durable hosts must inject a durable provider. */ attemptLeaseProvider?: AttemptLeaseProvider; hostExecutors?: HostExecutorRegistry; hostReconcilers?: Map; hostExecutorPolicy?: HostExecutorPolicy; now?: () => number; resolveGate?: GateResolver; } export interface PortableWorkflowRuntimeOptions { /** * Durable run root. Reusing the same baseDir + dag.runId formally resumes * the existing journal and does not redispatch settled nodes. */ baseDir: string; gateMode?: 'blocking' | 'suspend'; globalConcurrency?: number; frozenExecutionProfiles?: ReadonlyMap; perProfileConcurrency?: number; perExecutorConcurrency?: number; cancelSignal?: AbortSignal; authorizedArtifacts?: boolean; executionContext?: ExecutionContextSnapshot; /** @deprecated Use `executionContext`. */ resolvedWorkflowData?: ExecutionContextSnapshot; hostResponseWaitMs?: number; } export declare function runPortableWorkflow(dag: V3Dag, deps: PortableWorkflowRuntimeDeps, options: PortableWorkflowRuntimeOptions): Promise; //# sourceMappingURL=portable-runtime.d.ts.map