@nicia-ai/typegraph 0.25.1 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/backend/postgres/index.cjs +161 -113
  2. package/dist/backend/postgres/index.cjs.map +1 -1
  3. package/dist/backend/postgres/index.d.cts +6 -8
  4. package/dist/backend/postgres/index.d.ts +6 -8
  5. package/dist/backend/postgres/index.js +116 -68
  6. package/dist/backend/postgres/index.js.map +1 -1
  7. package/dist/backend/sqlite/index.cjs +16 -15
  8. package/dist/backend/sqlite/index.d.cts +11 -26
  9. package/dist/backend/sqlite/index.d.ts +11 -26
  10. package/dist/backend/sqlite/index.js +6 -5
  11. package/dist/backend/sqlite/libsql.cjs +9 -8
  12. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  13. package/dist/backend/sqlite/libsql.d.cts +4 -3
  14. package/dist/backend/sqlite/libsql.d.ts +4 -3
  15. package/dist/backend/sqlite/libsql.js +6 -5
  16. package/dist/backend/sqlite/libsql.js.map +1 -1
  17. package/dist/backend/sqlite/local.cjs +11 -10
  18. package/dist/backend/sqlite/local.cjs.map +1 -1
  19. package/dist/backend/sqlite/local.d.cts +4 -3
  20. package/dist/backend/sqlite/local.d.ts +4 -3
  21. package/dist/backend/sqlite/local.js +6 -5
  22. package/dist/backend/sqlite/local.js.map +1 -1
  23. package/dist/chunk-4FJVSF3K.cjs +12 -0
  24. package/dist/{chunk-D2GO3RBL.cjs.map → chunk-4FJVSF3K.cjs.map} +1 -1
  25. package/dist/chunk-5H3BAMTB.js +32 -0
  26. package/dist/chunk-5H3BAMTB.js.map +1 -0
  27. package/dist/{chunk-CLEUFN2K.js → chunk-DDVA4QBA.js} +174 -78
  28. package/dist/chunk-DDVA4QBA.js.map +1 -0
  29. package/dist/{chunk-OECDVACY.cjs → chunk-DN4RUDF3.cjs} +2 -2
  30. package/dist/chunk-DN4RUDF3.cjs.map +1 -0
  31. package/dist/{chunk-NHQWXSTS.js → chunk-E5ROA3MN.js} +3 -3
  32. package/dist/{chunk-NHQWXSTS.js.map → chunk-E5ROA3MN.js.map} +1 -1
  33. package/dist/{chunk-CPFR3O7L.js → chunk-ENXJLDRK.js} +2 -2
  34. package/dist/chunk-ENXJLDRK.js.map +1 -0
  35. package/dist/chunk-IUIWCFG3.cjs +36 -0
  36. package/dist/chunk-IUIWCFG3.cjs.map +1 -0
  37. package/dist/{chunk-EG6TJ3I5.js → chunk-OYLF3IC7.js} +3 -3
  38. package/dist/{chunk-EG6TJ3I5.js.map → chunk-OYLF3IC7.js.map} +1 -1
  39. package/dist/{chunk-JTI5WT4P.cjs → chunk-PN37HVAV.cjs} +32 -10
  40. package/dist/chunk-PN37HVAV.cjs.map +1 -0
  41. package/dist/{chunk-RCAJZG67.cjs → chunk-PYJOBZR3.cjs} +10 -10
  42. package/dist/{chunk-RCAJZG67.cjs.map → chunk-PYJOBZR3.cjs.map} +1 -1
  43. package/dist/{chunk-PSKUWVCB.js → chunk-RF5EUQWS.js} +336 -36
  44. package/dist/chunk-RF5EUQWS.js.map +1 -0
  45. package/dist/{chunk-CLGC7AQ2.cjs → chunk-RVT2N4RF.cjs} +206 -110
  46. package/dist/chunk-RVT2N4RF.cjs.map +1 -0
  47. package/dist/{chunk-4BOWVUGQ.js → chunk-TSGBRPNE.js} +3 -3
  48. package/dist/{chunk-4BOWVUGQ.js.map → chunk-TSGBRPNE.js.map} +1 -1
  49. package/dist/{chunk-CQVNGKU7.cjs → chunk-TVUARC7S.cjs} +410 -100
  50. package/dist/chunk-TVUARC7S.cjs.map +1 -0
  51. package/dist/{chunk-DOTEN2FG.js → chunk-U5ROKVRF.js} +26 -3
  52. package/dist/chunk-U5ROKVRF.js.map +1 -0
  53. package/dist/{chunk-E5JZSEGJ.cjs → chunk-WFUN6DCM.cjs} +8 -8
  54. package/dist/{chunk-E5JZSEGJ.cjs.map → chunk-WFUN6DCM.cjs.map} +1 -1
  55. package/dist/{chunk-AAA2CR3P.js → chunk-X53YKGHR.js} +78 -37
  56. package/dist/chunk-X53YKGHR.js.map +1 -0
  57. package/dist/{chunk-W5MTHMTE.cjs → chunk-YEDQLNVE.cjs} +26 -2
  58. package/dist/chunk-YEDQLNVE.cjs.map +1 -0
  59. package/dist/{chunk-QMQYK3IF.cjs → chunk-ZGEMI7MJ.cjs} +163 -122
  60. package/dist/chunk-ZGEMI7MJ.cjs.map +1 -0
  61. package/dist/{chunk-YZZBDCLV.js → chunk-ZTREJOGB.js} +32 -11
  62. package/dist/chunk-ZTREJOGB.js.map +1 -0
  63. package/dist/{ddl-BqMmpNor.d.ts → ddl-9kw8UADK.d.ts} +298 -12
  64. package/dist/{ddl-Bwjh8Hff.d.cts → ddl-Cw82BPM4.d.cts} +298 -12
  65. package/dist/{extension-types-D07e_NTw.d.cts → extension-types-B78CZfA5.d.cts} +1 -1
  66. package/dist/{extension-types-D07e_NTw.d.ts → extension-types-B78CZfA5.d.ts} +1 -1
  67. package/dist/graph-extension/index.cjs +18 -18
  68. package/dist/graph-extension/index.d.cts +4 -4
  69. package/dist/graph-extension/index.d.ts +4 -4
  70. package/dist/graph-extension/index.js +3 -3
  71. package/dist/{index-CT6nvtxL.d.cts → index-Bilw0pYm.d.cts} +34 -3
  72. package/dist/{index-DQheiVQV.d.ts → index-CWdBFWbI.d.ts} +34 -3
  73. package/dist/index.cjs +482 -361
  74. package/dist/index.cjs.map +1 -1
  75. package/dist/index.d.cts +13 -11
  76. package/dist/index.d.ts +13 -11
  77. package/dist/index.js +153 -37
  78. package/dist/index.js.map +1 -1
  79. package/dist/indexes/index.cjs +13 -13
  80. package/dist/indexes/index.d.cts +5 -5
  81. package/dist/indexes/index.d.ts +5 -5
  82. package/dist/indexes/index.js +1 -1
  83. package/dist/interchange/index.cjs +7 -7
  84. package/dist/interchange/index.d.cts +7 -5
  85. package/dist/interchange/index.d.ts +7 -5
  86. package/dist/interchange/index.js +2 -2
  87. package/dist/{manager-Cy3dhwYO.d.cts → manager-CWa9cgwb.d.cts} +36 -9
  88. package/dist/{manager-sZkU2VPC.d.ts → manager-Cfcb2sJL.d.ts} +36 -9
  89. package/dist/{materialize-indexes-BB9N5uQl.d.cts → materialize-indexes-BQfaAZKA.d.cts} +1 -1
  90. package/dist/{materialize-indexes-BYpU2RKh.d.ts → materialize-indexes-DFavFQah.d.ts} +1 -1
  91. package/dist/profiler/index.d.cts +9 -7
  92. package/dist/profiler/index.d.ts +9 -7
  93. package/dist/schema/index.cjs +32 -27
  94. package/dist/schema/index.cjs.map +1 -1
  95. package/dist/schema/index.d.cts +9 -7
  96. package/dist/schema/index.d.ts +9 -7
  97. package/dist/schema/index.js +6 -5
  98. package/dist/schema/index.js.map +1 -1
  99. package/dist/{sqlite-h6dta1IJ.d.ts → sqlite-BvSEbybu.d.cts} +320 -1
  100. package/dist/{sqlite-BhFswiAR.d.cts → sqlite-GKvcDPVn.d.ts} +320 -1
  101. package/dist/{store-BS_hehiz.d.ts → store-C57kdvAa.d.ts} +155 -5
  102. package/dist/{store-CkCvqRUf.d.cts → store-Ojf0NOKk.d.cts} +155 -5
  103. package/dist/{types-BpgACExN.d.cts → types-CF7nDH3q.d.cts} +2 -2
  104. package/dist/{types-Bz-Pi681.d.ts → types-Cars4JZ1.d.ts} +2 -2
  105. package/dist/{types-DptZHe-l.d.ts → types-DZPBXZOK.d.cts} +272 -14
  106. package/dist/{types-WF5ItKQu.d.cts → types-Dzkr0Eqi.d.ts} +272 -14
  107. package/dist/{where-DZYMiXVq.d.cts → where-BmtjfWuS.d.cts} +2 -2
  108. package/dist/{where-C40InMIp.d.ts → where-kk1Zz2En.d.ts} +2 -2
  109. package/package.json +3 -1
  110. package/dist/chunk-AAA2CR3P.js.map +0 -1
  111. package/dist/chunk-CLEUFN2K.js.map +0 -1
  112. package/dist/chunk-CLGC7AQ2.cjs.map +0 -1
  113. package/dist/chunk-CPFR3O7L.js.map +0 -1
  114. package/dist/chunk-CQVNGKU7.cjs.map +0 -1
  115. package/dist/chunk-D2GO3RBL.cjs +0 -12
  116. package/dist/chunk-DOTEN2FG.js.map +0 -1
  117. package/dist/chunk-JTI5WT4P.cjs.map +0 -1
  118. package/dist/chunk-OECDVACY.cjs.map +0 -1
  119. package/dist/chunk-PSKUWVCB.js.map +0 -1
  120. package/dist/chunk-QMQYK3IF.cjs.map +0 -1
  121. package/dist/chunk-W5MTHMTE.cjs.map +0 -1
  122. package/dist/chunk-YZZBDCLV.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJTI5WT4P_cjs = require('../chunk-JTI5WT4P.cjs');
3
+ var chunkPN37HVAV_cjs = require('../chunk-PN37HVAV.cjs');
4
4
  var chunkCTHNVU6K_cjs = require('../chunk-CTHNVU6K.cjs');
5
5
  require('../chunk-EK6RJ373.cjs');
6
6
  require('../chunk-X3244EKP.cjs');
@@ -10,51 +10,51 @@ require('../chunk-7V335GHG.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "andWhere", {
12
12
  enumerable: true,
13
- get: function () { return chunkJTI5WT4P_cjs.andWhere; }
13
+ get: function () { return chunkPN37HVAV_cjs.andWhere; }
14
14
  });
15
15
  Object.defineProperty(exports, "buildPostgresEdgeIndexBuilders", {
16
16
  enumerable: true,
17
- get: function () { return chunkJTI5WT4P_cjs.buildPostgresEdgeIndexBuilders; }
17
+ get: function () { return chunkPN37HVAV_cjs.buildPostgresEdgeIndexBuilders; }
18
18
  });
19
19
  Object.defineProperty(exports, "buildPostgresNodeIndexBuilders", {
20
20
  enumerable: true,
21
- get: function () { return chunkJTI5WT4P_cjs.buildPostgresNodeIndexBuilders; }
21
+ get: function () { return chunkPN37HVAV_cjs.buildPostgresNodeIndexBuilders; }
22
22
  });
23
23
  Object.defineProperty(exports, "buildSqliteEdgeIndexBuilders", {
24
24
  enumerable: true,
25
- get: function () { return chunkJTI5WT4P_cjs.buildSqliteEdgeIndexBuilders; }
25
+ get: function () { return chunkPN37HVAV_cjs.buildSqliteEdgeIndexBuilders; }
26
26
  });
27
27
  Object.defineProperty(exports, "buildSqliteNodeIndexBuilders", {
28
28
  enumerable: true,
29
- get: function () { return chunkJTI5WT4P_cjs.buildSqliteNodeIndexBuilders; }
29
+ get: function () { return chunkPN37HVAV_cjs.buildSqliteNodeIndexBuilders; }
30
30
  });
31
31
  Object.defineProperty(exports, "generateEdgeIndexDDL", {
32
32
  enumerable: true,
33
- get: function () { return chunkJTI5WT4P_cjs.generateEdgeIndexDDL; }
33
+ get: function () { return chunkPN37HVAV_cjs.generateEdgeIndexDDL; }
34
34
  });
35
35
  Object.defineProperty(exports, "generateIndexDDL", {
36
36
  enumerable: true,
37
- get: function () { return chunkJTI5WT4P_cjs.generateIndexDDL; }
37
+ get: function () { return chunkPN37HVAV_cjs.generateIndexDDL; }
38
38
  });
39
39
  Object.defineProperty(exports, "generateNodeIndexDDL", {
40
40
  enumerable: true,
41
- get: function () { return chunkJTI5WT4P_cjs.generateNodeIndexDDL; }
41
+ get: function () { return chunkPN37HVAV_cjs.generateNodeIndexDDL; }
42
42
  });
43
43
  Object.defineProperty(exports, "notWhere", {
44
44
  enumerable: true,
45
- get: function () { return chunkJTI5WT4P_cjs.notWhere; }
45
+ get: function () { return chunkPN37HVAV_cjs.notWhere; }
46
46
  });
47
47
  Object.defineProperty(exports, "orWhere", {
48
48
  enumerable: true,
49
- get: function () { return chunkJTI5WT4P_cjs.orWhere; }
49
+ get: function () { return chunkPN37HVAV_cjs.orWhere; }
50
50
  });
51
51
  Object.defineProperty(exports, "toDeclaredIndex", {
52
52
  enumerable: true,
53
- get: function () { return chunkJTI5WT4P_cjs.toDeclaredIndex; }
53
+ get: function () { return chunkPN37HVAV_cjs.toDeclaredIndex; }
54
54
  });
55
55
  Object.defineProperty(exports, "toDeclaredIndexes", {
56
56
  enumerable: true,
57
- get: function () { return chunkJTI5WT4P_cjs.toDeclaredIndexes; }
57
+ get: function () { return chunkPN37HVAV_cjs.toDeclaredIndexes; }
58
58
  });
59
59
  Object.defineProperty(exports, "defineEdgeIndex", {
60
60
  enumerable: true,
@@ -1,12 +1,12 @@
1
- import { a as EdgeIndexDeclaration, m as SqlDialect, R as RelationalIndexDeclaration, b as NodeIndexDeclaration, I as IndexDeclaration } from '../types-WF5ItKQu.cjs';
2
- export { E as EdgeIndexConfig, n as EdgeIndexDirection, o as EdgeIndexWhereBuilder, p as IndexOrigin, q as IndexScope, c as IndexWhereExpression, r as IndexWhereFieldBuilder, s as IndexWhereInput, N as NodeIndexConfig, t as NodeIndexWhereBuilder, u as SystemColumnName, V as VectorIndexDeclaration, v as VectorIndexImplementation, w as VectorIndexMetric, x as VectorIndexParams } from '../types-WF5ItKQu.cjs';
3
- export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from '../where-DZYMiXVq.cjs';
1
+ import { c as EdgeIndexDeclaration, p as SqlDialect, R as RelationalIndexDeclaration, d as NodeIndexDeclaration, I as IndexDeclaration } from '../types-DZPBXZOK.cjs';
2
+ export { E as EdgeIndexConfig, q as EdgeIndexDirection, r as EdgeIndexWhereBuilder, s as IndexOrigin, t as IndexScope, e as IndexWhereExpression, u as IndexWhereFieldBuilder, v as IndexWhereInput, N as NodeIndexConfig, w as NodeIndexWhereBuilder, x as SystemColumnName, V as VectorIndexDeclaration, y as VectorIndexImplementation, z as VectorIndexMetric, C as VectorIndexParams } from '../types-DZPBXZOK.cjs';
3
+ export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from '../where-BmtjfWuS.cjs';
4
4
  import { SQLWrapper } from 'drizzle-orm';
5
5
  import { IndexBuilder } from 'drizzle-orm/pg-core';
6
6
  import { IndexBuilder as IndexBuilder$1 } from 'drizzle-orm/sqlite-core';
7
- import { D as DeclaredIndex } from '../types-BpgACExN.cjs';
7
+ import { D as DeclaredIndex } from '../types-CF7nDH3q.cjs';
8
8
  import 'zod';
9
- import '../extension-types-D07e_NTw.cjs';
9
+ import '../extension-types-B78CZfA5.cjs';
10
10
 
11
11
  type GenerateIndexDdlOptions = Readonly<{
12
12
  nodesTableName?: string | undefined;
@@ -1,12 +1,12 @@
1
- import { a as EdgeIndexDeclaration, m as SqlDialect, R as RelationalIndexDeclaration, b as NodeIndexDeclaration, I as IndexDeclaration } from '../types-DptZHe-l.js';
2
- export { E as EdgeIndexConfig, n as EdgeIndexDirection, o as EdgeIndexWhereBuilder, p as IndexOrigin, q as IndexScope, c as IndexWhereExpression, r as IndexWhereFieldBuilder, s as IndexWhereInput, N as NodeIndexConfig, t as NodeIndexWhereBuilder, u as SystemColumnName, V as VectorIndexDeclaration, v as VectorIndexImplementation, w as VectorIndexMetric, x as VectorIndexParams } from '../types-DptZHe-l.js';
3
- export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from '../where-C40InMIp.js';
1
+ import { c as EdgeIndexDeclaration, p as SqlDialect, R as RelationalIndexDeclaration, d as NodeIndexDeclaration, I as IndexDeclaration } from '../types-Dzkr0Eqi.js';
2
+ export { E as EdgeIndexConfig, q as EdgeIndexDirection, r as EdgeIndexWhereBuilder, s as IndexOrigin, t as IndexScope, e as IndexWhereExpression, u as IndexWhereFieldBuilder, v as IndexWhereInput, N as NodeIndexConfig, w as NodeIndexWhereBuilder, x as SystemColumnName, V as VectorIndexDeclaration, y as VectorIndexImplementation, z as VectorIndexMetric, C as VectorIndexParams } from '../types-Dzkr0Eqi.js';
3
+ export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from '../where-kk1Zz2En.js';
4
4
  import { SQLWrapper } from 'drizzle-orm';
5
5
  import { IndexBuilder } from 'drizzle-orm/pg-core';
6
6
  import { IndexBuilder as IndexBuilder$1 } from 'drizzle-orm/sqlite-core';
7
- import { D as DeclaredIndex } from '../types-Bz-Pi681.js';
7
+ import { D as DeclaredIndex } from '../types-Cars4JZ1.js';
8
8
  import 'zod';
9
- import '../extension-types-D07e_NTw.js';
9
+ import '../extension-types-B78CZfA5.js';
10
10
 
11
11
  type GenerateIndexDdlOptions = Readonly<{
12
12
  nodesTableName?: string | undefined;
@@ -1,4 +1,4 @@
1
- export { andWhere, buildPostgresEdgeIndexBuilders, buildPostgresNodeIndexBuilders, buildSqliteEdgeIndexBuilders, buildSqliteNodeIndexBuilders, generateEdgeIndexDDL, generateIndexDDL, generateNodeIndexDDL, notWhere, orWhere, toDeclaredIndex, toDeclaredIndexes } from '../chunk-YZZBDCLV.js';
1
+ export { andWhere, buildPostgresEdgeIndexBuilders, buildPostgresNodeIndexBuilders, buildSqliteEdgeIndexBuilders, buildSqliteNodeIndexBuilders, generateEdgeIndexDDL, generateIndexDDL, generateNodeIndexDDL, notWhere, orWhere, toDeclaredIndex, toDeclaredIndexes } from '../chunk-ZTREJOGB.js';
2
2
  export { defineEdgeIndex, defineNodeIndex } from '../chunk-EJCDOA37.js';
3
3
  import '../chunk-OOS2RKRH.js';
4
4
  import '../chunk-WVQXAFP3.js';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkE5JZSEGJ_cjs = require('../chunk-E5JZSEGJ.cjs');
3
+ var chunkWFUN6DCM_cjs = require('../chunk-WFUN6DCM.cjs');
4
4
  require('../chunk-X3244EKP.cjs');
5
- require('../chunk-W5MTHMTE.cjs');
5
+ require('../chunk-YEDQLNVE.cjs');
6
6
  var zod = require('zod');
7
7
 
8
8
  var FORMAT_VERSION = "1.0";
@@ -122,8 +122,8 @@ async function exportGraph(store, options) {
122
122
  const graph = store.graph;
123
123
  const graphId = store.graphId;
124
124
  const backend = store.backend;
125
- const nodeKindsToExport = options_.nodeKinds ?? chunkE5JZSEGJ_cjs.getNodeKinds(graph);
126
- const edgeKindsToExport = options_.edgeKinds ?? chunkE5JZSEGJ_cjs.getEdgeKinds(graph);
125
+ const nodeKindsToExport = options_.nodeKinds ?? chunkWFUN6DCM_cjs.getNodeKinds(graph);
126
+ const edgeKindsToExport = options_.edgeKinds ?? chunkWFUN6DCM_cjs.getEdgeKinds(graph);
127
127
  const nodes = [];
128
128
  for (const kind of nodeKindsToExport) {
129
129
  const kindNodes = await exportNodesOfKind(backend, graphId, kind, options_);
@@ -137,7 +137,7 @@ async function exportGraph(store, options) {
137
137
  const schemaVersion = await backend.getActiveSchema(graphId);
138
138
  return {
139
139
  formatVersion: FORMAT_VERSION,
140
- exportedAt: chunkE5JZSEGJ_cjs.nowIso(),
140
+ exportedAt: chunkWFUN6DCM_cjs.nowIso(),
141
141
  source: {
142
142
  type: "typegraph-export",
143
143
  graphId,
@@ -285,7 +285,7 @@ async function importGraph(store, data, options) {
285
285
  }
286
286
  function buildNodeSchemaMap(graph) {
287
287
  const map = /* @__PURE__ */ new Map();
288
- for (const kindName of chunkE5JZSEGJ_cjs.getNodeKinds(graph)) {
288
+ for (const kindName of chunkWFUN6DCM_cjs.getNodeKinds(graph)) {
289
289
  const registration = graph.nodes[kindName];
290
290
  map.set(kindName, {
291
291
  registration,
@@ -296,7 +296,7 @@ function buildNodeSchemaMap(graph) {
296
296
  }
297
297
  function buildEdgeSchemaMap(graph) {
298
298
  const map = /* @__PURE__ */ new Map();
299
- for (const kindName of chunkE5JZSEGJ_cjs.getEdgeKinds(graph)) {
299
+ for (const kindName of chunkWFUN6DCM_cjs.getEdgeKinds(graph)) {
300
300
  const registration = graph.edges[kindName];
301
301
  map.set(kindName, {
302
302
  registration,
@@ -1,10 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { G as GraphDef } from '../manager-Cy3dhwYO.cjs';
3
- import { S as Store } from '../store-CkCvqRUf.cjs';
4
- import '../extension-types-D07e_NTw.cjs';
5
- import '../types-WF5ItKQu.cjs';
2
+ import { G as GraphDef } from '../manager-CWa9cgwb.cjs';
3
+ import { S as Store } from '../store-Ojf0NOKk.cjs';
4
+ import '../extension-types-B78CZfA5.cjs';
5
+ import '../types-DZPBXZOK.cjs';
6
6
  import 'drizzle-orm';
7
- import '../materialize-indexes-BB9N5uQl.cjs';
7
+ import 'drizzle-orm/pg-core';
8
+ import 'drizzle-orm/sqlite-core';
9
+ import '../materialize-indexes-BQfaAZKA.cjs';
8
10
 
9
11
  /**
10
12
  * Graph interchange format types.
@@ -1,10 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { G as GraphDef } from '../manager-sZkU2VPC.js';
3
- import { S as Store } from '../store-BS_hehiz.js';
4
- import '../extension-types-D07e_NTw.js';
5
- import '../types-DptZHe-l.js';
2
+ import { G as GraphDef } from '../manager-Cfcb2sJL.js';
3
+ import { S as Store } from '../store-C57kdvAa.js';
4
+ import '../extension-types-B78CZfA5.js';
5
+ import '../types-Dzkr0Eqi.js';
6
6
  import 'drizzle-orm';
7
- import '../materialize-indexes-BYpU2RKh.js';
7
+ import 'drizzle-orm/pg-core';
8
+ import 'drizzle-orm/sqlite-core';
9
+ import '../materialize-indexes-DFavFQah.js';
8
10
 
9
11
  /**
10
12
  * Graph interchange format types.
@@ -1,6 +1,6 @@
1
- import { getNodeKinds, getEdgeKinds, nowIso } from '../chunk-EG6TJ3I5.js';
1
+ import { getNodeKinds, getEdgeKinds, nowIso } from '../chunk-OYLF3IC7.js';
2
2
  import '../chunk-WVQXAFP3.js';
3
- import '../chunk-DOTEN2FG.js';
3
+ import '../chunk-U5ROKVRF.js';
4
4
  import { z } from 'zod';
5
5
 
6
6
  var FORMAT_VERSION = "1.0";
@@ -1,5 +1,5 @@
1
- import { b as NodeRegistration, E as EdgeRegistration, D as DeleteBehavior, T as TemporalMode, G as GraphExtension, N as NodeType, A as AnyEdgeType, c as GraphDefaults, I as IndexEntity } from './extension-types-D07e_NTw.cjs';
2
- import { O as OntologyRelation, I as IndexDeclaration, S as SerializedNodeDef, d as SerializedEdgeDef, h as SerializedSchema, y as SchemaVersionRow, G as GraphBackend } from './types-WF5ItKQu.cjs';
1
+ import { b as NodeRegistration, E as EdgeRegistration, D as DeleteBehavior, T as TemporalMode, G as GraphExtension, N as NodeType, A as AnyEdgeType, c as GraphDefaults, I as IndexEntity } from './extension-types-B78CZfA5.cjs';
2
+ import { O as OntologyRelation, I as IndexDeclaration, f as SerializedNodeDef, g as SerializedEdgeDef, k as SerializedSchema, D as SchemaVersionRow, G as GraphBackend } from './types-DZPBXZOK.cjs';
3
3
 
4
4
  /** Brand key for GraphDef */
5
5
  declare const GRAPH_DEF_BRAND: "__graphDef";
@@ -486,12 +486,21 @@ declare function getMigrationActions(diff: SchemaDiff): readonly string[];
486
486
  declare function parseSerializedSchema(json: string): SerializedSchema;
487
487
  /**
488
488
  * Reads the active schema row, bootstrapping the base tables on the
489
- * first call against an empty database. Also runs
490
- * `ensureFulltextTable` on the success path: drizzle-kit-managed
491
- * setups create every base table EXCEPT the strategy-owned fulltext
492
- * table, and the missing-table-error fallback below doesn't trigger
493
- * once `schema_versions` exists. The focused ensure closes that gap
494
- * before any `searchable()` write runs.
489
+ * first call against an empty database.
490
+ *
491
+ * Deliberately does NOT materialize runtime contributions (fulltext)
492
+ * here. Contribution DDL is derived from the *current code graph*; when
493
+ * the persisted schema is behind by a breaking change, running it here
494
+ * would apply vN+1 DDL against the vN table shape before `ensureSchema`
495
+ * computes the diff and throws `MigrationError`. On Postgres the first
496
+ * failing statement poisons the surrounding transaction, so the error
497
+ * that escapes is the idempotent marker-table
498
+ * `CREATE TABLE IF NOT EXISTS` (collateral damage) rather than a clean
499
+ * `MigrationError` — breaking the documented migrate-on-`MigrationError`
500
+ * recovery path (#143). `createStoreWithSchema` is the single canonical
501
+ * durable-marker writer (#135) and materializes runtime contributions
502
+ * only AFTER the schema gate has run, so the breaking-change check is
503
+ * always reached first.
495
504
  */
496
505
  declare function loadActiveSchemaWithBootstrap(backend: GraphBackend, graphId: string): Promise<SchemaVersionRow | undefined>;
497
506
  /**
@@ -606,6 +615,24 @@ declare function ensureSchema<G extends GraphDef>(backend: GraphBackend, graph:
606
615
  storedSchema: SerializedSchema | undefined;
607
616
  }>;
608
617
  }): Promise<SchemaValidationResult>;
618
+ /**
619
+ * Verifies the database is at the same schema version as the code
620
+ * graph, **without** running DDL, bootstrapping tables, or writing
621
+ * markers. The runtime-side counterpart of `ensureSchema` for the
622
+ * least-privilege deployment model documented in "Database roles &
623
+ * least privilege": `createStoreWithSchema` (run once under a privileged
624
+ * role, optionally after applying generated migration SQL externally) is
625
+ * responsible for advancing the schema; runtimes assert it.
626
+ *
627
+ * @throws ConfigurationError if no schema has been initialized.
628
+ * @throws MigrationError if the persisted schema is behind the code
629
+ * graph by any change (safe or breaking).
630
+ * @throws StoreNotInitializedError if the schema is current but the
631
+ * runtime-contribution markers are missing/stale/failed (the
632
+ * privileged migrator has not materialized strategy-owned storage for
633
+ * this graph on this connection).
634
+ */
635
+ declare function assertSchemaCurrent<G extends GraphDef>(backend: GraphBackend, graph: G): Promise<SchemaValidationResult>;
609
636
  /**
610
637
  * Initializes the schema for a new graph.
611
638
  *
@@ -679,4 +706,4 @@ declare function isSchemaInitialized(backend: GraphBackend, graphId: string): Pr
679
706
  */
680
707
  declare function getSchemaChanges<G extends GraphDef>(backend: GraphBackend, graph: G): Promise<SchemaDiff | undefined>;
681
708
 
682
- export { type AllEdgeTypes as A, isGraphDef as B, type ChangeSeverity as C, type DeprecatedKindsChange as D, type EdgeChange as E, type GraphDef as G, type IndexChange as I, KindRegistry as K, type MigrationHookContext as M, type NodeChange as N, type OntologyChange as O, type SchemaDiff as S, type ChangeType as a, type ExtensionChange as b, type SchemaManagerOptions as c, type SchemaValidationResult as d, applyDeprecatedKinds as e, computeSchemaDiff as f, ensureSchema as g, getActiveSchema as h, getMigrationActions as i, getSchemaChanges as j, initializeSchema as k, isBackwardsCompatible as l, isSchemaInitialized as m, loadActiveSchemaWithBootstrap as n, loadAndMergeGraphExtensionDocument as o, migrateSchema as p, parseSerializedSchema as q, rollbackSchema as r, type AllNodeTypes as s, type EdgeKinds as t, type GetEdgeType as u, type GetNodeType as v, type NodeKinds as w, defineGraph as x, getEdgeKinds as y, getNodeKinds as z };
709
+ export { type AllEdgeTypes as A, getNodeKinds as B, type ChangeSeverity as C, type DeprecatedKindsChange as D, type EdgeChange as E, isGraphDef as F, type GraphDef as G, type IndexChange as I, KindRegistry as K, type MigrationHookContext as M, type NodeChange as N, type OntologyChange as O, type SchemaDiff as S, type ChangeType as a, type ExtensionChange as b, type SchemaManagerOptions as c, type SchemaValidationResult as d, applyDeprecatedKinds as e, assertSchemaCurrent as f, computeSchemaDiff as g, ensureSchema as h, getActiveSchema as i, getMigrationActions as j, getSchemaChanges as k, initializeSchema as l, isBackwardsCompatible as m, isSchemaInitialized as n, loadActiveSchemaWithBootstrap as o, loadAndMergeGraphExtensionDocument as p, migrateSchema as q, parseSerializedSchema as r, rollbackSchema as s, type AllNodeTypes as t, type EdgeKinds as u, type GetEdgeType as v, type GetNodeType as w, type NodeKinds as x, defineGraph as y, getEdgeKinds as z };
@@ -1,5 +1,5 @@
1
- import { b as NodeRegistration, E as EdgeRegistration, D as DeleteBehavior, T as TemporalMode, G as GraphExtension, N as NodeType, A as AnyEdgeType, c as GraphDefaults, I as IndexEntity } from './extension-types-D07e_NTw.js';
2
- import { O as OntologyRelation, I as IndexDeclaration, S as SerializedNodeDef, d as SerializedEdgeDef, h as SerializedSchema, y as SchemaVersionRow, G as GraphBackend } from './types-DptZHe-l.js';
1
+ import { b as NodeRegistration, E as EdgeRegistration, D as DeleteBehavior, T as TemporalMode, G as GraphExtension, N as NodeType, A as AnyEdgeType, c as GraphDefaults, I as IndexEntity } from './extension-types-B78CZfA5.js';
2
+ import { O as OntologyRelation, I as IndexDeclaration, f as SerializedNodeDef, g as SerializedEdgeDef, k as SerializedSchema, D as SchemaVersionRow, G as GraphBackend } from './types-Dzkr0Eqi.js';
3
3
 
4
4
  /** Brand key for GraphDef */
5
5
  declare const GRAPH_DEF_BRAND: "__graphDef";
@@ -486,12 +486,21 @@ declare function getMigrationActions(diff: SchemaDiff): readonly string[];
486
486
  declare function parseSerializedSchema(json: string): SerializedSchema;
487
487
  /**
488
488
  * Reads the active schema row, bootstrapping the base tables on the
489
- * first call against an empty database. Also runs
490
- * `ensureFulltextTable` on the success path: drizzle-kit-managed
491
- * setups create every base table EXCEPT the strategy-owned fulltext
492
- * table, and the missing-table-error fallback below doesn't trigger
493
- * once `schema_versions` exists. The focused ensure closes that gap
494
- * before any `searchable()` write runs.
489
+ * first call against an empty database.
490
+ *
491
+ * Deliberately does NOT materialize runtime contributions (fulltext)
492
+ * here. Contribution DDL is derived from the *current code graph*; when
493
+ * the persisted schema is behind by a breaking change, running it here
494
+ * would apply vN+1 DDL against the vN table shape before `ensureSchema`
495
+ * computes the diff and throws `MigrationError`. On Postgres the first
496
+ * failing statement poisons the surrounding transaction, so the error
497
+ * that escapes is the idempotent marker-table
498
+ * `CREATE TABLE IF NOT EXISTS` (collateral damage) rather than a clean
499
+ * `MigrationError` — breaking the documented migrate-on-`MigrationError`
500
+ * recovery path (#143). `createStoreWithSchema` is the single canonical
501
+ * durable-marker writer (#135) and materializes runtime contributions
502
+ * only AFTER the schema gate has run, so the breaking-change check is
503
+ * always reached first.
495
504
  */
496
505
  declare function loadActiveSchemaWithBootstrap(backend: GraphBackend, graphId: string): Promise<SchemaVersionRow | undefined>;
497
506
  /**
@@ -606,6 +615,24 @@ declare function ensureSchema<G extends GraphDef>(backend: GraphBackend, graph:
606
615
  storedSchema: SerializedSchema | undefined;
607
616
  }>;
608
617
  }): Promise<SchemaValidationResult>;
618
+ /**
619
+ * Verifies the database is at the same schema version as the code
620
+ * graph, **without** running DDL, bootstrapping tables, or writing
621
+ * markers. The runtime-side counterpart of `ensureSchema` for the
622
+ * least-privilege deployment model documented in "Database roles &
623
+ * least privilege": `createStoreWithSchema` (run once under a privileged
624
+ * role, optionally after applying generated migration SQL externally) is
625
+ * responsible for advancing the schema; runtimes assert it.
626
+ *
627
+ * @throws ConfigurationError if no schema has been initialized.
628
+ * @throws MigrationError if the persisted schema is behind the code
629
+ * graph by any change (safe or breaking).
630
+ * @throws StoreNotInitializedError if the schema is current but the
631
+ * runtime-contribution markers are missing/stale/failed (the
632
+ * privileged migrator has not materialized strategy-owned storage for
633
+ * this graph on this connection).
634
+ */
635
+ declare function assertSchemaCurrent<G extends GraphDef>(backend: GraphBackend, graph: G): Promise<SchemaValidationResult>;
609
636
  /**
610
637
  * Initializes the schema for a new graph.
611
638
  *
@@ -679,4 +706,4 @@ declare function isSchemaInitialized(backend: GraphBackend, graphId: string): Pr
679
706
  */
680
707
  declare function getSchemaChanges<G extends GraphDef>(backend: GraphBackend, graph: G): Promise<SchemaDiff | undefined>;
681
708
 
682
- export { type AllEdgeTypes as A, isGraphDef as B, type ChangeSeverity as C, type DeprecatedKindsChange as D, type EdgeChange as E, type GraphDef as G, type IndexChange as I, KindRegistry as K, type MigrationHookContext as M, type NodeChange as N, type OntologyChange as O, type SchemaDiff as S, type ChangeType as a, type ExtensionChange as b, type SchemaManagerOptions as c, type SchemaValidationResult as d, applyDeprecatedKinds as e, computeSchemaDiff as f, ensureSchema as g, getActiveSchema as h, getMigrationActions as i, getSchemaChanges as j, initializeSchema as k, isBackwardsCompatible as l, isSchemaInitialized as m, loadActiveSchemaWithBootstrap as n, loadAndMergeGraphExtensionDocument as o, migrateSchema as p, parseSerializedSchema as q, rollbackSchema as r, type AllNodeTypes as s, type EdgeKinds as t, type GetEdgeType as u, type GetNodeType as v, type NodeKinds as w, defineGraph as x, getEdgeKinds as y, getNodeKinds as z };
709
+ export { type AllEdgeTypes as A, getNodeKinds as B, type ChangeSeverity as C, type DeprecatedKindsChange as D, type EdgeChange as E, isGraphDef as F, type GraphDef as G, type IndexChange as I, KindRegistry as K, type MigrationHookContext as M, type NodeChange as N, type OntologyChange as O, type SchemaDiff as S, type ChangeType as a, type ExtensionChange as b, type SchemaManagerOptions as c, type SchemaValidationResult as d, applyDeprecatedKinds as e, assertSchemaCurrent as f, computeSchemaDiff as g, ensureSchema as h, getActiveSchema as i, getMigrationActions as j, getSchemaChanges as k, initializeSchema as l, isBackwardsCompatible as m, isSchemaInitialized as n, loadActiveSchemaWithBootstrap as o, loadAndMergeGraphExtensionDocument as p, migrateSchema as q, parseSerializedSchema as r, rollbackSchema as s, type AllNodeTypes as t, type EdgeKinds as u, type GetEdgeType as v, type GetNodeType as w, type NodeKinds as x, defineGraph as y, getEdgeKinds as z };
@@ -1,4 +1,4 @@
1
- import { I as IndexEntity } from './extension-types-D07e_NTw.cjs';
1
+ import { I as IndexEntity } from './extension-types-B78CZfA5.cjs';
2
2
 
3
3
  /**
4
4
  * Index materialization — runs declared index DDL against the live
@@ -1,4 +1,4 @@
1
- import { I as IndexEntity } from './extension-types-D07e_NTw.js';
1
+ import { I as IndexEntity } from './extension-types-B78CZfA5.js';
2
2
 
3
3
  /**
4
4
  * Index materialization — runs declared index DDL against the live
@@ -1,12 +1,14 @@
1
- import { G as GraphDef } from '../manager-Cy3dhwYO.cjs';
2
- import { Q as QueryAst } from '../types-WF5ItKQu.cjs';
3
- import { S as Store } from '../store-CkCvqRUf.cjs';
4
- import { P as ProfilerOptions, a as ProfileReport } from '../types-BpgACExN.cjs';
5
- export { D as DeclaredIndex, I as IndexRecommendation, b as ProfileSummary, c as PropertyAccessStats, d as PropertyPath, R as RecommendationPriority, U as UsageContext } from '../types-BpgACExN.cjs';
6
- import '../extension-types-D07e_NTw.cjs';
1
+ import { G as GraphDef } from '../manager-CWa9cgwb.cjs';
2
+ import { Q as QueryAst } from '../types-DZPBXZOK.cjs';
3
+ import { S as Store } from '../store-Ojf0NOKk.cjs';
4
+ import { P as ProfilerOptions, a as ProfileReport } from '../types-CF7nDH3q.cjs';
5
+ export { D as DeclaredIndex, I as IndexRecommendation, b as ProfileSummary, c as PropertyAccessStats, d as PropertyPath, R as RecommendationPriority, U as UsageContext } from '../types-CF7nDH3q.cjs';
6
+ import '../extension-types-B78CZfA5.cjs';
7
7
  import 'zod';
8
8
  import 'drizzle-orm';
9
- import '../materialize-indexes-BB9N5uQl.cjs';
9
+ import 'drizzle-orm/pg-core';
10
+ import 'drizzle-orm/sqlite-core';
11
+ import '../materialize-indexes-BQfaAZKA.cjs';
10
12
 
11
13
  /**
12
14
  * QueryProfiler - Main profiler class.
@@ -1,12 +1,14 @@
1
- import { G as GraphDef } from '../manager-sZkU2VPC.js';
2
- import { Q as QueryAst } from '../types-DptZHe-l.js';
3
- import { S as Store } from '../store-BS_hehiz.js';
4
- import { P as ProfilerOptions, a as ProfileReport } from '../types-Bz-Pi681.js';
5
- export { D as DeclaredIndex, I as IndexRecommendation, b as ProfileSummary, c as PropertyAccessStats, d as PropertyPath, R as RecommendationPriority, U as UsageContext } from '../types-Bz-Pi681.js';
6
- import '../extension-types-D07e_NTw.js';
1
+ import { G as GraphDef } from '../manager-Cfcb2sJL.js';
2
+ import { Q as QueryAst } from '../types-Dzkr0Eqi.js';
3
+ import { S as Store } from '../store-C57kdvAa.js';
4
+ import { P as ProfilerOptions, a as ProfileReport } from '../types-Cars4JZ1.js';
5
+ export { D as DeclaredIndex, I as IndexRecommendation, b as ProfileSummary, c as PropertyAccessStats, d as PropertyPath, R as RecommendationPriority, U as UsageContext } from '../types-Cars4JZ1.js';
6
+ import '../extension-types-B78CZfA5.js';
7
7
  import 'zod';
8
8
  import 'drizzle-orm';
9
- import '../materialize-indexes-BYpU2RKh.js';
9
+ import 'drizzle-orm/pg-core';
10
+ import 'drizzle-orm/sqlite-core';
11
+ import '../materialize-indexes-DFavFQah.js';
10
12
 
11
13
  /**
12
14
  * QueryProfiler - Main profiler class.
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkQMQYK3IF_cjs = require('../chunk-QMQYK3IF.cjs');
4
- require('../chunk-E5JZSEGJ.cjs');
5
- require('../chunk-RCAJZG67.cjs');
3
+ var chunkZGEMI7MJ_cjs = require('../chunk-ZGEMI7MJ.cjs');
4
+ require('../chunk-WFUN6DCM.cjs');
5
+ require('../chunk-PYJOBZR3.cjs');
6
+ require('../chunk-IUIWCFG3.cjs');
6
7
  require('../chunk-CTHNVU6K.cjs');
7
8
  require('../chunk-EK6RJ373.cjs');
8
9
  require('../chunk-X3244EKP.cjs');
9
- require('../chunk-W5MTHMTE.cjs');
10
+ require('../chunk-YEDQLNVE.cjs');
10
11
  require('../chunk-7V335GHG.cjs');
11
12
 
12
13
  // src/schema/deserializer.ts
@@ -47,7 +48,7 @@ function buildRegistryFromClosures(schema) {
47
48
  const edgeImplyingClosure = recordToMap(closures.edgeImplyingClosure);
48
49
  const nodeKinds = /* @__PURE__ */ new Map();
49
50
  const edgeKinds = /* @__PURE__ */ new Map();
50
- return new chunkQMQYK3IF_cjs.KindRegistry(nodeKinds, edgeKinds, {
51
+ return new chunkZGEMI7MJ_cjs.KindRegistry(nodeKinds, edgeKinds, {
51
52
  subClassAncestors,
52
53
  subClassDescendants,
53
54
  broaderClosure,
@@ -75,91 +76,95 @@ function simpleRecordToMap(record) {
75
76
 
76
77
  Object.defineProperty(exports, "applyDeprecatedKinds", {
77
78
  enumerable: true,
78
- get: function () { return chunkQMQYK3IF_cjs.applyDeprecatedKinds; }
79
+ get: function () { return chunkZGEMI7MJ_cjs.applyDeprecatedKinds; }
80
+ });
81
+ Object.defineProperty(exports, "assertSchemaCurrent", {
82
+ enumerable: true,
83
+ get: function () { return chunkZGEMI7MJ_cjs.assertSchemaCurrent; }
79
84
  });
80
85
  Object.defineProperty(exports, "computeSchemaDiff", {
81
86
  enumerable: true,
82
- get: function () { return chunkQMQYK3IF_cjs.computeSchemaDiff; }
87
+ get: function () { return chunkZGEMI7MJ_cjs.computeSchemaDiff; }
83
88
  });
84
89
  Object.defineProperty(exports, "computeSchemaHash", {
85
90
  enumerable: true,
86
- get: function () { return chunkQMQYK3IF_cjs.computeSchemaHash; }
91
+ get: function () { return chunkZGEMI7MJ_cjs.computeSchemaHash; }
87
92
  });
88
93
  Object.defineProperty(exports, "createValidationError", {
89
94
  enumerable: true,
90
- get: function () { return chunkQMQYK3IF_cjs.createValidationError; }
95
+ get: function () { return chunkZGEMI7MJ_cjs.createValidationError; }
91
96
  });
92
97
  Object.defineProperty(exports, "deserializeWherePredicate", {
93
98
  enumerable: true,
94
- get: function () { return chunkQMQYK3IF_cjs.deserializeWherePredicate; }
99
+ get: function () { return chunkZGEMI7MJ_cjs.deserializeWherePredicate; }
95
100
  });
96
101
  Object.defineProperty(exports, "ensureSchema", {
97
102
  enumerable: true,
98
- get: function () { return chunkQMQYK3IF_cjs.ensureSchema; }
103
+ get: function () { return chunkZGEMI7MJ_cjs.ensureSchema; }
99
104
  });
100
105
  Object.defineProperty(exports, "getActiveSchema", {
101
106
  enumerable: true,
102
- get: function () { return chunkQMQYK3IF_cjs.getActiveSchema; }
107
+ get: function () { return chunkZGEMI7MJ_cjs.getActiveSchema; }
103
108
  });
104
109
  Object.defineProperty(exports, "getMigrationActions", {
105
110
  enumerable: true,
106
- get: function () { return chunkQMQYK3IF_cjs.getMigrationActions; }
111
+ get: function () { return chunkZGEMI7MJ_cjs.getMigrationActions; }
107
112
  });
108
113
  Object.defineProperty(exports, "getSchemaChanges", {
109
114
  enumerable: true,
110
- get: function () { return chunkQMQYK3IF_cjs.getSchemaChanges; }
115
+ get: function () { return chunkZGEMI7MJ_cjs.getSchemaChanges; }
111
116
  });
112
117
  Object.defineProperty(exports, "initializeSchema", {
113
118
  enumerable: true,
114
- get: function () { return chunkQMQYK3IF_cjs.initializeSchema; }
119
+ get: function () { return chunkZGEMI7MJ_cjs.initializeSchema; }
115
120
  });
116
121
  Object.defineProperty(exports, "isBackwardsCompatible", {
117
122
  enumerable: true,
118
- get: function () { return chunkQMQYK3IF_cjs.isBackwardsCompatible; }
123
+ get: function () { return chunkZGEMI7MJ_cjs.isBackwardsCompatible; }
119
124
  });
120
125
  Object.defineProperty(exports, "isSchemaInitialized", {
121
126
  enumerable: true,
122
- get: function () { return chunkQMQYK3IF_cjs.isSchemaInitialized; }
127
+ get: function () { return chunkZGEMI7MJ_cjs.isSchemaInitialized; }
123
128
  });
124
129
  Object.defineProperty(exports, "loadActiveSchemaWithBootstrap", {
125
130
  enumerable: true,
126
- get: function () { return chunkQMQYK3IF_cjs.loadActiveSchemaWithBootstrap; }
131
+ get: function () { return chunkZGEMI7MJ_cjs.loadActiveSchemaWithBootstrap; }
127
132
  });
128
133
  Object.defineProperty(exports, "loadAndMergeGraphExtensionDocument", {
129
134
  enumerable: true,
130
- get: function () { return chunkQMQYK3IF_cjs.loadAndMergeGraphExtensionDocument; }
135
+ get: function () { return chunkZGEMI7MJ_cjs.loadAndMergeGraphExtensionDocument; }
131
136
  });
132
137
  Object.defineProperty(exports, "migrateSchema", {
133
138
  enumerable: true,
134
- get: function () { return chunkQMQYK3IF_cjs.migrateSchema; }
139
+ get: function () { return chunkZGEMI7MJ_cjs.migrateSchema; }
135
140
  });
136
141
  Object.defineProperty(exports, "parseSerializedSchema", {
137
142
  enumerable: true,
138
- get: function () { return chunkQMQYK3IF_cjs.parseSerializedSchema; }
143
+ get: function () { return chunkZGEMI7MJ_cjs.parseSerializedSchema; }
139
144
  });
140
145
  Object.defineProperty(exports, "rollbackSchema", {
141
146
  enumerable: true,
142
- get: function () { return chunkQMQYK3IF_cjs.rollbackSchema; }
147
+ get: function () { return chunkZGEMI7MJ_cjs.rollbackSchema; }
143
148
  });
144
149
  Object.defineProperty(exports, "serializeSchema", {
145
150
  enumerable: true,
146
- get: function () { return chunkQMQYK3IF_cjs.serializeSchema; }
151
+ get: function () { return chunkZGEMI7MJ_cjs.serializeSchema; }
147
152
  });
148
153
  Object.defineProperty(exports, "validateEdgeProps", {
149
154
  enumerable: true,
150
- get: function () { return chunkQMQYK3IF_cjs.validateEdgeProps; }
155
+ get: function () { return chunkZGEMI7MJ_cjs.validateEdgeProps; }
151
156
  });
152
157
  Object.defineProperty(exports, "validateNodeProps", {
153
158
  enumerable: true,
154
- get: function () { return chunkQMQYK3IF_cjs.validateNodeProps; }
159
+ get: function () { return chunkZGEMI7MJ_cjs.validateNodeProps; }
155
160
  });
156
161
  Object.defineProperty(exports, "validateProps", {
157
162
  enumerable: true,
158
- get: function () { return chunkQMQYK3IF_cjs.validateProps; }
163
+ get: function () { return chunkZGEMI7MJ_cjs.validateProps; }
159
164
  });
160
165
  Object.defineProperty(exports, "wrapZodError", {
161
166
  enumerable: true,
162
- get: function () { return chunkQMQYK3IF_cjs.wrapZodError; }
167
+ get: function () { return chunkZGEMI7MJ_cjs.wrapZodError; }
163
168
  });
164
169
  exports.deserializeSchema = deserializeSchema;
165
170
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schema/deserializer.ts"],"names":["KindRegistry"],"mappings":"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","file":"index.cjs","sourcesContent":["/**\n * Schema deserializer for loading stored schemas.\n *\n * Reconstructs runtime objects from SerializedSchema.\n * Note: Zod schemas cannot be fully reconstructed from JSON Schema,\n * so this provides access to the serialized data for introspection.\n */\nimport { KindRegistry } from \"../registry/kind-registry\";\nimport {\n type SerializedClosures,\n type SerializedEdgeDef,\n type SerializedMetaEdge,\n type SerializedNodeDef,\n type SerializedOntologyRelation,\n type SerializedSchema,\n} from \"./types\";\n\n// ============================================================\n// Deserialized Schema\n// ============================================================\n\n/**\n * A deserialized schema provides read-only access to schema metadata.\n *\n * Note: Unlike the original GraphDef, this does not include Zod schemas\n * since those cannot be reconstructed from JSON Schema. Use this for\n * introspection and metadata access only.\n */\nexport type DeserializedSchema = Readonly<{\n graphId: string;\n version: number;\n generatedAt: string;\n\n /** Get node definition by name */\n getNode: (name: string) => SerializedNodeDef | undefined;\n\n /** Get all node names */\n getNodeNames: () => readonly string[];\n\n /** Get edge definition by name */\n getEdge: (name: string) => SerializedEdgeDef | undefined;\n\n /** Get all edge names */\n getEdgeNames: () => readonly string[];\n\n /** Get meta-edge definition by name */\n getMetaEdge: (name: string) => SerializedMetaEdge | undefined;\n\n /** Get all meta-edge names */\n getMetaEdgeNames: () => readonly string[];\n\n /** Get all ontology relations */\n getRelations: () => readonly SerializedOntologyRelation[];\n\n /** Get precomputed closures */\n getClosures: () => SerializedClosures;\n\n /** Get graph defaults */\n getDefaults: () => SerializedSchema[\"defaults\"];\n\n /** Get the raw serialized schema */\n getRaw: () => SerializedSchema;\n\n /** Build a KindRegistry from the closures */\n buildRegistry: () => KindRegistry;\n}>;\n\n// ============================================================\n// Deserialization\n// ============================================================\n\n/**\n * Deserializes a SerializedSchema into a DeserializedSchema.\n *\n * @param schema - The serialized schema to deserialize\n * @returns A deserialized schema with accessor methods\n */\nexport function deserializeSchema(\n schema: SerializedSchema,\n): DeserializedSchema {\n const nodeNames = Object.keys(schema.nodes);\n const edgeNames = Object.keys(schema.edges);\n const metaEdgeNames = Object.keys(schema.ontology.metaEdges);\n\n return {\n graphId: schema.graphId,\n version: schema.version,\n generatedAt: schema.generatedAt,\n\n getNode: (name) => schema.nodes[name],\n getNodeNames: () => nodeNames,\n\n getEdge: (name) => schema.edges[name],\n getEdgeNames: () => edgeNames,\n\n getMetaEdge: (name) => schema.ontology.metaEdges[name],\n getMetaEdgeNames: () => metaEdgeNames,\n\n getRelations: () => schema.ontology.relations,\n getClosures: () => schema.ontology.closures,\n\n getDefaults: () => schema.defaults,\n getRaw: () => schema,\n\n buildRegistry: () => buildRegistryFromClosures(schema),\n };\n}\n\n// ============================================================\n// Registry Building\n// ============================================================\n\n/**\n * Builds a KindRegistry from serialized closures.\n *\n * This allows query execution without recomputing closures.\n */\nfunction buildRegistryFromClosures(schema: SerializedSchema): KindRegistry {\n const { closures } = schema.ontology;\n\n // Convert Record<string, string[]> back to Map<string, Set<string>>\n const subClassAncestors = recordToMap(closures.subClassAncestors);\n const subClassDescendants = recordToMap(closures.subClassDescendants);\n const broaderClosure = recordToMap(closures.broaderClosure);\n const narrowerClosure = recordToMap(closures.narrowerClosure);\n const equivalenceSets = recordToMap(closures.equivalenceSets);\n const partOfClosure = recordToMap(closures.partOfClosure);\n const hasPartClosure = recordToMap(closures.hasPartClosure);\n const iriToKind = simpleRecordToMap(closures.iriToKind);\n const disjointPairs = new Set(closures.disjointPairs);\n const edgeInverses = simpleRecordToMap(closures.edgeInverses);\n const edgeImplicationsClosure = recordToMap(closures.edgeImplicationsClosure);\n const edgeImplyingClosure = recordToMap(closures.edgeImplyingClosure);\n\n // Build empty node/edge kind maps (we don't have the actual Zod schemas)\n const nodeKinds = new Map();\n const edgeKinds = new Map();\n\n return new KindRegistry(nodeKinds, edgeKinds, {\n subClassAncestors,\n subClassDescendants,\n broaderClosure,\n narrowerClosure,\n equivalenceSets,\n iriToKind,\n disjointPairs,\n partOfClosure,\n hasPartClosure,\n edgeInverses,\n edgeImplicationsClosure,\n edgeImplyingClosure,\n });\n}\n\n/**\n * Converts Record<string, string[]> to Map<string, Set<string>>.\n */\nfunction recordToMap(\n record: Record<string, readonly string[]>,\n): ReadonlyMap<string, ReadonlySet<string>> {\n const result = new Map<string, Set<string>>();\n for (const [key, values] of Object.entries(record)) {\n result.set(key, new Set(values));\n }\n return result;\n}\n\n/**\n * Converts Record<string, string> to Map<string, string>.\n */\nfunction simpleRecordToMap(\n record: Record<string, string>,\n): ReadonlyMap<string, string> {\n return new Map(Object.entries(record));\n}\n"]}
1
+ {"version":3,"sources":["../../src/schema/deserializer.ts"],"names":["KindRegistry"],"mappings":"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","file":"index.cjs","sourcesContent":["/**\n * Schema deserializer for loading stored schemas.\n *\n * Reconstructs runtime objects from SerializedSchema.\n * Note: Zod schemas cannot be fully reconstructed from JSON Schema,\n * so this provides access to the serialized data for introspection.\n */\nimport { KindRegistry } from \"../registry/kind-registry\";\nimport {\n type SerializedClosures,\n type SerializedEdgeDef,\n type SerializedMetaEdge,\n type SerializedNodeDef,\n type SerializedOntologyRelation,\n type SerializedSchema,\n} from \"./types\";\n\n// ============================================================\n// Deserialized Schema\n// ============================================================\n\n/**\n * A deserialized schema provides read-only access to schema metadata.\n *\n * Note: Unlike the original GraphDef, this does not include Zod schemas\n * since those cannot be reconstructed from JSON Schema. Use this for\n * introspection and metadata access only.\n */\nexport type DeserializedSchema = Readonly<{\n graphId: string;\n version: number;\n generatedAt: string;\n\n /** Get node definition by name */\n getNode: (name: string) => SerializedNodeDef | undefined;\n\n /** Get all node names */\n getNodeNames: () => readonly string[];\n\n /** Get edge definition by name */\n getEdge: (name: string) => SerializedEdgeDef | undefined;\n\n /** Get all edge names */\n getEdgeNames: () => readonly string[];\n\n /** Get meta-edge definition by name */\n getMetaEdge: (name: string) => SerializedMetaEdge | undefined;\n\n /** Get all meta-edge names */\n getMetaEdgeNames: () => readonly string[];\n\n /** Get all ontology relations */\n getRelations: () => readonly SerializedOntologyRelation[];\n\n /** Get precomputed closures */\n getClosures: () => SerializedClosures;\n\n /** Get graph defaults */\n getDefaults: () => SerializedSchema[\"defaults\"];\n\n /** Get the raw serialized schema */\n getRaw: () => SerializedSchema;\n\n /** Build a KindRegistry from the closures */\n buildRegistry: () => KindRegistry;\n}>;\n\n// ============================================================\n// Deserialization\n// ============================================================\n\n/**\n * Deserializes a SerializedSchema into a DeserializedSchema.\n *\n * @param schema - The serialized schema to deserialize\n * @returns A deserialized schema with accessor methods\n */\nexport function deserializeSchema(\n schema: SerializedSchema,\n): DeserializedSchema {\n const nodeNames = Object.keys(schema.nodes);\n const edgeNames = Object.keys(schema.edges);\n const metaEdgeNames = Object.keys(schema.ontology.metaEdges);\n\n return {\n graphId: schema.graphId,\n version: schema.version,\n generatedAt: schema.generatedAt,\n\n getNode: (name) => schema.nodes[name],\n getNodeNames: () => nodeNames,\n\n getEdge: (name) => schema.edges[name],\n getEdgeNames: () => edgeNames,\n\n getMetaEdge: (name) => schema.ontology.metaEdges[name],\n getMetaEdgeNames: () => metaEdgeNames,\n\n getRelations: () => schema.ontology.relations,\n getClosures: () => schema.ontology.closures,\n\n getDefaults: () => schema.defaults,\n getRaw: () => schema,\n\n buildRegistry: () => buildRegistryFromClosures(schema),\n };\n}\n\n// ============================================================\n// Registry Building\n// ============================================================\n\n/**\n * Builds a KindRegistry from serialized closures.\n *\n * This allows query execution without recomputing closures.\n */\nfunction buildRegistryFromClosures(schema: SerializedSchema): KindRegistry {\n const { closures } = schema.ontology;\n\n // Convert Record<string, string[]> back to Map<string, Set<string>>\n const subClassAncestors = recordToMap(closures.subClassAncestors);\n const subClassDescendants = recordToMap(closures.subClassDescendants);\n const broaderClosure = recordToMap(closures.broaderClosure);\n const narrowerClosure = recordToMap(closures.narrowerClosure);\n const equivalenceSets = recordToMap(closures.equivalenceSets);\n const partOfClosure = recordToMap(closures.partOfClosure);\n const hasPartClosure = recordToMap(closures.hasPartClosure);\n const iriToKind = simpleRecordToMap(closures.iriToKind);\n const disjointPairs = new Set(closures.disjointPairs);\n const edgeInverses = simpleRecordToMap(closures.edgeInverses);\n const edgeImplicationsClosure = recordToMap(closures.edgeImplicationsClosure);\n const edgeImplyingClosure = recordToMap(closures.edgeImplyingClosure);\n\n // Build empty node/edge kind maps (we don't have the actual Zod schemas)\n const nodeKinds = new Map();\n const edgeKinds = new Map();\n\n return new KindRegistry(nodeKinds, edgeKinds, {\n subClassAncestors,\n subClassDescendants,\n broaderClosure,\n narrowerClosure,\n equivalenceSets,\n iriToKind,\n disjointPairs,\n partOfClosure,\n hasPartClosure,\n edgeInverses,\n edgeImplicationsClosure,\n edgeImplyingClosure,\n });\n}\n\n/**\n * Converts Record<string, string[]> to Map<string, Set<string>>.\n */\nfunction recordToMap(\n record: Record<string, readonly string[]>,\n): ReadonlyMap<string, ReadonlySet<string>> {\n const result = new Map<string, Set<string>>();\n for (const [key, values] of Object.entries(record)) {\n result.set(key, new Set(values));\n }\n return result;\n}\n\n/**\n * Converts Record<string, string> to Map<string, string>.\n */\nfunction simpleRecordToMap(\n record: Record<string, string>,\n): ReadonlyMap<string, string> {\n return new Map(Object.entries(record));\n}\n"]}