@nicia-ai/typegraph 0.37.0 → 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-NBP2WTJW.cjs → chunk-2SL7OGPR.cjs} +2900 -1597
- 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-552KNYQJ.js → chunk-A2FGSWMQ.js} +1907 -607
- 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-J4IUSYFF.js → chunk-TE5ZA4VX.js} +69 -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-JBNOGRKW.cjs → chunk-YLINFV7Z.cjs} +157 -115
- 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-552KNYQJ.js.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-EXU3RASM.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-J4IUSYFF.js.map +0 -1
- package/dist/chunk-JBNOGRKW.cjs.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-NBP2WTJW.cjs.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-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,281 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { p as VectorSlot } from './index-CrFL_ENI.cjs';
|
|
3
|
+
import { G as GraphDef } from './define-graph-CzEvA_8F.cjs';
|
|
4
|
+
import { T as TemporalMode } from './extension-types-BLEVH4SG.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Embedding type for vector search.
|
|
8
|
+
*
|
|
9
|
+
* Creates a Zod-compatible schema for vector embeddings with
|
|
10
|
+
* dimension validation and metadata for query compilation.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Symbol used to brand embedding values at the type level.
|
|
15
|
+
* This allows TypeScript to distinguish embedding arrays from regular
|
|
16
|
+
* number arrays in the query builder type system.
|
|
17
|
+
*/
|
|
18
|
+
declare const EMBEDDING_BRAND: unique symbol;
|
|
19
|
+
/**
|
|
20
|
+
* Branded embedding type for type-level distinction.
|
|
21
|
+
* At runtime this is just `readonly number[]`, but TypeScript can
|
|
22
|
+
* distinguish it from regular arrays for query builder typing.
|
|
23
|
+
*/
|
|
24
|
+
type EmbeddingValue = readonly number[] & {
|
|
25
|
+
readonly [EMBEDDING_BRAND]: true;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Symbol key for storing embedding dimensions on the schema.
|
|
29
|
+
* This allows the schema introspector to detect embedding types
|
|
30
|
+
* and extract dimension information.
|
|
31
|
+
*/
|
|
32
|
+
declare const EMBEDDING_DIMENSIONS_KEY: "_embeddingDimensions";
|
|
33
|
+
/**
|
|
34
|
+
* Symbol key for storing the embedding's preferred index configuration
|
|
35
|
+
* on the schema. The schema introspector reads this when auto-deriving
|
|
36
|
+
* `VectorIndexDeclaration` entries at `defineGraph()` time.
|
|
37
|
+
*/
|
|
38
|
+
declare const EMBEDDING_INDEX_KEY: "_embeddingIndex";
|
|
39
|
+
/**
|
|
40
|
+
* Distance metric used for vector similarity. Pinned at the embedding
|
|
41
|
+
* brand because changing the metric usually means generating different
|
|
42
|
+
* model output (e.g. cosine-normalized vs. raw inner-product), and the
|
|
43
|
+
* stored index needs the same metric to score correctly.
|
|
44
|
+
*
|
|
45
|
+
* - `cosine`: cosine similarity. The default — works for most
|
|
46
|
+
* sentence-transformer / OpenAI-style embeddings that are already
|
|
47
|
+
* length-normalized.
|
|
48
|
+
* - `l2`: Euclidean distance. Use when your model outputs vectors
|
|
49
|
+
* trained for L2 (e.g. some image embedding models).
|
|
50
|
+
* - `inner_product`: dot-product distance. Use when your model outputs
|
|
51
|
+
* pre-normalized vectors AND you want to skip the cosine
|
|
52
|
+
* normalization step at query time.
|
|
53
|
+
*/
|
|
54
|
+
type EmbeddingMetric = "cosine" | "l2" | "inner_product";
|
|
55
|
+
/**
|
|
56
|
+
* Vector index implementation. `hnsw` is the default and what pgvector
|
|
57
|
+
* recommends for most workloads. `ivfflat` is the alternative for
|
|
58
|
+
* larger datasets where memory is the bottleneck. `none` disables
|
|
59
|
+
* automatic index creation for this embedding (the operator can still
|
|
60
|
+
* call `backend.createVectorIndex` manually).
|
|
61
|
+
*/
|
|
62
|
+
type EmbeddingIndexType = "hnsw" | "ivfflat" | "none";
|
|
63
|
+
/**
|
|
64
|
+
* Per-embedding configuration for the auto-derived
|
|
65
|
+
* `VectorIndexDeclaration`. All fields are optional with sensible
|
|
66
|
+
* defaults (`cosine` / `hnsw` / pgvector defaults: `m=16`,
|
|
67
|
+
* `ef_construction=64`). Override only when your model or dataset has
|
|
68
|
+
* a known reason to.
|
|
69
|
+
*/
|
|
70
|
+
type EmbeddingIndexOptions = Readonly<{
|
|
71
|
+
/** Distance metric. Default `"cosine"`. */
|
|
72
|
+
metric?: EmbeddingMetric;
|
|
73
|
+
/** Vector index implementation. Default `"hnsw"`. */
|
|
74
|
+
indexType?: EmbeddingIndexType;
|
|
75
|
+
/** HNSW `m` parameter — max connections per layer. Default `16`. */
|
|
76
|
+
m?: number;
|
|
77
|
+
/** HNSW `ef_construction` parameter — build-time search depth. Default `64`. */
|
|
78
|
+
efConstruction?: number;
|
|
79
|
+
/** IVFFlat `lists` parameter — number of inverted-list partitions. */
|
|
80
|
+
lists?: number;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Resolved embedding index configuration with all defaults applied.
|
|
84
|
+
* What gets attached to the brand and read by the auto-derivation pass.
|
|
85
|
+
*/
|
|
86
|
+
type ResolvedEmbeddingIndex = Readonly<{
|
|
87
|
+
metric: EmbeddingMetric;
|
|
88
|
+
indexType: EmbeddingIndexType;
|
|
89
|
+
m: number;
|
|
90
|
+
efConstruction: number;
|
|
91
|
+
lists: number | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* A Zod schema for vector embeddings with attached dimension metadata.
|
|
95
|
+
* Uses the branded EmbeddingValue type for type-level distinction.
|
|
96
|
+
*/
|
|
97
|
+
type EmbeddingSchema<D extends number = number> = z.ZodType<EmbeddingValue> & Readonly<{
|
|
98
|
+
[EMBEDDING_DIMENSIONS_KEY]: D;
|
|
99
|
+
[EMBEDDING_INDEX_KEY]: ResolvedEmbeddingIndex;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a Zod schema for vector embeddings.
|
|
103
|
+
*
|
|
104
|
+
* The dimension is validated at runtime and attached as metadata
|
|
105
|
+
* for the schema introspector and query compiler.
|
|
106
|
+
*
|
|
107
|
+
* @param dimensions - The number of dimensions (e.g., 384, 512, 768, 1536, 3072)
|
|
108
|
+
* @returns A Zod schema that validates embedding arrays
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* // OpenAI ada-002 embeddings
|
|
113
|
+
* const Document = defineNode("Document", {
|
|
114
|
+
* schema: z.object({
|
|
115
|
+
* title: z.string(),
|
|
116
|
+
* embedding: embedding(1536),
|
|
117
|
+
* }),
|
|
118
|
+
* });
|
|
119
|
+
*
|
|
120
|
+
* // Sentence transformers
|
|
121
|
+
* const Sentence = defineNode("Sentence", {
|
|
122
|
+
* schema: z.object({
|
|
123
|
+
* text: z.string(),
|
|
124
|
+
* embedding: embedding(384), // all-MiniLM-L6-v2
|
|
125
|
+
* }),
|
|
126
|
+
* });
|
|
127
|
+
*
|
|
128
|
+
* // Optional embeddings are supported
|
|
129
|
+
* const Article = defineNode("Article", {
|
|
130
|
+
* schema: z.object({
|
|
131
|
+
* content: z.string(),
|
|
132
|
+
* embedding: embedding(1536).optional(),
|
|
133
|
+
* }),
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
declare function embedding<D extends number>(dimensions: D, options?: EmbeddingIndexOptions): EmbeddingSchema<D>;
|
|
138
|
+
/**
|
|
139
|
+
* Checks if a value is an embedding schema.
|
|
140
|
+
*/
|
|
141
|
+
declare function isEmbeddingSchema(value: unknown): value is EmbeddingSchema;
|
|
142
|
+
/**
|
|
143
|
+
* Gets the dimensions from an embedding schema.
|
|
144
|
+
* Returns undefined if the schema is not an embedding schema.
|
|
145
|
+
*/
|
|
146
|
+
declare function getEmbeddingDimensions(schema: z.ZodType): number | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Enumerates every embedding `(kind, field)` slot a graph declares, as a
|
|
149
|
+
* fully-resolved {@link VectorSlot}. The single source of truth for "what
|
|
150
|
+
* vector slots does this graph have?", shared by the privileged boot
|
|
151
|
+
* materializer (`materializeVectorContributions`) and the verified-attach
|
|
152
|
+
* gate (`assertVectorContributionsInitialized`) so the two can never
|
|
153
|
+
* provision and assert different sets. Walks `graph.nodes` and reuses
|
|
154
|
+
* {@link resolveEmbeddingFields} per node schema.
|
|
155
|
+
*/
|
|
156
|
+
declare function resolveGraphVectorSlots(graph: GraphDef): readonly VectorSlot[];
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Searchable string type for fulltext search.
|
|
160
|
+
*
|
|
161
|
+
* `searchable()` attaches `SearchableMetadata` to a plain Zod string so
|
|
162
|
+
* the schema introspector and fulltext-sync layer can keep the fulltext
|
|
163
|
+
* index in sync with node data.
|
|
164
|
+
*
|
|
165
|
+
* The metadata is preserved by Zod's `.meta()` across refinements
|
|
166
|
+
* (`.min(1)`, `.trim()`, `.regex(...)`) and wrapper types (`.optional()`,
|
|
167
|
+
* `.nullable()`, `.default(...)`, pipes) — `getSearchableMetadata()` walks
|
|
168
|
+
* these variants so runtime indexing works whether or not a user chains
|
|
169
|
+
* additional modifiers.
|
|
170
|
+
*
|
|
171
|
+
* `$fulltext` is exposed on every `NodeAccessor` at the type level; a
|
|
172
|
+
* runtime guard throws a clear error if you call `.matches()` on an
|
|
173
|
+
* alias whose node kind has no `searchable()` fields. This is simpler
|
|
174
|
+
* and more predictable than a type-level brand that silently disappears
|
|
175
|
+
* behind `.min(1)`.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```typescript
|
|
179
|
+
* const Document = defineNode("Document", {
|
|
180
|
+
* schema: z.object({
|
|
181
|
+
* title: searchable({ language: "english" }),
|
|
182
|
+
* body: searchable().min(1),
|
|
183
|
+
* authorId: z.string(),
|
|
184
|
+
* }),
|
|
185
|
+
* });
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
declare const SEARCHABLE_FIELD_KEY: "_searchableField";
|
|
190
|
+
declare const DEFAULT_SEARCHABLE_LANGUAGE: "english";
|
|
191
|
+
/**
|
|
192
|
+
* Searchable field metadata attached to a Zod schema.
|
|
193
|
+
*/
|
|
194
|
+
type SearchableMetadata = Readonly<{
|
|
195
|
+
/**
|
|
196
|
+
* Language for stemming / tokenization.
|
|
197
|
+
* Postgres: passed to `to_tsvector(regconfig, ...)`.
|
|
198
|
+
* SQLite FTS5: tokenizer is fixed at table-create time, so the
|
|
199
|
+
* language is recorded but not applied per-row.
|
|
200
|
+
*/
|
|
201
|
+
language: string;
|
|
202
|
+
}>;
|
|
203
|
+
/**
|
|
204
|
+
* Branded Zod string schema. The `SEARCHABLE_FIELD_KEY` marker is
|
|
205
|
+
* attached both as a direct property (fast runtime check) and via Zod's
|
|
206
|
+
* `.meta()` (so it survives `.min()`, `.trim()`, etc.).
|
|
207
|
+
*/
|
|
208
|
+
type SearchableSchema = z.ZodString & Readonly<{
|
|
209
|
+
[SEARCHABLE_FIELD_KEY]: SearchableMetadata;
|
|
210
|
+
}>;
|
|
211
|
+
type SearchableOptions = Readonly<{
|
|
212
|
+
language?: string;
|
|
213
|
+
}>;
|
|
214
|
+
/**
|
|
215
|
+
* Creates a Zod string schema tagged as fulltext-searchable.
|
|
216
|
+
*
|
|
217
|
+
* The returned schema passes runtime validation unchanged — the tag only
|
|
218
|
+
* affects how TypeGraph treats the field for indexing and search. Pair
|
|
219
|
+
* with `.optional()` / `.nullable()` / `.min()` / `.trim()` exactly like
|
|
220
|
+
* any other Zod string; `getSearchableMetadata()` finds the metadata
|
|
221
|
+
* through all of them.
|
|
222
|
+
*/
|
|
223
|
+
declare function searchable(options?: SearchableOptions): SearchableSchema;
|
|
224
|
+
declare function isSearchableSchema(value: unknown): value is SearchableSchema;
|
|
225
|
+
declare function getSearchableMetadata(schema: z.ZodType): SearchableMetadata | undefined;
|
|
226
|
+
|
|
227
|
+
declare const RECORDED_INSTANT_BRAND: unique symbol;
|
|
228
|
+
/**
|
|
229
|
+
* A canonical UTC ISO-8601 recorded-time instant (`YYYY-MM-DDTHH:mm:ss.sssZ`),
|
|
230
|
+
* nominally branded so it can only originate from a recorded-time source —
|
|
231
|
+
* {@link Store.recordedNow} or an explicit {@link asRecordedInstant} — never an
|
|
232
|
+
* ad-hoc wall-clock string.
|
|
233
|
+
*
|
|
234
|
+
* The recorded commit clock is a logical, monotonic per-graph instant that can
|
|
235
|
+
* run briefly ahead of wall time under bursty same-millisecond writes, so a raw
|
|
236
|
+
* `new Date().toISOString()` may sort *before* the most recent commits and
|
|
237
|
+
* silently omit them. The brand turns that footgun into a compile error:
|
|
238
|
+
* `store.asOfRecorded` accepts only a `RecordedInstant`, so a bare wall-clock
|
|
239
|
+
* string no longer type-checks — callers reach for `await store.recordedNow()`
|
|
240
|
+
* (the monotonic high-water mark) or {@link asRecordedInstant} instead.
|
|
241
|
+
*/
|
|
242
|
+
type RecordedInstant = string & {
|
|
243
|
+
readonly [RECORDED_INSTANT_BRAND]: "RecordedInstant";
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Brands a canonical UTC ISO-8601 string as a {@link RecordedInstant}.
|
|
247
|
+
*
|
|
248
|
+
* The escape hatch for an instant that round-trips through untyped storage:
|
|
249
|
+
* captured from {@link Store.recordedNow}, persisted as a plain string, read
|
|
250
|
+
* back, and replayed into `asOfRecorded`. Validates the canonical form eagerly —
|
|
251
|
+
* the same check `asOfRecorded` applies — so a malformed value fails here, at the
|
|
252
|
+
* brand site, rather than deeper in a read. Does *not* assert the instant is a
|
|
253
|
+
* real captured commit; it only guarantees the value is well-formed enough to
|
|
254
|
+
* compare correctly against the recorded relations.
|
|
255
|
+
*
|
|
256
|
+
* @throws {ValidationError} when `value` is not a canonical UTC ISO-8601 string.
|
|
257
|
+
*/
|
|
258
|
+
declare function asRecordedInstant(value: string): RecordedInstant;
|
|
259
|
+
/**
|
|
260
|
+
* The single opaque temporal coordinate every pinned read is resolved
|
|
261
|
+
* against. It carries the valid-time axis plus an optional recorded/system-time
|
|
262
|
+
* axis, so every surface can inject one coordinate object instead of threading
|
|
263
|
+
* each temporal dimension separately.
|
|
264
|
+
*/
|
|
265
|
+
type ReadCoordinate = Readonly<{
|
|
266
|
+
/**
|
|
267
|
+
* The valid-time axis: a resolved temporal mode and (only for `"asOf"`) the
|
|
268
|
+
* instant it is pinned to.
|
|
269
|
+
*/
|
|
270
|
+
valid: Readonly<{
|
|
271
|
+
mode: TemporalMode;
|
|
272
|
+
/** Defined only when `mode` is `"asOf"`. */
|
|
273
|
+
asOf?: string;
|
|
274
|
+
}>;
|
|
275
|
+
/** The recorded/system-time axis. Defined only for recorded-pinned views. */
|
|
276
|
+
recorded?: Readonly<{
|
|
277
|
+
asOf: RecordedInstant;
|
|
278
|
+
}>;
|
|
279
|
+
}>;
|
|
280
|
+
|
|
281
|
+
export { DEFAULT_SEARCHABLE_LANGUAGE as D, type EmbeddingMetric as E, type RecordedInstant as R, type SearchableMetadata as S, type EmbeddingIndexType as a, type EmbeddingSchema as b, type EmbeddingValue as c, type SearchableOptions as d, type SearchableSchema as e, asRecordedInstant as f, embedding as g, getEmbeddingDimensions as h, getSearchableMetadata as i, isEmbeddingSchema as j, isSearchableSchema as k, type ReadCoordinate as l, resolveGraphVectorSlots as r, searchable as s };
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { p as VectorSlot } from './index-Bq7vSPHy.js';
|
|
3
|
+
import { G as GraphDef } from './define-graph-DRo9xpYN.js';
|
|
4
|
+
import { T as TemporalMode } from './extension-types-BLEVH4SG.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Embedding type for vector search.
|
|
8
|
+
*
|
|
9
|
+
* Creates a Zod-compatible schema for vector embeddings with
|
|
10
|
+
* dimension validation and metadata for query compilation.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Symbol used to brand embedding values at the type level.
|
|
15
|
+
* This allows TypeScript to distinguish embedding arrays from regular
|
|
16
|
+
* number arrays in the query builder type system.
|
|
17
|
+
*/
|
|
18
|
+
declare const EMBEDDING_BRAND: unique symbol;
|
|
19
|
+
/**
|
|
20
|
+
* Branded embedding type for type-level distinction.
|
|
21
|
+
* At runtime this is just `readonly number[]`, but TypeScript can
|
|
22
|
+
* distinguish it from regular arrays for query builder typing.
|
|
23
|
+
*/
|
|
24
|
+
type EmbeddingValue = readonly number[] & {
|
|
25
|
+
readonly [EMBEDDING_BRAND]: true;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Symbol key for storing embedding dimensions on the schema.
|
|
29
|
+
* This allows the schema introspector to detect embedding types
|
|
30
|
+
* and extract dimension information.
|
|
31
|
+
*/
|
|
32
|
+
declare const EMBEDDING_DIMENSIONS_KEY: "_embeddingDimensions";
|
|
33
|
+
/**
|
|
34
|
+
* Symbol key for storing the embedding's preferred index configuration
|
|
35
|
+
* on the schema. The schema introspector reads this when auto-deriving
|
|
36
|
+
* `VectorIndexDeclaration` entries at `defineGraph()` time.
|
|
37
|
+
*/
|
|
38
|
+
declare const EMBEDDING_INDEX_KEY: "_embeddingIndex";
|
|
39
|
+
/**
|
|
40
|
+
* Distance metric used for vector similarity. Pinned at the embedding
|
|
41
|
+
* brand because changing the metric usually means generating different
|
|
42
|
+
* model output (e.g. cosine-normalized vs. raw inner-product), and the
|
|
43
|
+
* stored index needs the same metric to score correctly.
|
|
44
|
+
*
|
|
45
|
+
* - `cosine`: cosine similarity. The default — works for most
|
|
46
|
+
* sentence-transformer / OpenAI-style embeddings that are already
|
|
47
|
+
* length-normalized.
|
|
48
|
+
* - `l2`: Euclidean distance. Use when your model outputs vectors
|
|
49
|
+
* trained for L2 (e.g. some image embedding models).
|
|
50
|
+
* - `inner_product`: dot-product distance. Use when your model outputs
|
|
51
|
+
* pre-normalized vectors AND you want to skip the cosine
|
|
52
|
+
* normalization step at query time.
|
|
53
|
+
*/
|
|
54
|
+
type EmbeddingMetric = "cosine" | "l2" | "inner_product";
|
|
55
|
+
/**
|
|
56
|
+
* Vector index implementation. `hnsw` is the default and what pgvector
|
|
57
|
+
* recommends for most workloads. `ivfflat` is the alternative for
|
|
58
|
+
* larger datasets where memory is the bottleneck. `none` disables
|
|
59
|
+
* automatic index creation for this embedding (the operator can still
|
|
60
|
+
* call `backend.createVectorIndex` manually).
|
|
61
|
+
*/
|
|
62
|
+
type EmbeddingIndexType = "hnsw" | "ivfflat" | "none";
|
|
63
|
+
/**
|
|
64
|
+
* Per-embedding configuration for the auto-derived
|
|
65
|
+
* `VectorIndexDeclaration`. All fields are optional with sensible
|
|
66
|
+
* defaults (`cosine` / `hnsw` / pgvector defaults: `m=16`,
|
|
67
|
+
* `ef_construction=64`). Override only when your model or dataset has
|
|
68
|
+
* a known reason to.
|
|
69
|
+
*/
|
|
70
|
+
type EmbeddingIndexOptions = Readonly<{
|
|
71
|
+
/** Distance metric. Default `"cosine"`. */
|
|
72
|
+
metric?: EmbeddingMetric;
|
|
73
|
+
/** Vector index implementation. Default `"hnsw"`. */
|
|
74
|
+
indexType?: EmbeddingIndexType;
|
|
75
|
+
/** HNSW `m` parameter — max connections per layer. Default `16`. */
|
|
76
|
+
m?: number;
|
|
77
|
+
/** HNSW `ef_construction` parameter — build-time search depth. Default `64`. */
|
|
78
|
+
efConstruction?: number;
|
|
79
|
+
/** IVFFlat `lists` parameter — number of inverted-list partitions. */
|
|
80
|
+
lists?: number;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Resolved embedding index configuration with all defaults applied.
|
|
84
|
+
* What gets attached to the brand and read by the auto-derivation pass.
|
|
85
|
+
*/
|
|
86
|
+
type ResolvedEmbeddingIndex = Readonly<{
|
|
87
|
+
metric: EmbeddingMetric;
|
|
88
|
+
indexType: EmbeddingIndexType;
|
|
89
|
+
m: number;
|
|
90
|
+
efConstruction: number;
|
|
91
|
+
lists: number | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* A Zod schema for vector embeddings with attached dimension metadata.
|
|
95
|
+
* Uses the branded EmbeddingValue type for type-level distinction.
|
|
96
|
+
*/
|
|
97
|
+
type EmbeddingSchema<D extends number = number> = z.ZodType<EmbeddingValue> & Readonly<{
|
|
98
|
+
[EMBEDDING_DIMENSIONS_KEY]: D;
|
|
99
|
+
[EMBEDDING_INDEX_KEY]: ResolvedEmbeddingIndex;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a Zod schema for vector embeddings.
|
|
103
|
+
*
|
|
104
|
+
* The dimension is validated at runtime and attached as metadata
|
|
105
|
+
* for the schema introspector and query compiler.
|
|
106
|
+
*
|
|
107
|
+
* @param dimensions - The number of dimensions (e.g., 384, 512, 768, 1536, 3072)
|
|
108
|
+
* @returns A Zod schema that validates embedding arrays
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* // OpenAI ada-002 embeddings
|
|
113
|
+
* const Document = defineNode("Document", {
|
|
114
|
+
* schema: z.object({
|
|
115
|
+
* title: z.string(),
|
|
116
|
+
* embedding: embedding(1536),
|
|
117
|
+
* }),
|
|
118
|
+
* });
|
|
119
|
+
*
|
|
120
|
+
* // Sentence transformers
|
|
121
|
+
* const Sentence = defineNode("Sentence", {
|
|
122
|
+
* schema: z.object({
|
|
123
|
+
* text: z.string(),
|
|
124
|
+
* embedding: embedding(384), // all-MiniLM-L6-v2
|
|
125
|
+
* }),
|
|
126
|
+
* });
|
|
127
|
+
*
|
|
128
|
+
* // Optional embeddings are supported
|
|
129
|
+
* const Article = defineNode("Article", {
|
|
130
|
+
* schema: z.object({
|
|
131
|
+
* content: z.string(),
|
|
132
|
+
* embedding: embedding(1536).optional(),
|
|
133
|
+
* }),
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
declare function embedding<D extends number>(dimensions: D, options?: EmbeddingIndexOptions): EmbeddingSchema<D>;
|
|
138
|
+
/**
|
|
139
|
+
* Checks if a value is an embedding schema.
|
|
140
|
+
*/
|
|
141
|
+
declare function isEmbeddingSchema(value: unknown): value is EmbeddingSchema;
|
|
142
|
+
/**
|
|
143
|
+
* Gets the dimensions from an embedding schema.
|
|
144
|
+
* Returns undefined if the schema is not an embedding schema.
|
|
145
|
+
*/
|
|
146
|
+
declare function getEmbeddingDimensions(schema: z.ZodType): number | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Enumerates every embedding `(kind, field)` slot a graph declares, as a
|
|
149
|
+
* fully-resolved {@link VectorSlot}. The single source of truth for "what
|
|
150
|
+
* vector slots does this graph have?", shared by the privileged boot
|
|
151
|
+
* materializer (`materializeVectorContributions`) and the verified-attach
|
|
152
|
+
* gate (`assertVectorContributionsInitialized`) so the two can never
|
|
153
|
+
* provision and assert different sets. Walks `graph.nodes` and reuses
|
|
154
|
+
* {@link resolveEmbeddingFields} per node schema.
|
|
155
|
+
*/
|
|
156
|
+
declare function resolveGraphVectorSlots(graph: GraphDef): readonly VectorSlot[];
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Searchable string type for fulltext search.
|
|
160
|
+
*
|
|
161
|
+
* `searchable()` attaches `SearchableMetadata` to a plain Zod string so
|
|
162
|
+
* the schema introspector and fulltext-sync layer can keep the fulltext
|
|
163
|
+
* index in sync with node data.
|
|
164
|
+
*
|
|
165
|
+
* The metadata is preserved by Zod's `.meta()` across refinements
|
|
166
|
+
* (`.min(1)`, `.trim()`, `.regex(...)`) and wrapper types (`.optional()`,
|
|
167
|
+
* `.nullable()`, `.default(...)`, pipes) — `getSearchableMetadata()` walks
|
|
168
|
+
* these variants so runtime indexing works whether or not a user chains
|
|
169
|
+
* additional modifiers.
|
|
170
|
+
*
|
|
171
|
+
* `$fulltext` is exposed on every `NodeAccessor` at the type level; a
|
|
172
|
+
* runtime guard throws a clear error if you call `.matches()` on an
|
|
173
|
+
* alias whose node kind has no `searchable()` fields. This is simpler
|
|
174
|
+
* and more predictable than a type-level brand that silently disappears
|
|
175
|
+
* behind `.min(1)`.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```typescript
|
|
179
|
+
* const Document = defineNode("Document", {
|
|
180
|
+
* schema: z.object({
|
|
181
|
+
* title: searchable({ language: "english" }),
|
|
182
|
+
* body: searchable().min(1),
|
|
183
|
+
* authorId: z.string(),
|
|
184
|
+
* }),
|
|
185
|
+
* });
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
declare const SEARCHABLE_FIELD_KEY: "_searchableField";
|
|
190
|
+
declare const DEFAULT_SEARCHABLE_LANGUAGE: "english";
|
|
191
|
+
/**
|
|
192
|
+
* Searchable field metadata attached to a Zod schema.
|
|
193
|
+
*/
|
|
194
|
+
type SearchableMetadata = Readonly<{
|
|
195
|
+
/**
|
|
196
|
+
* Language for stemming / tokenization.
|
|
197
|
+
* Postgres: passed to `to_tsvector(regconfig, ...)`.
|
|
198
|
+
* SQLite FTS5: tokenizer is fixed at table-create time, so the
|
|
199
|
+
* language is recorded but not applied per-row.
|
|
200
|
+
*/
|
|
201
|
+
language: string;
|
|
202
|
+
}>;
|
|
203
|
+
/**
|
|
204
|
+
* Branded Zod string schema. The `SEARCHABLE_FIELD_KEY` marker is
|
|
205
|
+
* attached both as a direct property (fast runtime check) and via Zod's
|
|
206
|
+
* `.meta()` (so it survives `.min()`, `.trim()`, etc.).
|
|
207
|
+
*/
|
|
208
|
+
type SearchableSchema = z.ZodString & Readonly<{
|
|
209
|
+
[SEARCHABLE_FIELD_KEY]: SearchableMetadata;
|
|
210
|
+
}>;
|
|
211
|
+
type SearchableOptions = Readonly<{
|
|
212
|
+
language?: string;
|
|
213
|
+
}>;
|
|
214
|
+
/**
|
|
215
|
+
* Creates a Zod string schema tagged as fulltext-searchable.
|
|
216
|
+
*
|
|
217
|
+
* The returned schema passes runtime validation unchanged — the tag only
|
|
218
|
+
* affects how TypeGraph treats the field for indexing and search. Pair
|
|
219
|
+
* with `.optional()` / `.nullable()` / `.min()` / `.trim()` exactly like
|
|
220
|
+
* any other Zod string; `getSearchableMetadata()` finds the metadata
|
|
221
|
+
* through all of them.
|
|
222
|
+
*/
|
|
223
|
+
declare function searchable(options?: SearchableOptions): SearchableSchema;
|
|
224
|
+
declare function isSearchableSchema(value: unknown): value is SearchableSchema;
|
|
225
|
+
declare function getSearchableMetadata(schema: z.ZodType): SearchableMetadata | undefined;
|
|
226
|
+
|
|
227
|
+
declare const RECORDED_INSTANT_BRAND: unique symbol;
|
|
228
|
+
/**
|
|
229
|
+
* A canonical UTC ISO-8601 recorded-time instant (`YYYY-MM-DDTHH:mm:ss.sssZ`),
|
|
230
|
+
* nominally branded so it can only originate from a recorded-time source —
|
|
231
|
+
* {@link Store.recordedNow} or an explicit {@link asRecordedInstant} — never an
|
|
232
|
+
* ad-hoc wall-clock string.
|
|
233
|
+
*
|
|
234
|
+
* The recorded commit clock is a logical, monotonic per-graph instant that can
|
|
235
|
+
* run briefly ahead of wall time under bursty same-millisecond writes, so a raw
|
|
236
|
+
* `new Date().toISOString()` may sort *before* the most recent commits and
|
|
237
|
+
* silently omit them. The brand turns that footgun into a compile error:
|
|
238
|
+
* `store.asOfRecorded` accepts only a `RecordedInstant`, so a bare wall-clock
|
|
239
|
+
* string no longer type-checks — callers reach for `await store.recordedNow()`
|
|
240
|
+
* (the monotonic high-water mark) or {@link asRecordedInstant} instead.
|
|
241
|
+
*/
|
|
242
|
+
type RecordedInstant = string & {
|
|
243
|
+
readonly [RECORDED_INSTANT_BRAND]: "RecordedInstant";
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Brands a canonical UTC ISO-8601 string as a {@link RecordedInstant}.
|
|
247
|
+
*
|
|
248
|
+
* The escape hatch for an instant that round-trips through untyped storage:
|
|
249
|
+
* captured from {@link Store.recordedNow}, persisted as a plain string, read
|
|
250
|
+
* back, and replayed into `asOfRecorded`. Validates the canonical form eagerly —
|
|
251
|
+
* the same check `asOfRecorded` applies — so a malformed value fails here, at the
|
|
252
|
+
* brand site, rather than deeper in a read. Does *not* assert the instant is a
|
|
253
|
+
* real captured commit; it only guarantees the value is well-formed enough to
|
|
254
|
+
* compare correctly against the recorded relations.
|
|
255
|
+
*
|
|
256
|
+
* @throws {ValidationError} when `value` is not a canonical UTC ISO-8601 string.
|
|
257
|
+
*/
|
|
258
|
+
declare function asRecordedInstant(value: string): RecordedInstant;
|
|
259
|
+
/**
|
|
260
|
+
* The single opaque temporal coordinate every pinned read is resolved
|
|
261
|
+
* against. It carries the valid-time axis plus an optional recorded/system-time
|
|
262
|
+
* axis, so every surface can inject one coordinate object instead of threading
|
|
263
|
+
* each temporal dimension separately.
|
|
264
|
+
*/
|
|
265
|
+
type ReadCoordinate = Readonly<{
|
|
266
|
+
/**
|
|
267
|
+
* The valid-time axis: a resolved temporal mode and (only for `"asOf"`) the
|
|
268
|
+
* instant it is pinned to.
|
|
269
|
+
*/
|
|
270
|
+
valid: Readonly<{
|
|
271
|
+
mode: TemporalMode;
|
|
272
|
+
/** Defined only when `mode` is `"asOf"`. */
|
|
273
|
+
asOf?: string;
|
|
274
|
+
}>;
|
|
275
|
+
/** The recorded/system-time axis. Defined only for recorded-pinned views. */
|
|
276
|
+
recorded?: Readonly<{
|
|
277
|
+
asOf: RecordedInstant;
|
|
278
|
+
}>;
|
|
279
|
+
}>;
|
|
280
|
+
|
|
281
|
+
export { DEFAULT_SEARCHABLE_LANGUAGE as D, type EmbeddingMetric as E, type RecordedInstant as R, type SearchableMetadata as S, type EmbeddingIndexType as a, type EmbeddingSchema as b, type EmbeddingValue as c, type SearchableOptions as d, type SearchableSchema as e, asRecordedInstant as f, embedding as g, getEmbeddingDimensions as h, getSearchableMetadata as i, isEmbeddingSchema as j, isSearchableSchema as k, type ReadCoordinate as l, resolveGraphVectorSlots as r, searchable as s };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { K as KindEntity } from './extension-types-
|
|
2
|
-
import { J as JsonPointer } from './
|
|
1
|
+
import { K as KindEntity } from './extension-types-BLEVH4SG.cjs';
|
|
2
|
+
import { J as JsonPointer } from './index-CrFL_ENI.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* QueryProfiler types.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { K as KindEntity } from './extension-types-
|
|
2
|
-
import { J as JsonPointer } from './
|
|
1
|
+
import { K as KindEntity } from './extension-types-BLEVH4SG.js';
|
|
2
|
+
import { J as JsonPointer } from './index-Bq7vSPHy.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* QueryProfiler types.
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { A as AnyEdgeType,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare function defineNodeIndex<N extends NodeType>(node: N, config: NodeIndexConfig<N>): NodeIndexDeclaration;
|
|
5
|
-
declare function defineEdgeIndex<E extends AnyEdgeType>(edge: E, config: EdgeIndexConfig<E>): EdgeIndexDeclaration;
|
|
1
|
+
import { A as AnyEdgeType, a as NodeType } from './extension-types-BLEVH4SG.js';
|
|
2
|
+
import { a as EdgeIndexConfig, E as EdgeIndexDeclaration, i as NodeIndexConfig, N as NodeIndexDeclaration, f as IndexWhereExpression } from './index-Bq7vSPHy.js';
|
|
6
3
|
|
|
7
4
|
/** The TypeGraph relations that carry system indexes. */
|
|
8
5
|
type SystemIndexTable = "nodes" | "edges" | "recordedNodes" | "recordedEdges";
|
|
@@ -29,6 +26,9 @@ declare function generateSystemIndexDDL(declaration: SystemIndexDeclaration, phy
|
|
|
29
26
|
concurrent: boolean;
|
|
30
27
|
}>): string;
|
|
31
28
|
|
|
29
|
+
declare function defineNodeIndex<N extends NodeType>(node: N, config: NodeIndexConfig<N>): NodeIndexDeclaration;
|
|
30
|
+
declare function defineEdgeIndex<E extends AnyEdgeType>(edge: E, config: EdgeIndexConfig<E>): EdgeIndexDeclaration;
|
|
31
|
+
|
|
32
32
|
declare function andWhere(...predicates: [IndexWhereExpression, ...IndexWhereExpression[]]): IndexWhereExpression;
|
|
33
33
|
declare function orWhere(...predicates: [IndexWhereExpression, ...IndexWhereExpression[]]): IndexWhereExpression;
|
|
34
34
|
declare function notWhere(predicate: IndexWhereExpression): IndexWhereExpression;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { A as AnyEdgeType,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare function defineNodeIndex<N extends NodeType>(node: N, config: NodeIndexConfig<N>): NodeIndexDeclaration;
|
|
5
|
-
declare function defineEdgeIndex<E extends AnyEdgeType>(edge: E, config: EdgeIndexConfig<E>): EdgeIndexDeclaration;
|
|
1
|
+
import { A as AnyEdgeType, a as NodeType } from './extension-types-BLEVH4SG.cjs';
|
|
2
|
+
import { a as EdgeIndexConfig, E as EdgeIndexDeclaration, i as NodeIndexConfig, N as NodeIndexDeclaration, f as IndexWhereExpression } from './index-CrFL_ENI.cjs';
|
|
6
3
|
|
|
7
4
|
/** The TypeGraph relations that carry system indexes. */
|
|
8
5
|
type SystemIndexTable = "nodes" | "edges" | "recordedNodes" | "recordedEdges";
|
|
@@ -29,6 +26,9 @@ declare function generateSystemIndexDDL(declaration: SystemIndexDeclaration, phy
|
|
|
29
26
|
concurrent: boolean;
|
|
30
27
|
}>): string;
|
|
31
28
|
|
|
29
|
+
declare function defineNodeIndex<N extends NodeType>(node: N, config: NodeIndexConfig<N>): NodeIndexDeclaration;
|
|
30
|
+
declare function defineEdgeIndex<E extends AnyEdgeType>(edge: E, config: EdgeIndexConfig<E>): EdgeIndexDeclaration;
|
|
31
|
+
|
|
32
32
|
declare function andWhere(...predicates: [IndexWhereExpression, ...IndexWhereExpression[]]): IndexWhereExpression;
|
|
33
33
|
declare function orWhere(...predicates: [IndexWhereExpression, ...IndexWhereExpression[]]): IndexWhereExpression;
|
|
34
34
|
declare function notWhere(predicate: IndexWhereExpression): IndexWhereExpression;
|