@nicia-ai/typegraph 0.44.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.cjs +11 -11
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +7 -7
- package/dist/backend/index.cjs +53 -54
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +13 -14
- package/dist/backend/postgres/index.cjs +29 -30
- package/dist/backend/postgres/index.d.cts +7 -7
- package/dist/backend/postgres/index.d.ts +7 -7
- package/dist/backend/postgres/index.js +16 -17
- package/dist/backend/postgres/pglite-store.cjs +48 -43
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +15 -9
- package/dist/backend/postgres/pglite-store.d.ts +15 -9
- package/dist/backend/postgres/pglite-store.js +44 -39
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +18 -19
- package/dist/backend/postgres/pglite.d.cts +4 -4
- package/dist/backend/postgres/pglite.d.ts +4 -4
- package/dist/backend/postgres/pglite.js +17 -18
- package/dist/backend/sqlite/index.cjs +26 -27
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +14 -15
- package/dist/backend/sqlite/libsql.cjs +21 -22
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +15 -8
- package/dist/backend/sqlite/libsql.d.ts +15 -8
- package/dist/backend/sqlite/libsql.js +17 -18
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +49 -44
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- package/dist/backend/sqlite/local-store.d.cts +15 -10
- package/dist/backend/sqlite/local-store.d.ts +15 -10
- package/dist/backend/sqlite/local-store.js +45 -40
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +19 -20
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +17 -18
- package/dist/{chunk-XMYJY7NI.js → chunk-2LG2XB2M.js} +3 -3
- package/dist/{chunk-XMYJY7NI.js.map → chunk-2LG2XB2M.js.map} +1 -1
- package/dist/{chunk-QGKILWGZ.cjs → chunk-2NA5DYLO.cjs} +4 -4
- package/dist/{chunk-QGKILWGZ.cjs.map → chunk-2NA5DYLO.cjs.map} +1 -1
- package/dist/{chunk-5MUSU4ZP.cjs → chunk-3DHZCOT7.cjs} +20 -20
- package/dist/chunk-3DHZCOT7.cjs.map +1 -0
- package/dist/{chunk-OVUUTCPJ.cjs → chunk-4UGOKMI5.cjs} +268 -150
- package/dist/chunk-4UGOKMI5.cjs.map +1 -0
- package/dist/{chunk-FRHHDHKH.js → chunk-5262ZMTR.js} +26 -5
- package/dist/chunk-5262ZMTR.js.map +1 -0
- package/dist/{chunk-HOIFFY4M.js → chunk-5763DULU.js} +248 -76
- package/dist/chunk-5763DULU.js.map +1 -0
- package/dist/{chunk-7G32LIQM.js → chunk-5UVRGXD3.js} +277 -7
- package/dist/chunk-5UVRGXD3.js.map +1 -0
- package/dist/{chunk-IIT5K7SK.cjs → chunk-62ZP23AW.cjs} +15 -15
- package/dist/{chunk-IIT5K7SK.cjs.map → chunk-62ZP23AW.cjs.map} +1 -1
- package/dist/{chunk-S4KQ5LV4.js → chunk-775A4ZMN.js} +40 -6
- package/dist/chunk-775A4ZMN.js.map +1 -0
- package/dist/{chunk-QYWINYEA.cjs → chunk-7BQXPCGN.cjs} +830 -170
- package/dist/chunk-7BQXPCGN.cjs.map +1 -0
- package/dist/{chunk-FJMPR3OH.cjs → chunk-7EO3TCQB.cjs} +33 -7
- package/dist/chunk-7EO3TCQB.cjs.map +1 -0
- package/dist/chunk-7GT72YHH.cjs +1979 -0
- package/dist/chunk-7GT72YHH.cjs.map +1 -0
- package/dist/{chunk-SQRD2CYF.js → chunk-7VQXLT5O.js} +717 -76
- package/dist/chunk-7VQXLT5O.js.map +1 -0
- package/dist/{chunk-BCP7LLOY.js → chunk-7Z5OR7KO.js} +2706 -625
- package/dist/chunk-7Z5OR7KO.js.map +1 -0
- package/dist/chunk-A4OC4DVN.cjs +12 -0
- package/dist/{chunk-4SZ6XPTG.cjs.map → chunk-A4OC4DVN.cjs.map} +1 -1
- package/dist/{chunk-TDXIBCGY.cjs → chunk-A7J2YDDI.cjs} +5 -3
- package/dist/chunk-A7J2YDDI.cjs.map +1 -0
- package/dist/{chunk-FMMIX6N4.js → chunk-AKLS3BYZ.js} +56 -5
- package/dist/chunk-AKLS3BYZ.js.map +1 -0
- package/dist/{chunk-D7PG5D5K.js → chunk-AMKPPFUO.js} +32 -6
- package/dist/chunk-AMKPPFUO.js.map +1 -0
- package/dist/{chunk-PAW2XUZN.js → chunk-ASTI57H3.js} +3 -3
- package/dist/{chunk-PAW2XUZN.js.map → chunk-ASTI57H3.js.map} +1 -1
- package/dist/{chunk-FMGEZBAQ.js → chunk-BKCUOV7A.js} +27 -5
- package/dist/chunk-BKCUOV7A.js.map +1 -0
- package/dist/chunk-BSFJMMV3.cjs +268 -0
- package/dist/chunk-BSFJMMV3.cjs.map +1 -0
- package/dist/{chunk-63KCKSSH.js → chunk-C23WSN5E.js} +209 -24
- package/dist/chunk-C23WSN5E.js.map +1 -0
- package/dist/{chunk-JRP3VGHS.js → chunk-CBTIUB76.js} +3 -3
- package/dist/{chunk-JRP3VGHS.js.map → chunk-CBTIUB76.js.map} +1 -1
- package/dist/chunk-CNV4TXJG.js +58 -0
- package/dist/chunk-CNV4TXJG.js.map +1 -0
- package/dist/{chunk-QB6VMOJ2.cjs → chunk-CXBHOOIQ.cjs} +45 -10
- package/dist/chunk-CXBHOOIQ.cjs.map +1 -0
- package/dist/{chunk-46GDII45.js → chunk-DCQVHAYQ.js} +5 -5
- package/dist/{chunk-46GDII45.js.map → chunk-DCQVHAYQ.js.map} +1 -1
- package/dist/chunk-DLNROMQ7.js +306 -0
- package/dist/chunk-DLNROMQ7.js.map +1 -0
- package/dist/chunk-DYATYRY4.js +47 -0
- package/dist/chunk-DYATYRY4.js.map +1 -0
- package/dist/chunk-E4WNQBEF.cjs +217 -0
- package/dist/chunk-E4WNQBEF.cjs.map +1 -0
- package/dist/{chunk-G6Q5UM7U.js → chunk-FWJKWH6U.js} +5 -3
- package/dist/chunk-FWJKWH6U.js.map +1 -0
- package/dist/{chunk-BNUFUFAU.js → chunk-HFHTMECK.js} +7 -7
- package/dist/chunk-HFHTMECK.js.map +1 -0
- package/dist/{chunk-TFMVL4QH.js → chunk-I5MOXA4H.js} +20 -14
- package/dist/chunk-I5MOXA4H.js.map +1 -0
- package/dist/{chunk-4MB3AQAQ.js → chunk-J3WZ3FA2.js} +77 -3
- package/dist/chunk-J3WZ3FA2.js.map +1 -0
- package/dist/{chunk-UR7W5YQK.js → chunk-JBQQ7THH.js} +5 -3
- package/dist/chunk-JBQQ7THH.js.map +1 -0
- package/dist/chunk-JIVMTW7W.js +3393 -0
- package/dist/chunk-JIVMTW7W.js.map +1 -0
- package/dist/{chunk-2Y4IFKW7.js → chunk-JXA2ZP2Q.js} +6 -17
- package/dist/chunk-JXA2ZP2Q.js.map +1 -0
- package/dist/{chunk-GYA4JRP5.js → chunk-JXXDZTMN.js} +2 -2
- package/dist/chunk-JXXDZTMN.js.map +1 -0
- package/dist/chunk-JZUR7ZWE.js +254 -0
- package/dist/chunk-JZUR7ZWE.js.map +1 -0
- package/dist/chunk-K5ELX2GT.js +248 -0
- package/dist/chunk-K5ELX2GT.js.map +1 -0
- package/dist/chunk-LBJKZXDE.cjs +257 -0
- package/dist/chunk-LBJKZXDE.cjs.map +1 -0
- package/dist/{chunk-FGO5JFVJ.cjs → chunk-M4BDU5RX.cjs} +12 -12
- package/dist/{chunk-FGO5JFVJ.cjs.map → chunk-M4BDU5RX.cjs.map} +1 -1
- package/dist/{chunk-MIJKEVV7.js → chunk-MSY7FSX4.js} +37 -4
- package/dist/chunk-MSY7FSX4.js.map +1 -0
- package/dist/{chunk-ST3LPB2V.cjs → chunk-MUK4BU7K.cjs} +788 -146
- package/dist/chunk-MUK4BU7K.cjs.map +1 -0
- package/dist/{chunk-MCHP7RHZ.cjs → chunk-MXJDTH5B.cjs} +64 -41
- package/dist/chunk-MXJDTH5B.cjs.map +1 -0
- package/dist/{chunk-2VLBGQBY.cjs → chunk-N3257XE6.cjs} +724 -577
- package/dist/chunk-N3257XE6.cjs.map +1 -0
- package/dist/chunk-N66HCGCY.cjs +57 -0
- package/dist/chunk-N66HCGCY.cjs.map +1 -0
- package/dist/{chunk-CPEL3YIR.cjs → chunk-NFCVHQ5P.cjs} +55 -22
- package/dist/chunk-NFCVHQ5P.cjs.map +1 -0
- package/dist/{chunk-C4F7VJ5D.cjs → chunk-NI72YOJB.cjs} +84 -2
- package/dist/chunk-NI72YOJB.cjs.map +1 -0
- package/dist/{chunk-EE7N5XXQ.cjs → chunk-NK5Q7UNE.cjs} +10 -21
- package/dist/chunk-NK5Q7UNE.cjs.map +1 -0
- package/dist/{chunk-PHXITZE4.js → chunk-NMWDXFPH.js} +4 -4
- package/dist/{chunk-PHXITZE4.js.map → chunk-NMWDXFPH.js.map} +1 -1
- package/dist/{chunk-FSXTPBRN.js → chunk-NQ6BRJBE.js} +416 -850
- package/dist/chunk-NQ6BRJBE.js.map +1 -0
- package/dist/chunk-OH5E5KIO.js +2057 -0
- package/dist/chunk-OH5E5KIO.js.map +1 -0
- package/dist/chunk-ONU3HIED.cjs +2082 -0
- package/dist/chunk-ONU3HIED.cjs.map +1 -0
- package/dist/{chunk-STQ3BSED.cjs → chunk-PNN7RHVR.cjs} +66 -44
- package/dist/chunk-PNN7RHVR.cjs.map +1 -0
- package/dist/{chunk-6DCB664D.js → chunk-PQBQG7IM.js} +3 -3
- package/dist/{chunk-6DCB664D.js.map → chunk-PQBQG7IM.js.map} +1 -1
- package/dist/{chunk-ACSVZPK7.cjs → chunk-PWLJ77UV.cjs} +5 -3
- package/dist/chunk-PWLJ77UV.cjs.map +1 -0
- package/dist/chunk-Q7Q4WSLJ.cjs +328 -0
- package/dist/chunk-Q7Q4WSLJ.cjs.map +1 -0
- package/dist/{chunk-BEFM74L2.js → chunk-QLRESYPU.js} +637 -493
- package/dist/chunk-QLRESYPU.js.map +1 -0
- package/dist/{chunk-SBPC5IP3.js → chunk-QWX5YA3K.js} +784 -202
- package/dist/chunk-QWX5YA3K.js.map +1 -0
- package/dist/{chunk-TCRIQMBU.js → chunk-RJS7DECT.js} +8 -9
- package/dist/chunk-RJS7DECT.js.map +1 -0
- package/dist/{chunk-6JZUSDY2.cjs → chunk-RMQLSPA2.cjs} +297 -27
- package/dist/chunk-RMQLSPA2.cjs.map +1 -0
- package/dist/{chunk-SJDMVITW.cjs → chunk-RT5ZY4XA.cjs} +6 -5
- package/dist/chunk-RT5ZY4XA.cjs.map +1 -0
- package/dist/{chunk-IJTLXNGJ.js → chunk-T4XNKYXB.js} +780 -127
- package/dist/chunk-T4XNKYXB.js.map +1 -0
- package/dist/{chunk-PDGEXGS6.cjs → chunk-TQR4KBY2.cjs} +354 -182
- package/dist/chunk-TQR4KBY2.cjs.map +1 -0
- package/dist/chunk-TTAITEPJ.cjs +755 -0
- package/dist/chunk-TTAITEPJ.cjs.map +1 -0
- package/dist/{chunk-NN3QSOVS.cjs → chunk-U5SON7R2.cjs} +27 -27
- package/dist/{chunk-NN3QSOVS.cjs.map → chunk-U5SON7R2.cjs.map} +1 -1
- package/dist/{chunk-A2I2XO52.cjs → chunk-U63GDNRC.cjs} +32 -26
- package/dist/chunk-U63GDNRC.cjs.map +1 -0
- package/dist/{chunk-YNULOIR5.cjs → chunk-UDISNXDL.cjs} +64 -43
- package/dist/chunk-UDISNXDL.cjs.map +1 -0
- package/dist/{chunk-GWEDD3DH.js → chunk-UV3SN74I.js} +5 -5
- package/dist/{chunk-GWEDD3DH.js.map → chunk-UV3SN74I.js.map} +1 -1
- package/dist/{chunk-U5W4LKZV.cjs → chunk-VCRRKBLN.cjs} +9 -9
- package/dist/{chunk-U5W4LKZV.cjs.map → chunk-VCRRKBLN.cjs.map} +1 -1
- package/dist/{chunk-EFELJVLA.js → chunk-VGTJPTIC.js} +28 -5
- package/dist/chunk-VGTJPTIC.js.map +1 -0
- package/dist/chunk-VQH4VAWD.cjs +12 -0
- package/dist/{chunk-EPTSMFH7.cjs.map → chunk-VQH4VAWD.cjs.map} +1 -1
- package/dist/{chunk-SNXVDZAJ.js → chunk-W6OG3HDG.js} +5 -4
- package/dist/chunk-W6OG3HDG.js.map +1 -0
- package/dist/chunk-WDGA7IYB.js +207 -0
- package/dist/chunk-WDGA7IYB.js.map +1 -0
- package/dist/chunk-WEVQJ5LH.js +736 -0
- package/dist/chunk-WEVQJ5LH.js.map +1 -0
- package/dist/{chunk-3PRKZW6D.cjs → chunk-XBYVV3MP.cjs} +60 -5
- package/dist/chunk-XBYVV3MP.cjs.map +1 -0
- package/dist/{chunk-GFRGG2US.cjs → chunk-XCAGZAKP.cjs} +7 -7
- package/dist/{chunk-GFRGG2US.cjs.map → chunk-XCAGZAKP.cjs.map} +1 -1
- package/dist/{chunk-XR4YZFKW.cjs → chunk-XDF2UPEQ.cjs} +3864 -1783
- package/dist/chunk-XDF2UPEQ.cjs.map +1 -0
- package/dist/{chunk-7V2FGGI2.cjs → chunk-XMQSEJCF.cjs} +632 -1080
- package/dist/chunk-XMQSEJCF.cjs.map +1 -0
- package/dist/chunk-XNLIZYRZ.cjs +3432 -0
- package/dist/chunk-XNLIZYRZ.cjs.map +1 -0
- package/dist/{chunk-66UVLHQA.cjs → chunk-XNSI2FJO.cjs} +99 -100
- package/dist/chunk-XNSI2FJO.cjs.map +1 -0
- package/dist/chunk-XQSCL77R.cjs +60 -0
- package/dist/chunk-XQSCL77R.cjs.map +1 -0
- package/dist/{chunk-SVJ5GEXW.cjs → chunk-XUO3KQFO.cjs} +2 -2
- package/dist/chunk-XUO3KQFO.cjs.map +1 -0
- package/dist/{chunk-HJH3RMXG.cjs → chunk-YAAM3M2S.cjs} +10 -10
- package/dist/{chunk-HJH3RMXG.cjs.map → chunk-YAAM3M2S.cjs.map} +1 -1
- package/dist/{chunk-ATLN63JA.js → chunk-YBFHZUXX.js} +6 -6
- package/dist/{chunk-ATLN63JA.js.map → chunk-YBFHZUXX.js.map} +1 -1
- package/dist/{chunk-K3BUWSFR.js → chunk-YDFDBE6D.js} +119 -6
- package/dist/chunk-YDFDBE6D.js.map +1 -0
- package/dist/{chunk-OSZPLZIV.cjs → chunk-YVWGEQJE.cjs} +318 -132
- package/dist/chunk-YVWGEQJE.cjs.map +1 -0
- package/dist/{chunk-QT6V3YRH.js → chunk-YWGVVALJ.js} +3 -3
- package/dist/{chunk-QT6V3YRH.js.map → chunk-YWGVVALJ.js.map} +1 -1
- package/dist/core/index.cjs +40 -41
- package/dist/core/index.d.cts +4 -5
- package/dist/core/index.d.ts +4 -5
- package/dist/core/index.js +8 -9
- package/dist/{ddl-eWg7hx6R.d.cts → ddl-BJcOp4WZ.d.cts} +3 -3
- package/dist/{ddl-D5369kOY.d.ts → ddl-BXfGHbPN.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +26 -23
- package/dist/graph-extension/index.d.cts +16 -6
- package/dist/graph-extension/index.d.ts +16 -6
- package/dist/graph-extension/index.js +7 -8
- package/dist/graph-merge/index.cjs +2459 -655
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +170 -33
- package/dist/graph-merge/index.d.ts +170 -33
- package/dist/graph-merge/index.js +2269 -468
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-By89Sezh.d.ts → index-BSHvKfok.d.ts} +221 -10
- package/dist/{index-DcQ3Sxs-.d.cts → index-DxaYCv8Y.d.cts} +221 -10
- package/dist/index.cjs +330 -269
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +590 -576
- package/dist/index.d.ts +590 -576
- package/dist/index.js +73 -50
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +17 -17
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +10 -10
- package/dist/interchange/index.cjs +165 -50
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +261 -16
- package/dist/interchange/index.d.ts +261 -16
- package/dist/interchange/index.js +128 -24
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-B0KjKE93.d.ts → manager-CfZAimti.d.ts} +36 -5
- package/dist/{manager-Cn0NFIhN.d.cts → manager-HGk6E_HW.d.cts} +36 -5
- package/dist/{materialize-indexes-BD4V3svD.d.ts → materialize-indexes-6A7dWGtb.d.cts} +10 -2
- package/dist/{materialize-indexes-DVRhd5h4.d.cts → materialize-indexes-BMJP6Tms.d.ts} +10 -2
- package/dist/{postgres-DaEWvN4x.d.cts → postgres-DFYWENdR.d.cts} +1961 -439
- package/dist/{postgres-u0a0HN2D.d.ts → postgres-e7a9TdvR.d.ts} +1961 -439
- package/dist/profiler/index.cjs +15 -15
- package/dist/profiler/index.d.cts +9 -10
- package/dist/profiler/index.d.ts +9 -10
- package/dist/profiler/index.js +4 -4
- package/dist/provenance/index.cjs +46 -48
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +12 -14
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +50 -49
- package/dist/schema/index.d.cts +9 -16
- package/dist/schema/index.d.ts +9 -16
- package/dist/schema/index.js +23 -22
- package/dist/{searchable-CnYEancP.d.ts → searchable-9OQoPuRs.d.ts} +1 -2
- package/dist/{searchable-BT7j9_IK.d.cts → searchable-CIje5XYD.d.cts} +1 -2
- package/dist/{sqlite-BrMoSsI7.d.cts → sqlite-DerU5tc7.d.ts} +2029 -347
- package/dist/{sqlite-CHhZUyO5.d.ts → sqlite-DitnISa9.d.cts} +2029 -347
- package/dist/{store-view-Bvdku0Ht.d.ts → store-DawaWWjJ.d.ts} +3145 -2556
- package/dist/{store-view-w-md0nQ4.d.cts → store-RwTJx8LX.d.cts} +3145 -2556
- package/dist/{temporal-BCORwUau.d.cts → temporal-Bn-Fi8FJ.d.cts} +1 -1
- package/dist/{temporal--x9T8K4S.d.ts → temporal-BtM4UALv.d.ts} +1 -1
- package/dist/{types-6-WJmSD4.d.cts → types-CoIx8HX5.d.cts} +1 -1
- package/dist/{types-Cjvkj0jA.d.ts → types-HkveCCx0.d.cts} +866 -21
- package/dist/{types-Cjvkj0jA.d.cts → types-HkveCCx0.d.ts} +866 -21
- package/dist/{types-COODtTJU.d.ts → types-KFfk-8Ah.d.ts} +1 -1
- package/dist/{where-CUQmCR6d.d.cts → where--fk7_0kv.d.cts} +1 -1
- package/dist/{where-5xVawAwL.d.ts → where-ws5hf-Ov.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-2BIG7U6E.cjs +0 -83
- package/dist/chunk-2BIG7U6E.cjs.map +0 -1
- package/dist/chunk-2L54C2C2.js +0 -144
- package/dist/chunk-2L54C2C2.js.map +0 -1
- package/dist/chunk-2VLBGQBY.cjs.map +0 -1
- package/dist/chunk-2WDD2NO3.js +0 -59
- package/dist/chunk-2WDD2NO3.js.map +0 -1
- package/dist/chunk-2Y4IFKW7.js.map +0 -1
- package/dist/chunk-35S6P5ZU.js +0 -27
- package/dist/chunk-35S6P5ZU.js.map +0 -1
- package/dist/chunk-3PRKZW6D.cjs.map +0 -1
- package/dist/chunk-4MB3AQAQ.js.map +0 -1
- package/dist/chunk-4SZ6XPTG.cjs +0 -12
- package/dist/chunk-5MUSU4ZP.cjs.map +0 -1
- package/dist/chunk-63KCKSSH.js.map +0 -1
- package/dist/chunk-66UVLHQA.cjs.map +0 -1
- package/dist/chunk-6JZUSDY2.cjs.map +0 -1
- package/dist/chunk-764JHTLT.cjs +0 -15
- package/dist/chunk-764JHTLT.cjs.map +0 -1
- package/dist/chunk-7G32LIQM.js.map +0 -1
- package/dist/chunk-7V2FGGI2.cjs.map +0 -1
- package/dist/chunk-A2I2XO52.cjs.map +0 -1
- package/dist/chunk-A4PBRX4C.cjs +0 -100
- package/dist/chunk-A4PBRX4C.cjs.map +0 -1
- package/dist/chunk-ACSVZPK7.cjs.map +0 -1
- package/dist/chunk-ALFUGRYB.cjs +0 -1282
- package/dist/chunk-ALFUGRYB.cjs.map +0 -1
- package/dist/chunk-B75XRV3O.js +0 -125
- package/dist/chunk-B75XRV3O.js.map +0 -1
- package/dist/chunk-BCP7LLOY.js.map +0 -1
- package/dist/chunk-BEFM74L2.js.map +0 -1
- package/dist/chunk-BNUFUFAU.js.map +0 -1
- package/dist/chunk-C4F7VJ5D.cjs.map +0 -1
- package/dist/chunk-CPEL3YIR.cjs.map +0 -1
- package/dist/chunk-D7PG5D5K.js.map +0 -1
- package/dist/chunk-DI74SMXS.cjs +0 -29
- package/dist/chunk-DI74SMXS.cjs.map +0 -1
- package/dist/chunk-DK2S42XB.js +0 -77
- package/dist/chunk-DK2S42XB.js.map +0 -1
- package/dist/chunk-DRACN6XG.js +0 -27
- package/dist/chunk-DRACN6XG.js.map +0 -1
- package/dist/chunk-EE7N5XXQ.cjs.map +0 -1
- package/dist/chunk-EFELJVLA.js.map +0 -1
- package/dist/chunk-EPTSMFH7.cjs +0 -12
- package/dist/chunk-EQ7JKLZO.cjs +0 -157
- package/dist/chunk-EQ7JKLZO.cjs.map +0 -1
- package/dist/chunk-FJMPR3OH.cjs.map +0 -1
- package/dist/chunk-FMGEZBAQ.js.map +0 -1
- package/dist/chunk-FMMIX6N4.js.map +0 -1
- package/dist/chunk-FRHHDHKH.js.map +0 -1
- package/dist/chunk-FSXTPBRN.js.map +0 -1
- package/dist/chunk-G6Q5UM7U.js.map +0 -1
- package/dist/chunk-GYA4JRP5.js.map +0 -1
- package/dist/chunk-HOHAJ2NR.cjs +0 -61
- package/dist/chunk-HOHAJ2NR.cjs.map +0 -1
- package/dist/chunk-HOIFFY4M.js.map +0 -1
- package/dist/chunk-IIMQJYAM.js +0 -81
- package/dist/chunk-IIMQJYAM.js.map +0 -1
- package/dist/chunk-IJTLXNGJ.js.map +0 -1
- package/dist/chunk-ITE4IXAK.js +0 -25
- package/dist/chunk-ITE4IXAK.js.map +0 -1
- package/dist/chunk-K3BUWSFR.js.map +0 -1
- package/dist/chunk-KCO5EFJU.js +0 -79
- package/dist/chunk-KCO5EFJU.js.map +0 -1
- package/dist/chunk-KKYELPZ2.cjs +0 -83
- package/dist/chunk-KKYELPZ2.cjs.map +0 -1
- package/dist/chunk-MCHP7RHZ.cjs.map +0 -1
- package/dist/chunk-MIJKEVV7.js.map +0 -1
- package/dist/chunk-NCX65HBY.cjs +0 -1396
- package/dist/chunk-NCX65HBY.cjs.map +0 -1
- package/dist/chunk-OSZPLZIV.cjs.map +0 -1
- package/dist/chunk-OVUUTCPJ.cjs.map +0 -1
- package/dist/chunk-PDGEXGS6.cjs.map +0 -1
- package/dist/chunk-QB6VMOJ2.cjs.map +0 -1
- package/dist/chunk-QMQLUA66.js +0 -12
- package/dist/chunk-QMQLUA66.js.map +0 -1
- package/dist/chunk-QYWINYEA.cjs.map +0 -1
- package/dist/chunk-S4KQ5LV4.js.map +0 -1
- package/dist/chunk-SBPC5IP3.js.map +0 -1
- package/dist/chunk-SJDMVITW.cjs.map +0 -1
- package/dist/chunk-SNXVDZAJ.js.map +0 -1
- package/dist/chunk-SQRD2CYF.js.map +0 -1
- package/dist/chunk-ST3LPB2V.cjs.map +0 -1
- package/dist/chunk-STQ3BSED.cjs.map +0 -1
- package/dist/chunk-SVJ5GEXW.cjs.map +0 -1
- package/dist/chunk-TCRIQMBU.js.map +0 -1
- package/dist/chunk-TDXIBCGY.cjs.map +0 -1
- package/dist/chunk-TFMVL4QH.js.map +0 -1
- package/dist/chunk-TRF4EBJT.cjs +0 -30
- package/dist/chunk-TRF4EBJT.cjs.map +0 -1
- package/dist/chunk-TVLKA4AY.js +0 -94
- package/dist/chunk-TVLKA4AY.js.map +0 -1
- package/dist/chunk-UR7W5YQK.js.map +0 -1
- package/dist/chunk-VITTKBWF.js +0 -1263
- package/dist/chunk-VITTKBWF.js.map +0 -1
- package/dist/chunk-WBUFJ7BS.cjs +0 -131
- package/dist/chunk-WBUFJ7BS.cjs.map +0 -1
- package/dist/chunk-XR4YZFKW.cjs.map +0 -1
- package/dist/chunk-YNULOIR5.cjs.map +0 -1
- package/dist/chunk-ZDH3DX3C.cjs +0 -30
- package/dist/chunk-ZDH3DX3C.cjs.map +0 -1
- package/dist/chunk-ZTAJL4DT.cjs +0 -85
- package/dist/chunk-ZTAJL4DT.cjs.map +0 -1
- package/dist/define-graph-DVF-oN1i.d.cts +0 -173
- package/dist/define-graph-SvYXOl78.d.ts +0 -173
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/query/dialect/vector/libsql-strategy.ts"],"names":["assertFiniteEmbedding","sql","vectorPhysicalName","quoteIdentifier","VECTOR_CONTRIBUTION_PREFIX","vectorScoreExpression","conditions","vectorMinScoreCondition","pageClause","vectorPageClause"],"mappings":";;;;;;;AA2CA,IAAM,YAAA,GAAe,QAAA;AACrB,IAAM,YAAA,GAAe,WAAA;AAKrB,IAAM,qBAAA,GAAwB,KAAA;AAE9B,IAAM,mBAAA,GAA0C;AAAA,EAC9C,SAAA,EAAW,IAAA;AAAA,EACX,OAAA,EAAS,CAAC,QAAA,EAAU,IAAI,CAAA;AAAA;AAAA,EAExB,UAAA,EAAY,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,EAC3B,aAAA,EAAe,qBAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMf,yBAAA,EAA2B;AAAA,IACzB,IAAA,EAAM,aAAA;AAAA,IACN,kBAAA,EAAoB;AAAA;AAExB,CAAA;AAGA,SAAS,aAAa,IAAA,EAA2B;AAC/C,EAAA,OAAO,KA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AAU,IAAA,CAAK,OAAA,EAAS,IAAA,CAAK,QAAA,EAAU,KAAK,SAAS;AAAA,KACvD;AACA,IAAA,MAAM,aAAuB,EAAC;AAG9B,IAAA,IAAI,YAAA,CAAa,IAAI,CAAA,EAAG;AACtB,MAAA,UAAA,CAAW,IAAA;AAAA,QACT,CAAA,qBAAA,EAAwBA,iCAAA,CAAgB,eAAA,CAAgB,IAAI,CAAC,CAAC,CAAA;AAAA,OAChE;AAAA,IACF;AACA,IAAA,UAAA,CAAW,IAAA,CAAK,CAAA,qBAAA,EAAwB,KAAK,CAAA,CAAE,CAAA;AAC/C,IAAA,OAAO,UAAA;AAAA,EACT;AACF;AAUA,IAAM,0BAAA,GAA6B,CAAA;AAEnC,SAAS,gBAAgB,IAAA,EAA0B;AACjD,EAAA,OAAOD,oCAAA;AAAA,IACL,YAAA;AAAA,IACA,IAAA,CAAK,OAAA;AAAA,IACL,IAAA,CAAK,QAAA;AAAA,IACL,IAAA,CAAK;AAAA,GACP;AACF;AAEA,SAAS,oBAAA,CAAqB,OAAe,IAAA,EAA0B;AACrE,EAAA,MAAM,SAAA,GAAYC,iCAAA,CAAgB,eAAA,CAAgB,IAAI,CAAC,CAAA;AACvD,EAAA,MAAM,MAAA,GAAS,iBAAA,CAAkB,IAAA,CAAK,MAAM,CAAA;AAC5C,EAAA,OAAO,8BAA8B,SAAS,CAAA,IAAA,EAAOA,kCAAgB,KAAK,CAAC,2CAA2C,MAAM,CAAA,IAAA,CAAA;AAC9H","file":"chunk-YNULOIR5.cjs","sourcesContent":["/**\n * libSQL native vector strategy.\n *\n * libSQL ships vector search in core — no extension to load — so this\n * strategy is wired unconditionally by `createLibsqlBackend`. It backs each\n * `(nodeKind, fieldPath)` with its own `F32_BLOB(N)` table (the spike proved\n * the dimension MUST live in the column type for `libsql_vector_idx` to\n * build), brute-forces with `vector_distance_cos` / `vector_distance_l2`, and\n * accelerates with DiskANN (`libsql_vector_idx` + `vector_top_k`) when the\n * slot declares an approximate index.\n *\n * Metric support is `cosine` + `l2` (no `inner_product`), matching sqlite-vec\n * and advertised as data on `capabilities`. The generic `\"hnsw\"` index intent\n * (the portable \"give me an ANN index\" signal that `embedding()` defaults to)\n * is realized here as libSQL's DiskANN index; `\"ivfflat\"` is not supported and\n * a slot declaring it is materialized brute-force-only.\n *\n * The `pgvectorStrategy` and `sqliteVecStrategy` siblings follow the same\n * `VectorStrategy` contract for their engines.\n */\nimport { type StrategyTableContribution } from \"../../../backend/table-contribution\";\nimport {\n type DeleteEmbeddingParams,\n type UpsertEmbeddingBatchParams,\n type UpsertEmbeddingParams,\n type VectorCapabilities,\n type VectorMetric,\n type VectorSearchParams,\n} from \"../../../backend/types\";\nimport { sql, type SqlFragment } from \"../../sql-fragment\";\nimport {\n assertFiniteEmbedding,\n quoteIdentifier,\n VECTOR_CONTRIBUTION_PREFIX,\n vectorMinScoreCondition,\n vectorPhysicalName,\n vectorScoreExpression,\n type VectorSlot,\n type VectorStrategy,\n} from \"../vector-strategy\";\nimport { vectorPageClause } from \"./pagination\";\n\n/** Physical-name prefixes for the per-field table and its DiskANN index. */\nconst TABLE_PREFIX = \"tg_vec\";\nconst INDEX_PREFIX = \"tg_vecidx\";\n\n/**\n * libSQL `F32_BLOB` caps at 65,536 dimensions (per Turso docs / spike §2).\n */\nconst LIBSQL_MAX_DIMENSIONS = 65_536;\n\nconst LIBSQL_CAPABILITIES: VectorCapabilities = {\n supported: true,\n metrics: [\"cosine\", \"l2\"],\n // \"hnsw\" = portable ANN intent, realized as DiskANN. \"none\" = brute-force.\n indexTypes: [\"hnsw\", \"none\"],\n maxDimensions: LIBSQL_MAX_DIMENSIONS,\n // `vector_top_k` is a table function: no filter pushdown, no way to re-enter\n // the index. A filtered DiskANN search over-fetches by\n // CANDIDATE_FILTER_OVERFETCH and filters afterwards, so it under-fills once\n // more than the headroom is filtered out. Unlike sqlite-vec (pushdown) and\n // pgvector >= 0.8 (iterative scan), libSQL has no recovery at all.\n filteredApproximateSearch: {\n mode: \"post-filter\",\n guaranteesFullPage: false,\n },\n};\n\n/** Whether a slot's declared index type maps to a real libSQL ANN index. */\nfunction usesAnnIndex(slot: VectorSlot): boolean {\n return slot.indexType === \"hnsw\";\n}\n\n/** libSQL metric token accepted by `libsql_vector_idx(col, 'metric=…')`. */\nfunction libsqlMetricToken(metric: VectorMetric): string {\n switch (metric) {\n case \"cosine\": {\n return \"cosine\";\n }\n case \"l2\": {\n return \"l2\";\n }\n case \"inner_product\": {\n throw new Error(\n \"libSQL vector search does not support inner_product. Use 'cosine' or 'l2'.\",\n );\n }\n default: {\n const _exhaustive: never = metric;\n throw new Error(`Unsupported vector metric: ${String(_exhaustive)}`);\n }\n }\n}\n\n/**\n * Formats an embedding as the text argument to `vector32(...)`. The value is\n * bound as a parameter (not interpolated) — `vector32` parses it into the\n * F32 blob. Finiteness is validated first so a NaN names its index.\n */\nfunction vector32Literal(\n embedding: readonly number[],\n name: string,\n): SqlFragment {\n assertFiniteEmbedding(embedding, name);\n return sql`vector32(${`[${embedding.join(\",\")}]`})`;\n}\n\nfunction distanceExpression(\n embeddingColumn: SqlFragment,\n queryEmbedding: readonly number[],\n metric: VectorMetric,\n): SqlFragment {\n const query = vector32Literal(queryEmbedding, \"queryEmbedding\");\n switch (metric) {\n case \"cosine\": {\n return sql`vector_distance_cos(${embeddingColumn}, ${query})`;\n }\n case \"l2\": {\n return sql`vector_distance_l2(${embeddingColumn}, ${query})`;\n }\n case \"inner_product\": {\n throw new Error(\n \"libSQL vector search does not support inner_product. Use 'cosine' or 'l2'.\",\n );\n }\n default: {\n const _exhaustive: never = metric;\n throw new Error(`Unsupported vector metric: ${String(_exhaustive)}`);\n }\n }\n}\n\nfunction tableName(\n graphId: string,\n nodeKind: string,\n fieldPath: string,\n): string {\n return vectorPhysicalName(TABLE_PREFIX, graphId, nodeKind, fieldPath);\n}\n\nexport const libsqlVectorStrategy: VectorStrategy = {\n name: \"libsql-native\",\n capabilities: LIBSQL_CAPABILITIES,\n\n tableName,\n\n ownedTables(slot): readonly StrategyTableContribution[] {\n const table = tableName(slot.graphId, slot.nodeKind, slot.fieldPath);\n const name = quoteIdentifier(table);\n\n // No standalone graph_id index: the PRIMARY KEY (graph_id, node_id) already\n // covers `WHERE graph_id = ?` via its leading column, so a separate index\n // would be pure write amplification.\n const createDdl = [\n `CREATE TABLE IF NOT EXISTS ${name} (\n \"graph_id\" TEXT NOT NULL,\n \"node_id\" TEXT NOT NULL,\n \"embedding\" F32_BLOB(${slot.dimensions}) NOT NULL,\n \"created_at\" TEXT NOT NULL,\n \"updated_at\" TEXT NOT NULL,\n PRIMARY KEY (\"graph_id\", \"node_id\")\n);`,\n ];\n\n if (usesAnnIndex(slot)) {\n // The DiskANN index DDL is deterministic raw SQL; fold it into the\n // contribution so materialization creates table + index together.\n createDdl.push(libsqlVectorIndexDdl(table, slot));\n }\n\n return [\n {\n logicalName: `${VECTOR_CONTRIBUTION_PREFIX}:${slot.nodeKind}.${slot.fieldPath}`,\n owner: \"libsql-native\",\n tableName: table,\n createDdl,\n runtimeEnsure: true,\n },\n ];\n },\n\n buildUpsert(\n slot,\n params: UpsertEmbeddingParams,\n timestamp,\n ): readonly SqlFragment[] {\n const table = sql.identifier(\n tableName(slot.graphId, slot.nodeKind, slot.fieldPath),\n );\n const value = vector32Literal(params.embedding, \"embedding\");\n return [\n sql`\n INSERT INTO ${table} (\"graph_id\", \"node_id\", \"embedding\", \"created_at\", \"updated_at\")\n VALUES (${params.graphId}, ${params.nodeId}, ${value}, ${timestamp}, ${timestamp})\n ON CONFLICT (\"graph_id\", \"node_id\")\n DO UPDATE SET \"embedding\" = ${value}, \"updated_at\" = ${timestamp}\n `,\n ];\n },\n\n buildUpsertBatch(\n slot,\n params: UpsertEmbeddingBatchParams,\n timestamp,\n ): readonly SqlFragment[] {\n const table = sql.identifier(\n tableName(slot.graphId, slot.nodeKind, slot.fieldPath),\n );\n const valueRows = sql.join(\n params.rows.map(\n (row) =>\n sql`(${params.graphId}, ${row.nodeId}, ${vector32Literal(row.embedding, \"embedding\")}, ${timestamp}, ${timestamp})`,\n ),\n sql`, `,\n );\n // `excluded.\"embedding\"` reuses the row's already-converted F32_BLOB\n // value, so the multi-row form needs no per-row conversion in the\n // update arm (unlike buildUpsert's single bound value).\n return [\n sql`\n INSERT INTO ${table} (\"graph_id\", \"node_id\", \"embedding\", \"created_at\", \"updated_at\")\n VALUES ${valueRows}\n ON CONFLICT (\"graph_id\", \"node_id\")\n DO UPDATE SET \"embedding\" = excluded.\"embedding\", \"updated_at\" = excluded.\"updated_at\"\n `,\n ];\n },\n\n buildDelete(slot, params: DeleteEmbeddingParams): readonly SqlFragment[] {\n const table = sql.identifier(\n tableName(slot.graphId, slot.nodeKind, slot.fieldPath),\n );\n return [\n sql`\n DELETE FROM ${table}\n WHERE \"graph_id\" = ${params.graphId} AND \"node_id\" = ${params.nodeId}\n `,\n ];\n },\n\n buildSearch(\n slot,\n params: VectorSearchParams,\n candidates?: SqlFragment,\n ): SqlFragment {\n const table = tableName(slot.graphId, slot.nodeKind, slot.fieldPath);\n const quoted = sql.identifier(table);\n const embeddingColumn = sql`${quoted}.\"embedding\"`;\n const distance = distanceExpression(\n embeddingColumn,\n params.queryEmbedding,\n params.metric,\n );\n const score = vectorScoreExpression(distance, params.metric);\n\n if (usesAnnIndex(slot)) {\n // DiskANN: vector_top_k returns rowids from the per-field table; join\n // back, then scope by graph and compute the real distance/score.\n // `vector_top_k` is table-global, so single-graph deployments are exact;\n // multi-graph recall is bounded by the over-fetched k (documented).\n const indexName = libsqlIndexName(slot);\n const query = vector32Literal(params.queryEmbedding, \"queryEmbedding\");\n const conditions: SqlFragment[] = [\n sql`${quoted}.\"graph_id\" = ${params.graphId}`,\n ];\n if (params.minScore !== undefined) {\n conditions.push(\n vectorMinScoreCondition(distance, params.metric, params.minScore),\n );\n }\n // `vector_top_k` is a table function with no filter pushdown, so a\n // candidate filter can only be applied AFTER the ANN retrieval.\n // Over-fetch the DiskANN k to leave headroom for filtered-out rows;\n // recall is bounded by the over-fetch, and the page under-fills once\n // more than the headroom is filtered out. Declared, not merely noted:\n // `capabilities.filteredApproximateSearch.mode === \"post-filter\"`.\n if (candidates !== undefined) {\n conditions.push(sql`${quoted}.\"node_id\" IN (${candidates})`);\n }\n // `pageK` covers the requested page (`limit + offset`); the\n // candidate-filter over-fetch multiplies on top of it.\n const pageK = params.limit + (params.offset ?? 0);\n const annK =\n candidates === undefined ? pageK : pageK * CANDIDATE_FILTER_OVERFETCH;\n const pageClause = vectorPageClause(params.limit, params.offset);\n return sql`\n SELECT ${quoted}.\"node_id\" AS node_id, ${score} AS score\n FROM vector_top_k(${indexName}, ${query}, ${annK})\n JOIN ${quoted} ON ${quoted}.rowid = id\n WHERE ${sql.join(conditions, sql` AND `)}\n ORDER BY ${distance} ASC\n ${pageClause}\n `;\n }\n\n // Brute-force scan.\n const conditions: SqlFragment[] = [\n sql`${quoted}.\"graph_id\" = ${params.graphId}`,\n ];\n if (candidates !== undefined) {\n conditions.push(sql`${quoted}.\"node_id\" IN (${candidates})`);\n }\n if (params.minScore !== undefined) {\n conditions.push(\n vectorMinScoreCondition(distance, params.metric, params.minScore),\n );\n }\n const pageClause = vectorPageClause(params.limit, params.offset);\n return sql`\n SELECT ${quoted}.\"node_id\" AS node_id, ${score} AS score\n FROM ${quoted}\n WHERE ${sql.join(conditions, sql` AND `)}\n ORDER BY ${distance} ASC\n ${pageClause}\n `;\n },\n\n distanceExpression(embeddingColumn, queryEmbedding, metric) {\n return distanceExpression(embeddingColumn, queryEmbedding, metric);\n },\n\n buildCreateIndex(slot): SqlFragment | undefined {\n if (!usesAnnIndex(slot)) return undefined;\n return sql.raw(\n libsqlVectorIndexDdl(\n tableName(slot.graphId, slot.nodeKind, slot.fieldPath),\n slot,\n ),\n );\n },\n\n buildDropIndex(slot): SqlFragment | undefined {\n if (!usesAnnIndex(slot)) return undefined;\n const indexName = libsqlIndexName(slot);\n return sql.raw(`DROP INDEX IF EXISTS ${quoteIdentifier(indexName)}`);\n },\n\n buildDropStorage(slot): readonly string[] {\n const table = quoteIdentifier(\n tableName(slot.graphId, slot.nodeKind, slot.fieldPath),\n );\n const statements: string[] = [];\n // Drop the DiskANN index first so libSQL reclaims its shadow tables,\n // then the table itself.\n if (usesAnnIndex(slot)) {\n statements.push(\n `DROP INDEX IF EXISTS ${quoteIdentifier(libsqlIndexName(slot))}`,\n );\n }\n statements.push(`DROP TABLE IF EXISTS ${table}`);\n return statements;\n },\n};\n\n/**\n * DiskANN over-fetch multiplier applied when a candidate filter is present:\n * `vector_top_k` cannot pre-filter, so fetch `4k` neighbors and filter after.\n * Mirrors the hybrid facade's 4x over-fetch. Recall for the filtered search\n * is bounded by this headroom — if more than `3k` of the top `4k` neighbors\n * are filtered out, fewer than `k` rows return. That is the observable\n * meaning of `capabilities.filteredApproximateSearch.guaranteesFullPage`.\n */\nconst CANDIDATE_FILTER_OVERFETCH = 4;\n\nfunction libsqlIndexName(slot: VectorSlot): string {\n return vectorPhysicalName(\n INDEX_PREFIX,\n slot.graphId,\n slot.nodeKind,\n slot.fieldPath,\n );\n}\n\nfunction libsqlVectorIndexDdl(table: string, slot: VectorSlot): string {\n const indexName = quoteIdentifier(libsqlIndexName(slot));\n const metric = libsqlMetricToken(slot.metric);\n return `CREATE INDEX IF NOT EXISTS ${indexName} ON ${quoteIdentifier(table)}(libsql_vector_idx(\"embedding\", 'metric=${metric}'));`;\n}\n"]}
|
package/dist/chunk-ZDH3DX3C.cjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/utils/array.ts
|
|
4
|
-
function chunk(items, size) {
|
|
5
|
-
if (!Number.isSafeInteger(size) || size < 1) {
|
|
6
|
-
throw new RangeError(`chunk size must be a positive integer, got: ${size}`);
|
|
7
|
-
}
|
|
8
|
-
if (items.length === 0) return [];
|
|
9
|
-
if (items.length <= size) return [items];
|
|
10
|
-
const chunks = [];
|
|
11
|
-
for (let start = 0; start < items.length; start += size) {
|
|
12
|
-
chunks.push(items.slice(start, start + size));
|
|
13
|
-
}
|
|
14
|
-
return chunks;
|
|
15
|
-
}
|
|
16
|
-
function groupBy(items, keyFor) {
|
|
17
|
-
const groups = /* @__PURE__ */ new Map();
|
|
18
|
-
for (const item of items) {
|
|
19
|
-
const key = keyFor(item);
|
|
20
|
-
const group = groups.get(key) ?? [];
|
|
21
|
-
group.push(item);
|
|
22
|
-
groups.set(key, group);
|
|
23
|
-
}
|
|
24
|
-
return groups;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
exports.chunk = chunk;
|
|
28
|
-
exports.groupBy = groupBy;
|
|
29
|
-
//# sourceMappingURL=chunk-ZDH3DX3C.cjs.map
|
|
30
|
-
//# sourceMappingURL=chunk-ZDH3DX3C.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/array.ts"],"names":[],"mappings":";;;AAQO,SAAS,KAAA,CACd,OACA,IAAA,EAC2B;AAK3B,EAAA,IAAI,CAAC,MAAA,CAAO,aAAA,CAAc,IAAI,CAAA,IAAK,OAAO,CAAA,EAAG;AAC3C,IAAA,MAAM,IAAI,UAAA,CAAW,CAAA,4CAAA,EAA+C,IAAI,CAAA,CAAE,CAAA;AAAA,EAC5E;AACA,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,CAAA,EAAG,OAAO,EAAC;AAChC,EAAA,IAAI,KAAA,CAAM,MAAA,IAAU,IAAA,EAAM,OAAO,CAAC,KAAK,CAAA;AACvC,EAAA,MAAM,SAAgB,EAAC;AACvB,EAAA,KAAA,IAAS,QAAQ,CAAA,EAAG,KAAA,GAAQ,KAAA,CAAM,MAAA,EAAQ,SAAS,IAAA,EAAM;AACvD,IAAA,MAAA,CAAO,KAAK,KAAA,CAAM,KAAA,CAAM,KAAA,EAAO,KAAA,GAAQ,IAAI,CAAC,CAAA;AAAA,EAC9C;AACA,EAAA,OAAO,MAAA;AACT;AAMO,SAAS,OAAA,CACd,OACA,MAAA,EACa;AACb,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAY;AAC/B,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,IAAA,MAAM,GAAA,GAAM,OAAO,IAAI,CAAA;AACvB,IAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,GAAA,CAAI,GAAG,KAAK,EAAC;AAClC,IAAA,KAAA,CAAM,KAAK,IAAI,CAAA;AACf,IAAA,MAAA,CAAO,GAAA,CAAI,KAAK,KAAK,CAAA;AAAA,EACvB;AACA,EAAA,OAAO,MAAA;AACT","file":"chunk-ZDH3DX3C.cjs","sourcesContent":["/**\n * Splits `items` into consecutive chunks of at most `size` elements.\n *\n * An empty input yields no chunks (`[]`), and an input that already fits in a\n * single chunk is returned without copying. Callers rely on the empty-input\n * behavior to skip work entirely rather than issue a statement with an empty\n * `IN ()` list.\n */\nexport function chunk<T>(\n items: readonly T[],\n size: number,\n): readonly (readonly T[])[] {\n // A non-positive, non-finite, or fractional size would make the slice loop\n // fail to advance correctly; fail loud rather than spin or emit empty chunks.\n // All current callers derive size from a positive integer bind-parameter\n // budget, so this only guards against a future regression.\n if (!Number.isSafeInteger(size) || size < 1) {\n throw new RangeError(`chunk size must be a positive integer, got: ${size}`);\n }\n if (items.length === 0) return [];\n if (items.length <= size) return [items];\n const chunks: T[][] = [];\n for (let start = 0; start < items.length; start += size) {\n chunks.push(items.slice(start, start + size));\n }\n return chunks;\n}\n\n/**\n * Groups items by a caller-supplied key while preserving input order within\n * each group.\n */\nexport function groupBy<T, K>(\n items: Iterable<T>,\n keyFor: (item: T) => K,\n): Map<K, T[]> {\n const groups = new Map<K, T[]>();\n for (const item of items) {\n const key = keyFor(item);\n const group = groups.get(key) ?? [];\n group.push(item);\n groups.set(key, group);\n }\n return groups;\n}\n"]}
|
package/dist/chunk-ZTAJL4DT.cjs
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.cjs');
|
|
4
|
-
|
|
5
|
-
// src/utils/date.ts
|
|
6
|
-
var CANONICAL_ISO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
7
|
-
var ZONELESS_DATETIME_PATTERN = /^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?$/;
|
|
8
|
-
var OFFSET_DATETIME_PATTERN = /^(\d{4}-\d{2}-\d{2})[ T](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)(Z|[+-]\d{2}(?::?\d{2})?)$/i;
|
|
9
|
-
var DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
10
|
-
function normalizedOffset(offset) {
|
|
11
|
-
if (offset.toUpperCase() === "Z") return "Z";
|
|
12
|
-
if (/^[+-]\d{2}$/.test(offset)) return `${offset}:00`;
|
|
13
|
-
if (/^[+-]\d{4}$/.test(offset)) {
|
|
14
|
-
return `${offset.slice(0, 3)}:${offset.slice(3)}`;
|
|
15
|
-
}
|
|
16
|
-
return offset;
|
|
17
|
-
}
|
|
18
|
-
function databaseTimestampMilliseconds(value) {
|
|
19
|
-
if (ZONELESS_DATETIME_PATTERN.test(value)) {
|
|
20
|
-
return Date.parse(`${value.replace(" ", "T")}Z`);
|
|
21
|
-
}
|
|
22
|
-
const offsetMatch = OFFSET_DATETIME_PATTERN.exec(value);
|
|
23
|
-
if (offsetMatch !== null) {
|
|
24
|
-
const date = offsetMatch[1];
|
|
25
|
-
const time = offsetMatch[2];
|
|
26
|
-
const offset = offsetMatch[3];
|
|
27
|
-
if (date === void 0 || time === void 0 || offset === void 0) {
|
|
28
|
-
return Number.NaN;
|
|
29
|
-
}
|
|
30
|
-
return Date.parse(`${date}T${time}${normalizedOffset(offset)}`);
|
|
31
|
-
}
|
|
32
|
-
if (DATE_ONLY_PATTERN.test(value)) {
|
|
33
|
-
return Date.parse(`${value}T00:00:00.000Z`);
|
|
34
|
-
}
|
|
35
|
-
return Number.NaN;
|
|
36
|
-
}
|
|
37
|
-
function canonicalizeDatabaseTimestamp(value) {
|
|
38
|
-
if (value instanceof Date) {
|
|
39
|
-
if (Number.isNaN(value.getTime())) return void 0;
|
|
40
|
-
return value.toISOString();
|
|
41
|
-
}
|
|
42
|
-
if (typeof value !== "string") return void 0;
|
|
43
|
-
const milliseconds = databaseTimestampMilliseconds(value);
|
|
44
|
-
if (Number.isNaN(milliseconds)) return void 0;
|
|
45
|
-
return new Date(milliseconds).toISOString();
|
|
46
|
-
}
|
|
47
|
-
function isCanonicalIsoDate(value) {
|
|
48
|
-
if (!CANONICAL_ISO_DATE_PATTERN.test(value)) return false;
|
|
49
|
-
const date = new Date(value);
|
|
50
|
-
return !Number.isNaN(date.getTime()) && date.toISOString() === value;
|
|
51
|
-
}
|
|
52
|
-
function validateCanonicalIsoDate(value, fieldName) {
|
|
53
|
-
if (!isCanonicalIsoDate(value)) {
|
|
54
|
-
throw new chunkC4F7VJ5D_cjs.ValidationError(
|
|
55
|
-
`Invalid canonical ISO 8601 datetime for "${fieldName}": "${value}". Expected fixed-width UTC: YYYY-MM-DDTHH:mm:ss.sssZ`,
|
|
56
|
-
{
|
|
57
|
-
issues: [
|
|
58
|
-
{
|
|
59
|
-
path: fieldName,
|
|
60
|
-
message: `Expected canonical UTC ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ), got: "${value}"`
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
suggestion: `Use a fixed-width UTC datetime like "2024-01-15T10:30:00.000Z" (e.g. new Date(value).toISOString()).`
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
return value;
|
|
70
|
-
}
|
|
71
|
-
function validateOptionalCanonicalIsoDate(value, fieldName) {
|
|
72
|
-
if (value === void 0) return void 0;
|
|
73
|
-
return validateCanonicalIsoDate(value, fieldName);
|
|
74
|
-
}
|
|
75
|
-
function nowIso() {
|
|
76
|
-
return (/* @__PURE__ */ new Date()).toISOString();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
exports.canonicalizeDatabaseTimestamp = canonicalizeDatabaseTimestamp;
|
|
80
|
-
exports.isCanonicalIsoDate = isCanonicalIsoDate;
|
|
81
|
-
exports.nowIso = nowIso;
|
|
82
|
-
exports.validateCanonicalIsoDate = validateCanonicalIsoDate;
|
|
83
|
-
exports.validateOptionalCanonicalIsoDate = validateOptionalCanonicalIsoDate;
|
|
84
|
-
//# sourceMappingURL=chunk-ZTAJL4DT.cjs.map
|
|
85
|
-
//# sourceMappingURL=chunk-ZTAJL4DT.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/date.ts"],"names":["ValidationError"],"mappings":";;;;;AAyEA,IAAM,0BAAA,GACJ,+CAAA;AAEF,IAAM,yBAAA,GACJ,yDAAA;AACF,IAAM,uBAAA,GACJ,uFAAA;AACF,IAAM,iBAAA,GAAoB,qBAAA;AAE1B,SAAS,iBAAiB,MAAA,EAAwB;AAChD,EAAA,IAAI,MAAA,CAAO,WAAA,EAAY,KAAM,GAAA,EAAK,OAAO,GAAA;AACzC,EAAA,IAAI,cAAc,IAAA,CAAK,MAAM,CAAA,EAAG,OAAO,GAAG,MAAM,CAAA,GAAA,CAAA;AAChD,EAAA,IAAI,aAAA,CAAc,IAAA,CAAK,MAAM,CAAA,EAAG;AAC9B,IAAA,OAAO,CAAA,EAAG,MAAA,CAAO,KAAA,CAAM,CAAA,EAAG,CAAC,CAAC,CAAA,CAAA,EAAI,MAAA,CAAO,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA;AAAA,EACjD;AACA,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,8BAA8B,KAAA,EAAuB;AAC5D,EAAA,IAAI,yBAAA,CAA0B,IAAA,CAAK,KAAK,CAAA,EAAG;AACzC,IAAA,OAAO,IAAA,CAAK,MAAM,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,IAAA,CAAK,YAAY,CAAA,CAAE,WAAA,EAAY;AAC5C;AAMO,SAAS,mBAAmB,KAAA,EAAwB;AACzD,EAAA,IAAI,CAAC,0BAAA,CAA2B,IAAA,CAAK,KAAK,GAAG,OAAO,KAAA;AACpD,EAAA,MAAM,IAAA,GAAO,IAAI,IAAA,CAAK,KAAK,CAAA;AAC3B,EAAA,OAAO,CAAC,OAAO,KAAA,CAAM,IAAA,CAAK,SAAS,CAAA,IAAK,IAAA,CAAK,WAAA,EAAY,KAAM,KAAA;AACjE;AAgBO,SAAS,wBAAA,CACd,OACA,SAAA,EACQ;AACR,EAAA,IAAI,CAAC,kBAAA,CAAmB,KAAK,CAAA,EAAG;AAC9B,IAAA,MAAM,IAAIA,iCAAA;AAAA,MACR,CAAA,yCAAA,EAA4C,SAAS,CAAA,IAAA,EAAO,KAAK,CAAA,qDAAA,CAAA;AAAA,MAEjE;AAAA,QACE,MAAA,EAAQ;AAAA,UACN;AAAA,YACE,IAAA,EAAM,SAAA;AAAA,YACN,OAAA,EAAS,qEAAqE,KAAK,CAAA,CAAA;AAAA;AACrF;AACF,OACF;AAAA,MACA;AAAA,QACE,UAAA,EAAY,CAAA,oGAAA;AAAA;AACd,KACF;AAAA,EACF;AACA,EAAA,OAAO,KAAA;AACT;AAUO,SAAS,gCAAA,CACd,OACA,SAAA,EACoB;AACpB,EAAA,IAAI,KAAA,KAAU,QAAW,OAAO,MAAA;AAChC,EAAA,OAAO,wBAAA,CAAyB,OAAO,SAAS,CAAA;AAClD;AAuBO,SAAS,MAAA,GAAiB;AAC/B,EAAA,OAAA,iBAAO,IAAI,IAAA,EAAK,EAAE,WAAA,EAAY;AAChC","file":"chunk-ZTAJL4DT.cjs","sourcesContent":["/**\n * Date encoding utilities for consistent storage.\n *\n * Contract: All dates are stored as ISO 8601 strings in UTC.\n * - Always includes milliseconds\n * - Always UTC (Z suffix)\n * - Sorts correctly as strings\n */\n\nimport { ValidationError } from \"../errors\";\n\n/**\n * ISO 8601 datetime pattern.\n * Matches formats like:\n * - 2024-01-15T10:30:00.000Z\n * - 2024-01-15T10:30:00Z\n * - 2024-01-15T10:30:00.123Z\n */\nconst ISO_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?Z$/;\n\n/**\n * Checks if a string is a valid ISO 8601 datetime.\n *\n * @param value - String to validate\n * @returns True if valid ISO 8601 datetime\n */\nexport function isValidIsoDate(value: string): boolean {\n if (!ISO_DATE_PATTERN.test(value)) {\n return false;\n }\n // Also check that Date parsing produces a valid date\n const date = new Date(value);\n return !Number.isNaN(date.getTime());\n}\n\n/**\n * Validates that a string is a valid ISO 8601 datetime.\n * Throws ValidationError if invalid.\n *\n * @param value - String to validate\n * @param fieldName - Name of field for error message\n * @returns The validated string\n * @throws ValidationError if not a valid ISO datetime\n */\nexport function validateIsoDate(value: string, fieldName: string): string {\n if (!isValidIsoDate(value)) {\n throw new ValidationError(\n `Invalid ISO 8601 datetime for \"${fieldName}\": \"${value}\". ` +\n `Expected format: YYYY-MM-DDTHH:mm:ss.sssZ`,\n {\n issues: [\n {\n path: fieldName,\n message: `Invalid ISO 8601 datetime format. Expected: YYYY-MM-DDTHH:mm:ss.sssZ, got: \"${value}\"`,\n },\n ],\n },\n {\n suggestion: `Use a valid ISO 8601 UTC datetime like \"2024-01-15T10:30:00.000Z\"`,\n },\n );\n }\n return value;\n}\n\n/**\n * Strict canonical ISO 8601 pattern: fixed-width UTC with exactly\n * millisecond precision (`YYYY-MM-DDTHH:mm:ss.sssZ`). Unlike\n * {@link ISO_DATE_PATTERN}, which tolerates a missing or variable-width\n * fractional part, this is the only shape whose lexicographic text order\n * matches chronological order — avoiding cases like `\"...:00.1Z\"` (= `.100`)\n * sorting *after* `\"...:00.101Z\"`.\n */\nconst CANONICAL_ISO_DATE_PATTERN =\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$/;\n\nconst ZONELESS_DATETIME_PATTERN =\n /^\\d{4}-\\d{2}-\\d{2}[ T]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?$/;\nconst OFFSET_DATETIME_PATTERN =\n /^(\\d{4}-\\d{2}-\\d{2})[ T](\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?)(Z|[+-]\\d{2}(?::?\\d{2})?)$/i;\nconst DATE_ONLY_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nfunction normalizedOffset(offset: string): string {\n if (offset.toUpperCase() === \"Z\") return \"Z\";\n if (/^[+-]\\d{2}$/.test(offset)) return `${offset}:00`;\n if (/^[+-]\\d{4}$/.test(offset)) {\n return `${offset.slice(0, 3)}:${offset.slice(3)}`;\n }\n return offset;\n}\n\nfunction databaseTimestampMilliseconds(value: string): number {\n if (ZONELESS_DATETIME_PATTERN.test(value)) {\n return Date.parse(`${value.replace(\" \", \"T\")}Z`);\n }\n const offsetMatch = OFFSET_DATETIME_PATTERN.exec(value);\n if (offsetMatch !== null) {\n const date = offsetMatch[1];\n const time = offsetMatch[2];\n const offset = offsetMatch[3];\n if (date === undefined || time === undefined || offset === undefined) {\n return Number.NaN;\n }\n return Date.parse(`${date}T${time}${normalizedOffset(offset)}`);\n }\n if (DATE_ONLY_PATTERN.test(value)) {\n return Date.parse(`${value}T00:00:00.000Z`);\n }\n return Number.NaN;\n}\n\n/**\n * Canonicalizes a database-driver timestamp without interpreting a zoneless\n * string in the host timezone. PostgreSQL drivers can return values such as\n * `2026-06-25 12:00:00`; TypeGraph treats that shape as UTC so the same stored\n * clock value cannot move across hosts or daylight-saving boundaries.\n *\n * Returns `undefined` for an unsupported or unrepresentable value so callers\n * can raise an error specific to their storage boundary.\n */\nexport function canonicalizeDatabaseTimestamp(\n value: unknown,\n): string | undefined {\n if (value instanceof Date) {\n if (Number.isNaN(value.getTime())) return undefined;\n return value.toISOString();\n }\n if (typeof value !== \"string\") return undefined;\n const milliseconds = databaseTimestampMilliseconds(value);\n if (Number.isNaN(milliseconds)) return undefined;\n return new Date(milliseconds).toISOString();\n}\n\n/**\n * Checks if a string is a canonical UTC ISO 8601 datetime with fixed\n * millisecond width (`YYYY-MM-DDTHH:mm:ss.sssZ`).\n */\nexport function isCanonicalIsoDate(value: string): boolean {\n if (!CANONICAL_ISO_DATE_PATTERN.test(value)) return false;\n const date = new Date(value);\n return !Number.isNaN(date.getTime()) && date.toISOString() === value;\n}\n\n/**\n * Validates that a string is a canonical UTC ISO 8601 datetime with fixed\n * millisecond width. Stricter than {@link validateIsoDate} (which also\n * accepts missing or 1–2 digit milliseconds): required wherever the value\n * is compared **as text** against stored timestamps and must sort\n * chronologically — e.g. a temporal `asOf` coordinate, where a\n * variable-width value would mis-order and silently include or exclude the\n * wrong rows. Produce one with `new Date(value).toISOString()`.\n *\n * @param value - String to validate\n * @param fieldName - Name of field for error message\n * @returns The validated string\n * @throws ValidationError if not a canonical UTC ISO datetime\n */\nexport function validateCanonicalIsoDate(\n value: string,\n fieldName: string,\n): string {\n if (!isCanonicalIsoDate(value)) {\n throw new ValidationError(\n `Invalid canonical ISO 8601 datetime for \"${fieldName}\": \"${value}\". ` +\n `Expected fixed-width UTC: YYYY-MM-DDTHH:mm:ss.sssZ`,\n {\n issues: [\n {\n path: fieldName,\n message: `Expected canonical UTC ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ), got: \"${value}\"`,\n },\n ],\n },\n {\n suggestion: `Use a fixed-width UTC datetime like \"2024-01-15T10:30:00.000Z\" (e.g. new Date(value).toISOString()).`,\n },\n );\n }\n return value;\n}\n\n/**\n * Validates an optional canonical ISO date string. Returns `undefined` for an\n * absent value; otherwise enforces canonical fixed-width UTC ISO 8601 via\n * {@link validateCanonicalIsoDate}. Used for stored validity-window inputs\n * (`validFrom` / `validTo`) so every timestamp the temporal filters compare as\n * text is canonical and sorts chronologically — the same contract the `asOf`\n * read coordinate already enforces.\n */\nexport function validateOptionalCanonicalIsoDate(\n value: string | undefined,\n fieldName: string,\n): string | undefined {\n if (value === undefined) return undefined;\n return validateCanonicalIsoDate(value, fieldName);\n}\n\n/**\n * Encodes a Date to an ISO 8601 string for storage.\n */\nexport function encodeDate(date: Date): string {\n return date.toISOString();\n}\n\n/**\n * Decodes an ISO 8601 string to a Date.\n * Validates the string format first.\n *\n * @throws ValidationError if not a valid ISO datetime\n */\nexport function decodeDate(isoString: string): Date {\n validateIsoDate(isoString, \"date\");\n return new Date(isoString);\n}\n\n/**\n * Returns the current timestamp as an ISO string.\n */\nexport function nowIso(): string {\n return new Date().toISOString();\n}\n"]}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { N as NodeRegistration, E as EdgeRegistration, O as OntologyRelation, D as DeleteBehavior, T as TemporalMode, I as IndexDeclaration, G as GraphExtension, b as NodeType, c as AnyEdgeType, d as GraphDefaults } from './types-Cjvkj0jA.cjs';
|
|
2
|
-
|
|
3
|
-
/** Brand key for GraphDef */
|
|
4
|
-
declare const GRAPH_DEF_BRAND: "__graphDef";
|
|
5
|
-
/**
|
|
6
|
-
* An edge entry in the graph definition.
|
|
7
|
-
* Can be:
|
|
8
|
-
* - EdgeType directly (constrained or unconstrained)
|
|
9
|
-
* - EdgeRegistration object (always works, can override/narrow defaults)
|
|
10
|
-
*/
|
|
11
|
-
type EdgeEntry = EdgeRegistration | AnyEdgeType;
|
|
12
|
-
/**
|
|
13
|
-
* Normalized edge map type - all entries become EdgeRegistration.
|
|
14
|
-
* For bare EdgeTypes, constrained endpoints are extracted from the type;
|
|
15
|
-
* unconstrained edges fall back to all node types in the graph.
|
|
16
|
-
*/
|
|
17
|
-
type NormalizedEdges<TNodes extends Record<string, NodeRegistration>, TEdges extends Record<string, EdgeEntry>> = {
|
|
18
|
-
[K in keyof TEdges]: TEdges[K] extends EdgeRegistration ? TEdges[K] : TEdges[K] extends AnyEdgeType ? EdgeRegistration<TEdges[K], TEdges[K]["from"] extends readonly (infer N extends NodeType)[] ? N : TNodes[keyof TNodes]["type"], TEdges[K]["to"] extends readonly (infer N extends NodeType)[] ? N : TNodes[keyof TNodes]["type"]> : never;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Configuration for defineGraph.
|
|
22
|
-
*/
|
|
23
|
-
type GraphDefConfig<TNodes extends Record<string, NodeRegistration>, TEdges extends Record<string, EdgeEntry>, TOntology extends readonly OntologyRelation[]> = Readonly<{
|
|
24
|
-
/** Unique identifier for this graph */
|
|
25
|
-
id: string;
|
|
26
|
-
/** Node registrations */
|
|
27
|
-
nodes: TNodes;
|
|
28
|
-
/** Edge registrations or EdgeTypes with built-in domain/range */
|
|
29
|
-
edges: TEdges;
|
|
30
|
-
/** Ontology relations */
|
|
31
|
-
ontology?: TOntology;
|
|
32
|
-
/** Graph-wide defaults */
|
|
33
|
-
defaults?: GraphDefaults;
|
|
34
|
-
/**
|
|
35
|
-
* Index declarations attached to this graph.
|
|
36
|
-
*
|
|
37
|
-
* Accepts the outputs of `defineNodeIndex` / `defineEdgeIndex` (which
|
|
38
|
-
* already return `IndexDeclaration` values) or pre-built declarations
|
|
39
|
-
* reconstructed from a stored schema or graph extension.
|
|
40
|
-
*
|
|
41
|
-
* Validated at definition time: every index must reference a `kind`
|
|
42
|
-
* that exists in `nodes` / `edges`, and index `name`s must be unique
|
|
43
|
-
* within the graph.
|
|
44
|
-
*
|
|
45
|
-
* Index DDL is **not** generated by `defineGraph`. Indexes flow into
|
|
46
|
-
* `SerializedSchema.indexes` so they can later be materialized via
|
|
47
|
-
* `store.materializeIndexes()` — lifting the storage concern out of
|
|
48
|
-
* the schema-version commit path.
|
|
49
|
-
*/
|
|
50
|
-
indexes?: readonly IndexDeclaration[];
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* A graph definition.
|
|
54
|
-
*
|
|
55
|
-
* This is a compile-time artifact that describes the structure of a graph.
|
|
56
|
-
* Use `createStore()` to create a runtime store from this definition.
|
|
57
|
-
*/
|
|
58
|
-
type GraphDef<TNodes extends Record<string, NodeRegistration> = Record<string, NodeRegistration>, TEdges extends Record<string, EdgeRegistration> = Record<string, EdgeRegistration>, TOntology extends readonly OntologyRelation[] = readonly OntologyRelation[]> = Readonly<{
|
|
59
|
-
[GRAPH_DEF_BRAND]: true;
|
|
60
|
-
id: string;
|
|
61
|
-
nodes: TNodes;
|
|
62
|
-
edges: TEdges;
|
|
63
|
-
ontology: TOntology;
|
|
64
|
-
defaults: Readonly<{
|
|
65
|
-
onNodeDelete: DeleteBehavior;
|
|
66
|
-
temporalMode: TemporalMode;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* Index declarations attached to this graph. Preserves whatever the
|
|
70
|
-
* caller passed to `defineGraph` (including an explicit empty array)
|
|
71
|
-
* for introspection purposes.
|
|
72
|
-
*
|
|
73
|
-
* The serialized canonical form is order-canonicalized (sorted by
|
|
74
|
-
* `name`) and treats `undefined` and `[]` as the same "no slice" form
|
|
75
|
-
* — an empty array does not bump the schema hash, since indexes are
|
|
76
|
-
* an unordered set keyed by name and `[]` carries no semantic meaning
|
|
77
|
-
* that an absent slice doesn't.
|
|
78
|
-
*/
|
|
79
|
-
indexes: readonly IndexDeclaration[] | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* Graph extension this graph was merged with, if any. Set by
|
|
82
|
-
* `mergeGraphExtension`; never set by `defineGraph` directly.
|
|
83
|
-
* Exists solely so re-serialization is stable — the rest of the
|
|
84
|
-
* system reads the merged kinds through `nodes` / `edges` /
|
|
85
|
-
* `ontology` and never inspects this field. Absent on graphs that
|
|
86
|
-
* have never been extended; legacy graphs hash byte-identically.
|
|
87
|
-
*/
|
|
88
|
-
extension: GraphExtension | undefined;
|
|
89
|
-
/**
|
|
90
|
-
* Soft-deprecated kind names attached to this graph. Set by the
|
|
91
|
-
* loader from the persisted schema and by `store.deprecateKinds(...)`
|
|
92
|
-
* / `store.undeprecateKinds(...)`. A purely informational signal
|
|
93
|
-
* surfaced for introspection — does not gate reads, writes, or
|
|
94
|
-
* queries. Defaults to the empty set on freshly-defined graphs.
|
|
95
|
-
*/
|
|
96
|
-
deprecatedKinds: ReadonlySet<string>;
|
|
97
|
-
}>;
|
|
98
|
-
/**
|
|
99
|
-
* Extract node kind names from a GraphDef.
|
|
100
|
-
*/
|
|
101
|
-
type NodeKinds<G extends GraphDef> = keyof G["nodes"] & string;
|
|
102
|
-
/**
|
|
103
|
-
* Extract edge kind names from a GraphDef.
|
|
104
|
-
*/
|
|
105
|
-
type EdgeKinds<G extends GraphDef> = keyof G["edges"] & string;
|
|
106
|
-
/**
|
|
107
|
-
* Get a NodeType from a GraphDef by kind name.
|
|
108
|
-
*/
|
|
109
|
-
type GetNodeType<G extends GraphDef, K extends NodeKinds<G>> = G["nodes"][K]["type"];
|
|
110
|
-
/**
|
|
111
|
-
* Get an EdgeType from a GraphDef by kind name.
|
|
112
|
-
*/
|
|
113
|
-
type GetEdgeType<G extends GraphDef, K extends EdgeKinds<G>> = G["edges"][K]["type"];
|
|
114
|
-
/**
|
|
115
|
-
* Get all NodeTypes from a GraphDef.
|
|
116
|
-
*/
|
|
117
|
-
type AllNodeTypes<G extends GraphDef> = {
|
|
118
|
-
[K in NodeKinds<G>]: G["nodes"][K]["type"];
|
|
119
|
-
}[NodeKinds<G>];
|
|
120
|
-
/**
|
|
121
|
-
* Get all EdgeTypes from a GraphDef.
|
|
122
|
-
*/
|
|
123
|
-
type AllEdgeTypes<G extends GraphDef> = {
|
|
124
|
-
[K in EdgeKinds<G>]: G["edges"][K]["type"];
|
|
125
|
-
}[EdgeKinds<G>];
|
|
126
|
-
/**
|
|
127
|
-
* Creates a graph definition.
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```typescript
|
|
131
|
-
* const graph = defineGraph({
|
|
132
|
-
* id: "my_graph",
|
|
133
|
-
* nodes: {
|
|
134
|
-
* Person: { type: Person },
|
|
135
|
-
* Company: { type: Company },
|
|
136
|
-
* },
|
|
137
|
-
* edges: {
|
|
138
|
-
* // Traditional EdgeRegistration syntax
|
|
139
|
-
* worksAt: {
|
|
140
|
-
* type: worksAt,
|
|
141
|
-
* from: [Person],
|
|
142
|
-
* to: [Company],
|
|
143
|
-
* cardinality: "many",
|
|
144
|
-
* },
|
|
145
|
-
* // Or use EdgeType directly if it has from/to defined
|
|
146
|
-
* knows, // EdgeType with built-in domain/range
|
|
147
|
-
* },
|
|
148
|
-
* ontology: [
|
|
149
|
-
* subClassOf(Company, Organization),
|
|
150
|
-
* disjointWith(Person, Organization),
|
|
151
|
-
* ],
|
|
152
|
-
* defaults: {
|
|
153
|
-
* onNodeDelete: "restrict",
|
|
154
|
-
* temporalMode: "current",
|
|
155
|
-
* },
|
|
156
|
-
* });
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
declare function defineGraph<const TNodes extends Record<string, NodeRegistration<NodeType>>, const TEdges extends Record<string, EdgeEntry>, const TOntology extends readonly OntologyRelation[]>(config: GraphDefConfig<TNodes, TEdges, TOntology>): GraphDef<TNodes, NormalizedEdges<TNodes, TEdges>, TOntology>;
|
|
160
|
-
/**
|
|
161
|
-
* Checks if a value is a GraphDef.
|
|
162
|
-
*/
|
|
163
|
-
declare function isGraphDef(value: unknown): value is GraphDef;
|
|
164
|
-
/**
|
|
165
|
-
* Gets all node kind names from a GraphDef.
|
|
166
|
-
*/
|
|
167
|
-
declare function getNodeKinds<G extends GraphDef>(graph: G): readonly (keyof G["nodes"] & string)[];
|
|
168
|
-
/**
|
|
169
|
-
* Gets all edge kind names from a GraphDef.
|
|
170
|
-
*/
|
|
171
|
-
declare function getEdgeKinds<G extends GraphDef>(graph: G): readonly (keyof G["edges"] & string)[];
|
|
172
|
-
|
|
173
|
-
export { type AllEdgeTypes as A, type EdgeKinds as E, type GraphDef as G, type NodeKinds as N, type AllNodeTypes as a, type GetEdgeType as b, type GetNodeType as c, defineGraph as d, getNodeKinds as e, getEdgeKinds as g, isGraphDef as i };
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { N as NodeRegistration, E as EdgeRegistration, O as OntologyRelation, D as DeleteBehavior, T as TemporalMode, I as IndexDeclaration, G as GraphExtension, b as NodeType, c as AnyEdgeType, d as GraphDefaults } from './types-Cjvkj0jA.js';
|
|
2
|
-
|
|
3
|
-
/** Brand key for GraphDef */
|
|
4
|
-
declare const GRAPH_DEF_BRAND: "__graphDef";
|
|
5
|
-
/**
|
|
6
|
-
* An edge entry in the graph definition.
|
|
7
|
-
* Can be:
|
|
8
|
-
* - EdgeType directly (constrained or unconstrained)
|
|
9
|
-
* - EdgeRegistration object (always works, can override/narrow defaults)
|
|
10
|
-
*/
|
|
11
|
-
type EdgeEntry = EdgeRegistration | AnyEdgeType;
|
|
12
|
-
/**
|
|
13
|
-
* Normalized edge map type - all entries become EdgeRegistration.
|
|
14
|
-
* For bare EdgeTypes, constrained endpoints are extracted from the type;
|
|
15
|
-
* unconstrained edges fall back to all node types in the graph.
|
|
16
|
-
*/
|
|
17
|
-
type NormalizedEdges<TNodes extends Record<string, NodeRegistration>, TEdges extends Record<string, EdgeEntry>> = {
|
|
18
|
-
[K in keyof TEdges]: TEdges[K] extends EdgeRegistration ? TEdges[K] : TEdges[K] extends AnyEdgeType ? EdgeRegistration<TEdges[K], TEdges[K]["from"] extends readonly (infer N extends NodeType)[] ? N : TNodes[keyof TNodes]["type"], TEdges[K]["to"] extends readonly (infer N extends NodeType)[] ? N : TNodes[keyof TNodes]["type"]> : never;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Configuration for defineGraph.
|
|
22
|
-
*/
|
|
23
|
-
type GraphDefConfig<TNodes extends Record<string, NodeRegistration>, TEdges extends Record<string, EdgeEntry>, TOntology extends readonly OntologyRelation[]> = Readonly<{
|
|
24
|
-
/** Unique identifier for this graph */
|
|
25
|
-
id: string;
|
|
26
|
-
/** Node registrations */
|
|
27
|
-
nodes: TNodes;
|
|
28
|
-
/** Edge registrations or EdgeTypes with built-in domain/range */
|
|
29
|
-
edges: TEdges;
|
|
30
|
-
/** Ontology relations */
|
|
31
|
-
ontology?: TOntology;
|
|
32
|
-
/** Graph-wide defaults */
|
|
33
|
-
defaults?: GraphDefaults;
|
|
34
|
-
/**
|
|
35
|
-
* Index declarations attached to this graph.
|
|
36
|
-
*
|
|
37
|
-
* Accepts the outputs of `defineNodeIndex` / `defineEdgeIndex` (which
|
|
38
|
-
* already return `IndexDeclaration` values) or pre-built declarations
|
|
39
|
-
* reconstructed from a stored schema or graph extension.
|
|
40
|
-
*
|
|
41
|
-
* Validated at definition time: every index must reference a `kind`
|
|
42
|
-
* that exists in `nodes` / `edges`, and index `name`s must be unique
|
|
43
|
-
* within the graph.
|
|
44
|
-
*
|
|
45
|
-
* Index DDL is **not** generated by `defineGraph`. Indexes flow into
|
|
46
|
-
* `SerializedSchema.indexes` so they can later be materialized via
|
|
47
|
-
* `store.materializeIndexes()` — lifting the storage concern out of
|
|
48
|
-
* the schema-version commit path.
|
|
49
|
-
*/
|
|
50
|
-
indexes?: readonly IndexDeclaration[];
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* A graph definition.
|
|
54
|
-
*
|
|
55
|
-
* This is a compile-time artifact that describes the structure of a graph.
|
|
56
|
-
* Use `createStore()` to create a runtime store from this definition.
|
|
57
|
-
*/
|
|
58
|
-
type GraphDef<TNodes extends Record<string, NodeRegistration> = Record<string, NodeRegistration>, TEdges extends Record<string, EdgeRegistration> = Record<string, EdgeRegistration>, TOntology extends readonly OntologyRelation[] = readonly OntologyRelation[]> = Readonly<{
|
|
59
|
-
[GRAPH_DEF_BRAND]: true;
|
|
60
|
-
id: string;
|
|
61
|
-
nodes: TNodes;
|
|
62
|
-
edges: TEdges;
|
|
63
|
-
ontology: TOntology;
|
|
64
|
-
defaults: Readonly<{
|
|
65
|
-
onNodeDelete: DeleteBehavior;
|
|
66
|
-
temporalMode: TemporalMode;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* Index declarations attached to this graph. Preserves whatever the
|
|
70
|
-
* caller passed to `defineGraph` (including an explicit empty array)
|
|
71
|
-
* for introspection purposes.
|
|
72
|
-
*
|
|
73
|
-
* The serialized canonical form is order-canonicalized (sorted by
|
|
74
|
-
* `name`) and treats `undefined` and `[]` as the same "no slice" form
|
|
75
|
-
* — an empty array does not bump the schema hash, since indexes are
|
|
76
|
-
* an unordered set keyed by name and `[]` carries no semantic meaning
|
|
77
|
-
* that an absent slice doesn't.
|
|
78
|
-
*/
|
|
79
|
-
indexes: readonly IndexDeclaration[] | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* Graph extension this graph was merged with, if any. Set by
|
|
82
|
-
* `mergeGraphExtension`; never set by `defineGraph` directly.
|
|
83
|
-
* Exists solely so re-serialization is stable — the rest of the
|
|
84
|
-
* system reads the merged kinds through `nodes` / `edges` /
|
|
85
|
-
* `ontology` and never inspects this field. Absent on graphs that
|
|
86
|
-
* have never been extended; legacy graphs hash byte-identically.
|
|
87
|
-
*/
|
|
88
|
-
extension: GraphExtension | undefined;
|
|
89
|
-
/**
|
|
90
|
-
* Soft-deprecated kind names attached to this graph. Set by the
|
|
91
|
-
* loader from the persisted schema and by `store.deprecateKinds(...)`
|
|
92
|
-
* / `store.undeprecateKinds(...)`. A purely informational signal
|
|
93
|
-
* surfaced for introspection — does not gate reads, writes, or
|
|
94
|
-
* queries. Defaults to the empty set on freshly-defined graphs.
|
|
95
|
-
*/
|
|
96
|
-
deprecatedKinds: ReadonlySet<string>;
|
|
97
|
-
}>;
|
|
98
|
-
/**
|
|
99
|
-
* Extract node kind names from a GraphDef.
|
|
100
|
-
*/
|
|
101
|
-
type NodeKinds<G extends GraphDef> = keyof G["nodes"] & string;
|
|
102
|
-
/**
|
|
103
|
-
* Extract edge kind names from a GraphDef.
|
|
104
|
-
*/
|
|
105
|
-
type EdgeKinds<G extends GraphDef> = keyof G["edges"] & string;
|
|
106
|
-
/**
|
|
107
|
-
* Get a NodeType from a GraphDef by kind name.
|
|
108
|
-
*/
|
|
109
|
-
type GetNodeType<G extends GraphDef, K extends NodeKinds<G>> = G["nodes"][K]["type"];
|
|
110
|
-
/**
|
|
111
|
-
* Get an EdgeType from a GraphDef by kind name.
|
|
112
|
-
*/
|
|
113
|
-
type GetEdgeType<G extends GraphDef, K extends EdgeKinds<G>> = G["edges"][K]["type"];
|
|
114
|
-
/**
|
|
115
|
-
* Get all NodeTypes from a GraphDef.
|
|
116
|
-
*/
|
|
117
|
-
type AllNodeTypes<G extends GraphDef> = {
|
|
118
|
-
[K in NodeKinds<G>]: G["nodes"][K]["type"];
|
|
119
|
-
}[NodeKinds<G>];
|
|
120
|
-
/**
|
|
121
|
-
* Get all EdgeTypes from a GraphDef.
|
|
122
|
-
*/
|
|
123
|
-
type AllEdgeTypes<G extends GraphDef> = {
|
|
124
|
-
[K in EdgeKinds<G>]: G["edges"][K]["type"];
|
|
125
|
-
}[EdgeKinds<G>];
|
|
126
|
-
/**
|
|
127
|
-
* Creates a graph definition.
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```typescript
|
|
131
|
-
* const graph = defineGraph({
|
|
132
|
-
* id: "my_graph",
|
|
133
|
-
* nodes: {
|
|
134
|
-
* Person: { type: Person },
|
|
135
|
-
* Company: { type: Company },
|
|
136
|
-
* },
|
|
137
|
-
* edges: {
|
|
138
|
-
* // Traditional EdgeRegistration syntax
|
|
139
|
-
* worksAt: {
|
|
140
|
-
* type: worksAt,
|
|
141
|
-
* from: [Person],
|
|
142
|
-
* to: [Company],
|
|
143
|
-
* cardinality: "many",
|
|
144
|
-
* },
|
|
145
|
-
* // Or use EdgeType directly if it has from/to defined
|
|
146
|
-
* knows, // EdgeType with built-in domain/range
|
|
147
|
-
* },
|
|
148
|
-
* ontology: [
|
|
149
|
-
* subClassOf(Company, Organization),
|
|
150
|
-
* disjointWith(Person, Organization),
|
|
151
|
-
* ],
|
|
152
|
-
* defaults: {
|
|
153
|
-
* onNodeDelete: "restrict",
|
|
154
|
-
* temporalMode: "current",
|
|
155
|
-
* },
|
|
156
|
-
* });
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
declare function defineGraph<const TNodes extends Record<string, NodeRegistration<NodeType>>, const TEdges extends Record<string, EdgeEntry>, const TOntology extends readonly OntologyRelation[]>(config: GraphDefConfig<TNodes, TEdges, TOntology>): GraphDef<TNodes, NormalizedEdges<TNodes, TEdges>, TOntology>;
|
|
160
|
-
/**
|
|
161
|
-
* Checks if a value is a GraphDef.
|
|
162
|
-
*/
|
|
163
|
-
declare function isGraphDef(value: unknown): value is GraphDef;
|
|
164
|
-
/**
|
|
165
|
-
* Gets all node kind names from a GraphDef.
|
|
166
|
-
*/
|
|
167
|
-
declare function getNodeKinds<G extends GraphDef>(graph: G): readonly (keyof G["nodes"] & string)[];
|
|
168
|
-
/**
|
|
169
|
-
* Gets all edge kind names from a GraphDef.
|
|
170
|
-
*/
|
|
171
|
-
declare function getEdgeKinds<G extends GraphDef>(graph: G): readonly (keyof G["edges"] & string)[];
|
|
172
|
-
|
|
173
|
-
export { type AllEdgeTypes as A, type EdgeKinds as E, type GraphDef as G, type NodeKinds as N, type AllNodeTypes as a, type GetEdgeType as b, type GetNodeType as c, defineGraph as d, getNodeKinds as e, getEdgeKinds as g, isGraphDef as i };
|