@nicia-ai/typegraph 0.71.0 → 0.71.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 (46) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/backend/postgres/pglite-store.cjs +1 -1
  3. package/dist/backend/postgres/pglite-store.js +1 -1
  4. package/dist/backend/sqlite/local-store.cjs +1 -1
  5. package/dist/backend/sqlite/local-store.js +1 -1
  6. package/dist/{chunk-5YUJYIW3.cjs → chunk-D6J4Z423.cjs} +4 -4
  7. package/dist/{chunk-5YUJYIW3.cjs.map → chunk-D6J4Z423.cjs.map} +1 -1
  8. package/dist/{chunk-TKYOWV5U.js → chunk-EPXW4ONY.js} +5 -5
  9. package/dist/{chunk-TKYOWV5U.js.map → chunk-EPXW4ONY.js.map} +1 -1
  10. package/dist/{chunk-B33AHPS7.cjs → chunk-H3ULZVTX.cjs} +3 -3
  11. package/dist/{chunk-B33AHPS7.cjs.map → chunk-H3ULZVTX.cjs.map} +1 -1
  12. package/dist/{chunk-Z3MH5QUR.js → chunk-NMDDGDMQ.js} +3 -3
  13. package/dist/{chunk-Z3MH5QUR.js.map → chunk-NMDDGDMQ.js.map} +1 -1
  14. package/dist/{chunk-2PUJGVJ6.cjs → chunk-Q4MXRK6A.cjs} +9 -9
  15. package/dist/{chunk-2PUJGVJ6.cjs.map → chunk-Q4MXRK6A.cjs.map} +1 -1
  16. package/dist/{chunk-GW2DPIPL.js → chunk-U5RVSIFG.js} +3 -3
  17. package/dist/{chunk-GW2DPIPL.js.map → chunk-U5RVSIFG.js.map} +1 -1
  18. package/dist/{chunk-O64KMVIO.cjs → chunk-VUUIS5C7.cjs} +22 -22
  19. package/dist/{chunk-O64KMVIO.cjs.map → chunk-VUUIS5C7.cjs.map} +1 -1
  20. package/dist/{chunk-O7C44O4P.js → chunk-W2L5N4ES.js} +3 -3
  21. package/dist/{chunk-O7C44O4P.js.map → chunk-W2L5N4ES.js.map} +1 -1
  22. package/dist/{chunk-5E2PKOPM.js → chunk-XTHWIDRM.js} +4 -4
  23. package/dist/{chunk-5E2PKOPM.js.map → chunk-XTHWIDRM.js.map} +1 -1
  24. package/dist/{chunk-TVOQ2DGB.cjs → chunk-XZJDI4OR.cjs} +255 -255
  25. package/dist/{chunk-TVOQ2DGB.cjs.map → chunk-XZJDI4OR.cjs.map} +1 -1
  26. package/dist/{chunk-A7YKBSKQ.cjs → chunk-ZO72TBQE.cjs} +13 -13
  27. package/dist/{chunk-A7YKBSKQ.cjs.map → chunk-ZO72TBQE.cjs.map} +1 -1
  28. package/dist/{chunk-FFGW5GXR.js → chunk-ZX72XWSA.js} +3 -3
  29. package/dist/{chunk-FFGW5GXR.js.map → chunk-ZX72XWSA.js.map} +1 -1
  30. package/dist/graph-merge/index.cjs +31 -31
  31. package/dist/graph-merge/index.js +5 -5
  32. package/dist/index.cjs +52 -52
  33. package/dist/index.js +5 -5
  34. package/dist/interchange/index.cjs +26 -26
  35. package/dist/interchange/index.js +3 -3
  36. package/dist/{local-store-impl-MJR2DXZT.cjs → local-store-impl-VR7YQUMB.cjs} +7 -7
  37. package/dist/{local-store-impl-MJR2DXZT.cjs.map → local-store-impl-VR7YQUMB.cjs.map} +1 -1
  38. package/dist/{local-store-impl-U4MDR2N4.js → local-store-impl-Y3Q5HWSR.js} +6 -6
  39. package/dist/{local-store-impl-U4MDR2N4.js.map → local-store-impl-Y3Q5HWSR.js.map} +1 -1
  40. package/dist/{pglite-store-impl-RTAPLRQO.cjs → pglite-store-impl-NMSOMDPC.cjs} +7 -7
  41. package/dist/{pglite-store-impl-RTAPLRQO.cjs.map → pglite-store-impl-NMSOMDPC.cjs.map} +1 -1
  42. package/dist/{pglite-store-impl-QLLFPNO6.js → pglite-store-impl-QNGEP62P.js} +6 -6
  43. package/dist/{pglite-store-impl-QLLFPNO6.js.map → pglite-store-impl-QNGEP62P.js.map} +1 -1
  44. package/dist/schema/index.cjs +25 -25
  45. package/dist/schema/index.js +3 -3
  46. package/package.json +1 -1
@@ -2,15 +2,15 @@
2
2
 
3
3
  var chunkRQXQ2RK5_cjs = require('./chunk-RQXQ2RK5.cjs');
4
4
  var chunkB5C2V2LN_cjs = require('./chunk-B5C2V2LN.cjs');
5
- var chunk2PUJGVJ6_cjs = require('./chunk-2PUJGVJ6.cjs');
5
+ var chunkQ4MXRK6A_cjs = require('./chunk-Q4MXRK6A.cjs');
6
6
  var chunkRFRKNBIO_cjs = require('./chunk-RFRKNBIO.cjs');
7
7
  var chunk4DI7FJG6_cjs = require('./chunk-4DI7FJG6.cjs');
8
8
  var chunkRJHEBE5W_cjs = require('./chunk-RJHEBE5W.cjs');
9
9
  var chunkR255UE5U_cjs = require('./chunk-R255UE5U.cjs');
10
10
  var chunkAY2X2567_cjs = require('./chunk-AY2X2567.cjs');
11
- var chunkA7YKBSKQ_cjs = require('./chunk-A7YKBSKQ.cjs');
11
+ var chunkZO72TBQE_cjs = require('./chunk-ZO72TBQE.cjs');
12
12
  var chunk6YKISECL_cjs = require('./chunk-6YKISECL.cjs');
13
- var chunkB33AHPS7_cjs = require('./chunk-B33AHPS7.cjs');
13
+ var chunkH3ULZVTX_cjs = require('./chunk-H3ULZVTX.cjs');
14
14
  var chunkQEXVOTI2_cjs = require('./chunk-QEXVOTI2.cjs');
15
15
  var chunkXFX3Z5R7_cjs = require('./chunk-XFX3Z5R7.cjs');
16
16
  var chunkMYE7SL75_cjs = require('./chunk-MYE7SL75.cjs');
@@ -4529,7 +4529,7 @@ function neighborOutputNames() {
4529
4529
  ];
4530
4530
  }
4531
4531
  function mapEdge(row) {
4532
- return chunk2PUJGVJ6_cjs.rowToEdge({
4532
+ return chunkQ4MXRK6A_cjs.rowToEdge({
4533
4533
  id: String(row["edge_id"]),
4534
4534
  kind: String(row["edge_kind"]),
4535
4535
  from_kind: String(row["edge_from_kind"]),
@@ -4557,7 +4557,7 @@ function mapEdge(row) {
4557
4557
  });
4558
4558
  }
4559
4559
  function mapNode(row) {
4560
- return chunk2PUJGVJ6_cjs.rowToNode({
4560
+ return chunkQ4MXRK6A_cjs.rowToNode({
4561
4561
  id: String(row["node_id"]),
4562
4562
  kind: String(row["node_kind"]),
4563
4563
  props: row["node_props"],
@@ -5559,7 +5559,7 @@ function mapSubgraphNodeRow(row, projectionPlan) {
5559
5559
  const kindPlan = projectionPlan.projectedKinds.get(row.kind);
5560
5560
  if (kindPlan === void 0) {
5561
5561
  const normalizedRow = normalizeSubgraphRowTimestamps(row);
5562
- return chunk2PUJGVJ6_cjs.rowToNode({
5562
+ return chunkQ4MXRK6A_cjs.rowToNode({
5563
5563
  ...normalizedRow,
5564
5564
  props: normalizeProps(normalizedRow.props)
5565
5565
  });
@@ -5569,7 +5569,7 @@ function mapSubgraphNodeRow(row, projectionPlan) {
5569
5569
  id: row.id
5570
5570
  };
5571
5571
  if (kindPlan.includeMeta) {
5572
- projectedNode["meta"] = chunk2PUJGVJ6_cjs.rowToNodeMeta(normalizeSubgraphRowTimestamps(row));
5572
+ projectedNode["meta"] = chunkQ4MXRK6A_cjs.rowToNodeMeta(normalizeSubgraphRowTimestamps(row));
5573
5573
  }
5574
5574
  applyProjectedFields(projectedNode, row, kindPlan);
5575
5575
  return projectedNode;
@@ -5578,7 +5578,7 @@ function mapSubgraphEdgeRow(row, projectionPlan) {
5578
5578
  const kindPlan = projectionPlan.projectedKinds.get(row.kind);
5579
5579
  if (kindPlan === void 0) {
5580
5580
  const normalizedRow = normalizeSubgraphRowTimestamps(row);
5581
- return chunk2PUJGVJ6_cjs.rowToEdge({
5581
+ return chunkQ4MXRK6A_cjs.rowToEdge({
5582
5582
  ...normalizedRow,
5583
5583
  props: normalizeProps(normalizedRow.props)
5584
5584
  });
@@ -5592,7 +5592,7 @@ function mapSubgraphEdgeRow(row, projectionPlan) {
5592
5592
  toId: row.to_id
5593
5593
  };
5594
5594
  if (kindPlan.includeMeta) {
5595
- projectedEdge["meta"] = chunk2PUJGVJ6_cjs.rowToEdgeMeta(normalizeSubgraphRowTimestamps(row));
5595
+ projectedEdge["meta"] = chunkQ4MXRK6A_cjs.rowToEdgeMeta(normalizeSubgraphRowTimestamps(row));
5596
5596
  }
5597
5597
  applyProjectedFields(projectedEdge, row, kindPlan);
5598
5598
  return projectedEdge;
@@ -7368,12 +7368,12 @@ function buildCursorPredicate(cursorData, orderBy, direction, targetAlias) {
7368
7368
  const spec = chunkBXHAPCQG_cjs.requireDefined(orderBy[index_]);
7369
7369
  const value = values[index_];
7370
7370
  andConditions.push(
7371
- buildEqualityPredicate(chunkB33AHPS7_cjs.requireCursorField(spec.field), value)
7371
+ buildEqualityPredicate(chunkH3ULZVTX_cjs.requireCursorField(spec.field), value)
7372
7372
  );
7373
7373
  }
7374
7374
  const currentSpec = chunkBXHAPCQG_cjs.requireDefined(orderBy[index]);
7375
7375
  const comparison = buildPositionPredicate(
7376
- chunkB33AHPS7_cjs.requireCursorField(currentSpec.field),
7376
+ chunkH3ULZVTX_cjs.requireCursorField(currentSpec.field),
7377
7377
  currentSpec,
7378
7378
  values[index],
7379
7379
  direction === "forward" ? "after" : "before"
@@ -7387,7 +7387,7 @@ function buildCursorPredicate(cursorData, orderBy, direction, targetAlias) {
7387
7387
  }
7388
7388
  }
7389
7389
  const expression = orConditions.length === 0 ? buildImpossiblePredicate(
7390
- chunkB33AHPS7_cjs.requireCursorField(chunkBXHAPCQG_cjs.requireDefined(orderBy[0]).field)
7390
+ chunkH3ULZVTX_cjs.requireCursorField(chunkBXHAPCQG_cjs.requireDefined(orderBy[0]).field)
7391
7391
  ) : orConditions.length === 1 ? chunkBXHAPCQG_cjs.requireDefined(orConditions[0]) : { __type: "or", predicates: orConditions };
7392
7392
  return {
7393
7393
  targetAlias,
@@ -7403,7 +7403,7 @@ function buildTupleComparisonPredicate(values, orderBy, direction) {
7403
7403
  )) {
7404
7404
  return;
7405
7405
  }
7406
- const fields = orderBy.map((spec) => chunkB33AHPS7_cjs.requireCursorField(spec.field));
7406
+ const fields = orderBy.map((spec) => chunkH3ULZVTX_cjs.requireCursorField(spec.field));
7407
7407
  const tupleValues = values.map((value) => ({
7408
7408
  __type: "literal",
7409
7409
  value
@@ -7467,7 +7467,7 @@ function buildImpossiblePredicate(field2) {
7467
7467
  };
7468
7468
  }
7469
7469
  function buildCursorFromContext(context, orderBy, direction) {
7470
- return chunkB33AHPS7_cjs.buildCursorFromRow(context, orderBy, direction);
7470
+ return chunkH3ULZVTX_cjs.buildCursorFromRow(context, orderBy, direction);
7471
7471
  }
7472
7472
  function buildPaginatedResult(data, orderedRows, orderBy, limit, hasMore, isBackward, cursor, buildContext2) {
7473
7473
  return buildPaginatedResultFromRows(
@@ -9642,7 +9642,7 @@ function buildCompileOptions(config) {
9642
9642
  orderedAggregates: config.backend === void 0 ? false : config.backend.capabilities.orderedAggregates === true,
9643
9643
  recursiveTraversal: config.backend === void 0 ? COMPILER_DEFAULT_RECURSIVE_TRAVERSAL : chunkAZ2Q6RRS_cjs.resolveRecursiveTraversal(config.backend.capabilities),
9644
9644
  identitySameIdAcrossKinds: config.identitySameIdAcrossKinds,
9645
- identityRegisteredKinds: [...chunkB33AHPS7_cjs.identityActiveKinds(config.registry)],
9645
+ identityRegisteredKinds: [...chunkH3ULZVTX_cjs.identityActiveKinds(config.registry)],
9646
9646
  ...fulltextStrategy === void 0 ? {} : {
9647
9647
  fulltextStrategy,
9648
9648
  ...fulltextStrategy === false ? {} : { fulltextLanguages: buildFulltextLanguages(config.registry) }
@@ -10878,7 +10878,7 @@ var ExecutableQuery = class _ExecutableQuery {
10878
10878
  row,
10879
10879
  selectiveFields
10880
10880
  );
10881
- return chunkB33AHPS7_cjs.buildCursorFromRow(contextRow, this.#paginationOrderBy(), direction);
10881
+ return chunkH3ULZVTX_cjs.buildCursorFromRow(contextRow, this.#paginationOrderBy(), direction);
10882
10882
  }
10883
10883
  #buildCursorContextFromSelectiveRow(row, selectiveFields) {
10884
10884
  const outputNameByAliasField = /* @__PURE__ */ new Map();
@@ -10994,7 +10994,7 @@ var ExecutableQuery = class _ExecutableQuery {
10994
10994
  #paginationOrderBy() {
10995
10995
  const orderBy = this.#state.orderBy.map((order) => ({
10996
10996
  ...order,
10997
- field: chunkB33AHPS7_cjs.requireCursorField(order.field)
10997
+ field: chunkH3ULZVTX_cjs.requireCursorField(order.field)
10998
10998
  }));
10999
10999
  const startAlias = this.#state.startAlias;
11000
11000
  function hasSystemOrder(fieldName) {
@@ -11067,8 +11067,8 @@ var ExecutableQuery = class _ExecutableQuery {
11067
11067
  const cursor = options.after ?? options.before;
11068
11068
  let cursorData;
11069
11069
  if (cursor) {
11070
- cursorData = chunkB33AHPS7_cjs.decodeCursor(cursor);
11071
- chunkB33AHPS7_cjs.validateCursorColumns(cursorData, this.#paginationOrderBy());
11070
+ cursorData = chunkH3ULZVTX_cjs.decodeCursor(cursor);
11071
+ chunkH3ULZVTX_cjs.validateCursorColumns(cursorData, this.#paginationOrderBy());
11072
11072
  }
11073
11073
  const fetchLimit = limit + 1;
11074
11074
  const direction = isBackward ? "backward" : "forward";
@@ -11150,9 +11150,9 @@ var ExecutableQuery = class _ExecutableQuery {
11150
11150
  const pageLimit = pageOptions.first ?? pageOptions.last ?? chunkNAUA4PW5_cjs.DEFAULT_PAGINATION_LIMIT;
11151
11151
  const cursor = pageOptions.after ?? pageOptions.before;
11152
11152
  const paginationOrderBy = this.#paginationOrderBy();
11153
- const cursorData = cursor === void 0 ? void 0 : chunkB33AHPS7_cjs.decodeCursor(cursor);
11153
+ const cursorData = cursor === void 0 ? void 0 : chunkH3ULZVTX_cjs.decodeCursor(cursor);
11154
11154
  if (cursorData !== void 0)
11155
- chunkB33AHPS7_cjs.validateCursorColumns(cursorData, paginationOrderBy);
11155
+ chunkH3ULZVTX_cjs.validateCursorColumns(cursorData, paginationOrderBy);
11156
11156
  const direction = isBackward ? "backward" : "forward";
11157
11157
  const orderBy = adjustOrderByForDirection(paginationOrderBy, direction);
11158
11158
  const predicates = cursorData === void 0 ? this.#state.predicates : [
@@ -11185,7 +11185,7 @@ var ExecutableQuery = class _ExecutableQuery {
11185
11185
  (_spec, index) => oneStatementBatchOrderColumn(index)
11186
11186
  );
11187
11187
  function cursorFromRow(row, cursorDirection) {
11188
- return chunkB33AHPS7_cjs.buildCursorFromValues(
11188
+ return chunkH3ULZVTX_cjs.buildCursorFromValues(
11189
11189
  cursorOutputNames.map((outputName) => row[outputName]),
11190
11190
  paginationOrderBy,
11191
11191
  cursorDirection
@@ -15970,7 +15970,7 @@ async function executeHybridSearch(ctx, nodeKind, options) {
15970
15970
  ...candidates === void 0 ? {} : { candidates }
15971
15971
  });
15972
15972
  return rows.map((row, index) => {
15973
- const typedNode = chunk2PUJGVJ6_cjs.rowToNode(row.node);
15973
+ const typedNode = chunkQ4MXRK6A_cjs.rowToNode(row.node);
15974
15974
  return {
15975
15975
  node: typedNode,
15976
15976
  score: row.fusedScore,
@@ -16249,13 +16249,13 @@ async function fetchNodesByIds(backend, batchPointRead, graphId, nodeKind, ids)
16249
16249
  const rows = await bound.getNodes(graphId, nodeKind, ids);
16250
16250
  for (const row of rows) {
16251
16251
  if (row.deleted_at !== void 0) continue;
16252
- map.set(row.id, chunk2PUJGVJ6_cjs.rowToNode(row));
16252
+ map.set(row.id, chunkQ4MXRK6A_cjs.rowToNode(row));
16253
16253
  }
16254
16254
  return map;
16255
16255
  }
16256
16256
  for (const id of ids) {
16257
16257
  const row = await backend.getNode(graphId, nodeKind, id);
16258
- if (row && row.deleted_at === void 0) map.set(row.id, chunk2PUJGVJ6_cjs.rowToNode(row));
16258
+ if (row && row.deleted_at === void 0) map.set(row.id, chunkQ4MXRK6A_cjs.rowToNode(row));
16259
16259
  }
16260
16260
  return map;
16261
16261
  }
@@ -16428,7 +16428,7 @@ function normalizePageSize(pageSize) {
16428
16428
  return resolved;
16429
16429
  }
16430
16430
  function decodeValidationCursor(cursor) {
16431
- const decoded = chunkB33AHPS7_cjs.decodeCursor(cursor);
16431
+ const decoded = chunkH3ULZVTX_cjs.decodeCursor(cursor);
16432
16432
  if (decoded.d !== "f" || decoded.cols.length !== VALIDATION_CURSOR_COLUMNS.length || !decoded.cols.every(
16433
16433
  (column, index) => column === VALIDATION_CURSOR_COLUMNS[index]
16434
16434
  )) {
@@ -16450,7 +16450,7 @@ function decodeValidationCursor(cursor) {
16450
16450
  return { entity, kind, schemaFence, afterId };
16451
16451
  }
16452
16452
  function encodeValidationCursor(cursor) {
16453
- return chunkB33AHPS7_cjs.encodeCursor({
16453
+ return chunkH3ULZVTX_cjs.encodeCursor({
16454
16454
  v: 1,
16455
16455
  d: "f",
16456
16456
  cols: VALIDATION_CURSOR_COLUMNS,
@@ -17187,7 +17187,7 @@ async function prepareEvolutionPlan(params) {
17187
17187
  extension: callerExtension
17188
17188
  } = params;
17189
17189
  const extension = chunkBXHAPCQG_cjs.freezeDeep(structuredClone(callerExtension));
17190
- const mergedGraph = chunkA7YKBSKQ_cjs.mergeGraphExtension(baselineGraph, extension);
17190
+ const mergedGraph = chunkZO72TBQE_cjs.mergeGraphExtension(baselineGraph, extension);
17191
17191
  if (mergedGraph === baselineGraph) {
17192
17192
  const baseline = Object.freeze({
17193
17193
  version: baselineVersion,
@@ -17213,7 +17213,7 @@ async function prepareEvolutionPlan(params) {
17213
17213
  baselineGraph.id
17214
17214
  );
17215
17215
  }
17216
- const prepared = await chunkA7YKBSKQ_cjs.prepareNewSchemaVersion(
17216
+ const prepared = await chunkZO72TBQE_cjs.prepareNewSchemaVersion(
17217
17217
  mergedGraph,
17218
17218
  baselineVersion,
17219
17219
  storedSchema
@@ -20259,18 +20259,18 @@ function lowerBoundRequiresWrite(requested, stored) {
20259
20259
  return requestedValidFrom !== void 0 && requestedValidFrom !== null && !chunk3XJGYE66_cjs.isCanonicalIsoDate(requestedValidFrom);
20260
20260
  }
20261
20261
  function upsertWindowChanges(requested, current) {
20262
- return lowerBoundRequiresWrite(requested, current.valid_from) || requested?.clearValidTo === true && chunk2PUJGVJ6_cjs.validityEndAfterMutation(requested, current.valid_to) !== current.valid_to || requested?.clearValidTo === true && requested.validTo !== void 0 || windowFieldChanges("validTo", requested?.validTo, current.valid_to);
20262
+ return lowerBoundRequiresWrite(requested, current.valid_from) || requested?.clearValidTo === true && chunkQ4MXRK6A_cjs.validityEndAfterMutation(requested, current.valid_to) !== current.valid_to || requested?.clearValidTo === true && requested.validTo !== void 0 || windowFieldChanges("validTo", requested?.validTo, current.valid_to);
20263
20263
  }
20264
20264
  function windowAfterUpsertCreate(requested) {
20265
20265
  return {
20266
20266
  valid_from: requested.validFrom === null ? void 0 : requested.validFrom ?? UNKNOWN_VALIDITY_LOWER_BOUND,
20267
- valid_to: chunk2PUJGVJ6_cjs.validityEndAfterMutation(requested, void 0)
20267
+ valid_to: chunkQ4MXRK6A_cjs.validityEndAfterMutation(requested, void 0)
20268
20268
  };
20269
20269
  }
20270
20270
  function windowAfterUpsertUpdate(current, requested) {
20271
20271
  return {
20272
20272
  valid_from: current.valid_from,
20273
- valid_to: chunk2PUJGVJ6_cjs.validityEndAfterMutation(requested, current.valid_to)
20273
+ valid_to: chunkQ4MXRK6A_cjs.validityEndAfterMutation(requested, current.valid_to)
20274
20274
  };
20275
20275
  }
20276
20276
  function shouldCoalesceUpsert(existing, options, runDirtyCheck) {
@@ -20586,13 +20586,13 @@ function createEdgeCollection(config) {
20586
20586
  async bulkUpsertById(items) {
20587
20587
  if (items.length === 0) return [];
20588
20588
  for (const item of items) {
20589
- chunk2PUJGVJ6_cjs.assertValidityEndMutation(item, {
20589
+ chunkQ4MXRK6A_cjs.assertValidityEndMutation(item, {
20590
20590
  entityType: "edge",
20591
20591
  kind,
20592
20592
  id: item.id
20593
20593
  });
20594
20594
  if (item.clearValidTo === true) {
20595
- chunk2PUJGVJ6_cjs.assertClearValidToSupported(backend, "edge");
20595
+ chunkQ4MXRK6A_cjs.assertClearValidToSupported(backend, "edge");
20596
20596
  }
20597
20597
  }
20598
20598
  const upsertAll = async (target) => {
@@ -20765,7 +20765,7 @@ function createEdgeCollection(config) {
20765
20765
  }
20766
20766
  return { results: results2, mutations: toCreate.length + toUpdate.length };
20767
20767
  };
20768
- const { results, mutations } = await chunk2PUJGVJ6_cjs.runResolvedMutationSetConverging(
20768
+ const { results, mutations } = await chunkQ4MXRK6A_cjs.runResolvedMutationSetConverging(
20769
20769
  "edge",
20770
20770
  backend,
20771
20771
  () => chunkAZ2Q6RRS_cjs.runOptionallyInTransaction(backend, (target) => upsertAll(target))
@@ -20795,7 +20795,7 @@ function createEdgeCollection(config) {
20795
20795
  return result === void 0 ? void 0 : narrowEdge(result);
20796
20796
  },
20797
20797
  async getOrCreateByEndpoints(from, to, props, options) {
20798
- chunk2PUJGVJ6_cjs.assertValidityEndMutation(options ?? {}, {
20798
+ chunkQ4MXRK6A_cjs.assertValidityEndMutation(options ?? {}, {
20799
20799
  entityType: "edge",
20800
20800
  kind
20801
20801
  });
@@ -20830,7 +20830,7 @@ function createEdgeCollection(config) {
20830
20830
  async bulkGetOrCreateByEndpoints(items, options) {
20831
20831
  if (items.length === 0) return [];
20832
20832
  for (const item of items) {
20833
- chunk2PUJGVJ6_cjs.assertValidityEndMutation(item, {
20833
+ chunkQ4MXRK6A_cjs.assertValidityEndMutation(item, {
20834
20834
  entityType: "edge",
20835
20835
  kind
20836
20836
  });
@@ -21202,13 +21202,13 @@ function createNodeCollection(config) {
21202
21202
  return this.upsertByIdFromRecord(id, props, options);
21203
21203
  },
21204
21204
  async upsertByIdFromRecord(id, data, options) {
21205
- chunk2PUJGVJ6_cjs.assertValidityEndMutation(options ?? {}, {
21205
+ chunkQ4MXRK6A_cjs.assertValidityEndMutation(options ?? {}, {
21206
21206
  entityType: "node",
21207
21207
  kind,
21208
21208
  id
21209
21209
  });
21210
21210
  if (options?.clearValidTo === true) {
21211
- chunk2PUJGVJ6_cjs.assertClearValidToSupported(backend, "node");
21211
+ chunkQ4MXRK6A_cjs.assertClearValidToSupported(backend, "node");
21212
21212
  }
21213
21213
  const existing = await backend.getNode(graphId, kind, id);
21214
21214
  const coalesces = (row) => {
@@ -21281,7 +21281,7 @@ function createNodeCollection(config) {
21281
21281
  await config.maybeRefreshStatisticsAfterBulk?.(attempt.value.length);
21282
21282
  return narrowNodes(attempt.value);
21283
21283
  }
21284
- const results = await chunk2PUJGVJ6_cjs.runResolvedMutationSetConverging(
21284
+ const results = await chunkQ4MXRK6A_cjs.runResolvedMutationSetConverging(
21285
21285
  "node",
21286
21286
  backend,
21287
21287
  () => chunkAZ2Q6RRS_cjs.runOptionallyInTransaction(backend, async (target) => {
@@ -21332,13 +21332,13 @@ function createNodeCollection(config) {
21332
21332
  async bulkUpsertById(items) {
21333
21333
  if (items.length === 0) return [];
21334
21334
  for (const item of items) {
21335
- chunk2PUJGVJ6_cjs.assertValidityEndMutation(item, {
21335
+ chunkQ4MXRK6A_cjs.assertValidityEndMutation(item, {
21336
21336
  entityType: "node",
21337
21337
  kind,
21338
21338
  id: item.id
21339
21339
  });
21340
21340
  if (item.clearValidTo === true) {
21341
- chunk2PUJGVJ6_cjs.assertClearValidToSupported(backend, "node");
21341
+ chunkQ4MXRK6A_cjs.assertClearValidToSupported(backend, "node");
21342
21342
  }
21343
21343
  }
21344
21344
  const upsertAll = async (target) => {
@@ -21478,7 +21478,7 @@ function createNodeCollection(config) {
21478
21478
  }
21479
21479
  return { results: results2, mutations: toCreate.length + toUpdate.length };
21480
21480
  };
21481
- const { results, mutations } = await chunk2PUJGVJ6_cjs.runResolvedMutationSetConverging(
21481
+ const { results, mutations } = await chunkQ4MXRK6A_cjs.runResolvedMutationSetConverging(
21482
21482
  "node",
21483
21483
  backend,
21484
21484
  () => chunkAZ2Q6RRS_cjs.runOptionallyInTransaction(backend, (target) => upsertAll(target))
@@ -21873,7 +21873,7 @@ function createHistoryStoreBackendProjection(backend) {
21873
21873
  // src/store/introspect.ts
21874
21874
  function introspectSchema(graph, context) {
21875
21875
  const extension = graph.extension;
21876
- const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkA7YKBSKQ_cjs.extensionKindNames(extension);
21876
+ const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkZO72TBQE_cjs.extensionKindNames(extension);
21877
21877
  const deprecated = graph.deprecatedKinds;
21878
21878
  const kinds = [];
21879
21879
  for (const [name, registration] of Object.entries(graph.nodes)) {
@@ -21910,12 +21910,12 @@ function introspectSchema(graph, context) {
21910
21910
  deprecated: deprecated.has(name)
21911
21911
  });
21912
21912
  }
21913
- const runtimeOntologyKeys = chunkA7YKBSKQ_cjs.buildGraphExtensionOntologyKeySet(extension);
21913
+ const runtimeOntologyKeys = chunkZO72TBQE_cjs.buildGraphExtensionOntologyKeySet(extension);
21914
21914
  const ontology = graph.ontology.map((relation) => ({
21915
21915
  metaEdge: relation.metaEdge.name,
21916
21916
  from: chunkHRVGTDMK_cjs.getTypeName(relation.from),
21917
21917
  to: chunkHRVGTDMK_cjs.getTypeName(relation.to),
21918
- origin: runtimeOntologyKeys.has(chunkA7YKBSKQ_cjs.compileTimeOntologyKey(relation)) ? "runtime" : "compile-time"
21918
+ origin: runtimeOntologyKeys.has(chunkZO72TBQE_cjs.compileTimeOntologyKey(relation)) ? "runtime" : "compile-time"
21919
21919
  }));
21920
21920
  return {
21921
21921
  graphId: context.graphId,
@@ -22672,7 +22672,7 @@ async function materializeRemovals(context, options = {}) {
22672
22672
  await ensureFocusedStatusTable(backend, backend.ensureKindRemovalsTable);
22673
22673
  await reconcilePendingRemovals(context);
22674
22674
  const activeRow = await backend.getActiveSchema(graphId);
22675
- const activeSchema = activeRow === void 0 ? void 0 : chunkA7YKBSKQ_cjs.parseSerializedSchema(activeRow.schema_doc);
22675
+ const activeSchema = activeRow === void 0 ? void 0 : chunkZO72TBQE_cjs.parseSerializedSchema(activeRow.schema_doc);
22676
22676
  const reclaimedVectorFields = await reclaimRemovedVectorFieldTables(
22677
22677
  context,
22678
22678
  activeRow
@@ -22741,14 +22741,14 @@ async function reconcilePendingRemovals(context) {
22741
22741
  const reconciliations = [];
22742
22742
  const stopAtVersion = marker ?? 1;
22743
22743
  let currentRow = activeRow;
22744
- let currentSchema = chunkA7YKBSKQ_cjs.parseSerializedSchema(activeRow.schema_doc);
22744
+ let currentSchema = chunkZO72TBQE_cjs.parseSerializedSchema(activeRow.schema_doc);
22745
22745
  while (currentRow.version > stopAtVersion) {
22746
22746
  const priorRow = await backend.getSchemaVersion(
22747
22747
  graphId,
22748
22748
  currentRow.version - 1
22749
22749
  );
22750
22750
  if (priorRow === void 0) break;
22751
- const priorSchema = chunkA7YKBSKQ_cjs.parseSerializedSchema(priorRow.schema_doc);
22751
+ const priorSchema = chunkZO72TBQE_cjs.parseSerializedSchema(priorRow.schema_doc);
22752
22752
  for (const entity of ENTITY_KINDS) {
22753
22753
  const priorEntries = priorSchema[entity === "node" ? "nodes" : "edges"];
22754
22754
  const currentEntries = currentSchema[entity === "node" ? "nodes" : "edges"];
@@ -22813,7 +22813,7 @@ async function materializeOne2(row, ctx) {
22813
22813
  ctx.graphId,
22814
22814
  async (target) => {
22815
22815
  const activeRow = await target.getActiveSchema(ctx.graphId);
22816
- const activeSchema = activeRow === void 0 ? void 0 : chunkA7YKBSKQ_cjs.parseSerializedSchema(activeRow.schema_doc);
22816
+ const activeSchema = activeRow === void 0 ? void 0 : chunkZO72TBQE_cjs.parseSerializedSchema(activeRow.schema_doc);
22817
22817
  if (liveKindNamesFrom(activeSchema)[row.entity].has(row.kindName)) {
22818
22818
  return "skipped";
22819
22819
  }
@@ -22976,7 +22976,7 @@ async function resolveRemovedKindEmbeddingSlots(backend, row) {
22976
22976
  if (priorVersion < 1) return [];
22977
22977
  const priorRow = await backend.getSchemaVersion(row.graphId, priorVersion);
22978
22978
  if (priorRow === void 0) return [];
22979
- const priorSchema = chunkA7YKBSKQ_cjs.parseSerializedSchema(priorRow.schema_doc);
22979
+ const priorSchema = chunkZO72TBQE_cjs.parseSerializedSchema(priorRow.schema_doc);
22980
22980
  const slots = /* @__PURE__ */ new Map();
22981
22981
  for (const declaration of priorSchema.indexes ?? []) {
22982
22982
  if (declaration.entity === "vector" && declaration.kind === row.kindName) {
@@ -23013,14 +23013,14 @@ async function reclaimRemovedVectorFieldTables(context, activeRow) {
23013
23013
  let perBackend = reclaimCache.get(backend);
23014
23014
  const cached = perBackend?.get(cacheKey);
23015
23015
  if (cached !== void 0) return cached;
23016
- const activeSchema = chunkA7YKBSKQ_cjs.parseSerializedSchema(activeRow.schema_doc);
23016
+ const activeSchema = chunkZO72TBQE_cjs.parseSerializedSchema(activeRow.schema_doc);
23017
23017
  const activeVectorFields = vectorFieldKeysFrom(activeSchema);
23018
23018
  const survivingKinds = new Set(Object.keys(activeSchema.nodes));
23019
23019
  const historical = /* @__PURE__ */ new Map();
23020
23020
  for (let version = activeRow.version - 1; version >= 1; version -= 1) {
23021
23021
  const priorRow = await backend.getSchemaVersion(graphId, version);
23022
23022
  if (priorRow === void 0) continue;
23023
- const priorSchema = chunkA7YKBSKQ_cjs.parseSerializedSchema(priorRow.schema_doc);
23023
+ const priorSchema = chunkZO72TBQE_cjs.parseSerializedSchema(priorRow.schema_doc);
23024
23024
  for (const declaration of priorSchema.indexes ?? []) {
23025
23025
  if (declaration.entity !== "vector") continue;
23026
23026
  const key = vectorFieldKey(declaration.kind, declaration.fieldPath);
@@ -23058,7 +23058,7 @@ async function reclaimRemovedVectorFieldTables(context, activeRow) {
23058
23058
  async (target) => {
23059
23059
  const lockedActiveRow = await target.getActiveSchema(graphId);
23060
23060
  if (lockedActiveRow === void 0) return false;
23061
- const lockedActiveSchema = chunkA7YKBSKQ_cjs.parseSerializedSchema(
23061
+ const lockedActiveSchema = chunkZO72TBQE_cjs.parseSerializedSchema(
23062
23062
  lockedActiveRow.schema_doc
23063
23063
  );
23064
23064
  const lockedVectorFields = vectorFieldKeysFrom(lockedActiveSchema);
@@ -23183,7 +23183,7 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend, options) {
23183
23183
  const toKind = input.toKind;
23184
23184
  const registration = getEdgeRegistration(ctx.graph, kind);
23185
23185
  const edgeKind = registration.type;
23186
- chunkB33AHPS7_cjs.assertEdgeMatchIdentityBackendSupport(
23186
+ chunkH3ULZVTX_cjs.assertEdgeMatchIdentityBackendSupport(
23187
23187
  registration.matchIdentity,
23188
23188
  backend.capabilities,
23189
23189
  kind
@@ -23211,7 +23211,7 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend, options) {
23211
23211
  kind,
23212
23212
  operation: "create"
23213
23213
  });
23214
- const matchIdentity = chunk2PUJGVJ6_cjs.resolveEdgeMatchIdentityStorage(
23214
+ const matchIdentity = chunkQ4MXRK6A_cjs.resolveEdgeMatchIdentityStorage(
23215
23215
  registration.matchIdentity,
23216
23216
  {
23217
23217
  fromKind,
@@ -23235,7 +23235,7 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend, options) {
23235
23235
  backend
23236
23236
  };
23237
23237
  if (options?.validateCardinality ?? true) {
23238
- await chunk2PUJGVJ6_cjs.checkCardinalityConstraint(
23238
+ await chunkQ4MXRK6A_cjs.checkCardinalityConstraint(
23239
23239
  constraintContext,
23240
23240
  kind,
23241
23241
  cardinality,
@@ -23287,7 +23287,7 @@ function createdEdgeResult(edge) {
23287
23287
  return { outcome: "created", edge };
23288
23288
  }
23289
23289
  function foundEdgeResult(row) {
23290
- return { outcome: "found", edge: chunk2PUJGVJ6_cjs.rowToEdge(row), row };
23290
+ return { outcome: "found", edge: chunkQ4MXRK6A_cjs.rowToEdge(row), row };
23291
23291
  }
23292
23292
  function edgeCreateDidWrite(result) {
23293
23293
  return result.outcome === "created";
@@ -23332,7 +23332,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
23332
23332
  const kind = input.kind;
23333
23333
  const id = input.id ?? chunkQEXVOTI2_cjs.generateId();
23334
23334
  const registration = getEdgeRegistration(ctx.graph, kind);
23335
- chunkB33AHPS7_cjs.assertEdgeMatchIdentityBackendSupport(
23335
+ chunkH3ULZVTX_cjs.assertEdgeMatchIdentityBackendSupport(
23336
23336
  registration.matchIdentity,
23337
23337
  backend.capabilities,
23338
23338
  kind
@@ -23351,13 +23351,13 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
23351
23351
  convergesDynamically: convergeOn !== void 0 && !durableConvergence,
23352
23352
  cardinality: edgeCardinality(ctx, kind)
23353
23353
  } : void 0;
23354
- const schemaFenceInFirstWrite = candidate !== void 0 && chunk2PUJGVJ6_cjs.canFuseSchemaFenceInFirstWrite({ kind: "edge", candidate });
23355
- const autocommitSingleStatement = autocommitBackend !== void 0 && candidate !== void 0 && chunk2PUJGVJ6_cjs.isAutocommitSingleStatementWrite({ kind: "edge", candidate });
23356
- const plan = chunk2PUJGVJ6_cjs.edgeWritePlan(
23357
- convergeOn === void 0 || durableConvergence ? chunk2PUJGVJ6_cjs.edgeWriteNeedsConstraintFence(edgeCardinality(ctx, kind)) : "edgeMatchKeyConvergence"
23354
+ const schemaFenceInFirstWrite = candidate !== void 0 && chunkQ4MXRK6A_cjs.canFuseSchemaFenceInFirstWrite({ kind: "edge", candidate });
23355
+ const autocommitSingleStatement = autocommitBackend !== void 0 && candidate !== void 0 && chunkQ4MXRK6A_cjs.isAutocommitSingleStatementWrite({ kind: "edge", candidate });
23356
+ const plan = chunkQ4MXRK6A_cjs.edgeWritePlan(
23357
+ convergeOn === void 0 || durableConvergence ? chunkQ4MXRK6A_cjs.edgeWriteNeedsConstraintFence(edgeCardinality(ctx, kind)) : "edgeMatchKeyConvergence"
23358
23358
  );
23359
23359
  const rowWork = async (session, target, _overlaidSession, lock, transactionMode) => {
23360
- const targetBackend = chunk2PUJGVJ6_cjs.unfencedTarget(target);
23360
+ const targetBackend = chunkQ4MXRK6A_cjs.unfencedTarget(target);
23361
23361
  const fuseSchemaFenceInFirstWrite = schemaFenceInFirstWrite && chunkAZ2Q6RRS_cjs.isSchemaFencedInsertEligible(targetBackend) && !chunkQEXVOTI2_cjs.hasLeasedSchemaFence(ctx, targetBackend);
23362
23362
  if (schemaFenceInFirstWrite && !fuseSchemaFenceInFirstWrite) {
23363
23363
  await chunkQEXVOTI2_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
@@ -23367,7 +23367,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
23367
23367
  await chunkQEXVOTI2_cjs.diagnoseFusedSchemaFenceNoRow(ctx, targetBackend);
23368
23368
  const directInteractiveAutocommit = autocommitSingleStatement && transactionMode === "none" && targetBackend.capabilities.execution.interactiveTransactions;
23369
23369
  if (directInteractiveAutocommit) {
23370
- throw new chunk2PUJGVJ6_cjs.AutocommitWriteRequiresTransaction();
23370
+ throw new chunkQ4MXRK6A_cjs.AutocommitWriteRequiresTransaction();
23371
23371
  }
23372
23372
  if (transactionMode !== "none") {
23373
23373
  await chunkQEXVOTI2_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
@@ -23434,7 +23434,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
23434
23434
  match: durableMatchIdentity === void 0 ? { kind: "dynamic", ...chunkBXHAPCQG_cjs.requireDefined(convergeOn) } : { kind: "durable", identity: durableMatchIdentity }
23435
23435
  };
23436
23436
  const result = lock.coordination === void 0 && command.match.kind === "dynamic" ? {
23437
- outcome: "unsupported"} : await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation(
23437
+ outcome: "unsupported"} : await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation(
23438
23438
  "edge",
23439
23439
  () => chunkAZ2Q6RRS_cjs.executeAuthoritativeGraphCommand(
23440
23440
  target.commands,
@@ -23446,7 +23446,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
23446
23446
  if (durableMatchIdentity !== void 0 && work2.claim !== void 0) {
23447
23447
  await chunkRJHEBE5W_cjs.claimEdgeCardinality(target, ctx.claimsVerdict(), work2.claim);
23448
23448
  }
23449
- return createdEdgeResult(chunk2PUJGVJ6_cjs.rowToEdge(result.row));
23449
+ return createdEdgeResult(chunkQ4MXRK6A_cjs.rowToEdge(result.row));
23450
23450
  }
23451
23451
  if (result.outcome === "found") {
23452
23452
  if (command.match.kind === "dynamic") {
@@ -23553,7 +23553,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
23553
23553
  ...usesFusedCardinalityInsert && fusedWork.claim !== void 0 ? { cardinalityClaim: fusedWork.claim } : {}
23554
23554
  }
23555
23555
  };
23556
- const fusedResult = await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation(
23556
+ const fusedResult = await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation(
23557
23557
  "edge",
23558
23558
  () => session.createEdgeWithPlan(fusedCommand)
23559
23559
  );
@@ -23561,20 +23561,20 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
23561
23561
  if (fuseSchemaFenceInFirstWrite) {
23562
23562
  chunkQEXVOTI2_cjs.memoizeLeasedSchemaFence(ctx, targetBackend);
23563
23563
  }
23564
- return createdEdgeResult(chunk2PUJGVJ6_cjs.rowToEdge(fusedResult.row));
23564
+ return createdEdgeResult(chunkQ4MXRK6A_cjs.rowToEdge(fusedResult.row));
23565
23565
  }
23566
23566
  prepared = await diagnoseFusedCreateNoRow(true);
23567
23567
  }
23568
23568
  const work = edgeInsertWork(prepared);
23569
- const row = await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation("edge", async () => {
23569
+ const row = await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation("edge", async () => {
23570
23570
  if (shouldReturnRow) return session.createEdge(work);
23571
23571
  await session.createEdgeNoReturn(work);
23572
23572
  return;
23573
23573
  });
23574
- return createdEdgeResult(row === void 0 ? void 0 : chunk2PUJGVJ6_cjs.rowToEdge(row));
23574
+ return createdEdgeResult(row === void 0 ? void 0 : chunkQ4MXRK6A_cjs.rowToEdge(row));
23575
23575
  };
23576
23576
  if (autocommitSingleStatement) {
23577
- return chunk2PUJGVJ6_cjs.runAutocommitSingleStatementWritePlan(
23577
+ return chunkQ4MXRK6A_cjs.runAutocommitSingleStatementWritePlan(
23578
23578
  ctx,
23579
23579
  opContext,
23580
23580
  plan,
@@ -23587,12 +23587,12 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
23587
23587
  );
23588
23588
  }
23589
23589
  if (options?.skipHooks === true) {
23590
- return chunk2PUJGVJ6_cjs.runWritePlan(ctx, plan, backend, rowWork, {
23590
+ return chunkQ4MXRK6A_cjs.runWritePlan(ctx, plan, backend, rowWork, {
23591
23591
  schemaFenceInFirstWrite,
23592
23592
  didWrite: edgeCreateDidWrite
23593
23593
  });
23594
23594
  }
23595
- return chunk2PUJGVJ6_cjs.runHookedWritePlan(ctx, opContext, plan, backend, rowWork, {
23595
+ return chunkQ4MXRK6A_cjs.runHookedWritePlan(ctx, opContext, plan, backend, rowWork, {
23596
23596
  schemaFenceInFirstWrite,
23597
23597
  didWrite: edgeCreateDidWrite
23598
23598
  });
@@ -23642,7 +23642,7 @@ async function prepareEdgeBatchCreates(ctx, inputs, backend) {
23642
23642
  backend: validationBackend,
23643
23643
  registerPendingEdgeForCardinality,
23644
23644
  seedEndpointRow
23645
- } = chunk2PUJGVJ6_cjs.createEdgeBatchValidationBackend(backend);
23645
+ } = chunkQ4MXRK6A_cjs.createEdgeBatchValidationBackend(backend);
23646
23646
  await primeEdgeBatchValidationCache(ctx, inputs, backend, seedEndpointRow);
23647
23647
  const preparedCreates = [];
23648
23648
  for (const input of inputs) {
@@ -23791,7 +23791,7 @@ async function assertAtomicEdgeBatchCardinality(ctx, inputs, backend) {
23791
23791
  const errors = await Promise.all(
23792
23792
  window.map(async (input) => {
23793
23793
  try {
23794
- await chunk2PUJGVJ6_cjs.checkCardinalityConstraint(
23794
+ await chunkQ4MXRK6A_cjs.checkCardinalityConstraint(
23795
23795
  constraintContext,
23796
23796
  input.kind,
23797
23797
  edgeCardinality(ctx, input.kind),
@@ -23820,7 +23820,7 @@ async function runAtomicEdgeBatchProgram(ctx, inputs, preparation, backend, atom
23820
23820
  graphId: ctx.graphId,
23821
23821
  expectedVersion: chunkBXHAPCQG_cjs.requireDefined(ctx.schemaVersion)
23822
23822
  };
23823
- const result = await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation("edge", async () => {
23823
+ const result = await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation("edge", async () => {
23824
23824
  try {
23825
23825
  if (resultMode === "count") {
23826
23826
  return await atomicExecutor({
@@ -23878,7 +23878,7 @@ async function runAtomicEdgeBatchProgram(ctx, inputs, preparation, backend, atom
23878
23878
  return result;
23879
23879
  }
23880
23880
  function assertDurableBatchRows(work, rows) {
23881
- const outcomes = chunk2PUJGVJ6_cjs.classifyDurableEdgeBatchOutcomes(
23881
+ const outcomes = chunkQ4MXRK6A_cjs.classifyDurableEdgeBatchOutcomes(
23882
23882
  work.map((item) => item.params),
23883
23883
  rows
23884
23884
  );
@@ -23902,7 +23902,7 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
23902
23902
  if (inputs.length === 0) {
23903
23903
  return;
23904
23904
  }
23905
- const atomicExecutor = chunk2PUJGVJ6_cjs.resolveAtomicEdgeBatchExecutor({
23905
+ const atomicExecutor = chunkQ4MXRK6A_cjs.resolveAtomicEdgeBatchExecutor({
23906
23906
  backend,
23907
23907
  graph: ctx.graph,
23908
23908
  inputs,
@@ -23926,9 +23926,9 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
23926
23926
  );
23927
23927
  return;
23928
23928
  }
23929
- await chunk2PUJGVJ6_cjs.runWritePlan(
23929
+ await chunkQ4MXRK6A_cjs.runWritePlan(
23930
23930
  ctx,
23931
- chunk2PUJGVJ6_cjs.edgeWritePlan(batchFencesConstraintProbe(ctx, inputs)),
23931
+ chunkQ4MXRK6A_cjs.edgeWritePlan(batchFencesConstraintProbe(ctx, inputs)),
23932
23932
  backend,
23933
23933
  async (session, target) => {
23934
23934
  const { batchInsertWork } = await prepareEdgeBatchCreates(
@@ -23945,7 +23945,7 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
23945
23945
  await executeEdgeCreateInternal(
23946
23946
  ctx,
23947
23947
  input,
23948
- chunk2PUJGVJ6_cjs.nestedManagedWriteTarget(target),
23948
+ chunkQ4MXRK6A_cjs.nestedManagedWriteTarget(target),
23949
23949
  {
23950
23950
  returnRow: false,
23951
23951
  skipHooks: true
@@ -23954,14 +23954,14 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
23954
23954
  }
23955
23955
  return;
23956
23956
  }
23957
- const rows = await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation(
23957
+ const rows = await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation(
23958
23958
  "edge",
23959
23959
  () => chunkBXHAPCQG_cjs.requireDefined(session.createEdgesDurable)(batchInsertWork)
23960
23960
  );
23961
23961
  assertDurableBatchRows(batchInsertWork, rows);
23962
23962
  return;
23963
23963
  }
23964
- await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation(
23964
+ await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation(
23965
23965
  "edge",
23966
23966
  () => session.createEdgesNoReturn(batchInsertWork)
23967
23967
  );
@@ -23972,7 +23972,7 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
23972
23972
  if (inputs.length === 0) {
23973
23973
  return [];
23974
23974
  }
23975
- const atomicExecutor = chunk2PUJGVJ6_cjs.resolveAtomicEdgeBatchExecutor({
23975
+ const atomicExecutor = chunkQ4MXRK6A_cjs.resolveAtomicEdgeBatchExecutor({
23976
23976
  backend,
23977
23977
  graph: ctx.graph,
23978
23978
  inputs,
@@ -23994,11 +23994,11 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
23994
23994
  atomicExecutor,
23995
23995
  "rows"
23996
23996
  );
23997
- return rows.map((row) => chunk2PUJGVJ6_cjs.rowToEdge(row));
23997
+ return rows.map((row) => chunkQ4MXRK6A_cjs.rowToEdge(row));
23998
23998
  }
23999
- return chunk2PUJGVJ6_cjs.runWritePlan(
23999
+ return chunkQ4MXRK6A_cjs.runWritePlan(
24000
24000
  ctx,
24001
- chunk2PUJGVJ6_cjs.edgeWritePlan(batchFencesConstraintProbe(ctx, inputs)),
24001
+ chunkQ4MXRK6A_cjs.edgeWritePlan(batchFencesConstraintProbe(ctx, inputs)),
24002
24002
  backend,
24003
24003
  async (session, target) => {
24004
24004
  const { batchInsertWork } = await prepareEdgeBatchCreates(
@@ -24016,7 +24016,7 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
24016
24016
  const result = await executeEdgeCreateInternal(
24017
24017
  ctx,
24018
24018
  input,
24019
- chunk2PUJGVJ6_cjs.nestedManagedWriteTarget(target),
24019
+ chunkQ4MXRK6A_cjs.nestedManagedWriteTarget(target),
24020
24020
  { returnRow: true, skipHooks: true }
24021
24021
  );
24022
24022
  if (result.outcome !== "created") {
@@ -24035,24 +24035,24 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
24035
24035
  }
24036
24036
  return fallbackRows;
24037
24037
  }
24038
- const rows2 = await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation(
24038
+ const rows2 = await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation(
24039
24039
  "edge",
24040
24040
  () => chunkBXHAPCQG_cjs.requireDefined(session.createEdgesDurable)(batchInsertWork)
24041
24041
  );
24042
24042
  assertDurableBatchRows(batchInsertWork, rows2);
24043
- return rows2.map((row) => chunk2PUJGVJ6_cjs.rowToEdge(row));
24043
+ return rows2.map((row) => chunkQ4MXRK6A_cjs.rowToEdge(row));
24044
24044
  }
24045
- const rows = await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation(
24045
+ const rows = await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation(
24046
24046
  "edge",
24047
24047
  () => session.createEdges(batchInsertWork)
24048
24048
  );
24049
- return rows.map((row) => chunk2PUJGVJ6_cjs.rowToEdge(row));
24049
+ return rows.map((row) => chunkQ4MXRK6A_cjs.rowToEdge(row));
24050
24050
  }
24051
24051
  );
24052
24052
  }
24053
24053
  function batchFencesConstraintProbe(ctx, inputs) {
24054
24054
  for (const input of inputs) {
24055
- const reason = chunk2PUJGVJ6_cjs.edgeWriteNeedsConstraintFence(
24055
+ const reason = chunkQ4MXRK6A_cjs.edgeWriteNeedsConstraintFence(
24056
24056
  edgeCardinality(ctx, input.kind)
24057
24057
  );
24058
24058
  if (reason !== void 0) return reason;
@@ -24066,7 +24066,7 @@ function computeEdgeUpdate(ctx, kind, id, existingProps, inputProps) {
24066
24066
  { ...existingProps, ...inputProps },
24067
24067
  { kind, operation: "update", id }
24068
24068
  );
24069
- const identityRefusal = chunk2PUJGVJ6_cjs.edgeMatchIdentityUpdateRefusal({
24069
+ const identityRefusal = chunkQ4MXRK6A_cjs.edgeMatchIdentityUpdateRefusal({
24070
24070
  identity: registration.matchIdentity,
24071
24071
  kind,
24072
24072
  id,
@@ -24102,7 +24102,7 @@ function edgeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps) {
24102
24102
  }
24103
24103
  async function performEdgeUpdate(ctx, input, session, target, options, resolvedExisting) {
24104
24104
  const id = input.id;
24105
- chunk2PUJGVJ6_cjs.assertValidityEndMutation(input, {
24105
+ chunkQ4MXRK6A_cjs.assertValidityEndMutation(input, {
24106
24106
  entityType: "edge",
24107
24107
  kind: input.identity.kind,
24108
24108
  id
@@ -24128,7 +24128,7 @@ async function performEdgeUpdate(ctx, input, session, target, options, resolvedE
24128
24128
  const preservesLiveLowerBound = options?.clearDeleted !== true && chunk3XJGYE66_cjs.preservesImmutableLowerBound(input.onImmutableLowerBound);
24129
24129
  const appliedValidFrom = preservesLiveLowerBound ? void 0 : statedValidFrom;
24130
24130
  const validTo = chunk3XJGYE66_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
24131
- const effectiveValidTo = options?.clearDeleted === true && appliedValidFrom !== void 0 ? validTo : chunk2PUJGVJ6_cjs.validityEndAfterMutation(
24131
+ const effectiveValidTo = options?.clearDeleted === true && appliedValidFrom !== void 0 ? validTo : chunkQ4MXRK6A_cjs.validityEndAfterMutation(
24132
24132
  input.clearValidTo === true ? { clearValidTo: true } : validTo === void 0 ? {} : { validTo },
24133
24133
  existing.valid_to
24134
24134
  );
@@ -24137,7 +24137,7 @@ async function performEdgeUpdate(ctx, input, session, target, options, resolvedE
24137
24137
  let reentryClaim;
24138
24138
  const reentersActivePopulation = cardinality === "oneActive" && effectiveValidTo === void 0 && (existing.deleted_at !== void 0 || existing.valid_to !== void 0);
24139
24139
  if (reentersLivePopulation || reentersActivePopulation) {
24140
- await chunk2PUJGVJ6_cjs.checkCardinalityConstraint(
24140
+ await chunkQ4MXRK6A_cjs.checkCardinalityConstraint(
24141
24141
  {
24142
24142
  graphId: ctx.graphId,
24143
24143
  registry: ctx.registry,
@@ -24198,10 +24198,10 @@ async function performEdgeUpdate(ctx, input, session, target, options, resolvedE
24198
24198
  // "Did this write assert any window state?" is one predicate with one
24199
24199
  // owner, consulted here and by the fence appliers that carry it, rather
24200
24200
  // than re-derived from the params the diagnosis never sees.
24201
- chunk2PUJGVJ6_cjs.assertsStoredWindowState(fences),
24201
+ chunkQ4MXRK6A_cjs.assertsStoredWindowState(fences),
24202
24202
  () => session.reviseEdge(work, fences)
24203
24203
  );
24204
- return chunk2PUJGVJ6_cjs.rowToEdge(row);
24204
+ return chunkQ4MXRK6A_cjs.rowToEdge(row);
24205
24205
  }
24206
24206
  var EDGE_UPDATE_ATTEMPTS = 2;
24207
24207
  async function performEdgeUpdateConverging(ctx, input, session, target, options, resolvedExisting) {
@@ -24237,7 +24237,7 @@ function resolveAtomicEdgeUpdateExecutor(ctx, entries, backend) {
24237
24237
  )) {
24238
24238
  return;
24239
24239
  }
24240
- return chunk2PUJGVJ6_cjs.resolveAtomicEdgeResolvedUpdateBatchExecutor({
24240
+ return chunkQ4MXRK6A_cjs.resolveAtomicEdgeResolvedUpdateBatchExecutor({
24241
24241
  backend,
24242
24242
  graph: ctx.graph,
24243
24243
  schemaVersion: ctx.schemaVersion,
@@ -24261,7 +24261,7 @@ async function executeEdgeUpdate(ctx, input, backend) {
24261
24261
  );
24262
24262
  const opContext = ctx.createOperationContext("update", "edge", gate.kind, id);
24263
24263
  if (input.clearValidTo === true) {
24264
- chunk2PUJGVJ6_cjs.assertClearValidToSupported(backend, "edge");
24264
+ chunkQ4MXRK6A_cjs.assertClearValidToSupported(backend, "edge");
24265
24265
  }
24266
24266
  const atomicEntry = {
24267
24267
  input,
@@ -24274,7 +24274,7 @@ async function executeEdgeUpdate(ctx, input, backend) {
24274
24274
  backend
24275
24275
  );
24276
24276
  if (atomicExecutor !== void 0) {
24277
- return chunk2PUJGVJ6_cjs.runAtomicProgramWithHooks(
24277
+ return chunkQ4MXRK6A_cjs.runAtomicProgramWithHooks(
24278
24278
  ctx,
24279
24279
  opContext,
24280
24280
  async () => {
@@ -24286,36 +24286,36 @@ async function executeEdgeUpdate(ctx, input, backend) {
24286
24286
  );
24287
24287
  return chunkBXHAPCQG_cjs.requireDefined(edges[0]);
24288
24288
  },
24289
- chunk2PUJGVJ6_cjs.writeResultAlwaysChanges
24289
+ chunkQ4MXRK6A_cjs.writeResultAlwaysChanges
24290
24290
  );
24291
24291
  }
24292
- return chunk2PUJGVJ6_cjs.runHookedWritePlan(
24292
+ return chunkQ4MXRK6A_cjs.runHookedWritePlan(
24293
24293
  ctx,
24294
24294
  opContext,
24295
24295
  // An in-place props update on a live edge re-derives no constraint verdict.
24296
24296
  // Clearing an `oneActive` edge's end DOES: it re-admits the row to the
24297
24297
  // counted active population.
24298
- chunk2PUJGVJ6_cjs.edgeWritePlan(
24299
- input.clearValidTo === true && edgeCardinality(ctx, gate.kind) === "oneActive" ? chunk2PUJGVJ6_cjs.edgeWriteNeedsConstraintFence("oneActive") : void 0
24298
+ chunkQ4MXRK6A_cjs.edgeWritePlan(
24299
+ input.clearValidTo === true && edgeCardinality(ctx, gate.kind) === "oneActive" ? chunkQ4MXRK6A_cjs.edgeWriteNeedsConstraintFence("oneActive") : void 0
24300
24300
  ),
24301
24301
  backend,
24302
24302
  (session, target) => performEdgeUpdateConverging(ctx, input, session, target),
24303
- { didWrite: chunk2PUJGVJ6_cjs.writeResultAlwaysChanges }
24303
+ { didWrite: chunkQ4MXRK6A_cjs.writeResultAlwaysChanges }
24304
24304
  );
24305
24305
  }
24306
24306
  async function executeEdgeUpsertUpdateWithOutcome(ctx, input, backend, options) {
24307
24307
  if (input.clearValidTo === true) {
24308
- chunk2PUJGVJ6_cjs.assertClearValidToSupported(backend, "edge");
24308
+ chunkQ4MXRK6A_cjs.assertClearValidToSupported(backend, "edge");
24309
24309
  }
24310
- return chunk2PUJGVJ6_cjs.runWritePlan(
24310
+ return chunkQ4MXRK6A_cjs.runWritePlan(
24311
24311
  ctx,
24312
24312
  // An in-place props update re-derives no constraint verdict: endpoints
24313
24313
  // are immutable, so cardinality cannot change under it. A coalescing upsert
24314
24314
  // converges on a match key no database key backs; a resurrect or a cleared
24315
24315
  // end re-admits the row to the counted population its cardinality
24316
24316
  // constrains.
24317
- chunk2PUJGVJ6_cjs.edgeWritePlan(
24318
- options?.coalesceUnchanged === true ? "edgeMatchKeyConvergence" : input.clearValidTo === true || options?.clearDeleted === true ? chunk2PUJGVJ6_cjs.edgeWriteNeedsConstraintFence(edgeCardinality(ctx, input.identity.kind)) : void 0
24317
+ chunkQ4MXRK6A_cjs.edgeWritePlan(
24318
+ options?.coalesceUnchanged === true ? "edgeMatchKeyConvergence" : input.clearValidTo === true || options?.clearDeleted === true ? chunkQ4MXRK6A_cjs.edgeWriteNeedsConstraintFence(edgeCardinality(ctx, input.identity.kind)) : void 0
24319
24319
  ),
24320
24320
  backend,
24321
24321
  async (session, target) => {
@@ -24339,7 +24339,7 @@ async function executeEdgeUpsertUpdateWithOutcome(ctx, input, backend, options)
24339
24339
  input.props
24340
24340
  );
24341
24341
  if (shouldCoalesceUpsert(existing, input, runDirtyCheck)) {
24342
- return { edge: chunk2PUJGVJ6_cjs.rowToEdge(existing), wrote: false };
24342
+ return { edge: chunkQ4MXRK6A_cjs.rowToEdge(existing), wrote: false };
24343
24343
  }
24344
24344
  }
24345
24345
  }
@@ -24368,10 +24368,10 @@ async function executeEdgeUpsertUpdate(ctx, input, backend, options) {
24368
24368
  }
24369
24369
  async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
24370
24370
  if (creates.length === 0 || updates.length === 0) {
24371
- return chunk2PUJGVJ6_cjs.unsupportedResolvedMutationSet();
24371
+ return chunkQ4MXRK6A_cjs.unsupportedResolvedMutationSet();
24372
24372
  }
24373
24373
  const firstUpdate = chunkBXHAPCQG_cjs.requireDefined(updates[0]);
24374
- const executor = chunk2PUJGVJ6_cjs.resolveAtomicEdgeResolvedMutationSetExecutor({
24374
+ const executor = chunkQ4MXRK6A_cjs.resolveAtomicEdgeResolvedMutationSetExecutor({
24375
24375
  backend,
24376
24376
  graph: ctx.graph,
24377
24377
  schemaVersion: ctx.schemaVersion,
@@ -24381,18 +24381,18 @@ async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
24381
24381
  creates,
24382
24382
  updateCount: updates.length
24383
24383
  });
24384
- if (executor === void 0) return chunk2PUJGVJ6_cjs.unsupportedResolvedMutationSet();
24384
+ if (executor === void 0) return chunkQ4MXRK6A_cjs.unsupportedResolvedMutationSet();
24385
24385
  const ids = /* @__PURE__ */ new Set([
24386
24386
  ...creates.map((input) => chunkBXHAPCQG_cjs.requireDefined(input.id)),
24387
24387
  ...updates.map((entry2) => entry2.input.id)
24388
24388
  ]);
24389
24389
  if (ids.size !== creates.length + updates.length) {
24390
- return chunk2PUJGVJ6_cjs.unsupportedResolvedMutationSet();
24390
+ return chunkQ4MXRK6A_cjs.unsupportedResolvedMutationSet();
24391
24391
  }
24392
24392
  if (updates.some(
24393
24393
  (entry2) => entry2.clearDeleted || entry2.existing === void 0 || entry2.input.validFrom !== void 0 || entry2.input.validTo !== void 0 || entry2.input.clearValidTo === true
24394
24394
  )) {
24395
- return chunk2PUJGVJ6_cjs.unsupportedResolvedMutationSet();
24395
+ return chunkQ4MXRK6A_cjs.unsupportedResolvedMutationSet();
24396
24396
  }
24397
24397
  const preparation = await prepareAtomicEdgeBatchCreates(
24398
24398
  ctx,
@@ -24422,7 +24422,7 @@ async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
24422
24422
  );
24423
24423
  return { existing, props: validatedProps };
24424
24424
  });
24425
- const result = await chunk2PUJGVJ6_cjs.withAlreadyExistsTranslation("edge", async () => {
24425
+ const result = await chunkQ4MXRK6A_cjs.withAlreadyExistsTranslation("edge", async () => {
24426
24426
  try {
24427
24427
  return await executor({
24428
24428
  kind: "resolved-set",
@@ -24447,7 +24447,7 @@ async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
24447
24447
  });
24448
24448
  if (result.created.length === 0 && result.updated.length === 0) {
24449
24449
  await chunkQEXVOTI2_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
24450
- throw new chunk2PUJGVJ6_cjs.ResolvedMutationSetMoved("edge", executor);
24450
+ throw new chunkQ4MXRK6A_cjs.ResolvedMutationSetMoved("edge", executor);
24451
24451
  }
24452
24452
  if (result.created.length !== creates.length || result.updated.length !== updates.length) {
24453
24453
  throw new chunk7XYPLAPL_cjs.CompilerInvariantError(
@@ -24457,12 +24457,12 @@ async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
24457
24457
  chunkQEXVOTI2_cjs.memoizeLeasedSchemaFence(ctx, backend);
24458
24458
  const createdById = new Map(result.created.map((row) => [row.id, row]));
24459
24459
  const updatedById = new Map(result.updated.map((row) => [row.id, row]));
24460
- return chunk2PUJGVJ6_cjs.appliedResolvedMutationSet({
24460
+ return chunkQ4MXRK6A_cjs.appliedResolvedMutationSet({
24461
24461
  created: creates.map(
24462
- (input) => chunk2PUJGVJ6_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(createdById.get(chunkBXHAPCQG_cjs.requireDefined(input.id))))
24462
+ (input) => chunkQ4MXRK6A_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(createdById.get(chunkBXHAPCQG_cjs.requireDefined(input.id))))
24463
24463
  ),
24464
24464
  updated: updates.map(
24465
- (entry2) => chunk2PUJGVJ6_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(updatedById.get(entry2.input.id)))
24465
+ (entry2) => chunkQ4MXRK6A_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(updatedById.get(entry2.input.id)))
24466
24466
  )
24467
24467
  });
24468
24468
  }
@@ -24470,7 +24470,7 @@ async function executeEdgeUpsertUpdateBatch(ctx, entries, backend) {
24470
24470
  if (entries.length === 0) return [];
24471
24471
  for (const entry2 of entries) {
24472
24472
  if (entry2.input.clearValidTo === true) {
24473
- chunk2PUJGVJ6_cjs.assertClearValidToSupported(backend, "edge");
24473
+ chunkQ4MXRK6A_cjs.assertClearValidToSupported(backend, "edge");
24474
24474
  }
24475
24475
  }
24476
24476
  const first = chunkBXHAPCQG_cjs.requireDefined(entries[0]);
@@ -24487,10 +24487,10 @@ async function executeEdgeUpsertUpdateBatch(ctx, entries, backend) {
24487
24487
  const needsConstraintFence = entries.some(
24488
24488
  (entry2) => entry2.clearDeleted || entry2.input.clearValidTo === true
24489
24489
  );
24490
- return chunk2PUJGVJ6_cjs.runWritePlan(
24490
+ return chunkQ4MXRK6A_cjs.runWritePlan(
24491
24491
  ctx,
24492
- chunk2PUJGVJ6_cjs.edgeWritePlan(
24493
- needsConstraintFence ? chunk2PUJGVJ6_cjs.edgeWriteNeedsConstraintFence(
24492
+ chunkQ4MXRK6A_cjs.edgeWritePlan(
24493
+ needsConstraintFence ? chunkQ4MXRK6A_cjs.edgeWriteNeedsConstraintFence(
24494
24494
  edgeCardinality(ctx, first.input.identity.kind)
24495
24495
  ) : void 0
24496
24496
  ),
@@ -24514,11 +24514,11 @@ async function executeEdgeUpsertUpdateBatch(ctx, entries, backend) {
24514
24514
  }
24515
24515
  return edges;
24516
24516
  },
24517
- { didWrite: chunk2PUJGVJ6_cjs.writeResultAlwaysChanges }
24517
+ { didWrite: chunkQ4MXRK6A_cjs.writeResultAlwaysChanges }
24518
24518
  );
24519
24519
  }
24520
24520
  async function executeAtomicEdgeResolvedUpdates(ctx, entries, backend, atomicExecutor) {
24521
- const maxAttempts = chunk2PUJGVJ6_cjs.atomicResolvedUpdateAttemptBudget(
24521
+ const maxAttempts = chunkQ4MXRK6A_cjs.atomicResolvedUpdateAttemptBudget(
24522
24522
  entries.length,
24523
24523
  EDGE_UPDATE_ATTEMPTS
24524
24524
  );
@@ -24566,7 +24566,7 @@ async function executeAtomicEdgeResolvedUpdates(ctx, entries, backend, atomicExe
24566
24566
  chunkQEXVOTI2_cjs.memoizeLeasedSchemaFence(ctx, backend);
24567
24567
  const returned = new Map(rows.map((row) => [row.id, row]));
24568
24568
  return entries.map(
24569
- (entry2) => chunk2PUJGVJ6_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(returned.get(entry2.input.id)))
24569
+ (entry2) => chunkQ4MXRK6A_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(returned.get(entry2.input.id)))
24570
24570
  );
24571
24571
  }
24572
24572
  if (rows.length > 0) {
@@ -24612,7 +24612,7 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
24612
24612
  );
24613
24613
  if (gate.deleted_at) return;
24614
24614
  const opContext = ctx.createOperationContext("delete", "edge", gate.kind, id);
24615
- const atomicExecutor = chunk2PUJGVJ6_cjs.resolveAtomicEdgeDeleteBatchExecutor({
24615
+ const atomicExecutor = chunkQ4MXRK6A_cjs.resolveAtomicEdgeDeleteBatchExecutor({
24616
24616
  backend,
24617
24617
  graph: ctx.graph,
24618
24618
  expectedKind,
@@ -24622,7 +24622,7 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
24622
24622
  revisionTrackingEnabled: ctx.revisionTrackingEnabled
24623
24623
  });
24624
24624
  if (atomicExecutor !== void 0) {
24625
- await chunk2PUJGVJ6_cjs.runAtomicProgramWithHooks(
24625
+ await chunkQ4MXRK6A_cjs.runAtomicProgramWithHooks(
24626
24626
  ctx,
24627
24627
  opContext,
24628
24628
  () => executeAtomicEdgeDeletes(
@@ -24636,11 +24636,11 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
24636
24636
  );
24637
24637
  return;
24638
24638
  }
24639
- return chunk2PUJGVJ6_cjs.runHookedWritePlan(
24639
+ return chunkQ4MXRK6A_cjs.runHookedWritePlan(
24640
24640
  ctx,
24641
24641
  opContext,
24642
24642
  // A soft delete decides nothing a concurrent write could invalidate.
24643
- chunk2PUJGVJ6_cjs.edgeWritePlan(void 0),
24643
+ chunkQ4MXRK6A_cjs.edgeWritePlan(void 0),
24644
24644
  backend,
24645
24645
  async (session) => {
24646
24646
  await session.retireEdge({ id, kind: expectedKind });
@@ -24648,7 +24648,7 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
24648
24648
  );
24649
24649
  }
24650
24650
  async function executeEdgeDeleteBatch(ctx, expectedKind, ids, backend) {
24651
- const atomicExecutor = chunk2PUJGVJ6_cjs.resolveAtomicEdgeDeleteBatchExecutor({
24651
+ const atomicExecutor = chunkQ4MXRK6A_cjs.resolveAtomicEdgeDeleteBatchExecutor({
24652
24652
  backend,
24653
24653
  graph: ctx.graph,
24654
24654
  expectedKind,
@@ -24667,9 +24667,9 @@ async function executeEdgeDeleteBatch(ctx, expectedKind, ids, backend) {
24667
24667
  );
24668
24668
  return;
24669
24669
  }
24670
- await chunk2PUJGVJ6_cjs.runWritePlan(
24670
+ await chunkQ4MXRK6A_cjs.runWritePlan(
24671
24671
  ctx,
24672
- chunk2PUJGVJ6_cjs.edgeWritePlan(void 0),
24672
+ chunkQ4MXRK6A_cjs.edgeWritePlan(void 0),
24673
24673
  backend,
24674
24674
  async (session, target) => {
24675
24675
  const rowsById = await chunkQEXVOTI2_cjs.getEdgeRowsByIds(
@@ -24711,7 +24711,7 @@ async function executeAtomicEdgeDeletes(ctx, expectedKind, ids, backend, atomicE
24711
24711
  expectedVersion: chunkBXHAPCQG_cjs.requireDefined(ctx.schemaVersion)
24712
24712
  }
24713
24713
  });
24714
- await chunk2PUJGVJ6_cjs.assertAtomicDeleteSchemaFenceMatched(
24714
+ await chunkQ4MXRK6A_cjs.assertAtomicDeleteSchemaFenceMatched(
24715
24715
  result.schemaFenceMatched,
24716
24716
  ctx,
24717
24717
  backend,
@@ -24753,10 +24753,10 @@ async function executeEdgeHardDelete(ctx, expectedKind, id, backend) {
24753
24753
  "hardDelete"
24754
24754
  );
24755
24755
  const opContext = ctx.createOperationContext("delete", "edge", gate.kind, id);
24756
- return chunk2PUJGVJ6_cjs.runHookedWritePlan(
24756
+ return chunkQ4MXRK6A_cjs.runHookedWritePlan(
24757
24757
  ctx,
24758
24758
  opContext,
24759
- chunk2PUJGVJ6_cjs.edgeWritePlan(void 0),
24759
+ chunkQ4MXRK6A_cjs.edgeWritePlan(void 0),
24760
24760
  backend,
24761
24761
  async (session) => {
24762
24762
  await session.purgeEdge({
@@ -24825,7 +24825,7 @@ function findMatchingEdge(rows, matchOn, inputProps) {
24825
24825
  if (matchOn.length > 0) {
24826
24826
  const rowProps = chunkAZ2Q6RRS_cjs.rowPropsToObject(row.props);
24827
24827
  const matches = matchOn.every(
24828
- (field2) => chunk2PUJGVJ6_cjs.canonicalPersistedJsonValue(chunkBXHAPCQG_cjs.readOwnProperty(rowProps, field2)) === chunk2PUJGVJ6_cjs.canonicalPersistedJsonValue(chunkBXHAPCQG_cjs.readOwnProperty(inputProps, field2))
24828
+ (field2) => chunkQ4MXRK6A_cjs.canonicalPersistedJsonValue(chunkBXHAPCQG_cjs.readOwnProperty(rowProps, field2)) === chunkQ4MXRK6A_cjs.canonicalPersistedJsonValue(chunkBXHAPCQG_cjs.readOwnProperty(inputProps, field2))
24829
24829
  );
24830
24830
  if (!matches) continue;
24831
24831
  }
@@ -24846,7 +24846,7 @@ function assertEdgeMatchKey(row, matchOn, matchProps) {
24846
24846
  }
24847
24847
  async function executeEdgeFindByEndpoints(ctx, kind, fromKind, fromId, toKind, toId, backend, options) {
24848
24848
  const matchOn = options?.matchOn ?? [];
24849
- const matchProps = chunk2PUJGVJ6_cjs.normalizePersistedEdgeMatchProps(options?.props ?? {});
24849
+ const matchProps = chunkQ4MXRK6A_cjs.normalizePersistedEdgeMatchProps(options?.props ?? {});
24850
24850
  const registration = getEdgeRegistration(ctx.graph, kind);
24851
24851
  const edgeKind = registration.type;
24852
24852
  if (matchOn.length > 0) {
@@ -24866,9 +24866,9 @@ async function executeEdgeFindByEndpoints(ctx, kind, fromKind, fromId, toKind, t
24866
24866
  ...options?.asOf !== void 0 && { asOf: options.asOf }
24867
24867
  });
24868
24868
  if (candidateRows.length === 0) return void 0;
24869
- if (matchOn.length === 0) return chunk2PUJGVJ6_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(candidateRows[0]));
24869
+ if (matchOn.length === 0) return chunkQ4MXRK6A_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(candidateRows[0]));
24870
24870
  const { liveRow } = findMatchingEdge(candidateRows, matchOn, matchProps);
24871
- return liveRow === void 0 ? void 0 : chunk2PUJGVJ6_cjs.rowToEdge(liveRow);
24871
+ return liveRow === void 0 ? void 0 : chunkQ4MXRK6A_cjs.rowToEdge(liveRow);
24872
24872
  }
24873
24873
  function defersEndpointWindowOrdering(ifExists, onImmutableLowerBound) {
24874
24874
  return ifExists === "update" && chunk3XJGYE66_cjs.preservesImmutableLowerBound(onImmutableLowerBound);
@@ -24893,15 +24893,15 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
24893
24893
  registration.matchIdentity?.fields,
24894
24894
  options?.matchOn
24895
24895
  );
24896
- chunk2PUJGVJ6_cjs.assertValidityEndMutation(options ?? {}, { entityType: "edge", kind });
24896
+ chunkQ4MXRK6A_cjs.assertValidityEndMutation(options ?? {}, { entityType: "edge", kind });
24897
24897
  if (options?.clearValidTo === true) {
24898
- chunk2PUJGVJ6_cjs.assertClearValidToSupported(backend, "edge");
24898
+ chunkQ4MXRK6A_cjs.assertClearValidToSupported(backend, "edge");
24899
24899
  }
24900
24900
  const validatedProps = chunkQEXVOTI2_cjs.validateEdgeProps(edgeKind.schema, props, {
24901
24901
  kind,
24902
24902
  operation: "create"
24903
24903
  });
24904
- const matchProps = chunk2PUJGVJ6_cjs.normalizePersistedEdgeMatchProps(validatedProps);
24904
+ const matchProps = chunkQ4MXRK6A_cjs.normalizePersistedEdgeMatchProps(validatedProps);
24905
24905
  validateMatchOnFields(edgeKind.schema, matchOn, kind);
24906
24906
  const validFrom = chunk3XJGYE66_cjs.validateStatedValidityLowerBound(
24907
24907
  options?.validFrom,
@@ -24945,7 +24945,7 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
24945
24945
  );
24946
24946
  if (currentLiveRow !== void 0) {
24947
24947
  assertEndpointClearCanApply(ifExists, options?.clearValidTo, kind);
24948
- return { edge: chunk2PUJGVJ6_cjs.rowToEdge(currentLiveRow), action: "found" };
24948
+ return { edge: chunkQ4MXRK6A_cjs.rowToEdge(currentLiveRow), action: "found" };
24949
24949
  }
24950
24950
  initialCandidateRead = {
24951
24951
  rows: currentRows,
@@ -24962,7 +24962,7 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
24962
24962
  if (!isDeleted) {
24963
24963
  if (ifExists === "return") {
24964
24964
  assertEndpointClearCanApply(ifExists, options?.clearValidTo, kind);
24965
- return { edge: chunk2PUJGVJ6_cjs.rowToEdge(matchedRow), action: "found" };
24965
+ return { edge: chunkQ4MXRK6A_cjs.rowToEdge(matchedRow), action: "found" };
24966
24966
  }
24967
24967
  const outcome = await executeEdgeUpsertUpdateWithOutcome(
24968
24968
  ctx,
@@ -25157,7 +25157,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25157
25157
  const ifExists = options?.ifExists ?? "return";
25158
25158
  const registration = getEdgeRegistration(ctx.graph, kind);
25159
25159
  const edgeKind = registration.type;
25160
- chunkB33AHPS7_cjs.assertEdgeMatchIdentityBackendSupport(
25160
+ chunkH3ULZVTX_cjs.assertEdgeMatchIdentityBackendSupport(
25161
25161
  registration.matchIdentity,
25162
25162
  backend.capabilities,
25163
25163
  kind
@@ -25170,15 +25170,15 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25170
25170
  validateMatchOnFields(edgeKind.schema, matchOn, kind);
25171
25171
  const validated = [];
25172
25172
  for (const item of items) {
25173
- chunk2PUJGVJ6_cjs.assertValidityEndMutation(item, { entityType: "edge", kind });
25173
+ chunkQ4MXRK6A_cjs.assertValidityEndMutation(item, { entityType: "edge", kind });
25174
25174
  if (item.clearValidTo === true) {
25175
- chunk2PUJGVJ6_cjs.assertClearValidToSupported(backend, "edge");
25175
+ chunkQ4MXRK6A_cjs.assertClearValidToSupported(backend, "edge");
25176
25176
  }
25177
25177
  const validatedProps = chunkQEXVOTI2_cjs.validateEdgeProps(edgeKind.schema, item.props, {
25178
25178
  kind,
25179
25179
  operation: "create"
25180
25180
  });
25181
- const matchProps = chunk2PUJGVJ6_cjs.normalizePersistedEdgeMatchProps(validatedProps);
25181
+ const matchProps = chunkQ4MXRK6A_cjs.normalizePersistedEdgeMatchProps(validatedProps);
25182
25182
  const validFrom = chunk3XJGYE66_cjs.validateStatedValidityLowerBound(
25183
25183
  item.validFrom,
25184
25184
  "validFrom"
@@ -25191,7 +25191,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25191
25191
  validTo
25192
25192
  );
25193
25193
  }
25194
- const compositeKey = chunk2PUJGVJ6_cjs.buildEdgeMatchKey({
25194
+ const compositeKey = chunkQ4MXRK6A_cjs.buildEdgeMatchKey({
25195
25195
  fromKind: item.fromKind,
25196
25196
  fromId: item.fromId,
25197
25197
  toKind: item.toKind,
@@ -25222,7 +25222,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25222
25222
  }
25223
25223
  });
25224
25224
  }
25225
- const atomicConvergenceExecutor = chunk2PUJGVJ6_cjs.resolveAtomicEdgeConvergenceExecutor({
25225
+ const atomicConvergenceExecutor = chunkQ4MXRK6A_cjs.resolveAtomicEdgeConvergenceExecutor({
25226
25226
  backend,
25227
25227
  graph: ctx.graph,
25228
25228
  schemaVersion: ctx.schemaVersion,
@@ -25248,7 +25248,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25248
25248
  ctx.registry
25249
25249
  );
25250
25250
  if (endpointError) throw endpointError;
25251
- const matchIdentity = chunk2PUJGVJ6_cjs.resolveEdgeMatchIdentityStorage(
25251
+ const matchIdentity = chunkQ4MXRK6A_cjs.resolveEdgeMatchIdentityStorage(
25252
25252
  registration.matchIdentity,
25253
25253
  {
25254
25254
  fromKind: entry2.fromKind,
@@ -25327,7 +25327,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25327
25327
  for (const [nativeIndex, nativeResult] of nativeResults.entries()) {
25328
25328
  const nativeEntry = chunkBXHAPCQG_cjs.requireDefined(nativeEntries[nativeIndex]);
25329
25329
  const result = {
25330
- edge: chunk2PUJGVJ6_cjs.rowToEdge(nativeResult.row),
25330
+ edge: chunkQ4MXRK6A_cjs.rowToEdge(nativeResult.row),
25331
25331
  action: nativeResult.outcome
25332
25332
  };
25333
25333
  results[nativeEntry.index] = result;
@@ -25499,7 +25499,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25499
25499
  const found = Array.from({ length: items.length });
25500
25500
  for (const entry2 of partition.toFetch) {
25501
25501
  assertEndpointClearCanApply(ifExists, entry2.clearValidTo, kind);
25502
- found[entry2.index] = { edge: chunk2PUJGVJ6_cjs.rowToEdge(entry2.row), action: "found" };
25502
+ found[entry2.index] = { edge: chunkQ4MXRK6A_cjs.rowToEdge(entry2.row), action: "found" };
25503
25503
  }
25504
25504
  for (const { index, sourceIndex } of partition.duplicateOf) {
25505
25505
  found[index] = {
@@ -25516,15 +25516,15 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25516
25516
  if (found !== void 0) return found;
25517
25517
  }
25518
25518
  function runBatch() {
25519
- return chunk2PUJGVJ6_cjs.runWritePlan(
25519
+ return chunkQ4MXRK6A_cjs.runWritePlan(
25520
25520
  ctx,
25521
25521
  // A bulk getOrCreate always converges on a match key no database key
25522
25522
  // backs, whatever its cardinality — the same reason the single-item path
25523
25523
  // fences unconditionally.
25524
- chunk2PUJGVJ6_cjs.edgeWritePlan("edgeMatchKeyConvergence"),
25524
+ chunkQ4MXRK6A_cjs.edgeWritePlan("edgeMatchKeyConvergence"),
25525
25525
  backend,
25526
25526
  async (session, target, _overlaidSession, lock) => {
25527
- const rawTarget = chunk2PUJGVJ6_cjs.nestedManagedWriteTarget(target);
25527
+ const rawTarget = chunkQ4MXRK6A_cjs.nestedManagedWriteTarget(target);
25528
25528
  const { toCreate, toFetch, duplicateOf } = partitionEntries(
25529
25529
  await fetchRowsByEndpoint(target)
25530
25530
  );
@@ -25602,7 +25602,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25602
25602
  if (entry2.isDeleted) continue;
25603
25603
  assertEndpointClearCanApply(ifExists, entry2.clearValidTo, kind);
25604
25604
  results[entry2.index] = {
25605
- edge: chunk2PUJGVJ6_cjs.rowToEdge(entry2.row),
25605
+ edge: chunkQ4MXRK6A_cjs.rowToEdge(entry2.row),
25606
25606
  action: "found"
25607
25607
  };
25608
25608
  }
@@ -25637,7 +25637,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
25637
25637
  } else {
25638
25638
  assertEndpointClearCanApply(ifExists, entry2.clearValidTo, kind);
25639
25639
  results[entry2.index] = {
25640
- edge: chunk2PUJGVJ6_cjs.rowToEdge(entry2.row),
25640
+ edge: chunkQ4MXRK6A_cjs.rowToEdge(entry2.row),
25641
25641
  action: "found"
25642
25642
  };
25643
25643
  }
@@ -25786,14 +25786,14 @@ function invalidRecordedScanCursor() {
25786
25786
  );
25787
25787
  }
25788
25788
  function decodeRecordedScanCursor(cursor, expectedScope) {
25789
- const decoded = chunkB33AHPS7_cjs.decodeCursor(cursor);
25789
+ const decoded = chunkH3ULZVTX_cjs.decodeCursor(cursor);
25790
25790
  if (decoded.d !== "f" || decoded.cols.length !== 1 || decoded.cols[0] !== expectedScope || decoded.vals.length !== 1 || typeof decoded.vals[0] !== "string") {
25791
25791
  throw invalidRecordedScanCursor();
25792
25792
  }
25793
25793
  return decoded.vals[0];
25794
25794
  }
25795
25795
  function encodeRecordedScanCursor(id, scope) {
25796
- return chunkB33AHPS7_cjs.encodeCursor({ v: 1, d: "f", vals: [id], cols: [scope] });
25796
+ return chunkH3ULZVTX_cjs.encodeCursor({ v: 1, d: "f", vals: [id], cols: [scope] });
25797
25797
  }
25798
25798
  function createRecordedReadService(params) {
25799
25799
  const {
@@ -25916,7 +25916,7 @@ function createRecordedReadService(params) {
25916
25916
  kind,
25917
25917
  ids,
25918
25918
  coordinate,
25919
- toEntity: (row) => chunk2PUJGVJ6_cjs.rowToNode(mapRecordedNodeRow(row))
25919
+ toEntity: (row) => chunkQ4MXRK6A_cjs.rowToNode(mapRecordedNodeRow(row))
25920
25920
  });
25921
25921
  }
25922
25922
  function edgeGetByIds(kind, ids, coordinate) {
@@ -25931,7 +25931,7 @@ function createRecordedReadService(params) {
25931
25931
  kind,
25932
25932
  ids,
25933
25933
  coordinate,
25934
- toEntity: (row) => chunk2PUJGVJ6_cjs.rowToEdge(mapRecordedEdgeRow(row))
25934
+ toEntity: (row) => chunkQ4MXRK6A_cjs.rowToEdge(mapRecordedEdgeRow(row))
25935
25935
  });
25936
25936
  }
25937
25937
  function nodeScan(kind, coordinate, options) {
@@ -25946,7 +25946,7 @@ function createRecordedReadService(params) {
25946
25946
  kind,
25947
25947
  coordinate,
25948
25948
  options,
25949
- toEntity: (row) => chunk2PUJGVJ6_cjs.rowToNode(mapRecordedNodeRow(row))
25949
+ toEntity: (row) => chunkQ4MXRK6A_cjs.rowToNode(mapRecordedNodeRow(row))
25950
25950
  });
25951
25951
  }
25952
25952
  function edgeScan(kind, coordinate, options) {
@@ -25961,7 +25961,7 @@ function createRecordedReadService(params) {
25961
25961
  kind,
25962
25962
  coordinate,
25963
25963
  options,
25964
- toEntity: (row) => chunk2PUJGVJ6_cjs.rowToEdge(mapRecordedEdgeRow(row))
25964
+ toEntity: (row) => chunkQ4MXRK6A_cjs.rowToEdge(mapRecordedEdgeRow(row))
25965
25965
  });
25966
25966
  }
25967
25967
  return {
@@ -26301,7 +26301,7 @@ function syncStoreReplacementRef(ref, replacement) {
26301
26301
  ref.current = replacement;
26302
26302
  }
26303
26303
  async function commitEvolvedSchemaWhenRequiredKindsAreEmpty(backend, graph, currentVersion, classification, storedSchema) {
26304
- const result = await chunkA7YKBSKQ_cjs.commitNewSchemaVersionIfKindsEmpty(
26304
+ const result = await chunkZO72TBQE_cjs.commitNewSchemaVersionIfKindsEmpty(
26305
26305
  backend,
26306
26306
  graph,
26307
26307
  currentVersion,
@@ -26522,7 +26522,7 @@ var StoreImplementation = class _StoreImplementation {
26522
26522
  mapRecordedNodeRow: chunkRQXQ2RK5_cjs.createNodeRowMapper(rowMapperConfig),
26523
26523
  mapRecordedEdgeRow: chunkRQXQ2RK5_cjs.createEdgeRowMapper(rowMapperConfig)
26524
26524
  });
26525
- this.#registry = chunkA7YKBSKQ_cjs.buildKindRegistry(graph);
26525
+ this.#registry = chunkZO72TBQE_cjs.buildKindRegistry(graph);
26526
26526
  this.#hooks = options?.hooks ?? {};
26527
26527
  this.#defaultTraversalExpansion = options?.queryDefaults?.traversalExpansion ?? "inverse";
26528
26528
  this.#options = options;
@@ -26600,7 +26600,7 @@ var StoreImplementation = class _StoreImplementation {
26600
26600
  },
26601
26601
  liveNodesSharingIds: async (ids, target) => {
26602
26602
  const backend2 = target ?? this.#baseBackend;
26603
- const liveKindsById = await chunkB33AHPS7_cjs.liveNodeKindsSharingIds(
26603
+ const liveKindsById = await chunkH3ULZVTX_cjs.liveNodeKindsSharingIds(
26604
26604
  this.#identityContext(backend2),
26605
26605
  backend2,
26606
26606
  ids
@@ -26615,21 +26615,21 @@ var StoreImplementation = class _StoreImplementation {
26615
26615
  if (this.#graph.identity === void 0) return /* @__PURE__ */ new Map();
26616
26616
  const backend2 = target ?? this.#baseBackend;
26617
26617
  const ctx = this.#identityContext(backend2);
26618
- const rows = await chunkB33AHPS7_cjs.loadAssertionsByIds(
26618
+ const rows = await chunkH3ULZVTX_cjs.loadAssertionsByIds(
26619
26619
  backend2,
26620
26620
  ctx.schema,
26621
26621
  this.graphId,
26622
26622
  ids
26623
26623
  );
26624
26624
  return new Map(
26625
- [...rows].map(([id, row]) => [id, chunkB33AHPS7_cjs.toTransferAssertion(row)])
26625
+ [...rows].map(([id, row]) => [id, chunkH3ULZVTX_cjs.toTransferAssertion(row)])
26626
26626
  );
26627
26627
  },
26628
26628
  structuralIdentityClasses: async (references, target) => {
26629
26629
  if (this.#graph.identity === void 0) return /* @__PURE__ */ new Map();
26630
26630
  const backend2 = target ?? this.#baseBackend;
26631
26631
  const ctx = this.#identityContext(backend2);
26632
- return chunkB33AHPS7_cjs.loadCurrentStructuralClasses(
26632
+ return chunkH3ULZVTX_cjs.loadCurrentStructuralClasses(
26633
26633
  backend2,
26634
26634
  ctx.schema,
26635
26635
  this.graphId,
@@ -26682,7 +26682,7 @@ var StoreImplementation = class _StoreImplementation {
26682
26682
  );
26683
26683
  const existing = IDENTITY_FACADES.get(this);
26684
26684
  if (existing !== void 0) return existing;
26685
- const facade = chunkB33AHPS7_cjs.createIdentityFacade(this.#identityContext(this.#backend));
26685
+ const facade = chunkH3ULZVTX_cjs.createIdentityFacade(this.#identityContext(this.#backend));
26686
26686
  IDENTITY_FACADES.set(this, facade);
26687
26687
  return facade;
26688
26688
  }
@@ -26715,7 +26715,7 @@ var StoreImplementation = class _StoreImplementation {
26715
26715
  this.#recordedReadBinding,
26716
26716
  "recorded-identity"
26717
26717
  );
26718
- return chunkB33AHPS7_cjs.createIdentityReadFacade({
26718
+ return chunkH3ULZVTX_cjs.createIdentityReadFacade({
26719
26719
  ...this.#identityContext(backend),
26720
26720
  schema,
26721
26721
  coordinate
@@ -26744,7 +26744,7 @@ var StoreImplementation = class _StoreImplementation {
26744
26744
  * fails leaves no half-published derived relation behind.
26745
26745
  */
26746
26746
  async identitySchemaPreflight(target, provisionDerivedRelations) {
26747
- await chunkA7YKBSKQ_cjs.identitySchemaCommitPreflight(this.#identityContext(this.#backend), {
26747
+ await chunkZO72TBQE_cjs.identitySchemaCommitPreflight(this.#identityContext(this.#backend), {
26748
26748
  enablement: false,
26749
26749
  provisionDerivedRelations
26750
26750
  })(target);
@@ -26752,12 +26752,12 @@ var StoreImplementation = class _StoreImplementation {
26752
26752
  /** @internal Read-only startup integrity verification. */
26753
26753
  async validateIdentity() {
26754
26754
  if (this.#graph.identity === void 0) return;
26755
- await chunkB33AHPS7_cjs.validateIdentityForContext(this.#identityContext(this.#baseBackend));
26755
+ await chunkH3ULZVTX_cjs.validateIdentityForContext(this.#identityContext(this.#baseBackend));
26756
26756
  }
26757
26757
  /** @internal Cascades removed kinds in the schema-commit transaction. */
26758
26758
  async removeIdentityKindsInSchemaPreflight(target, kinds, options) {
26759
26759
  if (!this.#captureEnabled) {
26760
- await chunkB33AHPS7_cjs.removeIdentityKindsForContext(
26760
+ await chunkH3ULZVTX_cjs.removeIdentityKindsForContext(
26761
26761
  this.#identityContext(target),
26762
26762
  kinds,
26763
26763
  options
@@ -26770,7 +26770,7 @@ var StoreImplementation = class _StoreImplementation {
26770
26770
  this.#sqlSchema(),
26771
26771
  target.dialect === "sqlite"
26772
26772
  );
26773
- await chunkB33AHPS7_cjs.removeIdentityKindsForContext(
26773
+ await chunkH3ULZVTX_cjs.removeIdentityKindsForContext(
26774
26774
  this.#identityContext(scope.backend),
26775
26775
  kinds,
26776
26776
  options
@@ -26784,7 +26784,7 @@ var StoreImplementation = class _StoreImplementation {
26784
26784
  */
26785
26785
  readCurrentIdentityAssertions(mode, options) {
26786
26786
  if (this.#graph.identity === void 0) return Promise.resolve([]);
26787
- return chunkB33AHPS7_cjs.readIdentityAssertionsForInterchange(
26787
+ return chunkH3ULZVTX_cjs.readIdentityAssertionsForInterchange(
26788
26788
  this.#identityContext(this.#baseBackend),
26789
26789
  mode,
26790
26790
  options
@@ -26793,7 +26793,7 @@ var StoreImplementation = class _StoreImplementation {
26793
26793
  /** @internal Reads identity truth through an already-bound transaction. */
26794
26794
  identityAssertionsAtTarget(target, mode = "state") {
26795
26795
  if (this.#graph.identity === void 0) return Promise.resolve([]);
26796
- return chunkB33AHPS7_cjs.readIdentityAssertionsForInterchange(
26796
+ return chunkH3ULZVTX_cjs.readIdentityAssertionsForInterchange(
26797
26797
  this.#identityContext(target),
26798
26798
  mode
26799
26799
  );
@@ -26803,7 +26803,7 @@ var StoreImplementation = class _StoreImplementation {
26803
26803
  if (this.#graph.identity === void 0) {
26804
26804
  return Promise.resolve({ assertions: [], done: true });
26805
26805
  }
26806
- return chunkB33AHPS7_cjs.readIdentityAssertionPageAtTarget(
26806
+ return chunkH3ULZVTX_cjs.readIdentityAssertionPageAtTarget(
26807
26807
  this.#identityContext(target),
26808
26808
  target,
26809
26809
  mode,
@@ -26812,14 +26812,14 @@ var StoreImplementation = class _StoreImplementation {
26812
26812
  }
26813
26813
  /** @internal Acquires the enabled graph's identity lock for an import. */
26814
26814
  lockIdentityImportTarget(target) {
26815
- return this.#graph.identity === void 0 ? Promise.resolve() : chunkB33AHPS7_cjs.lockIdentityGraph(target, this.graphId);
26815
+ return this.#graph.identity === void 0 ? Promise.resolve() : chunkH3ULZVTX_cjs.lockIdentityGraph(target, this.graphId);
26816
26816
  }
26817
26817
  /** @internal Restores same-id folding after the ops-layer import bypass. */
26818
26818
  foldImportedIdentityNodes(target, references) {
26819
26819
  if (this.#graph.identity === void 0 || references.length === 0) {
26820
26820
  return Promise.resolve();
26821
26821
  }
26822
- return chunkB33AHPS7_cjs.foldIdentityForCreatedNodes(
26822
+ return chunkH3ULZVTX_cjs.foldIdentityForCreatedNodes(
26823
26823
  {
26824
26824
  graphId: this.graphId,
26825
26825
  registry: this.#registry,
@@ -26841,7 +26841,7 @@ var StoreImplementation = class _StoreImplementation {
26841
26841
  { code: "IDENTITY_IMPORT_REQUIRES_PROFILE", graphId: this.graphId }
26842
26842
  );
26843
26843
  }
26844
- return chunkB33AHPS7_cjs.importIdentityAssertionsIntoTarget(
26844
+ return chunkH3ULZVTX_cjs.importIdentityAssertionsIntoTarget(
26845
26845
  // The slice the coordinator reads — graph, registry, schema, folding
26846
26846
  // mode — none of which depend on the target. The target it writes
26847
26847
  // through is the parameter beside it, which is why this method can take
@@ -26861,7 +26861,7 @@ var StoreImplementation = class _StoreImplementation {
26861
26861
  if (this.#graph.identity === void 0 || seeds.length === 0) {
26862
26862
  return Promise.resolve();
26863
26863
  }
26864
- return chunkB33AHPS7_cjs.assertAffectedIdentityClassesConsistent(
26864
+ return chunkH3ULZVTX_cjs.assertAffectedIdentityClassesConsistent(
26865
26865
  this.#identityContext(target),
26866
26866
  target,
26867
26867
  seeds
@@ -26878,7 +26878,7 @@ var StoreImplementation = class _StoreImplementation {
26878
26878
  { code: "IDENTITY_MERGE_REQUIRES_PROFILE", graphId: this.graphId }
26879
26879
  );
26880
26880
  }
26881
- return chunkB33AHPS7_cjs.applyIdentityChangesForContext(
26881
+ return chunkH3ULZVTX_cjs.applyIdentityChangesForContext(
26882
26882
  this.#identityContext(target),
26883
26883
  retractions,
26884
26884
  assertions
@@ -27311,7 +27311,7 @@ var StoreImplementation = class _StoreImplementation {
27311
27311
  * between "proceed" and "ask the user" *before* attempting a commit.
27312
27312
  */
27313
27313
  async schemaChanges() {
27314
- return chunkA7YKBSKQ_cjs.getSchemaChanges(this.#backend, this.#graph);
27314
+ return chunkZO72TBQE_cjs.getSchemaChanges(this.#backend, this.#graph);
27315
27315
  }
27316
27316
  /**
27317
27317
  * Whether committing this store's graph would require a schema migration —
@@ -27323,7 +27323,7 @@ var StoreImplementation = class _StoreImplementation {
27323
27323
  * through a user's request.
27324
27324
  */
27325
27325
  async requiresMigration() {
27326
- return chunkA7YKBSKQ_cjs.requiresMigration(this.#backend, this.#graph);
27326
+ return chunkZO72TBQE_cjs.requiresMigration(this.#backend, this.#graph);
27327
27327
  }
27328
27328
  /**
27329
27329
  * Node operations bound to this store instance.
@@ -27353,13 +27353,13 @@ var StoreImplementation = class _StoreImplementation {
27353
27353
  #buildNodeOperations(ctx) {
27354
27354
  return {
27355
27355
  defaultTemporalMode: this.#graph.defaults.temporalMode,
27356
- rowToNode: (row) => chunk2PUJGVJ6_cjs.rowToNode(row),
27356
+ rowToNode: (row) => chunkQ4MXRK6A_cjs.rowToNode(row),
27357
27357
  maybeRefreshStatisticsAfterBulk: (rowCount) => this.#maybeRefreshStatisticsAfterBulk(rowCount),
27358
- executeCreate: (input, backend) => chunk2PUJGVJ6_cjs.executeNodeCreate(ctx, input, backend),
27359
- executeCreateBatch: (inputs, backend, options) => chunk2PUJGVJ6_cjs.executeNodeCreateBatch(ctx, inputs, backend, options),
27360
- executeCreateNoReturnBatch: (inputs, backend) => chunk2PUJGVJ6_cjs.executeNodeCreateNoReturnBatch(ctx, inputs, backend),
27361
- executeUpdate: (input, backend, options) => chunk2PUJGVJ6_cjs.executeNodeUpdate(ctx, { ...input, id: input.id }, backend, options),
27362
- executeNodeSetUpdate: (kind, patch, candidateIds, candidateIdColumn, backend, options) => chunk2PUJGVJ6_cjs.executeNodeSetUpdate(
27358
+ executeCreate: (input, backend) => chunkQ4MXRK6A_cjs.executeNodeCreate(ctx, input, backend),
27359
+ executeCreateBatch: (inputs, backend, options) => chunkQ4MXRK6A_cjs.executeNodeCreateBatch(ctx, inputs, backend, options),
27360
+ executeCreateNoReturnBatch: (inputs, backend) => chunkQ4MXRK6A_cjs.executeNodeCreateNoReturnBatch(ctx, inputs, backend),
27361
+ executeUpdate: (input, backend, options) => chunkQ4MXRK6A_cjs.executeNodeUpdate(ctx, { ...input, id: input.id }, backend, options),
27362
+ executeNodeSetUpdate: (kind, patch, candidateIds, candidateIdColumn, backend, options) => chunkQ4MXRK6A_cjs.executeNodeSetUpdate(
27363
27363
  ctx,
27364
27364
  kind,
27365
27365
  patch,
@@ -27368,20 +27368,20 @@ var StoreImplementation = class _StoreImplementation {
27368
27368
  backend,
27369
27369
  options
27370
27370
  ),
27371
- executeUpsertUpdateBatch: (entries, backend) => chunk2PUJGVJ6_cjs.executeNodeUpsertUpdateBatch(ctx, entries, backend),
27372
- executeResolvedMutationSet: (creates, updates, backend) => chunk2PUJGVJ6_cjs.executeNodeResolvedMutationSet(ctx, creates, updates, backend),
27373
- prepareReplacement: (kind, props) => chunk2PUJGVJ6_cjs.prepareNodeReplacement(ctx, kind, props),
27374
- executeReplacementBatch: (kind, items, backend) => chunk2PUJGVJ6_cjs.executeNodeReplacementBatch(ctx, kind, items, backend),
27371
+ executeUpsertUpdateBatch: (entries, backend) => chunkQ4MXRK6A_cjs.executeNodeUpsertUpdateBatch(ctx, entries, backend),
27372
+ executeResolvedMutationSet: (creates, updates, backend) => chunkQ4MXRK6A_cjs.executeNodeResolvedMutationSet(ctx, creates, updates, backend),
27373
+ prepareReplacement: (kind, props) => chunkQ4MXRK6A_cjs.prepareNodeReplacement(ctx, kind, props),
27374
+ executeReplacementBatch: (kind, items, backend) => chunkQ4MXRK6A_cjs.executeNodeReplacementBatch(ctx, kind, items, backend),
27375
27375
  // Present only when opted in; its absence is the coalesce off switch.
27376
27376
  ...ctx.coalesceUnchangedUpsertsEnabled && {
27377
- upsertDirtyCheck: (kind, id, existingProps, inputProps) => chunk2PUJGVJ6_cjs.nodeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps)
27377
+ upsertDirtyCheck: (kind, id, existingProps, inputProps) => chunkQ4MXRK6A_cjs.nodeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps)
27378
27378
  },
27379
- executeDelete: (kind, id, backend) => chunk2PUJGVJ6_cjs.executeNodeDelete(ctx, kind, id, backend),
27380
- executeDeleteBatch: (kind, ids, backend) => chunk2PUJGVJ6_cjs.executeNodeDeleteBatch(ctx, kind, ids, backend),
27381
- executeHardDelete: (kind, id, backend) => chunk2PUJGVJ6_cjs.executeNodeHardDelete(ctx, kind, id, backend),
27379
+ executeDelete: (kind, id, backend) => chunkQ4MXRK6A_cjs.executeNodeDelete(ctx, kind, id, backend),
27380
+ executeDeleteBatch: (kind, ids, backend) => chunkQ4MXRK6A_cjs.executeNodeDeleteBatch(ctx, kind, ids, backend),
27381
+ executeHardDelete: (kind, id, backend) => chunkQ4MXRK6A_cjs.executeNodeHardDelete(ctx, kind, id, backend),
27382
27382
  temporalRowMatcher: (options) => this.#temporalRowMatcher(options),
27383
27383
  createQuery: () => this.query(),
27384
- executeGetOrCreateByConstraint: (kind, constraintName, props, backend, options) => chunk2PUJGVJ6_cjs.executeNodeGetOrCreateByConstraint(
27384
+ executeGetOrCreateByConstraint: (kind, constraintName, props, backend, options) => chunkQ4MXRK6A_cjs.executeNodeGetOrCreateByConstraint(
27385
27385
  ctx,
27386
27386
  kind,
27387
27387
  constraintName,
@@ -27389,7 +27389,7 @@ var StoreImplementation = class _StoreImplementation {
27389
27389
  backend,
27390
27390
  options
27391
27391
  ),
27392
- executeBulkGetOrCreateByConstraint: (kind, constraintName, items, backend, options) => chunk2PUJGVJ6_cjs.executeNodeBulkGetOrCreateByConstraint(
27392
+ executeBulkGetOrCreateByConstraint: (kind, constraintName, items, backend, options) => chunkQ4MXRK6A_cjs.executeNodeBulkGetOrCreateByConstraint(
27393
27393
  ctx,
27394
27394
  kind,
27395
27395
  constraintName,
@@ -27397,15 +27397,15 @@ var StoreImplementation = class _StoreImplementation {
27397
27397
  backend,
27398
27398
  options
27399
27399
  ),
27400
- executeFindByConstraint: (kind, constraintName, props, backend) => chunk2PUJGVJ6_cjs.executeNodeFindByConstraint(ctx, kind, constraintName, props, backend),
27401
- executeBulkFindByConstraint: (kind, constraintName, items, backend) => chunk2PUJGVJ6_cjs.executeNodeBulkFindByConstraint(
27400
+ executeFindByConstraint: (kind, constraintName, props, backend) => chunkQ4MXRK6A_cjs.executeNodeFindByConstraint(ctx, kind, constraintName, props, backend),
27401
+ executeBulkFindByConstraint: (kind, constraintName, items, backend) => chunkQ4MXRK6A_cjs.executeNodeBulkFindByConstraint(
27402
27402
  ctx,
27403
27403
  kind,
27404
27404
  constraintName,
27405
27405
  items,
27406
27406
  backend
27407
27407
  ),
27408
- executeBulkFindByIndex: (kind, indexName, items, backend, options) => chunk2PUJGVJ6_cjs.executeNodeBulkFindByIndex(
27408
+ executeBulkFindByIndex: (kind, indexName, items, backend, options) => chunkQ4MXRK6A_cjs.executeNodeBulkFindByIndex(
27409
27409
  ctx,
27410
27410
  kind,
27411
27411
  indexName,
@@ -27424,7 +27424,7 @@ var StoreImplementation = class _StoreImplementation {
27424
27424
  #buildEdgeOperations(ctx) {
27425
27425
  return {
27426
27426
  defaultTemporalMode: this.#graph.defaults.temporalMode,
27427
- rowToEdge: (row) => chunk2PUJGVJ6_cjs.rowToEdge(row),
27427
+ rowToEdge: (row) => chunkQ4MXRK6A_cjs.rowToEdge(row),
27428
27428
  maybeRefreshStatisticsAfterBulk: (rowCount) => this.#maybeRefreshStatisticsAfterBulk(rowCount),
27429
27429
  executeCreate: (input, backend) => executeEdgeCreate(ctx, input, backend),
27430
27430
  executeCreateBatch: (inputs, backend) => executeEdgeCreateBatch(ctx, inputs, backend),
@@ -28080,7 +28080,7 @@ var StoreImplementation = class _StoreImplementation {
28080
28080
  });
28081
28081
  const edgesBySource = /* @__PURE__ */ new Map();
28082
28082
  for (const row of rows) {
28083
- const edge = chunk2PUJGVJ6_cjs.rowToEdge(row);
28083
+ const edge = chunkQ4MXRK6A_cjs.rowToEdge(row);
28084
28084
  const key = side === "from" ? `${edge.fromKind}\0${edge.fromId}` : `${edge.toKind}\0${edge.toId}`;
28085
28085
  const bucket = edgesBySource.get(key);
28086
28086
  if (bucket === void 0) edgesBySource.set(key, [edge]);
@@ -28747,7 +28747,7 @@ var StoreImplementation = class _StoreImplementation {
28747
28747
  }
28748
28748
  for (const row of rows) receiptRecorder?.recordNode(row.kind, 1);
28749
28749
  return rows.map(
28750
- (row) => chunk2PUJGVJ6_cjs.rowToNode(row)
28750
+ (row) => chunkQ4MXRK6A_cjs.rowToNode(row)
28751
28751
  );
28752
28752
  }
28753
28753
  /**
@@ -28804,7 +28804,7 @@ var StoreImplementation = class _StoreImplementation {
28804
28804
  receiptRecorder
28805
28805
  ));
28806
28806
  }
28807
- const identity = this.#graph.identity === void 0 ? void 0 : chunkB33AHPS7_cjs.createIdentityFacade(this.#identityContext(txBackend));
28807
+ const identity = this.#graph.identity === void 0 ? void 0 : chunkH3ULZVTX_cjs.createIdentityFacade(this.#identityContext(txBackend));
28808
28808
  const receiptIdentity = identity === void 0 || receiptRecorder === void 0 ? identity : wrapTransactionIdentity(identity, receiptRecorder);
28809
28809
  const getNodeCollection = (kind) => this.#resolveDynamicNodeCollection(nodes, kind);
28810
28810
  const base = {
@@ -28907,7 +28907,7 @@ var StoreImplementation = class _StoreImplementation {
28907
28907
  for (const [index, node] of nodes.entries()) {
28908
28908
  if (node !== void 0) {
28909
28909
  loadedByReference.set(
28910
- chunkB33AHPS7_cjs.refKey({ kind, id: chunkBXHAPCQG_cjs.requireDefined(ids[index]) }),
28910
+ chunkH3ULZVTX_cjs.refKey({ kind, id: chunkBXHAPCQG_cjs.requireDefined(ids[index]) }),
28911
28911
  node
28912
28912
  );
28913
28913
  }
@@ -28927,14 +28927,14 @@ var StoreImplementation = class _StoreImplementation {
28927
28927
  if (row === void 0) continue;
28928
28928
  if (!includeTombstoned && row.deleted_at !== void 0) continue;
28929
28929
  loadedByReference.set(
28930
- chunkB33AHPS7_cjs.refKey({ kind, id: row.id }),
28931
- chunk2PUJGVJ6_cjs.rowToNode(row)
28930
+ chunkH3ULZVTX_cjs.refKey({ kind, id: row.id }),
28931
+ chunkQ4MXRK6A_cjs.rowToNode(row)
28932
28932
  );
28933
28933
  }
28934
28934
  })
28935
28935
  );
28936
28936
  return references.map(
28937
- (reference) => loadedByReference.get(chunkB33AHPS7_cjs.refKey(reference))
28937
+ (reference) => loadedByReference.get(chunkH3ULZVTX_cjs.refKey(reference))
28938
28938
  );
28939
28939
  }
28940
28940
  };
@@ -28967,7 +28967,7 @@ var StoreImplementation = class _StoreImplementation {
28967
28967
  await chunkQEXVOTI2_cjs.lockRecordedGraphWrite(target, this.graphId);
28968
28968
  }
28969
28969
  if (this.#graph.identity !== void 0) {
28970
- await chunkB33AHPS7_cjs.lockIdentityGraph(target, this.graphId);
28970
+ await chunkH3ULZVTX_cjs.lockIdentityGraph(target, this.graphId);
28971
28971
  }
28972
28972
  const previousRevision = this.#revisionTrackingEnabled && !this.#captureEnabled ? await chunkQEXVOTI2_cjs.readRecordedClock(target, this.#sqlSchema(), this.graphId) : void 0;
28973
28973
  const clearGraphPreservingContributions = target.clearGraphPreservingContributionMaterializations;
@@ -29199,7 +29199,7 @@ var StoreImplementation = class _StoreImplementation {
29199
29199
  });
29200
29200
  }
29201
29201
  if (requirements.identityAffectedKinds.length > 0) {
29202
- const storage = await chunkA7YKBSKQ_cjs.inspectAdoptedIdentityStorage(
29202
+ const storage = await chunkZO72TBQE_cjs.inspectAdoptedIdentityStorage(
29203
29203
  adopted.backend,
29204
29204
  this.#sqlSchema(),
29205
29205
  {
@@ -29256,7 +29256,7 @@ var StoreImplementation = class _StoreImplementation {
29256
29256
  }
29257
29257
  );
29258
29258
  }
29259
- const storedSchema = chunkA7YKBSKQ_cjs.parseSerializedSchema(activeRow.schema_doc);
29259
+ const storedSchema = chunkZO72TBQE_cjs.parseSerializedSchema(activeRow.schema_doc);
29260
29260
  this.#evolutionPlanningSnapshot = {
29261
29261
  activeRow,
29262
29262
  storedSchema,
@@ -29316,7 +29316,7 @@ var StoreImplementation = class _StoreImplementation {
29316
29316
  return this;
29317
29317
  }
29318
29318
  return this.#cloneWithGraph(
29319
- this.#catchUpToStored(chunkA7YKBSKQ_cjs.parseSerializedSchema(active.schema_doc)),
29319
+ this.#catchUpToStored(chunkZO72TBQE_cjs.parseSerializedSchema(active.schema_doc)),
29320
29320
  options?.ref,
29321
29321
  schemaMetadataFromRow(active)
29322
29322
  );
@@ -29372,7 +29372,7 @@ var StoreImplementation = class _StoreImplementation {
29372
29372
  */
29373
29373
  async evolve(extension, options) {
29374
29374
  const { activeRow, storedSchema, baseline } = await this.#loadCaughtUp("evolve");
29375
- const merged = chunkA7YKBSKQ_cjs.mergeGraphExtension(baseline, extension);
29375
+ const merged = chunkZO72TBQE_cjs.mergeGraphExtension(baseline, extension);
29376
29376
  if (merged === baseline) {
29377
29377
  if (baseline === this.#graph) {
29378
29378
  syncStoreReplacementRef(options?.ref, this);
@@ -29401,7 +29401,7 @@ var StoreImplementation = class _StoreImplementation {
29401
29401
  );
29402
29402
  }
29403
29403
  const identityCandidate = merged.identity === void 0 ? void 0 : this.#cloneWithGraph(merged, void 0);
29404
- const identityProvisioning = identityCandidate === void 0 ? void 0 : await chunkA7YKBSKQ_cjs.ensureIdentitySchemaStorage(
29404
+ const identityProvisioning = identityCandidate === void 0 ? void 0 : await chunkZO72TBQE_cjs.ensureIdentitySchemaStorage(
29405
29405
  this.#baseBackend,
29406
29406
  this.#sqlSchema(),
29407
29407
  {
@@ -29410,7 +29410,7 @@ var StoreImplementation = class _StoreImplementation {
29410
29410
  // The evolved graph's registry — the one the candidate's own
29411
29411
  // preflight rebuilds through, so the predicate and the fill agree
29412
29412
  // on which assertions count.
29413
- registry: chunkA7YKBSKQ_cjs.buildKindRegistry(merged)
29413
+ registry: chunkZO72TBQE_cjs.buildKindRegistry(merged)
29414
29414
  }
29415
29415
  );
29416
29416
  const committed = identityCandidate === void 0 ? classification.requireEmpty.length > 0 ? await commitEvolvedSchemaWhenRequiredKindsAreEmpty(
@@ -29419,12 +29419,12 @@ var StoreImplementation = class _StoreImplementation {
29419
29419
  activeRow.version,
29420
29420
  classification,
29421
29421
  storedSchema
29422
- ) : await chunkA7YKBSKQ_cjs.commitNewSchemaVersion(
29422
+ ) : await chunkZO72TBQE_cjs.commitNewSchemaVersion(
29423
29423
  this.#backend,
29424
29424
  merged,
29425
29425
  activeRow.version,
29426
29426
  storedSchema
29427
- ) : await chunkA7YKBSKQ_cjs.commitNewSchemaVersionWithPreflight(
29427
+ ) : await chunkZO72TBQE_cjs.commitNewSchemaVersionWithPreflight(
29428
29428
  this.#backend,
29429
29429
  merged,
29430
29430
  activeRow.version,
@@ -29810,8 +29810,8 @@ var StoreImplementation = class _StoreImplementation {
29810
29810
  */
29811
29811
  async verifyConstraintFences() {
29812
29812
  const activeRow = await this.#baseBackend.getActiveSchema(this.graphId);
29813
- const graph = activeRow === void 0 ? this.#graph : this.#catchUpToStored(chunkA7YKBSKQ_cjs.parseSerializedSchema(activeRow.schema_doc));
29814
- const registry = graph === this.#graph ? this.#registry : chunkA7YKBSKQ_cjs.buildKindRegistry(graph);
29813
+ const graph = activeRow === void 0 ? this.#graph : this.#catchUpToStored(chunkZO72TBQE_cjs.parseSerializedSchema(activeRow.schema_doc));
29814
+ const registry = graph === this.#graph ? this.#registry : chunkZO72TBQE_cjs.buildKindRegistry(graph);
29815
29815
  return verifyConstraintFences({
29816
29816
  graph,
29817
29817
  registry,
@@ -30070,7 +30070,7 @@ var StoreImplementation = class _StoreImplementation {
30070
30070
  */
30071
30071
  async removeKinds(names, options) {
30072
30072
  const { activeRow, storedSchema, baseline } = await this.#loadCaughtUp("remove");
30073
- const plan = chunkA7YKBSKQ_cjs.planRemovals(baseline, names);
30073
+ const plan = chunkZO72TBQE_cjs.planRemovals(baseline, names);
30074
30074
  if (plan.removedNodeKinds.length === 0 && plan.removedEdgeKinds.length === 0) {
30075
30075
  if (baseline === this.#graph) {
30076
30076
  syncStoreReplacementRef(options?.ref, this);
@@ -30082,19 +30082,19 @@ var StoreImplementation = class _StoreImplementation {
30082
30082
  schemaMetadataFromRow(activeRow)
30083
30083
  );
30084
30084
  }
30085
- const compileTimeGraph = chunkA7YKBSKQ_cjs.stripGraphExtension(this.#graph);
30086
- const merged = plan.document === void 0 ? compileTimeGraph : chunkA7YKBSKQ_cjs.mergeGraphExtension(compileTimeGraph, plan.document);
30087
- const finalGraph = chunkA7YKBSKQ_cjs.applyDeprecatedKinds(merged, baseline.deprecatedKinds);
30085
+ const compileTimeGraph = chunkZO72TBQE_cjs.stripGraphExtension(this.#graph);
30086
+ const merged = plan.document === void 0 ? compileTimeGraph : chunkZO72TBQE_cjs.mergeGraphExtension(compileTimeGraph, plan.document);
30087
+ const finalGraph = chunkZO72TBQE_cjs.applyDeprecatedKinds(merged, baseline.deprecatedKinds);
30088
30088
  const identityCascade = await this.#identityRemovalPreflight(
30089
30089
  finalGraph,
30090
30090
  plan.removedNodeKinds
30091
30091
  );
30092
- const committedRow = identityCascade === void 0 ? await chunkA7YKBSKQ_cjs.commitNewSchemaVersion(
30092
+ const committedRow = identityCascade === void 0 ? await chunkZO72TBQE_cjs.commitNewSchemaVersion(
30093
30093
  this.#backend,
30094
30094
  finalGraph,
30095
30095
  activeRow.version,
30096
30096
  storedSchema
30097
- ) : await chunkA7YKBSKQ_cjs.commitNewSchemaVersionWithPreflight(
30097
+ ) : await chunkZO72TBQE_cjs.commitNewSchemaVersionWithPreflight(
30098
30098
  this.#backend,
30099
30099
  finalGraph,
30100
30100
  activeRow.version,
@@ -30153,7 +30153,7 @@ var StoreImplementation = class _StoreImplementation {
30153
30153
  async #identityRemovalPreflight(finalGraph, removedNodeKinds) {
30154
30154
  if (removedNodeKinds.length === 0) return void 0;
30155
30155
  const repairClosure = finalGraph.identity !== void 0;
30156
- if (!repairClosure && !await chunkA7YKBSKQ_cjs.identityKindCascadeNeeded(
30156
+ if (!repairClosure && !await chunkZO72TBQE_cjs.identityKindCascadeNeeded(
30157
30157
  this.#backend,
30158
30158
  this.#sqlSchema(),
30159
30159
  this.graphId,
@@ -30214,8 +30214,8 @@ var StoreImplementation = class _StoreImplementation {
30214
30214
  schemaMetadataFromRow(activeRow)
30215
30215
  );
30216
30216
  }
30217
- const merged = chunkA7YKBSKQ_cjs.applyDeprecatedKinds(baseline, nextSet);
30218
- const result = await chunkA7YKBSKQ_cjs.ensureSchema(this.#backend, merged, {
30217
+ const merged = chunkZO72TBQE_cjs.applyDeprecatedKinds(baseline, nextSet);
30218
+ const result = await chunkZO72TBQE_cjs.ensureSchema(this.#backend, merged, {
30219
30219
  preloaded: { activeRow, storedSchema },
30220
30220
  autoMigrate: true
30221
30221
  });
@@ -30223,9 +30223,9 @@ var StoreImplementation = class _StoreImplementation {
30223
30223
  return this.#cloneWithGraph(merged, options?.ref, metadata);
30224
30224
  }
30225
30225
  #catchUpToStored(storedSchema) {
30226
- const compileTimeGraph = chunkA7YKBSKQ_cjs.stripGraphExtension(this.#graph);
30227
- const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph : chunkA7YKBSKQ_cjs.mergeGraphExtension(compileTimeGraph, storedSchema.extension);
30228
- return chunkA7YKBSKQ_cjs.applyDeprecatedKinds(
30226
+ const compileTimeGraph = chunkZO72TBQE_cjs.stripGraphExtension(this.#graph);
30227
+ const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph : chunkZO72TBQE_cjs.mergeGraphExtension(compileTimeGraph, storedSchema.extension);
30228
+ return chunkZO72TBQE_cjs.applyDeprecatedKinds(
30229
30229
  withGraphExtension,
30230
30230
  storedSchema.deprecatedKinds
30231
30231
  );
@@ -30243,7 +30243,7 @@ var StoreImplementation = class _StoreImplementation {
30243
30243
  * serializes the actual commit.
30244
30244
  */
30245
30245
  async #loadCaughtUp(verb) {
30246
- const activeRow = await chunkA7YKBSKQ_cjs.loadActiveSchemaWithBootstrap(
30246
+ const activeRow = await chunkZO72TBQE_cjs.loadActiveSchemaWithBootstrap(
30247
30247
  this.#backend,
30248
30248
  this.graphId
30249
30249
  );
@@ -30254,7 +30254,7 @@ var StoreImplementation = class _StoreImplementation {
30254
30254
  { code }
30255
30255
  );
30256
30256
  }
30257
- const storedSchema = chunkA7YKBSKQ_cjs.parseSerializedSchema(activeRow.schema_doc);
30257
+ const storedSchema = chunkZO72TBQE_cjs.parseSerializedSchema(activeRow.schema_doc);
30258
30258
  const baseline = this.#catchUpToStored(storedSchema);
30259
30259
  return { activeRow, storedSchema, baseline };
30260
30260
  }
@@ -30347,8 +30347,8 @@ var StoreImplementation = class _StoreImplementation {
30347
30347
  uniqueSidecarBatch: this.#uniqueSidecarBatch,
30348
30348
  ...identityConfig === void 0 ? {} : {
30349
30349
  identity: {
30350
- lock: (target) => chunkB33AHPS7_cjs.lockIdentityGraph(target, this.graphId),
30351
- foldCreated: (target, references) => chunkB33AHPS7_cjs.foldIdentityForCreatedNodes(
30350
+ lock: (target) => chunkH3ULZVTX_cjs.lockIdentityGraph(target, this.graphId),
30351
+ foldCreated: (target, references) => chunkH3ULZVTX_cjs.foldIdentityForCreatedNodes(
30352
30352
  {
30353
30353
  graphId: this.graphId,
30354
30354
  registry: this.#registry,
@@ -30358,7 +30358,7 @@ var StoreImplementation = class _StoreImplementation {
30358
30358
  target,
30359
30359
  references
30360
30360
  ),
30361
- detachDeleted: (target, ref, mode) => chunkB33AHPS7_cjs.detachIdentityForNode(
30361
+ detachDeleted: (target, ref, mode) => chunkH3ULZVTX_cjs.detachIdentityForNode(
30362
30362
  {
30363
30363
  graphId: this.graphId,
30364
30364
  sameIdAcrossKinds: identityConfig.sameIdAcrossKinds,
@@ -30368,7 +30368,7 @@ var StoreImplementation = class _StoreImplementation {
30368
30368
  ref,
30369
30369
  mode
30370
30370
  ),
30371
- requireValidityEndCompatible: (target, ref, validTo) => chunkB33AHPS7_cjs.requireNodeValidityEndCompatible(
30371
+ requireValidityEndCompatible: (target, ref, validTo) => chunkH3ULZVTX_cjs.requireNodeValidityEndCompatible(
30372
30372
  {
30373
30373
  graphId: this.graphId,
30374
30374
  schema: this.#sqlSchema()
@@ -30856,7 +30856,7 @@ var IDENTITY_GATE_CODES = {
30856
30856
  };
30857
30857
  async function ensureSchemaWithIdentityPrecedence(backend, graph, options, gate) {
30858
30858
  try {
30859
- return await chunkA7YKBSKQ_cjs.ensureSchema(backend, graph, options);
30859
+ return await chunkZO72TBQE_cjs.ensureSchema(backend, graph, options);
30860
30860
  } catch (error) {
30861
30861
  if (gate === void 0 || !isIdentityOnlyBreakingChange(error)) throw error;
30862
30862
  throw identityMigrationRequiredError(graph.id, gate, {
@@ -30895,7 +30895,7 @@ function rebuildIdentityClosureWithSchemaFence(identityContext, writeContext) {
30895
30895
  return chunkQEXVOTI2_cjs.runInWriteTransaction(
30896
30896
  writeContext,
30897
30897
  identityContext.backend,
30898
- async (target) => chunkB33AHPS7_cjs.rebuildIdentityClosureForContext({ ...identityContext, backend: target }),
30898
+ async (target) => chunkH3ULZVTX_cjs.rebuildIdentityClosureForContext({ ...identityContext, backend: target }),
30899
30899
  { didWrite: () => false }
30900
30900
  );
30901
30901
  }
@@ -30904,7 +30904,7 @@ async function prepareStoreWithSchema(graph, backend, options) {
30904
30904
  graph: merged,
30905
30905
  activeRow,
30906
30906
  storedSchema
30907
- } = await chunkA7YKBSKQ_cjs.loadAndMergeGraphExtensionDocument(backend, graph);
30907
+ } = await chunkZO72TBQE_cjs.loadAndMergeGraphExtensionDocument(backend, graph);
30908
30908
  const identityProfileChanged = activeRow !== void 0 && storedSchema?.identity?.sameIdAcrossKinds !== merged.identity?.sameIdAcrossKinds;
30909
30909
  const identityInitialization = activeRow === void 0 && merged.identity !== void 0;
30910
30910
  const identityEnablement = identityInitialization || identityProfileChanged && storedSchema?.identity === void 0 && merged.identity !== void 0;
@@ -30916,8 +30916,8 @@ async function prepareStoreWithSchema(graph, backend, options) {
30916
30916
  const identityProfile = merged.identity;
30917
30917
  if (identityProfile !== void 0) {
30918
30918
  const resolvedIdentitySchema = options?.schema === void 0 ? chunkAZ2Q6RRS_cjs.createSqlSchema(backend.tableNames) : chunkAZ2Q6RRS_cjs.requireSqlSchema(options.schema, "store schema");
30919
- const identityRegistry = chunkA7YKBSKQ_cjs.buildKindRegistry(merged);
30920
- await chunkA7YKBSKQ_cjs.ensureIdentitySchemaStorage(backend, resolvedIdentitySchema, {
30919
+ const identityRegistry = chunkZO72TBQE_cjs.buildKindRegistry(merged);
30920
+ await chunkZO72TBQE_cjs.ensureIdentitySchemaStorage(backend, resolvedIdentitySchema, {
30921
30921
  graphId: merged.id,
30922
30922
  enablement: identityEnablement,
30923
30923
  registry: identityRegistry,
@@ -31050,7 +31050,7 @@ async function prepareVerifiedStore(graph, backend, options) {
31050
31050
  graph: merged,
31051
31051
  activeRow,
31052
31052
  result
31053
- } = await chunkA7YKBSKQ_cjs.loadAndVerifyGraph(backend, graph);
31053
+ } = await chunkZO72TBQE_cjs.loadAndVerifyGraph(backend, graph);
31054
31054
  await assertHistorySchemaOnOpen(backend, merged, options);
31055
31055
  return {
31056
31056
  graph: merged,
@@ -31119,5 +31119,5 @@ exports.orderByFragment = orderByFragment;
31119
31119
  exports.relationalIndexDdlOptions = relationalIndexDdlOptions;
31120
31120
  exports.sum = sum;
31121
31121
  exports.vectorIndexParams = vectorIndexParams;
31122
- //# sourceMappingURL=chunk-TVOQ2DGB.cjs.map
31123
- //# sourceMappingURL=chunk-TVOQ2DGB.cjs.map
31122
+ //# sourceMappingURL=chunk-XZJDI4OR.cjs.map
31123
+ //# sourceMappingURL=chunk-XZJDI4OR.cjs.map