@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/ontology/constants.ts
|
|
4
|
+
var META_EDGE_SUB_CLASS_OF = "subClassOf";
|
|
5
|
+
var META_EDGE_BROADER = "broader";
|
|
6
|
+
var META_EDGE_NARROWER = "narrower";
|
|
7
|
+
var META_EDGE_RELATED_TO = "relatedTo";
|
|
8
|
+
var META_EDGE_EQUIVALENT_TO = "equivalentTo";
|
|
9
|
+
var META_EDGE_SAME_AS = "sameAs";
|
|
10
|
+
var META_EDGE_DIFFERENT_FROM = "differentFrom";
|
|
11
|
+
var META_EDGE_DISJOINT_WITH = "disjointWith";
|
|
12
|
+
var META_EDGE_PART_OF = "partOf";
|
|
13
|
+
var META_EDGE_HAS_PART = "hasPart";
|
|
14
|
+
var META_EDGE_INVERSE_OF = "inverseOf";
|
|
15
|
+
var META_EDGE_IMPLIES = "implies";
|
|
16
|
+
var ALL_META_EDGE_NAMES = [
|
|
17
|
+
META_EDGE_SUB_CLASS_OF,
|
|
18
|
+
META_EDGE_BROADER,
|
|
19
|
+
META_EDGE_NARROWER,
|
|
20
|
+
META_EDGE_RELATED_TO,
|
|
21
|
+
META_EDGE_EQUIVALENT_TO,
|
|
22
|
+
META_EDGE_SAME_AS,
|
|
23
|
+
META_EDGE_DIFFERENT_FROM,
|
|
24
|
+
META_EDGE_DISJOINT_WITH,
|
|
25
|
+
META_EDGE_PART_OF,
|
|
26
|
+
META_EDGE_HAS_PART,
|
|
27
|
+
META_EDGE_INVERSE_OF,
|
|
28
|
+
META_EDGE_IMPLIES
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
exports.ALL_META_EDGE_NAMES = ALL_META_EDGE_NAMES;
|
|
32
|
+
exports.META_EDGE_BROADER = META_EDGE_BROADER;
|
|
33
|
+
exports.META_EDGE_DIFFERENT_FROM = META_EDGE_DIFFERENT_FROM;
|
|
34
|
+
exports.META_EDGE_DISJOINT_WITH = META_EDGE_DISJOINT_WITH;
|
|
35
|
+
exports.META_EDGE_EQUIVALENT_TO = META_EDGE_EQUIVALENT_TO;
|
|
36
|
+
exports.META_EDGE_HAS_PART = META_EDGE_HAS_PART;
|
|
37
|
+
exports.META_EDGE_IMPLIES = META_EDGE_IMPLIES;
|
|
38
|
+
exports.META_EDGE_INVERSE_OF = META_EDGE_INVERSE_OF;
|
|
39
|
+
exports.META_EDGE_NARROWER = META_EDGE_NARROWER;
|
|
40
|
+
exports.META_EDGE_PART_OF = META_EDGE_PART_OF;
|
|
41
|
+
exports.META_EDGE_RELATED_TO = META_EDGE_RELATED_TO;
|
|
42
|
+
exports.META_EDGE_SAME_AS = META_EDGE_SAME_AS;
|
|
43
|
+
exports.META_EDGE_SUB_CLASS_OF = META_EDGE_SUB_CLASS_OF;
|
|
44
|
+
//# sourceMappingURL=chunk-SVJ5GEXW.cjs.map
|
|
45
|
+
//# sourceMappingURL=chunk-SVJ5GEXW.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ontology/constants.ts"],"names":[],"mappings":";;;AAYO,IAAM,sBAAA,GAAyB;AAG/B,IAAM,iBAAA,GAAoB;AAG1B,IAAM,kBAAA,GAAqB;AAG3B,IAAM,oBAAA,GAAuB;AAG7B,IAAM,uBAAA,GAA0B;AAGhC,IAAM,iBAAA,GAAoB;AAG1B,IAAM,wBAAA,GAA2B;AAGjC,IAAM,uBAAA,GAA0B;AAGhC,IAAM,iBAAA,GAAoB;AAG1B,IAAM,kBAAA,GAAqB;AAG3B,IAAM,oBAAA,GAAuB;AAG7B,IAAM,iBAAA,GAAoB;AAM1B,IAAM,mBAAA,GAAsB;AAAA,EACjC,sBAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA,oBAAA;AAAA,EACA,uBAAA;AAAA,EACA,iBAAA;AAAA,EACA,wBAAA;AAAA,EACA,uBAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF","file":"chunk-SVJ5GEXW.cjs","sourcesContent":["/**\n * Named constants for ontology meta-edge names.\n *\n * Use these constants instead of string literals for type safety\n * and IDE support.\n */\n\n// ============================================================\n// Meta-Edge Names\n// ============================================================\n\n/** Type inheritance (Podcast subClassOf Media) */\nexport const META_EDGE_SUB_CLASS_OF = \"subClassOf\" as const;\n\n/** Broader concept (ML broader AI) */\nexport const META_EDGE_BROADER = \"broader\" as const;\n\n/** Narrower concept (AI narrower ML) */\nexport const META_EDGE_NARROWER = \"narrower\" as const;\n\n/** Non-hierarchical association */\nexport const META_EDGE_RELATED_TO = \"relatedTo\" as const;\n\n/** Same class, different representation */\nexport const META_EDGE_EQUIVALENT_TO = \"equivalentTo\" as const;\n\n/** Same individual (for deduplication) */\nexport const META_EDGE_SAME_AS = \"sameAs\" as const;\n\n/** Explicitly different individuals */\nexport const META_EDGE_DIFFERENT_FROM = \"differentFrom\" as const;\n\n/** Mutually exclusive types */\nexport const META_EDGE_DISJOINT_WITH = \"disjointWith\" as const;\n\n/** X is part of Y */\nexport const META_EDGE_PART_OF = \"partOf\" as const;\n\n/** Y has part X */\nexport const META_EDGE_HAS_PART = \"hasPart\" as const;\n\n/** Edge A is inverse of edge B */\nexport const META_EDGE_INVERSE_OF = \"inverseOf\" as const;\n\n/** Edge A implies edge B exists */\nexport const META_EDGE_IMPLIES = \"implies\" as const;\n\n// ============================================================\n// All Meta-Edge Names (for validation)\n// ============================================================\n\nexport const ALL_META_EDGE_NAMES = [\n META_EDGE_SUB_CLASS_OF,\n META_EDGE_BROADER,\n META_EDGE_NARROWER,\n META_EDGE_RELATED_TO,\n META_EDGE_EQUIVALENT_TO,\n META_EDGE_SAME_AS,\n META_EDGE_DIFFERENT_FROM,\n META_EDGE_DISJOINT_WITH,\n META_EDGE_PART_OF,\n META_EDGE_HAS_PART,\n META_EDGE_INVERSE_OF,\n META_EDGE_IMPLIES,\n] as const;\n\nexport type MetaEdgeName = (typeof ALL_META_EDGE_NAMES)[number];\n"]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkDDCYVIVV_cjs = require('./chunk-DDCYVIVV.cjs');
|
|
4
|
+
var chunkSAFZ6JTI_cjs = require('./chunk-SAFZ6JTI.cjs');
|
|
5
|
+
|
|
6
|
+
// src/core/temporal.ts
|
|
7
|
+
var RECORDED_MAX = "9999-12-31T23:59:59.999Z";
|
|
8
|
+
function assertValidRecordedInstant(value, path) {
|
|
9
|
+
chunkDDCYVIVV_cjs.validateCanonicalIsoDate(value, path);
|
|
10
|
+
if (value >= RECORDED_MAX) {
|
|
11
|
+
throw new chunkSAFZ6JTI_cjs.ValidationError(
|
|
12
|
+
`${path} must be before the recorded-time open sentinel ${RECORDED_MAX}.`,
|
|
13
|
+
{
|
|
14
|
+
issues: [
|
|
15
|
+
{
|
|
16
|
+
path,
|
|
17
|
+
message: `Expected a timestamp before ${RECORDED_MAX}, got "${value}"`
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
suggestion: "Use a real recorded-time commit instant, not the open-interval sentinel."
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function asRecordedInstant(value) {
|
|
28
|
+
assertValidRecordedInstant(value, "asRecordedInstant");
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
function resolveReadCoordinate(mode, asOf, suggestion) {
|
|
32
|
+
if (mode !== "asOf" && asOf !== void 0) {
|
|
33
|
+
throw new chunkSAFZ6JTI_cjs.ValidationError(
|
|
34
|
+
`Temporal mode "${mode}" does not take an asOf timestamp.`,
|
|
35
|
+
{
|
|
36
|
+
issues: [
|
|
37
|
+
{
|
|
38
|
+
path: "asOf",
|
|
39
|
+
message: `asOf is only valid with mode "asOf", not "${mode}"`
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
suggestion: 'Pin an instant with store.asOf(timestamp) or store.view({ mode: "asOf", asOf }); drop asOf for other modes.'
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
assertValidAsOf(
|
|
49
|
+
mode,
|
|
50
|
+
asOf,
|
|
51
|
+
suggestion === void 0 ? void 0 : { suggestion }
|
|
52
|
+
);
|
|
53
|
+
return { valid: asOf === void 0 ? { mode } : { mode, asOf } };
|
|
54
|
+
}
|
|
55
|
+
function withRecordedCoordinate(coordinate, recordedAsOf) {
|
|
56
|
+
assertValidRecordedInstant(recordedAsOf, "asOfRecorded");
|
|
57
|
+
return {
|
|
58
|
+
...coordinate,
|
|
59
|
+
recorded: { asOf: recordedAsOf }
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function assertValidAsOf(mode, asOf, options) {
|
|
63
|
+
if (mode === "asOf" && asOf === void 0) {
|
|
64
|
+
throw new chunkSAFZ6JTI_cjs.ValidationError(
|
|
65
|
+
'Temporal mode "asOf" requires a timestamp',
|
|
66
|
+
{
|
|
67
|
+
issues: [
|
|
68
|
+
{ path: "asOf", message: "Timestamp is required for asOf mode" }
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
suggestion: options?.suggestion ?? 'Provide an ISO-8601 timestamp for asOf mode, e.g. "2026-01-01T00:00:00.000Z".'
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
if (asOf !== void 0) {
|
|
77
|
+
chunkDDCYVIVV_cjs.validateCanonicalIsoDate(asOf, "asOf");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function describeCoordinate(coordinate) {
|
|
81
|
+
const { mode, asOf } = coordinate.valid;
|
|
82
|
+
const valid = asOf === void 0 ? `mode "${mode}"` : `mode "${mode}" asOf ${asOf}`;
|
|
83
|
+
return coordinate.recorded === void 0 ? valid : `${valid}, recorded asOf ${coordinate.recorded.asOf}`;
|
|
84
|
+
}
|
|
85
|
+
function coordinateContext(coordinate) {
|
|
86
|
+
const { mode, asOf } = coordinate.valid;
|
|
87
|
+
return {
|
|
88
|
+
temporalMode: mode,
|
|
89
|
+
...asOf !== void 0 && { asOf },
|
|
90
|
+
...coordinate.recorded === void 0 ? {} : { recordedAsOf: coordinate.recorded.asOf }
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
exports.RECORDED_MAX = RECORDED_MAX;
|
|
95
|
+
exports.asRecordedInstant = asRecordedInstant;
|
|
96
|
+
exports.assertValidRecordedInstant = assertValidRecordedInstant;
|
|
97
|
+
exports.coordinateContext = coordinateContext;
|
|
98
|
+
exports.describeCoordinate = describeCoordinate;
|
|
99
|
+
exports.resolveReadCoordinate = resolveReadCoordinate;
|
|
100
|
+
exports.withRecordedCoordinate = withRecordedCoordinate;
|
|
101
|
+
//# sourceMappingURL=chunk-SVUKGWSN.cjs.map
|
|
102
|
+
//# sourceMappingURL=chunk-SVUKGWSN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/temporal.ts"],"names":["validateCanonicalIsoDate","ValidationError"],"mappings":";;;;;;AAYO,IAAM,YAAA,GAAe;AAsBrB,SAAS,0BAAA,CAA2B,OAAe,IAAA,EAAoB;AAC5E,EAAAA,0CAAA,CAAyB,OAAO,IAAI,CAAA;AACpC,EAAA,IAAI,SAAS,YAAA,EAAc;AACzB,IAAA,MAAM,IAAIC,iCAAA;AAAA,MACR,CAAA,EAAG,IAAI,CAAA,gDAAA,EAAmD,YAAY,CAAA,CAAA,CAAA;AAAA,MACtE;AAAA,QACE,MAAA,EAAQ;AAAA,UACN;AAAA,YACE,IAAA;AAAA,YACA,OAAA,EAAS,CAAA,4BAAA,EAA+B,YAAY,CAAA,OAAA,EAAU,KAAK,CAAA,CAAA;AAAA;AACrE;AACF,OACF;AAAA,MACA;AAAA,QACE,UAAA,EACE;AAAA;AACJ,KACF;AAAA,EACF;AACF;AAeO,SAAS,kBAAkB,KAAA,EAAgC;AAChE,EAAA,0BAAA,CAA2B,OAAO,mBAAmB,CAAA;AACrD,EAAA,OAAO,KAAA;AACT;AAmCO,SAAS,qBAAA,CACd,IAAA,EACA,IAAA,EACA,UAAA,EACgB;AAChB,EAAA,IAAI,IAAA,KAAS,MAAA,IAAU,IAAA,KAAS,MAAA,EAAW;AACzC,IAAA,MAAM,IAAIA,iCAAA;AAAA,MACR,kBAAkB,IAAI,CAAA,kCAAA,CAAA;AAAA,MACtB;AAAA,QACE,MAAA,EAAQ;AAAA,UACN;AAAA,YACE,IAAA,EAAM,MAAA;AAAA,YACN,OAAA,EAAS,6CAA6C,IAAI,CAAA,CAAA;AAAA;AAC5D;AACF,OACF;AAAA,MACA;AAAA,QACE,UAAA,EACE;AAAA;AACJ,KACF;AAAA,EACF;AACA,EAAA,eAAA;AAAA,IACE,IAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA,KAAe,MAAA,GAAY,MAAA,GAAY,EAAE,UAAA;AAAW,GACtD;AACA,EAAA,OAAO,EAAE,KAAA,EAAO,IAAA,KAAS,MAAA,GAAY,EAAE,MAAK,GAAI,EAAE,IAAA,EAAM,IAAA,EAAK,EAAE;AACjE;AAQO,SAAS,sBAAA,CACd,YACA,YAAA,EACgB;AAChB,EAAA,0BAAA,CAA2B,cAAc,cAAc,CAAA;AACvD,EAAA,OAAO;AAAA,IACL,GAAG,UAAA;AAAA,IACH,QAAA,EAAU,EAAE,IAAA,EAAM,YAAA;AAAa,GACjC;AACF;AAwBA,SAAS,eAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACM;AACN,EAAA,IAAI,IAAA,KAAS,MAAA,IAAU,IAAA,KAAS,MAAA,EAAW;AACzC,IAAA,MAAM,IAAIA,iCAAA;AAAA,MACR,2CAAA;AAAA,MACA;AAAA,QACE,MAAA,EAAQ;AAAA,UACN,EAAE,IAAA,EAAM,MAAA,EAAQ,OAAA,EAAS,qCAAA;AAAsC;AACjE,OACF;AAAA,MACA;AAAA,QACE,UAAA,EACE,SAAS,UAAA,IACT;AAAA;AACJ,KACF;AAAA,EACF;AACA,EAAA,IAAI,SAAS,MAAA,EAAW;AACtB,IAAAD,0CAAA,CAAyB,MAAM,MAAM,CAAA;AAAA,EACvC;AACF;AASO,SAAS,mBAAmB,UAAA,EAAoC;AACrE,EAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAK,GAAI,UAAA,CAAW,KAAA;AAClC,EAAA,MAAM,KAAA,GACJ,SAAS,MAAA,GAAY,CAAA,MAAA,EAAS,IAAI,CAAA,CAAA,CAAA,GAAM,CAAA,MAAA,EAAS,IAAI,CAAA,OAAA,EAAU,IAAI,CAAA,CAAA;AACrE,EAAA,OAAO,UAAA,CAAW,aAAa,MAAA,GAC3B,KAAA,GACA,GAAG,KAAK,CAAA,gBAAA,EAAmB,UAAA,CAAW,QAAA,CAAS,IAAI,CAAA,CAAA;AACzD;AAMO,SAAS,kBACd,UAAA,EACyB;AACzB,EAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAK,GAAI,UAAA,CAAW,KAAA;AAClC,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,IAAA;AAAA,IACd,GAAI,IAAA,KAAS,MAAA,IAAa,EAAE,IAAA,EAAK;AAAA,IACjC,GAAI,UAAA,CAAW,QAAA,KAAa,MAAA,GAC1B,KACA,EAAE,YAAA,EAAc,UAAA,CAAW,QAAA,CAAS,IAAA;AAAK,GAC7C;AACF","file":"chunk-SVUKGWSN.cjs","sourcesContent":["/**\n * Shared temporal coordinate + validation.\n */\nimport { ValidationError } from \"../errors\";\nimport { validateCanonicalIsoDate } from \"../utils/date\";\nimport { type TemporalMode } from \"./types\";\n\n/**\n * Open-ended recorded-time sentinel. Chosen so SQLite text ordering and\n * PostgreSQL `timestamptz` ordering both put every real commit instant before\n * the open interval end.\n */\nexport const RECORDED_MAX = \"9999-12-31T23:59:59.999Z\";\n\ndeclare const RECORDED_INSTANT_BRAND: unique symbol;\n\n/**\n * A canonical UTC ISO-8601 recorded-time instant (`YYYY-MM-DDTHH:mm:ss.sssZ`),\n * nominally branded so it can only originate from a recorded-time source —\n * {@link Store.recordedNow} or an explicit {@link asRecordedInstant} — never an\n * ad-hoc wall-clock string.\n *\n * The recorded commit clock is a logical, monotonic per-graph instant that can\n * run briefly ahead of wall time under bursty same-millisecond writes, so a raw\n * `new Date().toISOString()` may sort *before* the most recent commits and\n * silently omit them. The brand turns that footgun into a compile error:\n * `store.asOfRecorded` accepts only a `RecordedInstant`, so a bare wall-clock\n * string no longer type-checks — callers reach for `await store.recordedNow()`\n * (the monotonic high-water mark) or {@link asRecordedInstant} instead.\n */\nexport type RecordedInstant = string & {\n readonly [RECORDED_INSTANT_BRAND]: \"RecordedInstant\";\n};\n\nexport function assertValidRecordedInstant(value: string, path: string): void {\n validateCanonicalIsoDate(value, path);\n if (value >= RECORDED_MAX) {\n throw new ValidationError(\n `${path} must be before the recorded-time open sentinel ${RECORDED_MAX}.`,\n {\n issues: [\n {\n path,\n message: `Expected a timestamp before ${RECORDED_MAX}, got \"${value}\"`,\n },\n ],\n },\n {\n suggestion:\n \"Use a real recorded-time commit instant, not the open-interval sentinel.\",\n },\n );\n }\n}\n\n/**\n * Brands a canonical UTC ISO-8601 string as a {@link RecordedInstant}.\n *\n * The escape hatch for an instant that round-trips through untyped storage:\n * captured from {@link Store.recordedNow}, persisted as a plain string, read\n * back, and replayed into `asOfRecorded`. Validates the canonical form eagerly —\n * the same check `asOfRecorded` applies — so a malformed value fails here, at the\n * brand site, rather than deeper in a read. Does *not* assert the instant is a\n * real captured commit; it only guarantees the value is well-formed enough to\n * compare correctly against the recorded relations.\n *\n * @throws {ValidationError} when `value` is not a canonical UTC ISO-8601 string.\n */\nexport function asRecordedInstant(value: string): RecordedInstant {\n assertValidRecordedInstant(value, \"asRecordedInstant\");\n return value as RecordedInstant;\n}\n\n/**\n * The single opaque temporal coordinate every pinned read is resolved\n * against. It carries the valid-time axis plus an optional recorded/system-time\n * axis, so every surface can inject one coordinate object instead of threading\n * each temporal dimension separately.\n */\nexport type ReadCoordinate = Readonly<{\n /**\n * The valid-time axis: a resolved temporal mode and (only for `\"asOf\"`) the\n * instant it is pinned to.\n */\n valid: Readonly<{\n mode: TemporalMode;\n /** Defined only when `mode` is `\"asOf\"`. */\n asOf?: string;\n }>;\n /** The recorded/system-time axis. Defined only for recorded-pinned views. */\n recorded?: Readonly<{ asOf: RecordedInstant }>;\n}>;\n\n/**\n * Resolves and validates a `(mode, asOf)` pair into a {@link ReadCoordinate}.\n * Rejects an `asOf` paired with any non-`\"asOf\"` mode rather than silently\n * dropping it — pinning an instant is only meaningful in `\"asOf\"` mode, so a\n * `view({ mode: \"current\", asOf })` is a caller mistake, not a coordinate to\n * quietly discard. Then validates via {@link assertValidAsOf}.\n *\n * @param mode - The temporal mode to pin.\n * @param asOf - The supplied timestamp. Required for `\"asOf\"`; rejected for\n * every other mode.\n * @param suggestion - Caller-specific remediation hint for the\n * missing/invalid-timestamp case.\n */\nexport function resolveReadCoordinate(\n mode: TemporalMode,\n asOf: string | undefined,\n suggestion?: string,\n): ReadCoordinate {\n if (mode !== \"asOf\" && asOf !== undefined) {\n throw new ValidationError(\n `Temporal mode \"${mode}\" does not take an asOf timestamp.`,\n {\n issues: [\n {\n path: \"asOf\",\n message: `asOf is only valid with mode \"asOf\", not \"${mode}\"`,\n },\n ],\n },\n {\n suggestion:\n 'Pin an instant with store.asOf(timestamp) or store.view({ mode: \"asOf\", asOf }); drop asOf for other modes.',\n },\n );\n }\n assertValidAsOf(\n mode,\n asOf,\n suggestion === undefined ? undefined : { suggestion },\n );\n return { valid: asOf === undefined ? { mode } : { mode, asOf } };\n}\n\n/**\n * Adds a recorded/system-time pin to an existing valid-time coordinate.\n * Direct `store.asOfRecorded(T)` passes the diagonal valid-time coordinate\n * (`mode: \"asOf\", asOf: T`); `store.asOf(vt).asOfRecorded(rt)` passes the\n * already-resolved valid coordinate and adds the recorded sibling.\n */\nexport function withRecordedCoordinate(\n coordinate: ReadCoordinate,\n recordedAsOf: RecordedInstant,\n): ReadCoordinate {\n assertValidRecordedInstant(recordedAsOf, \"asOfRecorded\");\n return {\n ...coordinate,\n recorded: { asOf: recordedAsOf },\n };\n}\n\n/**\n * Validates the `asOf` coordinate of a temporal read: `\"asOf\"` mode\n * requires a timestamp, and any supplied timestamp must be a canonical\n * fixed-width UTC ISO-8601 string (`YYYY-MM-DDTHH:mm:ss.sssZ`). The latter\n * is load-bearing — temporal filters compare `asOf` against `valid_from` /\n * `valid_to` as text on SQLite, so a non-canonical value (date-only, an\n * offset, natural language, or variable-width / missing milliseconds like\n * `.1Z`) would sort and compare wrong rather than error. Reached only through\n * {@link resolveReadCoordinate}, which every temporal read entry point routes\n * through (direct reads, queries, subgraphs, algorithms, and StoreView), so\n * they all fail identically.\n *\n * @param mode - The resolved temporal mode.\n * @param asOf - The supplied timestamp (may be `undefined`).\n * @param options.suggestion - A caller-specific remediation hint for the\n * missing-timestamp case.\n *\n * @throws {ValidationError} when `mode` is `\"asOf\"` and `asOf` is missing, or\n * when any supplied `asOf` is not a canonical UTC ISO-8601 timestamp. The\n * canonical check runs for *every* mode that consumes `asOf`, so a\n * non-canonical value can never reach a text comparison.\n */\nfunction assertValidAsOf(\n mode: TemporalMode,\n asOf: string | undefined,\n options?: Readonly<{ suggestion?: string }>,\n): void {\n if (mode === \"asOf\" && asOf === undefined) {\n throw new ValidationError(\n 'Temporal mode \"asOf\" requires a timestamp',\n {\n issues: [\n { path: \"asOf\", message: \"Timestamp is required for asOf mode\" },\n ],\n },\n {\n suggestion:\n options?.suggestion ??\n 'Provide an ISO-8601 timestamp for asOf mode, e.g. \"2026-01-01T00:00:00.000Z\".',\n },\n );\n }\n if (asOf !== undefined) {\n validateCanonicalIsoDate(asOf, \"asOf\");\n }\n}\n\n/**\n * A human-readable description of a coordinate for error messages, e.g.\n * `mode \"current\"` or `mode \"asOf\" asOf 2026-01-01T00:00:00.000Z`. Shared by\n * every refusal path (the `StoreView` read-only / current-only / search facades\n * and the sealed-query builder) so they describe a coordinate identically — and\n * a future axis (recorded time) is reflected everywhere from one place.\n */\nexport function describeCoordinate(coordinate: ReadCoordinate): string {\n const { mode, asOf } = coordinate.valid;\n const valid =\n asOf === undefined ? `mode \"${mode}\"` : `mode \"${mode}\" asOf ${asOf}`;\n return coordinate.recorded === undefined ?\n valid\n : `${valid}, recorded asOf ${coordinate.recorded.asOf}`;\n}\n\n/**\n * The structured error-context fields describing a coordinate, shared by the\n * same refusal paths as {@link describeCoordinate}.\n */\nexport function coordinateContext(\n coordinate: ReadCoordinate,\n): Record<string, unknown> {\n const { mode, asOf } = coordinate.valid;\n return {\n temporalMode: mode,\n ...(asOf !== undefined && { asOf }),\n ...(coordinate.recorded === undefined ?\n {}\n : { recordedAsOf: coordinate.recorded.asOf }),\n };\n}\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isPlainObject } from './chunk-ITE4IXAK.js';
|
|
2
|
+
import { ConfigurationError } from './chunk-DPNA466P.js';
|
|
3
|
+
|
|
4
|
+
// src/core/json-value.ts
|
|
5
|
+
function assertJsonValue(value, rootLabel, ownerKind) {
|
|
6
|
+
walk(value, rootLabel, ownerKind);
|
|
7
|
+
}
|
|
8
|
+
function walk(value, path, ownerKind) {
|
|
9
|
+
if (value === null) return;
|
|
10
|
+
const valueType = typeof value;
|
|
11
|
+
if (valueType === "number") {
|
|
12
|
+
if (!Number.isFinite(value)) {
|
|
13
|
+
throwInvalid(path, describeNonFinite(value), ownerKind);
|
|
14
|
+
}
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (valueType === "string" || valueType === "boolean") return;
|
|
18
|
+
if (valueType === "bigint" || valueType === "function" || valueType === "symbol" || valueType === "undefined") {
|
|
19
|
+
throwInvalid(path, valueType, ownerKind);
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(value)) {
|
|
22
|
+
for (const [index, element] of value.entries()) {
|
|
23
|
+
walk(element, `${path}[${index}]`, ownerKind);
|
|
24
|
+
}
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (!isPlainObject(value)) {
|
|
28
|
+
throwInvalid(path, describeNonPlain(value), ownerKind);
|
|
29
|
+
}
|
|
30
|
+
for (const [key, nested] of Object.entries(value)) {
|
|
31
|
+
walk(nested, `${path}.${key}`, ownerKind);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function describeNonFinite(value) {
|
|
35
|
+
if (Number.isNaN(value)) return "NaN";
|
|
36
|
+
if (value === Number.POSITIVE_INFINITY) return "Infinity";
|
|
37
|
+
if (value === Number.NEGATIVE_INFINITY) return "-Infinity";
|
|
38
|
+
return "non-finite number";
|
|
39
|
+
}
|
|
40
|
+
function describeNonPlain(value) {
|
|
41
|
+
const constructorName = value?.constructor?.name;
|
|
42
|
+
if (typeof constructorName === "string" && constructorName.length > 0) {
|
|
43
|
+
return `${constructorName} instance`;
|
|
44
|
+
}
|
|
45
|
+
return "non-plain object";
|
|
46
|
+
}
|
|
47
|
+
function throwInvalid(path, kind, ownerKind) {
|
|
48
|
+
throw new ConfigurationError(
|
|
49
|
+
`${ownerKind} ${path} contains a non-JSON value (${kind}). Annotations must be JSON-serializable.`,
|
|
50
|
+
{ path, valueKind: kind },
|
|
51
|
+
{
|
|
52
|
+
suggestion: "Use only strings, numbers, booleans, null, arrays, and plain objects in annotations."
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { assertJsonValue };
|
|
58
|
+
//# sourceMappingURL=chunk-TAUGGLNQ.js.map
|
|
59
|
+
//# sourceMappingURL=chunk-TAUGGLNQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/json-value.ts"],"names":[],"mappings":";;;;AAyBO,SAAS,eAAA,CACd,KAAA,EACA,SAAA,EACA,SAAA,EACM;AACN,EAAA,IAAA,CAAK,KAAA,EAAO,WAAW,SAAS,CAAA;AAClC;AAEA,SAAS,IAAA,CAAK,KAAA,EAAgB,IAAA,EAAc,SAAA,EAAyB;AACnE,EAAA,IAAI,UAAU,IAAA,EAAM;AACpB,EAAA,MAAM,YAAY,OAAO,KAAA;AACzB,EAAA,IAAI,cAAc,QAAA,EAAU;AAI1B,IAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG;AAC3B,MAAA,YAAA,CAAa,IAAA,EAAM,iBAAA,CAAkB,KAAe,CAAA,EAAG,SAAS,CAAA;AAAA,IAClE;AACA,IAAA;AAAA,EACF;AACA,EAAA,IAAI,SAAA,KAAc,QAAA,IAAY,SAAA,KAAc,SAAA,EAAW;AACvD,EAAA,IACE,cAAc,QAAA,IACd,SAAA,KAAc,cACd,SAAA,KAAc,QAAA,IACd,cAAc,WAAA,EACd;AACA,IAAA,YAAA,CAAa,IAAA,EAAM,WAAW,SAAS,CAAA;AAAA,EACzC;AACA,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,KAAA,MAAW,CAAC,KAAA,EAAO,OAAO,CAAA,IAAK,KAAA,CAAM,SAAQ,EAAG;AAC9C,MAAA,IAAA,CAAK,SAAS,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,KAAK,KAAK,SAAS,CAAA;AAAA,IAC9C;AACA,IAAA;AAAA,EACF;AACA,EAAA,IAAI,CAAC,aAAA,CAAc,KAAK,CAAA,EAAG;AACzB,IAAA,YAAA,CAAa,IAAA,EAAM,gBAAA,CAAiB,KAAK,CAAA,EAAG,SAAS,CAAA;AAAA,EACvD;AACA,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,MAAM,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AACjD,IAAA,IAAA,CAAK,QAAQ,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,GAAG,IAAI,SAAS,CAAA;AAAA,EAC1C;AACF;AAEA,SAAS,kBAAkB,KAAA,EAAuB;AAChD,EAAA,IAAI,MAAA,CAAO,KAAA,CAAM,KAAK,CAAA,EAAG,OAAO,KAAA;AAChC,EAAA,IAAI,KAAA,KAAU,MAAA,CAAO,iBAAA,EAAmB,OAAO,UAAA;AAC/C,EAAA,IAAI,KAAA,KAAU,MAAA,CAAO,iBAAA,EAAmB,OAAO,WAAA;AAC/C,EAAA,OAAO,mBAAA;AACT;AAEA,SAAS,iBAAiB,KAAA,EAAwB;AAChD,EAAA,MAAM,eAAA,GAAmB,OACrB,WAAA,EAAa,IAAA;AACjB,EAAA,IAAI,OAAO,eAAA,KAAoB,QAAA,IAAY,eAAA,CAAgB,SAAS,CAAA,EAAG;AACrE,IAAA,OAAO,GAAG,eAAe,CAAA,SAAA,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,kBAAA;AACT;AAEA,SAAS,YAAA,CAAa,IAAA,EAAc,IAAA,EAAc,SAAA,EAA0B;AAC1E,EAAA,MAAM,IAAI,kBAAA;AAAA,IACR,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,IAAI,+BAA+B,IAAI,CAAA,yCAAA,CAAA;AAAA,IACvD,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAK;AAAA,IACxB;AAAA,MACE,UAAA,EACE;AAAA;AACJ,GACF;AACF","file":"chunk-TAUGGLNQ.js","sourcesContent":["/**\n * Runtime validation for JSON-serializable values.\n *\n * Used at definition-time boundaries (e.g., `defineNode`/`defineEdge` annotations)\n * to reject values that would silently break `JSON.stringify` round-trips or\n * throw at hash time. Catches accidental violations from untyped JS callers\n * and `as any` escape hatches that bypass the `JsonValue` type.\n */\nimport { ConfigurationError } from \"../errors\";\nimport { isPlainObject } from \"../utils/object\";\n\n/**\n * Asserts that `value` is JSON-serializable.\n *\n * Throws `ConfigurationError` with a dotted path identifying the offending\n * field. Rejects `bigint`, `function`, `symbol`, `undefined`, and class\n * instances such as `Date`, `Map`, `Set`, regex literals, and Buffers — all\n * of which either throw or silently coerce under `JSON.stringify`.\n *\n * @param value - The value to validate\n * @param rootLabel - Label for the root of the value (e.g., `\"annotations\"`)\n * used as the prefix of the error path\n * @param ownerKind - Human-readable owner identifier for the error message\n * (e.g., `'Node \"Person\"'`)\n */\nexport function assertJsonValue(\n value: unknown,\n rootLabel: string,\n ownerKind: string,\n): void {\n walk(value, rootLabel, ownerKind);\n}\n\nfunction walk(value: unknown, path: string, ownerKind: string): void {\n if (value === null) return;\n const valueType = typeof value;\n if (valueType === \"number\") {\n // NaN/Infinity/-Infinity are not JSON values; JSON.stringify silently\n // coerces them to `null`, which would change the canonical hash input\n // without the consumer noticing.\n if (!Number.isFinite(value)) {\n throwInvalid(path, describeNonFinite(value as number), ownerKind);\n }\n return;\n }\n if (valueType === \"string\" || valueType === \"boolean\") return;\n if (\n valueType === \"bigint\" ||\n valueType === \"function\" ||\n valueType === \"symbol\" ||\n valueType === \"undefined\"\n ) {\n throwInvalid(path, valueType, ownerKind);\n }\n if (Array.isArray(value)) {\n for (const [index, element] of value.entries()) {\n walk(element, `${path}[${index}]`, ownerKind);\n }\n return;\n }\n if (!isPlainObject(value)) {\n throwInvalid(path, describeNonPlain(value), ownerKind);\n }\n for (const [key, nested] of Object.entries(value)) {\n walk(nested, `${path}.${key}`, ownerKind);\n }\n}\n\nfunction describeNonFinite(value: number): string {\n if (Number.isNaN(value)) return \"NaN\";\n if (value === Number.POSITIVE_INFINITY) return \"Infinity\";\n if (value === Number.NEGATIVE_INFINITY) return \"-Infinity\";\n return \"non-finite number\";\n}\n\nfunction describeNonPlain(value: unknown): string {\n const constructorName = (value as { constructor?: { name?: unknown } } | null)\n ?.constructor?.name;\n if (typeof constructorName === \"string\" && constructorName.length > 0) {\n return `${constructorName} instance`;\n }\n return \"non-plain object\";\n}\n\nfunction throwInvalid(path: string, kind: string, ownerKind: string): never {\n throw new ConfigurationError(\n `${ownerKind} ${path} contains a non-JSON value (${kind}). Annotations must be JSON-serializable.`,\n { path, valueKind: kind },\n {\n suggestion:\n \"Use only strings, numbers, booleans, null, arrays, and plain objects in annotations.\",\n },\n );\n}\n"]}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { createSqliteOperationStrategy, createContributionMaterializer, gateFulltextMethods, assertTrustedImportDatabaseEmpty, suspendSqliteSecondaryIndexes, createSqliteTrustedImportSession, restoreSecondaryIndexes, analyzeImportedTables, generateSqliteCreateTableSQL, mapContributionMaterializationRow, SQLITE_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, assertAdoptedDialect, buildKindRemovalInsertValues, SQLITE_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, SQLITE_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, generateSqliteDDL, createCommonOperationBackend, vectorSlotFromParams,
|
|
2
|
-
import { tables } from './chunk-
|
|
3
|
-
import { createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { createSqliteOperationStrategy, createContributionMaterializer, gateFulltextMethods, assertTrustedImportDatabaseEmpty, suspendSqliteSecondaryIndexes, createSqliteTrustedImportSession, restoreSecondaryIndexes, analyzeImportedTables, generateSqliteCreateTableSQL, mapContributionMaterializationRow, SQLITE_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, assertAdoptedDialect, buildKindRemovalInsertValues, SQLITE_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, SQLITE_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, generateSqliteDDL, createCommonOperationBackend, vectorSlotFromParams, buildLiveNodeCandidates, mapVectorWriteError, mapHybridSearchRow, gateFulltext, EMBEDDING_UPSERT_PARAM_COUNT, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams, getOrCreateLru } from './chunk-G32AO634.js';
|
|
2
|
+
import { tables } from './chunk-MTNEGGM2.js';
|
|
3
|
+
import { createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-AOL64O4Z.js';
|
|
4
|
+
import { toDrizzleSql, compileQueryWithDialect } from './chunk-Z2PPIVOO.js';
|
|
5
|
+
import { chunk } from './chunk-35S6P5ZU.js';
|
|
6
|
+
import { normalizeGraphAnalyticsCapabilities, INTERNAL_TEMPORARY_WRITES, SQLITE_CAPABILITIES, SQLITE_MAX_BIND_PARAMETERS, MODERN_SQLITE_MAX_BIND_PARAMETERS, DURABLE_OBJECT_MAX_BIND_PARAMETERS, D1_MAX_BIND_PARAMETERS } from './chunk-PZHC5GCD.js';
|
|
7
|
+
import { isMissingTableError } from './chunk-KFLXWVUJ.js';
|
|
8
|
+
import { fts5Strategy, buildVectorCapabilities, buildFulltextCapabilities, assertVectorSearchLimit } from './chunk-Y7M44XEK.js';
|
|
9
|
+
import { sql as sql$1, isSqlFragment } from './chunk-6XDBRDZE.js';
|
|
10
|
+
import { ConfigurationError, BackendDisposedError } from './chunk-DPNA466P.js';
|
|
8
11
|
import { getTableName, sql, eq, and, isNull, inArray } from 'drizzle-orm';
|
|
9
12
|
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
10
13
|
|
|
@@ -27,8 +30,8 @@ function isDurableObjectBySessionName(db) {
|
|
|
27
30
|
function isDurableObjectStorageClient(value) {
|
|
28
31
|
if (typeof value !== "object" || value === null) return false;
|
|
29
32
|
const candidate = value;
|
|
30
|
-
const sqlApi = candidate
|
|
31
|
-
return typeof candidate
|
|
33
|
+
const sqlApi = candidate["sql"];
|
|
34
|
+
return typeof candidate["transaction"] === "function" && typeof candidate["transactionSync"] === "function" && typeof sqlApi === "object" && sqlApi !== null && typeof sqlApi["exec"] === "function";
|
|
32
35
|
}
|
|
33
36
|
function getDurableObjectStorageClient(db) {
|
|
34
37
|
const client = db.$client;
|
|
@@ -77,7 +80,7 @@ var FIRST_MODERN_BIND_LIMIT_MINOR = 32;
|
|
|
77
80
|
function parseCompiledMaxVariableNumber(rows) {
|
|
78
81
|
for (const row of rows) {
|
|
79
82
|
if (typeof row !== "object" || row === null) continue;
|
|
80
|
-
const option = row
|
|
83
|
+
const option = row["compile_options"];
|
|
81
84
|
if (typeof option !== "string") continue;
|
|
82
85
|
const match = MAX_VARIABLE_NUMBER_COMPILE_OPTION.exec(option);
|
|
83
86
|
if (match !== null) return Number(match[1]);
|
|
@@ -87,7 +90,7 @@ function parseCompiledMaxVariableNumber(rows) {
|
|
|
87
90
|
function hasModernBindLimitByVersion(rows) {
|
|
88
91
|
const first = rows[0];
|
|
89
92
|
if (typeof first !== "object" || first === null) return false;
|
|
90
|
-
const version = first
|
|
93
|
+
const version = first["version"];
|
|
91
94
|
if (typeof version !== "string") return false;
|
|
92
95
|
const [major = 0, minor = 0] = version.split(".").map(Number);
|
|
93
96
|
if (!Number.isFinite(major) || !Number.isFinite(minor)) return false;
|
|
@@ -120,7 +123,7 @@ function resolveSqliteClient(db) {
|
|
|
120
123
|
const sqliteClient = db.$client;
|
|
121
124
|
if (typeof sqliteClient !== "object" || sqliteClient === null) return;
|
|
122
125
|
const candidate = sqliteClient;
|
|
123
|
-
if (typeof candidate
|
|
126
|
+
if (typeof candidate["prepare"] !== "function") return;
|
|
124
127
|
return sqliteClient;
|
|
125
128
|
}
|
|
126
129
|
function getOrCreatePreparedStatement(cache, sqliteClient, sqlText, cacheMax) {
|
|
@@ -247,7 +250,10 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
247
250
|
},
|
|
248
251
|
compile,
|
|
249
252
|
execute(query) {
|
|
250
|
-
return executeDrizzleQuery(
|
|
253
|
+
return executeDrizzleQuery(
|
|
254
|
+
db,
|
|
255
|
+
isSqlFragment(query) ? toDrizzleSql(query, "sqlite") : query
|
|
256
|
+
);
|
|
251
257
|
},
|
|
252
258
|
profile
|
|
253
259
|
};
|
|
@@ -430,7 +436,7 @@ function createSqliteOperationBackend(options) {
|
|
|
430
436
|
function execGet(query) {
|
|
431
437
|
return runWithSerializedQueue(serializedQueue, async () => {
|
|
432
438
|
if (compiledExecute === void 0) {
|
|
433
|
-
const rows2 = await
|
|
439
|
+
const rows2 = await executionAdapter.execute(query);
|
|
434
440
|
return rows2[0];
|
|
435
441
|
}
|
|
436
442
|
const rows = await compiledExecute(executionAdapter.compile(query));
|
|
@@ -440,7 +446,7 @@ function createSqliteOperationBackend(options) {
|
|
|
440
446
|
function execAll(query) {
|
|
441
447
|
return runWithSerializedQueue(serializedQueue, async () => {
|
|
442
448
|
if (compiledExecute === void 0) {
|
|
443
|
-
return await
|
|
449
|
+
return [...await executionAdapter.execute(query)];
|
|
444
450
|
}
|
|
445
451
|
return [...await compiledExecute(executionAdapter.compile(query))];
|
|
446
452
|
});
|
|
@@ -448,7 +454,9 @@ function createSqliteOperationBackend(options) {
|
|
|
448
454
|
function execRun(query) {
|
|
449
455
|
return runWithSerializedQueue(serializedQueue, async () => {
|
|
450
456
|
if (compiledRun === void 0) {
|
|
451
|
-
await db.run(
|
|
457
|
+
await db.run(
|
|
458
|
+
isSqlFragment(query) ? toDrizzleSql(query, "sqlite") : query
|
|
459
|
+
);
|
|
452
460
|
return;
|
|
453
461
|
}
|
|
454
462
|
await compiledRun(executionAdapter.compile(query));
|
|
@@ -553,9 +561,11 @@ function createSqliteOperationBackend(options) {
|
|
|
553
561
|
params,
|
|
554
562
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
555
563
|
// take precedence; the live-node default covers direct backend use.
|
|
556
|
-
params.candidates ??
|
|
564
|
+
params.candidates ?? buildLiveNodeCandidates(
|
|
565
|
+
tableNames.nodes,
|
|
557
566
|
params.graphId,
|
|
558
|
-
params.nodeKind
|
|
567
|
+
params.nodeKind,
|
|
568
|
+
nowIso()
|
|
559
569
|
)
|
|
560
570
|
);
|
|
561
571
|
let rows;
|
|
@@ -584,9 +594,11 @@ function createSqliteOperationBackend(options) {
|
|
|
584
594
|
metric: params.vector.metric,
|
|
585
595
|
indexType: params.vector.indexType
|
|
586
596
|
});
|
|
587
|
-
const candidates = params.candidates ??
|
|
597
|
+
const candidates = params.candidates ?? buildLiveNodeCandidates(
|
|
598
|
+
tableNames.nodes,
|
|
588
599
|
params.graphId,
|
|
589
|
-
params.nodeKind
|
|
600
|
+
params.nodeKind,
|
|
601
|
+
nowIso()
|
|
590
602
|
);
|
|
591
603
|
const vectorParams = {
|
|
592
604
|
graphId: params.graphId,
|
|
@@ -602,11 +614,11 @@ function createSqliteOperationBackend(options) {
|
|
|
602
614
|
const vectorSql = vectorStrategy.buildSearch(
|
|
603
615
|
slot,
|
|
604
616
|
vectorParams,
|
|
605
|
-
|
|
617
|
+
sql$1.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
606
618
|
);
|
|
607
619
|
const statement = operationStrategy.buildHybridSearch(
|
|
608
620
|
{ ...params, candidates },
|
|
609
|
-
vectorSql,
|
|
621
|
+
toDrizzleSql(vectorSql, "sqlite"),
|
|
610
622
|
params.vector.metric === "cosine"
|
|
611
623
|
);
|
|
612
624
|
let raw;
|
|
@@ -1116,14 +1128,27 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1116
1128
|
},
|
|
1117
1129
|
async refreshStatistics() {
|
|
1118
1130
|
await db.run(
|
|
1119
|
-
|
|
1131
|
+
toDrizzleSql(
|
|
1132
|
+
sql$1`PRAGMA analysis_limit = ${sql$1.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`,
|
|
1133
|
+
"sqlite"
|
|
1134
|
+
)
|
|
1120
1135
|
);
|
|
1121
1136
|
for (const tableName of coreAnalyzeTables) {
|
|
1122
|
-
await db.run(
|
|
1137
|
+
await db.run(
|
|
1138
|
+
toDrizzleSql(
|
|
1139
|
+
sql$1`ANALYZE ${sql$1.identifier(tableName)}`,
|
|
1140
|
+
"sqlite"
|
|
1141
|
+
)
|
|
1142
|
+
);
|
|
1123
1143
|
}
|
|
1124
1144
|
for (const tableName of recordedAnalyzeTables) {
|
|
1125
1145
|
try {
|
|
1126
|
-
await db.run(
|
|
1146
|
+
await db.run(
|
|
1147
|
+
toDrizzleSql(
|
|
1148
|
+
sql$1`ANALYZE ${sql$1.identifier(tableName)}`,
|
|
1149
|
+
"sqlite"
|
|
1150
|
+
)
|
|
1151
|
+
);
|
|
1127
1152
|
} catch (error) {
|
|
1128
1153
|
if (!isMissingTableError(error)) throw error;
|
|
1129
1154
|
}
|
|
@@ -1140,6 +1165,9 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1140
1165
|
);
|
|
1141
1166
|
},
|
|
1142
1167
|
async transaction(fn, options2) {
|
|
1168
|
+
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
1169
|
+
},
|
|
1170
|
+
async transactionWithNative(fn, options2) {
|
|
1143
1171
|
const temporaryWrites = options2?.temporaryWrites === INTERNAL_TEMPORARY_WRITES;
|
|
1144
1172
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
1145
1173
|
throw new ConfigurationError(
|
|
@@ -1233,5 +1261,5 @@ function createTransactionBackend(options) {
|
|
|
1233
1261
|
}
|
|
1234
1262
|
|
|
1235
1263
|
export { createSqliteBackend };
|
|
1236
|
-
//# sourceMappingURL=chunk-
|
|
1237
|
-
//# sourceMappingURL=chunk-
|
|
1264
|
+
//# sourceMappingURL=chunk-TE5ZA4VX.js.map
|
|
1265
|
+
//# sourceMappingURL=chunk-TE5ZA4VX.js.map
|