@nicia-ai/typegraph 0.28.1 → 0.30.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.
- package/dist/backend/postgres/index.cjs +24 -762
- package/dist/backend/postgres/index.cjs.map +1 -1
- package/dist/backend/postgres/index.d.cts +24 -5
- package/dist/backend/postgres/index.d.ts +24 -5
- package/dist/backend/postgres/index.js +11 -753
- package/dist/backend/postgres/index.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +52 -0
- package/dist/backend/postgres/pglite.cjs.map +1 -0
- package/dist/backend/postgres/pglite.d.cts +116 -0
- package/dist/backend/postgres/pglite.d.ts +116 -0
- package/dist/backend/postgres/pglite.js +50 -0
- package/dist/backend/postgres/pglite.js.map +1 -0
- package/dist/backend/sqlite/index.cjs +23 -27
- package/dist/backend/sqlite/index.d.cts +22 -15
- package/dist/backend/sqlite/index.d.ts +22 -15
- package/dist/backend/sqlite/index.js +10 -10
- package/dist/backend/sqlite/libsql.cjs +18 -14
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +17 -13
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +19 -17
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +9 -3
- package/dist/backend/sqlite/local.d.ts +9 -3
- package/dist/backend/sqlite/local.js +17 -15
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-26HWIIVS.cjs +740 -0
- package/dist/chunk-26HWIIVS.cjs.map +1 -0
- package/dist/chunk-2QA5EHEN.js +181 -0
- package/dist/chunk-2QA5EHEN.js.map +1 -0
- package/dist/chunk-3IRMLJEK.js +206 -0
- package/dist/chunk-3IRMLJEK.js.map +1 -0
- package/dist/{chunk-5MTOKWDA.js → chunk-3JLRHQ67.js} +9 -9
- package/dist/{chunk-5MTOKWDA.js.map → chunk-3JLRHQ67.js.map} +1 -1
- package/dist/{chunk-WVQXAFP3.js → chunk-454I6GDF.js} +46 -5
- package/dist/chunk-454I6GDF.js.map +1 -0
- package/dist/{chunk-CTHNVU6K.cjs → chunk-4BXHVEFB.cjs} +16 -16
- package/dist/{chunk-CTHNVU6K.cjs.map → chunk-4BXHVEFB.cjs.map} +1 -1
- package/dist/{chunk-NMOE2ZEU.cjs → chunk-4LBO6KIF.cjs} +139 -128
- package/dist/chunk-4LBO6KIF.cjs.map +1 -0
- package/dist/chunk-633N7DSE.js +258 -0
- package/dist/chunk-633N7DSE.js.map +1 -0
- package/dist/{chunk-WFUN6DCM.cjs → chunk-7JGLPAFV.cjs} +11 -11
- package/dist/chunk-7JGLPAFV.cjs.map +1 -0
- package/dist/{chunk-ZTREJOGB.js → chunk-AI3RNREM.js} +140 -69
- package/dist/chunk-AI3RNREM.js.map +1 -0
- package/dist/{chunk-TSGBRPNE.js → chunk-ENDUY2CD.js} +46 -46
- package/dist/chunk-ENDUY2CD.js.map +1 -0
- package/dist/{chunk-7V335GHG.cjs → chunk-FLRCVI2G.cjs} +12 -2
- package/dist/chunk-FLRCVI2G.cjs.map +1 -0
- package/dist/chunk-FVIGJTS7.js +305 -0
- package/dist/chunk-FVIGJTS7.js.map +1 -0
- package/dist/chunk-FWBVPATK.cjs +208 -0
- package/dist/chunk-FWBVPATK.cjs.map +1 -0
- package/dist/chunk-IE6GN7L3.cjs +319 -0
- package/dist/chunk-IE6GN7L3.cjs.map +1 -0
- package/dist/{chunk-PGU2XKMA.js → chunk-IUIJJYPI.js} +117 -106
- package/dist/chunk-IUIJJYPI.js.map +1 -0
- package/dist/{chunk-E5ROA3MN.js → chunk-IX7RE7CG.js} +3 -3
- package/dist/{chunk-E5ROA3MN.js.map → chunk-IX7RE7CG.js.map} +1 -1
- package/dist/{chunk-YEDQLNVE.cjs → chunk-JIEJCTDS.cjs} +30 -2
- package/dist/chunk-JIEJCTDS.cjs.map +1 -0
- package/dist/{chunk-WZH2MKHW.cjs → chunk-K4N35E7B.cjs} +101 -101
- package/dist/{chunk-WZH2MKHW.cjs.map → chunk-K4N35E7B.cjs.map} +1 -1
- package/dist/{chunk-NZ5PMBTG.js → chunk-K5P5OZXS.js} +12 -3
- package/dist/chunk-K5P5OZXS.js.map +1 -0
- package/dist/chunk-K5VREXMZ.js +738 -0
- package/dist/chunk-K5VREXMZ.js.map +1 -0
- package/dist/chunk-LUHU4T2F.cjs +12 -0
- package/dist/{chunk-4FJVSF3K.cjs.map → chunk-LUHU4T2F.cjs.map} +1 -1
- package/dist/{chunk-O57GYGYK.js → chunk-M6OC455F.js} +32 -18
- package/dist/chunk-M6OC455F.js.map +1 -0
- package/dist/{chunk-OYLF3IC7.js → chunk-MAQJYNJR.js} +4 -4
- package/dist/chunk-MAQJYNJR.js.map +1 -0
- package/dist/{chunk-OOS2RKRH.js → chunk-MXE2U3EX.js} +4 -4
- package/dist/{chunk-OOS2RKRH.js.map → chunk-MXE2U3EX.js.map} +1 -1
- package/dist/{chunk-TKM2WDT4.js → chunk-N2OEOGBB.js} +386 -1093
- package/dist/chunk-N2OEOGBB.js.map +1 -0
- package/dist/{chunk-EJCDOA37.js → chunk-R4JOBEJU.js} +5 -5
- package/dist/{chunk-EJCDOA37.js.map → chunk-R4JOBEJU.js.map} +1 -1
- package/dist/{chunk-FFHW2JEK.cjs → chunk-RP7YITHX.cjs} +32 -17
- package/dist/chunk-RP7YITHX.cjs.map +1 -0
- package/dist/{chunk-PYJOBZR3.cjs → chunk-SGPXKJ4A.cjs} +60 -60
- package/dist/chunk-SGPXKJ4A.cjs.map +1 -0
- package/dist/{chunk-U5ROKVRF.js → chunk-TQOYM4LN.js} +29 -3
- package/dist/chunk-TQOYM4LN.js.map +1 -0
- package/dist/{chunk-PN37HVAV.cjs → chunk-UESTHN47.cjs} +153 -71
- package/dist/chunk-UESTHN47.cjs.map +1 -0
- package/dist/chunk-VFX3LC76.cjs +183 -0
- package/dist/chunk-VFX3LC76.cjs.map +1 -0
- package/dist/chunk-WEMZM7J7.cjs +270 -0
- package/dist/chunk-WEMZM7J7.cjs.map +1 -0
- package/dist/{chunk-NYQFPGYP.cjs → chunk-WFCECD6Q.cjs} +423 -1139
- package/dist/chunk-WFCECD6Q.cjs.map +1 -0
- package/dist/{chunk-EK6RJ373.cjs → chunk-YQGLVWB2.cjs} +7 -7
- package/dist/{chunk-EK6RJ373.cjs.map → chunk-YQGLVWB2.cjs.map} +1 -1
- package/dist/{chunk-X3244EKP.cjs → chunk-ZFWNO3GE.cjs} +48 -4
- package/dist/chunk-ZFWNO3GE.cjs.map +1 -0
- package/dist/ddl-BSFlbGQF.d.cts +38 -0
- package/dist/ddl-EdkIiFVU.d.ts +38 -0
- package/dist/{extension-types-B78CZfA5.d.cts → extension-types-CwHV-Uk4.d.cts} +4 -4
- package/dist/{extension-types-B78CZfA5.d.ts → extension-types-CwHV-Uk4.d.ts} +4 -4
- package/dist/graph-extension/index.cjs +19 -19
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/{index-CWdBFWbI.d.ts → index-DzeIiMO3.d.ts} +30 -3
- package/dist/{index-Bilw0pYm.d.cts → index-Ln_KHTGA.d.cts} +30 -3
- package/dist/index.cjs +1542 -1011
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -12
- package/dist/index.d.ts +142 -12
- package/dist/index.js +1138 -643
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +19 -19
- package/dist/indexes/index.d.cts +9 -9
- package/dist/indexes/index.d.ts +9 -9
- package/dist/indexes/index.js +5 -5
- package/dist/interchange/index.cjs +8 -14
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +5 -16
- package/dist/interchange/index.d.ts +5 -16
- package/dist/interchange/index.js +3 -9
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-ehLTTNq0.d.ts → manager-BbdyNhkv.d.ts} +2 -2
- package/dist/{manager-c1MGaVVR.d.cts → manager-wTDgjoXG.d.cts} +2 -2
- package/dist/{materialize-indexes-DFavFQah.d.ts → materialize-indexes-lkawaDor.d.ts} +1 -1
- package/dist/{materialize-indexes-BQfaAZKA.d.cts → materialize-indexes-oanE3RU0.d.cts} +1 -1
- package/dist/{ddl-0Ooc2dpL.d.ts → postgres-CK2ByP1q.d.cts} +2 -471
- package/dist/{ddl-Dza3kDrI.d.cts → postgres-ymXYC6Rr.d.ts} +2 -471
- package/dist/profiler/index.cjs +10 -10
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +3 -3
- package/dist/schema/index.cjs +33 -33
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +10 -10
- package/dist/{sqlite-BxZUPbyD.d.ts → sqlite-DxH1lrwD.d.cts} +2 -468
- package/dist/{sqlite-mvpXjEeB.d.cts → sqlite-R8YGOqVQ.d.ts} +2 -468
- package/dist/{store-Ufc1Eoey.d.ts → store--z1Tmk7U.d.cts} +124 -5
- package/dist/{store-D7YEMg2v.d.cts → store-CNKM334w.d.ts} +124 -5
- package/dist/{types-CMQymcwk.d.cts → types-BBiDqJCU.d.ts} +252 -46
- package/dist/{types-B-sJJ4GQ.d.ts → types-CMvxx2kd.d.ts} +2 -2
- package/dist/{types-CmUA9sal.d.cts → types-D5B6Be5c.d.cts} +2 -2
- package/dist/{types-CQ7xXJMP.d.ts → types-dL-clxO3.d.cts} +252 -46
- package/dist/{where-CtrLu1Zf.d.ts → where-CAo6wsBZ.d.ts} +2 -2
- package/dist/{where-5zf15aFZ.d.cts → where-bJjuOCeV.d.cts} +2 -2
- package/package.json +20 -5
- package/dist/chunk-3EUKJEQ3.js +0 -77
- package/dist/chunk-3EUKJEQ3.js.map +0 -1
- package/dist/chunk-4FJVSF3K.cjs +0 -12
- package/dist/chunk-7V335GHG.cjs.map +0 -1
- package/dist/chunk-FFHW2JEK.cjs.map +0 -1
- package/dist/chunk-HTGDWIDE.cjs +0 -89
- package/dist/chunk-HTGDWIDE.cjs.map +0 -1
- package/dist/chunk-LYRUNG6E.cjs +0 -52
- package/dist/chunk-LYRUNG6E.cjs.map +0 -1
- package/dist/chunk-NMOE2ZEU.cjs.map +0 -1
- package/dist/chunk-NYQFPGYP.cjs.map +0 -1
- package/dist/chunk-NZ5PMBTG.js.map +0 -1
- package/dist/chunk-O57GYGYK.js.map +0 -1
- package/dist/chunk-OYLF3IC7.js.map +0 -1
- package/dist/chunk-PCHTTG42.js +0 -47
- package/dist/chunk-PCHTTG42.js.map +0 -1
- package/dist/chunk-PGU2XKMA.js.map +0 -1
- package/dist/chunk-PN37HVAV.cjs.map +0 -1
- package/dist/chunk-PYJOBZR3.cjs.map +0 -1
- package/dist/chunk-TKM2WDT4.js.map +0 -1
- package/dist/chunk-TSGBRPNE.js.map +0 -1
- package/dist/chunk-U5ROKVRF.js.map +0 -1
- package/dist/chunk-WFUN6DCM.cjs.map +0 -1
- package/dist/chunk-WVQXAFP3.js.map +0 -1
- package/dist/chunk-X3244EKP.cjs.map +0 -1
- package/dist/chunk-YEDQLNVE.cjs.map +0 -1
- package/dist/chunk-ZTREJOGB.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkZFWNO3GE_cjs = require('./chunk-ZFWNO3GE.cjs');
|
|
4
|
+
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
5
5
|
|
|
6
6
|
// src/core/types.ts
|
|
7
7
|
var NODE_TYPE_BRAND = "__nodeType";
|
|
@@ -73,14 +73,14 @@ function readObjectShape(schema) {
|
|
|
73
73
|
}
|
|
74
74
|
function readEmbeddingIndex(schema) {
|
|
75
75
|
for (const candidate of unwrapChain(schema)) {
|
|
76
|
-
const config =
|
|
76
|
+
const config = chunkZFWNO3GE_cjs.getEmbeddingIndex(candidate);
|
|
77
77
|
if (config !== void 0) return config;
|
|
78
78
|
}
|
|
79
79
|
return void 0;
|
|
80
80
|
}
|
|
81
81
|
function readEmbeddingDimensions(schema) {
|
|
82
82
|
for (const candidate of unwrapChain(schema)) {
|
|
83
|
-
if (
|
|
83
|
+
if (chunkZFWNO3GE_cjs.isEmbeddingSchema(candidate)) {
|
|
84
84
|
return candidate._embeddingDimensions;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -109,7 +109,7 @@ function validateConstraintNarrowing(name, edgeType, registration) {
|
|
|
109
109
|
const builtInFromNames = new Set(edgeType.from.map((node) => node.kind));
|
|
110
110
|
for (const fromNode of registration.from) {
|
|
111
111
|
if (!builtInFromNames.has(fromNode.kind)) {
|
|
112
|
-
throw new
|
|
112
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
113
113
|
`Edge "${name}" registration has 'from' kind "${fromNode.kind}" not in edge's built-in domain: [${[...builtInFromNames].join(", ")}]`,
|
|
114
114
|
{
|
|
115
115
|
edgeName: name,
|
|
@@ -125,7 +125,7 @@ function validateConstraintNarrowing(name, edgeType, registration) {
|
|
|
125
125
|
const builtInToNames = new Set(edgeType.to.map((node) => node.kind));
|
|
126
126
|
for (const toNode of registration.to) {
|
|
127
127
|
if (!builtInToNames.has(toNode.kind)) {
|
|
128
|
-
throw new
|
|
128
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
129
129
|
`Edge "${name}" registration has 'to' kind "${toNode.kind}" not in edge's built-in range: [${[...builtInToNames].join(", ")}]`,
|
|
130
130
|
{
|
|
131
131
|
edgeName: name,
|
|
@@ -201,7 +201,7 @@ function normalizeIndexes(inputs, nodes, edges) {
|
|
|
201
201
|
assertKindRegistered(declaration, edgeKinds, "edge");
|
|
202
202
|
}
|
|
203
203
|
if (seenNames.has(declaration.name)) {
|
|
204
|
-
throw new
|
|
204
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
205
205
|
`Duplicate index name "${declaration.name}" in defineGraph({ indexes }). Index names must be unique within a graph.`,
|
|
206
206
|
{ indexName: declaration.name },
|
|
207
207
|
{
|
|
@@ -224,7 +224,7 @@ function assertKindRegistered(declaration, registeredKinds, entity) {
|
|
|
224
224
|
if (registeredKinds.has(declaration.kind)) return;
|
|
225
225
|
const slot = entity === "node" ? "nodes" : "edges";
|
|
226
226
|
const suggestion = entity === "node" ? `Add { ${declaration.kind}: { type: ${declaration.kind} } } to defineGraph({ nodes }) or remove the index from "indexes".` : `Register the edge in defineGraph({ edges }) or remove the index from "indexes".`;
|
|
227
|
-
throw new
|
|
227
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
228
228
|
`Index "${declaration.name}" references ${entity} kind "${declaration.kind}" which is not registered in this graph's "${slot}".`,
|
|
229
229
|
{
|
|
230
230
|
indexName: declaration.name,
|
|
@@ -258,7 +258,7 @@ function isValidIsoDate(value) {
|
|
|
258
258
|
}
|
|
259
259
|
function validateIsoDate(value, fieldName) {
|
|
260
260
|
if (!isValidIsoDate(value)) {
|
|
261
|
-
throw new
|
|
261
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
262
262
|
`Invalid ISO 8601 datetime for "${fieldName}": "${value}". Expected format: YYYY-MM-DDTHH:mm:ss.sssZ`,
|
|
263
263
|
{
|
|
264
264
|
issues: [
|
|
@@ -297,5 +297,5 @@ exports.isNodeType = isNodeType;
|
|
|
297
297
|
exports.mergeVectorIndexes = mergeVectorIndexes;
|
|
298
298
|
exports.nowIso = nowIso;
|
|
299
299
|
exports.validateOptionalIsoDate = validateOptionalIsoDate;
|
|
300
|
-
//# sourceMappingURL=chunk-
|
|
301
|
-
//# sourceMappingURL=chunk-
|
|
300
|
+
//# sourceMappingURL=chunk-7JGLPAFV.cjs.map
|
|
301
|
+
//# sourceMappingURL=chunk-7JGLPAFV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/types.ts","../src/indexes/auto-derive.ts","../src/core/define-graph.ts","../src/utils/date.ts"],"names":["getEmbeddingIndex","isEmbeddingSchema","ConfigurationError","ValidationError"],"mappings":";;;;;;AAkCO,IAAM,eAAA,GAAkB;AAGxB,IAAM,eAAA,GAAkB;AAiSxB,SAAS,WAAW,KAAA,EAAmC;AAC5D,EAAA,OACE,OAAO,UAAU,QAAA,IACjB,KAAA,KAAU,QACV,eAAA,IAAmB,KAAA,IAClB,KAAA,CAAkC,eAAe,CAAA,KAAM,IAAA;AAE5D;AAKO,SAAS,WAAW,KAAA,EAAsC;AAC/D,EAAA,OACE,OAAO,UAAU,QAAA,IACjB,KAAA,KAAU,QACV,eAAA,IAAmB,KAAA,IAClB,KAAA,CAAkC,eAAe,CAAA,KAAM,IAAA;AAE5D;AAMO,SAAS,wBACd,KAAA,EACgC;AAChC,EAAA,OACE,WAAW,KAAK,CAAA,IAChB,MAAM,OAAA,CAAQ,KAAA,CAAM,IAAI,CAAA,IACxB,KAAA,CAAM,KAAK,MAAA,GAAS,CAAA,IACpB,MAAM,OAAA,CAAQ,KAAA,CAAM,EAAE,CAAA,IACtB,KAAA,CAAM,GAAG,MAAA,GAAS,CAAA;AAEtB;;;ACvTO,SAAS,wBACd,KAAA,EACmC;AACnC,EAAA,MAAM,MAAgC,EAAC;AACvC,EAAA,KAAA,MAAW,YAAA,IAAgB,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA,EAAG;AAC/C,IAAA,MAAM,OAAO,YAAA,CAAa,IAAA;AAC1B,IAAA,MAAM,KAAA,GAAQ,eAAA,CAAgB,IAAA,CAAK,MAAM,CAAA;AACzC,IAAA,IAAI,UAAU,MAAA,EAAW;AACzB,IAAA,KAAA,MAAW,CAAC,SAAA,EAAW,WAAW,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAC5D,MAAA,MAAM,MAAA,GAAS,mBAAmB,WAAW,CAAA;AAC7C,MAAA,IAAI,WAAW,MAAA,EAA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AA,OAAA,iBAAO,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAChC","file":"chunk-7JGLPAFV.cjs","sourcesContent":["import { type z } from \"zod\";\n\n// ============================================================\n// Cross-cutting Discriminators\n// ============================================================\n\n/**\n * Which side of the bipartite graph a kind lives on. Used everywhere a\n * function takes \"the entity that owns a kind\" — error metadata,\n * extension classifiers, removal queues, schema diffs.\n */\nexport type KindEntity = \"node\" | \"edge\";\n\n/**\n * Which physical surface an index targets. Vector indexes don't own a\n * kind directly (they back a per-`(kind, field)` typed embedding table\n * owned by the active `VectorStrategy`), but they participate in the same\n * materialization and diff pipelines, so they share this discriminator.\n */\nexport type IndexEntity = \"node\" | \"edge\" | \"vector\";\n\n/**\n * Field-level null-check operations that round-trip through persisted\n * documents (unique-constraint where clauses, index where clauses,\n * graph-extension where clauses, IsNullPredicate). Consolidated so a\n * single rename or extension touches one site.\n */\nexport type NullCheckOp = \"isNull\" | \"isNotNull\";\n\n// ============================================================\n// Brand Keys for Nominal Typing\n// ============================================================\n\n/** Brand key for NodeType */\nexport const NODE_TYPE_BRAND = \"__nodeType\" as const;\n\n/** Brand key for EdgeType */\nexport const EDGE_TYPE_BRAND = \"__edgeType\" as const;\n\n/** Brand symbol for NodeId */\ndeclare const __nodeId: unique symbol;\n\n/** Brand symbol for EdgeId */\ndeclare const __edgeId: unique symbol;\n\n// ============================================================\n// Node Type\n// ============================================================\n\n/**\n * Any JSON-serializable value.\n *\n * Mirrors the JSON wire format: primitives, arrays, and string-keyed objects.\n * `null` is included because the JSON spec requires it for \"no value here\";\n * this is the one place in the public API that uses `null` over `undefined`.\n */\nexport type JsonValue =\n | null\n | string\n | number\n | boolean\n | readonly JsonValue[]\n | Readonly<{ [key: string]: JsonValue }>;\n\n/**\n * Consumer-owned per-kind annotations.\n *\n * Stable labels attached to a node or edge kind at definition time — UI hints,\n * audit policy, provenance pointers, tooling annotations.\n *\n * **Consumer-owned, fully.** TypeGraph never reads, validates, or interprets\n * values in this field. Consumers own the entire namespace; there are no\n * reserved keys or extension prefixes. Future library-owned per-kind state,\n * if needed, will use a separate sibling field rather than carving out keys\n * here.\n *\n * **Annotations participate in schema hashing.** Any change to an annotation\n * value (or adding/removing an annotation key) bumps the canonical schema\n * hash and is reported as a `safe`-severity diff by `getSchemaChanges`. If\n * you don't want versioning for a piece of state, do not put it here.\n *\n * Values must be JSON-serializable — `bigint`, `function`, `symbol`, `undefined`,\n * `Date`, and other class instances are rejected at definition time so they can\n * never silently break schema hashing or storage round-trips.\n */\nexport type KindAnnotations = Readonly<Record<string, JsonValue>>;\n\n/**\n * A node type definition.\n *\n * Created via `defineNode()`. Represents a type of node in the graph\n * with an associated Zod schema for properties.\n */\nexport type NodeType<\n K extends string = string,\n S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>,\n> = Readonly<{\n [NODE_TYPE_BRAND]: true;\n kind: K;\n schema: S;\n description: string | undefined;\n annotations: KindAnnotations | undefined;\n}>;\n\n/**\n * Branded node ID type.\n *\n * Prevents mixing IDs from different node types at compile time.\n */\nexport type NodeId<N extends NodeType> = string &\n Readonly<{\n [__nodeId]: N;\n }>;\n\n/**\n * Infer the props type from a NodeType.\n */\nexport type NodeProps<N extends NodeType> = z.infer<N[\"schema\"]>;\n\n// ============================================================\n// Edge Type\n// ============================================================\n\n/**\n * An edge type definition.\n *\n * Created via `defineEdge()`. Represents a type of edge in the graph\n * with an optional Zod schema for properties.\n *\n * Optionally includes `from` and `to` arrays that define the allowed\n * source and target node types (domain and range constraints).\n */\nexport type EdgeType<\n K extends string = string,\n S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>,\n From extends readonly NodeType[] | undefined = undefined,\n To extends readonly NodeType[] | undefined = undefined,\n> = Readonly<{\n [EDGE_TYPE_BRAND]: true;\n kind: K;\n schema: S;\n description: string | undefined;\n annotations: KindAnnotations | undefined;\n from: From;\n to: To;\n}>;\n\n/**\n * Base edge type for use in constraints - accepts any from/to configuration.\n */\nexport type AnyEdgeType = EdgeType<\n string,\n z.ZodObject<z.ZodRawShape>,\n readonly NodeType[] | undefined,\n readonly NodeType[] | undefined\n>;\n\n/**\n * An edge type that has both from and to constraints defined.\n * Can be used directly in defineGraph without an EdgeRegistration wrapper.\n */\nexport type EdgeTypeWithEndpoints = EdgeType<\n string,\n z.ZodObject<z.ZodRawShape>,\n readonly NodeType[],\n readonly NodeType[]\n>;\n\n/**\n * Branded edge ID type.\n *\n * Prevents mixing IDs from different edge types at compile time.\n */\nexport type EdgeId<E extends AnyEdgeType = AnyEdgeType> = string &\n Readonly<{\n [__edgeId]: E;\n }>;\n\n/**\n * Infer the props type from an EdgeType.\n */\nexport type EdgeProps<E extends AnyEdgeType> = z.infer<E[\"schema\"]>;\n\n// ============================================================\n// Configuration Types\n// ============================================================\n\n/**\n * Delete behaviors for nodes.\n */\nexport type DeleteBehavior = \"restrict\" | \"cascade\" | \"disconnect\";\n\n/**\n * Edge cardinality constraints.\n */\nexport type Cardinality =\n | \"many\" // No constraint (default)\n | \"one\" // At most one edge of this kind from any source node\n | \"unique\" // At most one edge of this kind between any (source, target) pair\n | \"oneActive\"; // At most one edge with valid_to IS NULL from any source\n\n/**\n * Endpoint existence modes for edge validation.\n */\nexport type EndpointExistence =\n | \"notDeleted\" // Endpoint deleted_at IS NULL (default)\n | \"currentlyValid\" // Endpoint not deleted AND temporally valid\n | \"ever\"; // Endpoint exists in any state\n\n/**\n * Temporal query modes.\n */\nexport type TemporalMode =\n | \"current\" // Valid now AND not deleted\n | \"asOf\" // Valid at specific date AND not deleted\n | \"includeEnded\" // All validity periods AND not deleted\n | \"includeTombstones\"; // Everything including soft-deleted\n\n/**\n * Uniqueness constraint scope.\n */\nexport type UniquenessScope =\n | \"kind\" // Unique within this exact kind only\n | \"kindWithSubClasses\"; // Unique across this kind and all subclasses\n\n/**\n * Collation for uniqueness constraints.\n */\nexport type Collation = \"binary\" | \"caseInsensitive\";\n\n// ============================================================\n// Uniqueness Constraint\n// ============================================================\n\n/**\n * Uniqueness constraint definition.\n */\nexport type UniqueConstraint<\n S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>,\n> = Readonly<{\n name: string;\n fields: readonly (keyof z.infer<S> & string)[];\n where?: (\n props: UniqueConstraintPredicateBuilder<S>,\n ) => UniqueConstraintPredicate;\n scope: UniquenessScope;\n collation: Collation;\n}>;\n\n/**\n * Predicate builder for uniqueness constraint where clause.\n * Uses -? to make all fields required in the builder, even if optional in the schema.\n */\ntype UniqueConstraintPredicateBuilder<S extends z.ZodObject<z.ZodRawShape>> =\n Readonly<{\n [K in keyof z.infer<S>]-?: UniqueConstraintField;\n }>;\n\n/**\n * Field operations for uniqueness constraint predicates.\n */\ntype UniqueConstraintField = Readonly<{\n isNull: () => UniqueConstraintPredicate;\n isNotNull: () => UniqueConstraintPredicate;\n}>;\n\n/**\n * A uniqueness constraint predicate (internal representation).\n */\ntype UniqueConstraintPredicate = Readonly<{\n __type: \"unique_predicate\";\n field: string;\n op: NullCheckOp;\n}>;\n\n// ============================================================\n// Node Registration\n// ============================================================\n\n/**\n * Node registration in a graph definition.\n */\nexport type NodeRegistration<N extends NodeType = NodeType> = Readonly<{\n type: N;\n unique?: readonly UniqueConstraint<N[\"schema\"]>[];\n onDelete?: DeleteBehavior;\n}>;\n\n// ============================================================\n// Edge Registration\n// ============================================================\n\n/**\n * Edge registration in a graph definition.\n */\nexport type EdgeRegistration<\n E extends AnyEdgeType = AnyEdgeType,\n FromTypes extends NodeType = NodeType,\n ToTypes extends NodeType = NodeType,\n> = Readonly<{\n type: E;\n from: readonly FromTypes[];\n to: readonly ToTypes[];\n cardinality?: Cardinality;\n endpointExistence?: EndpointExistence;\n}>;\n\n// ============================================================\n// Graph Defaults\n// ============================================================\n\n/**\n * Default settings for a graph.\n */\nexport type GraphDefaults = Readonly<{\n onNodeDelete?: DeleteBehavior;\n temporalMode?: TemporalMode;\n}>;\n\n// ============================================================\n// Type Helpers\n// ============================================================\n\n/**\n * Checks if a value is a NodeType.\n */\nexport function isNodeType(value: unknown): value is NodeType {\n return (\n typeof value === \"object\" &&\n value !== null &&\n NODE_TYPE_BRAND in value &&\n (value as Record<string, unknown>)[NODE_TYPE_BRAND] === true\n );\n}\n\n/**\n * Checks if a value is an EdgeType.\n */\nexport function isEdgeType(value: unknown): value is AnyEdgeType {\n return (\n typeof value === \"object\" &&\n value !== null &&\n EDGE_TYPE_BRAND in value &&\n (value as Record<string, unknown>)[EDGE_TYPE_BRAND] === true\n );\n}\n\n/**\n * Checks if a value is an EdgeType with both from and to constraints defined.\n * Such edges can be used directly in defineGraph without an EdgeRegistration wrapper.\n */\nexport function isEdgeTypeWithEndpoints(\n value: unknown,\n): value is EdgeTypeWithEndpoints {\n return (\n isEdgeType(value) &&\n Array.isArray(value.from) &&\n value.from.length > 0 &&\n Array.isArray(value.to) &&\n value.to.length > 0\n );\n}\n","/**\n * Auto-derive vector index declarations from `embedding()` brands on\n * node schemas.\n *\n * Walks each node's top-level Zod shape, finds fields wrapped in\n * `embedding(dimensions, opts)` (including `.optional()` /\n * `.nullable()` wrappers), and emits one `VectorIndexDeclaration` per\n * (kind, field) pair. The declaration carries the resolved index\n * configuration from the embedding brand — metric, indexType, HNSW /\n * IVFFlat params — so the materializer doesn't need to reach back into\n * the Zod schema.\n *\n * Auto-derivation is intentionally limited to TOP-LEVEL embedding\n * fields. Embeddings nested inside object properties are out of scope\n * for v1 — vector slots are materialized as flat `(kind, fieldPath)`\n * storage units, and top-level fields keep that contract explicit.\n *\n * Explicit `defineVectorIndex(node, fieldPath, opts)` declarations\n * passed via `defineGraph({ indexes })` take precedence — when an\n * explicit declaration matches the same (kind, fieldPath) as an\n * auto-derived one, the explicit version wins. This lets consumers\n * override defaults without losing auto-derivation for other fields.\n */\n\nimport { type z } from \"zod\";\n\nimport {\n getEmbeddingIndex,\n isEmbeddingSchema,\n type ResolvedEmbeddingIndex,\n} from \"../core/embedding\";\nimport { type NodeRegistration } from \"../core/types\";\nimport { type IndexDeclaration, type VectorIndexDeclaration } from \"./types\";\n\n/**\n * Auto-derive vector index declarations from embedding brands on a\n * map of node registrations. Returns one declaration per\n * (kind, top-level field) pair. Empty array when no embeddings found.\n *\n * Cross-graph status-table disambiguation does NOT happen here — the\n * declaration name stays clean (`tg_vec_{kind}_{field}_{metric}`) so\n * `pg_indexes` and result-entry inspection are readable. The\n * materializer composes a graph-scoped key (`${graphId}::${name}`)\n * for status-table identity, applied uniformly to both auto-derived\n * and explicit `VectorIndexDeclaration` entries — see\n * `vectorStatusKey` in `store/materialize-indexes.ts`. This keeps\n * the disambiguation rule in one place that BOTH paths go through,\n * rather than depending on the auto-derive caller to produce a\n * graph-scoped name.\n */\nexport function autoDeriveVectorIndexes(\n nodes: Record<string, NodeRegistration>,\n): readonly VectorIndexDeclaration[] {\n const out: VectorIndexDeclaration[] = [];\n for (const registration of Object.values(nodes)) {\n const node = registration.type;\n const shape = readObjectShape(node.schema);\n if (shape === undefined) continue;\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const config = readEmbeddingIndex(fieldSchema);\n if (config === undefined) continue;\n const dimensions = readEmbeddingDimensions(fieldSchema);\n if (dimensions === undefined) continue;\n out.push(buildAutoDerived(node.kind, fieldName, dimensions, config));\n }\n }\n return out;\n}\n\n/**\n * Merge auto-derived declarations with explicit ones, preferring\n * explicit on (kind, fieldPath) collisions. Returns a flat list of all\n * indexes; non-vector entries from `explicit` pass through unchanged.\n */\nexport function mergeVectorIndexes(\n explicit: readonly IndexDeclaration[],\n autoDerived: readonly VectorIndexDeclaration[],\n): readonly IndexDeclaration[] {\n if (autoDerived.length === 0) return explicit;\n const explicitVectorKeys = new Set<string>();\n for (const declaration of explicit) {\n if (declaration.entity === \"vector\") {\n explicitVectorKeys.add(`${declaration.kind}|${declaration.fieldPath}`);\n }\n }\n const filteredAuto = autoDerived.filter(\n (entry) => !explicitVectorKeys.has(`${entry.kind}|${entry.fieldPath}`),\n );\n return [...explicit, ...filteredAuto];\n}\n\n/**\n * Generate the deterministic vector index name. The visible prefix\n * `tg_vec_<kind>_<field>_<metric>` keeps it scannable in result-entry\n * inspection and the `typegraph_index_materializations` table.\n *\n * Cross-graph disambiguation is handled separately at the\n * materialization boundary (see `vectorStatusKey`) so the declaration\n * name doesn't need to carry `graphId` — the same auto-derived name\n * is reusable across graphs and the materializer composes a\n * graph-scoped status key for both auto-derived and explicit entries\n * uniformly.\n */\nfunction buildAutoDerived(\n kind: string,\n fieldName: string,\n dimensions: number,\n config: ResolvedEmbeddingIndex,\n): VectorIndexDeclaration {\n const fieldPath = fieldName;\n return Object.freeze({\n entity: \"vector\" as const,\n name: `tg_vec_${sanitize(kind)}_${sanitize(fieldName)}_${config.metric}`,\n kind,\n fieldPath,\n dimensions,\n metric: config.metric,\n indexType: config.indexType,\n indexParams: Object.freeze({\n m: config.m,\n efConstruction: config.efConstruction,\n lists: config.lists,\n }),\n });\n}\n\nfunction sanitize(value: string): string {\n return value.replaceAll(/[^a-zA-Z0-9]/g, \"_\").toLowerCase();\n}\n\nfunction readObjectShape(\n schema: z.ZodType,\n): Record<string, z.ZodType> | undefined {\n if ((schema as { type?: string }).type !== \"object\") return undefined;\n const shape = (schema.def as { shape?: Record<string, z.ZodType> }).shape;\n return shape;\n}\n\nfunction readEmbeddingIndex(\n schema: z.ZodType,\n): ResolvedEmbeddingIndex | undefined {\n for (const candidate of unwrapChain(schema)) {\n const config = getEmbeddingIndex(candidate);\n if (config !== undefined) return config;\n }\n return undefined;\n}\n\nfunction readEmbeddingDimensions(schema: z.ZodType): number | undefined {\n for (const candidate of unwrapChain(schema)) {\n if (isEmbeddingSchema(candidate)) {\n return (candidate as unknown as Record<string, number>)\n ._embeddingDimensions;\n }\n }\n return undefined;\n}\n\n/**\n * Yield the schema and every reachable inner schema by repeatedly\n * applying `.unwrap()` (Zod 4 optional/nullable/default) and\n * `.def.innerType` (some wrappers). Cycle-guarded by depth and\n * reference identity. Generators stop at the first non-unwrappable\n * schema OR after 8 levels — deeper wrapping is pathological and not\n * worth supporting.\n */\nfunction* unwrapChain(schema: z.ZodType): Generator<z.ZodType, void, void> {\n const seen = new Set<z.ZodType>();\n let current: z.ZodType | undefined = schema;\n let depth = 0;\n while (current !== undefined && !seen.has(current) && depth < 8) {\n seen.add(current);\n yield current;\n current = unwrapOnce(current);\n depth++;\n }\n}\n\nfunction unwrapOnce(schema: z.ZodType): z.ZodType | undefined {\n // Zod 4 wrappers expose `.unwrap()` on optional/nullable/default.\n const candidate = schema as unknown as { unwrap?: () => z.ZodType };\n if (typeof candidate.unwrap === \"function\") return candidate.unwrap();\n // Some wrappers expose the inner schema via `.def.innerType`.\n return (schema as unknown as { def?: { innerType?: z.ZodType } }).def\n ?.innerType;\n}\n","import { ConfigurationError } from \"../errors/index\";\nimport { type GraphExtension } from \"../graph-extension/extension-types\";\nimport {\n autoDeriveVectorIndexes,\n mergeVectorIndexes,\n} from \"../indexes/auto-derive\";\nimport { type IndexDeclaration } from \"../indexes/types\";\nimport { type OntologyRelation } from \"../ontology/types\";\nimport {\n type AnyEdgeType,\n type DeleteBehavior,\n type EdgeRegistration,\n type EdgeTypeWithEndpoints,\n type GraphDefaults,\n isEdgeType,\n isEdgeTypeWithEndpoints,\n type KindEntity,\n type NodeRegistration,\n type NodeType,\n type TemporalMode,\n} from \"./types\";\n\n// ============================================================\n// Graph Definition Brand Symbol\n// ============================================================\n\n/** Brand key for GraphDef */\nconst GRAPH_DEF_BRAND = \"__graphDef\" as const;\n\n// ============================================================\n// Edge Entry Types\n// ============================================================\n\n/**\n * An edge entry in the graph definition.\n * Can be:\n * - EdgeType directly (constrained or unconstrained)\n * - EdgeRegistration object (always works, can override/narrow defaults)\n */\ntype EdgeEntry = EdgeRegistration | AnyEdgeType;\n\n/**\n * Normalized edge map type - all entries become EdgeRegistration.\n * For bare EdgeTypes, constrained endpoints are extracted from the type;\n * unconstrained edges fall back to all node types in the graph.\n */\ntype NormalizedEdges<\n TNodes extends Record<string, NodeRegistration>,\n TEdges extends Record<string, EdgeEntry>,\n> = {\n [K in keyof TEdges]: TEdges[K] extends EdgeRegistration ? TEdges[K]\n : TEdges[K] extends AnyEdgeType ?\n EdgeRegistration<\n TEdges[K],\n TEdges[K][\"from\"] extends readonly (infer N extends NodeType)[] ? N\n : TNodes[keyof TNodes][\"type\"],\n TEdges[K][\"to\"] extends readonly (infer N extends NodeType)[] ? N\n : TNodes[keyof TNodes][\"type\"]\n >\n : never;\n};\n\n// ============================================================\n// Edge Normalization Functions\n// ============================================================\n\n/**\n * Validates that an EdgeRegistration's constraints don't widen beyond\n * the edge type's built-in domain/range constraints.\n */\nfunction validateConstraintNarrowing(\n name: string,\n edgeType: EdgeTypeWithEndpoints,\n registration: EdgeRegistration,\n): void {\n const builtInFromNames = new Set(edgeType.from.map((node) => node.kind));\n for (const fromNode of registration.from) {\n if (!builtInFromNames.has(fromNode.kind)) {\n throw new ConfigurationError(\n `Edge \"${name}\" registration has 'from' kind \"${fromNode.kind}\" ` +\n `not in edge's built-in domain: [${[...builtInFromNames].join(\", \")}]`,\n {\n edgeName: name,\n invalidFrom: fromNode.kind,\n allowedFrom: [...builtInFromNames],\n },\n {\n suggestion: `Edge registration can only narrow, not widen, the edge type's built-in constraints.`,\n },\n );\n }\n }\n\n const builtInToNames = new Set(edgeType.to.map((node) => node.kind));\n for (const toNode of registration.to) {\n if (!builtInToNames.has(toNode.kind)) {\n throw new ConfigurationError(\n `Edge \"${name}\" registration has 'to' kind \"${toNode.kind}\" ` +\n `not in edge's built-in range: [${[...builtInToNames].join(\", \")}]`,\n {\n edgeName: name,\n invalidTo: toNode.kind,\n allowedTo: [...builtInToNames],\n },\n {\n suggestion: `Edge registration can only narrow, not widen, the edge type's built-in constraints.`,\n },\n );\n }\n }\n}\n\n/**\n * Normalizes a single edge entry to EdgeRegistration.\n */\nfunction normalizeEdgeEntry(\n name: string,\n entry: EdgeEntry,\n allNodeTypes: readonly NodeType[],\n): EdgeRegistration {\n if (isEdgeType(entry)) {\n if (isEdgeTypeWithEndpoints(entry)) {\n // EdgeType with from/to — convert to EdgeRegistration\n return { type: entry, from: entry.from, to: entry.to };\n }\n // Unconstrained EdgeType — allow any→any\n return { type: entry, from: allNodeTypes, to: allNodeTypes };\n }\n\n // Already EdgeRegistration — validate narrowing if edge has built-in constraints\n if (isEdgeTypeWithEndpoints(entry.type)) {\n validateConstraintNarrowing(name, entry.type, entry);\n }\n\n return entry;\n}\n\n/**\n * Normalizes all edge entries to EdgeRegistration.\n */\nfunction normalizeEdges(\n edges: Record<string, EdgeEntry>,\n allNodeTypes: readonly NodeType[],\n): Record<string, EdgeRegistration> {\n const result: Record<string, EdgeRegistration> = {};\n for (const [name, entry] of Object.entries(edges)) {\n result[name] = normalizeEdgeEntry(name, entry, allNodeTypes);\n }\n return result;\n}\n\n// ============================================================\n// Graph Definition Configuration\n// ============================================================\n\n/**\n * Configuration for defineGraph.\n */\ntype GraphDefConfig<\n TNodes extends Record<string, NodeRegistration>,\n TEdges extends Record<string, EdgeEntry>,\n TOntology extends readonly OntologyRelation[],\n> = Readonly<{\n /** Unique identifier for this graph */\n id: string;\n /** Node registrations */\n nodes: TNodes;\n /** Edge registrations or EdgeTypes with built-in domain/range */\n edges: TEdges;\n /** Ontology relations */\n ontology?: TOntology;\n /** Graph-wide defaults */\n defaults?: GraphDefaults;\n /**\n * Index declarations attached to this graph.\n *\n * Accepts the outputs of `defineNodeIndex` / `defineEdgeIndex` (which\n * already return `IndexDeclaration` values) or pre-built declarations\n * reconstructed from a stored schema or graph extension.\n *\n * Validated at definition time: every index must reference a `kind`\n * that exists in `nodes` / `edges`, and index `name`s must be unique\n * within the graph.\n *\n * Index DDL is **not** generated by `defineGraph`. Indexes flow into\n * `SerializedSchema.indexes` so they can later be materialized via\n * `store.materializeIndexes()` — lifting the storage concern out of\n * the schema-version commit path.\n */\n indexes?: readonly IndexDeclaration[];\n}>;\n\n// ============================================================\n// Graph Definition Type\n// ============================================================\n\n/**\n * A graph definition.\n *\n * This is a compile-time artifact that describes the structure of a graph.\n * Use `createStore()` to create a runtime store from this definition.\n */\nexport type GraphDef<\n TNodes extends Record<string, NodeRegistration> = Record<\n string,\n NodeRegistration\n >,\n TEdges extends Record<string, EdgeRegistration> = Record<\n string,\n EdgeRegistration\n >,\n TOntology extends readonly OntologyRelation[] = readonly OntologyRelation[],\n> = Readonly<{\n [GRAPH_DEF_BRAND]: true;\n id: string;\n nodes: TNodes;\n edges: TEdges;\n ontology: TOntology;\n defaults: Readonly<{\n onNodeDelete: DeleteBehavior;\n temporalMode: TemporalMode;\n }>;\n /**\n * Index declarations attached to this graph. Preserves whatever the\n * caller passed to `defineGraph` (including an explicit empty array)\n * for introspection purposes.\n *\n * The serialized canonical form is order-canonicalized (sorted by\n * `name`) and treats `undefined` and `[]` as the same \"no slice\" form\n * — an empty array does not bump the schema hash, since indexes are\n * an unordered set keyed by name and `[]` carries no semantic meaning\n * that an absent slice doesn't.\n */\n indexes: readonly IndexDeclaration[] | undefined;\n /**\n * Graph extension this graph was merged with, if any. Set by\n * `mergeGraphExtension`; never set by `defineGraph` directly.\n * Exists solely so re-serialization is stable — the rest of the\n * system reads the merged kinds through `nodes` / `edges` /\n * `ontology` and never inspects this field. Absent on graphs that\n * have never been extended; legacy graphs hash byte-identically.\n */\n extension: GraphExtension | undefined;\n /**\n * Soft-deprecated kind names attached to this graph. Set by the\n * loader from the persisted schema and by `store.deprecateKinds(...)`\n * / `store.undeprecateKinds(...)`. A purely informational signal\n * surfaced for introspection — does not gate reads, writes, or\n * queries. Defaults to the empty set on freshly-defined graphs.\n */\n deprecatedKinds: ReadonlySet<string>;\n}>;\n\n// ============================================================\n// Type Helpers\n// ============================================================\n\n/**\n * Extract node kind names from a GraphDef.\n */\nexport type NodeKinds<G extends GraphDef> = keyof G[\"nodes\"] & string;\n\n/**\n * Extract edge kind names from a GraphDef.\n */\nexport type EdgeKinds<G extends GraphDef> = keyof G[\"edges\"] & string;\n\n/**\n * Get a NodeType from a GraphDef by kind name.\n */\nexport type GetNodeType<\n G extends GraphDef,\n K extends NodeKinds<G>,\n> = G[\"nodes\"][K][\"type\"];\n\n/**\n * Get an EdgeType from a GraphDef by kind name.\n */\nexport type GetEdgeType<\n G extends GraphDef,\n K extends EdgeKinds<G>,\n> = G[\"edges\"][K][\"type\"];\n\n/**\n * Get all NodeTypes from a GraphDef.\n */\nexport type AllNodeTypes<G extends GraphDef> = {\n [K in NodeKinds<G>]: G[\"nodes\"][K][\"type\"];\n}[NodeKinds<G>];\n\n/**\n * Get all EdgeTypes from a GraphDef.\n */\nexport type AllEdgeTypes<G extends GraphDef> = {\n [K in EdgeKinds<G>]: G[\"edges\"][K][\"type\"];\n}[EdgeKinds<G>];\n\n// ============================================================\n// Define Graph Function\n// ============================================================\n\n/**\n * Creates a graph definition.\n *\n * @example\n * ```typescript\n * const graph = defineGraph({\n * id: \"my_graph\",\n * nodes: {\n * Person: { type: Person },\n * Company: { type: Company },\n * },\n * edges: {\n * // Traditional EdgeRegistration syntax\n * worksAt: {\n * type: worksAt,\n * from: [Person],\n * to: [Company],\n * cardinality: \"many\",\n * },\n * // Or use EdgeType directly if it has from/to defined\n * knows, // EdgeType with built-in domain/range\n * },\n * ontology: [\n * subClassOf(Company, Organization),\n * disjointWith(Person, Organization),\n * ],\n * defaults: {\n * onNodeDelete: \"restrict\",\n * temporalMode: \"current\",\n * },\n * });\n * ```\n */\nexport function defineGraph<\n const TNodes extends Record<string, NodeRegistration<NodeType>>,\n const TEdges extends Record<string, EdgeEntry>,\n const TOntology extends readonly OntologyRelation[],\n>(\n config: GraphDefConfig<TNodes, TEdges, TOntology>,\n): GraphDef<TNodes, NormalizedEdges<TNodes, TEdges>, TOntology> {\n const defaults = {\n onNodeDelete: config.defaults?.onNodeDelete ?? \"restrict\",\n temporalMode: config.defaults?.temporalMode ?? \"current\",\n } as const;\n\n const allNodeTypes = Object.values(config.nodes).map((reg) => reg.type);\n const normalizedEdges = normalizeEdges(config.edges, allNodeTypes);\n // Vector indexes are auto-derived from `embedding()` brands on node\n // schemas (see `autoDeriveVectorIndexes`). Explicit declarations\n // passed via `defineGraph({ indexes })` win on (kind, fieldPath)\n // collisions so consumers can override defaults — see\n // `mergeVectorIndexes`. The merged list flows through\n // `normalizeIndexes` for the standard kind-registered + unique-name\n // checks.\n //\n // Preservation rule: if the consumer never passed `indexes` at all\n // AND no embedding brands exist, leave `graph.indexes` undefined to\n // keep the introspection surface stable for legacy graphs. If the\n // consumer passed an explicit `[]`, surface it as `[]` (not\n // `undefined`) to match the contract pinned by the\n // \"preserves an explicit empty indexes array\" test.\n const autoVectorIndexes = autoDeriveVectorIndexes(config.nodes);\n const explicitProvided = config.indexes !== undefined;\n const mergedIndexes = mergeVectorIndexes(\n config.indexes ?? [],\n autoVectorIndexes,\n );\n const indexes =\n !explicitProvided && mergedIndexes.length === 0 ?\n undefined\n : normalizeIndexes(mergedIndexes, config.nodes, normalizedEdges);\n\n return Object.freeze({\n [GRAPH_DEF_BRAND]: true as const,\n id: config.id,\n nodes: config.nodes,\n edges: normalizedEdges,\n ontology: config.ontology ?? ([] as unknown as TOntology),\n defaults,\n indexes,\n extension: undefined,\n deprecatedKinds: EMPTY_DEPRECATED_KINDS,\n }) as GraphDef<TNodes, NormalizedEdges<TNodes, TEdges>, TOntology>;\n}\n\n// Sharing one frozen empty Set keeps the canonical-form hash stable\n// across graphs that never deprecate any kinds.\nconst EMPTY_DEPRECATED_KINDS: ReadonlySet<string> = Object.freeze(\n new Set<string>(),\n);\n\n// ============================================================\n// Index Normalization\n// ============================================================\n\n/**\n * Validates the `indexes` config slice:\n *\n * - Every index references a kind that exists in the graph's `nodes`\n * (for node indexes) or `edges` (for edge indexes).\n * - Index `name`s are unique within the graph.\n */\nfunction normalizeIndexes(\n inputs: readonly IndexDeclaration[],\n nodes: Record<string, NodeRegistration>,\n edges: Record<string, EdgeRegistration>,\n): readonly IndexDeclaration[] {\n if (inputs.length === 0) {\n return [];\n }\n\n const nodeKinds = collectKinds(nodes);\n const edgeKinds = collectKinds(edges);\n const seenNames = new Set<string>();\n\n for (const declaration of inputs) {\n if (declaration.entity === \"node\" || declaration.entity === \"vector\") {\n // Vector indexes attach to node kinds (the embedding lives on a\n // node field). Validation reuses the node-kind check.\n assertKindRegistered(declaration, nodeKinds, \"node\");\n } else {\n assertKindRegistered(declaration, edgeKinds, \"edge\");\n }\n\n if (seenNames.has(declaration.name)) {\n throw new ConfigurationError(\n `Duplicate index name \"${declaration.name}\" in defineGraph({ indexes }). ` +\n `Index names must be unique within a graph.`,\n { indexName: declaration.name },\n {\n suggestion: `Pass an explicit { name: \"...\" } to disambiguate.`,\n },\n );\n }\n seenNames.add(declaration.name);\n }\n\n return inputs;\n}\n\nfunction collectKinds(\n registrations: Record<string, { type: { kind: string } }>,\n): ReadonlySet<string> {\n const kinds = new Set<string>();\n for (const registration of Object.values(registrations)) {\n kinds.add(registration.type.kind);\n }\n return kinds;\n}\n\nfunction assertKindRegistered(\n declaration: IndexDeclaration,\n registeredKinds: ReadonlySet<string>,\n entity: KindEntity,\n): void {\n if (registeredKinds.has(declaration.kind)) return;\n\n const slot = entity === \"node\" ? \"nodes\" : \"edges\";\n const suggestion =\n entity === \"node\" ?\n `Add { ${declaration.kind}: { type: ${declaration.kind} } } to defineGraph({ nodes }) ` +\n `or remove the index from \"indexes\".`\n : `Register the edge in defineGraph({ edges }) or remove the index from \"indexes\".`;\n\n throw new ConfigurationError(\n `Index \"${declaration.name}\" references ${entity} kind \"${declaration.kind}\" ` +\n `which is not registered in this graph's \"${slot}\".`,\n {\n indexName: declaration.name,\n referencedKind: declaration.kind,\n availableKinds: [...registeredKinds],\n },\n { suggestion },\n );\n}\n\n// ============================================================\n// Graph Definition Utilities\n// ============================================================\n\n/**\n * Checks if a value is a GraphDef.\n */\nexport function isGraphDef(value: unknown): value is GraphDef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n GRAPH_DEF_BRAND in value &&\n (value as Record<string, unknown>)[GRAPH_DEF_BRAND] === true\n );\n}\n\n/**\n * Gets all node kind names from a GraphDef.\n */\nexport function getNodeKinds<G extends GraphDef>(\n graph: G,\n): readonly (keyof G[\"nodes\"] & string)[] {\n return Object.keys(graph.nodes);\n}\n\n/**\n * Gets all edge kind names from a GraphDef.\n */\nexport function getEdgeKinds<G extends GraphDef>(\n graph: G,\n): readonly (keyof G[\"edges\"] & string)[] {\n return Object.keys(graph.edges);\n}\n\n/**\n * Returns true when `name` is registered as either a node or edge kind\n * on the given graph.\n */\nexport function isKnownKind(graph: GraphDef, name: string): boolean {\n return Object.hasOwn(graph.nodes, name) || Object.hasOwn(graph.edges, name);\n}\n","/**\n * Date encoding utilities for consistent storage.\n *\n * Contract: All dates are stored as ISO 8601 strings in UTC.\n * - Always includes milliseconds\n * - Always UTC (Z suffix)\n * - Sorts correctly as strings\n */\n\nimport { ValidationError } from \"../errors\";\n\n/**\n * ISO 8601 datetime pattern.\n * Matches formats like:\n * - 2024-01-15T10:30:00.000Z\n * - 2024-01-15T10:30:00Z\n * - 2024-01-15T10:30:00.123Z\n */\nconst ISO_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?Z$/;\n\n/**\n * Checks if a string is a valid ISO 8601 datetime.\n *\n * @param value - String to validate\n * @returns True if valid ISO 8601 datetime\n */\nexport function isValidIsoDate(value: string): boolean {\n if (!ISO_DATE_PATTERN.test(value)) {\n return false;\n }\n // Also check that Date parsing produces a valid date\n const date = new Date(value);\n return !Number.isNaN(date.getTime());\n}\n\n/**\n * Validates that a string is a valid ISO 8601 datetime.\n * Throws ValidationError if invalid.\n *\n * @param value - String to validate\n * @param fieldName - Name of field for error message\n * @returns The validated string\n * @throws ValidationError if not a valid ISO datetime\n */\nexport function validateIsoDate(value: string, fieldName: string): string {\n if (!isValidIsoDate(value)) {\n throw new ValidationError(\n `Invalid ISO 8601 datetime for \"${fieldName}\": \"${value}\". ` +\n `Expected format: YYYY-MM-DDTHH:mm:ss.sssZ`,\n {\n issues: [\n {\n path: fieldName,\n message: `Invalid ISO 8601 datetime format. Expected: YYYY-MM-DDTHH:mm:ss.sssZ, got: \"${value}\"`,\n },\n ],\n },\n {\n suggestion: `Use a valid ISO 8601 UTC datetime like \"2024-01-15T10:30:00.000Z\"`,\n },\n );\n }\n return value;\n}\n\n/**\n * Validates an optional ISO date string.\n * Returns undefined if value is undefined, otherwise validates.\n */\nexport function validateOptionalIsoDate(\n value: string | undefined,\n fieldName: string,\n): string | undefined {\n if (value === undefined) return undefined;\n return validateIsoDate(value, fieldName);\n}\n\n/**\n * Encodes a Date to an ISO 8601 string for storage.\n */\nexport function encodeDate(date: Date): string {\n return date.toISOString();\n}\n\n/**\n * Decodes an ISO 8601 string to a Date.\n * Validates the string format first.\n *\n * @throws ValidationError if not a valid ISO datetime\n */\nexport function decodeDate(isoString: string): Date {\n validateIsoDate(isoString, \"date\");\n return new Date(isoString);\n}\n\n/**\n * Returns the current timestamp as an ISO string.\n */\nexport function nowIso(): string {\n return new Date().toISOString();\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsonPointer, parseJsonPointer } from './chunk-K5P5OZXS.js';
|
|
2
2
|
import { sql } from 'drizzle-orm';
|
|
3
3
|
import { CasingCache } from 'drizzle-orm/casing';
|
|
4
4
|
import { uniqueIndex, index } from 'drizzle-orm/pg-core';
|
|
@@ -401,7 +401,6 @@ var postgresDialect = {
|
|
|
401
401
|
capabilities: {
|
|
402
402
|
standardQueryStrategy: "cte_project",
|
|
403
403
|
recursiveQueryStrategy: "recursive_cte",
|
|
404
|
-
setOperationStrategy: "standard_parenthesized",
|
|
405
404
|
materializeIntermediateTraversalCtes: false,
|
|
406
405
|
emitNotMaterializedHint: true,
|
|
407
406
|
forceRecursiveWorktableOuterJoinOrder: false,
|
|
@@ -478,12 +477,24 @@ var postgresDialect = {
|
|
|
478
477
|
return sql`(${column} #> ${path} IS NOT NULL AND ${column} #>> ${path} != 'null')`;
|
|
479
478
|
},
|
|
480
479
|
// ============================================================
|
|
480
|
+
// Comparison Operations
|
|
481
|
+
// ============================================================
|
|
482
|
+
nullSafeEquals(left, right) {
|
|
483
|
+
return sql`${left} IS NOT DISTINCT FROM ${right}`;
|
|
484
|
+
},
|
|
485
|
+
// ============================================================
|
|
481
486
|
// String Operations
|
|
482
487
|
// ============================================================
|
|
483
488
|
ilike(column, pattern) {
|
|
484
489
|
return sql`${column} ILIKE ${pattern}`;
|
|
485
490
|
},
|
|
486
491
|
// ============================================================
|
|
492
|
+
// Set Operations
|
|
493
|
+
// ============================================================
|
|
494
|
+
wrapSetOperationOperand(inner) {
|
|
495
|
+
return sql`(${inner})`;
|
|
496
|
+
},
|
|
497
|
+
// ============================================================
|
|
487
498
|
// Recursive CTE Path Operations
|
|
488
499
|
// ============================================================
|
|
489
500
|
initializePath(nodeId) {
|
|
@@ -519,36 +530,9 @@ var postgresDialect = {
|
|
|
519
530
|
// ============================================================
|
|
520
531
|
// Vector Operations
|
|
521
532
|
// ============================================================
|
|
533
|
+
// Compile-time gate for `field.similarTo(...)`; the active
|
|
534
|
+
// `VectorStrategy` (pgvector) owns the distance SQL.
|
|
522
535
|
supportsVectors: true,
|
|
523
|
-
vectorDistance(column, embedding, metric) {
|
|
524
|
-
const formatted = this.formatEmbedding(embedding);
|
|
525
|
-
switch (metric) {
|
|
526
|
-
case "cosine": {
|
|
527
|
-
return sql`(${column} <=> ${formatted})`;
|
|
528
|
-
}
|
|
529
|
-
case "l2": {
|
|
530
|
-
return sql`(${column} <-> ${formatted})`;
|
|
531
|
-
}
|
|
532
|
-
case "inner_product": {
|
|
533
|
-
return sql`(${column} <#> ${formatted})`;
|
|
534
|
-
}
|
|
535
|
-
default: {
|
|
536
|
-
const _exhaustive = metric;
|
|
537
|
-
throw new Error("Unsupported vector metric: " + String(_exhaustive));
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
formatEmbedding(embedding) {
|
|
542
|
-
for (const [index, value] of embedding.entries()) {
|
|
543
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
544
|
-
throw new TypeError(
|
|
545
|
-
`embedding[${index}] must be a finite number, got: ${value}`
|
|
546
|
-
);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
const asString = `[${embedding.join(",")}]`;
|
|
550
|
-
return sql`${asString}::vector`;
|
|
551
|
-
},
|
|
552
536
|
// ============================================================
|
|
553
537
|
// Fulltext Operations
|
|
554
538
|
// ============================================================
|
|
@@ -580,7 +564,6 @@ var sqliteDialect = {
|
|
|
580
564
|
capabilities: {
|
|
581
565
|
standardQueryStrategy: "cte_project",
|
|
582
566
|
recursiveQueryStrategy: "recursive_cte",
|
|
583
|
-
setOperationStrategy: "sqlite_compound",
|
|
584
567
|
materializeIntermediateTraversalCtes: true,
|
|
585
568
|
emitNotMaterializedHint: false,
|
|
586
569
|
forceRecursiveWorktableOuterJoinOrder: true,
|
|
@@ -659,12 +642,24 @@ var sqliteDialect = {
|
|
|
659
642
|
return sql`(json_extract(${column}, ${pathSql}) IS NOT NULL AND json_type(${column}, ${pathSql}) != 'null')`;
|
|
660
643
|
},
|
|
661
644
|
// ============================================================
|
|
645
|
+
// Comparison Operations
|
|
646
|
+
// ============================================================
|
|
647
|
+
nullSafeEquals(left, right) {
|
|
648
|
+
return sql`${left} IS ${right}`;
|
|
649
|
+
},
|
|
650
|
+
// ============================================================
|
|
662
651
|
// String Operations
|
|
663
652
|
// ============================================================
|
|
664
653
|
ilike(column, pattern) {
|
|
665
654
|
return sql`LOWER(${column}) LIKE LOWER(${pattern})`;
|
|
666
655
|
},
|
|
667
656
|
// ============================================================
|
|
657
|
+
// Set Operations
|
|
658
|
+
// ============================================================
|
|
659
|
+
wrapSetOperationOperand(inner) {
|
|
660
|
+
return sql`SELECT * FROM (${inner})`;
|
|
661
|
+
},
|
|
662
|
+
// ============================================================
|
|
668
663
|
// Recursive CTE Path Operations
|
|
669
664
|
// ============================================================
|
|
670
665
|
initializePath(nodeId) {
|
|
@@ -703,43 +698,105 @@ var sqliteDialect = {
|
|
|
703
698
|
// ============================================================
|
|
704
699
|
// Vector Operations
|
|
705
700
|
// ============================================================
|
|
701
|
+
// Compile-time gate for `field.similarTo(...)`; the active
|
|
702
|
+
// `VectorStrategy` (sqlite-vec / libSQL-native) owns the distance SQL.
|
|
706
703
|
supportsVectors: true,
|
|
707
|
-
vectorDistance(column, embedding, metric) {
|
|
708
|
-
const formatted = this.formatEmbedding(embedding);
|
|
709
|
-
switch (metric) {
|
|
710
|
-
case "cosine": {
|
|
711
|
-
return sql`vec_distance_cosine(${column}, ${formatted})`;
|
|
712
|
-
}
|
|
713
|
-
case "l2": {
|
|
714
|
-
return sql`vec_distance_l2(${column}, ${formatted})`;
|
|
715
|
-
}
|
|
716
|
-
case "inner_product": {
|
|
717
|
-
throw new Error(
|
|
718
|
-
"Inner product distance is not supported by sqlite-vec. Use 'cosine' or 'l2' metrics instead."
|
|
719
|
-
);
|
|
720
|
-
}
|
|
721
|
-
default: {
|
|
722
|
-
const _exhaustive = metric;
|
|
723
|
-
throw new Error("Unsupported vector metric: " + String(_exhaustive));
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
},
|
|
727
|
-
formatEmbedding(embedding) {
|
|
728
|
-
for (const [index, value] of embedding.entries()) {
|
|
729
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
730
|
-
throw new TypeError(
|
|
731
|
-
`embedding[${index}] must be a finite number, got: ${value}`
|
|
732
|
-
);
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
const asJson = JSON.stringify(embedding);
|
|
736
|
-
return sql`vec_f32(${asJson})`;
|
|
737
|
-
},
|
|
738
704
|
// ============================================================
|
|
739
705
|
// Fulltext Operations
|
|
740
706
|
// ============================================================
|
|
741
707
|
fulltext: fts5Strategy
|
|
742
708
|
};
|
|
709
|
+
var VECTOR_CONTRIBUTION_PREFIX = "vector";
|
|
710
|
+
function buildVectorCapabilities(strategy) {
|
|
711
|
+
return strategy.capabilities;
|
|
712
|
+
}
|
|
713
|
+
function vectorScoreExpression(distanceExpression, metric) {
|
|
714
|
+
switch (metric) {
|
|
715
|
+
case "cosine": {
|
|
716
|
+
return sql`(1 - (${distanceExpression}))`;
|
|
717
|
+
}
|
|
718
|
+
case "l2":
|
|
719
|
+
case "inner_product": {
|
|
720
|
+
return distanceExpression;
|
|
721
|
+
}
|
|
722
|
+
default: {
|
|
723
|
+
const _exhaustive = metric;
|
|
724
|
+
throw new Error(`Unsupported vector metric: ${String(_exhaustive)}`);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
function vectorMinScoreCondition(distanceExpression, metric, minScore) {
|
|
729
|
+
assertVectorMinScore(minScore, metric);
|
|
730
|
+
switch (metric) {
|
|
731
|
+
case "cosine": {
|
|
732
|
+
return sql`${distanceExpression} <= ${1 - minScore}`;
|
|
733
|
+
}
|
|
734
|
+
case "l2": {
|
|
735
|
+
return sql`${distanceExpression} <= ${minScore}`;
|
|
736
|
+
}
|
|
737
|
+
case "inner_product": {
|
|
738
|
+
return sql`${distanceExpression} <= ${-minScore}`;
|
|
739
|
+
}
|
|
740
|
+
default: {
|
|
741
|
+
const _exhaustive = metric;
|
|
742
|
+
throw new Error(`Unsupported vector metric: ${String(_exhaustive)}`);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
function assertFiniteEmbedding(embedding, name) {
|
|
747
|
+
for (const [index, value] of embedding.entries()) {
|
|
748
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
749
|
+
throw new TypeError(
|
|
750
|
+
`${name}[${index}] must be a finite number, got: ${value}`
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
function assertVectorSearchLimit(limit) {
|
|
756
|
+
if (!Number.isInteger(limit) || limit <= 0) {
|
|
757
|
+
throw new RangeError(
|
|
758
|
+
`vectorSearch limit must be a positive integer, got: ${limit}`
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
function assertVectorMinScore(minScore, metric, label = "minScore") {
|
|
763
|
+
if (!Number.isFinite(minScore)) {
|
|
764
|
+
throw new RangeError(`${label} must be a finite number, got: ${minScore}`);
|
|
765
|
+
}
|
|
766
|
+
if (metric === "cosine" && (minScore < -1 || minScore > 1)) {
|
|
767
|
+
throw new RangeError(
|
|
768
|
+
`${label} for the cosine metric must be between -1 and 1, got: ${minScore}`
|
|
769
|
+
);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
var MAX_VECTOR_IDENTIFIER_LENGTH = 63;
|
|
773
|
+
function sanitizeIdentifierPart(value) {
|
|
774
|
+
return value.toLowerCase().replaceAll(/[^a-z0-9_]/g, "_");
|
|
775
|
+
}
|
|
776
|
+
function shortHash(input) {
|
|
777
|
+
let h1 = 3735928559;
|
|
778
|
+
let h2 = 1103547991;
|
|
779
|
+
for (let index = 0; index < input.length; index++) {
|
|
780
|
+
const ch = input.codePointAt(index);
|
|
781
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
782
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
783
|
+
}
|
|
784
|
+
h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);
|
|
785
|
+
h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
786
|
+
const hi = (h2 >>> 0).toString(16).padStart(8, "0");
|
|
787
|
+
const lo = (h1 >>> 0).toString(16).padStart(8, "0");
|
|
788
|
+
return `${hi}${lo}`.slice(0, 8);
|
|
789
|
+
}
|
|
790
|
+
function vectorPhysicalName(prefix, graphId, nodeKind, fieldPath) {
|
|
791
|
+
const readable = `${prefix}_${sanitizeIdentifierPart(graphId)}_${sanitizeIdentifierPart(nodeKind)}_${sanitizeIdentifierPart(fieldPath)}`;
|
|
792
|
+
const hash = shortHash(JSON.stringify([graphId, nodeKind, fieldPath]));
|
|
793
|
+
const full = `${readable}_${hash}`;
|
|
794
|
+
if (full.length <= MAX_VECTOR_IDENTIFIER_LENGTH) return full;
|
|
795
|
+
return `${readable.slice(0, MAX_VECTOR_IDENTIFIER_LENGTH - 1 - hash.length)}_${hash}`;
|
|
796
|
+
}
|
|
797
|
+
function quoteIdentifier2(name) {
|
|
798
|
+
return `"${name.replaceAll('"', '""')}"`;
|
|
799
|
+
}
|
|
743
800
|
|
|
744
801
|
// src/query/dialect/index.ts
|
|
745
802
|
var DIALECT_ADAPTERS = {
|
|
@@ -795,6 +852,20 @@ function compileEdgeIndexKeys(index, dialect, propsColumn, systemColumn) {
|
|
|
795
852
|
}
|
|
796
853
|
return { keys };
|
|
797
854
|
}
|
|
855
|
+
function compileNodeIndexFieldKeys(index, ctx) {
|
|
856
|
+
const adapter = getDialect(ctx.dialect);
|
|
857
|
+
const keys = [];
|
|
858
|
+
for (const [position, pointer] of index.fields.entries()) {
|
|
859
|
+
const extracted = compileIndexKeyValue(
|
|
860
|
+
adapter,
|
|
861
|
+
ctx.propsColumn,
|
|
862
|
+
pointer,
|
|
863
|
+
index.fieldValueTypes[position]
|
|
864
|
+
);
|
|
865
|
+
keys.push(sql`(${extracted})`);
|
|
866
|
+
}
|
|
867
|
+
return keys;
|
|
868
|
+
}
|
|
798
869
|
function compileIndexKeyValue(dialect, propsColumn, pointer, valueType) {
|
|
799
870
|
switch (valueType) {
|
|
800
871
|
case "number": {
|
|
@@ -983,7 +1054,7 @@ function generateEdgeIndexDDL(index, dialect, options = {}) {
|
|
|
983
1054
|
function generateTableIndexDDL(index, dialect, tableName, options) {
|
|
984
1055
|
const ifNotExists = options.ifNotExists ?? true;
|
|
985
1056
|
const propsColumn = sql.raw('"props"');
|
|
986
|
-
const systemColumn = (column) => sql.raw(
|
|
1057
|
+
const systemColumn = (column) => sql.raw(quoteIdentifier3(column));
|
|
987
1058
|
const keys = index.entity === "node" ? compileNodeIndexKeys(index, dialect, propsColumn, systemColumn).keys : compileEdgeIndexKeys(index, dialect, propsColumn, systemColumn).keys;
|
|
988
1059
|
const whereSql = index.where ? sqlToInlineString(
|
|
989
1060
|
compileIndexWhere(
|
|
@@ -1001,9 +1072,9 @@ function generateTableIndexDDL(index, dialect, tableName, options) {
|
|
|
1001
1072
|
const concurrent = options.concurrent === true && dialect === "postgres" ? "CONCURRENTLY " : "";
|
|
1002
1073
|
const ifNotExistsSql = ifNotExists ? "IF NOT EXISTS " : "";
|
|
1003
1074
|
const whereClause = whereSql ? ` WHERE ${whereSql}` : "";
|
|
1004
|
-
return `CREATE ${unique}INDEX ${concurrent}${ifNotExistsSql}${
|
|
1075
|
+
return `CREATE ${unique}INDEX ${concurrent}${ifNotExistsSql}${quoteIdentifier3(index.name)} ON ${quoteIdentifier3(tableName)} (${keySql})${whereClause};`;
|
|
1005
1076
|
}
|
|
1006
|
-
function
|
|
1077
|
+
function quoteIdentifier3(identifier) {
|
|
1007
1078
|
return `"${identifier.replaceAll('"', '""')}"`;
|
|
1008
1079
|
}
|
|
1009
1080
|
function sqlToInlineString(object, dialect) {
|
|
@@ -1364,6 +1435,6 @@ function notWhere(predicate) {
|
|
|
1364
1435
|
};
|
|
1365
1436
|
}
|
|
1366
1437
|
|
|
1367
|
-
export { BASE_CONTRIBUTION_OWNER, andWhere, buildFulltextCapabilities, buildPostgresEdgeIndexBuilders, buildPostgresNodeIndexBuilders, buildSqliteEdgeIndexBuilders, buildSqliteNodeIndexBuilders, edgeColumnList, fts5Strategy, generateEdgeIndexDDL, generateIndexDDL, generateNodeIndexDDL, getDialect, nodeColumnList, notWhere, orWhere, quotedColumn, quotedTableName, sqlNull, toDeclaredIndex, toDeclaredIndexes, tsvectorStrategy };
|
|
1368
|
-
//# sourceMappingURL=chunk-
|
|
1369
|
-
//# sourceMappingURL=chunk-
|
|
1438
|
+
export { BASE_CONTRIBUTION_OWNER, VECTOR_CONTRIBUTION_PREFIX, andWhere, assertFiniteEmbedding, assertVectorMinScore, assertVectorSearchLimit, buildFulltextCapabilities, buildPostgresEdgeIndexBuilders, buildPostgresNodeIndexBuilders, buildSqliteEdgeIndexBuilders, buildSqliteNodeIndexBuilders, buildVectorCapabilities, compileIndexWhere, compileNodeIndexFieldKeys, edgeColumnList, fts5Strategy, generateEdgeIndexDDL, generateIndexDDL, generateNodeIndexDDL, getDialect, nodeColumnList, notWhere, orWhere, quoteIdentifier2 as quoteIdentifier, quotedColumn, quotedTableName, sqlNull, toDeclaredIndex, toDeclaredIndexes, tsvectorStrategy, vectorMinScoreCondition, vectorPhysicalName, vectorScoreExpression };
|
|
1439
|
+
//# sourceMappingURL=chunk-AI3RNREM.js.map
|
|
1440
|
+
//# sourceMappingURL=chunk-AI3RNREM.js.map
|