import type { Agent } from "../../agent/types.js"; import type { Tool } from "../../tool/types.js"; import type { CapturedTenantContext, NodeState, WorkflowContext, WorkflowNode } from "../types.js"; import type { BlobStorage } from "../blob/types.js"; /** * Get the current workflow tenant context. * Returns undefined if not executing within a workflow step. * * This is used by context-aware framework utilities (e.g., the api module) * to automatically access project-scoped resources. */ export declare function getWorkflowTenant(): CapturedTenantContext | undefined; /** * Run a function with workflow tenant context available via AsyncLocalStorage. * If tenant is undefined, preserves any existing outer context. */ export declare function runWithWorkflowTenant(tenant: CapturedTenantContext | undefined, fn: () => Promise): Promise; export interface AgentRegistry { get(id: string): Agent | undefined; list?(): string[]; } export interface ToolRegistry { get(id: string): Tool | undefined; list?(): string[]; } export interface StepExecutorConfig { agentRegistry?: AgentRegistry; toolRegistry?: ToolRegistry; defaultTimeout?: number; /** Max milliseconds to wait for an aborted step to settle before detaching it (default: 1000) */ cancellationGracePeriod?: number; blobStorage?: BlobStorage; /** * Step lifecycle hooks. `runId` scopes the event to one run: without it a * progress channel built on these hooks is process-global and two concurrent * runs interleave with no way to tell them apart. It is optional because a * StepExecutor can be driven outside a run (tests, ad-hoc execution). */ onStepStart?: (nodeId: string, input: unknown, runId?: string) => void; onStepComplete?: (nodeId: string, output: unknown, runId?: string) => void; onStepError?: (nodeId: string, error: Error, runId?: string) => void; } export interface StepResult { success: boolean; output?: unknown; error?: string; executionTime: number; } export declare class StepExecutor { private config; private nonCooperativeErrors; constructor(config?: StepExecutorConfig); execute(node: WorkflowNode, context: WorkflowContext, abortSignal?: AbortSignal, runId?: string): Promise; /** Shared transient classification (HTTP statuses + network error codes) via retry-policy. */ private isRetryableError; private resolveInput; private executeWithTimeout; private waitForCancellationGrace; private executeStep; private executeAgent; private executeTool; private formatAvailableItems; private resolveFromRegistry; private getAgent; private getTool; shouldSkip(node: WorkflowNode, context: WorkflowContext): Promise; createInitialState(nodeId: string): NodeState; createRunningState(nodeId: string, input: unknown, attempt: number): NodeState; createCompletedState(result: StepResult, previousState: NodeState): NodeState; createSkippedState(nodeId: string): NodeState; } //# sourceMappingURL=step-executor.d.ts.map