import type { AgentConversation, AgentConversationSnapshot, AgentInteractionAcceptance, AgentReconciliation, AgentRun, ApplicationAgentTransport } from './agent-protocol'; export type AgentMutationKind = 'create' | 'send' | 'submit' | 'confirm' | 'cancel-run' | 'cancel-interaction' | 'reconcile' | 'resolve-manually'; export interface AgentPendingMutation { kind: AgentMutationKind; requestId: string; targetId?: string; revision?: number; state: 'pending' | 'unknown'; } export interface AgentConversationState { phase: 'idle' | 'loading' | 'ready' | 'error' | 'disposed'; stream: 'idle' | 'connecting' | 'live' | 'reconnecting' | 'disconnected'; persistence: 'session' | 'memory'; snapshot?: AgentConversationSnapshot; pending?: AgentPendingMutation; /** Acknowledged is admission, never business success. Closed does not attribute the change to this request. */ lastResolution?: { requestId: string; disposition: 'acknowledged' | 'closed'; }; error?: Error; } type RecoveryStorage = Pick; export declare const INITIAL_AGENT_CONVERSATION_STATE: AgentConversationState; /** One UI observer and mutation gate. The server still owns every durable state. */ export declare class AgentConversationController { private readonly transport; readonly agentCode: string; private readonly storage?; private value; private readonly listeners; private readonly lifetime; private streamAbort?; private conversationId?; private writing; private initialized; private resumePromise?; private readonly storageKey; constructor(transport: ApplicationAgentTransport, agentCode: string, storage?: RecoveryStorage | undefined); snapshot: () => AgentConversationState; subscribe: (listener: () => void) => () => void; private update; private assertLive; private persist; /** Mount/reload only reads. It never creates a conversation or replays a write. */ resume(): Promise; private restoreAndRead; /** Explicit history selection is scoped again by the platform, never trusted from storage. */ open(id: string): Promise; newConversation(): Promise; send(text: string): Promise; cancel(runId: string): Promise; submitInteraction(id: string, revision: number, input: Record): Promise; confirm(id: string, revision: number): Promise; cancelInteraction(id: string): Promise; reconcile(id: string): Promise; resolveManually(id: string, outcome: 'executed' | 'not_executed', note: string): Promise; private mutate; /** Read original correlation first. An absent result remains unknown, not permission to resubmit. */ recover(): Promise; private recoverOriginal; refresh(): Promise; private readSnapshot; private resolvePending; private event; private startStream; private observe; dispose(): void; } export {}; //# sourceMappingURL=agent-conversation.d.ts.map