@hawkeyexl/manni 4.21.0 → 4.22.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.
Files changed (303) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-C534YIAU.js → batch-C3NN2YXB.js} +20 -21
  3. package/dist/build-CEVEAHN7.js +36 -0
  4. package/dist/calibrate-CSKPY5AK.js +42 -0
  5. package/dist/capture-3HDBIHH6.js +37 -0
  6. package/dist/check-555TCJGF.js +45 -0
  7. package/dist/check-KGJBV42O.js +30 -0
  8. package/dist/{check-JZINDP3F.js → check-KXWHSCCR.js} +13 -16
  9. package/dist/check-MZSXCS2M.js +33 -0
  10. package/dist/{check-LKPQPQWJ.js → check-QNHLTYPN.js} +23 -23
  11. package/dist/{chunk-AE6KBAAU.js → chunk-2VLZDU4E.js} +5 -5
  12. package/dist/{chunk-ARNI3SJT.js → chunk-37Q7WEJJ.js} +9 -9
  13. package/dist/{chunk-PTGXEZQD.js → chunk-3ZVRGBK6.js} +4 -4
  14. package/dist/{chunk-DMVBIIP3.js → chunk-46MMIJWR.js} +3 -3
  15. package/dist/{chunk-CREFJCWZ.js → chunk-4LYVTR2T.js} +4 -4
  16. package/dist/{chunk-BXE4L52Q.js → chunk-562QZKAB.js} +6599 -3508
  17. package/dist/chunk-562QZKAB.js.map +1 -0
  18. package/dist/{chunk-BLXRIAV2.js → chunk-57LZPG4V.js} +29 -4
  19. package/dist/chunk-57LZPG4V.js.map +1 -0
  20. package/dist/{chunk-SHXPE4D4.js → chunk-5LQX57BW.js} +2 -2
  21. package/dist/{chunk-SHXPE4D4.js.map → chunk-5LQX57BW.js.map} +1 -1
  22. package/dist/{chunk-BKY6GAFA.js → chunk-63EQKVNT.js} +45 -910
  23. package/dist/chunk-63EQKVNT.js.map +1 -0
  24. package/dist/{chunk-TFVNEPMF.js → chunk-64DULZIG.js} +4 -4
  25. package/dist/{chunk-2HOWRAWK.js → chunk-6SVHI2U6.js} +2 -2
  26. package/dist/{chunk-D4QHRVDJ.js → chunk-6UHEMPEY.js} +3 -157
  27. package/dist/chunk-6UHEMPEY.js.map +1 -0
  28. package/dist/{chunk-DENZLZ3Z.js → chunk-A5YUK3SG.js} +26 -17
  29. package/dist/chunk-A5YUK3SG.js.map +1 -0
  30. package/dist/{chunk-XI3BNZG4.js → chunk-A67EJ3J6.js} +6 -6
  31. package/dist/{chunk-HHJ2HFPP.js → chunk-BLDL23RY.js} +8 -8
  32. package/dist/{chunk-RQPEKHZH.js → chunk-BY3635RR.js} +80 -16
  33. package/dist/chunk-BY3635RR.js.map +1 -0
  34. package/dist/{chunk-CFMI74TP.js → chunk-BZ74YUYE.js} +2 -2
  35. package/dist/{chunk-5UJKXOAD.js → chunk-CHTSA3YR.js} +6 -6
  36. package/dist/{chunk-FHJIH6XP.js → chunk-CPYQ4BJK.js} +16 -7
  37. package/dist/chunk-CPYQ4BJK.js.map +1 -0
  38. package/dist/{chunk-IN5T22FP.js → chunk-CQTESLC5.js} +2 -2
  39. package/dist/{chunk-245W2Q7C.js → chunk-D4BGNAN5.js} +2 -2
  40. package/dist/{chunk-762MM6NA.js → chunk-E3HYSNS6.js} +4 -4
  41. package/dist/{chunk-DPDG3FHL.js → chunk-EL2KNRC3.js} +3 -3
  42. package/dist/{chunk-LWBNHK72.js → chunk-FTSNG6DZ.js} +42 -24
  43. package/dist/chunk-FTSNG6DZ.js.map +1 -0
  44. package/dist/{chunk-KCWNJMSS.js → chunk-FXE5K56B.js} +3 -3
  45. package/dist/{chunk-CLPC3LKX.js → chunk-HYEKQ22B.js} +4 -4
  46. package/dist/{chunk-VLRIP4BQ.js → chunk-IC3FJWIF.js} +2 -2
  47. package/dist/{chunk-CZIO37J5.js → chunk-IDDRHB7E.js} +3 -3
  48. package/dist/chunk-INOVEO32.js +28 -0
  49. package/dist/chunk-INOVEO32.js.map +1 -0
  50. package/dist/chunk-IXFFVI5S.js +409 -0
  51. package/dist/chunk-IXFFVI5S.js.map +1 -0
  52. package/dist/{chunk-BHGFLRXM.js → chunk-JA7DWOVV.js} +5 -5
  53. package/dist/{chunk-B2242FYO.js → chunk-JF4BC7ZD.js} +38 -3
  54. package/dist/chunk-JF4BC7ZD.js.map +1 -0
  55. package/dist/{chunk-RKACUTY5.js → chunk-JL5FHNQK.js} +9 -11
  56. package/dist/{chunk-RKACUTY5.js.map → chunk-JL5FHNQK.js.map} +1 -1
  57. package/dist/{chunk-MTCOBRCX.js → chunk-JVE5YQN4.js} +4 -4
  58. package/dist/{chunk-6XK3NTL5.js → chunk-K5LBIAOM.js} +32 -38
  59. package/dist/chunk-K5LBIAOM.js.map +1 -0
  60. package/dist/{chunk-E7OG5F6S.js → chunk-KIUFBUUZ.js} +13 -11
  61. package/dist/{chunk-E7OG5F6S.js.map → chunk-KIUFBUUZ.js.map} +1 -1
  62. package/dist/{chunk-Q76T6Y6X.js → chunk-LCMBG4LY.js} +3635 -3409
  63. package/dist/chunk-LCMBG4LY.js.map +1 -0
  64. package/dist/{chunk-BXCVOHEX.js → chunk-LMS2RWDS.js} +15 -13
  65. package/dist/{chunk-BXCVOHEX.js.map → chunk-LMS2RWDS.js.map} +1 -1
  66. package/dist/{chunk-IOJD2RFG.js → chunk-MR5JWMC2.js} +2 -2
  67. package/dist/{chunk-JCTHXG33.js → chunk-NHOGTAPK.js} +2 -2
  68. package/dist/{chunk-VM7VAFJW.js → chunk-NVYDWVXN.js} +2 -1
  69. package/dist/{chunk-NLJ3XIKT.js → chunk-O6IDYZVW.js} +3 -3
  70. package/dist/{chunk-E23KWEPL.js → chunk-OHMLEITS.js} +2 -2
  71. package/dist/{chunk-NUQF5F5J.js → chunk-PNDEKFF3.js} +2 -2
  72. package/dist/{chunk-3SFAB75L.js → chunk-PX7OTUNU.js} +6 -6
  73. package/dist/{chunk-PACZEDOH.js → chunk-Q7FFJMFO.js} +19 -15
  74. package/dist/chunk-Q7FFJMFO.js.map +1 -0
  75. package/dist/{chunk-P7HAXMFN.js → chunk-QJJPTS6L.js} +5 -3
  76. package/dist/{chunk-P7HAXMFN.js.map → chunk-QJJPTS6L.js.map} +1 -1
  77. package/dist/chunk-RAN3CF33.js +1875 -0
  78. package/dist/chunk-RAN3CF33.js.map +1 -0
  79. package/dist/{chunk-H5YWCCBO.js → chunk-S7V4F7HC.js} +3 -3
  80. package/dist/{chunk-R2CR62JV.js → chunk-SCKVDD4E.js} +4 -4
  81. package/dist/{chunk-JUUCCML3.js → chunk-TJYJ4BNK.js} +4 -4
  82. package/dist/{chunk-JQA6RF4R.js → chunk-TR5TNPWT.js} +2 -2
  83. package/dist/{chunk-JQA6RF4R.js.map → chunk-TR5TNPWT.js.map} +1 -1
  84. package/dist/chunk-TT5UDTDM.js +888 -0
  85. package/dist/chunk-TT5UDTDM.js.map +1 -0
  86. package/dist/{chunk-22WGKOQ7.js → chunk-TWYJ2TVS.js} +7 -7
  87. package/dist/{chunk-U4OJ7U45.js → chunk-UQI463L3.js} +9 -9
  88. package/dist/{chunk-A4QNKEX4.js → chunk-V27DOGAO.js} +2 -2
  89. package/dist/{chunk-GMLOAKOA.js → chunk-VSDXZAQU.js} +4 -22
  90. package/dist/chunk-VSDXZAQU.js.map +1 -0
  91. package/dist/{chunk-YSZNJ2ID.js → chunk-VSHMXMBZ.js} +2 -2
  92. package/dist/{chunk-2NGFDLIM.js → chunk-VZSATUI7.js} +4 -4
  93. package/dist/{chunk-KQDRO6N6.js → chunk-W5OZMYMX.js} +2 -2
  94. package/dist/{chunk-XBJKYXOR.js → chunk-WW4JATBJ.js} +6 -6
  95. package/dist/{chunk-SSQZB5SQ.js → chunk-XG6PVB5S.js} +11 -1
  96. package/dist/chunk-XG6PVB5S.js.map +1 -0
  97. package/dist/{chunk-KBSTXL6L.js → chunk-XQKRD5A3.js} +4 -4
  98. package/dist/{chunk-2YKUSTHS.js → chunk-XSP3TUFN.js} +5 -5
  99. package/dist/{chunk-APAF4VWW.js → chunk-XTMONCQE.js} +6 -405
  100. package/dist/chunk-XTMONCQE.js.map +1 -0
  101. package/dist/{chunk-BJUEOC4G.js → chunk-YB3KD5RI.js} +3 -3
  102. package/dist/chunk-ZAOJYN2D.js +159 -0
  103. package/dist/chunk-ZAOJYN2D.js.map +1 -0
  104. package/dist/{chunk-OWJLB2AF.js → chunk-ZKIXGFID.js} +2 -2
  105. package/dist/{chunk-WHVFHBL3.js → chunk-ZT3ERG4B.js} +3 -3
  106. package/dist/chunk-ZTRC37NH.js +38 -0
  107. package/dist/chunk-ZTRC37NH.js.map +1 -0
  108. package/dist/{chunk-V2XJJEEF.js → chunk-ZW4YASUB.js} +4 -4
  109. package/dist/{chunk-5LE4NH3Z.js → chunk-ZX4TOTZS.js} +6 -4
  110. package/dist/{chunk-5LE4NH3Z.js.map → chunk-ZX4TOTZS.js.map} +1 -1
  111. package/dist/{cli-MOKRUHZT.js → cli-4QAH3DBX.js} +9 -11
  112. package/dist/{cli-3PBRPPMQ.js → cli-6476FRBK.js} +16 -19
  113. package/dist/{cli-3PBRPPMQ.js.map → cli-6476FRBK.js.map} +1 -1
  114. package/dist/{cli-FDXU7CGZ.js → cli-7XT7O5YM.js} +16 -19
  115. package/dist/{cli-FDXU7CGZ.js.map → cli-7XT7O5YM.js.map} +1 -1
  116. package/dist/{cli-AVHLY2AI.js → cli-FGCHGJYZ.js} +51 -50
  117. package/dist/cli-FGCHGJYZ.js.map +1 -0
  118. package/dist/{cli-FSDJY5OC.js → cli-JE4LG35H.js} +4 -4
  119. package/dist/{cli-JNYL6LB7.js → cli-U3622DIB.js} +14 -17
  120. package/dist/{cli-JNYL6LB7.js.map → cli-U3622DIB.js.map} +1 -1
  121. package/dist/{cli-MQXOK64K.js → cli-ULHJTJHH.js} +74 -42
  122. package/dist/cli-ULHJTJHH.js.map +1 -0
  123. package/dist/{cli-6NKE6RMT.js → cli-W7B2PNZO.js} +18 -21
  124. package/dist/{cli-6NKE6RMT.js.map → cli-W7B2PNZO.js.map} +1 -1
  125. package/dist/{cli-77A46SB2.js → cli-YGMXZ46V.js} +17 -20
  126. package/dist/{cli-77A46SB2.js.map → cli-YGMXZ46V.js.map} +1 -1
  127. package/dist/{cli-K47XWDLJ.js → cli-YINQL2NI.js} +28 -29
  128. package/dist/{cli-K47XWDLJ.js.map → cli-YINQL2NI.js.map} +1 -1
  129. package/dist/cli-Z3ART5DN.js +152 -0
  130. package/dist/cli-Z3ART5DN.js.map +1 -0
  131. package/dist/cli.js +15 -15
  132. package/dist/cli.js.map +1 -1
  133. package/dist/{config-BMWDC66C.js → config-2YJPJ36T.js} +5 -5
  134. package/dist/docmeta.js +8 -10
  135. package/dist/docmeta.js.map +1 -1
  136. package/dist/github-64ZVAUIT.js +28 -0
  137. package/dist/github-ARGPMQD2.js +32 -0
  138. package/dist/github-YHJABBUI.js +33 -0
  139. package/dist/graph/runtime.js.map +1 -1
  140. package/dist/{host-YSTYO5DX.js → host-JT27OWTC.js} +3 -3
  141. package/dist/index.d.ts +332 -23
  142. package/dist/index.js +218 -205
  143. package/dist/index.js.map +1 -1
  144. package/dist/{json-YIK72XAL.js → json-CVOVXB7O.js} +12 -15
  145. package/dist/json-QNGJFUY2.js +40 -0
  146. package/dist/{labels-X633ZPK7.js → labels-5WOKC3VR.js} +11 -14
  147. package/dist/{labels-X633ZPK7.js.map → labels-5WOKC3VR.js.map} +1 -1
  148. package/dist/lint-OQGB4DWJ.js +32 -0
  149. package/dist/list-EDAB7X5Y.js +30 -0
  150. package/dist/list-OQ3IYV2W.js +37 -0
  151. package/dist/list-PN6JKYNX.js +33 -0
  152. package/dist/{page-OMPEACUN.js → page-TPNMHL27.js} +11 -14
  153. package/dist/{prepare-B4JVDVOV.js → prepare-3V2QYBKL.js} +20 -22
  154. package/dist/{prepare-B4JVDVOV.js.map → prepare-3V2QYBKL.js.map} +1 -1
  155. package/dist/{pretty-PPNHHOEN.js → pretty-EZ2NFU3C.js} +13 -16
  156. package/dist/pretty-HO2LYG5N.js +41 -0
  157. package/dist/{pretty-U7ATCFBN.js → pretty-K3M4AW2D.js} +12 -15
  158. package/dist/{provider-JY2I3VLF.js → provider-YWNTTQPA.js} +3 -3
  159. package/dist/{release-VHHASAG7.js → release-EFLQT3FW.js} +3 -3
  160. package/dist/{reporters-KE7AZR6C.js → reporters-4R2E7PRJ.js} +6 -6
  161. package/dist/{reporters-FAIEOTC4.js → reporters-YVLLFBO5.js} +11 -14
  162. package/dist/run-H4BOR2FR.js +36 -0
  163. package/dist/{sarif-DOGRSGTB.js → sarif-GWHWJJFP.js} +10 -13
  164. package/dist/sarif-SJFVSOBV.js +33 -0
  165. package/dist/sarif-YBFD5OUL.js +28 -0
  166. package/dist/{strategy-EK5VY5DG.js → strategy-T56PH2VK.js} +29 -47
  167. package/dist/strategy-T56PH2VK.js.map +1 -0
  168. package/dist/{term-MDN3NJDW.js → term-33YSMISR.js} +18 -22
  169. package/dist/{term-MDN3NJDW.js.map → term-33YSMISR.js.map} +1 -1
  170. package/dist/{validate-QDYQ642J.js → validate-6R5UBDGU.js} +6 -7
  171. package/package.json +1 -1
  172. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  173. package/plugin/manni/hooks/graph-server.mjs +3 -3
  174. package/plugin/manni/hooks/page-metadata.mjs +81 -7
  175. package/plugin/manni/skills/fix/SKILL.md +3 -3
  176. package/shapes/graph/shapes-1.3.0.ttl +1250 -0
  177. package/dist/build-SVKT7QFU.js +0 -39
  178. package/dist/calibrate-AL3MH7TY.js +0 -43
  179. package/dist/capture-2F7B4DAD.js +0 -39
  180. package/dist/check-BI7OGIVE.js +0 -48
  181. package/dist/check-OPUMZEVK.js +0 -35
  182. package/dist/check-OW7UD73D.js +0 -33
  183. package/dist/chunk-6XK3NTL5.js.map +0 -1
  184. package/dist/chunk-APAF4VWW.js.map +0 -1
  185. package/dist/chunk-B2242FYO.js.map +0 -1
  186. package/dist/chunk-BKY6GAFA.js.map +0 -1
  187. package/dist/chunk-BLXRIAV2.js.map +0 -1
  188. package/dist/chunk-BXE4L52Q.js.map +0 -1
  189. package/dist/chunk-D4QHRVDJ.js.map +0 -1
  190. package/dist/chunk-D5GBYKDU.js +0 -164
  191. package/dist/chunk-D5GBYKDU.js.map +0 -1
  192. package/dist/chunk-DENZLZ3Z.js.map +0 -1
  193. package/dist/chunk-FHJIH6XP.js.map +0 -1
  194. package/dist/chunk-GMLOAKOA.js.map +0 -1
  195. package/dist/chunk-LWBNHK72.js.map +0 -1
  196. package/dist/chunk-PACZEDOH.js.map +0 -1
  197. package/dist/chunk-Q76T6Y6X.js.map +0 -1
  198. package/dist/chunk-RQPEKHZH.js.map +0 -1
  199. package/dist/chunk-RWXR3GJI.js +0 -441
  200. package/dist/chunk-RWXR3GJI.js.map +0 -1
  201. package/dist/chunk-S5G6T4VC.js +0 -3200
  202. package/dist/chunk-S5G6T4VC.js.map +0 -1
  203. package/dist/chunk-SSQZB5SQ.js.map +0 -1
  204. package/dist/chunk-UP6NBQ62.js +0 -2
  205. package/dist/chunk-ZPLVANY2.js +0 -15
  206. package/dist/chunk-ZPLVANY2.js.map +0 -1
  207. package/dist/cli-AVHLY2AI.js.map +0 -1
  208. package/dist/cli-LP5OE3BL.js +0 -84
  209. package/dist/cli-LP5OE3BL.js.map +0 -1
  210. package/dist/cli-MQXOK64K.js.map +0 -1
  211. package/dist/github-6GYTPSGV.js +0 -35
  212. package/dist/github-DJOLVNDD.js +0 -31
  213. package/dist/github-ZF2TQ3RP.js +0 -35
  214. package/dist/json-Y7625EFE.js +0 -42
  215. package/dist/lint-RF3B55W7.js +0 -35
  216. package/dist/list-5DW4QZ7P.js +0 -36
  217. package/dist/list-7CHWJ633.js +0 -39
  218. package/dist/list-UNWG6NPD.js +0 -33
  219. package/dist/pretty-XGYQ25PH.js +0 -43
  220. package/dist/run-MHJ3AYKG.js +0 -39
  221. package/dist/sarif-MIEMQOIK.js +0 -30
  222. package/dist/sarif-RGRG7VFX.js +0 -36
  223. package/dist/strategy-EK5VY5DG.js.map +0 -1
  224. package/dist/validate-QDYQ642J.js.map +0 -1
  225. /package/dist/{batch-C534YIAU.js.map → batch-C3NN2YXB.js.map} +0 -0
  226. /package/dist/{build-SVKT7QFU.js.map → build-CEVEAHN7.js.map} +0 -0
  227. /package/dist/{calibrate-AL3MH7TY.js.map → calibrate-CSKPY5AK.js.map} +0 -0
  228. /package/dist/{capture-2F7B4DAD.js.map → capture-3HDBIHH6.js.map} +0 -0
  229. /package/dist/{check-BI7OGIVE.js.map → check-555TCJGF.js.map} +0 -0
  230. /package/dist/{check-JZINDP3F.js.map → check-KGJBV42O.js.map} +0 -0
  231. /package/dist/{check-OPUMZEVK.js.map → check-KXWHSCCR.js.map} +0 -0
  232. /package/dist/{check-OW7UD73D.js.map → check-MZSXCS2M.js.map} +0 -0
  233. /package/dist/{check-LKPQPQWJ.js.map → check-QNHLTYPN.js.map} +0 -0
  234. /package/dist/{chunk-AE6KBAAU.js.map → chunk-2VLZDU4E.js.map} +0 -0
  235. /package/dist/{chunk-ARNI3SJT.js.map → chunk-37Q7WEJJ.js.map} +0 -0
  236. /package/dist/{chunk-PTGXEZQD.js.map → chunk-3ZVRGBK6.js.map} +0 -0
  237. /package/dist/{chunk-DMVBIIP3.js.map → chunk-46MMIJWR.js.map} +0 -0
  238. /package/dist/{chunk-CREFJCWZ.js.map → chunk-4LYVTR2T.js.map} +0 -0
  239. /package/dist/{chunk-TFVNEPMF.js.map → chunk-64DULZIG.js.map} +0 -0
  240. /package/dist/{chunk-2HOWRAWK.js.map → chunk-6SVHI2U6.js.map} +0 -0
  241. /package/dist/{chunk-XI3BNZG4.js.map → chunk-A67EJ3J6.js.map} +0 -0
  242. /package/dist/{chunk-HHJ2HFPP.js.map → chunk-BLDL23RY.js.map} +0 -0
  243. /package/dist/{chunk-CFMI74TP.js.map → chunk-BZ74YUYE.js.map} +0 -0
  244. /package/dist/{chunk-5UJKXOAD.js.map → chunk-CHTSA3YR.js.map} +0 -0
  245. /package/dist/{chunk-IN5T22FP.js.map → chunk-CQTESLC5.js.map} +0 -0
  246. /package/dist/{chunk-245W2Q7C.js.map → chunk-D4BGNAN5.js.map} +0 -0
  247. /package/dist/{chunk-762MM6NA.js.map → chunk-E3HYSNS6.js.map} +0 -0
  248. /package/dist/{chunk-DPDG3FHL.js.map → chunk-EL2KNRC3.js.map} +0 -0
  249. /package/dist/{chunk-KCWNJMSS.js.map → chunk-FXE5K56B.js.map} +0 -0
  250. /package/dist/{chunk-CLPC3LKX.js.map → chunk-HYEKQ22B.js.map} +0 -0
  251. /package/dist/{chunk-VLRIP4BQ.js.map → chunk-IC3FJWIF.js.map} +0 -0
  252. /package/dist/{chunk-CZIO37J5.js.map → chunk-IDDRHB7E.js.map} +0 -0
  253. /package/dist/{chunk-BHGFLRXM.js.map → chunk-JA7DWOVV.js.map} +0 -0
  254. /package/dist/{chunk-MTCOBRCX.js.map → chunk-JVE5YQN4.js.map} +0 -0
  255. /package/dist/{chunk-IOJD2RFG.js.map → chunk-MR5JWMC2.js.map} +0 -0
  256. /package/dist/{chunk-JCTHXG33.js.map → chunk-NHOGTAPK.js.map} +0 -0
  257. /package/dist/{chunk-VM7VAFJW.js.map → chunk-NVYDWVXN.js.map} +0 -0
  258. /package/dist/{chunk-NLJ3XIKT.js.map → chunk-O6IDYZVW.js.map} +0 -0
  259. /package/dist/{chunk-E23KWEPL.js.map → chunk-OHMLEITS.js.map} +0 -0
  260. /package/dist/{chunk-NUQF5F5J.js.map → chunk-PNDEKFF3.js.map} +0 -0
  261. /package/dist/{chunk-3SFAB75L.js.map → chunk-PX7OTUNU.js.map} +0 -0
  262. /package/dist/{chunk-H5YWCCBO.js.map → chunk-S7V4F7HC.js.map} +0 -0
  263. /package/dist/{chunk-R2CR62JV.js.map → chunk-SCKVDD4E.js.map} +0 -0
  264. /package/dist/{chunk-JUUCCML3.js.map → chunk-TJYJ4BNK.js.map} +0 -0
  265. /package/dist/{chunk-22WGKOQ7.js.map → chunk-TWYJ2TVS.js.map} +0 -0
  266. /package/dist/{chunk-U4OJ7U45.js.map → chunk-UQI463L3.js.map} +0 -0
  267. /package/dist/{chunk-A4QNKEX4.js.map → chunk-V27DOGAO.js.map} +0 -0
  268. /package/dist/{chunk-YSZNJ2ID.js.map → chunk-VSHMXMBZ.js.map} +0 -0
  269. /package/dist/{chunk-2NGFDLIM.js.map → chunk-VZSATUI7.js.map} +0 -0
  270. /package/dist/{chunk-KQDRO6N6.js.map → chunk-W5OZMYMX.js.map} +0 -0
  271. /package/dist/{chunk-XBJKYXOR.js.map → chunk-WW4JATBJ.js.map} +0 -0
  272. /package/dist/{chunk-KBSTXL6L.js.map → chunk-XQKRD5A3.js.map} +0 -0
  273. /package/dist/{chunk-2YKUSTHS.js.map → chunk-XSP3TUFN.js.map} +0 -0
  274. /package/dist/{chunk-BJUEOC4G.js.map → chunk-YB3KD5RI.js.map} +0 -0
  275. /package/dist/{chunk-OWJLB2AF.js.map → chunk-ZKIXGFID.js.map} +0 -0
  276. /package/dist/{chunk-WHVFHBL3.js.map → chunk-ZT3ERG4B.js.map} +0 -0
  277. /package/dist/{chunk-V2XJJEEF.js.map → chunk-ZW4YASUB.js.map} +0 -0
  278. /package/dist/{chunk-UP6NBQ62.js.map → cli-4QAH3DBX.js.map} +0 -0
  279. /package/dist/{cli-FSDJY5OC.js.map → cli-JE4LG35H.js.map} +0 -0
  280. /package/dist/{cli-MOKRUHZT.js.map → config-2YJPJ36T.js.map} +0 -0
  281. /package/dist/{config-BMWDC66C.js.map → github-64ZVAUIT.js.map} +0 -0
  282. /package/dist/{github-6GYTPSGV.js.map → github-ARGPMQD2.js.map} +0 -0
  283. /package/dist/{github-DJOLVNDD.js.map → github-YHJABBUI.js.map} +0 -0
  284. /package/dist/{github-ZF2TQ3RP.js.map → host-JT27OWTC.js.map} +0 -0
  285. /package/dist/{host-YSTYO5DX.js.map → json-CVOVXB7O.js.map} +0 -0
  286. /package/dist/{json-Y7625EFE.js.map → json-QNGJFUY2.js.map} +0 -0
  287. /package/dist/{json-YIK72XAL.js.map → lint-OQGB4DWJ.js.map} +0 -0
  288. /package/dist/{lint-RF3B55W7.js.map → list-EDAB7X5Y.js.map} +0 -0
  289. /package/dist/{list-5DW4QZ7P.js.map → list-OQ3IYV2W.js.map} +0 -0
  290. /package/dist/{list-7CHWJ633.js.map → list-PN6JKYNX.js.map} +0 -0
  291. /package/dist/{list-UNWG6NPD.js.map → page-TPNMHL27.js.map} +0 -0
  292. /package/dist/{page-OMPEACUN.js.map → pretty-EZ2NFU3C.js.map} +0 -0
  293. /package/dist/{pretty-PPNHHOEN.js.map → pretty-HO2LYG5N.js.map} +0 -0
  294. /package/dist/{pretty-U7ATCFBN.js.map → pretty-K3M4AW2D.js.map} +0 -0
  295. /package/dist/{pretty-XGYQ25PH.js.map → provider-YWNTTQPA.js.map} +0 -0
  296. /package/dist/{release-VHHASAG7.js.map → release-EFLQT3FW.js.map} +0 -0
  297. /package/dist/{provider-JY2I3VLF.js.map → reporters-4R2E7PRJ.js.map} +0 -0
  298. /package/dist/{reporters-FAIEOTC4.js.map → reporters-YVLLFBO5.js.map} +0 -0
  299. /package/dist/{reporters-KE7AZR6C.js.map → run-H4BOR2FR.js.map} +0 -0
  300. /package/dist/{run-MHJ3AYKG.js.map → sarif-GWHWJJFP.js.map} +0 -0
  301. /package/dist/{sarif-DOGRSGTB.js.map → sarif-SJFVSOBV.js.map} +0 -0
  302. /package/dist/{sarif-MIEMQOIK.js.map → sarif-YBFD5OUL.js.map} +0 -0
  303. /package/dist/{sarif-RGRG7VFX.js.map → validate-6R5UBDGU.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lint/cli.ts"],"sourcesContent":["/**\n * The lint program. Named `lint` because that is where it is mounted\n * (`manni lint …`); `src/cli.ts` adds it to the umbrella and runs it. Thin\n * commander wrapper over the command cores. Follows clig.dev: primary output to\n * stdout, diagnostics to stderr, color only on a TTY (and never under\n * NO_COLOR/--no-color), meaningful exit codes.\n *\n * Grammar per proposal 0034: the verbs are `check`, `structure`, `templates`\n * and `tools`, and there is no default subcommand, so a bare `manni lint` is a\n * usage error that lists them. `check` runs every configured job; `structure`\n * runs one of them, and carries the options that belong to the tool performing\n * it.\n *\n * Exit codes are the contract CI reads:\n * 0 every file linted clean\n * 1 the run produced findings\n * 2 the tool could not do its job - bad usage, missing template, unreadable\n * input. A LintError is always this, never a lint failure.\n *\n * The 1/2 split is what lets a workflow tell \"the docs are wrong\" apart from\n * \"the linter is misconfigured\", which a single non-zero exit cannot.\n */\nimport { Command } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport {\n collect,\n configOption,\n explicitFalse,\n readStdin,\n reportConfig,\n splitList,\n} from \"../shared/cli-options.js\";\nimport { shouldColor } from \"../shared/color.js\";\nimport { fail } from \"../shared/run.js\";\nimport { notice } from \"../shared/warn.js\";\nimport {\n OMITTED_WHEN_CLEAN,\n REPORT_FORMAT_LIST,\n STDIN_TOKEN,\n} from \"../meta/internal.js\";\nimport {\n REPORT_FORMATS,\n isReportFormat,\n type ReportFormat as FamilyFormat,\n} from \"../meta/index.js\";\nimport { LintError } from \"./types.js\";\nimport { runLint } from \"./commands/lint.js\";\nimport {\n runTemplateShow,\n runTemplates,\n runTemplatesInfer,\n} from \"./commands/templates.js\";\nimport { runTools } from \"./commands/tools.js\";\nimport { INFER_FORMATS, isInferFormat, type InferFormat } from \"./core/infer.js\";\nimport {\n LINT_JOBS,\n TOOLS_BY_JOB,\n loadConfig,\n rebaseConfig,\n} from \"./core/config.js\";\nimport { resolveStructureTool } from \"./tools/index.js\";\nimport {\n render,\n renderTemplates,\n renderTools,\n type ListFormat,\n type ReportFormat,\n} from \"./reporters/index.js\";\nimport {\n SHOW_FORMATS,\n isShowFormat,\n renderTemplateShow,\n type ShowFormat,\n} from \"./reporters/template-show.js\";\n\n/** The options `check` and `structure` share, in the family's spelling. */\ninterface InputCliOptions {\n /** `--collection <name>`, repeatable; commander's default value is `[]`. */\n collection: string[];\n /** `--ext <list>`; the command splits it. */\n ext?: string;\n /** `--exclude <glob>`, repeatable; commander's default value is `[]`. */\n exclude: string[];\n /** `--as <format>`: force a parser. */\n as?: string;\n /**\n * `-c, --config <path>` and `--no-config` share one commander attribute:\n * `undefined` with neither flag, the path with `-c`, `false` with\n * `--no-config`. Split by `configOption`.\n */\n config?: string | boolean;\n allowEmpty?: boolean;\n /** `--no-gitignore`. */\n gitignore: boolean;\n /** `-f, --format <format>`. Always a string: the declaration has a default. */\n format: string;\n}\n\n/** `structure` adds the options of the tool that performs the job. */\ninterface StructureCliOptions extends InputCliOptions {\n tool?: string;\n template?: string;\n /** `--templates <path>`, repeatable; commander's default value is `[]`. */\n templates: string[];\n explain?: boolean;\n}\n\n/** What commander parses for `templates`. */\ninterface TemplatesCommandOptions {\n templates: string[];\n config?: string | boolean;\n format: string;\n}\n\n/** What commander parses for `templates infer`. */\ninterface TemplatesInferCliOptions {\n as?: string;\n name?: string;\n config?: string | boolean;\n format: string;\n out?: string;\n force?: boolean;\n}\n\n/** What commander parses for `tools`. */\ninterface ToolsCommandOptions {\n config?: string | boolean;\n format: string;\n}\n\n// `explain` is reachable through `--explain`, not `-f`: it reports on\n// configuration rather than on documents, and offering it as a format would\n// invite `-f explain` alongside a lint that then never happens. The `-f` set\n// itself is the family's, from meta, rather than a fourth hand-kept copy of\n// the same five words.\nconst LIST_FORMATS = new Set<string>([\"pretty\", \"json\"]);\n\n/** The heading the tool's own options print under, after the shared ones. */\nconst TOOL_OPTIONS_GROUP = \"Tool options:\";\n\nfunction resolveColor(program: Command): boolean {\n // commander maps --no-color to opts.color === false.\n const noColor = program.opts().color === false;\n return shouldColor({ noColor, isTTY: process.stdout.isTTY });\n}\n\nfunction reportFormat(value: unknown): FamilyFormat {\n const format = String(value);\n if (!isReportFormat(format)) {\n throw new LintError(\n `Unknown --format \"${format}\". Use ${REPORT_FORMAT_LIST}.`,\n );\n }\n return format;\n}\n\n/**\n * Whether a clean run may print nothing at all in this format.\n *\n * Only `github` may: an empty annotation stream is a clean check. Every other\n * format owes its envelope - an empty JSON array, a SARIF log with no results,\n * a JUnit suite of passing testcases - because a consumer parsing stdout must\n * not have to treat \"no output\" as a third outcome. `explain` is never clean\n * or dirty; it always has something to say.\n */\nfunction omittedWhenClean(format: ReportFormat): boolean {\n return format !== \"explain\" && OMITTED_WHEN_CLEAN.has(format);\n}\n\nfunction listFormat(value: unknown): ListFormat {\n const format = String(value);\n if (!LIST_FORMATS.has(format)) {\n throw new LintError(\n `Unknown --format \"${format}\". Use pretty or json.`,\n );\n }\n return format as ListFormat;\n}\n\n/**\n * `templates infer -f`: the format a *template file* is written in, which is\n * not the set a report is rendered in. A template is YAML or JSON because those\n * are the two the loader reads back, and `pretty` would name a third thing the\n * tool cannot then load.\n */\nfunction inferFormat(value: unknown): InferFormat {\n const format = String(value);\n if (!isInferFormat(format)) {\n throw new LintError(`Unknown --format \"${format}\". Use yaml or json.`);\n }\n return format;\n}\n\n/** `templates show -f`: a report, a template's data, or a page skeleton. */\nfunction showFormat(value: unknown): ShowFormat {\n const format = String(value);\n if (!isShowFormat(format)) {\n throw new LintError(\n `Unknown --format \"${format}\". Use pretty, json or markdown.`,\n );\n }\n return format;\n}\n\n/**\n * `--tool <name>`: which tool performs the structure job. Refused by name\n * rather than ignored, because falling through to manni's engine would lint\n * with something other than what was asked for and say nothing.\n *\n * The refusal is the registry's, not a second copy of it here. `runLint`\n * refuses the same name with the same sentence for a caller that never touches\n * commander; this one fires first, so a bad `--tool` is reported before the\n * run asks what it was pointed at.\n */\nfunction assertStructureTool(value: string | undefined): void {\n if (value === undefined) return;\n resolveStructureTool(value);\n}\n\n/**\n * `-c/--config` and `--no-config`, in one place.\n *\n * Every verb here takes them, and they had been written out three times. A flag\n * two commands both have carries the same name *and* the same description, so\n * the declaration is shared rather than copied - which is what kept the fourth\n * copy, on `templates infer`, from spelling either of them slightly differently.\n */\nfunction withConfigOptions(command: Command): Command {\n return command\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\");\n}\n\n/**\n * The value of a flag a command and its parent both declare.\n *\n * Commander keeps parsing a parent's options past a subcommand name unless\n * `enablePositionalOptions()` is on, so `templates infer page.md -f json` sets\n * `format` on `templates` and leaves `infer` holding its own default. Both\n * commands declare `-f`, `-c` and `--no-config`, because \"commands must have\n * parallel behaviors\" and `infer` must list them in its own `--help`.\n *\n * Turning positional options on would fix it and move every other flag in this\n * program with it: `manni lint structure docs/ --no-color` is a root option\n * written after its command, and there are three more like it. So the lookup\n * changes instead. The nearest command actually *given* the flag wins, and the\n * subcommand's own default is the fallback - which is the reading a person\n * typing the line already has.\n */\nfunction optionValue(command: Command, key: string): unknown {\n for (\n let cmd: Command | null = command;\n cmd !== null;\n cmd = cmd.parent ?? null\n ) {\n if (cmd.getOptionValueSource(key) === \"cli\") return cmd.getOptionValue(key);\n }\n return command.getOptionValue(key);\n}\n\n/** The options every job verb takes, in one place so the two cannot drift. */\nfunction withInputOptions(command: Command): Command {\n command\n .argument(\n \"[paths...]\",\n \"files, directories, or globs to lint (use - for stdin)\",\n )\n .option(\n \"--collection <name>\",\n \"configured collection to run over; repeatable\",\n collect,\n [],\n )\n .option(\"--ext <list>\", \"comma-separated extensions for directory walks\")\n .option(\"--exclude <glob>\", \"glob to exclude; repeatable\", collect, [])\n .option(\"--as <format>\", \"force an input format (e.g. markdown, mdx)\")\n .option(\n \"-f, --format <format>\",\n `output: ${REPORT_FORMATS.join(\" | \")}`,\n \"pretty\",\n );\n return withConfigOptions(command)\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"--no-gitignore\", \"lint files .gitignore covers\");\n}\n\n/** The lint options every job verb turns its shared flags into. */\nfunction inputOptions(\n paths: string[],\n options: InputCliOptions,\n): {\n inputs: string[];\n collection: string[];\n exts?: string[];\n exclude: string[];\n as?: string;\n configPath?: string;\n noConfig?: boolean;\n allowEmpty?: boolean;\n respectGitignore?: boolean;\n onNotice: (message: string) => void;\n} {\n return {\n inputs: paths,\n collection: options.collection,\n ...(options.ext ? { exts: splitList(options.ext) } : {}),\n exclude: options.exclude,\n ...(options.as === undefined ? {} : { as: options.as }),\n ...configOption(options.config),\n // `undefined` rather than `false` when absent, so config still wins.\n ...(options.allowEmpty ? { allowEmpty: true } : {}),\n respectGitignore: explicitFalse(options.gitignore),\n onNotice: notice,\n };\n}\n\nexport function buildProgram(): Command {\n const program = new Command();\n program\n .name(\"lint\")\n .description(\n \"Validate document structure against doctype templates. Deterministic, CI-friendly.\",\n )\n .version(pkg.version, \"-V, --version\")\n .option(\"--no-color\", \"disable colored output\")\n .showHelpAfterError()\n // Exit code 1 is reserved for \"the docs are wrong\". Commander exits 1 on a\n // usage error by default, which would make a typo'd flag look exactly like\n // a failing lint to a workflow. With no callback, commander throws the\n // CommanderError instead, and the umbrella's runner maps it: help and\n // --version stay 0, every other usage error becomes 2. Commander has\n // already written its own message. This has to precede .command(), which\n // copies the callback into each subcommand.\n .exitOverride();\n\n /** Run one lint, render it, and settle the exit code. Both job verbs share it. */\n const lint = async (\n paths: string[],\n options: StructureCliOptions | InputCliOptions,\n command: Command,\n job: { tool?: StructureCliOptions } = {},\n ): Promise<void> => {\n const tool = job.tool;\n const format = reportFormat(options.format);\n const explain = tool?.explain === true;\n const stdinContent = paths.includes(STDIN_TOKEN) ? await readStdin() : undefined;\n const cwd = process.cwd();\n\n const run = await runLint({\n ...inputOptions(paths, options),\n ...(tool?.tool === undefined ? {} : { tool: tool.tool }),\n ...(tool?.template === undefined ? {} : { template: tool.template }),\n ...(tool && tool.templates.length > 0 ? { templates: tool.templates } : {}),\n ...(explain ? { explain: true } : {}),\n ...(stdinContent === undefined ? {} : { stdinContent }),\n // Which config governed the run, said where a report cannot be parsed\n // around: discovery walks up to the project boundary, so an unexpected\n // ancestor config is the difference between a five-minute diagnosis and\n // an hour of confusion.\n onConfigLoaded: reportConfig(format === \"pretty\", cwd),\n });\n\n const color = resolveColor(command.parent ?? command);\n const chosen: ReportFormat = explain ? \"explain\" : format;\n const text = render(run, chosen, { color });\n if (text.length > 0 || !omittedWhenClean(chosen)) {\n process.stdout.write(`${text}\\n`);\n }\n // `--explain` answers a question about configuration, so its exit code\n // reports whether it could answer it - not whether the docs are clean.\n //\n // That covers routing failures too: a page whose `type` matches no\n // template is a answered question, not an unanswered one, so it exits 0\n // like everything else here. Automation must not read this code as\n // \"everything routed\" - the ordinary run is what reports that, with exit\n // 1. Said in `--help` and the README, because the distinction is invisible\n // from the exit code alone.\n process.exitCode = explain ? 0 : run.summary.failed > 0 ? 1 : 0;\n };\n\n withInputOptions(\n program\n .command(\"check\")\n .description(\"Run every configured lint job over the given files/dirs/globs\"),\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Jobs: structure.\",\n \"\",\n \"Examples:\",\n \" manni lint check docs/ # every configured job\",\n \" manni lint check # targets from collections:\",\n \" manni lint check --collection guides\",\n ' manni lint check \"**/*.md\" -f github # CI annotations',\n \" cat page.md | manni lint check - --as markdown\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: InputCliOptions, command: Command) => {\n try {\n // Which jobs this run covered, said once, beside the config line. The\n // full form also names the jobs that exist and are not configured;\n // `structure` is the only job there is, so today it is one word.\n if (options.format === \"pretty\") {\n process.stderr.write(`Checked: ${LINT_JOBS.join(\", \")}.\\n`);\n }\n await lint(paths, options, command);\n } catch (err) {\n fail(err);\n }\n });\n\n const structure = withInputOptions(\n program\n .command(\"structure\")\n .description(\n \"Lint document structure against doctype templates, routing each page by its `type`\",\n ),\n );\n structure\n .optionsGroup(TOOL_OPTIONS_GROUP)\n .option(\n \"--tool <name>\",\n `tool that performs the job: ${TOOLS_BY_JOB.structure.join(\", \")}`,\n )\n .option(\n \"-t, --template <ref>\",\n \"apply this template to every file, overriding type routing\",\n )\n .option(\n \"--templates <path>\",\n \"template file to route by: its `types:` win over built-ins; repeatable\",\n collect,\n [],\n )\n .option(\n \"--explain\",\n \"print how each file's template was chosen, and lint nothing (always exits 0, unrouted pages included)\",\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni lint structure docs/ # route each page by its `type`\",\n \" manni lint structure docs/ --templates ./templates.yaml # add your own templates\",\n \" manni lint structure # targets from collections:\",\n \" manni lint structure docs/ --explain # show why each page routed where\",\n \" manni lint structure page.md -t tgdp:how-to:1.6 # force one template\",\n ' manni lint structure \"**/*.md\" -f github # CI annotations',\n \" manni lint structure docs/ --exclude '**/drafts/**'\",\n \" cat page.md | manni lint structure - -t tgdp:how-to:1.6 --as markdown\",\n ].join(\"\\n\"),\n )\n .action(\n async (paths: string[], options: StructureCliOptions, command: Command) => {\n try {\n assertStructureTool(options.tool);\n await lint(paths, options, command, { tool: options });\n } catch (err) {\n fail(err);\n }\n },\n );\n\n const templates = program\n .command(\"templates\")\n .description(\"List the templates that can be applied, and the types they serve\")\n .option(\n \"--templates <path>\",\n \"also list the templates in this file; repeatable\",\n collect,\n [],\n );\n withConfigOptions(templates)\n .option(\"-f, --format <format>\", \"output: pretty | json\", \"pretty\")\n .action(async (options: TemplatesCommandOptions, command: Command) => {\n try {\n const format = listFormat(options.format);\n // The listing answers \"what could route a page?\", so it has to see the\n // same template files a lint would - rebased the same way, or it would\n // answer for a different set of files depending on where it was run.\n const { configPath, noConfig } = configOption(options.config);\n const found = noConfig ? null : await loadConfig(configPath);\n const info = await runTemplates({\n templates:\n options.templates.length > 0\n ? options.templates\n : rebaseConfig(found).templates,\n });\n const color = resolveColor(command.parent ?? command);\n process.stdout.write(`${renderTemplates(info, format, { color })}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n\n const inferCommand = templates\n .command(\"infer\")\n .description(\"Write a first template from a page that already has the shape you want\")\n .argument(\"<page>\", \"one file to infer from (use - for stdin)\")\n .option(\"--as <format>\", \"force an input format (e.g. markdown, mdx)\")\n .option(\n \"--name <name>\",\n \"name for the template; defaults to the page's `type`, else its filename\",\n )\n .option(\"-f, --format <format>\", `output: ${INFER_FORMATS.join(\" | \")}`, \"yaml\")\n .option(\"-o, --out <path>\", \"write the template here instead of to stdout\")\n .option(\"--force\", \"overwrite the --out path\");\n withConfigOptions(inferCommand)\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni lint templates infer docs/guides/install.md\",\n \" manni lint templates infer docs/guides/install.md --name how-to\",\n \" manni lint templates infer page.mdx -f json\",\n \" manni lint templates infer page.md -o ./templates.yaml\",\n \" manni lint templates infer page.md -o ./templates.yaml --force\",\n \" cat page.md | manni lint templates infer - --as markdown\",\n \"\",\n \"One page, and every rule it writes is exactly one occurrence: a single\",\n \"page cannot show what varies. Loosening a heading into a list or a\",\n \"pattern, setting `min: 0`, and adding a trailing rule with no heading\",\n \"for the sections that may follow are your edits to make.\",\n ].join(\"\\n\"),\n )\n .action(\n async (\n page: string,\n options: TemplatesInferCliOptions,\n command: Command,\n ) => {\n try {\n // `-f`, `-c` and `--no-config` are read through `optionValue`: the\n // parent `templates` declares all three, and commander hands it any\n // of them typed after `infer`.\n const format = inferFormat(optionValue(command, \"format\"));\n const { configPath, noConfig } = configOption(\n optionValue(command, \"config\"),\n );\n const stdinContent =\n page === STDIN_TOKEN ? await readStdin() : undefined;\n const result = await runTemplatesInfer({\n page,\n format,\n ...(options.as === undefined ? {} : { as: options.as }),\n ...(options.name === undefined ? {} : { name: options.name }),\n ...(options.out === undefined ? {} : { out: options.out }),\n ...(options.force === undefined ? {} : { force: options.force }),\n ...(configPath === undefined ? {} : { configPath }),\n ...(noConfig === undefined ? {} : { noConfig }),\n ...(stdinContent === undefined ? {} : { stdinContent }),\n // The template is the primary output, so with no --out it owns\n // stdout and the config line goes to stderr beside it. With --out\n // stdout is free, and the line still belongs on stderr: a reader\n // piping nothing is not a reason to move a diagnostic.\n onConfigLoaded: reportConfig(false, process.cwd()),\n });\n\n if (result.written === undefined) {\n process.stdout.write(result.text);\n return;\n }\n // Said on stderr, so `-o` leaves stdout empty for a shell that is\n // watching it, and the template file is the whole output.\n process.stderr.write(\n `Wrote template \"${result.name}\" to ${result.written}\\n`,\n );\n } catch (err) {\n fail(err);\n }\n },\n );\n\n templates\n .command(\"show\")\n .description(\n \"Print what a template asks for: each section, how often it may occur, what it must contain, and what it is for\",\n )\n .argument(\n \"<ref>\",\n \"template to show: a built-in id, a path, a path#name, or a URL\",\n )\n .option(\"-f, --format <format>\", `output: ${SHOW_FORMATS.join(\" | \")}`, \"pretty\")\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni lint templates show tgdp:how-to:1.6\",\n \" manni lint templates show ./templates.yaml#how-to\",\n \" manni lint templates show tgdp:reference:1.6 -f json\",\n \" manni lint templates show tgdp:how-to:1.6 -f markdown > docs/rotate-key.md\",\n ].join(\"\\n\"),\n )\n .action(async (ref: string, _options: unknown, command: Command) => {\n try {\n // `-f` is read through `optionValue`: the parent `templates` declares\n // it too, and commander hands it any `-f` typed after `show`.\n const format = showFormat(optionValue(command, \"format\"));\n const show = await runTemplateShow({ ref });\n const color = resolveColor(program);\n process.stdout.write(`${renderTemplateShow(show, format, { color })}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n\n withConfigOptions(\n program\n .command(\"tools\")\n .description(\n \"List the lint jobs, the tool that performs each, and what it reads\",\n ),\n )\n .option(\"-f, --format <format>\", \"output: pretty | json\", \"pretty\")\n .action(async (options: ToolsCommandOptions, command: Command) => {\n try {\n const format = listFormat(options.format);\n const tools = await runTools(configOption(options.config));\n const color = resolveColor(command.parent ?? command);\n process.stdout.write(`${renderTools(tools, format, { color })}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n\n return program;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,eAAe;AAiHxB,IAAM,eAAe,oBAAI,IAAY,CAAC,UAAU,MAAM,CAAC;AAGvD,IAAM,qBAAqB;AAE3B,SAAS,aAAa,SAA2B;AAE/C,QAAM,UAAU,QAAQ,KAAK,EAAE,UAAU;AACzC,SAAO,YAAY,EAAE,SAAS,OAAO,QAAQ,OAAO,MAAM,CAAC;AAC7D;AAEA,SAAS,a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AA,IACV;AAAA,EACF,CAAC;AAEH;AAAA,IACE,QACG,QAAQ,OAAO,EACf;AAAA,MACC;AAAA,IACF;AAAA,EACJ,EACG,OAAO,yBAAyB,yBAAyB,QAAQ,EACjE,OAAO,OAAO,SAA8B,YAAqB;AAChE,QAAI;AACF,YAAM,SAAS,WAAW,QAAQ,MAAM;AACxC,YAAM,QAAQ,MAAM,SAAS,aAAa,QAAQ,MAAM,CAAC;AACzD,YAAM,QAAQ,aAAa,QAAQ,UAAU,OAAO;AACpD,cAAQ,OAAO,MAAM,GAAG,YAAY,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAC;AAAA,CAAI;AAAA,IACnE,SAAS,KAAK;AACZ,WAAK,GAAG;AAAA,IACV;AAAA,EACF,CAAC;AAEH,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/lint/cli.ts"],"sourcesContent":["/**\n * The lint program. Named `lint` because that is where it is mounted\n * (`manni lint …`); `src/cli.ts` adds it to the umbrella and runs it. Thin\n * commander wrapper over the command cores. Follows clig.dev: primary output to\n * stdout, diagnostics to stderr, color only on a TTY (and never under\n * NO_COLOR/--no-color), meaningful exit codes.\n *\n * Grammar per proposal 0034: the verbs are `check`, `structure`, `templates`\n * and `tools`, and there is no default subcommand, so a bare `manni lint` is a\n * usage error that lists them. `check` runs every configured job; `structure`\n * runs one of them, and carries the options that belong to the tool performing\n * it.\n *\n * Exit codes are the contract CI reads:\n * 0 every file linted clean\n * 1 the run produced findings\n * 2 the tool could not do its job - bad usage, missing template, unreadable\n * input. A LintError is always this, never a lint failure.\n *\n * The 1/2 split is what lets a workflow tell \"the docs are wrong\" apart from\n * \"the linter is misconfigured\", which a single non-zero exit cannot.\n */\nimport { Command } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport {\n collect,\n configOption,\n explicitFalse,\n readStdin,\n reportConfig,\n splitList,\n} from \"../shared/cli-options.js\";\nimport { shouldColor } from \"../shared/color.js\";\nimport { fail } from \"../shared/run.js\";\nimport { notice } from \"../shared/warn.js\";\nimport {\n OMITTED_WHEN_CLEAN,\n REPORT_FORMAT_LIST,\n STDIN_TOKEN,\n} from \"../meta/internal.js\";\nimport {\n REPORT_FORMATS,\n isReportFormat,\n type ReportFormat as FamilyFormat,\n} from \"../meta/index.js\";\nimport { LintError } from \"./types.js\";\nimport { runLint } from \"./commands/lint.js\";\nimport {\n runTemplateShow,\n runTemplates,\n runTemplatesInfer,\n} from \"./commands/templates.js\";\nimport { runTools } from \"./commands/tools.js\";\nimport { INFER_FORMATS, isInferFormat, type InferFormat } from \"./core/infer.js\";\nimport {\n LINT_JOBS,\n TOOLS_BY_JOB,\n loadConfig,\n rebaseConfig,\n} from \"./core/config.js\";\nimport { resolveStructureTool } from \"./tools/index.js\";\nimport {\n render,\n renderTemplates,\n renderTools,\n type ListFormat,\n type ReportFormat,\n} from \"./reporters/index.js\";\nimport {\n SHOW_FORMATS,\n isShowFormat,\n renderTemplateShow,\n type ShowFormat,\n} from \"./reporters/template-show.js\";\n\n/** The options `check` and `structure` share, in the family's spelling. */\ninterface InputCliOptions {\n /** `--collection <name>`, repeatable; commander's default value is `[]`. */\n collection: string[];\n /** `--ext <list>`; the command splits it. */\n ext?: string;\n /** `--exclude <glob>`, repeatable; commander's default value is `[]`. */\n exclude: string[];\n /** `--as <format>`: force a parser. */\n as?: string;\n /**\n * `-c, --config <path>` and `--no-config` share one commander attribute:\n * `undefined` with neither flag, the path with `-c`, `false` with\n * `--no-config`. Split by `configOption`.\n */\n config?: string | boolean;\n allowEmpty?: boolean;\n /** `--no-gitignore`. */\n gitignore: boolean;\n /** `-f, --format <format>`. Always a string: the declaration has a default. */\n format: string;\n}\n\n/** `structure` adds the options of the tool that performs the job. */\ninterface StructureCliOptions extends InputCliOptions {\n tool?: string;\n template?: string;\n /** `--templates <path>`, repeatable; commander's default value is `[]`. */\n templates: string[];\n explain?: boolean;\n}\n\n/** What commander parses for `templates`. */\ninterface TemplatesCommandOptions {\n templates: string[];\n config?: string | boolean;\n format: string;\n}\n\n/** What commander parses for `templates infer`. */\ninterface TemplatesInferCliOptions {\n as?: string;\n name?: string;\n config?: string | boolean;\n format: string;\n out?: string;\n force?: boolean;\n}\n\n/** What commander parses for `tools`. */\ninterface ToolsCommandOptions {\n config?: string | boolean;\n format: string;\n}\n\n// `explain` is reachable through `--explain`, not `-f`: it reports on\n// configuration rather than on documents, and offering it as a format would\n// invite `-f explain` alongside a lint that then never happens. The `-f` set\n// itself is the family's, from meta, rather than a fourth hand-kept copy of\n// the same five words.\nconst LIST_FORMATS = new Set<string>([\"pretty\", \"json\"]);\n\n/** The heading the tool's own options print under, after the shared ones. */\nconst TOOL_OPTIONS_GROUP = \"Tool options:\";\n\nfunction resolveColor(program: Command): boolean {\n // commander maps --no-color to opts.color === false.\n const noColor = program.opts().color === false;\n return shouldColor({ noColor, isTTY: process.stdout.isTTY });\n}\n\nfunction reportFormat(value: unknown): FamilyFormat {\n const format = String(value);\n if (!isReportFormat(format)) {\n throw new LintError(\n `Unknown --format \"${format}\". Use ${REPORT_FORMAT_LIST}.`,\n );\n }\n return format;\n}\n\n/**\n * Whether a clean run may print nothing at all in this format.\n *\n * Only `github` may: an empty annotation stream is a clean check. Every other\n * format owes its envelope - an empty JSON array, a SARIF log with no results,\n * a JUnit suite of passing testcases - because a consumer parsing stdout must\n * not have to treat \"no output\" as a third outcome. `explain` is never clean\n * or dirty; it always has something to say.\n */\nfunction omittedWhenClean(format: ReportFormat): boolean {\n return format !== \"explain\" && OMITTED_WHEN_CLEAN.has(format);\n}\n\nfunction listFormat(value: unknown): ListFormat {\n const format = String(value);\n if (!LIST_FORMATS.has(format)) {\n throw new LintError(\n `Unknown --format \"${format}\". Use pretty or json.`,\n );\n }\n return format as ListFormat;\n}\n\n/**\n * `templates infer -f`: the format a *template file* is written in, which is\n * not the set a report is rendered in. A template is YAML or JSON because those\n * are the two the loader reads back, and `pretty` would name a third thing the\n * tool cannot then load.\n */\nfunction inferFormat(value: unknown): InferFormat {\n const format = String(value);\n if (!isInferFormat(format)) {\n throw new LintError(`Unknown --format \"${format}\". Use yaml or json.`);\n }\n return format;\n}\n\n/** `templates show -f`: a report, a template's data, or a page skeleton. */\nfunction showFormat(value: unknown): ShowFormat {\n const format = String(value);\n if (!isShowFormat(format)) {\n throw new LintError(\n `Unknown --format \"${format}\". Use pretty, json or markdown.`,\n );\n }\n return format;\n}\n\n/**\n * `--tool <name>`: which tool performs the structure job. Refused by name\n * rather than ignored, because falling through to manni's engine would lint\n * with something other than what was asked for and say nothing.\n *\n * The refusal is the registry's, not a second copy of it here. `runLint`\n * refuses the same name with the same sentence for a caller that never touches\n * commander; this one fires first, so a bad `--tool` is reported before the\n * run asks what it was pointed at.\n */\nfunction assertStructureTool(value: string | undefined): void {\n if (value === undefined) return;\n resolveStructureTool(value);\n}\n\n/**\n * `-c/--config` and `--no-config`, in one place.\n *\n * Every verb here takes them, and they had been written out three times. A flag\n * two commands both have carries the same name *and* the same description, so\n * the declaration is shared rather than copied - which is what kept the fourth\n * copy, on `templates infer`, from spelling either of them slightly differently.\n */\nfunction withConfigOptions(command: Command): Command {\n return command\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\");\n}\n\n/**\n * The value of a flag a command and its parent both declare.\n *\n * Commander keeps parsing a parent's options past a subcommand name unless\n * `enablePositionalOptions()` is on, so `templates infer page.md -f json` sets\n * `format` on `templates` and leaves `infer` holding its own default. Both\n * commands declare `-f`, `-c` and `--no-config`, because \"commands must have\n * parallel behaviors\" and `infer` must list them in its own `--help`.\n *\n * Turning positional options on would fix it and move every other flag in this\n * program with it: `manni lint structure docs/ --no-color` is a root option\n * written after its command, and there are three more like it. So the lookup\n * changes instead. The nearest command actually *given* the flag wins, and the\n * subcommand's own default is the fallback - which is the reading a person\n * typing the line already has.\n */\nfunction optionValue(command: Command, key: string): unknown {\n for (\n let cmd: Command | null = command;\n cmd !== null;\n cmd = cmd.parent ?? null\n ) {\n if (cmd.getOptionValueSource(key) === \"cli\") return cmd.getOptionValue(key);\n }\n return command.getOptionValue(key);\n}\n\n/** The options every job verb takes, in one place so the two cannot drift. */\nfunction withInputOptions(command: Command): Command {\n command\n .argument(\n \"[paths...]\",\n \"files, directories, or globs to lint (use - for stdin)\",\n )\n .option(\n \"--collection <name>\",\n \"configured collection to run over; repeatable\",\n collect,\n [],\n )\n .option(\"--ext <list>\", \"comma-separated extensions for directory walks\")\n .option(\"--exclude <glob>\", \"glob to exclude; repeatable\", collect, [])\n .option(\"--as <format>\", \"force an input format (e.g. markdown, mdx)\")\n .option(\n \"-f, --format <format>\",\n `output: ${REPORT_FORMATS.join(\" | \")}`,\n \"pretty\",\n );\n return withConfigOptions(command)\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"--no-gitignore\", \"lint files .gitignore covers\");\n}\n\n/** The lint options every job verb turns its shared flags into. */\nfunction inputOptions(\n paths: string[],\n options: InputCliOptions,\n): {\n inputs: string[];\n collection: string[];\n exts?: string[];\n exclude: string[];\n as?: string;\n configPath?: string;\n noConfig?: boolean;\n allowEmpty?: boolean;\n respectGitignore?: boolean;\n onNotice: (message: string) => void;\n} {\n return {\n inputs: paths,\n collection: options.collection,\n ...(options.ext ? { exts: splitList(options.ext) } : {}),\n exclude: options.exclude,\n ...(options.as === undefined ? {} : { as: options.as }),\n ...configOption(options.config),\n // `undefined` rather than `false` when absent, so config still wins.\n ...(options.allowEmpty ? { allowEmpty: true } : {}),\n respectGitignore: explicitFalse(options.gitignore),\n onNotice: notice,\n };\n}\n\nexport function buildProgram(): Command {\n const program = new Command();\n program\n .name(\"lint\")\n .description(\n \"Validate document structure against doctype templates. Deterministic, CI-friendly.\",\n )\n .version(pkg.version, \"-V, --version\")\n .option(\"--no-color\", \"disable colored output\")\n .showHelpAfterError()\n // Exit code 1 is reserved for \"the docs are wrong\". Commander exits 1 on a\n // usage error by default, which would make a typo'd flag look exactly like\n // a failing lint to a workflow. With no callback, commander throws the\n // CommanderError instead, and the umbrella's runner maps it: help and\n // --version stay 0, every other usage error becomes 2. Commander has\n // already written its own message. This has to precede .command(), which\n // copies the callback into each subcommand.\n .exitOverride();\n\n /** Run one lint, render it, and settle the exit code. Both job verbs share it. */\n const lint = async (\n paths: string[],\n options: StructureCliOptions | InputCliOptions,\n command: Command,\n job: { tool?: StructureCliOptions } = {},\n ): Promise<void> => {\n const tool = job.tool;\n const format = reportFormat(options.format);\n const explain = tool?.explain === true;\n const stdinContent = paths.includes(STDIN_TOKEN) ? await readStdin() : undefined;\n const cwd = process.cwd();\n\n const run = await runLint({\n ...inputOptions(paths, options),\n ...(tool?.tool === undefined ? {} : { tool: tool.tool }),\n ...(tool?.template === undefined ? {} : { template: tool.template }),\n ...(tool && tool.templates.length > 0 ? { templates: tool.templates } : {}),\n ...(explain ? { explain: true } : {}),\n ...(stdinContent === undefined ? {} : { stdinContent }),\n // Which config governed the run, said where a report cannot be parsed\n // around: discovery walks up to the project boundary, so an unexpected\n // ancestor config is the difference between a five-minute diagnosis and\n // an hour of confusion.\n onConfigLoaded: reportConfig(format === \"pretty\", cwd),\n });\n\n const color = resolveColor(command.parent ?? command);\n const chosen: ReportFormat = explain ? \"explain\" : format;\n const text = render(run, chosen, { color });\n if (text.length > 0 || !omittedWhenClean(chosen)) {\n process.stdout.write(`${text}\\n`);\n }\n // `--explain` answers a question about configuration, so its exit code\n // reports whether it could answer it - not whether the docs are clean.\n //\n // That covers routing failures too: a page whose `type` matches no\n // template is a answered question, not an unanswered one, so it exits 0\n // like everything else here. Automation must not read this code as\n // \"everything routed\" - the ordinary run is what reports that, with exit\n // 1. Said in `--help` and the README, because the distinction is invisible\n // from the exit code alone.\n process.exitCode = explain ? 0 : run.summary.failed > 0 ? 1 : 0;\n };\n\n withInputOptions(\n program\n .command(\"check\")\n .description(\"Run every configured lint job over the given files/dirs/globs\"),\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Jobs: structure.\",\n \"\",\n \"Examples:\",\n \" manni lint check docs/ # every configured job\",\n \" manni lint check # targets from collections:\",\n \" manni lint check --collection guides\",\n ' manni lint check \"**/*.md\" -f github # CI annotations',\n \" cat page.md | manni lint check - --as markdown\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: InputCliOptions, command: Command) => {\n try {\n // Which jobs this run covered, said once, beside the config line. The\n // full form also names the jobs that exist and are not configured;\n // `structure` is the only job there is, so today it is one word.\n if (options.format === \"pretty\") {\n process.stderr.write(`Checked: ${LINT_JOBS.join(\", \")}.\\n`);\n }\n await lint(paths, options, command);\n } catch (err) {\n fail(err);\n }\n });\n\n const structure = withInputOptions(\n program\n .command(\"structure\")\n .description(\n \"Lint document structure against doctype templates, routing each page by its `type`\",\n ),\n );\n structure\n .optionsGroup(TOOL_OPTIONS_GROUP)\n .option(\n \"--tool <name>\",\n `tool that performs the job: ${TOOLS_BY_JOB.structure.join(\", \")}`,\n )\n .option(\n \"-t, --template <ref>\",\n \"apply this template to every file, overriding type routing\",\n )\n .option(\n \"--templates <path>\",\n \"template file to route by: its `types:` win over built-ins; repeatable\",\n collect,\n [],\n )\n .option(\n \"--explain\",\n \"print how each file's template was chosen, and lint nothing (always exits 0, unrouted pages included)\",\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni lint structure docs/ # route each page by its `type`\",\n \" manni lint structure docs/ --templates ./templates.yaml # add your own templates\",\n \" manni lint structure # targets from collections:\",\n \" manni lint structure docs/ --explain # show why each page routed where\",\n \" manni lint structure page.md -t tgdp:how-to:1.6 # force one template\",\n ' manni lint structure \"**/*.md\" -f github # CI annotations',\n \" manni lint structure docs/ --exclude '**/drafts/**'\",\n \" cat page.md | manni lint structure - -t tgdp:how-to:1.6 --as markdown\",\n ].join(\"\\n\"),\n )\n .action(\n async (paths: string[], options: StructureCliOptions, command: Command) => {\n try {\n assertStructureTool(options.tool);\n await lint(paths, options, command, { tool: options });\n } catch (err) {\n fail(err);\n }\n },\n );\n\n const templates = program\n .command(\"templates\")\n .description(\"List the templates that can be applied, and the types they serve\")\n .option(\n \"--templates <path>\",\n \"also list the templates in this file; repeatable\",\n collect,\n [],\n );\n withConfigOptions(templates)\n .option(\"-f, --format <format>\", \"output: pretty | json\", \"pretty\")\n .action(async (options: TemplatesCommandOptions, command: Command) => {\n try {\n const format = listFormat(options.format);\n // The listing answers \"what could route a page?\", so it has to see the\n // same template files a lint would - rebased the same way, or it would\n // answer for a different set of files depending on where it was run.\n const { configPath, noConfig } = configOption(options.config);\n const found = noConfig ? null : await loadConfig(configPath);\n const info = await runTemplates({\n templates:\n options.templates.length > 0\n ? options.templates\n : rebaseConfig(found).templates,\n });\n const color = resolveColor(command.parent ?? command);\n process.stdout.write(`${renderTemplates(info, format, { color })}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n\n const inferCommand = templates\n .command(\"infer\")\n .description(\"Write a first template from a page that already has the shape you want\")\n .argument(\"<page>\", \"one file to infer from (use - for stdin)\")\n .option(\"--as <format>\", \"force an input format (e.g. markdown, mdx)\")\n .option(\n \"--name <name>\",\n \"name for the template; defaults to the page's `type`, else its filename\",\n )\n .option(\"-f, --format <format>\", `output: ${INFER_FORMATS.join(\" | \")}`, \"yaml\")\n .option(\"-o, --out <path>\", \"write the template here instead of to stdout\")\n .option(\"--force\", \"overwrite the --out path\");\n withConfigOptions(inferCommand)\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni lint templates infer docs/guides/install.md\",\n \" manni lint templates infer docs/guides/install.md --name how-to\",\n \" manni lint templates infer page.mdx -f json\",\n \" manni lint templates infer page.md -o ./templates.yaml\",\n \" manni lint templates infer page.md -o ./templates.yaml --force\",\n \" cat page.md | manni lint templates infer - --as markdown\",\n \"\",\n \"One page, and every rule it writes is exactly one occurrence: a single\",\n \"page cannot show what varies. Loosening a heading into a list or a\",\n \"pattern, setting `min: 0`, and adding a trailing rule with no heading\",\n \"for the sections that may follow are your edits to make.\",\n ].join(\"\\n\"),\n )\n .action(\n async (\n page: string,\n options: TemplatesInferCliOptions,\n command: Command,\n ) => {\n try {\n // `-f`, `-c` and `--no-config` are read through `optionValue`: the\n // parent `templates` declares all three, and commander hands it any\n // of them typed after `infer`.\n const format = inferFormat(optionValue(command, \"format\"));\n const { configPath, noConfig } = configOption(\n optionValue(command, \"config\"),\n );\n const stdinContent =\n page === STDIN_TOKEN ? await readStdin() : undefined;\n const result = await runTemplatesInfer({\n page,\n format,\n ...(options.as === undefined ? {} : { as: options.as }),\n ...(options.name === undefined ? {} : { name: options.name }),\n ...(options.out === undefined ? {} : { out: options.out }),\n ...(options.force === undefined ? {} : { force: options.force }),\n ...(configPath === undefined ? {} : { configPath }),\n ...(noConfig === undefined ? {} : { noConfig }),\n ...(stdinContent === undefined ? {} : { stdinContent }),\n // The template is the primary output, so with no --out it owns\n // stdout and the config line goes to stderr beside it. With --out\n // stdout is free, and the line still belongs on stderr: a reader\n // piping nothing is not a reason to move a diagnostic.\n onConfigLoaded: reportConfig(false, process.cwd()),\n });\n\n if (result.written === undefined) {\n process.stdout.write(result.text);\n return;\n }\n // Said on stderr, so `-o` leaves stdout empty for a shell that is\n // watching it, and the template file is the whole output.\n process.stderr.write(\n `Wrote template \"${result.name}\" to ${result.written}\\n`,\n );\n } catch (err) {\n fail(err);\n }\n },\n );\n\n templates\n .command(\"show\")\n .description(\n \"Print what a template asks for: each section, how often it may occur, what it must contain, and what it is for\",\n )\n .argument(\n \"<ref>\",\n \"template to show: a built-in id, a path, a path#name, or a URL\",\n )\n .option(\"-f, --format <format>\", `output: ${SHOW_FORMATS.join(\" | \")}`, \"pretty\")\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni lint templates show tgdp:how-to:1.6\",\n \" manni lint templates show ./templates.yaml#how-to\",\n \" manni lint templates show tgdp:reference:1.6 -f json\",\n \" manni lint templates show tgdp:how-to:1.6 -f markdown > docs/rotate-key.md\",\n ].join(\"\\n\"),\n )\n .action(async (ref: string, _options: unknown, command: Command) => {\n try {\n // `-f` is read through `optionValue`: the parent `templates` declares\n // it too, and commander hands it any `-f` typed after `show`.\n const format = showFormat(optionValue(command, \"format\"));\n const show = await runTemplateShow({ ref });\n const color = resolveColor(program);\n process.stdout.write(`${renderTemplateShow(show, format, { color })}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n\n withConfigOptions(\n program\n .command(\"tools\")\n .description(\n \"List the lint jobs, the tool that performs each, and what it reads\",\n ),\n )\n .option(\"-f, --format <format>\", \"output: pretty | json\", \"pretty\")\n .action(async (options: ToolsCommandOptions, command: Command) => {\n try {\n const format = listFormat(options.format);\n const tools = await runTools(configOption(options.config));\n const color = resolveColor(command.parent ?? command);\n process.stdout.write(`${renderTools(tools, format, { color })}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n\n return program;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,eAAe;AAiHxB,IAAM,eAAe,oBAAI,IAAY,CAAC,UAAU,MAAM,CAAC;AAGvD,IAAM,qBAAqB;AAE3B,SAAS,aAAa,SAA2B;AAE/C,QAAM,UAAU,QAAQ,KAAK,EAAE,UAAU;AACzC,SAAO,YAAY,EAAE,SAAS,OAAO,QAAQ,OAAO,MAAM,CAAC;AAC7D;AAEA,SAAS,aAAa,OAA8B;AAClD,QAAM,SAAS,OAAO,KAAK;AAC3B,MAAI,CAAC,eAAe,MAAM,GAAG;AAC3B,UAAM,IAAI;AAAA,MACR,qBAAqB,MAAM,UAAU,kBAAkB;AAAA,IACzD;AAAA,EACF;AACA,SAAO;AACT;AAWA,SAAS,iBAAiB,QAA+B;AACvD,SAAO,WAAW,aAAa,mBAAmB,IAAI,MAAM;AAC9D;AAEA,SAAS,WAAW,OAA4B;AAC9C,QAAM,SAAS,OAAO,KAAK;AAC3B,MAAI,CAAC,aAAa,IAAI,MAAM,GAAG;AAC7B,UAAM,IAAI;AAAA,MACR,qBAAqB,MAAM;AAAA,IAC7B;AAAA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,KAAK;AACZ,WAAK,GAAG;AAAA,IACV;AAAA,EACF,CAAC;AAEH,SAAO;AACT;","names":[]}
@@ -11,7 +11,7 @@ import {
11
11
  runRetrieve,
12
12
  runTraverseContext,
13
13
  traverseIn
14
- } from "./chunk-XBJKYXOR.js";
14
+ } from "./chunk-WW4JATBJ.js";
15
15
  import {
16
16
  EXPORT_TARGETS,
17
17
  LLMS_FILENAME,
@@ -24,12 +24,12 @@ import {
24
24
  runFill,
25
25
  runQuery,
26
26
  runStats
27
- } from "./chunk-DENZLZ3Z.js";
28
- import "./chunk-245W2Q7C.js";
27
+ } from "./chunk-A5YUK3SG.js";
28
+ import "./chunk-D4BGNAN5.js";
29
29
  import {
30
30
  checkoutStatus,
31
31
  runBuild
32
- } from "./chunk-RQPEKHZH.js";
32
+ } from "./chunk-BY3635RR.js";
33
33
  import {
34
34
  CHUNKS_MANIFEST,
35
35
  SEARCH_MODES,
@@ -42,13 +42,16 @@ import {
42
42
  runSearch,
43
43
  runTraverse,
44
44
  shapeText
45
- } from "./chunk-LWBNHK72.js";
46
- import "./chunk-HHJ2HFPP.js";
45
+ } from "./chunk-FTSNG6DZ.js";
46
+ import "./chunk-BLDL23RY.js";
47
47
  import {
48
48
  parseChunksManifest
49
- } from "./chunk-NLJ3XIKT.js";
50
- import "./chunk-BLXRIAV2.js";
51
- import "./chunk-SHXPE4D4.js";
49
+ } from "./chunk-O6IDYZVW.js";
50
+ import {
51
+ EVALS_ARE_AUTHOR_FACING,
52
+ NO_AUTHORING_NEEDS_PUBLISH
53
+ } from "./chunk-57LZPG4V.js";
54
+ import "./chunk-5LQX57BW.js";
52
55
  import {
53
56
  ALL_FILL_FIELDS,
54
57
  CONFIG_SECTION,
@@ -60,34 +63,31 @@ import {
60
63
  assertInputFormat,
61
64
  byCodeUnit,
62
65
  loadRunConfig
63
- } from "./chunk-FHJIH6XP.js";
66
+ } from "./chunk-CPYQ4BJK.js";
64
67
  import "./chunk-GLP5PSXB.js";
65
- import "./chunk-ARNI3SJT.js";
66
- import "./chunk-XI3BNZG4.js";
68
+ import "./chunk-37Q7WEJJ.js";
69
+ import "./chunk-A67EJ3J6.js";
67
70
  import "./chunk-GMOAW2EG.js";
68
- import "./chunk-CZIO37J5.js";
69
- import "./chunk-WHVFHBL3.js";
70
- import "./chunk-R2CR62JV.js";
71
- import "./chunk-TFVNEPMF.js";
71
+ import "./chunk-IDDRHB7E.js";
72
+ import "./chunk-ZT3ERG4B.js";
73
+ import "./chunk-SCKVDD4E.js";
74
+ import "./chunk-64DULZIG.js";
72
75
  import "./chunk-TIUTIOFB.js";
73
- import "./chunk-VLRIP4BQ.js";
76
+ import "./chunk-IC3FJWIF.js";
74
77
  import "./chunk-TI4DA6DF.js";
75
- import "./chunk-KCWNJMSS.js";
76
- import "./chunk-UP6NBQ62.js";
77
- import "./chunk-2NGFDLIM.js";
78
- import "./chunk-Q76T6Y6X.js";
79
- import "./chunk-D5GBYKDU.js";
80
- import "./chunk-762MM6NA.js";
81
- import "./chunk-S5G6T4VC.js";
78
+ import "./chunk-FXE5K56B.js";
79
+ import "./chunk-VZSATUI7.js";
80
+ import "./chunk-LCMBG4LY.js";
81
+ import "./chunk-E3HYSNS6.js";
82
82
  import {
83
83
  collect,
84
84
  configOption,
85
85
  readStdin,
86
86
  splitList,
87
87
  writeTextAtomic
88
- } from "./chunk-BXE4L52Q.js";
88
+ } from "./chunk-562QZKAB.js";
89
89
  import "./chunk-DSWKBZWW.js";
90
- import "./chunk-BJUEOC4G.js";
90
+ import "./chunk-YB3KD5RI.js";
91
91
  import "./chunk-77AINBYM.js";
92
92
  import "./chunk-QK6VYJHV.js";
93
93
  import {
@@ -96,7 +96,7 @@ import {
96
96
  import {
97
97
  fail
98
98
  } from "./chunk-YEUYKR62.js";
99
- import "./chunk-B2242FYO.js";
99
+ import "./chunk-JF4BC7ZD.js";
100
100
  import {
101
101
  notice,
102
102
  noticeOnce,
@@ -104,10 +104,10 @@ import {
104
104
  } from "./chunk-HX44GB4Z.js";
105
105
  import {
106
106
  LOCAL_FLAG_HELP
107
- } from "./chunk-VM7VAFJW.js";
107
+ } from "./chunk-NVYDWVXN.js";
108
108
  import {
109
109
  package_default
110
- } from "./chunk-JQA6RF4R.js";
110
+ } from "./chunk-TR5TNPWT.js";
111
111
  import "./chunk-OWBRDNRZ.js";
112
112
  import {
113
113
  errorMessage
@@ -403,7 +403,7 @@ provenance:
403
403
  # stewardship people fields (owner, stakeholders, reviewed-by) out.
404
404
 
405
405
  # SHACL shapes \`manni graph check\` validates the built graph against. Default:
406
- # the shapes contract bundled with manni (shapes/graph/shapes-1.2.0.ttl).
406
+ # the shapes contract bundled with manni (shapes/graph/shapes-1.3.0.ttl).
407
407
  # check:
408
408
  # shapes: ["./my-shapes.ttl"]
409
409
 
@@ -526,6 +526,8 @@ async function runPublish(opts = {}) {
526
526
  },
527
527
  cwd
528
528
  );
529
+ const authoring = opts.authoring ?? config.authoring;
530
+ if (!authoring && opts.evals !== void 0) throw new GraphError(EVALS_ARE_AUTHOR_FACING);
529
531
  const configured = resolve3(cwd, config.out);
530
532
  const outDir = opts.out === void 0 ? dirname(configured) : resolve3(cwd, opts.out);
531
533
  const graph = join(outDir, basename(configured));
@@ -547,13 +549,31 @@ async function runPublish(opts = {}) {
547
549
  steps.push({ step, status: "skipped", detail: `no ${section} section`, files: [] });
548
550
  };
549
551
  const exported = (format, detail, out) => run(`export:${format}`, async () => {
550
- const r = await runExport({ ...source, graph, format, ...out === void 0 ? {} : { out }, ...format === "chunks" && opts.evals !== void 0 ? { evals: opts.evals } : {} });
552
+ const r = await runExport({
553
+ ...source,
554
+ graph,
555
+ format,
556
+ ...out === void 0 ? {} : { out },
557
+ ...format === "chunks" && opts.evals !== void 0 ? { evals: opts.evals } : {},
558
+ // The build already left author-facing content out of the graph the others reserialize.
559
+ ...!authoring && (format === "chunks" || format === "llms") ? { authoring } : {}
560
+ });
551
561
  return { detail: detail(r), files: r.files, warnings: r.warnings, ...r.notices === void 0 ? {} : { notices: r.notices } };
552
562
  });
553
563
  const names = (r) => r.files.map(shown).join(", ");
554
564
  await run("build", async () => {
555
- const r = await runBuild({ ...source, ...opts.collection === void 0 ? {} : { collection: opts.collection }, out: graph });
556
- return { detail: `${shown(r.outPath)}: ${plural(r.docs, "page")}, ${plural(r.quads, "triple")}`, files: [r.outPath], warnings: r.warnings };
565
+ const r = await runBuild({
566
+ ...source,
567
+ ...opts.collection === void 0 ? {} : { collection: opts.collection },
568
+ out: graph,
569
+ ...authoring ? {} : { authoring }
570
+ });
571
+ const records = r.strategyRecords > 0 ? `, ${plural(r.strategyRecords, "strategy record")}` : "";
572
+ return {
573
+ detail: `${shown(r.outPath)}: ${plural(r.docs, "page")}, ${plural(r.quads, "triple")}${records}`,
574
+ files: [r.outPath],
575
+ warnings: r.warnings
576
+ };
557
577
  });
558
578
  await exported("search", (r) => `${names(r)}: ${String(r.nodes)} ${r.nodes === 1 ? "entry" : "entries"}`, outDir);
559
579
  if (config.declared.embed) {
@@ -1009,6 +1029,7 @@ function publisher(opts, seams) {
1009
1029
  await publish({
1010
1030
  ...source,
1011
1031
  out: index,
1032
+ ...opts.authoring === void 0 ? {} : { authoring: opts.authoring },
1012
1033
  say: (kind, message) => {
1013
1034
  if (kind === "warning") warn(message);
1014
1035
  else notice(message);
@@ -1065,6 +1086,7 @@ function publisher(opts, seams) {
1065
1086
  };
1066
1087
  }
1067
1088
  async function runServe(opts, seams = {}) {
1089
+ if (opts.authoring === false && opts.publish !== true) throw new GraphError(NO_AUTHORING_NEEDS_PUBLISH);
1068
1090
  if (opts.publish === true && opts.graph !== void 0) {
1069
1091
  throw new GraphError(
1070
1092
  "--publish writes graph.ttl into the index directory, so it cannot be combined with --graph. Use --index to choose the directory."
@@ -1220,6 +1242,10 @@ function buildProgram() {
1220
1242
  }
1221
1243
  return [...prev, { field, value }];
1222
1244
  };
1245
+ const NO_AUTHORING_HELP = "Leave out author-facing content: strategy records, and every field its schemas prefer in a sidecar (default: config authoring)";
1246
+ function authoringOption(value) {
1247
+ return value === false ? { authoring: false } : {};
1248
+ }
1223
1249
  function artifactInputs(command) {
1224
1250
  return command.option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
1225
1251
  "-i, --index <dir>",
@@ -1284,19 +1310,22 @@ function buildProgram() {
1284
1310
  documentInputs(
1285
1311
  program.command("build").description("Derive the knowledge graph and write deterministic Turtle"),
1286
1312
  "build"
1287
- ).option("-o, --out <path>", "Output .ttl path (default: config out)").action(async (paths, opts) => {
1313
+ ).option("-o, --out <path>", "Output .ttl path (default: config out)").option("--no-authoring", NO_AUTHORING_HELP).action(async (paths, opts) => {
1288
1314
  try {
1289
1315
  const result = await runBuild({
1290
1316
  paths,
1291
1317
  ...documentOptions(opts),
1292
1318
  ...await inputOptions(paths, opts),
1293
- out: opts.out
1319
+ out: opts.out,
1320
+ ...authoringOption(opts.authoring)
1294
1321
  });
1295
1322
  for (const warning of result.warnings) warn(warning);
1296
1323
  const { total, fromTermbase } = result.concepts;
1297
1324
  const termbase = fromTermbase > 0 ? ` (${fromTermbase} from the termbase)` : "";
1325
+ const records = result.strategyRecords;
1326
+ const strategy = records > 0 ? `, ${records} strategy record${records === 1 ? "" : "s"}` : "";
1298
1327
  console.log(
1299
- `Wrote ${result.outPath} (${result.docs} docs, ${result.quads} triples, ${total} concepts${termbase})`
1328
+ `Wrote ${result.outPath} (${result.docs} docs, ${result.quads} triples, ${total} concepts${termbase}${strategy})`
1300
1329
  );
1301
1330
  } catch (e) {
1302
1331
  fail(e);
@@ -1668,10 +1697,11 @@ function buildProgram() {
1668
1697
  ).option(
1669
1698
  "--publish",
1670
1699
  "Publish the graph first when its artifact is missing or older than the checkout, and again after the checkout changes"
1671
- ).action(
1700
+ ).option("--no-authoring", NO_AUTHORING_HELP).action(
1672
1701
  async (opts) => {
1673
1702
  try {
1674
- process.exitCode = await runServe({ ...rest(opts), ...documentOptions(opts) });
1703
+ const { authoring, ...others } = rest(opts);
1704
+ process.exitCode = await runServe({ ...others, ...documentOptions(opts), ...authoringOption(authoring) });
1675
1705
  } catch (e) {
1676
1706
  fail(e);
1677
1707
  }
@@ -1714,7 +1744,7 @@ function buildProgram() {
1714
1744
  ).argument("<target>", `What to write: ${EXPORT_TARGETS.join(" | ")}`).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
1715
1745
  "-o, --out <path>",
1716
1746
  "Output path (default: the graph path with the target's extension); a directory for search and chunks"
1717
- ).option("--evals <path>", "A docevals JSON report for chunks (default: config export.chunks.evals)").action(
1747
+ ).option("--evals <path>", "A docevals JSON report for chunks (default: config export.chunks.evals)").option("--no-authoring", NO_AUTHORING_HELP).action(
1718
1748
  async (target, opts) => {
1719
1749
  try {
1720
1750
  if (!EXPORT_TARGETS.includes(target)) {
@@ -1727,7 +1757,8 @@ function buildProgram() {
1727
1757
  graph: opts.graph,
1728
1758
  format: target,
1729
1759
  out: opts.out,
1730
- ...opts.evals === void 0 ? {} : { evals: opts.evals }
1760
+ ...opts.evals === void 0 ? {} : { evals: opts.evals },
1761
+ ...authoringOption(opts.authoring)
1731
1762
  });
1732
1763
  for (const warning of result.warnings) warn(warning);
1733
1764
  for (const said of result.notices ?? []) noticeOnce(said);
@@ -1742,7 +1773,7 @@ function buildProgram() {
1742
1773
  );
1743
1774
  program.command("publish").description(
1744
1775
  "Build, embed when configured, and export everything serving needs into one directory"
1745
- ).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-o, --out <dir>", "Directory for every artifact (default: the directory of config out)").option("--evals <path>", "A docevals JSON report for the chunks (default: config export.chunks.evals)").option("--collection <name>", "Configured collection to read (repeatable)", collect, []).option(
1776
+ ).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-o, --out <dir>", "Directory for every artifact (default: the directory of config out)").option("--evals <path>", "A docevals JSON report for the chunks (default: config export.chunks.evals)").option("--collection <name>", "Configured collection to read (repeatable)", collect, []).option("--no-authoring", NO_AUTHORING_HELP).option(
1746
1777
  "-f, --format <format>",
1747
1778
  `Output: ${GRAPH_FORMAT_LIST}`,
1748
1779
  formatOption,
@@ -1754,6 +1785,7 @@ function buildProgram() {
1754
1785
  ...documentOptions(opts),
1755
1786
  ...opts.out === void 0 ? {} : { out: opts.out },
1756
1787
  ...opts.evals === void 0 ? {} : { evals: opts.evals },
1788
+ ...authoringOption(opts.authoring),
1757
1789
  say: (kind, message) => {
1758
1790
  if (kind === "notice") noticeOnce(message);
1759
1791
  else warn(message);
@@ -1771,4 +1803,4 @@ export {
1771
1803
  buildProgram,
1772
1804
  colorFor
1773
1805
  };
1774
- //# sourceMappingURL=cli-MQXOK64K.js.map
1806
+ //# sourceMappingURL=cli-ULHJTJHH.js.map