@nicia-ai/typegraph 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/postgres/index.cjs +29 -29
- package/dist/backend/postgres/index.d.cts +39 -7
- package/dist/backend/postgres/index.d.ts +39 -7
- package/dist/backend/postgres/index.js +16 -16
- package/dist/backend/postgres/pglite.cjs +21 -21
- package/dist/backend/postgres/pglite.d.cts +4 -4
- package/dist/backend/postgres/pglite.d.ts +4 -4
- package/dist/backend/postgres/pglite.js +16 -16
- package/dist/backend/sqlite/index.cjs +25 -26
- package/dist/backend/sqlite/index.d.cts +8 -8
- package/dist/backend/sqlite/index.d.ts +8 -8
- package/dist/backend/sqlite/index.js +13 -14
- package/dist/backend/sqlite/libsql.cjs +19 -19
- package/dist/backend/sqlite/libsql.d.cts +4 -4
- package/dist/backend/sqlite/libsql.d.ts +4 -4
- package/dist/backend/sqlite/libsql.js +15 -15
- package/dist/backend/sqlite/local.cjs +101 -21
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +95 -5
- package/dist/backend/sqlite/local.d.ts +95 -5
- package/dist/backend/sqlite/local.js +95 -16
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-ZV5N4DBG.js → chunk-3TWF3SH4.js} +300 -58
- package/dist/chunk-3TWF3SH4.js.map +1 -0
- package/dist/chunk-4JEZZJ6S.cjs +1271 -0
- package/dist/chunk-4JEZZJ6S.cjs.map +1 -0
- package/dist/{chunk-UNNPKQUG.cjs → chunk-4TOD4LBZ.cjs} +246 -155
- package/dist/chunk-4TOD4LBZ.cjs.map +1 -0
- package/dist/{chunk-QV245VMN.js → chunk-55MZDDZV.js} +100 -6
- package/dist/chunk-55MZDDZV.js.map +1 -0
- package/dist/{chunk-GQANNXXT.cjs → chunk-5A6FNS6N.cjs} +75 -20
- package/dist/chunk-5A6FNS6N.cjs.map +1 -0
- package/dist/{chunk-3Z6TW3CT.cjs → chunk-5AQIKK56.cjs} +65 -25
- package/dist/chunk-5AQIKK56.cjs.map +1 -0
- package/dist/{chunk-BVTWD66D.js → chunk-5SEGFTZX.js} +3 -3
- package/dist/{chunk-BVTWD66D.js.map → chunk-5SEGFTZX.js.map} +1 -1
- package/dist/{chunk-6GNSY7AV.js → chunk-6FR2MMS6.js} +7 -7
- package/dist/chunk-6FR2MMS6.js.map +1 -0
- package/dist/chunk-7YSP4V4R.cjs +69 -0
- package/dist/chunk-7YSP4V4R.cjs.map +1 -0
- package/dist/chunk-A42GCBGX.cjs +28 -0
- package/dist/chunk-A42GCBGX.cjs.map +1 -0
- package/dist/{chunk-RHZWOJVA.cjs → chunk-BLZDPRXT.cjs} +52 -4
- package/dist/chunk-BLZDPRXT.cjs.map +1 -0
- package/dist/chunk-BYPOGQWK.js +25 -0
- package/dist/chunk-BYPOGQWK.js.map +1 -0
- package/dist/{chunk-6HVOHZHS.cjs → chunk-CK5BVQOW.cjs} +213 -168
- package/dist/chunk-CK5BVQOW.cjs.map +1 -0
- package/dist/{chunk-JJRCLAUN.cjs → chunk-CTTSDJLY.cjs} +116 -10
- package/dist/chunk-CTTSDJLY.cjs.map +1 -0
- package/dist/chunk-CUHM5CWJ.cjs +12 -0
- package/dist/chunk-CUHM5CWJ.cjs.map +1 -0
- package/dist/{chunk-A7SZZFAG.js → chunk-CZQ3FO2Q.js} +409 -99
- package/dist/chunk-CZQ3FO2Q.js.map +1 -0
- package/dist/{chunk-2JXB3NYJ.cjs → chunk-D7ZEOS56.cjs} +25 -32
- package/dist/chunk-D7ZEOS56.cjs.map +1 -0
- package/dist/chunk-DFVLCOP6.js +10 -0
- package/dist/chunk-DFVLCOP6.js.map +1 -0
- package/dist/{chunk-UJLOZYKT.cjs → chunk-EM3CWPND.cjs} +441 -115
- package/dist/chunk-EM3CWPND.cjs.map +1 -0
- package/dist/chunk-EMF62TZG.cjs +1176 -0
- package/dist/chunk-EMF62TZG.cjs.map +1 -0
- package/dist/chunk-EOLERH7Y.cjs +40 -0
- package/dist/chunk-EOLERH7Y.cjs.map +1 -0
- package/dist/{chunk-TGJE22RM.cjs → chunk-FACJJWGF.cjs} +24 -6
- package/dist/chunk-FACJJWGF.cjs.map +1 -0
- package/dist/{chunk-HK5SATYM.cjs → chunk-FL472AMI.cjs} +16 -109
- package/dist/chunk-FL472AMI.cjs.map +1 -0
- package/dist/{chunk-WVC2Q2FD.cjs → chunk-FN35DLCN.cjs} +31 -9
- package/dist/chunk-FN35DLCN.cjs.map +1 -0
- package/dist/{chunk-KUTNI6SI.js → chunk-FPIZFYHE.js} +10 -18
- package/dist/chunk-FPIZFYHE.js.map +1 -0
- package/dist/{chunk-VCGO4V26.js → chunk-FRV5Q5IO.js} +64 -9
- package/dist/chunk-FRV5Q5IO.js.map +1 -0
- package/dist/{chunk-K5P5OZXS.js → chunk-G6Q5UM7U.js} +2 -2
- package/dist/{chunk-K5P5OZXS.js.map → chunk-G6Q5UM7U.js.map} +1 -1
- package/dist/chunk-GSQ6NPH6.cjs +100 -0
- package/dist/chunk-GSQ6NPH6.cjs.map +1 -0
- package/dist/chunk-GUR2FNB5.cjs +12 -0
- package/dist/{chunk-HMFK4BXR.cjs.map → chunk-GUR2FNB5.cjs.map} +1 -1
- package/dist/{chunk-JQGIPGVL.cjs → chunk-H7YNSMA7.cjs} +43 -2
- package/dist/chunk-H7YNSMA7.cjs.map +1 -0
- package/dist/{chunk-2MRAX3UE.js → chunk-I7ZUZKFD.js} +47 -4
- package/dist/chunk-I7ZUZKFD.js.map +1 -0
- package/dist/{chunk-3BRVBQQD.cjs → chunk-J7WFGBJR.cjs} +2445 -2367
- package/dist/chunk-J7WFGBJR.cjs.map +1 -0
- package/dist/{chunk-V3QNTB7Z.js → chunk-JBTOYDMN.js} +194 -114
- package/dist/chunk-JBTOYDMN.js.map +1 -0
- package/dist/{chunk-K2TGS3EN.js → chunk-K3PPLHY7.js} +138 -89
- package/dist/chunk-K3PPLHY7.js.map +1 -0
- package/dist/{chunk-Z5XBMDXU.js → chunk-KBGQIPRQ.js} +42 -3
- package/dist/chunk-KBGQIPRQ.js.map +1 -0
- package/dist/chunk-KMI7LYAF.js +1252 -0
- package/dist/chunk-KMI7LYAF.js.map +1 -0
- package/dist/{chunk-JIEJCTDS.cjs → chunk-LGEALRC6.cjs} +21 -4
- package/dist/chunk-LGEALRC6.cjs.map +1 -0
- package/dist/{chunk-TQOYM4LN.js → chunk-MP2JQKSG.js} +21 -5
- package/dist/chunk-MP2JQKSG.js.map +1 -0
- package/dist/{chunk-ZP5WHI4C.cjs → chunk-O7UN7OXA.cjs} +358 -116
- package/dist/chunk-O7UN7OXA.cjs.map +1 -0
- package/dist/chunk-OHMP6N2J.js +47 -0
- package/dist/chunk-OHMP6N2J.js.map +1 -0
- package/dist/{chunk-4DIBPQNJ.js → chunk-OR5ZA5WP.js} +135 -25
- package/dist/chunk-OR5ZA5WP.js.map +1 -0
- package/dist/{chunk-DEQFL35G.js → chunk-Q5TEXCTB.js} +61 -7
- package/dist/chunk-Q5TEXCTB.js.map +1 -0
- package/dist/chunk-QNKSQTKQ.js +1312 -0
- package/dist/chunk-QNKSQTKQ.js.map +1 -0
- package/dist/{chunk-ZURTTSCM.js → chunk-QOTI55H7.js} +6 -94
- package/dist/chunk-QOTI55H7.js.map +1 -0
- package/dist/{chunk-CHXTTSC6.js → chunk-QWEUYILR.js} +104 -5
- package/dist/chunk-QWEUYILR.js.map +1 -0
- package/dist/{chunk-LANHCOXB.js → chunk-RGP33ZJ5.js} +485 -83
- package/dist/chunk-RGP33ZJ5.js.map +1 -0
- package/dist/chunk-RGPG7EOJ.js +94 -0
- package/dist/chunk-RGPG7EOJ.js.map +1 -0
- package/dist/{chunk-G6SOJEDI.cjs → chunk-S55OV6PW.cjs} +15 -15
- package/dist/chunk-S55OV6PW.cjs.map +1 -0
- package/dist/{chunk-3E7SNSIA.cjs → chunk-SJDMVITW.cjs} +4 -4
- package/dist/{chunk-3E7SNSIA.cjs.map → chunk-SJDMVITW.cjs.map} +1 -1
- package/dist/{chunk-XLUNB2TZ.js → chunk-SNXVDZAJ.js} +3 -3
- package/dist/{chunk-XLUNB2TZ.js.map → chunk-SNXVDZAJ.js.map} +1 -1
- package/dist/{chunk-RBV7YCQD.js → chunk-T2WUSPDA.js} +49 -9
- package/dist/chunk-T2WUSPDA.js.map +1 -0
- package/dist/{chunk-KGC4LY5T.cjs → chunk-TCOCYN2P.cjs} +75 -21
- package/dist/chunk-TCOCYN2P.cjs.map +1 -0
- package/dist/{chunk-FLRCVI2G.cjs → chunk-TDXIBCGY.cjs} +2 -2
- package/dist/{chunk-FLRCVI2G.cjs.map → chunk-TDXIBCGY.cjs.map} +1 -1
- package/dist/{chunk-ZY4GXIVN.cjs → chunk-TEDRJXOG.cjs} +5 -5
- package/dist/{chunk-ZY4GXIVN.cjs.map → chunk-TEDRJXOG.cjs.map} +1 -1
- package/dist/{chunk-WLRIWYHQ.js → chunk-UES55P7G.js} +1863 -1785
- package/dist/chunk-UES55P7G.js.map +1 -0
- package/dist/{chunk-WL2SG7ZV.cjs → chunk-UMDVATGY.cjs} +6 -6
- package/dist/{chunk-WL2SG7ZV.cjs.map → chunk-UMDVATGY.cjs.map} +1 -1
- package/dist/chunk-UT3S4SEN.js +31 -0
- package/dist/chunk-UT3S4SEN.js.map +1 -0
- package/dist/{chunk-RRKQAKD6.cjs → chunk-UUT7UN2N.cjs} +149 -39
- package/dist/chunk-UUT7UN2N.cjs.map +1 -0
- package/dist/{chunk-SHLY4MCM.js → chunk-UZV3AZKF.js} +21 -3
- package/dist/chunk-UZV3AZKF.js.map +1 -0
- package/dist/{chunk-CYX2JTDG.js → chunk-VHMPG6UL.js} +29 -7
- package/dist/chunk-VHMPG6UL.js.map +1 -0
- package/dist/{chunk-T6SPUYLX.cjs → chunk-VPYHY3LJ.cjs} +116 -10
- package/dist/chunk-VPYHY3LJ.cjs.map +1 -0
- package/dist/{chunk-T46GR2VY.js → chunk-VSPCZAXF.js} +3 -3
- package/dist/{chunk-T46GR2VY.js.map → chunk-VSPCZAXF.js.map} +1 -1
- package/dist/{chunk-K34OPSJK.js → chunk-W63OVYY4.js} +3 -3
- package/dist/{chunk-K34OPSJK.js.map → chunk-W63OVYY4.js.map} +1 -1
- package/dist/{chunk-RY2VIWAM.js → chunk-WDBCBWC4.js} +355 -32
- package/dist/chunk-WDBCBWC4.js.map +1 -0
- package/dist/chunk-WJT7OU7E.cjs +1334 -0
- package/dist/chunk-WJT7OU7E.cjs.map +1 -0
- package/dist/{chunk-5IQIX7LU.cjs → chunk-XOX22WHL.cjs} +476 -163
- package/dist/chunk-XOX22WHL.cjs.map +1 -0
- package/dist/{ddl-BrmPg61z.d.ts → ddl-C2rZ-Aen.d.ts} +4 -4
- package/dist/{ddl-j1-sH6lE.d.cts → ddl-CZz7a0E8.d.cts} +4 -4
- package/dist/{extension-types-YGFJPrzK.d.cts → extension-types-ixRpJVUp.d.cts} +24 -1
- package/dist/{extension-types-YGFJPrzK.d.ts → extension-types-ixRpJVUp.d.ts} +24 -1
- package/dist/{types-DkNnF-7K.d.cts → fulltext-strategy-B57yvC5Q.d.ts} +2562 -2133
- package/dist/{types-D1Sqeyxy.d.ts → fulltext-strategy-CDkSSYhq.d.cts} +2562 -2133
- package/dist/graph-extension/index.cjs +20 -19
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +5 -4
- package/dist/graph-merge/index.cjs +255 -164
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +63 -33
- package/dist/graph-merge/index.d.ts +63 -33
- package/dist/graph-merge/index.js +135 -44
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-DGX6D9j1.d.ts → index-6CSUAq-x.d.ts} +234 -93
- package/dist/{index-SEvUHDA6.d.cts → index-Bks_3HHK.d.cts} +234 -93
- package/dist/index.cjs +208 -188
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +33 -33
- package/dist/indexes/index.cjs +19 -20
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +10 -11
- package/dist/interchange/index.cjs +47 -26
- package/dist/interchange/index.d.cts +126 -12
- package/dist/interchange/index.d.ts +126 -12
- package/dist/interchange/index.js +14 -13
- package/dist/{manager-ms9cKdc6.d.cts → manager-DwQi8eV0.d.cts} +9 -2
- package/dist/{manager-BZUeN_BU.d.ts → manager-ejUCB52T.d.ts} +9 -2
- package/dist/{materialize-indexes-D20xNluI.d.cts → materialize-indexes-B4e9360H.d.cts} +20 -4
- package/dist/{materialize-indexes-CAkIYFV-.d.ts → materialize-indexes-te9TPMMJ.d.ts} +20 -4
- package/dist/{postgres-BhpxGMC5.d.cts → postgres-CfEqsRMp.d.cts} +152 -1
- package/dist/{postgres-CWHLwNl1.d.ts → postgres-DQ5R6rzV.d.ts} +152 -1
- package/dist/profiler/index.cjs +11 -11
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +4 -4
- package/dist/provenance/index.cjs +40 -41
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +5 -5
- package/dist/provenance/index.d.ts +5 -5
- package/dist/provenance/index.js +11 -12
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +53 -40
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +57 -57
- package/dist/schema/index.d.ts +57 -57
- package/dist/schema/index.js +28 -15
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-XrDxNaa7.d.cts → sqlite-D7zBinNR.d.cts} +92 -1
- package/dist/{sqlite-CGu5SLsw.d.ts → sqlite-DvQndLky.d.ts} +92 -1
- package/dist/{store-view-D09po4H6.d.cts → store-view-BSpqvAxK.d.cts} +415 -44
- package/dist/{store-view-BlgnhEYf.d.ts → store-view-CKbHFRnn.d.ts} +415 -44
- package/dist/{types-DiE1AO7p.d.cts → types-Bv9DcS_E.d.cts} +2 -2
- package/dist/{types-B1TbZJYS.d.ts → types-CoxuV7EJ.d.ts} +2 -2
- package/dist/{where-DKjuofPr.d.cts → where-7RKFOsXt.d.ts} +2 -2
- package/dist/{where-DrUIIWHb.d.ts → where-DdMIXOtH.d.cts} +2 -2
- package/package.json +14 -13
- package/dist/chunk-2EBMPJBO.js +0 -16
- package/dist/chunk-2EBMPJBO.js.map +0 -1
- package/dist/chunk-2JXB3NYJ.cjs.map +0 -1
- package/dist/chunk-2MRAX3UE.js.map +0 -1
- package/dist/chunk-3BRVBQQD.cjs.map +0 -1
- package/dist/chunk-3EUKJEQ3.js +0 -77
- package/dist/chunk-3EUKJEQ3.js.map +0 -1
- package/dist/chunk-3Z6TW3CT.cjs.map +0 -1
- package/dist/chunk-4DIBPQNJ.js.map +0 -1
- package/dist/chunk-4S2FXGBJ.js +0 -9
- package/dist/chunk-4S2FXGBJ.js.map +0 -1
- package/dist/chunk-5IQIX7LU.cjs.map +0 -1
- package/dist/chunk-6GNSY7AV.js.map +0 -1
- package/dist/chunk-6HVOHZHS.cjs.map +0 -1
- package/dist/chunk-6SCVW4AS.js +0 -20
- package/dist/chunk-6SCVW4AS.js.map +0 -1
- package/dist/chunk-A7SZZFAG.js.map +0 -1
- package/dist/chunk-CHXTTSC6.js.map +0 -1
- package/dist/chunk-CYX2JTDG.js.map +0 -1
- package/dist/chunk-DEQFL35G.js.map +0 -1
- package/dist/chunk-G6SOJEDI.cjs.map +0 -1
- package/dist/chunk-GQANNXXT.cjs.map +0 -1
- package/dist/chunk-GZCNZ7QW.js +0 -24
- package/dist/chunk-GZCNZ7QW.js.map +0 -1
- package/dist/chunk-HK5SATYM.cjs.map +0 -1
- package/dist/chunk-HMFK4BXR.cjs +0 -12
- package/dist/chunk-HTGDWIDE.cjs +0 -89
- package/dist/chunk-HTGDWIDE.cjs.map +0 -1
- package/dist/chunk-JIEJCTDS.cjs.map +0 -1
- package/dist/chunk-JJRCLAUN.cjs.map +0 -1
- package/dist/chunk-JQGIPGVL.cjs.map +0 -1
- package/dist/chunk-K2TGS3EN.js.map +0 -1
- package/dist/chunk-KGC4LY5T.cjs.map +0 -1
- package/dist/chunk-KNHYNQQ3.cjs +0 -663
- package/dist/chunk-KNHYNQQ3.cjs.map +0 -1
- package/dist/chunk-KUTNI6SI.js.map +0 -1
- package/dist/chunk-LANHCOXB.js.map +0 -1
- package/dist/chunk-N6WTUSBV.cjs +0 -23
- package/dist/chunk-N6WTUSBV.cjs.map +0 -1
- package/dist/chunk-NAUA4PW5.cjs +0 -28
- package/dist/chunk-NAUA4PW5.cjs.map +0 -1
- package/dist/chunk-QV245VMN.js.map +0 -1
- package/dist/chunk-RBV7YCQD.js.map +0 -1
- package/dist/chunk-RHZWOJVA.cjs.map +0 -1
- package/dist/chunk-RRKQAKD6.cjs.map +0 -1
- package/dist/chunk-RY2VIWAM.js.map +0 -1
- package/dist/chunk-SHLY4MCM.js.map +0 -1
- package/dist/chunk-T2DWPQNE.js +0 -649
- package/dist/chunk-T2DWPQNE.js.map +0 -1
- package/dist/chunk-T6SPUYLX.cjs.map +0 -1
- package/dist/chunk-TGJE22RM.cjs.map +0 -1
- package/dist/chunk-TOTPVGOG.cjs +0 -774
- package/dist/chunk-TOTPVGOG.cjs.map +0 -1
- package/dist/chunk-TQOYM4LN.js.map +0 -1
- package/dist/chunk-UJLOZYKT.cjs.map +0 -1
- package/dist/chunk-UNNPKQUG.cjs.map +0 -1
- package/dist/chunk-V3QNTB7Z.js.map +0 -1
- package/dist/chunk-VCGO4V26.js.map +0 -1
- package/dist/chunk-WLRIWYHQ.js.map +0 -1
- package/dist/chunk-WVC2Q2FD.cjs.map +0 -1
- package/dist/chunk-XXVEULWX.js +0 -39
- package/dist/chunk-XXVEULWX.js.map +0 -1
- package/dist/chunk-YAZE7QZR.cjs +0 -32
- package/dist/chunk-YAZE7QZR.cjs.map +0 -1
- package/dist/chunk-YC6PWTHY.cjs +0 -44
- package/dist/chunk-YC6PWTHY.cjs.map +0 -1
- package/dist/chunk-Z5HBYM7U.cjs +0 -11
- package/dist/chunk-Z5HBYM7U.cjs.map +0 -1
- package/dist/chunk-Z5XBMDXU.js.map +0 -1
- package/dist/chunk-ZP5WHI4C.cjs.map +0 -1
- package/dist/chunk-ZURTTSCM.js.map +0 -1
- package/dist/chunk-ZV5N4DBG.js.map +0 -1
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
var chunk6HVOHZHS_cjs = require('../chunk-6HVOHZHS.cjs');
|
|
3
|
+
var chunkJ7WFGBJR_cjs = require('../chunk-J7WFGBJR.cjs');
|
|
4
|
+
require('../chunk-CTTSDJLY.cjs');
|
|
5
|
+
var chunk4JEZZJ6S_cjs = require('../chunk-4JEZZJ6S.cjs');
|
|
6
|
+
require('../chunk-WJT7OU7E.cjs');
|
|
7
|
+
var chunkCK5BVQOW_cjs = require('../chunk-CK5BVQOW.cjs');
|
|
9
8
|
var chunkACSVZPK7_cjs = require('../chunk-ACSVZPK7.cjs');
|
|
10
|
-
var
|
|
11
|
-
require('../chunk-
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
14
|
-
|
|
15
|
-
require('../chunk-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
require('../chunk-
|
|
20
|
-
require('../chunk-
|
|
21
|
-
require('../chunk-
|
|
22
|
-
require('../chunk-
|
|
23
|
-
require('../chunk-
|
|
24
|
-
require('../chunk-
|
|
25
|
-
require('../chunk-
|
|
9
|
+
var chunkVPYHY3LJ_cjs = require('../chunk-VPYHY3LJ.cjs');
|
|
10
|
+
require('../chunk-FACJJWGF.cjs');
|
|
11
|
+
require('../chunk-UUT7UN2N.cjs');
|
|
12
|
+
var chunkTEDRJXOG_cjs = require('../chunk-TEDRJXOG.cjs');
|
|
13
|
+
require('../chunk-D7ZEOS56.cjs');
|
|
14
|
+
require('../chunk-UMDVATGY.cjs');
|
|
15
|
+
var chunkFL472AMI_cjs = require('../chunk-FL472AMI.cjs');
|
|
16
|
+
require('../chunk-GSQ6NPH6.cjs');
|
|
17
|
+
var chunkA42GCBGX_cjs = require('../chunk-A42GCBGX.cjs');
|
|
18
|
+
var chunkXOX22WHL_cjs = require('../chunk-XOX22WHL.cjs');
|
|
19
|
+
require('../chunk-EOLERH7Y.cjs');
|
|
20
|
+
require('../chunk-4TOD4LBZ.cjs');
|
|
21
|
+
require('../chunk-BLZDPRXT.cjs');
|
|
22
|
+
require('../chunk-7YSP4V4R.cjs');
|
|
23
|
+
require('../chunk-H7YNSMA7.cjs');
|
|
24
|
+
require('../chunk-SJDMVITW.cjs');
|
|
26
25
|
require('../chunk-DI74SMXS.cjs');
|
|
27
|
-
var
|
|
28
|
-
require('../chunk-
|
|
26
|
+
var chunkLGEALRC6_cjs = require('../chunk-LGEALRC6.cjs');
|
|
27
|
+
require('../chunk-TDXIBCGY.cjs');
|
|
29
28
|
var zod = require('zod');
|
|
30
29
|
|
|
31
30
|
// src/graph-merge/canonical-props.ts
|
|
@@ -47,10 +46,14 @@ function edgeStateSignature(edge) {
|
|
|
47
46
|
}
|
|
48
47
|
function parseRowProps(props) {
|
|
49
48
|
let parsed;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
if (typeof props === "string") {
|
|
50
|
+
try {
|
|
51
|
+
parsed = JSON.parse(props);
|
|
52
|
+
} catch {
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
parsed = props;
|
|
54
57
|
}
|
|
55
58
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
56
59
|
return {};
|
|
@@ -94,7 +97,7 @@ function compareMergeKeys(left, right) {
|
|
|
94
97
|
var ENUMERATION_PAGE_SIZE = 1e3;
|
|
95
98
|
async function enumerateAllNodes(backend, graphId, kind) {
|
|
96
99
|
const collected = [];
|
|
97
|
-
let after
|
|
100
|
+
let after;
|
|
98
101
|
for (; ; ) {
|
|
99
102
|
const page = await backend.findNodesByKind({
|
|
100
103
|
graphId,
|
|
@@ -116,7 +119,7 @@ async function enumerateAllNodes(backend, graphId, kind) {
|
|
|
116
119
|
}
|
|
117
120
|
async function enumerateAllEdges(backend, graphId, kind) {
|
|
118
121
|
const collected = [];
|
|
119
|
-
let after
|
|
122
|
+
let after;
|
|
120
123
|
for (; ; ) {
|
|
121
124
|
const page = await backend.findEdgesByKind({
|
|
122
125
|
graphId,
|
|
@@ -241,12 +244,12 @@ function diffEdgeKind(kind, baseRows, forkRows) {
|
|
|
241
244
|
return { new: created, modified, deleted };
|
|
242
245
|
}
|
|
243
246
|
function byId(left, right) {
|
|
244
|
-
return
|
|
247
|
+
return chunkA42GCBGX_cjs.compareStrings(left.id, right.id);
|
|
245
248
|
}
|
|
246
249
|
async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
247
250
|
const graph = baseStore.graph;
|
|
248
|
-
const nodeKinds =
|
|
249
|
-
const edgeKinds =
|
|
251
|
+
const nodeKinds = chunkVPYHY3LJ_cjs.getNodeKinds(graph);
|
|
252
|
+
const edgeKinds = chunkVPYHY3LJ_cjs.getEdgeKinds(graph);
|
|
250
253
|
const newNodes = [];
|
|
251
254
|
const modifiedNodes = [];
|
|
252
255
|
const deletedNodes = [];
|
|
@@ -345,6 +348,9 @@ function asBaseVersion(value) {
|
|
|
345
348
|
|
|
346
349
|
// src/graph-merge/base-version.ts
|
|
347
350
|
var TOKEN_SEPARATOR = "\0";
|
|
351
|
+
var REVISION_COMPONENT_PREFIX = "revision:";
|
|
352
|
+
var REVISION_COMPONENT_SEPARATOR = ":";
|
|
353
|
+
var INITIAL_REVISION = "initial";
|
|
348
354
|
var FALLBACK_SCHEMA_VERSION = 1;
|
|
349
355
|
async function readActiveSchemaVersion(backend, graphId) {
|
|
350
356
|
const active = await backend.getActiveSchema(graphId);
|
|
@@ -352,16 +358,16 @@ async function readActiveSchemaVersion(backend, graphId) {
|
|
|
352
358
|
}
|
|
353
359
|
async function computeSchemaComponent(store) {
|
|
354
360
|
const version = await readActiveSchemaVersion(store.backend, store.graphId);
|
|
355
|
-
return
|
|
361
|
+
return chunkCK5BVQOW_cjs.computeSchemaHash(chunkCK5BVQOW_cjs.serializeSchema(store.graph, version));
|
|
356
362
|
}
|
|
357
363
|
function byDigestEntry(left, right) {
|
|
358
|
-
const byKind =
|
|
359
|
-
return byKind === 0 ?
|
|
364
|
+
const byKind = chunkA42GCBGX_cjs.compareStrings(left.kind, right.kind);
|
|
365
|
+
return byKind === 0 ? chunkA42GCBGX_cjs.compareStrings(left.id, right.id) : byKind;
|
|
360
366
|
}
|
|
361
367
|
var CONTENT_FINGERPRINT_BYTES = 16;
|
|
362
368
|
async function computeContentComponent(backend, graphId, graph) {
|
|
363
|
-
const nodeKinds =
|
|
364
|
-
const edgeKinds =
|
|
369
|
+
const nodeKinds = chunkVPYHY3LJ_cjs.getNodeKinds(graph);
|
|
370
|
+
const edgeKinds = chunkVPYHY3LJ_cjs.getEdgeKinds(graph);
|
|
365
371
|
const nodeDigest = [];
|
|
366
372
|
for (const kind of nodeKinds) {
|
|
367
373
|
const rows = await enumerateAllNodes(backend, graphId, kind);
|
|
@@ -396,7 +402,7 @@ async function computeContentComponent(backend, graphId, graph) {
|
|
|
396
402
|
}
|
|
397
403
|
}
|
|
398
404
|
}
|
|
399
|
-
return
|
|
405
|
+
return chunkTEDRJXOG_cjs.sha256Hex(
|
|
400
406
|
canonicalizeProps({
|
|
401
407
|
nodes: nodeDigest.sort((left, right) => byDigestEntry(left, right)),
|
|
402
408
|
edges: edgeDigest.sort((left, right) => byDigestEntry(left, right))
|
|
@@ -405,6 +411,16 @@ async function computeContentComponent(backend, graphId, graph) {
|
|
|
405
411
|
);
|
|
406
412
|
}
|
|
407
413
|
async function computeBaseVersion(store) {
|
|
414
|
+
if (store.revisionTrackingEnabled) {
|
|
415
|
+
const [schemaComponent2, origin, revision] = await Promise.all([
|
|
416
|
+
computeSchemaComponent(store),
|
|
417
|
+
store.revisionOriginNow(),
|
|
418
|
+
store.revisionNow()
|
|
419
|
+
]);
|
|
420
|
+
return asBaseVersion(
|
|
421
|
+
`${schemaComponent2}${TOKEN_SEPARATOR}${revisionComponent(origin, revision)}`
|
|
422
|
+
);
|
|
423
|
+
}
|
|
408
424
|
const [schemaComponent, contentComponent] = await Promise.all([
|
|
409
425
|
computeSchemaComponent(store),
|
|
410
426
|
computeContentComponent(store.backend, store.graphId, store.graph)
|
|
@@ -413,6 +429,30 @@ async function computeBaseVersion(store) {
|
|
|
413
429
|
`${schemaComponent}${TOKEN_SEPARATOR}${contentComponent}`
|
|
414
430
|
);
|
|
415
431
|
}
|
|
432
|
+
function revisionComponent(origin, revision) {
|
|
433
|
+
return `${REVISION_COMPONENT_PREFIX}${origin}${REVISION_COMPONENT_SEPARATOR}${revision ?? INITIAL_REVISION}`;
|
|
434
|
+
}
|
|
435
|
+
function hasRevisionAnchor(version) {
|
|
436
|
+
return contentComponentOf(version).startsWith(REVISION_COMPONENT_PREFIX);
|
|
437
|
+
}
|
|
438
|
+
function revisionAnchorOf(version) {
|
|
439
|
+
const revision = revisionPartsOf(version)?.revision;
|
|
440
|
+
return revision === void 0 || revision === INITIAL_REVISION ? void 0 : revision;
|
|
441
|
+
}
|
|
442
|
+
function revisionOriginOf(version) {
|
|
443
|
+
return revisionPartsOf(version)?.origin;
|
|
444
|
+
}
|
|
445
|
+
function revisionPartsOf(version) {
|
|
446
|
+
const component = contentComponentOf(version);
|
|
447
|
+
if (!component.startsWith(REVISION_COMPONENT_PREFIX)) return void 0;
|
|
448
|
+
const encoded = component.slice(REVISION_COMPONENT_PREFIX.length);
|
|
449
|
+
const separator = encoded.indexOf(REVISION_COMPONENT_SEPARATOR);
|
|
450
|
+
if (separator <= 0 || separator === encoded.length - 1) return void 0;
|
|
451
|
+
return {
|
|
452
|
+
origin: encoded.slice(0, separator),
|
|
453
|
+
revision: encoded.slice(separator + 1)
|
|
454
|
+
};
|
|
455
|
+
}
|
|
416
456
|
function contentComponentOf(version) {
|
|
417
457
|
const separatorIndex = version.indexOf(TOKEN_SEPARATOR);
|
|
418
458
|
return separatorIndex === -1 ? version : version.slice(separatorIndex + 1);
|
|
@@ -434,7 +474,7 @@ function toTypeGraphErrorOptions(category, options) {
|
|
|
434
474
|
...options.cause === void 0 ? {} : { cause: options.cause }
|
|
435
475
|
};
|
|
436
476
|
}
|
|
437
|
-
var MergeError = class extends
|
|
477
|
+
var MergeError = class extends chunkLGEALRC6_cjs.TypeGraphError {
|
|
438
478
|
constructor(message, options = {}) {
|
|
439
479
|
super(
|
|
440
480
|
message,
|
|
@@ -444,7 +484,7 @@ var MergeError = class extends chunkJIEJCTDS_cjs.TypeGraphError {
|
|
|
444
484
|
this.name = "MergeError";
|
|
445
485
|
}
|
|
446
486
|
};
|
|
447
|
-
var BranchError = class extends
|
|
487
|
+
var BranchError = class extends chunkLGEALRC6_cjs.TypeGraphError {
|
|
448
488
|
constructor(message, options = {}) {
|
|
449
489
|
super(
|
|
450
490
|
message,
|
|
@@ -487,22 +527,32 @@ var CLONE_IMPORT_BATCH_SIZE = 1e3;
|
|
|
487
527
|
function cloneWorkingCopyStrategy(makeBackend) {
|
|
488
528
|
return {
|
|
489
529
|
create: async (baseStore) => {
|
|
490
|
-
const data = await chunkKNHYNQQ3_cjs.exportGraph(baseStore, {
|
|
491
|
-
includeMeta: true,
|
|
492
|
-
includeDeleted: false
|
|
493
|
-
});
|
|
494
530
|
const backend = await makeBackend();
|
|
495
531
|
try {
|
|
496
|
-
const [freshStore] = await
|
|
532
|
+
const [freshStore] = await chunkJ7WFGBJR_cjs.createStoreWithSchema(
|
|
497
533
|
baseStore.graph,
|
|
498
|
-
backend
|
|
534
|
+
backend,
|
|
535
|
+
{
|
|
536
|
+
// Keep descendants branchable with the same O(1) anchor contract,
|
|
537
|
+
// but do not copy recorded-time history into the disposable fork.
|
|
538
|
+
revisionTracking: baseStore.revisionTrackingEnabled
|
|
539
|
+
}
|
|
540
|
+
);
|
|
541
|
+
const result = await chunk4JEZZJ6S_cjs.importGraphStream(
|
|
542
|
+
freshStore,
|
|
543
|
+
chunk4JEZZJ6S_cjs.exportGraphStream(baseStore, {
|
|
544
|
+
includeMeta: true,
|
|
545
|
+
includeTemporal: true,
|
|
546
|
+
includeDeleted: false,
|
|
547
|
+
batchSize: CLONE_IMPORT_BATCH_SIZE
|
|
548
|
+
}),
|
|
549
|
+
{
|
|
550
|
+
onConflict: "error",
|
|
551
|
+
onUnknownProperty: "error",
|
|
552
|
+
validateReferences: true,
|
|
553
|
+
batchSize: CLONE_IMPORT_BATCH_SIZE
|
|
554
|
+
}
|
|
499
555
|
);
|
|
500
|
-
const result = await chunkKNHYNQQ3_cjs.importGraph(freshStore, data, {
|
|
501
|
-
onConflict: "error",
|
|
502
|
-
onUnknownProperty: "error",
|
|
503
|
-
validateReferences: true,
|
|
504
|
-
batchSize: CLONE_IMPORT_BATCH_SIZE
|
|
505
|
-
});
|
|
506
556
|
if (!result.success) {
|
|
507
557
|
throw new BranchError(
|
|
508
558
|
"Clone import failed: the working copy could not be seeded from the base store. The backend returned by makeBackend() must be empty.",
|
|
@@ -525,12 +575,12 @@ function cloneWorkingCopyStrategy(makeBackend) {
|
|
|
525
575
|
async function branch(baseStore, makeBackend, options, strategy) {
|
|
526
576
|
try {
|
|
527
577
|
const base = await computeBaseVersion(baseStore);
|
|
528
|
-
const id = options?.id ?? asBranchId(
|
|
578
|
+
const id = options?.id ?? asBranchId(chunkXOX22WHL_cjs.generateId());
|
|
529
579
|
const workingCopyStrategy = strategy ?? cloneWorkingCopyStrategy(makeBackend);
|
|
530
580
|
const store = await workingCopyStrategy.create(baseStore);
|
|
531
|
-
return
|
|
581
|
+
return chunkFL472AMI_cjs.ok({ id, base, store });
|
|
532
582
|
} catch (error) {
|
|
533
|
-
return
|
|
583
|
+
return chunkFL472AMI_cjs.err(
|
|
534
584
|
new BranchError("Failed to create working-copy branch of base store", {
|
|
535
585
|
cause: error
|
|
536
586
|
})
|
|
@@ -554,7 +604,7 @@ function constraintSignature(node, constraint) {
|
|
|
554
604
|
return void 0;
|
|
555
605
|
}
|
|
556
606
|
}
|
|
557
|
-
return `${constraint.name}${KEY_PART_SEPARATOR}${
|
|
607
|
+
return `${constraint.name}${KEY_PART_SEPARATOR}${chunkXOX22WHL_cjs.computeUniqueKey(
|
|
558
608
|
props,
|
|
559
609
|
constraint.fields,
|
|
560
610
|
constraint.collation
|
|
@@ -591,12 +641,12 @@ function blockNodes(newNodes, resolveConfig, uniqueConstraints = []) {
|
|
|
591
641
|
}
|
|
592
642
|
}
|
|
593
643
|
const sortedKeys = [...buckets.keys()].sort(
|
|
594
|
-
(left, right) =>
|
|
644
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)
|
|
595
645
|
);
|
|
596
646
|
const ordered = /* @__PURE__ */ new Map();
|
|
597
647
|
for (const key of sortedKeys) {
|
|
598
648
|
const members = [...buckets.get(key)].sort(
|
|
599
|
-
(left, right) =>
|
|
649
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id)
|
|
600
650
|
);
|
|
601
651
|
ordered.set(key, members);
|
|
602
652
|
}
|
|
@@ -613,7 +663,7 @@ function buildBranchRank(branchOrder, allBranchIds) {
|
|
|
613
663
|
next += 1;
|
|
614
664
|
}
|
|
615
665
|
}
|
|
616
|
-
const remaining = allBranchIds.filter((branchId) => !rank.has(branchId)).sort((left, right) =>
|
|
666
|
+
const remaining = allBranchIds.filter((branchId) => !rank.has(branchId)).sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right));
|
|
617
667
|
for (const branchId of remaining) {
|
|
618
668
|
if (!rank.has(branchId)) {
|
|
619
669
|
rank.set(branchId, next);
|
|
@@ -685,8 +735,8 @@ function collectConflictingValues(property, contributions) {
|
|
|
685
735
|
values.push({ branchId, value });
|
|
686
736
|
}
|
|
687
737
|
return [...values].sort((left, right) => {
|
|
688
|
-
const byBranch =
|
|
689
|
-
return byBranch === 0 ?
|
|
738
|
+
const byBranch = chunkA42GCBGX_cjs.compareStrings(left.branchId, right.branchId);
|
|
739
|
+
return byBranch === 0 ? chunkA42GCBGX_cjs.compareStrings(
|
|
690
740
|
canonicalValueKey(left.value),
|
|
691
741
|
canonicalValueKey(right.value)
|
|
692
742
|
) : byBranch;
|
|
@@ -813,7 +863,7 @@ function unionProperties(canonicalMember, members, context, baseContext, branchR
|
|
|
813
863
|
const props = {};
|
|
814
864
|
const conflicts = [];
|
|
815
865
|
for (const property of [...propertyNames].sort(
|
|
816
|
-
(left, right) =>
|
|
866
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)
|
|
817
867
|
)) {
|
|
818
868
|
const values = collectConflictingValues(property, members);
|
|
819
869
|
if (values.length === 0) {
|
|
@@ -878,14 +928,14 @@ function canonicalizeCluster(cluster, members, policy, branchRank, weights, cano
|
|
|
878
928
|
);
|
|
879
929
|
const memberIds = [
|
|
880
930
|
...new Set(cluster.members.map((member) => idOf(member)))
|
|
881
|
-
].sort((left, right) =>
|
|
931
|
+
].sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right));
|
|
882
932
|
const branchOrigins = [
|
|
883
933
|
...new Set(
|
|
884
934
|
members.map((member) => member.branchId).filter(
|
|
885
935
|
(branchId) => branchId !== BASE_PROVENANCE_BRANCH && branchId !== preferredBranchId
|
|
886
936
|
)
|
|
887
937
|
)
|
|
888
|
-
].sort((left, right) =>
|
|
938
|
+
].sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right));
|
|
889
939
|
const resolution = {
|
|
890
940
|
canonicalId,
|
|
891
941
|
memberIds,
|
|
@@ -900,6 +950,7 @@ var UnionFind = class {
|
|
|
900
950
|
constructor(compare) {
|
|
901
951
|
this.compare = compare;
|
|
902
952
|
}
|
|
953
|
+
compare;
|
|
903
954
|
parent = /* @__PURE__ */ new Map();
|
|
904
955
|
/** Adds `value` as its own singleton set if it is not already present. */
|
|
905
956
|
add(value) {
|
|
@@ -945,7 +996,7 @@ var UnionFind = class {
|
|
|
945
996
|
var SUB_CLASS_OF_META_EDGE = "subClassOf";
|
|
946
997
|
var EQUIVALENT_TO_META_EDGE = "equivalentTo";
|
|
947
998
|
function buildSubClassClosure(ontology) {
|
|
948
|
-
const unionFind = new UnionFind(
|
|
999
|
+
const unionFind = new UnionFind(chunkA42GCBGX_cjs.compareStrings);
|
|
949
1000
|
for (const relation of ontology) {
|
|
950
1001
|
unionFind.add(relation.from);
|
|
951
1002
|
unionFind.add(relation.to);
|
|
@@ -976,7 +1027,7 @@ function buildSubClassClosure(ontology) {
|
|
|
976
1027
|
relations.push([child, parent]);
|
|
977
1028
|
}
|
|
978
1029
|
return {
|
|
979
|
-
closure:
|
|
1030
|
+
closure: chunkFL472AMI_cjs.computeTransitiveClosure(relations),
|
|
980
1031
|
canonicalOf
|
|
981
1032
|
};
|
|
982
1033
|
}
|
|
@@ -989,7 +1040,7 @@ function isReachable2(closure, from, to) {
|
|
|
989
1040
|
if (fromRep === toRep) {
|
|
990
1041
|
return from !== to;
|
|
991
1042
|
}
|
|
992
|
-
return
|
|
1043
|
+
return chunkFL472AMI_cjs.isReachable(closure.closure, fromRep, toRep);
|
|
993
1044
|
}
|
|
994
1045
|
|
|
995
1046
|
// src/graph-merge/similarity.ts
|
|
@@ -1172,37 +1223,37 @@ function scorePrepared(left, right, strategy, ctx) {
|
|
|
1172
1223
|
switch (strategy.kind) {
|
|
1173
1224
|
case "custom": {
|
|
1174
1225
|
const raw = strategy.score(left.node, right.node);
|
|
1175
|
-
return
|
|
1226
|
+
return chunkFL472AMI_cjs.ok(clampScore(raw));
|
|
1176
1227
|
}
|
|
1177
1228
|
case "fulltext": {
|
|
1178
1229
|
if (left.text.length === 0 || right.text.length === 0) {
|
|
1179
|
-
return
|
|
1230
|
+
return chunkFL472AMI_cjs.ok(NO_EVIDENCE_SCORE);
|
|
1180
1231
|
}
|
|
1181
|
-
return
|
|
1232
|
+
return chunkFL472AMI_cjs.ok(clampScore(diceFromMultisets(left.grams, right.grams)));
|
|
1182
1233
|
}
|
|
1183
1234
|
case "vector": {
|
|
1184
1235
|
if (ctx.embeddings === void 0) {
|
|
1185
|
-
return
|
|
1236
|
+
return chunkFL472AMI_cjs.err(embedderUnavailable("vector", ctx));
|
|
1186
1237
|
}
|
|
1187
1238
|
if (left.text.length === 0 || right.text.length === 0) {
|
|
1188
|
-
return
|
|
1239
|
+
return chunkFL472AMI_cjs.ok(NO_EVIDENCE_SCORE);
|
|
1189
1240
|
}
|
|
1190
1241
|
const cosine = cosineFromLookup(ctx.embeddings, left.text, right.text);
|
|
1191
|
-
return
|
|
1242
|
+
return chunkFL472AMI_cjs.ok(clampScore(cosine));
|
|
1192
1243
|
}
|
|
1193
1244
|
case "hybrid": {
|
|
1194
1245
|
if (ctx.embeddings === void 0) {
|
|
1195
|
-
return
|
|
1246
|
+
return chunkFL472AMI_cjs.err(embedderUnavailable("hybrid", ctx));
|
|
1196
1247
|
}
|
|
1197
1248
|
if (left.text.length === 0 || right.text.length === 0) {
|
|
1198
|
-
return
|
|
1249
|
+
return chunkFL472AMI_cjs.ok(NO_EVIDENCE_SCORE);
|
|
1199
1250
|
}
|
|
1200
1251
|
const vectorScore = clampScore(
|
|
1201
1252
|
cosineFromLookup(ctx.embeddings, left.text, right.text)
|
|
1202
1253
|
);
|
|
1203
1254
|
const fulltextScore = diceFromMultisets(left.grams, right.grams);
|
|
1204
1255
|
const weights = normalizeHybridWeights(strategy.weights);
|
|
1205
|
-
return
|
|
1256
|
+
return chunkFL472AMI_cjs.ok(
|
|
1206
1257
|
clampScore(
|
|
1207
1258
|
weights.vector * vectorScore + weights.fulltext * fulltextScore
|
|
1208
1259
|
)
|
|
@@ -1260,7 +1311,7 @@ function scoreCandidates(input, resolveConfig, ctx, ceilingPolicy, maxComparison
|
|
|
1260
1311
|
}
|
|
1261
1312
|
if (maxComparisonsPerKind !== void 0 && fuzzy.length > maxComparisonsPerKind) {
|
|
1262
1313
|
if (ceilingPolicy === "error") {
|
|
1263
|
-
return
|
|
1314
|
+
return chunkFL472AMI_cjs.err(
|
|
1264
1315
|
new MergeError(
|
|
1265
1316
|
`Comparison ceiling exceeded: ${fuzzy.length} candidate pairs > maxComparisonsPerKind ${maxComparisonsPerKind}.`,
|
|
1266
1317
|
{
|
|
@@ -1273,7 +1324,7 @@ function scoreCandidates(input, resolveConfig, ctx, ceilingPolicy, maxComparison
|
|
|
1273
1324
|
)
|
|
1274
1325
|
);
|
|
1275
1326
|
}
|
|
1276
|
-
return
|
|
1327
|
+
return chunkFL472AMI_cjs.ok({
|
|
1277
1328
|
edges: [...forced].sort(
|
|
1278
1329
|
(left, right) => compareCandidateEdges(left, right)
|
|
1279
1330
|
),
|
|
@@ -1291,14 +1342,14 @@ function scoreCandidates(input, resolveConfig, ctx, ceilingPolicy, maxComparison
|
|
|
1291
1342
|
const edges = [...forced];
|
|
1292
1343
|
for (const { left, right, a, b } of fuzzy) {
|
|
1293
1344
|
const scored = scorer(a, left, b, right);
|
|
1294
|
-
if (
|
|
1295
|
-
return
|
|
1345
|
+
if (chunkFL472AMI_cjs.isErr(scored)) {
|
|
1346
|
+
return chunkFL472AMI_cjs.err(scored.error);
|
|
1296
1347
|
}
|
|
1297
1348
|
if (scored.data >= threshold) {
|
|
1298
1349
|
edges.push({ a, b, score: scored.data });
|
|
1299
1350
|
}
|
|
1300
1351
|
}
|
|
1301
|
-
return
|
|
1352
|
+
return chunkFL472AMI_cjs.ok({
|
|
1302
1353
|
edges: edges.sort((left, right) => compareCandidateEdges(left, right)),
|
|
1303
1354
|
warnings: []
|
|
1304
1355
|
});
|
|
@@ -1508,7 +1559,7 @@ function pickHighestPriorityBranch(branchIds, branchRank) {
|
|
|
1508
1559
|
let chosenRank = branchRank.get(chosen) ?? Number.MAX_SAFE_INTEGER;
|
|
1509
1560
|
for (const candidate of branchIds.slice(1)) {
|
|
1510
1561
|
const candidateRank = branchRank.get(candidate) ?? Number.MAX_SAFE_INTEGER;
|
|
1511
|
-
if (candidateRank < chosenRank || candidateRank === chosenRank &&
|
|
1562
|
+
if (candidateRank < chosenRank || candidateRank === chosenRank && chunkA42GCBGX_cjs.compareStrings(candidate, chosen) < 0) {
|
|
1512
1563
|
chosen = candidate;
|
|
1513
1564
|
chosenRank = candidateRank;
|
|
1514
1565
|
}
|
|
@@ -1601,20 +1652,20 @@ function resolveDeleteModifyOver(modified, deleted, modifiedEntity, deletedEntit
|
|
|
1601
1652
|
}
|
|
1602
1653
|
return {
|
|
1603
1654
|
survivingModifications: [...survivingModifications].sort((left, right) => {
|
|
1604
|
-
const byId2 =
|
|
1655
|
+
const byId2 = chunkA42GCBGX_cjs.compareStrings(
|
|
1605
1656
|
modifiedEntity(left).id,
|
|
1606
1657
|
modifiedEntity(right).id
|
|
1607
1658
|
);
|
|
1608
|
-
return byId2 === 0 ?
|
|
1659
|
+
return byId2 === 0 ? chunkA42GCBGX_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
1609
1660
|
}),
|
|
1610
1661
|
deletions: [...deletions].sort(
|
|
1611
|
-
(left, right) =>
|
|
1662
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id)
|
|
1612
1663
|
),
|
|
1613
1664
|
conflicts: [...conflicts].sort(
|
|
1614
|
-
(left, right) =>
|
|
1665
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left.entityId, right.entityId)
|
|
1615
1666
|
),
|
|
1616
1667
|
dropped: [...dropped].sort(
|
|
1617
|
-
(left, right) =>
|
|
1668
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id)
|
|
1618
1669
|
)
|
|
1619
1670
|
};
|
|
1620
1671
|
}
|
|
@@ -1658,11 +1709,11 @@ function reconcileOver(survivingModifications, entityOf, rebuild, policy, branch
|
|
|
1658
1709
|
}
|
|
1659
1710
|
return {
|
|
1660
1711
|
survivingModifications: [...out].sort((left, right) => {
|
|
1661
|
-
const byId2 =
|
|
1662
|
-
return byId2 === 0 ?
|
|
1712
|
+
const byId2 = chunkA42GCBGX_cjs.compareStrings(entityOf(left).id, entityOf(right).id);
|
|
1713
|
+
return byId2 === 0 ? chunkA42GCBGX_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
1663
1714
|
}),
|
|
1664
1715
|
conflicts: conflicts.sort(
|
|
1665
|
-
(left, right) =>
|
|
1716
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(
|
|
1666
1717
|
`${left.entityId}|${left.property}`,
|
|
1667
1718
|
`${right.entityId}|${right.property}`
|
|
1668
1719
|
)
|
|
@@ -1696,7 +1747,7 @@ function threeWayMergeProps(entityId, kind, baseProps, contributions, context, b
|
|
|
1696
1747
|
propertyNames.add(name);
|
|
1697
1748
|
}
|
|
1698
1749
|
}
|
|
1699
|
-
for (const property of [...propertyNames].sort(
|
|
1750
|
+
for (const property of [...propertyNames].sort(chunkA42GCBGX_cjs.compareStrings)) {
|
|
1700
1751
|
const baseHas = property in baseProps;
|
|
1701
1752
|
const baseKey = baseHas ? canonicalValueKey(baseProps[property]) : void 0;
|
|
1702
1753
|
const changed = contributions.filter((contribution) => {
|
|
@@ -1833,7 +1884,7 @@ function unionEdgeProps(survivorId, kind, survivor, edges, context, branchRank,
|
|
|
1833
1884
|
const conflicts = [];
|
|
1834
1885
|
const contributions = edges.map((edge) => edge.staged);
|
|
1835
1886
|
for (const property of [...propertyNames].sort(
|
|
1836
|
-
(left, right) =>
|
|
1887
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)
|
|
1837
1888
|
)) {
|
|
1838
1889
|
const values = collectConflictingValues(property, contributions);
|
|
1839
1890
|
if (values.length === 0) {
|
|
@@ -1902,7 +1953,7 @@ function repointEdges(stagedEdges, canonicalOf, deletedNodeIds, policy, branchRa
|
|
|
1902
1953
|
const merged = [];
|
|
1903
1954
|
const conflicts = [];
|
|
1904
1955
|
const sortedGroups = [...dedupeKeyByGroup.keys()].sort(
|
|
1905
|
-
(left, right) =>
|
|
1956
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)
|
|
1906
1957
|
);
|
|
1907
1958
|
for (const group of sortedGroups) {
|
|
1908
1959
|
const dedupeKeys = [...dedupeKeyByGroup.get(group)];
|
|
@@ -1914,7 +1965,7 @@ function repointEdges(stagedEdges, canonicalOf, deletedNodeIds, policy, branchRa
|
|
|
1914
1965
|
}
|
|
1915
1966
|
const survivor = pickSurvivor(groupEdges, preferredBranchId);
|
|
1916
1967
|
const survivorId = survivor.staged.id;
|
|
1917
|
-
const mergedIds = [...groupEdges].map((edge) => edge.staged.id).sort((left, right) =>
|
|
1968
|
+
const mergedIds = [...groupEdges].map((edge) => edge.staged.id).sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right));
|
|
1918
1969
|
const fromId = idOf(survivor.fromKey);
|
|
1919
1970
|
const fromKind = kindOf(survivor.fromKey);
|
|
1920
1971
|
const toId = idOf(survivor.toKey);
|
|
@@ -1963,12 +2014,12 @@ function repointEdges(stagedEdges, canonicalOf, deletedNodeIds, policy, branchRa
|
|
|
1963
2014
|
mergeKey(edge.toKind, edge.toId),
|
|
1964
2015
|
edge.props
|
|
1965
2016
|
)
|
|
1966
|
-
})).sort((left, right) =>
|
|
2017
|
+
})).sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left.sortKey, right.sortKey)).map(({ edge }) => edge);
|
|
1967
2018
|
return {
|
|
1968
2019
|
edges: sortedEdges,
|
|
1969
|
-
dropped: dropped.sort((left, right) =>
|
|
2020
|
+
dropped: dropped.sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id)),
|
|
1970
2021
|
conflicts: conflicts.sort(
|
|
1971
|
-
(left, right) =>
|
|
2022
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(
|
|
1972
2023
|
`${left.entityId}|${left.property}`,
|
|
1973
2024
|
`${right.entityId}|${right.property}`
|
|
1974
2025
|
)
|
|
@@ -2097,7 +2148,7 @@ function normalizeMergeOptions(options = {}) {
|
|
|
2097
2148
|
...provenanceWeights === void 0 ? {} : { provenanceWeights }
|
|
2098
2149
|
};
|
|
2099
2150
|
}
|
|
2100
|
-
var Provenance =
|
|
2151
|
+
var Provenance = chunkCK5BVQOW_cjs.defineNode("Provenance", {
|
|
2101
2152
|
schema: zod.z.object({
|
|
2102
2153
|
targetGraphId: zod.z.string(),
|
|
2103
2154
|
role: zod.z.enum(["node", "edge"]),
|
|
@@ -2111,14 +2162,14 @@ function provenanceGraphId(targetGraphId) {
|
|
|
2111
2162
|
return `${targetGraphId}::merge-provenance`;
|
|
2112
2163
|
}
|
|
2113
2164
|
function buildProvenanceGraph(targetGraphId) {
|
|
2114
|
-
return
|
|
2165
|
+
return chunkVPYHY3LJ_cjs.defineGraph({
|
|
2115
2166
|
id: provenanceGraphId(targetGraphId),
|
|
2116
2167
|
nodes: { Provenance: { type: Provenance } },
|
|
2117
2168
|
edges: {}
|
|
2118
2169
|
});
|
|
2119
2170
|
}
|
|
2120
2171
|
async function openProvenanceStore(backend, targetGraphId) {
|
|
2121
|
-
const [store] = await
|
|
2172
|
+
const [store] = await chunkJ7WFGBJR_cjs.createStoreWithSchema(
|
|
2122
2173
|
buildProvenanceGraph(targetGraphId),
|
|
2123
2174
|
backend
|
|
2124
2175
|
);
|
|
@@ -2138,7 +2189,7 @@ async function provenanceNodeId(targetGraphId, record) {
|
|
|
2138
2189
|
record.branchId,
|
|
2139
2190
|
record.sourceId
|
|
2140
2191
|
].join(ID_SEPARATOR);
|
|
2141
|
-
const digest = await
|
|
2192
|
+
const digest = await chunkTEDRJXOG_cjs.sha256Hex(tuple, ID_DIGEST_BYTES);
|
|
2142
2193
|
return `prov_${digest}`;
|
|
2143
2194
|
}
|
|
2144
2195
|
async function persistProvenanceRecords(store, targetGraphId, records) {
|
|
@@ -2165,7 +2216,7 @@ async function readProvenance(store, query = {}) {
|
|
|
2165
2216
|
const all = await store.nodes.Provenance.find();
|
|
2166
2217
|
return all.filter(
|
|
2167
2218
|
(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)
|
|
2168
|
-
).sort((left, right) =>
|
|
2219
|
+
).sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id));
|
|
2169
2220
|
}
|
|
2170
2221
|
|
|
2171
2222
|
// src/graph-merge/sources.ts
|
|
@@ -2175,10 +2226,10 @@ function orderEndpoints(left, right) {
|
|
|
2175
2226
|
return compareMergeKeys(leftKey, rightKey) <= 0 ? { a: leftKey, b: rightKey, left, right } : { a: rightKey, b: leftKey, left: right, right: left };
|
|
2176
2227
|
}
|
|
2177
2228
|
function sortMembersById(members) {
|
|
2178
|
-
return [...members].sort((left, right) =>
|
|
2229
|
+
return [...members].sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id));
|
|
2179
2230
|
}
|
|
2180
2231
|
function sortedBucketKeys(blocks) {
|
|
2181
|
-
return [...blocks.keys()].sort((left, right) =>
|
|
2232
|
+
return [...blocks.keys()].sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right));
|
|
2182
2233
|
}
|
|
2183
2234
|
var NODE_SYSTEM_FIELDS = /* @__PURE__ */ new Set(["id", "kind", "meta"]);
|
|
2184
2235
|
function nodeProps(node) {
|
|
@@ -2206,7 +2257,7 @@ function windowedPairs(members, config) {
|
|
|
2206
2257
|
key: fieldText(node, config.sortFields)
|
|
2207
2258
|
}));
|
|
2208
2259
|
keyed.sort(
|
|
2209
|
-
(left, right) => left.key === right.key ?
|
|
2260
|
+
(left, right) => left.key === right.key ? chunkA42GCBGX_cjs.compareStrings(left.node.id, right.node.id) : chunkA42GCBGX_cjs.compareStrings(left.key, right.key)
|
|
2210
2261
|
);
|
|
2211
2262
|
const pairs = [];
|
|
2212
2263
|
for (let index = 0; index < keyed.length; index += 1) {
|
|
@@ -2264,7 +2315,7 @@ function ontologyRetypeEdges(stagedIdentities, isRetypeCompatible) {
|
|
|
2264
2315
|
}
|
|
2265
2316
|
}
|
|
2266
2317
|
const edges = [];
|
|
2267
|
-
for (const id of [...identitiesById.keys()].sort(
|
|
2318
|
+
for (const id of [...identitiesById.keys()].sort(chunkA42GCBGX_cjs.compareStrings)) {
|
|
2268
2319
|
const identities = [...new Set(identitiesById.get(id))].sort(
|
|
2269
2320
|
compareMergeKeys
|
|
2270
2321
|
);
|
|
@@ -2356,7 +2407,7 @@ var baseUniqueSource = {
|
|
|
2356
2407
|
const forcedEdges = [];
|
|
2357
2408
|
const baseMembers = /* @__PURE__ */ new Map();
|
|
2358
2409
|
const constraints = [...uniqueConstraints].sort(
|
|
2359
|
-
(left, right) =>
|
|
2410
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left.name, right.name)
|
|
2360
2411
|
);
|
|
2361
2412
|
const items = nodes.map((node) => ({ props: nodeProps(node) }));
|
|
2362
2413
|
const matchesByConstraint = await Promise.all(
|
|
@@ -2399,7 +2450,7 @@ var baseUniqueSource = {
|
|
|
2399
2450
|
pairs: [],
|
|
2400
2451
|
forcedEdges,
|
|
2401
2452
|
baseMembers: [...baseMembers.values()].sort(
|
|
2402
|
-
(left, right) =>
|
|
2453
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id)
|
|
2403
2454
|
)
|
|
2404
2455
|
};
|
|
2405
2456
|
}
|
|
@@ -2456,7 +2507,7 @@ var baseKeySource = {
|
|
|
2456
2507
|
pairs,
|
|
2457
2508
|
forcedEdges: [],
|
|
2458
2509
|
baseMembers: [...baseMembers.values()].sort(
|
|
2459
|
-
(left, right) =>
|
|
2510
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id)
|
|
2460
2511
|
)
|
|
2461
2512
|
};
|
|
2462
2513
|
}
|
|
@@ -2468,16 +2519,16 @@ var CANDIDATE_SOURCES = [
|
|
|
2468
2519
|
|
|
2469
2520
|
// src/graph-merge/staging.ts
|
|
2470
2521
|
function compareByIdThenBranch(left, right) {
|
|
2471
|
-
const byId2 =
|
|
2472
|
-
return byId2 === 0 ?
|
|
2522
|
+
const byId2 = chunkA42GCBGX_cjs.compareStrings(left.id, right.id);
|
|
2523
|
+
return byId2 === 0 ? chunkA42GCBGX_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
2473
2524
|
}
|
|
2474
2525
|
function compareByKindIdBranch(left, right) {
|
|
2475
|
-
const byKind =
|
|
2526
|
+
const byKind = chunkA42GCBGX_cjs.compareStrings(left.kind, right.kind);
|
|
2476
2527
|
if (byKind !== 0) {
|
|
2477
2528
|
return byKind;
|
|
2478
2529
|
}
|
|
2479
|
-
const byId2 =
|
|
2480
|
-
return byId2 === 0 ?
|
|
2530
|
+
const byId2 = chunkA42GCBGX_cjs.compareStrings(left.id, right.id);
|
|
2531
|
+
return byId2 === 0 ? chunkA42GCBGX_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
2481
2532
|
}
|
|
2482
2533
|
function groupByKind(items) {
|
|
2483
2534
|
const buckets = /* @__PURE__ */ new Map();
|
|
@@ -2491,7 +2542,7 @@ function groupByKind(items) {
|
|
|
2491
2542
|
}
|
|
2492
2543
|
const ordered = /* @__PURE__ */ new Map();
|
|
2493
2544
|
for (const kind of [...buckets.keys()].sort(
|
|
2494
|
-
(left, right) =>
|
|
2545
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)
|
|
2495
2546
|
)) {
|
|
2496
2547
|
ordered.set(
|
|
2497
2548
|
kind,
|
|
@@ -2606,7 +2657,7 @@ async function withTxConflictRetry(commit) {
|
|
|
2606
2657
|
// src/graph-merge/type-reconcile.ts
|
|
2607
2658
|
var INCOMPATIBLE_TYPES_FLAG_REASON = "type-reconcile:incompatible-kinds";
|
|
2608
2659
|
function distinctKinds(kinds) {
|
|
2609
|
-
return [...new Set(kinds)].sort((left, right) =>
|
|
2660
|
+
return [...new Set(kinds)].sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right));
|
|
2610
2661
|
}
|
|
2611
2662
|
function areEquivalent(closure, left, right) {
|
|
2612
2663
|
return left !== right && isReachable2(closure, left, right) && isReachable2(closure, right, left);
|
|
@@ -2624,7 +2675,7 @@ function mostSpecificCommonKind(closure, kinds) {
|
|
|
2624
2675
|
if (qualifiers.length === 0) {
|
|
2625
2676
|
return void 0;
|
|
2626
2677
|
}
|
|
2627
|
-
return [...qualifiers].sort((left, right) =>
|
|
2678
|
+
return [...qualifiers].sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right))[0];
|
|
2628
2679
|
}
|
|
2629
2680
|
function reconcileTypes(clusters, closure, mode) {
|
|
2630
2681
|
if (mode === "off") {
|
|
@@ -2661,10 +2712,10 @@ function reconcileTypes(clusters, closure, mode) {
|
|
|
2661
2712
|
}
|
|
2662
2713
|
return {
|
|
2663
2714
|
reconciliations: reconciliations.sort(
|
|
2664
|
-
(left, right) =>
|
|
2715
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left.entityId, right.entityId)
|
|
2665
2716
|
),
|
|
2666
2717
|
retypeMap,
|
|
2667
|
-
dropped: dropped.sort((left, right) =>
|
|
2718
|
+
dropped: dropped.sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left.id, right.id))
|
|
2668
2719
|
};
|
|
2669
2720
|
}
|
|
2670
2721
|
|
|
@@ -2683,8 +2734,8 @@ function newNodesByKind(staging) {
|
|
|
2683
2734
|
ordered.set(
|
|
2684
2735
|
kind,
|
|
2685
2736
|
[...items].sort((left, right) => {
|
|
2686
|
-
const byId2 =
|
|
2687
|
-
return byId2 === 0 ?
|
|
2737
|
+
const byId2 = chunkA42GCBGX_cjs.compareStrings(left.node.id, right.node.id);
|
|
2738
|
+
return byId2 === 0 ? chunkA42GCBGX_cjs.compareStrings(left.branchId, right.branchId) : byId2;
|
|
2688
2739
|
})
|
|
2689
2740
|
);
|
|
2690
2741
|
}
|
|
@@ -2716,7 +2767,7 @@ async function precomputeEmbeddings(byKind, resolve, embedder) {
|
|
|
2716
2767
|
return lookup;
|
|
2717
2768
|
}
|
|
2718
2769
|
const orderedTexts = [...texts].sort(
|
|
2719
|
-
(left, right) =>
|
|
2770
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)
|
|
2720
2771
|
);
|
|
2721
2772
|
const vectors = await embedder(orderedTexts);
|
|
2722
2773
|
if (vectors.length !== orderedTexts.length) {
|
|
@@ -2752,7 +2803,7 @@ async function embedMissingPairTexts(base, pairs, strategy, embedder) {
|
|
|
2752
2803
|
return existing;
|
|
2753
2804
|
}
|
|
2754
2805
|
const orderedTexts = [...missing].sort(
|
|
2755
|
-
(left, right) =>
|
|
2806
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)
|
|
2756
2807
|
);
|
|
2757
2808
|
const vectors = await embedder(orderedTexts);
|
|
2758
2809
|
if (vectors.length !== orderedTexts.length) {
|
|
@@ -2782,7 +2833,7 @@ async function generateAllCandidates(target, staging, options, introspectionKind
|
|
|
2782
2833
|
async ([kind, items]) => {
|
|
2783
2834
|
const resolveConfig = options.resolve[kind];
|
|
2784
2835
|
if (resolveConfig === void 0) {
|
|
2785
|
-
return
|
|
2836
|
+
return chunkFL472AMI_cjs.ok({ edges: [], warnings: [], baseMembers: [] });
|
|
2786
2837
|
}
|
|
2787
2838
|
const nodes = items.map((staged) => asNode(staged));
|
|
2788
2839
|
const uniqueConstraints = uniqueConstraintsFor(
|
|
@@ -2825,10 +2876,10 @@ async function generateAllCandidates(target, staging, options, introspectionKind
|
|
|
2825
2876
|
options.onComparisonCeiling,
|
|
2826
2877
|
options.maxComparisonsPerKind
|
|
2827
2878
|
);
|
|
2828
|
-
if (
|
|
2829
|
-
return
|
|
2879
|
+
if (chunkFL472AMI_cjs.isErr(scored)) {
|
|
2880
|
+
return chunkFL472AMI_cjs.err(scored.error);
|
|
2830
2881
|
}
|
|
2831
|
-
return
|
|
2882
|
+
return chunkFL472AMI_cjs.ok({
|
|
2832
2883
|
edges: scored.data.edges,
|
|
2833
2884
|
warnings: scored.data.warnings.map(
|
|
2834
2885
|
(warning) => `[${kind}] ${warning.message}`
|
|
@@ -2839,14 +2890,14 @@ async function generateAllCandidates(target, staging, options, introspectionKind
|
|
|
2839
2890
|
)
|
|
2840
2891
|
);
|
|
2841
2892
|
for (const result of perKind) {
|
|
2842
|
-
if (
|
|
2843
|
-
return
|
|
2893
|
+
if (chunkFL472AMI_cjs.isErr(result)) {
|
|
2894
|
+
return chunkFL472AMI_cjs.err(result.error);
|
|
2844
2895
|
}
|
|
2845
2896
|
allEdges.push(...result.data.edges);
|
|
2846
2897
|
warnings.push(...result.data.warnings);
|
|
2847
2898
|
baseMembers.push(...result.data.baseMembers);
|
|
2848
2899
|
}
|
|
2849
|
-
return
|
|
2900
|
+
return chunkFL472AMI_cjs.ok({
|
|
2850
2901
|
// The ONE shared `(a, b)` edge comparator (id-first `(kind, id)` order), so this
|
|
2851
2902
|
// stage emits edges in exactly the order clustering consumes them.
|
|
2852
2903
|
edges: allEdges.sort((left, right) => compareCandidateEdges(left, right)),
|
|
@@ -2949,9 +3000,9 @@ function buildProvenanceIndex(records) {
|
|
|
2949
3000
|
for (const [branchId, sets] of byBranch) {
|
|
2950
3001
|
frozen.set(branchId, {
|
|
2951
3002
|
nodeIds: [...sets.nodeIds].sort(
|
|
2952
|
-
(left, right) =>
|
|
3003
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)
|
|
2953
3004
|
),
|
|
2954
|
-
edgeIds: [...sets.edgeIds].sort((left, right) =>
|
|
3005
|
+
edgeIds: [...sets.edgeIds].sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right)).map((id) => id)
|
|
2955
3006
|
});
|
|
2956
3007
|
}
|
|
2957
3008
|
return {
|
|
@@ -3166,7 +3217,7 @@ function planMerge(staging, candidateEdges, candidateWarnings, baseMembers, opti
|
|
|
3166
3217
|
...repoint2.dropped,
|
|
3167
3218
|
...reconciliation.dropped
|
|
3168
3219
|
].sort(
|
|
3169
|
-
(left, right) =>
|
|
3220
|
+
(left, right) => chunkA42GCBGX_cjs.compareStrings(`${left.kind}|${left.id}`, `${right.kind}|${right.id}`)
|
|
3170
3221
|
);
|
|
3171
3222
|
return {
|
|
3172
3223
|
canonicalEntities,
|
|
@@ -3199,7 +3250,7 @@ function planMerge(staging, candidateEdges, candidateWarnings, baseMembers, opti
|
|
|
3199
3250
|
mergeKey(left.kind, left.entityId),
|
|
3200
3251
|
mergeKey(right.kind, right.entityId)
|
|
3201
3252
|
);
|
|
3202
|
-
return byEntity === 0 ?
|
|
3253
|
+
return byEntity === 0 ? chunkA42GCBGX_cjs.compareStrings(left.property, right.property) : byEntity;
|
|
3203
3254
|
}
|
|
3204
3255
|
),
|
|
3205
3256
|
deleteModifyConflicts: [
|
|
@@ -3339,13 +3390,50 @@ async function commitPlan(target, plan, expectedBaseVersion) {
|
|
|
3339
3390
|
tx.nodes,
|
|
3340
3391
|
tx.edges
|
|
3341
3392
|
);
|
|
3342
|
-
},
|
|
3393
|
+
}, mergeCommitTransactionOptions(target))
|
|
3343
3394
|
);
|
|
3344
3395
|
}
|
|
3345
3396
|
var MERGE_COMMIT_TX_OPTIONS = {
|
|
3346
3397
|
isolationLevel: "serializable"
|
|
3347
3398
|
};
|
|
3399
|
+
function mergeCommitTransactionOptions(target) {
|
|
3400
|
+
return target.historyEnabled ? void 0 : MERGE_COMMIT_TX_OPTIONS;
|
|
3401
|
+
}
|
|
3348
3402
|
async function assertTargetUnchanged(txBackend, target, expectedBaseVersion) {
|
|
3403
|
+
if (hasRevisionAnchor(expectedBaseVersion)) {
|
|
3404
|
+
await chunkXOX22WHL_cjs.lockRecordedGraphWrite(txBackend, target.graphId);
|
|
3405
|
+
const expectedOrigin = revisionOriginOf(expectedBaseVersion);
|
|
3406
|
+
const liveOrigin = await chunkXOX22WHL_cjs.readRevisionOrigin(
|
|
3407
|
+
txBackend,
|
|
3408
|
+
target.revisionSchema,
|
|
3409
|
+
target.graphId
|
|
3410
|
+
);
|
|
3411
|
+
if (liveOrigin !== expectedOrigin) {
|
|
3412
|
+
throw new BaseVersionMismatchError(
|
|
3413
|
+
"The merge branch was forked from a different revision-tracked store; the resolved plan was not applied.",
|
|
3414
|
+
{
|
|
3415
|
+
details: { expectedOrigin, liveOrigin },
|
|
3416
|
+
suggestion: "Merge the branch back into its original base store, or fork a new branch from this target."
|
|
3417
|
+
}
|
|
3418
|
+
);
|
|
3419
|
+
}
|
|
3420
|
+
const liveRevision = await chunkXOX22WHL_cjs.readRecordedClock(
|
|
3421
|
+
txBackend,
|
|
3422
|
+
target.revisionSchema,
|
|
3423
|
+
target.graphId
|
|
3424
|
+
);
|
|
3425
|
+
const expectedRevision = revisionAnchorOf(expectedBaseVersion);
|
|
3426
|
+
if (liveRevision !== expectedRevision) {
|
|
3427
|
+
throw new BaseVersionMismatchError(
|
|
3428
|
+
"The merge target was modified between the revision-anchor check and the commit transaction; the resolved plan was not applied.",
|
|
3429
|
+
{
|
|
3430
|
+
details: { expectedRevision, liveRevision },
|
|
3431
|
+
suggestion: "Re-run the merge (and re-branch if the divergence is real), or route all graph writes through the revision-tracked Store."
|
|
3432
|
+
}
|
|
3433
|
+
);
|
|
3434
|
+
}
|
|
3435
|
+
return;
|
|
3436
|
+
}
|
|
3349
3437
|
const liveContent = await computeContentComponent(
|
|
3350
3438
|
txBackend,
|
|
3351
3439
|
target.graphId,
|
|
@@ -3387,7 +3475,7 @@ async function validateBaseVersions(target, branches) {
|
|
|
3387
3475
|
const targetVersion = await computeBaseVersion(target);
|
|
3388
3476
|
for (const branch2 of branches) {
|
|
3389
3477
|
if (branch2.base !== targetVersion) {
|
|
3390
|
-
return
|
|
3478
|
+
return chunkFL472AMI_cjs.err(
|
|
3391
3479
|
new BaseVersionMismatchError(
|
|
3392
3480
|
`Branch "${branch2.id}" forked from base@V "${branch2.base}", which does not match the merge target's current base@V "${targetVersion}".`,
|
|
3393
3481
|
{
|
|
@@ -3401,20 +3489,20 @@ async function validateBaseVersions(target, branches) {
|
|
|
3401
3489
|
);
|
|
3402
3490
|
}
|
|
3403
3491
|
}
|
|
3404
|
-
return
|
|
3492
|
+
return chunkFL472AMI_cjs.ok(targetVersion);
|
|
3405
3493
|
}
|
|
3406
3494
|
function tryNormalize(optionsInput) {
|
|
3407
3495
|
try {
|
|
3408
|
-
return
|
|
3496
|
+
return chunkFL472AMI_cjs.ok(normalizeMergeOptions(optionsInput));
|
|
3409
3497
|
} catch (error) {
|
|
3410
|
-
return
|
|
3498
|
+
return chunkFL472AMI_cjs.err(new MergeError("Invalid merge options.", { cause: error }));
|
|
3411
3499
|
}
|
|
3412
3500
|
}
|
|
3413
3501
|
async function resolveMerge(store, target, branches, options, useBaseSources, incremental, expectedBaseVersion) {
|
|
3414
3502
|
let targetBranchSeen = false;
|
|
3415
3503
|
for (const branch2 of branches) {
|
|
3416
3504
|
if (branch2.id === BASE_PROVENANCE_BRANCH) {
|
|
3417
|
-
return
|
|
3505
|
+
return chunkFL472AMI_cjs.err(
|
|
3418
3506
|
new MergeError(
|
|
3419
3507
|
`Branch id "${BASE_PROVENANCE_BRANCH}" is reserved for committed-base provenance and cannot be used as a branch id.`,
|
|
3420
3508
|
{ details: { branchId: branch2.id } }
|
|
@@ -3423,7 +3511,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
3423
3511
|
}
|
|
3424
3512
|
if (branch2.id === COMMITTED_TARGET_BRANCH) {
|
|
3425
3513
|
if (incremental?.targetBranchId !== COMMITTED_TARGET_BRANCH || targetBranchSeen) {
|
|
3426
|
-
return
|
|
3514
|
+
return chunkFL472AMI_cjs.err(
|
|
3427
3515
|
new MergeError(
|
|
3428
3516
|
`Branch id "${COMMITTED_TARGET_BRANCH}" is reserved for the committed incremental target and cannot be used as a branch id.`,
|
|
3429
3517
|
{ details: { branchId: branch2.id } }
|
|
@@ -3468,8 +3556,8 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
3468
3556
|
useBaseSources,
|
|
3469
3557
|
options.embedder
|
|
3470
3558
|
);
|
|
3471
|
-
if (
|
|
3472
|
-
return
|
|
3559
|
+
if (chunkFL472AMI_cjs.isErr(candidates)) {
|
|
3560
|
+
return chunkFL472AMI_cjs.err(candidates.error);
|
|
3473
3561
|
}
|
|
3474
3562
|
const plan = planMerge(
|
|
3475
3563
|
staging,
|
|
@@ -3529,12 +3617,12 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
3529
3617
|
warnings,
|
|
3530
3618
|
...provenancePersisted === void 0 ? {} : { provenancePersisted }
|
|
3531
3619
|
};
|
|
3532
|
-
return
|
|
3620
|
+
return chunkFL472AMI_cjs.ok(report);
|
|
3533
3621
|
} catch (error) {
|
|
3534
3622
|
if (error instanceof MergeError) {
|
|
3535
|
-
return
|
|
3623
|
+
return chunkFL472AMI_cjs.err(error);
|
|
3536
3624
|
}
|
|
3537
|
-
return
|
|
3625
|
+
return chunkFL472AMI_cjs.err(
|
|
3538
3626
|
new MergeError(
|
|
3539
3627
|
`Merge failed while staging or committing: ${describeCause(error)}`,
|
|
3540
3628
|
{ cause: error }
|
|
@@ -3544,14 +3632,14 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
3544
3632
|
}
|
|
3545
3633
|
async function merge(store, branches, optionsInput = {}) {
|
|
3546
3634
|
const normalized = tryNormalize(optionsInput);
|
|
3547
|
-
if (
|
|
3548
|
-
return
|
|
3635
|
+
if (chunkFL472AMI_cjs.isErr(normalized)) {
|
|
3636
|
+
return chunkFL472AMI_cjs.err(normalized.error);
|
|
3549
3637
|
}
|
|
3550
3638
|
const options = normalized.data;
|
|
3551
3639
|
const target = options.target ?? store;
|
|
3552
3640
|
const precondition = await validateBaseVersions(target, branches);
|
|
3553
|
-
if (
|
|
3554
|
-
return
|
|
3641
|
+
if (chunkFL472AMI_cjs.isErr(precondition)) {
|
|
3642
|
+
return chunkFL472AMI_cjs.err(precondition.error);
|
|
3555
3643
|
}
|
|
3556
3644
|
return resolveMerge(
|
|
3557
3645
|
store,
|
|
@@ -3567,7 +3655,7 @@ async function validateForkPointVersions(forkPoint, branches) {
|
|
|
3567
3655
|
const forkVersion = await computeBaseVersion(forkPoint);
|
|
3568
3656
|
for (const branch2 of branches) {
|
|
3569
3657
|
if (branch2.base !== forkVersion) {
|
|
3570
|
-
return
|
|
3658
|
+
return chunkFL472AMI_cjs.err(
|
|
3571
3659
|
new BaseVersionMismatchError(
|
|
3572
3660
|
`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.`,
|
|
3573
3661
|
{
|
|
@@ -3581,7 +3669,7 @@ async function validateForkPointVersions(forkPoint, branches) {
|
|
|
3581
3669
|
);
|
|
3582
3670
|
}
|
|
3583
3671
|
}
|
|
3584
|
-
return
|
|
3672
|
+
return chunkFL472AMI_cjs.ok(forkVersion);
|
|
3585
3673
|
}
|
|
3586
3674
|
function nodeSchemaFor(target, kind) {
|
|
3587
3675
|
const registry = target.graph.nodes;
|
|
@@ -3792,7 +3880,7 @@ async function validateIncrementalEdgeWrites(target, edgesApi, plan) {
|
|
|
3792
3880
|
}
|
|
3793
3881
|
}
|
|
3794
3882
|
}
|
|
3795
|
-
const notFound = [...plannedKindById.keys()].filter((id) => !existingById.has(id)).sort((left, right) =>
|
|
3883
|
+
const notFound = [...plannedKindById.keys()].filter((id) => !existingById.has(id)).sort((left, right) => chunkA42GCBGX_cjs.compareStrings(left, right));
|
|
3796
3884
|
if (notFound.length > 0) {
|
|
3797
3885
|
const crossKindById = /* @__PURE__ */ new Map();
|
|
3798
3886
|
for (const kind of Object.keys(target.graph.edges)) {
|
|
@@ -4023,6 +4111,9 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
4023
4111
|
}
|
|
4024
4112
|
return withTxConflictRetry(
|
|
4025
4113
|
() => target.transaction(async (tx) => {
|
|
4114
|
+
if (target.revisionTrackingEnabled) {
|
|
4115
|
+
await chunkXOX22WHL_cjs.lockRecordedGraphWrite(tx.backend, target.graphId);
|
|
4116
|
+
}
|
|
4026
4117
|
const nodesApi = tx.nodes;
|
|
4027
4118
|
const edgesApi = tx.edges;
|
|
4028
4119
|
await assertBaseResolutionStable(tx, guard);
|
|
@@ -4030,18 +4121,18 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
4030
4121
|
await validateIncrementalNodeWrites(target, nodesApi, plan);
|
|
4031
4122
|
await validateIncrementalEdgeWrites(target, edgesApi, plan);
|
|
4032
4123
|
return applyMergePlan(plan, nodesApi, edgesApi);
|
|
4033
|
-
},
|
|
4124
|
+
}, mergeCommitTransactionOptions(target))
|
|
4034
4125
|
);
|
|
4035
4126
|
}
|
|
4036
4127
|
async function mergeIncremental(args) {
|
|
4037
4128
|
const { forkPoint, target, branches } = args;
|
|
4038
4129
|
const normalized = tryNormalize(args.options ?? {});
|
|
4039
|
-
if (
|
|
4040
|
-
return
|
|
4130
|
+
if (chunkFL472AMI_cjs.isErr(normalized)) {
|
|
4131
|
+
return chunkFL472AMI_cjs.err(normalized.error);
|
|
4041
4132
|
}
|
|
4042
4133
|
const options = normalized.data;
|
|
4043
4134
|
if (options.onBasePropertyConflict !== "flag") {
|
|
4044
|
-
return
|
|
4135
|
+
return chunkFL472AMI_cjs.err(
|
|
4045
4136
|
new MergeError(
|
|
4046
4137
|
'mergeIncremental() requires onBasePropertyConflict: "flag" (keep-base); a non-keep-base policy could overwrite a newer committed base value with a stale branch value.',
|
|
4047
4138
|
{ details: {} }
|
|
@@ -4049,8 +4140,8 @@ async function mergeIncremental(args) {
|
|
|
4049
4140
|
);
|
|
4050
4141
|
}
|
|
4051
4142
|
const forkPrecondition = await validateForkPointVersions(forkPoint, branches);
|
|
4052
|
-
if (
|
|
4053
|
-
return
|
|
4143
|
+
if (chunkFL472AMI_cjs.isErr(forkPrecondition)) {
|
|
4144
|
+
return chunkFL472AMI_cjs.err(forkPrecondition.error);
|
|
4054
4145
|
}
|
|
4055
4146
|
const forkVersion = forkPrecondition.data;
|
|
4056
4147
|
const [forkSchema, targetSchema] = await Promise.all([
|
|
@@ -4058,7 +4149,7 @@ async function mergeIncremental(args) {
|
|
|
4058
4149
|
computeSchemaComponent(target)
|
|
4059
4150
|
]);
|
|
4060
4151
|
if (forkSchema !== targetSchema) {
|
|
4061
|
-
return
|
|
4152
|
+
return chunkFL472AMI_cjs.err(
|
|
4062
4153
|
new MergeError(
|
|
4063
4154
|
"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).",
|
|
4064
4155
|
{ details: {} }
|
|
@@ -4082,15 +4173,15 @@ async function mergeIncremental(args) {
|
|
|
4082
4173
|
|
|
4083
4174
|
Object.defineProperty(exports, "isErr", {
|
|
4084
4175
|
enumerable: true,
|
|
4085
|
-
get: function () { return
|
|
4176
|
+
get: function () { return chunkFL472AMI_cjs.isErr; }
|
|
4086
4177
|
});
|
|
4087
4178
|
Object.defineProperty(exports, "isOk", {
|
|
4088
4179
|
enumerable: true,
|
|
4089
|
-
get: function () { return
|
|
4180
|
+
get: function () { return chunkFL472AMI_cjs.isOk; }
|
|
4090
4181
|
});
|
|
4091
4182
|
Object.defineProperty(exports, "unwrap", {
|
|
4092
4183
|
enumerable: true,
|
|
4093
|
-
get: function () { return
|
|
4184
|
+
get: function () { return chunkFL472AMI_cjs.unwrap; }
|
|
4094
4185
|
});
|
|
4095
4186
|
exports.BaseVersionMismatchError = BaseVersionMismatchError;
|
|
4096
4187
|
exports.BranchError = BranchError;
|