import { type TimelineItem } from "../../timeline/index.js"; import { type ProviderRecoveryFacts } from "../../lib/provider-recovery.js"; import type { Session, SessionEvent, SessionStatus } from "../types.js"; export declare function isTerminalSessionStatus(value: SessionStatus): boolean; /** * The console's timeline projection over exact session events. Falls back to * the session's initial message while the event log is still empty. */ export declare function projectSessionTimeline(session: Session, events: SessionEvent[], creationClientEventId?: string, projectedItems?: TimelineItem[]): TimelineItem[]; export type SessionFailureSummary = { /** Human-readable reason from the latest recorded failure boundary, if any. */ reason: string | null; safetyRefusal?: boolean | undefined; /** When the most recent failure happened. */ failedAt: string | null; /** Exact durable event identity; independent of history hydration or clock precision. */ failureEventId?: string | null | undefined; /** Final consecutive automatic-recovery streak, not total recoveries in a turn or session. */ consecutiveRecoveryCount: number | null; detailsTruncated?: boolean | undefined; /** Typed sandbox evidence suppresses generic execution/model remedies, never grants recovery. */ structuralSandboxFailure?: boolean | undefined; /** Exact recorded provider/engine text, before any humanizing. Shown only behind a details toggle. */ recordedDetail?: string | null | undefined; /** Recorded failure code, when the worker classified the failure. */ failureCode?: string | null | undefined; /** Closed exhausted-provider-quota marker (`daily`, `monthly`, `credits`, `quota`). */ quotaScope?: string | null | undefined; /** Spent automatic same-turn recovery: the affected model/provider and condition. */ providerRecovery?: ProviderRecoveryFacts | undefined; }; /** * Failure honesty for the session header/banner: the latest failure reason * and the final consecutive retry streak when explicitly recorded by the worker. */ export declare function summarizeSessionFailure(events: SessionEvent[], sessionStatus: SessionStatus, diagnostics?: Session["failureDiagnostics"], diagnosticsThrough?: number): SessionFailureSummary; export declare function reasoningSummaryText(payload: unknown): string; export declare function failurePayloadMessage(payload: Record): string | undefined; /** * The display label for an event, preferring a named-operation label over the * generic event-type one (so `sandbox.provision` reads "Starting sandbox" rather * than "Sandbox operation started"). Falls back to {@link eventLabel}. */ export declare function eventDisplayLabel(event: SessionEvent): string; /** * Whether a lazy sandbox provision is in flight on this event stream: the latest * `sandbox.provision` operation event is a `.started` not yet closed by a * `.completed`/`.failed`. Drives the workbench "Starting sandbox…" affordance and * the renegotiate-on-settle that picks the freshly-warm box back up. */ export declare function sandboxProvisionInFlight(events: SessionEvent[]): boolean; export declare function eventLabel(type: string): string;