import type { AgentSessionInternalSurface as AgentSession } from "./agent-session-methods.ts"; import type { DrainedAgentQueues } from "./agent-session-types.js"; import type { PendingRecoveryDelivery } from "./extensions/index.js"; import type { CustomMessage } from "./messages.ts"; type ProtectedDelivery = "steer" | "followUp"; type ProtectedPhase = "queued" | "consumed-unpersisted" | "persistence-failed"; export declare const PROTECTED_RECONCILIATION_CUSTOM_TYPE = "atomic:protected-streaming-reconciliation"; export interface ProtectedStreamingCustomMessage { message: CustomMessage; delivery: ProtectedDelivery; phase: ProtectedPhase; } /** Durable card intents with neither a persisted hidden completion nor a scheduled one. */ export declare function pendingProtectedStreamingCustomMessages(session: AgentSession): PendingRecoveryDelivery[]; /** Requeue the hidden model-facing turn of each recovered durable card. */ export declare function recoverProtectedStreamingCustomMessages(session: AgentSession, pending: readonly PendingRecoveryDelivery[]): number; /** Close a recovered card without a model turn, so later resumes never offer it again. */ export declare function dismissProtectedStreamingCustomMessage(session: AgentSession, pending: PendingRecoveryDelivery): Promise; /** Persist one visible card and register its hidden model-facing turn. */ export declare function admitProtectedStreamingCustomMessage(session: AgentSession, message: CustomMessage, delivery: ProtectedDelivery): Promise; /** Queue one hidden turn before public listeners can transfer its ownership. */ export declare function queueProtectedStreamingCustomMessage(session: AgentSession, message: CustomMessage, delivery: ProtectedDelivery, priority?: boolean): Promise; /** Queue a whole hidden batch before public listeners can transfer ownership. */ export declare function queueProtectedStreamingCustomMessages(session: AgentSession, messages: CustomMessage[], delivery: ProtectedDelivery): Promise; /** Start or queue an idle protected batch before exposing its display cards. */ export declare function triggerProtectedStreamingCustomMessages(session: AgentSession, messages: CustomMessage[], delivery: ProtectedDelivery): Promise; /** Record that agent-core drained and consumed the hidden reconciliation. */ export declare function markProtectedStreamingCustomMessageConsumed(session: AgentSession, message: CustomMessage): boolean; export declare function markProtectedStreamingCustomMessagePersistenceFailed(session: AgentSession, message: CustomMessage): void; export declare function isProtectedStreamingCustomMessage(session: AgentSession, message: CustomMessage): boolean; /** * Persist a consumed hidden reconciliation exactly once. Its visible card was * already committed at admission, so a transient failure never re-adds a card * or re-injects another provider message. */ export declare function persistProtectedStreamingCustomMessage(session: AgentSession, message: CustomMessage): Promise; /** Retry only hidden reconciliation persistence; never queue another alias. */ export declare function retryConsumedProtectedStreamingCustomMessages(session: AgentSession): Promise; /** Flush consumed reconciliations before session state can be discarded. */ export declare function flushConsumedProtectedStreamingCustomMessages(session: AgentSession): Promise; /** * Persist only reconciliation input already sealed inside an accepted pause * hold. Other queued input can still race an active protocol turn and must keep * the historical fail-closed disposal behavior. */ export declare function prepareProtectedStreamingCustomMessagesForDisposal(session: AgentSession): Promise; /** Restore only protected references actually removed from native queues/hold. */ export declare function restoreProtectedStreamingCustomMessages(session: AgentSession, removed: DrainedAgentQueues): void; /** Move protection only for message references that transfer with native queues. */ export declare function transferProtectedStreamingCustomMessages(source: AgentSession, target: AgentSession, transferred: DrainedAgentQueues): void; export {}; //# sourceMappingURL=agent-session-persistent-custom-messages.d.ts.map