@nicia-ai/typegraph 0.47.0 → 0.48.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 (207) hide show
  1. package/dist/backend/drizzle/indexes.d.cts +1 -1
  2. package/dist/backend/drizzle/indexes.d.ts +1 -1
  3. package/dist/backend/index.cjs +27 -19
  4. package/dist/backend/index.d.cts +37 -55
  5. package/dist/backend/index.d.ts +37 -55
  6. package/dist/backend/index.js +4 -4
  7. package/dist/backend/postgres/index.cjs +7 -7
  8. package/dist/backend/postgres/index.d.cts +21 -7
  9. package/dist/backend/postgres/index.d.ts +21 -7
  10. package/dist/backend/postgres/index.js +6 -6
  11. package/dist/backend/postgres/pglite-store.cjs +17 -17
  12. package/dist/backend/postgres/pglite-store.d.cts +8 -8
  13. package/dist/backend/postgres/pglite-store.d.ts +8 -8
  14. package/dist/backend/postgres/pglite-store.js +14 -14
  15. package/dist/backend/postgres/pglite.cjs +8 -8
  16. package/dist/backend/postgres/pglite.d.cts +3 -3
  17. package/dist/backend/postgres/pglite.d.ts +3 -3
  18. package/dist/backend/postgres/pglite.js +7 -7
  19. package/dist/backend/sqlite/index.cjs +7 -7
  20. package/dist/backend/sqlite/index.d.cts +20 -7
  21. package/dist/backend/sqlite/index.d.ts +20 -7
  22. package/dist/backend/sqlite/index.js +6 -6
  23. package/dist/backend/sqlite/libsql.cjs +8 -8
  24. package/dist/backend/sqlite/libsql.d.cts +3 -3
  25. package/dist/backend/sqlite/libsql.d.ts +3 -3
  26. package/dist/backend/sqlite/libsql.js +6 -6
  27. package/dist/backend/sqlite/local-store.cjs +18 -18
  28. package/dist/backend/sqlite/local-store.d.cts +8 -8
  29. package/dist/backend/sqlite/local-store.d.ts +8 -8
  30. package/dist/backend/sqlite/local-store.js +15 -15
  31. package/dist/backend/sqlite/local.cjs +9 -9
  32. package/dist/backend/sqlite/local.d.cts +3 -3
  33. package/dist/backend/sqlite/local.d.ts +3 -3
  34. package/dist/backend/sqlite/local.js +7 -7
  35. package/dist/{chunk-EMIB2RXD.cjs → chunk-2HIYYMWY.cjs} +99 -96
  36. package/dist/chunk-2HIYYMWY.cjs.map +1 -0
  37. package/dist/{chunk-6KFLYYOC.cjs → chunk-2QGYQBS2.cjs} +5 -5
  38. package/dist/{chunk-6KFLYYOC.cjs.map → chunk-2QGYQBS2.cjs.map} +1 -1
  39. package/dist/{chunk-5FT3TLPK.js → chunk-2SYZXD54.js} +16 -13
  40. package/dist/chunk-2SYZXD54.js.map +1 -0
  41. package/dist/{chunk-XYBQI6LE.js → chunk-2TYSSBU5.js} +6 -6
  42. package/dist/{chunk-XYBQI6LE.js.map → chunk-2TYSSBU5.js.map} +1 -1
  43. package/dist/{chunk-6JVZSOHQ.cjs → chunk-3FPR224C.cjs} +26 -26
  44. package/dist/{chunk-6JVZSOHQ.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
  45. package/dist/{chunk-MFZR4QKM.cjs → chunk-3KOY4FH3.cjs} +181 -4
  46. package/dist/chunk-3KOY4FH3.cjs.map +1 -0
  47. package/dist/{chunk-6FWSNSRE.js → chunk-4WMMBDS5.js} +4 -4
  48. package/dist/chunk-4WMMBDS5.js.map +1 -0
  49. package/dist/{chunk-NG2RB5WL.js → chunk-5K2BKEBD.js} +18 -3
  50. package/dist/chunk-5K2BKEBD.js.map +1 -0
  51. package/dist/chunk-5PRKMB24.cjs +124 -0
  52. package/dist/chunk-5PRKMB24.cjs.map +1 -0
  53. package/dist/chunk-6LN7FIVU.js +107 -0
  54. package/dist/chunk-6LN7FIVU.js.map +1 -0
  55. package/dist/{chunk-I4G3SQPF.cjs → chunk-7XUYFFR4.cjs} +7 -7
  56. package/dist/chunk-7XUYFFR4.cjs.map +1 -0
  57. package/dist/{chunk-KH7XW7VV.js → chunk-ACGSAMD3.js} +24 -27
  58. package/dist/chunk-ACGSAMD3.js.map +1 -0
  59. package/dist/{chunk-QS3NQZVC.js → chunk-AX6JGVTZ.js} +16 -11
  60. package/dist/chunk-AX6JGVTZ.js.map +1 -0
  61. package/dist/{chunk-DJZTXBWY.js → chunk-BRRP76WO.js} +71 -30
  62. package/dist/chunk-BRRP76WO.js.map +1 -0
  63. package/dist/{chunk-5UMTUOM5.js → chunk-CT3ZKTOF.js} +5 -4
  64. package/dist/chunk-CT3ZKTOF.js.map +1 -0
  65. package/dist/{chunk-XY5OMOJD.js → chunk-DZAICA5J.js} +3 -3
  66. package/dist/{chunk-XY5OMOJD.js.map → chunk-DZAICA5J.js.map} +1 -1
  67. package/dist/{chunk-OIFSOPSR.cjs → chunk-EZEEWCFJ.cjs} +38 -156
  68. package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
  69. package/dist/{chunk-AMMWA76F.cjs → chunk-FA2AFWLP.cjs} +6 -6
  70. package/dist/{chunk-AMMWA76F.cjs.map → chunk-FA2AFWLP.cjs.map} +1 -1
  71. package/dist/{chunk-FNOMT74T.js → chunk-I4GAZH5Z.js} +180 -5
  72. package/dist/chunk-I4GAZH5Z.js.map +1 -0
  73. package/dist/{chunk-WGX7JH7E.cjs → chunk-JB6T4GLL.cjs} +106 -134
  74. package/dist/chunk-JB6T4GLL.cjs.map +1 -0
  75. package/dist/{chunk-MX4DHSQP.cjs → chunk-JFRT7S3B.cjs} +92 -98
  76. package/dist/chunk-JFRT7S3B.cjs.map +1 -0
  77. package/dist/{chunk-SE6EGQSD.js → chunk-KF6K7TGH.js} +38 -66
  78. package/dist/chunk-KF6K7TGH.js.map +1 -0
  79. package/dist/{chunk-ZHNXLS3C.js → chunk-NACVVDWB.js} +208 -8
  80. package/dist/chunk-NACVVDWB.js.map +1 -0
  81. package/dist/{chunk-M35DF33T.js → chunk-OD4SSY2U.js} +29 -16
  82. package/dist/chunk-OD4SSY2U.js.map +1 -0
  83. package/dist/{chunk-U5EDAVOJ.cjs → chunk-OTUPEF2W.cjs} +54 -49
  84. package/dist/chunk-OTUPEF2W.cjs.map +1 -0
  85. package/dist/{chunk-BCQ76AXA.cjs → chunk-PFBRJBUL.cjs} +107 -94
  86. package/dist/chunk-PFBRJBUL.cjs.map +1 -0
  87. package/dist/{chunk-AVGUJWVX.js → chunk-S5TERQVW.js} +15 -132
  88. package/dist/chunk-S5TERQVW.js.map +1 -0
  89. package/dist/chunk-SIT26LAZ.cjs +614 -0
  90. package/dist/chunk-SIT26LAZ.cjs.map +1 -0
  91. package/dist/{chunk-BR7SHKGM.cjs → chunk-SR725PWF.cjs} +548 -507
  92. package/dist/chunk-SR725PWF.cjs.map +1 -0
  93. package/dist/{chunk-5FBRVORR.cjs → chunk-TKZXMWQF.cjs} +8 -7
  94. package/dist/chunk-TKZXMWQF.cjs.map +1 -0
  95. package/dist/{chunk-425IZOQ5.cjs → chunk-TQHGE7UC.cjs} +20 -2
  96. package/dist/chunk-TQHGE7UC.cjs.map +1 -0
  97. package/dist/{chunk-GYUJZARH.cjs → chunk-TUNPBZY3.cjs} +4 -4
  98. package/dist/{chunk-GYUJZARH.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
  99. package/dist/chunk-UGHG7PGX.js +592 -0
  100. package/dist/chunk-UGHG7PGX.js.map +1 -0
  101. package/dist/{chunk-KABFHAL7.cjs → chunk-UMGZDVOA.cjs} +213 -12
  102. package/dist/chunk-UMGZDVOA.cjs.map +1 -0
  103. package/dist/{chunk-UPAJHMW3.cjs → chunk-WCCATHMB.cjs} +54 -57
  104. package/dist/chunk-WCCATHMB.cjs.map +1 -0
  105. package/dist/{chunk-LEWHMOUY.js → chunk-YIURNGXI.js} +4 -4
  106. package/dist/{chunk-LEWHMOUY.js.map → chunk-YIURNGXI.js.map} +1 -1
  107. package/dist/{chunk-EP4RUYD6.js → chunk-YVF2EM7B.js} +3 -3
  108. package/dist/{chunk-EP4RUYD6.js.map → chunk-YVF2EM7B.js.map} +1 -1
  109. package/dist/{chunk-NNQ6A3RM.js → chunk-ZFMCDJGB.js} +7 -12
  110. package/dist/chunk-ZFMCDJGB.js.map +1 -0
  111. package/dist/core/index.cjs +6 -6
  112. package/dist/core/index.d.cts +4 -4
  113. package/dist/core/index.d.ts +4 -4
  114. package/dist/core/index.js +2 -2
  115. package/dist/ddl-BL1NZLMY.d.cts +78 -0
  116. package/dist/ddl-D_oW-EVO.d.ts +78 -0
  117. package/dist/graph-extension/index.d.cts +4 -4
  118. package/dist/graph-extension/index.d.ts +4 -4
  119. package/dist/graph-merge/index.cjs +334 -191
  120. package/dist/graph-merge/index.cjs.map +1 -1
  121. package/dist/graph-merge/index.d.cts +65 -15
  122. package/dist/graph-merge/index.d.ts +65 -15
  123. package/dist/graph-merge/index.js +174 -32
  124. package/dist/graph-merge/index.js.map +1 -1
  125. package/dist/{index-CHTv4XMZ.d.cts → index-COs_z6nV.d.cts} +2 -2
  126. package/dist/{index-CzoJ3MUw.d.ts → index-D7d1u2gr.d.ts} +2 -2
  127. package/dist/index.cjs +90 -86
  128. package/dist/index.d.cts +12 -12
  129. package/dist/index.d.ts +12 -12
  130. package/dist/index.js +13 -13
  131. package/dist/indexes/index.d.cts +4 -4
  132. package/dist/indexes/index.d.ts +4 -4
  133. package/dist/interchange/index.cjs +38 -38
  134. package/dist/interchange/index.d.cts +7 -7
  135. package/dist/interchange/index.d.ts +7 -7
  136. package/dist/interchange/index.js +10 -10
  137. package/dist/{manager-DlY1vlla.d.cts → manager-CYaff3n3.d.cts} +2 -2
  138. package/dist/{manager-B6sOQzcQ.d.ts → manager-D9eRT_ns.d.ts} +2 -2
  139. package/dist/{materialize-indexes-DQL4xcpf.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
  140. package/dist/{materialize-indexes-sskhp-c_.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
  141. package/dist/{postgres-BXy_nyMs.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
  142. package/dist/{postgres-B6YOUcaK.d.ts → postgres-DMj39MEu.d.cts} +1 -1
  143. package/dist/profiler/index.d.cts +9 -9
  144. package/dist/profiler/index.d.ts +9 -9
  145. package/dist/provenance/index.cjs +25 -26
  146. package/dist/provenance/index.cjs.map +1 -1
  147. package/dist/provenance/index.d.cts +7 -7
  148. package/dist/provenance/index.d.ts +7 -7
  149. package/dist/provenance/index.js +9 -10
  150. package/dist/provenance/index.js.map +1 -1
  151. package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
  152. package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
  153. package/dist/schema/index.cjs +35 -35
  154. package/dist/schema/index.d.cts +6 -6
  155. package/dist/schema/index.d.ts +6 -6
  156. package/dist/schema/index.js +8 -8
  157. package/dist/{searchable-D9gMiwcS.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
  158. package/dist/{searchable-0Cn_lY8U.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
  159. package/dist/{sqlite-DioSxaPe.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
  160. package/dist/{sqlite-ClXuBYAj.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
  161. package/dist/{store-5j-w5onJ.d.ts → store-JUVvtmR4.d.cts} +113 -26
  162. package/dist/{store-CFedKGU5.d.cts → store-UzrGvZOo.d.ts} +113 -26
  163. package/dist/{temporal-CjO9FH1l.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
  164. package/dist/{temporal-Ce1pG0S1.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
  165. package/dist/{types-DKkMJZjR.d.cts → types-BqFZTQmV.d.cts} +29 -4
  166. package/dist/{types-DKkMJZjR.d.ts → types-BqFZTQmV.d.ts} +29 -4
  167. package/dist/{types-BrdOFu48.d.ts → types-Bx74kaTt.d.ts} +1 -1
  168. package/dist/{types-oj_OGAaZ.d.cts → types-CXAhpW-c.d.cts} +1 -1
  169. package/dist/{where-D1wKCJ4Q.d.cts → where-DI_Fqz-X.d.cts} +1 -1
  170. package/dist/{where-C8w2627G.d.ts → where-O-k2wgYm.d.ts} +1 -1
  171. package/package.json +1 -1
  172. package/dist/chunk-3HGRTCDU.cjs +0 -269
  173. package/dist/chunk-3HGRTCDU.cjs.map +0 -1
  174. package/dist/chunk-425IZOQ5.cjs.map +0 -1
  175. package/dist/chunk-5FBRVORR.cjs.map +0 -1
  176. package/dist/chunk-5FT3TLPK.js.map +0 -1
  177. package/dist/chunk-5UMTUOM5.js.map +0 -1
  178. package/dist/chunk-6FWSNSRE.js.map +0 -1
  179. package/dist/chunk-AVGUJWVX.js.map +0 -1
  180. package/dist/chunk-BCQ76AXA.cjs.map +0 -1
  181. package/dist/chunk-BR7SHKGM.cjs.map +0 -1
  182. package/dist/chunk-DJZTXBWY.js.map +0 -1
  183. package/dist/chunk-EMIB2RXD.cjs.map +0 -1
  184. package/dist/chunk-FNOMT74T.js.map +0 -1
  185. package/dist/chunk-I4G3SQPF.cjs.map +0 -1
  186. package/dist/chunk-JR6SX5RH.cjs +0 -268
  187. package/dist/chunk-JR6SX5RH.cjs.map +0 -1
  188. package/dist/chunk-KABFHAL7.cjs.map +0 -1
  189. package/dist/chunk-KH7XW7VV.js.map +0 -1
  190. package/dist/chunk-M35DF33T.js.map +0 -1
  191. package/dist/chunk-MFZR4QKM.cjs.map +0 -1
  192. package/dist/chunk-MX4DHSQP.cjs.map +0 -1
  193. package/dist/chunk-NAZ2RA4L.js +0 -254
  194. package/dist/chunk-NAZ2RA4L.js.map +0 -1
  195. package/dist/chunk-NG2RB5WL.js.map +0 -1
  196. package/dist/chunk-NNQ6A3RM.js.map +0 -1
  197. package/dist/chunk-OIFSOPSR.cjs.map +0 -1
  198. package/dist/chunk-QS3NQZVC.js.map +0 -1
  199. package/dist/chunk-SE6EGQSD.js.map +0 -1
  200. package/dist/chunk-SHSSRCFR.js +0 -246
  201. package/dist/chunk-SHSSRCFR.js.map +0 -1
  202. package/dist/chunk-U5EDAVOJ.cjs.map +0 -1
  203. package/dist/chunk-UPAJHMW3.cjs.map +0 -1
  204. package/dist/chunk-WGX7JH7E.cjs.map +0 -1
  205. package/dist/chunk-ZHNXLS3C.js.map +0 -1
  206. package/dist/ddl-CprnMXJ-.d.ts +0 -38
  207. package/dist/ddl-DJA7Lci5.d.cts +0 -38
@@ -1,19 +1,21 @@
1
1
  'use strict';
2
2
 
3
- var chunkWGX7JH7E_cjs = require('./chunk-WGX7JH7E.cjs');
4
- var chunkMFZR4QKM_cjs = require('./chunk-MFZR4QKM.cjs');
5
- var chunkMX4DHSQP_cjs = require('./chunk-MX4DHSQP.cjs');
6
- var chunk3HGRTCDU_cjs = require('./chunk-3HGRTCDU.cjs');
3
+ var chunkJB6T4GLL_cjs = require('./chunk-JB6T4GLL.cjs');
4
+ var chunk3KOY4FH3_cjs = require('./chunk-3KOY4FH3.cjs');
5
+ var chunkJFRT7S3B_cjs = require('./chunk-JFRT7S3B.cjs');
6
+ var chunkEZEEWCFJ_cjs = require('./chunk-EZEEWCFJ.cjs');
7
+ var chunkSIT26LAZ_cjs = require('./chunk-SIT26LAZ.cjs');
8
+ var chunk5PRKMB24_cjs = require('./chunk-5PRKMB24.cjs');
7
9
  var chunkBFUOME67_cjs = require('./chunk-BFUOME67.cjs');
8
10
  var chunkFQPEMEWX_cjs = require('./chunk-FQPEMEWX.cjs');
9
- var chunk425IZOQ5_cjs = require('./chunk-425IZOQ5.cjs');
11
+ var chunkTQHGE7UC_cjs = require('./chunk-TQHGE7UC.cjs');
10
12
  var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
11
13
  var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
12
14
  var zod = require('zod');
13
15
 
14
16
  var FORMAT_VERSION = "2.0";
15
17
  var AcceptedFormatVersionSchema = zod.z.enum(["1.0", "2.0"]);
16
- var ValidityTimestampSchema = zod.z.iso.datetime().refine((value) => chunk425IZOQ5_cjs.isCanonicalIsoDate(value), {
18
+ var ValidityTimestampSchema = zod.z.iso.datetime().refine((value) => chunkTQHGE7UC_cjs.isCanonicalIsoDate(value), {
17
19
  message: "Expected canonical UTC ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ); convert with new Date(value).toISOString()."
18
20
  });
19
21
  var InterchangeNodeSchema = zod.z.object({
@@ -22,10 +24,13 @@ var InterchangeNodeSchema = zod.z.object({
22
24
  properties: zod.z.record(zod.z.string(), zod.z.unknown()),
23
25
  /**
24
26
  * `undefined` (key absent): not requested (`includeTemporal: false`) —
25
- * import defaults it to the import's own creation timestamp. `null`:
26
- * requested and confirmed the row has no lower bound (e.g. a legacy row
27
- * predating the "omitted validFrom defaults to creation time" fix) —
28
- * import preserves that open-left validity instead of re-stamping it.
27
+ * import defaults it to the import's own creation timestamp, UNLESS the
28
+ * record states a `validTo` at or before that instant, in which case the row
29
+ * is imported with no lower bound ("ended at T, start unknown") rather than
30
+ * one after its own end (issue #407). `null`: requested and confirmed the row
31
+ * has no lower bound (e.g. a legacy row predating the "omitted validFrom
32
+ * defaults to creation time" fix) — import preserves that open-left validity
33
+ * instead of re-stamping it.
29
34
  */
30
35
  validFrom: ValidityTimestampSchema.nullable().optional(),
31
36
  validTo: ValidityTimestampSchema.optional(),
@@ -254,8 +259,8 @@ async function importGraph(store, data, rawOptions) {
254
259
  );
255
260
  }
256
261
  async function withImportStreamLease(store, run) {
257
- const lease = chunk3HGRTCDU_cjs.acquireSerializedStreamLease(
258
- chunkMFZR4QKM_cjs.storeBackend(store),
262
+ const lease = chunkSIT26LAZ_cjs.acquireSerializedStreamLease(
263
+ chunk3KOY4FH3_cjs.storeBackend(store),
259
264
  "import-stream"
260
265
  );
261
266
  if (!lease.acquired) {
@@ -278,13 +283,13 @@ async function importGraphData(store, data, options) {
278
283
  const errors = [];
279
284
  const graph = store.graph;
280
285
  const graphId = store.graphId;
281
- const backend = chunkMFZR4QKM_cjs.storeBackend(store);
282
- const runtime = chunkMFZR4QKM_cjs.storeRuntime(store);
286
+ const backend = chunk3KOY4FH3_cjs.storeBackend(store);
287
+ const runtime = chunk3KOY4FH3_cjs.storeRuntime(store);
283
288
  const registry = store.registry;
284
289
  const nodeSchemas = buildNodeSchemaMap(graph);
285
290
  const edgeSchemas = buildEdgeSchemaMap(graph);
286
291
  const importedNodeIds = /* @__PURE__ */ new Set();
287
- await chunkMX4DHSQP_cjs.runInWriteTransaction(
292
+ await chunkJFRT7S3B_cjs.runInWriteTransaction(
288
293
  {
289
294
  graphId,
290
295
  schemaVersion: store.introspect().schemaVersion,
@@ -347,8 +352,8 @@ async function importGraphData(store, data, options) {
347
352
  async function importGraphStream(store, chunks, rawOptions) {
348
353
  const options = ImportOptionsSchema.parse(rawOptions);
349
354
  const sourceBackend = exportStreamBackend(chunks);
350
- const targetBackend = chunkMFZR4QKM_cjs.storeBackend(store);
351
- const contention = sourceBackend === void 0 ? void 0 : chunk3HGRTCDU_cjs.snapshotExportContention(sourceBackend, targetBackend);
355
+ const targetBackend = chunk3KOY4FH3_cjs.storeBackend(store);
356
+ const contention = sourceBackend === void 0 ? void 0 : chunkSIT26LAZ_cjs.snapshotExportContention(sourceBackend, targetBackend);
352
357
  if (contention !== void 0) {
353
358
  throw serializedStreamRefusal({
354
359
  graphId: store.graphId,
@@ -365,7 +370,7 @@ async function importGraphStream(store, chunks, rawOptions) {
365
370
  try {
366
371
  for await (const chunk of chunks) {
367
372
  if (releaseImportLease === void 0) {
368
- const lease = chunk3HGRTCDU_cjs.acquireSerializedStreamLease(
373
+ const lease = chunkSIT26LAZ_cjs.acquireSerializedStreamLease(
369
374
  targetBackend,
370
375
  "import-stream"
371
376
  );
@@ -604,7 +609,7 @@ function asIdentityImportError(assertions, graphId, error) {
604
609
  }
605
610
  function taggedAssertion(assertions, error) {
606
611
  if (typeof error !== "object" || error === null) return void 0;
607
- const id = error[chunkMX4DHSQP_cjs.IDENTITY_IMPORT_FAILED_ASSERTION];
612
+ const id = error[chunkJFRT7S3B_cjs.IDENTITY_IMPORT_FAILED_ASSERTION];
608
613
  if (typeof id !== "string") return void 0;
609
614
  return assertions.find((candidate) => candidate.id === id);
610
615
  }
@@ -635,7 +640,7 @@ function identityImportProgress(error) {
635
640
  if (typeof error !== "object" || error === null) {
636
641
  return { created: 0, skipped: 0 };
637
642
  }
638
- const progress = error[chunkMX4DHSQP_cjs.IDENTITY_IMPORT_PROGRESS];
643
+ const progress = error[chunkJFRT7S3B_cjs.IDENTITY_IMPORT_PROGRESS];
639
644
  if (typeof progress !== "object" || progress === null || !("created" in progress) || typeof progress.created !== "number" || !("skipped" in progress) || typeof progress.skipped !== "number") {
640
645
  return { created: 0, skipped: 0 };
641
646
  }
@@ -837,8 +842,8 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
837
842
  registerAppliedNodeUpdate,
838
843
  seedNodeRow,
839
844
  seedUniqueRow
840
- } = chunkWGX7JH7E_cjs.createNodeBatchValidationBackend(graphId, registry, backend);
841
- await chunkWGX7JH7E_cjs.primeBatchValidationCaches(
845
+ } = chunkJB6T4GLL_cjs.createNodeBatchValidationBackend(graphId, registry, backend);
846
+ await chunkJB6T4GLL_cjs.primeBatchValidationCaches(
842
847
  { graphId, registry },
843
848
  candidates.map((candidate) => candidate.draft),
844
849
  backend,
@@ -859,7 +864,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
859
864
  case "skip": {
860
865
  record(node, {
861
866
  status: "skipped",
862
- liveTarget: chunk3HGRTCDU_cjs.isLiveNodeRow(existing)
867
+ liveTarget: chunk5PRKMB24_cjs.isLiveNodeRow(existing)
863
868
  });
864
869
  break;
865
870
  }
@@ -871,7 +876,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
871
876
  break;
872
877
  }
873
878
  case "update": {
874
- if (!chunk3HGRTCDU_cjs.isLiveNodeRow(existing)) {
879
+ if (!chunk5PRKMB24_cjs.isLiveNodeRow(existing)) {
875
880
  record(node, { status: "skipped", liveTarget: false });
876
881
  break;
877
882
  }
@@ -906,7 +911,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
906
911
  registerAppliedNodeUpdate(
907
912
  node.kind,
908
913
  node.id,
909
- chunk3HGRTCDU_cjs.rowPropsToObject(existing.props),
914
+ chunk5PRKMB24_cjs.rowPropsToObject(existing.props),
910
915
  props,
911
916
  uniqueConstraints
912
917
  );
@@ -921,7 +926,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
921
926
  continue;
922
927
  }
923
928
  const uniquenessResult = await catchUniquenessError(
924
- () => chunkMFZR4QKM_cjs.checkUniquenessConstraints(
929
+ () => chunk3KOY4FH3_cjs.checkUniquenessConstraints(
925
930
  { graphId, registry, backend: validationBackend },
926
931
  node.kind,
927
932
  node.id,
@@ -948,7 +953,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
948
953
  } else {
949
954
  await backend.insertNodesBatch(insertParamsList);
950
955
  }
951
- await chunkMFZR4QKM_cjs.applyNodeInsertSideEffectsBatch(
956
+ await chunk3KOY4FH3_cjs.applyNodeInsertSideEffectsBatch(
952
957
  writeContext,
953
958
  accepted.map((candidate) => ({
954
959
  kind: candidate.node.kind,
@@ -1003,7 +1008,7 @@ var NODE_UPDATE_TARGET_CHANGED_CODE = "INTERCHANGE_NODE_UPDATE_TARGET_CHANGED";
1003
1008
  async function updateImportedNode(writeContext, backend, node, args) {
1004
1009
  try {
1005
1010
  const result = await catchUniquenessError(
1006
- () => chunkMFZR4QKM_cjs.applyNodeUpdate(
1011
+ () => chunk3KOY4FH3_cjs.applyNodeUpdate(
1007
1012
  writeContext,
1008
1013
  {
1009
1014
  existing: args.existing,
@@ -1084,12 +1089,12 @@ function windowErrorOf(assert) {
1084
1089
  }
1085
1090
  function validateValidityWindow(entity) {
1086
1091
  return windowErrorOf(() => {
1087
- chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
1092
+ chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(
1088
1093
  entity.validFrom ?? void 0,
1089
1094
  "validFrom"
1090
1095
  );
1091
- chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(entity.validTo, "validTo");
1092
- chunk425IZOQ5_cjs.assertOrderedValidityWindow(
1096
+ chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(entity.validTo, "validTo");
1097
+ chunkTQHGE7UC_cjs.assertOrderedValidityWindow(
1093
1098
  `${entity.kind} "${entity.id}"`,
1094
1099
  entity.validFrom ?? void 0,
1095
1100
  entity.validTo
@@ -1098,7 +1103,7 @@ function validateValidityWindow(entity) {
1098
1103
  }
1099
1104
  function validateUpdateValidityWindow(entity, storedValidFrom) {
1100
1105
  const verdict = windowResultOf(
1101
- () => chunk425IZOQ5_cjs.assertWritableValidityWindow(
1106
+ () => chunkTQHGE7UC_cjs.assertWritableValidityWindow(
1102
1107
  `${entity.kind} "${entity.id}"`,
1103
1108
  entity.validFrom ?? void 0,
1104
1109
  {
@@ -1137,7 +1142,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
1137
1142
  if (existing) {
1138
1143
  switch (options.onConflict) {
1139
1144
  case "skip": {
1140
- return { status: "skipped", liveTarget: chunk3HGRTCDU_cjs.isLiveNodeRow(existing) };
1145
+ return { status: "skipped", liveTarget: chunk5PRKMB24_cjs.isLiveNodeRow(existing) };
1141
1146
  }
1142
1147
  case "error": {
1143
1148
  return {
@@ -1146,7 +1151,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
1146
1151
  };
1147
1152
  }
1148
1153
  case "update": {
1149
- if (!chunk3HGRTCDU_cjs.isLiveNodeRow(existing)) {
1154
+ if (!chunk5PRKMB24_cjs.isLiveNodeRow(existing)) {
1150
1155
  return { status: "skipped", liveTarget: false };
1151
1156
  }
1152
1157
  const updateWindow = validateUpdateValidityWindow(
@@ -1176,7 +1181,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
1176
1181
  }
1177
1182
  }
1178
1183
  const uniquenessResult = await catchUniquenessError(
1179
- () => chunkMFZR4QKM_cjs.checkUniquenessConstraints(
1184
+ () => chunk3KOY4FH3_cjs.checkUniquenessConstraints(
1180
1185
  { graphId, registry, backend },
1181
1186
  node.kind,
1182
1187
  node.id,
@@ -1195,7 +1200,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
1195
1200
  ...node.validFrom !== void 0 && { validFrom: node.validFrom },
1196
1201
  ...node.validTo !== void 0 && { validTo: node.validTo }
1197
1202
  });
1198
- await chunkMFZR4QKM_cjs.applyNodeInsertSideEffects(
1203
+ await chunk3KOY4FH3_cjs.applyNodeInsertSideEffects(
1199
1204
  writeContext,
1200
1205
  {
1201
1206
  kind: node.kind,
@@ -1330,7 +1335,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
1330
1335
  for (const [kind, ids] of idsByKind) {
1331
1336
  const rows = await backend.getNodes(graphId, kind, [...ids]);
1332
1337
  for (const row of rows) {
1333
- if (chunk3HGRTCDU_cjs.isLiveNodeRow(row)) {
1338
+ if (chunk5PRKMB24_cjs.isLiveNodeRow(row)) {
1334
1339
  liveEndpointKeys.add(makeNodeKey(kind, row.id));
1335
1340
  }
1336
1341
  }
@@ -1341,7 +1346,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
1341
1346
  if (importedNodeIds.has(key)) return true;
1342
1347
  if (checkedEndpointKeys.has(key)) return liveEndpointKeys.has(key);
1343
1348
  const row = await backend.getNode(graphId, endpoint.kind, endpoint.id);
1344
- return row !== void 0 && chunk3HGRTCDU_cjs.isLiveNodeRow(row);
1349
+ return row !== void 0 && chunk5PRKMB24_cjs.isLiveNodeRow(row);
1345
1350
  };
1346
1351
  const existingById = /* @__PURE__ */ new Map();
1347
1352
  if (candidates.length > 0 && backend.getEdges !== void 0) {
@@ -1502,7 +1507,7 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
1502
1507
  edge.from.kind,
1503
1508
  edge.from.id
1504
1509
  );
1505
- if (fromExists === void 0 || !chunk3HGRTCDU_cjs.isLiveNodeRow(fromExists)) {
1510
+ if (fromExists === void 0 || !chunk5PRKMB24_cjs.isLiveNodeRow(fromExists)) {
1506
1511
  return {
1507
1512
  status: "error",
1508
1513
  error: `From node not found: ${edge.from.kind}:${edge.from.id}`
@@ -1511,7 +1516,7 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
1511
1516
  }
1512
1517
  if (!importedNodeIds.has(toKey)) {
1513
1518
  const toExists = await backend.getNode(graphId, edge.to.kind, edge.to.id);
1514
- if (toExists === void 0 || !chunk3HGRTCDU_cjs.isLiveNodeRow(toExists)) {
1519
+ if (toExists === void 0 || !chunk5PRKMB24_cjs.isLiveNodeRow(toExists)) {
1515
1520
  return {
1516
1521
  status: "error",
1517
1522
  error: `To node not found: ${edge.to.kind}:${edge.to.id}`
@@ -1648,7 +1653,7 @@ function formatZodError(error) {
1648
1653
  }).join("; ");
1649
1654
  }
1650
1655
  function makeNodeKey(kind, id) {
1651
- return chunkMX4DHSQP_cjs.encodeTupleKey([kind, id]);
1656
+ return chunkEZEEWCFJ_cjs.encodeTupleKey([kind, id]);
1652
1657
  }
1653
1658
 
1654
1659
  // src/interchange/export.ts
@@ -1691,7 +1696,7 @@ async function exportGraph(store, options) {
1691
1696
  };
1692
1697
  }
1693
1698
  function exportGraphStream(store, options) {
1694
- const backend = chunkMFZR4QKM_cjs.storeBackend(store);
1699
+ const backend = chunk3KOY4FH3_cjs.storeBackend(store);
1695
1700
  return markExportStreamBackend(
1696
1701
  exportGraphStreamFromBackend(store, backend, options),
1697
1702
  backend
@@ -1839,7 +1844,7 @@ function exportStreamCancelled(phase, graphId, signal, framed) {
1839
1844
  );
1840
1845
  }
1841
1846
  function claimSnapshotExportLeaseOrRefuse(graphId, backend) {
1842
- const lease = chunk3HGRTCDU_cjs.acquireSerializedStreamLease(backend, "export-snapshot");
1847
+ const lease = chunkSIT26LAZ_cjs.acquireSerializedStreamLease(backend, "export-snapshot");
1843
1848
  if (!lease.acquired) {
1844
1849
  throw serializedStreamRefusal({
1845
1850
  graphId,
@@ -1858,7 +1863,7 @@ async function produceExportChunks(store, backend, options, emit) {
1858
1863
  type: "header",
1859
1864
  header: {
1860
1865
  formatVersion: FORMAT_VERSION,
1861
- exportedAt: chunk425IZOQ5_cjs.nowIso(),
1866
+ exportedAt: chunkTQHGE7UC_cjs.nowIso(),
1862
1867
  source: {
1863
1868
  type: "typegraph-export",
1864
1869
  graphId,
@@ -1895,7 +1900,7 @@ async function produceExportChunks(store, backend, options, emit) {
1895
1900
  if (store.graph.identity === void 0) return;
1896
1901
  let after;
1897
1902
  for (; ; ) {
1898
- const page = await chunkMFZR4QKM_cjs.storeRuntime(store).readIdentityAssertionPageAtTarget(
1903
+ const page = await chunk3KOY4FH3_cjs.storeRuntime(store).readIdentityAssertionPageAtTarget(
1899
1904
  backend,
1900
1905
  options.identityMode,
1901
1906
  {
@@ -2044,7 +2049,7 @@ async function* exportNodeChunks(backend, graphId, kind, options) {
2044
2049
  const node = {
2045
2050
  kind: row.kind,
2046
2051
  id: row.id,
2047
- properties: chunk3HGRTCDU_cjs.rowPropsToObject(row.props)
2052
+ properties: chunk5PRKMB24_cjs.rowPropsToObject(row.props)
2048
2053
  };
2049
2054
  if (options.includeTemporal) {
2050
2055
  const validFrom = (
@@ -2094,7 +2099,7 @@ async function* exportEdgeChunks(backend, graphId, kind, options) {
2094
2099
  kind: row.to_kind,
2095
2100
  id: row.to_id
2096
2101
  },
2097
- properties: chunk3HGRTCDU_cjs.rowPropsToObject(row.props)
2102
+ properties: chunk5PRKMB24_cjs.rowPropsToObject(row.props)
2098
2103
  };
2099
2104
  if (options.includeTemporal) {
2100
2105
  const validFrom = (
@@ -2144,5 +2149,5 @@ exports.importGraph = importGraph;
2144
2149
  exports.importGraphStream = importGraphStream;
2145
2150
  exports.serializedStreamRefusal = serializedStreamRefusal;
2146
2151
  exports.withImportStreamLease = withImportStreamLease;
2147
- //# sourceMappingURL=chunk-U5EDAVOJ.cjs.map
2148
- //# sourceMappingURL=chunk-U5EDAVOJ.cjs.map
2152
+ //# sourceMappingURL=chunk-OTUPEF2W.cjs.map
2153
+ //# sourceMappingURL=chunk-OTUPEF2W.cjs.map