@nicia-ai/typegraph 0.42.1 → 0.44.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/drizzle/indexes.cjs +9 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +50 -50
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +11 -11
- package/dist/backend/postgres/index.cjs +26 -26
- package/dist/backend/postgres/index.d.cts +6 -5
- package/dist/backend/postgres/index.d.ts +6 -5
- package/dist/backend/postgres/index.js +13 -13
- package/dist/backend/postgres/pglite-store.cjs +33 -33
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +7 -7
- package/dist/backend/postgres/pglite-store.d.ts +7 -7
- package/dist/backend/postgres/pglite-store.js +29 -29
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +15 -15
- package/dist/backend/postgres/pglite.d.cts +3 -2
- package/dist/backend/postgres/pglite.d.ts +3 -2
- package/dist/backend/postgres/pglite.js +14 -14
- package/dist/backend/sqlite/index.cjs +23 -23
- package/dist/backend/sqlite/index.d.cts +7 -6
- package/dist/backend/sqlite/index.d.ts +7 -6
- package/dist/backend/sqlite/index.js +11 -11
- package/dist/backend/sqlite/libsql.cjs +17 -17
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -2
- package/dist/backend/sqlite/libsql.d.ts +3 -2
- package/dist/backend/sqlite/libsql.js +13 -13
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +34 -34
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- package/dist/backend/sqlite/local-store.d.cts +8 -7
- package/dist/backend/sqlite/local-store.d.ts +8 -7
- package/dist/backend/sqlite/local-store.js +30 -30
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +16 -16
- package/dist/backend/sqlite/local.d.cts +3 -2
- package/dist/backend/sqlite/local.d.ts +3 -2
- package/dist/backend/sqlite/local.js +14 -14
- package/dist/{chunk-3RPQDGUE.cjs → chunk-2BIG7U6E.cjs} +5 -5
- package/dist/{chunk-3RPQDGUE.cjs.map → chunk-2BIG7U6E.cjs.map} +1 -1
- package/dist/{chunk-2OOY4OYT.js → chunk-2L54C2C2.js} +4 -4
- package/dist/{chunk-2OOY4OYT.js.map → chunk-2L54C2C2.js.map} +1 -1
- package/dist/{chunk-V2GZBPY2.cjs → chunk-2VLBGQBY.cjs} +310 -61
- package/dist/chunk-2VLBGQBY.cjs.map +1 -0
- package/dist/{chunk-RXOAXO3R.js → chunk-2WDD2NO3.js} +3 -3
- package/dist/{chunk-RXOAXO3R.js.map → chunk-2WDD2NO3.js.map} +1 -1
- package/dist/{chunk-2HKIID5K.js → chunk-2Y4IFKW7.js} +5 -5
- package/dist/{chunk-2HKIID5K.js.map → chunk-2Y4IFKW7.js.map} +1 -1
- package/dist/{chunk-ECU53PMN.cjs → chunk-3PRKZW6D.cjs} +5 -5
- package/dist/chunk-3PRKZW6D.cjs.map +1 -0
- package/dist/{chunk-2G6ZEGYO.js → chunk-46GDII45.js} +4 -4
- package/dist/{chunk-2G6ZEGYO.js.map → chunk-46GDII45.js.map} +1 -1
- package/dist/{chunk-OYJSYDIH.js → chunk-4MB3AQAQ.js} +13 -3
- package/dist/chunk-4MB3AQAQ.js.map +1 -0
- package/dist/chunk-4SZ6XPTG.cjs +12 -0
- package/dist/{chunk-VGMNGWBR.cjs.map → chunk-4SZ6XPTG.cjs.map} +1 -1
- package/dist/{chunk-FY4VY5EV.cjs → chunk-5MUSU4ZP.cjs} +20 -20
- package/dist/chunk-5MUSU4ZP.cjs.map +1 -0
- package/dist/{chunk-ZIRC2U6G.js → chunk-63KCKSSH.js} +78 -16
- package/dist/chunk-63KCKSSH.js.map +1 -0
- package/dist/{chunk-7Y6BV3TK.cjs → chunk-66UVLHQA.cjs} +100 -100
- package/dist/{chunk-7Y6BV3TK.cjs.map → chunk-66UVLHQA.cjs.map} +1 -1
- package/dist/{chunk-M4GYQF2H.js → chunk-6DCB664D.js} +7 -4
- package/dist/chunk-6DCB664D.js.map +1 -0
- package/dist/{chunk-OMQ2NBOR.cjs → chunk-6JZUSDY2.cjs} +27 -27
- package/dist/{chunk-OMQ2NBOR.cjs.map → chunk-6JZUSDY2.cjs.map} +1 -1
- package/dist/{chunk-Z3WIL6S3.js → chunk-7G32LIQM.js} +5 -5
- package/dist/{chunk-Z3WIL6S3.js.map → chunk-7G32LIQM.js.map} +1 -1
- package/dist/{chunk-2SO5I5AI.cjs → chunk-7V2FGGI2.cjs} +250 -198
- package/dist/chunk-7V2FGGI2.cjs.map +1 -0
- package/dist/{chunk-I73ATSAH.cjs → chunk-A2I2XO52.cjs} +4 -4
- package/dist/{chunk-I73ATSAH.cjs.map → chunk-A2I2XO52.cjs.map} +1 -1
- package/dist/{chunk-O2GZM7UK.cjs → chunk-A4PBRX4C.cjs} +7 -7
- package/dist/{chunk-O2GZM7UK.cjs.map → chunk-A4PBRX4C.cjs.map} +1 -1
- package/dist/{chunk-5P6IPIT6.cjs → chunk-ALFUGRYB.cjs} +75 -65
- package/dist/chunk-ALFUGRYB.cjs.map +1 -0
- package/dist/{chunk-NXIZL7ZZ.js → chunk-ATLN63JA.js} +6 -6
- package/dist/chunk-ATLN63JA.js.map +1 -0
- package/dist/{chunk-CUPJL6TS.js → chunk-B75XRV3O.js} +3 -3
- package/dist/{chunk-CUPJL6TS.js.map → chunk-B75XRV3O.js.map} +1 -1
- package/dist/{chunk-DP7KC6CL.js → chunk-BCP7LLOY.js} +754 -476
- package/dist/chunk-BCP7LLOY.js.map +1 -0
- package/dist/{chunk-RAWG2FEU.js → chunk-BEFM74L2.js} +264 -18
- package/dist/chunk-BEFM74L2.js.map +1 -0
- package/dist/{chunk-LQLVJWUH.js → chunk-BNUFUFAU.js} +7 -7
- package/dist/chunk-BNUFUFAU.js.map +1 -0
- package/dist/{chunk-KTBTSHU6.cjs → chunk-C4F7VJ5D.cjs} +13 -3
- package/dist/chunk-C4F7VJ5D.cjs.map +1 -0
- package/dist/{chunk-CVK4T34X.cjs → chunk-CPEL3YIR.cjs} +22 -22
- package/dist/{chunk-CVK4T34X.cjs.map → chunk-CPEL3YIR.cjs.map} +1 -1
- package/dist/{chunk-O3USVVWS.js → chunk-DK2S42XB.js} +3 -3
- package/dist/{chunk-O3USVVWS.js.map → chunk-DK2S42XB.js.map} +1 -1
- package/dist/{chunk-DMZEVJGL.cjs → chunk-EE7N5XXQ.cjs} +13 -13
- package/dist/{chunk-DMZEVJGL.cjs.map → chunk-EE7N5XXQ.cjs.map} +1 -1
- package/dist/{chunk-ZGOUVMVS.js → chunk-EFELJVLA.js} +5 -5
- package/dist/{chunk-ZGOUVMVS.js.map → chunk-EFELJVLA.js.map} +1 -1
- package/dist/chunk-EPTSMFH7.cjs +12 -0
- package/dist/{chunk-U3YRCZ5L.cjs.map → chunk-EPTSMFH7.cjs.map} +1 -1
- package/dist/{chunk-FSCJOTHF.cjs → chunk-EQ7JKLZO.cjs} +10 -10
- package/dist/{chunk-FSCJOTHF.cjs.map → chunk-EQ7JKLZO.cjs.map} +1 -1
- package/dist/{chunk-5Q3P6OIC.cjs → chunk-FGO5JFVJ.cjs} +12 -12
- package/dist/chunk-FGO5JFVJ.cjs.map +1 -0
- package/dist/{chunk-VC26BUNP.js → chunk-FMGEZBAQ.js} +5 -5
- package/dist/{chunk-VC26BUNP.js.map → chunk-FMGEZBAQ.js.map} +1 -1
- package/dist/{chunk-UZLEQFTV.js → chunk-FMMIX6N4.js} +4 -4
- package/dist/chunk-FMMIX6N4.js.map +1 -0
- package/dist/{chunk-5C75HQYQ.js → chunk-FRHHDHKH.js} +5 -5
- package/dist/{chunk-5C75HQYQ.js.map → chunk-FRHHDHKH.js.map} +1 -1
- package/dist/{chunk-EVFL2ZY5.js → chunk-FSXTPBRN.js} +63 -12
- package/dist/chunk-FSXTPBRN.js.map +1 -0
- package/dist/{chunk-TRC646QQ.cjs → chunk-GFRGG2US.cjs} +7 -7
- package/dist/{chunk-TRC646QQ.cjs.map → chunk-GFRGG2US.cjs.map} +1 -1
- package/dist/{chunk-UJRWOV5B.js → chunk-GWEDD3DH.js} +5 -5
- package/dist/{chunk-UJRWOV5B.js.map → chunk-GWEDD3DH.js.map} +1 -1
- package/dist/{chunk-AQR6BHB3.cjs → chunk-HJH3RMXG.cjs} +10 -10
- package/dist/{chunk-AQR6BHB3.cjs.map → chunk-HJH3RMXG.cjs.map} +1 -1
- package/dist/{chunk-F7TDKSVB.cjs → chunk-HOHAJ2NR.cjs} +4 -4
- package/dist/{chunk-F7TDKSVB.cjs.map → chunk-HOHAJ2NR.cjs.map} +1 -1
- package/dist/{chunk-YPVQYM3L.js → chunk-HOIFFY4M.js} +100 -20
- package/dist/chunk-HOIFFY4M.js.map +1 -0
- package/dist/{chunk-LDCWO5B6.js → chunk-IIMQJYAM.js} +3 -3
- package/dist/{chunk-LDCWO5B6.js.map → chunk-IIMQJYAM.js.map} +1 -1
- package/dist/{chunk-OM6RIOA5.cjs → chunk-IIT5K7SK.cjs} +13 -13
- package/dist/{chunk-OM6RIOA5.cjs.map → chunk-IIT5K7SK.cjs.map} +1 -1
- package/dist/{chunk-EQOQOT55.js → chunk-IJTLXNGJ.js} +5 -5
- package/dist/{chunk-EQOQOT55.js.map → chunk-IJTLXNGJ.js.map} +1 -1
- package/dist/{chunk-4XRP2N6B.js → chunk-JRP3VGHS.js} +3 -3
- package/dist/{chunk-4XRP2N6B.js.map → chunk-JRP3VGHS.js.map} +1 -1
- package/dist/{chunk-42XYPKZU.js → chunk-K3BUWSFR.js} +41 -3
- package/dist/chunk-K3BUWSFR.js.map +1 -0
- package/dist/{chunk-GT7NEXSU.js → chunk-KCO5EFJU.js} +3 -3
- package/dist/{chunk-GT7NEXSU.js.map → chunk-KCO5EFJU.js.map} +1 -1
- package/dist/{chunk-ARN3ZODS.cjs → chunk-KKYELPZ2.cjs} +6 -6
- package/dist/{chunk-ARN3ZODS.cjs.map → chunk-KKYELPZ2.cjs.map} +1 -1
- package/dist/{chunk-33PAKPED.cjs → chunk-MCHP7RHZ.cjs} +41 -41
- package/dist/{chunk-33PAKPED.cjs.map → chunk-MCHP7RHZ.cjs.map} +1 -1
- package/dist/{chunk-CDYRPI5U.js → chunk-MIJKEVV7.js} +4 -4
- package/dist/{chunk-CDYRPI5U.js.map → chunk-MIJKEVV7.js.map} +1 -1
- package/dist/{chunk-K2HHCWZO.cjs → chunk-NCX65HBY.cjs} +137 -108
- package/dist/chunk-NCX65HBY.cjs.map +1 -0
- package/dist/{chunk-6TJ6PKPS.cjs → chunk-NN3QSOVS.cjs} +27 -27
- package/dist/{chunk-6TJ6PKPS.cjs.map → chunk-NN3QSOVS.cjs.map} +1 -1
- package/dist/{chunk-F2KVJ6FF.cjs → chunk-OSZPLZIV.cjs} +179 -117
- package/dist/chunk-OSZPLZIV.cjs.map +1 -0
- package/dist/{chunk-UTTW2Q3M.cjs → chunk-OVUUTCPJ.cjs} +171 -133
- package/dist/chunk-OVUUTCPJ.cjs.map +1 -0
- package/dist/{chunk-FMPZPOUD.js → chunk-PAW2XUZN.js} +3 -3
- package/dist/{chunk-FMPZPOUD.js.map → chunk-PAW2XUZN.js.map} +1 -1
- package/dist/{chunk-5ZPRE4CV.cjs → chunk-PDGEXGS6.cjs} +204 -124
- package/dist/chunk-PDGEXGS6.cjs.map +1 -0
- package/dist/{chunk-CVNGKTHO.js → chunk-PHXITZE4.js} +4 -4
- package/dist/{chunk-CVNGKTHO.js.map → chunk-PHXITZE4.js.map} +1 -1
- package/dist/{chunk-ZPCKPLMX.cjs → chunk-QB6VMOJ2.cjs} +8 -8
- package/dist/{chunk-ZPCKPLMX.cjs.map → chunk-QB6VMOJ2.cjs.map} +1 -1
- package/dist/{chunk-5AERZSHC.cjs → chunk-QGKILWGZ.cjs} +4 -4
- package/dist/{chunk-5AERZSHC.cjs.map → chunk-QGKILWGZ.cjs.map} +1 -1
- package/dist/{chunk-ZOHCFYXE.js → chunk-QT6V3YRH.js} +3 -3
- package/dist/{chunk-ZOHCFYXE.js.map → chunk-QT6V3YRH.js.map} +1 -1
- package/dist/{chunk-XDMPDUKL.cjs → chunk-QYWINYEA.cjs} +9 -9
- package/dist/{chunk-XDMPDUKL.cjs.map → chunk-QYWINYEA.cjs.map} +1 -1
- package/dist/{chunk-3V6D5DEC.js → chunk-S4KQ5LV4.js} +3 -3
- package/dist/{chunk-3V6D5DEC.js.map → chunk-S4KQ5LV4.js.map} +1 -1
- package/dist/{chunk-6NB73BXV.js → chunk-SBPC5IP3.js} +40 -12
- package/dist/chunk-SBPC5IP3.js.map +1 -0
- package/dist/{chunk-HHBKGPEI.js → chunk-SQRD2CYF.js} +264 -21
- package/dist/chunk-SQRD2CYF.js.map +1 -0
- package/dist/{chunk-O7XVCLXW.cjs → chunk-ST3LPB2V.cjs} +324 -77
- package/dist/chunk-ST3LPB2V.cjs.map +1 -0
- package/dist/{chunk-FFQGI67R.cjs → chunk-STQ3BSED.cjs} +44 -44
- package/dist/{chunk-FFQGI67R.cjs.map → chunk-STQ3BSED.cjs.map} +1 -1
- package/dist/{chunk-JOYPNY33.js → chunk-TCRIQMBU.js} +9 -9
- package/dist/{chunk-JOYPNY33.js.map → chunk-TCRIQMBU.js.map} +1 -1
- package/dist/{chunk-ZP2KPDNN.js → chunk-TFMVL4QH.js} +3 -3
- package/dist/{chunk-ZP2KPDNN.js.map → chunk-TFMVL4QH.js.map} +1 -1
- package/dist/{chunk-4WYFRACU.js → chunk-TVLKA4AY.js} +3 -3
- package/dist/{chunk-4WYFRACU.js.map → chunk-TVLKA4AY.js.map} +1 -1
- package/dist/{chunk-X2XOQZT3.cjs → chunk-U5W4LKZV.cjs} +13 -9
- package/dist/chunk-U5W4LKZV.cjs.map +1 -0
- package/dist/{chunk-WYQILW5V.js → chunk-VITTKBWF.js} +43 -33
- package/dist/chunk-VITTKBWF.js.map +1 -0
- package/dist/{chunk-AO2WPYFZ.cjs → chunk-WBUFJ7BS.cjs} +4 -4
- package/dist/{chunk-AO2WPYFZ.cjs.map → chunk-WBUFJ7BS.cjs.map} +1 -1
- package/dist/{chunk-CI5NPLXX.js → chunk-XMYJY7NI.js} +3 -3
- package/dist/{chunk-CI5NPLXX.js.map → chunk-XMYJY7NI.js.map} +1 -1
- package/dist/{chunk-277UZV7X.cjs → chunk-XR4YZFKW.cjs} +1803 -1525
- package/dist/chunk-XR4YZFKW.cjs.map +1 -0
- package/dist/{chunk-5GV4JQNA.cjs → chunk-YNULOIR5.cjs} +43 -43
- package/dist/{chunk-5GV4JQNA.cjs.map → chunk-YNULOIR5.cjs.map} +1 -1
- package/dist/{chunk-ZBV4LQD2.cjs → chunk-ZTAJL4DT.cjs} +4 -4
- package/dist/{chunk-ZBV4LQD2.cjs.map → chunk-ZTAJL4DT.cjs.map} +1 -1
- package/dist/core/index.cjs +28 -28
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +8 -8
- package/dist/{ddl-Bc4Dl8fu.d.ts → ddl-D5369kOY.d.ts} +3 -3
- package/dist/{ddl-3unqC-kg.d.cts → ddl-eWg7hx6R.d.cts} +3 -3
- package/dist/{define-graph-Byslw2OO.d.cts → define-graph-DVF-oN1i.d.cts} +1 -1
- package/dist/{define-graph-DBFnc7u_.d.ts → define-graph-SvYXOl78.d.ts} +1 -1
- package/dist/graph-extension/index.cjs +20 -20
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +5 -5
- package/dist/graph-merge/index.cjs +104 -104
- package/dist/graph-merge/index.d.cts +9 -8
- package/dist/graph-merge/index.d.ts +9 -8
- package/dist/graph-merge/index.js +24 -24
- package/dist/{index-DQzVJBHa.d.ts → index-By89Sezh.d.ts} +37 -7
- package/dist/{index-DHXw7QAl.d.cts → index-DcQ3Sxs-.d.cts} +37 -7
- package/dist/index.cjs +210 -202
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +34 -34
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +49 -41
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +11 -11
- package/dist/interchange/index.d.ts +11 -11
- package/dist/interchange/index.js +23 -15
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-Dl0-er1G.d.ts → manager-B0KjKE93.d.ts} +44 -6
- package/dist/{manager-U9_zopqr.d.cts → manager-Cn0NFIhN.d.cts} +44 -6
- package/dist/{materialize-indexes-BM3u0aXE.d.ts → materialize-indexes-BD4V3svD.d.ts} +1 -1
- package/dist/{materialize-indexes-DzMCetZe.d.cts → materialize-indexes-DVRhd5h4.d.cts} +1 -1
- package/dist/{postgres-C5-WMKFA.d.ts → postgres-DaEWvN4x.d.cts} +1 -1
- package/dist/{postgres-DpJqtbSX.d.cts → postgres-u0a0HN2D.d.ts} +1 -1
- package/dist/profiler/index.d.cts +10 -9
- package/dist/profiler/index.d.ts +10 -9
- package/dist/provenance/index.cjs +38 -38
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +8 -8
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +41 -41
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +14 -14
- package/dist/{searchable-B4mUXZT6.d.cts → searchable-BT7j9_IK.d.cts} +2 -2
- package/dist/{searchable-C7jmPNLT.d.ts → searchable-CnYEancP.d.ts} +2 -2
- package/dist/{sqlite-Da7jiYu9.d.cts → sqlite-BrMoSsI7.d.cts} +1 -1
- package/dist/{sqlite-Ch5tSYQY.d.ts → sqlite-CHhZUyO5.d.ts} +1 -1
- package/dist/{store-view-CNcOG8bQ.d.cts → store-view-Bvdku0Ht.d.ts} +199 -35
- package/dist/{store-view-6C2vTWqf.d.ts → store-view-w-md0nQ4.d.cts} +199 -35
- package/dist/{temporal-BtrTYTiB.d.ts → temporal--x9T8K4S.d.ts} +1 -1
- package/dist/{temporal-CMpigMCW.d.cts → temporal-BCORwUau.d.cts} +1 -1
- package/dist/{types-G4sVM-76.d.cts → types-6-WJmSD4.d.cts} +1 -1
- package/dist/{types-D2rU5Taq.d.ts → types-COODtTJU.d.ts} +1 -1
- package/dist/{types-Dh-EgT-w.d.ts → types-Cjvkj0jA.d.cts} +351 -12
- package/dist/{types-Dh-EgT-w.d.cts → types-Cjvkj0jA.d.ts} +351 -12
- package/dist/{where-B8Y21kig.d.ts → where-5xVawAwL.d.ts} +1 -1
- package/dist/{where-DbZ9XDOI.d.cts → where-CUQmCR6d.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-277UZV7X.cjs.map +0 -1
- package/dist/chunk-2SO5I5AI.cjs.map +0 -1
- package/dist/chunk-42XYPKZU.js.map +0 -1
- package/dist/chunk-5P6IPIT6.cjs.map +0 -1
- package/dist/chunk-5Q3P6OIC.cjs.map +0 -1
- package/dist/chunk-5ZPRE4CV.cjs.map +0 -1
- package/dist/chunk-6NB73BXV.js.map +0 -1
- package/dist/chunk-DP7KC6CL.js.map +0 -1
- package/dist/chunk-ECU53PMN.cjs.map +0 -1
- package/dist/chunk-EVFL2ZY5.js.map +0 -1
- package/dist/chunk-F2KVJ6FF.cjs.map +0 -1
- package/dist/chunk-FY4VY5EV.cjs.map +0 -1
- package/dist/chunk-HHBKGPEI.js.map +0 -1
- package/dist/chunk-K2HHCWZO.cjs.map +0 -1
- package/dist/chunk-KTBTSHU6.cjs.map +0 -1
- package/dist/chunk-LQLVJWUH.js.map +0 -1
- package/dist/chunk-M4GYQF2H.js.map +0 -1
- package/dist/chunk-NXIZL7ZZ.js.map +0 -1
- package/dist/chunk-O7XVCLXW.cjs.map +0 -1
- package/dist/chunk-OYJSYDIH.js.map +0 -1
- package/dist/chunk-RAWG2FEU.js.map +0 -1
- package/dist/chunk-U3YRCZ5L.cjs +0 -12
- package/dist/chunk-UTTW2Q3M.cjs.map +0 -1
- package/dist/chunk-UZLEQFTV.js.map +0 -1
- package/dist/chunk-V2GZBPY2.cjs.map +0 -1
- package/dist/chunk-VGMNGWBR.cjs +0 -12
- package/dist/chunk-WYQILW5V.js.map +0 -1
- package/dist/chunk-X2XOQZT3.cjs.map +0 -1
- package/dist/chunk-YPVQYM3L.js.map +0 -1
- package/dist/chunk-ZIRC2U6G.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkTRF4EBJT_cjs = require('./chunk-TRF4EBJT.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkEE7N5XXQ_cjs = require('./chunk-EE7N5XXQ.cjs');
|
|
5
5
|
var chunkACSVZPK7_cjs = require('./chunk-ACSVZPK7.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
6
|
+
var chunkWBUFJ7BS_cjs = require('./chunk-WBUFJ7BS.cjs');
|
|
7
|
+
var chunkQB6VMOJ2_cjs = require('./chunk-QB6VMOJ2.cjs');
|
|
8
|
+
var chunkZTAJL4DT_cjs = require('./chunk-ZTAJL4DT.cjs');
|
|
9
|
+
var chunkA2I2XO52_cjs = require('./chunk-A2I2XO52.cjs');
|
|
10
10
|
var chunkZY4GXIVN_cjs = require('./chunk-ZY4GXIVN.cjs');
|
|
11
11
|
var chunk764JHTLT_cjs = require('./chunk-764JHTLT.cjs');
|
|
12
12
|
var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkQYWINYEA_cjs = require('./chunk-QYWINYEA.cjs');
|
|
14
14
|
var chunkSVJ5GEXW_cjs = require('./chunk-SVJ5GEXW.cjs');
|
|
15
15
|
var chunkDI74SMXS_cjs = require('./chunk-DI74SMXS.cjs');
|
|
16
|
-
var
|
|
16
|
+
var chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.cjs');
|
|
17
17
|
var zod = require('zod');
|
|
18
18
|
|
|
19
19
|
// src/ontology/core-meta-edges.ts
|
|
20
20
|
function createMetaEdge(name, properties) {
|
|
21
21
|
return Object.freeze({
|
|
22
|
-
[
|
|
22
|
+
[chunkEE7N5XXQ_cjs.META_EDGE_BRAND]: true,
|
|
23
23
|
name,
|
|
24
24
|
properties: {
|
|
25
25
|
transitive: properties.transitive ?? false,
|
|
@@ -910,7 +910,7 @@ var KindRegistry = class {
|
|
|
910
910
|
* Checks if child is a subclass of parent (directly or transitively).
|
|
911
911
|
*/
|
|
912
912
|
isSubClassOf(child, parent) {
|
|
913
|
-
return
|
|
913
|
+
return chunkQYWINYEA_cjs.isReachable(this.subClassAncestors, child, parent);
|
|
914
914
|
}
|
|
915
915
|
/**
|
|
916
916
|
* Expands a kind to include all its subclasses.
|
|
@@ -937,13 +937,13 @@ var KindRegistry = class {
|
|
|
937
937
|
* Checks if narrowerConcept is narrower than broaderConcept.
|
|
938
938
|
*/
|
|
939
939
|
isNarrowerThan(narrowerConcept, broaderConcept) {
|
|
940
|
-
return
|
|
940
|
+
return chunkQYWINYEA_cjs.isReachable(this.broaderClosure, narrowerConcept, broaderConcept);
|
|
941
941
|
}
|
|
942
942
|
/**
|
|
943
943
|
* Checks if broaderConcept is broader than narrowerConcept.
|
|
944
944
|
*/
|
|
945
945
|
isBroaderThan(broaderConcept, narrowerConcept) {
|
|
946
|
-
return
|
|
946
|
+
return chunkQYWINYEA_cjs.isReachable(this.narrowerClosure, broaderConcept, narrowerConcept);
|
|
947
947
|
}
|
|
948
948
|
/**
|
|
949
949
|
* Expands to include all narrower concepts.
|
|
@@ -1007,7 +1007,7 @@ var KindRegistry = class {
|
|
|
1007
1007
|
* Checks if part is part of whole (directly or transitively).
|
|
1008
1008
|
*/
|
|
1009
1009
|
isPartOf(part, whole) {
|
|
1010
|
-
return
|
|
1010
|
+
return chunkQYWINYEA_cjs.isReachable(this.partOfClosure, part, whole);
|
|
1011
1011
|
}
|
|
1012
1012
|
/**
|
|
1013
1013
|
* Gets all wholes that contain this part.
|
|
@@ -1168,18 +1168,18 @@ function computeClosuresFromOntology(ontology) {
|
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
const subClassAncestors =
|
|
1172
|
-
const subClassDescendants =
|
|
1173
|
-
const broaderClosure =
|
|
1174
|
-
const narrowerClosure =
|
|
1171
|
+
const subClassAncestors = chunkQYWINYEA_cjs.computeTransitiveClosure(subClassRelations);
|
|
1172
|
+
const subClassDescendants = chunkQYWINYEA_cjs.invertClosure(subClassAncestors);
|
|
1173
|
+
const broaderClosure = chunkQYWINYEA_cjs.computeTransitiveClosure(broaderRelations);
|
|
1174
|
+
const narrowerClosure = chunkQYWINYEA_cjs.invertClosure(broaderClosure);
|
|
1175
1175
|
const equivalenceSets = computeEquivalenceSets(equivalentRelations);
|
|
1176
1176
|
const iriToKind = computeIriMapping(equivalentRelations);
|
|
1177
1177
|
const disjointPairs = computeDisjointPairs(disjointRelations);
|
|
1178
|
-
const partOfClosure =
|
|
1179
|
-
const hasPartClosure =
|
|
1178
|
+
const partOfClosure = chunkQYWINYEA_cjs.computeTransitiveClosure(partOfRelations);
|
|
1179
|
+
const hasPartClosure = chunkQYWINYEA_cjs.invertClosure(partOfClosure);
|
|
1180
1180
|
const edgeInverses = computeEdgeInverses(inverseOfRelations);
|
|
1181
|
-
const edgeImplicationsClosure =
|
|
1182
|
-
const edgeImplyingClosure =
|
|
1181
|
+
const edgeImplicationsClosure = chunkQYWINYEA_cjs.computeTransitiveClosure(impliesRelations);
|
|
1182
|
+
const edgeImplyingClosure = chunkQYWINYEA_cjs.invertClosure(edgeImplicationsClosure);
|
|
1183
1183
|
return {
|
|
1184
1184
|
subClassAncestors,
|
|
1185
1185
|
subClassDescendants,
|
|
@@ -1283,7 +1283,7 @@ function serializeSchema(graph, version) {
|
|
|
1283
1283
|
return {
|
|
1284
1284
|
graphId: graph.id,
|
|
1285
1285
|
version,
|
|
1286
|
-
generatedAt:
|
|
1286
|
+
generatedAt: chunkZTAJL4DT_cjs.nowIso(),
|
|
1287
1287
|
nodes,
|
|
1288
1288
|
edges,
|
|
1289
1289
|
ontology,
|
|
@@ -1314,7 +1314,7 @@ function serializeDeprecatedKinds(set) {
|
|
|
1314
1314
|
function canonicalExtension(document) {
|
|
1315
1315
|
if (document === void 0) return void 0;
|
|
1316
1316
|
if (document.version === void 0) return document;
|
|
1317
|
-
if (document.version !==
|
|
1317
|
+
if (document.version !== chunkQYWINYEA_cjs.LEGACY_GRAPH_EXTENSION_VERSION) return document;
|
|
1318
1318
|
const { version: _omit, ...rest } = document;
|
|
1319
1319
|
return rest;
|
|
1320
1320
|
}
|
|
@@ -1400,7 +1400,7 @@ function serializeEdgeIndexDeclaration(declaration) {
|
|
|
1400
1400
|
}
|
|
1401
1401
|
function serializeNodes(graph) {
|
|
1402
1402
|
const result = {};
|
|
1403
|
-
for (const kindName of
|
|
1403
|
+
for (const kindName of chunkQB6VMOJ2_cjs.getNodeKinds(graph)) {
|
|
1404
1404
|
const registration = graph.nodes[kindName];
|
|
1405
1405
|
if (registration === void 0) continue;
|
|
1406
1406
|
result[kindName] = serializeNodeDef(registration);
|
|
@@ -1468,7 +1468,7 @@ function deserializeWherePredicate(serialized) {
|
|
|
1468
1468
|
}
|
|
1469
1469
|
function serializeEdges(graph) {
|
|
1470
1470
|
const result = {};
|
|
1471
|
-
for (const kindName of
|
|
1471
|
+
for (const kindName of chunkQB6VMOJ2_cjs.getEdgeKinds(graph)) {
|
|
1472
1472
|
const registration = graph.edges[kindName];
|
|
1473
1473
|
if (registration === void 0) continue;
|
|
1474
1474
|
result[kindName] = serializeEdgeDef(registration);
|
|
@@ -1525,8 +1525,8 @@ function serializeMetaEdge(metaEdge) {
|
|
|
1525
1525
|
function serializeOntologyRelation(relation) {
|
|
1526
1526
|
return {
|
|
1527
1527
|
metaEdge: relation.metaEdge.name,
|
|
1528
|
-
from:
|
|
1529
|
-
to:
|
|
1528
|
+
from: chunkEE7N5XXQ_cjs.getTypeName(relation.from),
|
|
1529
|
+
to: chunkEE7N5XXQ_cjs.getTypeName(relation.to)
|
|
1530
1530
|
};
|
|
1531
1531
|
}
|
|
1532
1532
|
function serializeClosures(relations) {
|
|
@@ -1659,7 +1659,7 @@ function compileNodeCached(kindName, document) {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
function compileNode(kindName, document) {
|
|
1661
1661
|
const schema = buildObjectSchema(document.properties);
|
|
1662
|
-
const type =
|
|
1662
|
+
const type = chunkEE7N5XXQ_cjs.defineNode(
|
|
1663
1663
|
kindName,
|
|
1664
1664
|
chunkDI74SMXS_cjs.compactUndefined({
|
|
1665
1665
|
schema,
|
|
@@ -1837,7 +1837,7 @@ function graphExtensionOntologyKey(entry) {
|
|
|
1837
1837
|
return `${entry.metaEdge}|${entry.from}|${entry.to}`;
|
|
1838
1838
|
}
|
|
1839
1839
|
function compileTimeOntologyKey(relation) {
|
|
1840
|
-
return `${relation.metaEdge.name}|${
|
|
1840
|
+
return `${relation.metaEdge.name}|${chunkEE7N5XXQ_cjs.getTypeName(relation.from)}|${chunkEE7N5XXQ_cjs.getTypeName(relation.to)}`;
|
|
1841
1841
|
}
|
|
1842
1842
|
function buildGraphExtensionOntologyKeySet(document) {
|
|
1843
1843
|
return new Set(
|
|
@@ -1858,7 +1858,7 @@ function mergeGraphExtension(graph, document) {
|
|
|
1858
1858
|
if (graph.extension !== void 0 && chunkACSVZPK7_cjs.canonicalEqual(unionDocument, existingDocument)) {
|
|
1859
1859
|
return graph;
|
|
1860
1860
|
}
|
|
1861
|
-
const validatedUnion =
|
|
1861
|
+
const validatedUnion = chunkQYWINYEA_cjs.unwrap(chunkQYWINYEA_cjs.validateGraphExtension(unionDocument));
|
|
1862
1862
|
const compiled = compileGraphExtension(validatedUnion);
|
|
1863
1863
|
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = extensionKindNames(existingDocument);
|
|
1864
1864
|
const nodeKinds = /* @__PURE__ */ new Map();
|
|
@@ -1908,7 +1908,7 @@ function mergeGraphExtension(graph, document) {
|
|
|
1908
1908
|
edgeKind: edge.kindName,
|
|
1909
1909
|
side: "to"
|
|
1910
1910
|
});
|
|
1911
|
-
const type =
|
|
1911
|
+
const type = chunkEE7N5XXQ_cjs.defineEdge(
|
|
1912
1912
|
edge.kindName,
|
|
1913
1913
|
chunkDI74SMXS_cjs.compactUndefined({
|
|
1914
1914
|
schema: edge.schema,
|
|
@@ -1960,7 +1960,7 @@ function deriveGraphExtensionVectorIndexes(compiledNodes) {
|
|
|
1960
1960
|
...compiled.unique.length === 0 ? {} : { unique: [...compiled.unique] }
|
|
1961
1961
|
};
|
|
1962
1962
|
}
|
|
1963
|
-
return
|
|
1963
|
+
return chunkQB6VMOJ2_cjs.autoDeriveVectorIndexes(registrations).map(
|
|
1964
1964
|
(index) => Object.freeze({ ...index, origin: "runtime" })
|
|
1965
1965
|
);
|
|
1966
1966
|
}
|
|
@@ -1978,7 +1978,7 @@ function mergeIndexesWithGraphExtension(existing, runtimeIndexes, graphId) {
|
|
|
1978
1978
|
const runtimeRelational = runtimeIndexes.filter(
|
|
1979
1979
|
(index) => index.entity !== "vector"
|
|
1980
1980
|
);
|
|
1981
|
-
const vectorMerged =
|
|
1981
|
+
const vectorMerged = chunkQB6VMOJ2_cjs.mergeVectorIndexes(compileTimeIndexes, runtimeVectors);
|
|
1982
1982
|
const merged = [...vectorMerged, ...runtimeRelational];
|
|
1983
1983
|
assertUniqueIndexNames(merged, graphId);
|
|
1984
1984
|
return merged;
|
|
@@ -1990,7 +1990,7 @@ function assertUniqueIndexNames(indexes, graphId) {
|
|
|
1990
1990
|
seen.add(index.name);
|
|
1991
1991
|
continue;
|
|
1992
1992
|
}
|
|
1993
|
-
throw new
|
|
1993
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
1994
1994
|
`Duplicate index name "${index.name}" after merging graph extension into graph "${graphId}". Index names must be unique within a graph.`,
|
|
1995
1995
|
{ graphId, indexName: index.name, code: "DUPLICATE_INDEX_NAME" },
|
|
1996
1996
|
{
|
|
@@ -2006,12 +2006,12 @@ function compileGraphExtensionRelationalIndexes(documents, nodeKinds, mergedEdge
|
|
|
2006
2006
|
if (document.entity === "node") {
|
|
2007
2007
|
const node = nodeKinds.get(document.kind);
|
|
2008
2008
|
if (node === void 0) {
|
|
2009
|
-
throw new
|
|
2009
|
+
throw new chunkC4F7VJ5D_cjs.KindNotFoundError(document.kind, "node", {
|
|
2010
2010
|
graphId,
|
|
2011
2011
|
suggestion: "Declare the kind under `nodes` in this graph extension, or remove the index from `indexes`."
|
|
2012
2012
|
});
|
|
2013
2013
|
}
|
|
2014
|
-
const declaration2 =
|
|
2014
|
+
const declaration2 = chunkA2I2XO52_cjs.defineNodeIndex(
|
|
2015
2015
|
node,
|
|
2016
2016
|
toNodeIndexConfig(document)
|
|
2017
2017
|
);
|
|
@@ -2020,12 +2020,12 @@ function compileGraphExtensionRelationalIndexes(documents, nodeKinds, mergedEdge
|
|
|
2020
2020
|
}
|
|
2021
2021
|
const edgeRegistration = mergedEdges[document.kind];
|
|
2022
2022
|
if (edgeRegistration === void 0) {
|
|
2023
|
-
throw new
|
|
2023
|
+
throw new chunkC4F7VJ5D_cjs.KindNotFoundError(document.kind, "edge", {
|
|
2024
2024
|
graphId,
|
|
2025
2025
|
suggestion: "Declare the edge under `edges` in this graph extension, or remove the index from `indexes`."
|
|
2026
2026
|
});
|
|
2027
2027
|
}
|
|
2028
|
-
const declaration =
|
|
2028
|
+
const declaration = chunkA2I2XO52_cjs.defineEdgeIndex(
|
|
2029
2029
|
edgeRegistration.type,
|
|
2030
2030
|
toEdgeIndexConfig(document)
|
|
2031
2031
|
);
|
|
@@ -2037,7 +2037,7 @@ function buildWhereCallback(where) {
|
|
|
2037
2037
|
return (props) => {
|
|
2038
2038
|
const builder = props[where.field];
|
|
2039
2039
|
if (builder === void 0) {
|
|
2040
|
-
throw new
|
|
2040
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2041
2041
|
`Graph-extension index \`where\` references unknown field "${where.field}".`,
|
|
2042
2042
|
{ field: where.field, code: "EXTENSION_INDEX_WHERE_UNKNOWN_FIELD" }
|
|
2043
2043
|
);
|
|
@@ -2112,14 +2112,14 @@ function isEmptyExtension(extension) {
|
|
|
2112
2112
|
}
|
|
2113
2113
|
function assertNoCollision(kindName, entity, collides, graphId) {
|
|
2114
2114
|
if (!collides) return;
|
|
2115
|
-
throw new
|
|
2115
|
+
throw new chunkQYWINYEA_cjs.KindCollisionError(kindName, entity, graphId);
|
|
2116
2116
|
}
|
|
2117
2117
|
function resolveEndpoints(entries, nodeKinds, context) {
|
|
2118
2118
|
return entries.map((entry) => {
|
|
2119
2119
|
if (typeof entry !== "string") return entry;
|
|
2120
2120
|
const resolved = nodeKinds.get(entry);
|
|
2121
2121
|
if (resolved === void 0) {
|
|
2122
|
-
throw new
|
|
2122
|
+
throw new chunkQYWINYEA_cjs.GraphExtensionUnresolvedEndpointError(
|
|
2123
2123
|
context.edgeKind,
|
|
2124
2124
|
context.side,
|
|
2125
2125
|
entry,
|
|
@@ -2135,6 +2135,183 @@ function resolveOntologyEndpoints(relation, nodeKinds) {
|
|
|
2135
2135
|
return { ...relation, from, to };
|
|
2136
2136
|
}
|
|
2137
2137
|
|
|
2138
|
+
// src/graph-extension/remove.ts
|
|
2139
|
+
function planRemovals(graph, names) {
|
|
2140
|
+
const document = graph.extension;
|
|
2141
|
+
const namesSet = new Set(names);
|
|
2142
|
+
if (namesSet.size === 0) {
|
|
2143
|
+
return { document, removedNodeKinds: [], removedEdgeKinds: [] };
|
|
2144
|
+
}
|
|
2145
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = extensionKindNames(document);
|
|
2146
|
+
const compileTimeNodeNames = new Set(
|
|
2147
|
+
Object.keys(graph.nodes).filter((name) => !runtimeNodeNames.has(name))
|
|
2148
|
+
);
|
|
2149
|
+
const compileTimeEdgeNames = new Set(
|
|
2150
|
+
Object.keys(graph.edges).filter((name) => !runtimeEdgeNames.has(name))
|
|
2151
|
+
);
|
|
2152
|
+
for (const name of namesSet) {
|
|
2153
|
+
if (compileTimeNodeNames.has(name)) {
|
|
2154
|
+
throw new chunkQYWINYEA_cjs.RemoveCompileTimeKindError(name, "node", graph.id);
|
|
2155
|
+
}
|
|
2156
|
+
if (compileTimeEdgeNames.has(name)) {
|
|
2157
|
+
throw new chunkQYWINYEA_cjs.RemoveCompileTimeKindError(name, "edge", graph.id);
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
const removedNodeKinds = [...namesSet].filter(
|
|
2161
|
+
(name) => runtimeNodeNames.has(name)
|
|
2162
|
+
);
|
|
2163
|
+
const explicitlyRemovedEdgeKinds = [...namesSet].filter(
|
|
2164
|
+
(name) => runtimeEdgeNames.has(name)
|
|
2165
|
+
);
|
|
2166
|
+
const referentsByKind = buildCompileTimeReferentIndex(
|
|
2167
|
+
graph,
|
|
2168
|
+
runtimeEdgeNames
|
|
2169
|
+
);
|
|
2170
|
+
for (const kindName of removedNodeKinds) {
|
|
2171
|
+
const referents = referentsByKind.get(kindName);
|
|
2172
|
+
if (referents !== void 0 && referents.length > 0) {
|
|
2173
|
+
throw new chunkQYWINYEA_cjs.KindHasReferentsError(kindName, referents, graph.id);
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
if (document === void 0) {
|
|
2177
|
+
return {
|
|
2178
|
+
document: void 0,
|
|
2179
|
+
removedNodeKinds: [],
|
|
2180
|
+
removedEdgeKinds: []
|
|
2181
|
+
};
|
|
2182
|
+
}
|
|
2183
|
+
const removedNodeKindsSet = new Set(removedNodeKinds);
|
|
2184
|
+
const explicitlyRemovedEdgeKindsSet = new Set(explicitlyRemovedEdgeKinds);
|
|
2185
|
+
const cascadeEdges = /* @__PURE__ */ new Set();
|
|
2186
|
+
const updatedEdges = {};
|
|
2187
|
+
for (const [edgeName, edgeDocument] of Object.entries(document.edges ?? {})) {
|
|
2188
|
+
if (explicitlyRemovedEdgeKindsSet.has(edgeName)) {
|
|
2189
|
+
cascadeEdges.add(edgeName);
|
|
2190
|
+
continue;
|
|
2191
|
+
}
|
|
2192
|
+
const newFrom = edgeDocument.from.filter(
|
|
2193
|
+
(kind) => !removedNodeKindsSet.has(kind)
|
|
2194
|
+
);
|
|
2195
|
+
const newTo = edgeDocument.to.filter(
|
|
2196
|
+
(kind) => !removedNodeKindsSet.has(kind)
|
|
2197
|
+
);
|
|
2198
|
+
if (newFrom.length === 0 || newTo.length === 0) {
|
|
2199
|
+
cascadeEdges.add(edgeName);
|
|
2200
|
+
continue;
|
|
2201
|
+
}
|
|
2202
|
+
updatedEdges[edgeName] = {
|
|
2203
|
+
...edgeDocument,
|
|
2204
|
+
from: newFrom,
|
|
2205
|
+
to: newTo
|
|
2206
|
+
};
|
|
2207
|
+
}
|
|
2208
|
+
const updatedNodes = {};
|
|
2209
|
+
for (const [nodeName, nodeDocument] of Object.entries(document.nodes ?? {})) {
|
|
2210
|
+
if (removedNodeKindsSet.has(nodeName)) continue;
|
|
2211
|
+
updatedNodes[nodeName] = nodeDocument;
|
|
2212
|
+
}
|
|
2213
|
+
const survivingOntology = (document.ontology ?? []).filter(
|
|
2214
|
+
(relation) => !removedNodeKindsSet.has(relation.from) && !removedNodeKindsSet.has(relation.to)
|
|
2215
|
+
);
|
|
2216
|
+
const allRemovedKinds = /* @__PURE__ */ new Set([
|
|
2217
|
+
...removedNodeKindsSet,
|
|
2218
|
+
...cascadeEdges,
|
|
2219
|
+
...explicitlyRemovedEdgeKindsSet
|
|
2220
|
+
]);
|
|
2221
|
+
const survivingIndexes = (document.indexes ?? []).filter(
|
|
2222
|
+
(index) => !allRemovedKinds.has(index.kind)
|
|
2223
|
+
);
|
|
2224
|
+
const newDocument = Object.freeze({
|
|
2225
|
+
...document.version === void 0 ? {} : { version: document.version },
|
|
2226
|
+
...Object.keys(updatedNodes).length === 0 ? {} : { nodes: updatedNodes },
|
|
2227
|
+
...Object.keys(updatedEdges).length === 0 ? {} : { edges: updatedEdges },
|
|
2228
|
+
...survivingOntology.length === 0 ? {} : { ontology: survivingOntology },
|
|
2229
|
+
...survivingIndexes.length === 0 ? {} : { indexes: survivingIndexes }
|
|
2230
|
+
});
|
|
2231
|
+
return {
|
|
2232
|
+
document: newDocument,
|
|
2233
|
+
removedNodeKinds,
|
|
2234
|
+
removedEdgeKinds: [
|
|
2235
|
+
...explicitlyRemovedEdgeKinds,
|
|
2236
|
+
...[...cascadeEdges].filter(
|
|
2237
|
+
(name) => !explicitlyRemovedEdgeKindsSet.has(name)
|
|
2238
|
+
)
|
|
2239
|
+
]
|
|
2240
|
+
};
|
|
2241
|
+
}
|
|
2242
|
+
function stripGraphExtension(graph) {
|
|
2243
|
+
const document = graph.extension;
|
|
2244
|
+
if (document === void 0) return graph;
|
|
2245
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = extensionKindNames(document);
|
|
2246
|
+
const runtimeOntologyKeys = buildGraphExtensionOntologyKeySet(document);
|
|
2247
|
+
const compileNodes = {};
|
|
2248
|
+
for (const [name, registration] of Object.entries(graph.nodes)) {
|
|
2249
|
+
if (runtimeNodeNames.has(name)) continue;
|
|
2250
|
+
compileNodes[name] = registration;
|
|
2251
|
+
}
|
|
2252
|
+
const compileEdges = {};
|
|
2253
|
+
for (const [name, registration] of Object.entries(graph.edges)) {
|
|
2254
|
+
if (runtimeEdgeNames.has(name)) continue;
|
|
2255
|
+
compileEdges[name] = registration;
|
|
2256
|
+
}
|
|
2257
|
+
const compileOntology = graph.ontology.filter(
|
|
2258
|
+
(relation) => !runtimeOntologyKeys.has(compileTimeOntologyKey(relation))
|
|
2259
|
+
);
|
|
2260
|
+
const compileIndexes = (graph.indexes ?? []).filter(
|
|
2261
|
+
(index) => index.origin !== "runtime"
|
|
2262
|
+
);
|
|
2263
|
+
return Object.freeze({
|
|
2264
|
+
...graph,
|
|
2265
|
+
nodes: compileNodes,
|
|
2266
|
+
edges: compileEdges,
|
|
2267
|
+
ontology: compileOntology,
|
|
2268
|
+
indexes: compileIndexes.length === 0 ? void 0 : compileIndexes,
|
|
2269
|
+
extension: void 0
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2272
|
+
function buildCompileTimeReferentIndex(graph, runtimeEdgeNames) {
|
|
2273
|
+
const index = /* @__PURE__ */ new Map();
|
|
2274
|
+
const append = (kindName, referent) => {
|
|
2275
|
+
const existing = index.get(kindName);
|
|
2276
|
+
if (existing === void 0) index.set(kindName, [referent]);
|
|
2277
|
+
else existing.push(referent);
|
|
2278
|
+
};
|
|
2279
|
+
for (const [edgeName, registration] of Object.entries(graph.edges)) {
|
|
2280
|
+
if (runtimeEdgeNames.has(edgeName)) continue;
|
|
2281
|
+
const reg = registration;
|
|
2282
|
+
const referent = {
|
|
2283
|
+
type: "compile-time-edge",
|
|
2284
|
+
name: edgeName
|
|
2285
|
+
};
|
|
2286
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2287
|
+
for (const endpoint of reg.from ?? []) {
|
|
2288
|
+
if (seen.has(endpoint.kind)) continue;
|
|
2289
|
+
seen.add(endpoint.kind);
|
|
2290
|
+
append(endpoint.kind, referent);
|
|
2291
|
+
}
|
|
2292
|
+
for (const endpoint of reg.to ?? []) {
|
|
2293
|
+
if (seen.has(endpoint.kind)) continue;
|
|
2294
|
+
seen.add(endpoint.kind);
|
|
2295
|
+
append(endpoint.kind, referent);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
const runtimeOntologyKeys = buildGraphExtensionOntologyKeySet(
|
|
2299
|
+
graph.extension
|
|
2300
|
+
);
|
|
2301
|
+
for (const relation of graph.ontology) {
|
|
2302
|
+
if (runtimeOntologyKeys.has(compileTimeOntologyKey(relation))) continue;
|
|
2303
|
+
const fromName = chunkEE7N5XXQ_cjs.getTypeName(relation.from);
|
|
2304
|
+
const toName = chunkEE7N5XXQ_cjs.getTypeName(relation.to);
|
|
2305
|
+
const referent = {
|
|
2306
|
+
type: "compile-time-ontology",
|
|
2307
|
+
name: `${relation.metaEdge.name}(${fromName}, ${toName})`
|
|
2308
|
+
};
|
|
2309
|
+
append(fromName, referent);
|
|
2310
|
+
if (toName !== fromName) append(toName, referent);
|
|
2311
|
+
}
|
|
2312
|
+
return index;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2138
2315
|
// src/registry/validate-implies.ts
|
|
2139
2316
|
function validateImpliesEndpointCompatibility(edgeEndpoints, registry) {
|
|
2140
2317
|
for (const [impliedEdgeKind, impliedEndpoints] of edgeEndpoints) {
|
|
@@ -2168,7 +2345,7 @@ function assertEndpointCompatible(side, implyingEdgeKind, implyingKinds, implied
|
|
|
2168
2345
|
(kind) => !registry.isAssignableToAny(kind, impliedKinds)
|
|
2169
2346
|
);
|
|
2170
2347
|
if (incompatibleKinds.length === 0) return;
|
|
2171
|
-
throw new
|
|
2348
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2172
2349
|
`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(", ")}].`,
|
|
2173
2350
|
{
|
|
2174
2351
|
metaEdge: chunkSVJ5GEXW_cjs.META_EDGE_IMPLIES,
|
|
@@ -2208,7 +2385,7 @@ function buildEdgeEndpointKinds(edges) {
|
|
|
2208
2385
|
}
|
|
2209
2386
|
function extractNodeTypes(graph) {
|
|
2210
2387
|
const result = /* @__PURE__ */ new Map();
|
|
2211
|
-
for (const typeName of
|
|
2388
|
+
for (const typeName of chunkQB6VMOJ2_cjs.getNodeKinds(graph)) {
|
|
2212
2389
|
const registration = graph.nodes[typeName];
|
|
2213
2390
|
result.set(typeName, registration.type);
|
|
2214
2391
|
}
|
|
@@ -2216,7 +2393,7 @@ function extractNodeTypes(graph) {
|
|
|
2216
2393
|
}
|
|
2217
2394
|
function extractEdgeTypes(graph) {
|
|
2218
2395
|
const result = /* @__PURE__ */ new Map();
|
|
2219
|
-
for (const typeName of
|
|
2396
|
+
for (const typeName of chunkQB6VMOJ2_cjs.getEdgeKinds(graph)) {
|
|
2220
2397
|
const registration = graph.edges[typeName];
|
|
2221
2398
|
result.set(typeName, registration.type);
|
|
2222
2399
|
}
|
|
@@ -2564,7 +2741,7 @@ function parseSerializedSchema(json) {
|
|
|
2564
2741
|
try {
|
|
2565
2742
|
parsed = JSON.parse(json);
|
|
2566
2743
|
} catch {
|
|
2567
|
-
throw new
|
|
2744
|
+
throw new chunkC4F7VJ5D_cjs.DatabaseOperationError(
|
|
2568
2745
|
"Stored schema document is not valid JSON",
|
|
2569
2746
|
{ operation: "select", entity: "schema" }
|
|
2570
2747
|
);
|
|
@@ -2572,7 +2749,7 @@ function parseSerializedSchema(json) {
|
|
|
2572
2749
|
const result = serializedSchemaZod.safeParse(parsed);
|
|
2573
2750
|
if (!result.success) {
|
|
2574
2751
|
const issues = result.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ");
|
|
2575
|
-
throw new
|
|
2752
|
+
throw new chunkC4F7VJ5D_cjs.DatabaseOperationError(
|
|
2576
2753
|
`Stored schema document is malformed: ${issues}`,
|
|
2577
2754
|
{ operation: "select", entity: "schema" }
|
|
2578
2755
|
);
|
|
@@ -2589,7 +2766,7 @@ async function loadActiveSchemaWithBootstrap(backend, graphId) {
|
|
|
2589
2766
|
try {
|
|
2590
2767
|
return await backend.getActiveSchema(graphId);
|
|
2591
2768
|
} catch (error) {
|
|
2592
|
-
if (backend.bootstrapTables &&
|
|
2769
|
+
if (backend.bootstrapTables && chunkWBUFJ7BS_cjs.isMissingTableError(error)) {
|
|
2593
2770
|
await backend.bootstrapTables();
|
|
2594
2771
|
return await backend.getActiveSchema(graphId);
|
|
2595
2772
|
}
|
|
@@ -2609,7 +2786,8 @@ async function loadAndMergeGraphExtensionDocument(backend, graph) {
|
|
|
2609
2786
|
}
|
|
2610
2787
|
function mergeStoredGraphExtension(graph, activeRow) {
|
|
2611
2788
|
const storedSchema = parseSerializedSchema(activeRow.schema_doc);
|
|
2612
|
-
const
|
|
2789
|
+
const compileTimeGraph = stripGraphExtension(graph);
|
|
2790
|
+
const merged = storedSchema.extension === void 0 ? compileTimeGraph : mergeGraphExtension(compileTimeGraph, storedSchema.extension);
|
|
2613
2791
|
return {
|
|
2614
2792
|
graph: applyDeprecatedKinds(merged, storedSchema.deprecatedKinds),
|
|
2615
2793
|
storedSchema
|
|
@@ -2683,8 +2861,11 @@ async function ensureSchema(backend, graph, options) {
|
|
|
2683
2861
|
}
|
|
2684
2862
|
const actions = getMigrationActions(diff);
|
|
2685
2863
|
if (throwOnBreaking) {
|
|
2686
|
-
|
|
2687
|
-
|
|
2864
|
+
const removesKind = [...diff.nodes, ...diff.edges].some(
|
|
2865
|
+
(change) => change.type === "removed"
|
|
2866
|
+
);
|
|
2867
|
+
throw new chunkC4F7VJ5D_cjs.MigrationError(
|
|
2868
|
+
`Schema migration required: ${diff.summary}. ${actions.length} migration action(s) needed. Use getSchemaChanges() to review, then migrateSchema() to apply.` + (removesKind ? ` This diff removes a kind: migrateSchema() refuses to drop one that still holds rows, so export or delete those rows first and retry.` : ""),
|
|
2688
2869
|
{
|
|
2689
2870
|
graphId: graph.id,
|
|
2690
2871
|
fromVersion: activeSchema.version,
|
|
@@ -2736,7 +2917,7 @@ async function assertVectorContributionsInitialized(backend, graph) {
|
|
|
2736
2917
|
function schemaBehindError(graphId, fromVersion, diff) {
|
|
2737
2918
|
const actions = getMigrationActions(diff);
|
|
2738
2919
|
const qualifier = isBackwardsCompatible(diff) ? "safe auto-migration" : "breaking change";
|
|
2739
|
-
return new
|
|
2920
|
+
return new chunkC4F7VJ5D_cjs.MigrationError(
|
|
2740
2921
|
`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().`,
|
|
2741
2922
|
{
|
|
2742
2923
|
graphId,
|
|
@@ -2756,7 +2937,7 @@ async function readActiveSchemaPure(backend, graphId) {
|
|
|
2756
2937
|
try {
|
|
2757
2938
|
activeRow = await backend.getActiveSchema(graphId);
|
|
2758
2939
|
} catch (error) {
|
|
2759
|
-
if (
|
|
2940
|
+
if (chunkWBUFJ7BS_cjs.isMissingTableError(error)) {
|
|
2760
2941
|
throw schemaNotInitializedError(graphId, error);
|
|
2761
2942
|
}
|
|
2762
2943
|
throw error;
|
|
@@ -2767,7 +2948,7 @@ async function readActiveSchemaPure(backend, graphId) {
|
|
|
2767
2948
|
return activeRow;
|
|
2768
2949
|
}
|
|
2769
2950
|
function schemaNotInitializedError(graphId, cause) {
|
|
2770
|
-
return new
|
|
2951
|
+
return new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
2771
2952
|
`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.`,
|
|
2772
2953
|
{ graphId },
|
|
2773
2954
|
{
|
|
@@ -2788,31 +2969,96 @@ async function initializeSchema(backend, graph) {
|
|
|
2788
2969
|
schemaDoc: schema
|
|
2789
2970
|
});
|
|
2790
2971
|
}
|
|
2791
|
-
async function migrateSchema(backend, graph, currentVersion) {
|
|
2792
|
-
const
|
|
2972
|
+
async function migrateSchema(backend, graph, currentVersion, options) {
|
|
2973
|
+
const {
|
|
2974
|
+
graph: target,
|
|
2975
|
+
storedSchema,
|
|
2976
|
+
activeRow
|
|
2977
|
+
} = await loadAndMergeGraphExtensionDocument(backend, graph);
|
|
2978
|
+
if (activeRow !== void 0 && activeRow.version !== currentVersion) {
|
|
2979
|
+
throw new chunkC4F7VJ5D_cjs.StaleVersionError({
|
|
2980
|
+
graphId: graph.id,
|
|
2981
|
+
expected: currentVersion,
|
|
2982
|
+
actual: activeRow.version
|
|
2983
|
+
});
|
|
2984
|
+
}
|
|
2985
|
+
const dropped = storedSchema === void 0 ? [] : [
|
|
2986
|
+
...droppedKinds(storedSchema.nodes, chunkQB6VMOJ2_cjs.getNodeKinds(target), "node"),
|
|
2987
|
+
...droppedKinds(storedSchema.edges, chunkQB6VMOJ2_cjs.getEdgeKinds(target), "edge")
|
|
2988
|
+
];
|
|
2989
|
+
const committed = dropped.length > 0 && options?.discardDroppedKindRows !== true ? await commitDroppedKindsOnlyWhenEmpty(
|
|
2990
|
+
backend,
|
|
2991
|
+
target,
|
|
2992
|
+
currentVersion,
|
|
2993
|
+
dropped
|
|
2994
|
+
) : await commitNewSchemaVersion(backend, target, currentVersion);
|
|
2995
|
+
return committed.version;
|
|
2996
|
+
}
|
|
2997
|
+
async function commitDroppedKindsOnlyWhenEmpty(backend, graph, currentVersion, dropped) {
|
|
2998
|
+
const result = await commitNewSchemaVersionIfKindsEmpty(
|
|
2793
2999
|
backend,
|
|
2794
3000
|
graph,
|
|
2795
|
-
currentVersion
|
|
3001
|
+
currentVersion,
|
|
3002
|
+
dropped
|
|
2796
3003
|
);
|
|
2797
|
-
return
|
|
3004
|
+
if (result.status === "committed") return result.row;
|
|
3005
|
+
throwPopulatedKindRemovalError(graph.id, currentVersion, result.kinds);
|
|
3006
|
+
}
|
|
3007
|
+
function throwPopulatedKindRemovalError(graphId, currentVersion, populated) {
|
|
3008
|
+
const named = populated.map((entry) => `${entry.entity} "${entry.kind}" (${String(entry.count)})`).join(", ");
|
|
3009
|
+
throw new chunkC4F7VJ5D_cjs.MigrationError(
|
|
3010
|
+
`Refusing to commit a schema for graph "${graphId}" that drops kinds still holding rows: ${named}. Committing would make those rows unreachable, and the next materializeRemovals() would delete them. Export or delete those rows, then retry. Pass { discardDroppedKindRows: true } if losing them is the intent.`,
|
|
3011
|
+
{
|
|
3012
|
+
graphId,
|
|
3013
|
+
fromVersion: currentVersion,
|
|
3014
|
+
toVersion: currentVersion + 1,
|
|
3015
|
+
reason: "kind-removal",
|
|
3016
|
+
droppedKinds: {
|
|
3017
|
+
nodes: populated.filter((entry) => entry.entity === "node").map((entry) => entry.kind),
|
|
3018
|
+
edges: populated.filter((entry) => entry.entity === "edge").map((entry) => entry.kind)
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
);
|
|
3022
|
+
}
|
|
3023
|
+
function droppedKinds(committed, present, entity) {
|
|
3024
|
+
const kinds = new Set(present);
|
|
3025
|
+
return Object.keys(committed).filter((name) => !kinds.has(name)).toSorted().map((kind) => ({ kind, entity }));
|
|
2798
3026
|
}
|
|
2799
3027
|
async function commitNewSchemaVersion(backend, graph, currentVersion) {
|
|
3028
|
+
const params = await buildNewSchemaVersionCommit(graph, currentVersion);
|
|
3029
|
+
return backend.commitSchemaVersion(params);
|
|
3030
|
+
}
|
|
3031
|
+
async function commitNewSchemaVersionIfKindsEmpty(backend, graph, currentVersion, probes) {
|
|
3032
|
+
const params = await buildNewSchemaVersionCommit(graph, currentVersion);
|
|
3033
|
+
const commitIfKindsEmpty = backend.commitSchemaVersionIfKindsEmpty;
|
|
3034
|
+
if (commitIfKindsEmpty === void 0) {
|
|
3035
|
+
throw new chunkC4F7VJ5D_cjs.ConfigurationError(
|
|
3036
|
+
"This backend cannot atomically fence entity writes while checking schema kind emptiness.",
|
|
3037
|
+
{
|
|
3038
|
+
code: "SCHEMA_KIND_EMPTINESS_FENCE_UNSUPPORTED",
|
|
3039
|
+
graphId: graph.id
|
|
3040
|
+
}
|
|
3041
|
+
);
|
|
3042
|
+
}
|
|
3043
|
+
return commitIfKindsEmpty(params, probes);
|
|
3044
|
+
}
|
|
3045
|
+
async function buildNewSchemaVersionCommit(graph, currentVersion) {
|
|
2800
3046
|
buildKindRegistry(graph);
|
|
2801
3047
|
const newVersion = currentVersion + 1;
|
|
2802
3048
|
const schema = serializeSchema(graph, newVersion);
|
|
2803
3049
|
const hash = await computeSchemaHash(schema);
|
|
2804
|
-
return
|
|
3050
|
+
return {
|
|
2805
3051
|
graphId: graph.id,
|
|
2806
3052
|
expected: { kind: "active", version: currentVersion },
|
|
2807
3053
|
version: newVersion,
|
|
2808
3054
|
schemaHash: hash,
|
|
2809
3055
|
schemaDoc: schema
|
|
2810
|
-
}
|
|
3056
|
+
};
|
|
2811
3057
|
}
|
|
2812
3058
|
async function rollbackSchema(backend, graphId, targetVersion) {
|
|
2813
3059
|
const activeRow = await backend.getActiveSchema(graphId);
|
|
2814
3060
|
if (activeRow === void 0) {
|
|
2815
|
-
throw new
|
|
3061
|
+
throw new chunkC4F7VJ5D_cjs.MigrationError(
|
|
2816
3062
|
`Cannot rollback graph "${graphId}": no active schema version exists.`,
|
|
2817
3063
|
{
|
|
2818
3064
|
graphId,
|
|
@@ -2865,6 +3111,7 @@ exports.buildGraphExtensionOntologyKeySet = buildGraphExtensionOntologyKeySet;
|
|
|
2865
3111
|
exports.buildKindRegistry = buildKindRegistry;
|
|
2866
3112
|
exports.classifySchemaChanges = classifySchemaChanges;
|
|
2867
3113
|
exports.commitNewSchemaVersion = commitNewSchemaVersion;
|
|
3114
|
+
exports.commitNewSchemaVersionIfKindsEmpty = commitNewSchemaVersionIfKindsEmpty;
|
|
2868
3115
|
exports.compileTimeOntologyKey = compileTimeOntologyKey;
|
|
2869
3116
|
exports.computeSchemaDiff = computeSchemaDiff;
|
|
2870
3117
|
exports.computeSchemaHash = computeSchemaHash;
|
|
@@ -2893,6 +3140,7 @@ exports.migrateSchema = migrateSchema;
|
|
|
2893
3140
|
exports.narrower = narrower;
|
|
2894
3141
|
exports.parseSerializedSchema = parseSerializedSchema;
|
|
2895
3142
|
exports.partOf = partOf;
|
|
3143
|
+
exports.planRemovals = planRemovals;
|
|
2896
3144
|
exports.relatedTo = relatedTo;
|
|
2897
3145
|
exports.requiresMigration = requiresMigration;
|
|
2898
3146
|
exports.rollbackSchema = rollbackSchema;
|
|
@@ -2900,7 +3148,8 @@ exports.sameAs = sameAs;
|
|
|
2900
3148
|
exports.serializeIndexDeclaration = serializeIndexDeclaration;
|
|
2901
3149
|
exports.serializeSchema = serializeSchema;
|
|
2902
3150
|
exports.serializeSchemaProperties = serializeSchemaProperties;
|
|
3151
|
+
exports.stripGraphExtension = stripGraphExtension;
|
|
2903
3152
|
exports.subClassOf = subClassOf;
|
|
2904
3153
|
exports.validateImpliesEndpointCompatibility = validateImpliesEndpointCompatibility;
|
|
2905
|
-
//# sourceMappingURL=chunk-
|
|
2906
|
-
//# sourceMappingURL=chunk-
|
|
3154
|
+
//# sourceMappingURL=chunk-2VLBGQBY.cjs.map
|
|
3155
|
+
//# sourceMappingURL=chunk-2VLBGQBY.cjs.map
|