import { type Span } from '@opentelemetry/api'; import type { PlanManager } from '../../manager/plan/lifecycle.js'; import type { TurnRecorder } from '../../manager/session/turn-recorder.js'; import type { ActivityStore } from '../../store/activity/memory.js'; import type { CheckpointId } from '../../types/hitl/index.js'; import type { SessionEvent, Turn } from '../../types/session/index.js'; import type { Logger } from '../../utils/logger.js'; import type { EmitEvent } from './events.js'; export interface ResultAssemblerConfig { recorder: TurnRecorder; planManager: PlanManager; activityStore: ActivityStore; log: Logger; emitEvent: EmitEvent; drainPending: () => Generator; /** * The state a host should resume from if the turn settles recoverably. * A function rather than a value: checkpoints are written per iteration, * and a turn that fails before its first one may write one on demand. */ resumeCheckpointId?: () => CheckpointId | undefined | Promise; /** * The turn's abort signal, read only to recover WHY a cancellation * happened. Absent means the cause is unknown. */ signal?: AbortSignal; } /** * How a turn ends: the terminal record (`turn_completed` or `turn_failed`), * or `turn_paused` for a recoverable failure, with the audit entry and the * span verdict that go with it. */ export declare class ResultAssembler { private config; constructor(config: ResultAssemblerConfig); completeTurn(rootSpan: Span): AsyncGenerator; handleError(err: unknown, rootSpan: Span): AsyncGenerator; /** * Where a recoverable failure pauses. A checkpoint that cannot be written * leaves the turn to fail with the error it actually had: a pause with * nothing to resume from is a dead end, and the write failure is not what * the caller needs to hear about. */ private resumePoint; /** The durable half of settling: every queued record lands, the ledger is flushed. */ finalize(): Promise; } //# sourceMappingURL=result.d.ts.map