@nicia-ai/typegraph 0.37.1 → 0.38.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/README.md +12 -10
- package/dist/backend/drizzle/indexes.cjs +32 -0
- package/dist/backend/drizzle/indexes.cjs.map +1 -0
- package/dist/backend/drizzle/indexes.d.cts +43 -0
- package/dist/backend/drizzle/indexes.d.ts +43 -0
- package/dist/backend/drizzle/indexes.js +11 -0
- package/dist/backend/drizzle/indexes.js.map +1 -0
- package/dist/backend/index.cjs +161 -0
- package/dist/backend/index.cjs.map +1 -0
- package/dist/backend/index.d.cts +3 -0
- package/dist/backend/index.d.ts +3 -0
- package/dist/backend/index.js +8 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/postgres/index.cjs +32 -28
- package/dist/backend/postgres/index.d.cts +13 -12
- package/dist/backend/postgres/index.d.ts +13 -12
- package/dist/backend/postgres/index.js +19 -15
- package/dist/backend/postgres/pglite-store.cjs +67 -0
- package/dist/backend/postgres/pglite-store.cjs.map +1 -0
- package/dist/backend/postgres/pglite-store.d.cts +38 -0
- package/dist/backend/postgres/pglite-store.d.ts +38 -0
- package/dist/backend/postgres/pglite-store.js +65 -0
- package/dist/backend/postgres/pglite-store.js.map +1 -0
- package/dist/backend/postgres/pglite.cjs +25 -50
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +10 -9
- package/dist/backend/postgres/pglite.d.ts +10 -9
- package/dist/backend/postgres/pglite.js +20 -52
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +29 -25
- package/dist/backend/sqlite/index.d.cts +11 -11
- package/dist/backend/sqlite/index.d.ts +11 -11
- package/dist/backend/sqlite/index.js +17 -13
- package/dist/backend/sqlite/libsql.cjs +23 -19
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +9 -10
- package/dist/backend/sqlite/libsql.d.ts +9 -10
- package/dist/backend/sqlite/libsql.js +19 -15
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +72 -0
- package/dist/backend/sqlite/local-store.cjs.map +1 -0
- package/dist/backend/sqlite/local-store.d.cts +42 -0
- package/dist/backend/sqlite/local-store.d.ts +42 -0
- package/dist/backend/sqlite/local-store.js +67 -0
- package/dist/backend/sqlite/local-store.js.map +1 -0
- package/dist/backend/sqlite/local.cjs +28 -183
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +8 -81
- package/dist/backend/sqlite/local.d.ts +8 -81
- package/dist/backend/sqlite/local.js +20 -180
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-2EBMPJBO.js +16 -0
- package/dist/chunk-2EBMPJBO.js.map +1 -0
- package/dist/{chunk-5AVRFNP4.cjs → chunk-2SL7OGPR.cjs} +2866 -1507
- package/dist/chunk-2SL7OGPR.cjs.map +1 -0
- package/dist/chunk-35S6P5ZU.js +27 -0
- package/dist/chunk-35S6P5ZU.js.map +1 -0
- package/dist/chunk-3LKL3S6X.js +50 -0
- package/dist/chunk-3LKL3S6X.js.map +1 -0
- package/dist/chunk-6G5CQ6JX.js +47 -0
- package/dist/chunk-6G5CQ6JX.js.map +1 -0
- package/dist/chunk-6XDBRDZE.js +312 -0
- package/dist/chunk-6XDBRDZE.js.map +1 -0
- package/dist/chunk-764JHTLT.cjs +15 -0
- package/dist/chunk-764JHTLT.cjs.map +1 -0
- package/dist/chunk-76HE7DJP.js +68 -0
- package/dist/chunk-76HE7DJP.js.map +1 -0
- package/dist/{chunk-VGDDG3XJ.cjs → chunk-7M3NACL3.cjs} +12 -12
- package/dist/{chunk-VGDDG3XJ.cjs.map → chunk-7M3NACL3.cjs.map} +1 -1
- package/dist/{chunk-NXQFATMF.cjs → chunk-7VLCN3JB.cjs} +153 -123
- package/dist/chunk-7VLCN3JB.cjs.map +1 -0
- package/dist/{chunk-GA4TT3DH.js → chunk-A2FGSWMQ.js} +1845 -489
- package/dist/chunk-A2FGSWMQ.js.map +1 -0
- package/dist/chunk-AOL64O4Z.js +165 -0
- package/dist/chunk-AOL64O4Z.js.map +1 -0
- package/dist/{chunk-27SSDCEP.cjs → chunk-B63IFHXR.cjs} +53 -74
- package/dist/chunk-B63IFHXR.cjs.map +1 -0
- package/dist/{chunk-3XXGYU62.cjs → chunk-BKAKAVRW.cjs} +56 -53
- package/dist/chunk-BKAKAVRW.cjs.map +1 -0
- package/dist/{chunk-YTSN73ND.js → chunk-BQITNFQJ.js} +3 -3
- package/dist/{chunk-YTSN73ND.js.map → chunk-BQITNFQJ.js.map} +1 -1
- package/dist/{chunk-NUIG3BCV.cjs → chunk-CQC6VBAF.cjs} +93 -155
- package/dist/chunk-CQC6VBAF.cjs.map +1 -0
- package/dist/{chunk-6EEO3OVU.cjs → chunk-CWX77JB4.cjs} +22 -59
- package/dist/chunk-CWX77JB4.cjs.map +1 -0
- package/dist/{chunk-UGZUAYAR.js → chunk-D7PG5D5K.js} +4 -3
- package/dist/chunk-D7PG5D5K.js.map +1 -0
- package/dist/chunk-DDCIXXOO.js +9 -0
- package/dist/chunk-DDCIXXOO.js.map +1 -0
- package/dist/chunk-DDCYVIVV.cjs +44 -0
- package/dist/chunk-DDCYVIVV.cjs.map +1 -0
- package/dist/{chunk-XPCZADMT.cjs → chunk-DOVMTPKE.cjs} +89 -27
- package/dist/chunk-DOVMTPKE.cjs.map +1 -0
- package/dist/{chunk-5PNMDJ7J.js → chunk-DPNA466P.js} +14 -9
- package/dist/chunk-DPNA466P.js.map +1 -0
- package/dist/{chunk-BYPOGQWK.js → chunk-DRACN6XG.js} +6 -4
- package/dist/chunk-DRACN6XG.js.map +1 -0
- package/dist/chunk-E6TXEISH.cjs +175 -0
- package/dist/chunk-E6TXEISH.cjs.map +1 -0
- package/dist/{chunk-TKT2XHED.js → chunk-E6YZRKMM.js} +13 -12
- package/dist/chunk-E6YZRKMM.js.map +1 -0
- package/dist/{chunk-3C2RYI6L.cjs → chunk-EOJFGECD.cjs} +11 -11
- package/dist/chunk-EOJFGECD.cjs.map +1 -0
- package/dist/{chunk-XWV4JT34.js → chunk-ERZ4QPQX.js} +27 -22
- package/dist/chunk-ERZ4QPQX.js.map +1 -0
- package/dist/{chunk-DFVLCOP6.js → chunk-EZH7FNUS.js} +3 -3
- package/dist/{chunk-DFVLCOP6.js.map → chunk-EZH7FNUS.js.map} +1 -1
- package/dist/{chunk-WWFHO375.cjs → chunk-FJMPR3OH.cjs} +4 -3
- package/dist/chunk-FJMPR3OH.cjs.map +1 -0
- package/dist/chunk-FMNUSGZ4.cjs +12 -0
- package/dist/chunk-FMNUSGZ4.cjs.map +1 -0
- package/dist/{chunk-K3Q3LJY3.js → chunk-G32AO634.js} +201 -100
- package/dist/chunk-G32AO634.js.map +1 -0
- package/dist/{chunk-EXU3RASM.js → chunk-G3CSQLLT.js} +20 -474
- package/dist/chunk-G3CSQLLT.js.map +1 -0
- package/dist/chunk-GNPGGLAE.cjs +212 -0
- package/dist/chunk-GNPGGLAE.cjs.map +1 -0
- package/dist/{chunk-QARBLBXT.cjs → chunk-GUUWKPTK.cjs} +7 -7
- package/dist/{chunk-QARBLBXT.cjs.map → chunk-GUUWKPTK.cjs.map} +1 -1
- package/dist/chunk-GYA4JRP5.js +31 -0
- package/dist/chunk-GYA4JRP5.js.map +1 -0
- package/dist/chunk-I6FX7AAG.js +39 -0
- package/dist/chunk-I6FX7AAG.js.map +1 -0
- package/dist/chunk-IMQKXL4E.cjs +12 -0
- package/dist/{chunk-QSXTWU4U.cjs.map → chunk-IMQKXL4E.cjs.map} +1 -1
- package/dist/chunk-J6IJARLG.js +94 -0
- package/dist/chunk-J6IJARLG.js.map +1 -0
- package/dist/{chunk-W63OVYY4.js → chunk-K34OPSJK.js} +3 -3
- package/dist/{chunk-W63OVYY4.js.map → chunk-K34OPSJK.js.map} +1 -1
- package/dist/{chunk-TGOMW4MB.cjs → chunk-KCLZHYPU.cjs} +110 -109
- package/dist/chunk-KCLZHYPU.cjs.map +1 -0
- package/dist/{chunk-XGPUQ56G.js → chunk-KFLXWVUJ.js} +4 -38
- package/dist/chunk-KFLXWVUJ.js.map +1 -0
- package/dist/{chunk-3DS7Z4T4.cjs → chunk-LZ3TVJY4.cjs} +44 -43
- package/dist/chunk-LZ3TVJY4.cjs.map +1 -0
- package/dist/{chunk-UXLSNRYL.js → chunk-MTNEGGM2.js} +4 -4
- package/dist/chunk-MTNEGGM2.js.map +1 -0
- package/dist/{chunk-IP3CGGPA.cjs → chunk-N2V3HJFV.cjs} +92 -185
- package/dist/chunk-N2V3HJFV.cjs.map +1 -0
- package/dist/chunk-NAUA4PW5.cjs +28 -0
- package/dist/chunk-NAUA4PW5.cjs.map +1 -0
- package/dist/chunk-NMQ6C6TS.cjs +61 -0
- package/dist/chunk-NMQ6C6TS.cjs.map +1 -0
- package/dist/{chunk-2N6EOBTH.cjs → chunk-NPWACFQJ.cjs} +58 -53
- package/dist/chunk-NPWACFQJ.cjs.map +1 -0
- package/dist/{chunk-5KEQ74YU.cjs → chunk-NT6ILURI.cjs} +9 -86
- package/dist/chunk-NT6ILURI.cjs.map +1 -0
- package/dist/chunk-NU23DUSJ.cjs +192 -0
- package/dist/chunk-NU23DUSJ.cjs.map +1 -0
- package/dist/{chunk-WOJMKB3N.cjs → chunk-NWYCOFEZ.cjs} +1677 -308
- package/dist/chunk-NWYCOFEZ.cjs.map +1 -0
- package/dist/{chunk-3GH67G4Z.cjs → chunk-O5H62ZWJ.cjs} +4 -42
- package/dist/chunk-O5H62ZWJ.cjs.map +1 -0
- package/dist/{chunk-3SLPDKHQ.js → chunk-PH4IJ3V5.js} +5 -77
- package/dist/chunk-PH4IJ3V5.js.map +1 -0
- package/dist/chunk-PWXGB77L.cjs +56 -0
- package/dist/chunk-PWXGB77L.cjs.map +1 -0
- package/dist/chunk-PZHC5GCD.js +193 -0
- package/dist/chunk-PZHC5GCD.js.map +1 -0
- package/dist/chunk-QMQLUA66.js +12 -0
- package/dist/chunk-QMQLUA66.js.map +1 -0
- package/dist/{chunk-5WWVZMVX.js → chunk-QZ7A6HBM.js} +2 -2
- package/dist/{chunk-5WWVZMVX.js.map → chunk-QZ7A6HBM.js.map} +1 -1
- package/dist/{chunk-VKGKDOKR.js → chunk-RQPRCEIO.js} +1539 -206
- package/dist/chunk-RQPRCEIO.js.map +1 -0
- package/dist/chunk-RW24SAHI.cjs +74 -0
- package/dist/chunk-RW24SAHI.cjs.map +1 -0
- package/dist/{chunk-BVRDGYXQ.cjs → chunk-SAFZ6JTI.cjs} +14 -9
- package/dist/chunk-SAFZ6JTI.cjs.map +1 -0
- package/dist/{chunk-L7HQ2OSI.js → chunk-SCTZRFW5.js} +87 -166
- package/dist/chunk-SCTZRFW5.js.map +1 -0
- package/dist/{chunk-5KPNWT6X.js → chunk-SDHV2MWU.js} +24 -45
- package/dist/chunk-SDHV2MWU.js.map +1 -0
- package/dist/chunk-SVJ5GEXW.cjs +45 -0
- package/dist/chunk-SVJ5GEXW.cjs.map +1 -0
- package/dist/chunk-SVUKGWSN.cjs +102 -0
- package/dist/chunk-SVUKGWSN.cjs.map +1 -0
- package/dist/chunk-TAUGGLNQ.js +59 -0
- package/dist/chunk-TAUGGLNQ.js.map +1 -0
- package/dist/{chunk-UV3WP5WZ.js → chunk-TE5ZA4VX.js} +55 -27
- package/dist/chunk-TE5ZA4VX.js.map +1 -0
- package/dist/{chunk-A42GCBGX.cjs → chunk-TRF4EBJT.cjs} +6 -4
- package/dist/chunk-TRF4EBJT.cjs.map +1 -0
- package/dist/{chunk-KQJ54OG5.js → chunk-U4JDJKPD.js} +19 -56
- package/dist/chunk-U4JDJKPD.js.map +1 -0
- package/dist/chunk-UH2USOMG.cjs +627 -0
- package/dist/chunk-UH2USOMG.cjs.map +1 -0
- package/dist/{chunk-RCVLFTCT.js → chunk-UPXDVI3T.js} +13 -12
- package/dist/chunk-UPXDVI3T.js.map +1 -0
- package/dist/{chunk-5VQM6VWP.cjs → chunk-UWG5GX6E.cjs} +2 -2
- package/dist/{chunk-5VQM6VWP.cjs.map → chunk-UWG5GX6E.cjs.map} +1 -1
- package/dist/{chunk-3RWZPJKV.js → chunk-VBH7ZXSZ.js} +21 -78
- package/dist/chunk-VBH7ZXSZ.js.map +1 -0
- package/dist/{chunk-K5UBVGJN.js → chunk-VDYA2HMS.js} +6 -6
- package/dist/{chunk-K5UBVGJN.js.map → chunk-VDYA2HMS.js.map} +1 -1
- package/dist/chunk-X4PVHAZ6.cjs +83 -0
- package/dist/chunk-X4PVHAZ6.cjs.map +1 -0
- package/dist/{chunk-UYQMBBWJ.js → chunk-X6CNEA32.js} +23 -20
- package/dist/chunk-X6CNEA32.js.map +1 -0
- package/dist/chunk-X6RDQ5NB.cjs +335 -0
- package/dist/chunk-X6RDQ5NB.cjs.map +1 -0
- package/dist/chunk-XD6X7O5R.js +184 -0
- package/dist/chunk-XD6X7O5R.js.map +1 -0
- package/dist/{chunk-DIQ3AV5W.cjs → chunk-XFY73JWD.cjs} +324 -224
- package/dist/chunk-XFY73JWD.cjs.map +1 -0
- package/dist/{chunk-DEFQM7JU.cjs → chunk-XRU7V7FF.cjs} +7 -7
- package/dist/{chunk-DEFQM7JU.cjs.map → chunk-XRU7V7FF.cjs.map} +1 -1
- package/dist/{chunk-TPF25IG6.js → chunk-XZA3Y4YH.js} +3 -3
- package/dist/{chunk-TPF25IG6.js.map → chunk-XZA3Y4YH.js.map} +1 -1
- package/dist/chunk-Y7M44XEK.js +462 -0
- package/dist/chunk-Y7M44XEK.js.map +1 -0
- package/dist/{chunk-RRSNR3TP.js → chunk-YIRLBUNN.js} +3 -3
- package/dist/{chunk-RRSNR3TP.js.map → chunk-YIRLBUNN.js.map} +1 -1
- package/dist/{chunk-IXGYRP2P.js → chunk-YJDSPA5E.js} +79 -49
- package/dist/chunk-YJDSPA5E.js.map +1 -0
- package/dist/{chunk-EJYMTO3K.cjs → chunk-YLINFV7Z.cjs} +144 -116
- package/dist/chunk-YLINFV7Z.cjs.map +1 -0
- package/dist/{chunk-QERAIDRJ.js → chunk-Z2PPIVOO.js} +82 -22
- package/dist/chunk-Z2PPIVOO.js.map +1 -0
- package/dist/chunk-Z5QHVL5U.cjs +12 -0
- package/dist/chunk-Z5QHVL5U.cjs.map +1 -0
- package/dist/chunk-ZDH3DX3C.cjs +30 -0
- package/dist/chunk-ZDH3DX3C.cjs.map +1 -0
- package/dist/chunk-ZE6NVENI.js +77 -0
- package/dist/chunk-ZE6NVENI.js.map +1 -0
- package/dist/chunk-ZHX4KEM7.cjs +49 -0
- package/dist/chunk-ZHX4KEM7.cjs.map +1 -0
- package/dist/chunk-ZKZAIX42.cjs +479 -0
- package/dist/chunk-ZKZAIX42.cjs.map +1 -0
- package/dist/{chunk-TEDRJXOG.cjs → chunk-ZY4GXIVN.cjs} +5 -5
- package/dist/{chunk-TEDRJXOG.cjs.map → chunk-ZY4GXIVN.cjs.map} +1 -1
- package/dist/core/index.cjs +117 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +225 -0
- package/dist/core/index.d.ts +225 -0
- package/dist/core/index.js +12 -0
- package/dist/core/index.js.map +1 -0
- package/dist/{ddl-CS0KUVwB.d.ts → ddl-Dx3Z0_WC.d.ts} +3 -3
- package/dist/{ddl-BD-ZfKeX.d.cts → ddl-J6sDyABg.d.cts} +3 -3
- package/dist/define-graph-CzEvA_8F.d.cts +174 -0
- package/dist/define-graph-DRo9xpYN.d.ts +174 -0
- package/dist/{extension-types-BM2ACfYO.d.cts → extension-types-BLEVH4SG.d.cts} +1 -1
- package/dist/{extension-types-BM2ACfYO.d.ts → extension-types-BLEVH4SG.d.ts} +1 -1
- package/dist/graph-extension/index.cjs +21 -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 +6 -4
- package/dist/graph-merge/index.cjs +265 -214
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +8 -89
- package/dist/graph-merge/index.d.ts +8 -89
- package/dist/graph-merge/index.js +141 -90
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-BeacbPoe.d.ts → index-BD_3TCgh.d.ts} +6 -4
- package/dist/{index-BPM59vsg.d.cts → index-BihFPsPu.d.cts} +6 -4
- package/dist/{fulltext-strategy-C27vXaeB.d.cts → index-Bq7vSPHy.d.ts} +3195 -2646
- package/dist/{fulltext-strategy-DebsMrqg.d.ts → index-CrFL_ENI.d.cts} +3195 -2646
- package/dist/index.cjs +326 -315
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -240
- package/dist/index.d.ts +59 -240
- package/dist/index.js +46 -79
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +26 -38
- package/dist/indexes/index.d.cts +6 -41
- package/dist/indexes/index.d.ts +6 -41
- package/dist/indexes/index.js +14 -10
- package/dist/interchange/index.cjs +48 -39
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +7 -8
- package/dist/interchange/index.d.ts +7 -8
- package/dist/interchange/index.js +23 -14
- package/dist/interchange/index.js.map +1 -1
- package/dist/local-options-CZ1BnIoF.d.cts +29 -0
- package/dist/local-options-CZ1BnIoF.d.ts +29 -0
- package/dist/{manager-D00_NXvT.d.ts → manager-CASfhmzV.d.ts} +4 -173
- package/dist/{manager-nU1vTJLy.d.cts → manager-nCEJiYBb.d.cts} +4 -173
- package/dist/{materialize-indexes-zK2J_flP.d.ts → materialize-indexes-D4iei4Kp.d.ts} +1 -1
- package/dist/{materialize-indexes-CuR3gAZb.d.cts → materialize-indexes-ExQ6OrAh.d.cts} +1 -1
- package/dist/{postgres-IaBA4RgE.d.ts → postgres-Cl1ZAN1G.d.ts} +1 -1
- package/dist/{postgres-YrYmPlaU.d.cts → postgres-DMgIKQU-.d.cts} +1 -1
- package/dist/postgres-execution-fKW0qRiN.d.cts +14 -0
- package/dist/postgres-execution-fKW0qRiN.d.ts +14 -0
- package/dist/profiler/index.cjs +9 -8
- package/dist/profiler/index.cjs.map +1 -1
- package/dist/profiler/index.d.cts +9 -17
- package/dist/profiler/index.d.ts +9 -17
- package/dist/profiler/index.js +8 -7
- package/dist/profiler/index.js.map +1 -1
- package/dist/provenance/index.cjs +61 -55
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -8
- package/dist/provenance/index.d.ts +7 -8
- package/dist/provenance/index.js +34 -28
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +46 -37
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +8 -10
- package/dist/schema/index.d.ts +8 -10
- package/dist/schema/index.js +22 -13
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-BUOHPx7p.d.ts → sqlite-BDkW39aa.d.cts} +1 -1
- package/dist/{sqlite-Pp8O19WE.d.cts → sqlite-CYfhvESj.d.ts} +1 -1
- package/dist/sqlite-execution-DwbE2a9y.d.cts +32 -0
- package/dist/sqlite-execution-DwbE2a9y.d.ts +32 -0
- package/dist/{store-view-X96Rd00T.d.cts → store-view-BoHqdHjB.d.cts} +394 -1393
- package/dist/{store-view-ANL6mTph.d.ts → store-view-Ctq-3OHy.d.ts} +394 -1393
- package/dist/temporal-BC_NQV5Y.d.cts +281 -0
- package/dist/temporal-DqtOEo_B.d.ts +281 -0
- package/dist/{types-r-Zyq2Hz.d.cts → types-COq3-vMC.d.cts} +2 -2
- package/dist/{types-wsvuBgPK.d.ts → types-CUevi_D1.d.ts} +2 -2
- package/dist/{where-CJOpJj3a.d.ts → where-BdE_cYtx.d.ts} +5 -5
- package/dist/{where-K3uBP33l.d.cts → where-C92TXCzT.d.cts} +5 -5
- package/package.json +37 -6
- package/dist/chunk-27SSDCEP.cjs.map +0 -1
- package/dist/chunk-2N6EOBTH.cjs.map +0 -1
- package/dist/chunk-3C2RYI6L.cjs.map +0 -1
- package/dist/chunk-3DS7Z4T4.cjs.map +0 -1
- package/dist/chunk-3GH67G4Z.cjs.map +0 -1
- package/dist/chunk-3RWZPJKV.js.map +0 -1
- package/dist/chunk-3SLPDKHQ.js.map +0 -1
- package/dist/chunk-3XXGYU62.cjs.map +0 -1
- package/dist/chunk-44TA22QT.js +0 -1478
- package/dist/chunk-44TA22QT.js.map +0 -1
- package/dist/chunk-5AVRFNP4.cjs.map +0 -1
- package/dist/chunk-5KEQ74YU.cjs.map +0 -1
- package/dist/chunk-5KPNWT6X.js.map +0 -1
- package/dist/chunk-5PNMDJ7J.js.map +0 -1
- package/dist/chunk-6EEO3OVU.cjs.map +0 -1
- package/dist/chunk-7YSP4V4R.cjs +0 -69
- package/dist/chunk-7YSP4V4R.cjs.map +0 -1
- package/dist/chunk-A42GCBGX.cjs.map +0 -1
- package/dist/chunk-BVRDGYXQ.cjs.map +0 -1
- package/dist/chunk-BYPOGQWK.js.map +0 -1
- package/dist/chunk-CUHM5CWJ.cjs +0 -12
- package/dist/chunk-CUHM5CWJ.cjs.map +0 -1
- package/dist/chunk-DIQ3AV5W.cjs.map +0 -1
- package/dist/chunk-EJYMTO3K.cjs.map +0 -1
- package/dist/chunk-EXU3RASM.js.map +0 -1
- package/dist/chunk-GA4TT3DH.js.map +0 -1
- package/dist/chunk-IP3CGGPA.cjs.map +0 -1
- package/dist/chunk-IPSVVTWT.cjs +0 -1540
- package/dist/chunk-IPSVVTWT.cjs.map +0 -1
- package/dist/chunk-IXGYRP2P.js.map +0 -1
- package/dist/chunk-K3Q3LJY3.js.map +0 -1
- package/dist/chunk-KQJ54OG5.js.map +0 -1
- package/dist/chunk-L7HQ2OSI.js.map +0 -1
- package/dist/chunk-M6VES7V6.js +0 -239
- package/dist/chunk-M6VES7V6.js.map +0 -1
- package/dist/chunk-NUIG3BCV.cjs.map +0 -1
- package/dist/chunk-NXQFATMF.cjs.map +0 -1
- package/dist/chunk-OHMP6N2J.js +0 -47
- package/dist/chunk-OHMP6N2J.js.map +0 -1
- package/dist/chunk-QERAIDRJ.js.map +0 -1
- package/dist/chunk-QSXTWU4U.cjs +0 -12
- package/dist/chunk-RCVLFTCT.js.map +0 -1
- package/dist/chunk-TGOMW4MB.cjs.map +0 -1
- package/dist/chunk-TKT2XHED.js.map +0 -1
- package/dist/chunk-UGZUAYAR.js.map +0 -1
- package/dist/chunk-UV3WP5WZ.js.map +0 -1
- package/dist/chunk-UXLSNRYL.js.map +0 -1
- package/dist/chunk-UYQMBBWJ.js.map +0 -1
- package/dist/chunk-VKGKDOKR.js.map +0 -1
- package/dist/chunk-VL2V6PEN.cjs +0 -261
- package/dist/chunk-VL2V6PEN.cjs.map +0 -1
- package/dist/chunk-WOJMKB3N.cjs.map +0 -1
- package/dist/chunk-WWFHO375.cjs.map +0 -1
- package/dist/chunk-XGPUQ56G.js.map +0 -1
- package/dist/chunk-XGU7DZDA.cjs +0 -1095
- package/dist/chunk-XGU7DZDA.cjs.map +0 -1
- package/dist/chunk-XPCZADMT.cjs.map +0 -1
- package/dist/chunk-XWV4JT34.js.map +0 -1
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
import { createStoreWithSchema } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { createStoreWithSchema } from '../chunk-A2FGSWMQ.js';
|
|
2
|
+
import { compareStrings } from '../chunk-DRACN6XG.js';
|
|
3
|
+
import '../chunk-AOL64O4Z.js';
|
|
4
|
+
import { importGraphStream, exportGraphStream } from '../chunk-E6YZRKMM.js';
|
|
5
|
+
import '../chunk-UPXDVI3T.js';
|
|
6
|
+
import { storeBackend, generateId, computeUniqueKey, transactionBackend, lockRecordedGraphWrite, readRevisionOrigin, readRecordedClock } from '../chunk-RQPRCEIO.js';
|
|
7
|
+
import '../chunk-35S6P5ZU.js';
|
|
8
|
+
import '../chunk-PZHC5GCD.js';
|
|
9
|
+
import '../chunk-J6IJARLG.js';
|
|
10
|
+
import { computeSchemaHash, serializeSchema } from '../chunk-VBH7ZXSZ.js';
|
|
11
|
+
import { defineNode } from '../chunk-76HE7DJP.js';
|
|
12
|
+
import '../chunk-ZE6NVENI.js';
|
|
7
13
|
import { sortedReplacer } from '../chunk-UR7W5YQK.js';
|
|
8
|
-
import '../chunk-
|
|
9
|
-
import '../chunk-
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import '../chunk-
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import '../chunk-
|
|
20
|
-
import '../chunk-
|
|
21
|
-
import '../chunk-OHMP6N2J.js';
|
|
22
|
-
import '../chunk-PC2UBAUB.js';
|
|
14
|
+
import '../chunk-KFLXWVUJ.js';
|
|
15
|
+
import { getNodeKinds, getEdgeKinds, defineGraph } from '../chunk-PH4IJ3V5.js';
|
|
16
|
+
import '../chunk-I6FX7AAG.js';
|
|
17
|
+
import '../chunk-U4JDJKPD.js';
|
|
18
|
+
import '../chunk-BQITNFQJ.js';
|
|
19
|
+
import '../chunk-VDYA2HMS.js';
|
|
20
|
+
import { sha256Hex } from '../chunk-K34OPSJK.js';
|
|
21
|
+
import '../chunk-2EBMPJBO.js';
|
|
22
|
+
import '../chunk-G3CSQLLT.js';
|
|
23
|
+
import '../chunk-DDCIXXOO.js';
|
|
24
|
+
import '../chunk-Y7M44XEK.js';
|
|
25
|
+
import '../chunk-6XDBRDZE.js';
|
|
26
|
+
import '../chunk-D7PG5D5K.js';
|
|
23
27
|
import '../chunk-SNXVDZAJ.js';
|
|
28
|
+
import { requireDefined } from '../chunk-QMQLUA66.js';
|
|
29
|
+
import '../chunk-PC2UBAUB.js';
|
|
30
|
+
import { ok, err, isErr, computeTransitiveClosure, isReachable } from '../chunk-SCTZRFW5.js';
|
|
31
|
+
export { isErr, isOk, unwrap } from '../chunk-SCTZRFW5.js';
|
|
32
|
+
import '../chunk-GYA4JRP5.js';
|
|
33
|
+
import '../chunk-TAUGGLNQ.js';
|
|
24
34
|
import '../chunk-ITE4IXAK.js';
|
|
25
|
-
import
|
|
35
|
+
import '../chunk-XZA3Y4YH.js';
|
|
36
|
+
import { TypeGraphError } from '../chunk-DPNA466P.js';
|
|
26
37
|
import '../chunk-G6Q5UM7U.js';
|
|
27
38
|
import { z } from 'zod';
|
|
28
39
|
|
|
@@ -112,7 +123,7 @@ async function enumerateAllNodes(backend, graphId, kind) {
|
|
|
112
123
|
if (page.length < ENUMERATION_PAGE_SIZE) {
|
|
113
124
|
break;
|
|
114
125
|
}
|
|
115
|
-
after = page.at(-1).id;
|
|
126
|
+
after = requireDefined(page.at(-1)).id;
|
|
116
127
|
}
|
|
117
128
|
return collected;
|
|
118
129
|
}
|
|
@@ -134,7 +145,7 @@ async function enumerateAllEdges(backend, graphId, kind) {
|
|
|
134
145
|
if (page.length < ENUMERATION_PAGE_SIZE) {
|
|
135
146
|
break;
|
|
136
147
|
}
|
|
137
|
-
after = page.at(-1).id;
|
|
148
|
+
after = requireDefined(page.at(-1)).id;
|
|
138
149
|
}
|
|
139
150
|
return collected;
|
|
140
151
|
}
|
|
@@ -255,12 +266,12 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
|
255
266
|
const forkNodeVersions = /* @__PURE__ */ new Map();
|
|
256
267
|
for (const kind of nodeKinds) {
|
|
257
268
|
const baseRows = await enumerateAllNodes(
|
|
258
|
-
baseStore
|
|
269
|
+
storeBackend(baseStore),
|
|
259
270
|
baseStore.graphId,
|
|
260
271
|
kind
|
|
261
272
|
);
|
|
262
273
|
const forkRows = await enumerateAllNodes(
|
|
263
|
-
forkStore
|
|
274
|
+
storeBackend(forkStore),
|
|
264
275
|
forkStore.graphId,
|
|
265
276
|
kind
|
|
266
277
|
);
|
|
@@ -286,12 +297,12 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
|
286
297
|
const forkEdgeSignatures = /* @__PURE__ */ new Map();
|
|
287
298
|
for (const kind of edgeKinds) {
|
|
288
299
|
const baseRows = await enumerateAllEdges(
|
|
289
|
-
baseStore
|
|
300
|
+
storeBackend(baseStore),
|
|
290
301
|
baseStore.graphId,
|
|
291
302
|
kind
|
|
292
303
|
);
|
|
293
304
|
const forkRows = await enumerateAllEdges(
|
|
294
|
-
forkStore
|
|
305
|
+
storeBackend(forkStore),
|
|
295
306
|
forkStore.graphId,
|
|
296
307
|
kind
|
|
297
308
|
);
|
|
@@ -356,7 +367,10 @@ async function readActiveSchemaVersion(backend, graphId) {
|
|
|
356
367
|
return active?.version ?? FALLBACK_SCHEMA_VERSION;
|
|
357
368
|
}
|
|
358
369
|
async function computeSchemaComponent(store) {
|
|
359
|
-
const version = await readActiveSchemaVersion(
|
|
370
|
+
const version = await readActiveSchemaVersion(
|
|
371
|
+
storeBackend(store),
|
|
372
|
+
store.graphId
|
|
373
|
+
);
|
|
360
374
|
return computeSchemaHash(serializeSchema(store.graph, version));
|
|
361
375
|
}
|
|
362
376
|
function byDigestEntry(left, right) {
|
|
@@ -422,7 +436,7 @@ async function computeBaseVersion(store) {
|
|
|
422
436
|
}
|
|
423
437
|
const [schemaComponent, contentComponent] = await Promise.all([
|
|
424
438
|
computeSchemaComponent(store),
|
|
425
|
-
computeContentComponent(store
|
|
439
|
+
computeContentComponent(storeBackend(store), store.graphId, store.graph)
|
|
426
440
|
]);
|
|
427
441
|
return asBaseVersion(
|
|
428
442
|
`${schemaComponent}${TOKEN_SEPARATOR}${contentComponent}`
|
|
@@ -644,7 +658,7 @@ function blockNodes(newNodes, resolveConfig, uniqueConstraints = []) {
|
|
|
644
658
|
);
|
|
645
659
|
const ordered = /* @__PURE__ */ new Map();
|
|
646
660
|
for (const key of sortedKeys) {
|
|
647
|
-
const members = [...buckets.get(key)].sort(
|
|
661
|
+
const members = [...requireDefined(buckets.get(key))].sort(
|
|
648
662
|
(left, right) => compareStrings(left.id, right.id)
|
|
649
663
|
);
|
|
650
664
|
ordered.set(key, members);
|
|
@@ -672,7 +686,7 @@ function buildBranchRank(branchOrder, allBranchIds) {
|
|
|
672
686
|
return rank;
|
|
673
687
|
}
|
|
674
688
|
function pickByPriority(values, branchRank) {
|
|
675
|
-
let chosen = values[0];
|
|
689
|
+
let chosen = requireDefined(values[0]);
|
|
676
690
|
let chosenRank = branchRank.get(chosen.branchId) ?? Number.MAX_SAFE_INTEGER;
|
|
677
691
|
for (const candidate of values.slice(1)) {
|
|
678
692
|
const candidateRank = branchRank.get(candidate.branchId) ?? Number.MAX_SAFE_INTEGER;
|
|
@@ -686,7 +700,7 @@ function pickByPriority(values, branchRank) {
|
|
|
686
700
|
return chosen.value;
|
|
687
701
|
}
|
|
688
702
|
function pickByWeight(values, weights, branchRank) {
|
|
689
|
-
let chosen = values[0];
|
|
703
|
+
let chosen = requireDefined(values[0]);
|
|
690
704
|
let chosenWeight = weights.get(chosen.branchId) ?? 0;
|
|
691
705
|
let chosenRank = branchRank.get(chosen.branchId) ?? Number.MAX_SAFE_INTEGER;
|
|
692
706
|
for (const candidate of values.slice(1)) {
|
|
@@ -713,7 +727,7 @@ function allValuesEqual(values) {
|
|
|
713
727
|
if (values.length <= 1) {
|
|
714
728
|
return true;
|
|
715
729
|
}
|
|
716
|
-
const first = canonicalValueKey(values[0].value);
|
|
730
|
+
const first = canonicalValueKey(requireDefined(values[0]).value);
|
|
717
731
|
return values.every(
|
|
718
732
|
(candidate) => canonicalValueKey(candidate.value) === first
|
|
719
733
|
);
|
|
@@ -799,7 +813,7 @@ function pickClusterSurvivor(members, cluster, canonicalOverride, preferKind) {
|
|
|
799
813
|
const byKey = (left, right) => compareMergeKeys(mergeKeyOf(left), mergeKeyOf(right));
|
|
800
814
|
const baseMembers = members.filter((member) => member.origin === "base").sort(byKey);
|
|
801
815
|
if (baseMembers.length > 0) {
|
|
802
|
-
return baseMembers[0];
|
|
816
|
+
return requireDefined(baseMembers[0]);
|
|
803
817
|
}
|
|
804
818
|
let canonicalId;
|
|
805
819
|
if (canonicalOverride !== void 0) {
|
|
@@ -812,15 +826,15 @@ function pickClusterSurvivor(members, cluster, canonicalOverride, preferKind) {
|
|
|
812
826
|
const minIdentity = [...cluster.members].sort(
|
|
813
827
|
(left, right) => compareMergeKeys(left, right)
|
|
814
828
|
)[0];
|
|
815
|
-
canonicalId = minIdentity === void 0 ? members[0].id : idOf(minIdentity);
|
|
829
|
+
canonicalId = minIdentity === void 0 ? requireDefined(members[0]).id : idOf(minIdentity);
|
|
816
830
|
}
|
|
817
831
|
const membersAtId = members.filter((member) => member.id === canonicalId);
|
|
818
832
|
if (membersAtId.length === 0) {
|
|
819
|
-
return [...members].sort(byKey)[0];
|
|
833
|
+
return requireDefined([...members].sort(byKey)[0]);
|
|
820
834
|
}
|
|
821
835
|
const kinds = [...new Set(membersAtId.map((member) => member.kind))];
|
|
822
836
|
const chosenKind = preferKind !== void 0 && kinds.length > 1 ? preferKind(kinds) : void 0;
|
|
823
|
-
return (chosenKind === void 0 ? void 0 : membersAtId.find((member) => member.kind === chosenKind)) ?? [...membersAtId].sort(byKey)[0];
|
|
837
|
+
return (chosenKind === void 0 ? void 0 : membersAtId.find((member) => member.kind === chosenKind)) ?? requireDefined([...membersAtId].sort(byKey)[0]);
|
|
824
838
|
}
|
|
825
839
|
function findPreferredMember(members, property, preferredBranchId) {
|
|
826
840
|
if (preferredBranchId === void 0) {
|
|
@@ -847,7 +861,7 @@ function pickCanonicalPropertyValue(canonicalMember, members, property, values,
|
|
|
847
861
|
return preferredValue;
|
|
848
862
|
}
|
|
849
863
|
const canonicalValue = memberPropertyValue(canonicalMember, property);
|
|
850
|
-
return canonicalValue === void 0 ? values[0].value : canonicalValue;
|
|
864
|
+
return canonicalValue === void 0 ? requireDefined(values[0]).value : canonicalValue;
|
|
851
865
|
}
|
|
852
866
|
function unionProperties(canonicalMember, members, context, baseContext, branchRank, preferredBranchId) {
|
|
853
867
|
const canonicalId = canonicalMember.id;
|
|
@@ -962,11 +976,11 @@ var UnionFind = class {
|
|
|
962
976
|
this.add(value);
|
|
963
977
|
let root = value;
|
|
964
978
|
while (this.parent.get(root) !== root) {
|
|
965
|
-
root = this.parent.get(root);
|
|
979
|
+
root = requireDefined(this.parent.get(root));
|
|
966
980
|
}
|
|
967
981
|
let cursor = value;
|
|
968
982
|
while (cursor !== root) {
|
|
969
|
-
const next = this.parent.get(cursor);
|
|
983
|
+
const next = requireDefined(this.parent.get(cursor));
|
|
970
984
|
this.parent.set(cursor, root);
|
|
971
985
|
cursor = next;
|
|
972
986
|
}
|
|
@@ -1152,8 +1166,8 @@ function cosineSimilarity(left, right) {
|
|
|
1152
1166
|
let leftMagnitude = 0;
|
|
1153
1167
|
let rightMagnitude = 0;
|
|
1154
1168
|
for (let index = 0; index < left.length; index += 1) {
|
|
1155
|
-
const leftComponent = left[index];
|
|
1156
|
-
const rightComponent = right[index];
|
|
1169
|
+
const leftComponent = requireDefined(left[index]);
|
|
1170
|
+
const rightComponent = requireDefined(right[index]);
|
|
1157
1171
|
dot += leftComponent * rightComponent;
|
|
1158
1172
|
leftMagnitude += leftComponent * leftComponent;
|
|
1159
1173
|
rightMagnitude += rightComponent * rightComponent;
|
|
@@ -1387,7 +1401,10 @@ function buildComponents(edges, nodeIds, edgesSorted = false) {
|
|
|
1387
1401
|
});
|
|
1388
1402
|
}
|
|
1389
1403
|
clusters.sort(
|
|
1390
|
-
(left, right) => compareMergeKeys(
|
|
1404
|
+
(left, right) => compareMergeKeys(
|
|
1405
|
+
requireDefined(left.members[0]),
|
|
1406
|
+
requireDefined(right.members[0])
|
|
1407
|
+
)
|
|
1391
1408
|
);
|
|
1392
1409
|
return clusters;
|
|
1393
1410
|
}
|
|
@@ -1399,8 +1416,8 @@ function adjacencyOf(members, edges) {
|
|
|
1399
1416
|
}
|
|
1400
1417
|
for (const edge of edges) {
|
|
1401
1418
|
if (memberSet.has(edge.a) && memberSet.has(edge.b)) {
|
|
1402
|
-
adjacency.get(edge.a).add(edge.b);
|
|
1403
|
-
adjacency.get(edge.b).add(edge.a);
|
|
1419
|
+
requireDefined(adjacency.get(edge.a)).add(edge.b);
|
|
1420
|
+
requireDefined(adjacency.get(edge.b)).add(edge.a);
|
|
1404
1421
|
}
|
|
1405
1422
|
}
|
|
1406
1423
|
return adjacency;
|
|
@@ -1415,10 +1432,10 @@ function exceedsDiameter(members, edges, maxDiameter) {
|
|
|
1415
1432
|
const queue = [source];
|
|
1416
1433
|
let head = 0;
|
|
1417
1434
|
while (head < queue.length) {
|
|
1418
|
-
const current = queue[head];
|
|
1435
|
+
const current = requireDefined(queue[head]);
|
|
1419
1436
|
head += 1;
|
|
1420
|
-
const currentDistance = distance.get(current);
|
|
1421
|
-
for (const neighbor of adjacency.get(current)) {
|
|
1437
|
+
const currentDistance = requireDefined(distance.get(current));
|
|
1438
|
+
for (const neighbor of requireDefined(adjacency.get(current))) {
|
|
1422
1439
|
if (!distance.has(neighbor)) {
|
|
1423
1440
|
const neighborDistance = currentDistance + 1;
|
|
1424
1441
|
if (neighborDistance > maxDiameter) {
|
|
@@ -1501,7 +1518,10 @@ function enforceDiameter(clusters, candidateEdges, clusterMaxDiameter) {
|
|
|
1501
1518
|
}
|
|
1502
1519
|
}
|
|
1503
1520
|
guarded.sort(
|
|
1504
|
-
(left, right) => compareMergeKeys(
|
|
1521
|
+
(left, right) => compareMergeKeys(
|
|
1522
|
+
requireDefined(left.members[0]),
|
|
1523
|
+
requireDefined(right.members[0])
|
|
1524
|
+
)
|
|
1505
1525
|
);
|
|
1506
1526
|
return guarded;
|
|
1507
1527
|
}
|
|
@@ -1546,7 +1566,10 @@ function enforceBaseGuard(clusters, candidateEdges, baseIds) {
|
|
|
1546
1566
|
);
|
|
1547
1567
|
}
|
|
1548
1568
|
result.sort(
|
|
1549
|
-
(left, right) => compareMergeKeys(
|
|
1569
|
+
(left, right) => compareMergeKeys(
|
|
1570
|
+
requireDefined(left.members[0]),
|
|
1571
|
+
requireDefined(right.members[0])
|
|
1572
|
+
)
|
|
1550
1573
|
);
|
|
1551
1574
|
return { clusters: result, events };
|
|
1552
1575
|
}
|
|
@@ -1554,7 +1577,7 @@ function enforceBaseGuard(clusters, candidateEdges, baseIds) {
|
|
|
1554
1577
|
// src/graph-merge/delete-modify.ts
|
|
1555
1578
|
var DELETED_NODE_DROP_REASON = "delete-modify:deleteWins";
|
|
1556
1579
|
function pickHighestPriorityBranch(branchIds, branchRank) {
|
|
1557
|
-
let chosen = branchIds[0];
|
|
1580
|
+
let chosen = requireDefined(branchIds[0]);
|
|
1558
1581
|
let chosenRank = branchRank.get(chosen) ?? Number.MAX_SAFE_INTEGER;
|
|
1559
1582
|
for (const candidate of branchIds.slice(1)) {
|
|
1560
1583
|
const candidateRank = branchRank.get(candidate) ?? Number.MAX_SAFE_INTEGER;
|
|
@@ -1610,8 +1633,8 @@ function resolveDeleteModifyOver(modified, deleted, modifiedEntity, deletedEntit
|
|
|
1610
1633
|
}
|
|
1611
1634
|
continue;
|
|
1612
1635
|
}
|
|
1613
|
-
const deletionsForKey = deletedByKey.get(key);
|
|
1614
|
-
const { id, kind } = modifiedEntity(modifications[0]);
|
|
1636
|
+
const deletionsForKey = requireDefined(deletedByKey.get(key));
|
|
1637
|
+
const { id, kind } = modifiedEntity(requireDefined(modifications[0]));
|
|
1615
1638
|
const deletedBy = pickHighestPriorityBranch(
|
|
1616
1639
|
deletionsForKey.map((deletion) => deletion.branchId),
|
|
1617
1640
|
branchRank
|
|
@@ -1646,7 +1669,7 @@ function resolveDeleteModifyOver(modified, deleted, modifiedEntity, deletedEntit
|
|
|
1646
1669
|
if (conflictedKeys.has(key)) {
|
|
1647
1670
|
continue;
|
|
1648
1671
|
}
|
|
1649
|
-
const { id, kind } = deletedEntity(deletionsForKey[0]);
|
|
1672
|
+
const { id, kind } = deletedEntity(requireDefined(deletionsForKey[0]));
|
|
1650
1673
|
deletions.push({ id, kind });
|
|
1651
1674
|
}
|
|
1652
1675
|
return {
|
|
@@ -1678,10 +1701,10 @@ function reconcileOver(survivingModifications, entityOf, rebuild, policy, branch
|
|
|
1678
1701
|
const conflicts = [];
|
|
1679
1702
|
for (const modifications of grouped.values()) {
|
|
1680
1703
|
if (modifications.length === 1) {
|
|
1681
|
-
out.push(modifications[0]);
|
|
1704
|
+
out.push(requireDefined(modifications[0]));
|
|
1682
1705
|
continue;
|
|
1683
1706
|
}
|
|
1684
|
-
const first = entityOf(modifications[0]);
|
|
1707
|
+
const first = entityOf(requireDefined(modifications[0]));
|
|
1685
1708
|
const { props, conflicts: propertyConflicts } = threeWayMergeProps(
|
|
1686
1709
|
first.id,
|
|
1687
1710
|
first.kind,
|
|
@@ -1700,7 +1723,7 @@ function reconcileOver(survivingModifications, entityOf, rebuild, policy, branch
|
|
|
1700
1723
|
);
|
|
1701
1724
|
const representative = modifications.find(
|
|
1702
1725
|
(modification) => modification.branchId === chosenBranch
|
|
1703
|
-
) ?? modifications[0];
|
|
1726
|
+
) ?? requireDefined(modifications[0]);
|
|
1704
1727
|
out.push(rebuild(representative, chosenBranch, props));
|
|
1705
1728
|
for (const conflict of propertyConflicts) {
|
|
1706
1729
|
conflicts.push(conflict);
|
|
@@ -1748,7 +1771,7 @@ function threeWayMergeProps(entityId, kind, baseProps, contributions, context, b
|
|
|
1748
1771
|
}
|
|
1749
1772
|
for (const property of [...propertyNames].sort(compareStrings)) {
|
|
1750
1773
|
const baseHas = property in baseProps;
|
|
1751
|
-
const baseKey = baseHas ? canonicalValueKey(baseProps[property]) : void 0;
|
|
1774
|
+
const baseKey = baseHas ? canonicalValueKey(requireDefined(baseProps[property])) : void 0;
|
|
1752
1775
|
const changed = contributions.filter((contribution) => {
|
|
1753
1776
|
if (!(property in contribution.forkProps)) {
|
|
1754
1777
|
return false;
|
|
@@ -1765,7 +1788,7 @@ function threeWayMergeProps(entityId, kind, baseProps, contributions, context, b
|
|
|
1765
1788
|
(contribution) => !(property in contribution.forkProps)
|
|
1766
1789
|
);
|
|
1767
1790
|
if (baseHas && !deletedByFork) {
|
|
1768
|
-
merged[property] = baseProps[property];
|
|
1791
|
+
merged[property] = requireDefined(baseProps[property]);
|
|
1769
1792
|
}
|
|
1770
1793
|
continue;
|
|
1771
1794
|
}
|
|
@@ -1773,13 +1796,13 @@ function threeWayMergeProps(entityId, kind, baseProps, contributions, context, b
|
|
|
1773
1796
|
values.map((candidate) => canonicalValueKey(candidate.value))
|
|
1774
1797
|
);
|
|
1775
1798
|
if (distinctValues.size === 1) {
|
|
1776
|
-
merged[property] = values[0].value;
|
|
1799
|
+
merged[property] = requireDefined(values[0]).value;
|
|
1777
1800
|
continue;
|
|
1778
1801
|
}
|
|
1779
1802
|
const preferredValue = values.find(
|
|
1780
1803
|
(value2) => value2.branchId === preferredBranchId
|
|
1781
1804
|
)?.value;
|
|
1782
|
-
const canonicalValue = preferredValue ?? (baseHas ? baseProps[property] : values[0].value);
|
|
1805
|
+
const canonicalValue = preferredValue ?? (baseHas ? requireDefined(baseProps[property]) : requireDefined(values[0]).value);
|
|
1783
1806
|
const reportedValues = preferredBranchId === void 0 ? values : values.filter((value2) => value2.branchId !== preferredBranchId);
|
|
1784
1807
|
const { value, conflict } = resolvePropertyUnion(
|
|
1785
1808
|
{ entityId, kind, property, values, reportedValues, canonicalValue },
|
|
@@ -1864,7 +1887,7 @@ function groupKey(fromKey, type, toKey) {
|
|
|
1864
1887
|
function pickSurvivor(edges, preferredBranchId) {
|
|
1865
1888
|
const preferred = preferredBranchId === void 0 ? [] : edges.filter((edge) => edge.staged.branchId === preferredBranchId);
|
|
1866
1889
|
const candidates = preferred.length > 0 ? preferred : edges;
|
|
1867
|
-
let survivor = candidates[0];
|
|
1890
|
+
let survivor = requireDefined(candidates[0]);
|
|
1868
1891
|
for (const candidate of candidates.slice(1)) {
|
|
1869
1892
|
if (candidate.staged.id < survivor.staged.id) {
|
|
1870
1893
|
survivor = candidate;
|
|
@@ -1889,7 +1912,7 @@ function unionEdgeProps(survivorId, kind, survivor, edges, context, branchRank,
|
|
|
1889
1912
|
if (values.length === 0) {
|
|
1890
1913
|
continue;
|
|
1891
1914
|
}
|
|
1892
|
-
const survivorValue = property in survivor.staged.props ? survivor.staged.props[property] : values[0].value;
|
|
1915
|
+
const survivorValue = property in survivor.staged.props ? survivor.staged.props[property] : requireDefined(values[0]).value;
|
|
1893
1916
|
const canonicalValue = values.find((value2) => value2.branchId === preferredBranchId)?.value ?? survivorValue;
|
|
1894
1917
|
const reportedValues = preferredBranchId === void 0 ? values : values.filter((value2) => value2.branchId !== preferredBranchId);
|
|
1895
1918
|
const { value, conflict } = resolvePropertyUnion(
|
|
@@ -1955,10 +1978,10 @@ function repointEdges(stagedEdges, canonicalOf, deletedNodeIds, policy, branchRa
|
|
|
1955
1978
|
(left, right) => compareStrings(left, right)
|
|
1956
1979
|
);
|
|
1957
1980
|
for (const group of sortedGroups) {
|
|
1958
|
-
const dedupeKeys = [...dedupeKeyByGroup.get(group)];
|
|
1981
|
+
const dedupeKeys = [...requireDefined(dedupeKeyByGroup.get(group))];
|
|
1959
1982
|
const groupEdges = [];
|
|
1960
1983
|
for (const key of dedupeKeys) {
|
|
1961
|
-
for (const edge of liveByDedupeKey.get(key)) {
|
|
1984
|
+
for (const edge of requireDefined(liveByDedupeKey.get(key))) {
|
|
1962
1985
|
groupEdges.push(edge);
|
|
1963
1986
|
}
|
|
1964
1987
|
}
|
|
@@ -2262,7 +2285,12 @@ function windowedPairs(members, config) {
|
|
|
2262
2285
|
for (let index = 0; index < keyed.length; index += 1) {
|
|
2263
2286
|
const last = Math.min(index + config.window, keyed.length - 1);
|
|
2264
2287
|
for (let index_ = index + 1; index_ <= last; index_ += 1) {
|
|
2265
|
-
pairs.push(
|
|
2288
|
+
pairs.push(
|
|
2289
|
+
orderEndpoints(
|
|
2290
|
+
requireDefined(keyed[index]).node,
|
|
2291
|
+
requireDefined(keyed[index_]).node
|
|
2292
|
+
)
|
|
2293
|
+
);
|
|
2266
2294
|
}
|
|
2267
2295
|
}
|
|
2268
2296
|
return pairs;
|
|
@@ -2280,7 +2308,12 @@ function pairsFromBlocks(blocks, keyless) {
|
|
|
2280
2308
|
}
|
|
2281
2309
|
for (let index = 0; index < members.length; index += 1) {
|
|
2282
2310
|
for (let index_ = index + 1; index_ < members.length; index_ += 1) {
|
|
2283
|
-
pairs.push(
|
|
2311
|
+
pairs.push(
|
|
2312
|
+
orderEndpoints(
|
|
2313
|
+
requireDefined(members[index]),
|
|
2314
|
+
requireDefined(members[index_])
|
|
2315
|
+
)
|
|
2316
|
+
);
|
|
2284
2317
|
}
|
|
2285
2318
|
}
|
|
2286
2319
|
}
|
|
@@ -2295,7 +2328,10 @@ function forcedEdgesFromBlocks(blocks) {
|
|
|
2295
2328
|
const members = sortMembersById(blocks.get(bucketKey) ?? []);
|
|
2296
2329
|
for (let index = 0; index < members.length; index += 1) {
|
|
2297
2330
|
for (let index_ = index + 1; index_ < members.length; index_ += 1) {
|
|
2298
|
-
const { a, b } = orderEndpoints(
|
|
2331
|
+
const { a, b } = orderEndpoints(
|
|
2332
|
+
requireDefined(members[index]),
|
|
2333
|
+
requireDefined(members[index_])
|
|
2334
|
+
);
|
|
2299
2335
|
edges.push({ a, b, score: FORCED_MATCH_SCORE });
|
|
2300
2336
|
}
|
|
2301
2337
|
}
|
|
@@ -2328,8 +2364,8 @@ function ontologyRetypeEdges(stagedIdentities, isRetypeCompatible) {
|
|
|
2328
2364
|
}
|
|
2329
2365
|
for (let index = 1; index < members.length; index += 1) {
|
|
2330
2366
|
edges.push({
|
|
2331
|
-
a: members[0],
|
|
2332
|
-
b: members[index],
|
|
2367
|
+
a: requireDefined(members[0]),
|
|
2368
|
+
b: requireDefined(members[index]),
|
|
2333
2369
|
score: FORCED_MATCH_SCORE
|
|
2334
2370
|
});
|
|
2335
2371
|
}
|
|
@@ -2345,10 +2381,13 @@ function unionByCompatibility(identities, isRetypeCompatible) {
|
|
|
2345
2381
|
for (let index = 0; index < identities.length; index += 1) {
|
|
2346
2382
|
for (let index_ = index + 1; index_ < identities.length; index_ += 1) {
|
|
2347
2383
|
if (isRetypeCompatible([
|
|
2348
|
-
kindOf(identities[index]),
|
|
2349
|
-
kindOf(identities[index_])
|
|
2384
|
+
kindOf(requireDefined(identities[index])),
|
|
2385
|
+
kindOf(requireDefined(identities[index_]))
|
|
2350
2386
|
])) {
|
|
2351
|
-
forest.union(
|
|
2387
|
+
forest.union(
|
|
2388
|
+
requireDefined(identities[index]),
|
|
2389
|
+
requireDefined(identities[index_])
|
|
2390
|
+
);
|
|
2352
2391
|
}
|
|
2353
2392
|
}
|
|
2354
2393
|
}
|
|
@@ -2359,7 +2398,7 @@ function unionByCompatibility(identities, isRetypeCompatible) {
|
|
|
2359
2398
|
function groupsOf(identities, representativeOf) {
|
|
2360
2399
|
const byRoot = /* @__PURE__ */ new Map();
|
|
2361
2400
|
for (const identity of identities) {
|
|
2362
|
-
const root = representativeOf.get(identity);
|
|
2401
|
+
const root = requireDefined(representativeOf.get(identity));
|
|
2363
2402
|
const bucket = byRoot.get(root);
|
|
2364
2403
|
if (bucket === void 0) {
|
|
2365
2404
|
byRoot.set(root, [identity]);
|
|
@@ -2545,7 +2584,7 @@ function groupByKind(items) {
|
|
|
2545
2584
|
)) {
|
|
2546
2585
|
ordered.set(
|
|
2547
2586
|
kind,
|
|
2548
|
-
[...buckets.get(kind)].sort(
|
|
2587
|
+
[...requireDefined(buckets.get(kind))].sort(
|
|
2549
2588
|
(left, right) => compareByIdThenBranch(left, right)
|
|
2550
2589
|
)
|
|
2551
2590
|
);
|
|
@@ -2674,7 +2713,9 @@ function mostSpecificCommonKind(closure, kinds) {
|
|
|
2674
2713
|
if (qualifiers.length === 0) {
|
|
2675
2714
|
return void 0;
|
|
2676
2715
|
}
|
|
2677
|
-
return
|
|
2716
|
+
return requireDefined(
|
|
2717
|
+
[...qualifiers].sort((left, right) => compareStrings(left, right))[0]
|
|
2718
|
+
);
|
|
2678
2719
|
}
|
|
2679
2720
|
function reconcileTypes(clusters, closure, mode) {
|
|
2680
2721
|
if (mode === "off") {
|
|
@@ -2779,7 +2820,7 @@ async function precomputeEmbeddings(byKind, resolve, embedder) {
|
|
|
2779
2820
|
);
|
|
2780
2821
|
}
|
|
2781
2822
|
for (const [index, text] of orderedTexts.entries()) {
|
|
2782
|
-
lookup.set(text, vectors[index]);
|
|
2823
|
+
lookup.set(text, requireDefined(vectors[index]));
|
|
2783
2824
|
}
|
|
2784
2825
|
return lookup;
|
|
2785
2826
|
}
|
|
@@ -2816,7 +2857,7 @@ async function embedMissingPairTexts(base, pairs, strategy, embedder) {
|
|
|
2816
2857
|
}
|
|
2817
2858
|
const augmented = new Map(existing);
|
|
2818
2859
|
for (const [index, text] of orderedTexts.entries()) {
|
|
2819
|
-
augmented.set(text, vectors[index]);
|
|
2860
|
+
augmented.set(text, requireDefined(vectors[index]));
|
|
2820
2861
|
}
|
|
2821
2862
|
return augmented;
|
|
2822
2863
|
}
|
|
@@ -3265,8 +3306,14 @@ function planMerge(staging, candidateEdges, candidateWarnings, baseMembers, opti
|
|
|
3265
3306
|
dropped,
|
|
3266
3307
|
baseAmbiguities: baseAmbiguities.sort(
|
|
3267
3308
|
(left, right) => compareMergeKeys(
|
|
3268
|
-
mergeKey(
|
|
3269
|
-
|
|
3309
|
+
mergeKey(
|
|
3310
|
+
requireDefined(left.baseIds[0]).kind,
|
|
3311
|
+
requireDefined(left.baseIds[0]).id
|
|
3312
|
+
),
|
|
3313
|
+
mergeKey(
|
|
3314
|
+
requireDefined(right.baseIds[0]).kind,
|
|
3315
|
+
requireDefined(right.baseIds[0]).id
|
|
3316
|
+
)
|
|
3270
3317
|
)
|
|
3271
3318
|
),
|
|
3272
3319
|
provenanceRecords,
|
|
@@ -3373,7 +3420,7 @@ async function applyMergePlan(plan, nodesApi, edgesApi) {
|
|
|
3373
3420
|
return { nodes: committedNodeIds.size, edges: committedEdges };
|
|
3374
3421
|
}
|
|
3375
3422
|
async function commitPlan(target, plan, expectedBaseVersion) {
|
|
3376
|
-
if (!target.
|
|
3423
|
+
if (!storeBackend(target).capabilities.transactions) {
|
|
3377
3424
|
throw new MergeError(
|
|
3378
3425
|
"merge() requires a transaction-capable target backend. The merged plan (canonical upserts, soft-deletes, edge upserts) must commit atomically; a non-transactional fallback would leave a partially-merged graph on a mid-commit failure. (mergeIncremental() enforces the same requirement.)",
|
|
3379
3426
|
{ details: { capability: "transactions" } }
|
|
@@ -3382,7 +3429,11 @@ async function commitPlan(target, plan, expectedBaseVersion) {
|
|
|
3382
3429
|
return withTxConflictRetry(
|
|
3383
3430
|
() => target.transaction(async (tx) => {
|
|
3384
3431
|
if (expectedBaseVersion !== void 0) {
|
|
3385
|
-
await assertTargetUnchanged(
|
|
3432
|
+
await assertTargetUnchanged(
|
|
3433
|
+
transactionBackend(tx),
|
|
3434
|
+
target,
|
|
3435
|
+
expectedBaseVersion
|
|
3436
|
+
);
|
|
3386
3437
|
}
|
|
3387
3438
|
return applyMergePlan(
|
|
3388
3439
|
plan,
|
|
@@ -3543,7 +3594,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
3543
3594
|
options.embedder
|
|
3544
3595
|
);
|
|
3545
3596
|
const ctx = {
|
|
3546
|
-
backend: store
|
|
3597
|
+
backend: storeBackend(store),
|
|
3547
3598
|
...embeddings === void 0 ? {} : { embeddings }
|
|
3548
3599
|
};
|
|
3549
3600
|
const candidates = await generateAllCandidates(
|
|
@@ -3586,7 +3637,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
3586
3637
|
if (options.persistProvenance) {
|
|
3587
3638
|
try {
|
|
3588
3639
|
const provenanceStore = await openProvenanceStore(
|
|
3589
|
-
target
|
|
3640
|
+
storeBackend(target),
|
|
3590
3641
|
target.graphId
|
|
3591
3642
|
);
|
|
3592
3643
|
const count = await persistProvenanceRecords(
|
|
@@ -3906,12 +3957,12 @@ async function validateIncrementalEdgeWrites(target, edgesApi, plan) {
|
|
|
3906
3957
|
);
|
|
3907
3958
|
}
|
|
3908
3959
|
throw new MergeError(
|
|
3909
|
-
`mergeIncremental() would overwrite committed edge "${id}" (kind "${row.kind}") with a different-kind edge "${plannedKindById.get(id)}" of the same id.`,
|
|
3960
|
+
`mergeIncremental() would overwrite committed edge "${id}" (kind "${row.kind}") with a different-kind edge "${requireDefined(plannedKindById.get(id))}" of the same id.`,
|
|
3910
3961
|
{
|
|
3911
3962
|
details: {
|
|
3912
3963
|
id,
|
|
3913
3964
|
committedKind: row.kind,
|
|
3914
|
-
plannedKind: plannedKindById.get(id)
|
|
3965
|
+
plannedKind: requireDefined(plannedKindById.get(id))
|
|
3915
3966
|
}
|
|
3916
3967
|
}
|
|
3917
3968
|
);
|
|
@@ -4031,7 +4082,7 @@ async function assertInheritedUnchanged(args) {
|
|
|
4031
4082
|
for (const [kind, ids] of idsByKind) {
|
|
4032
4083
|
const rows = await args.fetchRows(kind, ids);
|
|
4033
4084
|
for (const [index, id] of ids.entries()) {
|
|
4034
|
-
const expected = args.expected.get(mergeKey(kind, id));
|
|
4085
|
+
const expected = requireDefined(args.expected.get(mergeKey(kind, id)));
|
|
4035
4086
|
const current = args.deriveValue(rows[index]);
|
|
4036
4087
|
if (current === expected) {
|
|
4037
4088
|
continue;
|
|
@@ -4102,7 +4153,7 @@ async function assertInheritedEdgesUnchanged(edgesApi, guard, plan) {
|
|
|
4102
4153
|
});
|
|
4103
4154
|
}
|
|
4104
4155
|
async function commitIncrementalPlan(target, plan, guard) {
|
|
4105
|
-
if (!target.
|
|
4156
|
+
if (!storeBackend(target).capabilities.transactions) {
|
|
4106
4157
|
throw new MergeError(
|
|
4107
4158
|
"mergeIncremental() requires a transaction-capable target backend. Incremental writes must preflight existing rows and commit atomically; non-transactional fallback would allow partial graph writes.",
|
|
4108
4159
|
{ details: { capability: "transactions" } }
|
|
@@ -4111,7 +4162,7 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
4111
4162
|
return withTxConflictRetry(
|
|
4112
4163
|
() => target.transaction(async (tx) => {
|
|
4113
4164
|
if (target.revisionTrackingEnabled) {
|
|
4114
|
-
await lockRecordedGraphWrite(tx
|
|
4165
|
+
await lockRecordedGraphWrite(transactionBackend(tx), target.graphId);
|
|
4115
4166
|
}
|
|
4116
4167
|
const nodesApi = tx.nodes;
|
|
4117
4168
|
const edgesApi = tx.edges;
|