@shrkcrft/cli 0.1.0-alpha.2

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 (450) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/asset-preview/apply-action-hint-stub.d.ts +28 -0
  4. package/dist/asset-preview/apply-action-hint-stub.d.ts.map +1 -0
  5. package/dist/asset-preview/apply-action-hint-stub.js +170 -0
  6. package/dist/asset-preview/apply-asset-preview.d.ts +31 -0
  7. package/dist/asset-preview/apply-asset-preview.d.ts.map +1 -0
  8. package/dist/asset-preview/apply-asset-preview.js +210 -0
  9. package/dist/asset-preview/apply-knowledge-stale-fix.d.ts +37 -0
  10. package/dist/asset-preview/apply-knowledge-stale-fix.d.ts.map +1 -0
  11. package/dist/asset-preview/apply-knowledge-stale-fix.js +344 -0
  12. package/dist/asset-preview/apply-missing-barrel.d.ts +15 -0
  13. package/dist/asset-preview/apply-missing-barrel.d.ts.map +1 -0
  14. package/dist/asset-preview/apply-missing-barrel.js +65 -0
  15. package/dist/asset-preview/apply-template-drift-fix.d.ts +21 -0
  16. package/dist/asset-preview/apply-template-drift-fix.d.ts.map +1 -0
  17. package/dist/asset-preview/apply-template-drift-fix.js +125 -0
  18. package/dist/asset-preview/apply-template-update.d.ts +43 -0
  19. package/dist/asset-preview/apply-template-update.d.ts.map +1 -0
  20. package/dist/asset-preview/apply-template-update.js +257 -0
  21. package/dist/asset-preview/entry-mutator.d.ts +106 -0
  22. package/dist/asset-preview/entry-mutator.d.ts.map +1 -0
  23. package/dist/asset-preview/entry-mutator.js +428 -0
  24. package/dist/authoring/authoring-kit.d.ts +36 -0
  25. package/dist/authoring/authoring-kit.d.ts.map +1 -0
  26. package/dist/authoring/authoring-kit.js +106 -0
  27. package/dist/command-registry.d.ts +158 -0
  28. package/dist/command-registry.d.ts.map +1 -0
  29. package/dist/command-registry.js +348 -0
  30. package/dist/commands/apply.command.d.ts +3 -0
  31. package/dist/commands/apply.command.d.ts.map +1 -0
  32. package/dist/commands/apply.command.js +879 -0
  33. package/dist/commands/architecture.command.d.ts +5 -0
  34. package/dist/commands/architecture.command.d.ts.map +1 -0
  35. package/dist/commands/architecture.command.js +141 -0
  36. package/dist/commands/ask.command.d.ts +3 -0
  37. package/dist/commands/ask.command.d.ts.map +1 -0
  38. package/dist/commands/ask.command.js +58 -0
  39. package/dist/commands/audit.command.d.ts +3 -0
  40. package/dist/commands/audit.command.d.ts.map +1 -0
  41. package/dist/commands/audit.command.js +141 -0
  42. package/dist/commands/biome.command.d.ts +7 -0
  43. package/dist/commands/biome.command.d.ts.map +1 -0
  44. package/dist/commands/biome.command.js +350 -0
  45. package/dist/commands/boundaries.command.d.ts +9 -0
  46. package/dist/commands/boundaries.command.d.ts.map +1 -0
  47. package/dist/commands/boundaries.command.js +314 -0
  48. package/dist/commands/brief.command.d.ts +3 -0
  49. package/dist/commands/brief.command.d.ts.map +1 -0
  50. package/dist/commands/brief.command.js +206 -0
  51. package/dist/commands/bundle.command.d.ts +3 -0
  52. package/dist/commands/bundle.command.d.ts.map +1 -0
  53. package/dist/commands/bundle.command.js +1183 -0
  54. package/dist/commands/changes.command.d.ts +3 -0
  55. package/dist/commands/changes.command.d.ts.map +1 -0
  56. package/dist/commands/changes.command.js +155 -0
  57. package/dist/commands/check.command.d.ts +3 -0
  58. package/dist/commands/check.command.d.ts.map +1 -0
  59. package/dist/commands/check.command.js +553 -0
  60. package/dist/commands/checks.command.d.ts +29 -0
  61. package/dist/commands/checks.command.d.ts.map +1 -0
  62. package/dist/commands/checks.command.js +521 -0
  63. package/dist/commands/ci.command.d.ts +3 -0
  64. package/dist/commands/ci.command.d.ts.map +1 -0
  65. package/dist/commands/ci.command.js +680 -0
  66. package/dist/commands/codemod.command.d.ts +3 -0
  67. package/dist/commands/codemod.command.d.ts.map +1 -0
  68. package/dist/commands/codemod.command.js +130 -0
  69. package/dist/commands/command-catalog.d.ts +265 -0
  70. package/dist/commands/command-catalog.d.ts.map +1 -0
  71. package/dist/commands/command-catalog.js +3242 -0
  72. package/dist/commands/commands.command.d.ts +92 -0
  73. package/dist/commands/commands.command.d.ts.map +1 -0
  74. package/dist/commands/commands.command.js +1208 -0
  75. package/dist/commands/constructs.command.d.ts +15 -0
  76. package/dist/commands/constructs.command.d.ts.map +1 -0
  77. package/dist/commands/constructs.command.js +669 -0
  78. package/dist/commands/context.command.d.ts +3 -0
  79. package/dist/commands/context.command.d.ts.map +1 -0
  80. package/dist/commands/context.command.js +120 -0
  81. package/dist/commands/contract-gate.command.d.ts +5 -0
  82. package/dist/commands/contract-gate.command.d.ts.map +1 -0
  83. package/dist/commands/contract-gate.command.js +208 -0
  84. package/dist/commands/contract-templates.command.d.ts +8 -0
  85. package/dist/commands/contract-templates.command.d.ts.map +1 -0
  86. package/dist/commands/contract-templates.command.js +151 -0
  87. package/dist/commands/contract.command.d.ts +3 -0
  88. package/dist/commands/contract.command.d.ts.map +1 -0
  89. package/dist/commands/contract.command.js +105 -0
  90. package/dist/commands/conventions.command.d.ts +8 -0
  91. package/dist/commands/conventions.command.d.ts.map +1 -0
  92. package/dist/commands/conventions.command.js +169 -0
  93. package/dist/commands/coverage.command.d.ts +3 -0
  94. package/dist/commands/coverage.command.d.ts.map +1 -0
  95. package/dist/commands/coverage.command.js +56 -0
  96. package/dist/commands/daily.commands.d.ts +5 -0
  97. package/dist/commands/daily.commands.d.ts.map +1 -0
  98. package/dist/commands/daily.commands.js +224 -0
  99. package/dist/commands/dashboard-export.command.d.ts +4 -0
  100. package/dist/commands/dashboard-export.command.d.ts.map +1 -0
  101. package/dist/commands/dashboard-export.command.js +86 -0
  102. package/dist/commands/dashboard.command.d.ts +3 -0
  103. package/dist/commands/dashboard.command.d.ts.map +1 -0
  104. package/dist/commands/dashboard.command.js +106 -0
  105. package/dist/commands/dev.command.d.ts +3 -0
  106. package/dist/commands/dev.command.d.ts.map +1 -0
  107. package/dist/commands/dev.command.js +1392 -0
  108. package/dist/commands/diagnostics.command.d.ts +5 -0
  109. package/dist/commands/diagnostics.command.d.ts.map +1 -0
  110. package/dist/commands/diagnostics.command.js +97 -0
  111. package/dist/commands/docs.command.d.ts +4 -0
  112. package/dist/commands/docs.command.d.ts.map +1 -0
  113. package/dist/commands/docs.command.js +34 -0
  114. package/dist/commands/doctor.command.d.ts +7 -0
  115. package/dist/commands/doctor.command.d.ts.map +1 -0
  116. package/dist/commands/doctor.command.js +681 -0
  117. package/dist/commands/drift.command.d.ts +3 -0
  118. package/dist/commands/drift.command.d.ts.map +1 -0
  119. package/dist/commands/drift.command.js +124 -0
  120. package/dist/commands/eslint.command.d.ts +7 -0
  121. package/dist/commands/eslint.command.d.ts.map +1 -0
  122. package/dist/commands/eslint.command.js +423 -0
  123. package/dist/commands/explore.command.d.ts +3 -0
  124. package/dist/commands/explore.command.d.ts.map +1 -0
  125. package/dist/commands/explore.command.js +65 -0
  126. package/dist/commands/export-bundle.command.d.ts +6 -0
  127. package/dist/commands/export-bundle.command.d.ts.map +1 -0
  128. package/dist/commands/export-bundle.command.js +96 -0
  129. package/dist/commands/export.command.d.ts +3 -0
  130. package/dist/commands/export.command.d.ts.map +1 -0
  131. package/dist/commands/export.command.js +83 -0
  132. package/dist/commands/feedback-dispatch.command.d.ts +12 -0
  133. package/dist/commands/feedback-dispatch.command.d.ts.map +1 -0
  134. package/dist/commands/feedback-dispatch.command.js +63 -0
  135. package/dist/commands/feedback.command.d.ts +11 -0
  136. package/dist/commands/feedback.command.d.ts.map +1 -0
  137. package/dist/commands/feedback.command.js +336 -0
  138. package/dist/commands/fix.command.d.ts +3 -0
  139. package/dist/commands/fix.command.d.ts.map +1 -0
  140. package/dist/commands/fix.command.js +776 -0
  141. package/dist/commands/gen.command.d.ts +3 -0
  142. package/dist/commands/gen.command.d.ts.map +1 -0
  143. package/dist/commands/gen.command.js +136 -0
  144. package/dist/commands/git.command.d.ts +6 -0
  145. package/dist/commands/git.command.d.ts.map +1 -0
  146. package/dist/commands/git.command.js +81 -0
  147. package/dist/commands/graph.command.d.ts +3 -0
  148. package/dist/commands/graph.command.d.ts.map +1 -0
  149. package/dist/commands/graph.command.js +287 -0
  150. package/dist/commands/grounding.command.d.ts +7 -0
  151. package/dist/commands/grounding.command.d.ts.map +1 -0
  152. package/dist/commands/grounding.command.js +54 -0
  153. package/dist/commands/help.command.d.ts +20 -0
  154. package/dist/commands/help.command.d.ts.map +1 -0
  155. package/dist/commands/help.command.js +127 -0
  156. package/dist/commands/helper.command.d.ts +6 -0
  157. package/dist/commands/helper.command.d.ts.map +1 -0
  158. package/dist/commands/helper.command.js +170 -0
  159. package/dist/commands/ide.command.d.ts +6 -0
  160. package/dist/commands/ide.command.d.ts.map +1 -0
  161. package/dist/commands/ide.command.js +340 -0
  162. package/dist/commands/impact.command.d.ts +3 -0
  163. package/dist/commands/impact.command.d.ts.map +1 -0
  164. package/dist/commands/impact.command.js +819 -0
  165. package/dist/commands/import.command.d.ts +3 -0
  166. package/dist/commands/import.command.d.ts.map +1 -0
  167. package/dist/commands/import.command.js +115 -0
  168. package/dist/commands/infer.command.d.ts +3 -0
  169. package/dist/commands/infer.command.d.ts.map +1 -0
  170. package/dist/commands/infer.command.js +227 -0
  171. package/dist/commands/ingest.command.d.ts +6 -0
  172. package/dist/commands/ingest.command.d.ts.map +1 -0
  173. package/dist/commands/ingest.command.js +532 -0
  174. package/dist/commands/init.command.d.ts +3 -0
  175. package/dist/commands/init.command.d.ts.map +1 -0
  176. package/dist/commands/init.command.js +301 -0
  177. package/dist/commands/inspect.command.d.ts +3 -0
  178. package/dist/commands/inspect.command.d.ts.map +1 -0
  179. package/dist/commands/inspect.command.js +122 -0
  180. package/dist/commands/knowledge-author.command.d.ts +22 -0
  181. package/dist/commands/knowledge-author.command.d.ts.map +1 -0
  182. package/dist/commands/knowledge-author.command.js +366 -0
  183. package/dist/commands/knowledge-propose.command.d.ts +3 -0
  184. package/dist/commands/knowledge-propose.command.d.ts.map +1 -0
  185. package/dist/commands/knowledge-propose.command.js +125 -0
  186. package/dist/commands/knowledge.command.d.ts +18 -0
  187. package/dist/commands/knowledge.command.d.ts.map +1 -0
  188. package/dist/commands/knowledge.command.js +538 -0
  189. package/dist/commands/languages.command.d.ts +3 -0
  190. package/dist/commands/languages.command.d.ts.map +1 -0
  191. package/dist/commands/languages.command.js +300 -0
  192. package/dist/commands/lint.command.d.ts +15 -0
  193. package/dist/commands/lint.command.d.ts.map +1 -0
  194. package/dist/commands/lint.command.js +194 -0
  195. package/dist/commands/mcp.command.d.ts +3 -0
  196. package/dist/commands/mcp.command.d.ts.map +1 -0
  197. package/dist/commands/mcp.command.js +74 -0
  198. package/dist/commands/memory.command.d.ts +11 -0
  199. package/dist/commands/memory.command.d.ts.map +1 -0
  200. package/dist/commands/memory.command.js +264 -0
  201. package/dist/commands/onboard.command.d.ts +3 -0
  202. package/dist/commands/onboard.command.d.ts.map +1 -0
  203. package/dist/commands/onboard.command.js +650 -0
  204. package/dist/commands/orchestrate.command.d.ts +3 -0
  205. package/dist/commands/orchestrate.command.d.ts.map +1 -0
  206. package/dist/commands/orchestrate.command.js +49 -0
  207. package/dist/commands/owners.command.d.ts +5 -0
  208. package/dist/commands/owners.command.d.ts.map +1 -0
  209. package/dist/commands/owners.command.js +113 -0
  210. package/dist/commands/ownership.command.d.ts +5 -0
  211. package/dist/commands/ownership.command.d.ts.map +1 -0
  212. package/dist/commands/ownership.command.js +117 -0
  213. package/dist/commands/pack-author.command.d.ts +30 -0
  214. package/dist/commands/pack-author.command.d.ts.map +1 -0
  215. package/dist/commands/pack-author.command.js +242 -0
  216. package/dist/commands/packs-new.d.ts +27 -0
  217. package/dist/commands/packs-new.d.ts.map +1 -0
  218. package/dist/commands/packs-new.js +805 -0
  219. package/dist/commands/packs.command.d.ts +15 -0
  220. package/dist/commands/packs.command.d.ts.map +1 -0
  221. package/dist/commands/packs.command.js +958 -0
  222. package/dist/commands/paths.command.d.ts +6 -0
  223. package/dist/commands/paths.command.d.ts.map +1 -0
  224. package/dist/commands/paths.command.js +97 -0
  225. package/dist/commands/pipelines.command.d.ts +9 -0
  226. package/dist/commands/pipelines.command.d.ts.map +1 -0
  227. package/dist/commands/pipelines.command.js +308 -0
  228. package/dist/commands/plan-check.command.d.ts +27 -0
  229. package/dist/commands/plan-check.command.d.ts.map +1 -0
  230. package/dist/commands/plan-check.command.js +150 -0
  231. package/dist/commands/plan-simulate.command.d.ts +3 -0
  232. package/dist/commands/plan-simulate.command.d.ts.map +1 -0
  233. package/dist/commands/plan-simulate.command.js +60 -0
  234. package/dist/commands/plan.command.d.ts +8 -0
  235. package/dist/commands/plan.command.d.ts.map +1 -0
  236. package/dist/commands/plan.command.js +139 -0
  237. package/dist/commands/playbooks.command.d.ts +10 -0
  238. package/dist/commands/playbooks.command.d.ts.map +1 -0
  239. package/dist/commands/playbooks.command.js +296 -0
  240. package/dist/commands/plugin.command.d.ts +11 -0
  241. package/dist/commands/plugin.command.d.ts.map +1 -0
  242. package/dist/commands/plugin.command.js +394 -0
  243. package/dist/commands/policy.command.d.ts +8 -0
  244. package/dist/commands/policy.command.d.ts.map +1 -0
  245. package/dist/commands/policy.command.js +451 -0
  246. package/dist/commands/pr.command.d.ts +3 -0
  247. package/dist/commands/pr.command.d.ts.map +1 -0
  248. package/dist/commands/pr.command.js +132 -0
  249. package/dist/commands/preflight.command.d.ts +3 -0
  250. package/dist/commands/preflight.command.d.ts.map +1 -0
  251. package/dist/commands/preflight.command.js +102 -0
  252. package/dist/commands/presets.command.d.ts +17 -0
  253. package/dist/commands/presets.command.d.ts.map +1 -0
  254. package/dist/commands/presets.command.js +647 -0
  255. package/dist/commands/profiles.command.d.ts +7 -0
  256. package/dist/commands/profiles.command.d.ts.map +1 -0
  257. package/dist/commands/profiles.command.js +151 -0
  258. package/dist/commands/provenance.command.d.ts +26 -0
  259. package/dist/commands/provenance.command.d.ts.map +1 -0
  260. package/dist/commands/provenance.command.js +237 -0
  261. package/dist/commands/quality.command.d.ts +5 -0
  262. package/dist/commands/quality.command.d.ts.map +1 -0
  263. package/dist/commands/quality.command.js +69 -0
  264. package/dist/commands/recommend.command.d.ts +4 -0
  265. package/dist/commands/recommend.command.d.ts.map +1 -0
  266. package/dist/commands/recommend.command.js +270 -0
  267. package/dist/commands/registrations.command.d.ts +3 -0
  268. package/dist/commands/registrations.command.d.ts.map +1 -0
  269. package/dist/commands/registrations.command.js +300 -0
  270. package/dist/commands/registry.command.d.ts +4 -0
  271. package/dist/commands/registry.command.d.ts.map +1 -0
  272. package/dist/commands/registry.command.js +37 -0
  273. package/dist/commands/release.command.d.ts +4 -0
  274. package/dist/commands/release.command.d.ts.map +1 -0
  275. package/dist/commands/release.command.js +639 -0
  276. package/dist/commands/repo.command.d.ts +3 -0
  277. package/dist/commands/repo.command.d.ts.map +1 -0
  278. package/dist/commands/repo.command.js +24 -0
  279. package/dist/commands/report.command.d.ts +3 -0
  280. package/dist/commands/report.command.d.ts.map +1 -0
  281. package/dist/commands/report.command.js +511 -0
  282. package/dist/commands/reposet.command.d.ts +6 -0
  283. package/dist/commands/reposet.command.d.ts.map +1 -0
  284. package/dist/commands/reposet.command.js +120 -0
  285. package/dist/commands/review.command.d.ts +3 -0
  286. package/dist/commands/review.command.d.ts.map +1 -0
  287. package/dist/commands/review.command.js +354 -0
  288. package/dist/commands/risk.command.d.ts +3 -0
  289. package/dist/commands/risk.command.d.ts.map +1 -0
  290. package/dist/commands/risk.command.js +56 -0
  291. package/dist/commands/rounds.command.d.ts +8 -0
  292. package/dist/commands/rounds.command.d.ts.map +1 -0
  293. package/dist/commands/rounds.command.js +180 -0
  294. package/dist/commands/rules.command.d.ts +49 -0
  295. package/dist/commands/rules.command.d.ts.map +1 -0
  296. package/dist/commands/rules.command.js +435 -0
  297. package/dist/commands/runtime.command.d.ts +3 -0
  298. package/dist/commands/runtime.command.d.ts.map +1 -0
  299. package/dist/commands/runtime.command.js +56 -0
  300. package/dist/commands/safety.command.d.ts +3 -0
  301. package/dist/commands/safety.command.d.ts.map +1 -0
  302. package/dist/commands/safety.command.js +117 -0
  303. package/dist/commands/scaffolds.command.d.ts +5 -0
  304. package/dist/commands/scaffolds.command.d.ts.map +1 -0
  305. package/dist/commands/scaffolds.command.js +122 -0
  306. package/dist/commands/schemas.command.d.ts +21 -0
  307. package/dist/commands/schemas.command.d.ts.map +1 -0
  308. package/dist/commands/schemas.command.js +296 -0
  309. package/dist/commands/search.command.d.ts +12 -0
  310. package/dist/commands/search.command.d.ts.map +1 -0
  311. package/dist/commands/search.command.js +275 -0
  312. package/dist/commands/self-config.command.d.ts +7 -0
  313. package/dist/commands/self-config.command.d.ts.map +1 -0
  314. package/dist/commands/self-config.command.js +156 -0
  315. package/dist/commands/self.command.d.ts +3 -0
  316. package/dist/commands/self.command.d.ts.map +1 -0
  317. package/dist/commands/self.command.js +117 -0
  318. package/dist/commands/simulate.command.d.ts +3 -0
  319. package/dist/commands/simulate.command.d.ts.map +1 -0
  320. package/dist/commands/simulate.command.js +54 -0
  321. package/dist/commands/spec.command.d.ts +29 -0
  322. package/dist/commands/spec.command.d.ts.map +1 -0
  323. package/dist/commands/spec.command.js +985 -0
  324. package/dist/commands/start-here.command.d.ts +3 -0
  325. package/dist/commands/start-here.command.d.ts.map +1 -0
  326. package/dist/commands/start-here.command.js +35 -0
  327. package/dist/commands/stats.command.d.ts +3 -0
  328. package/dist/commands/stats.command.d.ts.map +1 -0
  329. package/dist/commands/stats.command.js +88 -0
  330. package/dist/commands/surface.command.d.ts +15 -0
  331. package/dist/commands/surface.command.d.ts.map +1 -0
  332. package/dist/commands/surface.command.js +328 -0
  333. package/dist/commands/task-context.command.d.ts +7 -0
  334. package/dist/commands/task-context.command.d.ts.map +1 -0
  335. package/dist/commands/task-context.command.js +646 -0
  336. package/dist/commands/task.command.d.ts +3 -0
  337. package/dist/commands/task.command.d.ts.map +1 -0
  338. package/dist/commands/task.command.js +301 -0
  339. package/dist/commands/template-quality.command.d.ts +5 -0
  340. package/dist/commands/template-quality.command.d.ts.map +1 -0
  341. package/dist/commands/template-quality.command.js +128 -0
  342. package/dist/commands/templates.command.d.ts +26 -0
  343. package/dist/commands/templates.command.d.ts.map +1 -0
  344. package/dist/commands/templates.command.js +964 -0
  345. package/dist/commands/test.command.d.ts +3 -0
  346. package/dist/commands/test.command.d.ts.map +1 -0
  347. package/dist/commands/test.command.js +262 -0
  348. package/dist/commands/tests.command.d.ts +5 -0
  349. package/dist/commands/tests.command.d.ts.map +1 -0
  350. package/dist/commands/tests.command.js +97 -0
  351. package/dist/commands/trace.command.d.ts +3 -0
  352. package/dist/commands/trace.command.d.ts.map +1 -0
  353. package/dist/commands/trace.command.js +121 -0
  354. package/dist/commands/upgrade.command.d.ts +4 -0
  355. package/dist/commands/upgrade.command.d.ts.map +1 -0
  356. package/dist/commands/upgrade.command.js +43 -0
  357. package/dist/commands/version.command.d.ts +3 -0
  358. package/dist/commands/version.command.d.ts.map +1 -0
  359. package/dist/commands/version.command.js +10 -0
  360. package/dist/commands/why.command.d.ts +24 -0
  361. package/dist/commands/why.command.d.ts.map +1 -0
  362. package/dist/commands/why.command.js +119 -0
  363. package/dist/dashboard/dashboard-api-server.d.ts +21 -0
  364. package/dist/dashboard/dashboard-api-server.d.ts.map +1 -0
  365. package/dist/dashboard/dashboard-api-server.js +410 -0
  366. package/dist/dashboard/live-session-server.d.ts +18 -0
  367. package/dist/dashboard/live-session-server.d.ts.map +1 -0
  368. package/dist/dashboard/live-session-server.js +133 -0
  369. package/dist/diff/collect-changed-paths.d.ts +27 -0
  370. package/dist/diff/collect-changed-paths.d.ts.map +1 -0
  371. package/dist/diff/collect-changed-paths.js +68 -0
  372. package/dist/doctor/doctor-tags.d.ts +63 -0
  373. package/dist/doctor/doctor-tags.d.ts.map +1 -0
  374. package/dist/doctor/doctor-tags.js +146 -0
  375. package/dist/export/export-formats.d.ts +22 -0
  376. package/dist/export/export-formats.d.ts.map +1 -0
  377. package/dist/export/export-formats.js +135 -0
  378. package/dist/index.d.ts +22 -0
  379. package/dist/index.d.ts.map +1 -0
  380. package/dist/index.js +21 -0
  381. package/dist/init/detected-block.d.ts +57 -0
  382. package/dist/init/detected-block.d.ts.map +1 -0
  383. package/dist/init/detected-block.js +197 -0
  384. package/dist/init/gitignore.d.ts +30 -0
  385. package/dist/init/gitignore.d.ts.map +1 -0
  386. package/dist/init/gitignore.js +110 -0
  387. package/dist/init/init-templates.d.ts +6 -0
  388. package/dist/init/init-templates.d.ts.map +1 -0
  389. package/dist/init/init-templates.js +413 -0
  390. package/dist/main.d.ts +18 -0
  391. package/dist/main.d.ts.map +1 -0
  392. package/dist/main.js +699 -0
  393. package/dist/output/failure-hints.d.ts +55 -0
  394. package/dist/output/failure-hints.d.ts.map +1 -0
  395. package/dist/output/failure-hints.js +159 -0
  396. package/dist/output/format-output.d.ts +9 -0
  397. package/dist/output/format-output.d.ts.map +1 -0
  398. package/dist/output/format-output.js +26 -0
  399. package/dist/output/print-error.d.ts +3 -0
  400. package/dist/output/print-error.d.ts.map +1 -0
  401. package/dist/output/print-error.js +14 -0
  402. package/dist/output/watch-loop.d.ts +37 -0
  403. package/dist/output/watch-loop.d.ts.map +1 -0
  404. package/dist/output/watch-loop.js +115 -0
  405. package/dist/schemas/json-schemas.d.ts +1630 -0
  406. package/dist/schemas/json-schemas.d.ts.map +1 -0
  407. package/dist/schemas/json-schemas.js +811 -0
  408. package/dist/surface/about.d.ts +10 -0
  409. package/dist/surface/about.d.ts.map +1 -0
  410. package/dist/surface/about.js +53 -0
  411. package/dist/surface/load-surface-context.d.ts +34 -0
  412. package/dist/surface/load-surface-context.d.ts.map +1 -0
  413. package/dist/surface/load-surface-context.js +100 -0
  414. package/dist/surface/no-args-landing.d.ts +7 -0
  415. package/dist/surface/no-args-landing.d.ts.map +1 -0
  416. package/dist/surface/no-args-landing.js +36 -0
  417. package/dist/surface/not-enabled-error.d.ts +24 -0
  418. package/dist/surface/not-enabled-error.d.ts.map +1 -0
  419. package/dist/surface/not-enabled-error.js +36 -0
  420. package/dist/surface/profiles.d.ts +37 -0
  421. package/dist/surface/profiles.d.ts.map +1 -0
  422. package/dist/surface/profiles.js +151 -0
  423. package/dist/surface/shape-defaults.d.ts +21 -0
  424. package/dist/surface/shape-defaults.d.ts.map +1 -0
  425. package/dist/surface/shape-defaults.js +50 -0
  426. package/dist/surface/spine-extractor.d.ts +38 -0
  427. package/dist/surface/spine-extractor.d.ts.map +1 -0
  428. package/dist/surface/spine-extractor.js +100 -0
  429. package/dist/surface/surface-config-writer.d.ts +59 -0
  430. package/dist/surface/surface-config-writer.d.ts.map +1 -0
  431. package/dist/surface/surface-config-writer.js +135 -0
  432. package/dist/surface/surface-summary.d.ts +66 -0
  433. package/dist/surface/surface-summary.d.ts.map +1 -0
  434. package/dist/surface/surface-summary.js +162 -0
  435. package/dist/surface/tier.d.ts +100 -0
  436. package/dist/surface/tier.d.ts.map +1 -0
  437. package/dist/surface/tier.js +172 -0
  438. package/dist/task-next/apply-batch-runner.d.ts +42 -0
  439. package/dist/task-next/apply-batch-runner.d.ts.map +1 -0
  440. package/dist/task-next/apply-batch-runner.js +192 -0
  441. package/dist/task-next/task-next-ranker.d.ts +75 -0
  442. package/dist/task-next/task-next-ranker.d.ts.map +1 -0
  443. package/dist/task-next/task-next-ranker.js +179 -0
  444. package/dist/usage/usage-log.d.ts +54 -0
  445. package/dist/usage/usage-log.d.ts.map +1 -0
  446. package/dist/usage/usage-log.js +105 -0
  447. package/dist/validation/run-validation-loop.d.ts +38 -0
  448. package/dist/validation/run-validation-loop.d.ts.map +1 -0
  449. package/dist/validation/run-validation-loop.js +100 -0
  450. package/package.json +73 -0
package/dist/main.js ADDED
@@ -0,0 +1,699 @@
1
+ #!/usr/bin/env node
2
+ import { CommandRegistry, extractGlobalCwd, parseArgs, } from "./command-registry.js";
3
+ import { initCommand } from "./commands/init.command.js";
4
+ import { inspectCommand } from "./commands/inspect.command.js";
5
+ import { doctorAcknowledgeCommand, doctorAcknowledgementsCommand, doctorCommand, doctorSuppressCommand, doctorSuppressionsCommand, } from "./commands/doctor.command.js";
6
+ import { knowledgeAnchorsCommand, knowledgeGetCommand, knowledgeListCommand, knowledgeReferencesCommand, knowledgeRenameFileCommand, knowledgeRenameSymbolCommand, knowledgeSearchCommand, knowledgeStaleCheckCommand, knowledgeUpdateAnchorCommand, knowledgeVerifyCommand, } from "./commands/knowledge.command.js";
7
+ import { knowledgeAddCommand, knowledgeLintCommand, knowledgeRemoveCommand, knowledgeUpdateCommand, } from "./commands/knowledge-author.command.js";
8
+ import { knowledgeProposeCommand } from "./commands/knowledge-propose.command.js";
9
+ import { provenanceDoctorCommand, provenanceListCommand, provenanceMissingCommand, provenanceReportCommand, provenanceShowCommand, } from "./commands/provenance.command.js";
10
+ import { packAuthorPendingCommand, packAuthorPreviewCommand, packAuthorStatusCommand, packAuthorValidateCommand, } from "./commands/pack-author.command.js";
11
+ import { rulesAddCommand, rulesDoctorCommand, rulesGetCommand, rulesLintCommand, rulesListCommand, rulesRelevantCommand, rulesRemoveCommand, rulesScaffoldCommand, rulesUpdateCommand, } from "./commands/rules.command.js";
12
+ import { checksListCommand, checksDoctorCommand, checksRunCommand, checksParseReportCommand, checksImportCommand, checksAggregateCommand, checksReportCommand, checksConvertCommand, } from "./commands/checks.command.js";
13
+ import { codemodCommand } from "./commands/codemod.command.js";
14
+ import { pathsListCommand, pathsGetCommand, pathsSearchCommand, pathsBestCommand, } from "./commands/paths.command.js";
15
+ import { templatesAddCommand, templatesDoctorCommand, templatesDriftCommand, templatesGetCommand, templatesListCommand, templatesPreviewCommand, templatesRemoveCommand, templatesScaffoldCommand, templatesSearchCommand, templatesSmokeCommand, templatesUpdateCommand, templatesVarsCommand, templatesVerifyPathsCommand, } from "./commands/templates.command.js";
16
+ import { pipelinesListCommand, pipelinesGetCommand, pipelinesContextCommand, pipelinesPlanCommand, pipelinesScriptCommand, pipelinesNextCommand, pipelinesVarsCommand, } from "./commands/pipelines.command.js";
17
+ import { packsListCommand, packsContributionsCommand, packsConflictsCommand, packsSignatureStatusCommand, packsGetCommand, packsInspectCommand, packsDoctorCommand, packsReleaseCheckCommand, packsCompatCommand, packsSignCommand, packsVerifyCommand, packsDevStatusCommand, packsWatchCommand, } from "./commands/packs.command.js";
18
+ import { packsNewCommand, packsTestCommand } from "./commands/packs-new.js";
19
+ import { presetsListCommand, presetsGetCommand, presetsExplainCommand, presetsRecommendCommand, presetsPreviewCommand, presetsApplyCommand, presetsDoctorCommand, presetsDiffCommand, presetsPatchCommand, } from "./commands/presets.command.js";
20
+ import { taskCommand } from "./commands/task.command.js";
21
+ import { preflightCommand } from "./commands/preflight.command.js";
22
+ import { checkCommand } from "./commands/check.command.js";
23
+ import { driftCommand } from "./commands/drift.command.js";
24
+ import { graphCommand } from "./commands/graph.command.js";
25
+ import { coverageCommand } from "./commands/coverage.command.js";
26
+ import { statsCommand } from "./commands/stats.command.js";
27
+ import { reviewCommand } from "./commands/review.command.js";
28
+ import { onboardCommand } from "./commands/onboard.command.js";
29
+ import { contradictionsCommand, generatedCommand, ingestCommand, } from "./commands/ingest.command.js";
30
+ import { contextBuildCommand, contextRefreshCommand, contextStatusCommand, understandTaskCommand, validateChangeCommand, } from "./commands/task-context.command.js";
31
+ import { testCommand } from "./commands/test.command.js";
32
+ import { planParentCommand, planReviewCommand } from "./commands/plan.command.js";
33
+ import { devCommand } from "./commands/dev.command.js";
34
+ import { explainCommand, } from "./commands/daily.commands.js";
35
+ import { schemasListCommand, schemasGetCommand, schemasInventoryCommand, schemasWriteCommand, schemasEmitCommand, } from "./commands/schemas.command.js";
36
+ import { contextCommand } from "./commands/context.command.js";
37
+ import { diffParentCommand, diffRoundsCommand, roundsCaptureCommand, roundsListCommand, roundsParentCommand, roundsShowCommand, } from "./commands/rounds.command.js";
38
+ import { genCommand } from "./commands/gen.command.js";
39
+ import { applyCommand } from "./commands/apply.command.js";
40
+ import { groundingCommand } from "./commands/grounding.command.js";
41
+ import { planCheckCommand } from "./commands/plan-check.command.js";
42
+ import { whyCommand } from "./commands/why.command.js";
43
+ import { specParentCommand, specCreateCommand, specReviewCommand, specImplementCommand, specVerifyCommand, specListCommand, specShowCommand, specStatusCommand, specLintCommand, } from "./commands/spec.command.js";
44
+ import { exportCommand } from "./commands/export.command.js";
45
+ import { dashboardCommand } from "./commands/dashboard.command.js";
46
+ import { dashboardDiffCommand, dashboardExportCommand, } from "./commands/dashboard-export.command.js";
47
+ import { importCommand } from "./commands/import.command.js";
48
+ import { askCommand } from "./commands/ask.command.js";
49
+ import { mcpCommand } from "./commands/mcp.command.js";
50
+ import { versionCommand } from "./commands/version.command.js";
51
+ import { makeHelpCommand } from "./commands/help.command.js";
52
+ import { qualityCommand } from "./commands/quality.command.js";
53
+ import { ciCommand } from "./commands/ci.command.js";
54
+ import { eslintCommand } from "./commands/eslint.command.js";
55
+ import { biomeCommand } from "./commands/biome.command.js";
56
+ import { ideCommand } from "./commands/ide.command.js";
57
+ import { makeCommandsCommand } from "./commands/commands.command.js";
58
+ import { safetyCommand } from "./commands/safety.command.js";
59
+ import { pluginCommand } from "./commands/plugin.command.js";
60
+ import { profilesCommand } from "./commands/profiles.command.js";
61
+ import { auditProjectCouplingCommand } from "./commands/audit.command.js";
62
+ import { conventionsCommand } from "./commands/conventions.command.js";
63
+ import { selfConfigCommand } from "./commands/self-config.command.js";
64
+ import { helperCommand } from "./commands/helper.command.js";
65
+ import { registryCommand } from "./commands/registry.command.js";
66
+ import { registrationsCommand } from "./commands/registrations.command.js";
67
+ import { boundariesListCommand, boundariesGetCommand, boundariesExplainCommand, boundariesInferCommand, } from "./commands/boundaries.command.js";
68
+ import { scaffoldsListCommand, scaffoldsGetCommand, scaffoldsDoctorCommand, } from "./commands/scaffolds.command.js";
69
+ import { inferCommand } from "./commands/infer.command.js";
70
+ import { reportCommand } from "./commands/report.command.js";
71
+ import { bundleCommand } from "./commands/bundle.command.js";
72
+ import { impactCommand } from "./commands/impact.command.js";
73
+ import { traceCommand } from "./commands/trace.command.js";
74
+ import { feedbackCommand } from "./commands/feedback-dispatch.command.js";
75
+ import { searchCommand } from "./commands/search.command.js";
76
+ import { briefCommand } from "./commands/brief.command.js";
77
+ import { releaseCommand, installSmokeCommand } from "./commands/release.command.js";
78
+ import { startHereCommand } from "./commands/start-here.command.js";
79
+ import { docsCheckCommand, examplesCheckCommand } from "./commands/docs.command.js";
80
+ import { selfAuditCommand } from "./commands/self.command.js";
81
+ import { diagnosticsListCommand } from "./commands/diagnostics.command.js";
82
+ import { architectureMapCommand } from "./commands/architecture.command.js";
83
+ import { orchestrateCommand } from "./commands/orchestrate.command.js";
84
+ import { simulateCommand } from "./commands/simulate.command.js";
85
+ import { reposetInitCommand, reposetListCommand, reposetDoctorCommand, reposetMapCommand, } from "./commands/reposet.command.js";
86
+ import { recommendCommand } from "./commands/recommend.command.js";
87
+ import { surfaceCommand } from "./commands/surface.command.js";
88
+ import { upgradeCheckCommand, upgradePlanCommand } from "./commands/upgrade.command.js";
89
+ import { architectureViolationsCommand, architectureAreaCommand, } from "./commands/architecture.command.js";
90
+ import { riskCommand } from "./commands/risk.command.js";
91
+ import { contractCommand } from "./commands/contract.command.js";
92
+ import { contractApproveCommand, contractCheckCommand, contractStatusCommand, } from "./commands/contract-gate.command.js";
93
+ import { planSimulateCommand } from "./commands/plan-simulate.command.js";
94
+ import { memoryBuildCommand, memoryDiagnosticsCommand, memoryDiffCommand, memoryDriftCommand, memoryFilesCommand, memoryReportCommand, memoryResetCommand, memoryRiskCommand, memorySnapshotsCommand, } from "./commands/memory.command.js";
95
+ import { constructsAdoptCommand, constructsApiCommand, constructsEventsCommand, constructsFacetsCommand, constructsFilesCommand, constructsGetCommand, constructsImpactCommand, constructsInferCommand, constructsListCommand, constructsRelatedCommand, constructsSearchCommand, constructsTokensCommand, constructsTraceCommand, } from "./commands/constructs.command.js";
96
+ import { playbooksBriefCommand, playbooksGetCommand, playbooksListCommand, playbooksPreviewCommand, playbooksRecommendCommand, playbooksRunbookCommand, playbooksScriptCommand, playbooksValidateCommand, } from "./commands/playbooks.command.js";
97
+ import { repoAreasCommand } from "./commands/repo.command.js";
98
+ import { policyCheckCommand, policyListCommand, policyGetCommand, policySnapshotCommand, policyTestCommand, policyRunCommand, } from "./commands/policy.command.js";
99
+ import { ownersListCommand, ownersMatchCommand, ownersImpactCommand } from "./commands/owners.command.js";
100
+ import { ownershipListCommand, ownershipForCommand, ownershipAffectedCommand, } from "./commands/ownership.command.js";
101
+ import { runtimeDoctorCommand } from "./commands/runtime.command.js";
102
+ import { testsImpactCommand, testsSuggestCommand, testsMissingCommand } from "./commands/tests.command.js";
103
+ import { gitChangedCommand, gitRootCommand, gitBranchCommand, gitStatusSummaryCommand, } from "./commands/git.command.js";
104
+ import { templatesLintCommand, templatesTestCommand, templatesSnapshotCommand, } from "./commands/template-quality.command.js";
105
+ import { boundariesEnforceCommand, boundariesSuggestCommand } from "./commands/boundaries.command.js";
106
+ import { languagesCommand } from "./commands/languages.command.js";
107
+ import { fixCommand } from "./commands/fix.command.js";
108
+ // unified lint aggregator.
109
+ import { lintCommand } from "./commands/lint.command.js";
110
+ import { changesCommand } from "./commands/changes.command.js";
111
+ import { exploreCommand } from "./commands/explore.command.js";
112
+ import { prCommand } from "./commands/pr.command.js";
113
+ import { suggestDidYouMean } from '@shrkcrft/inspector';
114
+ import { COMMAND_CATALOG } from "./commands/command-catalog.js";
115
+ import { errorFooterFor, renderErrorFooter } from "./output/failure-hints.js";
116
+ import { renderAbout } from "./surface/about.js";
117
+ import { renderNoArgsLanding } from "./surface/no-args-landing.js";
118
+ import { loadSurfaceContext } from "./surface/load-surface-context.js";
119
+ import { buildSurfaceSummary, findCommandInSummary } from "./surface/surface-summary.js";
120
+ import { makeSurfaceNotEnabledError, renderSurfaceNotEnabledText, SURFACE_NOT_ENABLED_EXIT_CODE, } from "./surface/not-enabled-error.js";
121
+ import { extractCommandPath, recordUsage, sanitizeFlagNames, } from "./usage/usage-log.js";
122
+ import { loadProjectConfig } from '@shrkcrft/config';
123
+ export function buildRegistry() {
124
+ const registry = new CommandRegistry();
125
+ registry.register(initCommand);
126
+ registry.register(inspectCommand);
127
+ registry.register(doctorCommand);
128
+ registry.registerSubcommand('doctor', doctorSuppressCommand);
129
+ registry.registerSubcommand('doctor', doctorSuppressionsCommand);
130
+ // Acknowledgements with required reason + expiry.
131
+ registry.registerSubcommand('doctor', doctorAcknowledgeCommand);
132
+ registry.registerSubcommand('doctor', doctorAcknowledgementsCommand);
133
+ registry.register(contextCommand);
134
+ registry.register(genCommand);
135
+ registry.register(applyCommand);
136
+ // `shrk grounding` thin context primer.
137
+ registry.register(groundingCommand);
138
+ // feedback3 — `shrk why <file>` (closes the dangling ide-suggested verb).
139
+ registry.register(whyCommand);
140
+ // spec verb + subcommands.
141
+ registry.register(specParentCommand);
142
+ registry.registerSubcommand('spec', specCreateCommand);
143
+ registry.registerSubcommand('spec', specReviewCommand);
144
+ registry.registerSubcommand('spec', specImplementCommand);
145
+ registry.registerSubcommand('spec', specVerifyCommand);
146
+ registry.registerSubcommand('spec', specListCommand);
147
+ registry.registerSubcommand('spec', specShowCommand);
148
+ registry.registerSubcommand('spec', specStatusCommand);
149
+ registry.registerSubcommand('spec', specLintCommand);
150
+ // rounds capture + diff.
151
+ registry.register(roundsParentCommand);
152
+ registry.registerSubcommand('rounds', roundsCaptureCommand);
153
+ registry.registerSubcommand('rounds', roundsListCommand);
154
+ registry.registerSubcommand('rounds', roundsShowCommand);
155
+ registry.register(diffParentCommand);
156
+ registry.registerSubcommand('diff', diffRoundsCommand);
157
+ registry.register(exportCommand);
158
+ registry.register(dashboardCommand);
159
+ registry.registerSubcommand('dashboard', dashboardExportCommand);
160
+ registry.registerSubcommand('dashboard', dashboardDiffCommand);
161
+ registry.register(importCommand);
162
+ registry.register(taskCommand);
163
+ registry.register(explainCommand);
164
+ registry.register(checkCommand);
165
+ // changed-only preflight orchestrator.
166
+ registry.register(preflightCommand);
167
+ registry.register(driftCommand);
168
+ registry.register(graphCommand);
169
+ registry.register(coverageCommand);
170
+ registry.register(statsCommand);
171
+ registry.register(reviewCommand);
172
+ registry.register(onboardCommand);
173
+ registry.register(ingestCommand);
174
+ registry.register(contradictionsCommand);
175
+ registry.register(generatedCommand);
176
+ registry.register(understandTaskCommand);
177
+ registry.register(validateChangeCommand);
178
+ // contextBuildCommand / contextRefreshCommand / contextStatusCommand are
179
+ // dispatched from inside contextCommand based on the first positional arg
180
+ // (avoids breaking `shrk context --task "..."` flat usage).
181
+ void contextBuildCommand;
182
+ void contextRefreshCommand;
183
+ void contextStatusCommand;
184
+ registry.register(testCommand);
185
+ registry.register(planParentCommand);
186
+ registry.register(devCommand);
187
+ registry.register(askCommand);
188
+ registry.register(mcpCommand);
189
+ registry.register(versionCommand);
190
+ registry.register(qualityCommand);
191
+ registry.register(ciCommand);
192
+ registry.register(eslintCommand);
193
+ registry.register(biomeCommand);
194
+ registry.register(ideCommand);
195
+ registry.register(pluginCommand);
196
+ registry.register(profilesCommand);
197
+ registry.registerSubcommand('audit', auditProjectCouplingCommand);
198
+ registry.register(conventionsCommand);
199
+ registry.register(selfConfigCommand);
200
+ registry.register(helperCommand);
201
+ registry.register(registryCommand);
202
+ registry.register(registrationsCommand);
203
+ registry.register(makeCommandsCommand(registry));
204
+ registry.register(safetyCommand);
205
+ registry.register(inferCommand);
206
+ registry.register(reportCommand);
207
+ registry.register(bundleCommand);
208
+ registry.register(impactCommand);
209
+ registry.register(traceCommand);
210
+ registry.register(feedbackCommand);
211
+ registry.register(fixCommand);
212
+ // unified lint verb (knowledge / rules / templates aggregator).
213
+ registry.register(lintCommand);
214
+ registry.register(changesCommand);
215
+ registry.register(prCommand);
216
+ registry.register(searchCommand);
217
+ registry.register(briefCommand);
218
+ registry.register(releaseCommand);
219
+ registry.register(startHereCommand);
220
+ registry.register(exploreCommand);
221
+ registry.register(orchestrateCommand);
222
+ registry.register(simulateCommand);
223
+ registry.register(recommendCommand);
224
+ // Adaptive surface introspection + management.
225
+ registry.register(surfaceCommand);
226
+ registry.register(riskCommand);
227
+ registry.register(contractCommand);
228
+ // contract gates — dispatched from inside contractCommand when the
229
+ // first positional is check/approve/status (avoids subcommand-routing
230
+ // collision with the task-string form `shrk contract "<task>"`).
231
+ void contractCheckCommand;
232
+ void contractApproveCommand;
233
+ void contractStatusCommand;
234
+ registry.registerSubcommand('plan', planSimulateCommand);
235
+ // register `plan review` as a proper subcommand so the catalog
236
+ // and registry agree. The internal dispatch in planParentCommand still
237
+ // works (acts as a fallback for direct invocation), but the canonical
238
+ // wire-up is now explicit.
239
+ registry.registerSubcommand('plan', planReviewCommand);
240
+ // `shrk plan check <path>` validates external plans.
241
+ registry.registerSubcommand('plan', planCheckCommand);
242
+ registry.registerSubcommand('memory', memoryBuildCommand);
243
+ registry.registerSubcommand('memory', memoryReportCommand);
244
+ registry.registerSubcommand('memory', memoryRiskCommand);
245
+ registry.registerSubcommand('memory', memoryFilesCommand);
246
+ registry.registerSubcommand('memory', memoryDiagnosticsCommand);
247
+ registry.registerSubcommand('memory', memoryResetCommand);
248
+ registry.registerSubcommand('memory', memoryDiffCommand);
249
+ registry.registerSubcommand('memory', memoryDriftCommand);
250
+ registry.registerSubcommand('memory', memorySnapshotsCommand);
251
+ registry.register(languagesCommand);
252
+ registry.registerSubcommand('docs', docsCheckCommand);
253
+ registry.registerSubcommand('examples', examplesCheckCommand);
254
+ registry.registerSubcommand('self', selfAuditCommand);
255
+ registry.registerSubcommand('install', installSmokeCommand);
256
+ registry.registerSubcommand('diagnostics', diagnosticsListCommand);
257
+ registry.registerSubcommand('architecture', architectureMapCommand);
258
+ registry.registerSubcommand('architecture', architectureViolationsCommand);
259
+ registry.registerSubcommand('architecture', architectureAreaCommand);
260
+ registry.registerSubcommand('reposet', reposetInitCommand);
261
+ registry.registerSubcommand('reposet', reposetListCommand);
262
+ registry.registerSubcommand('reposet', reposetDoctorCommand);
263
+ registry.registerSubcommand('reposet', reposetMapCommand);
264
+ registry.registerSubcommand('upgrade', upgradeCheckCommand);
265
+ registry.registerSubcommand('upgrade', upgradePlanCommand);
266
+ registry.registerSubcommand('boundaries', boundariesListCommand);
267
+ registry.registerSubcommand('boundaries', boundariesGetCommand);
268
+ registry.registerSubcommand('boundaries', boundariesExplainCommand);
269
+ registry.registerSubcommand('boundaries', boundariesInferCommand);
270
+ registry.registerSubcommand('boundaries', boundariesSuggestCommand);
271
+ registry.registerSubcommand('boundaries', boundariesEnforceCommand);
272
+ registry.registerSubcommand('repo', repoAreasCommand);
273
+ registry.registerSubcommand('policy', policyListCommand);
274
+ registry.registerSubcommand('policy', policyGetCommand);
275
+ registry.registerSubcommand('policy', policyTestCommand);
276
+ registry.registerSubcommand('policy', policyRunCommand);
277
+ registry.registerSubcommand('policy', policyCheckCommand);
278
+ registry.registerSubcommand('policy', policySnapshotCommand);
279
+ registry.registerSubcommand('owners', ownersListCommand);
280
+ registry.registerSubcommand('owners', ownersMatchCommand);
281
+ registry.registerSubcommand('owners', ownersImpactCommand);
282
+ registry.registerSubcommand('ownership', ownershipListCommand);
283
+ registry.registerSubcommand('ownership', ownershipForCommand);
284
+ registry.registerSubcommand('ownership', ownershipAffectedCommand);
285
+ registry.registerSubcommand('runtime', runtimeDoctorCommand);
286
+ registry.registerSubcommand('constructs', constructsListCommand);
287
+ registry.registerSubcommand('constructs', constructsGetCommand);
288
+ registry.registerSubcommand('constructs', constructsTraceCommand);
289
+ registry.registerSubcommand('constructs', constructsApiCommand);
290
+ registry.registerSubcommand('constructs', constructsEventsCommand);
291
+ registry.registerSubcommand('constructs', constructsTokensCommand);
292
+ registry.registerSubcommand('constructs', constructsFacetsCommand);
293
+ registry.registerSubcommand('constructs', constructsSearchCommand);
294
+ registry.registerSubcommand('constructs', constructsInferCommand);
295
+ registry.registerSubcommand('constructs', constructsAdoptCommand);
296
+ registry.registerSubcommand('constructs', constructsImpactCommand);
297
+ registry.registerSubcommand('constructs', constructsRelatedCommand);
298
+ registry.registerSubcommand('constructs', constructsFilesCommand);
299
+ registry.registerSubcommand('playbooks', playbooksListCommand);
300
+ registry.registerSubcommand('playbooks', playbooksGetCommand);
301
+ registry.registerSubcommand('playbooks', playbooksRecommendCommand);
302
+ registry.registerSubcommand('playbooks', playbooksRunbookCommand);
303
+ registry.registerSubcommand('playbooks', playbooksBriefCommand);
304
+ registry.registerSubcommand('playbooks', playbooksScriptCommand);
305
+ registry.registerSubcommand('playbooks', playbooksPreviewCommand);
306
+ registry.registerSubcommand('playbooks', playbooksValidateCommand);
307
+ registry.aliasGroup('construct', 'constructs');
308
+ registry.aliasGroup('playbook', 'playbooks');
309
+ registry.registerSubcommand('tests', testsImpactCommand);
310
+ registry.registerSubcommand('tests', testsSuggestCommand);
311
+ registry.registerSubcommand('tests', testsMissingCommand);
312
+ registry.registerSubcommand('git', gitChangedCommand);
313
+ registry.registerSubcommand('git', gitRootCommand);
314
+ registry.registerSubcommand('git', gitBranchCommand);
315
+ registry.registerSubcommand('git', gitStatusSummaryCommand);
316
+ registry.registerSubcommand('templates', templatesLintCommand);
317
+ registry.registerSubcommand('templates', templatesTestCommand);
318
+ registry.registerSubcommand('templates', templatesSnapshotCommand);
319
+ registry.registerSubcommand('knowledge', knowledgeListCommand);
320
+ registry.registerSubcommand('knowledge', knowledgeGetCommand);
321
+ registry.registerSubcommand('knowledge', knowledgeSearchCommand);
322
+ registry.registerSubcommand('knowledge', knowledgeStaleCheckCommand);
323
+ registry.registerSubcommand('knowledge', knowledgeVerifyCommand);
324
+ registry.registerSubcommand('knowledge', knowledgeReferencesCommand);
325
+ registry.registerSubcommand('knowledge', knowledgeAnchorsCommand);
326
+ registry.registerSubcommand('knowledge', knowledgeRenameSymbolCommand);
327
+ registry.registerSubcommand('knowledge', knowledgeRenameFileCommand);
328
+ registry.registerSubcommand('knowledge', knowledgeUpdateAnchorCommand);
329
+ // knowledge authoring preview surface.
330
+ registry.registerSubcommand('knowledge', knowledgeAddCommand);
331
+ registry.registerSubcommand('knowledge', knowledgeUpdateCommand);
332
+ registry.registerSubcommand('knowledge', knowledgeRemoveCommand);
333
+ registry.registerSubcommand('knowledge', knowledgeLintCommand);
334
+ // propose stub entries for uncovered exports (AST-driven).
335
+ registry.registerSubcommand('knowledge', knowledgeProposeCommand);
336
+ registry.registerSubcommand('rules', rulesListCommand);
337
+ registry.registerSubcommand('rules', rulesGetCommand);
338
+ registry.registerSubcommand('rules', rulesRelevantCommand);
339
+ registry.registerSubcommand('rules', rulesScaffoldCommand);
340
+ // `rules update` thin wrapper over knowledge update.
341
+ registry.registerSubcommand('rules', rulesUpdateCommand);
342
+ // authoring symmetry: rules add / rules remove (parity with knowledge).
343
+ registry.registerSubcommand('rules', rulesAddCommand);
344
+ registry.registerSubcommand('rules', rulesRemoveCommand);
345
+ registry.registerSubcommand('rules', rulesDoctorCommand);
346
+ registry.registerSubcommand('rules', rulesLintCommand);
347
+ // custom checks registry.
348
+ registry.registerSubcommand('checks', checksListCommand);
349
+ registry.registerSubcommand('checks', checksDoctorCommand);
350
+ registry.registerSubcommand('checks', checksRunCommand);
351
+ registry.registerSubcommand('checks', checksParseReportCommand);
352
+ // universal check-result protocol.
353
+ registry.registerSubcommand('checks', checksImportCommand);
354
+ registry.registerSubcommand('checks', checksAggregateCommand);
355
+ registry.registerSubcommand('checks', checksReportCommand);
356
+ registry.registerSubcommand('checks', checksConvertCommand);
357
+ // codemod-assist (NOT a codemod engine).
358
+ registry.register(codemodCommand);
359
+ registry.registerSubcommand('paths', pathsListCommand);
360
+ registry.registerSubcommand('paths', pathsGetCommand);
361
+ registry.registerSubcommand('paths', pathsSearchCommand);
362
+ registry.registerSubcommand('paths', pathsBestCommand);
363
+ registry.registerSubcommand('templates', templatesListCommand);
364
+ registry.registerSubcommand('templates', templatesGetCommand);
365
+ registry.registerSubcommand('templates', templatesSearchCommand);
366
+ registry.registerSubcommand('templates', templatesPreviewCommand);
367
+ registry.registerSubcommand('templates', templatesVarsCommand);
368
+ registry.registerSubcommand('templates', templatesDriftCommand);
369
+ registry.registerSubcommand('templates', templatesVerifyPathsCommand);
370
+ registry.registerSubcommand('templates', templatesSmokeCommand);
371
+ // authoring stack: scaffold / add / doctor.
372
+ registry.registerSubcommand('templates', templatesScaffoldCommand);
373
+ registry.registerSubcommand('templates', templatesAddCommand);
374
+ registry.registerSubcommand('templates', templatesDoctorCommand);
375
+ // authoring parity: update / remove.
376
+ registry.registerSubcommand('templates', templatesUpdateCommand);
377
+ registry.registerSubcommand('templates', templatesRemoveCommand);
378
+ registry.registerSubcommand('pipelines', pipelinesListCommand);
379
+ registry.registerSubcommand('pipelines', pipelinesGetCommand);
380
+ registry.registerSubcommand('pipelines', pipelinesContextCommand);
381
+ registry.registerSubcommand('pipelines', pipelinesPlanCommand);
382
+ registry.registerSubcommand('pipelines', pipelinesScriptCommand);
383
+ registry.registerSubcommand('pipelines', pipelinesNextCommand);
384
+ registry.registerSubcommand('pipelines', pipelinesVarsCommand);
385
+ registry.registerSubcommand('packs', packsListCommand);
386
+ registry.registerSubcommand('packs', packsContributionsCommand);
387
+ registry.registerSubcommand('packs', packsConflictsCommand);
388
+ registry.registerSubcommand('packs', packsSignatureStatusCommand);
389
+ registry.registerSubcommand('packs', packsGetCommand);
390
+ registry.registerSubcommand('packs', packsInspectCommand);
391
+ registry.registerSubcommand('packs', packsDoctorCommand);
392
+ registry.registerSubcommand('packs', packsSignCommand);
393
+ registry.registerSubcommand('packs', packsVerifyCommand);
394
+ registry.registerSubcommand('packs', packsNewCommand);
395
+ registry.registerSubcommand('packs', packsTestCommand);
396
+ registry.registerSubcommand('packs', packsReleaseCheckCommand);
397
+ registry.registerSubcommand('packs', packsCompatCommand);
398
+ registry.registerSubcommand('packs', packsDevStatusCommand);
399
+ registry.registerSubcommand('packs', packsWatchCommand);
400
+ // pack authoring moved to a 3-level group: `shrk pack author <verb>`.
401
+ // The old `pack-author <verb>` shape is gone (no backward-compat shim).
402
+ // `shrk packs pending` survives as a convenience for the pending view.
403
+ registry.registerAt(['pack', 'author', packAuthorStatusCommand.name], packAuthorStatusCommand);
404
+ registry.registerAt(['pack', 'author', packAuthorPreviewCommand.name], packAuthorPreviewCommand);
405
+ registry.registerAt(['pack', 'author', packAuthorPendingCommand.name], packAuthorPendingCommand);
406
+ registry.registerAt(['pack', 'author', packAuthorValidateCommand.name], packAuthorValidateCommand);
407
+ registry.registerSubcommand('packs', packAuthorPendingCommand);
408
+ // provenance ledger CLI.
409
+ registry.registerSubcommand('provenance', provenanceListCommand);
410
+ registry.registerSubcommand('provenance', provenanceShowCommand);
411
+ registry.registerSubcommand('provenance', provenanceReportCommand);
412
+ // missing / doctor verbs.
413
+ registry.registerSubcommand('provenance', provenanceMissingCommand);
414
+ registry.registerSubcommand('provenance', provenanceDoctorCommand);
415
+ registry.registerSubcommand('schemas', schemasListCommand);
416
+ registry.registerSubcommand('schemas', schemasGetCommand);
417
+ registry.registerSubcommand('schemas', schemasInventoryCommand);
418
+ registry.registerSubcommand('schemas', schemasWriteCommand);
419
+ // preview-first emission + preflight drift check.
420
+ registry.registerSubcommand('schemas', schemasEmitCommand);
421
+ registry.registerSubcommand('scaffolds', scaffoldsListCommand);
422
+ registry.registerSubcommand('scaffolds', scaffoldsGetCommand);
423
+ registry.registerSubcommand('scaffolds', scaffoldsDoctorCommand);
424
+ registry.registerSubcommand('presets', presetsListCommand);
425
+ registry.registerSubcommand('presets', presetsGetCommand);
426
+ registry.registerSubcommand('presets', presetsExplainCommand);
427
+ registry.registerSubcommand('presets', presetsRecommendCommand);
428
+ registry.registerSubcommand('presets', presetsPreviewCommand);
429
+ registry.registerSubcommand('presets', presetsApplyCommand);
430
+ registry.registerSubcommand('presets', presetsDoctorCommand);
431
+ registry.registerSubcommand('presets', presetsDiffCommand);
432
+ registry.registerSubcommand('presets', presetsPatchCommand);
433
+ // release subcommand additions — register under 'release' group via 'train'.
434
+ // We pass 'train' as the canonical name; users invoke `shrk release train <verb>`.
435
+ // Convenience aliases so users can say either form.
436
+ registry.aliasGroup('pipeline', 'pipelines');
437
+ registry.aliasGroup('schema', 'schemas');
438
+ registry.aliasGroup('preset', 'presets');
439
+ registry.aliasGroup('scaffold', 'scaffolds');
440
+ const help = makeHelpCommand(registry);
441
+ registry.register(help);
442
+ return registry;
443
+ }
444
+ export async function runCli(argv) {
445
+ const usageStart = performance.now();
446
+ const { cwd: probeCwd, rest: probeArgv } = extractGlobalCwd(argv);
447
+ let exitCode = 0;
448
+ try {
449
+ exitCode = await runCliInner(argv);
450
+ return exitCode;
451
+ }
452
+ finally {
453
+ // append one local usage entry. Failure is silent.
454
+ try {
455
+ const command = extractCommandPath(probeArgv);
456
+ if (command.length > 0) {
457
+ const flags = sanitizeFlagNames(probeArgv);
458
+ const enabled = await isUsageEnabled(probeCwd ?? process.cwd());
459
+ recordUsage({
460
+ cwd: probeCwd ?? process.cwd(),
461
+ command,
462
+ exitCode,
463
+ durationMs: performance.now() - usageStart,
464
+ flags,
465
+ enabled,
466
+ });
467
+ }
468
+ }
469
+ catch {
470
+ // ignore — usage log must never fail the CLI
471
+ }
472
+ }
473
+ }
474
+ /**
475
+ * Resolve whether the local usage log is enabled. Order:
476
+ * 1. `SHARKCRAFT_USAGE_DISABLED=1` env → false (disabled).
477
+ * 2. `sharkcraft.config.ts usage.enabled === false` → false.
478
+ * 3. Otherwise → true.
479
+ */
480
+ async function isUsageEnabled(cwd) {
481
+ if (process.env.SHARKCRAFT_USAGE_DISABLED === '1')
482
+ return false;
483
+ try {
484
+ const result = await loadProjectConfig(cwd);
485
+ if (!result.ok)
486
+ return true;
487
+ return result.value.config.usage?.enabled !== false;
488
+ }
489
+ catch {
490
+ return true;
491
+ }
492
+ }
493
+ async function runCliInner(argv) {
494
+ const registry = buildRegistry();
495
+ // Pre-parse the global --cwd so it can appear anywhere (incl. before the command).
496
+ const { cwd: globalCwd, rest: cleanArgv } = extractGlobalCwd(argv);
497
+ const [first] = cleanArgv;
498
+ // bare invocation lands on the curated tiered view.
499
+ if (!first) {
500
+ const landing = await renderNoArgsLanding(globalCwd ?? process.cwd());
501
+ process.stdout.write(landing);
502
+ return 0;
503
+ }
504
+ // Top-level meta flags.
505
+ if (first === '--help' || first === '-h') {
506
+ return registry.get('help').run(parseArgs([], { globalCwd }));
507
+ }
508
+ if (first === '--full-help') {
509
+ return registry.get('help').run(parseArgs(['--full'], { globalCwd }));
510
+ }
511
+ if (first === '--version' || first === '-v') {
512
+ return registry.get('version').run(parseArgs([], { globalCwd }));
513
+ }
514
+ // `shrk --about` prints the in-binary philosophy summary.
515
+ if (first === '--about') {
516
+ process.stdout.write(renderAbout());
517
+ return 0;
518
+ }
519
+ // greedy trie descent. Handles 1-, 2-, and 3-level commands uniformly
520
+ // (`shrk doctor`, `shrk packs list`, `shrk pack author status`). The
521
+ // resolver stops when it hits a flag or a token that isn't a child of the
522
+ // current node, returning the deepest handler + the leftover tokens.
523
+ const { handler, matchedPath, rest: leftover, node } = registry.resolve(cleanArgv);
524
+ // `--help` / `-h` immediately after a (sub)group → render help for that
525
+ // path. This works at any depth.
526
+ if (leftover[0] === '--help' || leftover[0] === '-h') {
527
+ return registry.get('help').run(parseArgs([matchedPath.join(' ')], { globalCwd }));
528
+ }
529
+ if (handler) {
530
+ // gate experimental commands. Bootstrap commands and core/extended
531
+ // tiers pass through; experimental commands return the structured
532
+ // not-enabled error unless `surface.enabled[]` contains them.
533
+ const gateReason = await checkSurfaceGate(matchedPath, globalCwd ?? process.cwd());
534
+ if (gateReason) {
535
+ const err = makeSurfaceNotEnabledError(gateReason.command, { reason: gateReason.detail });
536
+ process.stderr.write(renderSurfaceNotEnabledText(err));
537
+ return SURFACE_NOT_ENABLED_EXIT_CODE;
538
+ }
539
+ return await handler.run(parseArgs(leftover, { globalCwd }));
540
+ }
541
+ // No handler at the deepest match. If we landed on a group node (has
542
+ // children), show that group's help so the user discovers the verbs.
543
+ if (matchedPath.length > 0 && node.children.size > 0) {
544
+ return registry.get('help').run(parseArgs([matchedPath.join(' ')], { globalCwd }));
545
+ }
546
+ // Genuinely unknown — fall back to free-form / did-you-mean.
547
+ const probe = cleanArgv.filter((t) => typeof t === 'string' && t.length > 0 && !t.startsWith('-'));
548
+ if (looksLikeFreeFormTask(probe)) {
549
+ printFreeFormTaskHint(probe.join(' '));
550
+ return 2;
551
+ }
552
+ const attempted = probe.slice(0, 2).join(' ');
553
+ process.stderr.write(`Unknown command: ${attempted}\n`);
554
+ printDidYouMean(attempted);
555
+ return 2;
556
+ }
557
+ /**
558
+ * Heuristic for "this looks like a task, not a command".
559
+ *
560
+ * - At least two non-flag tokens (commands have at most two tokens: a
561
+ * top-level + a subcommand verb).
562
+ * - Or one token that matches a known free-form verb (rename / add / fix /
563
+ * refactor / remove / migrate / implement / update / build / …).
564
+ * - Never matches `--`-prefixed flag tokens.
565
+ *
566
+ * The function is deterministic and accepts only positional tokens.
567
+ * Exported for tests.
568
+ */
569
+ export function looksLikeFreeFormTask(tokens) {
570
+ const clean = tokens.filter((t) => t.length > 0 && !t.startsWith('-'));
571
+ if (clean.length < 2)
572
+ return false;
573
+ // 3+ tokens is almost always a sentence, not a command — `shrk` only has
574
+ // 2 levels (top + sub), so anything beyond that has no chance of being a
575
+ // real path.
576
+ if (clean.length >= 3)
577
+ return true;
578
+ // 2 tokens: only treat as a task if the first token is a recognisable
579
+ // task verb. Otherwise it's plausibly a typo of a subcommand and we let
580
+ // the regular did-you-mean handle it.
581
+ const verbs = new Set([
582
+ 'rename',
583
+ 'add',
584
+ 'fix',
585
+ 'refactor',
586
+ 'remove',
587
+ 'delete',
588
+ 'migrate',
589
+ 'wire',
590
+ 'create',
591
+ 'implement',
592
+ 'update',
593
+ 'introduce',
594
+ 'build',
595
+ 'extract',
596
+ 'move',
597
+ 'inline',
598
+ 'generate',
599
+ 'scaffold',
600
+ 'explain',
601
+ 'document',
602
+ 'review',
603
+ 'test',
604
+ 'design',
605
+ 'refresh',
606
+ 'reorganise',
607
+ 'reorganize',
608
+ 'restructure',
609
+ 'split',
610
+ 'merge',
611
+ 'reduce',
612
+ 'simplify',
613
+ ]);
614
+ return verbs.has(clean[0].toLowerCase());
615
+ }
616
+ function printFreeFormTaskHint(task) {
617
+ process.stderr.write(`\nThis looks like a task, not a command.\n` +
618
+ `\n` +
619
+ `Recommended:\n` +
620
+ ` $ shrk recommend "${task}"\n` +
621
+ `\n` +
622
+ `Why:\n` +
623
+ ` \`shrk recommend\` is the canonical human entrypoint for "what should I do?".\n` +
624
+ `\n` +
625
+ `More detail:\n` +
626
+ ` $ shrk start-here\n` +
627
+ ` $ shrk commands\n`);
628
+ }
629
+ /**
630
+ * Check whether the resolved command path is gated by the
631
+ * surface tier model. Returns `null` if the command is callable
632
+ * (core/extended), or `{ command, detail }` if it is an experimental
633
+ * command not enabled in the current repo's surface config.
634
+ *
635
+ * Failure-soft: any error loading the inspection (fresh repo, no
636
+ * config, etc.) lets the command through. The gate must NEVER false-
637
+ * positive a bootstrap call — the bootstrap set in `tier.ts` plus
638
+ * spine-derived core commands always pass through cleanly.
639
+ */
640
+ async function checkSurfaceGate(matchedPath, cwd) {
641
+ const candidate = matchedPath.join(' ');
642
+ if (candidate.length === 0)
643
+ return null;
644
+ try {
645
+ const { context } = await loadSurfaceContext({ cwd });
646
+ const summary = buildSurfaceSummary(context);
647
+ // Try the full path first; fall back to the top-level token. The
648
+ // catalog uses both shapes ("doctor" and "plan review").
649
+ const view = findCommandInSummary(summary, candidate) ??
650
+ findCommandInSummary(summary, matchedPath[0] ?? '');
651
+ if (!view)
652
+ return null;
653
+ if (view.callable)
654
+ return null;
655
+ return { command: view.command, detail: view.detail };
656
+ }
657
+ catch {
658
+ return null;
659
+ }
660
+ }
661
+ function printDidYouMean(attempted) {
662
+ const candidates = suggestDidYouMean(COMMAND_CATALOG, [attempted], 3);
663
+ if (candidates.length === 0) {
664
+ process.stderr.write("Tip: run `shrk commands suggest \"<partial>\"` or `shrk help` to discover commands.\n");
665
+ const footer = errorFooterFor('unknown-command', { task: attempted });
666
+ if (footer)
667
+ process.stderr.write(renderErrorFooter(footer));
668
+ return;
669
+ }
670
+ process.stderr.write('Did you mean:\n');
671
+ for (const c of candidates) {
672
+ process.stderr.write(` shrk ${c.command} — ${c.description}\n`);
673
+ }
674
+ // append the standardised next-command footer so the user
675
+ // always has a deterministic exit route.
676
+ const footer = errorFooterFor('unknown-command', { task: attempted });
677
+ if (footer)
678
+ process.stderr.write(renderErrorFooter(footer));
679
+ }
680
+ // Entry point when invoked directly.
681
+ //
682
+ // Bun exposes `import.meta.main`; Node does not. When Node runs the
683
+ // compiled `dist/main.js` directly the path-suffix check (`main.js`)
684
+ // catches it. The npm bin shim points at `shrk` so that suffix also
685
+ // triggers it. Source dev under Bun still runs via `main.ts`.
686
+ const isMain = typeof import.meta !== 'undefined' && import.meta.main === true;
687
+ const entryPath = process.argv[1] ?? '';
688
+ if (isMain ||
689
+ entryPath.endsWith('main.ts') ||
690
+ entryPath.endsWith('main.js') ||
691
+ entryPath.endsWith('shrk') ||
692
+ entryPath.endsWith('shrk.js') ||
693
+ entryPath.endsWith('shrk.cmd')) {
694
+ const argv = process.argv.slice(2);
695
+ runCli(argv).then((code) => process.exit(code), (err) => {
696
+ process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}\n`);
697
+ process.exit(1);
698
+ });
699
+ }