import type { ConnectionCheckpoint, ConnectionNeed, ConnectionWait } from '@xopcai/gateway-contract'; import { type SessionInput } from './session-input-repository.js'; export declare function onConnectionWaitChanged(listener: (conversationId: string) => void): () => void; export declare function publishConnectionWait(conversationId: string): void; export declare function getConnectionWait(id: string): ConnectionWait | undefined; export declare function getActiveConnectionWait(conversationId: string): ConnectionWait | undefined; export declare function isConnectionSuspended(conversationId: string, runId: string): boolean; export declare function updateConnectionWait(wait: ConnectionWait, expectedVersion: number): ConnectionWait; export declare function requireSessionConnection(input: { conversationId: string; principalId: string; agentId: string; summary: string; needs: ConnectionNeed[]; checkpoint?: Omit; origin?: { inputId: string; runId: string; }; }): { status: 'connection_required' | 'skipped' | 'objective_conflict'; waitId?: string; }; /** Pending messages may revise the goal; controls cannot become a competing model execution. */ export declare function interruptedConnectionMessage(wait: ConnectionWait): SessionInput | undefined; export declare function hasPendingConnectionMessages(wait: ConnectionWait, includeControls?: boolean): boolean; /** The input and the wait transition commit together, using the existing queue's unique key. */ export declare function queueConnectionResolution(wait: ConnectionWait, resolution: 'continued' | 'skipped'): ConnectionWait; export declare function consumeConnectionResume(input: SessionInput): boolean; export declare function connectionBindings(conversationId: string): ConnectionNeed[]; /** Changes to the objective or transcript invalidate an outstanding action approval. */ export declare function connectorObjectiveScope(conversationId: string): string | undefined; export declare function bindObjectiveAccount(conversationId: string, connectorId: string, accountId: string): void; export declare function connectionBinding(conversationId: string, connectorId: string): string | undefined; /** Explicit objective changes invalidate an outstanding auto-resume intent. */ export declare function invalidateConnectionResumeIntent(conversationId: string): void; export declare function reviseCurrentConnectionObjective(conversationId: string, summary: string | undefined): void; export declare function cancelConnectionObjective(conversationId: string, expectedWaitId?: string, expectedObjectiveRevision?: number): void; export declare function getConnectionResumeInput(conversationId: string, runId: string): SessionInput | undefined; export declare function listConnectionWaitsToCheck(): ConnectionWait[]; /** A queued wait has not crossed consumeConnectionResume's execution boundary. */ export declare function reconcileConnectionWaits(afterRestart?: boolean): string[];