/** * Recover a detached Sandbox turn from its durable completed records. * * A fast detached run can finish before the live event subscriber receives * every message-part event. The Sandbox still retains two exact records: a * turn-id keyed result cache and the completed assistant message on the * session. This adapter joins them without guessing across turns, then returns * the same `DetachedTurnFinal` shape `runDetachedTurn` already consumes. */ import type { SandboxInstance } from '@tangle-network/sandbox'; import type { DetachedTurnFinal } from './detached-turn'; /** The official Sandbox methods needed for completed-turn recovery. */ export type CompletedSandboxTurnSource = Pick; /** Options for resolving one exact detached turn. */ export interface ReadCompletedSandboxTurnOptions { turnId: string; sessionId: string; log?: (message: string, meta?: Record) => void; } /** * Read the exact completed turn. The session-level result is consulted only * when the matching completed assistant message is still the latest message; * otherwise that result could belong to a newer turn on the same session. */ export declare function readCompletedSandboxTurn(box: CompletedSandboxTurnSource, options: ReadCompletedSandboxTurnOptions): Promise;