@hawkeyexl/manni 4.8.1 → 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 (173) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-QMHYWGUA.js → batch-6NICDKRE.js} +12 -12
  3. package/dist/{build-ZGA3O3P4.js → build-3KP2K3XN.js} +11 -11
  4. package/dist/{calibrate-KBMFGKP3.js → calibrate-LUA3DWKD.js} +13 -13
  5. package/dist/{capture-C46UXFRK.js → capture-NETOHCB4.js} +12 -12
  6. package/dist/{check-UMI5ACCE.js → check-7B77ZD2N.js} +11 -11
  7. package/dist/{check-OAJWC3WD.js → check-E4QCB7LS.js} +5 -5
  8. package/dist/{check-CORYIW76.js → check-NLL4NRYA.js} +13 -13
  9. package/dist/{check-LLQ6PJV3.js → check-PTECPIIB.js} +10 -10
  10. package/dist/{chunk-N7J5C35C.js → chunk-2BV4FBC7.js} +2 -2
  11. package/dist/chunk-2BV4FBC7.js.map +1 -0
  12. package/dist/{chunk-PO5W6JAP.js → chunk-2JV7C4YV.js} +7 -7
  13. package/dist/{chunk-Z27GYQOY.js → chunk-2UCC26MO.js} +8 -8
  14. package/dist/{chunk-WBETAXO2.js → chunk-2W34HX2U.js} +5 -5
  15. package/dist/{chunk-ZIGIJBXG.js → chunk-2YJ5H5E6.js} +9 -9
  16. package/dist/{chunk-HWNSIEZK.js → chunk-3E2X2RBU.js} +6 -6
  17. package/dist/{chunk-Q3GFZJTY.js → chunk-4DLF5SA4.js} +35 -17
  18. package/dist/chunk-4DLF5SA4.js.map +1 -0
  19. package/dist/{chunk-BYVH727K.js → chunk-55GMOVKW.js} +2 -2
  20. package/dist/{chunk-C2JPBQCJ.js → chunk-5REEVKGH.js} +2 -2
  21. package/dist/{chunk-XXDXIIQ4.js → chunk-6AGESHHM.js} +2 -2
  22. package/dist/{chunk-GQBVZS5G.js → chunk-6LR73NMO.js} +6 -6
  23. package/dist/{chunk-XKBEHKWO.js → chunk-6M5VJOC2.js} +2 -1
  24. package/dist/{chunk-F734HIHT.js → chunk-7Y3N4Y72.js} +3 -3
  25. package/dist/{chunk-WUFP4V7B.js → chunk-ABHG6I3G.js} +1292 -126
  26. package/dist/chunk-ABHG6I3G.js.map +1 -0
  27. package/dist/{chunk-FEALEYSE.js → chunk-AO5TSDKT.js} +4 -4
  28. package/dist/{chunk-LF6FOF6U.js → chunk-BD7IXBWE.js} +15 -26
  29. package/dist/{chunk-LF6FOF6U.js.map → chunk-BD7IXBWE.js.map} +1 -1
  30. package/dist/{chunk-NB4ILZMQ.js → chunk-CCWMACJL.js} +8 -8
  31. package/dist/{chunk-K43X5VDR.js → chunk-D2UW3ZCK.js} +6 -6
  32. package/dist/{chunk-SV6UEQCU.js → chunk-DFCQ6BMI.js} +4 -4
  33. package/dist/{chunk-ECVQNGTH.js → chunk-DNZUBCGZ.js} +3 -3
  34. package/dist/{chunk-POGYWOJ2.js → chunk-EAUIQADY.js} +3 -3
  35. package/dist/{chunk-XDS3KQCK.js → chunk-G6FNWRAI.js} +4 -4
  36. package/dist/{chunk-6HMLYFEU.js → chunk-G7XD4QH5.js} +810 -5
  37. package/dist/chunk-G7XD4QH5.js.map +1 -0
  38. package/dist/{chunk-WUXD6VBD.js → chunk-GB2XPITA.js} +2 -2
  39. package/dist/{chunk-KPXOJMQ6.js → chunk-GCKHSBEN.js} +2 -2
  40. package/dist/{chunk-6QBJHRFC.js → chunk-GDLHTI5R.js} +129 -26
  41. package/dist/chunk-GDLHTI5R.js.map +1 -0
  42. package/dist/{chunk-NNFSIRVE.js → chunk-GXN7RRHR.js} +3 -3
  43. package/dist/{chunk-RCS5YFY2.js → chunk-H26VDFDS.js} +2 -2
  44. package/dist/{chunk-4VQBHTGA.js → chunk-IJ62BB2T.js} +5 -5
  45. package/dist/{chunk-WT6HMEEF.js → chunk-KBG463UK.js} +35 -8
  46. package/dist/{chunk-WT6HMEEF.js.map → chunk-KBG463UK.js.map} +1 -1
  47. package/dist/{chunk-UWY4B2PM.js → chunk-LQZQ5KGG.js} +4 -4
  48. package/dist/{chunk-VSOYZ7QH.js → chunk-PK7EKJ5T.js} +4 -4
  49. package/dist/{chunk-YVVMC4SZ.js → chunk-QBVP3SQP.js} +4 -4
  50. package/dist/{chunk-6MNOMHFI.js → chunk-QJRQ4BRC.js} +11 -11
  51. package/dist/{chunk-7LC4YJJ3.js → chunk-RODZ7MB7.js} +3 -3
  52. package/dist/{chunk-SXODK43S.js → chunk-RZVCWX5R.js} +4 -4
  53. package/dist/{chunk-5LAKRYXU.js → chunk-SUTMSDQ2.js} +3 -3
  54. package/dist/{chunk-6KKZXB2O.js → chunk-VVVKBUBO.js} +2 -2
  55. package/dist/{chunk-6ZR24A4S.js → chunk-VZVEP2OZ.js} +2 -2
  56. package/dist/{chunk-3FG2UU3H.js → chunk-WN47MNSK.js} +4 -4
  57. package/dist/{chunk-LAU6SVTJ.js → chunk-XU73V5XT.js} +7 -7
  58. package/dist/{chunk-77L5GNVO.js → chunk-Z5YHMRLF.js} +2 -2
  59. package/dist/{chunk-AO66Q66S.js → chunk-ZHRPH52H.js} +2 -2
  60. package/dist/chunk-ZMECS2IJ.js +27 -0
  61. package/dist/chunk-ZMECS2IJ.js.map +1 -0
  62. package/dist/{chunk-VD3EQSBI.js → chunk-ZXXFP2LA.js} +2 -2
  63. package/dist/{cli-SBJY2NQH.js → cli-4YYC6LCY.js} +15 -15
  64. package/dist/{cli-4B5RWL7P.js → cli-BIIUKPTE.js} +13 -12
  65. package/dist/{cli-4B5RWL7P.js.map → cli-BIIUKPTE.js.map} +1 -1
  66. package/dist/{cli-XIQKPNA7.js → cli-EH3I4IUX.js} +32 -32
  67. package/dist/cli-EH3I4IUX.js.map +1 -0
  68. package/dist/{cli-MNNOXWYU.js → cli-HO62TOM2.js} +8 -8
  69. package/dist/cli-LWST5FQH.js +839 -0
  70. package/dist/cli-LWST5FQH.js.map +1 -0
  71. package/dist/{cli-UB5W75GJ.js → cli-P2X7PNY6.js} +12 -12
  72. package/dist/{cli-QR3ZQZA4.js → cli-SGVFZOAW.js} +19 -19
  73. package/dist/{cli-5AML7QR2.js → cli-TELPAMJO.js} +14 -14
  74. package/dist/{cli-I4GBPLRM.js → cli-UETKXHJN.js} +3 -3
  75. package/dist/{cli-WWDARAWS.js → cli-V2DI3K2R.js} +14 -14
  76. package/dist/cli.js +18 -11
  77. package/dist/cli.js.map +1 -1
  78. package/dist/{config-YWSNBFEE.js → config-TYXYQK3I.js} +3 -3
  79. package/dist/docmeta.js +7 -7
  80. package/dist/{github-TIZ3ZR3D.js → github-ESK45CEZ.js} +10 -10
  81. package/dist/{github-WKOJRW7P.js → github-WER7JUTN.js} +12 -12
  82. package/dist/index.js +35 -34
  83. package/dist/index.js.map +1 -1
  84. package/dist/{json-4FUOZ3XX.js → json-QR4G35KA.js} +10 -10
  85. package/dist/{lint-7VQFESHK.js → lint-QTI7XK2A.js} +11 -10
  86. package/dist/{list-7U2MBDIM.js → list-JO4G3TS3.js} +10 -10
  87. package/dist/{list-W6EUAOBV.js → list-O2MJUP5V.js} +10 -10
  88. package/dist/{page-WZLBKSCD.js → page-FSXDXCDD.js} +9 -9
  89. package/dist/{prepare-FPEWAHJH.js → prepare-UPIBTFNS.js} +11 -11
  90. package/dist/{pretty-7M4X4TCY.js → pretty-4IONWSEP.js} +10 -10
  91. package/dist/{pretty-CUCMQU5R.js → pretty-R4BQD2VH.js} +11 -11
  92. package/dist/{reporters-DQVSDXV6.js → reporters-DHO2BXAD.js} +5 -5
  93. package/dist/{reporters-KYJE54JS.js → reporters-FPP6JNDP.js} +9 -9
  94. package/dist/{run-ABGXGOGQ.js → run-YH5Z7RJ7.js} +10 -10
  95. package/dist/{term-HTIG3YDC.js → term-ASM4LVYC.js} +279 -150
  96. package/dist/term-ASM4LVYC.js.map +1 -0
  97. package/dist/{validate-HWNU3MDY.js → validate-7JI3H57P.js} +5 -5
  98. package/package.json +1 -1
  99. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  100. package/dist/chunk-6HMLYFEU.js.map +0 -1
  101. package/dist/chunk-6QBJHRFC.js.map +0 -1
  102. package/dist/chunk-N7J5C35C.js.map +0 -1
  103. package/dist/chunk-Q3GFZJTY.js.map +0 -1
  104. package/dist/chunk-WUFP4V7B.js.map +0 -1
  105. package/dist/cli-XIQKPNA7.js.map +0 -1
  106. package/dist/term-HTIG3YDC.js.map +0 -1
  107. /package/dist/{batch-QMHYWGUA.js.map → batch-6NICDKRE.js.map} +0 -0
  108. /package/dist/{build-ZGA3O3P4.js.map → build-3KP2K3XN.js.map} +0 -0
  109. /package/dist/{calibrate-KBMFGKP3.js.map → calibrate-LUA3DWKD.js.map} +0 -0
  110. /package/dist/{capture-C46UXFRK.js.map → capture-NETOHCB4.js.map} +0 -0
  111. /package/dist/{check-LLQ6PJV3.js.map → check-7B77ZD2N.js.map} +0 -0
  112. /package/dist/{check-OAJWC3WD.js.map → check-E4QCB7LS.js.map} +0 -0
  113. /package/dist/{check-CORYIW76.js.map → check-NLL4NRYA.js.map} +0 -0
  114. /package/dist/{check-UMI5ACCE.js.map → check-PTECPIIB.js.map} +0 -0
  115. /package/dist/{chunk-PO5W6JAP.js.map → chunk-2JV7C4YV.js.map} +0 -0
  116. /package/dist/{chunk-Z27GYQOY.js.map → chunk-2UCC26MO.js.map} +0 -0
  117. /package/dist/{chunk-WBETAXO2.js.map → chunk-2W34HX2U.js.map} +0 -0
  118. /package/dist/{chunk-ZIGIJBXG.js.map → chunk-2YJ5H5E6.js.map} +0 -0
  119. /package/dist/{chunk-HWNSIEZK.js.map → chunk-3E2X2RBU.js.map} +0 -0
  120. /package/dist/{chunk-BYVH727K.js.map → chunk-55GMOVKW.js.map} +0 -0
  121. /package/dist/{chunk-C2JPBQCJ.js.map → chunk-5REEVKGH.js.map} +0 -0
  122. /package/dist/{chunk-XXDXIIQ4.js.map → chunk-6AGESHHM.js.map} +0 -0
  123. /package/dist/{chunk-GQBVZS5G.js.map → chunk-6LR73NMO.js.map} +0 -0
  124. /package/dist/{chunk-XKBEHKWO.js.map → chunk-6M5VJOC2.js.map} +0 -0
  125. /package/dist/{chunk-F734HIHT.js.map → chunk-7Y3N4Y72.js.map} +0 -0
  126. /package/dist/{chunk-FEALEYSE.js.map → chunk-AO5TSDKT.js.map} +0 -0
  127. /package/dist/{chunk-NB4ILZMQ.js.map → chunk-CCWMACJL.js.map} +0 -0
  128. /package/dist/{chunk-K43X5VDR.js.map → chunk-D2UW3ZCK.js.map} +0 -0
  129. /package/dist/{chunk-SV6UEQCU.js.map → chunk-DFCQ6BMI.js.map} +0 -0
  130. /package/dist/{chunk-ECVQNGTH.js.map → chunk-DNZUBCGZ.js.map} +0 -0
  131. /package/dist/{chunk-POGYWOJ2.js.map → chunk-EAUIQADY.js.map} +0 -0
  132. /package/dist/{chunk-XDS3KQCK.js.map → chunk-G6FNWRAI.js.map} +0 -0
  133. /package/dist/{chunk-WUXD6VBD.js.map → chunk-GB2XPITA.js.map} +0 -0
  134. /package/dist/{chunk-KPXOJMQ6.js.map → chunk-GCKHSBEN.js.map} +0 -0
  135. /package/dist/{chunk-NNFSIRVE.js.map → chunk-GXN7RRHR.js.map} +0 -0
  136. /package/dist/{chunk-RCS5YFY2.js.map → chunk-H26VDFDS.js.map} +0 -0
  137. /package/dist/{chunk-4VQBHTGA.js.map → chunk-IJ62BB2T.js.map} +0 -0
  138. /package/dist/{chunk-UWY4B2PM.js.map → chunk-LQZQ5KGG.js.map} +0 -0
  139. /package/dist/{chunk-VSOYZ7QH.js.map → chunk-PK7EKJ5T.js.map} +0 -0
  140. /package/dist/{chunk-YVVMC4SZ.js.map → chunk-QBVP3SQP.js.map} +0 -0
  141. /package/dist/{chunk-6MNOMHFI.js.map → chunk-QJRQ4BRC.js.map} +0 -0
  142. /package/dist/{chunk-7LC4YJJ3.js.map → chunk-RODZ7MB7.js.map} +0 -0
  143. /package/dist/{chunk-SXODK43S.js.map → chunk-RZVCWX5R.js.map} +0 -0
  144. /package/dist/{chunk-5LAKRYXU.js.map → chunk-SUTMSDQ2.js.map} +0 -0
  145. /package/dist/{chunk-6KKZXB2O.js.map → chunk-VVVKBUBO.js.map} +0 -0
  146. /package/dist/{chunk-6ZR24A4S.js.map → chunk-VZVEP2OZ.js.map} +0 -0
  147. /package/dist/{chunk-3FG2UU3H.js.map → chunk-WN47MNSK.js.map} +0 -0
  148. /package/dist/{chunk-LAU6SVTJ.js.map → chunk-XU73V5XT.js.map} +0 -0
  149. /package/dist/{chunk-77L5GNVO.js.map → chunk-Z5YHMRLF.js.map} +0 -0
  150. /package/dist/{chunk-AO66Q66S.js.map → chunk-ZHRPH52H.js.map} +0 -0
  151. /package/dist/{chunk-VD3EQSBI.js.map → chunk-ZXXFP2LA.js.map} +0 -0
  152. /package/dist/{cli-SBJY2NQH.js.map → cli-4YYC6LCY.js.map} +0 -0
  153. /package/dist/{cli-MNNOXWYU.js.map → cli-HO62TOM2.js.map} +0 -0
  154. /package/dist/{cli-UB5W75GJ.js.map → cli-P2X7PNY6.js.map} +0 -0
  155. /package/dist/{cli-QR3ZQZA4.js.map → cli-SGVFZOAW.js.map} +0 -0
  156. /package/dist/{cli-5AML7QR2.js.map → cli-TELPAMJO.js.map} +0 -0
  157. /package/dist/{cli-I4GBPLRM.js.map → cli-UETKXHJN.js.map} +0 -0
  158. /package/dist/{cli-WWDARAWS.js.map → cli-V2DI3K2R.js.map} +0 -0
  159. /package/dist/{config-YWSNBFEE.js.map → config-TYXYQK3I.js.map} +0 -0
  160. /package/dist/{github-TIZ3ZR3D.js.map → github-ESK45CEZ.js.map} +0 -0
  161. /package/dist/{github-WKOJRW7P.js.map → github-WER7JUTN.js.map} +0 -0
  162. /package/dist/{json-4FUOZ3XX.js.map → json-QR4G35KA.js.map} +0 -0
  163. /package/dist/{lint-7VQFESHK.js.map → lint-QTI7XK2A.js.map} +0 -0
  164. /package/dist/{list-7U2MBDIM.js.map → list-JO4G3TS3.js.map} +0 -0
  165. /package/dist/{list-W6EUAOBV.js.map → list-O2MJUP5V.js.map} +0 -0
  166. /package/dist/{page-WZLBKSCD.js.map → page-FSXDXCDD.js.map} +0 -0
  167. /package/dist/{prepare-FPEWAHJH.js.map → prepare-UPIBTFNS.js.map} +0 -0
  168. /package/dist/{pretty-7M4X4TCY.js.map → pretty-4IONWSEP.js.map} +0 -0
  169. /package/dist/{pretty-CUCMQU5R.js.map → pretty-R4BQD2VH.js.map} +0 -0
  170. /package/dist/{reporters-DQVSDXV6.js.map → reporters-DHO2BXAD.js.map} +0 -0
  171. /package/dist/{reporters-KYJE54JS.js.map → reporters-FPP6JNDP.js.map} +0 -0
  172. /package/dist/{run-ABGXGOGQ.js.map → run-YH5Z7RJ7.js.map} +0 -0
  173. /package/dist/{validate-HWNU3MDY.js.map → validate-7JI3H57P.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 { 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,GA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iBAAiB,SAAY,CAAC,IAAI,EAAE,aAAa;AAAA;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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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!/usr/bin/env node
2
2
  import {
3
3
  idHash
4
- } from "./chunk-WUXD6VBD.js";
5
- import "./chunk-7LC4YJJ3.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-POGYWOJ2.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-XDS3KQCK.js";
17
- import "./chunk-WBETAXO2.js";
16
+ import "./chunk-G6FNWRAI.js";
17
+ import "./chunk-2W34HX2U.js";
18
18
  import {
19
19
  memberOf,
20
20
  retainMembers
21
- } from "./chunk-WT6HMEEF.js";
22
- import "./chunk-YVVMC4SZ.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-6HMLYFEU.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-N7J5C35C.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-HWNU3MDY.js"),
265
- import("./reporters-DQVSDXV6.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-UMI5ACCE.js"),
279
- import("./pretty-CUCMQU5R.js"),
278
+ import("./check-7B77ZD2N.js"),
279
+ import("./pretty-R4BQD2VH.js"),
280
280
  import("./json-7WV7KL6H.js"),
281
- import("./github-WKOJRW7P.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-7VQFESHK.js"),
296
- import("./reporters-KYJE54JS.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-ABGXGOGQ.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-LLQ6PJV3.js"),
334
- import("./pretty-7M4X4TCY.js"),
335
- import("./json-4FUOZ3XX.js"),
336
- import("./github-TIZ3ZR3D.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-ZGA3O3P4.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-CORYIW76.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-UMI5ACCE.js");
658
- const { readPage } = await import("./page-WZLBKSCD.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-7U2MBDIM.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-W6EUAOBV.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-XIQKPNA7.js.map
907
+ //# sourceMappingURL=cli-EH3I4IUX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/family/cli.ts","../src/family/core/envelope.ts","../src/family/core/in-play.ts","../src/family/commands/check.ts","../src/family/core/changed.ts","../src/family/core/said-once.ts","../src/family/commands/status.ts"],"sourcesContent":["/**\n * The two family verbs, `manni check` and `manni status`, mounted on the\n * umbrella with `addCommand`. They are the only verbs it carries: each\n * orchestrates other domains' command cores and owns no checks of its own.\n *\n * Run by hand or in CI they follow the family contract: 0 clean, 1 errors, 2\n * operational, the report on stdout and notices on stderr. Under a Claude\n * Code hook envelope on stdin they speak the hook protocol instead, which\n * changes where output goes and what the exit code means, never what is\n * checked beyond the scope.\n */\nimport { resolve } from \"node:path\";\nimport { Command, Option } from \"commander\";\nimport { shouldColor } from \"../shared/color.js\";\nimport { errorMessage } from \"../shared/errors.js\";\nimport { programName } from \"../shared/program-name.js\";\nimport { fail } from \"../shared/run.js\";\nimport { notice } from \"../shared/warn.js\";\nimport { readEnvelope, type Envelope } from \"./core/envelope.js\";\nimport { FamilyError, labelFrom } from \"./core/in-play.js\";\nimport {\n CHECK_FORMATS,\n EDIT_TOOLS,\n exitCodeFor,\n hookFailure,\n hookReply,\n render,\n runFamilyCheck,\n runTurnCheck,\n turnReply,\n type CheckFormat,\n type FamilyCheckRun,\n type HookReply,\n type Scope,\n} from \"./commands/check.js\";\nimport {\n STATUS_FORMATS,\n agentLines,\n exportGeneratedBy,\n renderStatus,\n runStatus,\n type StatusFormat,\n} from \"./commands/status.js\";\n\ninterface CheckCliOptions {\n config?: string;\n format: CheckFormat;\n /** `--no-color`: `false` when given. */\n color: boolean;\n}\n\ninterface StatusCliOptions {\n config?: string;\n format: StatusFormat;\n}\n\nfunction send(reply: HookReply): void {\n if (reply.stdout !== undefined) process.stdout.write(reply.stdout);\n if (reply.stderr !== undefined) process.stderr.write(reply.stderr);\n process.exitCode = reply.exitCode;\n}\n\n/**\n * The file checks a hook asks for, or `undefined` when this event runs none.\n * A SubagentStop runs none: its subagent's turn is judged alone.\n */\nexport function hookScope(envelope: Envelope, cwd: string): { scope: Scope; file?: string } | undefined {\n if (envelope.event === \"Stop\") return { scope: { kind: \"changed\" } };\n if (envelope.event !== \"PostToolUse\") return undefined;\n if (envelope.toolName === undefined || !EDIT_TOOLS.includes(envelope.toolName)) return undefined;\n if (envelope.filePath === undefined) return undefined;\n const file = labelFrom(cwd, resolve(cwd, envelope.filePath));\n return { scope: { kind: \"paths\", paths: [file] }, file };\n}\n\n/** The events that end a turn, which tracevals judges (proposal 0079). */\nconst TURN_EVENTS: readonly string[] = [\"Stop\", \"SubagentStop\"];\n\nasync function checkUnderHook(paths: string[], options: CheckCliOptions, envelope: Envelope): Promise<void> {\n const cwd = resolve(envelope.cwd ?? process.cwd());\n // Positional paths win over the envelope's own scope.\n const asked: { scope: Scope; file?: string } | undefined =\n paths.length > 0 ? { scope: { kind: \"paths\", paths }, file: paths.join(\", \") } : hookScope(envelope, cwd);\n const turnEvent = TURN_EVENTS.includes(envelope.event);\n if (asked === undefined && !turnEvent) return;\n let run: FamilyCheckRun | undefined;\n if (asked !== undefined) {\n try {\n run = await runFamilyCheck({\n cwd,\n scope: asked.scope,\n allowMissing: true,\n ...(options.config === undefined ? {} : { configPath: options.config }),\n // stdout and stderr are the hook's channels; a notice is not for the agent.\n onNotice: () => undefined,\n });\n } catch (err) {\n // Nothing set up for the file checks is not the end of a turn's judgement.\n if (!(err instanceof FamilyError && err.quiet) && !turnEvent) {\n send(hookFailure(errorMessage(err), envelope, asked.file));\n return;\n }\n }\n }\n if (!turnEvent) {\n if (run !== undefined) send(hookReply(run, envelope));\n return;\n }\n send(turnReply(run, await runTurnCheck(envelope, cwd), envelope));\n}\n\nexport function buildCheck(): Command {\n return new Command(\"check\")\n .description(\"Run every check this repository has set up, and nothing else\")\n .argument(\"[paths...]\", \"files, directories, or globs; the per-file checks run on the collection members among them\")\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .addOption(\n new Option(\"-f, --format <format>\", \"output (not read under a hook)\")\n .choices(CHECK_FORMATS)\n .default(\"pretty\"),\n )\n .option(\"--no-color\", \"disable colored output\")\n .showHelpAfterError(\"(add --help for usage)\")\n .exitOverride()\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni check # every in-play check, the CI gate\",\n \" manni check docs/limits.md # per-file checks on one page\",\n \" manni check -f github # in a GitHub workflow\",\n \" manni check docs/ -f json # scripting form\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: CheckCliOptions) => {\n const envelope = await readEnvelope();\n if (envelope !== undefined) {\n await checkUnderHook(paths, options, envelope);\n return;\n }\n try {\n const run = await runFamilyCheck({\n scope: paths.length > 0 ? { kind: \"paths\", paths } : { kind: \"all\" },\n ...(options.config === undefined ? {} : { configPath: options.config }),\n onNotice: notice,\n });\n for (const check of run.checks) {\n if (check.status === \"error\") {\n process.stderr.write(`${programName()} ${check.command} could not run: ${check.message}\\n`);\n }\n }\n const color = shouldColor({ noColor: !options.color, isTTY: process.stdout.isTTY });\n const text = render(run, options.format, color);\n if (text.length > 0) process.stdout.write(`${text}\\n`);\n process.exitCode = exitCodeFor(run);\n } catch (err) {\n fail(err);\n }\n });\n}\n\nexport function buildStatus(): Command {\n return new Command(\"status\")\n .description(\"Say what is set up here, and so what manni check runs\")\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .addOption(\n new Option(\"-f, --format <format>\", \"output\").choices(STATUS_FORMATS).default(\"pretty\"),\n )\n .showHelpAfterError(\"(add --help for usage)\")\n .exitOverride()\n .action(async (options: StatusCliOptions) => {\n const envelope = await readEnvelope();\n const configOption = options.config === undefined ? {} : { configPath: options.config };\n if (envelope?.event === \"SessionStart\") {\n try {\n const report = await runStatus({ cwd: resolve(envelope.cwd ?? process.cwd()), ...configOption });\n // The agent lines promise checks, so they need a domain in play to be true.\n const lines = report.domains.some((d) => d.status === \"in-play\") ? `\\n\\n${agentLines(report)}` : \"\";\n process.stdout.write(`${renderStatus(report, \"pretty\")}${lines}\\n`);\n exportGeneratedBy(envelope);\n } catch {\n // No config, or one that cannot be read: the session starts without a word.\n }\n return;\n }\n try {\n const report = await runStatus(configOption);\n process.stdout.write(`${renderStatus(report, options.format)}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n}\n","/**\n * The Claude Code hook envelope, detected rather than switched.\n *\n * A hook command gets one JSON object on stdin, and Claude Code closes the\n * stream after it. When stdin is not a terminal and parses as an object with a\n * string `hook_event_name`, `manni check` and `manni status` speak the hook\n * protocol. Anything else is a run by hand, and stdin is left unread beyond\n * that one look. The look never hangs: `readStdin` gives up on a stream that\n * stays silent, which is what an inherited pipe nobody writes to looks like.\n */\nimport { readStdin } from \"../../tracevals/capture/hook.js\";\n\nexport interface Envelope {\n /** `hook_event_name`: `PostToolUse`, `Stop`, `SessionStart`, … */\n event: string;\n /** The directory the hook fired in; relative paths resolve from it. */\n cwd?: string;\n /** `tool_name`, on a tool event. */\n toolName?: string;\n /** `tool_input.file_path`, or `tool_input.notebook_path` for a notebook. */\n filePath?: string;\n /** `stop_hook_active`: this stop already follows one repair pass. */\n stopHookActive: boolean;\n /** `model`, on `SessionStart`: a string, or an object carrying `id`. */\n model?: string;\n /** `session_id`. */\n sessionId?: string;\n /** `transcript_path`: the session's own transcript. */\n transcriptPath?: string;\n /** `agent_transcript_path`, on `SubagentStop`: the subagent's own transcript. */\n agentTranscriptPath?: string;\n /** `agent_id`, on `SubagentStop`. */\n agentId?: string;\n /** `agent_type`, on `SubagentStop`. */\n agentType?: string;\n /** `last_assistant_message`, on `Stop` and `SubagentStop`. */\n lastAssistantMessage?: string;\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** The envelope in `text`, or `undefined` when `text` is not one. */\nexport function parseEnvelope(text: string): Envelope | undefined {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return undefined;\n }\n const doc = record(parsed);\n const event = str(doc?.hook_event_name);\n if (doc === undefined || event === undefined) return undefined;\n const input = record(doc.tool_input);\n const filePath = str(input?.file_path) ?? str(input?.notebook_path);\n const cwd = str(doc.cwd);\n const toolName = str(doc.tool_name);\n const model = str(doc.model) ?? str(record(doc.model)?.id);\n const strings = {\n sessionId: str(doc.session_id),\n transcriptPath: str(doc.transcript_path),\n agentTranscriptPath: str(doc.agent_transcript_path),\n agentId: str(doc.agent_id),\n agentType: str(doc.agent_type),\n lastAssistantMessage: str(doc.last_assistant_message),\n };\n const given = Object.fromEntries(Object.entries(strings).filter(([, v]) => v !== undefined)) as Partial<\n Record<keyof typeof strings, string>\n >;\n return {\n event,\n stopHookActive: doc.stop_hook_active === true,\n ...(cwd === undefined ? {} : { cwd }),\n ...(toolName === undefined ? {} : { toolName }),\n ...(filePath === undefined ? {} : { filePath }),\n ...(model === undefined ? {} : { model }),\n ...given,\n };\n}\n\n/** The envelope on stdin, or `undefined` for a run by hand. */\nexport async function readEnvelope(\n stream: NodeJS.ReadStream = process.stdin,\n): Promise<Envelope | undefined> {\n if (stream.isTTY) return undefined;\n try {\n return parseEnvelope(await readStdin(stream));\n } catch {\n // Too large to be an envelope: a run by hand with something piped in.\n return undefined;\n }\n}\n","/**\n * What is set up, and so what `manni check` runs.\n *\n * There are no keys of the family's own. A domain is in play when its own\n * section of `manni.config.yaml` exists, or when the content carries its\n * declarations. Nothing manni would apply by default counts as set up:\n *\n * | Domain | In play when |\n * |---|---|\n * | meta | a file's schema set is more than the built-in defaults: `meta:` covers it, or it names its own `$schema` |\n * | cite | a page carries citations |\n * | lint | `lint:` exists |\n * | docevals | a page resolves evals, from `docevals:` or its own declarations |\n * | term | the collections hold a term |\n * | graph | `graph:` exists |\n * | tracevals | `tracevals.runtime` exists; it judges the turn a Stop or SubagentStop hook ends |\n * | a11y | never run by `check`: it needs a running site |\n *\n * Only members of a declared collection are file-checked. tracevals judges a\n * turn, not files, so it needs no collection.\n */\nimport { relative, resolve, sep } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport type { CollectionConfig } from \"../../shared/collections.js\";\nimport {\n findFamilyConfigFile,\n readFamilyConfigFile,\n type ConfigFile,\n} from \"../../shared/config-file.js\";\nimport { ToolError } from \"../../shared/errors.js\";\nimport { memberOf, retainMembers } from \"../../meta/core/collections.js\";\nimport { resolveTargetSet } from \"../../meta/internal.js\";\n\n/** An operational error of `manni check` or `manni status`: exit 2. */\nexport class FamilyError extends ToolError {\n constructor(\n message: string,\n /** Set for the two conditions a hook answers with silence. */\n readonly quiet = false,\n ) {\n super(message);\n this.name = \"FamilyError\";\n }\n}\n\nexport function noConfigError(cwd: string): FamilyError {\n return new FamilyError(\n `No manni.config.yaml found from ${cwd} up to the repository root. manni check runs the checks it sets up.`,\n true,\n );\n}\n\nexport function nothingSetUpError(): FamilyError {\n return new FamilyError(\n \"Nothing is set up to check in manni.config.yaml. manni status says what each domain needs.\",\n true,\n );\n}\n\n/** The domains `check` can run, in the order it runs and reports them. */\nexport const DOMAINS = [\"meta\", \"cite\", \"lint\", \"docevals\", \"term\", \"graph\"] as const;\nexport type Domain = (typeof DOMAINS)[number];\n\n/** Each domain's check, as `check` names it. */\nexport const COMMANDS: Readonly<Record<Domain, string>> = {\n meta: \"meta validate\",\n cite: \"cite check\",\n lint: \"lint check\",\n docevals: \"docevals run\",\n term: \"term check\",\n graph: \"graph check\",\n};\n\n/** Why a domain is not in play, as both `check` and `status` say it. */\nexport const NOT_SET_UP: Readonly<Record<Domain, string>> = {\n meta: \"no meta: section\",\n cite: \"no page carries citations\",\n lint: \"no lint: section\",\n docevals: \"no page resolves any evals\",\n term: \"no terms in any collection\",\n graph: \"no graph: section\",\n};\n\n/** Why `meta` skips files when `meta:` exists but covers none of them. */\nexport const META_DEFAULTS_ONLY = \"only the built-in default schemas cover these files\";\n\n/**\n * The domains `check` does not run here, and what to run instead. tracevals\n * leaves this list when `tracevals.runtime` exists (`Family.runtime`).\n */\nexport const NOT_CHECKED: ReadonlyArray<readonly [string, string]> = [\n [\"a11y\", \"run manni site preview, then manni a11y check\"],\n [\"tracevals\", \"run manni tracevals run over sessions\"],\n];\n\n/** `1 page`, `2 pages`. */\nexport function plural(n: number, one: string, many = `${one}s`): string {\n return `${String(n)} ${n === 1 ? one : many}`;\n}\n\nexport interface Family {\n file: ConfigFile;\n /**\n * The config each domain core is handed, so every one reads this file\n * rather than discovering its own: as typed, or as discovery found it,\n * relative to `cwd`.\n */\n configPath: string;\n /** The top-level keys of the file: `meta`, `lint`, `graph`, … */\n sections: ReadonlySet<string>;\n /** `tracevals.runtime` exists: tracevals judges each turn under the hooks. */\n runtime: boolean;\n collections: readonly CollectionConfig[];\n}\n\nfunction toError(message: string): FamilyError {\n return new FamilyError(message);\n}\n\nexport async function loadFamily(cwd: string, configPath?: string): Promise<Family> {\n const file =\n configPath === undefined\n ? await findFamilyConfigFile(cwd, toError)\n : await readFamilyConfigFile(configPath, cwd, toError);\n if (file === null) throw noConfigError(cwd);\n // Already parsed once by the loader, which would have thrown on bad YAML.\n const doc = parseYaml(file.text) as unknown;\n const top = record(doc);\n const sections = new Set(top === undefined ? [] : Object.keys(top));\n const tracevals = record(top?.tracevals);\n // The old `conformance` key counts too. tracevals' loader refuses it and\n // names `runtime`, and only a tracevals in play loads that config, so a\n // config not yet migrated reaches `status` as an error, not as a silent skip.\n const runtime = tracevals?.runtime !== undefined || tracevals?.conformance !== undefined;\n return { file, configPath: configPath ?? file.source, sections, runtime, collections: file.collections };\n}\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** A path as a label relative to `cwd`, posix, the way the domains print one. */\nexport function labelFrom(cwd: string, path: string): string {\n return relative(cwd, path).split(sep).join(\"/\");\n}\n\n/** The collections a file at `label` (relative to `cwd`) belongs to. */\nexport function collectionsOf(family: Family, cwd: string, label: string): string[] {\n return memberOf(family.collections, family.file.dir, cwd, label);\n}\n\n/** Every member of every collection, labelled from `cwd`. */\nexport async function listMembers(family: Family, cwd: string): Promise<string[]> {\n const dir = family.file.dir;\n const { files } = await resolveTargetSet({\n inputs: family.collections.flatMap((c) => c.paths),\n cwd: dir,\n allowEmpty: true,\n });\n return retainMembers(files, (label) => memberOf(family.collections, dir, dir, label)).map(\n (label) => labelFrom(cwd, resolve(dir, label)),\n );\n}\n","/**\n * `manni check`: every check the repository has set up, and nothing else.\n *\n * It owns no checks. Each one is a domain's own command core, run in process\n * with the family config handed to it, and each report is that domain's own\n * reporter's output. What this adds is the choice of what runs (`in-play.ts`),\n * the scope, and one verdict over all of it.\n *\n * Scope:\n *\n * - `all`: every in-play check over every collection, per-file and set-wide.\n * Each domain runs bare, exactly as its own CI step would.\n * - `paths`: the per-file checks on the collection members among the paths.\n * - `changed`: the per-file checks on the git working tree's changes, plus\n * `cite` set-wide. `term` runs set-wide too when a collection document\n * changed or was removed. `graph` never runs here; only `all` checks it.\n * A clean tree runs nothing.\n *\n * `cite` is per-file on paths and set-wide otherwise: a source edit can drift\n * any page's citation, so after a session the whole set is what is checked.\n */\nimport { basename, extname, resolve } from \"node:path\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\nimport { ToolError, errorMessage } from \"../../shared/errors.js\";\nimport { warn } from \"../../shared/warn.js\";\nimport { resolveTargetSet } from \"../../meta/internal.js\";\nimport { supportedExtensions } from \"../../meta/extractors/index.js\";\nimport type { TurnCheckInput, TurnCheckResult } from \"../../tracevals/commands/check.js\";\nimport { changedFiles } from \"../core/changed.js\";\nimport { sayOnce } from \"../core/said-once.js\";\nimport type { Envelope } from \"../core/envelope.js\";\nimport {\n COMMANDS,\n DOMAINS,\n META_DEFAULTS_ONLY,\n NOT_SET_UP,\n collectionsOf,\n labelFrom,\n listMembers,\n loadFamily,\n nothingSetUpError,\n plural,\n type Domain,\n type Family,\n} from \"../core/in-play.js\";\nimport { withSharedWalks } from \"../../meta/core/load-files.js\";\n\nexport const CHECK_FORMATS = [\"pretty\", \"json\", \"github\"] as const;\nexport type CheckFormat = (typeof CHECK_FORMATS)[number];\n\nexport type Scope =\n | { kind: \"all\" }\n | { kind: \"paths\"; paths: string[] }\n | { kind: \"changed\" };\n\nexport interface FamilyCheckOptions {\n /** Where paths resolve and the domains run. Default `process.cwd()`. */\n cwd?: string;\n /** `-c, --config`. */\n configPath?: string;\n scope: Scope;\n /**\n * Leave out a named path that does not exist, rather than failing on it. A\n * hook names a file the edit may have just removed.\n */\n allowMissing?: boolean;\n /** Diagnostics: the outside-every-collection notice, and the domains' own. */\n onNotice?: (message: string) => void;\n}\n\n/** A check that ran. `render` is the domain's own reporter. */\nexport interface RanCheck {\n command: string;\n status: \"pass\" | \"fail\";\n render: (format: CheckFormat, color: boolean) => string;\n}\n\n/** A check that did not run: not in play, or it could not. */\nexport interface NotRunCheck {\n command: string;\n status: \"skipped\" | \"error\";\n message: string;\n}\n\nexport type CheckOutcome = RanCheck | NotRunCheck;\n\nexport interface FamilyCheckRun {\n status: \"pass\" | \"fail\";\n /** The collection members the per-file checks covered, labelled from `cwd`. */\n files: string[];\n checks: CheckOutcome[];\n}\n\ntype Outcome =\n | { skipped: string }\n | { failed: boolean; render: (format: CheckFormat, color: boolean) => string };\n\ninterface Context {\n family: Family;\n cwd: string;\n /** The per-file inputs, or `[]` for a bare run over the collections. */\n inputs: string[];\n onNotice: (message: string) => void;\n}\n\n/**\n * Each domain's command core and reporter are imported where it runs: a hook\n * checks one page with four domains, and the other two (the RDF stack among\n * them) are worth not loading.\n */\nasync function runDomain(domain: Domain, ctx: Context): Promise<Outcome> {\n const { family, cwd, inputs, onNotice } = ctx;\n const configPath = family.configPath;\n switch (domain) {\n case \"meta\": {\n const [{ runValidate }, { render: renderMeta }] = await Promise.all([\n import(\"../../meta/commands/validate.js\"),\n import(\"../../meta/reporters/index.js\"),\n ]);\n const run = await runValidate({ inputs, configPath, cwd, skipDefaultOnly: true, onNotice });\n if (run.results.length === 0) {\n return { skipped: family.sections.has(\"meta\") ? META_DEFAULTS_ONLY : NOT_SET_UP.meta };\n }\n return {\n failed: run.summary.failed > 0,\n render: (format, color) =>\n renderMeta(format, run.results, run.summary, { color, quiet: true, frame: run.frame, onNotice }),\n };\n }\n case \"cite\": {\n const [{ runCheck: runCite }, { renderCheckPretty: citePretty }, { renderCheckJson: citeJson }, { renderCheckGithub: citeGithub }] =\n await Promise.all([\n import(\"../../cite/commands/check.js\"),\n import(\"../../cite/reporters/pretty.js\"),\n import(\"../../cite/reporters/json.js\"),\n import(\"../../cite/reporters/github.js\"),\n ]);\n const run = await runCite({ inputs, configPath, cwd, onNotice });\n if (!run.pages.some((p) => p.citations.length > 0 || p.findings.length > 0)) {\n return { skipped: NOT_SET_UP.cite };\n }\n return {\n failed: run.summary.failed > 0,\n render: (format, color) =>\n format === \"json\"\n ? citeJson(run)\n : format === \"github\"\n ? citeGithub(run)\n : citePretty(run, { color, quiet: true }),\n };\n }\n case \"lint\": {\n if (!family.sections.has(\"lint\")) return { skipped: NOT_SET_UP.lint };\n const [{ runLint }, { render: renderLint }] = await Promise.all([\n import(\"../../lint/commands/lint.js\"),\n import(\"../../lint/reporters/index.js\"),\n ]);\n const run = await runLint({ inputs, configPath, cwd, onNotice });\n return {\n failed: run.summary.failed > 0,\n render: (format, color) => renderLint(run, format, { color }),\n };\n }\n case \"docevals\": {\n const [{ runRun: runDocevals }, { render: renderDocevals }, { DocevalsError }] = await Promise.all([\n import(\"../../docevals/commands/run.js\"),\n import(\"../../docevals/reporters/index.js\"),\n import(\"../../docevals/types.js\"),\n ]);\n let report;\n try {\n report = await runDocevals(inputs, {\n config: configPath,\n cwd,\n deterministicOnly: true,\n generate: false,\n execution: false,\n toolVersion: pkg.version,\n });\n } catch (err) {\n if (err instanceof DocevalsError && err.code === \"nothing-resolved\") {\n return { skipped: NOT_SET_UP.docevals };\n }\n throw err;\n }\n return {\n failed: report.exitCode !== 0,\n render: (format, color) => renderDocevals(report, format, { color }),\n };\n }\n case \"term\": {\n const [{ runCheck: runTerm }, { renderFindingsPretty: termPretty }, { renderFindingsJson: termJson }, { renderFindingsGithub: termGithub }] =\n await Promise.all([\n import(\"../../term/commands/check.js\"),\n import(\"../../term/reporters/pretty.js\"),\n import(\"../../term/reporters/json.js\"),\n import(\"../../term/reporters/github.js\"),\n ]);\n const report = await runTerm({ inputs, configPath, cwd, allowEmpty: true, onNotice });\n if (report.terms === 0) return { skipped: NOT_SET_UP.term };\n return {\n failed: report.summary.failed > 0,\n render: (format, color) =>\n format === \"json\"\n ? termJson(report)\n : format === \"github\"\n ? termGithub(report)\n : termPretty(report, { color, references: true }),\n };\n }\n case \"graph\": {\n if (!family.sections.has(\"graph\")) return { skipped: NOT_SET_UP.graph };\n const [{ buildGraph }, { runCheck: runGraph, renderCheck: renderGraph }] = await Promise.all([\n import(\"../../graph/commands/build.js\"),\n import(\"../../graph/commands/check.js\"),\n ]);\n const built = await buildGraph({ config: configPath, cwd });\n for (const warning of built.warnings) onNotice(warning);\n const report = await runGraph({ config: configPath, cwd, turtle: built.turtle });\n return {\n failed: report.exitCode !== 0,\n render: (format) => renderGraph(report, format),\n };\n }\n }\n}\n\nasync function outcome(domain: Domain, ctx: Context): Promise<CheckOutcome> {\n const command = COMMANDS[domain];\n try {\n const result = await runDomain(domain, ctx);\n if (\"skipped\" in result) return { command, status: \"skipped\", message: result.skipped };\n return { command, status: result.failed ? \"fail\" : \"pass\", render: result.render };\n } catch (err) {\n return { command, status: \"error\", message: errorMessage(err) };\n }\n}\n\n/** A hook or a git status names files by any extension; a walk keeps the documents. */\nfunction isDocument(label: string): boolean {\n return supportedExtensions().includes(extname(label).toLowerCase());\n}\n\n/** Every domain walks the same collections, so the run shares one walk per target set. */\nexport function runFamilyCheck(opts: FamilyCheckOptions): Promise<FamilyCheckRun> {\n return withSharedWalks(() => checkUnshared(opts));\n}\n\nasync function checkUnshared(opts: FamilyCheckOptions): Promise<FamilyCheckRun> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const onNotice = opts.onNotice ?? ((): void => undefined);\n const family = await loadFamily(cwd, opts.configPath);\n if (family.collections.length === 0) throw nothingSetUpError();\n const isMember = (label: string): boolean => collectionsOf(family, cwd, label).length > 0;\n\n let files: string[];\n let domains: Domain[];\n let inputs: string[];\n switch (opts.scope.kind) {\n case \"all\":\n files = await listMembers(family, cwd);\n inputs = [];\n domains = [...DOMAINS];\n break;\n case \"paths\": {\n const { files: named } = await resolveTargetSet({\n inputs: opts.scope.paths,\n cwd,\n ...(opts.allowMissing === true ? { allowEmpty: true } : {}),\n });\n const outside = named.filter((label) => !isMember(label));\n if (outside.length > 0) {\n onNotice(`Skipped ${plural(outside.length, \"file\")} outside every collection: ${outside.join(\", \")}`);\n }\n // A collection globbed wide holds assets too; only documents are checked.\n files = named.filter((label) => isMember(label) && isDocument(label));\n inputs = files;\n domains = files.length > 0 ? [\"meta\", \"cite\", \"lint\", \"docevals\"] : [];\n break;\n }\n case \"changed\": {\n const changed = await changedFiles(cwd);\n if (!changed.dirty) return { status: \"pass\", files: [], checks: [] };\n const memberDocuments = (paths: string[]): string[] =>\n paths.map((path) => labelFrom(cwd, path)).filter((l) => isDocument(l) && isMember(l));\n files = memberDocuments(changed.files);\n inputs = files;\n // term reads only collection documents, so a session that changed or\n // removed none of them leaves the glossary as it was. graph never runs\n // here: it is the slowest set-wide check, and its findings span pages\n // rather than the one an agent just wrote, so a bare run (CI) owns it.\n const pageChanged = files.length > 0 || memberDocuments(changed.removed).length > 0;\n domains = [\n ...(files.length > 0 ? ([\"meta\", \"lint\", \"docevals\"] as const) : []),\n \"cite\",\n ...(pageChanged ? ([\"term\"] as const) : []),\n ];\n break;\n }\n }\n\n const checks: CheckOutcome[] = [];\n for (const domain of domains) {\n // The set-wide checks run bare, over every collection, whatever the scope.\n const setWide = domain === \"term\" || domain === \"graph\" || (domain === \"cite\" && opts.scope.kind !== \"paths\");\n checks.push(await outcome(domain, { family, cwd, inputs: setWide ? [] : inputs, onNotice }));\n }\n if (opts.scope.kind === \"all\" && checks.every((c) => c.status === \"skipped\")) {\n throw nothingSetUpError();\n }\n return { status: checks.some((c) => c.status === \"fail\") ? \"fail\" : \"pass\", files, checks };\n}\n\n/** The exit code a run by hand ends with: 2 when a check could not run. */\nexport function exitCodeFor(run: FamilyCheckRun): 0 | 1 | 2 {\n if (run.checks.some((c) => c.status === \"error\")) return 2;\n return run.status === \"fail\" ? 1 : 0;\n}\n\nfunction isRan(check: CheckOutcome): check is RanCheck {\n return check.status === \"pass\" || check.status === \"fail\";\n}\n\n/** The first line of a message, for a one-line context. */\nfunction firstLine(message: string): string {\n return message.split(\"\\n\", 1)[0] ?? \"\";\n}\n\n/** What an agent is handed when a hook blocks: the failing checks' reports, nothing else. */\nfunction renderFailures(run: FamilyCheckRun): string {\n return run.checks\n .filter((c): c is RanCheck => c.status === \"fail\")\n .map((c) => `${c.command}\\n${c.render(\"pretty\", false)}`)\n .join(\"\\n\\n\");\n}\n\nexport function renderPretty(run: FamilyCheckRun, color: boolean): string {\n const blocks: string[] = [];\n for (const check of run.checks) {\n if (isRan(check)) blocks.push(`${check.command}\\n${check.render(\"pretty\", color)}`);\n }\n const notRun = run.checks.filter((c): c is NotRunCheck => !isRan(c));\n if (notRun.length > 0) {\n const width = Math.max(...notRun.map((c) => c.command.length)) + 3;\n blocks.push(\n notRun\n .map((c) => `${c.status.padEnd(9)}${c.command.padEnd(width)}${firstLine(c.message)}`)\n .join(\"\\n\"),\n );\n }\n const count = (status: CheckOutcome[\"status\"]): number =>\n run.checks.filter((c) => c.status === status).length;\n const errors = count(\"error\");\n blocks.push(\n `${plural(run.checks.length, \"check\")} over ${plural(run.files.length, \"file\")}: ` +\n `${String(count(\"fail\"))} failed, ${String(count(\"skipped\"))} skipped` +\n (errors > 0 ? `, ${String(errors)} could not run` : \"\"),\n );\n return blocks.join(\"\\n\\n\");\n}\n\n/** A check's JSON entry: its own report, or why there is none. */\nfunction jsonEntry(c: CheckOutcome): object {\n if (!isRan(c)) return { command: c.command, status: c.status, message: c.message };\n try {\n return { command: c.command, status: c.status, report: JSON.parse(c.render(\"json\", false)) as unknown };\n } catch {\n // One reporter's bad output must not take the other checks' reports with it.\n // `error` on purpose, whatever the run's own status: with no report to\n // embed, a `pass` or `fail` here would be a verdict nobody can inspect.\n // The reference documents `error` for this case too.\n return { command: c.command, status: \"error\", message: `${c.command} -f json printed output that is not JSON` };\n }\n}\n\nexport function renderJson(run: FamilyCheckRun): string {\n return JSON.stringify(\n {\n status: run.status,\n files: run.files,\n checks: run.checks.map(jsonEntry),\n },\n null,\n 2,\n );\n}\n\nexport function renderGithub(run: FamilyCheckRun): string {\n return run.checks\n .filter(isRan)\n .map((c) => c.render(\"github\", false))\n .filter((text) => text.length > 0)\n .join(\"\\n\");\n}\n\nexport function render(run: FamilyCheckRun, format: CheckFormat, color: boolean): string {\n return format === \"json\" ? renderJson(run) : format === \"github\" ? renderGithub(run) : renderPretty(run, color);\n}\n\n/** What a hook command ends with: its exit code, and what it prints where. */\nexport interface HookReply {\n exitCode: 0 | 2;\n stdout?: string;\n stderr?: string;\n}\n\n/** The PostToolUse tools whose edit `check` answers. */\nexport const EDIT_TOOLS: readonly string[] = [\"Edit\", \"Write\", \"MultiEdit\", \"NotebookEdit\"];\n\n/**\n * The hook protocol's answer to a run. Never exit 2 for a check that could\n * not run: 2 means \"block\" to Claude Code, and an operational error is not\n * the agent's to fix.\n */\nexport function hookReply(run: FamilyCheckRun, envelope: Envelope): HookReply {\n const failed = run.status === \"fail\";\n if (envelope.event === \"PostToolUse\") {\n const files = run.files.join(\", \");\n if (failed) {\n return {\n exitCode: 2,\n stderr: `manni found errors in ${files}. Fix them before you continue.\\n\\n${renderFailures(run)}\\n`,\n };\n }\n const errors = run.checks.filter((c): c is NotRunCheck => c.status === \"error\");\n if (errors.length === 0) return { exitCode: 0 };\n const additionalContext = errors\n .map((c) => `manni ${c.command} could not check ${files}: ${firstLine(c.message)}`)\n .join(\"\\n\");\n return {\n exitCode: 0,\n stdout: `${JSON.stringify({ hookSpecificOutput: { hookEventName: \"PostToolUse\", additionalContext } })}\\n`,\n };\n }\n if (envelope.event === \"Stop\") return turnReply(run, undefined, envelope);\n return { exitCode: 0 };\n}\n\n/** What tracevals found in the turn a Stop or SubagentStop ended, for the reply. */\nexport interface TurnVerdict {\n /** Rules broken with a confident verdict: how many, the report, the trace judged. */\n broken?: { rules: number; report: string; trace: string };\n /** A skip not yet said this session. */\n skipMessage?: string;\n}\n\n/**\n * The reply to a Stop or a SubagentStop: 0078's file checks first, then the\n * turn. One block carries both reasons; after the repair pass, one message\n * carries both sentences. Always exit 0, as 0078's Stop is.\n */\nexport function turnReply(\n run: FamilyCheckRun | undefined,\n turn: TurnVerdict | undefined,\n envelope: Envelope,\n): HookReply {\n const reasons: string[] = [];\n const messages: string[] = [];\n if (run?.status === \"fail\") {\n if (envelope.stopHookActive) {\n messages.push(\"manni still reports errors after one repair pass. Run manni check to see them.\");\n } else {\n reasons.push(`manni found errors in the files you changed. Fix them, then finish.\\n\\n${renderFailures(run)}`);\n }\n }\n if (turn?.broken !== undefined) {\n const { rules, report, trace } = turn.broken;\n if (envelope.stopHookActive) {\n messages.push(\n `tracevals still finds broken rules after one repair pass. Run manni tracevals check ${trace} to see them.`,\n );\n } else {\n reasons.push(\n `This turn broke ${plural(rules, \"rule\")} from the files and requests that governed it. ` +\n `Fix the work, or say why the rule does not apply here, then finish.\\n\\n${report}`,\n );\n }\n }\n if (turn?.skipMessage !== undefined) messages.push(turn.skipMessage);\n if (reasons.length === 0 && messages.length === 0) return { exitCode: 0 };\n const reply = {\n ...(reasons.length > 0 ? { decision: \"block\", reason: reasons.join(\"\\n\\n\") } : {}),\n ...(messages.length > 0 ? { systemMessage: messages.join(\" \") } : {}),\n };\n return { exitCode: 0, stdout: `${JSON.stringify(reply)}\\n` };\n}\n\n/** Test seams `checkTurn` takes; production builds each from config. */\nexport type TurnSeams = Partial<Pick<TurnCheckInput, \"judge\" | \"extractor\" | \"localModels\" | \"env\">>;\n\n/**\n * Judge the turn a Stop or SubagentStop ended, with every gate of proposal\n * 0079. Silent (`undefined`) when tracevals is not in play, the turn is clean\n * or only needs review, a skip was already said this session, or the run\n * could not happen: an operational failure is not the agent's to fix.\n */\nexport async function runTurnCheck(\n envelope: Envelope,\n cwd: string,\n seams: TurnSeams = {},\n): Promise<TurnVerdict | undefined> {\n const subagent = envelope.event === \"SubagentStop\";\n const judged = subagent ? envelope.agentTranscriptPath : envelope.transcriptPath;\n if (judged === undefined) return undefined;\n const trace = resolve(cwd, judged);\n const sessionId = envelope.sessionId ?? basename(trace, \".jsonl\");\n let result: TurnCheckResult;\n let renderTurn: (typeof import(\"../../tracevals/reporters/runtime.js\"))[\"renderCheck\"];\n try {\n // Loaded here, as every domain is, so a run that never judges a turn never\n // loads tracevals.\n const [{ checkTurn }, reporters] = await Promise.all([\n import(\"../../tracevals/commands/check.js\"),\n import(\"../../tracevals/reporters/runtime.js\"),\n ]);\n renderTurn = reporters.renderCheck;\n result = await checkTurn({\n transcriptPath: resolve(cwd, envelope.transcriptPath ?? judged),\n ...(subagent ? { agentTranscriptPath: trace } : {}),\n ...(subagent && envelope.agentId !== undefined ? { agentId: envelope.agentId } : {}),\n ...(subagent && envelope.agentType !== undefined ? { agentType: envelope.agentType } : {}),\n ...(envelope.lastAssistantMessage !== undefined\n ? { lastAssistantMessage: envelope.lastAssistantMessage }\n : {}),\n sessionId,\n cwd,\n inLoop: true,\n ...seams,\n });\n } catch (err) {\n // An operational failure is not the agent's to fix, so it stays silent, as\n // 0078's Stop failures do. Anything else is a bug: say so on stderr, which\n // a hook that exits 0 sends to the debug log, and still never block.\n if (!(err instanceof ToolError)) warn(`the turn check failed unexpectedly: ${errorMessage(err)}`);\n return undefined;\n }\n const { skipped } = result;\n if (skipped?.message !== undefined) {\n return sayOnce(cwd, sessionId, skipped.gate) ? { skipMessage: skipped.message } : undefined;\n }\n if (result.exitCode !== 1 || result.report === undefined) return undefined;\n return {\n broken: {\n rules: result.report.summary.fail,\n report: renderTurn(result.report, { color: false }),\n trace: judged,\n },\n };\n}\n\n/** The reply when the run itself could not happen, under a hook. */\nexport function hookFailure(message: string, envelope: Envelope, file: string | undefined): HookReply {\n if (envelope.event !== \"PostToolUse\" || file === undefined) return { exitCode: 0 };\n const additionalContext = `manni check could not check ${file}: ${firstLine(message)}`;\n return {\n exitCode: 0,\n stdout: `${JSON.stringify({ hookSpecificOutput: { hookEventName: \"PostToolUse\", additionalContext } })}\\n`,\n };\n}\n","/**\n * The files a session changed: the git working tree against `HEAD`.\n *\n * Modified, added, renamed (by the new name) and untracked files, staged or\n * not. A deleted file, or a renamed one's old name, is named apart, since\n * there is nothing left to check. Paths come back absolute, resolved from\n * `cwd`: porcelain status names them from the repository root whatever\n * directory git ran in.\n */\nimport { execFile } from \"node:child_process\";\nimport { posix, resolve } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nconst run = promisify(execFile);\n\nasync function git(args: string[], cwd: string): Promise<string> {\n // shell:false: nothing here is ever parsed as shell syntax.\n const { stdout } = await run(\"git\", args, {\n cwd,\n shell: false,\n windowsHide: true,\n maxBuffer: 64 * 1024 * 1024,\n });\n return stdout;\n}\n\n/** Parse `git status --porcelain=v1 -z` into repository-relative paths. */\nexport function parsePorcelain(output: string): { files: string[]; removed: string[] } {\n const fields = output.split(\"\\0\");\n const files: string[] = [];\n const removed: string[] = [];\n for (let i = 0; i < fields.length; i++) {\n const entry = fields[i] ?? \"\";\n if (entry.length < 4) continue;\n const xy = entry.slice(0, 2);\n const path = entry.slice(3);\n // A rename or copy is followed by its old name, which is not a change to\n // check. A rename's old name is gone; a copy's is still there.\n if (xy.includes(\"R\") || xy.includes(\"C\")) {\n i++;\n if (xy.includes(\"R\")) removed.push(fields[i] ?? \"\");\n }\n // `RD`, a staged rename then deleted in the tree, removes both names:\n // the old one above and the new one here. Two files, not one twice.\n if (xy.includes(\"D\")) removed.push(path);\n else files.push(path);\n }\n return { files, removed };\n}\n\nexport interface ChangedTree {\n /** The changed files left to check, absolute. */\n files: string[];\n /** The files the tree no longer has: deleted, or renamed away. Absolute. */\n removed: string[];\n /**\n * Whether the tree differs from `HEAD` at all. A deletion alone leaves no\n * file to check, but it can still break a citation to what it removed.\n */\n dirty: boolean;\n}\n\nexport async function changedFiles(cwd: string): Promise<ChangedTree> {\n // Rebased through `cwd`'s own prefix rather than resolved from the\n // top-level git prints: on Windows that is the long spelling of a path the\n // caller may hold in its 8.3 short form, and the two would never compare.\n const prefix = (await git([\"rev-parse\", \"--show-prefix\"], cwd)).trim();\n const status = await git(\n [\"status\", \"--porcelain=v1\", \"-z\", \"--untracked-files=all\"],\n cwd,\n );\n const { files, removed } = parsePorcelain(status);\n const absolute = (path: string): string => resolve(cwd, posix.relative(prefix, path));\n return { files: files.map(absolute), removed: removed.map(absolute), dirty: status.length > 0 };\n}\n","/**\n * What a hook has already told the user this session (proposal 0079: \"A skip\n * message is said once per session\").\n *\n * Each hook is a process of its own, and parallel subagents end in parallel\n * SubagentStop hooks, so the memory is one marker file per message, created\n * exclusively. The process whose create succeeds is the one that says it, so\n * no two hooks can both read \"not said yet\".\n */\nimport { mkdirSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { DEFAULT_CAPTURE_DIR } from \"../../tracevals/capture/types.js\";\nimport { idHash } from \"../../tracevals/rules/ledger.js\";\n\n/**\n * `<project>/.manni/tracevals/sessions/<session hash>.<key>.said`. The session\n * id is hashed, so nothing in it can climb out of the directory and two ids\n * never share a marker. The key is a gate name, which is already safe.\n */\nexport function saidPath(projectDir: string, sessionId: string, key: string): string {\n return join(projectDir, DEFAULT_CAPTURE_DIR, `${idHash(sessionId)}.${key}.said`);\n}\n\n/**\n * True the first time `key` comes up in a session, and records it. A marker\n * that cannot be written says the message rather than lose it.\n */\nexport function sayOnce(projectDir: string, sessionId: string, key: string): boolean {\n const path = saidPath(projectDir, sessionId, key);\n try {\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, \"\", { flag: \"wx\" });\n return true;\n } catch (err) {\n // EEXIST: another hook said it first. Anything else is an unwritable\n // project, which repeats the message each stop rather than lose it.\n return (err as NodeJS.ErrnoException).code !== \"EEXIST\";\n }\n}\n","/**\n * `manni status`: what is set up here, and so what `manni check` runs.\n *\n * It reads the same table `check` does (`in-play.ts`), counting what the\n * content declares where a domain is in play by declaration: the pages that\n * name their own `$schema`, carry citations or resolve evals, and the terms.\n * It checks nothing, so it exits 0 whatever it finds.\n */\nimport { appendFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { extname, resolve } from \"node:path\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { extractorForExtension } from \"../../meta/extractors/index.js\";\nimport type { HostStatus } from \"../../tracevals/rules/host.js\";\nimport type { Envelope } from \"../core/envelope.js\";\nimport {\n COMMANDS,\n DOMAINS,\n NOT_CHECKED,\n NOT_SET_UP,\n collectionsOf,\n listMembers,\n loadFamily,\n plural,\n type Domain,\n type Family,\n} from \"../core/in-play.js\";\nimport { withSharedWalks } from \"../../meta/core/load-files.js\";\n\nexport const STATUS_FORMATS = [\"pretty\", \"json\"] as const;\nexport type StatusFormat = (typeof STATUS_FORMATS)[number];\n\nexport type DomainState = \"in-play\" | \"not-set-up\" | \"not-checked\" | \"unknown\";\n\nexport interface ModelRole {\n provider: string;\n model: string;\n}\n\nexport interface DomainRow {\n name: string;\n status: DomainState;\n reason: string;\n /** tracevals in play: the model judging inside a hook, and the one extracting rules. */\n models?: { hook: ModelRole; extraction: ModelRole };\n /** tracevals in play with a model host running: each model it holds. */\n host?: HostStatus[\"models\"];\n}\n\nexport interface StatusReport {\n version: string;\n /** The config file, as discovery found it or as it was typed. */\n config: string;\n collections: { name: string; files: number }[];\n domains: DomainRow[];\n}\n\nexport interface StatusOptions {\n cwd?: string;\n configPath?: string;\n /** Test seam: the running model host. Default: ask the inference library. */\n hostStatus?: () => Promise<HostStatus | null>;\n}\n\n/**\n * tracevals' row when `tracevals.runtime` exists: both models, resolved\n * the way `check` and `prepare` resolve them, and the host when one runs.\n */\nasync function tracevalsRow(cwd: string, opts: StatusOptions): Promise<DomainRow> {\n try {\n const [\n { discoverConfig },\n { assertProviderSelection, resolveSelectionIdentity, selectHookProvider, selectProvider },\n { hostStatus },\n ] = await Promise.all([\n import(\"../../tracevals/core/config.js\"),\n import(\"../../tracevals/judge/provider.js\"),\n import(\"../../tracevals/rules/host.js\"),\n ]);\n const { config } = await discoverConfig(cwd, opts.configPath === undefined ? {} : { configPath: opts.configPath });\n const hook = await resolveSelectionIdentity(config, selectHookProvider(config));\n const selection = selectProvider(config);\n assertProviderSelection(selection);\n const extraction = await resolveSelectionIdentity(config, selection);\n const host = await (opts.hostStatus ?? hostStatus)().catch(() => null);\n return {\n name: \"tracevals\",\n status: \"in-play\",\n reason: `hook: ${hook.provider} ${hook.model} · extraction: ${extraction.provider} ${extraction.model}`,\n models: {\n hook: { provider: hook.provider, model: hook.model },\n extraction: { provider: extraction.provider, model: extraction.model },\n },\n ...(host === null || host.models.length === 0 ? {} : { host: host.models }),\n };\n } catch (err) {\n const message = errorMessage(err).split(\"\\n\", 1)[0] ?? \"\";\n return { name: \"tracevals\", status: \"unknown\", reason: `manni tracevals check could not run: ${message}` };\n }\n}\n\n/** `1 page names`, `3 pages name`: a count and the verb that agrees with it. */\nfunction pages(n: number, one: string, many: string): string {\n return n === 1 ? `1 page ${one}` : `${String(n)} pages ${many}`;\n}\n\n/** The pages naming their own `$schema`, read the way `meta validate` extracts them. */\nfunction ownSchemaCount(cwd: string, members: readonly string[]): number {\n let n = 0;\n for (const label of members) {\n const extractor = extractorForExtension(extname(label));\n if (extractor === undefined) continue;\n try {\n const { data } = extractor.extract(readFileSync(resolve(cwd, label), \"utf8\"), label);\n if (data.$schema !== undefined) n++;\n } catch {\n // A page that does not parse names nothing; `meta validate` reports it.\n }\n }\n return n;\n}\n\n/**\n * The pages carrying citations, read the way `cite check` reads them: its\n * targets, its manifests, its entry rules. Nothing is classified, so no claim\n * or source is looked at and no git history is read.\n */\nasync function citedPages(cwd: string, configPath: string): Promise<number> {\n // Imported where they run, so `manni check` never loads them.\n const { prepareRun, readTarget } = await import(\"../../cite/commands/check.js\");\n const { readPage } = await import(\"../../cite/core/page.js\");\n const prepared = await prepareRun({ inputs: [], configPath, cwd, checkSources: false }, \"checked\", \"check\");\n let n = 0;\n for (const file of prepared.files) {\n const content = await readTarget(prepared.run, file);\n const { citations } = (await prepared.setupFor(file, content)).options;\n const read = readPage(file, content, { markers: false, ...(citations === undefined ? {} : { citations }) });\n if (read.citations.length > 0) n++;\n }\n return n;\n}\n\nasync function row(domain: Domain, family: Family, cwd: string, members: readonly string[]): Promise<DomainRow> {\n const configPath = family.configPath;\n const inPlay = (reason: string): DomainRow => ({ name: domain, status: \"in-play\", reason });\n const notSetUp: DomainRow = { name: domain, status: \"not-set-up\", reason: NOT_SET_UP[domain] };\n const section = family.sections.has(domain);\n switch (domain) {\n case \"meta\": {\n if (section) return inPlay(\"meta: section\");\n const n = ownSchemaCount(cwd, members);\n return n > 0 ? inPlay(pages(n, \"names its own $schema\", \"name their own $schema\")) : notSetUp;\n }\n case \"cite\": {\n const n = await citedPages(cwd, configPath);\n return n > 0 ? inPlay(pages(n, \"carries citations\", \"carry citations\")) : notSetUp;\n }\n case \"docevals\": {\n const { runList: listEvals } = await import(\"../../docevals/commands/list.js\");\n const { plans } = await listEvals([], { config: configPath, cwd });\n const n = plans.filter((p) => !p.skip && p.evals.length > 0).length;\n if (n === 0) return notSetUp;\n return inPlay(section ? \"docevals: section\" : pages(n, \"declares evals\", \"declare evals\"));\n }\n case \"term\": {\n const { runList: listTerms } = await import(\"../../term/commands/list.js\");\n const { terms } = await listTerms({ inputs: [], configPath, cwd, allowEmpty: true });\n return terms.length > 0 ? inPlay(plural(terms.length, \"term\")) : notSetUp;\n }\n case \"lint\":\n case \"graph\":\n return section ? inPlay(`${domain}: section`) : notSetUp;\n }\n}\n\n/** Every domain walks the same collections, so the run shares one walk per target set. */\nexport function runStatus(opts: StatusOptions = {}): Promise<StatusReport> {\n return withSharedWalks(() => statusUnshared(opts));\n}\n\nasync function statusUnshared(opts: StatusOptions): Promise<StatusReport> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const family = await loadFamily(cwd, opts.configPath);\n const members = family.collections.length === 0 ? [] : await listMembers(family, cwd);\n const domains: DomainRow[] = [];\n for (const domain of DOMAINS) {\n // `check` only reads collection members, so with no collections every\n // domain has nothing to check, whatever sections the config carries.\n if (family.collections.length === 0) {\n domains.push({ name: domain, status: \"not-set-up\", reason: \"no collections: in manni.config.yaml\" });\n continue;\n }\n try {\n domains.push(await row(domain, family, cwd, members));\n } catch (err) {\n // Status checks nothing, so a domain that cannot read its own setup is\n // reported in its row rather than ending the run, as unknown: whether it is\n // set up is the thing it could not read.\n const message = errorMessage(err).split(\"\\n\", 1)[0] ?? \"\";\n domains.push({ name: domain, status: \"unknown\", reason: `manni ${COMMANDS[domain]} could not run: ${message}` });\n }\n }\n for (const [name, reason] of NOT_CHECKED) {\n domains.push(\n name === \"tracevals\" && family.runtime\n ? await tracevalsRow(cwd, opts)\n : { name, status: \"not-checked\", reason },\n );\n }\n return {\n version: pkg.version,\n config: family.file.source,\n collections: family.collections.map((c) => ({\n name: c.name,\n files: members.filter((label) => collectionsOf(family, cwd, label).includes(c.name)).length,\n })),\n domains,\n };\n}\n\nconst STATE_LABEL: Readonly<Record<DomainState, string>> = {\n \"in-play\": \"in play\",\n \"not-set-up\": \"not set up\",\n \"not-checked\": \"not checked\",\n unknown: \"unknown\",\n};\n\nexport function renderStatus(report: StatusReport, format: StatusFormat): string {\n if (format === \"json\") return JSON.stringify(report, null, 2);\n const head = [\n `manni ${report.version}`,\n `config ${report.config}`,\n ...report.collections.map((c) => `collection ${c.name} (${plural(c.files, \"file\")})`),\n ].join(\" \");\n // tracevals in play judges each turn, which is what its row says.\n const label = (d: DomainRow): string => (d.models !== undefined ? \"judges each turn\" : STATE_LABEL[d.status]);\n const width = Math.max(14, ...report.domains.map((d) => label(d).length + 3));\n const rows = report.domains.flatMap((d) => [\n `${d.name.padEnd(11)}${label(d).padEnd(width)}${d.reason}`,\n ...(d.host ?? []).map(\n (m) =>\n `${\"\".padEnd(11)}${\"model host\".padEnd(width)}${m.model} loaded, ${plural(m.sessions, \"session\")}, ` +\n `idle ${String(Math.floor(m.idleMs / 60_000))}m`,\n ),\n ]);\n return [head, \"\", ...rows].join(\"\\n\");\n}\n\n/**\n * The plugin skill the briefing points an agent at, as `<plugin>:<skill>`.\n * `test/plugin.test.ts` checks both halves against `plugin/manni`.\n */\nexport const FIX_SKILL = \"manni:fix\";\n\n/** The set-wide checks a stop runs when a collection document changed, as the briefing names them. */\nconst PAGE_WIDE: ReadonlyArray<readonly [Domain, string]> = [[\"term\", \"the glossary\"]];\n\n/** `a`, `a or b`, `a, b or c`: a list in prose, joined by `conjunction`. */\nfunction prose(items: readonly string[], conjunction: string): string {\n return items.length <= 1\n ? (items[0] ?? \"\")\n : `${items.slice(0, -1).join(\", \")} ${conjunction} ${items.at(-1) ?? \"\"}`;\n}\n\n/** What an agent is told at the start of a session, after the table. */\nexport function agentLines(report: StatusReport): string {\n const names = prose(report.collections.map((c) => c.name), \"or\");\n const inPlay = new Set(report.domains.filter((d) => d.status === \"in-play\").map((d) => d.name));\n // A stop checks every citation whenever the tree changed: a source edit can drift any of them.\n const plus = inPlay.has(\"cite\") ? \", plus every citation\" : \"\";\n const pageWide = PAGE_WIDE.filter(([domain]) => inPlay.has(domain)).map(([, what]) => what);\n const also = pageWide.length === 0 ? \"\" : ` It checks ${prose(pageWide, \"and\")} too when you changed a page.`;\n return [\n `After you edit a file in ${names}, manni check runs on it, and errors come back to you at once.`,\n `Before you finish, manni check runs on every file you changed${plus}.${also} You get one repair pass.`,\n `The ${FIX_SKILL} skill says how to repair each finding.`,\n ].join(\"\\n\");\n}\n\n/** A model id as Claude Code spells one, and nothing a shell would read as more. */\nconst MODEL_ID = /^[A-Za-z0-9._:/@-]+$/;\n\n/**\n * Append `export MANNI_GENERATED_BY=<model>` to `$CLAUDE_ENV_FILE`, so every\n * command the session runs records which model wrote what. Only when the\n * envelope names the model, the file is offered, and nobody set the variable.\n */\nexport function exportGeneratedBy(envelope: Envelope, env: NodeJS.ProcessEnv = process.env): boolean {\n const file = env.CLAUDE_ENV_FILE;\n // A context-window suffix such as `[1m]` is a session setting, not the model.\n const model = envelope.model?.replace(/\\[[^\\]]*\\]$/, \"\");\n if (model === undefined || !MODEL_ID.test(model)) return false;\n if (file === undefined || file === \"\" || env.MANNI_GENERATED_BY !== undefined) return false;\n const existing = existsSync(file) ? readFileSync(file, \"utf8\") : \"\";\n const lead = existing === \"\" || existing.endsWith(\"\\n\") ? \"\" : \"\\n\";\n appendFileSync(file, `${lead}export MANNI_GENERATED_BY=${model}\\n`, \"utf8\");\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,WAAAA,gBAAe;AACxB,SAAS,SAAS,cAAc;;;AC2BhC,SAAS,IAAI,OAAoC;AAC/C,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,QAAQ;AACjE;AAEA,SAAS,OAAO,OAAqD;AACnE,SAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IACrE,QACD;AACN;AAGO,SAAS,cAAc,MAAoC;AAChE,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,IAAI;AAAA,EAC1B,QAAQ;AACN,WAAO;AAAA,EACT;AACA,QAAM,MAAM,OAAO,MAAM;AACzB,QAAM,QAAQ,IAAI,KAAK,eAAe;AACtC,MAAI,QAAQ,UAAa,UAAU,OAAW,QAAO;AACrD,QAAM,QAAQ,OAAO,I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Aa,CAAC;AAE/F,cAAM,QAAQ,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,WAAW,SAAS,IAAI;AAAA;AAAA,EAAO,WAAW,MAAM,CAAC,KAAK;AACjG,gBAAQ,OAAO,MAAM,GAAG,aAAa,QAAQ,QAAQ,CAAC,GAAG,KAAK;AAAA,CAAI;AAClE,0BAAkB,QAAQ;AAAA,MAC5B,QAAQ;AAAA,MAER;AACA;AAAA,IACF;AACA,QAAI;AACF,YAAM,SAAS,MAAM,UAAU,YAAY;AAC3C,cAAQ,OAAO,MAAM,GAAG,aAAa,QAAQ,QAAQ,MAAM,CAAC;AAAA,CAAI;AAAA,IAClE,SAAS,KAAK;AACZ,WAAK,GAAG;AAAA,IACV;AAAA,EACF,CAAC;AACL;","names":["resolve","record","resolve","resolve","run","resolve","extname","resolve","extname","resolve","resolve","run"]}
@@ -4,18 +4,18 @@ import {
4
4
  parseQueryParams,
5
5
  resolveGetInputs,
6
6
  resolveQueryInputs
7
- } from "./chunk-GQBVZS5G.js";
8
- import "./chunk-WBETAXO2.js";
9
- import "./chunk-WT6HMEEF.js";
10
- import "./chunk-YVVMC4SZ.js";
11
- import "./chunk-6HMLYFEU.js";
7
+ } from "./chunk-6LR73NMO.js";
8
+ import "./chunk-2W34HX2U.js";
9
+ import "./chunk-KBG463UK.js";
10
+ import "./chunk-QBVP3SQP.js";
11
+ import "./chunk-G7XD4QH5.js";
12
12
  import "./chunk-YEUYKR62.js";
13
13
  import "./chunk-RNVYGWIC.js";
14
14
  import "./chunk-MNH7QO4Z.js";
15
- import "./chunk-XKBEHKWO.js";
15
+ import "./chunk-6M5VJOC2.js";
16
16
  import "./chunk-HX44GB4Z.js";
17
17
  import "./chunk-QCHVR4ZM.js";
18
- import "./chunk-N7J5C35C.js";
18
+ import "./chunk-2BV4FBC7.js";
19
19
  import "./chunk-OWBRDNRZ.js";
20
20
  import "./chunk-G3T47CFV.js";
21
21
  import "./chunk-2H7UOFLK.js";
@@ -25,4 +25,4 @@ export {
25
25
  resolveGetInputs,
26
26
  resolveQueryInputs
27
27
  };
28
- //# sourceMappingURL=cli-MNNOXWYU.js.map
28
+ //# sourceMappingURL=cli-HO62TOM2.js.map