@nicia-ai/typegraph 0.35.0 → 0.37.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 -24
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +11 -11
- package/dist/backend/postgres/pglite.cjs +16 -16
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +11 -11
- package/dist/backend/sqlite/index.cjs +22 -21
- package/dist/backend/sqlite/index.d.cts +11 -9
- package/dist/backend/sqlite/index.d.ts +11 -9
- package/dist/backend/sqlite/index.js +10 -9
- package/dist/backend/sqlite/libsql.cjs +15 -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 +11 -10
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +30 -23
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +18 -11
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-TCOCYN2P.cjs → chunk-27SSDCEP.cjs} +14 -14
- package/dist/{chunk-TCOCYN2P.cjs.map → chunk-27SSDCEP.cjs.map} +1 -1
- package/dist/{chunk-5AQIKK56.cjs → chunk-2N6EOBTH.cjs} +16 -16
- package/dist/{chunk-5AQIKK56.cjs.map → chunk-2N6EOBTH.cjs.map} +1 -1
- package/dist/{chunk-FN35DLCN.cjs → chunk-3C2RYI6L.cjs} +13 -107
- package/dist/chunk-3C2RYI6L.cjs.map +1 -0
- package/dist/{chunk-4JEZZJ6S.cjs → chunk-3DS7Z4T4.cjs} +39 -39
- package/dist/{chunk-4JEZZJ6S.cjs.map → chunk-3DS7Z4T4.cjs.map} +1 -1
- package/dist/{chunk-BLZDPRXT.cjs → chunk-3GH67G4Z.cjs} +5 -5
- package/dist/{chunk-BLZDPRXT.cjs.map → chunk-3GH67G4Z.cjs.map} +1 -1
- package/dist/{chunk-K3PPLHY7.js → chunk-3RWZPJKV.js} +24 -9
- package/dist/chunk-3RWZPJKV.js.map +1 -0
- package/dist/{chunk-QWEUYILR.js → chunk-3SLPDKHQ.js} +4 -4
- package/dist/chunk-3SLPDKHQ.js.map +1 -0
- package/dist/{chunk-5A6FNS6N.cjs → chunk-3XXGYU62.cjs} +11 -11
- package/dist/{chunk-5A6FNS6N.cjs.map → chunk-3XXGYU62.cjs.map} +1 -1
- package/dist/{chunk-JBTOYDMN.js → chunk-44TA22QT.js} +58 -11
- package/dist/chunk-44TA22QT.js.map +1 -0
- package/dist/{chunk-UES55P7G.js → chunk-552KNYQJ.js} +2652 -409
- package/dist/chunk-552KNYQJ.js.map +1 -0
- package/dist/{chunk-VPYHY3LJ.cjs → chunk-5KEQ74YU.cjs} +14 -14
- package/dist/chunk-5KEQ74YU.cjs.map +1 -0
- package/dist/{chunk-Q5TEXCTB.js → chunk-5KPNWT6X.js} +3 -3
- package/dist/{chunk-Q5TEXCTB.js.map → chunk-5KPNWT6X.js.map} +1 -1
- package/dist/{chunk-MP2JQKSG.js → chunk-5PNMDJ7J.js} +108 -5
- package/dist/chunk-5PNMDJ7J.js.map +1 -0
- package/dist/{chunk-AW4A3P5A.cjs → chunk-5VQM6VWP.cjs} +2 -2
- package/dist/{chunk-AW4A3P5A.cjs.map → chunk-5VQM6VWP.cjs.map} +1 -1
- package/dist/{chunk-A3W7QG7K.js → chunk-5WWVZMVX.js} +2 -2
- package/dist/{chunk-A3W7QG7K.js.map → chunk-5WWVZMVX.js.map} +1 -1
- package/dist/{chunk-FACJJWGF.cjs → chunk-6EEO3OVU.cjs} +7 -7
- package/dist/{chunk-FACJJWGF.cjs.map → chunk-6EEO3OVU.cjs.map} +1 -1
- package/dist/{chunk-LGEALRC6.cjs → chunk-BVRDGYXQ.cjs} +113 -4
- package/dist/chunk-BVRDGYXQ.cjs.map +1 -0
- package/dist/{chunk-GSQ6NPH6.cjs → chunk-DEFQM7JU.cjs} +7 -7
- package/dist/{chunk-GSQ6NPH6.cjs.map → chunk-DEFQM7JU.cjs.map} +1 -1
- package/dist/{chunk-EM3CWPND.cjs → chunk-DIQ3AV5W.cjs} +574 -268
- package/dist/chunk-DIQ3AV5W.cjs.map +1 -0
- package/dist/{chunk-FPIZFYHE.js → chunk-EXU3RASM.js} +74 -15
- package/dist/chunk-EXU3RASM.js.map +1 -0
- package/dist/{chunk-H7YNSMA7.cjs → chunk-HAHNRASW.cjs} +20 -2
- package/dist/chunk-HAHNRASW.cjs.map +1 -0
- package/dist/{chunk-FL472AMI.cjs → chunk-IP3CGGPA.cjs} +8 -8
- package/dist/{chunk-FL472AMI.cjs.map → chunk-IP3CGGPA.cjs.map} +1 -1
- package/dist/{chunk-4TOD4LBZ.cjs → chunk-IPSVVTWT.cjs} +94 -35
- package/dist/chunk-IPSVVTWT.cjs.map +1 -0
- package/dist/{chunk-RGP33ZJ5.js → chunk-IXGYRP2P.js} +184 -92
- package/dist/chunk-IXGYRP2P.js.map +1 -0
- package/dist/{chunk-3TWF3SH4.js → chunk-J4IUSYFF.js} +251 -121
- package/dist/chunk-J4IUSYFF.js.map +1 -0
- package/dist/{chunk-O7UN7OXA.cjs → chunk-JBNOGRKW.cjs} +318 -188
- package/dist/chunk-JBNOGRKW.cjs.map +1 -0
- package/dist/{chunk-WDBCBWC4.js → chunk-K3Q3LJY3.js} +520 -221
- package/dist/chunk-K3Q3LJY3.js.map +1 -0
- package/dist/{chunk-OR5ZA5WP.js → chunk-K5UBVGJN.js} +4 -4
- package/dist/{chunk-OR5ZA5WP.js.map → chunk-K5UBVGJN.js.map} +1 -1
- package/dist/{chunk-UZV3AZKF.js → chunk-KQJ54OG5.js} +3 -3
- package/dist/{chunk-UZV3AZKF.js.map → chunk-KQJ54OG5.js.map} +1 -1
- package/dist/{chunk-QOTI55H7.js → chunk-L7HQ2OSI.js} +4 -4
- package/dist/{chunk-QOTI55H7.js.map → chunk-L7HQ2OSI.js.map} +1 -1
- package/dist/{chunk-55MZDDZV.js → chunk-M6VES7V6.js} +4 -4
- package/dist/{chunk-55MZDDZV.js.map → chunk-M6VES7V6.js.map} +1 -1
- package/dist/{chunk-J7WFGBJR.cjs → chunk-NBP2WTJW.cjs} +3249 -1006
- package/dist/chunk-NBP2WTJW.cjs.map +1 -0
- package/dist/{chunk-CK5BVQOW.cjs → chunk-NUIG3BCV.cjs} +100 -85
- package/dist/chunk-NUIG3BCV.cjs.map +1 -0
- package/dist/{chunk-EMF62TZG.cjs → chunk-NXQFATMF.cjs} +269 -177
- package/dist/chunk-NXQFATMF.cjs.map +1 -0
- package/dist/{chunk-KBGQIPRQ.js → chunk-PC2UBAUB.js} +20 -3
- package/dist/chunk-PC2UBAUB.js.map +1 -0
- package/dist/chunk-QARBLBXT.cjs +219 -0
- package/dist/chunk-QARBLBXT.cjs.map +1 -0
- package/dist/{chunk-6FR2MMS6.js → chunk-QERAIDRJ.js} +45 -4
- package/dist/chunk-QERAIDRJ.js.map +1 -0
- package/dist/chunk-QSXTWU4U.cjs +12 -0
- package/dist/{chunk-GUR2FNB5.cjs.map → chunk-QSXTWU4U.cjs.map} +1 -1
- package/dist/{chunk-QNKSQTKQ.js → chunk-RCVLFTCT.js} +49 -19
- package/dist/chunk-RCVLFTCT.js.map +1 -0
- package/dist/{chunk-VSPCZAXF.js → chunk-RRSNR3TP.js} +3 -3
- package/dist/{chunk-VSPCZAXF.js.map → chunk-RRSNR3TP.js.map} +1 -1
- package/dist/{chunk-WJT7OU7E.cjs → chunk-TGOMW4MB.cjs} +129 -98
- package/dist/chunk-TGOMW4MB.cjs.map +1 -0
- package/dist/{chunk-KMI7LYAF.js → chunk-TKT2XHED.js} +8 -8
- package/dist/{chunk-KMI7LYAF.js.map → chunk-TKT2XHED.js.map} +1 -1
- package/dist/{chunk-RGPG7EOJ.js → chunk-TPF25IG6.js} +3 -3
- package/dist/{chunk-RGPG7EOJ.js.map → chunk-TPF25IG6.js.map} +1 -1
- package/dist/{chunk-5SEGFTZX.js → chunk-UGZUAYAR.js} +3 -3
- package/dist/{chunk-5SEGFTZX.js.map → chunk-UGZUAYAR.js.map} +1 -1
- package/dist/{chunk-VHMPG6UL.js → chunk-UXLSNRYL.js} +11 -105
- package/dist/chunk-UXLSNRYL.js.map +1 -0
- package/dist/{chunk-FRV5Q5IO.js → chunk-UYQMBBWJ.js} +3 -3
- package/dist/{chunk-FRV5Q5IO.js.map → chunk-UYQMBBWJ.js.map} +1 -1
- package/dist/{chunk-UUT7UN2N.cjs → chunk-VGDDG3XJ.cjs} +7 -7
- package/dist/{chunk-UUT7UN2N.cjs.map → chunk-VGDDG3XJ.cjs.map} +1 -1
- package/dist/{chunk-CZQ3FO2Q.js → chunk-VKGKDOKR.js} +56 -21
- package/dist/chunk-VKGKDOKR.js.map +1 -0
- package/dist/{chunk-CTTSDJLY.cjs → chunk-VL2V6PEN.cjs} +11 -11
- package/dist/{chunk-CTTSDJLY.cjs.map → chunk-VL2V6PEN.cjs.map} +1 -1
- package/dist/{chunk-XOX22WHL.cjs → chunk-WOJMKB3N.cjs} +125 -90
- package/dist/chunk-WOJMKB3N.cjs.map +1 -0
- package/dist/{chunk-UMDVATGY.cjs → chunk-WWFHO375.cjs} +6 -6
- package/dist/{chunk-UMDVATGY.cjs.map → chunk-WWFHO375.cjs.map} +1 -1
- package/dist/{chunk-I7ZUZKFD.js → chunk-XGPUQ56G.js} +3 -3
- package/dist/{chunk-I7ZUZKFD.js.map → chunk-XGPUQ56G.js.map} +1 -1
- package/dist/{chunk-D7ZEOS56.cjs → chunk-XGU7DZDA.cjs} +74 -14
- package/dist/chunk-XGU7DZDA.cjs.map +1 -0
- package/dist/{chunk-S55OV6PW.cjs → chunk-XPCZADMT.cjs} +54 -11
- package/dist/chunk-XPCZADMT.cjs.map +1 -0
- package/dist/{chunk-T2WUSPDA.js → chunk-XWV4JT34.js} +3 -3
- package/dist/{chunk-T2WUSPDA.js.map → chunk-XWV4JT34.js.map} +1 -1
- package/dist/chunk-YTSN73ND.js +212 -0
- package/dist/chunk-YTSN73ND.js.map +1 -0
- package/dist/{ddl-CZz7a0E8.d.cts → ddl-BD-ZfKeX.d.cts} +3 -3
- package/dist/{ddl-C2rZ-Aen.d.ts → ddl-CS0KUVwB.d.ts} +3 -3
- package/dist/{extension-types-ixRpJVUp.d.cts → extension-types-BM2ACfYO.d.cts} +6 -1
- package/dist/{extension-types-ixRpJVUp.d.ts → extension-types-BM2ACfYO.d.ts} +6 -1
- package/dist/{fulltext-strategy-CDkSSYhq.d.cts → fulltext-strategy-C27vXaeB.d.cts} +127 -8
- package/dist/{fulltext-strategy-B57yvC5Q.d.ts → fulltext-strategy-DebsMrqg.d.ts} +127 -8
- 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/graph-merge/index.cjs +88 -88
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +6 -6
- package/dist/graph-merge/index.d.ts +6 -6
- package/dist/graph-merge/index.js +19 -19
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-Bks_3HHK.d.cts → index-BPM59vsg.d.cts} +119 -7
- package/dist/{index-6CSUAq-x.d.ts → index-BeacbPoe.d.ts} +119 -7
- package/dist/index.cjs +230 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +53 -40
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +30 -21
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +8 -7
- package/dist/interchange/index.cjs +208 -30
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +25 -8
- package/dist/interchange/index.d.ts +25 -8
- package/dist/interchange/index.js +191 -11
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-DwQi8eV0.d.cts → manager-D00_NXvT.d.ts} +11 -2
- package/dist/{manager-ejUCB52T.d.ts → manager-nU1vTJLy.d.cts} +11 -2
- package/dist/{materialize-indexes-B4e9360H.d.cts → materialize-indexes-CuR3gAZb.d.cts} +8 -2
- package/dist/{materialize-indexes-te9TPMMJ.d.ts → materialize-indexes-zK2J_flP.d.ts} +8 -2
- package/dist/{postgres-DQ5R6rzV.d.ts → postgres-IaBA4RgE.d.ts} +1 -1
- package/dist/{postgres-CfEqsRMp.d.cts → postgres-YrYmPlaU.d.cts} +1 -1
- package/dist/profiler/index.cjs +3 -3
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +2 -2
- package/dist/provenance/index.cjs +32 -33
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +5 -5
- package/dist/provenance/index.d.ts +5 -5
- package/dist/provenance/index.js +5 -6
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +11 -11
- package/dist/{sqlite-DvQndLky.d.ts → sqlite-BUOHPx7p.d.ts} +1 -1
- package/dist/{sqlite-D7zBinNR.d.cts → sqlite-Pp8O19WE.d.cts} +1 -1
- package/dist/{store-view-CKbHFRnn.d.ts → store-view-ANL6mTph.d.ts} +457 -57
- package/dist/{store-view-BSpqvAxK.d.cts → store-view-X96Rd00T.d.cts} +457 -57
- package/dist/{types-Bv9DcS_E.d.cts → types-r-Zyq2Hz.d.cts} +2 -2
- package/dist/{types-CoxuV7EJ.d.ts → types-wsvuBgPK.d.ts} +2 -2
- package/dist/where-CJOpJj3a.d.ts +36 -0
- package/dist/where-K3uBP33l.d.cts +36 -0
- package/package.json +1 -1
- package/dist/chunk-3TWF3SH4.js.map +0 -1
- package/dist/chunk-4TOD4LBZ.cjs.map +0 -1
- package/dist/chunk-6FR2MMS6.js.map +0 -1
- package/dist/chunk-CK5BVQOW.cjs.map +0 -1
- package/dist/chunk-CZQ3FO2Q.js.map +0 -1
- package/dist/chunk-D7ZEOS56.cjs.map +0 -1
- package/dist/chunk-EM3CWPND.cjs.map +0 -1
- package/dist/chunk-EMF62TZG.cjs.map +0 -1
- package/dist/chunk-EOLERH7Y.cjs +0 -40
- package/dist/chunk-EOLERH7Y.cjs.map +0 -1
- package/dist/chunk-FN35DLCN.cjs.map +0 -1
- package/dist/chunk-FPIZFYHE.js.map +0 -1
- package/dist/chunk-GUR2FNB5.cjs +0 -12
- package/dist/chunk-H7YNSMA7.cjs.map +0 -1
- package/dist/chunk-J7WFGBJR.cjs.map +0 -1
- package/dist/chunk-JBTOYDMN.js.map +0 -1
- package/dist/chunk-K3PPLHY7.js.map +0 -1
- package/dist/chunk-KBGQIPRQ.js.map +0 -1
- package/dist/chunk-LGEALRC6.cjs.map +0 -1
- package/dist/chunk-MP2JQKSG.js.map +0 -1
- package/dist/chunk-O7UN7OXA.cjs.map +0 -1
- package/dist/chunk-QNKSQTKQ.js.map +0 -1
- package/dist/chunk-QWEUYILR.js.map +0 -1
- package/dist/chunk-RGP33ZJ5.js.map +0 -1
- package/dist/chunk-S55OV6PW.cjs.map +0 -1
- package/dist/chunk-UES55P7G.js.map +0 -1
- package/dist/chunk-UT3S4SEN.js +0 -31
- package/dist/chunk-UT3S4SEN.js.map +0 -1
- package/dist/chunk-VHMPG6UL.js.map +0 -1
- package/dist/chunk-VPYHY3LJ.cjs.map +0 -1
- package/dist/chunk-WDBCBWC4.js.map +0 -1
- package/dist/chunk-WJT7OU7E.cjs.map +0 -1
- package/dist/chunk-XOX22WHL.cjs.map +0 -1
- package/dist/where-7RKFOsXt.d.ts +0 -11
- package/dist/where-DdMIXOtH.d.cts +0 -11
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunk5KEQ74YU_cjs = require('./chunk-5KEQ74YU.cjs');
|
|
3
4
|
var chunkACSVZPK7_cjs = require('./chunk-ACSVZPK7.cjs');
|
|
4
|
-
var
|
|
5
|
-
var chunkUUT7UN2N_cjs = require('./chunk-UUT7UN2N.cjs');
|
|
5
|
+
var chunkVGDDG3XJ_cjs = require('./chunk-VGDDG3XJ.cjs');
|
|
6
6
|
var chunkTEDRJXOG_cjs = require('./chunk-TEDRJXOG.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
7
|
+
var chunkIP3CGGPA_cjs = require('./chunk-IP3CGGPA.cjs');
|
|
8
|
+
var chunkDEFQM7JU_cjs = require('./chunk-DEFQM7JU.cjs');
|
|
9
|
+
var chunk3GH67G4Z_cjs = require('./chunk-3GH67G4Z.cjs');
|
|
10
|
+
var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
|
|
11
11
|
var chunkDI74SMXS_cjs = require('./chunk-DI74SMXS.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunkBVRDGYXQ_cjs = require('./chunk-BVRDGYXQ.cjs');
|
|
13
13
|
var zod = require('zod');
|
|
14
14
|
|
|
15
15
|
// src/core/node.ts
|
|
16
16
|
function validateSchemaKeys(schema, name) {
|
|
17
|
-
|
|
17
|
+
chunkDEFQM7JU_cjs.assertSchemaKeysAreFree(
|
|
18
18
|
"Node",
|
|
19
19
|
name,
|
|
20
20
|
Object.keys(schema.shape),
|
|
21
|
-
|
|
21
|
+
chunkDEFQM7JU_cjs.RESERVED_NODE_KEYS
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
function defineNode(name, options) {
|
|
25
25
|
validateSchemaKeys(options.schema, name);
|
|
26
26
|
if (options.annotations !== void 0) {
|
|
27
|
-
|
|
27
|
+
chunkIP3CGGPA_cjs.assertJsonValue(options.annotations, "annotations", `Node "${name}"`);
|
|
28
28
|
}
|
|
29
29
|
return Object.freeze({
|
|
30
|
-
[
|
|
30
|
+
[chunk5KEQ74YU_cjs.NODE_TYPE_BRAND]: true,
|
|
31
31
|
kind: name,
|
|
32
32
|
schema: options.schema,
|
|
33
33
|
description: options.description,
|
|
@@ -36,21 +36,21 @@ function defineNode(name, options) {
|
|
|
36
36
|
}
|
|
37
37
|
var EMPTY_SCHEMA = zod.z.object({});
|
|
38
38
|
function validateSchemaKeys2(schema, name) {
|
|
39
|
-
|
|
39
|
+
chunkDEFQM7JU_cjs.assertSchemaKeysAreFree(
|
|
40
40
|
"Edge",
|
|
41
41
|
name,
|
|
42
42
|
Object.keys(schema.shape),
|
|
43
|
-
|
|
43
|
+
chunkDEFQM7JU_cjs.RESERVED_EDGE_KEYS
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
function defineEdge(name, options) {
|
|
47
47
|
const schema = options?.schema ?? EMPTY_SCHEMA;
|
|
48
48
|
validateSchemaKeys2(schema, name);
|
|
49
49
|
if (options?.annotations !== void 0) {
|
|
50
|
-
|
|
50
|
+
chunkIP3CGGPA_cjs.assertJsonValue(options.annotations, "annotations", `Edge "${name}"`);
|
|
51
51
|
}
|
|
52
52
|
return Object.freeze({
|
|
53
|
-
[
|
|
53
|
+
[chunk5KEQ74YU_cjs.EDGE_TYPE_BRAND]: true,
|
|
54
54
|
kind: name,
|
|
55
55
|
schema,
|
|
56
56
|
description: options?.description,
|
|
@@ -87,7 +87,7 @@ function createMetaEdge(name, properties) {
|
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
var subClassOfMetaEdge = createMetaEdge(
|
|
90
|
+
var subClassOfMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_SUB_CLASS_OF, {
|
|
91
91
|
transitive: true,
|
|
92
92
|
inference: "subsumption",
|
|
93
93
|
description: "Type inheritance (Podcast subClassOf Media)"
|
|
@@ -99,9 +99,9 @@ function subClassOf(child, parent) {
|
|
|
99
99
|
to: parent
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
var broaderMetaEdge = createMetaEdge(
|
|
102
|
+
var broaderMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_BROADER, {
|
|
103
103
|
transitive: true,
|
|
104
|
-
inverse:
|
|
104
|
+
inverse: chunkIP3CGGPA_cjs.META_EDGE_NARROWER,
|
|
105
105
|
inference: "hierarchy",
|
|
106
106
|
description: "Broader concept (ML broader AI)"
|
|
107
107
|
});
|
|
@@ -112,9 +112,9 @@ function broader(narrowerConcept, broaderConcept) {
|
|
|
112
112
|
to: broaderConcept
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
var narrowerMetaEdge = createMetaEdge(
|
|
115
|
+
var narrowerMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_NARROWER, {
|
|
116
116
|
transitive: true,
|
|
117
|
-
inverse:
|
|
117
|
+
inverse: chunkIP3CGGPA_cjs.META_EDGE_BROADER,
|
|
118
118
|
inference: "hierarchy",
|
|
119
119
|
description: "Narrower concept (AI narrower ML)"
|
|
120
120
|
});
|
|
@@ -125,7 +125,7 @@ function narrower(broaderConcept, narrowerConcept) {
|
|
|
125
125
|
to: narrowerConcept
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
var relatedToMetaEdge = createMetaEdge(
|
|
128
|
+
var relatedToMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_RELATED_TO, {
|
|
129
129
|
symmetric: true,
|
|
130
130
|
inference: "association",
|
|
131
131
|
description: "Non-hierarchical association"
|
|
@@ -137,7 +137,7 @@ function relatedTo(conceptA, conceptB) {
|
|
|
137
137
|
to: conceptB
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
-
var equivalentToMetaEdge = createMetaEdge(
|
|
140
|
+
var equivalentToMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_EQUIVALENT_TO, {
|
|
141
141
|
symmetric: true,
|
|
142
142
|
transitive: true,
|
|
143
143
|
inference: "substitution",
|
|
@@ -150,7 +150,7 @@ function equivalentTo(kindA, kindBOrIri) {
|
|
|
150
150
|
to: kindBOrIri
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
var sameAsMetaEdge = createMetaEdge(
|
|
153
|
+
var sameAsMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_SAME_AS, {
|
|
154
154
|
symmetric: true,
|
|
155
155
|
transitive: true,
|
|
156
156
|
inference: "substitution",
|
|
@@ -163,7 +163,7 @@ function sameAs(kindA, kindBOrIri) {
|
|
|
163
163
|
to: kindBOrIri
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
var differentFromMetaEdge = createMetaEdge(
|
|
166
|
+
var differentFromMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_DIFFERENT_FROM, {
|
|
167
167
|
symmetric: true,
|
|
168
168
|
inference: "constraint",
|
|
169
169
|
description: "Explicitly different individuals"
|
|
@@ -175,7 +175,7 @@ function differentFrom(kindA, kindB) {
|
|
|
175
175
|
to: kindB
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
var disjointWithMetaEdge = createMetaEdge(
|
|
178
|
+
var disjointWithMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_DISJOINT_WITH, {
|
|
179
179
|
symmetric: true,
|
|
180
180
|
inference: "constraint",
|
|
181
181
|
description: "Mutually exclusive types"
|
|
@@ -187,9 +187,9 @@ function disjointWith(kindA, kindB) {
|
|
|
187
187
|
to: kindB
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
var partOfMetaEdge = createMetaEdge(
|
|
190
|
+
var partOfMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_PART_OF, {
|
|
191
191
|
transitive: true,
|
|
192
|
-
inverse:
|
|
192
|
+
inverse: chunkIP3CGGPA_cjs.META_EDGE_HAS_PART,
|
|
193
193
|
inference: "composition",
|
|
194
194
|
description: "X is part of Y"
|
|
195
195
|
});
|
|
@@ -200,9 +200,9 @@ function partOf(part, whole) {
|
|
|
200
200
|
to: whole
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
var hasPartMetaEdge = createMetaEdge(
|
|
203
|
+
var hasPartMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_HAS_PART, {
|
|
204
204
|
transitive: true,
|
|
205
|
-
inverse:
|
|
205
|
+
inverse: chunkIP3CGGPA_cjs.META_EDGE_PART_OF,
|
|
206
206
|
inference: "composition",
|
|
207
207
|
description: "Y has part X"
|
|
208
208
|
});
|
|
@@ -213,12 +213,12 @@ function hasPart(whole, part) {
|
|
|
213
213
|
to: part
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
var inverseOfMetaEdge = createMetaEdge(
|
|
216
|
+
var inverseOfMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_INVERSE_OF, {
|
|
217
217
|
symmetric: true,
|
|
218
218
|
inference: "none",
|
|
219
219
|
description: "Edge A is inverse of edge B"
|
|
220
220
|
});
|
|
221
|
-
var impliesMetaEdge = createMetaEdge(
|
|
221
|
+
var impliesMetaEdge = createMetaEdge(chunkIP3CGGPA_cjs.META_EDGE_IMPLIES, {
|
|
222
222
|
transitive: true,
|
|
223
223
|
inference: "none",
|
|
224
224
|
description: "Edge A implies edge B exists"
|
|
@@ -872,7 +872,7 @@ var KindRegistry = class {
|
|
|
872
872
|
* Checks if child is a subclass of parent (directly or transitively).
|
|
873
873
|
*/
|
|
874
874
|
isSubClassOf(child, parent) {
|
|
875
|
-
return
|
|
875
|
+
return chunkIP3CGGPA_cjs.isReachable(this.subClassAncestors, child, parent);
|
|
876
876
|
}
|
|
877
877
|
/**
|
|
878
878
|
* Expands a kind to include all its subclasses.
|
|
@@ -899,13 +899,13 @@ var KindRegistry = class {
|
|
|
899
899
|
* Checks if narrowerConcept is narrower than broaderConcept.
|
|
900
900
|
*/
|
|
901
901
|
isNarrowerThan(narrowerConcept, broaderConcept) {
|
|
902
|
-
return
|
|
902
|
+
return chunkIP3CGGPA_cjs.isReachable(this.broaderClosure, narrowerConcept, broaderConcept);
|
|
903
903
|
}
|
|
904
904
|
/**
|
|
905
905
|
* Checks if broaderConcept is broader than narrowerConcept.
|
|
906
906
|
*/
|
|
907
907
|
isBroaderThan(broaderConcept, narrowerConcept) {
|
|
908
|
-
return
|
|
908
|
+
return chunkIP3CGGPA_cjs.isReachable(this.narrowerClosure, broaderConcept, narrowerConcept);
|
|
909
909
|
}
|
|
910
910
|
/**
|
|
911
911
|
* Expands to include all narrower concepts.
|
|
@@ -969,7 +969,7 @@ var KindRegistry = class {
|
|
|
969
969
|
* Checks if part is part of whole (directly or transitively).
|
|
970
970
|
*/
|
|
971
971
|
isPartOf(part, whole) {
|
|
972
|
-
return
|
|
972
|
+
return chunkIP3CGGPA_cjs.isReachable(this.partOfClosure, part, whole);
|
|
973
973
|
}
|
|
974
974
|
/**
|
|
975
975
|
* Gets all wholes that contain this part.
|
|
@@ -1091,57 +1091,57 @@ function computeClosuresFromOntology(ontology) {
|
|
|
1091
1091
|
const fromName = getKindName(relation.from);
|
|
1092
1092
|
const toName = getKindName(relation.to);
|
|
1093
1093
|
switch (relation.metaEdge.name) {
|
|
1094
|
-
case
|
|
1094
|
+
case chunkIP3CGGPA_cjs.META_EDGE_SUB_CLASS_OF: {
|
|
1095
1095
|
subClassRelations.push([fromName, toName]);
|
|
1096
1096
|
break;
|
|
1097
1097
|
}
|
|
1098
|
-
case
|
|
1098
|
+
case chunkIP3CGGPA_cjs.META_EDGE_BROADER: {
|
|
1099
1099
|
broaderRelations.push([fromName, toName]);
|
|
1100
1100
|
break;
|
|
1101
1101
|
}
|
|
1102
|
-
case
|
|
1102
|
+
case chunkIP3CGGPA_cjs.META_EDGE_NARROWER: {
|
|
1103
1103
|
broaderRelations.push([toName, fromName]);
|
|
1104
1104
|
break;
|
|
1105
1105
|
}
|
|
1106
|
-
case
|
|
1107
|
-
case
|
|
1106
|
+
case chunkIP3CGGPA_cjs.META_EDGE_EQUIVALENT_TO:
|
|
1107
|
+
case chunkIP3CGGPA_cjs.META_EDGE_SAME_AS: {
|
|
1108
1108
|
equivalentRelations.push([fromName, toName]);
|
|
1109
1109
|
break;
|
|
1110
1110
|
}
|
|
1111
|
-
case
|
|
1111
|
+
case chunkIP3CGGPA_cjs.META_EDGE_DISJOINT_WITH: {
|
|
1112
1112
|
disjointRelations.push([fromName, toName]);
|
|
1113
1113
|
break;
|
|
1114
1114
|
}
|
|
1115
|
-
case
|
|
1115
|
+
case chunkIP3CGGPA_cjs.META_EDGE_PART_OF: {
|
|
1116
1116
|
partOfRelations.push([fromName, toName]);
|
|
1117
1117
|
break;
|
|
1118
1118
|
}
|
|
1119
|
-
case
|
|
1119
|
+
case chunkIP3CGGPA_cjs.META_EDGE_HAS_PART: {
|
|
1120
1120
|
partOfRelations.push([toName, fromName]);
|
|
1121
1121
|
break;
|
|
1122
1122
|
}
|
|
1123
|
-
case
|
|
1123
|
+
case chunkIP3CGGPA_cjs.META_EDGE_INVERSE_OF: {
|
|
1124
1124
|
inverseOfRelations.push([fromName, toName]);
|
|
1125
1125
|
break;
|
|
1126
1126
|
}
|
|
1127
|
-
case
|
|
1127
|
+
case chunkIP3CGGPA_cjs.META_EDGE_IMPLIES: {
|
|
1128
1128
|
impliesRelations.push([fromName, toName]);
|
|
1129
1129
|
break;
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
|
-
const subClassAncestors =
|
|
1134
|
-
const subClassDescendants =
|
|
1135
|
-
const broaderClosure =
|
|
1136
|
-
const narrowerClosure =
|
|
1133
|
+
const subClassAncestors = chunkIP3CGGPA_cjs.computeTransitiveClosure(subClassRelations);
|
|
1134
|
+
const subClassDescendants = chunkIP3CGGPA_cjs.invertClosure(subClassAncestors);
|
|
1135
|
+
const broaderClosure = chunkIP3CGGPA_cjs.computeTransitiveClosure(broaderRelations);
|
|
1136
|
+
const narrowerClosure = chunkIP3CGGPA_cjs.invertClosure(broaderClosure);
|
|
1137
1137
|
const equivalenceSets = computeEquivalenceSets(equivalentRelations);
|
|
1138
1138
|
const iriToKind = computeIriMapping(equivalentRelations);
|
|
1139
1139
|
const disjointPairs = computeDisjointPairs(disjointRelations);
|
|
1140
|
-
const partOfClosure =
|
|
1141
|
-
const hasPartClosure =
|
|
1140
|
+
const partOfClosure = chunkIP3CGGPA_cjs.computeTransitiveClosure(partOfRelations);
|
|
1141
|
+
const hasPartClosure = chunkIP3CGGPA_cjs.invertClosure(partOfClosure);
|
|
1142
1142
|
const edgeInverses = computeEdgeInverses(inverseOfRelations);
|
|
1143
|
-
const edgeImplicationsClosure =
|
|
1144
|
-
const edgeImplyingClosure =
|
|
1143
|
+
const edgeImplicationsClosure = chunkIP3CGGPA_cjs.computeTransitiveClosure(impliesRelations);
|
|
1144
|
+
const edgeImplyingClosure = chunkIP3CGGPA_cjs.invertClosure(edgeImplicationsClosure);
|
|
1145
1145
|
return {
|
|
1146
1146
|
subClassAncestors,
|
|
1147
1147
|
subClassDescendants,
|
|
@@ -1245,7 +1245,7 @@ function serializeSchema(graph, version) {
|
|
|
1245
1245
|
return {
|
|
1246
1246
|
graphId: graph.id,
|
|
1247
1247
|
version,
|
|
1248
|
-
generatedAt:
|
|
1248
|
+
generatedAt: chunk3GH67G4Z_cjs.nowIso(),
|
|
1249
1249
|
nodes,
|
|
1250
1250
|
edges,
|
|
1251
1251
|
ontology,
|
|
@@ -1276,7 +1276,7 @@ function serializeDeprecatedKinds(set) {
|
|
|
1276
1276
|
function canonicalExtension(document) {
|
|
1277
1277
|
if (document === void 0) return void 0;
|
|
1278
1278
|
if (document.version === void 0) return document;
|
|
1279
|
-
if (document.version !==
|
|
1279
|
+
if (document.version !== chunkIP3CGGPA_cjs.LEGACY_GRAPH_EXTENSION_VERSION) return document;
|
|
1280
1280
|
const { version: _omit, ...rest } = document;
|
|
1281
1281
|
return rest;
|
|
1282
1282
|
}
|
|
@@ -1362,7 +1362,7 @@ function serializeEdgeIndexDeclaration(declaration) {
|
|
|
1362
1362
|
}
|
|
1363
1363
|
function serializeNodes(graph) {
|
|
1364
1364
|
const result = {};
|
|
1365
|
-
for (const kindName of
|
|
1365
|
+
for (const kindName of chunk5KEQ74YU_cjs.getNodeKinds(graph)) {
|
|
1366
1366
|
const registration = graph.nodes[kindName];
|
|
1367
1367
|
if (registration === void 0) continue;
|
|
1368
1368
|
result[kindName] = serializeNodeDef(registration);
|
|
@@ -1430,7 +1430,7 @@ function deserializeWherePredicate(serialized) {
|
|
|
1430
1430
|
}
|
|
1431
1431
|
function serializeEdges(graph) {
|
|
1432
1432
|
const result = {};
|
|
1433
|
-
for (const kindName of
|
|
1433
|
+
for (const kindName of chunk5KEQ74YU_cjs.getEdgeKinds(graph)) {
|
|
1434
1434
|
const registration = graph.edges[kindName];
|
|
1435
1435
|
if (registration === void 0) continue;
|
|
1436
1436
|
result[kindName] = serializeEdgeDef(registration);
|
|
@@ -1691,7 +1691,7 @@ function compileProperty(property) {
|
|
|
1691
1691
|
}
|
|
1692
1692
|
function compileStringProperty(property) {
|
|
1693
1693
|
if (property.searchable !== void 0) {
|
|
1694
|
-
return applyStringRefinements(
|
|
1694
|
+
return applyStringRefinements(chunkHAHNRASW_cjs.searchable(property.searchable), property);
|
|
1695
1695
|
}
|
|
1696
1696
|
if (property.format === void 0) {
|
|
1697
1697
|
return applyStringRefinements(zod.z.string(), property);
|
|
@@ -1741,7 +1741,7 @@ function compileEnumProperty(property) {
|
|
|
1741
1741
|
}
|
|
1742
1742
|
function compileArrayProperty(property) {
|
|
1743
1743
|
if (property.embedding !== void 0) {
|
|
1744
|
-
return
|
|
1744
|
+
return chunkHAHNRASW_cjs.embedding(property.embedding.dimensions);
|
|
1745
1745
|
}
|
|
1746
1746
|
const inner = compilePropertyForArrayItem(property.items);
|
|
1747
1747
|
return zod.z.array(inner);
|
|
@@ -1781,7 +1781,7 @@ function makeWherePredicate(field, op) {
|
|
|
1781
1781
|
};
|
|
1782
1782
|
}
|
|
1783
1783
|
var META_EDGE_BY_NAME = Object.fromEntries(
|
|
1784
|
-
|
|
1784
|
+
chunkIP3CGGPA_cjs.ALL_META_EDGE_NAMES.map((name) => [name, core[`${name}MetaEdge`]])
|
|
1785
1785
|
);
|
|
1786
1786
|
function compileOntologyRelation(relation, nodeTypeByName) {
|
|
1787
1787
|
const metaEdge = META_EDGE_BY_NAME[relation.metaEdge];
|
|
@@ -1820,7 +1820,7 @@ function mergeGraphExtension(graph, document) {
|
|
|
1820
1820
|
if (graph.extension !== void 0 && chunkACSVZPK7_cjs.canonicalEqual(unionDocument, existingDocument)) {
|
|
1821
1821
|
return graph;
|
|
1822
1822
|
}
|
|
1823
|
-
const validatedUnion =
|
|
1823
|
+
const validatedUnion = chunkIP3CGGPA_cjs.unwrap(chunkIP3CGGPA_cjs.validateGraphExtension(unionDocument));
|
|
1824
1824
|
const compiled = compileGraphExtension(validatedUnion);
|
|
1825
1825
|
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = extensionKindNames(existingDocument);
|
|
1826
1826
|
const nodeKinds = /* @__PURE__ */ new Map();
|
|
@@ -1922,7 +1922,7 @@ function deriveGraphExtensionVectorIndexes(compiledNodes) {
|
|
|
1922
1922
|
...compiled.unique.length === 0 ? {} : { unique: [...compiled.unique] }
|
|
1923
1923
|
};
|
|
1924
1924
|
}
|
|
1925
|
-
return
|
|
1925
|
+
return chunk5KEQ74YU_cjs.autoDeriveVectorIndexes(registrations).map(
|
|
1926
1926
|
(index) => Object.freeze({ ...index, origin: "runtime" })
|
|
1927
1927
|
);
|
|
1928
1928
|
}
|
|
@@ -1940,7 +1940,7 @@ function mergeIndexesWithGraphExtension(existing, runtimeIndexes, graphId) {
|
|
|
1940
1940
|
const runtimeRelational = runtimeIndexes.filter(
|
|
1941
1941
|
(index) => index.entity !== "vector"
|
|
1942
1942
|
);
|
|
1943
|
-
const vectorMerged =
|
|
1943
|
+
const vectorMerged = chunk5KEQ74YU_cjs.mergeVectorIndexes(compileTimeIndexes, runtimeVectors);
|
|
1944
1944
|
const merged = [...vectorMerged, ...runtimeRelational];
|
|
1945
1945
|
assertUniqueIndexNames(merged, graphId);
|
|
1946
1946
|
return merged;
|
|
@@ -1952,7 +1952,7 @@ function assertUniqueIndexNames(indexes, graphId) {
|
|
|
1952
1952
|
seen.add(index.name);
|
|
1953
1953
|
continue;
|
|
1954
1954
|
}
|
|
1955
|
-
throw new
|
|
1955
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
1956
1956
|
`Duplicate index name "${index.name}" after merging graph extension into graph "${graphId}". Index names must be unique within a graph.`,
|
|
1957
1957
|
{ graphId, indexName: index.name, code: "DUPLICATE_INDEX_NAME" },
|
|
1958
1958
|
{
|
|
@@ -1968,12 +1968,12 @@ function compileGraphExtensionRelationalIndexes(documents, nodeKinds, mergedEdge
|
|
|
1968
1968
|
if (document.entity === "node") {
|
|
1969
1969
|
const node = nodeKinds.get(document.kind);
|
|
1970
1970
|
if (node === void 0) {
|
|
1971
|
-
throw new
|
|
1971
|
+
throw new chunkBVRDGYXQ_cjs.KindNotFoundError(document.kind, "node", {
|
|
1972
1972
|
graphId,
|
|
1973
1973
|
suggestion: "Declare the kind under `nodes` in this graph extension, or remove the index from `indexes`."
|
|
1974
1974
|
});
|
|
1975
1975
|
}
|
|
1976
|
-
const declaration2 =
|
|
1976
|
+
const declaration2 = chunkVGDDG3XJ_cjs.defineNodeIndex(
|
|
1977
1977
|
node,
|
|
1978
1978
|
toNodeIndexConfig(document)
|
|
1979
1979
|
);
|
|
@@ -1982,12 +1982,12 @@ function compileGraphExtensionRelationalIndexes(documents, nodeKinds, mergedEdge
|
|
|
1982
1982
|
}
|
|
1983
1983
|
const edgeRegistration = mergedEdges[document.kind];
|
|
1984
1984
|
if (edgeRegistration === void 0) {
|
|
1985
|
-
throw new
|
|
1985
|
+
throw new chunkBVRDGYXQ_cjs.KindNotFoundError(document.kind, "edge", {
|
|
1986
1986
|
graphId,
|
|
1987
1987
|
suggestion: "Declare the edge under `edges` in this graph extension, or remove the index from `indexes`."
|
|
1988
1988
|
});
|
|
1989
1989
|
}
|
|
1990
|
-
const declaration =
|
|
1990
|
+
const declaration = chunkVGDDG3XJ_cjs.defineEdgeIndex(
|
|
1991
1991
|
edgeRegistration.type,
|
|
1992
1992
|
toEdgeIndexConfig(document)
|
|
1993
1993
|
);
|
|
@@ -1999,7 +1999,7 @@ function buildWhereCallback(where) {
|
|
|
1999
1999
|
return (props) => {
|
|
2000
2000
|
const builder = props[where.field];
|
|
2001
2001
|
if (builder === void 0) {
|
|
2002
|
-
throw new
|
|
2002
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
2003
2003
|
`Graph-extension index \`where\` references unknown field "${where.field}".`,
|
|
2004
2004
|
{ field: where.field, code: "EXTENSION_INDEX_WHERE_UNKNOWN_FIELD" }
|
|
2005
2005
|
);
|
|
@@ -2074,14 +2074,14 @@ function isEmptyExtension(extension) {
|
|
|
2074
2074
|
}
|
|
2075
2075
|
function assertNoCollision(kindName, entity, collides, graphId) {
|
|
2076
2076
|
if (!collides) return;
|
|
2077
|
-
throw new
|
|
2077
|
+
throw new chunkIP3CGGPA_cjs.KindCollisionError(kindName, entity, graphId);
|
|
2078
2078
|
}
|
|
2079
2079
|
function resolveEndpoints(entries, nodeKinds, context) {
|
|
2080
2080
|
return entries.map((entry) => {
|
|
2081
2081
|
if (typeof entry !== "string") return entry;
|
|
2082
2082
|
const resolved = nodeKinds.get(entry);
|
|
2083
2083
|
if (resolved === void 0) {
|
|
2084
|
-
throw new
|
|
2084
|
+
throw new chunkIP3CGGPA_cjs.GraphExtensionUnresolvedEndpointError(
|
|
2085
2085
|
context.edgeKind,
|
|
2086
2086
|
context.side,
|
|
2087
2087
|
entry,
|
|
@@ -2130,10 +2130,10 @@ function assertEndpointCompatible(side, implyingEdgeKind, implyingKinds, implied
|
|
|
2130
2130
|
(kind) => !registry.isAssignableToAny(kind, impliedKinds)
|
|
2131
2131
|
);
|
|
2132
2132
|
if (incompatibleKinds.length === 0) return;
|
|
2133
|
-
throw new
|
|
2133
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
2134
2134
|
`implies("${implyingEdgeKind}", "${impliedEdgeKind}") is endpoint-incompatible: ${side} kind(s) [${incompatibleKinds.join(", ")}] declared on "${implyingEdgeKind}" cannot be assigned to any of "${impliedEdgeKind}"'s ${side} kind(s) [${impliedKinds.join(", ")}].`,
|
|
2135
2135
|
{
|
|
2136
|
-
metaEdge:
|
|
2136
|
+
metaEdge: chunkIP3CGGPA_cjs.META_EDGE_IMPLIES,
|
|
2137
2137
|
implyingEdge: implyingEdgeKind,
|
|
2138
2138
|
impliedEdge: impliedEdgeKind,
|
|
2139
2139
|
endpoint: side,
|
|
@@ -2170,7 +2170,7 @@ function buildEdgeEndpointKinds(edges) {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
function extractNodeTypes(graph) {
|
|
2172
2172
|
const result = /* @__PURE__ */ new Map();
|
|
2173
|
-
for (const typeName of
|
|
2173
|
+
for (const typeName of chunk5KEQ74YU_cjs.getNodeKinds(graph)) {
|
|
2174
2174
|
const registration = graph.nodes[typeName];
|
|
2175
2175
|
result.set(typeName, registration.type);
|
|
2176
2176
|
}
|
|
@@ -2178,7 +2178,7 @@ function extractNodeTypes(graph) {
|
|
|
2178
2178
|
}
|
|
2179
2179
|
function extractEdgeTypes(graph) {
|
|
2180
2180
|
const result = /* @__PURE__ */ new Map();
|
|
2181
|
-
for (const typeName of
|
|
2181
|
+
for (const typeName of chunk5KEQ74YU_cjs.getEdgeKinds(graph)) {
|
|
2182
2182
|
const registration = graph.edges[typeName];
|
|
2183
2183
|
result.set(typeName, registration.type);
|
|
2184
2184
|
}
|
|
@@ -2526,7 +2526,7 @@ function parseSerializedSchema(json) {
|
|
|
2526
2526
|
try {
|
|
2527
2527
|
parsed = JSON.parse(json);
|
|
2528
2528
|
} catch {
|
|
2529
|
-
throw new
|
|
2529
|
+
throw new chunkBVRDGYXQ_cjs.DatabaseOperationError(
|
|
2530
2530
|
"Stored schema document is not valid JSON",
|
|
2531
2531
|
{ operation: "select", entity: "schema" }
|
|
2532
2532
|
);
|
|
@@ -2534,7 +2534,7 @@ function parseSerializedSchema(json) {
|
|
|
2534
2534
|
const result = serializedSchemaZod.safeParse(parsed);
|
|
2535
2535
|
if (!result.success) {
|
|
2536
2536
|
const issues = result.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ");
|
|
2537
|
-
throw new
|
|
2537
|
+
throw new chunkBVRDGYXQ_cjs.DatabaseOperationError(
|
|
2538
2538
|
`Stored schema document is malformed: ${issues}`,
|
|
2539
2539
|
{ operation: "select", entity: "schema" }
|
|
2540
2540
|
);
|
|
@@ -2551,7 +2551,7 @@ async function loadActiveSchemaWithBootstrap(backend, graphId) {
|
|
|
2551
2551
|
try {
|
|
2552
2552
|
return await backend.getActiveSchema(graphId);
|
|
2553
2553
|
} catch (error) {
|
|
2554
|
-
if (backend.bootstrapTables &&
|
|
2554
|
+
if (backend.bootstrapTables && chunk3GH67G4Z_cjs.isMissingTableError(error)) {
|
|
2555
2555
|
await backend.bootstrapTables();
|
|
2556
2556
|
return await backend.getActiveSchema(graphId);
|
|
2557
2557
|
}
|
|
@@ -2645,7 +2645,7 @@ async function ensureSchema(backend, graph, options) {
|
|
|
2645
2645
|
}
|
|
2646
2646
|
const actions = getMigrationActions(diff);
|
|
2647
2647
|
if (throwOnBreaking) {
|
|
2648
|
-
throw new
|
|
2648
|
+
throw new chunkBVRDGYXQ_cjs.MigrationError(
|
|
2649
2649
|
`Schema migration required: ${diff.summary}. ${actions.length} migration action(s) needed. Use getSchemaChanges() to review, then migrateSchema() to apply.`,
|
|
2650
2650
|
{
|
|
2651
2651
|
graphId: graph.id,
|
|
@@ -2672,16 +2672,31 @@ async function loadAndVerifyGraph(backend, graph) {
|
|
|
2672
2672
|
}
|
|
2673
2673
|
}
|
|
2674
2674
|
await backend.assertRuntimeContributionsInitialized?.(merged.id);
|
|
2675
|
+
await assertVectorContributionsInitialized(backend, merged);
|
|
2675
2676
|
return {
|
|
2676
2677
|
graph: merged,
|
|
2677
2678
|
activeRow,
|
|
2678
2679
|
result: { status: "unchanged", version: activeRow.version }
|
|
2679
2680
|
};
|
|
2680
2681
|
}
|
|
2682
|
+
async function assertVectorContributionsInitialized(backend, graph) {
|
|
2683
|
+
if (backend.capabilities.vector?.supported !== true) return;
|
|
2684
|
+
const slots = chunkHAHNRASW_cjs.resolveGraphVectorSlots(graph);
|
|
2685
|
+
const assertVectorSlotsInitialized = backend.assertVectorSlotsInitialized;
|
|
2686
|
+
if (assertVectorSlotsInitialized !== void 0) {
|
|
2687
|
+
await assertVectorSlotsInitialized(slots);
|
|
2688
|
+
return;
|
|
2689
|
+
}
|
|
2690
|
+
const assertVectorSlotInitialized = backend.assertVectorSlotInitialized;
|
|
2691
|
+
if (assertVectorSlotInitialized === void 0) return;
|
|
2692
|
+
for (const slot of slots) {
|
|
2693
|
+
await assertVectorSlotInitialized(slot);
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2681
2696
|
function schemaBehindError(graphId, fromVersion, diff) {
|
|
2682
2697
|
const actions = getMigrationActions(diff);
|
|
2683
2698
|
const qualifier = isBackwardsCompatible(diff) ? "safe auto-migration" : "breaking change";
|
|
2684
|
-
return new
|
|
2699
|
+
return new chunkBVRDGYXQ_cjs.MigrationError(
|
|
2685
2700
|
`Schema verification failed for graph "${graphId}": ${diff.summary} (${qualifier}). ${actions.length} migration action(s) needed. The least-privilege runtime cannot migrate \u2014 run createStoreWithSchema(graph, adminBackend) under a privileged role (after any generated migration SQL, if you manage DDL externally) before attaching with createStore() / createVerifiedStore().`,
|
|
2686
2701
|
{
|
|
2687
2702
|
graphId,
|
|
@@ -2699,7 +2714,7 @@ async function readActiveSchemaPure(backend, graphId) {
|
|
|
2699
2714
|
try {
|
|
2700
2715
|
activeRow = await backend.getActiveSchema(graphId);
|
|
2701
2716
|
} catch (error) {
|
|
2702
|
-
if (
|
|
2717
|
+
if (chunk3GH67G4Z_cjs.isMissingTableError(error)) {
|
|
2703
2718
|
throw schemaNotInitializedError(graphId, error);
|
|
2704
2719
|
}
|
|
2705
2720
|
throw error;
|
|
@@ -2710,7 +2725,7 @@ async function readActiveSchemaPure(backend, graphId) {
|
|
|
2710
2725
|
return activeRow;
|
|
2711
2726
|
}
|
|
2712
2727
|
function schemaNotInitializedError(graphId, cause) {
|
|
2713
|
-
return new
|
|
2728
|
+
return new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
2714
2729
|
`Cannot verify graph "${graphId}": no schema has been initialized. Run createStoreWithSchema(graph, adminBackend) once under a privileged role (which commits the schema_versions row and materializes contribution markers) before attaching with createStore() / createVerifiedStore(). Generated migration SQL creates the tables but does not initialize the schema row.`,
|
|
2715
2730
|
{ graphId },
|
|
2716
2731
|
{
|
|
@@ -2755,7 +2770,7 @@ async function commitNewSchemaVersion(backend, graph, currentVersion) {
|
|
|
2755
2770
|
async function rollbackSchema(backend, graphId, targetVersion) {
|
|
2756
2771
|
const activeRow = await backend.getActiveSchema(graphId);
|
|
2757
2772
|
if (activeRow === void 0) {
|
|
2758
|
-
throw new
|
|
2773
|
+
throw new chunkBVRDGYXQ_cjs.MigrationError(
|
|
2759
2774
|
`Cannot rollback graph "${graphId}": no active schema version exists.`,
|
|
2760
2775
|
{ graphId, fromVersion: 0, toVersion: targetVersion }
|
|
2761
2776
|
);
|
|
@@ -2830,5 +2845,5 @@ exports.serializeSchema = serializeSchema;
|
|
|
2830
2845
|
exports.serializeSchemaProperties = serializeSchemaProperties;
|
|
2831
2846
|
exports.subClassOf = subClassOf;
|
|
2832
2847
|
exports.validateImpliesEndpointCompatibility = validateImpliesEndpointCompatibility;
|
|
2833
|
-
//# sourceMappingURL=chunk-
|
|
2834
|
-
//# sourceMappingURL=chunk-
|
|
2848
|
+
//# sourceMappingURL=chunk-NUIG3BCV.cjs.map
|
|
2849
|
+
//# sourceMappingURL=chunk-NUIG3BCV.cjs.map
|