@hawkeyexl/manni 4.9.0 → 4.10.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 (168) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-W5GXL2P4.js → batch-6NICDKRE.js} +12 -12
  3. package/dist/{build-Q56FEXR6.js → build-3KP2K3XN.js} +11 -11
  4. package/dist/{calibrate-XFE56P4M.js → calibrate-LUA3DWKD.js} +13 -13
  5. package/dist/{capture-GMYH4ATL.js → capture-NETOHCB4.js} +12 -12
  6. package/dist/{check-ZE5HIDOW.js → check-7B77ZD2N.js} +11 -11
  7. package/dist/{check-OAJWC3WD.js → check-E4QCB7LS.js} +5 -5
  8. package/dist/{check-KUBELO5G.js → check-NLL4NRYA.js} +13 -13
  9. package/dist/{check-HBRX4FOR.js → check-PTECPIIB.js} +10 -10
  10. package/dist/{chunk-KX5IYIOO.js → chunk-2BV4FBC7.js} +2 -2
  11. package/dist/chunk-2BV4FBC7.js.map +1 -0
  12. package/dist/{chunk-FGUXMZXO.js → chunk-2JV7C4YV.js} +7 -7
  13. package/dist/{chunk-HRXDM6H6.js → chunk-2UCC26MO.js} +8 -8
  14. package/dist/{chunk-IN6DWNVE.js → chunk-2W34HX2U.js} +5 -5
  15. package/dist/{chunk-3XMG4CZY.js → chunk-2YJ5H5E6.js} +9 -9
  16. package/dist/{chunk-QAKJNPY3.js → chunk-3E2X2RBU.js} +6 -6
  17. package/dist/{chunk-RFSGKF4O.js → chunk-4DLF5SA4.js} +4 -4
  18. package/dist/{chunk-5EB6RIXJ.js → chunk-55GMOVKW.js} +2 -2
  19. package/dist/{chunk-76I6I5N2.js → chunk-5REEVKGH.js} +2 -2
  20. package/dist/{chunk-XXDXIIQ4.js → chunk-6AGESHHM.js} +2 -2
  21. package/dist/{chunk-5WME4CB6.js → chunk-6LR73NMO.js} +6 -6
  22. package/dist/{chunk-XKBEHKWO.js → chunk-6M5VJOC2.js} +2 -1
  23. package/dist/{chunk-YUZ2ECZY.js → chunk-7Y3N4Y72.js} +3 -3
  24. package/dist/{chunk-YEUQ7OKT.js → chunk-ABHG6I3G.js} +4 -4
  25. package/dist/{chunk-3CDZWY6M.js → chunk-AO5TSDKT.js} +4 -4
  26. package/dist/{chunk-TMI2YF6D.js → chunk-BD7IXBWE.js} +15 -26
  27. package/dist/{chunk-TMI2YF6D.js.map → chunk-BD7IXBWE.js.map} +1 -1
  28. package/dist/{chunk-XHFHXOQQ.js → chunk-CCWMACJL.js} +8 -8
  29. package/dist/{chunk-Q2H7J3FF.js → chunk-D2UW3ZCK.js} +6 -6
  30. package/dist/{chunk-MHAYLDBK.js → chunk-DFCQ6BMI.js} +4 -4
  31. package/dist/{chunk-ECVQNGTH.js → chunk-DNZUBCGZ.js} +3 -3
  32. package/dist/{chunk-XTAHZTES.js → chunk-EAUIQADY.js} +3 -3
  33. package/dist/{chunk-M6GH3FGJ.js → chunk-G6FNWRAI.js} +4 -4
  34. package/dist/{chunk-3XGGF5JW.js → chunk-G7XD4QH5.js} +3 -3
  35. package/dist/{chunk-QKE3XS2L.js → chunk-GB2XPITA.js} +2 -2
  36. package/dist/{chunk-KPXOJMQ6.js → chunk-GCKHSBEN.js} +2 -2
  37. package/dist/{chunk-5LBEQ4ZU.js → chunk-GDLHTI5R.js} +2 -2
  38. package/dist/{chunk-GRILZZGS.js → chunk-GXN7RRHR.js} +3 -3
  39. package/dist/{chunk-UDUHRXJ4.js → chunk-H26VDFDS.js} +2 -2
  40. package/dist/{chunk-TKTRIZT4.js → chunk-IJ62BB2T.js} +5 -5
  41. package/dist/{chunk-QCCAHV6A.js → chunk-KBG463UK.js} +3 -3
  42. package/dist/{chunk-2EHDJ47Y.js → chunk-LQZQ5KGG.js} +4 -4
  43. package/dist/{chunk-VKWZCEWB.js → chunk-PK7EKJ5T.js} +4 -4
  44. package/dist/{chunk-X6WLCNKC.js → chunk-QBVP3SQP.js} +4 -4
  45. package/dist/{chunk-BSTXARMY.js → chunk-QJRQ4BRC.js} +11 -11
  46. package/dist/{chunk-OWSNXPPX.js → chunk-RODZ7MB7.js} +3 -3
  47. package/dist/{chunk-OVOYKWCM.js → chunk-RZVCWX5R.js} +4 -4
  48. package/dist/{chunk-GEMXGXPR.js → chunk-SUTMSDQ2.js} +3 -3
  49. package/dist/{chunk-6KKZXB2O.js → chunk-VVVKBUBO.js} +2 -2
  50. package/dist/{chunk-23UAGEKP.js → chunk-VZVEP2OZ.js} +2 -2
  51. package/dist/{chunk-DTGIUMZV.js → chunk-WN47MNSK.js} +4 -4
  52. package/dist/{chunk-FSBIPCWE.js → chunk-XU73V5XT.js} +7 -7
  53. package/dist/{chunk-Q45PZX2D.js → chunk-Z5YHMRLF.js} +2 -2
  54. package/dist/{chunk-35WTFPQS.js → chunk-ZHRPH52H.js} +2 -2
  55. package/dist/chunk-ZMECS2IJ.js +27 -0
  56. package/dist/chunk-ZMECS2IJ.js.map +1 -0
  57. package/dist/{chunk-ND2S5BXB.js → chunk-ZXXFP2LA.js} +2 -2
  58. package/dist/{cli-MEPJTS2V.js → cli-4YYC6LCY.js} +15 -15
  59. package/dist/{cli-EMQXRN6E.js → cli-BIIUKPTE.js} +13 -12
  60. package/dist/{cli-EMQXRN6E.js.map → cli-BIIUKPTE.js.map} +1 -1
  61. package/dist/{cli-ZJRHU7MO.js → cli-EH3I4IUX.js} +32 -32
  62. package/dist/cli-EH3I4IUX.js.map +1 -0
  63. package/dist/{cli-J35OPSTP.js → cli-HO62TOM2.js} +8 -8
  64. package/dist/cli-LWST5FQH.js +839 -0
  65. package/dist/cli-LWST5FQH.js.map +1 -0
  66. package/dist/{cli-B7SFJDZA.js → cli-P2X7PNY6.js} +12 -12
  67. package/dist/{cli-TPONWND4.js → cli-SGVFZOAW.js} +19 -19
  68. package/dist/{cli-BJ7JXJ2U.js → cli-TELPAMJO.js} +14 -14
  69. package/dist/{cli-URNPOMOH.js → cli-UETKXHJN.js} +3 -3
  70. package/dist/{cli-YDMMIL2U.js → cli-V2DI3K2R.js} +14 -14
  71. package/dist/cli.js +18 -11
  72. package/dist/cli.js.map +1 -1
  73. package/dist/{config-YWSNBFEE.js → config-TYXYQK3I.js} +3 -3
  74. package/dist/docmeta.js +7 -7
  75. package/dist/{github-IYOVHWHG.js → github-ESK45CEZ.js} +10 -10
  76. package/dist/{github-63CZJGZS.js → github-WER7JUTN.js} +12 -12
  77. package/dist/index.js +35 -34
  78. package/dist/index.js.map +1 -1
  79. package/dist/{json-JIUPGOUQ.js → json-QR4G35KA.js} +10 -10
  80. package/dist/{lint-TBE35CCW.js → lint-QTI7XK2A.js} +11 -10
  81. package/dist/{list-IZ4RIM72.js → list-JO4G3TS3.js} +10 -10
  82. package/dist/{list-TNEJ3J77.js → list-O2MJUP5V.js} +10 -10
  83. package/dist/{page-WQ3GQF76.js → page-FSXDXCDD.js} +9 -9
  84. package/dist/{prepare-ZUTYXTUZ.js → prepare-UPIBTFNS.js} +11 -11
  85. package/dist/{pretty-CBV5XSMZ.js → pretty-4IONWSEP.js} +10 -10
  86. package/dist/{pretty-Q3C433DW.js → pretty-R4BQD2VH.js} +11 -11
  87. package/dist/{reporters-TTYGOUAF.js → reporters-DHO2BXAD.js} +5 -5
  88. package/dist/{reporters-DH5HPFXJ.js → reporters-FPP6JNDP.js} +9 -9
  89. package/dist/{run-LZXKVTM7.js → run-YH5Z7RJ7.js} +10 -10
  90. package/dist/{term-DL3YFL43.js → term-ASM4LVYC.js} +14 -14
  91. package/dist/{validate-UVDMC5LT.js → validate-7JI3H57P.js} +5 -5
  92. package/package.json +1 -1
  93. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  94. package/dist/chunk-KX5IYIOO.js.map +0 -1
  95. package/dist/cli-ZJRHU7MO.js.map +0 -1
  96. /package/dist/{batch-W5GXL2P4.js.map → batch-6NICDKRE.js.map} +0 -0
  97. /package/dist/{build-Q56FEXR6.js.map → build-3KP2K3XN.js.map} +0 -0
  98. /package/dist/{calibrate-XFE56P4M.js.map → calibrate-LUA3DWKD.js.map} +0 -0
  99. /package/dist/{capture-GMYH4ATL.js.map → capture-NETOHCB4.js.map} +0 -0
  100. /package/dist/{check-HBRX4FOR.js.map → check-7B77ZD2N.js.map} +0 -0
  101. /package/dist/{check-OAJWC3WD.js.map → check-E4QCB7LS.js.map} +0 -0
  102. /package/dist/{check-KUBELO5G.js.map → check-NLL4NRYA.js.map} +0 -0
  103. /package/dist/{check-ZE5HIDOW.js.map → check-PTECPIIB.js.map} +0 -0
  104. /package/dist/{chunk-FGUXMZXO.js.map → chunk-2JV7C4YV.js.map} +0 -0
  105. /package/dist/{chunk-HRXDM6H6.js.map → chunk-2UCC26MO.js.map} +0 -0
  106. /package/dist/{chunk-IN6DWNVE.js.map → chunk-2W34HX2U.js.map} +0 -0
  107. /package/dist/{chunk-3XMG4CZY.js.map → chunk-2YJ5H5E6.js.map} +0 -0
  108. /package/dist/{chunk-QAKJNPY3.js.map → chunk-3E2X2RBU.js.map} +0 -0
  109. /package/dist/{chunk-RFSGKF4O.js.map → chunk-4DLF5SA4.js.map} +0 -0
  110. /package/dist/{chunk-5EB6RIXJ.js.map → chunk-55GMOVKW.js.map} +0 -0
  111. /package/dist/{chunk-76I6I5N2.js.map → chunk-5REEVKGH.js.map} +0 -0
  112. /package/dist/{chunk-XXDXIIQ4.js.map → chunk-6AGESHHM.js.map} +0 -0
  113. /package/dist/{chunk-5WME4CB6.js.map → chunk-6LR73NMO.js.map} +0 -0
  114. /package/dist/{chunk-XKBEHKWO.js.map → chunk-6M5VJOC2.js.map} +0 -0
  115. /package/dist/{chunk-YUZ2ECZY.js.map → chunk-7Y3N4Y72.js.map} +0 -0
  116. /package/dist/{chunk-YEUQ7OKT.js.map → chunk-ABHG6I3G.js.map} +0 -0
  117. /package/dist/{chunk-3CDZWY6M.js.map → chunk-AO5TSDKT.js.map} +0 -0
  118. /package/dist/{chunk-XHFHXOQQ.js.map → chunk-CCWMACJL.js.map} +0 -0
  119. /package/dist/{chunk-Q2H7J3FF.js.map → chunk-D2UW3ZCK.js.map} +0 -0
  120. /package/dist/{chunk-MHAYLDBK.js.map → chunk-DFCQ6BMI.js.map} +0 -0
  121. /package/dist/{chunk-ECVQNGTH.js.map → chunk-DNZUBCGZ.js.map} +0 -0
  122. /package/dist/{chunk-XTAHZTES.js.map → chunk-EAUIQADY.js.map} +0 -0
  123. /package/dist/{chunk-M6GH3FGJ.js.map → chunk-G6FNWRAI.js.map} +0 -0
  124. /package/dist/{chunk-3XGGF5JW.js.map → chunk-G7XD4QH5.js.map} +0 -0
  125. /package/dist/{chunk-QKE3XS2L.js.map → chunk-GB2XPITA.js.map} +0 -0
  126. /package/dist/{chunk-KPXOJMQ6.js.map → chunk-GCKHSBEN.js.map} +0 -0
  127. /package/dist/{chunk-5LBEQ4ZU.js.map → chunk-GDLHTI5R.js.map} +0 -0
  128. /package/dist/{chunk-GRILZZGS.js.map → chunk-GXN7RRHR.js.map} +0 -0
  129. /package/dist/{chunk-UDUHRXJ4.js.map → chunk-H26VDFDS.js.map} +0 -0
  130. /package/dist/{chunk-TKTRIZT4.js.map → chunk-IJ62BB2T.js.map} +0 -0
  131. /package/dist/{chunk-QCCAHV6A.js.map → chunk-KBG463UK.js.map} +0 -0
  132. /package/dist/{chunk-2EHDJ47Y.js.map → chunk-LQZQ5KGG.js.map} +0 -0
  133. /package/dist/{chunk-VKWZCEWB.js.map → chunk-PK7EKJ5T.js.map} +0 -0
  134. /package/dist/{chunk-X6WLCNKC.js.map → chunk-QBVP3SQP.js.map} +0 -0
  135. /package/dist/{chunk-BSTXARMY.js.map → chunk-QJRQ4BRC.js.map} +0 -0
  136. /package/dist/{chunk-OWSNXPPX.js.map → chunk-RODZ7MB7.js.map} +0 -0
  137. /package/dist/{chunk-OVOYKWCM.js.map → chunk-RZVCWX5R.js.map} +0 -0
  138. /package/dist/{chunk-GEMXGXPR.js.map → chunk-SUTMSDQ2.js.map} +0 -0
  139. /package/dist/{chunk-6KKZXB2O.js.map → chunk-VVVKBUBO.js.map} +0 -0
  140. /package/dist/{chunk-23UAGEKP.js.map → chunk-VZVEP2OZ.js.map} +0 -0
  141. /package/dist/{chunk-DTGIUMZV.js.map → chunk-WN47MNSK.js.map} +0 -0
  142. /package/dist/{chunk-FSBIPCWE.js.map → chunk-XU73V5XT.js.map} +0 -0
  143. /package/dist/{chunk-Q45PZX2D.js.map → chunk-Z5YHMRLF.js.map} +0 -0
  144. /package/dist/{chunk-35WTFPQS.js.map → chunk-ZHRPH52H.js.map} +0 -0
  145. /package/dist/{chunk-ND2S5BXB.js.map → chunk-ZXXFP2LA.js.map} +0 -0
  146. /package/dist/{cli-MEPJTS2V.js.map → cli-4YYC6LCY.js.map} +0 -0
  147. /package/dist/{cli-J35OPSTP.js.map → cli-HO62TOM2.js.map} +0 -0
  148. /package/dist/{cli-B7SFJDZA.js.map → cli-P2X7PNY6.js.map} +0 -0
  149. /package/dist/{cli-TPONWND4.js.map → cli-SGVFZOAW.js.map} +0 -0
  150. /package/dist/{cli-BJ7JXJ2U.js.map → cli-TELPAMJO.js.map} +0 -0
  151. /package/dist/{cli-URNPOMOH.js.map → cli-UETKXHJN.js.map} +0 -0
  152. /package/dist/{cli-YDMMIL2U.js.map → cli-V2DI3K2R.js.map} +0 -0
  153. /package/dist/{config-YWSNBFEE.js.map → config-TYXYQK3I.js.map} +0 -0
  154. /package/dist/{github-63CZJGZS.js.map → github-ESK45CEZ.js.map} +0 -0
  155. /package/dist/{github-IYOVHWHG.js.map → github-WER7JUTN.js.map} +0 -0
  156. /package/dist/{json-JIUPGOUQ.js.map → json-QR4G35KA.js.map} +0 -0
  157. /package/dist/{lint-TBE35CCW.js.map → lint-QTI7XK2A.js.map} +0 -0
  158. /package/dist/{list-IZ4RIM72.js.map → list-JO4G3TS3.js.map} +0 -0
  159. /package/dist/{list-TNEJ3J77.js.map → list-O2MJUP5V.js.map} +0 -0
  160. /package/dist/{page-WQ3GQF76.js.map → page-FSXDXCDD.js.map} +0 -0
  161. /package/dist/{prepare-ZUTYXTUZ.js.map → prepare-UPIBTFNS.js.map} +0 -0
  162. /package/dist/{pretty-CBV5XSMZ.js.map → pretty-4IONWSEP.js.map} +0 -0
  163. /package/dist/{pretty-Q3C433DW.js.map → pretty-R4BQD2VH.js.map} +0 -0
  164. /package/dist/{reporters-DH5HPFXJ.js.map → reporters-DHO2BXAD.js.map} +0 -0
  165. /package/dist/{reporters-TTYGOUAF.js.map → reporters-FPP6JNDP.js.map} +0 -0
  166. /package/dist/{run-LZXKVTM7.js.map → run-YH5Z7RJ7.js.map} +0 -0
  167. /package/dist/{term-DL3YFL43.js.map → term-ASM4LVYC.js.map} +0 -0
  168. /package/dist/{validate-UVDMC5LT.js.map → validate-7JI3H57P.js.map} +0 -0
@@ -7,16 +7,16 @@ import {
7
7
  loadGraderPlugins,
8
8
  parseNewerThan,
9
9
  urlManifestRefusal
10
- } from "./chunk-3XMG4CZY.js";
10
+ } from "./chunk-2YJ5H5E6.js";
11
11
  import {
12
12
  discoverArtifacts
13
- } from "./chunk-Q45PZX2D.js";
13
+ } from "./chunk-Z5YHMRLF.js";
14
14
  import {
15
15
  discoverTraces
16
16
  } from "./chunk-4TSWU2SU.js";
17
17
  import {
18
18
  discoverConfig
19
- } from "./chunk-KPXOJMQ6.js";
19
+ } from "./chunk-GCKHSBEN.js";
20
20
  import {
21
21
  assertProviderSelection,
22
22
  constructProvider,
@@ -36,7 +36,7 @@ import {
36
36
  externalWriteWarnings,
37
37
  mergeMetaProvenance,
38
38
  offerExternalHomes
39
- } from "./chunk-IN6DWNVE.js";
39
+ } from "./chunk-2W34HX2U.js";
40
40
  import {
41
41
  keyHome,
42
42
  marksValidator,
@@ -44,12 +44,12 @@ import {
44
44
  readManifestOrEmpty,
45
45
  readManifestValue,
46
46
  spliceManifestValue
47
- } from "./chunk-QCCAHV6A.js";
47
+ } from "./chunk-KBG463UK.js";
48
48
  import {
49
49
  DocmetaError,
50
50
  extractFrontmatter,
51
51
  writeFileAtomic
52
- } from "./chunk-3XGGF5JW.js";
52
+ } from "./chunk-G7XD4QH5.js";
53
53
  import {
54
54
  palette
55
55
  } from "./chunk-RNVYGWIC.js";
@@ -1191,4 +1191,4 @@ export {
1191
1191
  runFill,
1192
1192
  renderFill
1193
1193
  };
1194
- //# sourceMappingURL=chunk-FSBIPCWE.js.map
1194
+ //# sourceMappingURL=chunk-XU73V5XT.js.map
@@ -5,7 +5,7 @@ import {
5
5
  listInTree,
6
6
  safeRead,
7
7
  segments
8
- } from "./chunk-XTAHZTES.js";
8
+ } from "./chunk-EAUIQADY.js";
9
9
  import {
10
10
  TracevalsError
11
11
  } from "./chunk-UKZNLVJW.js";
@@ -171,4 +171,4 @@ async function discoverArtifacts(options) {
171
171
  export {
172
172
  discoverArtifacts
173
173
  };
174
- //# sourceMappingURL=chunk-Q45PZX2D.js.map
174
+ //# sourceMappingURL=chunk-Z5YHMRLF.js.map
@@ -6,7 +6,7 @@ import {
6
6
  extractFrontmatter,
7
7
  extractorForExtension,
8
8
  locateFrontmatter
9
- } from "./chunk-3XGGF5JW.js";
9
+ } from "./chunk-G7XD4QH5.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-35WTFPQS.js.map
3250
+ //# sourceMappingURL=chunk-ZHRPH52H.js.map
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/shared/batch-launcher.ts
4
+ function isBatchFile(launcher) {
5
+ const lower = launcher.toLowerCase();
6
+ return lower.endsWith(".bat") || lower.endsWith(".cmd");
7
+ }
8
+ function launcherCommandLine(launcher, args, refuse) {
9
+ if (!isBatchFile(launcher)) {
10
+ return { command: launcher, argv: args, verbatim: false };
11
+ }
12
+ const quote = (value) => {
13
+ if (value.includes('"')) throw refuse(value);
14
+ return `"${value}"`;
15
+ };
16
+ const line = [launcher, ...args].map(quote).join(" ");
17
+ return {
18
+ command: process.env["COMSPEC"] ?? "cmd.exe",
19
+ argv: ["/d", "/s", "/c", `"${line}"`],
20
+ verbatim: true
21
+ };
22
+ }
23
+
24
+ export {
25
+ launcherCommandLine
26
+ };
27
+ //# sourceMappingURL=chunk-ZMECS2IJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shared/batch-launcher.ts"],"sourcesContent":["/**\n * Starting a Windows `.bat` or `.cmd` launcher without a shell string.\n *\n * Node refuses to spawn a `.bat` or `.cmd` without a shell, and `shell: true`\n * joins the argv into one string **with no quoting at all**. An argv carrying\n * user-supplied paths makes that a command-injection hole, not a convenience.\n * The documented alternative is this one: run `cmd.exe` directly, do the\n * quoting here, and pass the whole command as one verbatim argument. `/s` then\n * strips exactly the outer pair of quotes, which is why the string is wrapped a\n * second time. The next reader will find `shell: true` simpler; it is also the\n * version with the hole in it.\n *\n * Shared by `lint`'s DITA-OT seam (`dita.bat`) and `site`' runner (`npm.cmd`\n * and every other Node CLI shim).\n */\n\n/** How a launcher is actually started. */\nexport interface LauncherCommandLine {\n command: string;\n argv: string[];\n /** Windows: the argv is already one quoted string and must not be re-quoted. */\n verbatim: boolean;\n}\n\nfunction isBatchFile(launcher: string): boolean {\n const lower = launcher.toLowerCase();\n return lower.endsWith(\".bat\") || lower.endsWith(\".cmd\");\n}\n\n/**\n * How to start `launcher` with `args`, given what it is. A `\"` inside a Windows\n * path is impossible (the character is not legal in a filename), so a token\n * carrying one is a shape this cannot quote safely. `refuse` builds the error\n * thrown for it, in the calling domain's own class and words.\n */\nexport function launcherCommandLine(\n launcher: string,\n args: string[],\n refuse: (value: string) => Error,\n): LauncherCommandLine {\n if (!isBatchFile(launcher)) {\n return { command: launcher, argv: args, verbatim: false };\n }\n const quote = (value: string): string => {\n if (value.includes('\"')) throw refuse(value);\n return `\"${value}\"`;\n };\n const line = [launcher, ...args].map(quote).join(\" \");\n return {\n command: process.env[\"COMSPEC\"] ?? \"cmd.exe\",\n argv: [\"/d\", \"/s\", \"/c\", `\"${line}\"`],\n verbatim: true,\n };\n}\n"],"mappings":";;;AAwBA,SAAS,YAAY,UAA2B;AAC9C,QAAM,QAAQ,SAAS,YAAY;AACnC,SAAO,MAAM,SAAS,MAAM,KAAK,MAAM,SAAS,MAAM;AACxD;AAQO,SAAS,oBACd,UACA,MACA,QACqB;AACrB,MAAI,CAAC,YAAY,QAAQ,GAAG;AAC1B,WAAO,EAAE,SAAS,UAAU,MAAM,MAAM,UAAU,MAAM;AAAA,EAC1D;AACA,QAAM,QAAQ,CAAC,UAA0B;AACvC,QAAI,MAAM,SAAS,GAAG,EAAG,OAAM,OAAO,KAAK;AAC3C,WAAO,IAAI,KAAK;AAAA,EAClB;AACA,QAAM,OAAO,CAAC,UAAU,GAAG,IAAI,EAAE,IAAI,KAAK,EAAE,KAAK,GAAG;AACpD,SAAO;AAAA,IACL,SAAS,QAAQ,IAAI,SAAS,KAAK;AAAA,IACnC,MAAM,CAAC,MAAM,MAAM,MAAM,IAAI,IAAI,GAAG;AAAA,IACpC,UAAU;AAAA,EACZ;AACF;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  TERM_FIELDS,
4
4
  displayPath
5
- } from "./chunk-YEUQ7OKT.js";
5
+ } from "./chunk-ABHG6I3G.js";
6
6
 
7
7
  // src/term/reporters/json.ts
8
8
  function termEntry(term) {
@@ -49,4 +49,4 @@ export {
49
49
  renderFindingsJson,
50
50
  renderFormatsJson
51
51
  };
52
- //# sourceMappingURL=chunk-ND2S5BXB.js.map
52
+ //# sourceMappingURL=chunk-ZXXFP2LA.js.map
@@ -3,27 +3,27 @@ import {
3
3
  KeyError,
4
4
  runKeyRotate,
5
5
  runKeySet
6
- } from "./chunk-BSTXARMY.js";
7
- import "./chunk-HRXDM6H6.js";
8
- import "./chunk-QAKJNPY3.js";
9
- import "./chunk-GEMXGXPR.js";
10
- import "./chunk-YUZ2ECZY.js";
11
- import "./chunk-OVOYKWCM.js";
6
+ } from "./chunk-QJRQ4BRC.js";
7
+ import "./chunk-2UCC26MO.js";
8
+ import "./chunk-3E2X2RBU.js";
9
+ import "./chunk-SUTMSDQ2.js";
10
+ import "./chunk-7Y3N4Y72.js";
11
+ import "./chunk-RZVCWX5R.js";
12
12
  import "./chunk-PCE7QHXJ.js";
13
13
  import "./chunk-77AINBYM.js";
14
- import "./chunk-VKWZCEWB.js";
14
+ import "./chunk-PK7EKJ5T.js";
15
15
  import "./chunk-IKEWBMCN.js";
16
- import "./chunk-M6GH3FGJ.js";
17
- import "./chunk-IN6DWNVE.js";
16
+ import "./chunk-G6FNWRAI.js";
17
+ import "./chunk-2W34HX2U.js";
18
18
  import {
19
19
  collect,
20
20
  explicitFalse,
21
21
  splitList
22
- } from "./chunk-QCCAHV6A.js";
22
+ } from "./chunk-KBG463UK.js";
23
23
  import {
24
24
  COMMON_FORMAT_LIST
25
- } from "./chunk-X6WLCNKC.js";
26
- import "./chunk-3XGGF5JW.js";
25
+ } from "./chunk-QBVP3SQP.js";
26
+ import "./chunk-G7XD4QH5.js";
27
27
  import {
28
28
  fail
29
29
  } from "./chunk-YEUYKR62.js";
@@ -32,14 +32,14 @@ import {
32
32
  shouldColor
33
33
  } from "./chunk-RNVYGWIC.js";
34
34
  import "./chunk-MNH7QO4Z.js";
35
- import "./chunk-XKBEHKWO.js";
35
+ import "./chunk-6M5VJOC2.js";
36
36
  import {
37
37
  notice
38
38
  } from "./chunk-HX44GB4Z.js";
39
39
  import "./chunk-QCHVR4ZM.js";
40
40
  import {
41
41
  package_default
42
- } from "./chunk-KX5IYIOO.js";
42
+ } from "./chunk-2BV4FBC7.js";
43
43
  import "./chunk-OWBRDNRZ.js";
44
44
  import "./chunk-G3T47CFV.js";
45
45
  import "./chunk-2H7UOFLK.js";
@@ -228,4 +228,4 @@ function buildProgram() {
228
228
  export {
229
229
  buildProgram
230
230
  };
231
- //# sourceMappingURL=cli-MEPJTS2V.js.map
231
+ //# sourceMappingURL=cli-4YYC6LCY.js.map
@@ -5,7 +5,7 @@ import {
5
5
  runTemplates,
6
6
  runTemplatesInfer,
7
7
  runTools
8
- } from "./chunk-DTGIUMZV.js";
8
+ } from "./chunk-WN47MNSK.js";
9
9
  import {
10
10
  LINT_JOBS,
11
11
  TOOLS_BY_JOB,
@@ -13,21 +13,22 @@ import {
13
13
  rebaseConfig,
14
14
  resolveStructureTool,
15
15
  runLint
16
- } from "./chunk-TMI2YF6D.js";
17
- import "./chunk-35WTFPQS.js";
16
+ } from "./chunk-BD7IXBWE.js";
17
+ import "./chunk-ZMECS2IJ.js";
18
+ import "./chunk-ZHRPH52H.js";
18
19
  import "./chunk-TIUTIOFB.js";
19
20
  import {
20
21
  render,
21
22
  renderTemplates,
22
23
  renderTools
23
- } from "./chunk-2EHDJ47Y.js";
24
+ } from "./chunk-LQZQ5KGG.js";
24
25
  import "./chunk-GLP5PSXB.js";
25
26
  import "./chunk-TBAMBLF3.js";
26
27
  import {
27
28
  LintError
28
29
  } from "./chunk-YGFIQ6Y5.js";
29
- import "./chunk-M6GH3FGJ.js";
30
- import "./chunk-IN6DWNVE.js";
30
+ import "./chunk-G6FNWRAI.js";
31
+ import "./chunk-2W34HX2U.js";
31
32
  import {
32
33
  collect,
33
34
  configOption,
@@ -35,16 +36,16 @@ import {
35
36
  readStdin,
36
37
  reportConfig,
37
38
  splitList
38
- } from "./chunk-QCCAHV6A.js";
39
+ } from "./chunk-KBG463UK.js";
39
40
  import {
40
41
  OMITTED_WHEN_CLEAN,
41
42
  REPORT_FORMATS,
42
43
  REPORT_FORMAT_LIST,
43
44
  isReportFormat
44
- } from "./chunk-X6WLCNKC.js";
45
+ } from "./chunk-QBVP3SQP.js";
45
46
  import {
46
47
  STDIN_TOKEN
47
- } from "./chunk-3XGGF5JW.js";
48
+ } from "./chunk-G7XD4QH5.js";
48
49
  import {
49
50
  fail
50
51
  } from "./chunk-YEUYKR62.js";
@@ -52,14 +53,14 @@ import {
52
53
  shouldColor
53
54
  } from "./chunk-RNVYGWIC.js";
54
55
  import "./chunk-MNH7QO4Z.js";
55
- import "./chunk-XKBEHKWO.js";
56
+ import "./chunk-6M5VJOC2.js";
56
57
  import {
57
58
  notice
58
59
  } from "./chunk-HX44GB4Z.js";
59
60
  import "./chunk-QCHVR4ZM.js";
60
61
  import {
61
62
  package_default
62
- } from "./chunk-KX5IYIOO.js";
63
+ } from "./chunk-2BV4FBC7.js";
63
64
  import "./chunk-OWBRDNRZ.js";
64
65
  import "./chunk-G3T47CFV.js";
65
66
  import "./chunk-2H7UOFLK.js";
@@ -344,4 +345,4 @@ function buildProgram() {
344
345
  export {
345
346
  buildProgram
346
347
  };
347
- //# sourceMappingURL=cli-EMQXRN6E.js.map
348
+ //# sourceMappingURL=cli-BIIUKPTE.js.map
@@ -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 { runTemplates, runTemplatesInfer } 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\";\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/**\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 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;AAuGxB,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,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A;AAAA;AAAA;AAAA;AAAA,UAKrD,gBAAgB,aAAa,OAAO,QAAQ,IAAI,CAAC;AAAA,QACnD,CAAC;AAED,YAAI,OAAO,YAAY,QAAW;AAChC,kBAAQ,OAAO,MAAM,OAAO,IAAI;AAChC;AAAA,QACF;AAGA,gBAAQ,OAAO;AAAA,UACb,mBAAmB,OAAO,IAAI,QAAQ,OAAO,OAAO;AAAA;AAAA,QACtD;AAAA,MACF,SAAS,KAAK;AACZ,aAAK,GAAG;AAAA,MACV;AAAA,IACF;AAAA,EACF;AAEF;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 { runTemplates, runTemplatesInfer } 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\";\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/**\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 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,eA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chunk-QKE3XS2L.js";
5
- import "./chunk-OWSNXPPX.js";
4
+ } from "./chunk-GB2XPITA.js";
5
+ import "./chunk-RODZ7MB7.js";
6
6
  import {
7
7
  readStdin
8
8
  } from "./chunk-TZOYZK2E.js";
9
9
  import "./chunk-CWXZ2MRT.js";
10
- import "./chunk-XTAHZTES.js";
10
+ import "./chunk-EAUIQADY.js";
11
11
  import "./chunk-4TSWU2SU.js";
12
12
  import {
13
13
  DEFAULT_CAPTURE_DIR
14
14
  } from "./chunk-CU57HT2E.js";
15
15
  import "./chunk-UKZNLVJW.js";
16
- import "./chunk-M6GH3FGJ.js";
17
- import "./chunk-IN6DWNVE.js";
16
+ import "./chunk-G6FNWRAI.js";
17
+ import "./chunk-2W34HX2U.js";
18
18
  import {
19
19
  memberOf,
20
20
  retainMembers
21
- } from "./chunk-QCCAHV6A.js";
22
- import "./chunk-X6WLCNKC.js";
21
+ } from "./chunk-KBG463UK.js";
22
+ import "./chunk-QBVP3SQP.js";
23
23
  import {
24
24
  extractorForExtension,
25
25
  resolveTargetSet,
26
26
  supportedExtensions,
27
27
  withSharedWalks
28
- } from "./chunk-3XGGF5JW.js";
28
+ } from "./chunk-G7XD4QH5.js";
29
29
  import {
30
30
  fail
31
31
  } from "./chunk-YEUYKR62.js";
@@ -36,7 +36,7 @@ import "./chunk-MNH7QO4Z.js";
36
36
  import {
37
37
  findFamilyConfigFile,
38
38
  readFamilyConfigFile
39
- } from "./chunk-XKBEHKWO.js";
39
+ } from "./chunk-6M5VJOC2.js";
40
40
  import {
41
41
  notice,
42
42
  warn
@@ -44,7 +44,7 @@ import {
44
44
  import "./chunk-QCHVR4ZM.js";
45
45
  import {
46
46
  package_default
47
- } from "./chunk-KX5IYIOO.js";
47
+ } from "./chunk-2BV4FBC7.js";
48
48
  import {
49
49
  programName
50
50
  } from "./chunk-OWBRDNRZ.js";
@@ -150,7 +150,7 @@ var NOT_SET_UP = {
150
150
  };
151
151
  var META_DEFAULTS_ONLY = "only the built-in default schemas cover these files";
152
152
  var NOT_CHECKED = [
153
- ["a11y", "run manni a11y check against a running site"],
153
+ ["a11y", "run manni site preview, then manni a11y check"],
154
154
  ["tracevals", "run manni tracevals run over sessions"]
155
155
  ];
156
156
  function plural(n, one, many = `${one}s`) {
@@ -261,8 +261,8 @@ async function runDomain(domain, ctx) {
261
261
  switch (domain) {
262
262
  case "meta": {
263
263
  const [{ runValidate }, { render: renderMeta }] = await Promise.all([
264
- import("./validate-UVDMC5LT.js"),
265
- import("./reporters-TTYGOUAF.js")
264
+ import("./validate-7JI3H57P.js"),
265
+ import("./reporters-DHO2BXAD.js")
266
266
  ]);
267
267
  const run2 = await runValidate({ inputs, configPath, cwd, skipDefaultOnly: true, onNotice });
268
268
  if (run2.results.length === 0) {
@@ -275,10 +275,10 @@ async function runDomain(domain, ctx) {
275
275
  }
276
276
  case "cite": {
277
277
  const [{ runCheck: runCite }, { renderCheckPretty: citePretty }, { renderCheckJson: citeJson }, { renderCheckGithub: citeGithub }] = await Promise.all([
278
- import("./check-ZE5HIDOW.js"),
279
- import("./pretty-Q3C433DW.js"),
278
+ import("./check-7B77ZD2N.js"),
279
+ import("./pretty-R4BQD2VH.js"),
280
280
  import("./json-7WV7KL6H.js"),
281
- import("./github-63CZJGZS.js")
281
+ import("./github-WER7JUTN.js")
282
282
  ]);
283
283
  const run2 = await runCite({ inputs, configPath, cwd, onNotice });
284
284
  if (!run2.pages.some((p) => p.citations.length > 0 || p.findings.length > 0)) {
@@ -292,8 +292,8 @@ async function runDomain(domain, ctx) {
292
292
  case "lint": {
293
293
  if (!family.sections.has("lint")) return { skipped: NOT_SET_UP.lint };
294
294
  const [{ runLint }, { render: renderLint }] = await Promise.all([
295
- import("./lint-TBE35CCW.js"),
296
- import("./reporters-DH5HPFXJ.js")
295
+ import("./lint-QTI7XK2A.js"),
296
+ import("./reporters-FPP6JNDP.js")
297
297
  ]);
298
298
  const run2 = await runLint({ inputs, configPath, cwd, onNotice });
299
299
  return {
@@ -303,7 +303,7 @@ async function runDomain(domain, ctx) {
303
303
  }
304
304
  case "docevals": {
305
305
  const [{ runRun: runDocevals }, { render: renderDocevals }, { DocevalsError }] = await Promise.all([
306
- import("./run-LZXKVTM7.js"),
306
+ import("./run-YH5Z7RJ7.js"),
307
307
  import("./reporters-M6LJ2IYU.js"),
308
308
  import("./types-Y6TXHM7M.js")
309
309
  ]);
@@ -330,10 +330,10 @@ async function runDomain(domain, ctx) {
330
330
  }
331
331
  case "term": {
332
332
  const [{ runCheck: runTerm }, { renderFindingsPretty: termPretty }, { renderFindingsJson: termJson }, { renderFindingsGithub: termGithub }] = await Promise.all([
333
- import("./check-HBRX4FOR.js"),
334
- import("./pretty-CBV5XSMZ.js"),
335
- import("./json-JIUPGOUQ.js"),
336
- import("./github-IYOVHWHG.js")
333
+ import("./check-PTECPIIB.js"),
334
+ import("./pretty-4IONWSEP.js"),
335
+ import("./json-QR4G35KA.js"),
336
+ import("./github-ESK45CEZ.js")
337
337
  ]);
338
338
  const report = await runTerm({ inputs, configPath, cwd, allowEmpty: true, onNotice });
339
339
  if (report.terms === 0) return { skipped: NOT_SET_UP.term };
@@ -345,8 +345,8 @@ async function runDomain(domain, ctx) {
345
345
  case "graph": {
346
346
  if (!family.sections.has("graph")) return { skipped: NOT_SET_UP.graph };
347
347
  const [{ buildGraph }, { runCheck: runGraph, renderCheck: renderGraph }] = await Promise.all([
348
- import("./build-Q56FEXR6.js"),
349
- import("./check-OAJWC3WD.js")
348
+ import("./build-3KP2K3XN.js"),
349
+ import("./check-E4QCB7LS.js")
350
350
  ]);
351
351
  const built = await buildGraph({ config: configPath, cwd });
352
352
  for (const warning of built.warnings) onNotice(warning);
@@ -559,7 +559,7 @@ async function runTurnCheck(envelope, cwd, seams = {}) {
559
559
  let renderTurn;
560
560
  try {
561
561
  const [{ checkTurn }, reporters] = await Promise.all([
562
- import("./check-KUBELO5G.js"),
562
+ import("./check-NLL4NRYA.js"),
563
563
  import("./runtime-7QE3DW6S.js")
564
564
  ]);
565
565
  renderTurn = reporters.renderCheck;
@@ -612,7 +612,7 @@ async function tracevalsRow(cwd, opts) {
612
612
  { assertProviderSelection, resolveSelectionIdentity, selectHookProvider, selectProvider },
613
613
  { hostStatus }
614
614
  ] = await Promise.all([
615
- import("./config-YWSNBFEE.js"),
615
+ import("./config-TYXYQK3I.js"),
616
616
  import("./provider-527CO4DM.js"),
617
617
  import("./host-6GURH5HE.js")
618
618
  ]);
@@ -654,8 +654,8 @@ function ownSchemaCount(cwd, members) {
654
654
  return n;
655
655
  }
656
656
  async function citedPages(cwd, configPath) {
657
- const { prepareRun, readTarget } = await import("./check-ZE5HIDOW.js");
658
- const { readPage } = await import("./page-WQ3GQF76.js");
657
+ const { prepareRun, readTarget } = await import("./check-7B77ZD2N.js");
658
+ const { readPage } = await import("./page-FSXDXCDD.js");
659
659
  const prepared = await prepareRun({ inputs: [], configPath, cwd, checkSources: false }, "checked", "check");
660
660
  let n = 0;
661
661
  for (const file of prepared.files) {
@@ -682,14 +682,14 @@ async function row(domain, family, cwd, members) {
682
682
  return n > 0 ? inPlay(pages(n, "carries citations", "carry citations")) : notSetUp;
683
683
  }
684
684
  case "docevals": {
685
- const { runList: listEvals } = await import("./list-IZ4RIM72.js");
685
+ const { runList: listEvals } = await import("./list-JO4G3TS3.js");
686
686
  const { plans } = await listEvals([], { config: configPath, cwd });
687
687
  const n = plans.filter((p) => !p.skip && p.evals.length > 0).length;
688
688
  if (n === 0) return notSetUp;
689
689
  return inPlay(section ? "docevals: section" : pages(n, "declares evals", "declare evals"));
690
690
  }
691
691
  case "term": {
692
- const { runList: listTerms } = await import("./list-TNEJ3J77.js");
692
+ const { runList: listTerms } = await import("./list-O2MJUP5V.js");
693
693
  const { terms } = await listTerms({ inputs: [], configPath, cwd, allowEmpty: true });
694
694
  return terms.length > 0 ? inPlay(plural(terms.length, "term")) : notSetUp;
695
695
  }
@@ -904,4 +904,4 @@ export {
904
904
  buildStatus,
905
905
  hookScope
906
906
  };
907
- //# sourceMappingURL=cli-ZJRHU7MO.js.map
907
+ //# sourceMappingURL=cli-EH3I4IUX.js.map