import type { TalkActionRecord, TalkInterruptionRecord, TalkSession, TalkSessionStore, VisualCaptureReceipt } from "./types.js"; /** Three missed 30-second heartbeats. */ export declare const TALK_SESSION_TTL_MS = 90000; /** Far more writes than a spoken conversation produces. The cap is here so a * looping client cannot grow the log without bound, not to bound the audit. */ export declare const TALK_ACTION_LOG_LIMIT = 500; export declare const TALK_INTERRUPTION_LOG_LIMIT = 500; /** Carries the HTTP status the router should answer with, so state rules live * here rather than being re-derived at every route. */ export declare class TalkSessionError extends Error { readonly status: number; constructor(status: number, message: string); } export interface OpenTalkSessionOptions { /** The `sessions` row this talk session bills through. */ sessionId: string; model: string; /** The standing brief this session opens with. */ brief: string; /** Expiry of the credential minted for this open, in provider seconds. */ tokenExpiresAt: number; /** Browser identity supplied outside provider tool arguments. */ browserInstanceId?: string; } export interface TalkTurnResult { contextTokens: number; /** Cumulative over the session, not just this turn. */ truncatedTurns: number; handoffSuggested: boolean; } export declare class TalkSessionRegistry { private readonly store; private readonly now; constructor(now?: () => number, store?: TalkSessionStore); open(options: OpenTalkSessionOptions): TalkSession; get(id: string): TalkSession | undefined; park(id: string): TalkSession; resume(id: string): TalkSession; /** Remember the credential just handed out, so the next one can be required to * outlive it. */ recordToken(id: string, expiresAt: number): void; heartbeat(id: string): TalkSession; /** Append one completed exchange and re-apply the rolling truncation. */ appendTurn(id: string, text: string, budgetTokens?: number, visualReceipts?: readonly VisualCaptureReceipt[]): TalkTurnResult; /** Log one attempted write. The id and timestamp are the registry's to assign * so no caller can name or date its own entry. */ recordAction(id: string, input: Omit): TalkActionRecord; recordInterruption(id: string, input: Omit): TalkInterruptionRecord; /** Idempotent: terminal rows remain stored for normal chat history and audit, * while the public registry no longer exposes them as resumable. */ close(id: string): void; /** Park every live session whose last heartbeat predates the TTL. Returns the * ids parked so the caller can release their provider connections. */ reap(): string[]; private require; } //# sourceMappingURL=registry.d.ts.map