@nicia-ai/typegraph 0.46.1 → 0.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.cjs +9 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +49 -49
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +10 -10
- package/dist/backend/postgres/index.cjs +26 -26
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +13 -13
- package/dist/backend/postgres/pglite-store.cjs +33 -33
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +29 -29
- package/dist/backend/postgres/pglite.cjs +15 -15
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +14 -14
- package/dist/backend/sqlite/index.cjs +23 -23
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +11 -11
- package/dist/backend/sqlite/libsql.cjs +18 -18
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +13 -13
- package/dist/backend/sqlite/local-store.cjs +34 -34
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +30 -30
- package/dist/backend/sqlite/local.cjs +16 -16
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +14 -14
- package/dist/{chunk-VCRRKBLN.cjs → chunk-2ZWM2RFH.cjs} +9 -9
- package/dist/{chunk-VCRRKBLN.cjs.map → chunk-2ZWM2RFH.cjs.map} +1 -1
- package/dist/{chunk-Q3G6A4I3.cjs → chunk-32UETY6S.cjs} +26 -26
- package/dist/chunk-32UETY6S.cjs.map +1 -0
- package/dist/{chunk-JXA2ZP2Q.js → chunk-36LIJXWC.js} +4 -4
- package/dist/{chunk-JXA2ZP2Q.js.map → chunk-36LIJXWC.js.map} +1 -1
- package/dist/{chunk-MCLYU6BN.cjs → chunk-5PDSCELM.cjs} +14 -14
- package/dist/{chunk-MCLYU6BN.cjs.map → chunk-5PDSCELM.cjs.map} +1 -1
- package/dist/{chunk-775A4ZMN.js → chunk-5ZJOB5YS.js} +4 -4
- package/dist/{chunk-775A4ZMN.js.map → chunk-5ZJOB5YS.js.map} +1 -1
- package/dist/{chunk-J3WZ3FA2.js → chunk-62ZXBMSD.js} +24 -3
- package/dist/chunk-62ZXBMSD.js.map +1 -0
- package/dist/{chunk-7BQXPCGN.cjs → chunk-6BD6ZBKT.cjs} +10 -10
- package/dist/{chunk-7BQXPCGN.cjs.map → chunk-6BD6ZBKT.cjs.map} +1 -1
- package/dist/chunk-6LAXM4J2.cjs +12 -0
- package/dist/{chunk-VQH4VAWD.cjs.map → chunk-6LAXM4J2.cjs.map} +1 -1
- package/dist/{chunk-MSY7FSX4.js → chunk-72WUT4GG.js} +4 -4
- package/dist/{chunk-MSY7FSX4.js.map → chunk-72WUT4GG.js.map} +1 -1
- package/dist/chunk-73MWKDFK.cjs +12 -0
- package/dist/{chunk-A4OC4DVN.cjs.map → chunk-73MWKDFK.cjs.map} +1 -1
- package/dist/{chunk-BKCUOV7A.js → chunk-7TKNK32B.js} +5 -5
- package/dist/{chunk-BKCUOV7A.js.map → chunk-7TKNK32B.js.map} +1 -1
- package/dist/{chunk-GF3KXUTW.js → chunk-A2LJG5GM.js} +9 -9
- package/dist/{chunk-GF3KXUTW.js.map → chunk-A2LJG5GM.js.map} +1 -1
- package/dist/{chunk-PF6F5NLJ.cjs → chunk-A4R3H7RU.cjs} +237 -237
- package/dist/{chunk-PF6F5NLJ.cjs.map → chunk-A4R3H7RU.cjs.map} +1 -1
- package/dist/{chunk-RMQLSPA2.cjs → chunk-A7NMUYEL.cjs} +27 -27
- package/dist/{chunk-RMQLSPA2.cjs.map → chunk-A7NMUYEL.cjs.map} +1 -1
- package/dist/{chunk-U63GDNRC.cjs → chunk-AF3TWL5C.cjs} +4 -4
- package/dist/{chunk-U63GDNRC.cjs.map → chunk-AF3TWL5C.cjs.map} +1 -1
- package/dist/{chunk-XBYVV3MP.cjs → chunk-ANKOXPCC.cjs} +4 -4
- package/dist/chunk-ANKOXPCC.cjs.map +1 -0
- package/dist/{chunk-WQZLUGVR.js → chunk-AT3MLMJV.js} +10 -10
- package/dist/{chunk-WQZLUGVR.js.map → chunk-AT3MLMJV.js.map} +1 -1
- package/dist/{chunk-UV3SN74I.js → chunk-AU3IJNNP.js} +5 -5
- package/dist/{chunk-UV3SN74I.js.map → chunk-AU3IJNNP.js.map} +1 -1
- package/dist/{chunk-YAAM3M2S.cjs → chunk-BEB4OFZF.cjs} +10 -10
- package/dist/{chunk-YAAM3M2S.cjs.map → chunk-BEB4OFZF.cjs.map} +1 -1
- package/dist/{chunk-PT7RIRIZ.cjs → chunk-BQM5P2NO.cjs} +168 -168
- package/dist/{chunk-PT7RIRIZ.cjs.map → chunk-BQM5P2NO.cjs.map} +1 -1
- package/dist/{chunk-YWGVVALJ.js → chunk-BRN3RGD2.js} +3 -3
- package/dist/{chunk-YWGVVALJ.js.map → chunk-BRN3RGD2.js.map} +1 -1
- package/dist/{chunk-UDISNXDL.cjs → chunk-BZZI7B43.cjs} +47 -47
- package/dist/{chunk-UDISNXDL.cjs.map → chunk-BZZI7B43.cjs.map} +1 -1
- package/dist/{chunk-TQR4KBY2.cjs → chunk-C2ZP5YS6.cjs} +135 -133
- package/dist/chunk-C2ZP5YS6.cjs.map +1 -0
- package/dist/{chunk-PNN7RHVR.cjs → chunk-C4DYN2SD.cjs} +48 -48
- package/dist/{chunk-PNN7RHVR.cjs.map → chunk-C4DYN2SD.cjs.map} +1 -1
- package/dist/{chunk-PNTCATDE.cjs → chunk-C6KE2HSQ.cjs} +1355 -1312
- package/dist/chunk-C6KE2HSQ.cjs.map +1 -0
- package/dist/{chunk-LBJKZXDE.cjs → chunk-D6GCNNMK.cjs} +10 -10
- package/dist/{chunk-LBJKZXDE.cjs.map → chunk-D6GCNNMK.cjs.map} +1 -1
- package/dist/{chunk-JZUR7ZWE.js → chunk-DSAWGCMP.js} +3 -3
- package/dist/{chunk-JZUR7ZWE.js.map → chunk-DSAWGCMP.js.map} +1 -1
- package/dist/{chunk-U5SON7R2.cjs → chunk-DYPRZ53S.cjs} +27 -27
- package/dist/{chunk-U5SON7R2.cjs.map → chunk-DYPRZ53S.cjs.map} +1 -1
- package/dist/{chunk-YVWGEQJE.cjs → chunk-E4OSGBCM.cjs} +139 -133
- package/dist/chunk-E4OSGBCM.cjs.map +1 -0
- package/dist/{chunk-YDFDBE6D.js → chunk-EAMVXR5B.js} +4 -4
- package/dist/{chunk-YDFDBE6D.js.map → chunk-EAMVXR5B.js.map} +1 -1
- package/dist/{chunk-NLI2AVEF.js → chunk-EDHV4CBU.js} +8 -8
- package/dist/{chunk-NLI2AVEF.js.map → chunk-EDHV4CBU.js.map} +1 -1
- package/dist/{chunk-DCQVHAYQ.js → chunk-EDJDDY6H.js} +4 -4
- package/dist/{chunk-DCQVHAYQ.js.map → chunk-EDJDDY6H.js.map} +1 -1
- package/dist/{chunk-5262ZMTR.js → chunk-EJSYWAEV.js} +5 -5
- package/dist/{chunk-5262ZMTR.js.map → chunk-EJSYWAEV.js.map} +1 -1
- package/dist/{chunk-65E3XWGF.cjs → chunk-F36KZDFX.cjs} +91 -91
- package/dist/{chunk-65E3XWGF.cjs.map → chunk-F36KZDFX.cjs.map} +1 -1
- package/dist/{chunk-AKLS3BYZ.js → chunk-FA6Z7B5L.js} +3 -3
- package/dist/chunk-FA6Z7B5L.js.map +1 -0
- package/dist/{chunk-ASTI57H3.js → chunk-FCIZNUW5.js} +3 -3
- package/dist/{chunk-ASTI57H3.js.map → chunk-FCIZNUW5.js.map} +1 -1
- package/dist/{chunk-CBTIUB76.js → chunk-FSLTU57P.js} +3 -3
- package/dist/{chunk-CBTIUB76.js.map → chunk-FSLTU57P.js.map} +1 -1
- package/dist/{chunk-2LG2XB2M.js → chunk-FXNHZFZV.js} +3 -3
- package/dist/{chunk-2LG2XB2M.js.map → chunk-FXNHZFZV.js.map} +1 -1
- package/dist/{chunk-BSFJMMV3.cjs → chunk-GVAMRRZR.cjs} +4 -4
- package/dist/{chunk-BSFJMMV3.cjs.map → chunk-GVAMRRZR.cjs.map} +1 -1
- package/dist/{chunk-2Z2Z3ZD6.js → chunk-GWUWRZXW.js} +3 -3
- package/dist/{chunk-2Z2Z3ZD6.js.map → chunk-GWUWRZXW.js.map} +1 -1
- package/dist/{chunk-C23WSN5E.js → chunk-GWXXHOLU.js} +20 -14
- package/dist/chunk-GWXXHOLU.js.map +1 -0
- package/dist/{chunk-CMWHLBVN.cjs → chunk-HNYLMPQQ.cjs} +68 -68
- package/dist/{chunk-CMWHLBVN.cjs.map → chunk-HNYLMPQQ.cjs.map} +1 -1
- package/dist/{chunk-NMWDXFPH.js → chunk-IHRDX7K6.js} +4 -4
- package/dist/{chunk-NMWDXFPH.js.map → chunk-IHRDX7K6.js.map} +1 -1
- package/dist/{chunk-VGTJPTIC.js → chunk-JCNTKRAK.js} +5 -5
- package/dist/{chunk-VGTJPTIC.js.map → chunk-JCNTKRAK.js.map} +1 -1
- package/dist/{chunk-MXJDTH5B.cjs → chunk-JL5UEBWT.cjs} +45 -45
- package/dist/{chunk-MXJDTH5B.cjs.map → chunk-JL5UEBWT.cjs.map} +1 -1
- package/dist/{chunk-LGHCOKTT.js → chunk-KA4L2NZ3.js} +14 -14
- package/dist/{chunk-LGHCOKTT.js.map → chunk-KA4L2NZ3.js.map} +1 -1
- package/dist/{chunk-NI72YOJB.cjs → chunk-KCH7WQA5.cjs} +24 -2
- package/dist/chunk-KCH7WQA5.cjs.map +1 -0
- package/dist/{chunk-2NA5DYLO.cjs → chunk-KOAI3KIV.cjs} +4 -4
- package/dist/{chunk-2NA5DYLO.cjs.map → chunk-KOAI3KIV.cjs.map} +1 -1
- package/dist/{chunk-7VQXLT5O.js → chunk-KXSMF6PL.js} +101 -25
- package/dist/chunk-KXSMF6PL.js.map +1 -0
- package/dist/{chunk-M3WP7RQZ.js → chunk-LHYSY6SE.js} +6 -6
- package/dist/chunk-LHYSY6SE.js.map +1 -0
- package/dist/{chunk-WDGA7IYB.js → chunk-LNIWCQR4.js} +3 -3
- package/dist/{chunk-WDGA7IYB.js.map → chunk-LNIWCQR4.js.map} +1 -1
- package/dist/{chunk-YBQOHKHN.cjs → chunk-N3QTGPC7.cjs} +99 -99
- package/dist/{chunk-YBQOHKHN.cjs.map → chunk-N3QTGPC7.cjs.map} +1 -1
- package/dist/{chunk-K5ELX2GT.js → chunk-OZJCH7ZS.js} +3 -3
- package/dist/{chunk-K5ELX2GT.js.map → chunk-OZJCH7ZS.js.map} +1 -1
- package/dist/{chunk-62ZP23AW.cjs → chunk-PYKF7UIL.cjs} +13 -13
- package/dist/{chunk-62ZP23AW.cjs.map → chunk-PYKF7UIL.cjs.map} +1 -1
- package/dist/{chunk-PQBQG7IM.js → chunk-QOJ2L2AD.js} +3 -3
- package/dist/{chunk-PQBQG7IM.js.map → chunk-QOJ2L2AD.js.map} +1 -1
- package/dist/{chunk-DTVWX77L.cjs → chunk-QPOQX2DI.cjs} +235 -235
- package/dist/{chunk-DTVWX77L.cjs.map → chunk-QPOQX2DI.cjs.map} +1 -1
- package/dist/{chunk-NFCVHQ5P.cjs → chunk-QU7QLJA4.cjs} +26 -26
- package/dist/{chunk-NFCVHQ5P.cjs.map → chunk-QU7QLJA4.cjs.map} +1 -1
- package/dist/{chunk-XL7SLCXS.js → chunk-R7EWHKID.js} +3 -3
- package/dist/{chunk-XL7SLCXS.js.map → chunk-R7EWHKID.js.map} +1 -1
- package/dist/{chunk-HFHTMECK.js → chunk-RFDEYLIK.js} +7 -7
- package/dist/{chunk-HFHTMECK.js.map → chunk-RFDEYLIK.js.map} +1 -1
- package/dist/{chunk-MUK4BU7K.cjs → chunk-RHDOAQCT.cjs} +200 -124
- package/dist/chunk-RHDOAQCT.cjs.map +1 -0
- package/dist/{chunk-YBFHZUXX.js → chunk-S3G5VLSW.js} +6 -6
- package/dist/{chunk-YBFHZUXX.js.map → chunk-S3G5VLSW.js.map} +1 -1
- package/dist/{chunk-M4BDU5RX.cjs → chunk-S7WIRFNS.cjs} +12 -12
- package/dist/{chunk-M4BDU5RX.cjs.map → chunk-S7WIRFNS.cjs.map} +1 -1
- package/dist/{chunk-T4XNKYXB.js → chunk-SXWLLQ3D.js} +4 -4
- package/dist/{chunk-T4XNKYXB.js.map → chunk-SXWLLQ3D.js.map} +1 -1
- package/dist/{chunk-NK5Q7UNE.cjs → chunk-TCT66A7N.cjs} +10 -10
- package/dist/{chunk-NK5Q7UNE.cjs.map → chunk-TCT66A7N.cjs.map} +1 -1
- package/dist/{chunk-3DHZCOT7.cjs → chunk-UTVQPZPN.cjs} +20 -20
- package/dist/{chunk-3DHZCOT7.cjs.map → chunk-UTVQPZPN.cjs.map} +1 -1
- package/dist/{chunk-CXBHOOIQ.cjs → chunk-WA64ZSCA.cjs} +11 -11
- package/dist/{chunk-CXBHOOIQ.cjs.map → chunk-WA64ZSCA.cjs.map} +1 -1
- package/dist/{chunk-L65OU2U3.js → chunk-WEJHA7AD.js} +13 -13
- package/dist/{chunk-L65OU2U3.js.map → chunk-WEJHA7AD.js.map} +1 -1
- package/dist/{chunk-5UVRGXD3.js → chunk-WHS2Y43J.js} +5 -5
- package/dist/{chunk-5UVRGXD3.js.map → chunk-WHS2Y43J.js.map} +1 -1
- package/dist/{chunk-I5MOXA4H.js → chunk-WMKEGJG4.js} +3 -3
- package/dist/{chunk-I5MOXA4H.js.map → chunk-WMKEGJG4.js.map} +1 -1
- package/dist/{chunk-5763DULU.js → chunk-WYFB7BN3.js} +16 -14
- package/dist/chunk-WYFB7BN3.js.map +1 -0
- package/dist/{chunk-VLT6PEWR.cjs → chunk-XBHRKLZU.cjs} +4 -4
- package/dist/{chunk-VLT6PEWR.cjs.map → chunk-XBHRKLZU.cjs.map} +1 -1
- package/dist/{chunk-S6PW7VV5.js → chunk-YQ4JONWE.js} +91 -48
- package/dist/chunk-YQ4JONWE.js.map +1 -0
- package/dist/{chunk-MZLPX2R7.js → chunk-Z43KWLZF.js} +8 -8
- package/dist/{chunk-MZLPX2R7.js.map → chunk-Z43KWLZF.js.map} +1 -1
- package/dist/{chunk-E4WNQBEF.cjs → chunk-ZBVZ7HXD.cjs} +12 -12
- package/dist/{chunk-E4WNQBEF.cjs.map → chunk-ZBVZ7HXD.cjs.map} +1 -1
- package/dist/{chunk-4UGOKMI5.cjs → chunk-ZHOAZD7Q.cjs} +161 -161
- package/dist/{chunk-4UGOKMI5.cjs.map → chunk-ZHOAZD7Q.cjs.map} +1 -1
- package/dist/{chunk-XCAGZAKP.cjs → chunk-ZIH42CRX.cjs} +7 -7
- package/dist/{chunk-XCAGZAKP.cjs.map → chunk-ZIH42CRX.cjs.map} +1 -1
- package/dist/core/index.cjs +27 -27
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +7 -7
- package/dist/{ddl-BJcOp4WZ.d.cts → ddl-mE07h_EM.d.cts} +3 -3
- package/dist/{ddl-BXfGHbPN.d.ts → ddl-opIn8DfX.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +20 -20
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/graph-merge/index.cjs +248 -248
- package/dist/graph-merge/index.d.cts +8 -8
- package/dist/graph-merge/index.d.ts +8 -8
- package/dist/graph-merge/index.js +24 -24
- package/dist/{index-DxaYCv8Y.d.cts → index-Deyu8IXL.d.ts} +20 -3
- package/dist/{index-BSHvKfok.d.ts → index-DrRS51Ld.d.cts} +20 -3
- package/dist/index.cjs +219 -215
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +34 -34
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +52 -52
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +16 -16
- package/dist/{manager-CfZAimti.d.ts → manager-DX983gJ0.d.ts} +2 -2
- package/dist/{manager-HGk6E_HW.d.cts → manager-ptr3JLRP.d.cts} +2 -2
- package/dist/{materialize-indexes-6A7dWGtb.d.cts → materialize-indexes-BXz77YqO.d.cts} +1 -1
- package/dist/{materialize-indexes-BMJP6Tms.d.ts → materialize-indexes-CpXoggWU.d.ts} +1 -1
- package/dist/{postgres-DFYWENdR.d.cts → postgres-DwgEXSPI.d.cts} +1 -1
- package/dist/{postgres-e7a9TdvR.d.ts → postgres-QdOMHTBz.d.ts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +42 -42
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +9 -9
- package/dist/schema/index.cjs +44 -44
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +17 -17
- package/dist/{searchable-9OQoPuRs.d.ts → searchable-BOUuA83f.d.ts} +1 -1
- package/dist/{searchable-CIje5XYD.d.cts → searchable-BrUh0pdc.d.cts} +1 -1
- package/dist/{sqlite-DerU5tc7.d.ts → sqlite-BfYcV61E.d.cts} +1 -1
- package/dist/{sqlite-DitnISa9.d.cts → sqlite-DK40XVR1.d.ts} +1 -1
- package/dist/{store-B0h6x7wo.d.cts → store-Bo1psfVZ.d.ts} +15 -5
- package/dist/{store-ClQ-MZQS.d.ts → store-FTqBpuJD.d.cts} +15 -5
- package/dist/{temporal-Bn-Fi8FJ.d.cts → temporal-CXewwLTB.d.cts} +1 -1
- package/dist/{temporal-BtM4UALv.d.ts → temporal-DPtn0HOu.d.ts} +1 -1
- package/dist/{types-KFfk-8Ah.d.ts → types-CeT7xM4M.d.ts} +1 -1
- package/dist/{types-HkveCCx0.d.ts → types-Du78EvpN.d.cts} +7 -6
- package/dist/{types-HkveCCx0.d.cts → types-Du78EvpN.d.ts} +7 -6
- package/dist/{types-CoIx8HX5.d.cts → types-XR1nHERK.d.cts} +1 -1
- package/dist/{where--fk7_0kv.d.cts → where-CJsp-YUf.d.cts} +1 -1
- package/dist/{where-ws5hf-Ov.d.ts → where-CMbFiWwp.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-5763DULU.js.map +0 -1
- package/dist/chunk-7VQXLT5O.js.map +0 -1
- package/dist/chunk-A4OC4DVN.cjs +0 -12
- package/dist/chunk-AKLS3BYZ.js.map +0 -1
- package/dist/chunk-C23WSN5E.js.map +0 -1
- package/dist/chunk-J3WZ3FA2.js.map +0 -1
- package/dist/chunk-M3WP7RQZ.js.map +0 -1
- package/dist/chunk-MUK4BU7K.cjs.map +0 -1
- package/dist/chunk-NI72YOJB.cjs.map +0 -1
- package/dist/chunk-PNTCATDE.cjs.map +0 -1
- package/dist/chunk-Q3G6A4I3.cjs.map +0 -1
- package/dist/chunk-S6PW7VV5.js.map +0 -1
- package/dist/chunk-TQR4KBY2.cjs.map +0 -1
- package/dist/chunk-VQH4VAWD.cjs +0 -12
- package/dist/chunk-XBYVV3MP.cjs.map +0 -1
- package/dist/chunk-YVWGEQJE.cjs.map +0 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
3
|
+
var chunkC6KE2HSQ_cjs = require('../chunk-C6KE2HSQ.cjs');
|
|
4
|
+
require('../chunk-BEB4OFZF.cjs');
|
|
5
|
+
var chunkHNYLMPQQ_cjs = require('../chunk-HNYLMPQQ.cjs');
|
|
6
|
+
require('../chunk-BQM5P2NO.cjs');
|
|
7
|
+
var chunk32UETY6S_cjs = require('../chunk-32UETY6S.cjs');
|
|
8
|
+
var chunkF36KZDFX_cjs = require('../chunk-F36KZDFX.cjs');
|
|
9
|
+
var chunkTCT66A7N_cjs = require('../chunk-TCT66A7N.cjs');
|
|
10
|
+
var chunkQPOQX2DI_cjs = require('../chunk-QPOQX2DI.cjs');
|
|
11
|
+
var chunkA4R3H7RU_cjs = require('../chunk-A4R3H7RU.cjs');
|
|
12
12
|
var chunkPWLJ77UV_cjs = require('../chunk-PWLJ77UV.cjs');
|
|
13
|
-
require('../chunk-
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
require('../chunk-
|
|
20
|
-
require('../chunk-
|
|
21
|
-
require('../chunk-
|
|
13
|
+
require('../chunk-GVAMRRZR.cjs');
|
|
14
|
+
var chunkQU7QLJA4_cjs = require('../chunk-QU7QLJA4.cjs');
|
|
15
|
+
var chunkANKOXPCC_cjs = require('../chunk-ANKOXPCC.cjs');
|
|
16
|
+
var chunkWA64ZSCA_cjs = require('../chunk-WA64ZSCA.cjs');
|
|
17
|
+
var chunkZBVZ7HXD_cjs = require('../chunk-ZBVZ7HXD.cjs');
|
|
18
|
+
var chunk5PDSCELM_cjs = require('../chunk-5PDSCELM.cjs');
|
|
19
|
+
require('../chunk-PYKF7UIL.cjs');
|
|
20
|
+
require('../chunk-ZIH42CRX.cjs');
|
|
21
|
+
require('../chunk-AF3TWL5C.cjs');
|
|
22
22
|
var chunkZY4GXIVN_cjs = require('../chunk-ZY4GXIVN.cjs');
|
|
23
23
|
require('../chunk-NAUA4PW5.cjs');
|
|
24
|
-
require('../chunk-
|
|
25
|
-
var
|
|
24
|
+
require('../chunk-ZHOAZD7Q.cjs');
|
|
25
|
+
var chunk2ZWM2RFH_cjs = require('../chunk-2ZWM2RFH.cjs');
|
|
26
26
|
require('../chunk-7EO3TCQB.cjs');
|
|
27
27
|
require('../chunk-RT5ZY4XA.cjs');
|
|
28
28
|
require('../chunk-HAHNRASW.cjs');
|
|
29
|
-
var
|
|
29
|
+
var chunk6BD6ZBKT_cjs = require('../chunk-6BD6ZBKT.cjs');
|
|
30
30
|
var chunkXUO3KQFO_cjs = require('../chunk-XUO3KQFO.cjs');
|
|
31
|
-
require('../chunk-
|
|
32
|
-
var
|
|
31
|
+
require('../chunk-D6GCNNMK.cjs');
|
|
32
|
+
var chunkKCH7WQA5_cjs = require('../chunk-KCH7WQA5.cjs');
|
|
33
33
|
require('../chunk-A7J2YDDI.cjs');
|
|
34
34
|
var chunkN66HCGCY_cjs = require('../chunk-N66HCGCY.cjs');
|
|
35
35
|
var zod = require('zod');
|
|
@@ -118,7 +118,7 @@ function toTypeGraphErrorOptions(category, options) {
|
|
|
118
118
|
...options.cause === void 0 ? {} : { cause: options.cause }
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
var MergeError = class extends
|
|
121
|
+
var MergeError = class extends chunkKCH7WQA5_cjs.TypeGraphError {
|
|
122
122
|
static errorCategory = "system";
|
|
123
123
|
constructor(message, options = {}) {
|
|
124
124
|
const errorClass = new.target;
|
|
@@ -138,7 +138,7 @@ var InvalidMergeOptionsError = class extends MergeError {
|
|
|
138
138
|
this.name = "InvalidMergeOptionsError";
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
-
var BranchError = class extends
|
|
141
|
+
var BranchError = class extends chunkKCH7WQA5_cjs.TypeGraphError {
|
|
142
142
|
constructor(message, options = {}) {
|
|
143
143
|
super(
|
|
144
144
|
message,
|
|
@@ -238,18 +238,18 @@ function endpointTuple(assertion) {
|
|
|
238
238
|
return [assertion.a.kind, assertion.a.id, assertion.b.kind, assertion.b.id];
|
|
239
239
|
}
|
|
240
240
|
function identityEndpointKey(assertion) {
|
|
241
|
-
return
|
|
241
|
+
return chunkQPOQX2DI_cjs.encodeTupleKey(endpointTuple(assertion));
|
|
242
242
|
}
|
|
243
243
|
function identitySemanticKey(assertion) {
|
|
244
|
-
return
|
|
244
|
+
return chunkQPOQX2DI_cjs.identityAssertionSemanticKey(
|
|
245
245
|
assertion.relation,
|
|
246
246
|
assertion.a,
|
|
247
247
|
assertion.b
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
250
|
function compareIdentitySurvivors(left, right) {
|
|
251
|
-
const byValidity =
|
|
252
|
-
return byValidity === 0 ?
|
|
251
|
+
const byValidity = chunkA4R3H7RU_cjs.compareCodePoints(left.validFrom, right.validFrom);
|
|
252
|
+
return byValidity === 0 ? chunkA4R3H7RU_cjs.compareCodePoints(left.id, right.id) : byValidity;
|
|
253
253
|
}
|
|
254
254
|
var DUPLICATE_IDENTITY_ASSERTION_DROP_REASON = "identity:duplicate-assertion";
|
|
255
255
|
var REDUNDANT_IDENTITY_ASSERTION_DROP_REASON = "identity:endpoints-collapsed";
|
|
@@ -279,7 +279,7 @@ function dedupeIdentityAssertions(assertions, committedIds) {
|
|
|
279
279
|
}
|
|
280
280
|
return {
|
|
281
281
|
survivors: [...survivorBySemantic.values()].toSorted(
|
|
282
|
-
(left, right) =>
|
|
282
|
+
(left, right) => chunkA4R3H7RU_cjs.compareCodePoints(identitySemanticKey(left), identitySemanticKey(right))
|
|
283
283
|
),
|
|
284
284
|
dropped
|
|
285
285
|
};
|
|
@@ -403,7 +403,7 @@ function planIdentityChanges(staging, storedIdentityRowsById) {
|
|
|
403
403
|
return {
|
|
404
404
|
assertions: deduped.survivors,
|
|
405
405
|
retractions: retractions.toSorted(
|
|
406
|
-
(left, right) =>
|
|
406
|
+
(left, right) => chunkA4R3H7RU_cjs.compareCodePoints(left.id, right.id)
|
|
407
407
|
),
|
|
408
408
|
dropped: [...deduped.dropped, ...retractionDropped]
|
|
409
409
|
};
|
|
@@ -445,7 +445,7 @@ function remapIdentityAssertionEndpoints(assertions, canonicalOf, retypeMap, sto
|
|
|
445
445
|
);
|
|
446
446
|
continue;
|
|
447
447
|
}
|
|
448
|
-
const [a, b] =
|
|
448
|
+
const [a, b] = chunkQPOQX2DI_cjs.normalizeIdentityPair(remappedA, remappedB);
|
|
449
449
|
const result = { ...assertion, a, b };
|
|
450
450
|
const stored = storedRowsById.get(assertion.id);
|
|
451
451
|
if (stored !== void 0 && assertionTruthKey(stored) === assertionTruthKey(assertion) && assertionTruthKey(result) !== assertionTruthKey(assertion)) {
|
|
@@ -634,7 +634,7 @@ async function buildIdentityPeerProbe(target, probedIds, targetPeers, plan, prof
|
|
|
634
634
|
(group) => group.map((member) => mergeKey(member.kind, member.id))
|
|
635
635
|
)
|
|
636
636
|
]);
|
|
637
|
-
const ledger = (await relevantLedgerAssertions(target, memberKeys,
|
|
637
|
+
const ledger = (await relevantLedgerAssertions(target, memberKeys, chunk32UETY6S_cjs.storeBackend(target))).filter(
|
|
638
638
|
(assertion) => !plannedDeletions.has(mergeKey(assertion.a.kind, assertion.a.id)) && !plannedDeletions.has(mergeKey(assertion.b.kind, assertion.b.id))
|
|
639
639
|
);
|
|
640
640
|
return {
|
|
@@ -655,7 +655,7 @@ async function buildIdentityPeerProbe(target, probedIds, targetPeers, plan, prof
|
|
|
655
655
|
};
|
|
656
656
|
}
|
|
657
657
|
async function snapshotIdentityClasses(target, seeds, liveKeys, plannedDeletions, txBackend) {
|
|
658
|
-
const classes = await
|
|
658
|
+
const classes = await chunk32UETY6S_cjs.storeRuntime(target).structuralIdentityClasses(
|
|
659
659
|
seeds,
|
|
660
660
|
txBackend
|
|
661
661
|
);
|
|
@@ -663,7 +663,7 @@ async function snapshotIdentityClasses(target, seeds, liveKeys, plannedDeletions
|
|
|
663
663
|
const groups = [];
|
|
664
664
|
for (const seed of seeds) {
|
|
665
665
|
const key = mergeKey(seed.kind, seed.id);
|
|
666
|
-
const members = (classes.get(
|
|
666
|
+
const members = (classes.get(chunkQPOQX2DI_cjs.identityReferenceKey(seed)) ?? [seed]).filter(
|
|
667
667
|
(member) => !plannedDeletions.has(mergeKey(member.kind, member.id))
|
|
668
668
|
);
|
|
669
669
|
groups.push(members);
|
|
@@ -672,7 +672,7 @@ async function snapshotIdentityClasses(target, seeds, liveKeys, plannedDeletions
|
|
|
672
672
|
return { fingerprints, groups };
|
|
673
673
|
}
|
|
674
674
|
async function relevantLedgerAssertions(target, memberKeys, backend) {
|
|
675
|
-
const current = await
|
|
675
|
+
const current = await chunk32UETY6S_cjs.storeRuntime(target).identityAssertionsAtTarget(
|
|
676
676
|
backend,
|
|
677
677
|
"state"
|
|
678
678
|
);
|
|
@@ -683,7 +683,7 @@ async function relevantLedgerAssertions(target, memberKeys, backend) {
|
|
|
683
683
|
function differentLedgerFingerprint(assertions) {
|
|
684
684
|
return JSON.stringify(
|
|
685
685
|
assertions.filter((assertion) => assertion.relation === "different").map((assertion) => [assertion.id, ...endpointTuple(assertion)]).toSorted(
|
|
686
|
-
(left, right) =>
|
|
686
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(chunkQPOQX2DI_cjs.encodeTupleKey(left), chunkQPOQX2DI_cjs.encodeTupleKey(right))
|
|
687
687
|
)
|
|
688
688
|
);
|
|
689
689
|
}
|
|
@@ -745,7 +745,7 @@ async function assertPlannedIdentityIdsFresh(target, txBackend, plan) {
|
|
|
745
745
|
...plan.identityRetractions.map((retraction) => retraction.id)
|
|
746
746
|
];
|
|
747
747
|
if (plannedIds.length === 0) return;
|
|
748
|
-
const storedById = await
|
|
748
|
+
const storedById = await chunk32UETY6S_cjs.storeRuntime(target).identityAssertionRowsByIds(
|
|
749
749
|
plannedIds,
|
|
750
750
|
txBackend
|
|
751
751
|
);
|
|
@@ -798,7 +798,7 @@ function affectedIdentityClassSeeds(plan, profile) {
|
|
|
798
798
|
return [...seedsByKey.values()];
|
|
799
799
|
}
|
|
800
800
|
async function assertMergedIdentityClassesConsistent(target, txBackend, plan) {
|
|
801
|
-
await
|
|
801
|
+
await chunk32UETY6S_cjs.storeRuntime(target).assertIdentityClassesConsistentAtTarget(
|
|
802
802
|
txBackend,
|
|
803
803
|
affectedIdentityClassSeeds(plan, target.graph.identity?.sameIdAcrossKinds)
|
|
804
804
|
);
|
|
@@ -837,9 +837,9 @@ function identityRefusalCode(error) {
|
|
|
837
837
|
}
|
|
838
838
|
function translateIdentityCommitError(error) {
|
|
839
839
|
if (error instanceof MergeError) return error;
|
|
840
|
-
if (!(error instanceof
|
|
840
|
+
if (!(error instanceof chunkKCH7WQA5_cjs.TypeGraphError)) return error;
|
|
841
841
|
const identityCode = identityRefusalCode(error);
|
|
842
|
-
const identityRefusal = error instanceof
|
|
842
|
+
const identityRefusal = error instanceof chunkKCH7WQA5_cjs.IdentityContradictionError || error instanceof chunkKCH7WQA5_cjs.NodeNotFoundError || identityCode !== void 0 && !IDENTITY_ENVIRONMENT_CODES.has(identityCode);
|
|
843
843
|
if (!identityRefusal) return error;
|
|
844
844
|
return new IdentityMergeConflictError(
|
|
845
845
|
`The identity applier refused the resolved plan inside the commit transaction \u2014 identity truth on the target is incompatible with the plan. Cause: ${describeCause(error)}`,
|
|
@@ -852,7 +852,7 @@ function translateIdentityCommitError(error) {
|
|
|
852
852
|
}
|
|
853
853
|
async function assertIdentityPeersStable(target, txBackend, probe, plan) {
|
|
854
854
|
if (probe === void 0) return;
|
|
855
|
-
const live = (await
|
|
855
|
+
const live = (await chunk32UETY6S_cjs.storeRuntime(target).liveNodesSharingIds(probe.ids, txBackend)).filter((peer) => !probe.plannedDeletions.has(mergeKey(peer.kind, peer.id)));
|
|
856
856
|
const seedKindsById = /* @__PURE__ */ new Map();
|
|
857
857
|
for (const seed of probe.seeds) {
|
|
858
858
|
const kinds = seedKindsById.get(seed.id) ?? /* @__PURE__ */ new Set();
|
|
@@ -877,7 +877,7 @@ async function assertIdentityPeersStable(target, txBackend, probe, plan) {
|
|
|
877
877
|
probe.plannedDeletions,
|
|
878
878
|
txBackend
|
|
879
879
|
);
|
|
880
|
-
const drifted = [...probe.classFingerprints].filter(([key, fingerprint]) => liveFingerprints.get(key) !== fingerprint).map(([key]) => key).sort((left, right) =>
|
|
880
|
+
const drifted = [...probe.classFingerprints].filter(([key, fingerprint]) => liveFingerprints.get(key) !== fingerprint).map(([key]) => key).sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
881
881
|
if (drifted.length > 0) {
|
|
882
882
|
throw new BaseVersionMismatchError(
|
|
883
883
|
`mergeIncremental() validated identity against the classes visible at planning, but the identity class of ${drifted.length} node(s) the plan folds on changed before the commit transaction. Committing the plan could contradict identity truth it never validated.`,
|
|
@@ -921,8 +921,8 @@ var ENUMERATION_PAGE_SIZE = 1e3;
|
|
|
921
921
|
var EXPLICIT_RETRACTION = { kind: "explicit" };
|
|
922
922
|
function validWindowOf(row) {
|
|
923
923
|
return {
|
|
924
|
-
validFrom:
|
|
925
|
-
validTo:
|
|
924
|
+
validFrom: chunk5PDSCELM_cjs.canonicalizeDatabaseTimestamp(row.valid_from),
|
|
925
|
+
validTo: chunk5PDSCELM_cjs.canonicalizeDatabaseTimestamp(row.valid_to)
|
|
926
926
|
};
|
|
927
927
|
}
|
|
928
928
|
function windowsDiffer(left, right) {
|
|
@@ -1034,7 +1034,7 @@ function diffNodeKind(kind, baseRows, forkRows) {
|
|
|
1034
1034
|
deleted.push({
|
|
1035
1035
|
id: baseRow.id,
|
|
1036
1036
|
kind,
|
|
1037
|
-
deletedAt: forkRow === void 0 ? void 0 :
|
|
1037
|
+
deletedAt: forkRow === void 0 ? void 0 : chunk5PDSCELM_cjs.canonicalizeDatabaseTimestamp(forkRow.deleted_at)
|
|
1038
1038
|
});
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
@@ -1140,7 +1140,7 @@ async function classifyRetractions(forkStore, retracted, deletedNodes) {
|
|
|
1140
1140
|
deletion
|
|
1141
1141
|
])
|
|
1142
1142
|
);
|
|
1143
|
-
const forkRowsById = await
|
|
1143
|
+
const forkRowsById = await chunk32UETY6S_cjs.storeRuntime(forkStore).identityAssertionRowsByIds(
|
|
1144
1144
|
retracted.map((assertion) => assertion.id)
|
|
1145
1145
|
);
|
|
1146
1146
|
return retracted.map((assertion) => ({
|
|
@@ -1153,15 +1153,15 @@ async function classifyRetractions(forkStore, retracted, deletedNodes) {
|
|
|
1153
1153
|
}));
|
|
1154
1154
|
}
|
|
1155
1155
|
function byId(left, right) {
|
|
1156
|
-
return
|
|
1156
|
+
return chunkA4R3H7RU_cjs.compareStrings(left.id, right.id);
|
|
1157
1157
|
}
|
|
1158
1158
|
async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
1159
1159
|
const graph = baseStore.graph;
|
|
1160
|
-
const nodeKinds =
|
|
1161
|
-
const edgeKinds =
|
|
1160
|
+
const nodeKinds = chunkWA64ZSCA_cjs.getNodeKinds(graph);
|
|
1161
|
+
const edgeKinds = chunkWA64ZSCA_cjs.getEdgeKinds(graph);
|
|
1162
1162
|
const [baseIdentity, forkIdentity] = await Promise.all([
|
|
1163
|
-
|
|
1164
|
-
|
|
1163
|
+
chunk32UETY6S_cjs.storeRuntime(baseStore).readCurrentIdentityAssertions("state"),
|
|
1164
|
+
chunk32UETY6S_cjs.storeRuntime(forkStore).readCurrentIdentityAssertions("state")
|
|
1165
1165
|
]);
|
|
1166
1166
|
const baseIdentityById = new Map(
|
|
1167
1167
|
baseIdentity.map((assertion) => [assertion.id, assertion])
|
|
@@ -1176,12 +1176,12 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
|
1176
1176
|
const forkNodeVersions = /* @__PURE__ */ new Map();
|
|
1177
1177
|
for (const kind of nodeKinds) {
|
|
1178
1178
|
const baseRows = await enumerateAllNodes(
|
|
1179
|
-
|
|
1179
|
+
chunk32UETY6S_cjs.storeBackend(baseStore),
|
|
1180
1180
|
baseStore.graphId,
|
|
1181
1181
|
kind
|
|
1182
1182
|
);
|
|
1183
1183
|
const forkRows = await enumerateAllNodes(
|
|
1184
|
-
|
|
1184
|
+
chunk32UETY6S_cjs.storeBackend(forkStore),
|
|
1185
1185
|
forkStore.graphId,
|
|
1186
1186
|
kind
|
|
1187
1187
|
);
|
|
@@ -1211,12 +1211,12 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
|
1211
1211
|
const forkEdgeSignatures = /* @__PURE__ */ new Map();
|
|
1212
1212
|
for (const kind of edgeKinds) {
|
|
1213
1213
|
const baseRows = await enumerateAllEdges(
|
|
1214
|
-
|
|
1214
|
+
chunk32UETY6S_cjs.storeBackend(baseStore),
|
|
1215
1215
|
baseStore.graphId,
|
|
1216
1216
|
kind
|
|
1217
1217
|
);
|
|
1218
1218
|
const forkRows = await enumerateAllEdges(
|
|
1219
|
-
|
|
1219
|
+
chunk32UETY6S_cjs.storeBackend(forkStore),
|
|
1220
1220
|
forkStore.graphId,
|
|
1221
1221
|
kind
|
|
1222
1222
|
);
|
|
@@ -1252,7 +1252,7 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
|
1252
1252
|
const retractedAssertions = baseIdentity.filter((assertion) => {
|
|
1253
1253
|
const fork = forkIdentityById.get(assertion.id);
|
|
1254
1254
|
return fork === void 0 || assertionTruthKey(fork) !== assertionTruthKey(assertion);
|
|
1255
|
-
}).toSorted((left, right) =>
|
|
1255
|
+
}).toSorted((left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id));
|
|
1256
1256
|
const classifiedRetractions = await classifyRetractions(
|
|
1257
1257
|
forkStore,
|
|
1258
1258
|
retractedAssertions,
|
|
@@ -1283,7 +1283,7 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
|
1283
1283
|
new: forkIdentity.filter((assertion) => {
|
|
1284
1284
|
const base = baseIdentityById.get(assertion.id);
|
|
1285
1285
|
return base === void 0 || assertionTruthKey(base) !== assertionTruthKey(assertion);
|
|
1286
|
-
}).toSorted((left, right) =>
|
|
1286
|
+
}).toSorted((left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id)),
|
|
1287
1287
|
retracted: classifiedRetractions
|
|
1288
1288
|
},
|
|
1289
1289
|
forkNodeVersions,
|
|
@@ -1313,19 +1313,19 @@ async function readActiveSchemaVersion(backend, graphId) {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
async function computeSchemaComponent(store) {
|
|
1315
1315
|
const version = await readActiveSchemaVersion(
|
|
1316
|
-
|
|
1316
|
+
chunk32UETY6S_cjs.storeBackend(store),
|
|
1317
1317
|
store.graphId
|
|
1318
1318
|
);
|
|
1319
|
-
return
|
|
1319
|
+
return chunkF36KZDFX_cjs.computeSchemaHash(chunkF36KZDFX_cjs.serializeSchema(store.graph, version));
|
|
1320
1320
|
}
|
|
1321
1321
|
function byDigestEntry(left, right) {
|
|
1322
|
-
const byKind =
|
|
1323
|
-
return byKind === 0 ?
|
|
1322
|
+
const byKind = chunkA4R3H7RU_cjs.compareStrings(left.kind, right.kind);
|
|
1323
|
+
return byKind === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.id, right.id) : byKind;
|
|
1324
1324
|
}
|
|
1325
1325
|
var CONTENT_FINGERPRINT_BYTES = 16;
|
|
1326
1326
|
async function computeContentComponent(backend, graphId, graph, identityAssertions) {
|
|
1327
|
-
const nodeKinds =
|
|
1328
|
-
const edgeKinds =
|
|
1327
|
+
const nodeKinds = chunkWA64ZSCA_cjs.getNodeKinds(graph);
|
|
1328
|
+
const edgeKinds = chunkWA64ZSCA_cjs.getEdgeKinds(graph);
|
|
1329
1329
|
const nodeDigest = [];
|
|
1330
1330
|
for (const kind of nodeKinds) {
|
|
1331
1331
|
const rows = await enumerateAllNodes(backend, graphId, kind);
|
|
@@ -1375,7 +1375,7 @@ async function computeBaseVersion(store) {
|
|
|
1375
1375
|
computeSchemaComponent(store),
|
|
1376
1376
|
store.revisionOriginNow(),
|
|
1377
1377
|
store.revisionNow(),
|
|
1378
|
-
readActiveSchemaVersion(
|
|
1378
|
+
readActiveSchemaVersion(chunk32UETY6S_cjs.storeBackend(store), store.graphId)
|
|
1379
1379
|
]);
|
|
1380
1380
|
return asBaseVersion(
|
|
1381
1381
|
`${schemaComponent2}${SCHEMA_VERSION_TAG}${activeVersion}${TOKEN_SEPARATOR}${revisionComponent(origin, revision)}`
|
|
@@ -1390,9 +1390,9 @@ async function computeBaseVersion(store) {
|
|
|
1390
1390
|
);
|
|
1391
1391
|
}
|
|
1392
1392
|
async function computeStoreContentComponent(store) {
|
|
1393
|
-
const identityAssertions = await
|
|
1393
|
+
const identityAssertions = await chunk32UETY6S_cjs.storeRuntime(store).readCurrentIdentityAssertions("state");
|
|
1394
1394
|
return computeContentComponent(
|
|
1395
|
-
|
|
1395
|
+
chunk32UETY6S_cjs.storeBackend(store),
|
|
1396
1396
|
store.graphId,
|
|
1397
1397
|
store.graph,
|
|
1398
1398
|
identityAssertions
|
|
@@ -1434,7 +1434,7 @@ function cloneWorkingCopyStrategy(makeBackend) {
|
|
|
1434
1434
|
create: async (baseStore) => {
|
|
1435
1435
|
const backend = await makeBackend();
|
|
1436
1436
|
try {
|
|
1437
|
-
const [freshStore] = await
|
|
1437
|
+
const [freshStore] = await chunkC6KE2HSQ_cjs.createStoreWithSchema(
|
|
1438
1438
|
baseStore.graph,
|
|
1439
1439
|
backend,
|
|
1440
1440
|
{
|
|
@@ -1455,16 +1455,16 @@ function cloneWorkingCopyStrategy(makeBackend) {
|
|
|
1455
1455
|
validateReferences: true,
|
|
1456
1456
|
batchSize: CLONE_IMPORT_BATCH_SIZE
|
|
1457
1457
|
};
|
|
1458
|
-
const result =
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
) === void 0 ? await
|
|
1458
|
+
const result = chunkANKOXPCC_cjs.snapshotExportContention(
|
|
1459
|
+
chunk32UETY6S_cjs.storeBackend(baseStore),
|
|
1460
|
+
chunk32UETY6S_cjs.storeBackend(freshStore)
|
|
1461
|
+
) === void 0 ? await chunkHNYLMPQQ_cjs.importGraphStream(
|
|
1462
1462
|
freshStore,
|
|
1463
|
-
|
|
1463
|
+
chunkHNYLMPQQ_cjs.exportGraphStream(baseStore, exportOptions),
|
|
1464
1464
|
importOptions
|
|
1465
|
-
) : await
|
|
1465
|
+
) : await chunkHNYLMPQQ_cjs.importGraph(
|
|
1466
1466
|
freshStore,
|
|
1467
|
-
await
|
|
1467
|
+
await chunkHNYLMPQQ_cjs.exportGraph(baseStore, exportOptions),
|
|
1468
1468
|
importOptions
|
|
1469
1469
|
);
|
|
1470
1470
|
if (!result.success) {
|
|
@@ -1489,18 +1489,18 @@ function cloneWorkingCopyStrategy(makeBackend) {
|
|
|
1489
1489
|
async function branch(baseStore, makeBackend, options, strategy) {
|
|
1490
1490
|
try {
|
|
1491
1491
|
const base = await computeBaseVersion(baseStore);
|
|
1492
|
-
const id = options?.id ?? asBranchId(
|
|
1492
|
+
const id = options?.id ?? asBranchId(chunkA4R3H7RU_cjs.generateId());
|
|
1493
1493
|
const workingCopyStrategy = strategy ?? cloneWorkingCopyStrategy(makeBackend);
|
|
1494
1494
|
const store = await workingCopyStrategy.create(baseStore);
|
|
1495
1495
|
const schemaAnchor = await readSchemaAnchor(store);
|
|
1496
|
-
return
|
|
1496
|
+
return chunk6BD6ZBKT_cjs.ok({
|
|
1497
1497
|
id,
|
|
1498
1498
|
base,
|
|
1499
1499
|
store,
|
|
1500
1500
|
...schemaAnchor === void 0 ? { schemaAnchor: void 0 } : { schemaAnchor }
|
|
1501
1501
|
});
|
|
1502
1502
|
} catch (error) {
|
|
1503
|
-
return
|
|
1503
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
1504
1504
|
new BranchError("Failed to create working-copy branch of base store", {
|
|
1505
1505
|
cause: error
|
|
1506
1506
|
})
|
|
@@ -1509,11 +1509,11 @@ async function branch(baseStore, makeBackend, options, strategy) {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
async function readSchemaAnchor(store) {
|
|
1511
1511
|
try {
|
|
1512
|
-
const schemaRow = await
|
|
1512
|
+
const schemaRow = await chunk32UETY6S_cjs.storeBackend(store).getActiveSchema(store.graphId);
|
|
1513
1513
|
return schemaRow === void 0 ? void 0 : { version: schemaRow.version, hash: schemaRow.schema_hash };
|
|
1514
1514
|
} catch (error) {
|
|
1515
1515
|
try {
|
|
1516
|
-
await
|
|
1516
|
+
await chunk32UETY6S_cjs.storeBackend(store).close();
|
|
1517
1517
|
} catch {
|
|
1518
1518
|
}
|
|
1519
1519
|
throw error;
|
|
@@ -1536,7 +1536,7 @@ function constraintSignature(node, constraint) {
|
|
|
1536
1536
|
return void 0;
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
1539
|
-
return `${constraint.name}${KEY_PART_SEPARATOR}${
|
|
1539
|
+
return `${constraint.name}${KEY_PART_SEPARATOR}${chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1540
1540
|
props,
|
|
1541
1541
|
constraint.fields,
|
|
1542
1542
|
constraint.collation
|
|
@@ -1573,12 +1573,12 @@ function blockNodes(newNodes, resolveConfig, uniqueConstraints = []) {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
1575
|
const sortedKeys = [...buckets.keys()].sort(
|
|
1576
|
-
(left, right) =>
|
|
1576
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
1577
1577
|
);
|
|
1578
1578
|
const ordered = /* @__PURE__ */ new Map();
|
|
1579
1579
|
for (const key of sortedKeys) {
|
|
1580
1580
|
const members = [...chunkN66HCGCY_cjs.requireDefined(buckets.get(key))].sort(
|
|
1581
|
-
(left, right) =>
|
|
1581
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id)
|
|
1582
1582
|
);
|
|
1583
1583
|
ordered.set(key, members);
|
|
1584
1584
|
}
|
|
@@ -1595,7 +1595,7 @@ function buildBranchRank(branchOrder, allBranchIds) {
|
|
|
1595
1595
|
next += 1;
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
|
-
const remaining = allBranchIds.filter((branchId) => !rank.has(branchId)).sort((left, right) =>
|
|
1598
|
+
const remaining = allBranchIds.filter((branchId) => !rank.has(branchId)).sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
1599
1599
|
for (const branchId of remaining) {
|
|
1600
1600
|
if (!rank.has(branchId)) {
|
|
1601
1601
|
rank.set(branchId, next);
|
|
@@ -1667,8 +1667,8 @@ function collectConflictingValues(property, contributions) {
|
|
|
1667
1667
|
values.push({ branchId, value });
|
|
1668
1668
|
}
|
|
1669
1669
|
return [...values].sort((left, right) => {
|
|
1670
|
-
const byBranch =
|
|
1671
|
-
return byBranch === 0 ?
|
|
1670
|
+
const byBranch = chunkA4R3H7RU_cjs.compareStrings(left.branchId, right.branchId);
|
|
1671
|
+
return byBranch === 0 ? chunkA4R3H7RU_cjs.compareStrings(
|
|
1672
1672
|
canonicalValueKey(left.value),
|
|
1673
1673
|
canonicalValueKey(right.value)
|
|
1674
1674
|
) : byBranch;
|
|
@@ -1798,7 +1798,7 @@ function unionProperties(canonicalMember, members, context, baseContext, branchR
|
|
|
1798
1798
|
const props = chunkN66HCGCY_cjs.createDataKeyedBag();
|
|
1799
1799
|
const conflicts = [];
|
|
1800
1800
|
for (const property of [...propertyNames].sort(
|
|
1801
|
-
(left, right) =>
|
|
1801
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
1802
1802
|
)) {
|
|
1803
1803
|
const values = collectConflictingValues(property, members);
|
|
1804
1804
|
if (values.length === 0) {
|
|
@@ -1863,14 +1863,14 @@ function canonicalizeCluster(cluster, members, policy, branchRank, weights, cano
|
|
|
1863
1863
|
);
|
|
1864
1864
|
const memberIds = [
|
|
1865
1865
|
...new Set(cluster.members.map((member) => idOf(member)))
|
|
1866
|
-
].sort((left, right) =>
|
|
1866
|
+
].sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
1867
1867
|
const branchOrigins = [
|
|
1868
1868
|
...new Set(
|
|
1869
1869
|
members.map((member) => member.branchId).filter(
|
|
1870
1870
|
(branchId) => branchId !== BASE_PROVENANCE_BRANCH && branchId !== preferredBranchId
|
|
1871
1871
|
)
|
|
1872
1872
|
)
|
|
1873
|
-
].sort((left, right) =>
|
|
1873
|
+
].sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
1874
1874
|
const resolution = {
|
|
1875
1875
|
canonicalId,
|
|
1876
1876
|
memberIds,
|
|
@@ -1898,7 +1898,7 @@ var EQUIVALENCE_META_EDGES = /* @__PURE__ */ new Set([
|
|
|
1898
1898
|
chunkXUO3KQFO_cjs.META_EDGE_SAME_AS
|
|
1899
1899
|
]);
|
|
1900
1900
|
function buildSubClassClosure(ontology) {
|
|
1901
|
-
const unionFind = new UnionFind(
|
|
1901
|
+
const unionFind = new UnionFind(chunkA4R3H7RU_cjs.compareStrings);
|
|
1902
1902
|
for (const relation of ontology) {
|
|
1903
1903
|
unionFind.add(relation.from);
|
|
1904
1904
|
unionFind.add(relation.to);
|
|
@@ -1929,7 +1929,7 @@ function buildSubClassClosure(ontology) {
|
|
|
1929
1929
|
relations.push([child, parent]);
|
|
1930
1930
|
}
|
|
1931
1931
|
return {
|
|
1932
|
-
closure:
|
|
1932
|
+
closure: chunk6BD6ZBKT_cjs.computeTransitiveClosure(relations),
|
|
1933
1933
|
canonicalOf
|
|
1934
1934
|
};
|
|
1935
1935
|
}
|
|
@@ -1942,7 +1942,7 @@ function isReachable2(closure, from, to) {
|
|
|
1942
1942
|
if (fromRep === toRep) {
|
|
1943
1943
|
return from !== to;
|
|
1944
1944
|
}
|
|
1945
|
-
return
|
|
1945
|
+
return chunk6BD6ZBKT_cjs.isReachable(closure.closure, fromRep, toRep);
|
|
1946
1946
|
}
|
|
1947
1947
|
|
|
1948
1948
|
// src/graph-merge/similarity.ts
|
|
@@ -2125,37 +2125,37 @@ function scorePrepared(left, right, strategy, ctx) {
|
|
|
2125
2125
|
switch (strategy.kind) {
|
|
2126
2126
|
case "custom": {
|
|
2127
2127
|
const raw = strategy.score(left.node, right.node);
|
|
2128
|
-
return
|
|
2128
|
+
return chunk6BD6ZBKT_cjs.ok(clampScore(raw));
|
|
2129
2129
|
}
|
|
2130
2130
|
case "fulltext": {
|
|
2131
2131
|
if (left.text.length === 0 || right.text.length === 0) {
|
|
2132
|
-
return
|
|
2132
|
+
return chunk6BD6ZBKT_cjs.ok(NO_EVIDENCE_SCORE);
|
|
2133
2133
|
}
|
|
2134
|
-
return
|
|
2134
|
+
return chunk6BD6ZBKT_cjs.ok(clampScore(diceFromMultisets(left.grams, right.grams)));
|
|
2135
2135
|
}
|
|
2136
2136
|
case "vector": {
|
|
2137
2137
|
if (ctx.embeddings === void 0) {
|
|
2138
|
-
return
|
|
2138
|
+
return chunk6BD6ZBKT_cjs.err(embedderUnavailable("vector", ctx));
|
|
2139
2139
|
}
|
|
2140
2140
|
if (left.text.length === 0 || right.text.length === 0) {
|
|
2141
|
-
return
|
|
2141
|
+
return chunk6BD6ZBKT_cjs.ok(NO_EVIDENCE_SCORE);
|
|
2142
2142
|
}
|
|
2143
2143
|
const cosine = cosineFromLookup(ctx.embeddings, left.text, right.text);
|
|
2144
|
-
return
|
|
2144
|
+
return chunk6BD6ZBKT_cjs.ok(clampScore(cosine));
|
|
2145
2145
|
}
|
|
2146
2146
|
case "hybrid": {
|
|
2147
2147
|
if (ctx.embeddings === void 0) {
|
|
2148
|
-
return
|
|
2148
|
+
return chunk6BD6ZBKT_cjs.err(embedderUnavailable("hybrid", ctx));
|
|
2149
2149
|
}
|
|
2150
2150
|
if (left.text.length === 0 || right.text.length === 0) {
|
|
2151
|
-
return
|
|
2151
|
+
return chunk6BD6ZBKT_cjs.ok(NO_EVIDENCE_SCORE);
|
|
2152
2152
|
}
|
|
2153
2153
|
const vectorScore = clampScore(
|
|
2154
2154
|
cosineFromLookup(ctx.embeddings, left.text, right.text)
|
|
2155
2155
|
);
|
|
2156
2156
|
const fulltextScore = diceFromMultisets(left.grams, right.grams);
|
|
2157
2157
|
const weights = normalizeHybridWeights(strategy.weights);
|
|
2158
|
-
return
|
|
2158
|
+
return chunk6BD6ZBKT_cjs.ok(
|
|
2159
2159
|
clampScore(
|
|
2160
2160
|
weights.vector * vectorScore + weights.fulltext * fulltextScore
|
|
2161
2161
|
)
|
|
@@ -2213,7 +2213,7 @@ function scoreCandidates(input, resolveConfig, ctx, ceilingPolicy, maxComparison
|
|
|
2213
2213
|
}
|
|
2214
2214
|
if (maxComparisonsPerKind !== void 0 && fuzzy.length > maxComparisonsPerKind) {
|
|
2215
2215
|
if (ceilingPolicy === "error") {
|
|
2216
|
-
return
|
|
2216
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
2217
2217
|
new MergeError(
|
|
2218
2218
|
`Comparison ceiling exceeded: ${fuzzy.length} candidate pairs > maxComparisonsPerKind ${maxComparisonsPerKind}.`,
|
|
2219
2219
|
{
|
|
@@ -2226,7 +2226,7 @@ function scoreCandidates(input, resolveConfig, ctx, ceilingPolicy, maxComparison
|
|
|
2226
2226
|
)
|
|
2227
2227
|
);
|
|
2228
2228
|
}
|
|
2229
|
-
return
|
|
2229
|
+
return chunk6BD6ZBKT_cjs.ok({
|
|
2230
2230
|
edges: [...forced].sort(
|
|
2231
2231
|
(left, right) => compareCandidateEdges(left, right)
|
|
2232
2232
|
),
|
|
@@ -2244,14 +2244,14 @@ function scoreCandidates(input, resolveConfig, ctx, ceilingPolicy, maxComparison
|
|
|
2244
2244
|
const edges = [...forced];
|
|
2245
2245
|
for (const { left, right, a, b } of fuzzy) {
|
|
2246
2246
|
const scored = scorer(a, left, b, right);
|
|
2247
|
-
if (
|
|
2248
|
-
return
|
|
2247
|
+
if (chunk6BD6ZBKT_cjs.isErr(scored)) {
|
|
2248
|
+
return chunk6BD6ZBKT_cjs.err(scored.error);
|
|
2249
2249
|
}
|
|
2250
2250
|
if (scored.data >= threshold) {
|
|
2251
2251
|
edges.push({ a, b, score: scored.data });
|
|
2252
2252
|
}
|
|
2253
2253
|
}
|
|
2254
|
-
return
|
|
2254
|
+
return chunk6BD6ZBKT_cjs.ok({
|
|
2255
2255
|
edges: edges.sort((left, right) => compareCandidateEdges(left, right)),
|
|
2256
2256
|
warnings: []
|
|
2257
2257
|
});
|
|
@@ -2470,7 +2470,7 @@ function pickHighestPriorityBranch(branchIds, branchRank) {
|
|
|
2470
2470
|
let chosenRank = branchRank.get(chosen) ?? Number.MAX_SAFE_INTEGER;
|
|
2471
2471
|
for (const candidate of branchIds.slice(1)) {
|
|
2472
2472
|
const candidateRank = branchRank.get(candidate) ?? Number.MAX_SAFE_INTEGER;
|
|
2473
|
-
if (candidateRank < chosenRank || candidateRank === chosenRank &&
|
|
2473
|
+
if (candidateRank < chosenRank || candidateRank === chosenRank && chunkA4R3H7RU_cjs.compareStrings(candidate, chosen) < 0) {
|
|
2474
2474
|
chosen = candidate;
|
|
2475
2475
|
chosenRank = candidateRank;
|
|
2476
2476
|
}
|
|
@@ -2563,20 +2563,20 @@ function resolveDeleteModifyOver(modified, deleted, modifiedEntity, deletedEntit
|
|
|
2563
2563
|
}
|
|
2564
2564
|
return {
|
|
2565
2565
|
survivingModifications: [...survivingModifications].sort((left, right) => {
|
|
2566
|
-
const byId2 =
|
|
2566
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(
|
|
2567
2567
|
modifiedEntity(left).id,
|
|
2568
2568
|
modifiedEntity(right).id
|
|
2569
2569
|
);
|
|
2570
|
-
return byId2 === 0 ?
|
|
2570
|
+
return byId2 === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
2571
2571
|
}),
|
|
2572
2572
|
deletions: [...deletions].sort(
|
|
2573
|
-
(left, right) =>
|
|
2573
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id)
|
|
2574
2574
|
),
|
|
2575
2575
|
conflicts: [...conflicts].sort(
|
|
2576
|
-
(left, right) =>
|
|
2576
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.entityId, right.entityId)
|
|
2577
2577
|
),
|
|
2578
2578
|
dropped: [...dropped].sort(
|
|
2579
|
-
(left, right) =>
|
|
2579
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id)
|
|
2580
2580
|
)
|
|
2581
2581
|
};
|
|
2582
2582
|
}
|
|
@@ -2620,11 +2620,11 @@ function reconcileOver(survivingModifications, entityOf, rebuild, policy, branch
|
|
|
2620
2620
|
}
|
|
2621
2621
|
return {
|
|
2622
2622
|
survivingModifications: [...out].sort((left, right) => {
|
|
2623
|
-
const byId2 =
|
|
2624
|
-
return byId2 === 0 ?
|
|
2623
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(entityOf(left).id, entityOf(right).id);
|
|
2624
|
+
return byId2 === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
2625
2625
|
}),
|
|
2626
2626
|
conflicts: conflicts.sort(
|
|
2627
|
-
(left, right) =>
|
|
2627
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(
|
|
2628
2628
|
`${left.entityId}|${left.property}`,
|
|
2629
2629
|
`${right.entityId}|${right.property}`
|
|
2630
2630
|
)
|
|
@@ -2658,7 +2658,7 @@ function threeWayMergeProps(entityId, kind, baseProps, contributions, context, b
|
|
|
2658
2658
|
propertyNames.add(name);
|
|
2659
2659
|
}
|
|
2660
2660
|
}
|
|
2661
|
-
for (const property of [...propertyNames].sort(
|
|
2661
|
+
for (const property of [...propertyNames].sort(chunkA4R3H7RU_cjs.compareStrings)) {
|
|
2662
2662
|
const baseHas = chunkN66HCGCY_cjs.hasOwnKey(baseProps, property);
|
|
2663
2663
|
const baseKey = baseHas ? canonicalValueKey(chunkN66HCGCY_cjs.requireDefined(baseProps[property])) : void 0;
|
|
2664
2664
|
const changed = contributions.filter((contribution) => {
|
|
@@ -2757,7 +2757,7 @@ var WINDOW_NOT_APPLICABLE_DROP_REASON = "window-not-applicable";
|
|
|
2757
2757
|
function earliestEnd(claims) {
|
|
2758
2758
|
let earliest;
|
|
2759
2759
|
for (const claim of claims) {
|
|
2760
|
-
if (earliest === void 0 ||
|
|
2760
|
+
if (earliest === void 0 || chunkA4R3H7RU_cjs.compareStrings(claim.validTo, earliest) < 0) {
|
|
2761
2761
|
earliest = claim.validTo;
|
|
2762
2762
|
}
|
|
2763
2763
|
}
|
|
@@ -2771,7 +2771,7 @@ function resolveEndClaims(claims, preferredBranchId) {
|
|
|
2771
2771
|
}
|
|
2772
2772
|
function claimingBranches(claims) {
|
|
2773
2773
|
return [...new Set(claims.map((claim) => claim.branchId))].sort(
|
|
2774
|
-
(left, right) =>
|
|
2774
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
2775
2775
|
);
|
|
2776
2776
|
}
|
|
2777
2777
|
function classifyDelta(base, fork) {
|
|
@@ -2860,7 +2860,7 @@ function resolvePopulation(entity, deltas, deletions, preferredBranchId, dropIte
|
|
|
2860
2860
|
mergeKey(right.kind, right.id)
|
|
2861
2861
|
)
|
|
2862
2862
|
),
|
|
2863
|
-
dropped: dropped.sort((left, right) =>
|
|
2863
|
+
dropped: dropped.sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id))
|
|
2864
2864
|
};
|
|
2865
2865
|
}
|
|
2866
2866
|
function resolveValidWindows(staging, nodeDeletions, edgeDeletions, preferredBranchId) {
|
|
@@ -2949,7 +2949,7 @@ function rowsById(groupEdges) {
|
|
|
2949
2949
|
function sourcePairByRow(rows) {
|
|
2950
2950
|
const pairs = /* @__PURE__ */ new Map();
|
|
2951
2951
|
for (const [id, members] of rows) {
|
|
2952
|
-
const sorted = members.map((member) => member.sourcePair).sort((left, right) =>
|
|
2952
|
+
const sorted = members.map((member) => member.sourcePair).sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
2953
2953
|
pairs.set(id, chunkN66HCGCY_cjs.requireDefined(sorted[0]));
|
|
2954
2954
|
}
|
|
2955
2955
|
return pairs;
|
|
@@ -2960,14 +2960,14 @@ function foldSets(groupEdges) {
|
|
|
2960
2960
|
const representatives = /* @__PURE__ */ new Map();
|
|
2961
2961
|
for (const [id, pair] of sourcePairs) {
|
|
2962
2962
|
const representative = representatives.get(pair);
|
|
2963
|
-
if (representative === void 0 ||
|
|
2963
|
+
if (representative === void 0 || chunkA4R3H7RU_cjs.compareStrings(id, representative) < 0) {
|
|
2964
2964
|
representatives.set(pair, id);
|
|
2965
2965
|
}
|
|
2966
2966
|
}
|
|
2967
2967
|
const collapsed = [];
|
|
2968
2968
|
const parallel = [];
|
|
2969
2969
|
for (const id of [...rows.keys()].sort(
|
|
2970
|
-
(left, right) =>
|
|
2970
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
2971
2971
|
)) {
|
|
2972
2972
|
const members = chunkN66HCGCY_cjs.requireDefined(rows.get(id));
|
|
2973
2973
|
const pair = chunkN66HCGCY_cjs.requireDefined(sourcePairs.get(id));
|
|
@@ -2980,7 +2980,7 @@ function foldSets(groupEdges) {
|
|
|
2980
2980
|
return [collapsed, ...parallel];
|
|
2981
2981
|
}
|
|
2982
2982
|
function compareMembers(left, right, preferredBranchId) {
|
|
2983
|
-
const byId2 =
|
|
2983
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(left.staged.id, right.staged.id);
|
|
2984
2984
|
if (byId2 !== 0) {
|
|
2985
2985
|
return byId2;
|
|
2986
2986
|
}
|
|
@@ -2989,7 +2989,7 @@ function compareMembers(left, right, preferredBranchId) {
|
|
|
2989
2989
|
if (leftPreferred !== rightPreferred) {
|
|
2990
2990
|
return leftPreferred ? -1 : 1;
|
|
2991
2991
|
}
|
|
2992
|
-
return
|
|
2992
|
+
return chunkA4R3H7RU_cjs.compareStrings(left.staged.branchId, right.staged.branchId);
|
|
2993
2993
|
}
|
|
2994
2994
|
function pickSurvivor(edges, preferredBranchId) {
|
|
2995
2995
|
const inherited = edges.filter(
|
|
@@ -3015,8 +3015,8 @@ function authoredProperty(edge, property) {
|
|
|
3015
3015
|
}
|
|
3016
3016
|
function unauthoredValue(property, edges) {
|
|
3017
3017
|
const carriers = edges.filter((edge) => chunkN66HCGCY_cjs.hasOwnKey(edge.staged.props, property)).sort((left, right) => {
|
|
3018
|
-
const byId2 =
|
|
3019
|
-
return byId2 === 0 ?
|
|
3018
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(left.staged.id, right.staged.id);
|
|
3019
|
+
return byId2 === 0 ? chunkA4R3H7RU_cjs.compareStrings(
|
|
3020
3020
|
canonicalValueKey(left.staged.props[property]),
|
|
3021
3021
|
canonicalValueKey(right.staged.props[property])
|
|
3022
3022
|
) : byId2;
|
|
@@ -3033,7 +3033,7 @@ function unionEdgeProps(survivorId, kind, survivor, edges, context, branchRank,
|
|
|
3033
3033
|
const props = chunkN66HCGCY_cjs.createDataKeyedBag();
|
|
3034
3034
|
const conflicts = [];
|
|
3035
3035
|
for (const property of [...propertyNames].sort(
|
|
3036
|
-
(left, right) =>
|
|
3036
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
3037
3037
|
)) {
|
|
3038
3038
|
const claimants = edges.filter((edge) => authoredProperty(edge, property)).map((edge) => edge.staged);
|
|
3039
3039
|
const values = collectConflictingValues(property, claimants);
|
|
@@ -3066,7 +3066,7 @@ function unionEdgeProps(survivorId, kind, survivor, edges, context, branchRank,
|
|
|
3066
3066
|
function foldEdgeSet(foldSet, context, branchRank, preferredBranchId) {
|
|
3067
3067
|
const survivor = pickSurvivor(foldSet, preferredBranchId);
|
|
3068
3068
|
const survivorId = survivor.staged.id;
|
|
3069
|
-
const mergedIds = foldSet.map((edge) => edge.staged.id).sort((left, right) =>
|
|
3069
|
+
const mergedIds = foldSet.map((edge) => edge.staged.id).sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
3070
3070
|
const fromId = idOf(survivor.fromKey);
|
|
3071
3071
|
const fromKind = kindOf(survivor.fromKey);
|
|
3072
3072
|
const toId = idOf(survivor.toKey);
|
|
@@ -3162,7 +3162,7 @@ function repointEdges(stagedEdges, canonicalOf, deletedNodeIds, policy, branchRa
|
|
|
3162
3162
|
const merged = [];
|
|
3163
3163
|
const conflicts = [];
|
|
3164
3164
|
const sortedGroups = [...liveByGroup.keys()].sort(
|
|
3165
|
-
(left, right) =>
|
|
3165
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
3166
3166
|
);
|
|
3167
3167
|
for (const group of sortedGroups) {
|
|
3168
3168
|
const groupEdges = chunkN66HCGCY_cjs.requireDefined(liveByGroup.get(group));
|
|
@@ -3190,12 +3190,12 @@ function repointEdges(stagedEdges, canonicalOf, deletedNodeIds, policy, branchRa
|
|
|
3190
3190
|
),
|
|
3191
3191
|
edge.id
|
|
3192
3192
|
])
|
|
3193
|
-
})).sort((left, right) =>
|
|
3193
|
+
})).sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left.sortKey, right.sortKey)).map(({ edge }) => edge);
|
|
3194
3194
|
return {
|
|
3195
3195
|
edges: sortedEdges,
|
|
3196
|
-
dropped: dropped.sort((left, right) =>
|
|
3196
|
+
dropped: dropped.sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id)),
|
|
3197
3197
|
conflicts: conflicts.sort(
|
|
3198
|
-
(left, right) =>
|
|
3198
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(
|
|
3199
3199
|
`${left.entityId}|${left.property}`,
|
|
3200
3200
|
`${right.entityId}|${right.property}`
|
|
3201
3201
|
)
|
|
@@ -3326,7 +3326,7 @@ function normalizeMergeOptions(options = {}) {
|
|
|
3326
3326
|
}
|
|
3327
3327
|
var PROVENANCE_KIND = "Provenance";
|
|
3328
3328
|
var PROVENANCE_OWNER_KIND = "ProvenanceOwner";
|
|
3329
|
-
var Provenance =
|
|
3329
|
+
var Provenance = chunkTCT66A7N_cjs.defineNode(PROVENANCE_KIND, {
|
|
3330
3330
|
schema: zod.z.object({
|
|
3331
3331
|
targetGraphId: zod.z.string(),
|
|
3332
3332
|
role: zod.z.enum(["node", "edge"]),
|
|
@@ -3339,7 +3339,7 @@ var Provenance = chunkNK5Q7UNE_cjs.defineNode(PROVENANCE_KIND, {
|
|
|
3339
3339
|
var PROVENANCE_OWNER = "@nicia-ai/typegraph/merge-provenance";
|
|
3340
3340
|
var PROVENANCE_OWNER_VERSION = 1;
|
|
3341
3341
|
var PROVENANCE_OWNER_ID = "merge-provenance-owner";
|
|
3342
|
-
var ProvenanceOwner =
|
|
3342
|
+
var ProvenanceOwner = chunkTCT66A7N_cjs.defineNode(PROVENANCE_OWNER_KIND, {
|
|
3343
3343
|
schema: zod.z.object({
|
|
3344
3344
|
owner: zod.z.literal(PROVENANCE_OWNER),
|
|
3345
3345
|
version: zod.z.literal(PROVENANCE_OWNER_VERSION),
|
|
@@ -3350,7 +3350,7 @@ function provenanceGraphId(targetGraphId) {
|
|
|
3350
3350
|
return `${targetGraphId}::merge-provenance`;
|
|
3351
3351
|
}
|
|
3352
3352
|
function buildOwnedProvenanceGraph(targetGraphId) {
|
|
3353
|
-
return
|
|
3353
|
+
return chunkWA64ZSCA_cjs.defineInternalGraph({
|
|
3354
3354
|
id: provenanceGraphId(targetGraphId),
|
|
3355
3355
|
nodes: {
|
|
3356
3356
|
Provenance: { type: Provenance },
|
|
@@ -3360,14 +3360,14 @@ function buildOwnedProvenanceGraph(targetGraphId) {
|
|
|
3360
3360
|
});
|
|
3361
3361
|
}
|
|
3362
3362
|
function buildProvenanceGraph(targetGraphId) {
|
|
3363
|
-
return
|
|
3363
|
+
return chunkWA64ZSCA_cjs.defineInternalGraph({
|
|
3364
3364
|
id: provenanceGraphId(targetGraphId),
|
|
3365
3365
|
nodes: { Provenance: { type: Provenance } },
|
|
3366
3366
|
edges: {}
|
|
3367
3367
|
});
|
|
3368
3368
|
}
|
|
3369
3369
|
async function openProvenanceStore(...args) {
|
|
3370
|
-
const [backend, targetGraphId] = args.length === 1 ? [
|
|
3370
|
+
const [backend, targetGraphId] = args.length === 1 ? [chunk32UETY6S_cjs.storeBackend(args[0]), args[0].graphId] : args;
|
|
3371
3371
|
const graph = buildOwnedProvenanceGraph(targetGraphId);
|
|
3372
3372
|
const preflight = await inspectSidecarGraphId(backend, graph, targetGraphId);
|
|
3373
3373
|
if (preflight.state === "refuse") {
|
|
@@ -3379,7 +3379,7 @@ async function openProvenanceStore(...args) {
|
|
|
3379
3379
|
throw provenanceGraphIdCollision(graph.id, targetGraphId, claim.reason);
|
|
3380
3380
|
}
|
|
3381
3381
|
}
|
|
3382
|
-
const [store] = await
|
|
3382
|
+
const [store] = await chunkC6KE2HSQ_cjs.createStoreWithSchema(graph, backend);
|
|
3383
3383
|
return store;
|
|
3384
3384
|
}
|
|
3385
3385
|
async function claimSidecarOwnership(backend, graph, targetGraphId) {
|
|
@@ -3406,10 +3406,10 @@ async function claimSidecarOwnership(backend, graph, targetGraphId) {
|
|
|
3406
3406
|
}
|
|
3407
3407
|
async function drainUnfencedRowWriters(tx) {
|
|
3408
3408
|
if (tx.dialect !== "postgres") return;
|
|
3409
|
-
const schema =
|
|
3409
|
+
const schema = chunkQU7QLJA4_cjs.createSqlSchema(tx.tableNames);
|
|
3410
3410
|
await tx.executeStatement(
|
|
3411
|
-
|
|
3412
|
-
|
|
3411
|
+
chunk2ZWM2RFH_cjs.asCompiledStatementSql(
|
|
3412
|
+
chunk2ZWM2RFH_cjs.sql`LOCK TABLE ${schema.nodesTable}, ${schema.edgesTable} IN SHARE ROW EXCLUSIVE MODE`
|
|
3413
3413
|
)
|
|
3414
3414
|
);
|
|
3415
3415
|
}
|
|
@@ -3428,14 +3428,14 @@ async function inspectSidecarGraphId(port, graph, targetGraphId) {
|
|
|
3428
3428
|
if (activeSchema === void 0) {
|
|
3429
3429
|
return { state: "refuse", reason: "application-graph" };
|
|
3430
3430
|
}
|
|
3431
|
-
const ownedHash = await
|
|
3432
|
-
|
|
3431
|
+
const ownedHash = await chunkF36KZDFX_cjs.computeSchemaHash(
|
|
3432
|
+
chunkF36KZDFX_cjs.serializeSchema(graph, activeSchema.version)
|
|
3433
3433
|
);
|
|
3434
3434
|
if (activeSchema.schema_hash === ownedHash) {
|
|
3435
3435
|
return { state: "refuse", reason: "unowned-exact-schema-graph" };
|
|
3436
3436
|
}
|
|
3437
|
-
const legacyHash = await
|
|
3438
|
-
|
|
3437
|
+
const legacyHash = await chunkF36KZDFX_cjs.computeSchemaHash(
|
|
3438
|
+
chunkF36KZDFX_cjs.serializeSchema(buildProvenanceGraph(targetGraphId), activeSchema.version)
|
|
3439
3439
|
);
|
|
3440
3440
|
if (activeSchema.schema_hash !== legacyHash) {
|
|
3441
3441
|
return { state: "refuse", reason: "application-graph" };
|
|
@@ -3475,7 +3475,7 @@ var SIDECAR_REFUSALS = {
|
|
|
3475
3475
|
};
|
|
3476
3476
|
function provenanceGraphIdCollision(graphId, targetGraphId, reason) {
|
|
3477
3477
|
const refusal = SIDECAR_REFUSALS[reason];
|
|
3478
|
-
return new
|
|
3478
|
+
return new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
3479
3479
|
refusal.describe(graphId, targetGraphId),
|
|
3480
3480
|
{
|
|
3481
3481
|
code: "GRAPH_MERGE_PROVENANCE_ID_COLLISION",
|
|
@@ -3487,7 +3487,7 @@ function provenanceGraphIdCollision(graphId, targetGraphId, reason) {
|
|
|
3487
3487
|
);
|
|
3488
3488
|
}
|
|
3489
3489
|
function provenanceClaimUnfenced(graphId, targetGraphId) {
|
|
3490
|
-
return new
|
|
3490
|
+
return new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
3491
3491
|
`Claiming graph id "${graphId}" for merge provenance requires a transactional schema fence, which this backend does not provide.`,
|
|
3492
3492
|
{
|
|
3493
3493
|
code: "GRAPH_MERGE_PROVENANCE_CLAIM_UNFENCED",
|
|
@@ -3539,12 +3539,12 @@ async function* readRowsOfKind(port, graphId, kind) {
|
|
|
3539
3539
|
}
|
|
3540
3540
|
}
|
|
3541
3541
|
async function hasRowsUnderGraphId(port, graphId, scope) {
|
|
3542
|
-
const schema =
|
|
3543
|
-
const kindFilter = scope === "any" ?
|
|
3542
|
+
const schema = chunkQU7QLJA4_cjs.createSqlSchema(port.tableNames);
|
|
3543
|
+
const kindFilter = scope === "any" ? chunk2ZWM2RFH_cjs.sql.empty() : chunk2ZWM2RFH_cjs.sql` AND kind <> ${PROVENANCE_KIND}`;
|
|
3544
3544
|
if (await hasRowsInTable(port, schema.tables.nodes, graphId, kindFilter)) {
|
|
3545
3545
|
return true;
|
|
3546
3546
|
}
|
|
3547
|
-
if (await hasRowsInTable(port, schema.tables.edges, graphId,
|
|
3547
|
+
if (await hasRowsInTable(port, schema.tables.edges, graphId, chunk2ZWM2RFH_cjs.sql.empty())) {
|
|
3548
3548
|
return true;
|
|
3549
3549
|
}
|
|
3550
3550
|
for (const tableName of secondaryRowTableNames(schema.tables)) {
|
|
@@ -3570,8 +3570,8 @@ function secondaryRowTableNames(tables) {
|
|
|
3570
3570
|
}
|
|
3571
3571
|
async function hasRowsInTable(port, tableName, graphId, filter) {
|
|
3572
3572
|
const rows = await port.execute(
|
|
3573
|
-
|
|
3574
|
-
|
|
3573
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(
|
|
3574
|
+
chunk2ZWM2RFH_cjs.sql`SELECT 1 AS present FROM ${chunk2ZWM2RFH_cjs.sql.identifier(tableName)} WHERE graph_id = ${graphId}${filter} LIMIT 1`
|
|
3575
3575
|
)
|
|
3576
3576
|
);
|
|
3577
3577
|
return rows.length > 0;
|
|
@@ -3579,10 +3579,10 @@ async function hasRowsInTable(port, tableName, graphId, filter) {
|
|
|
3579
3579
|
async function hasRowsInSecondaryTable(port, tableName, graphId) {
|
|
3580
3580
|
const tableExists = port.tableExists;
|
|
3581
3581
|
if (tableExists !== void 0) {
|
|
3582
|
-
return await tableExists(tableName) && await hasRowsInTable(port, tableName, graphId,
|
|
3582
|
+
return await tableExists(tableName) && await hasRowsInTable(port, tableName, graphId, chunk2ZWM2RFH_cjs.sql.empty());
|
|
3583
3583
|
}
|
|
3584
3584
|
try {
|
|
3585
|
-
return await hasRowsInTable(port, tableName, graphId,
|
|
3585
|
+
return await hasRowsInTable(port, tableName, graphId, chunk2ZWM2RFH_cjs.sql.empty());
|
|
3586
3586
|
} catch {
|
|
3587
3587
|
return false;
|
|
3588
3588
|
}
|
|
@@ -3627,7 +3627,7 @@ function contributionKey(record) {
|
|
|
3627
3627
|
]);
|
|
3628
3628
|
}
|
|
3629
3629
|
function encodeProvenanceTuple(values) {
|
|
3630
|
-
return values.some((value) => value.includes(ID_SEPARATOR)) ?
|
|
3630
|
+
return values.some((value) => value.includes(ID_SEPARATOR)) ? chunkQPOQX2DI_cjs.encodeTupleKey(values) : values.join(ID_SEPARATOR);
|
|
3631
3631
|
}
|
|
3632
3632
|
async function provenanceNodeId(targetGraphId, record) {
|
|
3633
3633
|
const tuple = encodeProvenanceTuple([
|
|
@@ -3670,7 +3670,7 @@ async function readProvenance(store, query = {}) {
|
|
|
3670
3670
|
const all = await store.nodes.Provenance.find();
|
|
3671
3671
|
return all.filter(
|
|
3672
3672
|
(node) => (query.branchId === void 0 || node.branchId === query.branchId) && (query.canonicalId === void 0 || node.canonicalId === query.canonicalId) && (query.role === void 0 || node.role === query.role)
|
|
3673
|
-
).sort((left, right) =>
|
|
3673
|
+
).sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id));
|
|
3674
3674
|
}
|
|
3675
3675
|
|
|
3676
3676
|
// src/graph-merge/sources.ts
|
|
@@ -3680,10 +3680,10 @@ function orderEndpoints(left, right) {
|
|
|
3680
3680
|
return compareMergeKeys(leftKey, rightKey) <= 0 ? { a: leftKey, b: rightKey, left, right } : { a: rightKey, b: leftKey, left: right, right: left };
|
|
3681
3681
|
}
|
|
3682
3682
|
function sortMembersById(members) {
|
|
3683
|
-
return [...members].sort((left, right) =>
|
|
3683
|
+
return [...members].sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id));
|
|
3684
3684
|
}
|
|
3685
3685
|
function sortedBucketKeys(blocks) {
|
|
3686
|
-
return [...blocks.keys()].sort((left, right) =>
|
|
3686
|
+
return [...blocks.keys()].sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
3687
3687
|
}
|
|
3688
3688
|
var NODE_SYSTEM_FIELDS = /* @__PURE__ */ new Set(["id", "kind", "meta"]);
|
|
3689
3689
|
function nodeProps(node) {
|
|
@@ -3711,7 +3711,7 @@ function windowedPairs(members, config) {
|
|
|
3711
3711
|
key: fieldText(node, config.sortFields)
|
|
3712
3712
|
}));
|
|
3713
3713
|
keyed.sort(
|
|
3714
|
-
(left, right) => left.key === right.key ?
|
|
3714
|
+
(left, right) => left.key === right.key ? chunkA4R3H7RU_cjs.compareStrings(left.node.id, right.node.id) : chunkA4R3H7RU_cjs.compareStrings(left.key, right.key)
|
|
3715
3715
|
);
|
|
3716
3716
|
const pairs = [];
|
|
3717
3717
|
for (let index = 0; index < keyed.length; index += 1) {
|
|
@@ -3782,7 +3782,7 @@ function ontologyRetypeEdges(stagedIdentities, isRetypeCompatible) {
|
|
|
3782
3782
|
}
|
|
3783
3783
|
}
|
|
3784
3784
|
const edges = [];
|
|
3785
|
-
for (const id of [...identitiesById.keys()].sort(
|
|
3785
|
+
for (const id of [...identitiesById.keys()].sort(chunkA4R3H7RU_cjs.compareStrings)) {
|
|
3786
3786
|
const identities = [...new Set(identitiesById.get(id))].sort(
|
|
3787
3787
|
compareMergeKeys
|
|
3788
3788
|
);
|
|
@@ -3877,7 +3877,7 @@ var baseUniqueSource = {
|
|
|
3877
3877
|
const forcedEdges = [];
|
|
3878
3878
|
const baseMembers = /* @__PURE__ */ new Map();
|
|
3879
3879
|
const constraints = [...uniqueConstraints].sort(
|
|
3880
|
-
(left, right) =>
|
|
3880
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.name, right.name)
|
|
3881
3881
|
);
|
|
3882
3882
|
const items = nodes.map((node) => ({ props: nodeProps(node) }));
|
|
3883
3883
|
const matchesByConstraint = await Promise.all(
|
|
@@ -3920,7 +3920,7 @@ var baseUniqueSource = {
|
|
|
3920
3920
|
pairs: [],
|
|
3921
3921
|
forcedEdges,
|
|
3922
3922
|
baseMembers: [...baseMembers.values()].sort(
|
|
3923
|
-
(left, right) =>
|
|
3923
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id)
|
|
3924
3924
|
)
|
|
3925
3925
|
};
|
|
3926
3926
|
}
|
|
@@ -3977,7 +3977,7 @@ var baseKeySource = {
|
|
|
3977
3977
|
pairs,
|
|
3978
3978
|
forcedEdges: [],
|
|
3979
3979
|
baseMembers: [...baseMembers.values()].sort(
|
|
3980
|
-
(left, right) =>
|
|
3980
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id)
|
|
3981
3981
|
)
|
|
3982
3982
|
};
|
|
3983
3983
|
}
|
|
@@ -3989,16 +3989,16 @@ var CANDIDATE_SOURCES = [
|
|
|
3989
3989
|
|
|
3990
3990
|
// src/graph-merge/staging.ts
|
|
3991
3991
|
function compareByIdThenBranch(left, right) {
|
|
3992
|
-
const byId2 =
|
|
3993
|
-
return byId2 === 0 ?
|
|
3992
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(left.id, right.id);
|
|
3993
|
+
return byId2 === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
3994
3994
|
}
|
|
3995
3995
|
function compareByKindIdBranch(left, right) {
|
|
3996
|
-
const byKind =
|
|
3996
|
+
const byKind = chunkA4R3H7RU_cjs.compareStrings(left.kind, right.kind);
|
|
3997
3997
|
if (byKind !== 0) {
|
|
3998
3998
|
return byKind;
|
|
3999
3999
|
}
|
|
4000
|
-
const byId2 =
|
|
4001
|
-
return byId2 === 0 ?
|
|
4000
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(left.id, right.id);
|
|
4001
|
+
return byId2 === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
4002
4002
|
}
|
|
4003
4003
|
function groupByKind(items) {
|
|
4004
4004
|
const buckets = /* @__PURE__ */ new Map();
|
|
@@ -4012,7 +4012,7 @@ function groupByKind(items) {
|
|
|
4012
4012
|
}
|
|
4013
4013
|
const ordered = /* @__PURE__ */ new Map();
|
|
4014
4014
|
for (const kind of [...buckets.keys()].sort(
|
|
4015
|
-
(left, right) =>
|
|
4015
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
4016
4016
|
)) {
|
|
4017
4017
|
ordered.set(
|
|
4018
4018
|
kind,
|
|
@@ -4034,7 +4034,7 @@ async function stageBranches(baseStore, branches, captureTargetStateFor) {
|
|
|
4034
4034
|
const windowedEdges = [];
|
|
4035
4035
|
const newIdentityAssertions = [];
|
|
4036
4036
|
const retractedIdentityAssertions = [];
|
|
4037
|
-
const baseIdentityAssertions = await
|
|
4037
|
+
const baseIdentityAssertions = await chunk32UETY6S_cjs.storeRuntime(baseStore).readCurrentIdentityAssertions("state");
|
|
4038
4038
|
let targetNodeVersions = /* @__PURE__ */ new Map();
|
|
4039
4039
|
let targetEdgeSignatures = /* @__PURE__ */ new Map();
|
|
4040
4040
|
for (const branch2 of branches) {
|
|
@@ -4105,17 +4105,17 @@ async function stageBranches(baseStore, branches, captureTargetStateFor) {
|
|
|
4105
4105
|
(left, right) => compareByKindIdBranch(left, right)
|
|
4106
4106
|
),
|
|
4107
4107
|
newIdentityAssertions: newIdentityAssertions.toSorted((left, right) => {
|
|
4108
|
-
const byId2 =
|
|
4109
|
-
return byId2 === 0 ?
|
|
4108
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(left.assertion.id, right.assertion.id);
|
|
4109
|
+
return byId2 === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
4110
4110
|
}),
|
|
4111
4111
|
retractedIdentityAssertions: retractedIdentityAssertions.toSorted(
|
|
4112
4112
|
(left, right) => {
|
|
4113
|
-
const byId2 =
|
|
4114
|
-
return byId2 === 0 ?
|
|
4113
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(left.assertion.id, right.assertion.id);
|
|
4114
|
+
return byId2 === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
4115
4115
|
}
|
|
4116
4116
|
),
|
|
4117
4117
|
baseIdentityAssertions: baseIdentityAssertions.toSorted(
|
|
4118
|
-
(left, right) =>
|
|
4118
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id)
|
|
4119
4119
|
),
|
|
4120
4120
|
targetNodeVersions,
|
|
4121
4121
|
targetEdgeSignatures
|
|
@@ -4167,7 +4167,7 @@ async function withTxConflictRetry(commit) {
|
|
|
4167
4167
|
// src/graph-merge/type-reconcile.ts
|
|
4168
4168
|
var INCOMPATIBLE_TYPES_FLAG_REASON = "type-reconcile:incompatible-kinds";
|
|
4169
4169
|
function distinctKinds(kinds) {
|
|
4170
|
-
return [...new Set(kinds)].sort((left, right) =>
|
|
4170
|
+
return [...new Set(kinds)].sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
4171
4171
|
}
|
|
4172
4172
|
function areEquivalent(closure, left, right) {
|
|
4173
4173
|
return left !== right && isReachable2(closure, left, right) && isReachable2(closure, right, left);
|
|
@@ -4186,7 +4186,7 @@ function mostSpecificCommonKind(closure, kinds) {
|
|
|
4186
4186
|
return void 0;
|
|
4187
4187
|
}
|
|
4188
4188
|
return chunkN66HCGCY_cjs.requireDefined(
|
|
4189
|
-
[...qualifiers].sort((left, right) =>
|
|
4189
|
+
[...qualifiers].sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right))[0]
|
|
4190
4190
|
);
|
|
4191
4191
|
}
|
|
4192
4192
|
function reconcileTypes(clusters, closure, mode) {
|
|
@@ -4224,10 +4224,10 @@ function reconcileTypes(clusters, closure, mode) {
|
|
|
4224
4224
|
}
|
|
4225
4225
|
return {
|
|
4226
4226
|
reconciliations: reconciliations.sort(
|
|
4227
|
-
(left, right) =>
|
|
4227
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left.entityId, right.entityId)
|
|
4228
4228
|
),
|
|
4229
4229
|
retypeMap,
|
|
4230
|
-
dropped: dropped.sort((left, right) =>
|
|
4230
|
+
dropped: dropped.sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left.id, right.id))
|
|
4231
4231
|
};
|
|
4232
4232
|
}
|
|
4233
4233
|
|
|
@@ -4245,8 +4245,8 @@ function newNodesByKind(staging) {
|
|
|
4245
4245
|
ordered.set(
|
|
4246
4246
|
kind,
|
|
4247
4247
|
[...items].sort((left, right) => {
|
|
4248
|
-
const byId2 =
|
|
4249
|
-
return byId2 === 0 ?
|
|
4248
|
+
const byId2 = chunkA4R3H7RU_cjs.compareStrings(left.node.id, right.node.id);
|
|
4249
|
+
return byId2 === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
4250
4250
|
})
|
|
4251
4251
|
);
|
|
4252
4252
|
}
|
|
@@ -4280,7 +4280,7 @@ async function precomputeEmbeddings(byKind, resolve, embedder) {
|
|
|
4280
4280
|
}
|
|
4281
4281
|
async function embedSortedTexts(texts, embedder) {
|
|
4282
4282
|
const orderedTexts = [...texts].sort(
|
|
4283
|
-
(left, right) =>
|
|
4283
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
4284
4284
|
);
|
|
4285
4285
|
const vectors = await embedder(orderedTexts);
|
|
4286
4286
|
if (vectors.length !== orderedTexts.length) {
|
|
@@ -4330,7 +4330,7 @@ async function generateAllCandidates(target, staging, options, introspectionKind
|
|
|
4330
4330
|
async ([kind, items]) => {
|
|
4331
4331
|
const resolveConfig = options.resolve[kind];
|
|
4332
4332
|
if (resolveConfig === void 0) {
|
|
4333
|
-
return
|
|
4333
|
+
return chunk6BD6ZBKT_cjs.ok({ edges: [], warnings: [], baseMembers: [] });
|
|
4334
4334
|
}
|
|
4335
4335
|
const nodes = items.map((staged) => asNode(staged));
|
|
4336
4336
|
const uniqueConstraints = uniqueConstraintsFor(
|
|
@@ -4373,10 +4373,10 @@ async function generateAllCandidates(target, staging, options, introspectionKind
|
|
|
4373
4373
|
options.onComparisonCeiling,
|
|
4374
4374
|
options.maxComparisonsPerKind
|
|
4375
4375
|
);
|
|
4376
|
-
if (
|
|
4377
|
-
return
|
|
4376
|
+
if (chunk6BD6ZBKT_cjs.isErr(scored)) {
|
|
4377
|
+
return chunk6BD6ZBKT_cjs.err(scored.error);
|
|
4378
4378
|
}
|
|
4379
|
-
return
|
|
4379
|
+
return chunk6BD6ZBKT_cjs.ok({
|
|
4380
4380
|
edges: scored.data.edges,
|
|
4381
4381
|
warnings: scored.data.warnings.map(
|
|
4382
4382
|
(warning) => `[${kind}] ${warning.message}`
|
|
@@ -4387,14 +4387,14 @@ async function generateAllCandidates(target, staging, options, introspectionKind
|
|
|
4387
4387
|
)
|
|
4388
4388
|
);
|
|
4389
4389
|
for (const result of perKind) {
|
|
4390
|
-
if (
|
|
4391
|
-
return
|
|
4390
|
+
if (chunk6BD6ZBKT_cjs.isErr(result)) {
|
|
4391
|
+
return chunk6BD6ZBKT_cjs.err(result.error);
|
|
4392
4392
|
}
|
|
4393
4393
|
allEdges.push(...result.data.edges);
|
|
4394
4394
|
warnings.push(...result.data.warnings);
|
|
4395
4395
|
baseMembers.push(...result.data.baseMembers);
|
|
4396
4396
|
}
|
|
4397
|
-
return
|
|
4397
|
+
return chunk6BD6ZBKT_cjs.ok({
|
|
4398
4398
|
// The ONE shared `(a, b)` edge comparator (id-first `(kind, id)` order), so this
|
|
4399
4399
|
// stage emits edges in exactly the order clustering consumes them.
|
|
4400
4400
|
edges: allEdges.sort((left, right) => compareCandidateEdges(left, right)),
|
|
@@ -4532,9 +4532,9 @@ function buildProvenanceIndex(records) {
|
|
|
4532
4532
|
for (const [branchId, sets] of byBranch) {
|
|
4533
4533
|
frozen.set(branchId, {
|
|
4534
4534
|
nodeIds: [...sets.nodeIds].sort(
|
|
4535
|
-
(left, right) =>
|
|
4535
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)
|
|
4536
4536
|
),
|
|
4537
|
-
edgeIds: [...sets.edgeIds].sort((left, right) =>
|
|
4537
|
+
edgeIds: [...sets.edgeIds].sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right)).map((id) => id)
|
|
4538
4538
|
});
|
|
4539
4539
|
}
|
|
4540
4540
|
return {
|
|
@@ -4849,7 +4849,7 @@ function planMerge(staging, candidateEdges, candidateWarnings, baseMembers, opti
|
|
|
4849
4849
|
...identityRemap.dropped,
|
|
4850
4850
|
...validWindows.dropped
|
|
4851
4851
|
].sort(
|
|
4852
|
-
(left, right) =>
|
|
4852
|
+
(left, right) => chunkA4R3H7RU_cjs.compareStrings(`${left.kind}|${left.id}`, `${right.kind}|${right.id}`)
|
|
4853
4853
|
);
|
|
4854
4854
|
return {
|
|
4855
4855
|
canonicalEntities,
|
|
@@ -4886,7 +4886,7 @@ function planMerge(staging, candidateEdges, candidateWarnings, baseMembers, opti
|
|
|
4886
4886
|
mergeKey(left.kind, left.entityId),
|
|
4887
4887
|
mergeKey(right.kind, right.entityId)
|
|
4888
4888
|
);
|
|
4889
|
-
return byEntity === 0 ?
|
|
4889
|
+
return byEntity === 0 ? chunkA4R3H7RU_cjs.compareStrings(left.property, right.property) : byEntity;
|
|
4890
4890
|
}
|
|
4891
4891
|
),
|
|
4892
4892
|
deleteModifyConflicts: [
|
|
@@ -5064,7 +5064,7 @@ async function applyMergePlan(plan, nodesApi, edgesApi, target, txBackend) {
|
|
|
5064
5064
|
}
|
|
5065
5065
|
let appliedIdentity;
|
|
5066
5066
|
try {
|
|
5067
|
-
appliedIdentity = await
|
|
5067
|
+
appliedIdentity = await chunk32UETY6S_cjs.storeRuntime(target).applyIdentityMergeAtTarget(
|
|
5068
5068
|
txBackend,
|
|
5069
5069
|
plan.identityRetractions.map((retraction) => retraction.id),
|
|
5070
5070
|
plan.identityAssertions
|
|
@@ -5089,7 +5089,7 @@ async function applyMergePlan(plan, nodesApi, edgesApi, target, txBackend) {
|
|
|
5089
5089
|
};
|
|
5090
5090
|
}
|
|
5091
5091
|
async function commitPlan(target, plan, expectedBaseVersion) {
|
|
5092
|
-
if (!
|
|
5092
|
+
if (!chunk32UETY6S_cjs.storeBackend(target).capabilities.transactions) {
|
|
5093
5093
|
throw new MergeError(
|
|
5094
5094
|
"merge() requires a transaction-capable target backend. The merged plan (canonical upserts, soft-deletes, edge upserts) must commit atomically; a non-transactional fallback would leave a partially-merged graph on a mid-commit failure. (mergeIncremental() enforces the same requirement.)",
|
|
5095
5095
|
{ details: { capability: "transactions" } }
|
|
@@ -5099,18 +5099,18 @@ async function commitPlan(target, plan, expectedBaseVersion) {
|
|
|
5099
5099
|
() => target.transaction(async (tx) => {
|
|
5100
5100
|
if (expectedBaseVersion !== void 0) {
|
|
5101
5101
|
await assertTargetUnchanged(
|
|
5102
|
-
|
|
5102
|
+
chunk32UETY6S_cjs.transactionBackend(tx),
|
|
5103
5103
|
target,
|
|
5104
5104
|
expectedBaseVersion
|
|
5105
5105
|
);
|
|
5106
5106
|
}
|
|
5107
|
-
await assertPlannedIdentityIdsFresh(target,
|
|
5107
|
+
await assertPlannedIdentityIdsFresh(target, chunk32UETY6S_cjs.transactionBackend(tx), plan);
|
|
5108
5108
|
return applyMergePlan(
|
|
5109
5109
|
plan,
|
|
5110
5110
|
tx.nodes,
|
|
5111
5111
|
tx.edges,
|
|
5112
5112
|
target,
|
|
5113
|
-
|
|
5113
|
+
chunk32UETY6S_cjs.transactionBackend(tx)
|
|
5114
5114
|
);
|
|
5115
5115
|
}, mergeCommitTransactionOptions(target))
|
|
5116
5116
|
);
|
|
@@ -5123,9 +5123,9 @@ function mergeCommitTransactionOptions(target) {
|
|
|
5123
5123
|
}
|
|
5124
5124
|
async function assertTargetUnchanged(txBackend, target, expectedBaseVersion) {
|
|
5125
5125
|
if (hasRevisionAnchor(expectedBaseVersion)) {
|
|
5126
|
-
await
|
|
5126
|
+
await chunkA4R3H7RU_cjs.lockRecordedGraphWrite(txBackend, target.graphId);
|
|
5127
5127
|
const expectedOrigin = revisionOriginOf(expectedBaseVersion);
|
|
5128
|
-
const liveOrigin = await
|
|
5128
|
+
const liveOrigin = await chunkA4R3H7RU_cjs.readRevisionOrigin(
|
|
5129
5129
|
txBackend,
|
|
5130
5130
|
target.revisionSchema,
|
|
5131
5131
|
target.graphId
|
|
@@ -5139,7 +5139,7 @@ async function assertTargetUnchanged(txBackend, target, expectedBaseVersion) {
|
|
|
5139
5139
|
}
|
|
5140
5140
|
);
|
|
5141
5141
|
}
|
|
5142
|
-
const liveRevision = await
|
|
5142
|
+
const liveRevision = await chunkA4R3H7RU_cjs.readRecordedClock(
|
|
5143
5143
|
txBackend,
|
|
5144
5144
|
target.revisionSchema,
|
|
5145
5145
|
target.graphId
|
|
@@ -5160,7 +5160,7 @@ async function assertTargetUnchanged(txBackend, target, expectedBaseVersion) {
|
|
|
5160
5160
|
txBackend,
|
|
5161
5161
|
target.graphId,
|
|
5162
5162
|
target.graph,
|
|
5163
|
-
await
|
|
5163
|
+
await chunk32UETY6S_cjs.storeRuntime(target).identityAssertionsAtTarget(txBackend, "state")
|
|
5164
5164
|
);
|
|
5165
5165
|
const expectedContent = contentComponentOf(expectedBaseVersion);
|
|
5166
5166
|
if (liveContent !== expectedContent) {
|
|
@@ -5198,7 +5198,7 @@ async function validateBaseVersions(target, branches) {
|
|
|
5198
5198
|
const targetVersion = await computeBaseVersion(target);
|
|
5199
5199
|
for (const branch2 of branches) {
|
|
5200
5200
|
if (branch2.base !== targetVersion) {
|
|
5201
|
-
return
|
|
5201
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5202
5202
|
new BaseVersionMismatchError(
|
|
5203
5203
|
`Branch "${branch2.id}" forked from base@V "${branch2.base}", which does not match the merge target's current base@V "${targetVersion}".`,
|
|
5204
5204
|
{
|
|
@@ -5212,14 +5212,14 @@ async function validateBaseVersions(target, branches) {
|
|
|
5212
5212
|
);
|
|
5213
5213
|
}
|
|
5214
5214
|
}
|
|
5215
|
-
return
|
|
5215
|
+
return chunk6BD6ZBKT_cjs.ok(targetVersion);
|
|
5216
5216
|
}
|
|
5217
5217
|
function tryNormalize(optionsInput, refusedOptions = []) {
|
|
5218
5218
|
const refusedOption = refusedOptions.find(
|
|
5219
5219
|
(option) => chunkN66HCGCY_cjs.hasOwnKey(optionsInput, option)
|
|
5220
5220
|
);
|
|
5221
5221
|
if (refusedOption !== void 0) {
|
|
5222
|
-
return
|
|
5222
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5223
5223
|
new InvalidMergeOptionsError(
|
|
5224
5224
|
`This merge operation does not accept options.${refusedOption}.`,
|
|
5225
5225
|
{ details: { option: refusedOption } }
|
|
@@ -5227,18 +5227,18 @@ function tryNormalize(optionsInput, refusedOptions = []) {
|
|
|
5227
5227
|
);
|
|
5228
5228
|
}
|
|
5229
5229
|
try {
|
|
5230
|
-
return
|
|
5230
|
+
return chunk6BD6ZBKT_cjs.ok(normalizeMergeOptions(optionsInput));
|
|
5231
5231
|
} catch (error) {
|
|
5232
|
-
return
|
|
5232
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5233
5233
|
new InvalidMergeOptionsError("Invalid merge options.", { cause: error })
|
|
5234
5234
|
);
|
|
5235
5235
|
}
|
|
5236
5236
|
}
|
|
5237
5237
|
async function tryOpenProvenanceStore(target) {
|
|
5238
5238
|
try {
|
|
5239
|
-
return
|
|
5239
|
+
return chunk6BD6ZBKT_cjs.ok(await openProvenanceStore(target));
|
|
5240
5240
|
} catch (error) {
|
|
5241
|
-
const code = error instanceof
|
|
5241
|
+
const code = error instanceof chunkKCH7WQA5_cjs.TypeGraphError ? error.details?.code : void 0;
|
|
5242
5242
|
const details = {
|
|
5243
5243
|
option: "persistProvenance",
|
|
5244
5244
|
graphId: provenanceGraphId(target.graphId),
|
|
@@ -5246,7 +5246,7 @@ async function tryOpenProvenanceStore(target) {
|
|
|
5246
5246
|
...typeof code === "string" ? { provenanceErrorCode: code } : {}
|
|
5247
5247
|
};
|
|
5248
5248
|
const message = `options.persistProvenance was requested but the merge-provenance sidecar cannot be opened: ${describeCause(error)}`;
|
|
5249
|
-
return
|
|
5249
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5250
5250
|
code === "GRAPH_MERGE_PROVENANCE_ID_COLLISION" || code === "GRAPH_MERGE_PROVENANCE_CLAIM_UNFENCED" ? new InvalidMergeOptionsError(message, { details, cause: error }) : new MergeError(message, { details, cause: error })
|
|
5251
5251
|
);
|
|
5252
5252
|
}
|
|
@@ -5255,7 +5255,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5255
5255
|
let targetBranchSeen = false;
|
|
5256
5256
|
for (const branch2 of branches) {
|
|
5257
5257
|
if (branch2.id === BASE_PROVENANCE_BRANCH) {
|
|
5258
|
-
return
|
|
5258
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5259
5259
|
new MergeError(
|
|
5260
5260
|
`Branch id "${BASE_PROVENANCE_BRANCH}" is reserved for committed-base provenance and cannot be used as a branch id.`,
|
|
5261
5261
|
{ details: { branchId: branch2.id } }
|
|
@@ -5264,7 +5264,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5264
5264
|
}
|
|
5265
5265
|
if (branch2.id === COMMITTED_TARGET_BRANCH) {
|
|
5266
5266
|
if (incremental?.targetBranchId !== COMMITTED_TARGET_BRANCH || targetBranchSeen) {
|
|
5267
|
-
return
|
|
5267
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5268
5268
|
new MergeError(
|
|
5269
5269
|
`Branch id "${COMMITTED_TARGET_BRANCH}" is reserved for the committed incremental target and cannot be used as a branch id.`,
|
|
5270
5270
|
{ details: { branchId: branch2.id } }
|
|
@@ -5275,7 +5275,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5275
5275
|
}
|
|
5276
5276
|
}
|
|
5277
5277
|
for (const branch2 of branches) {
|
|
5278
|
-
const branchSchemaRow = await
|
|
5278
|
+
const branchSchemaRow = await chunk32UETY6S_cjs.storeBackend(branch2.store).getActiveSchema(
|
|
5279
5279
|
branch2.store.graphId
|
|
5280
5280
|
);
|
|
5281
5281
|
let drifted;
|
|
@@ -5283,13 +5283,13 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5283
5283
|
const anchor = branch2.schemaAnchor;
|
|
5284
5284
|
drifted = anchor === void 0 ? branchSchemaRow !== void 0 : branchSchemaRow?.version !== anchor.version || branchSchemaRow.schema_hash !== anchor.hash;
|
|
5285
5285
|
} else {
|
|
5286
|
-
const sourceSchemaRow = await
|
|
5286
|
+
const sourceSchemaRow = await chunk32UETY6S_cjs.storeBackend(store).getActiveSchema(
|
|
5287
5287
|
store.graphId
|
|
5288
5288
|
);
|
|
5289
5289
|
drifted = branchSchemaRow?.schema_hash !== sourceSchemaRow?.schema_hash;
|
|
5290
5290
|
}
|
|
5291
5291
|
if (drifted) {
|
|
5292
|
-
return
|
|
5292
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5293
5293
|
new BaseVersionMismatchError(
|
|
5294
5294
|
`Branch "${branch2.id}"'s store has a committed schema different from its at-fork state \u2014 a schema operation ran on the branch after forking. Merge carries data changes only; apply the schema change to the target first (or re-fork), then merge.`,
|
|
5295
5295
|
{
|
|
@@ -5305,7 +5305,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5305
5305
|
}
|
|
5306
5306
|
}
|
|
5307
5307
|
const provenanceStore = options.persistProvenance ? await tryOpenProvenanceStore(target) : void 0;
|
|
5308
|
-
if (provenanceStore !== void 0 &&
|
|
5308
|
+
if (provenanceStore !== void 0 && chunk6BD6ZBKT_cjs.isErr(provenanceStore)) {
|
|
5309
5309
|
return provenanceStore;
|
|
5310
5310
|
}
|
|
5311
5311
|
try {
|
|
@@ -5332,7 +5332,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5332
5332
|
options.embedder
|
|
5333
5333
|
);
|
|
5334
5334
|
const ctx = {
|
|
5335
|
-
backend:
|
|
5335
|
+
backend: chunk32UETY6S_cjs.storeBackend(store),
|
|
5336
5336
|
...embeddings === void 0 ? {} : { embeddings }
|
|
5337
5337
|
};
|
|
5338
5338
|
const candidates = await generateAllCandidates(
|
|
@@ -5344,8 +5344,8 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5344
5344
|
useBaseSources,
|
|
5345
5345
|
options.embedder
|
|
5346
5346
|
);
|
|
5347
|
-
if (
|
|
5348
|
-
return
|
|
5347
|
+
if (chunk6BD6ZBKT_cjs.isErr(candidates)) {
|
|
5348
|
+
return chunk6BD6ZBKT_cjs.err(candidates.error);
|
|
5349
5349
|
}
|
|
5350
5350
|
const identityProbeIds = target.graph.identity === void 0 ? void 0 : [
|
|
5351
5351
|
.../* @__PURE__ */ new Set([
|
|
@@ -5360,7 +5360,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5360
5360
|
])
|
|
5361
5361
|
])
|
|
5362
5362
|
];
|
|
5363
|
-
const targetPeers = identityProbeIds === void 0 ? [] : await
|
|
5363
|
+
const targetPeers = identityProbeIds === void 0 ? [] : await chunk32UETY6S_cjs.storeRuntime(target).liveNodesSharingIds(identityProbeIds);
|
|
5364
5364
|
const stagedIdentityIds = [
|
|
5365
5365
|
.../* @__PURE__ */ new Set([
|
|
5366
5366
|
...staging.newIdentityAssertions.map((staged) => staged.assertion.id),
|
|
@@ -5369,7 +5369,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5369
5369
|
)
|
|
5370
5370
|
])
|
|
5371
5371
|
];
|
|
5372
|
-
const storedIdentityRowsById = stagedIdentityIds.length === 0 || target.graph.identity === void 0 ? NO_STORED_ASSERTIONS : await
|
|
5372
|
+
const storedIdentityRowsById = stagedIdentityIds.length === 0 || target.graph.identity === void 0 ? NO_STORED_ASSERTIONS : await chunk32UETY6S_cjs.storeRuntime(target).identityAssertionRowsByIds(
|
|
5373
5373
|
stagedIdentityIds
|
|
5374
5374
|
);
|
|
5375
5375
|
const identityContext = {
|
|
@@ -5392,14 +5392,14 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5392
5392
|
if (plan.identityAssertions.length > 0) {
|
|
5393
5393
|
assertOneIdOneTruth(
|
|
5394
5394
|
plan.identityAssertions,
|
|
5395
|
-
await
|
|
5395
|
+
await chunk32UETY6S_cjs.storeRuntime(target).identityAssertionRowsByIds(
|
|
5396
5396
|
plan.identityAssertions.map((assertion) => assertion.id)
|
|
5397
5397
|
)
|
|
5398
5398
|
);
|
|
5399
5399
|
}
|
|
5400
5400
|
let identityGuard;
|
|
5401
5401
|
if (identityProbeIds !== void 0 && incremental !== void 0) {
|
|
5402
|
-
const freshPeers = await
|
|
5402
|
+
const freshPeers = await chunk32UETY6S_cjs.storeRuntime(target).liveNodesSharingIds(identityProbeIds);
|
|
5403
5403
|
const built = await buildIdentityPeerProbe(
|
|
5404
5404
|
target,
|
|
5405
5405
|
identityProbeIds,
|
|
@@ -5452,7 +5452,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5452
5452
|
const provenance = options.provenance ? buildProvenanceIndex(plan.provenanceRecords) : { byBranch: () => ({ nodeIds: [], edgeIds: [] }) };
|
|
5453
5453
|
const warnings = [...plan.warnings];
|
|
5454
5454
|
let provenancePersisted;
|
|
5455
|
-
if (provenanceStore !== void 0 && !
|
|
5455
|
+
if (provenanceStore !== void 0 && !chunk6BD6ZBKT_cjs.isErr(provenanceStore)) {
|
|
5456
5456
|
try {
|
|
5457
5457
|
const count = await persistProvenanceRecords(
|
|
5458
5458
|
provenanceStore.data,
|
|
@@ -5482,12 +5482,12 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5482
5482
|
warnings,
|
|
5483
5483
|
...provenancePersisted === void 0 ? {} : { provenancePersisted }
|
|
5484
5484
|
};
|
|
5485
|
-
return
|
|
5485
|
+
return chunk6BD6ZBKT_cjs.ok(report);
|
|
5486
5486
|
} catch (error) {
|
|
5487
5487
|
if (error instanceof MergeError) {
|
|
5488
|
-
return
|
|
5488
|
+
return chunk6BD6ZBKT_cjs.err(error);
|
|
5489
5489
|
}
|
|
5490
|
-
return
|
|
5490
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5491
5491
|
new MergeError(
|
|
5492
5492
|
`Merge failed while staging or committing: ${describeCause(error)}`,
|
|
5493
5493
|
{ cause: error }
|
|
@@ -5497,14 +5497,14 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
5497
5497
|
}
|
|
5498
5498
|
async function merge(store, branches, optionsInput = {}) {
|
|
5499
5499
|
const normalized = tryNormalize(optionsInput);
|
|
5500
|
-
if (
|
|
5501
|
-
return
|
|
5500
|
+
if (chunk6BD6ZBKT_cjs.isErr(normalized)) {
|
|
5501
|
+
return chunk6BD6ZBKT_cjs.err(normalized.error);
|
|
5502
5502
|
}
|
|
5503
5503
|
const options = normalized.data;
|
|
5504
5504
|
const target = options.target ?? store;
|
|
5505
5505
|
const precondition = await validateBaseVersions(target, branches);
|
|
5506
|
-
if (
|
|
5507
|
-
return
|
|
5506
|
+
if (chunk6BD6ZBKT_cjs.isErr(precondition)) {
|
|
5507
|
+
return chunk6BD6ZBKT_cjs.err(precondition.error);
|
|
5508
5508
|
}
|
|
5509
5509
|
return resolveMerge(
|
|
5510
5510
|
store,
|
|
@@ -5520,7 +5520,7 @@ async function validateForkPointVersions(forkPoint, branches) {
|
|
|
5520
5520
|
const forkVersion = await computeBaseVersion(forkPoint);
|
|
5521
5521
|
for (const branch2 of branches) {
|
|
5522
5522
|
if (branch2.base !== forkVersion) {
|
|
5523
|
-
return
|
|
5523
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5524
5524
|
new BaseVersionMismatchError(
|
|
5525
5525
|
`Branch "${branch2.id}" forked from base@V "${branch2.base}", which does not match the fork-point's base@V "${forkVersion}". mergeIncremental() requires every branch to have forked from the supplied forkPoint.`,
|
|
5526
5526
|
{
|
|
@@ -5534,7 +5534,7 @@ async function validateForkPointVersions(forkPoint, branches) {
|
|
|
5534
5534
|
);
|
|
5535
5535
|
}
|
|
5536
5536
|
}
|
|
5537
|
-
return
|
|
5537
|
+
return chunk6BD6ZBKT_cjs.ok(forkVersion);
|
|
5538
5538
|
}
|
|
5539
5539
|
function nodeSchemaFor(target, kind) {
|
|
5540
5540
|
const registry = target.graph.nodes;
|
|
@@ -5689,7 +5689,7 @@ async function validateIncrementalEdgeWrites(target, edgesApi, plan) {
|
|
|
5689
5689
|
}
|
|
5690
5690
|
}
|
|
5691
5691
|
}
|
|
5692
|
-
const notFound = [...plannedKindById.keys()].filter((id) => !existingById.has(id)).sort((left, right) =>
|
|
5692
|
+
const notFound = [...plannedKindById.keys()].filter((id) => !existingById.has(id)).sort((left, right) => chunkA4R3H7RU_cjs.compareStrings(left, right));
|
|
5693
5693
|
if (notFound.length > 0) {
|
|
5694
5694
|
const crossKindById = /* @__PURE__ */ new Map();
|
|
5695
5695
|
for (const kind of Object.keys(target.graph.edges)) {
|
|
@@ -5926,7 +5926,7 @@ async function assertForkPointUnchanged(precondition) {
|
|
|
5926
5926
|
);
|
|
5927
5927
|
}
|
|
5928
5928
|
async function commitIncrementalPlan(target, plan, guard) {
|
|
5929
|
-
if (!
|
|
5929
|
+
if (!chunk32UETY6S_cjs.storeBackend(target).capabilities.transactions) {
|
|
5930
5930
|
throw new MergeError(
|
|
5931
5931
|
"mergeIncremental() requires a transaction-capable target backend. Incremental writes must preflight existing rows and commit atomically; non-transactional fallback would allow partial graph writes.",
|
|
5932
5932
|
{ details: { capability: "transactions" } }
|
|
@@ -5935,16 +5935,16 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
5935
5935
|
return withTxConflictRetry(
|
|
5936
5936
|
() => target.transaction(async (tx) => {
|
|
5937
5937
|
if (target.revisionTrackingEnabled) {
|
|
5938
|
-
await
|
|
5938
|
+
await chunkA4R3H7RU_cjs.lockRecordedGraphWrite(chunk32UETY6S_cjs.transactionBackend(tx), target.graphId);
|
|
5939
5939
|
}
|
|
5940
5940
|
await assertForkPointUnchanged(guard.forkPoint);
|
|
5941
5941
|
const nodesApi = tx.nodes;
|
|
5942
5942
|
const edgesApi = tx.edges;
|
|
5943
5943
|
await assertBaseResolutionStable(tx, guard);
|
|
5944
|
-
await assertPlannedIdentityIdsFresh(target,
|
|
5944
|
+
await assertPlannedIdentityIdsFresh(target, chunk32UETY6S_cjs.transactionBackend(tx), plan);
|
|
5945
5945
|
await assertIdentityPeersStable(
|
|
5946
5946
|
target,
|
|
5947
|
-
|
|
5947
|
+
chunk32UETY6S_cjs.transactionBackend(tx),
|
|
5948
5948
|
guard.identityPeerProbe,
|
|
5949
5949
|
plan
|
|
5950
5950
|
);
|
|
@@ -5956,7 +5956,7 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
5956
5956
|
nodesApi,
|
|
5957
5957
|
edgesApi,
|
|
5958
5958
|
target,
|
|
5959
|
-
|
|
5959
|
+
chunk32UETY6S_cjs.transactionBackend(tx)
|
|
5960
5960
|
);
|
|
5961
5961
|
}, mergeCommitTransactionOptions(target))
|
|
5962
5962
|
);
|
|
@@ -5964,12 +5964,12 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
5964
5964
|
async function mergeIncremental(args) {
|
|
5965
5965
|
const { forkPoint, target, branches } = args;
|
|
5966
5966
|
const normalized = tryNormalize(args.options ?? {}, ["target"]);
|
|
5967
|
-
if (
|
|
5968
|
-
return
|
|
5967
|
+
if (chunk6BD6ZBKT_cjs.isErr(normalized)) {
|
|
5968
|
+
return chunk6BD6ZBKT_cjs.err(normalized.error);
|
|
5969
5969
|
}
|
|
5970
5970
|
const options = normalized.data;
|
|
5971
5971
|
if (options.onBasePropertyConflict !== "flag") {
|
|
5972
|
-
return
|
|
5972
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5973
5973
|
new InvalidMergeOptionsError(
|
|
5974
5974
|
'mergeIncremental() requires onBasePropertyConflict: "flag" (keep-base); a non-keep-base policy could overwrite a newer committed base value with a stale branch value.',
|
|
5975
5975
|
{
|
|
@@ -5983,8 +5983,8 @@ async function mergeIncremental(args) {
|
|
|
5983
5983
|
);
|
|
5984
5984
|
}
|
|
5985
5985
|
const forkPrecondition = await validateForkPointVersions(forkPoint, branches);
|
|
5986
|
-
if (
|
|
5987
|
-
return
|
|
5986
|
+
if (chunk6BD6ZBKT_cjs.isErr(forkPrecondition)) {
|
|
5987
|
+
return chunk6BD6ZBKT_cjs.err(forkPrecondition.error);
|
|
5988
5988
|
}
|
|
5989
5989
|
const forkVersion = forkPrecondition.data;
|
|
5990
5990
|
const [forkSchema, targetSchema] = await Promise.all([
|
|
@@ -5992,7 +5992,7 @@ async function mergeIncremental(args) {
|
|
|
5992
5992
|
computeSchemaComponent(target)
|
|
5993
5993
|
]);
|
|
5994
5994
|
if (forkSchema !== targetSchema) {
|
|
5995
|
-
return
|
|
5995
|
+
return chunk6BD6ZBKT_cjs.err(
|
|
5996
5996
|
new MergeError(
|
|
5997
5997
|
"mergeIncremental() requires target and forkPoint to share a schema; schema drift is not supported (the target content may differ \u2014 only the schema must match).",
|
|
5998
5998
|
{ details: {} }
|
|
@@ -6022,15 +6022,15 @@ async function mergeIncremental(args) {
|
|
|
6022
6022
|
|
|
6023
6023
|
Object.defineProperty(exports, "isErr", {
|
|
6024
6024
|
enumerable: true,
|
|
6025
|
-
get: function () { return
|
|
6025
|
+
get: function () { return chunk6BD6ZBKT_cjs.isErr; }
|
|
6026
6026
|
});
|
|
6027
6027
|
Object.defineProperty(exports, "isOk", {
|
|
6028
6028
|
enumerable: true,
|
|
6029
|
-
get: function () { return
|
|
6029
|
+
get: function () { return chunk6BD6ZBKT_cjs.isOk; }
|
|
6030
6030
|
});
|
|
6031
6031
|
Object.defineProperty(exports, "unwrap", {
|
|
6032
6032
|
enumerable: true,
|
|
6033
|
-
get: function () { return
|
|
6033
|
+
get: function () { return chunk6BD6ZBKT_cjs.unwrap; }
|
|
6034
6034
|
});
|
|
6035
6035
|
exports.BaseVersionMismatchError = BaseVersionMismatchError;
|
|
6036
6036
|
exports.BranchError = BranchError;
|