@hawkeyexl/manni 4.13.0 → 4.14.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-TKNIUBLK.js +48 -0
- package/dist/build-6G7PEAG4.js +37 -0
- package/dist/calibrate-BDCXDZV5.js +43 -0
- package/dist/capture-NQJLZD66.js +39 -0
- package/dist/check-552X5I2J.js +36 -0
- package/dist/{check-LU5YC3L4.js → check-5HMDJOFP.js} +15 -14
- package/dist/check-BSB4FF4L.js +33 -0
- package/dist/{check-NBN2YK2J.js → check-QIZCTAIR.js} +33 -32
- package/dist/{check-NBN2YK2J.js.map → check-QIZCTAIR.js.map} +1 -1
- package/dist/{chunk-NSAW7U42.js → chunk-2A6XYSXO.js} +58 -10
- package/dist/chunk-2A6XYSXO.js.map +1 -0
- package/dist/{chunk-PA7CMQGD.js → chunk-2HQSMZ4N.js} +11 -5
- package/dist/chunk-2HQSMZ4N.js.map +1 -0
- package/dist/{chunk-LNGSE7V2.js → chunk-36FJWJSK.js} +132 -27
- package/dist/chunk-36FJWJSK.js.map +1 -0
- package/dist/{chunk-BMBAAPGN.js → chunk-3BMTCS4H.js} +33 -18
- package/dist/chunk-3BMTCS4H.js.map +1 -0
- package/dist/{chunk-NWUXRV6N.js → chunk-3CCY7M3R.js} +10 -8
- package/dist/chunk-3CCY7M3R.js.map +1 -0
- package/dist/{chunk-TDCOKKMI.js → chunk-3MTZZJKH.js} +3 -3
- package/dist/chunk-4U3X7LYV.js +236 -0
- package/dist/chunk-4U3X7LYV.js.map +1 -0
- package/dist/{chunk-OYIWF3B2.js → chunk-56URKBXQ.js} +17 -17
- package/dist/chunk-56URKBXQ.js.map +1 -0
- package/dist/{chunk-IGQMBHFY.js → chunk-66MKBRTA.js} +88 -12
- package/dist/chunk-66MKBRTA.js.map +1 -0
- package/dist/{chunk-GWI6JPTT.js → chunk-6VT3Z352.js} +24 -7
- package/dist/chunk-6VT3Z352.js.map +1 -0
- package/dist/{chunk-CU57HT2E.js → chunk-6WJUZQQX.js} +2 -2
- package/dist/{chunk-NTEYYYKL.js → chunk-6XFSZCLT.js} +16 -22
- package/dist/chunk-6XFSZCLT.js.map +1 -0
- package/dist/{chunk-OREHJQNN.js → chunk-742G2QCV.js} +4 -3
- package/dist/{chunk-OREHJQNN.js.map → chunk-742G2QCV.js.map} +1 -1
- package/dist/chunk-7AXJY4FX.js +83 -0
- package/dist/chunk-7AXJY4FX.js.map +1 -0
- package/dist/{chunk-EQ7E6HMG.js → chunk-7KOWE4F4.js} +14 -16
- package/dist/chunk-7KOWE4F4.js.map +1 -0
- package/dist/{chunk-J5NOWIJ3.js → chunk-7PENJOI6.js} +14 -8
- package/dist/{chunk-J5NOWIJ3.js.map → chunk-7PENJOI6.js.map} +1 -1
- package/dist/chunk-7WVWGULD.js +81 -0
- package/dist/chunk-7WVWGULD.js.map +1 -0
- package/dist/{chunk-VYBYUQIP.js → chunk-A7MNH4YI.js} +88 -7
- package/dist/chunk-A7MNH4YI.js.map +1 -0
- package/dist/{chunk-WVXCN5DS.js → chunk-AJYUJ37M.js} +65 -8
- package/dist/chunk-AJYUJ37M.js.map +1 -0
- package/dist/{chunk-OTJOBZJ5.js → chunk-B2242FYO.js} +2 -1
- package/dist/chunk-B2242FYO.js.map +1 -0
- package/dist/{chunk-YZ4TJLZQ.js → chunk-B6GUSA53.js} +15 -10
- package/dist/chunk-B6GUSA53.js.map +1 -0
- package/dist/{chunk-PCGBXHSE.js → chunk-BA4TCCOO.js} +5 -5
- package/dist/{chunk-TQ3W6RKG.js → chunk-BAWKNF6U.js} +3 -3
- package/dist/{chunk-HY6ROJTH.js → chunk-BIRGZEWO.js} +86 -10
- package/dist/chunk-BIRGZEWO.js.map +1 -0
- package/dist/chunk-BREAC43H.js +85 -0
- package/dist/chunk-BREAC43H.js.map +1 -0
- package/dist/{chunk-YQV75FIL.js → chunk-CFMI74TP.js} +3 -3
- package/dist/{chunk-OUAH7XF2.js → chunk-CZJNYHK7.js} +2 -2
- package/dist/{chunk-52WO7ESI.js → chunk-D2TIZOMN.js} +6 -5
- package/dist/chunk-D2TIZOMN.js.map +1 -0
- package/dist/{chunk-VOXOBUTX.js → chunk-EXAZ7K25.js} +5 -5
- package/dist/{chunk-BQXY76JB.js → chunk-GHZAOPGK.js} +148 -92
- package/dist/chunk-GHZAOPGK.js.map +1 -0
- package/dist/{chunk-UQMLCIRX.js → chunk-HGU4FDRY.js} +6 -6
- package/dist/{chunk-ZXRAE55H.js → chunk-IGRXQC3H.js} +2 -2
- package/dist/{chunk-3BVDFQ6Y.js → chunk-IOYEPB27.js} +5 -5
- package/dist/{chunk-U6IHLEWT.js → chunk-JCTHXG33.js} +2 -2
- package/dist/{chunk-6ZFJWUUH.js → chunk-JNMY7KZG.js} +2 -2
- package/dist/{chunk-OBXCJZ6R.js → chunk-JTEWU4C6.js} +26 -16
- package/dist/chunk-JTEWU4C6.js.map +1 -0
- package/dist/{chunk-VNYXK7TM.js → chunk-JWBS7YDI.js} +8 -8
- package/dist/chunk-JWBS7YDI.js.map +1 -0
- package/dist/{chunk-ULDV2LUI.js → chunk-LCRBR7KW.js} +10 -4
- package/dist/chunk-LCRBR7KW.js.map +1 -0
- package/dist/{chunk-3HUCB4Z3.js → chunk-M43NTWVH.js} +10 -7
- package/dist/chunk-M43NTWVH.js.map +1 -0
- package/dist/chunk-M534DYAJ.js +76 -0
- package/dist/chunk-M534DYAJ.js.map +1 -0
- package/dist/chunk-MC7U5IH4.js +126 -0
- package/dist/chunk-MC7U5IH4.js.map +1 -0
- package/dist/{chunk-7JPL3CUC.js → chunk-MIGFQP5N.js} +2 -2
- package/dist/{chunk-TZOYZK2E.js → chunk-OZUPJB4J.js} +2 -2
- package/dist/{chunk-X4MPUD4B.js → chunk-QEZQ7MGH.js} +53 -13
- package/dist/chunk-QEZQ7MGH.js.map +1 -0
- package/dist/{chunk-DQOM3DEU.js → chunk-QF7EIRMU.js} +29 -23
- package/dist/chunk-QF7EIRMU.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-OKMTUAWO.js → chunk-QSPH4F56.js} +5 -5
- package/dist/{chunk-JUL2PRQN.js → chunk-STM3G7WJ.js} +207 -79
- package/dist/chunk-STM3G7WJ.js.map +1 -0
- package/dist/{chunk-HKTGHLBA.js → chunk-T3BBNLAT.js} +2 -2
- package/dist/{chunk-HKTGHLBA.js.map → chunk-T3BBNLAT.js.map} +1 -1
- package/dist/{chunk-SCLXVTFZ.js → chunk-TKINOTVS.js} +1 -1
- package/dist/chunk-TKINOTVS.js.map +1 -0
- package/dist/{chunk-E6BVUDGY.js → chunk-USKTLEPZ.js} +4 -4
- package/dist/{chunk-LSFXNAHU.js → chunk-V6OCE4ND.js} +129 -59
- package/dist/chunk-V6OCE4ND.js.map +1 -0
- package/dist/{chunk-N6A6DJUO.js → chunk-VBBJGFME.js} +6 -7
- package/dist/chunk-VBBJGFME.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-JEUFYSFQ.js → chunk-W5DO426O.js} +114 -70
- package/dist/chunk-W5DO426O.js.map +1 -0
- package/dist/{chunk-3O6U4ICM.js → chunk-W6B24IMO.js} +3 -3
- package/dist/{chunk-SE4JN5XN.js → chunk-WDENIUC7.js} +3 -1
- package/dist/chunk-WDENIUC7.js.map +1 -0
- package/dist/{chunk-KE2F7QES.js → chunk-WIPTWZVH.js} +6 -6
- package/dist/{chunk-7RNONVHI.js → chunk-Y36PNW6J.js} +9 -9
- package/dist/{chunk-QKT67PFE.js → chunk-Y37VJFX2.js} +9 -9
- package/dist/{chunk-3XGTNN3M.js → chunk-YJ3EG2D5.js} +12 -124
- package/dist/chunk-YJ3EG2D5.js.map +1 -0
- package/dist/{chunk-UKZNLVJW.js → chunk-ZINZTHWO.js} +4 -2
- package/dist/chunk-ZINZTHWO.js.map +1 -0
- package/dist/{chunk-CODWRUAD.js → chunk-ZPLIXZZ6.js} +7 -5
- package/dist/chunk-ZPLIXZZ6.js.map +1 -0
- package/dist/{chunk-HIEGOW7X.js → chunk-ZRQUQS7P.js} +5 -79
- package/dist/chunk-ZRQUQS7P.js.map +1 -0
- package/dist/{cli-KYTCJYXK.js → cli-5XKHMRZ5.js} +317 -28
- package/dist/cli-5XKHMRZ5.js.map +1 -0
- package/dist/{cli-DGFLJ2DD.js → cli-7QHJW5GH.js} +69 -26
- package/dist/cli-7QHJW5GH.js.map +1 -0
- package/dist/{cli-7DETHSNW.js → cli-BUV3DRUH.js} +29 -83
- package/dist/cli-BUV3DRUH.js.map +1 -0
- package/dist/{cli-RP5E7XHC.js → cli-IKDX2I5X.js} +20 -18
- package/dist/{cli-RP5E7XHC.js.map → cli-IKDX2I5X.js.map} +1 -1
- package/dist/{cli-H5LVGOVT.js → cli-LOND37OA.js} +383 -247
- package/dist/cli-LOND37OA.js.map +1 -0
- package/dist/{cli-AZKWTCFV.js → cli-O6Y2KVWD.js} +11 -11
- package/dist/{cli-BW5VOFOZ.js → cli-QTLOAVOY.js} +11 -10
- package/dist/{cli-BW5VOFOZ.js.map → cli-QTLOAVOY.js.map} +1 -1
- package/dist/{cli-G66X7YMP.js → cli-SOA2E26G.js} +23 -22
- package/dist/{cli-G66X7YMP.js.map → cli-SOA2E26G.js.map} +1 -1
- package/dist/{cli-ECVT4YXR.js → cli-VQYB3663.js} +19 -18
- package/dist/{cli-ECVT4YXR.js.map → cli-VQYB3663.js.map} +1 -1
- package/dist/{cli-L5B2RVV2.js → cli-X6IWTDFK.js} +31 -29
- package/dist/{cli-L5B2RVV2.js.map → cli-X6IWTDFK.js.map} +1 -1
- package/dist/{cli-4JHQCPHU.js → cli-XAT673VB.js} +3 -3
- 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-IPBOTQBN.js +36 -0
- package/dist/github-XM36D7ZH.js +32 -0
- package/dist/graph/runtime.js.map +1 -1
- package/dist/index.d.ts +92 -20
- package/dist/index.js +137 -131
- package/dist/index.js.map +1 -1
- package/dist/{json-LCVPMEAM.js → json-225TND7K.js} +15 -13
- package/dist/{labels-OQXBVM4A.js → labels-CTLHIRC4.js} +14 -12
- package/dist/{labels-OQXBVM4A.js.map → labels-CTLHIRC4.js.map} +1 -1
- package/dist/lint-NP3PC3SO.js +35 -0
- package/dist/list-JJGNKO6S.js +36 -0
- package/dist/list-Q457TIMA.js +34 -0
- package/dist/{page-XPX5XJZE.js → page-FJW7J2EU.js} +13 -12
- package/dist/{picker-3XF36MJF.js → picker-FPUC5UGM.js} +3 -3
- package/dist/{prepare-VMBIQYAM.js → prepare-RKJEKHAG.js} +21 -20
- package/dist/{prepare-VMBIQYAM.js.map → prepare-RKJEKHAG.js.map} +1 -1
- package/dist/{pretty-KG6TMOEI.js → pretty-ECBO3EVT.js} +15 -14
- package/dist/{pretty-KSTZMBUF.js → pretty-QFEN2SIA.js} +15 -13
- package/dist/{provider-LBX4IXGX.js → provider-JY2I3VLF.js} +3 -3
- package/dist/{release-VV3UTKE5.js → release-Z3ASYZ3S.js} +3 -3
- package/dist/{reporters-FBYLPKD4.js → reporters-IKKL5RHS.js} +15 -14
- package/dist/{reporters-26H3N2KW.js → reporters-TDQDQHKE.js} +6 -5
- package/dist/{reporters-AQU4W3KY.js → reporters-WGLQKW2Y.js} +6 -6
- package/dist/run-BTETGGLW.js +39 -0
- package/dist/sarif-K4SMB563.js +31 -0
- package/dist/sarif-ZHFK6PZY.js +37 -0
- package/dist/{term-SI3VM6EM.js → term-2M7APX2A.js} +58 -109
- package/dist/term-2M7APX2A.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-GBM5STKS.js} +6 -6
- package/dist/validate-GBM5STKS.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-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-TKNIUBLK.js.map} +0 -0
- /package/dist/{build-4BL24BG3.js.map → build-6G7PEAG4.js.map} +0 -0
- /package/dist/{calibrate-AEDJ7N7G.js.map → calibrate-BDCXDZV5.js.map} +0 -0
- /package/dist/{capture-TP3P4YNL.js.map → capture-NQJLZD66.js.map} +0 -0
- /package/dist/{check-5IYH42KS.js.map → check-552X5I2J.js.map} +0 -0
- /package/dist/{check-LU5YC3L4.js.map → check-5HMDJOFP.js.map} +0 -0
- /package/dist/{check-S55MH66H.js.map → check-BSB4FF4L.js.map} +0 -0
- /package/dist/{chunk-TDCOKKMI.js.map → chunk-3MTZZJKH.js.map} +0 -0
- /package/dist/{chunk-CU57HT2E.js.map → chunk-6WJUZQQX.js.map} +0 -0
- /package/dist/{chunk-PCGBXHSE.js.map → chunk-BA4TCCOO.js.map} +0 -0
- /package/dist/{chunk-TQ3W6RKG.js.map → chunk-BAWKNF6U.js.map} +0 -0
- /package/dist/{chunk-YQV75FIL.js.map → chunk-CFMI74TP.js.map} +0 -0
- /package/dist/{chunk-OUAH7XF2.js.map → chunk-CZJNYHK7.js.map} +0 -0
- /package/dist/{chunk-VOXOBUTX.js.map → chunk-EXAZ7K25.js.map} +0 -0
- /package/dist/{chunk-UQMLCIRX.js.map → chunk-HGU4FDRY.js.map} +0 -0
- /package/dist/{chunk-ZXRAE55H.js.map → chunk-IGRXQC3H.js.map} +0 -0
- /package/dist/{chunk-3BVDFQ6Y.js.map → chunk-IOYEPB27.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-7JPL3CUC.js.map → chunk-MIGFQP5N.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-USKTLEPZ.js.map} +0 -0
- /package/dist/{chunk-PAU352SV.js.map → chunk-W4GTMOJW.js.map} +0 -0
- /package/dist/{chunk-3O6U4ICM.js.map → chunk-W6B24IMO.js.map} +0 -0
- /package/dist/{chunk-KE2F7QES.js.map → chunk-WIPTWZVH.js.map} +0 -0
- /package/dist/{chunk-7RNONVHI.js.map → chunk-Y36PNW6J.js.map} +0 -0
- /package/dist/{chunk-QKT67PFE.js.map → chunk-Y37VJFX2.js.map} +0 -0
- /package/dist/{cli-AZKWTCFV.js.map → cli-O6Y2KVWD.js.map} +0 -0
- /package/dist/{cli-4JHQCPHU.js.map → cli-XAT673VB.js.map} +0 -0
- /package/dist/{config-JJW75SBX.js.map → config-7I5CHHRZ.js.map} +0 -0
- /package/dist/{github-DJQ4MWNZ.js.map → github-IPBOTQBN.js.map} +0 -0
- /package/dist/{github-UWTDM2J2.js.map → github-XM36D7ZH.js.map} +0 -0
- /package/dist/{json-LCVPMEAM.js.map → json-225TND7K.js.map} +0 -0
- /package/dist/{lint-O7XRHKFP.js.map → lint-NP3PC3SO.js.map} +0 -0
- /package/dist/{list-OOOCLOAL.js.map → list-JJGNKO6S.js.map} +0 -0
- /package/dist/{list-OYQ5XPN2.js.map → list-Q457TIMA.js.map} +0 -0
- /package/dist/{page-XPX5XJZE.js.map → page-FJW7J2EU.js.map} +0 -0
- /package/dist/{picker-3XF36MJF.js.map → picker-FPUC5UGM.js.map} +0 -0
- /package/dist/{pretty-KG6TMOEI.js.map → pretty-ECBO3EVT.js.map} +0 -0
- /package/dist/{pretty-KSTZMBUF.js.map → pretty-QFEN2SIA.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-IKKL5RHS.js.map} +0 -0
- /package/dist/{reporters-AQU4W3KY.js.map → reporters-TDQDQHKE.js.map} +0 -0
- /package/dist/{reporters-FBYLPKD4.js.map → reporters-WGLQKW2Y.js.map} +0 -0
- /package/dist/{run-KUGTU3TT.js.map → run-BTETGGLW.js.map} +0 -0
- /package/dist/{types-Y6TXHM7M.js.map → sarif-K4SMB563.js.map} +0 -0
- /package/dist/{validate-NQO7TFSN.js.map → sarif-ZHFK6PZY.js.map} +0 -0
|
@@ -10,8 +10,10 @@ var TracevalsError = class extends ToolError {
|
|
|
10
10
|
this.name = "TracevalsError";
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
+
var TRIAGE_GUIDE = "https://hawkeyexl.github.io/manni/tracevals/triage/";
|
|
13
14
|
|
|
14
15
|
export {
|
|
15
|
-
TracevalsError
|
|
16
|
+
TracevalsError,
|
|
17
|
+
TRIAGE_GUIDE
|
|
16
18
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-ZINZTHWO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tracevals/types.ts"],"sourcesContent":["/** Shared result model and errors for manni tracevals. */\nimport type { ConsensusResult } from \"@hawkeyexl/inference\";\nimport type {\n AvailabilityReport,\n CoverageEntry,\n} from \"./artifacts/types.js\";\nimport type { ArtifactType } from \"./artifacts/types.js\";\nimport type { ManifestReport } from \"./capture/types.js\";\nimport type { Finding } from \"./graders/types.js\";\nimport { ToolError } from \"../shared/errors.js\";\nimport type { Guidance } from \"../shared/guidance.js\";\n\n/**\n * Operational error: bad usage, unreadable input, unknown format. Exits 2.\n * A `ToolError`, so the shared bin runner prints it as one line.\n */\nexport class TracevalsError extends ToolError {\n constructor(message: string) {\n super(message);\n this.name = \"TracevalsError\";\n }\n}\n\n/** The page every tracevals finding links to. */\nexport const TRIAGE_GUIDE = \"https://hawkeyexl.github.io/manni/tracevals/triage/\";\n\nexport type Outcome = \"pass\" | \"fail\" | \"error\" | \"needs-review\" | \"skipped\";\n\nexport interface EvalResult {\n evalName: string;\n /** Path of the artifact the eval came from. */\n artifact: string;\n artifactName: string;\n artifactType: ArtifactType;\n grader: string;\n implicit: boolean;\n /**\n * Where the eval is declared: the item of `metadata.evals` that names it, in\n * the artifact or in the manifest that supplied the block (proposal 0037).\n * `file` is relative to the working directory and forward-slashed when it is\n * inside it, absolute when it is not, and a URL for a hosted manifest.\n * `line` is 1-based, and absent when nothing records one, as for the\n * implicit eval, which no entry declares.\n */\n location: { file: string; line?: number };\n outcome: Outcome;\n /** Present for deterministic evals that produced findings. */\n findings?: Finding[];\n /** Present for judged evals. */\n consensus?: ConsensusResult;\n error?: string;\n skipReason?: string;\n /**\n * Judged evals only: uncached ensemble runs this eval spent. `0` when the\n * ensemble came from cache, or when the turn budget stopped it.\n */\n turns?: number;\n /**\n * Set when the model that judged this eval also produced what it graded.\n *\n * `session` — the judge model is the model that ran the session. This is the\n * sharpest form of the bias in either manni tool: the judge is not being\n * asked about a document it happened to draft, it is being asked whether its\n * own behavior followed the rules. `criterion` — `meta-provenance` records\n * this model proposing this assertion, so the judge wrote the question.\n *\n * Reported, never fatal: bias skews a verdict, it does not stop one forming,\n * and erroring would punish a single-model setup with no second provider to\n * reach for.\n */\n selfPreference?: { axis: \"session\" | \"criterion\"; model: string };\n /**\n * The eval's weight in the run's pass rate. Never changes its own outcome —\n * the binary verdict is what the reporters and exit code consume.\n */\n weight?: number;\n /**\n * The rule behind the result (proposal 0089): the artifact, the eval, its\n * assertion and the triage guide. The engine stamps it on every result,\n * passing ones included.\n */\n guidance?: Guidance | null;\n durationMs: number;\n}\n\nexport interface RunSummary {\n total: number;\n pass: number;\n fail: number;\n error: number;\n needsReview: number;\n skipped: number;\n /**\n * Weighted share of the graded set that passed, 1 when nothing was graded.\n *\n * The graded set is pass + fail + error; `needs-review` and `skipped` are in\n * neither half, so a session awaiting review neither helps nor hurts. Each\n * eval contributes its `weight` (1 unless it says otherwise), which is what\n * lets a secondary check report without dominating.\n *\n * Reported, never gated: manni tracevals has no suite targets to compare it\n * against, and inventing an exit-code rule around a number nobody configured\n * would be a gate no one asked for.\n */\n passRate: number;\n}\n\nexport interface RunReport {\n trace: {\n file: string;\n source: string;\n sessionId?: string;\n cwd: string;\n model?: string;\n turnCount: number;\n };\n /** Trace + resolution warnings, surfaced in every format. */\n warnings: string[];\n coverage: CoverageEntry[];\n /**\n * Offered versus used (ADR 01016). An observation about the session's\n * configuration; it never contributes to `summary` or `exitCode`.\n */\n availability: AvailabilityReport;\n /**\n * The session manifest this run consulted (ADR 01024), when one was found.\n * Absent means no manifest existed, which is the ordinary case — every hash\n * check then reports `skipped` and staleness stays the mtime heuristic.\n * Like `availability`, an observation: never in `summary`, never in\n * `exitCode`.\n */\n manifest?: ManifestReport;\n evalResults: EvalResult[];\n summary: RunSummary;\n /** 0 pass, 1 any fail/error (and needs-review when failOnReview). */\n exitCode: 0 | 1;\n /** Uncached ensemble runs this run spent. See `judge.maxTurns`. */\n turns: number;\n durationMs: number;\n}\n\n/* -------------------------------------------------------------------------- *\n * Batch runs (ADR 01018)\n *\n * Adherence is a rate across sessions, not a single verdict. `BatchReport`\n * sits alongside `RunReport` rather than replacing it: naming one trace still\n * yields exactly the `RunReport` above, byte for byte.\n * -------------------------------------------------------------------------- */\n\n/** Outcome tallies for one aggregate row. */\nexport interface AggregateCounts {\n pass: number;\n fail: number;\n error: number;\n needsReview: number;\n skipped: number;\n}\n\n/**\n * One artifact, or one eval within it, summed over every trace in the batch.\n *\n * Keyed by type and *name* rather than by path, so the same skill evaluated\n * across several projects is one rate — which is the fleet question this\n * report exists to answer. The paths it resolved from are kept in `artifacts`\n * so a reader can see when a row spans more than one.\n */\nexport interface AggregateRow {\n /** `<type>:<name>` for an artifact row, plus `::<evalName>` for an eval row. */\n key: string;\n artifactName: string;\n artifactType: ArtifactType;\n /** Distinct resolved paths this row was aggregated from, sorted. */\n artifacts: string[];\n /** Absent on artifact rows. */\n evalName?: string;\n /** The grader kinds seen for this row, sorted. Usually exactly one. */\n graders?: string[];\n /** Traces that produced at least one result for this row. */\n traces: number;\n /** Eval results contributing to this row. */\n total: number;\n counts: AggregateCounts;\n /** `total` minus `skipped` — the pass-rate denominator. */\n graded: number;\n /**\n * `pass / graded`, or `null` when nothing was graded. Skipped results are\n * excluded deliberately: a check that never armed is not evidence either\n * way, and folding it in would let an artifact nobody invoked report a\n * perfect score.\n */\n passRate: number | null;\n /** Traces where this row produced a `fail` or an `error`, in batch order. */\n failingTraces: string[];\n /** Traces where it produced a `needs-review`, in batch order. */\n reviewTraces: string[];\n /** Distinct skip reasons, sorted — an exhausted budget surfaces here. */\n skipReasons: string[];\n}\n\n/** One trace's place in the batch. */\nexport interface BatchTraceEntry {\n file: string;\n sessionId?: string;\n /**\n * Set when the trace could not be evaluated at all — unreadable, or not a\n * recognized format. One bad file in a corpus of fifty must not cost the\n * other forty-nine, so this is an entry rather than an aborted run.\n */\n error?: string;\n /** Absent when `error` is set. */\n summary?: RunSummary;\n warnings: string[];\n exitCode: 0 | 1;\n /** Judge turns spent on that trace. */\n turns: number;\n durationMs: number;\n}\n\nexport interface BatchSummary extends RunSummary {\n /** Traces selected, including any that errored. */\n traces: number;\n tracesPassed: number;\n /** Traces that produced a report with exit code 1. */\n tracesFailed: number;\n /** Traces that could not be evaluated at all. */\n tracesErrored: number;\n}\n\nexport interface BatchReport {\n traces: BatchTraceEntry[];\n /** Per-artifact rates, sorted by `key`. */\n artifacts: AggregateRow[];\n /** Per-eval rates, sorted by `key`. */\n evals: AggregateRow[];\n /** Eval counts summed over every trace, plus the per-trace tallies. */\n summary: BatchSummary;\n /** Batch-level warnings: plugin loading and trace selection. */\n warnings: string[];\n /** `1` when any trace failed or errored. */\n exitCode: 0 | 1;\n /** Judge turns spent across the batch. The budget spans it, not each trace. */\n turns: number;\n durationMs: number;\n}\n"],"mappings":";;;;;;AAgBO,IAAM,iBAAN,cAA6B,UAAU;AAAA,EAC5C,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;AAGO,IAAM,eAAe;","names":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
displayPath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YJ3EG2D5.js";
|
|
5
5
|
import {
|
|
6
6
|
escapeWorkflowCommandMessage,
|
|
7
|
-
escapeWorkflowCommandProperty
|
|
8
|
-
|
|
7
|
+
escapeWorkflowCommandProperty,
|
|
8
|
+
guidanceLines
|
|
9
|
+
} from "./chunk-QK6VYJHV.js";
|
|
9
10
|
|
|
10
11
|
// src/term/reporters/github.ts
|
|
11
12
|
function renderFindingsGithub(report) {
|
|
@@ -13,11 +14,12 @@ function renderFindingsGithub(report) {
|
|
|
13
14
|
const params = [`file=${escapeWorkflowCommandProperty(displayPath(finding.file, report.cwd))}`];
|
|
14
15
|
if (finding.line !== void 0) params.push(`line=${String(finding.line)}`);
|
|
15
16
|
params.push(`title=${escapeWorkflowCommandProperty(finding.ruleId)}`);
|
|
16
|
-
|
|
17
|
+
const message = [finding.message, ...guidanceLines(finding.guidance)].join("\n");
|
|
18
|
+
return `::${finding.severity} ${params.join(",")}::${escapeWorkflowCommandMessage(message)}`;
|
|
17
19
|
}).join("\n");
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export {
|
|
21
23
|
renderFindingsGithub
|
|
22
24
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-ZPLIXZZ6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/term/reporters/github.ts"],"sourcesContent":["/**\n * GitHub workflow commands, one per reported finding:\n * `::error file=<file>,line=<n>,title=<ruleId>::<message>`, with `::warning`\n * and `::notice` for the lower levels. The rule's guidance lines follow the\n * message after `%0A`. Uses meta's escapes. A clean run is the empty string,\n * which the CLI prints nothing for.\n */\nimport { escapeWorkflowCommandMessage, escapeWorkflowCommandProperty } from \"../../meta/internal.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport type { TermReport } from \"../commands/findings.js\";\nimport { displayPath } from \"../commands/run.js\";\n\nexport function renderFindingsGithub(report: TermReport): string {\n return report.findings\n .map((finding) => {\n const params = [`file=${escapeWorkflowCommandProperty(displayPath(finding.file, report.cwd))}`];\n if (finding.line !== undefined) params.push(`line=${String(finding.line)}`);\n params.push(`title=${escapeWorkflowCommandProperty(finding.ruleId)}`);\n const message = [finding.message, ...guidanceLines(finding.guidance)].join(\"\\n\");\n return `::${finding.severity} ${params.join(\",\")}::${escapeWorkflowCommandMessage(message)}`;\n })\n .join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;AAYO,SAAS,qBAAqB,QAA4B;AAC/D,SAAO,OAAO,SACX,IAAI,CAAC,YAAY;AAChB,UAAM,SAAS,CAAC,QAAQ,8BAA8B,YAAY,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE;AAC9F,QAAI,QAAQ,SAAS,OAAW,QAAO,KAAK,QAAQ,OAAO,QAAQ,IAAI,CAAC,EAAE;AAC1E,WAAO,KAAK,SAAS,8BAA8B,QAAQ,MAAM,CAAC,EAAE;AACpE,UAAM,UAAU,CAAC,QAAQ,SAAS,GAAG,cAAc,QAAQ,QAAQ,CAAC,EAAE,KAAK,IAAI;AAC/E,WAAO,KAAK,QAAQ,QAAQ,IAAI,OAAO,KAAK,GAAG,CAAC,KAAK,6BAA6B,OAAO,CAAC;AAAA,EAC5F,CAAC,EACA,KAAK,IAAI;AACd;","names":[]}
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
META_CONTEXT,
|
|
4
|
-
keyHome,
|
|
5
|
-
lazyKey,
|
|
6
|
-
loadExternalMetadata,
|
|
7
|
-
marksValidator,
|
|
8
|
-
memberOf,
|
|
9
|
-
mergeWithMarks,
|
|
10
|
-
pageMarks,
|
|
11
|
-
pageSchemaSet,
|
|
12
4
|
withValueAt
|
|
13
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-36FJWJSK.js";
|
|
14
6
|
import {
|
|
15
7
|
DocmetaError,
|
|
16
8
|
escapePointerSegment,
|
|
17
9
|
extractorByName,
|
|
18
10
|
extractorForExtension,
|
|
19
|
-
loadMetaSection,
|
|
20
|
-
rebaseConfigSchemaRefs,
|
|
21
|
-
schemaTrustRoot,
|
|
22
11
|
supportedExtensions
|
|
23
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BIRGZEWO.js";
|
|
24
13
|
import {
|
|
25
14
|
decryptValue,
|
|
26
15
|
encryptValue,
|
|
27
16
|
isEncryptedValue
|
|
28
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-B2242FYO.js";
|
|
29
18
|
import {
|
|
30
19
|
errorMessage
|
|
31
20
|
} from "./chunk-G3T47CFV.js";
|
|
@@ -128,71 +117,8 @@ function reencryptWith(extractor, page, opts) {
|
|
|
128
117
|
return { content, rewritten, skipped };
|
|
129
118
|
}
|
|
130
119
|
|
|
131
|
-
// src/meta/core/page-view.ts
|
|
132
|
-
async function metaPageView(opts) {
|
|
133
|
-
const { cwd } = opts;
|
|
134
|
-
const loaded = opts.noConfig === true ? null : await loadMetaSection(opts.configPath, cwd);
|
|
135
|
-
const config = loaded ? rebaseConfigSchemaRefs(loaded.config, loaded.dir, cwd) : null;
|
|
136
|
-
const configDir = loaded?.dir ?? cwd;
|
|
137
|
-
const collections = loaded?.collections ?? [];
|
|
138
|
-
const validator = marksValidator({
|
|
139
|
-
config,
|
|
140
|
-
cwd,
|
|
141
|
-
...loaded ? { configDir: loaded.dir } : {}
|
|
142
|
-
})();
|
|
143
|
-
const marksOptions = {
|
|
144
|
-
validator,
|
|
145
|
-
config,
|
|
146
|
-
cwd,
|
|
147
|
-
trustRoot: schemaTrustRoot(cwd, loaded?.dir)
|
|
148
|
-
};
|
|
149
|
-
const membersOf = (label) => memberOf(collections, configDir, cwd, label);
|
|
150
|
-
const index = await loadExternalMetadata(collections, {
|
|
151
|
-
configDir,
|
|
152
|
-
base: cwd,
|
|
153
|
-
offline: config?.offline ?? false,
|
|
154
|
-
...opts.pages === void 0 ? {} : { pages: opts.pages }
|
|
155
|
-
});
|
|
156
|
-
const joinKey = lazyKey(loaded?.configFile, void 0);
|
|
157
|
-
const marks = pageMarks(marksOptions);
|
|
158
|
-
const ctx = {
|
|
159
|
-
cwd,
|
|
160
|
-
base: cwd,
|
|
161
|
-
noConfig: loaded === null,
|
|
162
|
-
config,
|
|
163
|
-
...loaded ? { configDir: loaded.dir, configPath: loaded.path } : {},
|
|
164
|
-
...loaded?.configFile !== void 0 ? { configFile: loaded.configFile } : {},
|
|
165
|
-
collections,
|
|
166
|
-
declaredCollections: collections,
|
|
167
|
-
targets: [],
|
|
168
|
-
validator
|
|
169
|
-
};
|
|
170
|
-
return {
|
|
171
|
-
validator,
|
|
172
|
-
refsFor: (label, data) => pageSchemaSet(marksOptions, label, data, membersOf(label)),
|
|
173
|
-
merge: (label, extracted) => mergeWithMarks(label, extracted, index, membersOf(label), cwd, {
|
|
174
|
-
encryptionKey: joinKey,
|
|
175
|
-
marks
|
|
176
|
-
}),
|
|
177
|
-
home: (label, data, key) => keyHome(ctx, label, data, key)
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// src/meta/core/declared-at.ts
|
|
182
|
-
function declaredAt(label, pointer, metadata) {
|
|
183
|
-
const at = metadata.locate?.(pointer);
|
|
184
|
-
if (at !== void 0) {
|
|
185
|
-
return { file: at.file, ...at.line === void 0 ? {} : { line: at.line } };
|
|
186
|
-
}
|
|
187
|
-
if (!metadata.extracted.present) return { file: label };
|
|
188
|
-
const line = metadata.extracted.lineFor(pointer);
|
|
189
|
-
return { file: label, ...line === void 0 ? {} : { line } };
|
|
190
|
-
}
|
|
191
|
-
|
|
192
120
|
export {
|
|
193
121
|
reencryptMetadata,
|
|
194
|
-
reencryptData
|
|
195
|
-
metaPageView,
|
|
196
|
-
declaredAt
|
|
122
|
+
reencryptData
|
|
197
123
|
};
|
|
198
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-ZRQUQS7P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/meta/core/reencrypt.ts"],"sourcesContent":["/**\n * Re-encrypt a page's metadata under a new key: meta's half of `manni key\n * rotate` (proposal 0045).\n *\n * Values are found by their ciphertext, not through schema marks. Every\n * string at any depth of the metadata that has the ciphertext shape is a\n * candidate, and the authentication tag decides whether it is ours: no schema\n * is resolved, so a mark from a `-s` schema or an unreachable remote cannot\n * hide a value from rotation. `citations` is left alone; cite owns it, and\n * re-encrypts its own sources with their pins.\n *\n * Pure: no IO. The caller reads the page and writes `content` back.\n */\nimport { extname } from \"node:path\";\nimport { decryptValue, encryptValue, isEncryptedValue } from \"../../shared/encryption.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { escapePointerSegment } from \"../extractors/pointer.js\";\nimport { extractorByName, extractorForExtension, supportedExtensions } from \"../extractors/index.js\";\nimport { DocmetaError, type MetadataExtractor, type MetadataPatch } from \"../types.js\";\nimport { META_CONTEXT, withValueAt } from \"./encrypted.js\";\n\n/** One value re-encrypted: where, and the ciphertext before and after. */\nexport interface ReencryptedValue {\n pointer: string;\n from: string;\n to: string;\n}\n\nexport interface ReencryptMetadataResult {\n /** The page with every rewritten value; the input itself when nothing was. */\n content: string;\n rewritten: ReencryptedValue[];\n /** Values that could not be re-encrypted, and why. */\n skipped: { pointer: string; message: string }[];\n}\n\nexport interface ReencryptDataResult {\n /** The metadata with every rewritten value; the input itself when nothing was. */\n data: Record<string, unknown>;\n rewritten: ReencryptedValue[];\n /** Values that could not be re-encrypted, and why. */\n skipped: { pointer: string; message: string }[];\n /** The top-level keys whose value changed, in document order. */\n keys: string[];\n}\n\n/** The subtree cite owns. */\nconst CITATIONS_KEY = \"citations\";\n\nconst NOT_OURS = \"does not decrypt under the current key\";\nconst READ_ONLY = \"this format cannot be written\";\n\n/**\n * Re-encrypt every encrypted value in one page's metadata from `fromKey` to\n * `toKey`.\n *\n * - A value that decrypts under `fromKey` is rewritten under `toKey`.\n * - One that already decrypts under `toKey` is done: an interrupted rotation\n * can be run again. It is neither rewritten nor skipped.\n * - One that decrypts under neither is skipped.\n *\n * The format is `page.format` (an extractor name) when given, else the\n * file's extension. A nested value rewrites its top-level key; everything\n * else in the page is kept. A format that cannot be written lists every value\n * it would have rewritten as skipped, and returns the content unchanged.\n */\nexport function reencryptMetadata(\n page: { file: string; content: string; format?: string },\n opts: { fromKey: string; toKey: string },\n): ReencryptMetadataResult {\n const extractor =\n page.format !== undefined\n ? extractorByName(page.format)\n : extractorForExtension(extname(page.file));\n if (!extractor) {\n throw new DocmetaError(\n page.format !== undefined\n ? `Unknown format \"${page.format}\" for \"${page.file}\".`\n : `Unsupported file type \"${extname(page.file)}\" for \"${page.file}\". Supported: ${supportedExtensions().join(\", \")}.`,\n );\n }\n return reencryptWith(extractor, page, opts);\n}\n\ninterface Found {\n pointer: string;\n top: string;\n token: string;\n}\n\n/** Every ciphertext in `data`, in document order, outside `citations`. */\nfunction tokensIn(data: Record<string, unknown>): Found[] {\n const found: Found[] = [];\n const walk = (node: unknown, pointer: string, top: string): void => {\n if (isEncryptedValue(node)) {\n found.push({ pointer, top, token: node });\n return;\n }\n if (Array.isArray(node)) {\n (node as unknown[]).forEach((item, i) => {\n walk(item, `${pointer}/${String(i)}`, top);\n });\n return;\n }\n if (typeof node === \"object\" && node !== null && !(node instanceof Date)) {\n for (const [k, v] of Object.entries(node)) {\n walk(v, `${pointer}/${escapePointerSegment(k)}`, top);\n }\n }\n };\n for (const [key, value] of Object.entries(data)) {\n if (key === CITATIONS_KEY) continue;\n walk(value, `/${escapePointerSegment(key)}`, key);\n }\n return found;\n}\n\n/**\n * Re-encrypt every ciphertext in one metadata object, `citations` aside.\n *\n * The rule `reencryptMetadata` runs on a page, on the data alone: a value\n * that decrypts under `fromKey` is rewritten under `toKey`, one already under\n * `toKey` is done, and one under neither is skipped. `manni key rotate` calls\n * it a second time for the values an external-metadata manifest supplies,\n * which live in the manifest rather than in any page.\n *\n * `writable` says whether the caller can write what it plans. `false` lists\n * every value it would have rewritten as skipped instead, in document order\n * beside the ones that could not be read, and rewrites nothing.\n */\nexport function reencryptData(\n data: Record<string, unknown>,\n opts: { fromKey: string; toKey: string; writable?: boolean },\n): ReencryptDataResult {\n const writable = opts.writable ?? true;\n const rewritten: ReencryptedValue[] = [];\n const skipped: { pointer: string; message: string }[] = [];\n const found = tokensIn(data);\n for (const { pointer, token } of found) {\n const opened = decryptValue(token, opts.fromKey, META_CONTEXT);\n if (opened.ok) {\n if (!writable) {\n skipped.push({ pointer, message: READ_ONLY });\n continue;\n }\n rewritten.push({\n pointer,\n from: token,\n to: encryptValue(opened.value, opts.toKey, META_CONTEXT),\n });\n continue;\n }\n if (decryptValue(token, opts.toKey, META_CONTEXT).ok) continue;\n skipped.push({ pointer, message: NOT_OURS });\n }\n if (rewritten.length === 0) return { data, rewritten, skipped, keys: [] };\n\n let next: Record<string, unknown> = data;\n for (const r of rewritten) next = withValueAt(next, r.pointer, r.to);\n const done = new Set(rewritten.map((r) => r.pointer));\n const keys = [...new Set(found.filter((f) => done.has(f.pointer)).map((f) => f.top))];\n return { data: next, rewritten, skipped, keys };\n}\n\n/** `reencryptMetadata` with the extractor chosen. Exported for tests. */\nexport function reencryptWith(\n extractor: MetadataExtractor,\n page: { file: string; content: string },\n opts: { fromKey: string; toKey: string },\n): ReencryptMetadataResult {\n const read = (content: string): Record<string, unknown> => {\n try {\n return extractor.extract(content, page.file).data;\n } catch (err) {\n if (err instanceof DocmetaError) throw err;\n throw new DocmetaError(`${page.file}: ${errorMessage(err)}`);\n }\n };\n const data = read(page.content);\n const apply = extractor.apply;\n const plan = reencryptData(data, { ...opts, writable: apply !== undefined });\n const { rewritten, skipped } = plan;\n if (rewritten.length === 0 || apply === undefined) {\n return { content: page.content, rewritten: [], skipped };\n }\n\n // One patch entry per top-level key: the whole value, with its tokens\n // replaced, because a writer sets top-level keys and nothing deeper.\n const patch: MetadataPatch = {};\n for (const top of plan.keys) patch[top] = plan.data[top];\n const content = apply(page.content, patch, { filePath: page.file });\n\n // A writer that cannot keep a value is worse than a refused rotation: the\n // old ciphertext would be gone and the new one nowhere.\n const reread = tokensIn(read(content));\n for (const r of rewritten) {\n if (!reread.some((f) => f.pointer === r.pointer && f.token === r.to)) {\n throw new DocmetaError(\n `${page.file}: the ${extractor.name} writer did not keep ${r.pointer}; nothing was re-encrypted.`,\n );\n }\n }\n return { content, rewritten, skipped };\n}\n"],"mappings":"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","names":["content"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
renderCheck,
|
|
4
4
|
runCheck
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4U3X7LYV.js";
|
|
6
6
|
import {
|
|
7
7
|
EXPORT_TARGETS,
|
|
8
8
|
renderEmbed,
|
|
@@ -16,50 +16,60 @@ import {
|
|
|
16
16
|
runQuery,
|
|
17
17
|
runStats,
|
|
18
18
|
runTraverse
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
runBuild
|
|
22
|
-
} from "./chunk-N6A6DJUO.js";
|
|
19
|
+
} from "./chunk-7KOWE4F4.js";
|
|
23
20
|
import {
|
|
24
21
|
SEARCH_MODES,
|
|
22
|
+
bundledShapesPath,
|
|
23
|
+
compactIri,
|
|
24
|
+
loadShapes,
|
|
25
|
+
localName,
|
|
25
26
|
renderSearch,
|
|
26
|
-
runSearch
|
|
27
|
-
|
|
27
|
+
runSearch,
|
|
28
|
+
shapeText
|
|
29
|
+
} from "./chunk-STM3G7WJ.js";
|
|
30
|
+
import {
|
|
31
|
+
runBuild
|
|
32
|
+
} from "./chunk-VBBJGFME.js";
|
|
28
33
|
import {
|
|
29
34
|
ALL_FILL_FIELDS,
|
|
30
35
|
CONFIG_SECTION,
|
|
31
36
|
DEFAULT_CONFIG_FILENAME,
|
|
32
37
|
DEFAULT_EXTENSIONS,
|
|
33
38
|
GraphError,
|
|
39
|
+
NS,
|
|
34
40
|
STDIN,
|
|
35
|
-
assertInputFormat
|
|
36
|
-
|
|
41
|
+
assertInputFormat,
|
|
42
|
+
byCodeUnit,
|
|
43
|
+
loadRunConfig
|
|
44
|
+
} from "./chunk-7PENJOI6.js";
|
|
45
|
+
import "./chunk-GLP5PSXB.js";
|
|
37
46
|
import "./chunk-TIUTIOFB.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-3MTZZJKH.js";
|
|
48
|
+
import "./chunk-TKINOTVS.js";
|
|
40
49
|
import "./chunk-YUTVAMWW.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-7AXJY4FX.js";
|
|
51
|
+
import "./chunk-ZRQUQS7P.js";
|
|
52
|
+
import "./chunk-66MKBRTA.js";
|
|
53
|
+
import "./chunk-CZJNYHK7.js";
|
|
54
|
+
import "./chunk-3BMTCS4H.js";
|
|
55
|
+
import "./chunk-D2TIZOMN.js";
|
|
46
56
|
import {
|
|
47
57
|
collect,
|
|
48
58
|
configOption,
|
|
49
59
|
readStdin,
|
|
50
60
|
splitList,
|
|
51
61
|
writeTextAtomic
|
|
52
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-36FJWJSK.js";
|
|
53
63
|
import "./chunk-DSWKBZWW.js";
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
64
|
+
import "./chunk-BIRGZEWO.js";
|
|
65
|
+
import "./chunk-QK6VYJHV.js";
|
|
56
66
|
import {
|
|
57
67
|
shouldColor
|
|
58
68
|
} from "./chunk-RNVYGWIC.js";
|
|
59
69
|
import {
|
|
60
70
|
fail
|
|
61
71
|
} from "./chunk-YEUYKR62.js";
|
|
62
|
-
import "./chunk-
|
|
72
|
+
import "./chunk-B2242FYO.js";
|
|
63
73
|
import {
|
|
64
74
|
warn
|
|
65
75
|
} from "./chunk-HX44GB4Z.js";
|
|
@@ -68,7 +78,7 @@ import {
|
|
|
68
78
|
} from "./chunk-VM7VAFJW.js";
|
|
69
79
|
import {
|
|
70
80
|
package_default
|
|
71
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-T3BBNLAT.js";
|
|
72
82
|
import "./chunk-OWBRDNRZ.js";
|
|
73
83
|
import {
|
|
74
84
|
errorMessage
|
|
@@ -81,12 +91,237 @@ import { Command } from "commander";
|
|
|
81
91
|
// src/graph/reporters/index.ts
|
|
82
92
|
var GRAPH_FORMATS = ["pretty", "json"];
|
|
83
93
|
var GRAPH_FORMAT_LIST = GRAPH_FORMATS.join(" | ");
|
|
84
|
-
var CHECK_FORMATS = [...GRAPH_FORMATS, "github"];
|
|
94
|
+
var CHECK_FORMATS = [...GRAPH_FORMATS, "github", "sarif"];
|
|
95
|
+
var SHAPES_SHOW_FORMATS = [...GRAPH_FORMATS, "markdown"];
|
|
96
|
+
var SHAPES_SHOW_FORMAT_LIST = SHAPES_SHOW_FORMATS.join(" | ");
|
|
85
97
|
var CHECK_FORMAT_LIST = CHECK_FORMATS.join(" | ");
|
|
86
98
|
|
|
99
|
+
// src/graph/commands/shapes.ts
|
|
100
|
+
import { resolve } from "node:path";
|
|
101
|
+
import { DataFactory } from "n3";
|
|
102
|
+
var SH = "http://www.w3.org/ns/shacl#";
|
|
103
|
+
function resolveShapes(opts) {
|
|
104
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
105
|
+
const config = loadRunConfig(
|
|
106
|
+
{
|
|
107
|
+
...opts.config === void 0 ? {} : { configPath: opts.config },
|
|
108
|
+
...opts.noConfig === void 0 ? {} : { noConfig: opts.noConfig }
|
|
109
|
+
},
|
|
110
|
+
cwd
|
|
111
|
+
);
|
|
112
|
+
const given = opts.shapes && opts.shapes.length > 0 ? opts.shapes : config.check.shapes;
|
|
113
|
+
const sources = given.length > 0 ? given.map((p) => ({ path: resolve(cwd, p), label: p })) : [bundledShapesPath(import.meta.url)];
|
|
114
|
+
const loaded = loadShapes(sources);
|
|
115
|
+
const sourceOf = new Map(
|
|
116
|
+
loaded.files.map((file) => [file, given.length > 0 ? file.label : "bundled"])
|
|
117
|
+
);
|
|
118
|
+
return { loaded, sourceOf };
|
|
119
|
+
}
|
|
120
|
+
function fileIndex(resolved, iri) {
|
|
121
|
+
const file = resolved.loaded.fileOf.get(iri);
|
|
122
|
+
return file === void 0 ? 0 : resolved.loaded.files.indexOf(file);
|
|
123
|
+
}
|
|
124
|
+
var named = (iri) => DataFactory.namedNode(iri);
|
|
125
|
+
function firstObject(store, subject, predicate) {
|
|
126
|
+
return store.getObjects(named(subject), named(predicate), null).map((o) => o.value).sort(byCodeUnit)[0];
|
|
127
|
+
}
|
|
128
|
+
function nodeShapeRow(resolved, iri) {
|
|
129
|
+
const { loaded, sourceOf } = resolved;
|
|
130
|
+
const file = loaded.fileOf.get(iri);
|
|
131
|
+
const store = loaded.store;
|
|
132
|
+
const targetClass = firstObject(store, iri, `${SH}targetClass`);
|
|
133
|
+
const objectsOf = firstObject(store, iri, `${SH}targetObjectsOf`);
|
|
134
|
+
return {
|
|
135
|
+
name: localName(iri),
|
|
136
|
+
id: file?.id ?? "",
|
|
137
|
+
source: file === void 0 ? "" : sourceOf.get(file) ?? file.label,
|
|
138
|
+
target: targetClass ?? (objectsOf === void 0 ? null : `objects of ${objectsOf}`),
|
|
139
|
+
closed: firstObject(store, iri, `${SH}closed`) === "true",
|
|
140
|
+
description: shapeText(store, named(iri), `${SH}description`),
|
|
141
|
+
guide: file?.guide ?? null
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function nodeShapes(store) {
|
|
145
|
+
return store.getSubjects(named(`${NS.rdf}type`), named(`${SH}NodeShape`), null).filter((s) => s.termType === "NamedNode").map((s) => s.value).sort((a, b) => byCodeUnit(localName(a), localName(b)) || byCodeUnit(a, b));
|
|
146
|
+
}
|
|
147
|
+
var SEVERITIES = {
|
|
148
|
+
[`${SH}Violation`]: "error",
|
|
149
|
+
[`${SH}Warning`]: "warning",
|
|
150
|
+
[`${SH}Info`]: "notice"
|
|
151
|
+
};
|
|
152
|
+
function propertyRows(store, shape) {
|
|
153
|
+
const rows = [];
|
|
154
|
+
for (const property of store.getObjects(named(shape), named(`${SH}property`), null)) {
|
|
155
|
+
const term = property.termType === "BlankNode" ? DataFactory.blankNode(property.value) : named(property.value);
|
|
156
|
+
const read = (predicate) => store.getObjects(term, named(predicate), null).map((o) => o.value).sort(byCodeUnit)[0];
|
|
157
|
+
const path = read(`${SH}path`);
|
|
158
|
+
if (path === void 0) continue;
|
|
159
|
+
const min = read(`${SH}minCount`);
|
|
160
|
+
const max = read(`${SH}maxCount`);
|
|
161
|
+
rows.push({
|
|
162
|
+
rule: property.termType === "NamedNode" ? localName(property.value) : null,
|
|
163
|
+
path,
|
|
164
|
+
key: shapeText(store, term, `${SH}name`),
|
|
165
|
+
min: min === void 0 ? 0 : Number(min),
|
|
166
|
+
max: max === void 0 ? null : Number(max),
|
|
167
|
+
severity: SEVERITIES[read(`${SH}severity`) ?? ""] ?? "error",
|
|
168
|
+
description: shapeText(store, term, `${SH}description`)
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return rows.sort(
|
|
172
|
+
(a, b) => byCodeUnit(a.rule ?? "", b.rule ?? "") || byCodeUnit(a.path, b.path)
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
function runShapes(opts = {}) {
|
|
176
|
+
const resolved = resolveShapes(opts);
|
|
177
|
+
const shapes = nodeShapes(resolved.loaded.store).sort(
|
|
178
|
+
(a, b) => fileIndex(resolved, a) - fileIndex(resolved, b)
|
|
179
|
+
);
|
|
180
|
+
return { shapes: shapes.map((iri) => nodeShapeRow(resolved, iri)) };
|
|
181
|
+
}
|
|
182
|
+
function runShapesShow(name, opts = {}) {
|
|
183
|
+
const resolved = resolveShapes(opts);
|
|
184
|
+
const all = nodeShapes(resolved.loaded.store);
|
|
185
|
+
const matching = all.filter((iri) => localName(iri) === name);
|
|
186
|
+
if (matching.length === 0) {
|
|
187
|
+
if (all.length === 0) {
|
|
188
|
+
throw new GraphError(`Unknown shape "${name}". The shapes in effect define no node shapes.`);
|
|
189
|
+
}
|
|
190
|
+
const available = [...new Set(all.map(localName))].join(", ");
|
|
191
|
+
throw new GraphError(`Unknown shape "${name}". Available: ${available}.`);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
shapes: matching.map((iri) => ({
|
|
195
|
+
...nodeShapeRow(resolved, iri),
|
|
196
|
+
properties: propertyRows(resolved.loaded.store, iri)
|
|
197
|
+
}))
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function occurrence(min, max) {
|
|
201
|
+
if (max === 0) return "forbidden";
|
|
202
|
+
if (max === null) {
|
|
203
|
+
if (min === 0) return "optional, repeats";
|
|
204
|
+
if (min === 1) return "required, repeats";
|
|
205
|
+
return `at least ${String(min)}`;
|
|
206
|
+
}
|
|
207
|
+
if (min === 1 && max === 1) return "required";
|
|
208
|
+
if (min === 0 && max === 1) return "optional";
|
|
209
|
+
return `${String(min)} to ${String(max)}`;
|
|
210
|
+
}
|
|
211
|
+
function columns(rows) {
|
|
212
|
+
const widths = [];
|
|
213
|
+
for (const row of rows) {
|
|
214
|
+
row.forEach((cell, i) => widths[i] = Math.max(widths[i] ?? 0, cell.length));
|
|
215
|
+
}
|
|
216
|
+
return rows.map(
|
|
217
|
+
(row) => row.map((cell, i) => i === row.length - 1 ? cell : cell.padEnd(widths[i] ?? 0)).join(" ").trimEnd()
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
var compactTarget = (target) => target === null ? "(no target)" : target.startsWith("objects of ") ? `objects of ${compactIri(target.slice("objects of ".length))}` : compactIri(target);
|
|
221
|
+
function renderShapes(list, format) {
|
|
222
|
+
if (format === "json") return JSON.stringify(list, null, 2);
|
|
223
|
+
const groups = [];
|
|
224
|
+
for (const shape of list.shapes) {
|
|
225
|
+
const last = groups.at(-1);
|
|
226
|
+
const head = last?.[0];
|
|
227
|
+
if (last !== void 0 && head?.id === shape.id && head.source === shape.source) {
|
|
228
|
+
last.push(shape);
|
|
229
|
+
} else {
|
|
230
|
+
groups.push([shape]);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const blocks = [];
|
|
234
|
+
for (const rows of groups) {
|
|
235
|
+
const first = rows[0];
|
|
236
|
+
if (first === void 0) continue;
|
|
237
|
+
const lines = [first.source === first.id ? first.id : `${first.id} (${first.source})`];
|
|
238
|
+
if (first.guide !== null) lines.push(` Guide: ${first.guide}`);
|
|
239
|
+
lines.push(
|
|
240
|
+
...columns(
|
|
241
|
+
rows.map((s) => [s.name, compactTarget(s.target), s.description ?? ""])
|
|
242
|
+
).map((l) => ` ${l}`)
|
|
243
|
+
);
|
|
244
|
+
blocks.push(lines.join("\n"));
|
|
245
|
+
}
|
|
246
|
+
return blocks.join("\n\n");
|
|
247
|
+
}
|
|
248
|
+
function renderShapesShow(show, format) {
|
|
249
|
+
if (format === "json") return JSON.stringify(show, null, 2);
|
|
250
|
+
if (format === "markdown") return skeleton(show);
|
|
251
|
+
return show.shapes.map((shape) => {
|
|
252
|
+
const head = [compactTarget(shape.target), ...shape.closed ? ["closed"] : []].join(", ");
|
|
253
|
+
const lines = [`${shape.name} ${shape.id} ${head}`];
|
|
254
|
+
if (shape.description !== null) lines.push(` ${shape.description}`);
|
|
255
|
+
if (shape.guide !== null) lines.push(` Guide: ${shape.guide}`);
|
|
256
|
+
lines.push("");
|
|
257
|
+
const rows = columns(
|
|
258
|
+
shape.properties.map((p) => {
|
|
259
|
+
const words = [
|
|
260
|
+
occurrence(p.min, p.max),
|
|
261
|
+
...p.severity === "error" ? [] : [p.severity]
|
|
262
|
+
].join(", ");
|
|
263
|
+
return [p.rule ?? "(unnamed)", compactIri(p.path), p.key === null ? words : `${p.key} \xB7 ${words}`];
|
|
264
|
+
})
|
|
265
|
+
);
|
|
266
|
+
shape.properties.forEach((p, i) => {
|
|
267
|
+
lines.push(` ${rows[i] ?? ""}`);
|
|
268
|
+
if (p.description !== null) lines.push(` ${p.description}`);
|
|
269
|
+
});
|
|
270
|
+
return lines.join("\n");
|
|
271
|
+
}).join("\n\n");
|
|
272
|
+
}
|
|
273
|
+
function skeleton(show) {
|
|
274
|
+
const root = /* @__PURE__ */ new Map();
|
|
275
|
+
for (const shape of show.shapes) {
|
|
276
|
+
for (const p of shape.properties) {
|
|
277
|
+
if (p.key === null) continue;
|
|
278
|
+
let level = root;
|
|
279
|
+
let node;
|
|
280
|
+
for (const part of p.key.split(".")) {
|
|
281
|
+
node = level.get(part);
|
|
282
|
+
if (node === void 0) {
|
|
283
|
+
node = { comment: null, required: false, repeats: false, children: /* @__PURE__ */ new Map() };
|
|
284
|
+
level.set(part, node);
|
|
285
|
+
}
|
|
286
|
+
level = node.children;
|
|
287
|
+
}
|
|
288
|
+
if (node === void 0) continue;
|
|
289
|
+
node.comment ??= p.description;
|
|
290
|
+
node.required ||= p.min > 0;
|
|
291
|
+
node.repeats ||= p.max !== 1;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const first = show.shapes[0];
|
|
295
|
+
if (first === void 0 || root.size === 0) {
|
|
296
|
+
throw new GraphError(
|
|
297
|
+
`${first?.name ?? "This shape"} has no frontmatter keys. manni writes every value it checks.`
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
const required = (node) => node.children.size === 0 ? node.required : [...node.children.values()].some(required);
|
|
301
|
+
const lines = ["---", `# ${first.name}, ${first.id}`];
|
|
302
|
+
for (const g of [...new Set(show.shapes.map((s) => s.guide))]) {
|
|
303
|
+
if (g !== null) lines.push(`# Guide: ${g}`);
|
|
304
|
+
}
|
|
305
|
+
const write = (level, indent) => {
|
|
306
|
+
for (const [key, node] of [...level].sort(([a], [b]) => byCodeUnit(a, b))) {
|
|
307
|
+
const mark = required(node) ? "" : "# ";
|
|
308
|
+
if (node.children.size > 0) {
|
|
309
|
+
lines.push(`${indent}${mark}${key}:`);
|
|
310
|
+
write(node.children, `${indent} `);
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
if (node.comment !== null) lines.push(`${indent}# ${node.comment}`);
|
|
314
|
+
lines.push(`${indent}${mark}${key}:${node.repeats ? " []" : ""}`);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
write(root, "");
|
|
318
|
+
lines.push("---");
|
|
319
|
+
return lines.join("\n");
|
|
320
|
+
}
|
|
321
|
+
|
|
87
322
|
// src/graph/commands/init.ts
|
|
88
323
|
import { existsSync, readFileSync } from "node:fs";
|
|
89
|
-
import { resolve } from "node:path";
|
|
324
|
+
import { resolve as resolve2 } from "node:path";
|
|
90
325
|
import { parse as parseYaml } from "yaml";
|
|
91
326
|
var HEADER = `# manni.config.yaml \u2014 shared configuration for the manni family of tools.
|
|
92
327
|
# Each tool reads its own top-level key; manni graph reads "graph:".
|
|
@@ -139,7 +374,7 @@ provenance:
|
|
|
139
374
|
# stewardship people fields (owner, stakeholders, reviewed-by) out.
|
|
140
375
|
|
|
141
376
|
# SHACL shapes \`manni graph check\` validates the built graph against. Default:
|
|
142
|
-
# the shapes contract bundled with manni (shapes/graph/shapes-1.1.
|
|
377
|
+
# the shapes contract bundled with manni (shapes/graph/shapes-1.1.1.ttl).
|
|
143
378
|
# check:
|
|
144
379
|
# shapes: ["./my-shapes.ttl"]
|
|
145
380
|
|
|
@@ -207,7 +442,7 @@ function starterSection() {
|
|
|
207
442
|
${body}`;
|
|
208
443
|
}
|
|
209
444
|
async function runInit(cwd = process.cwd()) {
|
|
210
|
-
const path =
|
|
445
|
+
const path = resolve2(cwd, DEFAULT_CONFIG_FILENAME);
|
|
211
446
|
if (!existsSync(path)) {
|
|
212
447
|
await writeTextAtomic(path, `${HEADER}${starterSection()}`);
|
|
213
448
|
return path;
|
|
@@ -295,6 +530,7 @@ function buildProgram() {
|
|
|
295
530
|
}
|
|
296
531
|
const formatOption = choiceOption("--format", GRAPH_FORMATS);
|
|
297
532
|
const checkFormatOption = choiceOption("--format", CHECK_FORMATS);
|
|
533
|
+
const showFormatOption = choiceOption("--format", SHAPES_SHOW_FORMATS);
|
|
298
534
|
const fieldsOption = (raw) => splitList(raw).map((value) => enumOption("--fields", ALL_FILL_FIELDS)(value));
|
|
299
535
|
function documentInputs(command, verb) {
|
|
300
536
|
return command.argument(
|
|
@@ -382,16 +618,69 @@ function buildProgram() {
|
|
|
382
618
|
checkFormatOption,
|
|
383
619
|
"pretty"
|
|
384
620
|
).action(
|
|
385
|
-
async (opts) => {
|
|
621
|
+
async (opts, command) => {
|
|
386
622
|
try {
|
|
387
623
|
const report = await runCheck({ ...rest(opts), ...documentOptions(opts) });
|
|
388
|
-
console.log(
|
|
624
|
+
console.log(
|
|
625
|
+
renderCheck(report, opts.format, {
|
|
626
|
+
color: colorFor(command, process.stdout.isTTY)
|
|
627
|
+
})
|
|
628
|
+
);
|
|
389
629
|
process.exitCode = report.exitCode;
|
|
390
630
|
} catch (e) {
|
|
391
631
|
fail(e);
|
|
392
632
|
}
|
|
393
633
|
}
|
|
394
634
|
);
|
|
635
|
+
function optionValue(command, key) {
|
|
636
|
+
for (let cmd = command; cmd !== null; cmd = cmd.parent) {
|
|
637
|
+
if (cmd.getOptionValueSource(key) === "cli") return cmd.getOptionValue(key);
|
|
638
|
+
}
|
|
639
|
+
return command.getOptionValue(key);
|
|
640
|
+
}
|
|
641
|
+
function shapesOptions(command) {
|
|
642
|
+
const { configPath, noConfig } = configOption(optionValue(command, "config"));
|
|
643
|
+
const shapes = optionValue(command, "shapes");
|
|
644
|
+
return {
|
|
645
|
+
...configPath === void 0 ? {} : { config: configPath },
|
|
646
|
+
...noConfig === true ? { noConfig } : {},
|
|
647
|
+
...Array.isArray(shapes) ? { shapes: shapes.map(String) } : {}
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
function shapesInput(command) {
|
|
651
|
+
return command.option(
|
|
652
|
+
"--shapes <path>",
|
|
653
|
+
"Shapes .ttl file; repeatable (default: config check.shapes, then bundled)",
|
|
654
|
+
collect,
|
|
655
|
+
[]
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
const shapesCommand = shapesInput(
|
|
659
|
+
configInputs(
|
|
660
|
+
program.command("shapes").description("List the SHACL node shapes `graph check` runs, and what each one targets")
|
|
661
|
+
)
|
|
662
|
+
).option("-f, --format <format>", `Output: ${GRAPH_FORMAT_LIST}`, "pretty").action((_opts, command) => {
|
|
663
|
+
try {
|
|
664
|
+
const format = formatOption(String(optionValue(command, "format")));
|
|
665
|
+
console.log(renderShapes(runShapes(shapesOptions(command)), format));
|
|
666
|
+
} catch (e) {
|
|
667
|
+
fail(e);
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
shapesInput(
|
|
671
|
+
configInputs(
|
|
672
|
+
shapesCommand.command("show").description(
|
|
673
|
+
"Print every property a shape checks and the frontmatter key that feeds it"
|
|
674
|
+
).argument("<shape>", "Node shape to show, by local name, such as DocumentShape")
|
|
675
|
+
)
|
|
676
|
+
).option("-f, --format <format>", `Output: ${SHAPES_SHOW_FORMAT_LIST}`, "pretty").action((shape, _opts, command) => {
|
|
677
|
+
try {
|
|
678
|
+
const format = showFormatOption(String(optionValue(command, "format")));
|
|
679
|
+
console.log(renderShapesShow(runShapesShow(shape, shapesOptions(command)), format));
|
|
680
|
+
} catch (e) {
|
|
681
|
+
fail(e);
|
|
682
|
+
}
|
|
683
|
+
});
|
|
395
684
|
documentInputs(
|
|
396
685
|
program.command("fill").description(
|
|
397
686
|
"Propose `graph:` fields and sample questions with an LLM, gated by confidence, and write them back"
|
|
@@ -651,4 +940,4 @@ export {
|
|
|
651
940
|
buildProgram,
|
|
652
941
|
colorFor
|
|
653
942
|
};
|
|
654
|
-
//# sourceMappingURL=cli-
|
|
943
|
+
//# sourceMappingURL=cli-5XKHMRZ5.js.map
|