@shrkcrft/cli 0.1.0-alpha.29 → 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 +76 -0
  20. package/dist/commands/baseline.command.d.ts.map +1 -1
  21. package/dist/commands/baseline.command.js +599 -75
  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 +164 -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 +1260 -324
  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 +8 -1
  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 +20 -0
  77. package/dist/commands/docs-references.command.d.ts.map +1 -0
  78. package/dist/commands/docs-references.command.js +520 -0
  79. package/dist/commands/doctor.command.d.ts.map +1 -1
  80. package/dist/commands/doctor.command.js +60 -5
  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 +54 -0
  99. package/dist/commands/gates.command.d.ts.map +1 -1
  100. package/dist/commands/gates.command.js +1314 -64
  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 +62 -0
  104. package/dist/commands/generated.command.d.ts.map +1 -1
  105. package/dist/commands/generated.command.js +639 -156
  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 +203 -25
  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 +362 -74
  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 +67 -0
  328. package/dist/gates/gate-rule-globs.d.ts.map +1 -0
  329. package/dist/gates/gate-rule-globs.js +139 -0
  330. package/dist/gates/gate-rule-view.d.ts +25 -6
  331. package/dist/gates/gate-rule-view.d.ts.map +1 -1
  332. package/dist/gates/gate-rule-view.js +105 -77
  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 +225 -4
  370. package/dist/gates/rule-coverage.d.ts.map +1 -1
  371. package/dist/gates/rule-coverage.js +610 -43
  372. package/dist/gates/run-gate-planes.d.ts +58 -0
  373. package/dist/gates/run-gate-planes.d.ts.map +1 -0
  374. package/dist/gates/run-gate-planes.js +403 -0
  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 +204 -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
@@ -188,7 +188,7 @@ export function applyAssetPreview(input) {
188
188
  rules: 'shrk rules lint',
189
189
  paths: 'shrk paths list',
190
190
  templates: 'shrk templates drift --min-severity warning',
191
- pipelines: 'shrk pipelines lint',
191
+ pipelines: 'shrk check pipelines',
192
192
  boundaries: 'shrk check boundaries --changed-only',
193
193
  presets: 'shrk presets list --json',
194
194
  };
@@ -1,4 +1,4 @@
1
- import type { IKnowledgeReference } from '@shrkcrft/knowledge';
1
+ import { type IKnowledgeReference } from '@shrkcrft/knowledge';
2
2
  import { AssetProvenanceSource } from '@shrkcrft/inspector';
3
3
  import { type ParsedArgs } from '../command-registry.js';
4
4
  export interface IAuthoringSource {
@@ -31,6 +31,14 @@ export declare function multiFlagValues(args: ParsedArgs, name: string): string[
31
31
  /**
32
32
  * Parse a `kind:value[:required]` reference spec. Returns null on
33
33
  * invalid input so callers can filter.
34
+ *
35
+ * A symbol may pin its declaring file — `symbol:<name>@<path>` — and address a
36
+ * member — `symbol:Owner.member@<path>`. This is the inverse of
37
+ * `formatKnowledgeReference`, so what the stale-check prints can be pasted
38
+ * back as a `--reference`.
39
+ *
40
+ * The accepted kinds are {@link KNOWLEDGE_REFERENCE_KINDS} — the one
41
+ * vocabulary the validator and the stale-check read — never a hand-copied list.
34
42
  */
35
43
  export declare function parseReferenceSpec(spec: string): IKnowledgeReference | null;
36
44
  //# sourceMappingURL=authoring-kit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authoring-kit.d.ts","sourceRoot":"","sources":["../../src/authoring/authoring-kit.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,qBAAqB,EACtB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AAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GACnD,MAAM,EAAE,CAiBV;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAExE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAgC3E"}
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { mkdirSync, writeFileSync } from 'node:fs';
18
18
  import * as nodePath from 'node:path';
19
+ import { KNOWLEDGE_REFERENCE_KINDS, } from '@shrkcrft/knowledge';
19
20
  import { AssetProvenanceSource, } from '@shrkcrft/inspector';
20
21
  import { flagList } from "../command-registry.js";
21
22
  /**
@@ -70,12 +71,22 @@ export function multiFlagValues(args, name) {
70
71
  /**
71
72
  * Parse a `kind:value[:required]` reference spec. Returns null on
72
73
  * invalid input so callers can filter.
74
+ *
75
+ * A symbol may pin its declaring file — `symbol:<name>@<path>` — and address a
76
+ * member — `symbol:Owner.member@<path>`. This is the inverse of
77
+ * `formatKnowledgeReference`, so what the stale-check prints can be pasted
78
+ * back as a `--reference`.
79
+ *
80
+ * The accepted kinds are {@link KNOWLEDGE_REFERENCE_KINDS} — the one
81
+ * vocabulary the validator and the stale-check read — never a hand-copied list.
73
82
  */
74
83
  export function parseReferenceSpec(spec) {
75
84
  const parts = spec.split(':');
76
85
  if (parts.length < 2)
77
86
  return null;
78
87
  const [kindRaw, ...rest] = parts;
88
+ if (!KNOWLEDGE_REFERENCE_KINDS.includes(kindRaw))
89
+ return null;
79
90
  const kind = kindRaw;
80
91
  const required = rest[rest.length - 1] === 'required';
81
92
  if (required)
@@ -87,20 +98,22 @@ export function parseReferenceSpec(spec) {
87
98
  case 'file':
88
99
  case 'directory':
89
100
  return { kind, path: value, ...(required ? { required: true } : {}) };
90
- case 'symbol':
101
+ case 'symbol': {
102
+ // `Name@path` pins the declaring file (a symbol name never contains `@`).
103
+ const at = value.indexOf('@');
104
+ if (at > 0 && at < value.length - 1) {
105
+ return {
106
+ kind,
107
+ symbol: value.slice(0, at),
108
+ path: value.slice(at + 1),
109
+ ...(required ? { required: true } : {}),
110
+ };
111
+ }
91
112
  return { kind, symbol: value, ...(required ? { required: true } : {}) };
92
- case 'command':
93
- case 'template':
94
- case 'playbook':
95
- case 'construct':
96
- case 'helper':
97
- case 'policy':
98
- case 'boundary-rule':
99
- case 'path-convention':
100
- case 'package':
101
- case 'url':
102
- return { kind, id: value, ...(required ? { required: true } : {}) };
113
+ }
103
114
  default:
104
- return null;
115
+ // Every other kind in the vocabulary is id-keyed (a command, a registry
116
+ // id, a url) — a kind added to the vocabulary is accepted here at once.
117
+ return { kind, id: value, ...(required ? { required: true } : {}) };
105
118
  }
106
119
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The one-line message for an unlinked workspace dependency, or `undefined`
3
+ * for any other error. Pure over its inputs: `locate` maps the importing file
4
+ * to the package that needs the dependency and the directory the install runs
5
+ * in; the default reads the nearest package.json files on disk.
6
+ */
7
+ export declare function unlinkedWorkspaceDependencyMessage(error: unknown, locate?: (importerFile: string) => {
8
+ readonly packageName?: string;
9
+ readonly toolRoot: string;
10
+ }): string | undefined;
11
+ //# sourceMappingURL=unlinked-workspace-dependency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unlinked-workspace-dependency.d.ts","sourceRoot":"","sources":["../../src/bootstrap/unlinked-workspace-dependency.ts"],"names":[],"mappings":"AAgCA;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,EACd,MAAM,GAAE,CAAC,YAAY,EAAE,MAAM,KAAK;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAkB,GAC7G,MAAM,GAAG,SAAS,CAepB"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The bin bootstrap's one diagnosis (round 13, 13.2): is this load failure a
3
+ * workspace dependency of the installed tool that is not linked?
4
+ *
5
+ * A missing `@shrkcrft/*` link kills the emitted CLI (and the MCP server) at
6
+ * ESM LINK time — before `main.js` evaluates a line, so its `Fatal:` handler
7
+ * never runs and Node prints a raw resolver stack naming a `dist/` file. The
8
+ * bootstrap dynamic-imports the entry, and this function turns that one error
9
+ * into the sentence the build's link check prints (scripts/lib/workspace-links.ts):
10
+ *
11
+ * shrk: workspace dependency @shrkcrft/x (needed by @shrkcrft/y) is not linked — run `bun install` in <root>
12
+ *
13
+ * Two real shapes are recognised: Node's `Cannot find package '@shrkcrft/x'
14
+ * imported from <file>`, and Bun's `Cannot find module '@shrkcrft/x' from
15
+ * '<file>'` — a bare package name only, because Bun reports a missing SUBPATH
16
+ * of a linked package the same way. Anything else returns `undefined`, and the
17
+ * bootstrap rethrows it untouched.
18
+ *
19
+ * node: builtins ONLY — never an `@shrkcrft` import, not even core: the package
20
+ * it would import could be the one whose link is missing. That is also why the
21
+ * MCP server carries a byte-identical copy of this file instead of importing
22
+ * it; r77-bootstrap-rewrite.test.ts locks the two copies together.
23
+ */
24
+ import { existsSync, readFileSync } from 'node:fs';
25
+ import { dirname, join, sep } from 'node:path';
26
+ import { fileURLToPath } from 'node:url';
27
+ /** Node: the package directory itself was not found from the importing file. */
28
+ const NODE_UNLINKED = /^Cannot find package '(@shrkcrft\/[^'/]+)' imported from (.+)$/;
29
+ /** Bun: honoured for a bare package name only (see the module comment). */
30
+ const BUN_UNLINKED = /^Cannot find module '(@shrkcrft\/[^'/]+)' from '(.+)'$/;
31
+ /**
32
+ * The one-line message for an unlinked workspace dependency, or `undefined`
33
+ * for any other error. Pure over its inputs: `locate` maps the importing file
34
+ * to the package that needs the dependency and the directory the install runs
35
+ * in; the default reads the nearest package.json files on disk.
36
+ */
37
+ export function unlinkedWorkspaceDependencyMessage(error, locate = locateInstall) {
38
+ if (typeof error !== 'object' || error === null)
39
+ return undefined;
40
+ const { code, message } = error;
41
+ if (code !== 'ERR_MODULE_NOT_FOUND' || typeof message !== 'string')
42
+ return undefined;
43
+ const firstLine = message.split('\n', 1)[0] ?? '';
44
+ const match = NODE_UNLINKED.exec(firstLine) ?? BUN_UNLINKED.exec(firstLine);
45
+ const dependency = match?.[1];
46
+ const importer = match?.[2];
47
+ if (dependency === undefined || importer === undefined)
48
+ return undefined;
49
+ const importerFile = importer.startsWith('file:') ? fileURLToPath(importer) : importer;
50
+ const { packageName, toolRoot } = locate(importerFile);
51
+ return (`shrk: workspace dependency ${dependency} (needed by ${packageName ?? importerFile}) ` +
52
+ `is not linked — run \`bun install\` in ${toolRoot}`);
53
+ }
54
+ /** The package owning `importerFile` (its nearest package.json) and where its install runs. */
55
+ function locateInstall(importerFile) {
56
+ for (let dir = dirname(importerFile);;) {
57
+ const manifest = readManifest(join(dir, 'package.json'));
58
+ if (manifest !== undefined) {
59
+ const toolRoot = installRootOf(dir);
60
+ return typeof manifest.name === 'string' ? { packageName: manifest.name, toolRoot } : { toolRoot };
61
+ }
62
+ const parent = dirname(dir);
63
+ if (parent === dir)
64
+ return { toolRoot: dirname(importerFile) };
65
+ dir = parent;
66
+ }
67
+ }
68
+ /**
69
+ * Where the install that links `packageDir`'s dependencies runs: the directory
70
+ * holding the OUTERMOST `node_modules` when the package is installed (a
71
+ * consumer repo, a global prefix), else the nearest workspace root — a
72
+ * package.json declaring `workspaces`, i.e. the tool's own checkout.
73
+ */
74
+ function installRootOf(packageDir) {
75
+ const at = packageDir.indexOf(`${sep}node_modules${sep}`);
76
+ if (at >= 0)
77
+ return at === 0 ? sep : packageDir.slice(0, at);
78
+ for (let dir = packageDir;;) {
79
+ const manifest = readManifest(join(dir, 'package.json'));
80
+ if (manifest?.workspaces !== undefined)
81
+ return dir;
82
+ const parent = dirname(dir);
83
+ if (parent === dir)
84
+ return packageDir;
85
+ dir = parent;
86
+ }
87
+ }
88
+ /** A package.json's fields, `{}` when it exists but does not parse, `undefined` when absent. */
89
+ function readManifest(path) {
90
+ if (!existsSync(path))
91
+ return undefined;
92
+ try {
93
+ const parsed = JSON.parse(readFileSync(path, 'utf8'));
94
+ return typeof parsed === 'object' && parsed !== null ? parsed : {};
95
+ }
96
+ catch {
97
+ return {};
98
+ }
99
+ }
@@ -1,3 +1,5 @@
1
+ import type { PositionalMode } from './dispatch/positional-mode.js';
2
+ import type { ISubverbSpec } from './dispatch/subverb-spec.js';
1
3
  export interface ParsedArgs {
2
4
  positional: string[];
3
5
  flags: Map<string, string | boolean>;
@@ -5,6 +7,14 @@ export interface ParsedArgs {
5
7
  multiFlags: Map<string, string[]>;
6
8
  /** Resolved global cwd (absolute), if --cwd was passed at the top level. */
7
9
  globalCwd?: string;
10
+ /**
11
+ * The tokens `parseArgs` read, verbatim — how each flag was SPELLED, which
12
+ * the parsed map cannot tell (`--x` and `-x` both key `x`; `--offset -1`
13
+ * leaves `offset` valueless and keys `1`). Set by `parseArgs`; absent on a
14
+ * hand-built ParsedArgs. Read it through {@link spellFlagAsTyped} /
15
+ * {@link misreadValueHint}.
16
+ */
17
+ argv?: readonly string[];
8
18
  }
9
19
  export interface ICommandHandler {
10
20
  name: string;
@@ -18,6 +28,34 @@ export interface ICommandHandler {
18
28
  * naturally emits). Optional; commands without it parse exactly as before.
19
29
  */
20
30
  booleanFlags?: ReadonlySet<string>;
31
+ /**
32
+ * Subverbs this handler dispatches internally from `positional[0]`
33
+ * (`shrk check wiring`). Opt-in: the command index lists each as a
34
+ * first-class command, and — with `positionals: PositionalMode.None` — the
35
+ * command-string resolver can prove an unknown bare token is an unknown
36
+ * subverb instead of a free positional.
37
+ */
38
+ subverbs?: readonly ISubverbSpec[];
39
+ /**
40
+ * What a `positional[0]` that is not a subverb means. `undefined` = legacy
41
+ * (unchecked): an unknown tail is reported `prefix-only`, never flagged.
42
+ */
43
+ positionals?: PositionalMode;
44
+ /**
45
+ * The COMPLETE accepted flag set, when declared. The dispatcher refuses any
46
+ * other flag BEFORE the handler runs (`usageExitFor`: 3 on a verdict verb, 2
47
+ * elsewhere), so a typo can never read as an opt-in; the global flags
48
+ * (`dispatch/global-flags.ts`) are always accepted on top. A declared
49
+ * subverb's `flags` add to it. Undeclared = the post-run read-tracking
50
+ * detector judges instead.
51
+ */
52
+ flags?: ReadonlySet<string>;
53
+ /**
54
+ * The handler re-executes `process.argv` in a child process, so the flags it
55
+ * uses are read by the child: the post-run read-tracking detector must not
56
+ * judge this process's parse.
57
+ */
58
+ forwardsArgv?: boolean;
21
59
  run(args: ParsedArgs): Promise<number> | number;
22
60
  }
23
61
  /**
@@ -37,6 +75,13 @@ export interface ICommandResolution {
37
75
  handler?: ICommandHandler;
38
76
  /** The canonical segments that matched (aliases already resolved). */
39
77
  matchedPath: string[];
78
+ /**
79
+ * The same segments as the user SPELLED them (an alias stays an alias), the
80
+ * global flags the descent stepped over removed. `[...matchedTokens, ...rest]`
81
+ * is the argv with its command path first — the view the verdict path and
82
+ * the usage record read (`withoutPathGlobals`).
83
+ */
84
+ matchedTokens: string[];
40
85
  /** Tokens left over after the descent stopped (passed to the handler). */
41
86
  rest: string[];
42
87
  /** The trie node where the descent stopped — useful for help/suggestions. */
@@ -101,8 +146,27 @@ export declare class CommandRegistry {
101
146
  *
102
147
  * Returns the deepest node's handler, the canonical path that matched,
103
148
  * and the remaining tokens (passed to the handler).
149
+ *
150
+ * `options.transparent` names flag tokens the descent may step OVER instead
151
+ * of stopping at (the dispatcher's global `--strict` / `--no-hints`) — only
152
+ * while they sit INSIDE the command path. A run of them is stepped over when
153
+ * the token after it continues the path (a child or child alias of the
154
+ * current node, or a subverb its handler declares); the run is hoisted into
155
+ * `rest` before any `--` sentinel, so the handler still sees it. So
156
+ * `shrk --no-hints scaffolds list` resolves `scaffolds list` and
157
+ * `shrk check --strict wiring` keeps `wiring` as the subverb.
158
+ *
159
+ * Past the path, a token `options.bindsValue` names (the bare `--strict`,
160
+ * which `doctor` reads as `--strict <level>`) stays exactly where it is, in
161
+ * front of its value: `doctor --strict warnings` leaves `['--strict',
162
+ * 'warnings']`, never a positional `warnings`. A self-contained one
163
+ * (`--no-hints`, `--strict=<level>`) is still moved out of the way, so it
164
+ * never swallows the positional after it (`task --no-hints "add a thing"`).
104
165
  */
105
- resolve(tokens: readonly string[]): ICommandResolution;
166
+ resolve(tokens: readonly string[], options?: {
167
+ readonly transparent?: (token: string) => boolean;
168
+ readonly bindsValue?: (token: string) => boolean;
169
+ }): ICommandResolution;
106
170
  private descend;
107
171
  private collectAll;
108
172
  }
@@ -113,6 +177,21 @@ export interface ParseArgsOptions {
113
177
  booleanFlags?: ReadonlySet<string>;
114
178
  }
115
179
  export declare function parseArgs(argv: readonly string[], options?: ParseArgsOptions): ParsedArgs;
180
+ /**
181
+ * How the user SPELLED a parsed flag. The parser keys `--x` and `-x` alike as
182
+ * `x`, so a message that inferred the dashes from the key's length named a
183
+ * flag nobody typed (`graph cycles --x` → `Unknown flag "-x"`). Reads the argv
184
+ * `parseArgs` kept; without it, the conventional spelling (`-k` for one letter).
185
+ */
186
+ export declare function spellFlagAsTyped(key: string, argv: readonly string[] | undefined): string;
187
+ /**
188
+ * `--offset -1`: a flag value never starts with `-`, so `parseArgs` reads `-1`
189
+ * as a flag of its own and leaves `--offset` valueless. A refusal that said
190
+ * "-1 is not a flag" named the wrong problem; this names the flag the number
191
+ * was meant for, and the `=` spelling that passes it as the value. `undefined`
192
+ * unless `key` is numeric and its token directly follows a value-less `--flag`.
193
+ */
194
+ export declare function misreadValueHint(key: string, argv: readonly string[] | undefined): string | undefined;
116
195
  /**
117
196
  * Extracts `--cwd <value>` / `--cwd=<value>` from anywhere in argv. Used as a
118
197
  * pre-pass before command dispatch so a user can write `shrk --cwd ./repo doctor`.
@@ -160,6 +239,26 @@ export declare function extractGlobalExitTrailer(argv: readonly string[]): {
160
239
  export declare function resolveCwd(args: ParsedArgs): string;
161
240
  export declare function flagString(args: ParsedArgs, name: string): string | undefined;
162
241
  export declare function flagBool(args: ParsedArgs, name: string): boolean;
242
+ /**
243
+ * The guard for a per-item query verb whose input SELECTOR is required
244
+ * (`tests missing --files a,b`). Without it, "you gave me nothing to check"
245
+ * rendered as "I checked and found nothing": zero bytes, exit 0.
246
+ *
247
+ * Returns `null` when any listed flag (or, with `positional: true`, any
248
+ * positional) was passed; otherwise writes the usage line and the accepted
249
+ * selectors to stderr and returns `3` — the request itself was malformed.
250
+ */
251
+ export declare function requireInputSelector(args: ParsedArgs, spec: {
252
+ readonly flags: readonly string[];
253
+ readonly positional?: boolean;
254
+ readonly usage: string;
255
+ }): number | null;
256
+ /**
257
+ * A selector WAS given but resolved to 0 files (`--since HEAD` on a clean
258
+ * tree): nothing was analysed, so the answer is `2` (not verified) — never a
259
+ * confident empty result. `--json` gets a parseable object saying so.
260
+ */
261
+ export declare function emptySelectionExit(wantJson: boolean): number;
163
262
  export declare function flagNumber(args: ParsedArgs, name: string): number | undefined;
164
263
  /**
165
264
  * Parse a `--limit`/`--depth`-style flag as a positive integer, falling back to
@@ -1 +1 @@
1
- {"version":3,"file":"command-registry.d.ts","sourceRoot":"","sources":["../src/command-registry.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IACrC,0EAA0E;IAC1E,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;C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;;;OASG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;CACrC;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAqB,GAC7B,MAAM,EAAE,CAkCV;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAC3B,MAAM,GAAG,SAAS,CAKpB"}
@@ -2,6 +2,17 @@ import * as nodePath from 'node:path';
2
2
  function makeTrieNode() {
3
3
  return { children: new Map(), aliases: new Map() };
4
4
  }
5
+ /**
6
+ * Does `token` continue the command path below `node` — a trie child (or child
7
+ * alias), or a subverb the node's handler declares (`check wiring`)?
8
+ */
9
+ function continuesPath(node, token) {
10
+ if (token.startsWith('-'))
11
+ return false;
12
+ if (node.children.has(node.aliases.get(token) ?? token))
13
+ return true;
14
+ return node.handler?.subverbs?.some((s) => s.name === token || s.aliases?.includes(token) === true) === true;
15
+ }
5
16
  /**
6
17
  * Trie-backed command registry. Supports N-level dispatch
7
18
  * (`shrk pack author status`) while keeping the historical 1- and 2-level
@@ -153,13 +164,48 @@ export class CommandRegistry {
153
164
  *
154
165
  * Returns the deepest node's handler, the canonical path that matched,
155
166
  * and the remaining tokens (passed to the handler).
167
+ *
168
+ * `options.transparent` names flag tokens the descent may step OVER instead
169
+ * of stopping at (the dispatcher's global `--strict` / `--no-hints`) — only
170
+ * while they sit INSIDE the command path. A run of them is stepped over when
171
+ * the token after it continues the path (a child or child alias of the
172
+ * current node, or a subverb its handler declares); the run is hoisted into
173
+ * `rest` before any `--` sentinel, so the handler still sees it. So
174
+ * `shrk --no-hints scaffolds list` resolves `scaffolds list` and
175
+ * `shrk check --strict wiring` keeps `wiring` as the subverb.
176
+ *
177
+ * Past the path, a token `options.bindsValue` names (the bare `--strict`,
178
+ * which `doctor` reads as `--strict <level>`) stays exactly where it is, in
179
+ * front of its value: `doctor --strict warnings` leaves `['--strict',
180
+ * 'warnings']`, never a positional `warnings`. A self-contained one
181
+ * (`--no-hints`, `--strict=<level>`) is still moved out of the way, so it
182
+ * never swallows the positional after it (`task --no-hints "add a thing"`).
156
183
  */
157
- resolve(tokens) {
184
+ resolve(tokens, options = {}) {
158
185
  let node = this.root;
159
186
  const matched = [];
187
+ const spelled = [];
188
+ const hoisted = [];
189
+ const kept = [];
190
+ const isTransparent = (t) => t !== undefined && t !== '--' && options.transparent?.(t) === true;
160
191
  let i = 0;
161
192
  while (i < tokens.length) {
162
193
  const t = tokens[i];
194
+ if (isTransparent(t)) {
195
+ let end = i;
196
+ while (isTransparent(tokens[end]))
197
+ end += 1;
198
+ const run = tokens.slice(i, end);
199
+ i = end;
200
+ const next = tokens[i];
201
+ if (next !== undefined && continuesPath(node, next)) {
202
+ hoisted.push(...run);
203
+ continue;
204
+ }
205
+ for (const flag of run)
206
+ (options.bindsValue?.(flag) === true ? kept : hoisted).push(flag);
207
+ break;
208
+ }
163
209
  if (t.startsWith('-'))
164
210
  break;
165
211
  const canonical = node.aliases.get(t) ?? t;
@@ -168,12 +214,22 @@ export class CommandRegistry {
168
214
  break;
169
215
  node = child;
170
216
  matched.push(canonical);
217
+ spelled.push(t);
171
218
  i += 1;
172
219
  }
220
+ const rest = [...kept, ...tokens.slice(i)];
221
+ if (hoisted.length > 0) {
222
+ const sentinel = rest.indexOf('--');
223
+ if (sentinel === -1)
224
+ rest.push(...hoisted);
225
+ else
226
+ rest.splice(sentinel, 0, ...hoisted);
227
+ }
173
228
  return {
174
229
  handler: node.handler,
175
230
  matchedPath: matched,
176
- rest: tokens.slice(i),
231
+ matchedTokens: spelled,
232
+ rest,
177
233
  node,
178
234
  };
179
235
  }
@@ -248,11 +304,44 @@ export function parseArgs(argv, options = {}) {
248
304
  positional.push(arg);
249
305
  }
250
306
  }
251
- const out = { positional, flags, multiFlags };
307
+ const out = { positional, flags, multiFlags, argv: [...argv] };
252
308
  if (options.globalCwd)
253
309
  out.globalCwd = options.globalCwd;
254
310
  return out;
255
311
  }
312
+ /**
313
+ * How the user SPELLED a parsed flag. The parser keys `--x` and `-x` alike as
314
+ * `x`, so a message that inferred the dashes from the key's length named a
315
+ * flag nobody typed (`graph cycles --x` → `Unknown flag "-x"`). Reads the argv
316
+ * `parseArgs` kept; without it, the conventional spelling (`-k` for one letter).
317
+ */
318
+ export function spellFlagAsTyped(key, argv) {
319
+ for (const token of argv ?? []) {
320
+ if (token === '--')
321
+ break;
322
+ if (token === `--${key}` || token.startsWith(`--${key}=`))
323
+ return `--${key}`;
324
+ if (token === `-${key}`)
325
+ return `-${key}`;
326
+ }
327
+ return `${key.length === 1 ? '-' : '--'}${key}`;
328
+ }
329
+ /**
330
+ * `--offset -1`: a flag value never starts with `-`, so `parseArgs` reads `-1`
331
+ * as a flag of its own and leaves `--offset` valueless. A refusal that said
332
+ * "-1 is not a flag" named the wrong problem; this names the flag the number
333
+ * was meant for, and the `=` spelling that passes it as the value. `undefined`
334
+ * unless `key` is numeric and its token directly follows a value-less `--flag`.
335
+ */
336
+ export function misreadValueHint(key, argv) {
337
+ if (argv === undefined || !/^\d+(?:\.\d+)?$/.test(key))
338
+ return undefined;
339
+ const at = argv.indexOf(`-${key}`);
340
+ const owner = at > 0 ? argv[at - 1] : undefined;
341
+ if (owner === undefined || owner === '--' || !owner.startsWith('--') || owner.includes('='))
342
+ return undefined;
343
+ return `-${key} was read as a flag, not as the value of ${owner} — a flag value cannot start with "-" (${owner}=-${key} passes it as the value)`;
344
+ }
256
345
  /**
257
346
  * Extracts `--cwd <value>` / `--cwd=<value>` from anywhere in argv. Used as a
258
347
  * pre-pass before command dispatch so a user can write `shrk --cwd ./repo doctor`.
@@ -414,6 +503,44 @@ export function flagBool(args, name) {
414
503
  const v = args.flags.get(name);
415
504
  return v === true || v === 'true';
416
505
  }
506
+ /**
507
+ * The guard for a per-item query verb whose input SELECTOR is required
508
+ * (`tests missing --files a,b`). Without it, "you gave me nothing to check"
509
+ * rendered as "I checked and found nothing": zero bytes, exit 0.
510
+ *
511
+ * Returns `null` when any listed flag (or, with `positional: true`, any
512
+ * positional) was passed; otherwise writes the usage line and the accepted
513
+ * selectors to stderr and returns `3` — the request itself was malformed.
514
+ */
515
+ export function requireInputSelector(args, spec) {
516
+ const given = spec.flags.some((f) => {
517
+ const v = args.flags.get(f);
518
+ return v !== undefined && v !== false && v !== '';
519
+ });
520
+ if (given || (spec.positional === true && args.positional.length > 0))
521
+ return null;
522
+ const selectors = spec.flags.map((f) => `--${f}`).join('/');
523
+ const hint = selectors.length === 0
524
+ ? 'pass a positional argument'
525
+ : `pass one of ${selectors}${spec.positional ? ' (or a positional argument)' : ''}`;
526
+ process.stderr.write(`Usage: ${spec.usage}\n no input selected — ${hint}\n`);
527
+ return 3;
528
+ }
529
+ /**
530
+ * A selector WAS given but resolved to 0 files (`--since HEAD` on a clean
531
+ * tree): nothing was analysed, so the answer is `2` (not verified) — never a
532
+ * confident empty result. `--json` gets a parseable object saying so.
533
+ */
534
+ export function emptySelectionExit(wantJson) {
535
+ const reason = '0 files selected — nothing analysed';
536
+ if (wantJson) {
537
+ process.stdout.write(`${JSON.stringify({ files: [], analysed: false, reason, exitCode: 2 })}\n`);
538
+ }
539
+ else {
540
+ process.stderr.write(`${reason} (not verified).\n`);
541
+ }
542
+ return 2;
543
+ }
417
544
  export function flagNumber(args, name) {
418
545
  const v = args.flags.get(name);
419
546
  if (typeof v !== 'string')
@@ -1 +1 @@
1
- {"version":3,"file":"api-diff.command.d.ts","sourceRoot":"","sources":["../../src/commands/api-diff.command.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAGhC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,eAoB5B,CAAC"}
1
+ {"version":3,"file":"api-diff.command.d.ts","sourceRoot":"","sources":["../../src/commands/api-diff.command.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,eA+B5B,CAAC"}
@@ -3,6 +3,7 @@ import * as nodePath from 'node:path';
3
3
  import { diffApiSurfaces, extractApiSurface, extractApiSurfaceWithProgram, } from '@shrkcrft/api-surface-diff';
4
4
  import { GraphStore } from '@shrkcrft/graph';
5
5
  import { flagBool, flagList, flagString, resolveCwd, } from "../command-registry.js";
6
+ import { PositionalMode } from "../dispatch/positional-mode.js";
6
7
  import { asJson, header, kv } from "../output/format-output.js";
7
8
  /**
8
9
  * `shrk api-diff` — compare the current code-graph's public-API
@@ -14,6 +15,17 @@ import { asJson, header, kv } from "../output/format-output.js";
14
15
  */
15
16
  export const apiDiffCommand = {
16
17
  name: 'api-diff',
18
+ // positional[0] is `capture` or the baseline FILE: a verb-shaped token that
19
+ // is neither (`api-diff status`) is refused before it can become a path
20
+ // (it used to read as "Baseline read error: ENOENT …/status").
21
+ positionals: PositionalMode.Path,
22
+ subverbs: [
23
+ {
24
+ name: 'capture',
25
+ description: 'Write the current public API surface to a baseline file.',
26
+ usage: 'shrk api-diff capture --output <path> [--packages @scope/a,@scope/b] [--with-signatures] [--json]',
27
+ },
28
+ ],
17
29
  description: 'Compare the current public API surface to a saved baseline. Reports added / removed / kind-changed / moved symbols, with breaking-change severity.',
18
30
  usage: 'shrk api-diff capture --output <path> [--packages @scope/a,@scope/b] [--with-signatures] | shrk api-diff <baseline.json> [--packages @scope/a,@scope/b] [--with-signatures] [--json] [--fail-on-breaking] (--packages takes EXACT workspace package names, comma-separated or repeated)',
19
31
  async run(args) {
@@ -1 +1 @@
1
- {"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../src/commands/apply.command.ts"],"names":[],"mappings":"AAqDA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAyLhC,eAAO,MAAM,YAAY,EAAE,eAwsB1B,CAAC"}
1
+ {"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../src/commands/apply.command.ts"],"names":[],"mappings":"AAqDA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AA0LhC,eAAO,MAAM,YAAY,EAAE,eA0sB1B,CAAC"}
@@ -5,6 +5,7 @@ import { applyAssetPreview } from "../asset-preview/apply-asset-preview.js";
5
5
  import { ApplyBatchPlanError, parseApplyBatchPlan, runApplyBatch, } from "../task-next/apply-batch-runner.js";
6
6
  import { applyFolderOps, checkFolderOpSafety, diffPlanChanges, diffPlanFolderOps, evaluateSavedPlanInPlace, FileChangeType, FolderOpSafety, generate, isSyntheticTemplateId, OverwriteStrategy, readPlanFromFile, verifyPlan, writeSyntheticPlan, } from '@shrkcrft/generator';
7
7
  import { flagBool, flagList, flagString, resolveCwd, } from "../command-registry.js";
8
+ import { PositionalMode } from "../dispatch/positional-mode.js";
8
9
  import { asJson, header } from "../output/format-output.js";
9
10
  import { printError } from "../output/print-error.js";
10
11
  import { runValidationLoop } from "../validation/run-validation-loop.js";
@@ -178,6 +179,8 @@ async function runApplyBatchFromCli(args, batchPath) {
178
179
  }
179
180
  export const applyCommand = {
180
181
  name: 'apply',
182
+ // positional[0] is the plan FILE; a verb-shaped non-file is refused.
183
+ positionals: PositionalMode.Path,
181
184
  description: 'Apply a previously-saved generation plan (sharkcraft.plan/v1 JSON). The CLI is the only write path; MCP never writes. Plans that live under .sharkcraft/sessions/<id>/plans/ automatically update the session metadata (signature + divergence + applied + validation).',
182
185
  usage: 'shrk [--cwd <dir>] apply <plan.json> [--session <id>] [--force] [--allow-divergent] [--verify-signature] [--require-signature] [--no-verify-signature] [--dry-run] [--validate] [--report] [--json] [--trace] [--explain-dispatch] | shrk apply --asset-preview <draft.ts> --target <file> [--write] [--allow-unknown-target] [--reason <text>] | shrk apply --batch <plan.json> [--allow-divergent] [--dry-run] [--json]',
183
186
  async run(args) {
@@ -1 +1 @@
1
- {"version":3,"file":"arch.command.d.ts","sourceRoot":"","sources":["../../src/commands/arch.command.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,eAoBzB,CAAC"}
1
+ {"version":3,"file":"arch.command.d.ts","sourceRoot":"","sources":["../../src/commands/arch.command.ts"],"names":[],"mappings":"AAcA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAC;AAIhC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,eAoBzB,CAAC"}