import type { McpConnectionAccountBinding } from "@opengeni/contracts"; import { type Database } from "./database.js"; /** A shared account a prompt runs without, and why. Internal turn metadata only. */ export type LapsedWorkspaceAccountGap = { serverId: string; connectionId: string; reason: "account_not_visible" | "account_inactive" | "account_mismatch"; }; /** * Drop shared workspace accounts that can no longer be used from accounts a * prompt copies instead of resolving afresh: a voice session's accounts (frozen * when voice started, possibly days before its last words are handed off) and * an edited prompt's accounts (frozen when it was first sent). * * The turn fence admits a new turn only while each shared account it carries * is still the same live account. A copied account that was disconnected or * reconnected since would make the fence refuse the whole insert; in a work * claim that refusal rolls back and blocks the chat on every later message. * Running without that connector is what the person's next message would do * anyway, so the prompt keeps every other account and records the gap. * * This only narrows: nothing is added or replaced, personal accounts are left * to their own fence (a lapsed owner account is already accepted without * authority), and the fence still checks everything kept. The checks mirror * `fence_mcp_account_bindings`. */ export declare function withoutLapsedWorkspaceAccountBindings(db: Database, workspaceId: string, bindings: McpConnectionAccountBinding[] | null): Promise<{ bindings: McpConnectionAccountBinding[] | null; gaps: LapsedWorkspaceAccountGap[]; }>;