@hawkeyexl/manni 4.18.1 → 4.20.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-XVUPHNWT.js → batch-TBQBH6XQ.js} +13 -13
- package/dist/{build-GU7M5EC6.js → build-S3JQMDFX.js} +14 -14
- package/dist/{calibrate-YODCJAEA.js → calibrate-KLN22IGS.js} +14 -14
- package/dist/{capture-TZ42LHNK.js → capture-JS3ICXE7.js} +13 -13
- package/dist/{check-KBDIV35E.js → check-2EAR4ZW3.js} +31 -31
- package/dist/check-6D2JCIMD.js +47 -0
- package/dist/{check-I72HPJNA.js → check-PDXYA6XH.js} +13 -12
- package/dist/check-RNAB7X74.js +33 -0
- package/dist/{check-AOGJBQR4.js → check-WS2USSUD.js} +13 -13
- package/dist/{chunk-HUCZKEDF.js → chunk-2G4XYGTN.js} +4 -4
- package/dist/{chunk-O7OJWMP5.js → chunk-2XRSQXGZ.js} +2 -2
- package/dist/{chunk-W5STNXKP.js → chunk-3OXBZSDN.js} +2 -2
- package/dist/chunk-4KM23E53.js +50 -0
- package/dist/chunk-4KM23E53.js.map +1 -0
- package/dist/chunk-5HB4YKZW.js +64 -0
- package/dist/chunk-5HB4YKZW.js.map +1 -0
- package/dist/{chunk-N4KY3WLM.js → chunk-5MJE5KMY.js} +7 -7
- package/dist/{chunk-C4MNHJXP.js → chunk-5UJQLZXY.js} +2 -2
- package/dist/{chunk-34PGSNS5.js → chunk-6D7FCU4E.js} +3 -3
- package/dist/{chunk-ES7PJMHM.js → chunk-6VGWLCYT.js} +2 -2
- package/dist/chunk-BEQZI3V5.js +137 -0
- package/dist/chunk-BEQZI3V5.js.map +1 -0
- package/dist/{chunk-7MU47MZM.js → chunk-BV7FJ4V2.js} +7 -7
- package/dist/{chunk-2G42VA4H.js → chunk-DQO44Y5G.js} +5 -5
- package/dist/{chunk-7JDWLMOT.js → chunk-DTSWP5FC.js} +5 -5
- package/dist/{chunk-MHLCZBW2.js → chunk-EBYLQE7P.js} +2 -2
- package/dist/{chunk-LFKYNDG4.js → chunk-FERFWKZM.js} +2 -2
- package/dist/{chunk-PZAHBJ56.js → chunk-FRM62BEN.js} +3 -3
- package/dist/{chunk-RBNZI6YG.js → chunk-GCF7STEA.js} +7 -32
- package/dist/chunk-GCF7STEA.js.map +1 -0
- package/dist/{chunk-YMDASDGR.js → chunk-GL2HXZVX.js} +3 -3
- package/dist/chunk-GVOI7SCF.js +50 -0
- package/dist/chunk-GVOI7SCF.js.map +1 -0
- package/dist/{chunk-O3PRYQCW.js → chunk-GXDVERLV.js} +5 -5
- package/dist/{chunk-UXEICZKX.js → chunk-HIZNNOVW.js} +17 -5
- package/dist/chunk-HIZNNOVW.js.map +1 -0
- package/dist/{chunk-4VR2UFEO.js → chunk-HSC5G3FW.js} +8 -8
- package/dist/{chunk-72OTCIYQ.js → chunk-HZWLHSZG.js} +2 -2
- package/dist/{chunk-SJLEHQKY.js → chunk-I62V2ZAJ.js} +8 -8
- package/dist/{chunk-EEJFXYFO.js → chunk-IGAZWY2W.js} +2 -2
- package/dist/{chunk-GSLXJSGT.js → chunk-ITA7V5Y2.js} +4 -4
- package/dist/{chunk-AL46P5H6.js → chunk-IYRGV2BC.js} +6 -6
- package/dist/{chunk-HH327OEQ.js → chunk-JKH2LV5D.js} +5 -5
- package/dist/{chunk-2EAUZVO2.js → chunk-JOZVVIVD.js} +3 -3
- package/dist/{chunk-GRRSOAAS.js → chunk-KZ7534CD.js} +3 -3
- package/dist/{chunk-UVUMFFZ6.js → chunk-MLY65CQE.js} +24 -12
- package/dist/chunk-MLY65CQE.js.map +1 -0
- package/dist/{chunk-T363DMEJ.js → chunk-MNK732BZ.js} +37 -14
- package/dist/chunk-MNK732BZ.js.map +1 -0
- package/dist/{chunk-N74QH6XJ.js → chunk-NDQA4VYK.js} +3 -3
- package/dist/chunk-NEO2HN2N.js +326 -0
- package/dist/chunk-NEO2HN2N.js.map +1 -0
- package/dist/{chunk-MQG4ONTU.js → chunk-O26NQ7KT.js} +2 -2
- package/dist/chunk-O4O6JOGD.js +59 -0
- package/dist/chunk-O4O6JOGD.js.map +1 -0
- package/dist/{chunk-QRQVOEAH.js → chunk-PGDUVYTF.js} +2 -2
- package/dist/{chunk-CYMA4O2F.js → chunk-PHOWMWFJ.js} +6 -2
- package/dist/{chunk-CYMA4O2F.js.map → chunk-PHOWMWFJ.js.map} +1 -1
- package/dist/{chunk-WIHQJSO3.js → chunk-PTXHJLAS.js} +4 -4
- package/dist/{chunk-J33NBVBX.js → chunk-Q5EKERQS.js} +2 -2
- package/dist/{chunk-GWCITMHN.js → chunk-QA7AXRGH.js} +2 -2
- package/dist/{chunk-J7MZRF3J.js → chunk-QSY5YPM4.js} +5 -5
- package/dist/{chunk-S5JFWUNK.js → chunk-QWCP7UMG.js} +4 -4
- package/dist/chunk-RGZBROMW.js +25 -0
- package/dist/chunk-RGZBROMW.js.map +1 -0
- package/dist/{chunk-WMOQXWHB.js → chunk-RXCDT55X.js} +14 -14
- package/dist/{chunk-JBB22HPK.js → chunk-SFSALDIR.js} +6 -6
- package/dist/{chunk-ZI5JHYPT.js → chunk-SFTWEGUD.js} +2 -2
- package/dist/{chunk-SGV5U4NE.js → chunk-SGI3WPYK.js} +4 -4
- package/dist/chunk-SIREOHLW.js +233 -0
- package/dist/chunk-SIREOHLW.js.map +1 -0
- package/dist/{chunk-PRF44AAC.js → chunk-SOW6SVAM.js} +4 -4
- package/dist/{chunk-3H7M5MXE.js → chunk-SRTBHEUM.js} +3 -3
- package/dist/{chunk-YBWU4JGX.js → chunk-SX626JUF.js} +3 -3
- package/dist/{chunk-UT6SVXUQ.js → chunk-U2CE55YV.js} +5 -5
- package/dist/{chunk-4VQVJOIK.js → chunk-UKSXQHSE.js} +44 -23
- package/dist/chunk-UKSXQHSE.js.map +1 -0
- package/dist/chunk-VCU7OMXV.js +126 -0
- package/dist/chunk-VCU7OMXV.js.map +1 -0
- package/dist/chunk-XTKJNRJ6.js +33 -0
- package/dist/chunk-XTKJNRJ6.js.map +1 -0
- package/dist/{chunk-UE6IYEKA.js → chunk-Z6FATXBE.js} +2 -2
- package/dist/{chunk-PJILKN4Z.js → chunk-ZBE735BH.js} +5 -5
- package/dist/{chunk-FGGDLZUU.js → chunk-ZEKQRBXO.js} +2 -2
- package/dist/{chunk-Z2LHEYK5.js → chunk-ZODSGFAP.js} +5 -7
- package/dist/{chunk-Z2LHEYK5.js.map → chunk-ZODSGFAP.js.map} +1 -1
- package/dist/{chunk-WRWPOXVG.js → chunk-ZRMA5U53.js} +3 -3
- package/dist/{chunk-4CMNCP5O.js → chunk-ZVEDBFTM.js} +8 -8
- package/dist/{cli-OD7SXNLX.js → cli-4HH6IY2L.js} +14 -14
- package/dist/{cli-4P4FWT6C.js → cli-4IE6CRAT.js} +355 -123
- package/dist/cli-4IE6CRAT.js.map +1 -0
- package/dist/{cli-NCJZTOWR.js → cli-5BFVL3DH.js} +2 -2
- package/dist/{cli-HGZ7XTDU.js → cli-AR43H5BW.js} +9 -9
- package/dist/{cli-WQNWAMDL.js → cli-EQG4KETY.js} +89 -38
- package/dist/cli-EQG4KETY.js.map +1 -0
- package/dist/{cli-2JZEYVTI.js → cli-GVHXRQAD.js} +18 -18
- package/dist/{cli-NUP7KAW3.js → cli-HTAR3PWY.js} +21 -21
- package/dist/{cli-4YURODFH.js → cli-L7H4C442.js} +14 -14
- package/dist/{cli-DK55ACQR.js → cli-T4NY2EGM.js} +17 -17
- package/dist/{cli-TDCMZ7HV.js → cli-UIY57JPM.js} +14 -14
- package/dist/{cli-MRH5QXW5.js → cli-ZPW5VIRA.js} +9 -9
- package/dist/cli.js +20 -14
- package/dist/cli.js.map +1 -1
- package/dist/docmeta.js +8 -8
- package/dist/{github-FX4WWY7N.js → github-CMWG4QMI.js} +14 -14
- package/dist/github-NIRLMJ65.js +27 -0
- package/dist/{github-TOQ4AJIU.js → github-RIU47U73.js} +12 -12
- package/dist/index.d.ts +25 -1
- package/dist/index.js +99 -99
- package/dist/json-EJTB7XYG.js +34 -0
- package/dist/{json-SIPVIBNW.js → json-KSBVGZUX.js} +12 -12
- package/dist/{labels-UXKTDM5A.js → labels-VNKACCAG.js} +11 -11
- package/dist/{lint-UUVMFRPB.js → lint-75BD6L5T.js} +12 -12
- package/dist/list-6XVIW3RW.js +33 -0
- package/dist/{list-FLNHGIML.js → list-MH54XU7E.js} +12 -12
- package/dist/{list-6Q7VGKIG.js → list-PHNZAYIM.js} +12 -12
- package/dist/{page-FPLKY53Q.js → page-5AJS7AEM.js} +11 -11
- package/dist/{prepare-VUHZQTJ4.js → prepare-R63RJI6O.js} +16 -16
- package/dist/{pretty-JDZSGZCR.js → pretty-DE4WXJFA.js} +13 -13
- package/dist/{pretty-WKPQD3UU.js → pretty-E3DS32NZ.js} +12 -12
- package/dist/pretty-SUKMF6AB.js +35 -0
- package/dist/{release-Z3ASYZ3S.js → release-VHHASAG7.js} +4 -4
- package/dist/{reporters-E53V7UXY.js → reporters-DLMLFLKS.js} +4 -4
- package/dist/{reporters-RAWZONQ3.js → reporters-V2PSDBVW.js} +11 -11
- package/dist/reporters-V2PSDBVW.js.map +1 -0
- package/dist/{run-2BDAM2LA.js → run-QT2LVHRU.js} +12 -12
- package/dist/run-QT2LVHRU.js.map +1 -0
- package/dist/{sarif-7F6EJA3K.js → sarif-2ZKPRT42.js} +15 -15
- package/dist/sarif-2ZKPRT42.js.map +1 -0
- package/dist/{sarif-Q3FX4ODM.js → sarif-GKMUHCZB.js} +10 -10
- package/dist/sarif-GKMUHCZB.js.map +1 -0
- package/dist/sarif-HUIRTPSL.js +30 -0
- package/dist/sarif-HUIRTPSL.js.map +1 -0
- package/dist/strategy-TBFM7NZU.js +222 -0
- package/dist/strategy-TBFM7NZU.js.map +1 -0
- package/dist/{term-5CCU7VDU.js → term-ZZWAVUW5.js} +30 -28
- package/dist/term-ZZWAVUW5.js.map +1 -0
- package/dist/{validate-A2R6KXAH.js → validate-ZEUFF3BG.js} +5 -5
- package/dist/validate-ZEUFF3BG.js.map +1 -0
- package/package.json +4 -6
- package/plugin/manni/.claude-plugin/plugin.json +2 -2
- package/plugin/manni/.mcp.json +12 -0
- package/plugin/manni/hooks/graph-server.mjs +95 -0
- package/plugin/manni/hooks/hooks.json +26 -0
- package/plugin/manni/hooks/manni.mjs +51 -25
- package/plugin/manni/hooks/page-metadata.mjs +144 -0
- package/plugin/manni/skills/fix/SKILL.md +18 -1
- package/plugin/manni/skills/setup/SKILL.md +1 -1
- package/dist/check-OIL3CZ4N.js +0 -47
- package/dist/chunk-4VQVJOIK.js.map +0 -1
- package/dist/chunk-RBNZI6YG.js.map +0 -1
- package/dist/chunk-T363DMEJ.js.map +0 -1
- package/dist/chunk-UVUMFFZ6.js.map +0 -1
- package/dist/chunk-UXEICZKX.js.map +0 -1
- package/dist/cli-4P4FWT6C.js.map +0 -1
- package/dist/cli-WQNWAMDL.js.map +0 -1
- package/dist/term-5CCU7VDU.js.map +0 -1
- /package/dist/{batch-XVUPHNWT.js.map → batch-TBQBH6XQ.js.map} +0 -0
- /package/dist/{build-GU7M5EC6.js.map → build-S3JQMDFX.js.map} +0 -0
- /package/dist/{calibrate-YODCJAEA.js.map → calibrate-KLN22IGS.js.map} +0 -0
- /package/dist/{capture-TZ42LHNK.js.map → capture-JS3ICXE7.js.map} +0 -0
- /package/dist/{check-KBDIV35E.js.map → check-2EAR4ZW3.js.map} +0 -0
- /package/dist/{check-AOGJBQR4.js.map → check-6D2JCIMD.js.map} +0 -0
- /package/dist/{check-I72HPJNA.js.map → check-PDXYA6XH.js.map} +0 -0
- /package/dist/{check-OIL3CZ4N.js.map → check-RNAB7X74.js.map} +0 -0
- /package/dist/{cli-HGZ7XTDU.js.map → check-WS2USSUD.js.map} +0 -0
- /package/dist/{chunk-HUCZKEDF.js.map → chunk-2G4XYGTN.js.map} +0 -0
- /package/dist/{chunk-O7OJWMP5.js.map → chunk-2XRSQXGZ.js.map} +0 -0
- /package/dist/{chunk-W5STNXKP.js.map → chunk-3OXBZSDN.js.map} +0 -0
- /package/dist/{chunk-N4KY3WLM.js.map → chunk-5MJE5KMY.js.map} +0 -0
- /package/dist/{chunk-C4MNHJXP.js.map → chunk-5UJQLZXY.js.map} +0 -0
- /package/dist/{chunk-34PGSNS5.js.map → chunk-6D7FCU4E.js.map} +0 -0
- /package/dist/{chunk-ES7PJMHM.js.map → chunk-6VGWLCYT.js.map} +0 -0
- /package/dist/{chunk-7MU47MZM.js.map → chunk-BV7FJ4V2.js.map} +0 -0
- /package/dist/{chunk-2G42VA4H.js.map → chunk-DQO44Y5G.js.map} +0 -0
- /package/dist/{chunk-7JDWLMOT.js.map → chunk-DTSWP5FC.js.map} +0 -0
- /package/dist/{chunk-MHLCZBW2.js.map → chunk-EBYLQE7P.js.map} +0 -0
- /package/dist/{chunk-LFKYNDG4.js.map → chunk-FERFWKZM.js.map} +0 -0
- /package/dist/{chunk-PZAHBJ56.js.map → chunk-FRM62BEN.js.map} +0 -0
- /package/dist/{chunk-YMDASDGR.js.map → chunk-GL2HXZVX.js.map} +0 -0
- /package/dist/{chunk-O3PRYQCW.js.map → chunk-GXDVERLV.js.map} +0 -0
- /package/dist/{chunk-4VR2UFEO.js.map → chunk-HSC5G3FW.js.map} +0 -0
- /package/dist/{chunk-72OTCIYQ.js.map → chunk-HZWLHSZG.js.map} +0 -0
- /package/dist/{chunk-SJLEHQKY.js.map → chunk-I62V2ZAJ.js.map} +0 -0
- /package/dist/{chunk-EEJFXYFO.js.map → chunk-IGAZWY2W.js.map} +0 -0
- /package/dist/{chunk-GSLXJSGT.js.map → chunk-ITA7V5Y2.js.map} +0 -0
- /package/dist/{chunk-AL46P5H6.js.map → chunk-IYRGV2BC.js.map} +0 -0
- /package/dist/{chunk-HH327OEQ.js.map → chunk-JKH2LV5D.js.map} +0 -0
- /package/dist/{chunk-2EAUZVO2.js.map → chunk-JOZVVIVD.js.map} +0 -0
- /package/dist/{chunk-GRRSOAAS.js.map → chunk-KZ7534CD.js.map} +0 -0
- /package/dist/{chunk-N74QH6XJ.js.map → chunk-NDQA4VYK.js.map} +0 -0
- /package/dist/{chunk-MQG4ONTU.js.map → chunk-O26NQ7KT.js.map} +0 -0
- /package/dist/{chunk-QRQVOEAH.js.map → chunk-PGDUVYTF.js.map} +0 -0
- /package/dist/{chunk-WIHQJSO3.js.map → chunk-PTXHJLAS.js.map} +0 -0
- /package/dist/{chunk-J33NBVBX.js.map → chunk-Q5EKERQS.js.map} +0 -0
- /package/dist/{chunk-GWCITMHN.js.map → chunk-QA7AXRGH.js.map} +0 -0
- /package/dist/{chunk-J7MZRF3J.js.map → chunk-QSY5YPM4.js.map} +0 -0
- /package/dist/{chunk-S5JFWUNK.js.map → chunk-QWCP7UMG.js.map} +0 -0
- /package/dist/{chunk-WMOQXWHB.js.map → chunk-RXCDT55X.js.map} +0 -0
- /package/dist/{chunk-JBB22HPK.js.map → chunk-SFSALDIR.js.map} +0 -0
- /package/dist/{chunk-ZI5JHYPT.js.map → chunk-SFTWEGUD.js.map} +0 -0
- /package/dist/{chunk-SGV5U4NE.js.map → chunk-SGI3WPYK.js.map} +0 -0
- /package/dist/{chunk-PRF44AAC.js.map → chunk-SOW6SVAM.js.map} +0 -0
- /package/dist/{chunk-3H7M5MXE.js.map → chunk-SRTBHEUM.js.map} +0 -0
- /package/dist/{chunk-YBWU4JGX.js.map → chunk-SX626JUF.js.map} +0 -0
- /package/dist/{chunk-UT6SVXUQ.js.map → chunk-U2CE55YV.js.map} +0 -0
- /package/dist/{chunk-UE6IYEKA.js.map → chunk-Z6FATXBE.js.map} +0 -0
- /package/dist/{chunk-PJILKN4Z.js.map → chunk-ZBE735BH.js.map} +0 -0
- /package/dist/{chunk-FGGDLZUU.js.map → chunk-ZEKQRBXO.js.map} +0 -0
- /package/dist/{chunk-WRWPOXVG.js.map → chunk-ZRMA5U53.js.map} +0 -0
- /package/dist/{chunk-4CMNCP5O.js.map → chunk-ZVEDBFTM.js.map} +0 -0
- /package/dist/{cli-OD7SXNLX.js.map → cli-4HH6IY2L.js.map} +0 -0
- /package/dist/{cli-NCJZTOWR.js.map → cli-5BFVL3DH.js.map} +0 -0
- /package/dist/{github-FX4WWY7N.js.map → cli-AR43H5BW.js.map} +0 -0
- /package/dist/{cli-2JZEYVTI.js.map → cli-GVHXRQAD.js.map} +0 -0
- /package/dist/{cli-NUP7KAW3.js.map → cli-HTAR3PWY.js.map} +0 -0
- /package/dist/{cli-4YURODFH.js.map → cli-L7H4C442.js.map} +0 -0
- /package/dist/{cli-DK55ACQR.js.map → cli-T4NY2EGM.js.map} +0 -0
- /package/dist/{cli-TDCMZ7HV.js.map → cli-UIY57JPM.js.map} +0 -0
- /package/dist/{cli-MRH5QXW5.js.map → cli-ZPW5VIRA.js.map} +0 -0
- /package/dist/{github-TOQ4AJIU.js.map → github-CMWG4QMI.js.map} +0 -0
- /package/dist/{json-SIPVIBNW.js.map → github-NIRLMJ65.js.map} +0 -0
- /package/dist/{lint-UUVMFRPB.js.map → github-RIU47U73.js.map} +0 -0
- /package/dist/{list-6Q7VGKIG.js.map → json-EJTB7XYG.js.map} +0 -0
- /package/dist/{list-FLNHGIML.js.map → json-KSBVGZUX.js.map} +0 -0
- /package/dist/{labels-UXKTDM5A.js.map → labels-VNKACCAG.js.map} +0 -0
- /package/dist/{page-FPLKY53Q.js.map → lint-75BD6L5T.js.map} +0 -0
- /package/dist/{pretty-JDZSGZCR.js.map → list-6XVIW3RW.js.map} +0 -0
- /package/dist/{pretty-WKPQD3UU.js.map → list-MH54XU7E.js.map} +0 -0
- /package/dist/{reporters-E53V7UXY.js.map → list-PHNZAYIM.js.map} +0 -0
- /package/dist/{reporters-RAWZONQ3.js.map → page-5AJS7AEM.js.map} +0 -0
- /package/dist/{prepare-VUHZQTJ4.js.map → prepare-R63RJI6O.js.map} +0 -0
- /package/dist/{run-2BDAM2LA.js.map → pretty-DE4WXJFA.js.map} +0 -0
- /package/dist/{sarif-7F6EJA3K.js.map → pretty-E3DS32NZ.js.map} +0 -0
- /package/dist/{sarif-Q3FX4ODM.js.map → pretty-SUKMF6AB.js.map} +0 -0
- /package/dist/{release-Z3ASYZ3S.js.map → release-VHHASAG7.js.map} +0 -0
- /package/dist/{validate-A2R6KXAH.js.map → reporters-DLMLFLKS.js.map} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
titleOf
|
|
4
|
+
} from "./chunk-BEQZI3V5.js";
|
|
5
|
+
import {
|
|
6
|
+
displayPath
|
|
7
|
+
} from "./chunk-NEO2HN2N.js";
|
|
8
|
+
|
|
9
|
+
// src/strategy/reporters/json.ts
|
|
10
|
+
function recordJson(entry) {
|
|
11
|
+
const { record } = entry;
|
|
12
|
+
const out = { id: record.id, type: record.type, title: titleOf(record) };
|
|
13
|
+
if (record.description !== void 0) out["description"] = record.description;
|
|
14
|
+
if (record.lifecycle !== void 0) out["lifecycle"] = record.lifecycle;
|
|
15
|
+
out["file"] = entry.file;
|
|
16
|
+
out["line"] = record.line;
|
|
17
|
+
const parents = record.parents.map((p) => p.value);
|
|
18
|
+
if (record.type === "journey") out["personas"] = parents;
|
|
19
|
+
if (record.type === "persona" && parents.length > 0) out["audience"] = parents.length === 1 ? parents[0] : parents;
|
|
20
|
+
const children = entry.children.map((r) => r.id);
|
|
21
|
+
out["namedBy"] = {
|
|
22
|
+
...record.type === "audience" ? { personas: children } : {},
|
|
23
|
+
...record.type === "persona" ? { journeys: children } : {},
|
|
24
|
+
pages: entry.pages
|
|
25
|
+
};
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
function renderListJson(entries) {
|
|
29
|
+
const once = new Map(entries.map((entry) => [entry.record, entry]));
|
|
30
|
+
return JSON.stringify({ records: [...once.values()].map(recordJson) }, null, 2);
|
|
31
|
+
}
|
|
32
|
+
function renderGetJson(entry) {
|
|
33
|
+
return JSON.stringify(recordJson(entry), null, 2);
|
|
34
|
+
}
|
|
35
|
+
function renderFindingsJson(report) {
|
|
36
|
+
const count = (severity) => report.findings.filter((f) => f.severity === severity).length;
|
|
37
|
+
return JSON.stringify(
|
|
38
|
+
{
|
|
39
|
+
// `key` is the baseline's identity for a finding, not something it says.
|
|
40
|
+
findings: report.findings.map(({ key: _identity, ...finding }) => ({
|
|
41
|
+
...finding,
|
|
42
|
+
file: displayPath(finding.file, report.cwd, report.base)
|
|
43
|
+
})),
|
|
44
|
+
summary: {
|
|
45
|
+
records: report.records,
|
|
46
|
+
references: report.references,
|
|
47
|
+
errors: count("error"),
|
|
48
|
+
warnings: count("warning"),
|
|
49
|
+
notices: count("notice"),
|
|
50
|
+
...report.baseline === void 0 ? {} : { baseline: report.baseline }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
null,
|
|
54
|
+
2
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
recordJson,
|
|
60
|
+
renderListJson,
|
|
61
|
+
renderGetJson,
|
|
62
|
+
renderFindingsJson
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=chunk-5HB4YKZW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/strategy/reporters/json.ts"],"sourcesContent":["/**\n * JSON output for every `manni strategy` command. A record is the same object\n * in `list` and `get`: its fields, where it was read, its parent, and what\n * names it. Paths are relative to the working directory.\n */\nimport type { StrategyReport } from \"../commands/findings.js\";\nimport type { RecordEntry } from \"../commands/list.js\";\nimport { displayPath } from \"../commands/run.js\";\nimport { titleOf } from \"./pretty.js\";\n\nexport function recordJson(entry: RecordEntry): Record<string, unknown> {\n const { record } = entry;\n // `title` is never absent: an untitled record shows its id, as `list` does.\n const out: Record<string, unknown> = { id: record.id, type: record.type, title: titleOf(record) };\n if (record.description !== undefined) out[\"description\"] = record.description;\n if (record.lifecycle !== undefined) out[\"lifecycle\"] = record.lifecycle;\n out[\"file\"] = entry.file;\n out[\"line\"] = record.line;\n // A journey's `personas` is always a list. A persona's `audience` is one value, as it is written.\n const parents = record.parents.map((p) => p.value);\n if (record.type === \"journey\") out[\"personas\"] = parents;\n if (record.type === \"persona\" && parents.length > 0) out[\"audience\"] = parents.length === 1 ? parents[0] : parents;\n const children = entry.children.map((r) => r.id);\n out[\"namedBy\"] = {\n ...(record.type === \"audience\" ? { personas: children } : {}),\n ...(record.type === \"persona\" ? { journeys: children } : {}),\n pages: entry.pages,\n };\n return out;\n}\n\n/** Each record once, where the tree first reaches it. */\nexport function renderListJson(entries: readonly RecordEntry[]): string {\n const once = new Map(entries.map((entry) => [entry.record, entry]));\n return JSON.stringify({ records: [...once.values()].map(recordJson) }, null, 2);\n}\n\nexport function renderGetJson(entry: RecordEntry): string {\n return JSON.stringify(recordJson(entry), null, 2);\n}\n\nexport function renderFindingsJson(report: StrategyReport): string {\n const count = (severity: string): number => report.findings.filter((f) => f.severity === severity).length;\n return JSON.stringify(\n {\n // `key` is the baseline's identity for a finding, not something it says.\n findings: report.findings.map(({ key: _identity, ...finding }) => ({\n ...finding,\n file: displayPath(finding.file, report.cwd, report.base),\n })),\n summary: {\n records: report.records,\n references: report.references,\n errors: count(\"error\"),\n warnings: count(\"warning\"),\n notices: count(\"notice\"),\n ...(report.baseline === undefined ? {} : { baseline: report.baseline }),\n },\n },\n null,\n 2,\n );\n}\n"],"mappings":";;;;;;;;;AAUO,SAAS,WAAW,OAA6C;AACtE,QAAM,EAAE,OAAO,IAAI;AAEnB,QAAM,MAA+B,EAAE,IAAI,OAAO,IAAI,MAAM,OAAO,MAAM,OAAO,QAAQ,MAAM,EAAE;AAChG,MAAI,OAAO,gBAAgB,OAAW,KAAI,aAAa,IAAI,OAAO;AAClE,MAAI,OAAO,cAAc,OAAW,KAAI,WAAW,IAAI,OAAO;AAC9D,MAAI,MAAM,IAAI,MAAM;AACpB,MAAI,MAAM,IAAI,OAAO;AAErB,QAAM,UAAU,OAAO,QAAQ,IAAI,CAAC,MAAM,EAAE,KAAK;AACjD,MAAI,OAAO,SAAS,UAAW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CAAC,IAAI,EAAE,UAAU,OAAO,SAAS;AAAA,MACvE;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
parseTraceFile,
|
|
4
4
|
renderTrace
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SFTWEGUD.js";
|
|
6
6
|
import {
|
|
7
7
|
evaluateWhen,
|
|
8
8
|
matchesGlob,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
extractEvals,
|
|
31
31
|
findManifest,
|
|
32
32
|
resolveArtifacts
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-SX626JUF.js";
|
|
34
34
|
import {
|
|
35
35
|
discoverConfig
|
|
36
36
|
} from "./chunk-QSPH4F56.js";
|
|
@@ -74,10 +74,10 @@ import {
|
|
|
74
74
|
} from "./chunk-QS2Z3SWL.js";
|
|
75
75
|
import {
|
|
76
76
|
declaredAt
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-SRTBHEUM.js";
|
|
78
78
|
import {
|
|
79
79
|
xmlEscape
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-6D7FCU4E.js";
|
|
81
81
|
import {
|
|
82
82
|
PATH_JOIN,
|
|
83
83
|
externalMetadataJoin,
|
|
@@ -85,12 +85,12 @@ import {
|
|
|
85
85
|
loadExternalMetadata,
|
|
86
86
|
memberOf,
|
|
87
87
|
mergeWithMarks
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-PHOWMWFJ.js";
|
|
89
89
|
import {
|
|
90
90
|
DocmetaError,
|
|
91
91
|
classifyRef,
|
|
92
92
|
extractFrontmatter
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-PGDUVYTF.js";
|
|
94
94
|
import {
|
|
95
95
|
escapeWorkflowCommandMessage,
|
|
96
96
|
escapeWorkflowCommandProperty,
|
|
@@ -3204,4 +3204,4 @@ export {
|
|
|
3204
3204
|
resolveBatchTraces,
|
|
3205
3205
|
runBatch
|
|
3206
3206
|
};
|
|
3207
|
-
//# sourceMappingURL=chunk-
|
|
3207
|
+
//# sourceMappingURL=chunk-5MJE5KMY.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
extractFrontmatter,
|
|
7
7
|
extractorForExtension,
|
|
8
8
|
locateFrontmatter
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PGDUVYTF.js";
|
|
10
10
|
import {
|
|
11
11
|
errorMessage
|
|
12
12
|
} from "./chunk-G3T47CFV.js";
|
|
@@ -3247,4 +3247,4 @@ export {
|
|
|
3247
3247
|
unsupportedFormatMessage,
|
|
3248
3248
|
listFormats
|
|
3249
3249
|
};
|
|
3250
|
-
//# sourceMappingURL=chunk-
|
|
3250
|
+
//# sourceMappingURL=chunk-5UJQLZXY.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
canonicalSchemaRef,
|
|
7
7
|
fingerprint,
|
|
8
8
|
isErrorSeverity
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PGDUVYTF.js";
|
|
10
10
|
import {
|
|
11
11
|
escapeWorkflowCommandMessage,
|
|
12
12
|
escapeWorkflowCommandProperty,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-B2242FYO.js";
|
|
21
21
|
import {
|
|
22
22
|
package_default
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-ZODSGFAP.js";
|
|
24
24
|
|
|
25
25
|
// src/meta/reporters/rule-id.ts
|
|
26
26
|
var SYNTHETIC_SCHEMA = "(parse)";
|
|
@@ -407,4 +407,4 @@ export {
|
|
|
407
407
|
renderGithub,
|
|
408
408
|
render
|
|
409
409
|
};
|
|
410
|
-
//# sourceMappingURL=chunk-
|
|
410
|
+
//# sourceMappingURL=chunk-6D7FCU4E.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
offerPrompt,
|
|
6
6
|
planRelocation,
|
|
7
7
|
relocationOffers
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PHOWMWFJ.js";
|
|
9
9
|
|
|
10
10
|
// src/meta/core/location-writes.ts
|
|
11
11
|
import { LineCounter, isMap, isNode, isScalar, parseDocument } from "yaml";
|
|
@@ -161,4 +161,4 @@ export {
|
|
|
161
161
|
mergeMetaProvenance,
|
|
162
162
|
metaProvenanceEntries
|
|
163
163
|
};
|
|
164
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-6VGWLCYT.js.map
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
displayPath,
|
|
4
|
+
plural
|
|
5
|
+
} from "./chunk-NEO2HN2N.js";
|
|
6
|
+
import {
|
|
7
|
+
PARENTS,
|
|
8
|
+
RECORD_TYPES
|
|
9
|
+
} from "./chunk-O4O6JOGD.js";
|
|
10
|
+
import {
|
|
11
|
+
guidanceLines
|
|
12
|
+
} from "./chunk-QK6VYJHV.js";
|
|
13
|
+
import {
|
|
14
|
+
palette
|
|
15
|
+
} from "./chunk-RNVYGWIC.js";
|
|
16
|
+
|
|
17
|
+
// src/strategy/reporters/pretty.ts
|
|
18
|
+
var WIDTH = 80;
|
|
19
|
+
function titleOf(record) {
|
|
20
|
+
return record.title ?? record.id;
|
|
21
|
+
}
|
|
22
|
+
function countsLine(records) {
|
|
23
|
+
return RECORD_TYPES.map((type) => plural(records.filter((r) => r.type === type).length, type)).join(", ");
|
|
24
|
+
}
|
|
25
|
+
function renderListPretty(entries) {
|
|
26
|
+
const cell = (e) => `${" ".repeat(e.depth)}${e.record.id}`;
|
|
27
|
+
const recordWidth = Math.max("record".length, ...entries.map((e) => cell(e).length)) + 4;
|
|
28
|
+
const pagesWidth = Math.max("pages".length, ...entries.map((e) => String(e.pages.length).length));
|
|
29
|
+
const row = (record, pages, title) => `${record.padEnd(recordWidth)}${pages.padStart(pagesWidth)} ${title}`.trimEnd();
|
|
30
|
+
return [
|
|
31
|
+
row("record", "pages", "title"),
|
|
32
|
+
...entries.map((e) => row(cell(e), String(e.pages.length), titleOf(e.record))),
|
|
33
|
+
// A record under several parents is counted once.
|
|
34
|
+
countsLine([...new Set(entries.map((e) => e.record))])
|
|
35
|
+
].join("\n");
|
|
36
|
+
}
|
|
37
|
+
var KEY_WIDTH = 14;
|
|
38
|
+
function recordLines(records) {
|
|
39
|
+
const width = Math.max(0, ...records.map((r) => r.id.length)) + 2;
|
|
40
|
+
return records.map((r) => r.title === void 0 ? r.id : `${r.id.padEnd(width)}${r.title}`);
|
|
41
|
+
}
|
|
42
|
+
function renderGetPretty(entry, opts) {
|
|
43
|
+
const c = palette(opts.color);
|
|
44
|
+
const { record } = entry;
|
|
45
|
+
const rows = [
|
|
46
|
+
["type", [record.type]],
|
|
47
|
+
["id", [record.id]]
|
|
48
|
+
];
|
|
49
|
+
if (record.description !== void 0) rows.push(["description", [record.description]]);
|
|
50
|
+
if (record.lifecycle !== void 0) rows.push(["lifecycle", [record.lifecycle]]);
|
|
51
|
+
if (record.type !== "audience" && record.parents.length > 0) {
|
|
52
|
+
const shown = record.parents.map(
|
|
53
|
+
(p) => entry.parents.find((r) => r.id.toLowerCase() === p.value.toLowerCase()) ?? { id: p.value }
|
|
54
|
+
);
|
|
55
|
+
rows.push([PARENTS[record.type], recordLines(shown)]);
|
|
56
|
+
}
|
|
57
|
+
if (entry.children.length > 0) rows.push([record.type === "audience" ? "personas" : "journeys", recordLines(entry.children)]);
|
|
58
|
+
rows.push(["pages", entry.pages.length === 0 ? ["none"] : entry.pages]);
|
|
59
|
+
const where = `${entry.file}:${String(record.line)}`;
|
|
60
|
+
const lines = [`${c.bold(titleOf(record).padEnd(44))} ${c.dim(where)}`];
|
|
61
|
+
for (const [key, values] of rows) {
|
|
62
|
+
values.forEach((value, i) => lines.push(` ${(i === 0 ? key : "").padEnd(KEY_WIDTH)}${value}`));
|
|
63
|
+
}
|
|
64
|
+
return lines.join("\n");
|
|
65
|
+
}
|
|
66
|
+
var RULE_WIDTH = 36;
|
|
67
|
+
function wrapSentences(text, width) {
|
|
68
|
+
if (text.length <= width) return [text];
|
|
69
|
+
const lines = [];
|
|
70
|
+
let line = "";
|
|
71
|
+
for (const sentence of text.split(/(?<=[.?])\s+(?=[A-Z])/)) {
|
|
72
|
+
if (line === "") line = sentence;
|
|
73
|
+
else if (line.length + 1 + sentence.length <= width) line = `${line} ${sentence}`;
|
|
74
|
+
else {
|
|
75
|
+
lines.push(line);
|
|
76
|
+
line = sentence;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (line !== "") lines.push(line);
|
|
80
|
+
return lines;
|
|
81
|
+
}
|
|
82
|
+
function severityText(c, severity) {
|
|
83
|
+
const padded = severity.padEnd(7);
|
|
84
|
+
if (severity === "error") return c.red(padded);
|
|
85
|
+
if (severity === "warning") return c.yellow(padded);
|
|
86
|
+
return c.cyan(padded);
|
|
87
|
+
}
|
|
88
|
+
function counts(findings) {
|
|
89
|
+
const n = (severity) => findings.filter((f) => f.severity === severity).length;
|
|
90
|
+
const parts = [];
|
|
91
|
+
if (n("error") > 0) parts.push(plural(n("error"), "error"));
|
|
92
|
+
if (n("warning") > 0) parts.push(plural(n("warning"), "warning"));
|
|
93
|
+
if (n("notice") > 0) parts.push(plural(n("notice"), "notice"));
|
|
94
|
+
return parts.join(", ");
|
|
95
|
+
}
|
|
96
|
+
function renderFindingsPretty(report, opts) {
|
|
97
|
+
const c = palette(opts.color);
|
|
98
|
+
const { baseline } = report;
|
|
99
|
+
if (baseline?.written === true) {
|
|
100
|
+
return `${c.green("\u2713")} ${plural(report.found, "finding")} recorded in ${baseline.path}`;
|
|
101
|
+
}
|
|
102
|
+
const baselined = baseline !== void 0 && baseline.suppressed > 0 ? `, ${String(baseline.suppressed)} baselined` : "";
|
|
103
|
+
const records = plural(report.records, "record");
|
|
104
|
+
if (report.findings.length === 0) {
|
|
105
|
+
return `${c.green("\u2713")} ${records}, ${plural(report.references, "reference")}, no findings${baselined}`;
|
|
106
|
+
}
|
|
107
|
+
const ruleWidth = Math.max(RULE_WIDTH, ...report.findings.map((f) => f.ruleId.length + 2));
|
|
108
|
+
const prefixWidth = 2 + 7 + 1 + ruleWidth;
|
|
109
|
+
const indent = " ".repeat(prefixWidth);
|
|
110
|
+
const lines = [];
|
|
111
|
+
let group;
|
|
112
|
+
for (const finding of report.findings) {
|
|
113
|
+
const file = displayPath(finding.file, report.cwd, report.base);
|
|
114
|
+
const header = finding.line === void 0 ? file : `${file}:${String(finding.line)}`;
|
|
115
|
+
if (header !== group) {
|
|
116
|
+
lines.push(c.bold(header));
|
|
117
|
+
group = header;
|
|
118
|
+
}
|
|
119
|
+
wrapSentences(finding.message, WIDTH - prefixWidth).forEach((text, i) => {
|
|
120
|
+
lines.push(
|
|
121
|
+
i === 0 ? ` ${severityText(c, finding.severity)} ${finding.ruleId.padEnd(ruleWidth)}${text}` : `${indent}${text}`
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
for (const line of guidanceLines(finding.guidance)) lines.push(`${indent}${c.dim(line)}`);
|
|
125
|
+
}
|
|
126
|
+
lines.push("", `${counts(report.findings)} in ${records}${baselined}`);
|
|
127
|
+
return lines.join("\n");
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
titleOf,
|
|
132
|
+
countsLine,
|
|
133
|
+
renderListPretty,
|
|
134
|
+
renderGetPretty,
|
|
135
|
+
renderFindingsPretty
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=chunk-BEQZI3V5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/strategy/reporters/pretty.ts"],"sourcesContent":["/**\n * Human output for every `manni strategy` command. `list` is a tree, `get` a\n * key column, and `check` term's layout: findings grouped under a bold\n * `file:line`, each message wrapped under its own column with the rule's\n * guidance dim beneath it.\n */\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport type { Severity } from \"../../shared/severity.js\";\nimport type { StrategyReport } from \"../commands/findings.js\";\nimport type { RecordEntry } from \"../commands/list.js\";\nimport { displayPath, plural } from \"../commands/run.js\";\nimport { PARENTS, RECORD_TYPES, type StrategyFinding, type StrategyRecord } from \"../types.js\";\n\nconst WIDTH = 80;\n\n/** A record's title, or its id when it has none. */\nexport function titleOf(record: StrategyRecord): string {\n return record.title ?? record.id;\n}\n\n/** `4 audiences, 4 personas, 74 journeys`. */\nexport function countsLine(records: readonly StrategyRecord[]): string {\n return RECORD_TYPES.map((type) => plural(records.filter((r) => r.type === type).length, type)).join(\", \");\n}\n\n// ---------------------------------------------------------------------------\n// list\n\nexport function renderListPretty(entries: readonly RecordEntry[]): string {\n const cell = (e: RecordEntry): string => `${\" \".repeat(e.depth)}${e.record.id}`;\n const recordWidth = Math.max(\"record\".length, ...entries.map((e) => cell(e).length)) + 4;\n const pagesWidth = Math.max(\"pages\".length, ...entries.map((e) => String(e.pages.length).length));\n const row = (record: string, pages: string, title: string): string =>\n `${record.padEnd(recordWidth)}${pages.padStart(pagesWidth)} ${title}`.trimEnd();\n return [\n row(\"record\", \"pages\", \"title\"),\n ...entries.map((e) => row(cell(e), String(e.pages.length), titleOf(e.record))),\n // A record under several parents is counted once.\n countsLine([...new Set(entries.map((e) => e.record))]),\n ].join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// get\n\nconst KEY_WIDTH = 14;\n\n/** Each record as `id title`, the ids padded so the titles line up. */\nfunction recordLines(records: readonly Pick<StrategyRecord, \"id\" | \"title\">[]): string[] {\n const width = Math.max(0, ...records.map((r) => r.id.length)) + 2;\n return records.map((r) => (r.title === undefined ? r.id : `${r.id.padEnd(width)}${r.title}`));\n}\n\nexport function renderGetPretty(entry: RecordEntry, opts: { color: boolean }): string {\n const c = palette(opts.color);\n const { record } = entry;\n const rows: [string, string[]][] = [\n [\"type\", [record.type]],\n [\"id\", [record.id]],\n ];\n if (record.description !== undefined) rows.push([\"description\", [record.description]]);\n if (record.lifecycle !== undefined) rows.push([\"lifecycle\", [record.lifecycle]]);\n if (record.type !== \"audience\" && record.parents.length > 0) {\n // A value no record answers to shows as written.\n const shown = record.parents.map(\n (p) => entry.parents.find((r) => r.id.toLowerCase() === p.value.toLowerCase()) ?? { id: p.value },\n );\n rows.push([PARENTS[record.type], recordLines(shown)]);\n }\n if (entry.children.length > 0) rows.push([record.type === \"audience\" ? \"personas\" : \"journeys\", recordLines(entry.children)]);\n rows.push([\"pages\", entry.pages.length === 0 ? [\"none\"] : entry.pages]);\n\n const where = `${entry.file}:${String(record.line)}`;\n const lines = [`${c.bold(titleOf(record).padEnd(44))} ${c.dim(where)}`];\n for (const [key, values] of rows) {\n values.forEach((value, i) => lines.push(` ${(i === 0 ? key : \"\").padEnd(KEY_WIDTH)}${value}`));\n }\n return lines.join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// check\n\nconst RULE_WIDTH = 36;\n\n/** Sentences packed into lines of at most `width`; a message that fits stays whole. */\nfunction wrapSentences(text: string, width: number): string[] {\n if (text.length <= width) return [text];\n const lines: string[] = [];\n let line = \"\";\n // A sentence ends at `.` or `?` before a space and a capital, which every\n // message sentence starts with, so `m1.0`, a URL or `e.g. x` never splits.\n for (const sentence of text.split(/(?<=[.?])\\s+(?=[A-Z])/)) {\n if (line === \"\") line = sentence;\n else if (line.length + 1 + sentence.length <= width) line = `${line} ${sentence}`;\n else {\n lines.push(line);\n line = sentence;\n }\n }\n if (line !== \"\") lines.push(line);\n return lines;\n}\n\nfunction severityText(c: Colors, severity: Severity): string {\n const padded = severity.padEnd(7);\n if (severity === \"error\") return c.red(padded);\n if (severity === \"warning\") return c.yellow(padded);\n return c.cyan(padded);\n}\n\nfunction counts(findings: readonly StrategyFinding[]): string {\n const n = (severity: Severity): number => findings.filter((f) => f.severity === severity).length;\n const parts: string[] = [];\n if (n(\"error\") > 0) parts.push(plural(n(\"error\"), \"error\"));\n if (n(\"warning\") > 0) parts.push(plural(n(\"warning\"), \"warning\"));\n if (n(\"notice\") > 0) parts.push(plural(n(\"notice\"), \"notice\"));\n return parts.join(\", \");\n}\n\nexport function renderFindingsPretty(report: StrategyReport, opts: { color: boolean }): string {\n const c = palette(opts.color);\n const { baseline } = report;\n if (baseline?.written === true) {\n return `${c.green(\"✓\")} ${plural(report.found, \"finding\")} recorded in ${baseline.path}`;\n }\n const baselined = baseline !== undefined && baseline.suppressed > 0 ? `, ${String(baseline.suppressed)} baselined` : \"\";\n const records = plural(report.records, \"record\");\n if (report.findings.length === 0) {\n return `${c.green(\"✓\")} ${records}, ${plural(report.references, \"reference\")}, no findings${baselined}`;\n }\n\n const ruleWidth = Math.max(RULE_WIDTH, ...report.findings.map((f) => f.ruleId.length + 2));\n const prefixWidth = 2 + 7 + 1 + ruleWidth;\n const indent = \" \".repeat(prefixWidth);\n const lines: string[] = [];\n let group: string | undefined;\n for (const finding of report.findings) {\n const file = displayPath(finding.file, report.cwd, report.base);\n const header = finding.line === undefined ? file : `${file}:${String(finding.line)}`;\n if (header !== group) {\n lines.push(c.bold(header));\n group = header;\n }\n wrapSentences(finding.message, WIDTH - prefixWidth).forEach((text, i) => {\n lines.push(\n i === 0 ? ` ${severityText(c, finding.severity)} ${finding.ruleId.padEnd(ruleWidth)}${text}` : `${indent}${text}`,\n );\n });\n for (const line of guidanceLines(finding.guidance)) lines.push(`${indent}${c.dim(line)}`);\n }\n lines.push(\"\", `${counts(report.findings)} in ${records}${baselined}`);\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAcA,IAAM,QAAQ;AAGP,SAAS,QAAQ,QAAgC;AACtD,SAAO,OAAO,SAAS,OAAO;AAChC;AAGO,SAAS,WAAW,SAA4C;AACrE,SAAO,aAAa,IAAI,CAAC,SAAS,OAAO,QAAQ,OAAO,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,QAA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AC,OAAO,OAAO,GAAG,SAAS,EAAE;AACrE,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
tagCommits,
|
|
37
37
|
topLevel,
|
|
38
38
|
wordShare
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-ZBE735BH.js";
|
|
40
40
|
import {
|
|
41
41
|
applyMarkerMoves,
|
|
42
42
|
blockMatches,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
spellAt,
|
|
52
52
|
spellElsewhere,
|
|
53
53
|
unitAt
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-SGI3WPYK.js";
|
|
55
55
|
import {
|
|
56
56
|
CiteError,
|
|
57
57
|
citationInputs,
|
|
@@ -66,10 +66,10 @@ import {
|
|
|
66
66
|
sourceRange,
|
|
67
67
|
spellSource,
|
|
68
68
|
tooWide
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-GL2HXZVX.js";
|
|
70
70
|
import {
|
|
71
71
|
ensureEncryptionKey
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-UKSXQHSE.js";
|
|
73
73
|
import {
|
|
74
74
|
ANY_FENCE,
|
|
75
75
|
ENCRYPTION_KEY_ENV,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
toBodyLines,
|
|
102
102
|
toFileLines,
|
|
103
103
|
unitHolding
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-PHOWMWFJ.js";
|
|
105
105
|
import {
|
|
106
106
|
DocmetaError,
|
|
107
107
|
STDIN_LABEL,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
extractorByName,
|
|
111
111
|
locateFrontmatter,
|
|
112
112
|
writeFileAtomic
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-PGDUVYTF.js";
|
|
114
114
|
import {
|
|
115
115
|
SEVERITIES
|
|
116
116
|
} from "./chunk-77AINBYM.js";
|
|
@@ -2727,4 +2727,4 @@ export {
|
|
|
2727
2727
|
runRemove,
|
|
2728
2728
|
runUpdate
|
|
2729
2729
|
};
|
|
2730
|
-
//# sourceMappingURL=chunk-
|
|
2730
|
+
//# sourceMappingURL=chunk-BV7FJ4V2.js.map
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
updateConfigEval,
|
|
23
23
|
updateManifestEval,
|
|
24
24
|
updatePageEval
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-JKH2LV5D.js";
|
|
26
26
|
import {
|
|
27
27
|
DEFAULT_CONFIG_FILENAME,
|
|
28
28
|
assertRegisteredGraders,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
sha256,
|
|
42
42
|
splitBody,
|
|
43
43
|
withExternalMetadata
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-GXDVERLV.js";
|
|
45
45
|
import {
|
|
46
46
|
isTurnBudgetSkip
|
|
47
47
|
} from "./chunk-SSQZB5SQ.js";
|
|
@@ -54,10 +54,10 @@ import {
|
|
|
54
54
|
} from "./chunk-MDZXRHIJ.js";
|
|
55
55
|
import {
|
|
56
56
|
mergeMetaProvenance
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-6VGWLCYT.js";
|
|
58
58
|
import {
|
|
59
59
|
notFoundMessage
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-PGDUVYTF.js";
|
|
61
61
|
import {
|
|
62
62
|
SEVERITIES
|
|
63
63
|
} from "./chunk-77AINBYM.js";
|
|
@@ -1287,4 +1287,4 @@ export {
|
|
|
1287
1287
|
renderCalibration,
|
|
1288
1288
|
runInit
|
|
1289
1289
|
};
|
|
1290
|
-
//# sourceMappingURL=chunk-
|
|
1290
|
+
//# sourceMappingURL=chunk-DQO44Y5G.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
findingMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FRM62BEN.js";
|
|
5
5
|
import {
|
|
6
6
|
errorSite
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SGI3WPYK.js";
|
|
8
8
|
import {
|
|
9
9
|
RULE_ID_PREFIX,
|
|
10
10
|
guidanceFor,
|
|
11
11
|
isCiteRule
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GL2HXZVX.js";
|
|
13
13
|
import {
|
|
14
14
|
renderSarif
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6D7FCU4E.js";
|
|
16
16
|
import {
|
|
17
17
|
guidanceLines
|
|
18
18
|
} from "./chunk-QK6VYJHV.js";
|
|
@@ -78,4 +78,4 @@ export {
|
|
|
78
78
|
withFindingMessages,
|
|
79
79
|
renderCheckSarif
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-DTSWP5FC.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
STDIN_TOKEN,
|
|
9
9
|
notFoundMessage,
|
|
10
10
|
resolveTargetSet
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PGDUVYTF.js";
|
|
12
12
|
import {
|
|
13
13
|
escapeWorkflowCommandMessage,
|
|
14
14
|
escapeWorkflowCommandProperty,
|
|
@@ -438,4 +438,4 @@ export {
|
|
|
438
438
|
renderJson,
|
|
439
439
|
renderPretty
|
|
440
440
|
};
|
|
441
|
-
//# sourceMappingURL=chunk-
|
|
441
|
+
//# sourceMappingURL=chunk-EBYLQE7P.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
loadTerms
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SOW6SVAM.js";
|
|
5
5
|
|
|
6
6
|
// src/term/commands/list.ts
|
|
7
7
|
var LIST_FORMATS = ["pretty", "json", "csv"];
|
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
LIST_FORMATS,
|
|
15
15
|
runList
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-FERFWKZM.js.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resultFor,
|
|
4
4
|
splitBaselined
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZRMA5U53.js";
|
|
6
6
|
import {
|
|
7
7
|
errorSite
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SGI3WPYK.js";
|
|
9
9
|
import {
|
|
10
10
|
escapeWorkflowCommandMessage,
|
|
11
11
|
escapeWorkflowCommandProperty,
|
|
@@ -51,4 +51,4 @@ export {
|
|
|
51
51
|
findingMessage,
|
|
52
52
|
renderCheckGithub
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-FRM62BEN.js.map
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
resolveSeverity,
|
|
6
6
|
ruleId
|
|
7
7
|
} from "./chunk-BREAC43H.js";
|
|
8
|
+
import {
|
|
9
|
+
closestName
|
|
10
|
+
} from "./chunk-XTKJNRJ6.js";
|
|
8
11
|
import {
|
|
9
12
|
DEFAULT_ABSTRACT_MAX_LENGTH,
|
|
10
13
|
DEFAULT_CRAWL_MIN_PAGES,
|
|
@@ -12,49 +15,22 @@ import {
|
|
|
12
15
|
TermError,
|
|
13
16
|
languageKey,
|
|
14
17
|
loadTerms
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SOW6SVAM.js";
|
|
16
19
|
import {
|
|
17
20
|
TERM_MATCH_FIELDS
|
|
18
21
|
} from "./chunk-MC7U5IH4.js";
|
|
19
22
|
import {
|
|
20
23
|
TERM_RELATION_FIELDS
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-UKSXQHSE.js";
|
|
22
25
|
import {
|
|
23
26
|
isErrorSeverity,
|
|
24
27
|
resolveBaselineRequest,
|
|
25
28
|
settleBaseline
|
|
26
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-PGDUVYTF.js";
|
|
27
30
|
|
|
28
31
|
// src/term/commands/check.ts
|
|
29
32
|
import { existsSync } from "node:fs";
|
|
30
33
|
|
|
31
|
-
// src/shared/closest-name.ts
|
|
32
|
-
function editDistance(a, b) {
|
|
33
|
-
let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
34
|
-
for (let i = 1; i <= a.length; i++) {
|
|
35
|
-
const row = [i];
|
|
36
|
-
for (let j = 1; j <= b.length; j++) {
|
|
37
|
-
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
38
|
-
row.push(Math.min((row[j - 1] ?? 0) + 1, (prev[j] ?? 0) + 1, (prev[j - 1] ?? 0) + cost));
|
|
39
|
-
}
|
|
40
|
-
prev = row;
|
|
41
|
-
}
|
|
42
|
-
return prev[b.length] ?? 0;
|
|
43
|
-
}
|
|
44
|
-
function closestName(query, names) {
|
|
45
|
-
const limit = Math.max(2, Math.floor(query.length / 3));
|
|
46
|
-
let best;
|
|
47
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
48
|
-
for (const name of names) {
|
|
49
|
-
const distance = editDistance(query, name);
|
|
50
|
-
if (distance < bestDistance) {
|
|
51
|
-
best = name;
|
|
52
|
-
bestDistance = distance;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return bestDistance <= limit ? best : void 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
34
|
// src/term/core/check.ts
|
|
59
35
|
var RETIRED_STATUSES = /* @__PURE__ */ new Set(["deprecated", "superseded"]);
|
|
60
36
|
var REFERENCE_FIELDS = TERM_RELATION_FIELDS;
|
|
@@ -730,7 +706,6 @@ async function runCheck(opts) {
|
|
|
730
706
|
}
|
|
731
707
|
|
|
732
708
|
export {
|
|
733
|
-
closestName,
|
|
734
709
|
FINDING_FORMATS,
|
|
735
710
|
JUNIT_CLASSNAME,
|
|
736
711
|
toResults,
|
|
@@ -738,4 +713,4 @@ export {
|
|
|
738
713
|
reportedFindings,
|
|
739
714
|
runCheck
|
|
740
715
|
};
|
|
741
|
-
//# sourceMappingURL=chunk-
|
|
716
|
+
//# sourceMappingURL=chunk-GCF7STEA.js.map
|