import { type NextStepDirective, type PauseUntilSignalDirective } from '@sapiom/agent'; import type { StepDispatchRequest, StepDispatcher } from './dispatch.js'; import type { ExecutionState, StepRow } from './execution-state.js'; import type { AgentRunnerCore } from './runner-core.js'; import type { ExecutionStore, StartExecutionArgs } from './stores.js'; export declare function resetIdCounter(): void; export declare class InMemoryExecutionStore implements ExecutionStore { private readonly executions; private readonly steps; private readonly stepsById; private readonly maxStepOrder; getExecution(executionId: string): ExecutionState | undefined; allExecutions(): ExecutionState[]; startExecution(args: StartExecutionArgs): Promise; loadExecution(executionId: string): Promise; prepareResume(args: { executionId: string; fromStepName: string; fromStepInput: unknown; }): Promise; nextStepOrder(executionId: string): Promise; startStep(args: { executionId: string; stepName: string; stepOrder: number; attempt: number; input: unknown; status: 'dispatched' | 'running'; }): Promise; findStepRow(executionId: string, stepOrder: number, attempt: number): Promise; findStepRowById(stepRowId: string): Promise; completeStep(args: { stepRowId: string; output: unknown; nextDirective: NextStepDirective; sharedStateAfter: Record; logs?: unknown; }): Promise; failStep(args: { stepRowId: string; error: unknown; sharedStateAfter: Record; logs?: unknown; }): Promise; failActiveDispatchedStep(args: { executionId: string; expectedVersion: number; stepRowId: string; error: unknown; sharedState: Record; logs?: unknown; }): Promise; markStepDispatched(args: { executionId: string; expectedVersion: number; stepRowId: string; deadlineAt: Date; }): Promise; transitionToStep(args: { executionId: string; expectedVersion: number; nextStep: string; nextStepInput: unknown; sharedState: Record; }): Promise; retainStepForRetry(args: { executionId: string; expectedVersion: number; sharedState: Record; }): Promise; pauseExecution(args: { executionId: string; expectedVersion: number; directive: PauseUntilSignalDirective; sharedState: Record; }): Promise; completeExecution(args: { executionId: string; expectedVersion: number; output: unknown; sharedState: Record; }): Promise; failExecution(args: { executionId: string; expectedVersion: number; error: unknown; output?: unknown; sharedState: Record; }): Promise; } export declare class SyncInProcessDispatcher implements StepDispatcher { private bodies; private core; private maxAttemptsPerStep; setCore(core: AgentRunnerCore): void; setMaxAttempts(max: number): void; setSyncBody(stepName: string, body: (input: unknown) => Promise<{ output: unknown; directive: NextStepDirective; }>): void; dispatch(request: StepDispatchRequest): Promise; }