import { type NextStepDirective, type AgentDefinition } from "@sapiom/agent"; import { type StepDispatcher, type StepDispatchRequest, type AgentRunnerCore } from "@sapiom/agent-runtime"; import { type StubCallRecord } from "@sapiom/tools/stub"; import type { StubFile } from "./stubs.js"; export interface LogEntry { level: "info" | "warn" | "error" | "debug"; msg: string; meta?: Record; } export interface LocalStepTrace { step: string; attempt: number; input: unknown; status: "running" | "succeeded" | "threw"; startedAt?: string; finishedAt?: string; output?: unknown; directive?: NextStepDirective; sharedStateAfter?: Record; error?: { name: string; message: string; stack?: string; }; logs: LogEntry[]; calls?: StubCallRecord[]; } export type LocalStepTracePhase = "started" | "settled"; export type LocalStepTraceSink = (phase: LocalStepTracePhase, trace: LocalStepTrace) => void; export declare class LocalStubDispatcher implements StepDispatcher { private readonly definition; private readonly stubs; private readonly traceSink?; private core; private maxAttemptsPerStep; private signals; readonly trace: LocalStepTrace[]; readonly usedKeysByStep: Map>; readonly stubWarnings: Set; constructor(definition: AgentDefinition, stubs: StubFile, traceSink?: LocalStepTraceSink | undefined); private emit; setCore(core: AgentRunnerCore): void; setMaxAttempts(max: number): void; setSignals(signals: Map): void; dispatch(request: StepDispatchRequest): Promise; }