import type { Database } from "./database.js"; /** * Approving a call that runs on someone's own (Only me) connection is that * person's decision. Anyone who can control the chat may still decline it. * * The executing account is frozen on the turn when its message was accepted, * so an approval never changes whose account runs the call: without this rule * any member or workspace key could make an action happen as another person. */ export declare class SessionApprovalForbiddenError extends Error { readonly owner: PendingApprovalAccountOwner; readonly name = "SessionApprovalForbiddenError"; readonly code = "APPROVAL_REQUIRES_ACCOUNT_OWNER"; constructor(owner: PendingApprovalAccountOwner); } /** The person who alone may approve an action, and their name when known. */ export type PendingApprovalAccountOwner = { subjectId: string; label: string | null; }; /** * The owner's name as frozen on the turn. A personal account only runs for its * own sender's message, so the sender's label names the owner. Only a * person's own label is used: a bridge or key label never names the owner. */ export declare function accountOwnerLabelForTurn(owner: string, turn: { initiatorKind: string; initiatorSubjectId: string; initiatorContext: unknown; }): string | null; /** * The owner of `connectionId` when the turn uses it as someone's personal * account; null for a shared (workspace) connection. Reads the turn's frozen * account bindings and, for turns from before bindings, its personal * delegations; a personal row only executes through one of these. */ export declare function personalConnectionOwnerForTurn(input: { connectionId: string; mcpAccountBindings: unknown; personalConnectionDelegations: unknown; }): string | null; /** * The person who alone may approve this pending action, or null when anyone * who can control the chat may: actions on shared connections and actions * without a connection (Opengeni's own tools keep their own rules). */ export declare function pendingApprovalAccountOwner(db: Database, input: { workspaceId: string; sessionId: string; turnId: string; approvalId: string; }): Promise;