@nicia-ai/typegraph 0.46.0 → 0.46.1

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 (83) hide show
  1. package/dist/backend/index.cjs +5 -5
  2. package/dist/backend/index.js +2 -2
  3. package/dist/backend/postgres/pglite-store.cjs +8 -8
  4. package/dist/backend/postgres/pglite-store.d.cts +2 -2
  5. package/dist/backend/postgres/pglite-store.d.ts +2 -2
  6. package/dist/backend/postgres/pglite-store.js +7 -7
  7. package/dist/backend/sqlite/local-store.cjs +8 -8
  8. package/dist/backend/sqlite/local-store.d.cts +2 -2
  9. package/dist/backend/sqlite/local-store.d.ts +2 -2
  10. package/dist/backend/sqlite/local-store.js +7 -7
  11. package/dist/{chunk-CNV4TXJG.js → chunk-2Z2Z3ZD6.js} +3 -3
  12. package/dist/{chunk-CNV4TXJG.js.map → chunk-2Z2Z3ZD6.js.map} +1 -1
  13. package/dist/{chunk-N3257XE6.cjs → chunk-65E3XWGF.cjs} +21 -21
  14. package/dist/{chunk-N3257XE6.cjs.map → chunk-65E3XWGF.cjs.map} +1 -1
  15. package/dist/{chunk-ONU3HIED.cjs → chunk-CMWHLBVN.cjs} +29 -29
  16. package/dist/{chunk-ONU3HIED.cjs.map → chunk-CMWHLBVN.cjs.map} +1 -1
  17. package/dist/{chunk-XNLIZYRZ.cjs → chunk-DTVWX77L.cjs} +56 -56
  18. package/dist/{chunk-XNLIZYRZ.cjs.map → chunk-DTVWX77L.cjs.map} +1 -1
  19. package/dist/{chunk-JIVMTW7W.js → chunk-GF3KXUTW.js} +4 -4
  20. package/dist/{chunk-JIVMTW7W.js.map → chunk-GF3KXUTW.js.map} +1 -1
  21. package/dist/{chunk-QWX5YA3K.js → chunk-L65OU2U3.js} +11 -9
  22. package/dist/chunk-L65OU2U3.js.map +1 -0
  23. package/dist/{chunk-QLRESYPU.js → chunk-LGHCOKTT.js} +5 -5
  24. package/dist/{chunk-QLRESYPU.js.map → chunk-LGHCOKTT.js.map} +1 -1
  25. package/dist/{chunk-WEVQJ5LH.js → chunk-M3WP7RQZ.js} +2 -2
  26. package/dist/chunk-M3WP7RQZ.js.map +1 -0
  27. package/dist/{chunk-Q7Q4WSLJ.cjs → chunk-MCLYU6BN.cjs} +6 -2
  28. package/dist/chunk-MCLYU6BN.cjs.map +1 -0
  29. package/dist/{chunk-RJS7DECT.js → chunk-MZLPX2R7.js} +3 -3
  30. package/dist/{chunk-RJS7DECT.js.map → chunk-MZLPX2R7.js.map} +1 -1
  31. package/dist/{chunk-NQ6BRJBE.js → chunk-NLI2AVEF.js} +3 -3
  32. package/dist/{chunk-NQ6BRJBE.js.map → chunk-NLI2AVEF.js.map} +1 -1
  33. package/dist/{chunk-XMQSEJCF.cjs → chunk-PF6F5NLJ.cjs} +20 -20
  34. package/dist/{chunk-XMQSEJCF.cjs.map → chunk-PF6F5NLJ.cjs.map} +1 -1
  35. package/dist/{chunk-XDF2UPEQ.cjs → chunk-PNTCATDE.cjs} +431 -421
  36. package/dist/chunk-PNTCATDE.cjs.map +1 -0
  37. package/dist/{chunk-7GT72YHH.cjs → chunk-PT7RIRIZ.cjs} +66 -64
  38. package/dist/chunk-PT7RIRIZ.cjs.map +1 -0
  39. package/dist/{chunk-TTAITEPJ.cjs → chunk-Q3G6A4I3.cjs} +2 -2
  40. package/dist/chunk-Q3G6A4I3.cjs.map +1 -0
  41. package/dist/{chunk-7Z5OR7KO.js → chunk-S6PW7VV5.js} +19 -9
  42. package/dist/chunk-S6PW7VV5.js.map +1 -0
  43. package/dist/{chunk-XQSCL77R.cjs → chunk-VLT6PEWR.cjs} +4 -4
  44. package/dist/{chunk-XQSCL77R.cjs.map → chunk-VLT6PEWR.cjs.map} +1 -1
  45. package/dist/{chunk-OH5E5KIO.js → chunk-WQZLUGVR.js} +6 -6
  46. package/dist/{chunk-OH5E5KIO.js.map → chunk-WQZLUGVR.js.map} +1 -1
  47. package/dist/{chunk-DLNROMQ7.js → chunk-XL7SLCXS.js} +6 -3
  48. package/dist/chunk-XL7SLCXS.js.map +1 -0
  49. package/dist/{chunk-XNSI2FJO.cjs → chunk-YBQOHKHN.cjs} +8 -8
  50. package/dist/{chunk-XNSI2FJO.cjs.map → chunk-YBQOHKHN.cjs.map} +1 -1
  51. package/dist/core/index.cjs +5 -5
  52. package/dist/core/index.js +1 -1
  53. package/dist/graph-merge/index.cjs +149 -149
  54. package/dist/graph-merge/index.d.cts +1 -1
  55. package/dist/graph-merge/index.d.ts +1 -1
  56. package/dist/graph-merge/index.js +8 -8
  57. package/dist/index.cjs +79 -79
  58. package/dist/index.d.cts +2 -2
  59. package/dist/index.d.ts +2 -2
  60. package/dist/index.js +9 -9
  61. package/dist/interchange/index.cjs +34 -34
  62. package/dist/interchange/index.d.cts +1 -1
  63. package/dist/interchange/index.d.ts +1 -1
  64. package/dist/interchange/index.js +7 -7
  65. package/dist/profiler/index.d.cts +1 -1
  66. package/dist/profiler/index.d.ts +1 -1
  67. package/dist/provenance/index.cjs +16 -16
  68. package/dist/provenance/index.d.cts +1 -1
  69. package/dist/provenance/index.d.ts +1 -1
  70. package/dist/provenance/index.js +3 -3
  71. package/dist/schema/index.cjs +32 -32
  72. package/dist/schema/index.js +5 -5
  73. package/dist/{store-RwTJx8LX.d.cts → store-B0h6x7wo.d.cts} +12 -3
  74. package/dist/{store-DawaWWjJ.d.ts → store-ClQ-MZQS.d.ts} +12 -3
  75. package/package.json +3 -3
  76. package/dist/chunk-7GT72YHH.cjs.map +0 -1
  77. package/dist/chunk-7Z5OR7KO.js.map +0 -1
  78. package/dist/chunk-DLNROMQ7.js.map +0 -1
  79. package/dist/chunk-Q7Q4WSLJ.cjs.map +0 -1
  80. package/dist/chunk-QWX5YA3K.js.map +0 -1
  81. package/dist/chunk-TTAITEPJ.cjs.map +0 -1
  82. package/dist/chunk-WEVQJ5LH.js.map +0 -1
  83. package/dist/chunk-XDF2UPEQ.cjs.map +0 -1
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var chunk7GT72YHH_cjs = require('./chunk-7GT72YHH.cjs');
4
- var chunkTTAITEPJ_cjs = require('./chunk-TTAITEPJ.cjs');
5
- var chunkXNLIZYRZ_cjs = require('./chunk-XNLIZYRZ.cjs');
3
+ var chunkPT7RIRIZ_cjs = require('./chunk-PT7RIRIZ.cjs');
4
+ var chunkQ3G6A4I3_cjs = require('./chunk-Q3G6A4I3.cjs');
5
+ var chunkDTVWX77L_cjs = require('./chunk-DTVWX77L.cjs');
6
6
  var chunkXBYVV3MP_cjs = require('./chunk-XBYVV3MP.cjs');
7
7
  var chunkCXBHOOIQ_cjs = require('./chunk-CXBHOOIQ.cjs');
8
8
  var chunkE4WNQBEF_cjs = require('./chunk-E4WNQBEF.cjs');
9
- var chunkQ7Q4WSLJ_cjs = require('./chunk-Q7Q4WSLJ.cjs');
9
+ var chunkMCLYU6BN_cjs = require('./chunk-MCLYU6BN.cjs');
10
10
  var chunkNI72YOJB_cjs = require('./chunk-NI72YOJB.cjs');
11
11
  var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
12
12
  var zod = require('zod');
13
13
 
14
14
  var FORMAT_VERSION = "2.0";
15
15
  var AcceptedFormatVersionSchema = zod.z.enum(["1.0", "2.0"]);
16
- var ValidityTimestampSchema = zod.z.iso.datetime().refine((value) => chunkQ7Q4WSLJ_cjs.isCanonicalIsoDate(value), {
16
+ var ValidityTimestampSchema = zod.z.iso.datetime().refine((value) => chunkMCLYU6BN_cjs.isCanonicalIsoDate(value), {
17
17
  message: "Expected canonical UTC ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ); convert with new Date(value).toISOString()."
18
18
  });
19
19
  var InterchangeNodeSchema = zod.z.object({
@@ -240,7 +240,7 @@ async function importGraph(store, data, rawOptions) {
240
240
  }
241
241
  async function withImportStreamLease(store, run) {
242
242
  const lease = chunkXBYVV3MP_cjs.acquireSerializedStreamLease(
243
- chunkTTAITEPJ_cjs.storeBackend(store),
243
+ chunkQ3G6A4I3_cjs.storeBackend(store),
244
244
  "import-stream"
245
245
  );
246
246
  if (!lease.acquired) {
@@ -263,13 +263,13 @@ async function importGraphData(store, data, options) {
263
263
  const errors = [];
264
264
  const graph = store.graph;
265
265
  const graphId = store.graphId;
266
- const backend = chunkTTAITEPJ_cjs.storeBackend(store);
267
- const runtime = chunkTTAITEPJ_cjs.storeRuntime(store);
266
+ const backend = chunkQ3G6A4I3_cjs.storeBackend(store);
267
+ const runtime = chunkQ3G6A4I3_cjs.storeRuntime(store);
268
268
  const registry = store.registry;
269
269
  const nodeSchemas = buildNodeSchemaMap(graph);
270
270
  const edgeSchemas = buildEdgeSchemaMap(graph);
271
271
  const importedNodeIds = /* @__PURE__ */ new Set();
272
- await chunkXNLIZYRZ_cjs.runInWriteTransaction(
272
+ await chunkDTVWX77L_cjs.runInWriteTransaction(
273
273
  {
274
274
  graphId,
275
275
  schemaVersion: store.introspect().schemaVersion,
@@ -332,7 +332,7 @@ async function importGraphData(store, data, options) {
332
332
  async function importGraphStream(store, chunks, rawOptions) {
333
333
  const options = ImportOptionsSchema.parse(rawOptions);
334
334
  const sourceBackend = exportStreamBackend(chunks);
335
- const targetBackend = chunkTTAITEPJ_cjs.storeBackend(store);
335
+ const targetBackend = chunkQ3G6A4I3_cjs.storeBackend(store);
336
336
  const contention = sourceBackend === void 0 ? void 0 : chunkXBYVV3MP_cjs.snapshotExportContention(sourceBackend, targetBackend);
337
337
  if (contention !== void 0) {
338
338
  throw serializedStreamRefusal({
@@ -589,7 +589,7 @@ function asIdentityImportError(assertions, graphId, error) {
589
589
  }
590
590
  function taggedAssertion(assertions, error) {
591
591
  if (typeof error !== "object" || error === null) return void 0;
592
- const id = error[chunkXNLIZYRZ_cjs.IDENTITY_IMPORT_FAILED_ASSERTION];
592
+ const id = error[chunkDTVWX77L_cjs.IDENTITY_IMPORT_FAILED_ASSERTION];
593
593
  if (typeof id !== "string") return void 0;
594
594
  return assertions.find((candidate) => candidate.id === id);
595
595
  }
@@ -620,7 +620,7 @@ function identityImportProgress(error) {
620
620
  if (typeof error !== "object" || error === null) {
621
621
  return { created: 0, skipped: 0 };
622
622
  }
623
- const progress = error[chunkXNLIZYRZ_cjs.IDENTITY_IMPORT_PROGRESS];
623
+ const progress = error[chunkDTVWX77L_cjs.IDENTITY_IMPORT_PROGRESS];
624
624
  if (typeof progress !== "object" || progress === null || !("created" in progress) || typeof progress.created !== "number" || !("skipped" in progress) || typeof progress.skipped !== "number") {
625
625
  return { created: 0, skipped: 0 };
626
626
  }
@@ -822,8 +822,8 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
822
822
  registerAppliedNodeUpdate,
823
823
  seedNodeRow,
824
824
  seedUniqueRow
825
- } = chunk7GT72YHH_cjs.createNodeBatchValidationBackend(graphId, registry, backend);
826
- await chunk7GT72YHH_cjs.primeBatchValidationCaches(
825
+ } = chunkPT7RIRIZ_cjs.createNodeBatchValidationBackend(graphId, registry, backend);
826
+ await chunkPT7RIRIZ_cjs.primeBatchValidationCaches(
827
827
  { graphId, registry },
828
828
  candidates.map((candidate) => candidate.draft),
829
829
  backend,
@@ -906,7 +906,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
906
906
  continue;
907
907
  }
908
908
  const uniquenessResult = await catchUniquenessError(
909
- () => chunkTTAITEPJ_cjs.checkUniquenessConstraints(
909
+ () => chunkQ3G6A4I3_cjs.checkUniquenessConstraints(
910
910
  { graphId, registry, backend: validationBackend },
911
911
  node.kind,
912
912
  node.id,
@@ -933,7 +933,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
933
933
  } else {
934
934
  await backend.insertNodesBatch(insertParamsList);
935
935
  }
936
- await chunkTTAITEPJ_cjs.applyNodeInsertSideEffectsBatch(
936
+ await chunkQ3G6A4I3_cjs.applyNodeInsertSideEffectsBatch(
937
937
  writeContext,
938
938
  accepted.map((candidate) => ({
939
939
  kind: candidate.node.kind,
@@ -988,7 +988,7 @@ var NODE_UPDATE_TARGET_CHANGED_CODE = "INTERCHANGE_NODE_UPDATE_TARGET_CHANGED";
988
988
  async function updateImportedNode(writeContext, backend, node, args) {
989
989
  try {
990
990
  const result = await catchUniquenessError(
991
- () => chunkTTAITEPJ_cjs.applyNodeUpdate(
991
+ () => chunkQ3G6A4I3_cjs.applyNodeUpdate(
992
992
  writeContext,
993
993
  {
994
994
  existing: args.existing,
@@ -1069,12 +1069,12 @@ function windowErrorOf(assert) {
1069
1069
  }
1070
1070
  function validateValidityWindow(entity) {
1071
1071
  return windowErrorOf(() => {
1072
- chunkQ7Q4WSLJ_cjs.validateOptionalCanonicalIsoDate(
1072
+ chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(
1073
1073
  entity.validFrom ?? void 0,
1074
1074
  "validFrom"
1075
1075
  );
1076
- chunkQ7Q4WSLJ_cjs.validateOptionalCanonicalIsoDate(entity.validTo, "validTo");
1077
- chunkQ7Q4WSLJ_cjs.assertOrderedValidityWindow(
1076
+ chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(entity.validTo, "validTo");
1077
+ chunkMCLYU6BN_cjs.assertOrderedValidityWindow(
1078
1078
  `${entity.kind} "${entity.id}"`,
1079
1079
  entity.validFrom ?? void 0,
1080
1080
  entity.validTo
@@ -1083,7 +1083,7 @@ function validateValidityWindow(entity) {
1083
1083
  }
1084
1084
  function validateUpdateValidityWindow(entity, storedValidFrom) {
1085
1085
  const verdict = windowResultOf(
1086
- () => chunkQ7Q4WSLJ_cjs.assertWritableValidityWindow(
1086
+ () => chunkMCLYU6BN_cjs.assertWritableValidityWindow(
1087
1087
  `${entity.kind} "${entity.id}"`,
1088
1088
  entity.validFrom ?? void 0,
1089
1089
  {
@@ -1161,7 +1161,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
1161
1161
  }
1162
1162
  }
1163
1163
  const uniquenessResult = await catchUniquenessError(
1164
- () => chunkTTAITEPJ_cjs.checkUniquenessConstraints(
1164
+ () => chunkQ3G6A4I3_cjs.checkUniquenessConstraints(
1165
1165
  { graphId, registry, backend },
1166
1166
  node.kind,
1167
1167
  node.id,
@@ -1180,7 +1180,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
1180
1180
  ...node.validFrom !== void 0 && { validFrom: node.validFrom },
1181
1181
  ...node.validTo !== void 0 && { validTo: node.validTo }
1182
1182
  });
1183
- await chunkTTAITEPJ_cjs.applyNodeInsertSideEffects(
1183
+ await chunkQ3G6A4I3_cjs.applyNodeInsertSideEffects(
1184
1184
  writeContext,
1185
1185
  {
1186
1186
  kind: node.kind,
@@ -1633,7 +1633,7 @@ function formatZodError(error) {
1633
1633
  }).join("; ");
1634
1634
  }
1635
1635
  function makeNodeKey(kind, id) {
1636
- return chunkXNLIZYRZ_cjs.encodeTupleKey([kind, id]);
1636
+ return chunkDTVWX77L_cjs.encodeTupleKey([kind, id]);
1637
1637
  }
1638
1638
 
1639
1639
  // src/interchange/export.ts
@@ -1676,7 +1676,7 @@ async function exportGraph(store, options) {
1676
1676
  };
1677
1677
  }
1678
1678
  function exportGraphStream(store, options) {
1679
- const backend = chunkTTAITEPJ_cjs.storeBackend(store);
1679
+ const backend = chunkQ3G6A4I3_cjs.storeBackend(store);
1680
1680
  return markExportStreamBackend(
1681
1681
  exportGraphStreamFromBackend(store, backend, options),
1682
1682
  backend
@@ -1792,7 +1792,7 @@ async function produceExportChunks(store, backend, options, emit) {
1792
1792
  type: "header",
1793
1793
  header: {
1794
1794
  formatVersion: FORMAT_VERSION,
1795
- exportedAt: chunkQ7Q4WSLJ_cjs.nowIso(),
1795
+ exportedAt: chunkMCLYU6BN_cjs.nowIso(),
1796
1796
  source: {
1797
1797
  type: "typegraph-export",
1798
1798
  graphId,
@@ -1829,7 +1829,7 @@ async function produceExportChunks(store, backend, options, emit) {
1829
1829
  if (store.graph.identity === void 0) return;
1830
1830
  let after;
1831
1831
  for (; ; ) {
1832
- const page = await chunkTTAITEPJ_cjs.storeRuntime(store).readIdentityAssertionPageAtTarget(
1832
+ const page = await chunkQ3G6A4I3_cjs.storeRuntime(store).readIdentityAssertionPageAtTarget(
1833
1833
  backend,
1834
1834
  options.identityMode,
1835
1835
  {
@@ -2078,5 +2078,5 @@ exports.importGraph = importGraph;
2078
2078
  exports.importGraphStream = importGraphStream;
2079
2079
  exports.serializedStreamRefusal = serializedStreamRefusal;
2080
2080
  exports.withImportStreamLease = withImportStreamLease;
2081
- //# sourceMappingURL=chunk-ONU3HIED.cjs.map
2082
- //# sourceMappingURL=chunk-ONU3HIED.cjs.map
2081
+ //# sourceMappingURL=chunk-CMWHLBVN.cjs.map
2082
+ //# sourceMappingURL=chunk-CMWHLBVN.cjs.map