@shrkcrft/cli 0.1.0-alpha.30 → 0.1.0-alpha.31

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 (510) hide show
  1. package/dist/asset-preview/apply-asset-preview.js +1 -1
  2. package/dist/authoring/authoring-kit.d.ts +9 -1
  3. package/dist/authoring/authoring-kit.d.ts.map +1 -1
  4. package/dist/authoring/authoring-kit.js +26 -13
  5. package/dist/bootstrap/unlinked-workspace-dependency.d.ts +11 -0
  6. package/dist/bootstrap/unlinked-workspace-dependency.d.ts.map +1 -0
  7. package/dist/bootstrap/unlinked-workspace-dependency.js +99 -0
  8. package/dist/command-registry.d.ts +100 -1
  9. package/dist/command-registry.d.ts.map +1 -1
  10. package/dist/command-registry.js +130 -3
  11. package/dist/commands/api-diff.command.d.ts.map +1 -1
  12. package/dist/commands/api-diff.command.js +12 -0
  13. package/dist/commands/apply.command.d.ts.map +1 -1
  14. package/dist/commands/apply.command.js +3 -0
  15. package/dist/commands/arch.command.d.ts.map +1 -1
  16. package/dist/commands/arch.command.js +26 -7
  17. package/dist/commands/architecture.command.d.ts.map +1 -1
  18. package/dist/commands/architecture.command.js +8 -2
  19. package/dist/commands/baseline.command.d.ts +54 -3
  20. package/dist/commands/baseline.command.d.ts.map +1 -1
  21. package/dist/commands/baseline.command.js +582 -74
  22. package/dist/commands/biome.command.d.ts.map +1 -1
  23. package/dist/commands/biome.command.js +20 -0
  24. package/dist/commands/boundaries.command.d.ts +9 -1
  25. package/dist/commands/boundaries.command.d.ts.map +1 -1
  26. package/dist/commands/boundaries.command.js +88 -20
  27. package/dist/commands/bundle.command.d.ts.map +1 -1
  28. package/dist/commands/bundle.command.js +57 -11
  29. package/dist/commands/cache-align.command.d.ts.map +1 -1
  30. package/dist/commands/cache-align.command.js +3 -1
  31. package/dist/commands/changelog-data.d.ts.map +1 -1
  32. package/dist/commands/changelog-data.js +138 -0
  33. package/dist/commands/changes.command.d.ts.map +1 -1
  34. package/dist/commands/changes.command.js +15 -0
  35. package/dist/commands/check.command.d.ts.map +1 -1
  36. package/dist/commands/check.command.js +1241 -322
  37. package/dist/commands/checks.command.d.ts.map +1 -1
  38. package/dist/commands/checks.command.js +188 -40
  39. package/dist/commands/ci.command.d.ts.map +1 -1
  40. package/dist/commands/ci.command.js +35 -2
  41. package/dist/commands/code-intel.command.d.ts.map +1 -1
  42. package/dist/commands/code-intel.command.js +3 -0
  43. package/dist/commands/command-catalog.d.ts +23 -1
  44. package/dist/commands/command-catalog.d.ts.map +1 -1
  45. package/dist/commands/command-catalog.js +152 -35
  46. package/dist/commands/commands.command.d.ts +21 -3
  47. package/dist/commands/commands.command.d.ts.map +1 -1
  48. package/dist/commands/commands.command.js +172 -27
  49. package/dist/commands/compress.command.d.ts.map +1 -1
  50. package/dist/commands/compress.command.js +4 -0
  51. package/dist/commands/constructs.command.d.ts.map +1 -1
  52. package/dist/commands/constructs.command.js +50 -12
  53. package/dist/commands/context.command.d.ts.map +1 -1
  54. package/dist/commands/context.command.js +40 -5
  55. package/dist/commands/contract-templates.command.d.ts.map +1 -1
  56. package/dist/commands/contract-templates.command.js +9 -1
  57. package/dist/commands/contract.command.d.ts.map +1 -1
  58. package/dist/commands/contract.command.js +35 -0
  59. package/dist/commands/conventions.command.d.ts.map +1 -1
  60. package/dist/commands/conventions.command.js +189 -29
  61. package/dist/commands/coverage.command.d.ts.map +1 -1
  62. package/dist/commands/coverage.command.js +9 -0
  63. package/dist/commands/daily.commands.d.ts +0 -1
  64. package/dist/commands/daily.commands.d.ts.map +1 -1
  65. package/dist/commands/daily.commands.js +12 -76
  66. package/dist/commands/dashboard.command.d.ts.map +1 -1
  67. package/dist/commands/dashboard.command.js +10 -0
  68. package/dist/commands/dev.command.d.ts.map +1 -1
  69. package/dist/commands/dev.command.js +45 -2
  70. package/dist/commands/diagnostics.command.d.ts +0 -2
  71. package/dist/commands/diagnostics.command.d.ts.map +1 -1
  72. package/dist/commands/diagnostics.command.js +5 -78
  73. package/dist/commands/diff-check.command.d.ts +6 -4
  74. package/dist/commands/diff-check.command.d.ts.map +1 -1
  75. package/dist/commands/diff-check.command.js +190 -103
  76. package/dist/commands/docs-references.command.d.ts +13 -0
  77. package/dist/commands/docs-references.command.d.ts.map +1 -1
  78. package/dist/commands/docs-references.command.js +269 -72
  79. package/dist/commands/doctor.command.d.ts.map +1 -1
  80. package/dist/commands/doctor.command.js +58 -4
  81. package/dist/commands/drift.command.d.ts.map +1 -1
  82. package/dist/commands/drift.command.js +17 -4
  83. package/dist/commands/eslint.command.d.ts.map +1 -1
  84. package/dist/commands/eslint.command.js +20 -0
  85. package/dist/commands/export.command.d.ts.map +1 -1
  86. package/dist/commands/export.command.js +23 -1
  87. package/dist/commands/feedback-dispatch.command.d.ts.map +1 -1
  88. package/dist/commands/feedback-dispatch.command.js +29 -0
  89. package/dist/commands/feedback.command.d.ts.map +1 -1
  90. package/dist/commands/feedback.command.js +6 -1
  91. package/dist/commands/finish.command.d.ts.map +1 -1
  92. package/dist/commands/finish.command.js +32 -8
  93. package/dist/commands/fix.command.d.ts.map +1 -1
  94. package/dist/commands/fix.command.js +19 -0
  95. package/dist/commands/gate.command.d.ts +6 -1
  96. package/dist/commands/gate.command.d.ts.map +1 -1
  97. package/dist/commands/gate.command.js +50 -124
  98. package/dist/commands/gates.command.d.ts +52 -0
  99. package/dist/commands/gates.command.d.ts.map +1 -1
  100. package/dist/commands/gates.command.js +811 -185
  101. package/dist/commands/gen.command.d.ts.map +1 -1
  102. package/dist/commands/gen.command.js +4 -0
  103. package/dist/commands/generated.command.d.ts +33 -3
  104. package/dist/commands/generated.command.d.ts.map +1 -1
  105. package/dist/commands/generated.command.js +499 -147
  106. package/dist/commands/graph-code-subverbs.d.ts +15 -0
  107. package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
  108. package/dist/commands/graph-code-subverbs.js +198 -24
  109. package/dist/commands/graph.command.d.ts.map +1 -1
  110. package/dist/commands/graph.command.js +79 -37
  111. package/dist/commands/help.command.d.ts +30 -6
  112. package/dist/commands/help.command.d.ts.map +1 -1
  113. package/dist/commands/help.command.js +323 -199
  114. package/dist/commands/helper.command.d.ts +1 -0
  115. package/dist/commands/helper.command.d.ts.map +1 -1
  116. package/dist/commands/helper.command.js +195 -56
  117. package/dist/commands/impact.command.d.ts.map +1 -1
  118. package/dist/commands/impact.command.js +115 -12
  119. package/dist/commands/infer.command.d.ts.map +1 -1
  120. package/dist/commands/infer.command.js +20 -45
  121. package/dist/commands/ingest.command.d.ts +0 -1
  122. package/dist/commands/ingest.command.d.ts.map +1 -1
  123. package/dist/commands/ingest.command.js +25 -41
  124. package/dist/commands/knowledge-author.command.d.ts +0 -3
  125. package/dist/commands/knowledge-author.command.d.ts.map +1 -1
  126. package/dist/commands/knowledge-author.command.js +10 -23
  127. package/dist/commands/knowledge.command.d.ts.map +1 -1
  128. package/dist/commands/knowledge.command.js +469 -129
  129. package/dist/commands/languages.command.d.ts.map +1 -1
  130. package/dist/commands/languages.command.js +27 -0
  131. package/dist/commands/lint.command.d.ts.map +1 -1
  132. package/dist/commands/lint.command.js +3 -0
  133. package/dist/commands/mcp.command.d.ts +18 -0
  134. package/dist/commands/mcp.command.d.ts.map +1 -1
  135. package/dist/commands/mcp.command.js +33 -8
  136. package/dist/commands/onboard.command.d.ts.map +1 -1
  137. package/dist/commands/onboard.command.js +20 -0
  138. package/dist/commands/owners.command.d.ts.map +1 -1
  139. package/dist/commands/owners.command.js +14 -2
  140. package/dist/commands/packs-new.d.ts +13 -1
  141. package/dist/commands/packs-new.d.ts.map +1 -1
  142. package/dist/commands/packs-new.js +500 -335
  143. package/dist/commands/packs.command.d.ts.map +1 -1
  144. package/dist/commands/packs.command.js +378 -36
  145. package/dist/commands/paths.command.d.ts.map +1 -1
  146. package/dist/commands/paths.command.js +9 -1
  147. package/dist/commands/pipelines.command.d.ts.map +1 -1
  148. package/dist/commands/pipelines.command.js +7 -1
  149. package/dist/commands/plan-check.command.d.ts.map +1 -1
  150. package/dist/commands/plan-check.command.js +3 -0
  151. package/dist/commands/plan.command.d.ts.map +1 -1
  152. package/dist/commands/plan.command.js +3 -0
  153. package/dist/commands/playbooks.command.d.ts.map +1 -1
  154. package/dist/commands/playbooks.command.js +7 -2
  155. package/dist/commands/policy-lint.command.d.ts +19 -2
  156. package/dist/commands/policy-lint.command.d.ts.map +1 -1
  157. package/dist/commands/policy-lint.command.js +224 -65
  158. package/dist/commands/policy.command.d.ts.map +1 -1
  159. package/dist/commands/policy.command.js +6 -1
  160. package/dist/commands/pr.command.d.ts.map +1 -1
  161. package/dist/commands/pr.command.js +14 -0
  162. package/dist/commands/presets.command.d.ts.map +1 -1
  163. package/dist/commands/presets.command.js +12 -27
  164. package/dist/commands/profiles.command.d.ts.map +1 -1
  165. package/dist/commands/profiles.command.js +94 -26
  166. package/dist/commands/provenance.command.js +1 -1
  167. package/dist/commands/quality.command.d.ts.map +1 -1
  168. package/dist/commands/quality.command.js +129 -33
  169. package/dist/commands/recommend.command.d.ts +20 -4
  170. package/dist/commands/recommend.command.d.ts.map +1 -1
  171. package/dist/commands/recommend.command.js +172 -278
  172. package/dist/commands/registrations.command.d.ts.map +1 -1
  173. package/dist/commands/registrations.command.js +138 -13
  174. package/dist/commands/registry-lifecycle-run.d.ts +14 -0
  175. package/dist/commands/registry-lifecycle-run.d.ts.map +1 -0
  176. package/dist/commands/registry-lifecycle-run.js +336 -0
  177. package/dist/commands/registry.command.d.ts.map +1 -1
  178. package/dist/commands/registry.command.js +235 -62
  179. package/dist/commands/release.command.d.ts.map +1 -1
  180. package/dist/commands/release.command.js +99 -20
  181. package/dist/commands/report.command.d.ts.map +1 -1
  182. package/dist/commands/report.command.js +38 -2
  183. package/dist/commands/reuse-coverage.command.d.ts +23 -0
  184. package/dist/commands/reuse-coverage.command.d.ts.map +1 -0
  185. package/dist/commands/reuse-coverage.command.js +536 -0
  186. package/dist/commands/reuse.command.d.ts +3 -18
  187. package/dist/commands/reuse.command.d.ts.map +1 -1
  188. package/dist/commands/reuse.command.js +395 -244
  189. package/dist/commands/review.command.d.ts.map +1 -1
  190. package/dist/commands/review.command.js +33 -1
  191. package/dist/commands/rounds.command.d.ts.map +1 -1
  192. package/dist/commands/rounds.command.js +5 -0
  193. package/dist/commands/safety.command.d.ts.map +1 -1
  194. package/dist/commands/safety.command.js +9 -0
  195. package/dist/commands/scaffolds.command.d.ts.map +1 -1
  196. package/dist/commands/scaffolds.command.js +97 -25
  197. package/dist/commands/search.command.d.ts +0 -8
  198. package/dist/commands/search.command.d.ts.map +1 -1
  199. package/dist/commands/search.command.js +136 -28
  200. package/dist/commands/self-config-xrefs.command.d.ts +24 -0
  201. package/dist/commands/self-config-xrefs.command.d.ts.map +1 -0
  202. package/dist/commands/self-config-xrefs.command.js +170 -0
  203. package/dist/commands/self-config.command.d.ts.map +1 -1
  204. package/dist/commands/self-config.command.js +261 -65
  205. package/dist/commands/smart-context.command.d.ts.map +1 -1
  206. package/dist/commands/smart-context.command.js +39 -3
  207. package/dist/commands/spec.command.d.ts.map +1 -1
  208. package/dist/commands/spec.command.js +3 -0
  209. package/dist/commands/stats.command.d.ts.map +1 -1
  210. package/dist/commands/stats.command.js +3 -0
  211. package/dist/commands/surface.command.d.ts +6 -1
  212. package/dist/commands/surface.command.d.ts.map +1 -1
  213. package/dist/commands/surface.command.js +256 -54
  214. package/dist/commands/task-context.command.js +1 -1
  215. package/dist/commands/task.command.d.ts.map +1 -1
  216. package/dist/commands/task.command.js +22 -1
  217. package/dist/commands/templates.command.d.ts +4 -0
  218. package/dist/commands/templates.command.d.ts.map +1 -1
  219. package/dist/commands/templates.command.js +109 -22
  220. package/dist/commands/test.command.d.ts.map +1 -1
  221. package/dist/commands/test.command.js +161 -33
  222. package/dist/commands/tests.command.d.ts.map +1 -1
  223. package/dist/commands/tests.command.js +29 -3
  224. package/dist/commands/trace.command.d.ts.map +1 -1
  225. package/dist/commands/trace.command.js +29 -4
  226. package/dist/commands/watch.command.d.ts.map +1 -1
  227. package/dist/commands/watch.command.js +3 -0
  228. package/dist/commands/why.command.d.ts.map +1 -1
  229. package/dist/commands/why.command.js +3 -0
  230. package/dist/commands/wiring.command.d.ts +18 -4
  231. package/dist/commands/wiring.command.d.ts.map +1 -1
  232. package/dist/commands/wiring.command.js +360 -73
  233. package/dist/dashboard/code-intelligence-data.js +4 -4
  234. package/dist/diff/deleted-orphan-coverage.d.ts +32 -0
  235. package/dist/diff/deleted-orphan-coverage.d.ts.map +1 -0
  236. package/dist/diff/deleted-orphan-coverage.js +107 -0
  237. package/dist/diff/deleted-orphan-scope-notes.d.ts +23 -0
  238. package/dist/diff/deleted-orphan-scope-notes.d.ts.map +1 -0
  239. package/dist/diff/deleted-orphan-scope-notes.js +49 -0
  240. package/dist/diff/deleted-orphans.d.ts +32 -0
  241. package/dist/diff/deleted-orphans.d.ts.map +1 -1
  242. package/dist/diff/deleted-orphans.js +42 -2
  243. package/dist/dispatch/closest-match.d.ts +15 -0
  244. package/dist/dispatch/closest-match.d.ts.map +1 -0
  245. package/dist/dispatch/closest-match.js +47 -0
  246. package/dist/dispatch/global-flags.d.ts +94 -0
  247. package/dist/dispatch/global-flags.d.ts.map +1 -0
  248. package/dist/dispatch/global-flags.js +123 -0
  249. package/dist/dispatch/guard-invocation-input.d.ts +24 -0
  250. package/dist/dispatch/guard-invocation-input.d.ts.map +1 -0
  251. package/dist/dispatch/guard-invocation-input.js +1 -0
  252. package/dist/dispatch/guard-invocation.d.ts +33 -0
  253. package/dist/dispatch/guard-invocation.d.ts.map +1 -0
  254. package/dist/dispatch/guard-invocation.js +183 -0
  255. package/dist/dispatch/help-intercept.d.ts +22 -0
  256. package/dist/dispatch/help-intercept.d.ts.map +1 -0
  257. package/dist/dispatch/help-intercept.js +42 -0
  258. package/dist/dispatch/i-declared-invocation.d.ts +17 -0
  259. package/dist/dispatch/i-declared-invocation.d.ts.map +1 -0
  260. package/dist/dispatch/i-declared-invocation.js +1 -0
  261. package/dist/dispatch/i-unknown-flag-refusal-input.d.ts +28 -0
  262. package/dist/dispatch/i-unknown-flag-refusal-input.d.ts.map +1 -0
  263. package/dist/dispatch/i-unknown-flag-refusal-input.js +1 -0
  264. package/dist/dispatch/invocation-rejection-kind.d.ts +15 -0
  265. package/dist/dispatch/invocation-rejection-kind.d.ts.map +1 -0
  266. package/dist/dispatch/invocation-rejection-kind.js +15 -0
  267. package/dist/dispatch/invocation-rejection.d.ts +18 -0
  268. package/dist/dispatch/invocation-rejection.d.ts.map +1 -0
  269. package/dist/dispatch/invocation-rejection.js +1 -0
  270. package/dist/dispatch/judge-invocation.d.ts +24 -0
  271. package/dist/dispatch/judge-invocation.d.ts.map +1 -0
  272. package/dist/dispatch/judge-invocation.js +50 -0
  273. package/dist/dispatch/positional-mode.d.ts +18 -0
  274. package/dist/dispatch/positional-mode.d.ts.map +1 -0
  275. package/dist/dispatch/positional-mode.js +18 -0
  276. package/dist/dispatch/read-tracking-map.d.ts +28 -0
  277. package/dist/dispatch/read-tracking-map.d.ts.map +1 -0
  278. package/dist/dispatch/read-tracking-map.js +58 -0
  279. package/dist/dispatch/refuse-sibling-valve-flags.d.ts +30 -0
  280. package/dist/dispatch/refuse-sibling-valve-flags.d.ts.map +1 -0
  281. package/dist/dispatch/refuse-sibling-valve-flags.js +65 -0
  282. package/dist/dispatch/subverb-spec.d.ts +26 -0
  283. package/dist/dispatch/subverb-spec.d.ts.map +1 -0
  284. package/dist/dispatch/subverb-spec.js +1 -0
  285. package/dist/dispatch/undocumented-flag-reads.d.ts +22 -0
  286. package/dist/dispatch/undocumented-flag-reads.d.ts.map +1 -0
  287. package/dist/dispatch/undocumented-flag-reads.js +283 -0
  288. package/dist/dispatch/unknown-flag-refusal-mode.d.ts +13 -0
  289. package/dist/dispatch/unknown-flag-refusal-mode.d.ts.map +1 -0
  290. package/dist/dispatch/unknown-flag-refusal-mode.js +13 -0
  291. package/dist/dispatch/unknown-flag-refusal.d.ts +22 -0
  292. package/dist/dispatch/unknown-flag-refusal.d.ts.map +1 -0
  293. package/dist/dispatch/unknown-flag-refusal.js +57 -0
  294. package/dist/dispatch/unread-flags.d.ts +152 -0
  295. package/dist/dispatch/unread-flags.d.ts.map +1 -0
  296. package/dist/dispatch/unread-flags.js +295 -0
  297. package/dist/dispatch/verdict-valve-flag.d.ts +21 -0
  298. package/dist/dispatch/verdict-valve-flag.d.ts.map +1 -0
  299. package/dist/dispatch/verdict-valve-flag.js +21 -0
  300. package/dist/dispatch/walk-declared-subverbs.d.ts +14 -0
  301. package/dist/dispatch/walk-declared-subverbs.d.ts.map +1 -0
  302. package/dist/dispatch/walk-declared-subverbs.js +28 -0
  303. package/dist/exit-codes.d.ts +41 -3
  304. package/dist/exit-codes.d.ts.map +1 -1
  305. package/dist/exit-codes.js +153 -14
  306. package/dist/finish/run-finish.d.ts +72 -5
  307. package/dist/finish/run-finish.d.ts.map +1 -1
  308. package/dist/finish/run-finish.js +453 -104
  309. package/dist/gates/accepted-empty-note.d.ts +10 -0
  310. package/dist/gates/accepted-empty-note.d.ts.map +1 -0
  311. package/dist/gates/accepted-empty-note.js +11 -0
  312. package/dist/gates/allow-empty.d.ts +25 -0
  313. package/dist/gates/allow-empty.d.ts.map +1 -0
  314. package/dist/gates/allow-empty.js +27 -0
  315. package/dist/gates/asset-doctor-failing-units.d.ts +16 -0
  316. package/dist/gates/asset-doctor-failing-units.d.ts.map +1 -0
  317. package/dist/gates/asset-doctor-failing-units.js +14 -0
  318. package/dist/gates/asset-doctor-failure-line.d.ts +16 -0
  319. package/dist/gates/asset-doctor-failure-line.d.ts.map +1 -0
  320. package/dist/gates/asset-doctor-failure-line.js +28 -0
  321. package/dist/gates/empty-rule-advice-lines.d.ts +15 -0
  322. package/dist/gates/empty-rule-advice-lines.d.ts.map +1 -0
  323. package/dist/gates/empty-rule-advice-lines.js +20 -0
  324. package/dist/gates/gate-envelope.d.ts +85 -8
  325. package/dist/gates/gate-envelope.d.ts.map +1 -1
  326. package/dist/gates/gate-envelope.js +56 -7
  327. package/dist/gates/gate-rule-globs.d.ts +37 -3
  328. package/dist/gates/gate-rule-globs.d.ts.map +1 -1
  329. package/dist/gates/gate-rule-globs.js +78 -40
  330. package/dist/gates/gate-rule-view.d.ts +17 -4
  331. package/dist/gates/gate-rule-view.d.ts.map +1 -1
  332. package/dist/gates/gate-rule-view.js +105 -90
  333. package/dist/gates/i-coverage-dead-glob.d.ts +19 -0
  334. package/dist/gates/i-coverage-dead-glob.d.ts.map +1 -0
  335. package/dist/gates/i-coverage-dead-glob.js +1 -0
  336. package/dist/gates/i-coverage-negation.d.ts +13 -0
  337. package/dist/gates/i-coverage-negation.d.ts.map +1 -0
  338. package/dist/gates/i-coverage-negation.js +1 -0
  339. package/dist/gates/i-registration-query-settle-input.d.ts +18 -0
  340. package/dist/gates/i-registration-query-settle-input.d.ts.map +1 -0
  341. package/dist/gates/i-registration-query-settle-input.js +1 -0
  342. package/dist/gates/i-unit-state-note-row.d.ts +16 -0
  343. package/dist/gates/i-unit-state-note-row.d.ts.map +1 -0
  344. package/dist/gates/i-unit-state-note-row.js +1 -0
  345. package/dist/gates/i-unit-state-notes.d.ts +32 -0
  346. package/dist/gates/i-unit-state-notes.d.ts.map +1 -0
  347. package/dist/gates/i-unit-state-notes.js +1 -0
  348. package/dist/gates/incomplete-registry-inventory.d.ts +19 -0
  349. package/dist/gates/incomplete-registry-inventory.d.ts.map +1 -0
  350. package/dist/gates/incomplete-registry-inventory.js +63 -0
  351. package/dist/gates/measure-registration-roles.d.ts +10 -0
  352. package/dist/gates/measure-registration-roles.d.ts.map +1 -0
  353. package/dist/gates/measure-registration-roles.js +9 -0
  354. package/dist/gates/plane-verdict.d.ts +14 -0
  355. package/dist/gates/plane-verdict.d.ts.map +1 -0
  356. package/dist/gates/plane-verdict.js +22 -0
  357. package/dist/gates/qualify-clean-for-units.d.ts +12 -0
  358. package/dist/gates/qualify-clean-for-units.d.ts.map +1 -0
  359. package/dist/gates/qualify-clean-for-units.js +18 -0
  360. package/dist/gates/registration-graph-verdict.d.ts +34 -0
  361. package/dist/gates/registration-graph-verdict.d.ts.map +1 -0
  362. package/dist/gates/registration-graph-verdict.js +70 -0
  363. package/dist/gates/registration-roles.d.ts +9 -0
  364. package/dist/gates/registration-roles.d.ts.map +1 -0
  365. package/dist/gates/registration-roles.js +1 -0
  366. package/dist/gates/registry-liveness.d.ts +11 -0
  367. package/dist/gates/registry-liveness.d.ts.map +1 -0
  368. package/dist/gates/registry-liveness.js +13 -0
  369. package/dist/gates/rule-coverage.d.ts +187 -4
  370. package/dist/gates/rule-coverage.d.ts.map +1 -1
  371. package/dist/gates/rule-coverage.js +501 -49
  372. package/dist/gates/run-gate-planes.d.ts +14 -0
  373. package/dist/gates/run-gate-planes.d.ts.map +1 -1
  374. package/dist/gates/run-gate-planes.js +172 -30
  375. package/dist/gates/scaffold-selftest.d.ts +56 -0
  376. package/dist/gates/scaffold-selftest.d.ts.map +1 -0
  377. package/dist/gates/scaffold-selftest.js +119 -0
  378. package/dist/gates/seam-rejected-rules.d.ts +28 -0
  379. package/dist/gates/seam-rejected-rules.d.ts.map +1 -0
  380. package/dist/gates/seam-rejected-rules.js +95 -0
  381. package/dist/gates/self-test-check.d.ts +29 -0
  382. package/dist/gates/self-test-check.d.ts.map +1 -0
  383. package/dist/gates/self-test-check.js +1 -0
  384. package/dist/gates/self-test-subject.d.ts +28 -0
  385. package/dist/gates/self-test-subject.d.ts.map +1 -0
  386. package/dist/gates/self-test-subject.js +1 -0
  387. package/dist/gates/self-test.d.ts +20 -0
  388. package/dist/gates/self-test.d.ts.map +1 -0
  389. package/dist/gates/self-test.js +82 -0
  390. package/dist/gates/settle-verdict.d.ts +14 -0
  391. package/dist/gates/settle-verdict.d.ts.map +1 -0
  392. package/dist/gates/settle-verdict.js +13 -0
  393. package/dist/gates/settled-verdict.d.ts +8 -0
  394. package/dist/gates/settled-verdict.d.ts.map +1 -0
  395. package/dist/gates/settled-verdict.js +1 -0
  396. package/dist/gates/template-registry-coverage.d.ts +18 -0
  397. package/dist/gates/template-registry-coverage.d.ts.map +1 -0
  398. package/dist/gates/template-registry-coverage.js +24 -0
  399. package/dist/gates/unit-state-notes.d.ts +40 -0
  400. package/dist/gates/unit-state-notes.d.ts.map +1 -0
  401. package/dist/gates/unit-state-notes.js +71 -0
  402. package/dist/gates/verdict-line.d.ts +18 -0
  403. package/dist/gates/verdict-line.d.ts.map +1 -0
  404. package/dist/gates/verdict-line.js +40 -0
  405. package/dist/graph/graph-reuse-lookup.d.ts +10 -0
  406. package/dist/graph/graph-reuse-lookup.d.ts.map +1 -0
  407. package/dist/graph/graph-reuse-lookup.js +41 -0
  408. package/dist/graph/index-behind-hint.d.ts +11 -0
  409. package/dist/graph/index-behind-hint.d.ts.map +1 -0
  410. package/dist/graph/index-behind-hint.js +27 -0
  411. package/dist/knowledge/knowledge-stale-gate-flags.d.ts +3 -0
  412. package/dist/knowledge/knowledge-stale-gate-flags.d.ts.map +1 -0
  413. package/dist/knowledge/knowledge-stale-gate-flags.js +1 -0
  414. package/dist/knowledge/knowledge-stale-gate-input.d.ts +3 -0
  415. package/dist/knowledge/knowledge-stale-gate-input.d.ts.map +1 -0
  416. package/dist/knowledge/knowledge-stale-gate-input.js +1 -0
  417. package/dist/knowledge/knowledge-stale-gate-result.d.ts +3 -0
  418. package/dist/knowledge/knowledge-stale-gate-result.d.ts.map +1 -0
  419. package/dist/knowledge/knowledge-stale-gate-result.js +1 -0
  420. package/dist/knowledge/knowledge-stale-gate.d.ts +10 -0
  421. package/dist/knowledge/knowledge-stale-gate.d.ts.map +1 -0
  422. package/dist/knowledge/knowledge-stale-gate.js +9 -0
  423. package/dist/main.d.ts.map +1 -1
  424. package/dist/main.js +200 -83
  425. package/dist/output/failure-hints.d.ts.map +1 -1
  426. package/dist/output/failure-hints.js +11 -9
  427. package/dist/output/rejected-entries-note.d.ts +57 -0
  428. package/dist/output/rejected-entries-note.d.ts.map +1 -0
  429. package/dist/output/rejected-entries-note.js +103 -0
  430. package/dist/output/stdout-is-pipe.d.ts +13 -0
  431. package/dist/output/stdout-is-pipe.d.ts.map +1 -0
  432. package/dist/output/stdout-is-pipe.js +21 -0
  433. package/dist/packs/stale-build-warning.d.ts +11 -0
  434. package/dist/packs/stale-build-warning.d.ts.map +1 -0
  435. package/dist/packs/stale-build-warning.js +23 -0
  436. package/dist/quality/run-quality.d.ts +123 -0
  437. package/dist/quality/run-quality.d.ts.map +1 -0
  438. package/dist/quality/run-quality.js +442 -0
  439. package/dist/schemas/json-schemas.d.ts +184 -3
  440. package/dist/schemas/json-schemas.d.ts.map +1 -1
  441. package/dist/schemas/json-schemas.js +113 -2
  442. package/dist/shrk.d.ts +3 -0
  443. package/dist/shrk.d.ts.map +1 -0
  444. package/dist/shrk.js +30 -0
  445. package/dist/surface/audience-applicability.d.ts +26 -0
  446. package/dist/surface/audience-applicability.d.ts.map +1 -0
  447. package/dist/surface/audience-applicability.js +60 -0
  448. package/dist/surface/catalog-command-safety.d.ts +18 -0
  449. package/dist/surface/catalog-command-safety.d.ts.map +1 -0
  450. package/dist/surface/catalog-command-safety.js +62 -0
  451. package/dist/surface/cli-command-resolver.d.ts +21 -0
  452. package/dist/surface/cli-command-resolver.d.ts.map +1 -0
  453. package/dist/surface/cli-command-resolver.js +87 -0
  454. package/dist/surface/command-dispatch-kind.d.ts +20 -0
  455. package/dist/surface/command-dispatch-kind.d.ts.map +1 -0
  456. package/dist/surface/command-dispatch-kind.js +20 -0
  457. package/dist/surface/command-index-entry.d.ts +40 -0
  458. package/dist/surface/command-index-entry.d.ts.map +1 -0
  459. package/dist/surface/command-index-entry.js +1 -0
  460. package/dist/surface/command-index.d.ts +77 -0
  461. package/dist/surface/command-index.d.ts.map +1 -0
  462. package/dist/surface/command-index.js +323 -0
  463. package/dist/surface/i-command-index.d.ts +22 -0
  464. package/dist/surface/i-command-index.d.ts.map +1 -0
  465. package/dist/surface/i-command-index.js +1 -0
  466. package/dist/surface/i-command-string-context.d.ts +20 -0
  467. package/dist/surface/i-command-string-context.d.ts.map +1 -0
  468. package/dist/surface/i-command-string-context.js +1 -0
  469. package/dist/surface/i-surface-denial.d.ts +13 -0
  470. package/dist/surface/i-surface-denial.d.ts.map +1 -0
  471. package/dist/surface/i-surface-denial.js +1 -0
  472. package/dist/surface/load-surface-context.d.ts +17 -1
  473. package/dist/surface/load-surface-context.d.ts.map +1 -1
  474. package/dist/surface/load-surface-context.js +48 -10
  475. package/dist/surface/not-enabled-error.d.ts +38 -4
  476. package/dist/surface/not-enabled-error.d.ts.map +1 -1
  477. package/dist/surface/not-enabled-error.js +96 -6
  478. package/dist/surface/profiles.d.ts +7 -0
  479. package/dist/surface/profiles.d.ts.map +1 -1
  480. package/dist/surface/resolve-command-string.d.ts +10 -0
  481. package/dist/surface/resolve-command-string.d.ts.map +1 -0
  482. package/dist/surface/resolve-command-string.js +572 -0
  483. package/dist/surface/surface-config-writer.d.ts +7 -2
  484. package/dist/surface/surface-config-writer.d.ts.map +1 -1
  485. package/dist/surface/surface-config-writer.js +25 -6
  486. package/dist/surface/surface-layer.d.ts +11 -0
  487. package/dist/surface/surface-layer.d.ts.map +1 -0
  488. package/dist/surface/surface-layer.js +11 -0
  489. package/dist/surface/surface-refusal-reason.d.ts +16 -0
  490. package/dist/surface/surface-refusal-reason.d.ts.map +1 -0
  491. package/dist/surface/surface-refusal-reason.js +16 -0
  492. package/dist/surface/surface-selector.d.ts +26 -0
  493. package/dist/surface/surface-selector.d.ts.map +1 -0
  494. package/dist/surface/surface-selector.js +42 -0
  495. package/dist/surface/surface-summary.d.ts +61 -18
  496. package/dist/surface/surface-summary.d.ts.map +1 -1
  497. package/dist/surface/surface-summary.js +147 -60
  498. package/dist/surface/tier.d.ts +85 -22
  499. package/dist/surface/tier.d.ts.map +1 -1
  500. package/dist/surface/tier.js +132 -30
  501. package/dist/usage/usage-log.d.ts +6 -1
  502. package/dist/usage/usage-log.d.ts.map +1 -1
  503. package/dist/usage/usage-log.js +7 -2
  504. package/dist/validation/run-validation-loop.d.ts +9 -0
  505. package/dist/validation/run-validation-loop.d.ts.map +1 -1
  506. package/dist/validation/run-validation-loop.js +14 -11
  507. package/dist/validation/typecheck-emitted.d.ts +8 -9
  508. package/dist/validation/typecheck-emitted.d.ts.map +1 -1
  509. package/dist/validation/typecheck-emitted.js +17 -97
  510. package/package.json +34 -34
@@ -1,38 +1,61 @@
1
+ import { detectSharkcraftRepo } from '@shrkcrft/inspector';
2
+ import { resolveCwd } from "../command-registry.js";
1
3
  import { header } from "../output/format-output.js";
2
- import { COMMAND_CATALOG, defaultShowInHelp, listExplainFamily } from "./command-catalog.js";
4
+ import { nearest } from "../dispatch/closest-match.js";
5
+ import { CommandDispatchKind } from "../surface/command-dispatch-kind.js";
6
+ import { commandIndexFor, findCommandIndexEntry, subverbNamesOf, } from "../surface/command-index.js";
7
+ import { loadSurfaceContext } from "../surface/load-surface-context.js";
8
+ import { buildSurfaceSummary, findCommandInSummary, } from "../surface/surface-summary.js";
9
+ import { TierSource } from "../surface/tier.js";
10
+ import { defaultShowInHelp, isExplainFamily } from "./command-catalog.js";
3
11
  /**
4
- * Every multi-token command path the catalog documents. These are real,
5
- * callable verbs that the command trie never sees, because their parent
6
- * dispatches them from a positional argument rather than registering them.
12
+ * Help's topics come from THE command index the same inventory `surface
13
+ * list`, `commands doctor`, the command-string resolver and the dispatcher's
14
+ * help intercept read (one memoised object per registry). It used to walk
15
+ * COMMAND_CATALOG itself (a third inventory), so a registered verb with no
16
+ * catalog row had no help and a catalog row nothing dispatches still did.
7
17
  */
8
- function catalogHelpPaths() {
18
+ function helpIndex(registry) {
19
+ return commandIndexFor(registry);
20
+ }
21
+ /** Every command path (and alias spelling) the index knows — help topics. */
22
+ function indexHelpPaths(index) {
9
23
  const paths = new Set();
10
- for (const entry of COMMAND_CATALOG) {
11
- // Strip the flag/argument tail a few catalog entries carry in `command`.
12
- const clean = entry.command.split(/\s+--/)[0].trim();
13
- if (clean.length > 0)
14
- paths.add(clean);
24
+ for (const e of index.entries) {
25
+ if (e.dispatch === CommandDispatchKind.Meta)
26
+ continue;
27
+ paths.add(e.path);
28
+ for (const a of e.aliases)
29
+ paths.add(a);
15
30
  }
16
31
  return paths;
17
32
  }
18
33
  /**
19
- * Render help for a command path the trie could not resolve but the catalog
20
- * documents, plus its sibling verbs under the same parent so the family is
21
- * discoverable from any one member.
34
+ * Render help for an index path the trie could not resolve verbatim a
35
+ * subverb its parent dispatches from a positional (`check wiring`) plus its
36
+ * sibling verbs under the same parent so the family is discoverable from any
37
+ * one member.
22
38
  */
23
- function renderCatalogHelp(tokens) {
39
+ function renderIndexHelp(index, tokens) {
24
40
  const want = tokens.join(' ');
25
- const entry = COMMAND_CATALOG.find((e) => e.command.split(/\s+--/)[0].trim() === want);
26
- if (!entry)
41
+ const entry = findCommandIndexEntry(index, want);
42
+ if (!entry || entry.dispatch === CommandDispatchKind.Meta)
27
43
  return undefined;
28
- let out = `${want} — ${entry.description}\n`;
29
- const extra = EXTRA_HELP_LINES[want];
44
+ let out = `${entry.path} — ${entry.description}\n`;
45
+ // A catalog-documented subverb its handler does not declare has no usage of
46
+ // its own: fall back to the dispatching handler's, so help always shows how
47
+ // to invoke it (and never an empty page).
48
+ const usage = entry.usage ?? (entry.parent ? index.byPath.get(entry.parent)?.usage : undefined);
49
+ if (usage)
50
+ out += `${usage}\n`;
51
+ const extra = EXTRA_HELP_LINES[entry.path];
30
52
  if (extra)
31
53
  out += extra.join('\n') + '\n';
32
- const parent = tokens.slice(0, -1).join(' ');
54
+ const parent = entry.tokens.slice(0, -1).join(' ');
33
55
  if (parent.length > 0) {
34
- const siblings = [...catalogHelpPaths()]
35
- .filter((p) => p !== want && p.startsWith(parent + ' ') && !p.slice(parent.length + 1).includes(' '))
56
+ const siblings = subverbNamesOf(index, parent)
57
+ .map((name) => `${parent} ${name}`)
58
+ .filter((p) => p !== entry.path)
36
59
  .sort();
37
60
  if (siblings.length > 0) {
38
61
  out += `\nSiblings: ${siblings.join(', ')}\n`;
@@ -46,64 +69,28 @@ function firstSentence(description) {
46
69
  const head = dot > 0 ? description.slice(0, dot + 1) : description;
47
70
  return head.length > 100 ? head.slice(0, 97).trimEnd() + '…' : head;
48
71
  }
49
- /** Levenshtein edit distance — small, local helper for the unknown-topic guard. */
50
- function editDistance(a, b) {
51
- const m = a.length;
52
- const n = b.length;
53
- if (m === 0)
54
- return n;
55
- if (n === 0)
56
- return m;
57
- let prev = Array.from({ length: n + 1 }, (_, i) => i);
58
- let curr = new Array(n + 1);
59
- for (let i = 1; i <= m; i += 1) {
60
- curr[0] = i;
61
- for (let j = 1; j <= n; j += 1) {
62
- const cost = a[i - 1] === b[j - 1] ? 0 : 1;
63
- curr[j] = Math.min(prev[j] + 1, curr[j - 1] + 1, prev[j - 1] + cost);
64
- }
65
- [prev, curr] = [curr, prev];
66
- }
67
- return prev[n];
68
- }
69
72
  /**
70
- * The set of real, callable help topics: every registered top-level command
71
- * and group name, plus every top-level verb in the catalog. Used only to
72
- * suggest a near-typo when an unknown topic is requested — never to fabricate
73
- * one that isn't real.
73
+ * The set of real, callable top-level help topics: the first token of every
74
+ * index path, plus every top-level alias. Used only to suggest a near-typo
75
+ * when an unknown topic is requested — never to fabricate one that isn't real.
76
+ * The suggestion goes through the ONE did-you-mean scorer (`nearest`, the
77
+ * `max(1, len/4)`-edit tolerance main.ts uses), ties broken lexically.
74
78
  */
75
- function realHelpTopics(registry) {
79
+ function realHelpTopics(index) {
76
80
  const topics = new Set();
77
- for (const c of registry.list())
78
- topics.add(c.name);
79
- for (const g of registry.listGroups())
80
- topics.add(g);
81
- for (const entry of COMMAND_CATALOG) {
82
- const verb = entry.command.split(/\s+/)[0];
83
- if (verb)
84
- topics.add(verb);
85
- }
86
- return topics;
87
- }
88
- /**
89
- * Nearest real topic to `attempt` within a typo-tolerant edit-distance bound,
90
- * or undefined when nothing is close enough. Mirrors main.ts's confidence
91
- * tolerance (`max(1, len/4)` edits) so a fingers-on-keys typo suggests but a
92
- * genuinely-unrelated token does not. Deterministic: ties break lexically.
93
- */
94
- function nearestHelpTopic(attempt, topics) {
95
- const lower = attempt.toLowerCase();
96
- const tolerance = Math.max(1, Math.floor(lower.length / 4));
97
- let best;
98
- let bestDist = Number.POSITIVE_INFINITY;
99
- for (const topic of topics) {
100
- const dist = editDistance(lower, topic.toLowerCase());
101
- if (dist < bestDist || (dist === bestDist && best !== undefined && topic < best)) {
102
- bestDist = dist;
103
- best = topic;
81
+ for (const e of index.entries) {
82
+ if (e.dispatch === CommandDispatchKind.Meta)
83
+ continue;
84
+ const head = e.tokens[0];
85
+ if (head)
86
+ topics.add(head);
87
+ for (const a of e.aliases) {
88
+ const aliasHead = a.split(' ')[0];
89
+ if (aliasHead)
90
+ topics.add(aliasHead);
104
91
  }
105
92
  }
106
- return best !== undefined && bestDist <= tolerance ? best : undefined;
93
+ return topics;
107
94
  }
108
95
  const EXTRA_HELP_LINES = Object.freeze({
109
96
  graph: [
@@ -115,54 +102,91 @@ const EXTRA_HELP_LINES = Object.freeze({
115
102
  ' graph context — inspect one file or symbol with bridge enrichment',
116
103
  ' graph impact — reverse dependent closure for a file or symbol',
117
104
  ' graph callers — files that call/reference a symbol',
105
+ ' graph importers — every module that imports a module (alias/type-only/re-export aware)',
118
106
  ' graph cycles — list import cycles',
119
107
  ' graph unresolved — list unresolved imports grouped by file',
120
108
  ' graph deps — inbound/outbound package dependencies',
121
109
  ' graph why — shortest-path explanation in the knowledge graph',
122
110
  ],
123
111
  });
112
+ const START_SECTIONS = [
113
+ {
114
+ title: 'Bootstrap:',
115
+ lines: [
116
+ { command: 'init', text: ' $ shrk init --infer --write — scan the repo + populate sharkcraft/ from real signals (new repos)' },
117
+ { command: 'doctor', text: ' $ shrk doctor — is the workspace healthy?' },
118
+ { command: 'onboard', text: ' $ shrk onboard — analyze an existing repo (advisory)' },
119
+ ],
120
+ },
121
+ {
122
+ title: 'Use it for a task:',
123
+ lines: [
124
+ { command: 'recommend', text: ' $ shrk recommend "<task>" — what should I do?' },
125
+ { command: 'context', text: ' $ shrk context --task "<task>" — token-budgeted relevant context' },
126
+ { command: 'task', text: ' $ shrk task "<task>" — full AI-ready task packet (JSON)' },
127
+ { command: 'why', text: ' $ shrk why <file> — which rules govern this file' },
128
+ { command: 'impact', text: ' $ shrk impact <file> — blast radius: what breaks if I change this' },
129
+ ],
130
+ },
131
+ {
132
+ title: 'Generate code safely:',
133
+ lines: [
134
+ { command: 'gen', text: ' $ shrk gen <template> <name> — generate from template (dry-run by default)' },
135
+ { command: 'apply', text: ' $ shrk apply <plan.json> — apply a reviewed plan (CLI is the only write path)' },
136
+ { command: 'check boundaries', text: ' $ shrk check boundaries — enforce layer / import boundaries' },
137
+ { command: 'quality', text: ' $ shrk quality — pre-PR gate (doctor + boundaries + coverage + drift)' },
138
+ ],
139
+ },
140
+ {
141
+ title: 'Browse what shrk knows:',
142
+ lines: [
143
+ { command: 'graph status', text: ' $ shrk graph status — code-graph freshness and health' },
144
+ { command: 'coverage', text: ' $ shrk coverage — what knowledge is missing' },
145
+ { command: 'knowledge list', text: ' $ shrk knowledge list — knowledge entries' },
146
+ ],
147
+ },
148
+ {
149
+ title: 'Run shrk for an agent:',
150
+ lines: [
151
+ { command: 'mcp serve', text: ' $ shrk mcp serve — start the MCP server (stdio) for live queries' },
152
+ { command: 'dashboard', text: ' $ shrk dashboard — start the local read-only dashboard' },
153
+ ],
154
+ },
155
+ ];
124
156
  /**
125
157
  * Product start screen for bare `shrk` / `shrk --help`. Shows the
126
158
  * curated ~20-command "starter" surface organized by workflow phase.
127
159
  * Everything else stays callable; users see the full ~70-verb catalog
128
160
  * via `shrk --full-help` or browse it through `shrk surface list`.
129
161
  *
162
+ * `shown(command)` is the repository's surface: a curated line whose command
163
+ * `surface.hidden` hides, or the surface gate refuses (`surface.disabled`,
164
+ * experimental, tool-maintenance), is dropped — and a section left empty with
165
+ * it. The default shows every line (the text is then byte-identical to the
166
+ * pre-round-11 screen).
167
+ *
130
168
  * Returns the lines (without trailing newline). Pulled into a function
131
169
  * so tests can assert on the structure without grepping stdout.
132
170
  */
133
- export function renderStartScreen() {
171
+ export function renderStartScreen(shown = () => true) {
134
172
  const lines = [];
135
173
  lines.push('SharkCraft CLI — deterministic, local-first project intelligence for AI coding agents.');
136
174
  lines.push('Usage: shrk [--cwd <dir>] <command> [...args]');
137
175
  lines.push('');
138
- lines.push('Bootstrap:');
139
- lines.push(' $ shrk init --infer --write — scan the repo + populate sharkcraft/ from real signals (new repos)');
140
- lines.push(' $ shrk doctor — is the workspace healthy?');
141
- lines.push(' $ shrk onboard — analyze an existing repo (advisory)');
142
- lines.push('');
143
- lines.push('Use it for a task:');
144
- lines.push(' $ shrk recommend "<task>" — what should I do?');
145
- lines.push(' $ shrk context --task "<task>" — token-budgeted relevant context');
146
- lines.push(' $ shrk task "<task>" — full AI-ready task packet (JSON)');
147
- lines.push(' $ shrk why <file> — which rules govern this file');
148
- lines.push(' $ shrk impact <file> — blast radius: what breaks if I change this');
149
- lines.push('');
150
- lines.push('Generate code safely:');
151
- lines.push(' $ shrk gen <template> <name> — generate from template (dry-run by default)');
152
- lines.push(' $ shrk apply <plan.json> — apply a reviewed plan (CLI is the only write path)');
153
- lines.push(' $ shrk check boundaries — enforce layer / import boundaries');
154
- lines.push(' $ shrk quality — pre-PR gate (doctor + boundaries + coverage + drift)');
155
- lines.push('');
156
- lines.push('Browse what shrk knows:');
157
- lines.push(' $ shrk graph status — code-graph freshness and health');
158
- lines.push(' $ shrk coverage — what knowledge is missing');
159
- lines.push(' $ shrk knowledge list — knowledge entries');
160
- lines.push('');
161
- lines.push('Run shrk for an agent:');
162
- lines.push(' $ shrk mcp serve — start the MCP server (stdio) for live queries');
163
- lines.push(' $ shrk dashboard — start the local read-only dashboard');
164
- lines.push('');
165
- lines.push('Discover the rest (everything stays callable — this screen shows ~17 of ~70 verbs):');
176
+ let dropped = 0;
177
+ for (const section of START_SECTIONS) {
178
+ const kept = section.lines.filter((l) => shown(l.command));
179
+ dropped += section.lines.length - kept.length;
180
+ if (kept.length === 0)
181
+ continue;
182
+ lines.push(section.title);
183
+ for (const l of kept)
184
+ lines.push(l.text);
185
+ lines.push('');
186
+ }
187
+ lines.push(dropped === 0
188
+ ? 'Discover the rest (everything stays callable — this screen shows ~17 of ~70 verbs):'
189
+ : `Discover the rest (${dropped} curated command(s) are hidden or disabled by this repository's surface config):`);
166
190
  lines.push(' $ shrk surface list — full catalog by tier');
167
191
  lines.push(' $ shrk help <command> — usage for a specific command');
168
192
  lines.push(' $ shrk --full-help — long, exhaustive help (incl. the explain/dry-run family)');
@@ -171,11 +195,169 @@ export function renderStartScreen() {
171
195
  lines.push('Free-form input is fine — `shrk "<task>"` routes to `shrk recommend`.');
172
196
  return lines.join('\n') + '\n';
173
197
  }
198
+ /**
199
+ * The surface this repository presents — THE visibility authority: the
200
+ * surface summary over this registry's index, composed with the project's
201
+ * `surface{}` config, its profile and the host (tool repo or consumer). The
202
+ * start screen and `--full-help` render it, so `surface explain X` →
203
+ * `visible-in-help` and the help output can no longer disagree.
204
+ *
205
+ * Failure-soft: when the workspace cannot be loaded, the DEFAULT surface (no
206
+ * config; the host still detected) is rendered and one note says so.
207
+ */
208
+ async function helpSurface(registry, cwd) {
209
+ const index = helpIndex(registry);
210
+ try {
211
+ const { context } = await loadSurfaceContext({ cwd });
212
+ return { summary: buildSurfaceSummary(context, index) };
213
+ }
214
+ catch (e) {
215
+ const context = {
216
+ spineCommands: new Set(),
217
+ packContributions: new Map(),
218
+ surfaceConfig: undefined,
219
+ isToolRepo: detectSharkcraftRepo(cwd),
220
+ };
221
+ return {
222
+ summary: buildSurfaceSummary(context, index),
223
+ note: `note: surface config not loaded (${e instanceof Error ? e.message : String(e)}) — showing the default surface.\n`,
224
+ };
225
+ }
226
+ }
227
+ /** A curated start-screen line stays unless this repository hides or gates its command. */
228
+ function startScreenFilter(summary) {
229
+ return (command) => {
230
+ const view = findCommandInSummary(summary, command);
231
+ return view === undefined || (view.callable && !view.hidden);
232
+ };
233
+ }
234
+ /** `(hidden)` / `(gated: …)` for `--full-help --all`. */
235
+ function helpAnnotation(v) {
236
+ const notes = [];
237
+ if (!v.visibleInHelp)
238
+ notes.push('hidden');
239
+ if (!v.callable) {
240
+ notes.push(v.source === TierSource.ToolMaintenance
241
+ ? 'gated: tool-maintenance'
242
+ : v.source === TierSource.Disabled
243
+ ? 'gated: disabled'
244
+ : 'gated');
245
+ }
246
+ return notes.length > 0 ? ` (${notes.join(', ')})` : '';
247
+ }
248
+ /**
249
+ * `--full-help`, rendered FROM the surface summary. Without `all` it lists
250
+ * exactly the views whose `visibleInHelp` is true — every one at least once —
251
+ * so `surface.hidden`, profiles, `surface.disabled` and the tool-maintenance
252
+ * host gate all reach it. With `all` it lists every view, annotated
253
+ * `(hidden)` / `(gated: …)` rather than dropped.
254
+ *
255
+ * Placement (not visibility) still reads the catalog: a visible view on the
256
+ * rent-paying surface goes under its top-level verb or group; an explain /
257
+ * dry-run view goes in its own section (and, when it is also rent-paying, in
258
+ * its group too).
259
+ */
260
+ export function renderFullHelp(registry, summary, all) {
261
+ const index = helpIndex(registry);
262
+ const views = [...summary.tiers.core, ...summary.tiers.extended, ...summary.tiers.experimental];
263
+ const listed = views.filter((v) => all || v.visibleInHelp);
264
+ const rowOf = (v) => index.byPath.get(v.command)?.catalogEntry;
265
+ const inExplainFamily = (v) => {
266
+ const row = rowOf(v);
267
+ return row !== undefined && isExplainFamily(row);
268
+ };
269
+ const explainOnly = (v) => {
270
+ if (all)
271
+ return false;
272
+ const row = rowOf(v);
273
+ return row !== undefined && isExplainFamily(row) && !defaultShowInHelp(row);
274
+ };
275
+ // Registration order (init, inspect, doctor, …) — the order the top-level
276
+ // list has always had — then alphabetical.
277
+ const rank = new Map();
278
+ for (const name of [...registry.list().map((c) => c.name), ...registry.listGroups()]) {
279
+ if (!rank.has(name))
280
+ rank.set(name, rank.size);
281
+ }
282
+ const headRank = (path) => rank.get(path.split(' ')[0] ?? '') ?? Number.MAX_SAFE_INTEGER;
283
+ const byRegistration = (a, b) => headRank(a.command) - headRank(b.command) || a.command.localeCompare(b.command);
284
+ const line = (v, width) => ` ${v.command.padEnd(width)} — ${firstSentence(v.description) || '(no description)'}${all ? helpAnnotation(v) : ''}\n`;
285
+ let out = 'SharkCraft CLI — structured project intelligence for AI coding agents\n';
286
+ out += 'Usage: shrk [--cwd <dir>] <command> [...args]\n';
287
+ const main = listed.filter((v) => v.dispatch !== CommandDispatchKind.Meta && !explainOnly(v));
288
+ out += header('Top-level commands');
289
+ for (const v of main.filter((m) => !m.command.includes(' ')).sort(byRegistration))
290
+ out += line(v, 10);
291
+ if (!all) {
292
+ const hiddenCount = views.filter((v) => v.dispatch !== CommandDispatchKind.Meta && !v.visibleInHelp).length;
293
+ if (hiddenCount > 0) {
294
+ out +=
295
+ `\n …and ${hiddenCount} more hidden from default help (not on the curated surface, or hidden / gated by ` +
296
+ "this repository's surface config). Run `shrk --full-help --all` to see them, or `shrk surface list` to browse by tier.\n";
297
+ }
298
+ }
299
+ const groups = new Map();
300
+ for (const v of main) {
301
+ const head = v.command.split(' ')[0] ?? '';
302
+ if (!v.command.includes(' ') || head.length === 0)
303
+ continue;
304
+ const members = groups.get(head) ?? [];
305
+ members.push(v);
306
+ groups.set(head, members);
307
+ }
308
+ const aliasesByCanonical = new Map();
309
+ for (const [alias, canonical] of registry.listGroupAliases().entries()) {
310
+ const list = aliasesByCanonical.get(canonical) ?? [];
311
+ list.push(alias);
312
+ aliasesByCanonical.set(canonical, list);
313
+ }
314
+ const heads = [...groups.keys()].sort((a, b) => headRank(a) - headRank(b) || a.localeCompare(b));
315
+ for (const head of heads) {
316
+ const members = (groups.get(head) ?? []).sort((a, b) => a.command.localeCompare(b.command));
317
+ const aliases = aliasesByCanonical.get(head) ?? [];
318
+ out += header(`shrk ${head} <sub>${aliases.length ? ` (also: ${aliases.join(', ')})` : ''}`);
319
+ const width = Math.min(28, Math.max(...members.map((m) => m.command.length)));
320
+ for (const v of members)
321
+ out += line(v, width);
322
+ }
323
+ // Explain / dry-run family — several carry an Advanced surface, so they are
324
+ // not rent-paying, yet this section is WHY `visibleInHelp` counts them: they
325
+ // show what a gate, ranker, or graph SEES before you act.
326
+ const explain = listed.filter(inExplainFamily).sort((a, b) => a.command.localeCompare(b.command));
327
+ if (explain.length > 0) {
328
+ out += header('Inspect / explain (dry-run what a gate, ranker, or graph sees)');
329
+ for (const v of explain)
330
+ out += line(v, 24);
331
+ out += ' (also: shrk check wiring --explain <ruleId>)\n';
332
+ }
333
+ const meta = listed.filter((v) => v.dispatch === CommandDispatchKind.Meta);
334
+ if (meta.length > 0) {
335
+ out += header('Meta flags');
336
+ for (const v of meta)
337
+ out += line(v, 12);
338
+ }
339
+ out += '\nRun `shrk help <command>` for detailed usage.\n';
340
+ return out;
341
+ }
342
+ /** Bare `help` / `--help` (start screen) and `--full-help [--all]`, over the repository's surface. */
343
+ async function runListing(registry, args, wantsFull) {
344
+ const { summary, note } = await helpSurface(registry, resolveCwd({ ...args, multiFlags: new Map() }));
345
+ if (note)
346
+ process.stderr.write(note);
347
+ if (!wantsFull) {
348
+ process.stdout.write(renderStartScreen(startScreenFilter(summary)));
349
+ return 0;
350
+ }
351
+ process.stdout.write(renderFullHelp(registry, summary, args.flags.get('all') === true));
352
+ return 0;
353
+ }
174
354
  export function makeHelpCommand(registry) {
175
355
  return {
176
356
  name: 'help',
177
357
  description: 'Show CLI help. Bare `shrk help` prints a short start screen — pass `--full` for the long catalog.',
178
- usage: 'shrk help [<command>] [--full]',
358
+ usage: 'shrk help [<command>] [--full [--all]] · shrk <command> [...] --help | -h (anywhere before `--`; runs nothing)',
359
+ // Topic help is synchronous (it reads only the command index); the start
360
+ // screen and `--full-help` read the repository's surface, so they are async.
179
361
  run(args) {
180
362
  const requested = args.positional[0];
181
363
  const wantsFull = args.flags.get('full') === true ||
@@ -196,21 +378,38 @@ export function makeHelpCommand(registry) {
196
378
  // that exits 0. Error out honestly instead, with a did-you-mean when
197
379
  // a real topic is a near-typo of the request.
198
380
  const attempt = tokens.join(' ');
199
- // The trie matched nothing, but the CATALOG may still document this
200
- // path a documented verb whose parent isn't a registered command
201
- // is still real and callable.
202
- const viaCatalog = renderCatalogHelp(tokens);
203
- if (viaCatalog !== undefined) {
204
- process.stdout.write(viaCatalog);
381
+ const index = helpIndex(registry);
382
+ // The trie matched nothing, but the INDEX may still know the path
383
+ // under an alias spelling or as a folded variant.
384
+ const viaIndex = renderIndexHelp(index, tokens);
385
+ if (viaIndex !== undefined) {
386
+ process.stdout.write(viaIndex);
205
387
  return 0;
206
388
  }
207
389
  process.stderr.write(`no such help topic: '${attempt}'\n`);
208
- const suggestion = nearestHelpTopic(attempt, realHelpTopics(registry)) ??
209
- nearestHelpTopic(attempt, catalogHelpPaths());
390
+ const suggestion = nearest(attempt, realHelpTopics(index)) ?? nearest(attempt, indexHelpPaths(index));
210
391
  if (suggestion)
211
392
  process.stderr.write(`Did you mean: ${suggestion}?\n`);
212
393
  return 1;
213
394
  }
395
+ // A tail the trie did not consume (`graph importers`, `check wiring`,
396
+ // `templates lst`) is answered by the INDEX alone: a declared or
397
+ // catalogued subverb prints its own help; anything else is an unknown
398
+ // topic (exit 1) — never the parent group's listing at exit 0.
399
+ if (tokens.length > matchedPath.length) {
400
+ const index = helpIndex(registry);
401
+ const indexHelp = renderIndexHelp(index, tokens);
402
+ if (indexHelp !== undefined) {
403
+ process.stdout.write(indexHelp);
404
+ return 0;
405
+ }
406
+ const attempt = tokens.join(' ');
407
+ process.stderr.write(`no such help topic: '${attempt}'\n`);
408
+ const near = nearest(attempt, indexHelpPaths(index));
409
+ if (near)
410
+ process.stderr.write(`Did you mean: shrk help ${near}?\n`);
411
+ return 1;
412
+ }
214
413
  if (handler && matchedPath.join(' ') === tokens.join(' ') && node.children.size === 0) {
215
414
  // Exact match on a callable command.
216
415
  const canonical = registry.listCommandAliases().get(tokens[0]);
@@ -248,101 +447,26 @@ export function makeHelpCommand(registry) {
248
447
  }
249
448
  return 0;
250
449
  }
251
- // The trie could not resolve the full path, but the CATALOG may still
252
- // document it. Verbs like `check wiring` are dispatched from inside
253
- // their parent's handler on a positional, so they are real, callable
254
- // and documented — yet never trie nodes. Falling through to "Unknown
450
+ // The trie could not resolve the full path, but the INDEX may still
451
+ // list it. Verbs like `check wiring` are dispatched from inside their
452
+ // parent's handler on a positional, so they are real, callable and
453
+ // documented — yet never trie nodes. Falling through to "Unknown
255
454
  // command" made an entire documented surface look non-existent.
256
- const catalogHelp = renderCatalogHelp(tokens);
257
- if (catalogHelp !== undefined) {
258
- process.stdout.write(catalogHelp);
455
+ const index = helpIndex(registry);
456
+ const indexHelp = renderIndexHelp(index, tokens);
457
+ if (indexHelp !== undefined) {
458
+ process.stdout.write(indexHelp);
259
459
  return 0;
260
460
  }
261
461
  process.stderr.write(`no such help topic: '${tokens.join(' ')}'\n`);
262
- const near = nearestHelpTopic(tokens.join(' '), catalogHelpPaths());
462
+ const near = nearest(tokens.join(' '), indexHelpPaths(index));
263
463
  if (near)
264
464
  process.stderr.write(`Did you mean: shrk help ${near}?\n`);
265
465
  return 1;
266
466
  }
267
- if (!wantsFull) {
268
- process.stdout.write(renderStartScreen());
269
- return 0;
270
- }
271
- const wantsAll = args.flags.get('all') === true;
272
- process.stdout.write(`SharkCraft CLI — structured project intelligence for AI coding agents\n`);
273
- process.stdout.write(`Usage: shrk [--cwd <dir>] <command> [...args]\n`);
274
- // The catalog has ~360 entries; only ~30 top-level verbs pay
275
- // rent (see PRIMARY_VERBS_ALLOWLIST in command-catalog.ts).
276
- // Default --full-help filters to that set; `--full-help --all`
277
- // dumps the entire catalog for power users.
278
- const visibleVerbs = new Set();
279
- if (!wantsAll) {
280
- for (const entry of COMMAND_CATALOG) {
281
- if (defaultShowInHelp(entry)) {
282
- const verb = entry.command.split(/\s+/)[0] ?? '';
283
- if (verb)
284
- visibleVerbs.add(verb);
285
- }
286
- }
287
- }
288
- const visibleTopLevel = registry.list().filter((c) => {
289
- if (wantsAll)
290
- return true;
291
- return visibleVerbs.has(c.name);
292
- });
293
- process.stdout.write(header('Top-level commands'));
294
- for (const c of visibleTopLevel) {
295
- process.stdout.write(` ${c.name.padEnd(10)} — ${c.description}\n`);
296
- }
297
- if (!wantsAll) {
298
- const hiddenCount = registry.list().length - visibleTopLevel.length;
299
- if (hiddenCount > 0) {
300
- process.stdout.write(`\n …and ${hiddenCount} more, hidden from default help. Run \`shrk --full-help --all\` to see them, ` +
301
- `or \`shrk surface list\` to browse by tier.\n`);
302
- }
303
- }
304
- // Show each canonical group once — also filtered by the allowlist
305
- // unless --all was passed.
306
- const canonicalGroups = [];
307
- const aliasMap = registry.listGroupAliases();
308
- const seen = new Set();
309
- for (const g of registry.listGroups()) {
310
- const canonical = aliasMap.get(g) ?? g;
311
- if (!seen.has(canonical)) {
312
- seen.add(canonical);
313
- if (wantsAll || visibleVerbs.has(canonical)) {
314
- canonicalGroups.push(canonical);
315
- }
316
- }
317
- }
318
- const aliasesByCanonical = new Map();
319
- for (const [alias, canonical] of aliasMap.entries()) {
320
- const list = aliasesByCanonical.get(canonical) ?? [];
321
- list.push(alias);
322
- aliasesByCanonical.set(canonical, list);
323
- }
324
- for (const group of canonicalGroups) {
325
- const aliases = aliasesByCanonical.get(group) ?? [];
326
- const aliasNote = aliases.length ? ` (also: ${aliases.join(', ')})` : '';
327
- process.stdout.write(header(`shrk ${group} <sub>${aliasNote}`));
328
- for (const s of registry.listGroup(group)) {
329
- process.stdout.write(` ${group} ${s.name.padEnd(10)} — ${s.description}\n`);
330
- }
331
- }
332
- // Explain / dry-run family — several carry an Advanced surface and are
333
- // filtered out of the listings above, so surface them explicitly. These
334
- // show you what a gate, ranker, or graph SEES before you act; an agent
335
- // would otherwise find them only by guessing (the #4.4 friction).
336
- const explainFamily = listExplainFamily();
337
- if (explainFamily.length > 0) {
338
- process.stdout.write(header('Inspect / explain (dry-run what a gate, ranker, or graph sees)'));
339
- for (const e of explainFamily) {
340
- process.stdout.write(` ${e.command.padEnd(24)} — ${firstSentence(e.description)}\n`);
341
- }
342
- process.stdout.write(' (also: shrk check wiring --explain <ruleId>)\n');
343
- }
344
- process.stdout.write('\nRun `shrk help <command>` for detailed usage.\n');
345
- return 0;
467
+ // No topic: the start screen or `--full-help`, over THIS repository's
468
+ // surface (the one visibility authority — see renderFullHelp).
469
+ return runListing(registry, args, wantsFull);
346
470
  },
347
471
  };
348
472
  }
@@ -2,5 +2,6 @@ import { type ICommandHandler } from '../command-registry.js';
2
2
  export declare const helperListCommand: ICommandHandler;
3
3
  export declare const helperGetCommand: ICommandHandler;
4
4
  export declare const helperPlanCommand: ICommandHandler;
5
+ export declare const helperDoctorCommand: ICommandHandler;
5
6
  export declare const helperCommand: ICommandHandler;
6
7
  //# sourceMappingURL=helper.command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.command.d.ts","sourceRoot":"","sources":["../../src/commands/helper.command.ts"],"names":[],"mappings":"AAoBA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAUhC,eAAO,MAAM,iBAAiB,EAAE,eAgB/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eA6B9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAiF/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,eAqB3B,CAAC"}
1
+ {"version":3,"file":"helper.command.d.ts","sourceRoot":"","sources":["../../src/commands/helper.command.ts"],"names":[],"mappings":"AA6BA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAsBhC,eAAO,MAAM,iBAAiB,EAAE,eA2C/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eAiD9B,CAAC;AAyBF,eAAO,MAAM,iBAAiB,EAAE,eAgF/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAkEjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,eA2B3B,CAAC"}