import { g as GraphBackend, T as TransactionBackend, j as InsertNodeParams, N as NodeInsertClaim, k as NodeInsertProjection, l as SchemaWriteFenceParams, m as InsertEdgeParams, E as EdgeConvergenceMatch, n as EdgeRow, o as ClaimEdgeCardinalityParams, p as NodeRow } from './types-BynPp5kU.cjs'; type AtomicSqlRow = Readonly>; /** A transport-ready statement in the portable atomic-program protocol. */ type CompiledAtomicSqlStatement = Readonly<{ params: readonly unknown[]; sql: string; }>; /** A native all-or-nothing dispatch for a closed statement sequence. */ type AtomicSqlBatchExecutor = (statements: readonly CompiledAtomicSqlStatement[]) => Promise; type AtomicSqlProgramAdapter = Readonly<{ executeAtomicBatch?: AtomicSqlBatchExecutor; }>; /** The transport forms accepted by an atomic program author. */ type AtomicSqlProgramRegistration = AtomicSqlBatchExecutor | AtomicSqlProgramAdapter; /** * Registers an atomic SQL program executor for one exact backend resource. * * The declaration and executable transport are checked together so a backend * cannot claim atomic execution while omitting the executor, nor expose * an executor without declaring the session on which it is valid. The * registration is keyed by object identity; derived backends and other * transaction sessions therefore do not resolve this program. */ declare function registerAtomicSqlProgram(target: T, registration: AtomicSqlProgramRegistration): T; /** Returns whether this exact object owns a registered atomic SQL transport. */ declare function hasAtomicSqlProgramRegistration(target: GraphBackend | TransactionBackend): boolean; /** How a node batch member obtained the identifier stored by its program. */ type AtomicNodeBatchIdSource = "generated" | "caller"; /** Whether a node batch returns only its count or its ordered postimages. */ type AtomicNodeBatchResultMode = "count" | "rows"; /** Independently provable claim semantics accepted by a node mutation family. */ type AtomicNodeClaimFamily = "disjointness" | "uniqueness"; /** Independently provable derived-storage families in a node program. */ type AtomicNodeProjectionFamily = "embedding" | "fulltext"; /** * One complete derived-storage transition attached to a node postimage. * * Identity stays on the containing row entry so a projection cannot target a * different node. Embedding deletes are explicit because updates and * caller-id resurrection can remove a value that previously existed. */ type AtomicNodeProjection = Extract | Readonly<{ kind: "embedding"; action: "upsert"; fieldPath: string; embedding: readonly number[]; dimensions: number; metric: Extract["metric"]; indexType: Extract["indexType"]; }> | Readonly<{ kind: "embedding"; action: "delete"; fieldPath: string; dimensions: number; metric: Extract["metric"]; indexType: Extract["indexType"]; }>; /** Closed derived-storage envelope advertised by one node executor. */ type AtomicNodeProjectionSupport = Readonly<{ families: readonly AtomicNodeProjectionFamily[]; }>; /** Closed claim envelope advertised by one node mutation executor. */ type AtomicNodeClaimSupport = Readonly<{ /** Independently proved claim families; an omitted family is unsupported. */ families: readonly AtomicNodeClaimFamily[]; /** * Maximum compiled claim/probe bind cost one member may contribute to its * write gate. * Compute a member's required value with {@link atomicNodeClaimInputCost}; * backend implementations must not reproduce the SQL cost formula. * Total batch size is deliberately absent: the executor chunks statements * inside one atomic transport submission. */ maxInputCostPerEntry: number; }>; /** Exact compiled claim/probe bind cost one member contributes to its write gate. */ declare function atomicNodeClaimInputCost(claims: readonly NodeInsertClaim[]): number; /** One normalized node-create member supplied to a semantic executor. */ type AtomicNodeBatchEntry = Readonly<{ idSource: AtomicNodeBatchIdSource; params: InsertNodeParams; /** Complete canonically ordered claims this row owes. */ claims?: readonly NodeInsertClaim[]; /** Complete derived-storage transitions owed by the written postimage. */ projections?: readonly AtomicNodeProjection[]; }>; /** Complete schema-fenced input to an atomic node-create family. */ type AtomicNodeBatchInput = Readonly<{ entries: readonly AtomicNodeBatchEntry[]; resultMode: AtomicNodeBatchResultMode; schemaFence: SchemaWriteFenceParams; }>; /** Executes the complete eligible node-create family for one exact root. */ interface AtomicNodeBatchExecutor { /** Claim semantics this executor can prove, omitted for plain rows only. */ readonly claimSupport?: AtomicNodeClaimSupport; /** Derived-storage families this executor carries inside its program. */ readonly projectionSupport?: AtomicNodeProjectionSupport; (input: AtomicNodeBatchInput & Readonly<{ resultMode: "count"; }>): Promise; (input: AtomicNodeBatchInput & Readonly<{ resultMode: "rows"; }>): Promise; } /** One complete, preimage-free replacement supplied to a semantic executor. */ type AtomicNodeReplacementEntry = Readonly<{ params: InsertNodeParams; /** Complete canonically ordered claims the replacement postimage owes. */ claims?: readonly NodeInsertClaim[]; /** Complete derived-storage transitions owed by the replacement postimage. */ projections?: readonly AtomicNodeProjection[]; }>; /** Any node entry whose complete postimage drives projections/assertions. */ type AtomicNodePostimageEntry = AtomicNodeBatchEntry | AtomicNodeReplacementEntry; /** Executes complete blind node replacements for one exact resource. */ interface AtomicNodeReplacementBatchExecutor { /** Maximum members accepted by one atomic submission, including internal chunks. */ readonly maxEntries: Readonly<{ plain: number; claimed: number; }>; /** Exact no-SQL admission proof for the prepared replacement work. */ readonly accepts?: (entries: readonly AtomicNodeReplacementEntry[]) => boolean; /** Claim semantics this executor can prove, omitted for plain rows only. */ readonly claimSupport?: AtomicNodeClaimSupport; /** Claim families whose earlier owner rows this program releases. */ readonly releasedClaimFamilies?: readonly AtomicNodeClaimFamily[]; /** Derived-storage families this executor carries inside its program. */ readonly projectionSupport?: AtomicNodeProjectionSupport; (input: Readonly<{ entries: readonly AtomicNodeReplacementEntry[]; /** Whether earlier owner claims must be released before acquisition. */ releaseClaims: boolean; schemaFence: SchemaWriteFenceParams; }>): Promise; } /** Count-returning input to an atomic direct edge-create family. */ type AtomicEdgeBatchCountInput = Readonly<{ claims: readonly ClaimEdgeCardinalityParams[]; params: readonly InsertEdgeParams[]; resultMode: "count"; schemaFence: SchemaWriteFenceParams; }>; /** Postimage-returning input to an atomic direct edge-create family. */ type AtomicEdgeBatchRowsInput = Readonly<{ claims: readonly ClaimEdgeCardinalityParams[]; params: readonly InsertEdgeParams[]; resultMode: "rows"; schemaFence: SchemaWriteFenceParams; }>; /** Executes complete eligible direct edge creates for one exact root. */ interface AtomicEdgeBatchExecutor { (input: AtomicEdgeBatchCountInput): Promise; (input: AtomicEdgeBatchRowsInput): Promise; } /** One normalized durable edge-convergence member. */ type AtomicEdgeConvergenceEntry = Readonly<{ params: InsertEdgeParams; match: EdgeConvergenceMatch; }>; /** Authoritative row and outcome returned by durable convergence. */ type AtomicEdgeConvergenceResult = Readonly<{ row: EdgeRow; outcome: "created" | "found"; }>; /** Complete schema-fenced durable edge-convergence input. */ type AtomicEdgeConvergenceInput = Readonly<{ kind: "durable-convergence"; entries: readonly AtomicEdgeConvergenceEntry[]; schemaFence: SchemaWriteFenceParams; }>; /** Complete schema-fenced direct edge-delete input. */ type AtomicEdgeDeleteBatchInput = Readonly<{ graphId: string; expectedKind: string; ids: readonly string[]; schemaFence: SchemaWriteFenceParams; }>; /** Delete count plus explicit evidence that the schema fence matched. */ type AtomicDeleteBatchResult = Readonly<{ affectedCount: number; schemaFenceMatched: boolean; }>; /** Executes complete eligible direct edge deletes for one exact root. */ type AtomicEdgeDeleteBatchExecutor = (input: AtomicEdgeDeleteBatchInput) => Promise; /** Complete schema-fenced direct node-delete input. */ type AtomicNodeDeleteBatchInput = Readonly<{ graphId: string; kind: string; ids: readonly string[]; schemaFence: SchemaWriteFenceParams; }>; /** * Executes complete eligible direct node deletes for one exact root. * * Keep the callable as a function type intersected with its metadata. The API * compatibility inventory follows function aliases into their input types; * changing this to a callable interface would hide that contravariant edge. */ type AtomicNodeDeleteBatchExecutor = Readonly<{ /** Claim families whose owned sidecars this program releases. */ releasedClaimFamilies?: readonly AtomicNodeClaimFamily[]; }> & ((input: AtomicNodeDeleteBatchInput) => Promise); /** One authoritative node preimage and replacement used by a resolved set. */ type AtomicNodeResolvedUpdateEntry = Readonly<{ graphId: string; kind: string; id: string; props: Readonly>; expectedVersion: number; /** Complete derived-storage transitions owed by the written postimage. */ projections?: readonly AtomicNodeProjection[]; }>; /** Executes a complete eligible resolved node update set. */ interface AtomicNodeResolvedUpdateBatchExecutor { /** Maximum members accepted by one atomic submission, including internal chunks. */ readonly maxEntries: number; /** Derived-storage families this executor carries inside its program. */ readonly projectionSupport?: AtomicNodeProjectionSupport; (input: Readonly<{ entries: readonly AtomicNodeResolvedUpdateEntry[]; schemaFence: SchemaWriteFenceParams; }>): Promise; } /** One authoritative edge preimage and replacement used by a resolved set. */ type AtomicEdgeResolvedUpdateEntry = Readonly<{ existing: EdgeRow; props: Readonly>; }>; /** Executes a complete eligible resolved edge update set. */ interface AtomicEdgeResolvedUpdateBatchExecutor { /** Maximum members accepted by one atomic submission, including internal chunks. */ readonly maxEntries: number; (input: Readonly<{ entries: readonly AtomicEdgeResolvedUpdateEntry[]; schemaFence: SchemaWriteFenceParams; }>): Promise; } /** Ordered node postimages returned by a mixed resolved mutation set. */ type AtomicNodeResolvedMutationSetResult = Readonly<{ created: readonly NodeRow[]; updated: readonly NodeRow[]; }>; /** Executes a complete eligible mixed node create/update set. */ interface AtomicNodeResolvedMutationSetExecutor { /** Maximum total members accepted across the program's terminal assertions. */ readonly maxEntries: number; /** Derived-storage families this executor carries inside its program. */ readonly projectionSupport?: AtomicNodeProjectionSupport; (input: Readonly<{ creates: readonly AtomicNodeBatchEntry[]; updates: readonly AtomicNodeResolvedUpdateEntry[]; schemaFence: SchemaWriteFenceParams; }>): Promise; } /** Ordered edge postimages returned by a mixed resolved mutation set. */ type AtomicEdgeResolvedMutationSetResult = Readonly<{ created: readonly EdgeRow[]; updated: readonly EdgeRow[]; }>; /** Complete schema-fenced input to a mixed resolved edge mutation set. */ type AtomicEdgeResolvedMutationSetInput = Readonly<{ kind: "resolved-set"; creates: readonly InsertEdgeParams[]; updates: readonly AtomicEdgeResolvedUpdateEntry[]; schemaFence: SchemaWriteFenceParams; }>; /** Executes resolved edge sets and durable convergence for one exact root. */ interface AtomicEdgeMutationProgramExecutor { readonly maxEntries: Readonly<{ resolvedSet: number; durableConvergence: number; }>; (input: AtomicEdgeResolvedMutationSetInput): Promise; (input: AtomicEdgeConvergenceInput): Promise; } /** Internal proof that the closed SQL program rejected a missing endpoint. */ declare class AtomicEdgeBatchEndpointRefusalError extends Error { constructor(cause: unknown); } /** Internal proof that the closed SQL program refused a cardinality claim. */ declare class AtomicEdgeBatchCardinalityRefusalError extends Error { constructor(cause: unknown); } /** Internal proof that native convergence encountered a tombstoned winner. */ declare class AtomicEdgeConvergenceTombstoneRefusalError extends Error { constructor(cause: unknown); } /** Internal proof that an edge-delete input belongs to another collection. */ declare class AtomicEdgeDeleteIdentityRefusalError extends Error { constructor(cause: unknown); } /** Internal proof that a restricted node still has a live connected edge. */ declare class AtomicNodeDeleteRestrictedRefusalError extends Error { constructor(cause: unknown); } /** Every independently enabled semantic variant in a mutation profile. */ declare const ATOMIC_MUTATION_PROGRAM_VARIANTS: readonly ["createNodes", "replaceNodes", "createEdges", "deleteNodes", "deleteEdges", "updateNodes", "updateEdges", "mutateNodes", "mutateEdges.resolvedSet", "mutateEdges.durableConvergence"]; /** One independently enabled semantic variant in a mutation profile. */ type AtomicMutationProgramVariant = (typeof ATOMIC_MUTATION_PROGRAM_VARIANTS)[number]; /** One owner for the overloaded edge-mutation input/variant correlation. */ declare const ATOMIC_EDGE_MUTATION_VARIANT_BY_KIND: { readonly "durable-convergence": "mutateEdges.durableConvergence"; readonly "resolved-set": "mutateEdges.resolvedSet"; }; /** * Semantic mutation families implemented by one exact backend root. * * Registering this profile is an explicit claim about TypeGraph write * semantics, not merely transport mechanics. Each optional member authorizes * only that family; omitted families retain the complete portable path. */ type AtomicMutationProgramRegistration = Readonly<{ createNodes?: AtomicNodeBatchExecutor | undefined; replaceNodes?: AtomicNodeReplacementBatchExecutor | undefined; createEdges?: AtomicEdgeBatchExecutor | undefined; deleteNodes?: AtomicNodeDeleteBatchExecutor | undefined; deleteEdges?: AtomicEdgeDeleteBatchExecutor | undefined; updateNodes?: AtomicNodeResolvedUpdateBatchExecutor | undefined; updateEdges?: AtomicEdgeResolvedUpdateBatchExecutor | undefined; mutateNodes?: AtomicNodeResolvedMutationSetExecutor | undefined; mutateEdges?: AtomicEdgeMutationProgramExecutor | undefined; }>; /** * Registers TypeGraph semantic mutation programs for one exact backend resource. * * Transport registration proves atomic statement dispatch only. This second, * explicit profile declares which graph mutation families preserve their * complete schema-fence, validation, side-effect, refusal, and result-ordering * contracts. Object-identity registration prevents derived, projected, and * other transaction sessions from inheriting execution evidence. */ declare function registerAtomicMutationPrograms(target: T, registration: AtomicMutationProgramRegistration): T; /** Returns whether this exact resource owns a semantic program profile. */ declare function hasAtomicMutationProgramRegistration(target: GraphBackend | TransactionBackend): boolean; export { type AtomicMutationProgramVariant as A, type AtomicNodeBatchInput as B, type CompiledAtomicSqlStatement as C, type AtomicNodeBatchResultMode as D, type AtomicNodeClaimFamily as E, type AtomicNodeClaimSupport as F, type AtomicNodeDeleteBatchExecutor as G, type AtomicNodeDeleteBatchInput as H, AtomicNodeDeleteRestrictedRefusalError as I, type AtomicNodeProjection as J, type AtomicNodeProjectionFamily as K, type AtomicNodeProjectionSupport as L, type AtomicNodeReplacementBatchExecutor as M, type AtomicNodeReplacementEntry as N, type AtomicNodeResolvedMutationSetExecutor as O, type AtomicNodeResolvedMutationSetResult as P, type AtomicNodeResolvedUpdateBatchExecutor as Q, type AtomicNodeResolvedUpdateEntry as R, type AtomicSqlProgramAdapter as S, type AtomicSqlProgramRegistration as T, atomicNodeClaimInputCost as U, hasAtomicMutationProgramRegistration as V, hasAtomicSqlProgramRegistration as W, registerAtomicMutationPrograms as X, registerAtomicSqlProgram as Y, type AtomicNodePostimageEntry as Z, type AtomicSqlBatchExecutor as a, type AtomicSqlRow as b, ATOMIC_EDGE_MUTATION_VARIANT_BY_KIND as c, ATOMIC_MUTATION_PROGRAM_VARIANTS as d, type AtomicDeleteBatchResult as e, AtomicEdgeBatchCardinalityRefusalError as f, type AtomicEdgeBatchCountInput as g, AtomicEdgeBatchEndpointRefusalError as h, type AtomicEdgeBatchExecutor as i, type AtomicEdgeBatchRowsInput as j, type AtomicEdgeConvergenceEntry as k, type AtomicEdgeConvergenceInput as l, type AtomicEdgeConvergenceResult as m, AtomicEdgeConvergenceTombstoneRefusalError as n, type AtomicEdgeDeleteBatchExecutor as o, type AtomicEdgeDeleteBatchInput as p, AtomicEdgeDeleteIdentityRefusalError as q, type AtomicEdgeMutationProgramExecutor as r, type AtomicEdgeResolvedMutationSetInput as s, type AtomicEdgeResolvedMutationSetResult as t, type AtomicEdgeResolvedUpdateBatchExecutor as u, type AtomicEdgeResolvedUpdateEntry as v, type AtomicMutationProgramRegistration as w, type AtomicNodeBatchEntry as x, type AtomicNodeBatchExecutor as y, type AtomicNodeBatchIdSource as z };