@nicia-ai/typegraph 0.24.1 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/backend/postgres/index.cjs +178 -55
  2. package/dist/backend/postgres/index.cjs.map +1 -1
  3. package/dist/backend/postgres/index.d.cts +6 -7
  4. package/dist/backend/postgres/index.d.ts +6 -7
  5. package/dist/backend/postgres/index.js +151 -28
  6. package/dist/backend/postgres/index.js.map +1 -1
  7. package/dist/backend/sqlite/index.cjs +19 -17
  8. package/dist/backend/sqlite/index.d.cts +6 -7
  9. package/dist/backend/sqlite/index.d.ts +6 -7
  10. package/dist/backend/sqlite/index.js +9 -7
  11. package/dist/backend/sqlite/libsql.cjs +12 -10
  12. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  13. package/dist/backend/sqlite/libsql.d.cts +4 -5
  14. package/dist/backend/sqlite/libsql.d.ts +4 -5
  15. package/dist/backend/sqlite/libsql.js +9 -7
  16. package/dist/backend/sqlite/libsql.js.map +1 -1
  17. package/dist/backend/sqlite/local.cjs +14 -12
  18. package/dist/backend/sqlite/local.cjs.map +1 -1
  19. package/dist/backend/sqlite/local.d.cts +4 -5
  20. package/dist/backend/sqlite/local.d.ts +4 -5
  21. package/dist/backend/sqlite/local.js +9 -7
  22. package/dist/backend/sqlite/local.js.map +1 -1
  23. package/dist/chunk-4BOWVUGQ.js +2029 -0
  24. package/dist/chunk-4BOWVUGQ.js.map +1 -0
  25. package/dist/{chunk-SUHW2UYL.cjs → chunk-7CDXX3QZ.cjs} +2 -2
  26. package/dist/chunk-7CDXX3QZ.cjs.map +1 -0
  27. package/dist/chunk-7V335GHG.cjs +112 -0
  28. package/dist/chunk-7V335GHG.cjs.map +1 -0
  29. package/dist/chunk-7W3KAMVQ.cjs +2678 -0
  30. package/dist/chunk-7W3KAMVQ.cjs.map +1 -0
  31. package/dist/chunk-CTHNVU6K.cjs +551 -0
  32. package/dist/chunk-CTHNVU6K.cjs.map +1 -0
  33. package/dist/chunk-D2GO3RBL.cjs +12 -0
  34. package/dist/chunk-D2GO3RBL.cjs.map +1 -0
  35. package/dist/{chunk-WFMTAEEN.js → chunk-DOTEN2FG.js} +81 -7
  36. package/dist/chunk-DOTEN2FG.js.map +1 -0
  37. package/dist/chunk-E5JZSEGJ.cjs +301 -0
  38. package/dist/chunk-E5JZSEGJ.cjs.map +1 -0
  39. package/dist/chunk-EG6TJ3I5.js +286 -0
  40. package/dist/chunk-EG6TJ3I5.js.map +1 -0
  41. package/dist/chunk-EJCDOA37.js +537 -0
  42. package/dist/chunk-EJCDOA37.js.map +1 -0
  43. package/dist/{chunk-UVZHTBZ5.cjs → chunk-EK6RJ373.cjs} +7 -150
  44. package/dist/chunk-EK6RJ373.cjs.map +1 -0
  45. package/dist/{chunk-GUTQTMOV.js → chunk-FPCOUJSL.js} +2 -2
  46. package/dist/chunk-FPCOUJSL.js.map +1 -0
  47. package/dist/{chunk-3JK66E3I.cjs → chunk-JTI5WT4P.cjs} +630 -59
  48. package/dist/chunk-JTI5WT4P.cjs.map +1 -0
  49. package/dist/chunk-LVCSL6A3.js +2626 -0
  50. package/dist/chunk-LVCSL6A3.js.map +1 -0
  51. package/dist/chunk-NHQWXSTS.js +10 -0
  52. package/dist/chunk-NHQWXSTS.js.map +1 -0
  53. package/dist/chunk-NZ5PMBTG.js +105 -0
  54. package/dist/chunk-NZ5PMBTG.js.map +1 -0
  55. package/dist/{chunk-5HVDOPZU.cjs → chunk-O2P3KAUT.cjs} +416 -93
  56. package/dist/chunk-O2P3KAUT.cjs.map +1 -0
  57. package/dist/{chunk-QOLTW7OZ.js → chunk-OJ6IQVZG.js} +151 -13
  58. package/dist/chunk-OJ6IQVZG.js.map +1 -0
  59. package/dist/{chunk-EYELZHKY.js → chunk-OOS2RKRH.js} +5 -140
  60. package/dist/chunk-OOS2RKRH.js.map +1 -0
  61. package/dist/chunk-RCAJZG67.cjs +2069 -0
  62. package/dist/chunk-RCAJZG67.cjs.map +1 -0
  63. package/dist/{chunk-O5PST6TB.cjs → chunk-W5MTHMTE.cjs} +83 -6
  64. package/dist/chunk-W5MTHMTE.cjs.map +1 -0
  65. package/dist/{chunk-EY4LBX3F.js → chunk-WI5VRP3X.js} +337 -26
  66. package/dist/chunk-WI5VRP3X.js.map +1 -0
  67. package/dist/chunk-WVQXAFP3.js +79 -0
  68. package/dist/chunk-WVQXAFP3.js.map +1 -0
  69. package/dist/chunk-X3244EKP.cjs +84 -0
  70. package/dist/chunk-X3244EKP.cjs.map +1 -0
  71. package/dist/{chunk-753F33CV.js → chunk-YZZBDCLV.js} +617 -44
  72. package/dist/chunk-YZZBDCLV.js.map +1 -0
  73. package/dist/{chunk-OVJ2BE5Q.cjs → chunk-ZEMNF3QK.cjs} +171 -33
  74. package/dist/chunk-ZEMNF3QK.cjs.map +1 -0
  75. package/dist/{ddl-B_H8JM-E.d.cts → ddl-B2jjLjpR.d.cts} +762 -99
  76. package/dist/{ddl-1tFIvt9V.d.ts → ddl-DpaeAKPp.d.ts} +762 -99
  77. package/dist/extension-types-D07e_NTw.d.cts +543 -0
  78. package/dist/extension-types-D07e_NTw.d.ts +543 -0
  79. package/dist/graph-extension/index.cjs +71 -0
  80. package/dist/graph-extension/index.cjs.map +1 -0
  81. package/dist/graph-extension/index.d.cts +278 -0
  82. package/dist/graph-extension/index.d.ts +278 -0
  83. package/dist/graph-extension/index.js +6 -0
  84. package/dist/graph-extension/index.js.map +1 -0
  85. package/dist/{index-DXkEXpNz.d.ts → index-CT6nvtxL.d.cts} +114 -5
  86. package/dist/{index-DXkEXpNz.d.cts → index-DQheiVQV.d.ts} +114 -5
  87. package/dist/index.cjs +2672 -901
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.d.cts +29 -10
  90. package/dist/index.d.ts +29 -10
  91. package/dist/index.js +2248 -598
  92. package/dist/index.js.map +1 -1
  93. package/dist/indexes/index.cjs +25 -23
  94. package/dist/indexes/index.d.cts +40 -22
  95. package/dist/indexes/index.d.ts +40 -22
  96. package/dist/indexes/index.js +5 -3
  97. package/dist/interchange/index.cjs +8 -7
  98. package/dist/interchange/index.cjs.map +1 -1
  99. package/dist/interchange/index.d.cts +5 -4
  100. package/dist/interchange/index.d.ts +5 -4
  101. package/dist/interchange/index.js +3 -2
  102. package/dist/interchange/index.js.map +1 -1
  103. package/dist/{manager-nIhmttD-.d.ts → manager-BKaPQbns.d.ts} +189 -6
  104. package/dist/{manager-Vkz28eAC.d.cts → manager-BpjBW1JK.d.cts} +189 -6
  105. package/dist/materialize-indexes-BB9N5uQl.d.cts +68 -0
  106. package/dist/materialize-indexes-BYpU2RKh.d.ts +68 -0
  107. package/dist/profiler/index.cjs +10 -8
  108. package/dist/profiler/index.cjs.map +1 -1
  109. package/dist/profiler/index.d.cts +8 -7
  110. package/dist/profiler/index.d.ts +8 -7
  111. package/dist/profiler/index.js +3 -1
  112. package/dist/profiler/index.js.map +1 -1
  113. package/dist/schema/index.cjs +43 -22
  114. package/dist/schema/index.cjs.map +1 -1
  115. package/dist/schema/index.d.cts +17 -8
  116. package/dist/schema/index.d.ts +17 -8
  117. package/dist/schema/index.js +9 -4
  118. package/dist/schema/index.js.map +1 -1
  119. package/dist/{sqlite-D0aceIe0.d.cts → sqlite-CU3j6rc7.d.ts} +837 -120
  120. package/dist/{sqlite-SUxbZqfy.d.ts → sqlite-Myo8e3Lr.d.cts} +837 -120
  121. package/dist/{store-U3i2tUch.d.ts → store-BAGuOHDh.d.cts} +659 -23
  122. package/dist/{store-CpvwTMxV.d.cts → store-De98Lod4.d.ts} +659 -23
  123. package/dist/types--0EslBx5.d.cts +2123 -0
  124. package/dist/{types-qYFZ9SqD.d.ts → types-BLmJq4wI.d.ts} +3 -2
  125. package/dist/types-BNWYZ-0-.d.ts +2123 -0
  126. package/dist/{types-yH4_p0XB.d.cts → types-CYga3lZp.d.cts} +3 -2
  127. package/dist/where-CluR73rs.d.ts +11 -0
  128. package/dist/where-m1uWsdua.d.cts +11 -0
  129. package/package.json +33 -73
  130. package/dist/ast-C8S37w1A.d.ts +0 -497
  131. package/dist/ast-dgLhLOg0.d.cts +0 -497
  132. package/dist/chunk-3JK66E3I.cjs.map +0 -1
  133. package/dist/chunk-3PPEHLGK.js +0 -1116
  134. package/dist/chunk-3PPEHLGK.js.map +0 -1
  135. package/dist/chunk-5HVDOPZU.cjs.map +0 -1
  136. package/dist/chunk-753F33CV.js.map +0 -1
  137. package/dist/chunk-EY4LBX3F.js.map +0 -1
  138. package/dist/chunk-EYELZHKY.js.map +0 -1
  139. package/dist/chunk-GFGVREHH.js +0 -1381
  140. package/dist/chunk-GFGVREHH.js.map +0 -1
  141. package/dist/chunk-GUTQTMOV.js.map +0 -1
  142. package/dist/chunk-LBORRUNJ.js +0 -135
  143. package/dist/chunk-LBORRUNJ.js.map +0 -1
  144. package/dist/chunk-O5PST6TB.cjs.map +0 -1
  145. package/dist/chunk-OLROXS2S.cjs +0 -147
  146. package/dist/chunk-OLROXS2S.cjs.map +0 -1
  147. package/dist/chunk-OVJ2BE5Q.cjs.map +0 -1
  148. package/dist/chunk-PAUN562Y.cjs +0 -1417
  149. package/dist/chunk-PAUN562Y.cjs.map +0 -1
  150. package/dist/chunk-PEE4EWXZ.cjs +0 -1131
  151. package/dist/chunk-PEE4EWXZ.cjs.map +0 -1
  152. package/dist/chunk-QOLTW7OZ.js.map +0 -1
  153. package/dist/chunk-SUHW2UYL.cjs.map +0 -1
  154. package/dist/chunk-UVZHTBZ5.cjs.map +0 -1
  155. package/dist/chunk-WFMTAEEN.js.map +0 -1
  156. package/dist/types-C-zfYDJB.d.ts +0 -159
  157. package/dist/types-CQx4iW5Y.d.cts +0 -159
  158. package/dist/types-Qk2l3IkQ.d.cts +0 -1254
  159. package/dist/types-Qk2l3IkQ.d.ts +0 -1254
@@ -1,3 +1,6 @@
1
+ import { K as KindEntity } from './extension-types-D07e_NTw.cjs';
2
+ import { M as MaterializeIndexesResult } from './materialize-indexes-BB9N5uQl.cjs';
3
+
1
4
  /**
2
5
  * TypeGraph Error Hierarchy
3
6
  *
@@ -21,6 +24,7 @@
21
24
  * }
22
25
  * ```
23
26
  */
27
+
24
28
  /**
25
29
  * Error category for programmatic handling.
26
30
  *
@@ -83,7 +87,7 @@ type ValidationIssue = Readonly<{
83
87
  */
84
88
  type ValidationErrorDetails = Readonly<{
85
89
  /** Type of entity being validated */
86
- entityType?: "node" | "edge";
90
+ entityType?: KindEntity;
87
91
  /** Kind/type name of the entity */
88
92
  kind?: string;
89
93
  /** Operation being performed */
@@ -143,12 +147,22 @@ declare class EdgeNotFoundError extends TypeGraphError {
143
147
  });
144
148
  }
145
149
  /**
146
- * Thrown when a kind is not found in the graph registry.
150
+ * Thrown when an operation references a kind that isn't registered on
151
+ * the graph — `getNodeCollectionOrThrow` against an unknown kind, a
152
+ * `materializeIndexes({ kinds })` filter naming a missing kind, an
153
+ * extension referencing an unresolved endpoint, search facade typos,
154
+ * etc. Carries the offending `kindName` and `entity` plus the host
155
+ * `graphId` so logs are unambiguous when multiple stores share a
156
+ * process.
147
157
  */
148
158
  declare class KindNotFoundError extends TypeGraphError {
149
- constructor(kind: string, type: "node" | "edge", options?: {
159
+ readonly kindName: string;
160
+ readonly entity: KindEntity;
161
+ constructor(kindName: string, entity: KindEntity, options?: Readonly<{
162
+ graphId?: string;
163
+ suggestion?: string;
150
164
  cause?: unknown;
151
- });
165
+ }>);
152
166
  }
153
167
  /**
154
168
  * Thrown when a uniqueness constraint name is not found on a node kind.
@@ -281,6 +295,101 @@ declare class MigrationError extends TypeGraphError {
281
295
  cause?: unknown;
282
296
  });
283
297
  }
298
+ /**
299
+ * Thrown by `Store.evolve(extension, { eager })` when the schema
300
+ * commit succeeded but the follow-on `materializeIndexes()` produced
301
+ * one or more failed entries.
302
+ *
303
+ * Recovery: the schema commit is NOT rolled back. The new `Store` is
304
+ * fully constructed and (when `options.ref` was supplied) `ref.current`
305
+ * already points to it — the caller can read the new store via the ref
306
+ * and decide how to handle the failed indexes (retry, skip, alert).
307
+ * The full `MaterializeIndexesResult` is attached as `.materialization`.
308
+ *
309
+ * @example
310
+ * ```ts
311
+ * const ref = { current: store };
312
+ * try {
313
+ * await store.evolve(extension, { ref, eager: {} });
314
+ * } catch (error) {
315
+ * if (error instanceof EagerMaterializationError) {
316
+ * // schema is committed; ref.current is the new store
317
+ * log.warn(
318
+ * { failed: error.failedIndexNames },
319
+ * "indexes did not materialize; will retry",
320
+ * );
321
+ * await ref.current.materializeIndexes();
322
+ * } else {
323
+ * throw error;
324
+ * }
325
+ * }
326
+ * ```
327
+ */
328
+ declare class EagerMaterializationError extends TypeGraphError {
329
+ /**
330
+ * The full materialization result, including successful and failed
331
+ * entries. Same shape as `Store.materializeIndexes()` returns.
332
+ */
333
+ readonly materialization: MaterializeIndexesResult;
334
+ constructor(materialization: MaterializeIndexesResult, graphId: string);
335
+ /**
336
+ * Names of just the indexes that failed — derived from
337
+ * `materialization.results` so the two views can never disagree.
338
+ */
339
+ get failedIndexNames(): readonly string[];
340
+ }
341
+ /**
342
+ * Thrown by `commitSchemaVersion` and `setActiveVersion` when the
343
+ * caller's view of the active schema version is out of date — another
344
+ * writer has already advanced it.
345
+ *
346
+ * Recovery: re-read the active version with `getActiveSchema(graphId)`,
347
+ * recompute against the new baseline, and retry. This is a routine
348
+ * concurrency signal, not a bug.
349
+ *
350
+ * `actual` is `0` when no active version exists yet (initial-commit race
351
+ * where another writer initialized first).
352
+ */
353
+ declare class StaleVersionError extends TypeGraphError {
354
+ readonly details: Readonly<{
355
+ graphId: string;
356
+ expected: number;
357
+ actual: number;
358
+ }>;
359
+ constructor(details: Readonly<{
360
+ graphId: string;
361
+ expected: number;
362
+ actual: number;
363
+ }>, options?: {
364
+ cause?: unknown;
365
+ });
366
+ }
367
+ /**
368
+ * Thrown by `commitSchemaVersion` when a row already exists at the
369
+ * target version with a *different* schema hash — i.e. two writers
370
+ * committed materially different schemas at the same version number.
371
+ *
372
+ * Distinct from `StaleVersionError`: this is not a refetch-and-retry
373
+ * situation, it's a content disagreement that needs operator
374
+ * intervention. Typically caused by inconsistent application
375
+ * deployments writing schemas that hash differently.
376
+ */
377
+ declare class SchemaContentConflictError extends TypeGraphError {
378
+ readonly details: Readonly<{
379
+ graphId: string;
380
+ version: number;
381
+ existingHash: string;
382
+ incomingHash: string;
383
+ }>;
384
+ constructor(details: Readonly<{
385
+ graphId: string;
386
+ version: number;
387
+ existingHash: string;
388
+ incomingHash: string;
389
+ }>, options?: {
390
+ cause?: unknown;
391
+ });
392
+ }
284
393
  /**
285
394
  * Thrown when graph configuration is invalid.
286
395
  *
@@ -390,4 +499,4 @@ declare function isConstraintError(error: unknown): boolean;
390
499
  */
391
500
  declare function getErrorSuggestion(error: unknown): string | undefined;
392
501
 
393
- export { BackendDisposedError as B, CardinalityError as C, DatabaseOperationError as D, EdgeNotFoundError as E, KindNotFoundError as K, MigrationError as M, NodeConstraintNotFoundError as N, RestrictedDeleteError as R, SchemaMismatchError as S, TypeGraphError as T, UniquenessError as U, ValidationError as V, CompilerInvariantError as a, ConfigurationError as b, DisjointError as c, EndpointError as d, EndpointNotFoundError as e, type ErrorCategory as f, NodeNotFoundError as g, type TypeGraphErrorOptions as h, UnsupportedPredicateError as i, type ValidationErrorDetails as j, type ValidationIssue as k, VersionConflictError as l, getErrorSuggestion as m, isConstraintError as n, isSystemError as o, isTypeGraphError as p, isUserRecoverable as q };
502
+ export { BackendDisposedError as B, CardinalityError as C, DatabaseOperationError as D, EagerMaterializationError as E, KindNotFoundError as K, MigrationError as M, NodeConstraintNotFoundError as N, RestrictedDeleteError as R, SchemaContentConflictError as S, TypeGraphError as T, UniquenessError as U, type ValidationIssue as V, ValidationError as a, CompilerInvariantError as b, ConfigurationError as c, DisjointError as d, EdgeNotFoundError as e, EndpointError as f, EndpointNotFoundError as g, type ErrorCategory as h, NodeNotFoundError as i, SchemaMismatchError as j, StaleVersionError as k, type TypeGraphErrorOptions as l, UnsupportedPredicateError as m, type ValidationErrorDetails as n, VersionConflictError as o, getErrorSuggestion as p, isConstraintError as q, isSystemError as r, isTypeGraphError as s, isUserRecoverable as t };
@@ -1,3 +1,6 @@
1
+ import { K as KindEntity } from './extension-types-D07e_NTw.js';
2
+ import { M as MaterializeIndexesResult } from './materialize-indexes-BYpU2RKh.js';
3
+
1
4
  /**
2
5
  * TypeGraph Error Hierarchy
3
6
  *
@@ -21,6 +24,7 @@
21
24
  * }
22
25
  * ```
23
26
  */
27
+
24
28
  /**
25
29
  * Error category for programmatic handling.
26
30
  *
@@ -83,7 +87,7 @@ type ValidationIssue = Readonly<{
83
87
  */
84
88
  type ValidationErrorDetails = Readonly<{
85
89
  /** Type of entity being validated */
86
- entityType?: "node" | "edge";
90
+ entityType?: KindEntity;
87
91
  /** Kind/type name of the entity */
88
92
  kind?: string;
89
93
  /** Operation being performed */
@@ -143,12 +147,22 @@ declare class EdgeNotFoundError extends TypeGraphError {
143
147
  });
144
148
  }
145
149
  /**
146
- * Thrown when a kind is not found in the graph registry.
150
+ * Thrown when an operation references a kind that isn't registered on
151
+ * the graph — `getNodeCollectionOrThrow` against an unknown kind, a
152
+ * `materializeIndexes({ kinds })` filter naming a missing kind, an
153
+ * extension referencing an unresolved endpoint, search facade typos,
154
+ * etc. Carries the offending `kindName` and `entity` plus the host
155
+ * `graphId` so logs are unambiguous when multiple stores share a
156
+ * process.
147
157
  */
148
158
  declare class KindNotFoundError extends TypeGraphError {
149
- constructor(kind: string, type: "node" | "edge", options?: {
159
+ readonly kindName: string;
160
+ readonly entity: KindEntity;
161
+ constructor(kindName: string, entity: KindEntity, options?: Readonly<{
162
+ graphId?: string;
163
+ suggestion?: string;
150
164
  cause?: unknown;
151
- });
165
+ }>);
152
166
  }
153
167
  /**
154
168
  * Thrown when a uniqueness constraint name is not found on a node kind.
@@ -281,6 +295,101 @@ declare class MigrationError extends TypeGraphError {
281
295
  cause?: unknown;
282
296
  });
283
297
  }
298
+ /**
299
+ * Thrown by `Store.evolve(extension, { eager })` when the schema
300
+ * commit succeeded but the follow-on `materializeIndexes()` produced
301
+ * one or more failed entries.
302
+ *
303
+ * Recovery: the schema commit is NOT rolled back. The new `Store` is
304
+ * fully constructed and (when `options.ref` was supplied) `ref.current`
305
+ * already points to it — the caller can read the new store via the ref
306
+ * and decide how to handle the failed indexes (retry, skip, alert).
307
+ * The full `MaterializeIndexesResult` is attached as `.materialization`.
308
+ *
309
+ * @example
310
+ * ```ts
311
+ * const ref = { current: store };
312
+ * try {
313
+ * await store.evolve(extension, { ref, eager: {} });
314
+ * } catch (error) {
315
+ * if (error instanceof EagerMaterializationError) {
316
+ * // schema is committed; ref.current is the new store
317
+ * log.warn(
318
+ * { failed: error.failedIndexNames },
319
+ * "indexes did not materialize; will retry",
320
+ * );
321
+ * await ref.current.materializeIndexes();
322
+ * } else {
323
+ * throw error;
324
+ * }
325
+ * }
326
+ * ```
327
+ */
328
+ declare class EagerMaterializationError extends TypeGraphError {
329
+ /**
330
+ * The full materialization result, including successful and failed
331
+ * entries. Same shape as `Store.materializeIndexes()` returns.
332
+ */
333
+ readonly materialization: MaterializeIndexesResult;
334
+ constructor(materialization: MaterializeIndexesResult, graphId: string);
335
+ /**
336
+ * Names of just the indexes that failed — derived from
337
+ * `materialization.results` so the two views can never disagree.
338
+ */
339
+ get failedIndexNames(): readonly string[];
340
+ }
341
+ /**
342
+ * Thrown by `commitSchemaVersion` and `setActiveVersion` when the
343
+ * caller's view of the active schema version is out of date — another
344
+ * writer has already advanced it.
345
+ *
346
+ * Recovery: re-read the active version with `getActiveSchema(graphId)`,
347
+ * recompute against the new baseline, and retry. This is a routine
348
+ * concurrency signal, not a bug.
349
+ *
350
+ * `actual` is `0` when no active version exists yet (initial-commit race
351
+ * where another writer initialized first).
352
+ */
353
+ declare class StaleVersionError extends TypeGraphError {
354
+ readonly details: Readonly<{
355
+ graphId: string;
356
+ expected: number;
357
+ actual: number;
358
+ }>;
359
+ constructor(details: Readonly<{
360
+ graphId: string;
361
+ expected: number;
362
+ actual: number;
363
+ }>, options?: {
364
+ cause?: unknown;
365
+ });
366
+ }
367
+ /**
368
+ * Thrown by `commitSchemaVersion` when a row already exists at the
369
+ * target version with a *different* schema hash — i.e. two writers
370
+ * committed materially different schemas at the same version number.
371
+ *
372
+ * Distinct from `StaleVersionError`: this is not a refetch-and-retry
373
+ * situation, it's a content disagreement that needs operator
374
+ * intervention. Typically caused by inconsistent application
375
+ * deployments writing schemas that hash differently.
376
+ */
377
+ declare class SchemaContentConflictError extends TypeGraphError {
378
+ readonly details: Readonly<{
379
+ graphId: string;
380
+ version: number;
381
+ existingHash: string;
382
+ incomingHash: string;
383
+ }>;
384
+ constructor(details: Readonly<{
385
+ graphId: string;
386
+ version: number;
387
+ existingHash: string;
388
+ incomingHash: string;
389
+ }>, options?: {
390
+ cause?: unknown;
391
+ });
392
+ }
284
393
  /**
285
394
  * Thrown when graph configuration is invalid.
286
395
  *
@@ -390,4 +499,4 @@ declare function isConstraintError(error: unknown): boolean;
390
499
  */
391
500
  declare function getErrorSuggestion(error: unknown): string | undefined;
392
501
 
393
- export { BackendDisposedError as B, CardinalityError as C, DatabaseOperationError as D, EdgeNotFoundError as E, KindNotFoundError as K, MigrationError as M, NodeConstraintNotFoundError as N, RestrictedDeleteError as R, SchemaMismatchError as S, TypeGraphError as T, UniquenessError as U, ValidationError as V, CompilerInvariantError as a, ConfigurationError as b, DisjointError as c, EndpointError as d, EndpointNotFoundError as e, type ErrorCategory as f, NodeNotFoundError as g, type TypeGraphErrorOptions as h, UnsupportedPredicateError as i, type ValidationErrorDetails as j, type ValidationIssue as k, VersionConflictError as l, getErrorSuggestion as m, isConstraintError as n, isSystemError as o, isTypeGraphError as p, isUserRecoverable as q };
502
+ export { BackendDisposedError as B, CardinalityError as C, DatabaseOperationError as D, EagerMaterializationError as E, KindNotFoundError as K, MigrationError as M, NodeConstraintNotFoundError as N, RestrictedDeleteError as R, SchemaContentConflictError as S, TypeGraphError as T, UniquenessError as U, type ValidationIssue as V, ValidationError as a, CompilerInvariantError as b, ConfigurationError as c, DisjointError as d, EdgeNotFoundError as e, EndpointError as f, EndpointNotFoundError as g, type ErrorCategory as h, NodeNotFoundError as i, SchemaMismatchError as j, StaleVersionError as k, type TypeGraphErrorOptions as l, UnsupportedPredicateError as m, type ValidationErrorDetails as n, VersionConflictError as o, getErrorSuggestion as p, isConstraintError as q, isSystemError as r, isTypeGraphError as s, isUserRecoverable as t };