@paths.design/caws-cli 10.2.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/README.md +125 -374
  2. package/dist/index.js +45 -787
  3. package/dist/init/harness-detect.d.ts +18 -0
  4. package/dist/init/harness-detect.d.ts.map +1 -0
  5. package/dist/init/harness-detect.js +90 -0
  6. package/dist/init/harness-detect.js.map +1 -0
  7. package/dist/init/hook-install.d.ts +53 -0
  8. package/dist/init/hook-install.d.ts.map +1 -0
  9. package/dist/init/hook-install.js +421 -0
  10. package/dist/init/hook-install.js.map +1 -0
  11. package/dist/init/hook-packs/manifest-claude-code.d.ts +4 -0
  12. package/dist/init/hook-packs/manifest-claude-code.d.ts.map +1 -0
  13. package/dist/init/hook-packs/manifest-claude-code.js +190 -0
  14. package/dist/init/hook-packs/manifest-claude-code.js.map +1 -0
  15. package/dist/init/hook-packs/register.d.ts +19 -0
  16. package/dist/init/hook-packs/register.d.ts.map +1 -0
  17. package/dist/init/hook-packs/register.js +37 -0
  18. package/dist/init/hook-packs/register.js.map +1 -0
  19. package/dist/init/hook-packs/types.d.ts +123 -0
  20. package/dist/init/hook-packs/types.d.ts.map +1 -0
  21. package/dist/init/hook-packs/types.js +29 -0
  22. package/dist/init/hook-packs/types.js.map +1 -0
  23. package/dist/shell/binding/resolve-binding.d.ts +4 -0
  24. package/dist/shell/binding/resolve-binding.d.ts.map +1 -0
  25. package/dist/shell/binding/resolve-binding.js +228 -0
  26. package/dist/shell/binding/resolve-binding.js.map +1 -0
  27. package/dist/shell/binding/types.d.ts +42 -0
  28. package/dist/shell/binding/types.d.ts.map +1 -0
  29. package/dist/shell/binding/types.js +21 -0
  30. package/dist/shell/binding/types.js.map +1 -0
  31. package/dist/shell/commands/claim.d.ts +14 -0
  32. package/dist/shell/commands/claim.d.ts.map +1 -0
  33. package/dist/shell/commands/claim.js +197 -0
  34. package/dist/shell/commands/claim.js.map +1 -0
  35. package/dist/shell/commands/doctor.d.ts +13 -0
  36. package/dist/shell/commands/doctor.d.ts.map +1 -0
  37. package/dist/shell/commands/doctor.js +97 -0
  38. package/dist/shell/commands/doctor.js.map +1 -0
  39. package/dist/shell/commands/evidence.d.ts +28 -0
  40. package/dist/shell/commands/evidence.d.ts.map +1 -0
  41. package/dist/shell/commands/evidence.js +166 -0
  42. package/dist/shell/commands/evidence.js.map +1 -0
  43. package/dist/shell/commands/gates.d.ts +19 -0
  44. package/dist/shell/commands/gates.d.ts.map +1 -0
  45. package/dist/shell/commands/gates.js +208 -0
  46. package/dist/shell/commands/gates.js.map +1 -0
  47. package/dist/shell/commands/init.d.ts +17 -0
  48. package/dist/shell/commands/init.d.ts.map +1 -0
  49. package/dist/shell/commands/init.js +168 -0
  50. package/dist/shell/commands/init.js.map +1 -0
  51. package/dist/shell/commands/scope.d.ts +11 -0
  52. package/dist/shell/commands/scope.d.ts.map +1 -0
  53. package/dist/shell/commands/scope.js +92 -0
  54. package/dist/shell/commands/scope.js.map +1 -0
  55. package/dist/shell/commands/specs.d.ts +41 -0
  56. package/dist/shell/commands/specs.d.ts.map +1 -0
  57. package/dist/shell/commands/specs.js +264 -0
  58. package/dist/shell/commands/specs.js.map +1 -0
  59. package/dist/shell/commands/status.d.ts +15 -0
  60. package/dist/shell/commands/status.d.ts.map +1 -0
  61. package/dist/shell/commands/status.js +106 -0
  62. package/dist/shell/commands/status.js.map +1 -0
  63. package/dist/shell/commands/waiver.d.ts +38 -0
  64. package/dist/shell/commands/waiver.d.ts.map +1 -0
  65. package/dist/shell/commands/waiver.js +240 -0
  66. package/dist/shell/commands/waiver.js.map +1 -0
  67. package/dist/shell/commands/worktree.d.ts +38 -0
  68. package/dist/shell/commands/worktree.d.ts.map +1 -0
  69. package/dist/shell/commands/worktree.js +286 -0
  70. package/dist/shell/commands/worktree.js.map +1 -0
  71. package/dist/shell/gates/disposition.d.ts +23 -0
  72. package/dist/shell/gates/disposition.d.ts.map +1 -0
  73. package/dist/shell/gates/disposition.js +117 -0
  74. package/dist/shell/gates/disposition.js.map +1 -0
  75. package/dist/shell/gates/gate-result-contract.d.ts +39 -0
  76. package/dist/shell/gates/gate-result-contract.d.ts.map +1 -0
  77. package/dist/shell/gates/gate-result-contract.js +150 -0
  78. package/dist/shell/gates/gate-result-contract.js.map +1 -0
  79. package/dist/shell/gates/local-evaluators/budget-limit.d.ts +24 -0
  80. package/dist/shell/gates/local-evaluators/budget-limit.d.ts.map +1 -0
  81. package/dist/shell/gates/local-evaluators/budget-limit.js +67 -0
  82. package/dist/shell/gates/local-evaluators/budget-limit.js.map +1 -0
  83. package/dist/shell/gates/local-evaluators/diff-helpers.d.ts +25 -0
  84. package/dist/shell/gates/local-evaluators/diff-helpers.d.ts.map +1 -0
  85. package/dist/shell/gates/local-evaluators/diff-helpers.js +74 -0
  86. package/dist/shell/gates/local-evaluators/diff-helpers.js.map +1 -0
  87. package/dist/shell/gates/local-evaluators/index.d.ts +28 -0
  88. package/dist/shell/gates/local-evaluators/index.d.ts.map +1 -0
  89. package/dist/shell/gates/local-evaluators/index.js +67 -0
  90. package/dist/shell/gates/local-evaluators/index.js.map +1 -0
  91. package/dist/shell/gates/local-evaluators/scope-boundary.d.ts +23 -0
  92. package/dist/shell/gates/local-evaluators/scope-boundary.d.ts.map +1 -0
  93. package/dist/shell/gates/local-evaluators/scope-boundary.js +67 -0
  94. package/dist/shell/gates/local-evaluators/scope-boundary.js.map +1 -0
  95. package/dist/shell/gates/local-evaluators/spec-completeness.d.ts +12 -0
  96. package/dist/shell/gates/local-evaluators/spec-completeness.d.ts.map +1 -0
  97. package/dist/shell/gates/local-evaluators/spec-completeness.js +73 -0
  98. package/dist/shell/gates/local-evaluators/spec-completeness.js.map +1 -0
  99. package/dist/shell/gates/quality-gates-adapter.d.ts +55 -0
  100. package/dist/shell/gates/quality-gates-adapter.d.ts.map +1 -0
  101. package/dist/shell/gates/quality-gates-adapter.js +161 -0
  102. package/dist/shell/gates/quality-gates-adapter.js.map +1 -0
  103. package/dist/shell/gates/waiver-filter.d.ts +58 -0
  104. package/dist/shell/gates/waiver-filter.d.ts.map +1 -0
  105. package/dist/shell/gates/waiver-filter.js +119 -0
  106. package/dist/shell/gates/waiver-filter.js.map +1 -0
  107. package/dist/shell/index.d.ts +54 -0
  108. package/dist/shell/index.d.ts.map +1 -0
  109. package/dist/shell/index.js +85 -0
  110. package/dist/shell/index.js.map +1 -0
  111. package/dist/shell/register.d.ts +11 -0
  112. package/dist/shell/register.d.ts.map +1 -0
  113. package/dist/shell/register.js +464 -0
  114. package/dist/shell/register.js.map +1 -0
  115. package/dist/shell/render/claim.d.ts +22 -0
  116. package/dist/shell/render/claim.d.ts.map +1 -0
  117. package/dist/shell/render/claim.js +75 -0
  118. package/dist/shell/render/claim.js.map +1 -0
  119. package/dist/shell/render/decision.d.ts +15 -0
  120. package/dist/shell/render/decision.d.ts.map +1 -0
  121. package/dist/shell/render/decision.js +66 -0
  122. package/dist/shell/render/decision.js.map +1 -0
  123. package/dist/shell/render/diagnostic.d.ts +19 -0
  124. package/dist/shell/render/diagnostic.d.ts.map +1 -0
  125. package/dist/shell/render/diagnostic.js +76 -0
  126. package/dist/shell/render/diagnostic.js.map +1 -0
  127. package/dist/shell/render/finding.d.ts +15 -0
  128. package/dist/shell/render/finding.d.ts.map +1 -0
  129. package/dist/shell/render/finding.js +57 -0
  130. package/dist/shell/render/finding.js.map +1 -0
  131. package/dist/shell/render/gates.d.ts +3 -0
  132. package/dist/shell/render/gates.d.ts.map +1 -0
  133. package/dist/shell/render/gates.js +56 -0
  134. package/dist/shell/render/gates.js.map +1 -0
  135. package/dist/shell/render/init-hook-pack.d.ts +16 -0
  136. package/dist/shell/render/init-hook-pack.d.ts.map +1 -0
  137. package/dist/shell/render/init-hook-pack.js +206 -0
  138. package/dist/shell/render/init-hook-pack.js.map +1 -0
  139. package/dist/shell/render/init.d.ts +11 -0
  140. package/dist/shell/render/init.d.ts.map +1 -0
  141. package/dist/shell/render/init.js +32 -0
  142. package/dist/shell/render/init.js.map +1 -0
  143. package/dist/shell/render/status.d.ts +26 -0
  144. package/dist/shell/render/status.d.ts.map +1 -0
  145. package/dist/shell/render/status.js +143 -0
  146. package/dist/shell/render/status.js.map +1 -0
  147. package/dist/shell/render/waiver.d.ts +21 -0
  148. package/dist/shell/render/waiver.d.ts.map +1 -0
  149. package/dist/shell/render/waiver.js +94 -0
  150. package/dist/shell/render/waiver.js.map +1 -0
  151. package/dist/shell/rules.d.ts +37 -0
  152. package/dist/shell/rules.d.ts.map +1 -0
  153. package/dist/shell/rules.js +51 -0
  154. package/dist/shell/rules.js.map +1 -0
  155. package/dist/shell/session/actor.d.ts +14 -0
  156. package/dist/shell/session/actor.d.ts.map +1 -0
  157. package/dist/shell/session/actor.js +34 -0
  158. package/dist/shell/session/actor.js.map +1 -0
  159. package/dist/shell/session/resolve-session.d.ts +5 -0
  160. package/dist/shell/session/resolve-session.d.ts.map +1 -0
  161. package/dist/shell/session/resolve-session.js +239 -0
  162. package/dist/shell/session/resolve-session.js.map +1 -0
  163. package/dist/shell/session/types.d.ts +56 -0
  164. package/dist/shell/session/types.d.ts.map +1 -0
  165. package/dist/shell/session/types.js +15 -0
  166. package/dist/shell/session/types.js.map +1 -0
  167. package/dist/store/agents-store.d.ts +3 -0
  168. package/dist/store/agents-store.d.ts.map +1 -0
  169. package/dist/store/agents-store.js +63 -0
  170. package/dist/store/agents-store.js.map +1 -0
  171. package/dist/store/apply-patch.d.ts +16 -0
  172. package/dist/store/apply-patch.d.ts.map +1 -0
  173. package/dist/store/apply-patch.js +191 -0
  174. package/dist/store/apply-patch.js.map +1 -0
  175. package/dist/store/atomic-write.d.ts +34 -0
  176. package/dist/store/atomic-write.d.ts.map +1 -0
  177. package/dist/store/atomic-write.js +174 -0
  178. package/dist/store/atomic-write.js.map +1 -0
  179. package/dist/store/doctor-snapshot.d.ts +20 -0
  180. package/dist/store/doctor-snapshot.d.ts.map +1 -0
  181. package/dist/store/doctor-snapshot.js +176 -0
  182. package/dist/store/doctor-snapshot.js.map +1 -0
  183. package/dist/store/events-store.d.ts +33 -0
  184. package/dist/store/events-store.d.ts.map +1 -0
  185. package/dist/store/events-store.js +297 -0
  186. package/dist/store/events-store.js.map +1 -0
  187. package/dist/store/index.d.ts +21 -0
  188. package/dist/store/index.d.ts.map +1 -0
  189. package/dist/store/index.js +47 -0
  190. package/dist/store/index.js.map +1 -0
  191. package/dist/store/init-store.d.ts +21 -0
  192. package/dist/store/init-store.d.ts.map +1 -0
  193. package/dist/store/init-store.js +295 -0
  194. package/dist/store/init-store.js.map +1 -0
  195. package/dist/store/json-store.d.ts +3 -0
  196. package/dist/store/json-store.d.ts.map +1 -0
  197. package/dist/store/json-store.js +65 -0
  198. package/dist/store/json-store.js.map +1 -0
  199. package/dist/store/lifecycle-lock.d.ts +34 -0
  200. package/dist/store/lifecycle-lock.d.ts.map +1 -0
  201. package/dist/store/lifecycle-lock.js +168 -0
  202. package/dist/store/lifecycle-lock.js.map +1 -0
  203. package/dist/store/lifecycle-transaction.d.ts +79 -0
  204. package/dist/store/lifecycle-transaction.d.ts.map +1 -0
  205. package/dist/store/lifecycle-transaction.js +319 -0
  206. package/dist/store/lifecycle-transaction.js.map +1 -0
  207. package/dist/store/policy-store.d.ts +3 -0
  208. package/dist/store/policy-store.d.ts.map +1 -0
  209. package/dist/store/policy-store.js +65 -0
  210. package/dist/store/policy-store.js.map +1 -0
  211. package/dist/store/repo-root.d.ts +46 -0
  212. package/dist/store/repo-root.d.ts.map +1 -0
  213. package/dist/store/repo-root.js +145 -0
  214. package/dist/store/repo-root.js.map +1 -0
  215. package/dist/store/rules.d.ts +69 -0
  216. package/dist/store/rules.d.ts.map +1 -0
  217. package/dist/store/rules.js +95 -0
  218. package/dist/store/rules.js.map +1 -0
  219. package/dist/store/specs-store.d.ts +3 -0
  220. package/dist/store/specs-store.d.ts.map +1 -0
  221. package/dist/store/specs-store.js +131 -0
  222. package/dist/store/specs-store.js.map +1 -0
  223. package/dist/store/specs-writer.d.ts +61 -0
  224. package/dist/store/specs-writer.d.ts.map +1 -0
  225. package/dist/store/specs-writer.js +506 -0
  226. package/dist/store/specs-writer.js.map +1 -0
  227. package/dist/store/types.d.ts +84 -0
  228. package/dist/store/types.d.ts.map +1 -0
  229. package/dist/store/types.js +14 -0
  230. package/dist/store/types.js.map +1 -0
  231. package/dist/store/waivers-store.d.ts +25 -0
  232. package/dist/store/waivers-store.d.ts.map +1 -0
  233. package/dist/store/waivers-store.js +232 -0
  234. package/dist/store/waivers-store.js.map +1 -0
  235. package/dist/store/worktrees-store.d.ts +3 -0
  236. package/dist/store/worktrees-store.d.ts.map +1 -0
  237. package/dist/store/worktrees-store.js +62 -0
  238. package/dist/store/worktrees-store.js.map +1 -0
  239. package/dist/store/worktrees-writer.d.ts +77 -0
  240. package/dist/store/worktrees-writer.d.ts.map +1 -0
  241. package/dist/store/worktrees-writer.js +674 -0
  242. package/dist/store/worktrees-writer.js.map +1 -0
  243. package/dist/store/yaml-patch.d.ts +7 -0
  244. package/dist/store/yaml-patch.d.ts.map +1 -0
  245. package/dist/store/yaml-patch.js +250 -0
  246. package/dist/store/yaml-patch.js.map +1 -0
  247. package/dist/store/yaml-store.d.ts +9 -0
  248. package/dist/store/yaml-store.d.ts.map +1 -0
  249. package/dist/store/yaml-store.js +121 -0
  250. package/dist/store/yaml-store.js.map +1 -0
  251. package/package.json +15 -13
  252. package/dist/budget-derivation.js +0 -751
  253. package/dist/cicd-optimizer.js +0 -504
  254. package/dist/commands/agents.js +0 -124
  255. package/dist/commands/archive.js +0 -500
  256. package/dist/commands/burnup.js +0 -198
  257. package/dist/commands/diagnose.js +0 -525
  258. package/dist/commands/evaluate.js +0 -314
  259. package/dist/commands/gates.js +0 -149
  260. package/dist/commands/init.js +0 -857
  261. package/dist/commands/iterate.js +0 -417
  262. package/dist/commands/mode.js +0 -269
  263. package/dist/commands/parallel.js +0 -242
  264. package/dist/commands/plan.js +0 -438
  265. package/dist/commands/provenance.js +0 -1143
  266. package/dist/commands/quality-monitor.js +0 -284
  267. package/dist/commands/scope.js +0 -264
  268. package/dist/commands/session.js +0 -312
  269. package/dist/commands/sidecar.js +0 -74
  270. package/dist/commands/specs.js +0 -1656
  271. package/dist/commands/status.js +0 -1172
  272. package/dist/commands/templates.js +0 -237
  273. package/dist/commands/tool.js +0 -136
  274. package/dist/commands/tutorial.js +0 -480
  275. package/dist/commands/validate.js +0 -357
  276. package/dist/commands/verify-acs.js +0 -443
  277. package/dist/commands/waivers.js +0 -599
  278. package/dist/commands/workflow.js +0 -243
  279. package/dist/commands/worktree.js +0 -502
  280. package/dist/config/lite-scope.js +0 -158
  281. package/dist/config/modes.js +0 -347
  282. package/dist/constants/spec-types.js +0 -65
  283. package/dist/gates/budget-limit.js +0 -121
  284. package/dist/gates/feedback.js +0 -260
  285. package/dist/gates/format.js +0 -179
  286. package/dist/gates/god-object.js +0 -117
  287. package/dist/gates/pipeline.js +0 -167
  288. package/dist/gates/scope-boundary.js +0 -112
  289. package/dist/gates/spec-completeness.js +0 -109
  290. package/dist/gates/todo-detection.js +0 -205
  291. package/dist/generators/jest-config-generator.js +0 -242
  292. package/dist/generators/working-spec.js +0 -237
  293. package/dist/minimal-cli.js +0 -88
  294. package/dist/parallel/parallel-manager.js +0 -433
  295. package/dist/policy/PolicyManager.js +0 -470
  296. package/dist/scaffold/claude-hooks.js +0 -443
  297. package/dist/scaffold/cursor-hooks.js +0 -177
  298. package/dist/scaffold/git-hooks.js +0 -928
  299. package/dist/scaffold/index.js +0 -794
  300. package/dist/session/session-manager.js +0 -653
  301. package/dist/sidecars/index.js +0 -33
  302. package/dist/sidecars/listeners.js +0 -40
  303. package/dist/sidecars/provenance-summary.js +0 -238
  304. package/dist/sidecars/quality-gaps.js +0 -258
  305. package/dist/sidecars/schema.js +0 -149
  306. package/dist/sidecars/spec-drift.js +0 -151
  307. package/dist/sidecars/waiver-draft.js +0 -176
  308. package/dist/spec/SpecFileManager.js +0 -419
  309. package/dist/templates/.caws/schemas/policy.schema.json +0 -117
  310. package/dist/templates/.caws/schemas/scope.schema.json +0 -52
  311. package/dist/templates/.caws/schemas/waivers.schema.json +0 -106
  312. package/dist/templates/.caws/schemas/working-spec.schema.json +0 -340
  313. package/dist/templates/.caws/schemas/worktrees.schema.json +0 -38
  314. package/dist/templates/.caws/templates/working-spec.template.yml +0 -80
  315. package/dist/templates/.caws/tools/README.md +0 -18
  316. package/dist/templates/.caws/tools/scope-guard.js +0 -203
  317. package/dist/templates/.caws/tools-allow.json +0 -331
  318. package/dist/templates/.caws/waivers.yml +0 -19
  319. package/dist/templates/.claude/README.md +0 -190
  320. package/dist/templates/.claude/hooks/audit.sh +0 -121
  321. package/dist/templates/.claude/hooks/block-dangerous.sh +0 -203
  322. package/dist/templates/.claude/hooks/classify_command.py +0 -592
  323. package/dist/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
  324. package/dist/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
  325. package/dist/templates/.claude/hooks/naming-check.sh +0 -100
  326. package/dist/templates/.claude/hooks/protected-paths.sh +0 -39
  327. package/dist/templates/.claude/hooks/quality-check.sh +0 -81
  328. package/dist/templates/.claude/hooks/scan-secrets.sh +0 -85
  329. package/dist/templates/.claude/hooks/scope-guard.sh +0 -381
  330. package/dist/templates/.claude/hooks/session-caws-status.sh +0 -117
  331. package/dist/templates/.claude/hooks/session-log.sh +0 -634
  332. package/dist/templates/.claude/hooks/simplification-guard.sh +0 -92
  333. package/dist/templates/.claude/hooks/stop-worktree-check.sh +0 -46
  334. package/dist/templates/.claude/hooks/test_classify_command.py +0 -370
  335. package/dist/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
  336. package/dist/templates/.claude/hooks/validate-spec.sh +0 -76
  337. package/dist/templates/.claude/hooks/worktree-guard.sh +0 -220
  338. package/dist/templates/.claude/hooks/worktree-write-guard.sh +0 -190
  339. package/dist/templates/.claude/rules/git-safety.md +0 -26
  340. package/dist/templates/.claude/rules/worktree-isolation.md +0 -101
  341. package/dist/templates/.claude/settings.json +0 -141
  342. package/dist/templates/.cursor/README.md +0 -299
  343. package/dist/templates/.cursor/hooks/audit.sh +0 -55
  344. package/dist/templates/.cursor/hooks/block-dangerous.sh +0 -84
  345. package/dist/templates/.cursor/hooks/caws-quality-check.sh +0 -52
  346. package/dist/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
  347. package/dist/templates/.cursor/hooks/format.sh +0 -38
  348. package/dist/templates/.cursor/hooks/naming-check.sh +0 -64
  349. package/dist/templates/.cursor/hooks/scan-secrets.sh +0 -51
  350. package/dist/templates/.cursor/hooks/scope-guard.sh +0 -52
  351. package/dist/templates/.cursor/hooks/session-log.sh +0 -924
  352. package/dist/templates/.cursor/hooks/validate-spec.sh +0 -83
  353. package/dist/templates/.cursor/hooks.json +0 -76
  354. package/dist/templates/.cursor/rules/00-claims-verification.mdc +0 -144
  355. package/dist/templates/.cursor/rules/01-working-style.mdc +0 -50
  356. package/dist/templates/.cursor/rules/02-quality-gates.mdc +0 -368
  357. package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
  358. package/dist/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
  359. package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
  360. package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
  361. package/dist/templates/.cursor/rules/07-process-ops.mdc +0 -20
  362. package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
  363. package/dist/templates/.cursor/rules/09-docstrings.mdc +0 -89
  364. package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
  365. package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
  366. package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
  367. package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
  368. package/dist/templates/.cursor/rules/README.md +0 -148
  369. package/dist/templates/.github/copilot-instructions.md +0 -82
  370. package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
  371. package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
  372. package/dist/templates/.junie/guidelines.md +0 -73
  373. package/dist/templates/.vscode/launch.json +0 -17
  374. package/dist/templates/.vscode/settings.json +0 -95
  375. package/dist/templates/.windsurf/rules/caws-quality-standards.md +0 -54
  376. package/dist/templates/.windsurf/workflows/caws-guided-development.md +0 -92
  377. package/dist/templates/CLAUDE.md +0 -196
  378. package/dist/templates/COMMIT_CONVENTIONS.md +0 -86
  379. package/dist/templates/OIDC_SETUP.md +0 -300
  380. package/dist/templates/agents.md +0 -171
  381. package/dist/templates/codemod/README.md +0 -1
  382. package/dist/templates/codemod/test.js +0 -93
  383. package/dist/templates/docs/README.md +0 -151
  384. package/dist/templates/scripts/new_feature.sh +0 -80
  385. package/dist/templates/scripts/quality-gates/check-god-objects.js +0 -146
  386. package/dist/templates/scripts/quality-gates/run-quality-gates.js +0 -50
  387. package/dist/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
  388. package/dist/test-analysis.js +0 -786
  389. package/dist/tool-interface.js +0 -314
  390. package/dist/tool-loader.js +0 -303
  391. package/dist/tool-validator.js +0 -393
  392. package/dist/utils/agent-display.js +0 -210
  393. package/dist/utils/agent-session.js +0 -344
  394. package/dist/utils/async-utils.js +0 -188
  395. package/dist/utils/command-wrapper.js +0 -200
  396. package/dist/utils/event-log.js +0 -584
  397. package/dist/utils/event-renderer.js +0 -521
  398. package/dist/utils/finalization.js +0 -230
  399. package/dist/utils/git-lock.js +0 -119
  400. package/dist/utils/gitignore-updater.js +0 -158
  401. package/dist/utils/ide-detection.js +0 -133
  402. package/dist/utils/lifecycle-events.js +0 -94
  403. package/dist/utils/project-analysis.js +0 -367
  404. package/dist/utils/promise-utils.js +0 -72
  405. package/dist/utils/quality-gates-errors.js +0 -520
  406. package/dist/utils/quality-gates-utils.js +0 -387
  407. package/dist/utils/schema-validator.js +0 -50
  408. package/dist/utils/spec-resolver.js +0 -711
  409. package/dist/utils/typescript-detector.js +0 -369
  410. package/dist/utils/working-state.js +0 -530
  411. package/dist/utils/yaml-validation.js +0 -156
  412. package/dist/validation/spec-validation.js +0 -924
  413. package/dist/waivers-manager.js +0 -732
  414. package/dist/worktree/worktree-manager.js +0 -1735
  415. package/templates/.caws/schemas/policy.schema.json +0 -117
  416. package/templates/.caws/schemas/scope.schema.json +0 -52
  417. package/templates/.caws/schemas/waivers.schema.json +0 -106
  418. package/templates/.caws/schemas/working-spec.schema.json +0 -340
  419. package/templates/.caws/schemas/worktrees.schema.json +0 -38
  420. package/templates/.caws/templates/working-spec.template.yml +0 -80
  421. package/templates/.caws/tools/README.md +0 -18
  422. package/templates/.caws/tools/scope-guard.js +0 -203
  423. package/templates/.caws/tools-allow.json +0 -331
  424. package/templates/.caws/waivers.yml +0 -19
  425. package/templates/.claude/README.md +0 -190
  426. package/templates/.claude/hooks/audit.sh +0 -121
  427. package/templates/.claude/hooks/block-dangerous.sh +0 -203
  428. package/templates/.claude/hooks/classify_command.py +0 -592
  429. package/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
  430. package/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
  431. package/templates/.claude/hooks/naming-check.sh +0 -100
  432. package/templates/.claude/hooks/protected-paths.sh +0 -39
  433. package/templates/.claude/hooks/quality-check.sh +0 -81
  434. package/templates/.claude/hooks/scan-secrets.sh +0 -85
  435. package/templates/.claude/hooks/scope-guard.sh +0 -381
  436. package/templates/.claude/hooks/session-caws-status.sh +0 -117
  437. package/templates/.claude/hooks/session-log.sh +0 -634
  438. package/templates/.claude/hooks/simplification-guard.sh +0 -92
  439. package/templates/.claude/hooks/stop-worktree-check.sh +0 -46
  440. package/templates/.claude/hooks/test_classify_command.py +0 -370
  441. package/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
  442. package/templates/.claude/hooks/validate-spec.sh +0 -76
  443. package/templates/.claude/hooks/worktree-guard.sh +0 -220
  444. package/templates/.claude/hooks/worktree-write-guard.sh +0 -190
  445. package/templates/.claude/rules/git-safety.md +0 -26
  446. package/templates/.claude/rules/worktree-isolation.md +0 -101
  447. package/templates/.claude/settings.json +0 -141
  448. package/templates/.cursor/README.md +0 -299
  449. package/templates/.cursor/hooks/audit.sh +0 -55
  450. package/templates/.cursor/hooks/block-dangerous.sh +0 -84
  451. package/templates/.cursor/hooks/caws-quality-check.sh +0 -52
  452. package/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
  453. package/templates/.cursor/hooks/format.sh +0 -38
  454. package/templates/.cursor/hooks/naming-check.sh +0 -64
  455. package/templates/.cursor/hooks/scan-secrets.sh +0 -51
  456. package/templates/.cursor/hooks/scope-guard.sh +0 -52
  457. package/templates/.cursor/hooks/session-log.sh +0 -924
  458. package/templates/.cursor/hooks/validate-spec.sh +0 -83
  459. package/templates/.cursor/hooks.json +0 -76
  460. package/templates/.cursor/rules/00-claims-verification.mdc +0 -144
  461. package/templates/.cursor/rules/01-working-style.mdc +0 -50
  462. package/templates/.cursor/rules/02-quality-gates.mdc +0 -368
  463. package/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
  464. package/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
  465. package/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
  466. package/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
  467. package/templates/.cursor/rules/07-process-ops.mdc +0 -20
  468. package/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
  469. package/templates/.cursor/rules/09-docstrings.mdc +0 -89
  470. package/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
  471. package/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
  472. package/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
  473. package/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
  474. package/templates/.cursor/rules/README.md +0 -148
  475. package/templates/.github/copilot-instructions.md +0 -82
  476. package/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
  477. package/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
  478. package/templates/.junie/guidelines.md +0 -73
  479. package/templates/.vscode/launch.json +0 -17
  480. package/templates/.vscode/settings.json +0 -95
  481. package/templates/.windsurf/rules/caws-quality-standards.md +0 -54
  482. package/templates/.windsurf/workflows/caws-guided-development.md +0 -92
  483. package/templates/CLAUDE.md +0 -196
  484. package/templates/COMMIT_CONVENTIONS.md +0 -86
  485. package/templates/OIDC_SETUP.md +0 -300
  486. package/templates/agents.md +0 -171
  487. package/templates/codemod/README.md +0 -1
  488. package/templates/codemod/test.js +0 -93
  489. package/templates/docs/README.md +0 -151
  490. package/templates/scripts/new_feature.sh +0 -80
  491. package/templates/scripts/quality-gates/check-god-objects.js +0 -146
  492. package/templates/scripts/quality-gates/run-quality-gates.js +0 -50
  493. package/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
@@ -0,0 +1,54 @@
1
+ export { SHELL_RULES, SHELL_RULE_PREFIXES } from './rules';
2
+ export type { ShellRule } from './rules';
3
+ export { resolveSession, describeSessionSource } from './session/resolve-session';
4
+ export type { ResolveSessionOptions, ResolvedSession, SessionCapsule, SessionSource, } from './session/types';
5
+ export { buildActor } from './session/actor';
6
+ export type { BuildActorOptions } from './session/actor';
7
+ export { resolveBinding, parseWorktreePorcelain, } from './binding/resolve-binding';
8
+ export type { GitWorktreeEntry, ResolveBindingInput, ResolvedBinding, } from './binding/types';
9
+ export { renderDiagnostic, renderDiagnostics, countSeverities, } from './render/diagnostic';
10
+ export type { RenderDiagnosticsOptions } from './render/diagnostic';
11
+ export { renderFinding, renderFindings, countFindingSeverities, } from './render/finding';
12
+ export type { RenderFindingsOptions } from './render/finding';
13
+ export { renderDecision } from './render/decision';
14
+ export type { RenderDecisionOptions } from './render/decision';
15
+ export { runDoctorCommand } from './commands/doctor';
16
+ export type { DoctorCommandOptions } from './commands/doctor';
17
+ export { runScopeCommand } from './commands/scope';
18
+ export type { ScopeCommandOptions, ScopeMode } from './commands/scope';
19
+ export { runEvidenceRecordCommand } from './commands/evidence';
20
+ export type { EvidenceKind, EvidenceRecordOptions, } from './commands/evidence';
21
+ export { runClaimCommand } from './commands/claim';
22
+ export type { ClaimCommandOptions } from './commands/claim';
23
+ export { renderClaimPanel, classifyOwnership } from './render/claim';
24
+ export type { ClaimPanelInput, OwnershipRelation } from './render/claim';
25
+ export { runStatusCommand } from './commands/status';
26
+ export type { StatusCommandOptions } from './commands/status';
27
+ export { renderStatus } from './render/status';
28
+ export type { StatusRenderInput } from './render/status';
29
+ export { runGatesRunCommand } from './commands/gates';
30
+ export type { GatesRunCommandOptions, GatesRunCommandRequest, } from './commands/gates';
31
+ export { renderGatesRun } from './render/gates';
32
+ export { validateGatesReport, } from './gates/gate-result-contract';
33
+ export type { GatesReport, GatesViolation, GatesWarning, } from './gates/gate-result-contract';
34
+ export { runQualityGates, resolveQualityGatesBin } from './gates/quality-gates-adapter';
35
+ export type { QualityGatesRunner, QualityGatesRunnerInput, RunQualityGatesOptions, SubprocessResult, } from './gates/quality-gates-adapter';
36
+ export { deriveDispositions } from './gates/disposition';
37
+ export type { DispositionResult, GateDisposition, GateOutcome, } from './gates/disposition';
38
+ export { filterWaivedViolations } from './gates/waiver-filter';
39
+ export type { WaiverFilterInput, WaiverFilterResult, WaiverEvidence, } from './gates/waiver-filter';
40
+ export { runWaiverCreateCommand, runWaiverListCommand, runWaiverShowCommand, runWaiverRevokeCommand, } from './commands/waiver';
41
+ export type { WaiverCreateOptions, WaiverListOptions, WaiverShowOptions, WaiverRevokeOptions, } from './commands/waiver';
42
+ export { renderWaiverSummary, renderWaiverDetail, } from './render/waiver';
43
+ export type { RenderWaiverSummaryInput, RenderWaiverDetailInput, } from './render/waiver';
44
+ export { runInitCommand } from './commands/init';
45
+ export type { InitCommandOptions } from './commands/init';
46
+ export { runSpecsCreateCommand, runSpecsListCommand, runSpecsShowCommand, runSpecsCloseCommand, runSpecsArchiveCommand, } from './commands/specs';
47
+ export type { SpecsCreateOptions, SpecsListOptions, SpecsShowOptions, SpecsCloseOptions, SpecsArchiveOptions, } from './commands/specs';
48
+ export { runWorktreeCreateCommand, runWorktreeListCommand, runWorktreeBindCommand, runWorktreeDestroyCommand, runWorktreeMergeCommand, } from './commands/worktree';
49
+ export type { WorktreeCreateOptions, WorktreeListOptions, WorktreeBindOptions, WorktreeDestroyOptions, WorktreeMergeOptions, } from './commands/worktree';
50
+ export { renderInit } from './render/init';
51
+ export type { RenderInitInput } from './render/init';
52
+ export { registerShellCommands } from './register';
53
+ export type { RegisterShellCommandsOptions } from './register';
54
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ // Programmatic exports for the shell layer.
3
+ //
4
+ // Slice 5c lands four CLI commands (doctor, scope show, scope check,
5
+ // evidence record) registered via `registerShellCommands(program)`.
6
+ // Internals below the command surface are exported for tests and for
7
+ // adjacent shell modules that need them (hooks, status renderer).
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.registerShellCommands = exports.renderInit = exports.runWorktreeMergeCommand = exports.runWorktreeDestroyCommand = exports.runWorktreeBindCommand = exports.runWorktreeListCommand = exports.runWorktreeCreateCommand = exports.runSpecsArchiveCommand = exports.runSpecsCloseCommand = exports.runSpecsShowCommand = exports.runSpecsListCommand = exports.runSpecsCreateCommand = exports.runInitCommand = exports.renderWaiverDetail = exports.renderWaiverSummary = exports.runWaiverRevokeCommand = exports.runWaiverShowCommand = exports.runWaiverListCommand = exports.runWaiverCreateCommand = exports.filterWaivedViolations = exports.deriveDispositions = exports.resolveQualityGatesBin = exports.runQualityGates = exports.validateGatesReport = exports.renderGatesRun = exports.runGatesRunCommand = exports.renderStatus = exports.runStatusCommand = exports.classifyOwnership = exports.renderClaimPanel = exports.runClaimCommand = exports.runEvidenceRecordCommand = exports.runScopeCommand = exports.runDoctorCommand = exports.renderDecision = exports.countFindingSeverities = exports.renderFindings = exports.renderFinding = exports.countSeverities = exports.renderDiagnostics = exports.renderDiagnostic = exports.parseWorktreePorcelain = exports.resolveBinding = exports.buildActor = exports.describeSessionSource = exports.resolveSession = exports.SHELL_RULE_PREFIXES = exports.SHELL_RULES = void 0;
10
+ var rules_1 = require("./rules");
11
+ Object.defineProperty(exports, "SHELL_RULES", { enumerable: true, get: function () { return rules_1.SHELL_RULES; } });
12
+ Object.defineProperty(exports, "SHELL_RULE_PREFIXES", { enumerable: true, get: function () { return rules_1.SHELL_RULE_PREFIXES; } });
13
+ var resolve_session_1 = require("./session/resolve-session");
14
+ Object.defineProperty(exports, "resolveSession", { enumerable: true, get: function () { return resolve_session_1.resolveSession; } });
15
+ Object.defineProperty(exports, "describeSessionSource", { enumerable: true, get: function () { return resolve_session_1.describeSessionSource; } });
16
+ var actor_1 = require("./session/actor");
17
+ Object.defineProperty(exports, "buildActor", { enumerable: true, get: function () { return actor_1.buildActor; } });
18
+ var resolve_binding_1 = require("./binding/resolve-binding");
19
+ Object.defineProperty(exports, "resolveBinding", { enumerable: true, get: function () { return resolve_binding_1.resolveBinding; } });
20
+ Object.defineProperty(exports, "parseWorktreePorcelain", { enumerable: true, get: function () { return resolve_binding_1.parseWorktreePorcelain; } });
21
+ var diagnostic_1 = require("./render/diagnostic");
22
+ Object.defineProperty(exports, "renderDiagnostic", { enumerable: true, get: function () { return diagnostic_1.renderDiagnostic; } });
23
+ Object.defineProperty(exports, "renderDiagnostics", { enumerable: true, get: function () { return diagnostic_1.renderDiagnostics; } });
24
+ Object.defineProperty(exports, "countSeverities", { enumerable: true, get: function () { return diagnostic_1.countSeverities; } });
25
+ var finding_1 = require("./render/finding");
26
+ Object.defineProperty(exports, "renderFinding", { enumerable: true, get: function () { return finding_1.renderFinding; } });
27
+ Object.defineProperty(exports, "renderFindings", { enumerable: true, get: function () { return finding_1.renderFindings; } });
28
+ Object.defineProperty(exports, "countFindingSeverities", { enumerable: true, get: function () { return finding_1.countFindingSeverities; } });
29
+ var decision_1 = require("./render/decision");
30
+ Object.defineProperty(exports, "renderDecision", { enumerable: true, get: function () { return decision_1.renderDecision; } });
31
+ var doctor_1 = require("./commands/doctor");
32
+ Object.defineProperty(exports, "runDoctorCommand", { enumerable: true, get: function () { return doctor_1.runDoctorCommand; } });
33
+ var scope_1 = require("./commands/scope");
34
+ Object.defineProperty(exports, "runScopeCommand", { enumerable: true, get: function () { return scope_1.runScopeCommand; } });
35
+ var evidence_1 = require("./commands/evidence");
36
+ Object.defineProperty(exports, "runEvidenceRecordCommand", { enumerable: true, get: function () { return evidence_1.runEvidenceRecordCommand; } });
37
+ var claim_1 = require("./commands/claim");
38
+ Object.defineProperty(exports, "runClaimCommand", { enumerable: true, get: function () { return claim_1.runClaimCommand; } });
39
+ var claim_2 = require("./render/claim");
40
+ Object.defineProperty(exports, "renderClaimPanel", { enumerable: true, get: function () { return claim_2.renderClaimPanel; } });
41
+ Object.defineProperty(exports, "classifyOwnership", { enumerable: true, get: function () { return claim_2.classifyOwnership; } });
42
+ var status_1 = require("./commands/status");
43
+ Object.defineProperty(exports, "runStatusCommand", { enumerable: true, get: function () { return status_1.runStatusCommand; } });
44
+ var status_2 = require("./render/status");
45
+ Object.defineProperty(exports, "renderStatus", { enumerable: true, get: function () { return status_2.renderStatus; } });
46
+ var gates_1 = require("./commands/gates");
47
+ Object.defineProperty(exports, "runGatesRunCommand", { enumerable: true, get: function () { return gates_1.runGatesRunCommand; } });
48
+ var gates_2 = require("./render/gates");
49
+ Object.defineProperty(exports, "renderGatesRun", { enumerable: true, get: function () { return gates_2.renderGatesRun; } });
50
+ var gate_result_contract_1 = require("./gates/gate-result-contract");
51
+ Object.defineProperty(exports, "validateGatesReport", { enumerable: true, get: function () { return gate_result_contract_1.validateGatesReport; } });
52
+ var quality_gates_adapter_1 = require("./gates/quality-gates-adapter");
53
+ Object.defineProperty(exports, "runQualityGates", { enumerable: true, get: function () { return quality_gates_adapter_1.runQualityGates; } });
54
+ Object.defineProperty(exports, "resolveQualityGatesBin", { enumerable: true, get: function () { return quality_gates_adapter_1.resolveQualityGatesBin; } });
55
+ var disposition_1 = require("./gates/disposition");
56
+ Object.defineProperty(exports, "deriveDispositions", { enumerable: true, get: function () { return disposition_1.deriveDispositions; } });
57
+ var waiver_filter_1 = require("./gates/waiver-filter");
58
+ Object.defineProperty(exports, "filterWaivedViolations", { enumerable: true, get: function () { return waiver_filter_1.filterWaivedViolations; } });
59
+ var waiver_1 = require("./commands/waiver");
60
+ Object.defineProperty(exports, "runWaiverCreateCommand", { enumerable: true, get: function () { return waiver_1.runWaiverCreateCommand; } });
61
+ Object.defineProperty(exports, "runWaiverListCommand", { enumerable: true, get: function () { return waiver_1.runWaiverListCommand; } });
62
+ Object.defineProperty(exports, "runWaiverShowCommand", { enumerable: true, get: function () { return waiver_1.runWaiverShowCommand; } });
63
+ Object.defineProperty(exports, "runWaiverRevokeCommand", { enumerable: true, get: function () { return waiver_1.runWaiverRevokeCommand; } });
64
+ var waiver_2 = require("./render/waiver");
65
+ Object.defineProperty(exports, "renderWaiverSummary", { enumerable: true, get: function () { return waiver_2.renderWaiverSummary; } });
66
+ Object.defineProperty(exports, "renderWaiverDetail", { enumerable: true, get: function () { return waiver_2.renderWaiverDetail; } });
67
+ var init_1 = require("./commands/init");
68
+ Object.defineProperty(exports, "runInitCommand", { enumerable: true, get: function () { return init_1.runInitCommand; } });
69
+ var specs_1 = require("./commands/specs");
70
+ Object.defineProperty(exports, "runSpecsCreateCommand", { enumerable: true, get: function () { return specs_1.runSpecsCreateCommand; } });
71
+ Object.defineProperty(exports, "runSpecsListCommand", { enumerable: true, get: function () { return specs_1.runSpecsListCommand; } });
72
+ Object.defineProperty(exports, "runSpecsShowCommand", { enumerable: true, get: function () { return specs_1.runSpecsShowCommand; } });
73
+ Object.defineProperty(exports, "runSpecsCloseCommand", { enumerable: true, get: function () { return specs_1.runSpecsCloseCommand; } });
74
+ Object.defineProperty(exports, "runSpecsArchiveCommand", { enumerable: true, get: function () { return specs_1.runSpecsArchiveCommand; } });
75
+ var worktree_1 = require("./commands/worktree");
76
+ Object.defineProperty(exports, "runWorktreeCreateCommand", { enumerable: true, get: function () { return worktree_1.runWorktreeCreateCommand; } });
77
+ Object.defineProperty(exports, "runWorktreeListCommand", { enumerable: true, get: function () { return worktree_1.runWorktreeListCommand; } });
78
+ Object.defineProperty(exports, "runWorktreeBindCommand", { enumerable: true, get: function () { return worktree_1.runWorktreeBindCommand; } });
79
+ Object.defineProperty(exports, "runWorktreeDestroyCommand", { enumerable: true, get: function () { return worktree_1.runWorktreeDestroyCommand; } });
80
+ Object.defineProperty(exports, "runWorktreeMergeCommand", { enumerable: true, get: function () { return worktree_1.runWorktreeMergeCommand; } });
81
+ var init_2 = require("./render/init");
82
+ Object.defineProperty(exports, "renderInit", { enumerable: true, get: function () { return init_2.renderInit; } });
83
+ var register_1 = require("./register");
84
+ Object.defineProperty(exports, "registerShellCommands", { enumerable: true, get: function () { return register_1.registerShellCommands; } });
85
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,EAAE;AACF,qEAAqE;AACrE,oEAAoE;AACpE,qEAAqE;AACrE,kEAAkE;;;AAElE,iCAA2D;AAAlD,oGAAA,WAAW,OAAA;AAAE,4GAAA,mBAAmB,OAAA;AAGzC,6DAAkF;AAAzE,iHAAA,cAAc,OAAA;AAAE,wHAAA,qBAAqB,OAAA;AAQ9C,yCAA6C;AAApC,mGAAA,UAAU,OAAA;AAGnB,6DAGmC;AAFjC,iHAAA,cAAc,OAAA;AACd,yHAAA,sBAAsB,OAAA;AAQxB,kDAI6B;AAH3B,8GAAA,gBAAgB,OAAA;AAChB,+GAAA,iBAAiB,OAAA;AACjB,6GAAA,eAAe,OAAA;AAGjB,4CAI0B;AAHxB,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,iHAAA,sBAAsB,OAAA;AAGxB,8CAAmD;AAA1C,0GAAA,cAAc,OAAA;AAGvB,4CAAqD;AAA5C,0GAAA,gBAAgB,OAAA;AAGzB,0CAAmD;AAA1C,wGAAA,eAAe,OAAA;AAGxB,gDAA+D;AAAtD,oHAAA,wBAAwB,OAAA;AAMjC,0CAAmD;AAA1C,wGAAA,eAAe,OAAA;AAGxB,wCAAqE;AAA5D,yGAAA,gBAAgB,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AAG5C,4CAAqD;AAA5C,0GAAA,gBAAgB,OAAA;AAGzB,0CAA+C;AAAtC,sGAAA,YAAY,OAAA;AAGrB,0CAAsD;AAA7C,2GAAA,kBAAkB,OAAA;AAM3B,wCAAgD;AAAvC,uGAAA,cAAc,OAAA;AACvB,qEAEsC;AADpC,2HAAA,mBAAmB,OAAA;AAOrB,uEAAwF;AAA/E,wHAAA,eAAe,OAAA;AAAE,+HAAA,sBAAsB,OAAA;AAOhD,mDAAyD;AAAhD,iHAAA,kBAAkB,OAAA;AAO3B,uDAA+D;AAAtD,uHAAA,sBAAsB,OAAA;AAO/B,4CAK2B;AAJzB,gHAAA,sBAAsB,OAAA;AACtB,8GAAA,oBAAoB,OAAA;AACpB,8GAAA,oBAAoB,OAAA;AACpB,gHAAA,sBAAsB,OAAA;AASxB,0CAGyB;AAFvB,6GAAA,mBAAmB,OAAA;AACnB,4GAAA,kBAAkB,OAAA;AAOpB,wCAAiD;AAAxC,sGAAA,cAAc,OAAA;AAGvB,0CAM0B;AALxB,8GAAA,qBAAqB,OAAA;AACrB,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,6GAAA,oBAAoB,OAAA;AACpB,+GAAA,sBAAsB,OAAA;AAUxB,gDAM6B;AAL3B,oHAAA,wBAAwB,OAAA;AACxB,kHAAA,sBAAsB,OAAA;AACtB,kHAAA,sBAAsB,OAAA;AACtB,qHAAA,yBAAyB,OAAA;AACzB,mHAAA,uBAAuB,OAAA;AAUzB,sCAA2C;AAAlC,kGAAA,UAAU,OAAA;AAGnB,uCAAmD;AAA1C,iHAAA,qBAAqB,OAAA"}
@@ -0,0 +1,11 @@
1
+ import type { Command } from 'commander';
2
+ export interface RegisterShellCommandsOptions {
3
+ /**
4
+ * Exit hook used after every shell command. Default `process.exit`.
5
+ * Tests inject a recorder so they can assert exit codes without
6
+ * actually exiting the test process.
7
+ */
8
+ readonly exit?: (code: number) => void;
9
+ }
10
+ export declare function registerShellCommands(program: Command, options?: RegisterShellCommandsOptions): void;
11
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/shell/register.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BzC,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAyBD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,4BAAiC,GACzC,IAAI,CAimBN"}
@@ -0,0 +1,464 @@
1
+ "use strict";
2
+ // Commander registration bridge for the vNext shell commands.
3
+ //
4
+ // Thin translator: read Commander options → call the existing
5
+ // `run*Command` functions → set `process.exitCode`. It does NOT
6
+ // reimplement command behavior. It does NOT inspect business logic.
7
+ //
8
+ // 5c.9 / 5c.10 boundary:
9
+ //
10
+ // - REPLACES the legacy `scope` command group (no env-var feature
11
+ // flag, no compatibility alias, no duplicate registration).
12
+ // - ADDS `doctor` and `evidence record` as new noun groups.
13
+ // - Leaves all other legacy commands (validate, iterate, evaluate,
14
+ // verify-acs, status, worktree create/merge, spec create/close,
15
+ // etc.) UNTOUCHED.
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.registerShellCommands = registerShellCommands;
18
+ const index_1 = require("./index");
19
+ function parseDataOption(raw) {
20
+ if (typeof raw !== 'string' || raw.length === 0)
21
+ return {};
22
+ try {
23
+ const parsed = JSON.parse(raw);
24
+ if (typeof parsed !== 'object' ||
25
+ parsed === null ||
26
+ Array.isArray(parsed)) {
27
+ throw new TypeError('--data must be a JSON object');
28
+ }
29
+ return parsed;
30
+ }
31
+ catch (e) {
32
+ throw new Error(`caws evidence record: invalid --data JSON: ${e.message}`);
33
+ }
34
+ }
35
+ function isEvidenceKind(value) {
36
+ return value === 'test' || value === 'gate' || value === 'ac';
37
+ }
38
+ function registerShellCommands(program, options = {}) {
39
+ const exit = options.exit ?? ((code) => process.exit(code));
40
+ // -------------------------------------------------------------------
41
+ // caws init
42
+ //
43
+ // Creates the canonical vNext .caws/ shape (specs/, waivers/,
44
+ // policy.yaml, worktrees.json, agents.json). Idempotent. Refuses to
45
+ // overwrite legacy state (working-spec.yaml et al.). No --force.
46
+ // Replaces the legacy `caws init` registration removed from
47
+ // src/index.js as part of slice 7b.
48
+ // -------------------------------------------------------------------
49
+ program
50
+ .command('init')
51
+ .description('Bootstrap the canonical vNext .caws/ project state (idempotent; ' +
52
+ 'refuses to overwrite legacy single-spec layout). With ' +
53
+ '--agent-surface, also installs the corresponding hook pack.')
54
+ .option('--data', 'Show structured data block on diagnostics')
55
+ .option('--agent-surface <name>', 'Install a hook pack for an agent harness ' +
56
+ '(claude-code | cursor | windsurf | none). When omitted, init ' +
57
+ 'attempts filesystem detection and skips hook install when ' +
58
+ 'ambiguous.')
59
+ .option('--overwrite', 'For hook-pack install: replace drifted or unmanaged files at ' +
60
+ 'managed pack paths. CAUTION: local edits to those files will ' +
61
+ 'be lost.')
62
+ .option('--adopt', 'For hook-pack install: leave drifted or unmanaged files in place ' +
63
+ 'without enforcing pack contents. CAUTION: pack drift is no ' +
64
+ 'longer tracked for those paths.')
65
+ .action((opts) => {
66
+ // Commander hands back the raw string for agentSurface; the
67
+ // runInitCommand validator rejects unknown values with exit 2.
68
+ const runOpts = {
69
+ showData: opts.data === true,
70
+ };
71
+ if (opts.agentSurface !== undefined) {
72
+ runOpts.agentSurface =
73
+ opts.agentSurface;
74
+ }
75
+ if (opts.overwrite !== undefined) {
76
+ runOpts.overwrite = opts.overwrite;
77
+ }
78
+ if (opts.adopt !== undefined) {
79
+ runOpts.adopt = opts.adopt;
80
+ }
81
+ const code = (0, index_1.runInitCommand)(runOpts);
82
+ exit(code);
83
+ });
84
+ // -------------------------------------------------------------------
85
+ // caws doctor
86
+ // -------------------------------------------------------------------
87
+ program
88
+ .command('doctor')
89
+ .description('Run drift detection against the current .caws/ state')
90
+ .option('--data', 'Show structured data block on findings/diagnostics')
91
+ .action((opts) => {
92
+ const code = (0, index_1.runDoctorCommand)({
93
+ showData: opts.data === true,
94
+ });
95
+ exit(code);
96
+ });
97
+ // -------------------------------------------------------------------
98
+ // caws scope show <path> / caws scope check <path>
99
+ // (replaces the legacy `scope` group entirely)
100
+ // -------------------------------------------------------------------
101
+ const scopeCmd = program
102
+ .command('scope')
103
+ .description('Evaluate file paths against the bound spec scope');
104
+ scopeCmd
105
+ .command('show <path>')
106
+ .description('Explain the scope decision for <path>; always exits 0')
107
+ .option('--data', 'Show structured data block')
108
+ .action((p, opts) => {
109
+ const code = (0, index_1.runScopeCommand)({
110
+ path: p,
111
+ mode: 'show',
112
+ showData: opts.data === true,
113
+ });
114
+ exit(code);
115
+ });
116
+ scopeCmd
117
+ .command('check <path>')
118
+ .description('Enforce the scope decision for <path>; exits 0 on admit, 1 otherwise')
119
+ .option('--data', 'Show structured data block')
120
+ .action((p, opts) => {
121
+ const code = (0, index_1.runScopeCommand)({
122
+ path: p,
123
+ mode: 'check',
124
+ showData: opts.data === true,
125
+ });
126
+ exit(code);
127
+ });
128
+ // -------------------------------------------------------------------
129
+ // caws status — read-only dashboard (replaces legacy status)
130
+ // -------------------------------------------------------------------
131
+ program
132
+ .command('status')
133
+ .description('Read-only dashboard: project, current context, claim, and doctor findings')
134
+ .option('--data', 'Show structured data block on rendered diagnostics')
135
+ .action((opts) => {
136
+ const code = (0, index_1.runStatusCommand)({
137
+ showData: opts.data === true,
138
+ });
139
+ exit(code);
140
+ });
141
+ // -------------------------------------------------------------------
142
+ // caws claim [--takeover]
143
+ // -------------------------------------------------------------------
144
+ program
145
+ .command('claim')
146
+ .description('Surface ownership of the current worktree; with --takeover, ' +
147
+ 'acquire ownership from a foreign session (writes prior_owners audit).')
148
+ .option('--takeover', 'Forcibly take ownership of a foreign-owned worktree. Required when ' +
149
+ 'the current owner is a different session.')
150
+ .option('--data', 'Show structured data block on diagnostics')
151
+ .action((opts) => {
152
+ const code = (0, index_1.runClaimCommand)({
153
+ takeover: opts.takeover === true,
154
+ showData: opts.data === true,
155
+ });
156
+ exit(code);
157
+ });
158
+ // -------------------------------------------------------------------
159
+ // caws gates run --spec <id> [--context <ctx>]
160
+ // (replaces the legacy `gates` group and `quality-gates` alias)
161
+ // -------------------------------------------------------------------
162
+ const gatesCmd = program
163
+ .command('gates')
164
+ .description('Run quality gates against the current changes (policy-driven)');
165
+ gatesCmd
166
+ .command('run')
167
+ .description('Invoke quality-gates subprocess and apply policy.gates[gate].mode ' +
168
+ 'to decide block/warn/skip. Appends one gate_evaluated event per ' +
169
+ 'policy-declared gate.')
170
+ .requiredOption('--spec <id>', 'Spec id this gate run is about')
171
+ .option('--context <ctx>', 'Subprocess context: cli | commit | ci', 'cli')
172
+ .option('--data', 'Show structured data block on diagnostics')
173
+ .action((opts) => {
174
+ const code = (0, index_1.runGatesRunCommand)({ specId: opts.spec }, {
175
+ subprocessArgs: [`--context=${opts.context}`],
176
+ showData: opts.data === true,
177
+ });
178
+ exit(code);
179
+ });
180
+ // -------------------------------------------------------------------
181
+ // caws evidence record
182
+ // -------------------------------------------------------------------
183
+ const evidenceCmd = program
184
+ .command('evidence')
185
+ .description('Record typed evidence events into .caws/events.jsonl');
186
+ evidenceCmd
187
+ .command('record')
188
+ .description('Append a typed evidence event (test|gate|ac)')
189
+ .requiredOption('--type <kind>', 'Evidence kind: test | gate | ac')
190
+ .requiredOption('--spec <id>', 'Spec id this evidence is about')
191
+ .requiredOption('--data <json>', 'Event payload as a JSON object string')
192
+ .option('--actor-kind <kind>', 'Actor kind: agent | human | system | automation', 'agent')
193
+ .option('--actor-id <id>', 'Override actor id (defaults to session id)')
194
+ .action((opts) => {
195
+ // Parse --data here; pass already-typed shape to the command.
196
+ let data;
197
+ try {
198
+ data = parseDataOption(opts.data);
199
+ }
200
+ catch (e) {
201
+ process.stderr.write(`${e.message}\n`);
202
+ exit(1);
203
+ return;
204
+ }
205
+ if (!isEvidenceKind(opts.type)) {
206
+ process.stderr.write(`caws evidence record: invalid --type ${JSON.stringify(opts.type)}; expected test|gate|ac.\n`);
207
+ exit(1);
208
+ return;
209
+ }
210
+ const code = (0, index_1.runEvidenceRecordCommand)({
211
+ kind: opts.type,
212
+ specId: opts.spec,
213
+ data,
214
+ ...(opts.actorKind !== undefined
215
+ ? { actorKind: opts.actorKind }
216
+ : {}),
217
+ ...(opts.actorId !== undefined ? { actorId: opts.actorId } : {}),
218
+ });
219
+ exit(code);
220
+ });
221
+ // -------------------------------------------------------------------
222
+ // caws waiver create / list / show / revoke
223
+ //
224
+ // Singular `waiver` is the vNext authority surface. The legacy plural
225
+ // `waivers` group is removed in src/index.js as part of slice 7a.4 —
226
+ // no compatibility alias, no feature flag.
227
+ // -------------------------------------------------------------------
228
+ const waiverCmd = program
229
+ .command('waiver')
230
+ .description('Manage CAWS waivers (bounded exception records that suppress matching gate violations)');
231
+ waiverCmd
232
+ .command('create <id>')
233
+ .description('Create a new active waiver. Validates against the kernel before writing.')
234
+ .requiredOption('--title <title>', 'Short waiver title (≥5 chars)')
235
+ .requiredOption('--gate <gate>', 'Gate id this waiver covers; repeat for multiple gates', collectMulti, [])
236
+ .requiredOption('--reason <reason>', 'Justification for the waiver')
237
+ .requiredOption('--approved-by <id>', 'Approver identity')
238
+ .requiredOption('--expires-at <iso>', 'Expiry as an ISO-8601 datetime with timezone')
239
+ .option('--spec <id>', 'Optional spec id this waiver is scoped to (omit for project-wide)')
240
+ .option('--data', 'Show structured data block on diagnostics')
241
+ .action((id, opts) => {
242
+ const code = (0, index_1.runWaiverCreateCommand)({
243
+ id,
244
+ title: opts.title,
245
+ gates: opts.gate,
246
+ reason: opts.reason,
247
+ approvedBy: opts.approvedBy,
248
+ expiresAt: opts.expiresAt,
249
+ ...(opts.spec !== undefined ? { specId: opts.spec } : {}),
250
+ showData: opts.data === true,
251
+ });
252
+ exit(code);
253
+ });
254
+ waiverCmd
255
+ .command('list')
256
+ .description('List waivers. By default excludes revoked and expired records.')
257
+ .option('--include-revoked', 'Include revoked waivers')
258
+ .option('--include-expired', 'Include expired waivers')
259
+ .option('--data', 'Show structured data block on diagnostics')
260
+ .action((opts) => {
261
+ const code = (0, index_1.runWaiverListCommand)({
262
+ includeRevoked: opts.includeRevoked === true,
263
+ includeExpired: opts.includeExpired === true,
264
+ showData: opts.data === true,
265
+ });
266
+ exit(code);
267
+ });
268
+ waiverCmd
269
+ .command('show <id>')
270
+ .description('Show a waiver, including its derived effectiveness at now.')
271
+ .option('--data', 'Show structured data block on diagnostics')
272
+ .action((id, opts) => {
273
+ const code = (0, index_1.runWaiverShowCommand)({
274
+ id,
275
+ showData: opts.data === true,
276
+ });
277
+ exit(code);
278
+ });
279
+ waiverCmd
280
+ .command('revoke <id>')
281
+ .description('Revoke a waiver. Writes a revocation record; refuses double-revoke.')
282
+ .option('--revoked-by <id>', 'Identity recorded in revocation.revoked_by')
283
+ .option('--reason <reason>', 'Reason recorded in revocation.reason (recommended for audit)')
284
+ .option('--data', 'Show structured data block on diagnostics')
285
+ .action((id, opts) => {
286
+ const code = (0, index_1.runWaiverRevokeCommand)({
287
+ id,
288
+ ...(opts.revokedBy !== undefined ? { revokedBy: opts.revokedBy } : {}),
289
+ ...(opts.reason !== undefined ? { reason: opts.reason } : {}),
290
+ showData: opts.data === true,
291
+ });
292
+ exit(code);
293
+ });
294
+ // -------------------------------------------------------------------
295
+ // caws specs (CLI-SPECS-001)
296
+ //
297
+ // Restores v11 spec lifecycle commands. All mutation paths go through
298
+ // specs-writer (which uses the lifecycle-transaction substrate from
299
+ // Slice 4). The shell layer parses args + builds the actor envelope;
300
+ // the writer owns YAML patching + event append.
301
+ // -------------------------------------------------------------------
302
+ const specsCmd = program
303
+ .command('specs')
304
+ .description('Manage CAWS spec lifecycle (create/list/show/close/archive)');
305
+ specsCmd
306
+ .command('create <id>')
307
+ .description('Create a new spec in lifecycle_state: active.')
308
+ .requiredOption('--title <title>', 'Short spec title')
309
+ .requiredOption('--mode <mode>', 'Spec mode: feature | refactor | fix | doc | chore')
310
+ .requiredOption('--risk-tier <n>', 'Risk tier: 1, 2, or 3')
311
+ .option('--data', 'Show structured data block on diagnostics')
312
+ .action((id, opts) => {
313
+ const code = (0, index_1.runSpecsCreateCommand)({
314
+ id,
315
+ title: opts.title,
316
+ mode: opts.mode,
317
+ riskTier: opts.riskTier,
318
+ showData: opts.data === true,
319
+ });
320
+ exit(code);
321
+ });
322
+ specsCmd
323
+ .command('list')
324
+ .description('List specs. By default excludes archived specs.')
325
+ .option('--archived', 'Include archived specs in the listing')
326
+ .option('--data', 'Show structured data block on diagnostics')
327
+ .action((opts) => {
328
+ const code = (0, index_1.runSpecsListCommand)({
329
+ includeArchived: opts.archived === true,
330
+ showData: opts.data === true,
331
+ });
332
+ exit(code);
333
+ });
334
+ specsCmd
335
+ .command('show <id>')
336
+ .description('Show a spec by id (searches active and archived locations).')
337
+ .option('--data', 'Show structured data block on diagnostics')
338
+ .action((id, opts) => {
339
+ const code = (0, index_1.runSpecsShowCommand)({
340
+ id,
341
+ showData: opts.data === true,
342
+ });
343
+ exit(code);
344
+ });
345
+ specsCmd
346
+ .command('close <id>')
347
+ .description('Close an active spec. Non-destructive raw-byte YAML patch; appends spec_closed event.')
348
+ .requiredOption('--resolution <r>', 'Resolution: completed | superseded | abandoned')
349
+ .option('--reason <text>', 'Closure notes recorded on the spec YAML and the spec_closed event')
350
+ .option('--merge-commit <sha>', 'Optional merge commit SHA (e.g., when closure follows a worktree merge)')
351
+ .option('--superseded-by <id>', 'Spec id that supersedes this one (use with --resolution superseded)')
352
+ .option('--data', 'Show structured data block on diagnostics')
353
+ .action((id, opts) => {
354
+ const code = (0, index_1.runSpecsCloseCommand)({
355
+ id,
356
+ resolution: opts.resolution,
357
+ ...(opts.reason !== undefined ? { reason: opts.reason } : {}),
358
+ ...(opts.mergeCommit !== undefined
359
+ ? { mergeCommit: opts.mergeCommit }
360
+ : {}),
361
+ ...(opts.supersededBy !== undefined
362
+ ? { supersededBy: opts.supersededBy }
363
+ : {}),
364
+ showData: opts.data === true,
365
+ });
366
+ exit(code);
367
+ });
368
+ specsCmd
369
+ .command('archive <id>')
370
+ .description('Archive a closed spec. Moves the YAML file to .caws/specs/.archive/; appends spec_archived event.')
371
+ .option('--reason <text>', 'Archive reason (advisory; spec_archived schema does not carry it)')
372
+ .option('--data', 'Show structured data block on diagnostics')
373
+ .action((id, opts) => {
374
+ const code = (0, index_1.runSpecsArchiveCommand)({
375
+ id,
376
+ ...(opts.reason !== undefined ? { reason: opts.reason } : {}),
377
+ showData: opts.data === true,
378
+ });
379
+ exit(code);
380
+ });
381
+ // -------------------------------------------------------------------
382
+ // caws worktree (CLI-WORKTREE-001)
383
+ //
384
+ // Restores v11 worktree lifecycle commands. All mutation paths go
385
+ // through worktrees-writer (which uses the lifecycle-transaction
386
+ // substrate from Slice 4 + applyRegistryPatch + specs-writer.closeSpec
387
+ // for auto-close on merge).
388
+ // -------------------------------------------------------------------
389
+ const worktreeCmd = program
390
+ .command('worktree')
391
+ .description('Manage CAWS worktrees (create/list/bind/destroy/merge). Worktrees are git worktrees bound to active specs.');
392
+ worktreeCmd
393
+ .command('create <name>')
394
+ .description('Create a new git worktree under .caws/worktrees/<name> bound to an active spec.')
395
+ .requiredOption('--spec <id>', 'Active spec id to bind the worktree to')
396
+ .option('--base-branch <branch>', 'Base branch to start from (default: current branch)')
397
+ .option('--branch <branch>', 'New branch name (default: worktree name)')
398
+ .option('--data', 'Show structured data block on diagnostics')
399
+ .action((name, opts) => {
400
+ const code = (0, index_1.runWorktreeCreateCommand)({
401
+ name,
402
+ specId: opts.spec,
403
+ ...(opts.baseBranch !== undefined ? { baseBranch: opts.baseBranch } : {}),
404
+ ...(opts.branch !== undefined ? { branch: opts.branch } : {}),
405
+ showData: opts.data === true,
406
+ });
407
+ exit(code);
408
+ });
409
+ worktreeCmd
410
+ .command('list')
411
+ .description('List registered worktrees with branch, spec binding, and owner.')
412
+ .option('--data', 'Show structured data block on diagnostics')
413
+ .action((opts) => {
414
+ const code = (0, index_1.runWorktreeListCommand)({ showData: opts.data === true });
415
+ exit(code);
416
+ });
417
+ worktreeCmd
418
+ .command('bind <name>')
419
+ .description('Repair bidirectional binding between a worktree and a spec (one-sided → bound).')
420
+ .requiredOption('--spec <id>', 'Spec id to bind the worktree to')
421
+ .option('--data', 'Show structured data block on diagnostics')
422
+ .action((name, opts) => {
423
+ const code = (0, index_1.runWorktreeBindCommand)({
424
+ name,
425
+ specId: opts.spec,
426
+ showData: opts.data === true,
427
+ });
428
+ exit(code);
429
+ });
430
+ worktreeCmd
431
+ .command('destroy <name>')
432
+ .description('Destroy a worktree. Non-forceful: refuses foreign ownership, dirty checkout, unmerged branch (use --abandon-unmerged to override branch check only).')
433
+ .option('--abandon-unmerged', 'Destroy even when the branch is not merged into base. Still respects ownership and clean working tree.')
434
+ .option('--data', 'Show structured data block on diagnostics')
435
+ .action((name, opts) => {
436
+ const code = (0, index_1.runWorktreeDestroyCommand)({
437
+ name,
438
+ ...(opts.abandonUnmerged === true ? { abandonUnmerged: true } : {}),
439
+ showData: opts.data === true,
440
+ });
441
+ exit(code);
442
+ });
443
+ worktreeCmd
444
+ .command('merge <name>')
445
+ .description('Merge a worktree branch into its base. Auto-closes the bound spec via caws specs close.')
446
+ .option('--dry-run', 'Validate prerequisites only; no git, no file writes, no events')
447
+ .option('--message <text>', 'Custom merge commit message (default: merge(worktree): <name>)')
448
+ .option('--data', 'Show structured data block on diagnostics')
449
+ .action((name, opts) => {
450
+ const code = (0, index_1.runWorktreeMergeCommand)({
451
+ name,
452
+ ...(opts.dryRun === true ? { dryRun: true } : {}),
453
+ ...(opts.message !== undefined ? { message: opts.message } : {}),
454
+ showData: opts.data === true,
455
+ });
456
+ exit(code);
457
+ });
458
+ }
459
+ /** Commander value collector for repeatable string options. */
460
+ function collectMulti(value, prev) {
461
+ prev.push(value);
462
+ return prev;
463
+ }
464
+ //# sourceMappingURL=register.js.map