@hawkeyexl/manni 4.3.1 → 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-CFDUZRM2.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-KJR7OVDX.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-UBMMXS2Y.js → chunk-KCGV52AM.js} +69 -48
  67. package/dist/{chunk-UBMMXS2Y.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-HAPTXWU2.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-5HNHEUD5.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-G5CM2VGQ.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 -7661
  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-A5HZKYIW.js +0 -18
  206. package/dist/calibrate-S5K6QHUY.js +0 -13
  207. package/dist/capture-OZEZDABQ.js +0 -15
  208. package/dist/chunk-3R23C5DT.js.map +0 -1
  209. package/dist/chunk-CFDUZRM2.js.map +0 -1
  210. package/dist/chunk-G5CM2VGQ.js.map +0 -1
  211. package/dist/chunk-KJR7OVDX.js.map +0 -1
  212. package/dist/chunk-V4KUVE47.js +0 -27170
  213. package/dist/chunk-V4KUVE47.js.map +0 -1
  214. package/dist/chunk-ZQBTK3DO.js +0 -26518
  215. package/dist/chunk-ZQBTK3DO.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-A5HZKYIW.js.map → batch-DFRCLY77.js.map} +0 -0
  220. /package/dist/{calibrate-S5K6QHUY.js.map → build-Q5C6SX5J.js.map} +0 -0
  221. /package/dist/{capture-OZEZDABQ.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-HAPTXWU2.js.map → chunk-MYC3O5EJ.js.map} +0 -0
  224. /package/dist/{chunk-5HNHEUD5.js.map → chunk-XYLUCIKQ.js.map} +0 -0
@@ -0,0 +1,626 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ renderCheck,
4
+ runCheck
5
+ } from "./chunk-6OYEI2VV.js";
6
+ import {
7
+ EXPORT_TARGETS,
8
+ SEARCH_MODES,
9
+ renderEmbed,
10
+ renderFill,
11
+ renderQuery,
12
+ renderSearch,
13
+ renderStats,
14
+ renderTraverse,
15
+ runEmbed,
16
+ runExport,
17
+ runFill,
18
+ runQuery,
19
+ runSearch,
20
+ runStats,
21
+ runTraverse
22
+ } from "./chunk-644JVKJ4.js";
23
+ import {
24
+ DEFAULT_EXTENSIONS,
25
+ STDIN,
26
+ assertInputFormat,
27
+ runBuild
28
+ } from "./chunk-YIL4XLLJ.js";
29
+ import "./chunk-MYMBCTDE.js";
30
+ import {
31
+ ALL_FILL_FIELDS,
32
+ CONFIG_SECTION,
33
+ DEFAULT_CONFIG_FILENAME,
34
+ GraphError
35
+ } from "./chunk-M2JCK5F6.js";
36
+ import "./chunk-TIUTIOFB.js";
37
+ import "./chunk-TU2WUBVZ.js";
38
+ import "./chunk-H2DLH2JI.js";
39
+ import "./chunk-CYWHFSRT.js";
40
+ import "./chunk-K3D6FPV6.js";
41
+ import {
42
+ collect,
43
+ configOption,
44
+ readStdin,
45
+ splitList
46
+ } from "./chunk-V46OILVC.js";
47
+ import {
48
+ writeTextAtomic
49
+ } from "./chunk-RLR4TKUZ.js";
50
+ import "./chunk-C6OH6CNF.js";
51
+ import "./chunk-JVTNMVYU.js";
52
+ import {
53
+ fail
54
+ } from "./chunk-YEUYKR62.js";
55
+ import {
56
+ shouldColor
57
+ } from "./chunk-RNVYGWIC.js";
58
+ import "./chunk-MNH7QO4Z.js";
59
+ import {
60
+ LOCAL_FLAG_HELP,
61
+ warn
62
+ } from "./chunk-Q35YIDBV.js";
63
+ import {
64
+ package_default
65
+ } from "./chunk-UZC7LDAQ.js";
66
+ import "./chunk-OWBRDNRZ.js";
67
+ import {
68
+ errorMessage
69
+ } from "./chunk-G3T47CFV.js";
70
+ import "./chunk-2H7UOFLK.js";
71
+
72
+ // src/graph/cli.ts
73
+ import { Command } from "commander";
74
+
75
+ // src/graph/reporters/index.ts
76
+ var GRAPH_FORMATS = ["pretty", "json"];
77
+ var GRAPH_FORMAT_LIST = GRAPH_FORMATS.join(" | ");
78
+ var CHECK_FORMATS = [...GRAPH_FORMATS, "github"];
79
+ var CHECK_FORMAT_LIST = CHECK_FORMATS.join(" | ");
80
+
81
+ // src/graph/commands/init.ts
82
+ import { existsSync, readFileSync } from "node:fs";
83
+ import { resolve } from "node:path";
84
+ import { parse as parseYaml } from "yaml";
85
+ var HEADER = `# manni.config.yaml \u2014 shared configuration for the manni family of tools.
86
+ # Each tool reads its own top-level key; manni graph reads "graph:".
87
+ `;
88
+ var STARTER = `# Base IRI for every minted node. Set this to a namespace you control;
89
+ # without it, IRIs fall back to the urn:manni:graph: placeholder.
90
+ # baseIri: https://example.com/graph/
91
+
92
+ # There is no document set here. \`manni graph build\` and \`manni graph fill\` read the
93
+ # paths you name, or the collections declared once for every tool at the TOP
94
+ # level of this file, beside \`graph:\` rather than inside it:
95
+ #
96
+ # collections:
97
+ # - name: site
98
+ # paths: ["docs/**/*.md"]
99
+ #
100
+ # Output of \`manni graph build\`.
101
+ out: graph/graph.ttl
102
+
103
+ # Map published-site routes back to source files so route-style links
104
+ # (/docs/actions/find) become graph edges. A route may also carry the BCP-47
105
+ # \`language\` labelling every document under its root; a page's own \`lang\`
106
+ # frontmatter wins. Uncomment and adjust:
107
+ # routes:
108
+ # - basePath: /docs
109
+ # root: docs
110
+ # extensions: [.md, .mdx, .markdown]
111
+ # indexFiles: [index, README]
112
+ # - basePath: /docs/de
113
+ # root: docs/de
114
+ # language: de
115
+
116
+ # What to derive triples from. Remove entries to opt out.
117
+ build:
118
+ derive: [frontmatter, sections, links, tags, images, code, provenance]
119
+
120
+ # PROV-O settings. Git history is detected, not switched: per-file dates and
121
+ # author agents, rename -> prov:wasRevisionOf, and the build activity's HEAD
122
+ # committer date are derived wherever git can run over a repository, and a run
123
+ # that cannot says so once and builds the rest. Deterministic per commit;
124
+ # wall-clock time never enters the graph.
125
+ # qualified: emit prov:qualifiedAttribution/qualifiedAssociation nodes
126
+ # with roles alongside the direct properties.
127
+ provenance:
128
+ qualified: true
129
+
130
+ # Which fields a published graph may carry is read from x-manni-graph-output in
131
+ # the schema set \`manni meta validate\` resolves for each page. Set that under
132
+ # meta: (schemas, strict, register), not here. The default set keeps the
133
+ # stewardship people fields (owner, stakeholders, reviewed-by) out.
134
+
135
+ # SHACL shapes \`manni graph check\` validates the built graph against. Default:
136
+ # the shapes contract bundled with manni (shapes/graph/shapes-1.0.0.ttl).
137
+ # check:
138
+ # shapes: ["./my-shapes.ttl"]
139
+
140
+ # Metadata coverage gate for \`manni graph stats --check\`. A number applies to
141
+ # every measured field; a map gates named fields only. Unset gates nothing.
142
+ # stats:
143
+ # coverageThreshold:
144
+ # title: 100
145
+ # description: 50
146
+
147
+ # Which provider \`manni graph fill\` sends pages to. Unset, the family's
148
+ # top-level providers: map decides, and then \`auto\`, which detects one: an
149
+ # Anthropic key, then an OpenAI key, then the Claude CLI, then a local model.
150
+ # Connection settings (apiKeyEnv, baseUrl, command) live in that map, declared
151
+ # once for every manni tool. \`--provider\` wins over this, \`--local\` over both.
152
+ # provider: anthropic # auto | anthropic | openai | claude-cli | llama-cpp
153
+ # model: claude-sonnet-4-5 # the provider's default when omitted
154
+
155
+ # LLM settings for \`manni graph fill\` (SKOS frontmatter proposals).
156
+ fill:
157
+ temperature: 0
158
+ # Stop after this many inference calls. One page is one turn, and a cached
159
+ # page spends none. Unset is unbounded.
160
+ # maxTurns: 50
161
+ cacheDir: .manni/graph/cache
162
+ # fill proposes every field; confidence (0..1 per field) gates what is
163
+ # written. Fields scored below the threshold are reported, not written.
164
+ confidenceThreshold: 0.7
165
+ # fields: defaults to every fillable field \u2014 uncomment to restrict.
166
+ # Record meta-provenance (model + /graph/ pointers + confidence) on filled docs.
167
+ writeProvenance: true
168
+ # Reject proposals that would violate the SHACL shapes contract
169
+ # (broader/narrower cycles, conflicting labels).
170
+ validateGraph: true
171
+ # Also propose per-section metadata. Off by default: it costs more output per
172
+ # call, and section metadata is explicit-only, so review it as carefully.
173
+ sections: false
174
+
175
+ # Local embeddings for semantic search (\`manni graph embed\`). Needs the optional
176
+ # peer: npm install @huggingface/transformers
177
+ # embed:
178
+ # model: onnx-community/granite-embedding-small-english-r2-ONNX
179
+ # dtype: q8 # q8 keeps embedding reproducible across platforms
180
+ # out: graph # directory for the per-language vector sidecars
181
+ # cacheDir: .manni/graph/embed-cache
182
+
183
+ # Optional enrichment for \`manni graph export iirds\` (the iiRDS package).
184
+ # Absent, a minimal valid package is still produced.
185
+ # export:
186
+ # iirds:
187
+ # title: My Docs # package title (default: "manni graph export")
188
+ # creator: Acme Corp # Creator iirds:Party + vcard:Organization
189
+ # version: "1.3" # iiRDS version literal: "1.2" | "1.3"
190
+ `;
191
+ function starterSection() {
192
+ const body = STARTER.split("\n").map((line) => line === "" ? "" : ` ${line}`).join("\n");
193
+ return `${CONFIG_SECTION}:
194
+ ${body}`;
195
+ }
196
+ async function runInit(cwd = process.cwd()) {
197
+ const path = resolve(cwd, DEFAULT_CONFIG_FILENAME);
198
+ if (!existsSync(path)) {
199
+ await writeTextAtomic(path, `${HEADER}${starterSection()}`);
200
+ return path;
201
+ }
202
+ const text = readFileSync(path, "utf8");
203
+ let doc;
204
+ try {
205
+ doc = parseYaml(text);
206
+ } catch (e) {
207
+ throw new GraphError(
208
+ `Invalid YAML in ${DEFAULT_CONFIG_FILENAME}: ${errorMessage(e)}`
209
+ );
210
+ }
211
+ if (doc != null && (typeof doc !== "object" || Array.isArray(doc))) {
212
+ throw new GraphError(
213
+ `${DEFAULT_CONFIG_FILENAME}: top level must be a mapping \u2014 not adding a \`${CONFIG_SECTION}:\` section to it.`
214
+ );
215
+ }
216
+ if (doc != null && Object.hasOwn(doc, CONFIG_SECTION)) {
217
+ throw new GraphError(
218
+ `${DEFAULT_CONFIG_FILENAME} already has a \`${CONFIG_SECTION}:\` section \u2014 not overwriting.`
219
+ );
220
+ }
221
+ const separator = text === "" || text.endsWith("\n") ? "" : "\n";
222
+ const blank = text === "" ? "" : "\n";
223
+ await writeTextAtomic(
224
+ path,
225
+ `${text}${separator}${blank}${starterSection()}`
226
+ );
227
+ return path;
228
+ }
229
+
230
+ // src/graph/cli.ts
231
+ function colorFor(command, isTTY, env) {
232
+ const noColor = colorOwner(command).opts().color === false;
233
+ return shouldColor({ noColor, isTTY, env });
234
+ }
235
+ function colorOwner(command) {
236
+ for (let c = command; c !== null; c = c.parent) {
237
+ if (c.options.some((o) => o.long === "--no-color")) return c;
238
+ }
239
+ return command;
240
+ }
241
+ function buildProgram() {
242
+ const program = new Command();
243
+ program.name("graph").description(
244
+ "Deterministic knowledge graphs derived from documentation frontmatter and formatting."
245
+ ).version(package_default.version).option("--no-color", "disable colored output").showHelpAfterError("(add --help for usage)").exitOverride();
246
+ function numericOption(flag, { min, max, integer }) {
247
+ return (raw) => {
248
+ const value = Number.parseFloat(raw);
249
+ if (!Number.isFinite(value)) {
250
+ throw new GraphError(`${flag} expects a number, got "${raw}".`);
251
+ }
252
+ if (integer && !Number.isInteger(value)) {
253
+ throw new GraphError(`${flag} expects a whole number, got ${value}.`);
254
+ }
255
+ if (value < min || max !== void 0 && value > max) {
256
+ const range = max === void 0 ? `>= ${min}` : `${min}..${max}`;
257
+ throw new GraphError(`${flag} must be ${range}, got ${value}.`);
258
+ }
259
+ return value;
260
+ };
261
+ }
262
+ function countOption(flag, min = 1) {
263
+ return numericOption(flag, { min, integer: true });
264
+ }
265
+ function enumOption(flag, allowed) {
266
+ return (raw) => {
267
+ if (!allowed.includes(raw)) {
268
+ throw new GraphError(
269
+ `${flag} must be one of ${allowed.join(" | ")}, got "${raw}".`
270
+ );
271
+ }
272
+ return raw;
273
+ };
274
+ }
275
+ function choiceOption(flag, allowed) {
276
+ return (raw) => {
277
+ if (!allowed.includes(raw)) {
278
+ throw new GraphError(`Unknown ${flag} "${raw}". Use ${allowed.join(" | ")}.`);
279
+ }
280
+ return raw;
281
+ };
282
+ }
283
+ const formatOption = choiceOption("--format", GRAPH_FORMATS);
284
+ const checkFormatOption = choiceOption("--format", CHECK_FORMATS);
285
+ const fieldsOption = (raw) => splitList(raw).map((value) => enumOption("--fields", ALL_FILL_FIELDS)(value));
286
+ function documentInputs(command, verb) {
287
+ return command.argument(
288
+ "[paths...]",
289
+ `files, directories, or globs to ${verb} (use - for stdin)`
290
+ ).option(
291
+ "--collection <name>",
292
+ "Configured collection to read (repeatable)",
293
+ collect,
294
+ []
295
+ ).option("--exclude <glob>", "Glob to exclude (repeatable)", collect, []).option("--as <format>", "force an input format (markdown, mdx)").option(
296
+ "--ext <list>",
297
+ "comma-separated extensions for directory walks",
298
+ DEFAULT_EXTENSIONS.join(",")
299
+ ).option("--allow-empty", "treat zero matched files as success").option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file");
300
+ }
301
+ async function inputOptions(paths, opts) {
302
+ assertInputFormat(paths, opts.as);
303
+ return {
304
+ ...opts.as === void 0 ? {} : { as: opts.as },
305
+ ext: splitList(opts.ext),
306
+ ...opts.allowEmpty === true ? { allowEmpty: true } : {},
307
+ ...paths.includes(STDIN) ? { stdinContent: await readStdin() } : {}
308
+ };
309
+ }
310
+ function configInputs(command) {
311
+ return command.option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file");
312
+ }
313
+ function rest(opts) {
314
+ const { config, ...others } = opts;
315
+ return others;
316
+ }
317
+ function documentOptions(opts) {
318
+ const { configPath, noConfig } = configOption(opts.config);
319
+ return {
320
+ ...configPath === void 0 ? {} : { config: configPath },
321
+ ...noConfig === true ? { noConfig } : {},
322
+ ...opts.collection === void 0 ? {} : { collection: opts.collection },
323
+ ...opts.exclude === void 0 ? {} : { exclude: opts.exclude }
324
+ };
325
+ }
326
+ program.command("init").description("Add a starter `graph:` section to manni.config.yaml in the current directory").action(async () => {
327
+ try {
328
+ console.log(`Created ${await runInit()}`);
329
+ } catch (e) {
330
+ fail(e);
331
+ }
332
+ });
333
+ documentInputs(
334
+ program.command("build").description("Derive the knowledge graph and write deterministic Turtle"),
335
+ "build"
336
+ ).option("-o, --out <path>", "Output .ttl path (default: config out)").action(async (paths, opts) => {
337
+ try {
338
+ const result = await runBuild({
339
+ paths,
340
+ ...documentOptions(opts),
341
+ ...await inputOptions(paths, opts),
342
+ out: opts.out
343
+ });
344
+ for (const warning of result.warnings) warn(warning);
345
+ console.log(
346
+ `Wrote ${result.outPath} (${result.docs} docs, ${result.quads} triples)`
347
+ );
348
+ } catch (e) {
349
+ fail(e);
350
+ }
351
+ });
352
+ configInputs(
353
+ program.command("check").description(
354
+ "Validate the built graph against the bundled SHACL shapes (errors exit 1)"
355
+ )
356
+ ).option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
357
+ "--shapes <path>",
358
+ "Shapes .ttl file; repeatable (default: config check.shapes, then bundled)",
359
+ collect,
360
+ []
361
+ ).option(
362
+ "-f, --format <format>",
363
+ `Output: ${CHECK_FORMAT_LIST}`,
364
+ checkFormatOption,
365
+ "pretty"
366
+ ).action(
367
+ async (opts) => {
368
+ try {
369
+ const report = await runCheck({ ...rest(opts), ...documentOptions(opts) });
370
+ console.log(renderCheck(report, opts.format));
371
+ process.exitCode = report.exitCode;
372
+ } catch (e) {
373
+ fail(e);
374
+ }
375
+ }
376
+ );
377
+ documentInputs(
378
+ program.command("fill").description(
379
+ "Propose `graph:` frontmatter fields with an LLM, gated by confidence, and write them back"
380
+ ),
381
+ "fill"
382
+ ).option(
383
+ "-f, --format <format>",
384
+ `Output: ${GRAPH_FORMAT_LIST}`,
385
+ formatOption,
386
+ "pretty"
387
+ ).option("--dry-run", "Report proposals without writing files").option("--force", "Overwrite human-set graph fields").option("--no-cache", "Bypass the proposal cache").option("--no-validate-graph", "Skip the SHACL graph guardrail on proposals").option("--sections", "Also propose per-section metadata").option(
388
+ "--max-turns <n>",
389
+ "Stop after this many inference calls (a cached page costs none)",
390
+ countOption("--max-turns")
391
+ ).option(
392
+ "--confidence <n>",
393
+ "Minimum model confidence (0..1) to write a field (default: config, 0.7)",
394
+ numericOption("--confidence", { min: 0, max: 1 })
395
+ ).option(
396
+ // Comma-separated and given once: one separator per list (proposal 0034).
397
+ "--fields <list>",
398
+ `Fields to propose (comma-separated; default: config, then every field)`,
399
+ fieldsOption
400
+ ).option(
401
+ "--provider <name>",
402
+ "Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp"
403
+ ).option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).action(async (paths, opts) => {
404
+ try {
405
+ const report = await runFill({
406
+ paths,
407
+ ...documentOptions(opts),
408
+ ...await inputOptions(paths, opts),
409
+ dryRun: opts.dryRun,
410
+ force: opts.force,
411
+ noCache: opts.cache === false,
412
+ noValidateGraph: opts.validateGraph === false,
413
+ sections: opts.sections,
414
+ maxTurns: opts.maxTurns,
415
+ confidence: opts.confidence,
416
+ fields: opts.fields,
417
+ provider: opts.provider,
418
+ model: opts.model,
419
+ local: opts.local
420
+ });
421
+ for (const warning of report.warnings) warn(warning);
422
+ const rendered = renderFill(report, opts.format);
423
+ if (paths.includes(STDIN)) {
424
+ if (report.stdinDocument !== void 0) {
425
+ process.stdout.write(report.stdinDocument);
426
+ }
427
+ if (rendered.length > 0) process.stderr.write(`${rendered}
428
+ `);
429
+ } else {
430
+ console.log(rendered);
431
+ }
432
+ process.exitCode = report.exitCode;
433
+ } catch (e) {
434
+ fail(e);
435
+ }
436
+ });
437
+ program.command("query").description(
438
+ "Match triple patterns against the built graph (omit a term for wildcard)"
439
+ ).option("--subject <term>", "Subject IRI or prefixed name").option("--predicate <term>", "Predicate IRI or prefixed name").option("--object <term>", "Object IRI, prefixed name, or literal value").option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
440
+ "-f, --format <format>",
441
+ `Output: ${GRAPH_FORMAT_LIST}`,
442
+ formatOption,
443
+ "pretty"
444
+ ).action(
445
+ (opts) => {
446
+ try {
447
+ const { subject, predicate, object, ...others } = rest(opts);
448
+ const result = runQuery({
449
+ ...others,
450
+ ...documentOptions(opts),
451
+ ...subject === void 0 ? {} : { s: subject },
452
+ ...predicate === void 0 ? {} : { p: predicate },
453
+ ...object === void 0 ? {} : { o: object }
454
+ });
455
+ console.log(renderQuery(result, opts.format));
456
+ } catch (e) {
457
+ fail(e);
458
+ }
459
+ }
460
+ );
461
+ program.command("stats").description(
462
+ "Summarize the built graph: counts, orphans, broken links, hubs, metadata coverage"
463
+ ).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
464
+ "-f, --format <format>",
465
+ `Output: ${GRAPH_FORMAT_LIST}`,
466
+ formatOption,
467
+ "pretty"
468
+ ).option(
469
+ "--check",
470
+ "Exit 1 when broken internal links exist or coverage is below threshold"
471
+ ).option(
472
+ "--top <n>",
473
+ "How many most-connected docs to list",
474
+ countOption("--top")
475
+ ).option(
476
+ "--coverage-threshold <pct>",
477
+ "Minimum metadata coverage % (all fields); overrides config for this run",
478
+ // A percentage, so 0..100 rather than the 0..1 of a confidence. NaN here is
479
+ // worse than a wrong number: `pct < NaN` is false for every field, so the
480
+ // gate this flag exists to tighten would silently pass instead.
481
+ numericOption("--coverage-threshold", { min: 0, max: 100 })
482
+ ).action(
483
+ (opts) => {
484
+ try {
485
+ const report = runStats({ ...rest(opts), ...documentOptions(opts) });
486
+ console.log(renderStats(report, opts.format));
487
+ process.exitCode = report.exitCode;
488
+ } catch (e) {
489
+ fail(e);
490
+ }
491
+ }
492
+ );
493
+ program.command("search").description("Rank graph nodes for a text query (needs `export search`)").argument("<query>", "Text query").option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
494
+ "-i, --index <dir>",
495
+ "Directory holding the indexes and manifest (default: beside the graph)"
496
+ ).option(
497
+ "--lang <tag>",
498
+ "Which localization to search (required when the corpus has more than one)"
499
+ ).option("--limit <n>", "Maximum results (default 10)", countOption("--limit")).option(
500
+ "--vectors <path>",
501
+ "Vector sidecar path (default: from the manifest)"
502
+ ).option(
503
+ "--mode <mode>",
504
+ `Which legs to run: ${SEARCH_MODES.join(" | ")} (default: hybrid when vectors exist)`,
505
+ choiceOption("--mode", SEARCH_MODES)
506
+ ).option(
507
+ "-f, --format <format>",
508
+ `Output: ${GRAPH_FORMAT_LIST}`,
509
+ formatOption,
510
+ "pretty"
511
+ ).action(
512
+ async (query, opts) => {
513
+ try {
514
+ const report = await runSearch({
515
+ ...rest(opts),
516
+ ...documentOptions(opts),
517
+ query
518
+ });
519
+ console.log(renderSearch(report, opts.format));
520
+ } catch (e) {
521
+ fail(e);
522
+ }
523
+ }
524
+ );
525
+ program.command("traverse").description(
526
+ "Walk the graph from a node, honoring scope rules, with the full trace"
527
+ ).argument("<node>", "Starting node: a full IRI or a prefix:local CURIE").option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
528
+ "-d, --depth <n>",
529
+ "Maximum hops from the node (default 1; 3 under --impact)",
530
+ // Zero is allowed: it means the node itself, which is a real answer.
531
+ countOption("--depth", 0)
532
+ ).option(
533
+ "--predicates <list>",
534
+ "Only follow these predicates (comma-separated)"
535
+ ).option("--reverse", "Follow inbound edges (who points at this node)").option("--impact", "Transitive inbound reach: what a change here affects").option(
536
+ "--variant <variant>",
537
+ "Scope filter: product variant IRI, title, or slug"
538
+ ).option("--software-subject <subject>", "Scope filter: software subject").option("--lang <tag>", "Scope filter: BCP-47 language tag, matched in any case").option("--limit <n>", "Stop after this many nodes", countOption("--limit")).option(
539
+ "-f, --format <format>",
540
+ `Output: ${GRAPH_FORMAT_LIST}`,
541
+ formatOption,
542
+ "pretty"
543
+ ).action(
544
+ (node, opts) => {
545
+ try {
546
+ const { softwareSubject, ...others } = rest(opts);
547
+ const report = runTraverse({
548
+ ...others,
549
+ ...documentOptions(opts),
550
+ ...softwareSubject === void 0 ? {} : { subject: softwareSubject },
551
+ node,
552
+ predicates: opts.predicates === void 0 ? void 0 : splitList(opts.predicates)
553
+ });
554
+ console.log(renderTraverse(report, opts.format));
555
+ } catch (e) {
556
+ fail(e);
557
+ }
558
+ }
559
+ );
560
+ program.command("embed").description(
561
+ "Compute local embeddings for the search index (needs @huggingface/transformers)"
562
+ ).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
563
+ "-i, --index <dir>",
564
+ "Directory holding the indexes and manifest (default: beside the graph)"
565
+ ).option(
566
+ "-o, --out <dir>",
567
+ "Directory for the sidecars (default: the index directory)"
568
+ ).option(
569
+ "--embedding-model <id>",
570
+ "Embedding model id (any id; `mock` for offline runs)"
571
+ ).option("--dtype <dtype>", "Weight quantization (default q8)").option("--no-cache", "Ignore the vector cache").option(
572
+ "-f, --format <format>",
573
+ `Output: ${GRAPH_FORMAT_LIST}`,
574
+ formatOption,
575
+ "pretty"
576
+ ).action(
577
+ async (opts) => {
578
+ try {
579
+ const { embeddingModel, ...others } = rest(opts);
580
+ const report = await runEmbed({
581
+ ...others,
582
+ ...documentOptions(opts),
583
+ ...embeddingModel === void 0 ? {} : { model: embeddingModel },
584
+ noCache: opts.cache === false
585
+ });
586
+ console.log(renderEmbed(report, opts.format));
587
+ } catch (e) {
588
+ fail(e);
589
+ }
590
+ }
591
+ );
592
+ program.command("export").description(
593
+ "Reserialize the built graph into a consumer format (jsonld file, iirds package, or search index)"
594
+ ).argument("<target>", `What to write: ${EXPORT_TARGETS.join(" | ")}`).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
595
+ "-o, --out <path>",
596
+ "Output path (default: the graph path with the target's extension)"
597
+ ).action(
598
+ async (target, opts) => {
599
+ try {
600
+ if (!EXPORT_TARGETS.includes(target)) {
601
+ throw new GraphError(
602
+ `Unknown export target "${target}". Use ${EXPORT_TARGETS.join(" | ")}.`
603
+ );
604
+ }
605
+ const result = await runExport({
606
+ ...documentOptions(opts),
607
+ graph: opts.graph,
608
+ format: target,
609
+ out: opts.out
610
+ });
611
+ for (const warning of result.warnings) warn(warning);
612
+ console.log(
613
+ `Wrote ${result.nodes} node${result.nodes === 1 ? "" : "s"} to ${result.outPath}`
614
+ );
615
+ } catch (e) {
616
+ fail(e);
617
+ }
618
+ }
619
+ );
620
+ return program;
621
+ }
622
+ export {
623
+ buildProgram,
624
+ colorFor
625
+ };
626
+ //# sourceMappingURL=cli-OFPZ5MAS.js.map