import { ActionNode, DeadLetterEntry, ExecutionCheckpoint, Plan, PlanExecution } from "./plan-types.mjs"; import { PlanScheduler } from "./plan-scheduler.mjs"; //#region extensions/crypto/src/services/plan-executor.d.ts interface ToolDispatcher { /** * Call a tool by name with the given params. * Returns the tool result (the `details` field from jsonResult/errorResult). * Throws on tool-level errors. * @param userId — passed through so tools can enforce per-user gates (readonly, evolution). */ call(toolName: string, params: Record, userId?: string): Promise; /** * Check if a tool exists. */ exists(toolName: string): boolean; } type ConfirmationCallback = (step: ActionNode, resolvedParams: Record, userId: string) => Promise; declare class PlanExecutor { private dispatcher; private scheduler; private confirmCallback?; private deadLetterCallback?; private activeContexts; constructor(opts: { dispatcher: ToolDispatcher; scheduler: PlanScheduler; onConfirmRequired?: ConfirmationCallback; onDeadLetter?: (entry: DeadLetterEntry) => void; }); /** * Execute a plan. Returns the execution record. * For scheduled plans, this is called when the scheduler fires a trigger. */ execute(plan: Plan, executionId: string): Promise; /** * Cancel a running execution. */ cancel(executionId: string): boolean; /** * Get the number of currently running executions. */ get activeCount(): number; private writeCheckpoint; private deleteCheckpoint; /** * Resume an execution from a persisted checkpoint. * Returns the execution record, or null if checkpoint not found. */ resumeFromCheckpoint(plan: Plan, executionId: string): Promise; /** * Get all pending checkpoints (for resume-on-startup). */ getPendingCheckpoints(): ExecutionCheckpoint[]; /** Find a node by ID in the plan tree. */ private findNode; private executeNode; private executeAction; private executeSequence; private executeParallel; private executeIf; private executeWait; private executeLoop; private evaluateCondition; private resolveConditionValue; private compare; private resolveParams; private resolveValue; private writeDeadLetter; private handleFailure; /** Wait for a duration, checking for cancellation periodically. */ private waitDuration; } declare class ExecutionCancelledError extends Error { constructor(); } declare class StepFailedError extends Error { readonly stepId: string; constructor(stepId: string, message: string); } declare function formatExecutionSummary(exec: PlanExecution, plan: Plan): string; //#endregion export { ConfirmationCallback, ExecutionCancelledError, PlanExecutor, StepFailedError, ToolDispatcher, formatExecutionSummary }; //# sourceMappingURL=plan-executor.d.mts.map