@hawkeyexl/manni 4.13.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/batch-OMDKRGUE.js +48 -0
- package/dist/build-YCY5MUHA.js +37 -0
- package/dist/calibrate-RN2NJ4FS.js +43 -0
- package/dist/capture-2WYROZKA.js +39 -0
- package/dist/check-KRVWHF7E.js +33 -0
- package/dist/{check-NBN2YK2J.js → check-LVUTWAGR.js} +33 -32
- package/dist/{check-NBN2YK2J.js.map → check-LVUTWAGR.js.map} +1 -1
- package/dist/check-MR7IG7IP.js +36 -0
- package/dist/{check-LU5YC3L4.js → check-OIRJ6OBW.js} +15 -14
- package/dist/{chunk-J5NOWIJ3.js → chunk-3CSEHHKB.js} +14 -8
- package/dist/{chunk-J5NOWIJ3.js.map → chunk-3CSEHHKB.js.map} +1 -1
- package/dist/{chunk-7RNONVHI.js → chunk-3EJVJDMX.js} +9 -9
- package/dist/{chunk-LSFXNAHU.js → chunk-3WQMMLIO.js} +129 -59
- package/dist/chunk-3WQMMLIO.js.map +1 -0
- package/dist/{chunk-OREHJQNN.js → chunk-46OWIAAX.js} +5 -4
- package/dist/{chunk-OREHJQNN.js.map → chunk-46OWIAAX.js.map} +1 -1
- package/dist/{chunk-LNGSE7V2.js → chunk-476DMDJ5.js} +132 -27
- package/dist/chunk-476DMDJ5.js.map +1 -0
- package/dist/{chunk-EQ7E6HMG.js → chunk-4MYW2D2U.js} +14 -16
- package/dist/chunk-4MYW2D2U.js.map +1 -0
- package/dist/{chunk-NTEYYYKL.js → chunk-525KMBZS.js} +16 -22
- package/dist/chunk-525KMBZS.js.map +1 -0
- package/dist/{chunk-HIEGOW7X.js → chunk-57DHX65T.js} +5 -79
- package/dist/chunk-57DHX65T.js.map +1 -0
- package/dist/{chunk-PCE7QHXJ.js → chunk-5D24C6WM.js} +6 -1
- package/dist/chunk-5D24C6WM.js.map +1 -0
- package/dist/{chunk-DQOM3DEU.js → chunk-6DYFWAZA.js} +563 -359
- package/dist/chunk-6DYFWAZA.js.map +1 -0
- package/dist/{chunk-CU57HT2E.js → chunk-6WJUZQQX.js} +2 -2
- package/dist/chunk-7EKXSSEO.js +81 -0
- package/dist/chunk-7EKXSSEO.js.map +1 -0
- package/dist/{chunk-ULDV2LUI.js → chunk-7SVFBJBE.js} +10 -4
- package/dist/chunk-7SVFBJBE.js.map +1 -0
- package/dist/{chunk-QKT67PFE.js → chunk-7XHW5DZA.js} +9 -9
- package/dist/{chunk-TDCOKKMI.js → chunk-AL4HRKSZ.js} +3 -3
- package/dist/{chunk-OTJOBZJ5.js → chunk-B2242FYO.js} +2 -1
- package/dist/chunk-B2242FYO.js.map +1 -0
- package/dist/chunk-BREAC43H.js +85 -0
- package/dist/chunk-BREAC43H.js.map +1 -0
- package/dist/{chunk-HKTGHLBA.js → chunk-C37OVJ35.js} +2 -2
- package/dist/{chunk-HKTGHLBA.js.map → chunk-C37OVJ35.js.map} +1 -1
- package/dist/{chunk-YQV75FIL.js → chunk-CFMI74TP.js} +3 -3
- package/dist/{chunk-BMBAAPGN.js → chunk-CWGBRWP7.js} +33 -18
- package/dist/chunk-CWGBRWP7.js.map +1 -0
- package/dist/chunk-DN4LCWSA.js +83 -0
- package/dist/chunk-DN4LCWSA.js.map +1 -0
- package/dist/{chunk-JEUFYSFQ.js → chunk-DW22KCLN.js} +118 -75
- package/dist/chunk-DW22KCLN.js.map +1 -0
- package/dist/{chunk-PCGBXHSE.js → chunk-FEEO7ET6.js} +5 -5
- package/dist/{chunk-CODWRUAD.js → chunk-FYWQS35G.js} +7 -5
- package/dist/chunk-FYWQS35G.js.map +1 -0
- package/dist/{chunk-3O6U4ICM.js → chunk-GLQCSDFS.js} +3 -3
- package/dist/{chunk-BQXY76JB.js → chunk-GUTAKJIF.js} +148 -92
- package/dist/chunk-GUTAKJIF.js.map +1 -0
- package/dist/{chunk-WVXCN5DS.js → chunk-GZHBMMDC.js} +78 -14
- package/dist/chunk-GZHBMMDC.js.map +1 -0
- package/dist/{chunk-52WO7ESI.js → chunk-IE5PXI6M.js} +6 -5
- package/dist/chunk-IE5PXI6M.js.map +1 -0
- package/dist/{chunk-ZXRAE55H.js → chunk-IGRXQC3H.js} +2 -2
- package/dist/{chunk-U6IHLEWT.js → chunk-JCTHXG33.js} +2 -2
- package/dist/{chunk-NSAW7U42.js → chunk-JHE3CYWS.js} +58 -10
- package/dist/chunk-JHE3CYWS.js.map +1 -0
- package/dist/{chunk-6ZFJWUUH.js → chunk-JNMY7KZG.js} +2 -2
- package/dist/chunk-JQPZKWIP.js +76 -0
- package/dist/chunk-JQPZKWIP.js.map +1 -0
- package/dist/{chunk-OBXCJZ6R.js → chunk-JTATFPWB.js} +28 -17
- package/dist/chunk-JTATFPWB.js.map +1 -0
- package/dist/{chunk-3HUCB4Z3.js → chunk-JULE3EU3.js} +10 -7
- package/dist/chunk-JULE3EU3.js.map +1 -0
- package/dist/{chunk-TQ3W6RKG.js → chunk-KCXQXKOL.js} +3 -3
- package/dist/{chunk-VYBYUQIP.js → chunk-KN37BXVY.js} +88 -7
- package/dist/chunk-KN37BXVY.js.map +1 -0
- package/dist/{chunk-OUAH7XF2.js → chunk-MAOX3524.js} +2 -2
- package/dist/chunk-MC7U5IH4.js +126 -0
- package/dist/chunk-MC7U5IH4.js.map +1 -0
- package/dist/{chunk-OYIWF3B2.js → chunk-NIQ2JSZO.js} +29 -20
- package/dist/chunk-NIQ2JSZO.js.map +1 -0
- package/dist/{chunk-HY6ROJTH.js → chunk-OFOIBV5J.js} +86 -10
- package/dist/chunk-OFOIBV5J.js.map +1 -0
- package/dist/{chunk-TZOYZK2E.js → chunk-OZUPJB4J.js} +2 -2
- package/dist/{chunk-N6A6DJUO.js → chunk-Q2VOXKAQ.js} +6 -7
- package/dist/chunk-Q2VOXKAQ.js.map +1 -0
- package/dist/{chunk-GWI6JPTT.js → chunk-Q62Q7CDI.js} +88 -8
- package/dist/chunk-Q62Q7CDI.js.map +1 -0
- package/dist/{chunk-PA7CMQGD.js → chunk-QDO5JFFV.js} +11 -5
- package/dist/chunk-QDO5JFFV.js.map +1 -0
- package/dist/{chunk-VNYXK7TM.js → chunk-QEJ4GH25.js} +8 -8
- package/dist/chunk-QEJ4GH25.js.map +1 -0
- package/dist/chunk-QK6VYJHV.js +26 -0
- package/dist/chunk-QK6VYJHV.js.map +1 -0
- package/dist/chunk-QS2Z3SWL.js +21 -0
- package/dist/chunk-QS2Z3SWL.js.map +1 -0
- package/dist/{chunk-NWUXRV6N.js → chunk-QS3K57OJ.js} +10 -8
- package/dist/chunk-QS3K57OJ.js.map +1 -0
- package/dist/{chunk-OKMTUAWO.js → chunk-QSPH4F56.js} +5 -5
- package/dist/{chunk-3XGTNN3M.js → chunk-RGRNAQG5.js} +12 -124
- package/dist/chunk-RGRNAQG5.js.map +1 -0
- package/dist/{chunk-E6BVUDGY.js → chunk-SLGCRXHM.js} +4 -4
- package/dist/{chunk-KE2F7QES.js → chunk-SVF3WCC7.js} +6 -6
- package/dist/{chunk-IGQMBHFY.js → chunk-T62SFCQY.js} +88 -12
- package/dist/chunk-T62SFCQY.js.map +1 -0
- package/dist/{chunk-SCLXVTFZ.js → chunk-TKINOTVS.js} +1 -1
- package/dist/chunk-TKINOTVS.js.map +1 -0
- package/dist/{chunk-VOXOBUTX.js → chunk-TXZJESES.js} +5 -5
- package/dist/chunk-UPUJJOKB.js +236 -0
- package/dist/chunk-UPUJJOKB.js.map +1 -0
- package/dist/{chunk-7JPL3CUC.js → chunk-URGALOZY.js} +2 -2
- package/dist/{chunk-X4MPUD4B.js → chunk-UVLQRP6O.js} +53 -13
- package/dist/chunk-UVLQRP6O.js.map +1 -0
- package/dist/{chunk-CWXZ2MRT.js → chunk-VHJ72YCD.js} +4 -3
- package/dist/chunk-VHJ72YCD.js.map +1 -0
- package/dist/{chunk-PAU352SV.js → chunk-W4GTMOJW.js} +2 -2
- package/dist/{chunk-SE4JN5XN.js → chunk-WDENIUC7.js} +3 -1
- package/dist/chunk-WDENIUC7.js.map +1 -0
- package/dist/{chunk-3BVDFQ6Y.js → chunk-Y3GWQBJP.js} +5 -5
- package/dist/{chunk-YZ4TJLZQ.js → chunk-YT5HKJWV.js} +497 -18
- package/dist/chunk-YT5HKJWV.js.map +1 -0
- package/dist/{chunk-UQMLCIRX.js → chunk-Z6PZKXSP.js} +6 -6
- package/dist/{chunk-JUL2PRQN.js → chunk-ZC2MZZR5.js} +207 -79
- package/dist/chunk-ZC2MZZR5.js.map +1 -0
- package/dist/{chunk-UKZNLVJW.js → chunk-ZINZTHWO.js} +4 -2
- package/dist/chunk-ZINZTHWO.js.map +1 -0
- package/dist/{cli-4JHQCPHU.js → cli-33E3B2FK.js} +3 -3
- package/dist/{cli-G66X7YMP.js → cli-7JV4RM66.js} +23 -22
- package/dist/{cli-G66X7YMP.js.map → cli-7JV4RM66.js.map} +1 -1
- package/dist/{cli-L5B2RVV2.js → cli-B4DTJ2KC.js} +31 -29
- package/dist/{cli-L5B2RVV2.js.map → cli-B4DTJ2KC.js.map} +1 -1
- package/dist/{cli-ECVT4YXR.js → cli-D4WXCDTS.js} +20 -19
- package/dist/{cli-ECVT4YXR.js.map → cli-D4WXCDTS.js.map} +1 -1
- package/dist/{cli-7DETHSNW.js → cli-DDLLZHZW.js} +90 -84
- package/dist/cli-DDLLZHZW.js.map +1 -0
- package/dist/{cli-KYTCJYXK.js → cli-EVACAD7K.js} +317 -28
- package/dist/cli-EVACAD7K.js.map +1 -0
- package/dist/{cli-H5LVGOVT.js → cli-LIKI7WPR.js} +384 -248
- package/dist/cli-LIKI7WPR.js.map +1 -0
- package/dist/{cli-AZKWTCFV.js → cli-MWUFAS2X.js} +11 -11
- package/dist/{cli-DGFLJ2DD.js → cli-OKPRTVG6.js} +69 -26
- package/dist/cli-OKPRTVG6.js.map +1 -0
- package/dist/{cli-RP5E7XHC.js → cli-QEPVGLQ3.js} +20 -18
- package/dist/{cli-RP5E7XHC.js.map → cli-QEPVGLQ3.js.map} +1 -1
- package/dist/{cli-BW5VOFOZ.js → cli-VP6JTPFS.js} +11 -10
- package/dist/{cli-BW5VOFOZ.js.map → cli-VP6JTPFS.js.map} +1 -1
- package/dist/cli.js +14 -14
- package/dist/{config-JJW75SBX.js → config-7I5CHHRZ.js} +6 -6
- package/dist/docmeta.js +10 -10
- package/dist/github-DV57TW5L.js +32 -0
- package/dist/github-SGX2EARO.js +36 -0
- package/dist/graph/runtime.js.map +1 -1
- package/dist/index.d.ts +222 -45
- package/dist/index.js +138 -132
- package/dist/index.js.map +1 -1
- package/dist/{json-7WV7KL6H.js → json-5EQCGVCV.js} +4 -2
- package/dist/{json-LCVPMEAM.js → json-SHPUCD64.js} +15 -13
- package/dist/{labels-OQXBVM4A.js → labels-3GCGYYV3.js} +14 -12
- package/dist/{labels-OQXBVM4A.js.map → labels-3GCGYYV3.js.map} +1 -1
- package/dist/lint-RE4DMI6E.js +35 -0
- package/dist/list-F56MEJXR.js +36 -0
- package/dist/list-ZR3KY556.js +34 -0
- package/dist/{page-XPX5XJZE.js → page-G7XSO4FD.js} +13 -12
- package/dist/{picker-3XF36MJF.js → picker-FPUC5UGM.js} +3 -3
- package/dist/{prepare-VMBIQYAM.js → prepare-WHMWP7BG.js} +21 -20
- package/dist/{prepare-VMBIQYAM.js.map → prepare-WHMWP7BG.js.map} +1 -1
- package/dist/{pretty-KSTZMBUF.js → pretty-VTJVXWRK.js} +15 -13
- package/dist/{pretty-KG6TMOEI.js → pretty-YVRRWBWN.js} +23 -16
- package/dist/{provider-LBX4IXGX.js → provider-JY2I3VLF.js} +3 -3
- package/dist/{release-VV3UTKE5.js → release-Z3ASYZ3S.js} +3 -3
- package/dist/{reporters-26H3N2KW.js → reporters-FSXJ42EB.js} +6 -5
- package/dist/{reporters-AQU4W3KY.js → reporters-G5R4SURQ.js} +6 -6
- package/dist/{reporters-FBYLPKD4.js → reporters-MHPY4HRA.js} +15 -14
- package/dist/run-FSYOYEPR.js +39 -0
- package/dist/sarif-HBQIDY7T.js +31 -0
- package/dist/sarif-RRUFJZUL.js +37 -0
- package/dist/{term-SI3VM6EM.js → term-ABHGACYE.js} +58 -109
- package/dist/term-ABHGACYE.js.map +1 -0
- package/dist/types-VMOT7RAL.js +12 -0
- package/dist/types-VMOT7RAL.js.map +1 -0
- package/dist/{validate-NQO7TFSN.js → validate-DXYUUGUD.js} +6 -6
- package/dist/validate-DXYUUGUD.js.map +1 -0
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/plugin/manni/skills/check/SKILL.md +2 -2
- package/plugin/manni/skills/evals/SKILL.md +1 -1
- package/plugin/manni/skills/fix/SKILL.md +95 -16
- package/plugin/manni/skills/setup/SKILL.md +1 -1
- package/shapes/graph/shapes-1.1.1.ttl +953 -0
- package/dist/batch-OB2FXT47.js +0 -46
- package/dist/build-4BL24BG3.js +0 -36
- package/dist/calibrate-AEDJ7N7G.js +0 -41
- package/dist/capture-TP3P4YNL.js +0 -38
- package/dist/check-5IYH42KS.js +0 -34
- package/dist/check-S55MH66H.js +0 -30
- package/dist/chunk-3HUCB4Z3.js.map +0 -1
- package/dist/chunk-3XGTNN3M.js.map +0 -1
- package/dist/chunk-52WO7ESI.js.map +0 -1
- package/dist/chunk-BMBAAPGN.js.map +0 -1
- package/dist/chunk-BQXY76JB.js.map +0 -1
- package/dist/chunk-CODWRUAD.js.map +0 -1
- package/dist/chunk-CWXZ2MRT.js.map +0 -1
- package/dist/chunk-DQOM3DEU.js.map +0 -1
- package/dist/chunk-EQ7E6HMG.js.map +0 -1
- package/dist/chunk-GWI6JPTT.js.map +0 -1
- package/dist/chunk-HIEGOW7X.js.map +0 -1
- package/dist/chunk-HY6ROJTH.js.map +0 -1
- package/dist/chunk-IGQMBHFY.js.map +0 -1
- package/dist/chunk-JEUFYSFQ.js.map +0 -1
- package/dist/chunk-JUL2PRQN.js.map +0 -1
- package/dist/chunk-LNGSE7V2.js.map +0 -1
- package/dist/chunk-LSFXNAHU.js.map +0 -1
- package/dist/chunk-MNH7QO4Z.js +0 -15
- package/dist/chunk-MNH7QO4Z.js.map +0 -1
- package/dist/chunk-N6A6DJUO.js.map +0 -1
- package/dist/chunk-NSAW7U42.js.map +0 -1
- package/dist/chunk-NTEYYYKL.js.map +0 -1
- package/dist/chunk-NWUXRV6N.js.map +0 -1
- package/dist/chunk-OBXCJZ6R.js.map +0 -1
- package/dist/chunk-OTJOBZJ5.js.map +0 -1
- package/dist/chunk-OYIWF3B2.js.map +0 -1
- package/dist/chunk-PA7CMQGD.js.map +0 -1
- package/dist/chunk-PCE7QHXJ.js.map +0 -1
- package/dist/chunk-SCLXVTFZ.js.map +0 -1
- package/dist/chunk-SE4JN5XN.js.map +0 -1
- package/dist/chunk-UKZNLVJW.js.map +0 -1
- package/dist/chunk-ULDV2LUI.js.map +0 -1
- package/dist/chunk-VNYXK7TM.js.map +0 -1
- package/dist/chunk-VYBYUQIP.js.map +0 -1
- package/dist/chunk-WVXCN5DS.js.map +0 -1
- package/dist/chunk-X4MPUD4B.js.map +0 -1
- package/dist/chunk-Y6M4JFKG.js +0 -117
- package/dist/chunk-Y6M4JFKG.js.map +0 -1
- package/dist/chunk-YZ4TJLZQ.js.map +0 -1
- package/dist/cli-7DETHSNW.js.map +0 -1
- package/dist/cli-DGFLJ2DD.js.map +0 -1
- package/dist/cli-H5LVGOVT.js.map +0 -1
- package/dist/cli-KYTCJYXK.js.map +0 -1
- package/dist/github-DJQ4MWNZ.js +0 -35
- package/dist/github-UWTDM2J2.js +0 -30
- package/dist/lint-O7XRHKFP.js +0 -34
- package/dist/list-OOOCLOAL.js +0 -35
- package/dist/list-OYQ5XPN2.js +0 -32
- package/dist/run-KUGTU3TT.js +0 -37
- package/dist/term-SI3VM6EM.js.map +0 -1
- package/dist/types-Y6TXHM7M.js +0 -10
- /package/dist/{batch-OB2FXT47.js.map → batch-OMDKRGUE.js.map} +0 -0
- /package/dist/{build-4BL24BG3.js.map → build-YCY5MUHA.js.map} +0 -0
- /package/dist/{calibrate-AEDJ7N7G.js.map → calibrate-RN2NJ4FS.js.map} +0 -0
- /package/dist/{capture-TP3P4YNL.js.map → capture-2WYROZKA.js.map} +0 -0
- /package/dist/{check-5IYH42KS.js.map → check-KRVWHF7E.js.map} +0 -0
- /package/dist/{check-LU5YC3L4.js.map → check-MR7IG7IP.js.map} +0 -0
- /package/dist/{check-S55MH66H.js.map → check-OIRJ6OBW.js.map} +0 -0
- /package/dist/{chunk-7RNONVHI.js.map → chunk-3EJVJDMX.js.map} +0 -0
- /package/dist/{chunk-CU57HT2E.js.map → chunk-6WJUZQQX.js.map} +0 -0
- /package/dist/{chunk-QKT67PFE.js.map → chunk-7XHW5DZA.js.map} +0 -0
- /package/dist/{chunk-TDCOKKMI.js.map → chunk-AL4HRKSZ.js.map} +0 -0
- /package/dist/{chunk-YQV75FIL.js.map → chunk-CFMI74TP.js.map} +0 -0
- /package/dist/{chunk-PCGBXHSE.js.map → chunk-FEEO7ET6.js.map} +0 -0
- /package/dist/{chunk-3O6U4ICM.js.map → chunk-GLQCSDFS.js.map} +0 -0
- /package/dist/{chunk-ZXRAE55H.js.map → chunk-IGRXQC3H.js.map} +0 -0
- /package/dist/{chunk-U6IHLEWT.js.map → chunk-JCTHXG33.js.map} +0 -0
- /package/dist/{chunk-6ZFJWUUH.js.map → chunk-JNMY7KZG.js.map} +0 -0
- /package/dist/{chunk-TQ3W6RKG.js.map → chunk-KCXQXKOL.js.map} +0 -0
- /package/dist/{chunk-OUAH7XF2.js.map → chunk-MAOX3524.js.map} +0 -0
- /package/dist/{chunk-TZOYZK2E.js.map → chunk-OZUPJB4J.js.map} +0 -0
- /package/dist/{chunk-OKMTUAWO.js.map → chunk-QSPH4F56.js.map} +0 -0
- /package/dist/{chunk-E6BVUDGY.js.map → chunk-SLGCRXHM.js.map} +0 -0
- /package/dist/{chunk-KE2F7QES.js.map → chunk-SVF3WCC7.js.map} +0 -0
- /package/dist/{chunk-VOXOBUTX.js.map → chunk-TXZJESES.js.map} +0 -0
- /package/dist/{chunk-7JPL3CUC.js.map → chunk-URGALOZY.js.map} +0 -0
- /package/dist/{chunk-PAU352SV.js.map → chunk-W4GTMOJW.js.map} +0 -0
- /package/dist/{chunk-3BVDFQ6Y.js.map → chunk-Y3GWQBJP.js.map} +0 -0
- /package/dist/{chunk-UQMLCIRX.js.map → chunk-Z6PZKXSP.js.map} +0 -0
- /package/dist/{cli-4JHQCPHU.js.map → cli-33E3B2FK.js.map} +0 -0
- /package/dist/{cli-AZKWTCFV.js.map → cli-MWUFAS2X.js.map} +0 -0
- /package/dist/{config-JJW75SBX.js.map → config-7I5CHHRZ.js.map} +0 -0
- /package/dist/{github-DJQ4MWNZ.js.map → github-DV57TW5L.js.map} +0 -0
- /package/dist/{github-UWTDM2J2.js.map → github-SGX2EARO.js.map} +0 -0
- /package/dist/{json-7WV7KL6H.js.map → json-5EQCGVCV.js.map} +0 -0
- /package/dist/{json-LCVPMEAM.js.map → json-SHPUCD64.js.map} +0 -0
- /package/dist/{lint-O7XRHKFP.js.map → lint-RE4DMI6E.js.map} +0 -0
- /package/dist/{list-OOOCLOAL.js.map → list-F56MEJXR.js.map} +0 -0
- /package/dist/{list-OYQ5XPN2.js.map → list-ZR3KY556.js.map} +0 -0
- /package/dist/{page-XPX5XJZE.js.map → page-G7XSO4FD.js.map} +0 -0
- /package/dist/{picker-3XF36MJF.js.map → picker-FPUC5UGM.js.map} +0 -0
- /package/dist/{pretty-KG6TMOEI.js.map → pretty-VTJVXWRK.js.map} +0 -0
- /package/dist/{pretty-KSTZMBUF.js.map → pretty-YVRRWBWN.js.map} +0 -0
- /package/dist/{provider-LBX4IXGX.js.map → provider-JY2I3VLF.js.map} +0 -0
- /package/dist/{release-VV3UTKE5.js.map → release-Z3ASYZ3S.js.map} +0 -0
- /package/dist/{reporters-26H3N2KW.js.map → reporters-FSXJ42EB.js.map} +0 -0
- /package/dist/{reporters-AQU4W3KY.js.map → reporters-G5R4SURQ.js.map} +0 -0
- /package/dist/{reporters-FBYLPKD4.js.map → reporters-MHPY4HRA.js.map} +0 -0
- /package/dist/{run-KUGTU3TT.js.map → run-FSYOYEPR.js.map} +0 -0
- /package/dist/{types-Y6TXHM7M.js.map → sarif-HBQIDY7T.js.map} +0 -0
- /package/dist/{validate-NQO7TFSN.js.map → sarif-RRUFJZUL.js.map} +0 -0
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
removeFrontmatterCitations,
|
|
10
10
|
removeLine,
|
|
11
11
|
runAdd,
|
|
12
|
+
runHistory,
|
|
12
13
|
runRemove,
|
|
13
14
|
runUpdate,
|
|
14
15
|
shiftedEntries,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
spliceEntryField,
|
|
17
18
|
unifiedDiff,
|
|
18
19
|
withClaimLines
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YT5HKJWV.js";
|
|
20
21
|
import {
|
|
21
22
|
CITATIONS_KEY,
|
|
22
23
|
CITE_SECTION,
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
GIT_UNAVAILABLE_HISTORY,
|
|
26
27
|
MAX_PAGE_COMMITS,
|
|
27
28
|
PAGE_HISTORY_UNAVAILABLE,
|
|
29
|
+
SOURCE_HISTORY_UNAVAILABLE,
|
|
28
30
|
buildSourceIndex,
|
|
29
31
|
checkCitations,
|
|
30
32
|
claimDiff,
|
|
@@ -51,21 +53,29 @@ import {
|
|
|
51
53
|
sentencesOf,
|
|
52
54
|
sharesSentence,
|
|
53
55
|
sidecarsFor,
|
|
56
|
+
sourceBaseline,
|
|
54
57
|
stripMarkers,
|
|
55
58
|
twoManifestsRefusal,
|
|
56
59
|
urlManifestRefusal
|
|
57
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-6DYFWAZA.js";
|
|
61
|
+
import {
|
|
62
|
+
renderCheckJson,
|
|
63
|
+
renderHistoryJson,
|
|
64
|
+
renderRemoveJson,
|
|
65
|
+
renderUpdateJson
|
|
66
|
+
} from "./chunk-5D24C6WM.js";
|
|
58
67
|
import {
|
|
59
68
|
renderCheckGithub
|
|
60
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-QEJ4GH25.js";
|
|
61
70
|
import {
|
|
62
71
|
refusalLine,
|
|
63
72
|
removalLine,
|
|
64
73
|
renderCheckPretty,
|
|
74
|
+
renderHistoryPretty,
|
|
65
75
|
renderRemovePretty,
|
|
66
76
|
renderUpdatePretty,
|
|
67
77
|
rewriteLine
|
|
68
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-Q62Q7CDI.js";
|
|
69
79
|
import {
|
|
70
80
|
blockMatches,
|
|
71
81
|
claimEnd,
|
|
@@ -94,7 +104,7 @@ import {
|
|
|
94
104
|
toValidationResult,
|
|
95
105
|
unitAt,
|
|
96
106
|
unitText
|
|
97
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-GZHBMMDC.js";
|
|
98
108
|
import {
|
|
99
109
|
CITE_RULES,
|
|
100
110
|
CiteError,
|
|
@@ -134,16 +144,11 @@ import {
|
|
|
134
144
|
spellSource,
|
|
135
145
|
statementForms,
|
|
136
146
|
validateEntry
|
|
137
|
-
} from "./chunk-
|
|
138
|
-
import {
|
|
139
|
-
renderCheckJson,
|
|
140
|
-
renderRemoveJson,
|
|
141
|
-
renderUpdateJson
|
|
142
|
-
} from "./chunk-PCE7QHXJ.js";
|
|
147
|
+
} from "./chunk-UVLQRP6O.js";
|
|
143
148
|
import {
|
|
144
149
|
reencryptData,
|
|
145
150
|
reencryptMetadata
|
|
146
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-57DHX65T.js";
|
|
147
152
|
import {
|
|
148
153
|
ENCRYPTION_KEY_ENV,
|
|
149
154
|
MAX_RANGE_LINES,
|
|
@@ -170,7 +175,7 @@ import {
|
|
|
170
175
|
toBodyLines,
|
|
171
176
|
toFileLines,
|
|
172
177
|
writeEncryptionKey
|
|
173
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-476DMDJ5.js";
|
|
174
179
|
import {
|
|
175
180
|
LEGACY_CONFIG_NAMES,
|
|
176
181
|
STDIN_TOKEN,
|
|
@@ -181,7 +186,7 @@ import {
|
|
|
181
186
|
resolveTargetSet,
|
|
182
187
|
supportedExtensions,
|
|
183
188
|
writeFileAtomic
|
|
184
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-OFOIBV5J.js";
|
|
185
190
|
import {
|
|
186
191
|
findConfigFile,
|
|
187
192
|
findFamilyConfigFile,
|
|
@@ -195,7 +200,7 @@ import {
|
|
|
195
200
|
readConfigFile,
|
|
196
201
|
readFamilyConfigFile,
|
|
197
202
|
selectCollections
|
|
198
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-B2242FYO.js";
|
|
199
204
|
import {
|
|
200
205
|
ToolError
|
|
201
206
|
} from "./chunk-G3T47CFV.js";
|
|
@@ -224,6 +229,7 @@ __export(cite_exports, {
|
|
|
224
229
|
ManifestSet: () => ManifestSet,
|
|
225
230
|
PAGE_HISTORY_UNAVAILABLE: () => PAGE_HISTORY_UNAVAILABLE,
|
|
226
231
|
RULE_ID_PREFIX: () => RULE_ID_PREFIX,
|
|
232
|
+
SOURCE_HISTORY_UNAVAILABLE: () => SOURCE_HISTORY_UNAVAILABLE,
|
|
227
233
|
SRC_PATTERN: () => SRC_PATTERN,
|
|
228
234
|
anchoredLines: () => anchoredLines,
|
|
229
235
|
appendFrontmatterCitation: () => appendFrontmatterCitation,
|
|
@@ -306,6 +312,8 @@ __export(cite_exports, {
|
|
|
306
312
|
renderCheckGithub: () => renderCheckGithub,
|
|
307
313
|
renderCheckJson: () => renderCheckJson,
|
|
308
314
|
renderCheckPretty: () => renderCheckPretty,
|
|
315
|
+
renderHistoryJson: () => renderHistoryJson,
|
|
316
|
+
renderHistoryPretty: () => renderHistoryPretty,
|
|
309
317
|
renderRemoveJson: () => renderRemoveJson,
|
|
310
318
|
renderRemovePretty: () => renderRemovePretty,
|
|
311
319
|
renderUpdateJson: () => renderUpdateJson,
|
|
@@ -316,6 +324,7 @@ __export(cite_exports, {
|
|
|
316
324
|
ruleId: () => ruleId,
|
|
317
325
|
runAdd: () => runAdd,
|
|
318
326
|
runCheck: () => runCheck,
|
|
327
|
+
runHistory: () => runHistory,
|
|
319
328
|
runRemove: () => runRemove,
|
|
320
329
|
runUpdate: () => runUpdate,
|
|
321
330
|
runsHolding: () => runsHolding,
|
|
@@ -371,9 +380,9 @@ async function pinnedLines(ctx, citation, range, path, key) {
|
|
|
371
380
|
joined = void 0;
|
|
372
381
|
}
|
|
373
382
|
if (joined !== void 0 && hashLines(joined, key) === pin) return { joined };
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
const history = await
|
|
383
|
+
if (await ctx.git.available()) {
|
|
384
|
+
const recorded = citation.source["commit-sha"];
|
|
385
|
+
const { history } = await sourceBaseline(ctx.git, recorded, path, range, pin, key, void 0);
|
|
377
386
|
if (history.kind === "original") return { joined: history.lines.join("\n") };
|
|
378
387
|
}
|
|
379
388
|
return { skip: CHANGED };
|
|
@@ -529,7 +538,7 @@ async function indexFor(root, client) {
|
|
|
529
538
|
try {
|
|
530
539
|
return await buildSourceIndex(root, { gitClient: client });
|
|
531
540
|
} catch (error) {
|
|
532
|
-
if (isEnoent(error)) throw new KeyError(`Root directory not found: ${root}.`);
|
|
541
|
+
if (isEnoent(error)) throw new KeyError(`Root directory not found: ${root}. Fix --root, or cite.root in manni.config.yaml.`);
|
|
533
542
|
throw error;
|
|
534
543
|
}
|
|
535
544
|
}
|
|
@@ -931,4 +940,4 @@ export {
|
|
|
931
940
|
runKeyRotate,
|
|
932
941
|
runKeySet
|
|
933
942
|
};
|
|
934
|
-
//# sourceMappingURL=chunk-
|
|
943
|
+
//# sourceMappingURL=chunk-NIQ2JSZO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cite/index.ts","../src/cite/core/reencrypt.ts","../src/key/errors.ts","../src/key/commands/rotate.ts","../src/key/core/config.ts","../src/key/commands/set.ts"],"sourcesContent":["/**\n * The citation tool's programmatic API, exported from the package as the\n * `cite` namespace: `import { cite } from \"@hawkeyexl/manni\"`.\n */\nexport * from \"./types.js\";\nexport { CiteError } from \"./errors.js\";\nexport { DEFAULT_SEVERITY, RULE_ID_PREFIX, isCiteRule, resolveSeverity, ruleId } from \"./core/severity.js\";\nexport {\n FILE_PATTERN,\n SRC_PATTERN,\n formatSrc,\n lineSpec,\n parseLines,\n parseSrc,\n rangeLines,\n sourceRange,\n spellLines,\n spellSource,\n} from \"./core/range.js\";\nexport { hashLines, hashRange, isKeyedPin, normalizeText, sliceLines, splitLines } from \"./core/hash.js\";\nexport { shortCommit, shortLine, shortPin, shortSrc, spellAt } from \"./core/spell.js\";\nexport { buildSourceIndex, readSource } from \"./core/sources.js\";\nexport type { BuildIndexOptions, ReadSourceResult } from \"./core/sources.js\";\nexport {\n isUnitText,\n markerClaimEnd,\n markerRunAt,\n misplacedMarkerAt,\n misplacedMarkers,\n movedUnit,\n pre43Span,\n splitUnit,\n unitText,\n} from \"./core/reanchor.js\";\nexport type { MisplacedMarker } from \"./core/reanchor.js\";\nexport {\n anchoredLines,\n detectEol,\n fenceSpanAt,\n fencedBlockAfter,\n fencedBlockAt,\n fencedBlocks,\n formatStatement,\n insideFence,\n isBoundLine,\n isTableRow,\n lineAt,\n offsetOfLine,\n paragraphAfter,\n parseStatements,\n statementForms,\n} from \"./core/statements.js\";\nexport type { StatementForm } from \"./core/statements.js\";\nexport {\n blockMatches,\n claimEnd,\n claimLine,\n markerUnit,\n noUnitAt,\n normalizeWhitespace,\n pinOfLines,\n toBodyLines,\n toFileLines,\n unitAt,\n} from \"./core/claims.js\";\nexport type { ClaimUnit, NoUnit } from \"./core/claims.js\";\nexport {\n GIT_UNAVAILABLE_COMMIT,\n GIT_UNAVAILABLE_HISTORY,\n PAGE_HISTORY_UNAVAILABLE,\n SOURCE_HISTORY_UNAVAILABLE,\n gitClient,\n noGit,\n} from \"./core/git.js\";\nexport {\n MAX_PAGE_COMMITS,\n claimDiff,\n claimHistory,\n claimWords,\n holdsWords,\n refineClaim,\n runsHolding,\n sentencesOf,\n sharesSentence,\n stripMarkers,\n} from \"./core/history.js\";\nexport type { ClaimHistory, ClaimHistoryInput, RefineClaimInput } from \"./core/history.js\";\nexport { MAX_RANGE_LINES, MOVE_BUDGET_BYTES, MOVE_WINDOW_LINES, classifyCitation, findWindows, historyOf } from \"./core/classify.js\";\nexport type { ClassifyOptions, FindWindowsOptions, History } from \"./core/classify.js\";\nexport {\n MARKER_JSON,\n MAX_MARKERS_PER_PAGE,\n bodyLineOf,\n citationInputs,\n ownedMessage,\n pickExtractor,\n readPage,\n validateEntry,\n} from \"./core/page.js\";\nexport { shiftedEntries, withClaimLines } from \"./core/shift.js\";\nexport type { ShiftOptions, Shifted } from \"./core/shift.js\";\nexport {\n CITATIONS_KEY,\n duplicateJoinRefusal,\n loadCitationSidecars,\n orphanRefusal,\n sidecarsFor,\n twoManifestsRefusal,\n urlManifestRefusal,\n} from \"./core/sidecar.js\";\nexport type {\n CitationManifest,\n CitationSidecars,\n LoadSidecarOptions,\n PageSidecar,\n} from \"./core/sidecar.js\";\nexport { ManifestSet, itemLine, splice } from \"./core/manifest.js\";\nexport type { HeldManifest } from \"./core/manifest.js\";\nexport type { ReadPageOptions } from \"./core/page.js\";\nexport { checkCitations } from \"./core/check-page.js\";\nexport {\n claimMessageFor,\n errorSite,\n findingsFor,\n messageFor,\n misplacedMessageFor,\n toValidationResult,\n} from \"./core/adapt.js\";\nexport {\n appendFrontmatterCitation,\n entryObject,\n insertStatementBefore,\n removeFrontmatterCitations,\n removeLine,\n spliceEntryField,\n unifiedDiff,\n} from \"./core/write.js\";\nexport type { EntryPath } from \"./core/write.js\";\nexport { mintCitation } from \"./core/mint.js\";\nexport { CITE_SECTION, DEFAULT_CITE_BASELINE_PATH, loadCiteConfig, parseCiteConfig, readCiteConfigFile, resolveCiteRun } from \"./core/config.js\";\nexport type { CiteRunOptions } from \"./core/config.js\";\n\nexport { runCheck } from \"./commands/check.js\";\nexport { runAdd } from \"./commands/add.js\";\nexport { runRemove } from \"./commands/remove.js\";\nexport { runUpdate } from \"./commands/update.js\";\nexport { runHistory } from \"./commands/history.js\";\nexport { reencryptCitationEntries, reencryptCitations } from \"./core/reencrypt.js\";\nexport type { ReencryptEntriesResult, ReencryptOptions } from \"./core/reencrypt.js\";\nexport {\n refusalLine,\n removalLine,\n renderCheckPretty,\n renderHistoryPretty,\n renderRemovePretty,\n renderUpdatePretty,\n rewriteLine,\n} from \"./reporters/pretty.js\";\nexport type { PrettyOptions } from \"./reporters/pretty.js\";\nexport { renderCheckJson, renderHistoryJson, renderRemoveJson, renderUpdateJson } from \"./reporters/json.js\";\nexport { renderCheckGithub } from \"./reporters/github.js\";\n","/**\n * `reencryptCitations`: re-encrypt one page's encrypted citations under a new\n * key, for `manni key rotate` (proposal 0045). It reads sources and never\n * writes: the caller gets the rewritten page back, and writes it only once\n * every page in the run could be re-encrypted.\n *\n * A citation counts as done only when its `source.file` decrypts under the\n * new key *and* its pin holds under the new key. Either alone is a half\n * rotation, and a rerun has to finish it rather than declare it done. Meta's\n * walker cannot leave one today, because it skips the whole `citations` key\n * and cite encrypts in its own `cite-src` context; an interrupted run, a hand\n * edit, or a second writer of the same manifest can.\n *\n * The path must be tracked, and the pin must hold under the old key, over the\n * lines as they are today or, with git, as they were at the baseline the\n * classifier derives from the source's history (proposal 0097). Then `file` becomes the\n * path's ciphertext under the new key, its lines kept, and `integrity` the\n * keyed pin under it, so a `changed` citation stays exactly as changed. A pin\n * that holds nowhere is skipped, with `update --accept` named as the repair.\n * No message names a path.\n */\nimport type {\n Citation,\n CitationInput,\n CitationOrigin,\n GitClient,\n ReencryptCitationsResult,\n ReencryptedCitation,\n SourceIndex,\n SourceRange,\n} from \"../types.js\";\nimport { sourceBaseline } from \"./classify.js\";\nimport { gitClient } from \"./git.js\";\nimport { hashLines, sliceLines, splitLines } from \"./hash.js\";\nimport { readPage } from \"./page.js\";\nimport { formatSrc, sourceRange, spellSource } from \"./range.js\";\nimport { buildSourceIndex, decryptSourcePath, encryptSourcePath, readSource } from \"./sources.js\";\nimport { spliceEntryField } from \"./write.js\";\n\nconst UNDECRYPTABLE = \"does not decrypt under the current key\";\nconst MISSING = \"missing (no tracked file matches)\";\nconst CHANGED = \"changed; run `manni cite update --accept` before rotating\";\n\ntype Where = Pick<ReencryptedCitation, \"id\" | \"index\" | \"line\">;\n\n/** The fields a report row carries to name the entry: its id, or where it sits. */\nfunction whereOf(citation: Citation, origin: CitationOrigin): Where {\n const where: Where = { index: origin.index };\n if (citation.id !== undefined) where.id = citation.id;\n if (origin.line !== undefined) where.line = origin.line;\n return where;\n}\n\ninterface Context {\n root: string;\n index: SourceIndex;\n git: GitClient;\n}\n\n/**\n * The lines the pin was taken over, joined: today's when the pin holds there\n * under `key`, else the lines at the derived baseline when git finds one;\n * else why neither.\n */\nasync function pinnedLines(\n ctx: Context,\n citation: Citation,\n range: SourceRange,\n path: string,\n key: string,\n): Promise<{ joined: string } | { skip: string }> {\n const source = await readSource(ctx.root, ctx.index, { ...range, path, encrypted: false });\n if (source.kind === \"missing\") return { skip: MISSING };\n const pin = citation.source.integrity;\n let joined: string | undefined;\n try {\n joined = sliceLines(splitLines(source.text), range);\n } catch {\n // The range runs past the end of the file as it is now.\n joined = undefined;\n }\n if (joined !== undefined && hashLines(joined, key) === pin) return { joined };\n\n // The baseline the classifier derives (0097): the recorded commit when it\n // holds, else the newest commit in the source's history that does.\n if (await ctx.git.available()) {\n const recorded = citation.source[\"commit-sha\"];\n const { history } = await sourceBaseline(ctx.git, recorded, path, range, pin, key, undefined);\n if (history.kind === \"original\") return { joined: history.lines.join(\"\\n\") };\n }\n return { skip: CHANGED };\n}\n\n/** What one citation needs: nothing, a new pair of values, or a reason it cannot be done. */\ntype Verdict =\n | { kind: \"done\" }\n | { kind: \"skip\"; message: string }\n | { kind: \"write\"; file: string; integrity: string; to: string };\n\n/** Options every re-encryption takes, whichever channel the entry lives in. */\nexport interface ReencryptOptions {\n root: string;\n fromKey: string;\n toKey: string;\n /** History and the source index are read through it; defaults to one over the root. */\n gitClient?: GitClient;\n sourceIndex?: SourceIndex;\n}\n\n/**\n * One citation's verdict: whether it is already under the new key, what its\n * `source.file` and `source.integrity` become, or why neither. The rule is\n * the same wherever the entry is kept, so the page splicer and the manifest\n * writer both go through here.\n */\nasync function verdictFor(\n ctx: Context,\n citation: Citation,\n opts: Pick<ReencryptOptions, \"fromKey\" | \"toKey\">,\n): Promise<Verdict> {\n const range = sourceRange(citation.source);\n const underNew = decryptSourcePath(range.path, opts.toKey);\n // Done only when both halves are under the new key; a file that is and a\n // pin that is not is the half rotation this finishes.\n if (underNew !== undefined) {\n const held = await pinnedLines(ctx, citation, range, underNew, opts.toKey);\n if (\"joined\" in held) return { kind: \"done\" };\n }\n const path = underNew ?? decryptSourcePath(range.path, opts.fromKey);\n if (path === undefined) return { kind: \"skip\", message: UNDECRYPTABLE };\n const lines = await pinnedLines(ctx, citation, range, path, opts.fromKey);\n if (\"skip\" in lines) return { kind: \"skip\", message: lines.skip };\n const file = underNew === undefined ? encryptSourcePath(path, opts.toKey) : range.path;\n return {\n kind: \"write\",\n file,\n integrity: hashLines(lines.joined, opts.toKey),\n to: formatSrc({ ...range, path: file }),\n };\n}\n\n/** The git client and source index a run shares, built once per page at most. */\nasync function contextFor(opts: ReencryptOptions): Promise<Context> {\n const git = opts.gitClient ?? gitClient(opts.root);\n const index = opts.sourceIndex ?? (await buildSourceIndex(opts.root, { gitClient: git }));\n return { root: opts.root, index, git };\n}\n\nexport async function reencryptCitations(\n page: { file: string; content: string; format?: string },\n opts: ReencryptOptions,\n): Promise<ReencryptCitationsResult> {\n const read = readPage(page.file, page.content, page.format === undefined ? undefined : { format: page.format });\n const result: ReencryptCitationsResult = { content: page.content, rewritten: [], skipped: [] };\n const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);\n // A page with nothing encrypted costs no index and no git.\n if (encrypted.length === 0) return result;\n\n const ctx = await contextFor(opts);\n let after = page.content;\n for (const { citation, origin } of encrypted) {\n const range = sourceRange(citation.source);\n const where = whereOf(citation, origin);\n const verdict = await verdictFor(ctx, citation, opts);\n if (verdict.kind === \"done\") continue;\n if (verdict.kind === \"skip\") {\n result.skipped.push({ ...where, message: verdict.message });\n continue;\n }\n if (verdict.file !== range.path) {\n after = spliceEntryField(after, read.format, origin.index, [\"source\", \"file\"], verdict.file);\n }\n after = spliceEntryField(\n after,\n read.format,\n origin.index,\n [\"source\", \"integrity\"],\n verdict.integrity,\n );\n result.rewritten.push({ ...where, from: spellSource(citation.source), to: verdict.to });\n }\n result.content = after;\n return result;\n}\n\n/** What `reencryptCitationEntries` did to one page's manifest entries. */\nexport interface ReencryptEntriesResult {\n /** The entries as they should now be written, a copy of what came in. */\n entries: unknown[];\n /** Whether any of them changed. */\n changed: boolean;\n rewritten: ReencryptedCitation[];\n skipped: { id?: string; index?: number; line?: number; message: string }[];\n}\n\n/**\n * The same rotation, for a page whose citations live in a manifest.\n *\n * The entries come from meta's merge, so they are plain values; each one is\n * validated as `readPage` validates a frontmatter entry, and an encrypted\n * source's `file` and `integrity` are rewritten in place. The caller writes\n * the whole list back with one splice, once every page of the run could be\n * re-encrypted.\n */\nexport async function reencryptCitationEntries(\n page: { file: string; content: string; format?: string; citations: readonly CitationInput[] },\n opts: ReencryptOptions,\n): Promise<ReencryptEntriesResult> {\n const entries: unknown[] = JSON.parse(\n JSON.stringify(page.citations.map((input) => input.entry)),\n ) as unknown[];\n const out: ReencryptEntriesResult = { entries, changed: false, rewritten: [], skipped: [] };\n\n const read = readPage(page.file, page.content, {\n ...(page.format === undefined ? {} : { format: page.format }),\n citations: page.citations,\n });\n const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);\n if (encrypted.length === 0) return out;\n\n const ctx = await contextFor(opts);\n for (const { citation, origin } of encrypted) {\n const where = whereOf(citation, origin);\n const verdict = await verdictFor(ctx, citation, opts);\n if (verdict.kind === \"done\") continue;\n if (verdict.kind === \"skip\") {\n out.skipped.push({ ...where, message: verdict.message });\n continue;\n }\n const entry: unknown = entries[origin.index];\n const source =\n typeof entry === \"object\" && entry !== null && !Array.isArray(entry)\n ? (entry as Record<string, unknown>).source\n : undefined;\n if (typeof source !== \"object\" || source === null || Array.isArray(source)) {\n out.skipped.push({ ...where, message: UNDECRYPTABLE });\n continue;\n }\n const fields = source as Record<string, unknown>;\n fields.file = verdict.file;\n fields.integrity = verdict.integrity;\n out.changed = true;\n out.rewritten.push({ ...where, from: spellSource(citation.source), to: verdict.to });\n }\n return out;\n}\n","import { ToolError } from \"../shared/errors.js\";\n\n/** An operational or usage error in the key domain: exit 2. */\nexport class KeyError extends ToolError {\n constructor(message: string) {\n super(message);\n this.name = \"KeyError\";\n }\n}\n","/**\n * `manni key rotate [paths...]`: re-encrypt every encrypted value under a new\n * key, then write the key (proposal 0045).\n *\n * Values are found by their ciphertext, never through schema marks: meta's\n * `reencryptMetadata` takes every string of the ciphertext shape in a page's\n * metadata, and cite's `reencryptCitations` every encrypted `source.file` with its\n * keyed pin. A value already under the new key counts as done, so a run can\n * always be repeated.\n *\n * A value does not have to sit in a page. An external-metadata manifest\n * (proposal 0037) holds the private half of the same documents, which is\n * where an encrypted value most often lives, so the local manifests of the\n * collections a run covers are re-encrypted with the pages. See\n * `planManifests`.\n *\n * Input resolution is `cite check`'s: positional paths from `cwd`, else the\n * selected collections' `paths:` from the config's directory, `--exclude`\n * added to a collection's own `exclude:`, and zero files an error unless\n * `--allow-empty`.\n *\n * Every page and manifest is re-encrypted in memory first. One skip and\n * nothing is written (exit 1). Otherwise a whole run whose key comes from the\n * config writes in three steps, so that an interruption at any point leaves\n * every value readable by the next run:\n *\n * 1. the config: `encryptionKey:` the new key, `encryptionKeyPrevious:` the\n * old one, in one atomic write;\n * 2. the pages, then the manifests;\n * 3. the config again, without `encryptionKeyPrevious:`.\n *\n * A run that finds `encryptionKeyPrevious:` finishes that rotation: from the\n * previous key to the current one. A narrowed run (paths or `--collection`)\n * and a run whose key comes from `MANNI_ENCRYPTION_KEY` write pages and\n * manifests and never the config. `--dry-run` writes nothing at all.\n */\nimport { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport {\n DEFAULT_CITE_BASELINE_PATH,\n GIT_UNAVAILABLE_HISTORY,\n ManifestSet,\n buildSourceIndex,\n gitClient,\n loadCitationSidecars,\n parseCiteConfig,\n readPage,\n sourceRange,\n reencryptCitationEntries,\n reencryptCitations,\n type CiteConfig,\n type CitationSidecars,\n type GitClient,\n type ReencryptCitationsResult,\n type SourceIndex,\n} from \"../../cite/index.js\";\nimport {\n PATH_JOIN,\n classifyRef,\n externalMetadataJoin,\n loadExternalMetadata,\n reencryptMetadata,\n supportedExtensions,\n writeFileAtomic,\n type ExternalMetadataEntry,\n type ExternalMetadataIndex,\n type ExternalMetadataValue,\n} from \"../../meta/index.js\";\nimport {\n STDIN_TOKEN,\n assertNonEmpty,\n configMarks,\n extractorByName,\n gitignoreOptions,\n reencryptData,\n resolveTargetSet,\n spliceManifestValue,\n} from \"../../meta/internal.js\";\nimport { isMember, selectCollections, type CollectionConfig } from \"../../shared/collections.js\";\nimport type { ConfigFile } from \"../../shared/config-file.js\";\nimport { resolveEncryptionKey, writeEncryptionKey } from \"../../shared/encryption-key.js\";\nimport { generateEncryptionKey, isValidEncryptionKey } from \"../../shared/encryption.js\";\nimport { findGitRoot } from \"../../shared/git-root.js\";\nimport {\n findPageManifests,\n hasPagePlaceholder,\n pageManifestPath,\n} from \"../../shared/page-manifest.js\";\nimport { readRotateConfig, toKeyError, unfinishedRotation } from \"../core/config.js\";\nimport { KeyError } from \"../errors.js\";\nimport type {\n KeyRotateOptions,\n KeyRotateResult,\n RotateManifest,\n RotateOutcome,\n RotatePage,\n RotatedValue,\n SkippedValue,\n} from \"../types.js\";\n\nconst BAD_TO = \"--to must be at least 32 hex or base64url characters.\";\nconst NO_STDIN =\n \"key rotate reads and writes files, so it takes no stdin (`-`). Name the files instead.\";\nconst WITH_PATHS =\n \"--collection selects a configured collection; it cannot be combined with paths.\";\nconst NEEDS_CONFIG = \"--collection needs a config file to select from.\";\nconst NO_KEY =\n \"No encryption key is available, so nothing can be re-encrypted. Run `manni key set` first.\";\nconst ENV_NEEDS_TO =\n \"The key comes from MANNI_ENCRYPTION_KEY; pass --to <value>, re-encrypt with it, then update the secret. Nothing is written to config.\";\nconst NARROWED_NEEDS_TO = \"A run over part of the family needs --to, and never writes the key.\";\nconst NO_FILES =\n \"No files to re-encrypt. Pass paths/globs, or declare a collection under `collections:` in manni.config.yaml.\";\n\n/**\n * Any ciphertext at all. A page without one has nothing to rotate, so it costs\n * no parse; with one, the page is parsed and the tag decides.\n */\nconst ANY_CIPHERTEXT = /~[A-Za-z0-9_-]{82,}/;\n\n/** The `cite:` section of the file, for `root:` and `baseline:`; `{}` without one. */\nfunction citeSection(file: ConfigFile | null): CiteConfig {\n if (file === null) return {};\n const doc: unknown = parseYaml(file.text);\n if (typeof doc !== \"object\" || doc === null || !(\"cite\" in doc)) return {};\n return parseCiteConfig(doc.cite, file.source);\n}\n\n/**\n * Where cited sources resolve from, as `cite` resolves it: `--root` (cwd\n * relative) > `cite.root` (config relative) > the git root > `cwd`.\n */\nfunction rootFor(\n flag: string | undefined,\n cite: CiteConfig,\n file: ConfigFile | null,\n cwd: string,\n): { root: string; fellBack: boolean } {\n if (flag !== undefined) return { root: resolve(cwd, flag), fellBack: false };\n if (file !== null && cite.root !== undefined) {\n return { root: resolve(file.dir, cite.root), fellBack: false };\n }\n const gitRoot = findGitRoot(cwd);\n return gitRoot === null ? { root: cwd, fellBack: true } : { root: gitRoot, fellBack: false };\n}\n\nfunction isEnoent(error: unknown): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\";\n}\n\nasync function indexFor(root: string, client: GitClient): Promise<SourceIndex> {\n try {\n return await buildSourceIndex(root, { gitClient: client });\n } catch (error) {\n if (isEnoent(error)) throw new KeyError(`Root directory not found: ${root}. Fix --root, or cite.root in manni.config.yaml.`);\n throw error;\n }\n}\n\n/**\n * The page's encrypted citations, the only ones a rotation reads sources\n * for: whether it has any, and whether one carries a commit (its own or the\n * page's), which is when history would be read.\n */\nfunction encryptedCitations(\n file: string,\n content: string,\n format: string | undefined,\n): { any: boolean; withCommit: boolean } {\n const read = readPage(file, content, format === undefined ? undefined : { format });\n const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);\n return {\n any: encrypted.length > 0,\n withCommit: encrypted.some(({ citation }) => citation.source[\"commit-sha\"] !== undefined),\n };\n}\n\ninterface Planned {\n page: RotatePage;\n path: string;\n content: string;\n changed: boolean;\n}\n\n/**\n * The citations of one page that a manifest owns (proposal 0044). They are\n * re-encrypted exactly as a page's own are — a citation counts as done only\n * when its `source.file` decrypts under the new key *and* its pin holds —\n * and written back as one value per page, each manifest written once.\n *\n * Kept in its own function, and reached from one place in the loop below, so\n * nothing about how *meta* values are rotated changes.\n */\nasync function rotateManifestCitations(\n sidecars: CitationSidecars | null,\n manifests: ManifestSet,\n page: { file: string; content: string; format?: string },\n opts: {\n root: string;\n fromKey: string;\n toKey: string;\n gitClient: GitClient;\n sourceIndex: () => Promise<SourceIndex>;\n },\n): Promise<{ rewritten: RotatedValue[]; skipped: SkippedValue[]; wantsHistory: boolean }> {\n const none = { rewritten: [], skipped: [], wantsHistory: false };\n if (sidecars === null) return none;\n const sidecar = await sidecars.forPage(page.file, page.content, page.format);\n const owner = sidecar.owner;\n if (owner === undefined || sidecar.citations === undefined) return none;\n // Only a manifest entry that actually holds a ciphertext costs an index.\n if (!sidecar.citations.some((input) => ANY_CIPHERTEXT.test(JSON.stringify(input.entry)))) {\n return none;\n }\n const result = await reencryptCitationEntries(\n { ...page, citations: sidecar.citations },\n {\n root: opts.root,\n fromKey: opts.fromKey,\n toKey: opts.toKey,\n gitClient: opts.gitClient,\n sourceIndex: await opts.sourceIndex(),\n },\n );\n if (result.changed && sidecar.entry !== undefined) {\n await manifests.write(owner, sidecar.entry, result.entries, 0);\n }\n return {\n rewritten: result.rewritten.map((r) => ({ kind: \"citation\" as const, ...r })),\n skipped: result.skipped.map((s) => ({ kind: \"citation\" as const, ...s })),\n // A pin that no longer holds is re-keyed from the lines at its commit.\n wantsHistory: sidecar.citations.some((input) =>\n /\"commit-sha\"\\s*:/.test(JSON.stringify(input.entry)),\n ),\n };\n}\n\ninterface PlannedManifest {\n manifest: RotateManifest;\n path: string;\n /** The manifest's text, with every rewritten value spliced into it. */\n text: string;\n changed: boolean;\n}\n\n/** How a run spells a manifest: relative to its base, like every file label. */\nfunction reportedPath(abs: string, base: string): string {\n const rel = relative(base, abs);\n return rel === \"\" ? \".\" : rel.split(sep).join(\"/\");\n}\n\n/**\n * The collections whose manifests this run covers. A run over every\n * collection, and one narrowed by `--collection`, covers the collections it\n * selected. A run over positional paths covers the collections those files\n * belong to, so the private half of a page a run re-encrypts moves with it.\n */\nfunction manifestCollections(\n collections: readonly CollectionConfig[],\n opts: {\n fromCollections: boolean;\n files: readonly string[];\n base: string;\n configDir: string;\n },\n): CollectionConfig[] {\n if (opts.fromCollections) return [...collections];\n const rels = opts.files.map((rel) =>\n reportedPath(resolve(opts.base, rel), opts.configDir),\n );\n return collections.filter((c) => rels.some((rel) => isMember(c, rel)));\n}\n\n/** The owned values one manifest entry supplies, or an empty map. */\nfunction valuesOf(\n index: ExternalMetadataIndex,\n entry: ExternalMetadataEntry,\n): ReadonlyMap<string, ExternalMetadataValue> {\n const empty = new Map<string, ExternalMetadataValue>();\n if (entry.join === PATH_JOIN) {\n return entry.abs === undefined ? empty : (index.byPath.get(entry.abs) ?? empty);\n }\n return index.byField.get(entry.join)?.get(entry.spelled) ?? empty;\n}\n\n/**\n * Re-encrypt the metadata values that live in the selected collections' local\n * manifests (proposals 0037, 0039 and 0041).\n *\n * A manifest is private by construction, so it is where an encrypted value is\n * most likely to sit. Rotation would otherwise leave it under the old key and\n * `meta validate` would report `encrypted:unreadable` on every page the\n * manifest feeds.\n *\n * Two things are left alone. A URL manifest is somebody else's file and\n * read-only (0038), so it is never loaded, and a rotation reaches no network.\n * The `citations` key is cite's: it re-keys a citation's source together with\n * its pin, under its own context, and re-encrypting the source alone would\n * break the pin. `reencryptData` skips it for the same reason\n * `reencryptMetadata` does on a page.\n *\n * Text in, text out. Each value is spliced into the manifest by\n * `spliceManifestValue`, which replaces that value's range and keeps every\n * other byte: the comments, the key order, the quoting and the line endings.\n * Nothing is written here; the caller writes when every value could be\n * re-encrypted.\n */\nasync function planManifests(opts: {\n collections: readonly CollectionConfig[];\n configDir: string;\n base: string;\n fromKey: string;\n toKey: string;\n /** The run's pages, as absolute paths, which a `{page}` manifest (0058) is read for. */\n pages: readonly string[];\n /** A run over the whole family: no paths and no `--collection`. */\n whole: boolean;\n}): Promise<PlannedManifest[]> {\n const local = opts.collections\n .map((c) => ({\n ...c,\n externalMetadata: c.externalMetadata.filter(\n (m) => classifyRef(m.file).kind !== \"url\",\n ),\n }))\n .filter((c) => c.externalMetadata.length > 0);\n if (local.length === 0) return [];\n\n // A `{page}` entry (proposal 0058) is one manifest per page, so its files\n // are enumerated rather than named: each page of the run resolves its own,\n // and a whole run adds every file the pattern's glob finds, so a manifest\n // whose page is gone is re-encrypted too (0058 stress test 12). The pages\n // those files name are handed to the loader like the run's own.\n const pages = new Set(opts.pages);\n if (opts.whole) {\n for (const c of local) {\n for (const m of c.externalMetadata) {\n if (!hasPagePlaceholder(m.file)) continue;\n for (const found of findPageManifests(m.file, opts.configDir, (rel) => isMember(c, rel))) {\n for (const entry of found.entries) pages.add(entry.pageAbs);\n }\n }\n }\n }\n\n const index = await loadExternalMetadata(local, {\n configDir: opts.configDir,\n base: opts.base,\n pages: [...pages],\n });\n if (index === null) return [];\n\n // One plan per manifest file, so a manifest two collections declare is read\n // once and spliced once. Its reported path and collection identify it the\n // way `index.entries` does. A plan is made when an entry first names its\n // file, and only a plan with a value to report is kept.\n const plans = new Map<string, PlannedManifest>();\n const located = new Map<string, { abs: string; collection: string }>();\n const locate = (collection: string, abs: string, join: string): void => {\n located.set(`${collection}\\u0000${reportedPath(abs, opts.base)}\\u0000${join}`, { abs, collection });\n };\n for (const c of local) {\n for (const m of c.externalMetadata) {\n const join = externalMetadataJoin(m);\n if (!hasPagePlaceholder(m.file)) {\n locate(c.name, isAbsolute(m.file) ? m.file : resolve(opts.configDir, m.file), join);\n continue;\n }\n for (const page of pages) {\n const resolved = pageManifestPath(m.file, opts.configDir, page);\n if (!(\"outside\" in resolved)) locate(c.name, resolved.abs, join);\n }\n }\n }\n const planFor = async (key: string): Promise<PlannedManifest | undefined> => {\n const where = located.get(key);\n if (where === undefined) return undefined;\n const known = plans.get(where.abs);\n if (known !== undefined) return known;\n const plan: PlannedManifest = {\n manifest: {\n file: reportedPath(where.abs, opts.base),\n collection: where.collection,\n rewritten: [],\n skipped: [],\n written: false,\n },\n path: where.abs,\n text: await readFile(where.abs, \"utf8\"),\n changed: false,\n };\n plans.set(where.abs, plan);\n return plan;\n };\n\n for (const entry of index.entries) {\n const plan = await planFor(`${entry.collection}\\u0000${entry.file}\\u0000${entry.join}`);\n if (plan === undefined) continue;\n const data: Record<string, unknown> = {};\n for (const [key, supplied] of valuesOf(index, entry)) {\n if (supplied.file === entry.file && supplied.collection === entry.collection) {\n data[key] = supplied.value;\n }\n }\n const done = reencryptData(data, { fromKey: opts.fromKey, toKey: opts.toKey });\n for (const r of done.rewritten) {\n plan.manifest.rewritten.push({ entry: entry.spelled, ...r });\n }\n for (const s of done.skipped) {\n plan.manifest.skipped.push({ entry: entry.spelled, ...s });\n }\n for (const key of done.keys) {\n plan.text = spliceManifestValue(plan.text, {\n entry: entry.spelled,\n key,\n value: done.data[key],\n join: entry.join,\n file: plan.manifest.file,\n }).text;\n plan.changed = true;\n }\n }\n\n return [...plans.values()].filter(\n (p) => p.manifest.rewritten.length > 0 || p.manifest.skipped.length > 0,\n );\n}\n\nexport async function runKeyRotate(opts: KeyRotateOptions): Promise<KeyRotateResult> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const env = opts.env ?? process.env;\n if (opts.to !== undefined && !isValidEncryptionKey(opts.to)) throw new KeyError(BAD_TO);\n if (opts.inputs.includes(STDIN_TOKEN)) throw new KeyError(NO_STDIN);\n const wanted = opts.collection ?? [];\n if (wanted.length > 0 && opts.inputs.length > 0) throw new KeyError(WITH_PATHS);\n\n const file = await readRotateConfig(opts.configPath, cwd);\n if (wanted.length > 0 && file === null) throw new KeyError(NEEDS_CONFIG);\n const { key: current, source: keySource } = resolveEncryptionKey({\n env,\n file,\n toError: toKeyError,\n });\n if (current === undefined) throw new KeyError(NO_KEY);\n const narrowed = opts.inputs.length > 0 || wanted.length > 0;\n\n // Only a key from the config has a config a rotation can be finished in.\n const keyFile = keySource === \"config\" ? file : null;\n const previous = keyFile?.encryptionKeyPrevious;\n if (\n keyFile !== null &&\n previous !== undefined &&\n (narrowed || (opts.to !== undefined && opts.to !== current))\n ) {\n throw new KeyError(unfinishedRotation(keyFile.source));\n }\n if (keySource === \"env\" && opts.to === undefined) throw new KeyError(ENV_NEEDS_TO);\n if (narrowed && opts.to === undefined) throw new KeyError(NARROWED_NEEDS_TO);\n\n // Finishing an interrupted rotation goes from the key it replaced to the one\n // the config already holds; otherwise from the current key to the new one.\n const fromKey = previous ?? current;\n const toKey = previous === undefined ? (opts.to ?? generateEncryptionKey()) : current;\n\n const collections =\n file === null ? [] : selectCollections(file.collections, wanted, file.source, toKeyError);\n const fromCollections = opts.inputs.length === 0;\n const inputs = fromCollections ? collections.flatMap((c) => c.paths) : opts.inputs;\n if (inputs.length === 0) throw new KeyError(NO_FILES);\n // One base per run, as in cite and meta: typed paths from cwd, a\n // collection's `paths:` from the config's directory.\n const base = fromCollections && file !== null ? file.dir : cwd;\n\n const forced = opts.as === undefined ? undefined : extractorByName(opts.as);\n if (opts.as !== undefined && forced === undefined) {\n throw new KeyError(\n `Unknown format \"${opts.as}\". Supported extensions: ${supportedExtensions().join(\", \")}.`,\n );\n }\n const format = forced?.name;\n const exts = opts.exts ?? forced?.extensions;\n const exclude = [\n ...new Set([\n ...(opts.exclude ?? []),\n ...(fromCollections ? collections.flatMap((c) => c.exclude) : []),\n ]),\n ];\n const { files, gitignoreSkipped } = await resolveTargetSet({\n inputs,\n exts,\n exclude,\n cwd: base,\n allowEmpty: opts.allowEmpty,\n ...gitignoreOptions({ flag: opts.respectGitignore, onNotice: opts.onNotice }),\n });\n assertNonEmpty({\n files,\n inputs,\n usingStdin: false,\n allowEmpty: opts.allowEmpty,\n exclude,\n exts,\n gitignoreSkipped,\n action: \"re-encrypted\",\n });\n\n const cite = citeSection(file);\n const { root, fellBack } = rootFor(opts.root, cite, file, cwd);\n const client = opts.gitClient ?? gitClient(root);\n // Built once, and only when a page cites an encrypted source.\n let index: Promise<SourceIndex> | undefined;\n const sourceIndex = (): Promise<SourceIndex> => {\n if (index === undefined) {\n if (fellBack) opts.onNotice?.(`No git root found; resolving src: paths from ${cwd}`);\n index = indexFor(root, client);\n }\n return index;\n };\n\n // The manifests that own `citations` (proposal 0044): a page whose entries\n // live in one carries no ciphertext of its own, so they are read for every\n // page of the run, not only the ones the shortcut below lets through.\n const sidecars =\n file === null\n ? null\n : await loadCitationSidecars({\n collections: file.collections,\n configDir: file.dir,\n base,\n configSource: file.source,\n key: current,\n toError: toKeyError,\n // A keyless manifest (proposal 0068) keeps what a page's schemas mark.\n marks: () => configMarks(file.path, file.dir),\n // A `{page}` manifest (0058) is read for exactly the pages rotated.\n pages: files.map((rel) => resolve(base, rel)),\n });\n const manifests = new ManifestSet();\n\n const planned: Planned[] = [];\n let wantsHistory = false;\n for (const rel of files) {\n const path = resolve(base, rel);\n const before = await readFile(path, \"utf8\");\n const page = { file: rel, content: before, ...(format === undefined ? {} : { format }) };\n // A page's own values first, then the entries its manifest holds.\n const sidecarWork = await rotateManifestCitations(sidecars, manifests, page, {\n root,\n fromKey,\n toKey,\n gitClient: client,\n sourceIndex,\n });\n if (sidecarWork.wantsHistory) wantsHistory = true;\n if (!ANY_CIPHERTEXT.test(before)) {\n if (sidecarWork.rewritten.length === 0 && sidecarWork.skipped.length === 0) continue;\n planned.push({\n page: { file: rel, rewritten: sidecarWork.rewritten, skipped: sidecarWork.skipped, written: false },\n path,\n content: before,\n changed: false,\n });\n continue;\n }\n const meta = reencryptMetadata(page, { fromKey, toKey });\n const encrypted = encryptedCitations(rel, meta.content, format);\n if (encrypted.withCommit) wantsHistory = true;\n const cited: ReencryptCitationsResult = encrypted.any\n ? await reencryptCitations(\n { ...page, content: meta.content },\n { root, fromKey, toKey, gitClient: client, sourceIndex: await sourceIndex() },\n )\n : { content: meta.content, rewritten: [], skipped: [] };\n const rewritten: RotatedValue[] = [\n ...meta.rewritten.map((r) => ({ kind: \"metadata\" as const, ...r })),\n ...cited.rewritten.map((r) => ({ kind: \"citation\" as const, ...r })),\n ...sidecarWork.rewritten,\n ];\n const skipped: SkippedValue[] = [\n ...meta.skipped.map((s) => ({ kind: \"metadata\" as const, ...s })),\n ...cited.skipped.map((s) => ({ kind: \"citation\" as const, ...s })),\n ...sidecarWork.skipped,\n ];\n if (rewritten.length === 0 && skipped.length === 0) continue;\n planned.push({\n page: { file: rel, rewritten, skipped, written: false },\n path,\n content: cited.content,\n changed: cited.content !== before,\n });\n }\n\n // A pin that no longer holds is re-keyed from the lines at its commit, so a\n // citation with one wants git. Where git is not there, said once.\n if (wantsHistory && !(await client.available())) opts.onNotice?.(GIT_UNAVAILABLE_HISTORY);\n\n // The private half of the same documents: every local manifest of the\n // collections this run covers. Planned in memory like the pages, and\n // counted with them, so one unreadable value anywhere stops the whole run.\n const valueManifests =\n file === null\n ? []\n : await planManifests({\n collections: manifestCollections(collections, {\n fromCollections,\n files,\n base,\n configDir: file.dir,\n }),\n configDir: file.dir,\n base,\n fromKey,\n toKey,\n pages: files.map((rel) => resolve(base, rel)),\n whole: !narrowed,\n });\n\n const reencrypted =\n planned.reduce((n, p) => n + p.page.rewritten.length, 0) +\n valueManifests.reduce((n, m) => n + m.manifest.rewritten.length, 0);\n const skipped =\n planned.reduce((n, p) => n + p.page.skipped.length, 0) +\n valueManifests.reduce((n, m) => n + m.manifest.skipped.length, 0);\n const writePage = opts.writePage ?? ((path: string, content: string) => writeFileAtomic(path, content));\n\n let outcome: RotateOutcome;\n if (skipped > 0) {\n // The new key is never written beside a value it cannot decrypt, and no\n // page is written without the key: nothing at all.\n outcome = \"skipped\";\n } else if (opts.dryRun === true) {\n outcome = \"dry-run\";\n } else {\n const writesKey = !narrowed && keyFile !== null;\n // (1) The new key, with the old one beside it. A rotation being finished\n // already has both.\n if (!narrowed && keyFile !== null && previous === undefined) {\n await writeEncryptionKey({ file: keyFile, key: toKey, previous: fromKey, cwd, toError: toKeyError });\n }\n // (2) The pages, then the manifests: the citations one owns, and the\n // encrypted values another holds. Each manifest is written once,\n // however many pages it keeps entries for.\n for (const p of planned) {\n if (!p.changed) continue;\n await writePage(p.path, p.content);\n p.page.written = true;\n }\n for (const changed of manifests.changed()) await writePage(changed.path, changed.text);\n for (const m of valueManifests) {\n if (!m.changed) continue;\n await writePage(m.path, m.text);\n m.manifest.written = true;\n }\n // (3) The old key goes, now that nothing is under it.\n if (!narrowed && keyFile !== null) {\n await writeEncryptionKey({ file: keyFile, key: toKey, previous: null, cwd, toError: toKeyError });\n }\n if (narrowed) outcome = \"narrowed\";\n else if (!writesKey) outcome = \"env\";\n else outcome = previous === undefined ? \"written\" : \"finished\";\n }\n\n const wrote = outcome !== \"skipped\" && outcome !== \"dry-run\";\n const baseline =\n file !== null && cite.baseline !== undefined\n ? resolve(file.dir, cite.baseline)\n : join(file?.dir ?? cwd, DEFAULT_CITE_BASELINE_PATH);\n\n return {\n pages: planned.map((p) => p.page),\n manifests: valueManifests.map((m) => m.manifest),\n reencrypted,\n skipped,\n keyWritten: outcome === \"written\" || outcome === \"finished\",\n outcome,\n ...(keyFile === null ? {} : { configSource: keyFile.source }),\n baselineStale: wrote && existsSync(baseline),\n exitCode: skipped > 0 ? 1 : 0,\n };\n}\n","/**\n * Which config file `manni key` reads and writes. `key` has no section of its\n * own (proposal 0045): the key it manages sits at the top of the family file,\n * beside `collections:`.\n *\n * - `set` writes the nearest family file whatever it carries, or the one `-c`\n * names, read as a family file (`findFamilyConfigFile`,\n * `readFamilyConfigFile`).\n * - `rotate` reads its key and collections from the file every sibling\n * without a section there would read them from: the nearest family file\n * carrying `collections:` or `encryptionKey:`. That is discovery with a\n * section name nothing uses.\n */\nimport {\n findConfigFile,\n findFamilyConfigFile,\n readConfigFile,\n readFamilyConfigFile,\n type ConfigFile,\n type ConfigFileOptions,\n} from \"../../shared/config-file.js\";\nimport { KeyError } from \"../errors.js\";\n\nexport const toKeyError = (message: string): KeyError => new KeyError(message);\n\nconst KEY_CONFIG: ConfigFileOptions = {\n section: \"key\",\n // The key never had a file of its own.\n legacyNames: [],\n toError: toKeyError,\n};\n\n/** The config `rotate` reads the current key and the collections from. */\nexport function readRotateConfig(\n configPath: string | undefined,\n cwd: string,\n): Promise<ConfigFile | null> {\n return configPath === undefined\n ? findConfigFile(cwd, KEY_CONFIG)\n : readConfigFile(configPath, cwd, KEY_CONFIG);\n}\n\n/** The config `set` writes to; `null` when discovery finds no family file. */\nexport function readSetConfig(\n configPath: string | undefined,\n cwd: string,\n): Promise<ConfigFile | null> {\n return configPath === undefined\n ? findFamilyConfigFile(cwd, toKeyError)\n : readFamilyConfigFile(configPath, cwd, toKeyError);\n}\n\n/** The refusal while `encryptionKeyPrevious:` says a rotation is unfinished. */\nexport const unfinishedRotation = (source: string): string =>\n `A rotation is unfinished in ${source}. Run \\`manni key rotate\\` with no --to to finish it.`;\n","/**\n * `manni key set [value]`: write the family encryption key (proposal 0045).\n *\n * Refusals, each exit 2 and none echoing a value: a value of the wrong shape;\n * `MANNI_ENCRYPTION_KEY` set, because it wins and the written key would never\n * be read; a rotation left unfinished; a key already configured, because\n * replacing one in place strands every value encrypted under it (`rotate` is\n * what replaces a key); and a new `manni.config.yaml` beside a legacy\n * `docmeta.config.yaml`, which the new file would hide from `manni meta`.\n *\n * It warns, and still writes, when git would publish the file.\n */\nimport { existsSync } from \"node:fs\";\nimport { basename, dirname, join, relative, resolve } from \"node:path\";\nimport { LEGACY_CONFIG_NAMES } from \"../../meta/internal.js\";\nimport {\n ENCRYPTION_KEY_ENV,\n committedKeyWarning,\n isIgnoredByGit,\n writeEncryptionKey,\n} from \"../../shared/encryption-key.js\";\nimport { generateEncryptionKey, isValidEncryptionKey } from \"../../shared/encryption.js\";\nimport { readSetConfig, toKeyError, unfinishedRotation } from \"../core/config.js\";\nimport { KeyError } from \"../errors.js\";\nimport type { KeySetOptions, KeySetResult } from \"../types.js\";\n\nconst BAD_VALUE =\n \"The key must be at least 32 hex or base64url characters. Run `manni key set` with no value to generate one.\";\nconst ENV_SET = `${ENCRYPTION_KEY_ENV} is set, so a key written to config would never be read. Unset it, or keep the key in the secret.`;\n\nconst alreadyConfigured = (source: string): string =>\n `An encryption key is already configured in ${source}. Run \\`manni key rotate\\` to replace it and re-encrypt every value.`;\n\n/**\n * A new family file beside a legacy per-tool file hides it: discovery reads\n * the family file first in a directory, and one holding only a key is every\n * tool's config, so `manni meta` would stop reading the options it had.\n */\nfunction refuseBesideLegacy(path: string, cwd: string): void {\n const dir = dirname(path);\n const name = basename(path);\n for (const legacy of LEGACY_CONFIG_NAMES) {\n const found = join(dir, legacy);\n if (!existsSync(found)) continue;\n const source = relative(cwd, found).replace(/\\\\/g, \"/\");\n throw new KeyError(\n `${source} is a single-tool config; a ${name} beside it would hide it. Move its keys under meta: in ${name} first.`,\n );\n }\n}\n\nexport async function runKeySet(opts: KeySetOptions): Promise<KeySetResult> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const env = opts.env ?? process.env;\n if (opts.value !== undefined && !isValidEncryptionKey(opts.value)) {\n throw new KeyError(BAD_VALUE);\n }\n // Empty counts as unset, as `resolveEncryptionKey` has it.\n const fromEnv = env[ENCRYPTION_KEY_ENV];\n if (fromEnv !== undefined && fromEnv !== \"\") throw new KeyError(ENV_SET);\n\n const file = await readSetConfig(opts.configPath, cwd);\n if (file?.encryptionKeyPrevious !== undefined) {\n throw new KeyError(unfinishedRotation(file.source));\n }\n if (file?.encryptionKey !== undefined) {\n throw new KeyError(alreadyConfigured(file.source));\n }\n\n const generated = opts.value === undefined;\n const key = opts.value ?? generateEncryptionKey();\n const dryRun = opts.dryRun === true;\n // Name the target before writing to it: the legacy check and the git\n // warning are both about the file the key is about to land in.\n const target = await writeEncryptionKey({ file, key, cwd, toError: toKeyError, dryRun: true });\n if (target.created) refuseBesideLegacy(target.path, cwd);\n if (isIgnoredByGit(target.path) === false) {\n opts.onNotice?.(committedKeyWarning(target.source));\n }\n if (!dryRun) await writeEncryptionKey({ file, key, cwd, toError: toKeyError });\n return { path: target.path, source: target.source, created: target.created, generated, dryRun };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAI,SAAS,mBAAmB,KAAK,MAAM,CAAC;AAAA,EACpD;AACA,MAAI,MAAM,kBAAkB,QAAW;AACrC,UAAM,IAAI,SAAS,kBAAkB,KAAK,MAAM,CAAC;AAAA,EACnD;AAEA,QAAM,YAAY,KAAK,UAAU;AACjC,QAAM,MAAM,KAAK,SAAS,sBAAsB;AAChD,QAAM,SAAS,KAAK,WAAW;AAG/B,QAAM,SAAS,MAAM,mBAAmB,EAAE,MAAM,KAAK,KAAK,SAAS,YAAY,QAAQ,KAAK,CAAC;AAC7F,MAAI,OAAO,QAAS,oBAAmB,OAAO,MAAM,GAAG;AACvD,MAAI,eAAe,OAAO,IAAI,MAAM,OAAO;AACzC,SAAK,WAAW,oBAAoB,OAAO,MAAM,CAAC;AAAA,EACpD;AACA,MAAI,CAAC,OAAQ,OAAM,mBAAmB,EAAE,MAAM,KAAK,KAAK,SAAS,WAAW,CAAC;AAC7E,SAAO,EAAE,MAAM,OAAO,MAAM,QAAQ,OAAO,QAAQ,SAAS,OAAO,SAAS,WAAW,OAAO;AAChG;","names":["join","skipped","existsSync","join","relative","resolve","join","existsSync","relative","resolve"]}
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
matchesFileGlob,
|
|
6
6
|
readConfigFile,
|
|
7
7
|
selectCollections
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-B2242FYO.js";
|
|
9
9
|
import {
|
|
10
10
|
warn
|
|
11
11
|
} from "./chunk-HX44GB4Z.js";
|
|
12
12
|
import {
|
|
13
13
|
package_default
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-C37OVJ35.js";
|
|
15
15
|
import {
|
|
16
16
|
programName
|
|
17
17
|
} from "./chunk-OWBRDNRZ.js";
|
|
@@ -2711,7 +2711,7 @@ async function walkTargetSet(opts) {
|
|
|
2711
2711
|
}
|
|
2712
2712
|
function notFoundMessage(missing) {
|
|
2713
2713
|
const names = missing.map((m) => `"${m}"`).join(", ");
|
|
2714
|
-
return missing.length === 1 ? `File not found: ${names}.` : `Files not found: ${names}.`;
|
|
2714
|
+
return missing.length === 1 ? `File not found: ${names}. Check the path. Named paths resolve from the working directory.` : `Files not found: ${names}. Check the paths. Named paths resolve from the working directory.`;
|
|
2715
2715
|
}
|
|
2716
2716
|
function assertNonEmpty(p) {
|
|
2717
2717
|
if (p.allowEmpty || p.usingStdin || p.files.length > 0) return;
|
|
@@ -10897,6 +10897,70 @@ var PUBLISHED_PATHS = [
|
|
|
10897
10897
|
["terminology-strict/1.2.0.json", "manni:terminology-strict:1.2.0"],
|
|
10898
10898
|
["ai-context/1.1.0.json", "manni:ai-context:1.1.0"]
|
|
10899
10899
|
];
|
|
10900
|
+
var GUIDE_BASE = "https://hawkeyexl.github.io/manni/meta/reference/schemas/";
|
|
10901
|
+
var GUIDE_SLUGS = /* @__PURE__ */ new Map([
|
|
10902
|
+
["agentskills:skill:1.0", "agentskills-skill"],
|
|
10903
|
+
["anthropic:claude-skill:2.1", "anthropic-claude-skill"],
|
|
10904
|
+
["anthropic:claude-subagent:2.1", "anthropic-claude-subagent"],
|
|
10905
|
+
["antora:page:3.1", "antora-page"],
|
|
10906
|
+
["astro:starlight:0.41", "astro-starlight"],
|
|
10907
|
+
["dcmi:elements:1.1", "dcmi-elements"],
|
|
10908
|
+
["diataxis:diataxis:1.0", "diataxis"],
|
|
10909
|
+
["docusaurus:blog:3.10", "docusaurus-blog"],
|
|
10910
|
+
["docusaurus:docs:3.10", "docusaurus-docs"],
|
|
10911
|
+
["docusaurus:pages:3.10", "docusaurus-pages"],
|
|
10912
|
+
["google:okf:0.1", "google-okf"],
|
|
10913
|
+
["hugo:page:0.165", "hugo-page"],
|
|
10914
|
+
["jekyll:page:4.4", "jekyll-page"],
|
|
10915
|
+
["manni:ai-context:1.0.0", "manni-ai-context"],
|
|
10916
|
+
["manni:ai-context:1.1.0", "manni-ai-context"],
|
|
10917
|
+
["manni:ai-context-strict:1.0.0", "manni-ai-context"],
|
|
10918
|
+
["manni:artifact-evals:1.0.0", "manni-artifact-evals"],
|
|
10919
|
+
["manni:artifact-evals:1.1.0", "manni-artifact-evals"],
|
|
10920
|
+
["manni:artifact-evals-strict:1.0.0", "manni-artifact-evals"],
|
|
10921
|
+
["manni:artifact-evals-strict:1.1.0", "manni-artifact-evals"],
|
|
10922
|
+
["manni:audience:1.0.0", "manni-audience"],
|
|
10923
|
+
["manni:audience-strict:1.0.0", "manni-audience"],
|
|
10924
|
+
["manni:citations:1.0.0", "manni-citations"],
|
|
10925
|
+
["manni:citations-strict:1.0.0", "manni-citations"],
|
|
10926
|
+
["manni:core:1.0.0", "manni-core"],
|
|
10927
|
+
["manni:core-strict:1.0.0", "manni-core"],
|
|
10928
|
+
["manni:evals:1.0.0", "manni-evals"],
|
|
10929
|
+
["manni:evals-strict:1.0.0", "manni-evals"],
|
|
10930
|
+
["manni:graph:1.0.0", "manni-graph"],
|
|
10931
|
+
["manni:graph-strict:1.0.0", "manni-graph"],
|
|
10932
|
+
["manni:lifecycle:1.0.0", "manni-lifecycle"],
|
|
10933
|
+
["manni:lifecycle-strict:1.0.0", "manni-lifecycle"],
|
|
10934
|
+
["manni:stewardship:1.0.0", "manni-stewardship"],
|
|
10935
|
+
["manni:stewardship:1.1.0", "manni-stewardship"],
|
|
10936
|
+
["manni:stewardship-strict:1.0.0", "manni-stewardship"],
|
|
10937
|
+
["manni:stewardship-strict:1.1.0", "manni-stewardship"],
|
|
10938
|
+
["manni:structure:1.0.0", "manni-structure"],
|
|
10939
|
+
["manni:structure-strict:1.0.0", "manni-structure"],
|
|
10940
|
+
["manni:terminology:1.0.0", "manni-terminology"],
|
|
10941
|
+
["manni:terminology:1.1.0", "manni-terminology"],
|
|
10942
|
+
["manni:terminology:1.2.0", "manni-terminology"],
|
|
10943
|
+
["manni:terminology-strict:1.0.0", "manni-terminology"],
|
|
10944
|
+
["manni:terminology-strict:1.1.0", "manni-terminology"],
|
|
10945
|
+
["manni:terminology-strict:1.2.0", "manni-terminology"],
|
|
10946
|
+
["microsoft:learn:1.0", "microsoft-learn"],
|
|
10947
|
+
["mkdocs:material:9.7", "mkdocs-material"],
|
|
10948
|
+
["myst:frontmatter:1.10", "myst-frontmatter"],
|
|
10949
|
+
["oasis:dita-metadata:1.3", "oasis-dita-metadata"],
|
|
10950
|
+
["ogp:article:1.0", "ogp-article"],
|
|
10951
|
+
["passo-uno:seven-action:1.0", "passo-uno-seven-action"],
|
|
10952
|
+
["sphinx:docinfo:9.1", "sphinx-docinfo"],
|
|
10953
|
+
["tgdp:templates:1.0", "tgdp-templates-1-0"],
|
|
10954
|
+
["tgdp:templates:1.1", "tgdp-templates"],
|
|
10955
|
+
["tgdp:templates-strict:1.1", "tgdp-templates"],
|
|
10956
|
+
["vitepress:page:1.6", "vitepress-page"],
|
|
10957
|
+
["x:cards:1.0", "x-cards"]
|
|
10958
|
+
]);
|
|
10959
|
+
function builtinGuide(ref) {
|
|
10960
|
+
const id = PUBLISHED_ALIAS.get(ref) ?? LEGACY_PUBLISHED_ALIAS.get(ref) ?? ref;
|
|
10961
|
+
const slug = GUIDE_SLUGS.get(id);
|
|
10962
|
+
return slug === void 0 ? null : `${GUIDE_BASE}${slug}/`;
|
|
10963
|
+
}
|
|
10900
10964
|
var PUBLISHED_ALIAS = new Map(
|
|
10901
10965
|
PUBLISHED_PATHS.map(([path, id]) => [`${PUBLISHED_BASE}${path}`, id])
|
|
10902
10966
|
);
|
|
@@ -11188,6 +11252,16 @@ function unknownSchemaMessage(ref, registered) {
|
|
|
11188
11252
|
const ids = [...registered?.keys() ?? []];
|
|
11189
11253
|
return `Unknown schema "${ref}". manni meta schemas lists the built-in ids. Registered by meta.register: ${ids.length > 0 ? ids.join(", ") : "none"}.`;
|
|
11190
11254
|
}
|
|
11255
|
+
var UnknownSchemaError = class extends DocmetaError {
|
|
11256
|
+
constructor(ref, registered) {
|
|
11257
|
+
super(unknownSchemaMessage(ref, registered));
|
|
11258
|
+
this.ref = ref;
|
|
11259
|
+
}
|
|
11260
|
+
ref;
|
|
11261
|
+
};
|
|
11262
|
+
function documentSchemaMessage(err) {
|
|
11263
|
+
return err instanceof UnknownSchemaError ? `$schema names "${err.ref}", which this repository does not define. Use an id from manni meta schemas, or remove $schema.` : err.message;
|
|
11264
|
+
}
|
|
11191
11265
|
async function loadSchema(ref, options = {}) {
|
|
11192
11266
|
const registered = options.registered?.get(ref);
|
|
11193
11267
|
if (registered) return registered.schema;
|
|
@@ -11200,7 +11274,7 @@ async function loadSchema(ref, options = {}) {
|
|
|
11200
11274
|
}
|
|
11201
11275
|
if (kind === "builtin") {
|
|
11202
11276
|
const schema = BUILTINS.get(ref);
|
|
11203
|
-
if (!schema) throw new
|
|
11277
|
+
if (!schema) throw new UnknownSchemaError(ref, options.registered);
|
|
11204
11278
|
return schema;
|
|
11205
11279
|
}
|
|
11206
11280
|
if (kind === "url") {
|
|
@@ -11587,7 +11661,7 @@ function assertDocumentRefAllowed(ref, mode, params) {
|
|
|
11587
11661
|
if (kind === "url") {
|
|
11588
11662
|
if (mode === "local") {
|
|
11589
11663
|
throw new DocmetaError(
|
|
11590
|
-
|
|
11664
|
+
`${FILE_SCHEMA_KEY} names the URL "${ref}", and this repository accepts only built-in ids and schema files here. Use one of those, or remove ${FILE_SCHEMA_KEY}.`
|
|
11591
11665
|
);
|
|
11592
11666
|
}
|
|
11593
11667
|
const hosts = params.config?.schemaTrust?.hosts;
|
|
@@ -11597,12 +11671,12 @@ function assertDocumentRefAllowed(ref, mode, params) {
|
|
|
11597
11671
|
url = new URL(ref);
|
|
11598
11672
|
} catch {
|
|
11599
11673
|
throw new DocmetaError(
|
|
11600
|
-
|
|
11674
|
+
`${FILE_SCHEMA_KEY} names "${ref}", which is not a valid URL. Use a built-in id or a schema file in the repository, or remove ${FILE_SCHEMA_KEY}.`
|
|
11601
11675
|
);
|
|
11602
11676
|
}
|
|
11603
11677
|
if (!hostAllowed(url, hosts)) {
|
|
11604
11678
|
throw new DocmetaError(
|
|
11605
|
-
|
|
11679
|
+
`${FILE_SCHEMA_KEY} names a schema on "${url.host}", a host this repository does not trust. Use a built-in id or a schema file in the repository, or remove ${FILE_SCHEMA_KEY}.`
|
|
11606
11680
|
);
|
|
11607
11681
|
}
|
|
11608
11682
|
return;
|
|
@@ -11612,10 +11686,10 @@ function assertDocumentRefAllowed(ref, mode, params) {
|
|
|
11612
11686
|
const abs = resolve5(params.fileBase ?? process.cwd(), ref);
|
|
11613
11687
|
const within = relative4(root.dir, abs);
|
|
11614
11688
|
if (within !== "" && !within.startsWith("..") && !isAbsolute(within)) return;
|
|
11615
|
-
const
|
|
11689
|
+
const why = root.source === "git" ? "" : root.source === "config" ? " No git repository was found, so the config file's own directory is the boundary." : " No git repository and no config file were found, so the directory the command was run from is the boundary.";
|
|
11616
11690
|
const scope = root.source === "git" ? "the repository" : "the project";
|
|
11617
11691
|
throw new DocmetaError(
|
|
11618
|
-
|
|
11692
|
+
`${FILE_SCHEMA_KEY} "${ref}" points outside ${root.dir}.${why} Use a built-in id or a schema file inside ${scope}, or remove ${FILE_SCHEMA_KEY}.`
|
|
11619
11693
|
);
|
|
11620
11694
|
}
|
|
11621
11695
|
function withStrict(refs, registered) {
|
|
@@ -12830,11 +12904,13 @@ export {
|
|
|
12830
12904
|
__default as __default3,
|
|
12831
12905
|
__default48 as __default4,
|
|
12832
12906
|
listBuiltins,
|
|
12907
|
+
builtinGuide,
|
|
12833
12908
|
isPublishedBuiltinUrl,
|
|
12834
12909
|
publishedBuiltins,
|
|
12835
12910
|
classifyRef,
|
|
12836
12911
|
fetchSchemaBytes,
|
|
12837
12912
|
schemaLoadOptions,
|
|
12913
|
+
documentSchemaMessage,
|
|
12838
12914
|
loadSchema,
|
|
12839
12915
|
DEFAULT_BASELINE_PATH,
|
|
12840
12916
|
LEGACY_BASELINE_PATH,
|
|
@@ -12879,4 +12955,4 @@ export {
|
|
|
12879
12955
|
loadMetaSection,
|
|
12880
12956
|
resolveRunConfig
|
|
12881
12957
|
};
|
|
12882
|
-
//# sourceMappingURL=chunk-
|
|
12958
|
+
//# sourceMappingURL=chunk-OFOIBV5J.js.map
|