import { PendingWrite } from './pendingWrite'; import { AssistantProgressOptions } from './progress'; import { AssistantRawMessage } from './types'; /** What one poll of the sandbox says this turn has produced so far. */ export interface AssistantTurnProgress { /** * The model's output so far — text, media markdown and tool progress lines — * and NOTHING else. Empty until something renderable arrives. */ content: string; /** * ★★ Whether `content` holds anything to show, as an explicit field. * * This used to be signalled by a SENTINEL: `content` came back as * "Thinking..." when nothing had arrived, and callers compared strings to find * out. The sentinel then leaked wherever that comparison was skipped — a turn * whose stream budget elapsed stored "Thinking..." in front of its timeout * note. A boolean cannot be mistaken for output (BOFF-7277). */ hasRenderableOutput: boolean; done: boolean; tokens?: { input: number; output: number; }; /** * Identity + model of the message these tokens came from, needed to charge the * turn: `messageId` is half the server's idempotency hash and `model` selects the * per-token prices. Read from the SAME message as `tokens`, never guessed from * the tail of `messages` — on a session with trailing history that is a different * message, and mis-attributing a charge is worse than missing one. */ messageId?: string; model?: string; /** A write the sandbox refused pending approval, if this turn produced one. */ pendingWrite?: PendingWrite; } /** * Reduce one poll's session messages to this turn's progress. * * `priorNewestCreatedMs` is the `created` timestamp (sandbox clock) of the newest * message that already existed in this session BEFORE the prompt was sent. This * turn's reply is the assistant message created strictly after it. Crucially this * stays WITHIN the sandbox clock domain: an earlier version compared the * sandbox-stamped `created` against the browser wall-clock (Date#now), so a reply * stamped at prompt-time was silently dropped whenever the sandbox clock lagged * the browser — the turn then hung until the stream budget elapsed. A * sandbox-domain floor is immune to clock skew and correct for both fresh and * reused (per-conversation) sessions, with no message-window gap. */ export declare function buildAssistantProgress(messages: AssistantRawMessage[], priorNewestCreatedMs: number, options?: AssistantProgressOptions): AssistantTurnProgress; //# sourceMappingURL=turnProgress.d.ts.map