@hawkeyexl/manni 4.3.0 → 4.4.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 (224) hide show
  1. package/README.md +9 -1
  2. package/dist/batch-DFRCLY77.js +36 -0
  3. package/dist/build-Q5C6SX5J.js +31 -0
  4. package/dist/calibrate-XQILKXS3.js +31 -0
  5. package/dist/capture-JQMOC3BW.js +32 -0
  6. package/dist/check-HYNGXYJV.js +18 -0
  7. package/dist/check-HYNGXYJV.js.map +1 -0
  8. package/dist/check-NFZQLJKN.js +27 -0
  9. package/dist/check-NFZQLJKN.js.map +1 -0
  10. package/dist/check-U54XV6BP.js +40 -0
  11. package/dist/check-U54XV6BP.js.map +1 -0
  12. package/dist/chunk-252LNOEG.js +622 -0
  13. package/dist/chunk-252LNOEG.js.map +1 -0
  14. package/dist/chunk-2H7UOFLK.js +11 -0
  15. package/dist/chunk-2H7UOFLK.js.map +1 -0
  16. package/dist/chunk-2U3ORT6D.js +230 -0
  17. package/dist/chunk-2U3ORT6D.js.map +1 -0
  18. package/dist/chunk-3AFUD75K.js +23 -0
  19. package/dist/chunk-3AFUD75K.js.map +1 -0
  20. package/dist/{chunk-3R23C5DT.js → chunk-4TSWU2SU.js} +2 -14
  21. package/dist/chunk-4TSWU2SU.js.map +1 -0
  22. package/dist/chunk-5KHIFVD2.js +1192 -0
  23. package/dist/chunk-5KHIFVD2.js.map +1 -0
  24. package/dist/chunk-5YXBLLAC.js +2165 -0
  25. package/dist/chunk-5YXBLLAC.js.map +1 -0
  26. package/dist/chunk-644JVKJ4.js +3872 -0
  27. package/dist/chunk-644JVKJ4.js.map +1 -0
  28. package/dist/chunk-6OYEI2VV.js +88 -0
  29. package/dist/chunk-6OYEI2VV.js.map +1 -0
  30. package/dist/chunk-77AINBYM.js +19 -0
  31. package/dist/chunk-77AINBYM.js.map +1 -0
  32. package/dist/chunk-77HX34KD.js +1287 -0
  33. package/dist/chunk-77HX34KD.js.map +1 -0
  34. package/dist/{chunk-MOQXWXSG.js → chunk-7QMCHA4N.js} +32 -240
  35. package/dist/chunk-7QMCHA4N.js.map +1 -0
  36. package/dist/chunk-BUXDLRDT.js +455 -0
  37. package/dist/chunk-BUXDLRDT.js.map +1 -0
  38. package/dist/chunk-C6OH6CNF.js +388 -0
  39. package/dist/chunk-C6OH6CNF.js.map +1 -0
  40. package/dist/chunk-CK7SKVHR.js +1042 -0
  41. package/dist/chunk-CK7SKVHR.js.map +1 -0
  42. package/dist/chunk-CYWHFSRT.js +6737 -0
  43. package/dist/chunk-CYWHFSRT.js.map +1 -0
  44. package/dist/chunk-ERMSO34F.js +17 -0
  45. package/dist/chunk-ERMSO34F.js.map +1 -0
  46. package/dist/{chunk-IOYXPBCL.js → chunk-G3T47CFV.js} +1 -7
  47. package/dist/{chunk-IOYXPBCL.js.map → chunk-G3T47CFV.js.map} +1 -1
  48. package/dist/chunk-G7NJSREW.js +979 -0
  49. package/dist/chunk-G7NJSREW.js.map +1 -0
  50. package/dist/chunk-GLP5PSXB.js +72 -0
  51. package/dist/chunk-GLP5PSXB.js.map +1 -0
  52. package/dist/chunk-H2DLH2JI.js +198 -0
  53. package/dist/chunk-H2DLH2JI.js.map +1 -0
  54. package/dist/chunk-H6FZ66XR.js +634 -0
  55. package/dist/chunk-H6FZ66XR.js.map +1 -0
  56. package/dist/{chunk-CI2GOU3A.js → chunk-IEQHSCZG.js} +56 -137
  57. package/dist/chunk-IEQHSCZG.js.map +1 -0
  58. package/dist/chunk-IKEWBMCN.js +98 -0
  59. package/dist/chunk-IKEWBMCN.js.map +1 -0
  60. package/dist/chunk-JOHKIAVH.js +5440 -0
  61. package/dist/chunk-JOHKIAVH.js.map +1 -0
  62. package/dist/chunk-JVTNMVYU.js +10921 -0
  63. package/dist/chunk-JVTNMVYU.js.map +1 -0
  64. package/dist/chunk-K3D6FPV6.js +164 -0
  65. package/dist/chunk-K3D6FPV6.js.map +1 -0
  66. package/dist/{chunk-MFDD3YGU.js → chunk-KCGV52AM.js} +69 -48
  67. package/dist/{chunk-MFDD3YGU.js.map → chunk-KCGV52AM.js.map} +1 -1
  68. package/dist/chunk-LAKAWRV5.js +1651 -0
  69. package/dist/chunk-LAKAWRV5.js.map +1 -0
  70. package/dist/chunk-LJ2RDH3F.js +49 -0
  71. package/dist/chunk-LJ2RDH3F.js.map +1 -0
  72. package/dist/chunk-M2JCK5F6.js +805 -0
  73. package/dist/chunk-M2JCK5F6.js.map +1 -0
  74. package/dist/chunk-MNH7QO4Z.js +15 -0
  75. package/dist/chunk-MNH7QO4Z.js.map +1 -0
  76. package/dist/{chunk-RVVCA4WL.js → chunk-MYC3O5EJ.js} +4 -4
  77. package/dist/chunk-MYMBCTDE.js +387 -0
  78. package/dist/chunk-MYMBCTDE.js.map +1 -0
  79. package/dist/chunk-NCPWXHDO.js +683 -0
  80. package/dist/chunk-NCPWXHDO.js.map +1 -0
  81. package/dist/chunk-NWZ2SLYL.js +2957 -0
  82. package/dist/chunk-NWZ2SLYL.js.map +1 -0
  83. package/dist/chunk-OBFENF3U.js +934 -0
  84. package/dist/chunk-OBFENF3U.js.map +1 -0
  85. package/dist/chunk-OWBRDNRZ.js +16 -0
  86. package/dist/chunk-OWBRDNRZ.js.map +1 -0
  87. package/dist/{chunk-KTSJ2ZHA.js → chunk-PAU352SV.js} +5 -3
  88. package/dist/{chunk-KTSJ2ZHA.js.map → chunk-PAU352SV.js.map} +1 -1
  89. package/dist/chunk-PCE7QHXJ.js +68 -0
  90. package/dist/chunk-PCE7QHXJ.js.map +1 -0
  91. package/dist/chunk-PCHZY2I7.js +299 -0
  92. package/dist/chunk-PCHZY2I7.js.map +1 -0
  93. package/dist/chunk-PHF3D7ER.js +1042 -0
  94. package/dist/chunk-PHF3D7ER.js.map +1 -0
  95. package/dist/chunk-Q35YIDBV.js +1202 -0
  96. package/dist/chunk-Q35YIDBV.js.map +1 -0
  97. package/dist/chunk-RLR4TKUZ.js +4398 -0
  98. package/dist/chunk-RLR4TKUZ.js.map +1 -0
  99. package/dist/chunk-RNVYGWIC.js +30 -0
  100. package/dist/chunk-RNVYGWIC.js.map +1 -0
  101. package/dist/chunk-SE4JN5XN.js +19 -0
  102. package/dist/chunk-SE4JN5XN.js.map +1 -0
  103. package/dist/chunk-TIUTIOFB.js +25 -0
  104. package/dist/chunk-TIUTIOFB.js.map +1 -0
  105. package/dist/chunk-TU2WUBVZ.js +2 -0
  106. package/dist/chunk-TU2WUBVZ.js.map +1 -0
  107. package/dist/chunk-TZOYZK2E.js +98 -0
  108. package/dist/chunk-TZOYZK2E.js.map +1 -0
  109. package/dist/chunk-UKZNLVJW.js +17 -0
  110. package/dist/chunk-UKZNLVJW.js.map +1 -0
  111. package/dist/chunk-UZC7LDAQ.js +178 -0
  112. package/dist/chunk-UZC7LDAQ.js.map +1 -0
  113. package/dist/chunk-V46OILVC.js +3090 -0
  114. package/dist/chunk-V46OILVC.js.map +1 -0
  115. package/dist/chunk-WQE54PNH.js +1975 -0
  116. package/dist/chunk-WQE54PNH.js.map +1 -0
  117. package/dist/chunk-X3BPBDGQ.js +52 -0
  118. package/dist/chunk-X3BPBDGQ.js.map +1 -0
  119. package/dist/chunk-XSLV76YK.js +54 -0
  120. package/dist/chunk-XSLV76YK.js.map +1 -0
  121. package/dist/{chunk-QROCFW5S.js → chunk-XYLUCIKQ.js} +3 -3
  122. package/dist/chunk-YEUYKR62.js +72 -0
  123. package/dist/chunk-YEUYKR62.js.map +1 -0
  124. package/dist/{chunk-ESJ5W7EV.js → chunk-YFQBFNQS.js} +8 -94
  125. package/dist/chunk-YFQBFNQS.js.map +1 -0
  126. package/dist/chunk-YIL4XLLJ.js +1661 -0
  127. package/dist/chunk-YIL4XLLJ.js.map +1 -0
  128. package/dist/chunk-YNHZHSSM.js +41 -0
  129. package/dist/chunk-YNHZHSSM.js.map +1 -0
  130. package/dist/chunk-YTCZRLTU.js +96 -0
  131. package/dist/chunk-YTCZRLTU.js.map +1 -0
  132. package/dist/chunk-YYBFZLAJ.js +374 -0
  133. package/dist/chunk-YYBFZLAJ.js.map +1 -0
  134. package/dist/chunk-ZXRAE55H.js +31 -0
  135. package/dist/chunk-ZXRAE55H.js.map +1 -0
  136. package/dist/cli-2QPR2OZG.js +232 -0
  137. package/dist/cli-2QPR2OZG.js.map +1 -0
  138. package/dist/cli-4IOPGZHR.js +1203 -0
  139. package/dist/cli-4IOPGZHR.js.map +1 -0
  140. package/dist/cli-5FL73WHA.js +346 -0
  141. package/dist/cli-5FL73WHA.js.map +1 -0
  142. package/dist/cli-C262QOWM.js +739 -0
  143. package/dist/cli-C262QOWM.js.map +1 -0
  144. package/dist/cli-LJLLIQB2.js +423 -0
  145. package/dist/cli-LJLLIQB2.js.map +1 -0
  146. package/dist/cli-OFPZ5MAS.js +626 -0
  147. package/dist/cli-OFPZ5MAS.js.map +1 -0
  148. package/dist/cli-SHSMSRQY.js +28 -0
  149. package/dist/cli-SHSMSRQY.js.map +1 -0
  150. package/dist/cli-SRHFUZHA.js +473 -0
  151. package/dist/cli-SRHFUZHA.js.map +1 -0
  152. package/dist/cli-URZQXL4K.js +552 -0
  153. package/dist/cli-URZQXL4K.js.map +1 -0
  154. package/dist/cli.d.ts +12 -2
  155. package/dist/cli.js +109 -7651
  156. package/dist/cli.js.map +1 -1
  157. package/dist/docmeta.js +15 -3
  158. package/dist/docmeta.js.map +1 -1
  159. package/dist/github-FE6KCNYJ.js +27 -0
  160. package/dist/github-FE6KCNYJ.js.map +1 -0
  161. package/dist/github-QXL3VMK2.js +32 -0
  162. package/dist/github-QXL3VMK2.js.map +1 -0
  163. package/dist/index.d.ts +65 -3
  164. package/dist/index.js +407 -337
  165. package/dist/index.js.map +1 -1
  166. package/dist/json-7WV7KL6H.js +17 -0
  167. package/dist/json-7WV7KL6H.js.map +1 -0
  168. package/dist/json-SGZ6ZRFD.js +35 -0
  169. package/dist/json-SGZ6ZRFD.js.map +1 -0
  170. package/dist/lint-DL4LJRAY.js +28 -0
  171. package/dist/lint-DL4LJRAY.js.map +1 -0
  172. package/dist/list-6BAXTZUM.js +29 -0
  173. package/dist/list-6BAXTZUM.js.map +1 -0
  174. package/dist/list-7BKNYPSB.js +31 -0
  175. package/dist/list-7BKNYPSB.js.map +1 -0
  176. package/dist/page-3U2GCFNE.js +41 -0
  177. package/dist/page-3U2GCFNE.js.map +1 -0
  178. package/dist/picker-3XF36MJF.js +14 -0
  179. package/dist/picker-3XF36MJF.js.map +1 -0
  180. package/dist/pretty-2H57QVTY.js +43 -0
  181. package/dist/pretty-2H57QVTY.js.map +1 -0
  182. package/dist/pretty-N6DO4OOL.js +37 -0
  183. package/dist/pretty-N6DO4OOL.js.map +1 -0
  184. package/dist/reporters-M6LJ2IYU.js +21 -0
  185. package/dist/reporters-M6LJ2IYU.js.map +1 -0
  186. package/dist/reporters-N6GHXSS7.js +42 -0
  187. package/dist/reporters-N6GHXSS7.js.map +1 -0
  188. package/dist/reporters-UCNEV7PH.js +71 -0
  189. package/dist/reporters-UCNEV7PH.js.map +1 -0
  190. package/dist/run-XZDAREJE.js +33 -0
  191. package/dist/run-XZDAREJE.js.map +1 -0
  192. package/dist/term-5ICGKPC3.js +1592 -0
  193. package/dist/term-5ICGKPC3.js.map +1 -0
  194. package/dist/types-Y6TXHM7M.js +10 -0
  195. package/dist/types-Y6TXHM7M.js.map +1 -0
  196. package/dist/validate-GQRM77YN.js +16 -0
  197. package/dist/validate-GQRM77YN.js.map +1 -0
  198. package/package.json +1 -1
  199. package/plugin/manni/.claude-plugin/plugin.json +9 -0
  200. package/plugin/manni/hooks/hooks.json +52 -0
  201. package/plugin/manni/skills/check/SKILL.md +20 -0
  202. package/plugin/manni/skills/evals/SKILL.md +27 -0
  203. package/plugin/manni/skills/fix/SKILL.md +56 -0
  204. package/plugin/manni/skills/setup/SKILL.md +41 -0
  205. package/dist/batch-7JJWXWSF.js +0 -18
  206. package/dist/calibrate-IA2ARFMH.js +0 -13
  207. package/dist/capture-C32JXIFN.js +0 -15
  208. package/dist/chunk-3R23C5DT.js.map +0 -1
  209. package/dist/chunk-CI2GOU3A.js.map +0 -1
  210. package/dist/chunk-DP2ZA3WH.js +0 -26518
  211. package/dist/chunk-DP2ZA3WH.js.map +0 -1
  212. package/dist/chunk-ESJ5W7EV.js.map +0 -1
  213. package/dist/chunk-MOQXWXSG.js.map +0 -1
  214. package/dist/chunk-O6RVQKK6.js +0 -27170
  215. package/dist/chunk-O6RVQKK6.js.map +0 -1
  216. package/dist/picker-6HRMETE7.js +0 -12
  217. package/plugin/tracevals/.claude-plugin/plugin.json +0 -9
  218. package/plugin/tracevals/hooks/hooks.json +0 -17
  219. /package/dist/{batch-7JJWXWSF.js.map → batch-DFRCLY77.js.map} +0 -0
  220. /package/dist/{calibrate-IA2ARFMH.js.map → build-Q5C6SX5J.js.map} +0 -0
  221. /package/dist/{capture-C32JXIFN.js.map → calibrate-XQILKXS3.js.map} +0 -0
  222. /package/dist/{picker-6HRMETE7.js.map → capture-JQMOC3BW.js.map} +0 -0
  223. /package/dist/{chunk-RVVCA4WL.js.map → chunk-MYC3O5EJ.js.map} +0 -0
  224. /package/dist/{chunk-QROCFW5S.js.map → chunk-XYLUCIKQ.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/graph/cli.ts","../src/graph/reporters/index.ts","../src/graph/commands/init.ts"],"sourcesContent":["/**\n * The graph program. Named `graph` because that is where it is mounted\n * (`manni graph …`); `src/cli.ts` adds it to the umbrella and runs it.\n *\n * Grammar per proposals 0034 and 0051 §2: the domain owns verbs and has no\n * default subcommand, `-f` means the output format everywhere and is checked\n * against the verb's list, and a list reaches a flag by exactly one\n * separator. The plumbing is the family's: `fail()` from `src/shared/run.ts`,\n * `warn()` from `src/shared/warn.ts`, and `--no-color` from\n * `src/shared/color.ts`.\n */\nimport { Command } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport {\n collect,\n configOption,\n readStdin,\n splitList,\n} from \"../shared/cli-options.js\";\nimport { shouldColor } from \"../shared/color.js\";\nimport { fail } from \"../shared/run.js\";\nimport { warn } from \"../shared/warn.js\";\nimport { GraphError } from \"./types.js\";\nimport { LOCAL_FLAG_HELP } from \"../shared/providers.js\";\nimport { ALL_FILL_FIELDS, type FillField } from \"./core/config.js\";\nimport {\n assertInputFormat,\n DEFAULT_EXTENSIONS,\n STDIN,\n} from \"./core/discover.js\";\nimport {\n CHECK_FORMATS,\n CHECK_FORMAT_LIST,\n GRAPH_FORMATS,\n GRAPH_FORMAT_LIST,\n type CheckFormat,\n type GraphFormat,\n} from \"./reporters/index.js\";\nimport { runBuild } from \"./commands/build.js\";\nimport { renderCheck, runCheck } from \"./commands/check.js\";\nimport {\n EXPORT_TARGETS,\n runExport,\n type ExportFormat,\n} from \"./commands/export.js\";\nimport { renderQuery, runQuery } from \"./commands/query.js\";\nimport { renderFill, runFill } from \"./commands/fill.js\";\nimport { runInit } from \"./commands/init.js\";\nimport { renderEmbed, runEmbed } from \"./commands/embed.js\";\nimport {\n renderSearch,\n runSearch,\n SEARCH_MODES,\n type SearchMode,\n} from \"./commands/search.js\";\nimport { renderStats, runStats } from \"./commands/stats.js\";\nimport { renderTraverse, runTraverse } from \"./commands/traverse.js\";\n\n/**\n * Whether `command`'s output gets colour: this domain's `--no-color` and\n * `NO_COLOR` turn it off, and otherwise only a TTY turns it on\n * (`shouldColor`). `isTTY` is passed uncoerced: Node leaves it undefined off\n * a terminal, never false, and `shouldColor` reads a missing one as \"not a\n * terminal\".\n *\n * Exported because this is where the decision is testable — a spawned bin is\n * never a TTY. graph's reporters print no colour yet; when one does, it takes\n * the boolean from here rather than consulting the environment itself.\n */\nexport function colorFor(\n command: Command,\n isTTY: boolean | undefined,\n env?: NodeJS.ProcessEnv,\n): boolean {\n // commander maps --no-color to opts.color === false, on the command that\n // declares it.\n const noColor = colorOwner(command).opts().color === false;\n return shouldColor({ noColor, isTTY, env });\n}\n\n/**\n * The nearest command, this one or an ancestor, that declares `--no-color`:\n * the `graph` program, wherever it is mounted. Not the root: under the umbrella\n * that is `manni`, which has no `--no-color` of its own.\n */\nfunction colorOwner(command: Command): Command {\n for (let c: Command | null = command; c !== null; c = c.parent) {\n if (c.options.some((o) => o.long === \"--no-color\")) return c;\n }\n return command;\n}\n\nexport function buildProgram(): Command {\nconst program = new Command();\n\nprogram\n .name(\"graph\")\n .description(\n \"Deterministic knowledge graphs derived from documentation frontmatter and formatting.\",\n )\n .version(pkg.version)\n .option(\"--no-color\", \"disable colored output\")\n // A pointer, not the whole help screen: the message that precedes it\n // already names the offending flag.\n .showHelpAfterError(\"(add --help for usage)\")\n // MUST come before the `.command()` calls below. `copyInheritedSettings`\n // copies `_exitCallback` by value at subcommand-creation time, so an\n // `exitOverride()` installed afterwards leaves every subcommand still\n // calling `process.exit(1)` — which reports a usage error as a finding.\n .exitOverride();\n\n/**\n * Parse a numeric CLI option, refusing what the config schema refuses.\n *\n * `Number.parseFloat`/`parseInt` return NaN for `abc` and silently accept\n * out-of-range values, and NaN then disables whatever gate it feeds — a cost\n * cap that never fires, a confidence gate that writes everything, a `--top`\n * that asks for a negative number of rows. The documented precedence is\n * config → Ajv → CLI override, so the override has to be held to the same range.\n */\nfunction numericOption(\n flag: string,\n { min, max, integer }: { min: number; max?: number; integer?: boolean },\n) {\n return (raw: string): number => {\n const value = Number.parseFloat(raw);\n if (!Number.isFinite(value)) {\n throw new GraphError(`${flag} expects a number, got \"${raw}\".`);\n }\n if (integer && !Number.isInteger(value)) {\n throw new GraphError(`${flag} expects a whole number, got ${value}.`);\n }\n if (value < min || (max !== undefined && value > max)) {\n const range = max === undefined ? `>= ${min}` : `${min}..${max}`;\n throw new GraphError(`${flag} must be ${range}, got ${value}.`);\n }\n return value;\n };\n}\n\n/** A count: a whole number, at least `min` (1 unless the flag allows zero). */\nfunction countOption(flag: string, min = 1) {\n return numericOption(flag, { min, integer: true });\n}\n\n/**\n * Hold a CLI override to the same list its config key is held to.\n *\n * `fill.provider` is Ajv-validated against the schema enum; the `--provider`\n * override was an arbitrary string cast straight to `ProviderName`, so the\n * documented config → Ajv → CLI precedence had a hole at the last step.\n */\nfunction enumOption<T extends string>(flag: string, allowed: readonly T[]) {\n return (raw: string): T => {\n if (!(allowed as readonly string[]).includes(raw)) {\n throw new GraphError(\n `${flag} must be one of ${allowed.join(\" | \")}, got \"${raw}\".`,\n );\n }\n return raw as T;\n };\n}\n\n/**\n * A flag whose value is one of a named set, refused in the family's words:\n * `Unknown --format \"xml\". Use pretty | json.` The check runs while the\n * options are parsed, so a typo costs a message rather than a graph load.\n */\nfunction choiceOption<T extends string>(flag: string, allowed: readonly T[]) {\n return (raw: string): T => {\n if (!(allowed as readonly string[]).includes(raw)) {\n throw new GraphError(`Unknown ${flag} \"${raw}\". Use ${allowed.join(\" | \")}.`);\n }\n return raw as T;\n };\n}\n\n/** `-f, --format`: every verb's list is `pretty | json` (0051 §2). */\nconst formatOption = choiceOption(\"--format\", GRAPH_FORMATS);\n\n/** `check`'s own, which adds `github` — the CI gate's annotation format. */\nconst checkFormatOption = choiceOption(\"--format\", CHECK_FORMATS);\n\n/**\n * `--fields <list>`: comma-separated and given once, never repeatable — one\n * separator per list (proposal 0034), and the spelling `meta fill --fields`\n * already uses. Each value is held to the same list `fill.fields` is.\n */\nconst fieldsOption = (raw: string): FillField[] =>\n splitList(raw).map((value) => enumOption(\"--fields\", ALL_FILL_FIELDS)(value));\n\n/**\n * The document-set surface the verbs that read documents share (proposals\n * 0041 and 0051 §1): positional `[paths...]` with `-` for stdin,\n * `--collection` and `--exclude` (each one value per occurrence), `--as`,\n * `--ext` (comma-separated, given once), `--allow-empty`, and\n * `-c`/`--no-config`. Declared once so the verbs cannot drift apart on a name\n * or a description, and worded as `meta` and `lint` word them.\n */\nfunction documentInputs(command: Command, verb: string): Command {\n return command\n .argument(\n \"[paths...]\",\n `files, directories, or globs to ${verb} (use - for stdin)`,\n )\n .option(\n \"--collection <name>\",\n \"Configured collection to read (repeatable)\",\n collect,\n [],\n )\n .option(\"--exclude <glob>\", \"Glob to exclude (repeatable)\", collect, [])\n .option(\"--as <format>\", \"force an input format (markdown, mdx)\")\n .option(\n \"--ext <list>\",\n \"comma-separated extensions for directory walks\",\n DEFAULT_EXTENSIONS.join(\",\"),\n )\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\");\n}\n\n/** The input flags as commander hands them over. */\ninterface InputFlags {\n as?: string;\n ext: string;\n allowEmpty?: boolean;\n}\n\n/**\n * The input flags for a core, and stdin when `paths` holds `-`. `--as` is\n * checked first, so `-` without it is refused before anything waits on stdin.\n */\nasync function inputOptions(\n paths: string[],\n opts: InputFlags,\n): Promise<{\n as?: string;\n ext: string[];\n allowEmpty?: boolean;\n stdinContent?: string;\n}> {\n assertInputFormat(paths, opts.as);\n return {\n ...(opts.as === undefined ? {} : { as: opts.as }),\n ext: splitList(opts.ext),\n ...(opts.allowEmpty === true ? { allowEmpty: true } : {}),\n ...(paths.includes(STDIN) ? { stdinContent: await readStdin() } : {}),\n };\n}\n\n/**\n * `-c`/`--no-config` for a verb that reads a built graph rather than a\n * document set. They share one commander attribute, which `configOption`\n * splits.\n */\nfunction configInputs(command: Command): Command {\n return command\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\");\n}\n\n/**\n * `opts` minus the one attribute `-c` and `--no-config` share. `documentOptions`\n * restates it as the two fields a core reads, and spreading the raw value over\n * them would put commander's `false` back where a path belongs.\n */\nfunction rest<T extends { config?: string | boolean }>(\n opts: T,\n): Omit<T, \"config\"> {\n const { config, ...others } = opts;\n return others;\n}\n\n/** The shared options as the command cores take them. */\nfunction documentOptions(opts: {\n collection?: string[];\n exclude?: string[];\n config?: string | boolean;\n}): {\n config?: string;\n noConfig?: boolean;\n collection?: string[];\n exclude?: string[];\n} {\n const { configPath, noConfig } = configOption(opts.config);\n return {\n ...(configPath === undefined ? {} : { config: configPath }),\n ...(noConfig === true ? { noConfig } : {}),\n ...(opts.collection === undefined ? {} : { collection: opts.collection }),\n ...(opts.exclude === undefined ? {} : { exclude: opts.exclude }),\n };\n}\n\nprogram\n .command(\"init\")\n .description(\"Add a starter `graph:` section to manni.config.yaml in the current directory\")\n .action(async () => {\n try {\n console.log(`Created ${await runInit()}`);\n } catch (e) {\n fail(e);\n }\n });\n\ndocumentInputs(\n program\n .command(\"build\")\n .description(\"Derive the knowledge graph and write deterministic Turtle\"),\n \"build\",\n)\n .option(\"-o, --out <path>\", \"Output .ttl path (default: config out)\")\n .action(async (paths: string[], opts: InputFlags & {\n config?: string | boolean;\n collection?: string[];\n exclude?: string[];\n out?: string;\n }) => {\n try {\n const result = await runBuild({\n paths,\n ...documentOptions(opts),\n ...(await inputOptions(paths, opts)),\n out: opts.out,\n });\n // Warnings go to stderr so stdout stays the machine-readable summary;\n // a degraded build is still a successful one, so the exit code is 0.\n for (const warning of result.warnings) warn(warning);\n console.log(\n `Wrote ${result.outPath} (${result.docs} docs, ${result.quads} triples)`,\n );\n } catch (e) {\n fail(e);\n }\n });\n\nconfigInputs(\n program\n .command(\"check\")\n .description(\n \"Validate the built graph against the bundled SHACL shapes (errors exit 1)\",\n ),\n)\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n // One path per occurrence, never split on commas: a path may hold one.\n .option(\n \"--shapes <path>\",\n \"Shapes .ttl file; repeatable (default: config check.shapes, then bundled)\",\n collect,\n [],\n )\n .option(\n \"-f, --format <format>\",\n `Output: ${CHECK_FORMAT_LIST}`,\n checkFormatOption,\n \"pretty\",\n )\n .action(\n async (opts: {\n config?: string | boolean;\n graph?: string;\n shapes: string[];\n format: CheckFormat;\n }) => {\n try {\n const report = await runCheck({ ...rest(opts), ...documentOptions(opts) });\n console.log(renderCheck(report, opts.format));\n process.exitCode = report.exitCode;\n } catch (e) {\n fail(e);\n }\n },\n );\n\ndocumentInputs(\n program\n .command(\"fill\")\n .description(\n \"Propose `graph:` frontmatter fields with an LLM, gated by confidence, and write them back\",\n ),\n \"fill\",\n)\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .option(\"--dry-run\", \"Report proposals without writing files\")\n .option(\"--force\", \"Overwrite human-set graph fields\")\n .option(\"--no-cache\", \"Bypass the proposal cache\")\n .option(\"--no-validate-graph\", \"Skip the SHACL graph guardrail on proposals\")\n .option(\"--sections\", \"Also propose per-section metadata\")\n .option(\n \"--max-turns <n>\",\n \"Stop after this many inference calls (a cached page costs none)\",\n countOption(\"--max-turns\"),\n )\n .option(\n \"--confidence <n>\",\n \"Minimum model confidence (0..1) to write a field (default: config, 0.7)\",\n numericOption(\"--confidence\", { min: 0, max: 1 }),\n )\n .option(\n // Comma-separated and given once: one separator per list (proposal 0034).\n \"--fields <list>\",\n `Fields to propose (comma-separated; default: config, then every field)`,\n fieldsOption,\n )\n // The nameable providers, and `auto`. `mock` is the library's test double:\n // accepted when asked for by name, never offered.\n .option(\n \"--provider <name>\",\n \"Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp\",\n )\n .option(\"--model <model>\", \"Model override; needs a named provider, from here or config\")\n .option(\"--local\", LOCAL_FLAG_HELP)\n // Typed inline, as every other action in this file is. The option parsers\n // above (`numericOption`, `choiceOption`, `fieldsOption`) have already thrown\n // on anything malformed by the time this runs, so a cast per field would be\n // safe — but it would also be the one command with the most options and the\n // least help from the compiler.\n .action(async (paths: string[], opts: InputFlags & {\n config?: string | boolean;\n collection?: string[];\n exclude?: string[];\n dryRun?: boolean;\n force?: boolean;\n cache?: boolean;\n validateGraph?: boolean;\n sections?: boolean;\n maxTurns?: number;\n confidence?: number;\n fields?: FillField[];\n provider?: string;\n model?: string;\n local?: boolean;\n format: GraphFormat;\n }) => {\n try {\n const report = await runFill({\n paths,\n ...documentOptions(opts),\n ...(await inputOptions(paths, opts)),\n dryRun: opts.dryRun,\n force: opts.force,\n noCache: opts.cache === false,\n noValidateGraph: opts.validateGraph === false,\n sections: opts.sections,\n maxTurns: opts.maxTurns,\n confidence: opts.confidence,\n fields: opts.fields,\n provider: opts.provider,\n model: opts.model,\n local: opts.local,\n });\n // Same channel discipline as build: warnings on stderr, so stdout stays\n // the report, and a warning never changes the exit code.\n for (const warning of report.warnings) warn(warning);\n const rendered = renderFill(report, opts.format);\n if (paths.includes(STDIN)) {\n // With `-` the filled document owns stdout, as under `meta fill -`,\n // and the report in either format is a diagnostic on stderr.\n if (report.stdinDocument !== undefined) {\n process.stdout.write(report.stdinDocument);\n }\n if (rendered.length > 0) process.stderr.write(`${rendered}\\n`);\n } else {\n console.log(rendered);\n }\n process.exitCode = report.exitCode;\n } catch (e) {\n fail(e);\n }\n });\n\nprogram\n .command(\"query\")\n .description(\n \"Match triple patterns against the built graph (omit a term for wildcard)\",\n )\n // Long-only, and named for the triple position each one fills. `-o` is\n // `--out` on every other graph verb and `-s` is meta's schema flag; a\n // one-letter spelling that means two things in one family costs more than\n // the letters it saves.\n .option(\"--subject <term>\", \"Subject IRI or prefixed name\")\n .option(\"--predicate <term>\", \"Predicate IRI or prefixed name\")\n .option(\"--object <term>\", \"Object IRI, prefixed name, or literal value\")\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .action(\n (opts: {\n subject?: string;\n predicate?: string;\n object?: string;\n config?: string | boolean;\n graph?: string;\n format: GraphFormat;\n }) => {\n try {\n const { subject, predicate, object, ...others } = rest(opts);\n const result = runQuery({\n ...others,\n ...documentOptions(opts),\n ...(subject === undefined ? {} : { s: subject }),\n ...(predicate === undefined ? {} : { p: predicate }),\n ...(object === undefined ? {} : { o: object }),\n });\n console.log(renderQuery(result, opts.format));\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"stats\")\n .description(\n \"Summarize the built graph: counts, orphans, broken links, hubs, metadata coverage\",\n )\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .option(\n \"--check\",\n \"Exit 1 when broken internal links exist or coverage is below threshold\",\n )\n .option(\n \"--top <n>\",\n \"How many most-connected docs to list\",\n countOption(\"--top\"),\n )\n .option(\n \"--coverage-threshold <pct>\",\n \"Minimum metadata coverage % (all fields); overrides config for this run\",\n // A percentage, so 0..100 rather than the 0..1 of a confidence. NaN here is\n // worse than a wrong number: `pct < NaN` is false for every field, so the\n // gate this flag exists to tighten would silently pass instead.\n numericOption(\"--coverage-threshold\", { min: 0, max: 100 }),\n )\n .action(\n (opts: {\n config?: string | boolean;\n graph?: string;\n format: GraphFormat;\n check?: boolean;\n top?: number;\n coverageThreshold?: number;\n }) => {\n try {\n const report = runStats({ ...rest(opts), ...documentOptions(opts) });\n console.log(renderStats(report, opts.format));\n process.exitCode = report.exitCode;\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"search\")\n .description(\"Rank graph nodes for a text query (needs `export search`)\")\n .argument(\"<query>\", \"Text query\")\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-i, --index <dir>\",\n \"Directory holding the indexes and manifest (default: beside the graph)\",\n )\n .option(\n \"--lang <tag>\",\n \"Which localization to search (required when the corpus has more than one)\",\n )\n .option(\"--limit <n>\", \"Maximum results (default 10)\", countOption(\"--limit\"))\n .option(\n \"--vectors <path>\",\n \"Vector sidecar path (default: from the manifest)\",\n )\n .option(\n \"--mode <mode>\",\n `Which legs to run: ${SEARCH_MODES.join(\" | \")} (default: hybrid when vectors exist)`,\n choiceOption(\"--mode\", SEARCH_MODES),\n )\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .action(\n async (\n query: string,\n opts: {\n config?: string | boolean;\n graph?: string;\n index?: string;\n lang?: string;\n limit?: number;\n vectors?: string;\n mode?: SearchMode;\n format: GraphFormat;\n },\n ) => {\n try {\n const report = await runSearch({\n ...rest(opts),\n ...documentOptions(opts),\n query,\n });\n console.log(renderSearch(report, opts.format));\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"traverse\")\n .description(\n \"Walk the graph from a node, honoring scope rules, with the full trace\",\n )\n .argument(\"<node>\", \"Starting node: a full IRI or a prefix:local CURIE\")\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-d, --depth <n>\",\n \"Maximum hops from the node (default 1; 3 under --impact)\",\n // Zero is allowed: it means the node itself, which is a real answer.\n countOption(\"--depth\", 0),\n )\n // Comma-separated and given once: a CURIE holds no comma, so one separator\n // is enough, and a second spelling would be a second thing to document.\n .option(\n \"--predicates <list>\",\n \"Only follow these predicates (comma-separated)\",\n )\n .option(\"--reverse\", \"Follow inbound edges (who points at this node)\")\n .option(\"--impact\", \"Transitive inbound reach: what a change here affects\")\n .option(\n \"--variant <variant>\",\n \"Scope filter: product variant IRI, title, or slug\",\n )\n // Not `--subject`: on `query` that is a triple's subject, and one flag name\n // means one thing across the domain.\n .option(\"--software-subject <subject>\", \"Scope filter: software subject\")\n .option(\"--lang <tag>\", \"Scope filter: BCP-47 language tag, matched in any case\")\n .option(\"--limit <n>\", \"Stop after this many nodes\", countOption(\"--limit\"))\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .action(\n (\n node: string,\n opts: {\n config?: string | boolean;\n graph?: string;\n depth?: number;\n predicates?: string;\n reverse?: boolean;\n impact?: boolean;\n variant?: string;\n softwareSubject?: string;\n lang?: string;\n limit?: number;\n format: GraphFormat;\n },\n ) => {\n try {\n const { softwareSubject, ...others } = rest(opts);\n const report = runTraverse({\n ...others,\n ...documentOptions(opts),\n ...(softwareSubject === undefined ? {} : { subject: softwareSubject }),\n node,\n predicates:\n opts.predicates === undefined\n ? undefined\n : splitList(opts.predicates),\n });\n console.log(renderTraverse(report, opts.format));\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"embed\")\n .description(\n \"Compute local embeddings for the search index (needs @huggingface/transformers)\",\n )\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-i, --index <dir>\",\n \"Directory holding the indexes and manifest (default: beside the graph)\",\n )\n .option(\n \"-o, --out <dir>\",\n \"Directory for the sidecars (default: the index directory)\",\n )\n // Not `--model`: on `fill` that is the inference model, a different thing.\n .option(\n \"--embedding-model <id>\",\n \"Embedding model id (any id; `mock` for offline runs)\",\n )\n .option(\"--dtype <dtype>\", \"Weight quantization (default q8)\")\n .option(\"--no-cache\", \"Ignore the vector cache\")\n .option(\n \"-f, --format <format>\",\n `Output: ${GRAPH_FORMAT_LIST}`,\n formatOption,\n \"pretty\",\n )\n .action(\n async (opts: {\n config?: string | boolean;\n graph?: string;\n index?: string;\n out?: string;\n embeddingModel?: string;\n dtype?: string;\n cache?: boolean;\n format: GraphFormat;\n }) => {\n try {\n const { embeddingModel, ...others } = rest(opts);\n const report = await runEmbed({\n ...others,\n ...documentOptions(opts),\n ...(embeddingModel === undefined ? {} : { model: embeddingModel }),\n noCache: opts.cache === false,\n });\n console.log(renderEmbed(report, opts.format));\n } catch (e) {\n fail(e);\n }\n },\n );\n\nprogram\n .command(\"export\")\n .description(\n \"Reserialize the built graph into a consumer format (jsonld file, iirds package, or search index)\",\n )\n // The target is a positional, not `-f`: `-f` is the output format in every\n // other verb of the family (0051 §2), and one flag cannot mean two things.\n .argument(\"<target>\", `What to write: ${EXPORT_TARGETS.join(\" | \")}`)\n .option(\"-c, --config <path>\", \"Path to manni.config.yaml\")\n .option(\"--no-config\", \"Ignore any discovered config file\")\n .option(\"-g, --graph <path>\", \"Graph .ttl path (default: config out)\")\n .option(\n \"-o, --out <path>\",\n \"Output path (default: the graph path with the target's extension)\",\n )\n .action(\n async (\n target: string,\n opts: { config?: string | boolean; graph?: string; out?: string },\n ) => {\n try {\n if (!(EXPORT_TARGETS as readonly string[]).includes(target)) {\n throw new GraphError(\n `Unknown export target \"${target}\". Use ${EXPORT_TARGETS.join(\" | \")}.`,\n );\n }\n const result = await runExport({\n ...documentOptions(opts),\n graph: opts.graph,\n format: target as ExportFormat,\n out: opts.out,\n });\n for (const warning of result.warnings) warn(warning);\n console.log(\n `Wrote ${result.nodes} node${result.nodes === 1 ? \"\" : \"s\"} to ${result.outPath}`,\n );\n } catch (e) {\n fail(e);\n }\n },\n );\n\nreturn program;\n}\n","/**\n * What `-f` accepts, per verb.\n *\n * Each verb's renderer lives beside its command core (`renderCheck`,\n * `renderStats`, …); what belongs here is the *list*, stated once so the\n * union, the guard, the help text and the refusal sentence cannot drift\n * apart. It is the same shape a11y and cite keep (`A11Y_FORMATS`,\n * `REPORT_FORMATS`), which is why the sentence a user reads is the family's.\n *\n * Every verb takes `pretty | json`. `check` also takes `github`, because it is\n * the CI gate: it is the one graph verb whose output changes what a reviewer sees\n * on a pull request (proposal 0051 §2). It names its own list here rather than\n * widening the shared one, so no other verb advertises a format it cannot\n * render.\n */\n\n/** The list every graph verb's `-f` accepts, in the order messages list them. */\nexport const GRAPH_FORMATS = [\"pretty\", \"json\"] as const;\nexport type GraphFormat = (typeof GRAPH_FORMATS)[number];\n\n/** `\"pretty | json\"`, for help text and the refusal sentence. */\nexport const GRAPH_FORMAT_LIST: string = GRAPH_FORMATS.join(\" | \");\n\n/** `check`'s list: the shared two plus the CI annotation format. */\nexport const CHECK_FORMATS = [...GRAPH_FORMATS, \"github\"] as const;\nexport type CheckFormat = (typeof CHECK_FORMATS)[number];\n\n/** `\"pretty | json | github\"`, for help text and the refusal sentence. */\nexport const CHECK_FORMAT_LIST: string = CHECK_FORMATS.join(\" | \");\n","/**\n * `manni graph init` — scaffold a starter `graph:` section in manni.config.yaml.\n *\n * The family file is shared with the other tools, so a file that already\n * exists is not overwritten: the section is appended to it, leaving the\n * siblings' keys and comments exactly as they were. A file that already has a\n * `graph:` key is refused.\n */\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { writeTextAtomic } from \"../../shared/write-file.js\";\nimport { GraphError } from \"../types.js\";\nimport { CONFIG_SECTION, DEFAULT_CONFIG_FILENAME } from \"../core/config.js\";\n\nconst HEADER = `# manni.config.yaml — shared configuration for the manni family of tools.\n# Each tool reads its own top-level key; manni graph reads \"graph:\".\n`;\n\nconst STARTER = `# Base IRI for every minted node. Set this to a namespace you control;\n# without it, IRIs fall back to the urn:manni:graph: placeholder.\n# baseIri: https://example.com/graph/\n\n# There is no document set here. \\`manni graph build\\` and \\`manni graph fill\\` read the\n# paths you name, or the collections declared once for every tool at the TOP\n# level of this file, beside \\`graph:\\` rather than inside it:\n#\n# collections:\n# - name: site\n# paths: [\"docs/**/*.md\"]\n#\n# Output of \\`manni graph build\\`.\nout: graph/graph.ttl\n\n# Map published-site routes back to source files so route-style links\n# (/docs/actions/find) become graph edges. A route may also carry the BCP-47\n# \\`language\\` labelling every document under its root; a page's own \\`lang\\`\n# frontmatter wins. Uncomment and adjust:\n# routes:\n# - basePath: /docs\n# root: docs\n# extensions: [.md, .mdx, .markdown]\n# indexFiles: [index, README]\n# - basePath: /docs/de\n# root: docs/de\n# language: de\n\n# What to derive triples from. Remove entries to opt out.\nbuild:\n derive: [frontmatter, sections, links, tags, images, code, provenance]\n\n# PROV-O settings. Git history is detected, not switched: per-file dates and\n# author agents, rename -> prov:wasRevisionOf, and the build activity's HEAD\n# committer date are derived wherever git can run over a repository, and a run\n# that cannot says so once and builds the rest. Deterministic per commit;\n# wall-clock time never enters the graph.\n# qualified: emit prov:qualifiedAttribution/qualifiedAssociation nodes\n# with roles alongside the direct properties.\nprovenance:\n qualified: true\n\n# Which fields a published graph may carry is read from x-manni-graph-output in\n# the schema set \\`manni meta validate\\` resolves for each page. Set that under\n# meta: (schemas, strict, register), not here. The default set keeps the\n# stewardship people fields (owner, stakeholders, reviewed-by) out.\n\n# SHACL shapes \\`manni graph check\\` validates the built graph against. Default:\n# the shapes contract bundled with manni (shapes/graph/shapes-1.0.0.ttl).\n# check:\n# shapes: [\"./my-shapes.ttl\"]\n\n# Metadata coverage gate for \\`manni graph stats --check\\`. A number applies to\n# every measured field; a map gates named fields only. Unset gates nothing.\n# stats:\n# coverageThreshold:\n# title: 100\n# description: 50\n\n# Which provider \\`manni graph fill\\` sends pages to. Unset, the family's\n# top-level providers: map decides, and then \\`auto\\`, which detects one: an\n# Anthropic key, then an OpenAI key, then the Claude CLI, then a local model.\n# Connection settings (apiKeyEnv, baseUrl, command) live in that map, declared\n# once for every manni tool. \\`--provider\\` wins over this, \\`--local\\` over both.\n# provider: anthropic # auto | anthropic | openai | claude-cli | llama-cpp\n# model: claude-sonnet-4-5 # the provider's default when omitted\n\n# LLM settings for \\`manni graph fill\\` (SKOS frontmatter proposals).\nfill:\n temperature: 0\n # Stop after this many inference calls. One page is one turn, and a cached\n # page spends none. Unset is unbounded.\n # maxTurns: 50\n cacheDir: .manni/graph/cache\n # fill proposes every field; confidence (0..1 per field) gates what is\n # written. Fields scored below the threshold are reported, not written.\n confidenceThreshold: 0.7\n # fields: defaults to every fillable field — uncomment to restrict.\n # Record meta-provenance (model + /graph/ pointers + confidence) on filled docs.\n writeProvenance: true\n # Reject proposals that would violate the SHACL shapes contract\n # (broader/narrower cycles, conflicting labels).\n validateGraph: true\n # Also propose per-section metadata. Off by default: it costs more output per\n # call, and section metadata is explicit-only, so review it as carefully.\n sections: false\n\n# Local embeddings for semantic search (\\`manni graph embed\\`). Needs the optional\n# peer: npm install @huggingface/transformers\n# embed:\n# model: onnx-community/granite-embedding-small-english-r2-ONNX\n# dtype: q8 # q8 keeps embedding reproducible across platforms\n# out: graph # directory for the per-language vector sidecars\n# cacheDir: .manni/graph/embed-cache\n\n# Optional enrichment for \\`manni graph export iirds\\` (the iiRDS package).\n# Absent, a minimal valid package is still produced.\n# export:\n# iirds:\n# title: My Docs # package title (default: \"manni graph export\")\n# creator: Acme Corp # Creator iirds:Party + vcard:Organization\n# version: \"1.3\" # iiRDS version literal: \"1.2\" | \"1.3\"\n`;\n\n/** The starter as a `graph:` section: every line nested one level. */\nfunction starterSection(): string {\n const body = STARTER.split(\"\\n\")\n .map((line) => (line === \"\" ? \"\" : ` ${line}`))\n .join(\"\\n\");\n return `${CONFIG_SECTION}:\\n${body}`;\n}\n\nexport async function runInit(cwd = process.cwd()): Promise<string> {\n const path = resolve(cwd, DEFAULT_CONFIG_FILENAME);\n if (!existsSync(path)) {\n await writeTextAtomic(path, `${HEADER}${starterSection()}`);\n return path;\n }\n\n // A family file is already here. Parse it to make sure a `graph:` key can be\n // appended: the document must be a mapping (or empty) without one.\n const text = readFileSync(path, \"utf8\");\n let doc: unknown;\n try {\n doc = parseYaml(text);\n } catch (e) {\n throw new GraphError(\n `Invalid YAML in ${DEFAULT_CONFIG_FILENAME}: ${errorMessage(e)}`,\n );\n }\n if (doc != null && (typeof doc !== \"object\" || Array.isArray(doc))) {\n throw new GraphError(\n `${DEFAULT_CONFIG_FILENAME}: top level must be a mapping — not adding a \\`${CONFIG_SECTION}:\\` section to it.`,\n );\n }\n if (doc != null && Object.hasOwn(doc, CONFIG_SECTION)) {\n throw new GraphError(\n `${DEFAULT_CONFIG_FILENAME} already has a \\`${CONFIG_SECTION}:\\` section — not overwriting.`,\n );\n }\n // Append as text rather than re-serialising the document, so the siblings'\n // keys and comments come out byte-for-byte as they went in.\n const separator = text === \"\" || text.endsWith(\"\\n\") ? \"\" : \"\\n\";\n const blank = text === \"\" ? \"\" : \"\\n\";\n await writeTextAtomic(\n path,\n `${text}${separator}${blank}${starterSection()}`,\n );\n return path;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,eAAe;;;ACMjB,IAAM,gBAAgB,CAAC,UAAU,MAAM;AAIvC,IAAM,oBAA4B,cAAc,KAAK,KAAK;AAG1D,IAAM,gBAAgB,CAAC,GAAG,eAAe,QAAQ;AAIjD,IAAM,oBAA4B,cAAc,KAAK,KAAK;;;ACpBjE,SAAS,YAAY,oBAAoB;AACzC,SAAS,eAAe;AACxB,SAAS,SAAS,iBAAiB;AAMnC,IAAM,SAAS;AAAA;AAAA;AAIf,IAAM,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyGhB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,IACF;AAAA,EACF;AAEF,UACG,QAAQ,QAAQ,EAChB;AAAA,IACC;AAAA,EACF,EAGC,SAAS,YAAY,kBAAkB,eAAe,KAAK,KAAK,CAAC,EAAE,EACnE,OAAO,uBAAuB,2BAA2B,EACzD,OAAO,eAAe,mCAAmC,EACzD,OAAO,sBAAsB,uCAAuC,EACpE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC,OACE,QACA,SACG;AACH,UAAI;AACF,YAAI,CAAE,eAAqC,SAAS,MAAM,GAAG;AAC3D,gBAAM,IAAI;AAAA,YACR,0BAA0B,MAAM,UAAU,eAAe,KAAK,KAAK,CAAC;AAAA,UACtE;AAAA,QACF;AACA,cAAM,SAAS,MAAM,UAAU;AAAA,UAC7B,GAAG,gBAAgB,IAAI;AAAA,UACvB,OAAO,KAAK;AAAA,UACZ,QAAQ;AAAA,UACR,KAAK,KAAK;AAAA,QACZ,CAAC;AACD,mBAAW,WAAW,OAAO,SAAU,MAAK,OAAO;AACnD,gBAAQ;AAAA,UACN,SAAS,OAAO,KAAK,QAAQ,OAAO,UAAU,IAAI,KAAK,GAAG,OAAO,OAAO,OAAO;AAAA,QACjF;AAAA,MACF,SAAS,GAAG;AACV,aAAK,CAAC;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEF,SAAO;AACP;","names":[]}
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ buildProgram,
4
+ parseQueryParams,
5
+ resolveGetInputs,
6
+ resolveQueryInputs
7
+ } from "./chunk-KCGV52AM.js";
8
+ import "./chunk-CYWHFSRT.js";
9
+ import "./chunk-K3D6FPV6.js";
10
+ import "./chunk-V46OILVC.js";
11
+ import "./chunk-RLR4TKUZ.js";
12
+ import "./chunk-C6OH6CNF.js";
13
+ import "./chunk-JVTNMVYU.js";
14
+ import "./chunk-YEUYKR62.js";
15
+ import "./chunk-RNVYGWIC.js";
16
+ import "./chunk-MNH7QO4Z.js";
17
+ import "./chunk-Q35YIDBV.js";
18
+ import "./chunk-UZC7LDAQ.js";
19
+ import "./chunk-OWBRDNRZ.js";
20
+ import "./chunk-G3T47CFV.js";
21
+ import "./chunk-2H7UOFLK.js";
22
+ export {
23
+ buildProgram,
24
+ parseQueryParams,
25
+ resolveGetInputs,
26
+ resolveQueryInputs
27
+ };
28
+ //# sourceMappingURL=cli-SHSMSRQY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,473 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ listReviews,
4
+ renderCalibration,
5
+ renderFill,
6
+ renderReviews,
7
+ runCalibrate,
8
+ runFill,
9
+ runGenerate,
10
+ runInit,
11
+ runPromote,
12
+ runReview,
13
+ seedGoldenCases
14
+ } from "./chunk-77HX34KD.js";
15
+ import {
16
+ renderList,
17
+ runList
18
+ } from "./chunk-YTCZRLTU.js";
19
+ import {
20
+ runRun
21
+ } from "./chunk-PHF3D7ER.js";
22
+ import "./chunk-NWZ2SLYL.js";
23
+ import "./chunk-LJ2RDH3F.js";
24
+ import {
25
+ allowExecutionMessage,
26
+ isExecutionGrant
27
+ } from "./chunk-YNHZHSSM.js";
28
+ import {
29
+ render
30
+ } from "./chunk-NCPWXHDO.js";
31
+ import {
32
+ REPORT_FORMATS,
33
+ SUMMARY_FORMATS,
34
+ parseFormat
35
+ } from "./chunk-ZXRAE55H.js";
36
+ import {
37
+ DocevalsError
38
+ } from "./chunk-SE4JN5XN.js";
39
+ import "./chunk-77AINBYM.js";
40
+ import "./chunk-TU2WUBVZ.js";
41
+ import "./chunk-H2DLH2JI.js";
42
+ import {
43
+ terminalConfirm
44
+ } from "./chunk-CYWHFSRT.js";
45
+ import "./chunk-K3D6FPV6.js";
46
+ import {
47
+ collect,
48
+ configOption
49
+ } from "./chunk-V46OILVC.js";
50
+ import "./chunk-RLR4TKUZ.js";
51
+ import "./chunk-C6OH6CNF.js";
52
+ import "./chunk-JVTNMVYU.js";
53
+ import {
54
+ fail
55
+ } from "./chunk-YEUYKR62.js";
56
+ import {
57
+ colorFor,
58
+ palette
59
+ } from "./chunk-RNVYGWIC.js";
60
+ import "./chunk-MNH7QO4Z.js";
61
+ import {
62
+ LOCAL_FLAG_HELP,
63
+ notice
64
+ } from "./chunk-Q35YIDBV.js";
65
+ import {
66
+ package_default
67
+ } from "./chunk-UZC7LDAQ.js";
68
+ import "./chunk-OWBRDNRZ.js";
69
+ import "./chunk-G3T47CFV.js";
70
+ import "./chunk-2H7UOFLK.js";
71
+
72
+ // src/docevals/cli.ts
73
+ import { Command } from "commander";
74
+ function buildProgram() {
75
+ const program = new Command();
76
+ program.name("docevals").description(
77
+ "Deterministic and LLM-as-judge evals for documentation pages, driven by frontmatter."
78
+ ).version(package_default.version).option("--no-color", "disable colored output").showHelpAfterError("(add --help for usage)").exitOverride();
79
+ function collectGrant(value, previous) {
80
+ if (!isExecutionGrant(value)) {
81
+ fail(new DocevalsError(allowExecutionMessage(value)));
82
+ }
83
+ return [...previous, value];
84
+ }
85
+ function parseIntArg(name) {
86
+ return (value) => {
87
+ const n = Number.parseInt(value, 10);
88
+ if (Number.isNaN(n) || n < 1) {
89
+ fail(new DocevalsError(`${name} must be a positive integer, got "${value}"`));
90
+ }
91
+ return n;
92
+ };
93
+ }
94
+ function collectArg(value, previous) {
95
+ return [...previous, value];
96
+ }
97
+ function parseFloatArg(name) {
98
+ return (value) => {
99
+ const n = Number.parseFloat(value);
100
+ if (Number.isNaN(n) || n < 0) {
101
+ fail(new DocevalsError(`${name} must be a non-negative number, got "${value}"`));
102
+ }
103
+ return n;
104
+ };
105
+ }
106
+ function parseFormatArg(name, allowed) {
107
+ return (value) => {
108
+ try {
109
+ return parseFormat(value, allowed, name);
110
+ } catch (e) {
111
+ fail(e);
112
+ }
113
+ };
114
+ }
115
+ function documentInputs(command, verb) {
116
+ return command.argument(
117
+ "[paths...]",
118
+ `Files, directories, or globs to ${verb} (default: the configured collections)`
119
+ ).option(
120
+ "--collection <name>",
121
+ "Configured collection to read (repeatable)",
122
+ collect,
123
+ []
124
+ ).option("--exclude <glob>", "Glob to exclude (repeatable)", collect, []).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file");
125
+ }
126
+ function documentOptions(opts) {
127
+ const { configPath, noConfig } = configOption(opts.config);
128
+ return {
129
+ ...configPath === void 0 ? {} : { config: configPath },
130
+ ...noConfig === true ? { noConfig } : {},
131
+ ...opts.collection === void 0 ? {} : { collection: opts.collection },
132
+ ...opts.exclude === void 0 ? {} : { exclude: opts.exclude }
133
+ };
134
+ }
135
+ documentInputs(
136
+ program.command("list").description("Show the resolved eval plan per page without running anything"),
137
+ "list"
138
+ ).option(
139
+ "-f, --format <format>",
140
+ `Output format: ${SUMMARY_FORMATS.join(" | ")}`,
141
+ parseFormatArg("--format", SUMMARY_FORMATS),
142
+ "pretty"
143
+ ).option("--eval <name>", "Show only this eval (repeatable)", collectArg, []).option("--suite <name>", "Show only evals in this suite").action(
144
+ async (paths, opts, command) => {
145
+ try {
146
+ const run = await runList(paths, {
147
+ ...documentOptions(opts),
148
+ format: opts.format,
149
+ evalNames: opts.eval,
150
+ suite: opts.suite
151
+ });
152
+ console.log(
153
+ renderList(run, opts.format, {
154
+ color: colorFor(command, process.stdout.isTTY)
155
+ })
156
+ );
157
+ process.exitCode = run.exitCode;
158
+ } catch (e) {
159
+ fail(e);
160
+ }
161
+ }
162
+ );
163
+ documentInputs(
164
+ program.command("run").description("Run evals against documentation pages"),
165
+ "evaluate"
166
+ ).option(
167
+ "-f, --format <format>",
168
+ `Output format: ${REPORT_FORMATS.join(" | ")}`,
169
+ parseFormatArg("--format", REPORT_FORMATS),
170
+ "pretty"
171
+ ).option("--deterministic-only", "Run only command/tool graders, skip the AI judge").option("--ai-only", "Run only AI-judged evals, skip deterministic graders").option(
172
+ // `<kind>`, not `<kind...>`: a variadic option greedily eats the
173
+ // positional `[paths...]` that follow it, so `--allow-execution
174
+ // frontmatter-commands docs/**` would silently swallow the glob and run
175
+ // over the default file set instead. Repeat the flag to grant twice.
176
+ "--allow-execution <kind>",
177
+ "Run only these execution grants (repeatable): frontmatter-commands",
178
+ collectGrant,
179
+ []
180
+ ).option("--no-execution", "Clear every execution grant for this run").option("--no-generate", "Do not generate scripts for command evals missing a command").option("--no-cache", "Bypass the judge response cache").option("--fail-on-review", "Exit 1 when any eval lands in the human-review zone").option("--provider <name>", "Judge provider: auto (default) | anthropic | openai | claude-cli | llama-cpp").option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).option("--runs <n>", "Ensemble runs per eval", parseIntArg("--runs")).option(
181
+ "--chunk-chars <n>",
182
+ "Characters of page per judge call; longer pages are read in parts",
183
+ parseIntArg("--chunk-chars")
184
+ ).option(
185
+ "--eval <name>",
186
+ "Run only this eval (repeatable); suite targets are not evaluated on a filtered run",
187
+ collectArg,
188
+ []
189
+ ).option("--suite <name>", "Run only evals in this suite").option(
190
+ "--since <ref>",
191
+ "Evaluate only pages whose file or eval manifest changed between this git ref and HEAD"
192
+ ).option(
193
+ "--newer-than <duration>",
194
+ "Evaluate only pages whose file or eval manifest changed within this window, such as 30m, 24h, 7d or 2w; in CI, prefer --since"
195
+ ).option(
196
+ "--max-turns <n>",
197
+ "Stop after this many ensemble runs (a cached ensemble costs none)",
198
+ parseIntArg("--max-turns")
199
+ ).option(
200
+ "--baseline [path]",
201
+ "Fail only on findings a recorded baseline does not already hold"
202
+ ).option("--no-baseline", "Ignore the configured baseline for this run").option(
203
+ "--write-baseline [path]",
204
+ "Record this run's findings as the baseline; without a path, the configured one"
205
+ ).action(async (paths, opts, command) => {
206
+ try {
207
+ const report = await runRun(paths, {
208
+ ...documentOptions({
209
+ config: opts.config,
210
+ collection: opts.collection,
211
+ exclude: opts.exclude
212
+ }),
213
+ // parseFormatArg validated this at parse time; the cast only re-narrows
214
+ // from the `unknown` that the Record-typed options bag erases it to.
215
+ format: opts.format,
216
+ deterministicOnly: opts.deterministicOnly,
217
+ aiOnly: opts.aiOnly,
218
+ // Commander's default is `[]`, which is "no flag", not "run nothing":
219
+ // only a list someone typed narrows the run.
220
+ allowExecution: opts.allowExecution.length > 0 ? opts.allowExecution : void 0,
221
+ execution: opts.execution,
222
+ generate: opts.generate,
223
+ cache: opts.cache,
224
+ failOnReview: opts.failOnReview,
225
+ provider: opts.provider,
226
+ model: opts.model,
227
+ local: opts.local,
228
+ runs: opts.runs,
229
+ chunkChars: opts.chunkChars,
230
+ maxTurns: opts.maxTurns,
231
+ evalNames: opts.eval,
232
+ suite: opts.suite,
233
+ since: opts.since,
234
+ newerThan: opts.newerThan,
235
+ // commander collapses `--baseline` to true and `--no-baseline` to
236
+ // false on the same key; a string is an explicit path.
237
+ baseline: opts.baseline,
238
+ writeBaseline: opts.writeBaseline,
239
+ toolVersion: package_default.version
240
+ });
241
+ console.log(
242
+ render(report, opts.format, {
243
+ color: colorFor(command, process.stdout.isTTY)
244
+ })
245
+ );
246
+ process.exitCode = report.exitCode;
247
+ } catch (e) {
248
+ fail(e);
249
+ }
250
+ });
251
+ documentInputs(
252
+ program.command("generate").description(
253
+ "Generate check scripts for command evals with a plain-language assertion but no command"
254
+ ),
255
+ "read"
256
+ ).option("--provider <name>", "Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp").option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).action(
257
+ async (paths, opts, command) => {
258
+ try {
259
+ const pc = palette(colorFor(command, process.stdout.isTTY));
260
+ const result = await runGenerate(paths, {
261
+ ...documentOptions(opts),
262
+ provider: opts.provider,
263
+ model: opts.model,
264
+ local: opts.local
265
+ });
266
+ if (result.targets === 0) {
267
+ console.log("Nothing to generate \u2014 every command eval has a command.");
268
+ return;
269
+ }
270
+ console.log(
271
+ `Generated ${result.generatedPaths.length}/${result.targets} check script(s):`
272
+ );
273
+ for (const p of result.generatedPaths) console.log(` ${p}`);
274
+ for (const r of result.refusals) console.log(pc.red(` ${r.message}`));
275
+ if (result.generatedPaths.length < result.targets) {
276
+ process.exitCode = 1;
277
+ }
278
+ } catch (e) {
279
+ fail(e);
280
+ }
281
+ }
282
+ );
283
+ documentInputs(
284
+ program.command("fill").description(
285
+ "Propose frontmatter evals for pages with an LLM; writes proposals at or above the confidence threshold"
286
+ ),
287
+ "fill"
288
+ ).option(
289
+ "-f, --format <format>",
290
+ `Output format: ${SUMMARY_FORMATS.join(" | ")}`,
291
+ parseFormatArg("--format", SUMMARY_FORMATS),
292
+ "pretty"
293
+ ).option("--dry-run", "Report proposals without writing frontmatter").option(
294
+ "--confidence <n>",
295
+ "Minimum confidence to write (0-1, default: config fill.confidenceThreshold)",
296
+ parseFloatArg("--confidence")
297
+ ).option(
298
+ "--max-turns <n>",
299
+ "Stop after this many inference calls (a cached page costs none)",
300
+ parseIntArg("--max-turns")
301
+ ).option("--no-cache", "Bypass the fill proposal cache").option(
302
+ "--chunk-chars <n>",
303
+ "Characters of page per fill call; longer pages are proposed in parts",
304
+ parseIntArg("--chunk-chars")
305
+ ).option("--provider <name>", "Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp").option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).action(async (paths, opts, command) => {
306
+ try {
307
+ const confidence = opts.confidence;
308
+ if (confidence !== void 0 && confidence > 1) {
309
+ fail(new DocevalsError(`--confidence must be between 0 and 1, got ${confidence}`));
310
+ }
311
+ const report = await runFill(paths, {
312
+ ...documentOptions({
313
+ config: opts.config,
314
+ collection: opts.collection,
315
+ exclude: opts.exclude
316
+ }),
317
+ dryRun: opts.dryRun,
318
+ confidence,
319
+ maxTurns: opts.maxTurns,
320
+ noCache: opts.cache === false ? true : void 0,
321
+ provider: opts.provider,
322
+ model: opts.model,
323
+ local: opts.local,
324
+ // P1 (proposal 0047): offered only on a terminal, where there is
325
+ // someone to answer. Off one the evals go to the page and the W1
326
+ // line says so.
327
+ confirm: terminalConfirm(),
328
+ onNotice: notice,
329
+ onRelocated: (result) => {
330
+ const manifests = result.manifests.map((m) => m.file).join(", ");
331
+ notice(
332
+ `moved ${String(result.summary.moved)} value(s) into ${manifests}.`
333
+ );
334
+ }
335
+ });
336
+ console.log(
337
+ renderFill(report, opts.format, {
338
+ color: colorFor(command, process.stdout.isTTY)
339
+ })
340
+ );
341
+ process.exitCode = report.exitCode;
342
+ } catch (e) {
343
+ fail(e);
344
+ }
345
+ });
346
+ documentInputs(
347
+ program.command("promote").description(
348
+ "Find ai-graded evals expressible as deterministic checks; --write converts them"
349
+ ),
350
+ "read"
351
+ ).option("--write", "Apply promotions (write scripts and rewrite evals)").option("--provider <name>", "Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp").option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).action(
352
+ async (paths, opts, command) => {
353
+ try {
354
+ const pc = palette(colorFor(command, process.stdout.isTTY));
355
+ const proposals = await runPromote(paths, {
356
+ ...documentOptions(opts),
357
+ write: opts.write,
358
+ provider: opts.provider,
359
+ model: opts.model,
360
+ local: opts.local
361
+ });
362
+ if (proposals.length === 0) {
363
+ console.log("No ai-graded evals found.");
364
+ return;
365
+ }
366
+ for (const p of proposals) {
367
+ const tag = p.promotable ? p.applied ? pc.green("promoted") : pc.cyan("promotable") : pc.dim("keep-ai");
368
+ const script = p.scriptPath ? pc.dim(` -> ${p.scriptPath}`) : "";
369
+ console.log(`${tag} ${p.evalName} (${p.source}, ${p.file})${script}`);
370
+ console.log(pc.dim(` ${p.rationale}`));
371
+ if (p.error !== void 0) console.log(pc.red(` ${p.error}`));
372
+ }
373
+ if (!opts.write && proposals.some((p) => p.promotable)) {
374
+ console.log(pc.cyan("\nRe-run with --write to apply promotions."));
375
+ }
376
+ } catch (e) {
377
+ fail(e);
378
+ }
379
+ }
380
+ );
381
+ program.command("calibrate").description(
382
+ "Measure judge agreement against a human-verified golden set (.manni/docevals/golden/*.yaml)"
383
+ ).option("-c, --config <path>", "Path to manni.config.yaml").option("--golden <dir>", "Golden set directory", ".manni/docevals/golden").option(
384
+ "--seed",
385
+ "Write golden candidates from recorded reviews and exit; judges nothing, needs no provider"
386
+ ).option("--provider <name>", "Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp").option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).option("--runs <n>", "Ensemble runs per case", parseIntArg("--runs")).option(
387
+ "--max-turns <n>",
388
+ "Stop after this many ensemble runs (a cached ensemble costs none)",
389
+ parseIntArg("--max-turns")
390
+ ).option("--no-cache", "Bypass the judge response cache").action(
391
+ async (opts, command) => {
392
+ try {
393
+ const color = colorFor(command, process.stdout.isTTY);
394
+ const pc = palette(color);
395
+ if (opts.seed) {
396
+ const seeded = seedGoldenCases({ golden: opts.golden });
397
+ if (seeded.total === 0) {
398
+ console.log(
399
+ "No recorded reviews to seed from \u2014 run `manni docevals review <file> <eval> <pass|fail>` first."
400
+ );
401
+ return;
402
+ }
403
+ const changed = seeded.added + seeded.updated;
404
+ console.log(
405
+ changed === 0 ? `No new reviews to seed \u2014 ${seeded.total} golden case(s) already in ${seeded.path}.` : `Wrote ${changed} golden candidate(s) to ${seeded.path} (${seeded.added} new, ${seeded.updated} updated; ${seeded.total} total).`
406
+ );
407
+ if (seeded.unreviewed > 0) {
408
+ console.log(
409
+ pc.yellow(
410
+ `${seeded.unreviewed} case(s) are \`reviewed: false\`. Read them and set \`reviewed: true\` \u2014 a golden set assembled without a human is not one.`
411
+ )
412
+ );
413
+ }
414
+ return;
415
+ }
416
+ const report = await runCalibrate({
417
+ config: opts.config,
418
+ golden: opts.golden,
419
+ provider: opts.provider,
420
+ model: opts.model,
421
+ local: opts.local,
422
+ runs: opts.runs,
423
+ maxTurns: opts.maxTurns,
424
+ noCache: opts.cache === false
425
+ });
426
+ console.log(renderCalibration(report, { color }));
427
+ process.exitCode = report.meetsThreshold && report.unjudged === 0 && report.balanced ? 0 : 1;
428
+ } catch (e) {
429
+ fail(e);
430
+ }
431
+ }
432
+ );
433
+ program.command("init").description("Create a starter manni.config.yaml in the current directory").action(() => {
434
+ try {
435
+ console.log(`Created ${runInit()}`);
436
+ } catch (e) {
437
+ fail(e);
438
+ }
439
+ });
440
+ program.command("review").description(
441
+ "Record a human verdict for an eval in the human-review zone (or list recorded reviews)"
442
+ ).argument("[file]", "Page path").argument("[eval]", "Eval name").argument("[verdict]", "pass | fail").option("--reviewer <name>", "Reviewer name recorded with the verdict").option("--note <text>", "Optional note").action(
443
+ (file, evalName, verdict, opts, command) => {
444
+ try {
445
+ if (!file) {
446
+ console.log(
447
+ renderReviews(listReviews(), {
448
+ color: colorFor(command, process.stdout.isTTY)
449
+ })
450
+ );
451
+ return;
452
+ }
453
+ if (!evalName || !verdict) {
454
+ throw new DocevalsError(
455
+ "Usage: manni docevals review <file> <eval> <pass|fail>"
456
+ );
457
+ }
458
+ const entry = runReview(file, evalName, verdict, opts);
459
+ console.log(
460
+ `Recorded ${entry.verdict} for ${entry.evalName} on ${entry.file}`
461
+ );
462
+ } catch (e) {
463
+ fail(e);
464
+ }
465
+ }
466
+ );
467
+ return program;
468
+ }
469
+ export {
470
+ buildProgram,
471
+ colorFor
472
+ };
473
+ //# sourceMappingURL=cli-SRHFUZHA.js.map