import { type Database } from "./database.js"; /** Structural V2 correlation scope. This is deliberately NOT an actor/grant. */ export type ModalNativeLiveOriginScope = Readonly<{ version: 2; declarationId: string; planId: string; creatorId: string; accountId: string; workspaceId: string; sessionId: string; turnId: string; attemptId: string; executionGeneration: number; triggerEventId: string; sandboxGroupId: string; routeKind: "home"; routeTargetId: null; routeEpoch: number; }>; export type ModalNativeLiveOriginProjection = Readonly<{ version: 1; scope: ModalNativeLiveOriginScope; initiator: { kind: "subject" | "service"; subjectId: string; initiatingHumanSubjectId: string; }; membership: { id: string; authorizationRevision: string; basis: "workspace_membership" | "personal_workspace"; }; acceptedAuthority: { epoch: number; visibility: "user_private" | "workspace_shared"; ownerOrganizationMembershipId: string | null; }; currentAuthority: { epoch: number; executionEpoch: number; visibility: "user_private" | "workspace_shared"; ownerSubjectId: string | null; ownerOrganizationMembershipId: string | null; }; control: { workspaceRevision: string; sessionVersion: string; }; execution: { workflowId: string; workflowRunId: string; activityId: string; }; providerRecoveryCount: 0 | 1 | 2 | 3 | 4 | 5; checkedAt: string; }>; export type ModalNativeLiveOriginResult = { kind: "live"; projection: ModalNativeLiveOriginProjection; } | { kind: "fenced"; } | { kind: "unsupported"; reason: "invalid_scope" | "human_unavailable" | "external_authority" | "not_premodel"; }; /** * Private-server integration primitive, NOT host authentication or a grant. * The caller must authenticate the exact host request separately and consume * this projection in this SAME transaction. No native/provider awaits here. * Enter before taking any tenancy/control/session/lease lock: SQL acquires the * organization-membership -> tenancy -> canonical control/row prefix itself. * Preserves all subject and tenant GUCs. SQL uncertainty propagates (including * 55P03); no failed/aborted transaction is reported as successful admission. */ export declare function lockLiveNativeOriginalOriginTx(scopedTx: Database, scope: ModalNativeLiveOriginScope): Promise;