import type { Sapiom } from '@sapiom/tools'; import type { NextStepDirective } from './directives.js'; export interface StepLogger { info(message: string, meta?: Record): void; warn(message: string, meta?: Record): void; error(message: string, meta?: Record): void; debug(message: string, meta?: Record): void; } export type FinishedStepStatus = 'dispatched' | 'succeeded' | 'failed'; export interface OrchestrationExecutionContext = Record> { readonly executionId: string; readonly workflowName: string; readonly organizationId: string | null; readonly tenantId: string | null; readonly input: unknown; readonly shared: TypedContextStore; readonly history: readonly StepExecutionRecord[]; readonly attempts: number; readonly logger: StepLogger; readonly sapiom: Sapiom; } export interface TypedContextStore> { get(key: K): TShared[K] | undefined; set(key: K, value: TShared[K]): void; has(key: K): boolean; snapshot(): Partial; } export interface StepExecutionRecord { readonly stepName: string; readonly attempt: number; readonly status: FinishedStepStatus; readonly input: unknown; readonly output: unknown; readonly error: unknown; readonly nextDirective: NextStepDirective | null; readonly sharedStateAfter: Record | null; readonly startedAt: Date; readonly finishedAt: Date; } export declare class InMemoryContextStore> implements TypedContextStore { private state; constructor(initial?: Partial); get(key: K): TShared[K] | undefined; set(key: K, value: TShared[K]): void; has(key: K): boolean; snapshot(): Partial; }