import { McpServerConnectionRef, RotateSessionMcpCredentialsReceipt } from "@opengeni/contracts"; import { type Database } from "./database.js"; export { connectionMetadataMatchesBinding } from "./connection-token-resolver.js"; export declare class SessionMcpCredentialRotationError extends Error { readonly code: "invalid_request" | "not_found" | "not_quiescent" | "version_conflict" | "destination_conflict" | "brokered_server" | "connection_unavailable" | "operation_reuse" | "receipt_key_unavailable" | "authority_revoked"; constructor(code: "invalid_request" | "not_found" | "not_quiescent" | "version_conflict" | "destination_conflict" | "brokered_server" | "connection_unavailable" | "operation_reuse" | "receipt_key_unavailable" | "authority_revoked"); } export type AtomicSessionMcpCredentialRotationInput = { accountId: string; workspaceId: string; sessionId: string; subjectId: string; actorType: "human" | "service"; operationKey: string; requestDigest: string; digestKeyTag: string; updates: Array<{ id: string; expectedCredentialVersion: number; expectedServerUrl: string; } & ({ headersEncrypted: Record; } | { nativeConnectionId: string; replacementServerUrl?: string | undefined; })>; /** Resolve an exact native connection using this authenticated transaction. * Called only for a fresh, quiescent and CAS-valid operation. */ resolveNativeConnection?: (tx: Database, server: { url: string; connectionRef: McpServerConnectionRef | null; }, connectionId: string, replacementServerUrl?: string) => Promise; /** Trusted request authorizer, mandatory even for a committed receipt replay. * Revalidate the original authenticated subject and permissions on this tx. */ authorize: (tx: Database) => Promise; }; /** Existing command receipts own durable idempotency; this is not a new queue * command. No session/event/history/attempt/control/wake rows are mutated. */ export declare function rotateSessionMcpCredentialsAtomically(db: Database, input: AtomicSessionMcpCredentialRotationInput): Promise;