claude-code-workflow 6.3.53 → 7.0.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 (1908) hide show
  1. package/.claude/agents/action-planning-agent.md +358 -188
  2. package/.claude/agents/cli-execution-agent.md +13 -12
  3. package/.claude/agents/cli-explore-agent.md +66 -11
  4. package/.claude/agents/cli-lite-planning-agent.md +908 -892
  5. package/.claude/agents/cli-roadmap-plan-agent.md +1001 -0
  6. package/.claude/agents/code-developer.md +75 -85
  7. package/.claude/agents/conceptual-planning-agent.md +49 -19
  8. package/.claude/agents/context-search-agent.md +96 -19
  9. package/.claude/agents/debug-explore-agent.md +439 -436
  10. package/.claude/agents/issue-plan-agent.md +15 -11
  11. package/.claude/agents/memory-bridge.md +2 -2
  12. package/.claude/agents/tdd-developer.md +84 -107
  13. package/.claude/agents/team-worker.md +440 -0
  14. package/.claude/agents/test-action-planning-agent.md +684 -0
  15. package/.claude/agents/test-fix-agent.md +24 -12
  16. package/.claude/agents/ui-design-agent.md +3 -3
  17. package/.claude/agents/universal-executor.md +1 -1
  18. package/.claude/commands/ccw-coordinator.md +316 -62
  19. package/.claude/commands/ccw.md +502 -172
  20. package/.claude/commands/cli/cli-init.md +441 -441
  21. package/.claude/commands/flow-create.md +666 -0
  22. package/.claude/commands/issue/convert-to-plan.md +21 -19
  23. package/.claude/commands/issue/discover-by-prompt.md +2 -2
  24. package/.claude/commands/issue/discover.md +4 -4
  25. package/.claude/commands/issue/execute.md +43 -15
  26. package/.claude/commands/issue/from-brainstorm.md +5 -5
  27. package/.claude/commands/issue/plan.md +335 -335
  28. package/.claude/commands/issue/queue.md +1 -1
  29. package/.claude/commands/memory/prepare.md +240 -0
  30. package/.claude/commands/memory/style-skill-memory.md +2 -2
  31. package/.claude/commands/workflow/analyze-with-file.md +639 -667
  32. package/.claude/commands/workflow/brainstorm-with-file.md +779 -1153
  33. package/.claude/commands/workflow/clean.md +572 -548
  34. package/.claude/commands/workflow/collaborative-plan-with-file.md +635 -761
  35. package/.claude/commands/workflow/debug-with-file.md +648 -672
  36. package/.claude/commands/workflow/init-guidelines.md +447 -0
  37. package/.claude/commands/workflow/init-specs.md +380 -0
  38. package/.claude/commands/workflow/init.md +291 -224
  39. package/.claude/commands/workflow/integration-test-cycle.md +932 -0
  40. package/.claude/commands/workflow/refactor-cycle.md +852 -0
  41. package/.claude/commands/workflow/roadmap-with-file.md +544 -0
  42. package/.claude/commands/workflow/session/complete.md +139 -203
  43. package/.claude/commands/workflow/session/solidify.md +453 -303
  44. package/.claude/commands/workflow/session/start.md +202 -202
  45. package/.claude/commands/workflow/session/sync.md +201 -0
  46. package/.claude/commands/workflow/ui-design/codify-style.md +20 -20
  47. package/.claude/commands/workflow/ui-design/design-sync.md +7 -7
  48. package/.claude/commands/workflow/ui-design/explore-auto.md +16 -16
  49. package/.claude/commands/workflow/ui-design/generate.md +1 -1
  50. package/.claude/commands/workflow/ui-design/imitate-auto.md +19 -19
  51. package/.claude/commands/workflow/ui-design/import-from-code.md +540 -540
  52. package/.claude/commands/workflow/unified-execute-with-file.md +864 -904
  53. package/.claude/scripts/cleanup-ghost-commands.mjs +402 -0
  54. package/.claude/skills/_shared/COMMAND-TO-SKILL-CONVERSION.md +741 -0
  55. package/.claude/skills/brainstorm/SKILL.md +382 -0
  56. package/.claude/skills/brainstorm/phases/01-mode-routing.md +207 -0
  57. package/.claude/skills/brainstorm/phases/02-artifacts.md +457 -0
  58. package/.claude/skills/brainstorm/phases/03-role-analysis.md +718 -0
  59. package/.claude/skills/brainstorm/phases/04-synthesis.md +817 -0
  60. package/.claude/skills/ccw-help/SKILL.md +176 -176
  61. package/.claude/skills/ccw-help/index/all-commands.json +376 -805
  62. package/.claude/skills/ccw-help/index/by-category.json +400 -833
  63. package/.claude/skills/ccw-help/index/by-use-case.json +388 -819
  64. package/.claude/skills/ccw-help/index/command-relationships.json +15 -160
  65. package/.claude/skills/ccw-help/index/essential-commands.json +13 -90
  66. package/.claude/skills/command-generator/SKILL.md +190 -0
  67. package/.claude/skills/command-generator/phases/01-parameter-validation.md +174 -0
  68. package/.claude/skills/command-generator/phases/02-target-path-resolution.md +171 -0
  69. package/.claude/skills/command-generator/phases/03-template-loading.md +123 -0
  70. package/.claude/skills/command-generator/phases/04-content-formatting.md +184 -0
  71. package/.claude/skills/command-generator/phases/05-file-generation.md +185 -0
  72. package/.claude/skills/command-generator/specs/command-design-spec.md +160 -0
  73. package/.claude/skills/command-generator/templates/command-md.md +75 -0
  74. package/.claude/skills/issue-manage/SKILL.md +291 -285
  75. package/.claude/skills/memory-capture/SKILL.md +129 -0
  76. package/.claude/skills/memory-capture/phases/01-compact.md +254 -0
  77. package/.claude/skills/memory-capture/phases/02-tips.md +206 -0
  78. package/.claude/skills/memory-manage/SKILL.md +229 -0
  79. package/.claude/skills/memory-manage/phases/01-update-full.md +316 -0
  80. package/.claude/skills/memory-manage/phases/02-update-related.md +267 -0
  81. package/.claude/skills/memory-manage/phases/03-update-single.md +306 -0
  82. package/.claude/skills/memory-manage/phases/04-docs-full.md +435 -0
  83. package/.claude/skills/memory-manage/phases/05-docs-related.md +315 -0
  84. package/.claude/skills/review-cycle/SKILL.md +128 -0
  85. package/.claude/skills/review-cycle/phases/review-fix.md +760 -0
  86. package/.claude/skills/review-cycle/phases/review-module.md +764 -0
  87. package/.claude/skills/review-cycle/phases/review-session.md +775 -0
  88. package/.claude/skills/skill-generator/templates/llm-action.md +3 -3
  89. package/.claude/skills/spec-generator/README.md +81 -0
  90. package/.claude/skills/spec-generator/SKILL.md +290 -0
  91. package/.claude/skills/spec-generator/phases/01-5-requirement-clarification.md +404 -0
  92. package/.claude/skills/spec-generator/phases/01-discovery.md +242 -0
  93. package/.claude/skills/spec-generator/phases/02-product-brief.md +247 -0
  94. package/.claude/skills/spec-generator/phases/03-requirements.md +179 -0
  95. package/.claude/skills/spec-generator/phases/04-architecture.md +213 -0
  96. package/.claude/skills/spec-generator/phases/05-epics-stories.md +168 -0
  97. package/.claude/skills/spec-generator/phases/06-readiness-check.md +449 -0
  98. package/.claude/skills/spec-generator/specs/document-standards.md +248 -0
  99. package/.claude/skills/spec-generator/specs/quality-gates.md +219 -0
  100. package/.claude/skills/spec-generator/templates/architecture-doc.md +254 -0
  101. package/.claude/skills/spec-generator/templates/epics-template.md +196 -0
  102. package/.claude/skills/spec-generator/templates/product-brief.md +133 -0
  103. package/.claude/skills/spec-generator/templates/requirements-prd.md +224 -0
  104. package/.claude/skills/team-brainstorm/SKILL.md +407 -0
  105. package/.claude/skills/team-brainstorm/roles/challenger.md +167 -0
  106. package/.claude/skills/team-brainstorm/roles/coordinator.md +257 -0
  107. package/.claude/skills/team-brainstorm/roles/evaluator.md +157 -0
  108. package/.claude/skills/team-brainstorm/roles/ideator.md +160 -0
  109. package/.claude/skills/team-brainstorm/roles/synthesizer.md +168 -0
  110. package/.claude/skills/team-brainstorm/specs/team-config.json +86 -0
  111. package/.claude/skills/team-coordinate/SKILL.md +445 -0
  112. package/.claude/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +197 -0
  113. package/.claude/skills/team-coordinate/roles/coordinator/commands/dispatch.md +85 -0
  114. package/.claude/skills/team-coordinate/roles/coordinator/commands/monitor.md +296 -0
  115. package/.claude/skills/team-coordinate/roles/coordinator/role.md +283 -0
  116. package/.claude/skills/team-coordinate/specs/role-template.md +434 -0
  117. package/.claude/skills/team-coordinate/subagents/discuss-subagent.md +133 -0
  118. package/.claude/skills/team-coordinate/subagents/explore-subagent.md +120 -0
  119. package/.claude/skills/team-coordinate-v2/SKILL.md +265 -0
  120. package/.claude/skills/team-coordinate-v2/roles/coordinator/commands/analyze-task.md +185 -0
  121. package/.claude/skills/team-coordinate-v2/roles/coordinator/commands/dispatch.md +87 -0
  122. package/.claude/skills/team-coordinate-v2/roles/coordinator/commands/monitor.md +301 -0
  123. package/.claude/skills/team-coordinate-v2/roles/coordinator/role.md +297 -0
  124. package/.claude/skills/team-coordinate-v2/specs/role-spec-template.md +295 -0
  125. package/.claude/skills/team-coordinate-v2/subagents/discuss-subagent.md +133 -0
  126. package/.claude/skills/team-coordinate-v2/subagents/explore-subagent.md +120 -0
  127. package/.claude/skills/team-executor/SKILL.md +372 -0
  128. package/.claude/skills/team-executor/roles/executor/commands/monitor.md +277 -0
  129. package/.claude/skills/team-executor/roles/executor/role.md +202 -0
  130. package/.claude/skills/team-executor/specs/session-schema.md +272 -0
  131. package/.claude/skills/team-executor-v2/SKILL.md +215 -0
  132. package/.claude/skills/team-executor-v2/roles/executor/commands/monitor.md +239 -0
  133. package/.claude/skills/team-executor-v2/roles/executor/role.md +171 -0
  134. package/.claude/skills/team-executor-v2/specs/session-schema.md +264 -0
  135. package/.claude/skills/team-frontend/SKILL.md +426 -0
  136. package/.claude/skills/team-frontend/roles/analyst/commands/design-intelligence.md +150 -0
  137. package/.claude/skills/team-frontend/roles/analyst/role.md +225 -0
  138. package/.claude/skills/team-frontend/roles/architect/role.md +219 -0
  139. package/.claude/skills/team-frontend/roles/coordinator/role.md +257 -0
  140. package/.claude/skills/team-frontend/roles/developer/role.md +238 -0
  141. package/.claude/skills/team-frontend/roles/qa/commands/pre-delivery-checklist.md +116 -0
  142. package/.claude/skills/team-frontend/roles/qa/role.md +257 -0
  143. package/.claude/skills/team-frontend/specs/team-config.json +84 -0
  144. package/.claude/skills/team-issue/SKILL.md +425 -0
  145. package/.claude/skills/team-issue/roles/coordinator.md +340 -0
  146. package/.claude/skills/team-issue/roles/explorer.md +212 -0
  147. package/.claude/skills/team-issue/roles/implementer.md +322 -0
  148. package/.claude/skills/team-issue/roles/integrator.md +241 -0
  149. package/.claude/skills/team-issue/roles/planner.md +207 -0
  150. package/.claude/skills/team-issue/roles/reviewer.md +268 -0
  151. package/.claude/skills/team-issue/specs/team-config.json +70 -0
  152. package/.claude/skills/team-iterdev/SKILL.md +493 -0
  153. package/.claude/skills/team-iterdev/roles/architect.md +265 -0
  154. package/.claude/skills/team-iterdev/roles/coordinator.md +423 -0
  155. package/.claude/skills/team-iterdev/roles/developer.md +280 -0
  156. package/.claude/skills/team-iterdev/roles/reviewer.md +307 -0
  157. package/.claude/skills/team-iterdev/roles/tester.md +253 -0
  158. package/.claude/skills/team-iterdev/specs/team-config.json +172 -0
  159. package/.claude/skills/team-lifecycle-v3/SKILL.md +384 -0
  160. package/.claude/skills/team-lifecycle-v3/roles/analyst/role.md +113 -0
  161. package/.claude/skills/team-lifecycle-v3/roles/architect/commands/assess.md +193 -0
  162. package/.claude/skills/team-lifecycle-v3/roles/architect/role.md +103 -0
  163. package/.claude/skills/team-lifecycle-v3/roles/coordinator/commands/dispatch.md +142 -0
  164. package/.claude/skills/team-lifecycle-v3/roles/coordinator/commands/monitor.md +180 -0
  165. package/.claude/skills/team-lifecycle-v3/roles/coordinator/role.md +209 -0
  166. package/.claude/skills/team-lifecycle-v3/roles/discussant/commands/critique.md +136 -0
  167. package/.claude/skills/team-lifecycle-v3/roles/discussant/role.md +128 -0
  168. package/.claude/skills/team-lifecycle-v3/roles/executor/commands/implement.md +166 -0
  169. package/.claude/skills/team-lifecycle-v3/roles/executor/role.md +103 -0
  170. package/.claude/skills/team-lifecycle-v3/roles/explorer/role.md +91 -0
  171. package/.claude/skills/team-lifecycle-v3/roles/fe-developer/role.md +111 -0
  172. package/.claude/skills/team-lifecycle-v3/roles/fe-qa/commands/pre-delivery-checklist.md +152 -0
  173. package/.claude/skills/team-lifecycle-v3/roles/fe-qa/role.md +113 -0
  174. package/.claude/skills/team-lifecycle-v3/roles/planner/commands/explore.md +154 -0
  175. package/.claude/skills/team-lifecycle-v3/roles/planner/role.md +120 -0
  176. package/.claude/skills/team-lifecycle-v3/roles/reviewer/commands/code-review.md +163 -0
  177. package/.claude/skills/team-lifecycle-v3/roles/reviewer/commands/spec-quality.md +202 -0
  178. package/.claude/skills/team-lifecycle-v3/roles/reviewer/role.md +104 -0
  179. package/.claude/skills/team-lifecycle-v3/roles/tester/commands/validate.md +152 -0
  180. package/.claude/skills/team-lifecycle-v3/roles/tester/role.md +108 -0
  181. package/.claude/skills/team-lifecycle-v3/roles/writer/commands/generate-doc.md +187 -0
  182. package/.claude/skills/team-lifecycle-v3/roles/writer/role.md +96 -0
  183. package/.claude/skills/team-lifecycle-v3/specs/document-standards.md +192 -0
  184. package/.claude/skills/team-lifecycle-v3/specs/quality-gates.md +207 -0
  185. package/.claude/skills/team-lifecycle-v3/specs/team-config.json +158 -0
  186. package/.claude/skills/team-lifecycle-v3/templates/architecture-doc.md +254 -0
  187. package/.claude/skills/team-lifecycle-v3/templates/epics-template.md +196 -0
  188. package/.claude/skills/team-lifecycle-v3/templates/product-brief.md +133 -0
  189. package/.claude/skills/team-lifecycle-v3/templates/requirements-prd.md +224 -0
  190. package/.claude/skills/team-lifecycle-v4/SKILL.md +643 -0
  191. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +174 -0
  192. package/.claude/skills/team-lifecycle-v4/roles/architect/commands/assess.md +193 -0
  193. package/.claude/skills/team-lifecycle-v4/roles/architect/role.md +103 -0
  194. package/.claude/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +198 -0
  195. package/.claude/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +413 -0
  196. package/.claude/skills/team-lifecycle-v4/roles/coordinator/role.md +230 -0
  197. package/.claude/skills/team-lifecycle-v4/roles/executor/commands/implement.md +166 -0
  198. package/.claude/skills/team-lifecycle-v4/roles/executor/role.md +103 -0
  199. package/.claude/skills/team-lifecycle-v4/roles/fe-developer/role.md +111 -0
  200. package/.claude/skills/team-lifecycle-v4/roles/fe-qa/commands/pre-delivery-checklist.md +152 -0
  201. package/.claude/skills/team-lifecycle-v4/roles/fe-qa/role.md +113 -0
  202. package/.claude/skills/team-lifecycle-v4/roles/planner/commands/explore.md +172 -0
  203. package/.claude/skills/team-lifecycle-v4/roles/planner/role.md +139 -0
  204. package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/code-review.md +163 -0
  205. package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/spec-quality.md +202 -0
  206. package/.claude/skills/team-lifecycle-v4/roles/reviewer/role.md +150 -0
  207. package/.claude/skills/team-lifecycle-v4/roles/tester/commands/validate.md +152 -0
  208. package/.claude/skills/team-lifecycle-v4/roles/tester/role.md +108 -0
  209. package/.claude/skills/team-lifecycle-v4/roles/writer/commands/generate-doc.md +192 -0
  210. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +246 -0
  211. package/.claude/skills/team-lifecycle-v4/specs/document-standards.md +192 -0
  212. package/.claude/skills/team-lifecycle-v4/specs/quality-gates.md +207 -0
  213. package/.claude/skills/team-lifecycle-v4/specs/team-config.json +200 -0
  214. package/.claude/skills/team-lifecycle-v4/subagents/discuss-subagent.md +169 -0
  215. package/.claude/skills/team-lifecycle-v4/subagents/doc-generation-subagent.md +62 -0
  216. package/.claude/skills/team-lifecycle-v4/subagents/explore-subagent.md +172 -0
  217. package/.claude/skills/team-lifecycle-v4/templates/architecture-doc.md +254 -0
  218. package/.claude/skills/team-lifecycle-v4/templates/epics-template.md +196 -0
  219. package/.claude/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  220. package/.claude/skills/team-lifecycle-v4/templates/requirements-prd.md +224 -0
  221. package/.claude/skills/team-lifecycle-v5/SKILL.md +320 -0
  222. package/.claude/skills/team-lifecycle-v5/role-specs/analyst.md +93 -0
  223. package/.claude/skills/team-lifecycle-v5/role-specs/architect.md +76 -0
  224. package/.claude/skills/team-lifecycle-v5/role-specs/executor.md +67 -0
  225. package/.claude/skills/team-lifecycle-v5/role-specs/fe-developer.md +79 -0
  226. package/.claude/skills/team-lifecycle-v5/role-specs/fe-qa.md +79 -0
  227. package/.claude/skills/team-lifecycle-v5/role-specs/planner.md +98 -0
  228. package/.claude/skills/team-lifecycle-v5/role-specs/reviewer.md +94 -0
  229. package/.claude/skills/team-lifecycle-v5/role-specs/tester.md +76 -0
  230. package/.claude/skills/team-lifecycle-v5/role-specs/writer.md +126 -0
  231. package/.claude/skills/team-lifecycle-v5/roles/coordinator/commands/dispatch.md +178 -0
  232. package/.claude/skills/team-lifecycle-v5/roles/coordinator/commands/monitor.md +237 -0
  233. package/.claude/skills/team-lifecycle-v5/roles/coordinator/role.md +194 -0
  234. package/.claude/skills/team-lifecycle-v5/specs/document-standards.md +192 -0
  235. package/.claude/skills/team-lifecycle-v5/specs/quality-gates.md +207 -0
  236. package/.claude/skills/team-lifecycle-v5/specs/team-config.json +218 -0
  237. package/.claude/skills/team-lifecycle-v5/subagents/discuss-subagent.md +169 -0
  238. package/.claude/skills/team-lifecycle-v5/subagents/doc-generation-subagent.md +62 -0
  239. package/.claude/skills/team-lifecycle-v5/subagents/explore-subagent.md +172 -0
  240. package/.claude/skills/team-lifecycle-v5/templates/architecture-doc.md +254 -0
  241. package/.claude/skills/team-lifecycle-v5/templates/epics-template.md +196 -0
  242. package/.claude/skills/team-lifecycle-v5/templates/product-brief.md +133 -0
  243. package/.claude/skills/team-lifecycle-v5/templates/requirements-prd.md +224 -0
  244. package/.claude/skills/team-planex/SKILL.md +439 -0
  245. package/.claude/skills/team-planex/roles/executor.md +356 -0
  246. package/.claude/skills/team-planex/roles/planner.md +315 -0
  247. package/.claude/skills/team-quality-assurance/SKILL.md +466 -0
  248. package/.claude/skills/team-quality-assurance/roles/analyst/commands/quality-report.md +360 -0
  249. package/.claude/skills/team-quality-assurance/roles/analyst/role.md +186 -0
  250. package/.claude/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +169 -0
  251. package/.claude/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +336 -0
  252. package/.claude/skills/team-quality-assurance/roles/coordinator/role.md +195 -0
  253. package/.claude/skills/team-quality-assurance/roles/executor/commands/run-fix-cycle.md +220 -0
  254. package/.claude/skills/team-quality-assurance/roles/executor/role.md +179 -0
  255. package/.claude/skills/team-quality-assurance/roles/generator/commands/generate-tests.md +258 -0
  256. package/.claude/skills/team-quality-assurance/roles/generator/role.md +172 -0
  257. package/.claude/skills/team-quality-assurance/roles/scout/commands/scan.md +216 -0
  258. package/.claude/skills/team-quality-assurance/roles/scout/role.md +244 -0
  259. package/.claude/skills/team-quality-assurance/roles/strategist/commands/analyze-scope.md +221 -0
  260. package/.claude/skills/team-quality-assurance/roles/strategist/role.md +166 -0
  261. package/.claude/skills/team-quality-assurance/specs/team-config.json +131 -0
  262. package/.claude/skills/team-review/SKILL.md +264 -0
  263. package/.claude/skills/team-review/roles/coordinator/commands/dispatch.md +145 -0
  264. package/.claude/skills/team-review/roles/coordinator/commands/monitor.md +218 -0
  265. package/.claude/skills/team-review/roles/coordinator/role.md +244 -0
  266. package/.claude/skills/team-review/roles/fixer/commands/execute-fixes.md +163 -0
  267. package/.claude/skills/team-review/roles/fixer/commands/plan-fixes.md +187 -0
  268. package/.claude/skills/team-review/roles/fixer/role.md +247 -0
  269. package/.claude/skills/team-review/roles/reviewer/commands/deep-analyze.md +186 -0
  270. package/.claude/skills/team-review/roles/reviewer/commands/generate-report.md +174 -0
  271. package/.claude/skills/team-review/roles/reviewer/role.md +233 -0
  272. package/.claude/skills/team-review/roles/scanner/commands/semantic-scan.md +186 -0
  273. package/.claude/skills/team-review/roles/scanner/commands/toolchain-scan.md +187 -0
  274. package/.claude/skills/team-review/roles/scanner/role.md +255 -0
  275. package/.claude/skills/team-review/specs/dimensions.md +82 -0
  276. package/.claude/skills/team-review/specs/finding-schema.json +82 -0
  277. package/.claude/skills/team-review/specs/team-config.json +27 -0
  278. package/.claude/skills/team-roadmap-dev/SKILL.md +389 -0
  279. package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/dispatch.md +213 -0
  280. package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +378 -0
  281. package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/pause.md +91 -0
  282. package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/resume.md +138 -0
  283. package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +287 -0
  284. package/.claude/skills/team-roadmap-dev/roles/coordinator/role.md +237 -0
  285. package/.claude/skills/team-roadmap-dev/roles/executor/commands/implement.md +309 -0
  286. package/.claude/skills/team-roadmap-dev/roles/executor/role.md +220 -0
  287. package/.claude/skills/team-roadmap-dev/roles/planner/commands/create-plans.md +362 -0
  288. package/.claude/skills/team-roadmap-dev/roles/planner/commands/research.md +219 -0
  289. package/.claude/skills/team-roadmap-dev/roles/planner/role.md +243 -0
  290. package/.claude/skills/team-roadmap-dev/roles/verifier/commands/verify.md +335 -0
  291. package/.claude/skills/team-roadmap-dev/roles/verifier/role.md +247 -0
  292. package/.claude/skills/team-roadmap-dev/specs/team-config.json +96 -0
  293. package/.claude/skills/team-tech-debt/SKILL.md +473 -0
  294. package/.claude/skills/team-tech-debt/roles/assessor/commands/evaluate.md +164 -0
  295. package/.claude/skills/team-tech-debt/roles/assessor/role.md +187 -0
  296. package/.claude/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +157 -0
  297. package/.claude/skills/team-tech-debt/roles/coordinator/commands/monitor.md +434 -0
  298. package/.claude/skills/team-tech-debt/roles/coordinator/role.md +387 -0
  299. package/.claude/skills/team-tech-debt/roles/executor/commands/remediate.md +180 -0
  300. package/.claude/skills/team-tech-debt/roles/executor/role.md +228 -0
  301. package/.claude/skills/team-tech-debt/roles/planner/commands/create-plan.md +165 -0
  302. package/.claude/skills/team-tech-debt/roles/planner/role.md +190 -0
  303. package/.claude/skills/team-tech-debt/roles/scanner/commands/scan-debt.md +388 -0
  304. package/.claude/skills/team-tech-debt/roles/scanner/role.md +225 -0
  305. package/.claude/skills/team-tech-debt/roles/validator/commands/verify.md +203 -0
  306. package/.claude/skills/team-tech-debt/roles/validator/role.md +237 -0
  307. package/.claude/skills/team-tech-debt/specs/team-config.json +132 -0
  308. package/.claude/skills/team-testing/SKILL.md +362 -0
  309. package/.claude/skills/team-testing/roles/analyst.md +265 -0
  310. package/.claude/skills/team-testing/roles/coordinator.md +304 -0
  311. package/.claude/skills/team-testing/roles/executor.md +300 -0
  312. package/.claude/skills/team-testing/roles/generator.md +272 -0
  313. package/.claude/skills/team-testing/roles/strategist.md +218 -0
  314. package/.claude/skills/team-testing/specs/team-config.json +93 -0
  315. package/.claude/skills/team-uidesign/SKILL.md +419 -0
  316. package/.claude/skills/team-uidesign/roles/coordinator.md +315 -0
  317. package/.claude/skills/team-uidesign/roles/designer.md +251 -0
  318. package/.claude/skills/team-uidesign/roles/implementer.md +280 -0
  319. package/.claude/skills/team-uidesign/roles/researcher.md +286 -0
  320. package/.claude/skills/team-uidesign/roles/reviewer.md +301 -0
  321. package/.claude/skills/team-uidesign/specs/team-config.json +107 -0
  322. package/.claude/skills/team-ultra-analyze/SKILL.md +444 -0
  323. package/.claude/skills/team-ultra-analyze/roles/analyst/commands/analyze.md +210 -0
  324. package/.claude/skills/team-ultra-analyze/roles/analyst/role.md +253 -0
  325. package/.claude/skills/team-ultra-analyze/roles/coordinator/commands/dispatch.md +237 -0
  326. package/.claude/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +461 -0
  327. package/.claude/skills/team-ultra-analyze/roles/coordinator/role.md +354 -0
  328. package/.claude/skills/team-ultra-analyze/roles/discussant/commands/deepen.md +222 -0
  329. package/.claude/skills/team-ultra-analyze/roles/discussant/role.md +227 -0
  330. package/.claude/skills/team-ultra-analyze/roles/explorer/commands/explore.md +194 -0
  331. package/.claude/skills/team-ultra-analyze/roles/explorer/role.md +219 -0
  332. package/.claude/skills/team-ultra-analyze/roles/synthesizer/commands/synthesize.md +255 -0
  333. package/.claude/skills/team-ultra-analyze/roles/synthesizer/role.md +251 -0
  334. package/.claude/skills/team-ultra-analyze/specs/team-config.json +131 -0
  335. package/.claude/skills/workflow-execute/SKILL.md +625 -0
  336. package/.claude/skills/workflow-execute/phases/06-review.md +215 -0
  337. package/.claude/skills/workflow-lite-plan/SKILL.md +174 -0
  338. package/.claude/skills/workflow-lite-plan/phases/01-lite-plan.md +762 -0
  339. package/.claude/skills/workflow-lite-plan/phases/02-lite-execute.md +786 -0
  340. package/.claude/skills/workflow-multi-cli-plan/SKILL.md +163 -0
  341. package/.claude/skills/workflow-multi-cli-plan/phases/01-multi-cli-plan.md +604 -0
  342. package/.claude/skills/workflow-multi-cli-plan/phases/02-lite-execute.md +788 -0
  343. package/.claude/skills/workflow-plan/SKILL.md +441 -0
  344. package/.claude/skills/workflow-plan/phases/01-session-discovery.md +99 -0
  345. package/.claude/skills/workflow-plan/phases/02-context-gathering.md +338 -0
  346. package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -0
  347. package/.claude/skills/workflow-plan/phases/04-task-generation.md +433 -0
  348. package/.claude/skills/workflow-plan/phases/05-plan-verify.md +391 -0
  349. package/.claude/skills/workflow-plan/phases/06-replan.md +594 -0
  350. package/.claude/skills/workflow-skill-designer/SKILL.md +496 -0
  351. package/.claude/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  352. package/.claude/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  353. package/.claude/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  354. package/.claude/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  355. package/.claude/skills/workflow-tdd/SKILL.md +502 -0
  356. package/.claude/skills/workflow-tdd/phases/01-session-discovery.md +57 -0
  357. package/.claude/skills/workflow-tdd/phases/02-context-gathering.md +406 -0
  358. package/.claude/skills/workflow-tdd/phases/03-test-coverage-analysis.md +172 -0
  359. package/.claude/skills/workflow-tdd/phases/04-conflict-resolution.md +426 -0
  360. package/.claude/skills/workflow-tdd/phases/05-tdd-task-generation.md +472 -0
  361. package/.claude/skills/workflow-tdd/phases/06-tdd-structure-validation.md +189 -0
  362. package/.claude/skills/workflow-tdd/phases/07-tdd-verify.md +635 -0
  363. package/.claude/skills/workflow-test-fix/SKILL.md +458 -0
  364. package/.claude/skills/workflow-test-fix/phases/01-session-start.md +60 -0
  365. package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +492 -0
  366. package/.claude/skills/workflow-test-fix/phases/03-test-concept-enhanced.md +150 -0
  367. package/.claude/skills/workflow-test-fix/phases/04-test-task-generate.md +346 -0
  368. package/.claude/skills/workflow-test-fix/phases/05-test-cycle-execute.md +537 -0
  369. package/.codex/AGENTS.md +126 -122
  370. package/.codex/agents/action-planning-agent.md +88 -93
  371. package/.codex/agents/cli-execution-agent.md +4 -4
  372. package/.codex/agents/cli-explore-agent.md +56 -11
  373. package/.codex/agents/cli-lite-planning-agent.md +906 -736
  374. package/.codex/agents/code-developer.md +147 -38
  375. package/.codex/agents/conceptual-planning-agent.md +5 -5
  376. package/.codex/agents/context-search-agent.md +8 -4
  377. package/.codex/agents/issue-plan-agent.md +11 -11
  378. package/.codex/agents/memory-bridge.md +2 -2
  379. package/.codex/agents/tdd-developer.md +512 -0
  380. package/.codex/agents/test-action-planning-agent.md +684 -0
  381. package/.codex/agents/test-fix-agent.md +19 -7
  382. package/.codex/agents/ui-design-agent.md +3 -3
  383. package/.codex/prompts/prep-cycle.md +416 -0
  384. package/.codex/prompts/prep-plan.md +371 -0
  385. package/.codex/skills/analyze-with-file/EXECUTE.md +716 -0
  386. package/.codex/skills/analyze-with-file/SKILL.md +1049 -0
  387. package/.codex/skills/brainstorm-with-file/SKILL.md +1033 -0
  388. package/.codex/skills/clean/SKILL.md +421 -0
  389. package/.codex/skills/collaborative-plan-with-file/SKILL.md +822 -0
  390. package/.codex/skills/debug-with-file/SKILL.md +617 -0
  391. package/.codex/skills/issue-discover/SKILL.md +353 -0
  392. package/.codex/skills/issue-discover/phases/01-issue-new.md +334 -0
  393. package/.codex/skills/issue-discover/phases/02-discover.md +369 -0
  394. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +531 -0
  395. package/.codex/skills/issue-discover/phases/04-quick-execute.md +241 -0
  396. package/.codex/skills/memory-compact/SKILL.md +381 -0
  397. package/.codex/skills/parallel-dev-cycle/SKILL.md +401 -0
  398. package/.codex/skills/parallel-dev-cycle/phases/00-prep-checklist.md +191 -0
  399. package/.codex/skills/parallel-dev-cycle/phases/01-session-init.md +261 -0
  400. package/.codex/skills/parallel-dev-cycle/phases/02-agent-execution.md +449 -0
  401. package/.codex/skills/parallel-dev-cycle/phases/03-result-aggregation.md +230 -0
  402. package/.codex/skills/parallel-dev-cycle/phases/04-completion-summary.md +109 -0
  403. package/.codex/skills/parallel-dev-cycle/roles/code-developer.md +392 -0
  404. package/.codex/skills/parallel-dev-cycle/roles/exploration-planner.md +352 -0
  405. package/.codex/skills/parallel-dev-cycle/roles/requirements-analyst.md +433 -0
  406. package/.codex/skills/parallel-dev-cycle/roles/validation-archivist.md +447 -0
  407. package/.codex/skills/review-cycle/SKILL.md +476 -0
  408. package/.codex/skills/review-cycle/phases/01-discovery-initialization.md +341 -0
  409. package/.codex/skills/review-cycle/phases/02-parallel-review.md +546 -0
  410. package/.codex/skills/review-cycle/phases/03-aggregation.md +74 -0
  411. package/.codex/skills/review-cycle/phases/04-iterative-deep-dive.md +333 -0
  412. package/.codex/skills/review-cycle/phases/05-review-completion.md +173 -0
  413. package/.codex/skills/review-cycle/phases/06-fix-discovery-batching.md +238 -0
  414. package/.codex/skills/review-cycle/phases/07-fix-parallel-planning.md +223 -0
  415. package/.codex/skills/review-cycle/phases/08-fix-execution.md +238 -0
  416. package/.codex/skills/review-cycle/phases/09-fix-completion.md +141 -0
  417. package/.codex/skills/roadmap-with-file/SKILL.md +898 -0
  418. package/.codex/skills/team-lifecycle/agents/analyst.md +424 -0
  419. package/.codex/skills/team-lifecycle/agents/architect.md +274 -0
  420. package/.codex/skills/team-lifecycle/agents/discuss-agent.md +422 -0
  421. package/.codex/skills/team-lifecycle/agents/executor.md +423 -0
  422. package/.codex/skills/team-lifecycle/agents/explore-agent.md +471 -0
  423. package/.codex/skills/team-lifecycle/agents/fe-developer.md +239 -0
  424. package/.codex/skills/team-lifecycle/agents/fe-qa.md +357 -0
  425. package/.codex/skills/team-lifecycle/agents/planner.md +437 -0
  426. package/.codex/skills/team-lifecycle/agents/reviewer.md +483 -0
  427. package/.codex/skills/team-lifecycle/agents/tester.md +423 -0
  428. package/.codex/skills/team-lifecycle/agents/writer.md +502 -0
  429. package/.codex/skills/team-lifecycle/orchestrator.md +817 -0
  430. package/.codex/skills/team-lifecycle/phases/01-requirement-clarification.md +209 -0
  431. package/.codex/skills/team-lifecycle/phases/02-team-initialization.md +205 -0
  432. package/.codex/skills/team-lifecycle/phases/03-task-chain-creation.md +251 -0
  433. package/.codex/skills/team-lifecycle/phases/04-pipeline-coordination.md +719 -0
  434. package/.codex/skills/team-lifecycle/phases/05-completion-report.md +288 -0
  435. package/.codex/skills/team-lifecycle/specs/document-standards.md +192 -0
  436. package/.codex/skills/team-lifecycle/specs/quality-gates.md +207 -0
  437. package/.codex/skills/team-lifecycle/templates/architecture-doc.md +254 -0
  438. package/.codex/skills/team-lifecycle/templates/epics-template.md +196 -0
  439. package/.codex/skills/team-lifecycle/templates/product-brief.md +133 -0
  440. package/.codex/skills/team-lifecycle/templates/requirements-prd.md +224 -0
  441. package/.codex/skills/team-planex/agents/executor.md +217 -0
  442. package/.codex/skills/team-planex/agents/planner.md +183 -0
  443. package/.codex/skills/team-planex/orchestrator.md +284 -0
  444. package/.codex/skills/unified-execute-with-file/SKILL.md +786 -0
  445. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +391 -0
  446. package/.codex/skills/workflow-test-fix-cycle/phases/01-test-fix-gen.md +452 -0
  447. package/.codex/skills/workflow-test-fix-cycle/phases/02-test-cycle-execute.md +476 -0
  448. package/README.md +187 -157
  449. package/ccw/README.md +46 -0
  450. package/ccw/bin/ccw-mcp.js +16 -1
  451. package/ccw/dist/cli.d.ts.map +1 -1
  452. package/ccw/dist/cli.js +58 -2
  453. package/ccw/dist/cli.js.map +1 -1
  454. package/ccw/dist/commands/cli.d.ts +3 -0
  455. package/ccw/dist/commands/cli.d.ts.map +1 -1
  456. package/ccw/dist/commands/cli.js +109 -63
  457. package/ccw/dist/commands/cli.js.map +1 -1
  458. package/ccw/dist/commands/core-memory.d.ts +5 -0
  459. package/ccw/dist/commands/core-memory.d.ts.map +1 -1
  460. package/ccw/dist/commands/core-memory.js +307 -2
  461. package/ccw/dist/commands/core-memory.js.map +1 -1
  462. package/ccw/dist/commands/hook.d.ts +3 -1
  463. package/ccw/dist/commands/hook.d.ts.map +1 -1
  464. package/ccw/dist/commands/hook.js +669 -85
  465. package/ccw/dist/commands/hook.js.map +1 -1
  466. package/ccw/dist/commands/install.d.ts +12 -0
  467. package/ccw/dist/commands/install.d.ts.map +1 -1
  468. package/ccw/dist/commands/install.js +313 -3
  469. package/ccw/dist/commands/install.js.map +1 -1
  470. package/ccw/dist/commands/issue.d.ts +18 -5
  471. package/ccw/dist/commands/issue.d.ts.map +1 -1
  472. package/ccw/dist/commands/issue.js +58 -19
  473. package/ccw/dist/commands/issue.js.map +1 -1
  474. package/ccw/dist/commands/memory.d.ts +1 -1
  475. package/ccw/dist/commands/memory.d.ts.map +1 -1
  476. package/ccw/dist/commands/memory.js +371 -1
  477. package/ccw/dist/commands/memory.js.map +1 -1
  478. package/ccw/dist/commands/serve.d.ts.map +1 -1
  479. package/ccw/dist/commands/serve.js +74 -4
  480. package/ccw/dist/commands/serve.js.map +1 -1
  481. package/ccw/dist/commands/spec.d.ts +24 -0
  482. package/ccw/dist/commands/spec.d.ts.map +1 -0
  483. package/ccw/dist/commands/spec.js +374 -0
  484. package/ccw/dist/commands/spec.js.map +1 -0
  485. package/ccw/dist/commands/stop.d.ts +0 -4
  486. package/ccw/dist/commands/stop.d.ts.map +1 -1
  487. package/ccw/dist/commands/stop.js +135 -12
  488. package/ccw/dist/commands/stop.js.map +1 -1
  489. package/ccw/dist/commands/team.d.ts +27 -0
  490. package/ccw/dist/commands/team.d.ts.map +1 -0
  491. package/ccw/dist/commands/team.js +164 -0
  492. package/ccw/dist/commands/team.js.map +1 -0
  493. package/ccw/dist/commands/upgrade.js +4 -2
  494. package/ccw/dist/commands/upgrade.js.map +1 -1
  495. package/ccw/dist/commands/view.d.ts.map +1 -1
  496. package/ccw/dist/commands/view.js +2 -3
  497. package/ccw/dist/commands/view.js.map +1 -1
  498. package/ccw/dist/commands/workflow.js +2 -2
  499. package/ccw/dist/commands/workflow.js.map +1 -1
  500. package/ccw/dist/config/cli-settings-manager.d.ts +12 -3
  501. package/ccw/dist/config/cli-settings-manager.d.ts.map +1 -1
  502. package/ccw/dist/config/cli-settings-manager.js +146 -12
  503. package/ccw/dist/config/cli-settings-manager.js.map +1 -1
  504. package/ccw/dist/config/litellm-static-models.d.ts +30 -0
  505. package/ccw/dist/config/litellm-static-models.d.ts.map +1 -0
  506. package/ccw/dist/config/litellm-static-models.js +82 -0
  507. package/ccw/dist/config/litellm-static-models.js.map +1 -0
  508. package/ccw/dist/config/provider-models.d.ts +5 -32
  509. package/ccw/dist/config/provider-models.d.ts.map +1 -1
  510. package/ccw/dist/config/provider-models.js +5 -103
  511. package/ccw/dist/config/provider-models.js.map +1 -1
  512. package/ccw/dist/config/remote-notification-config.d.ts +32 -0
  513. package/ccw/dist/config/remote-notification-config.d.ts.map +1 -0
  514. package/ccw/dist/config/remote-notification-config.js +131 -0
  515. package/ccw/dist/config/remote-notification-config.js.map +1 -0
  516. package/ccw/dist/config/storage-paths.d.ts +22 -0
  517. package/ccw/dist/config/storage-paths.d.ts.map +1 -1
  518. package/ccw/dist/config/storage-paths.js +27 -0
  519. package/ccw/dist/config/storage-paths.js.map +1 -1
  520. package/ccw/dist/core/a2ui/A2UITypes.d.ts +143 -0
  521. package/ccw/dist/core/a2ui/A2UITypes.d.ts.map +1 -0
  522. package/ccw/dist/core/a2ui/A2UITypes.js +84 -0
  523. package/ccw/dist/core/a2ui/A2UITypes.js.map +1 -0
  524. package/ccw/dist/core/a2ui/A2UIWebSocketHandler.d.ts +170 -0
  525. package/ccw/dist/core/a2ui/A2UIWebSocketHandler.d.ts.map +1 -0
  526. package/ccw/dist/core/a2ui/A2UIWebSocketHandler.js +718 -0
  527. package/ccw/dist/core/a2ui/A2UIWebSocketHandler.js.map +1 -0
  528. package/ccw/dist/core/a2ui/index.d.ts +3 -0
  529. package/ccw/dist/core/a2ui/index.d.ts.map +1 -0
  530. package/ccw/dist/core/a2ui/index.js +6 -0
  531. package/ccw/dist/core/a2ui/index.js.map +1 -0
  532. package/ccw/dist/core/auth/csrf-middleware.d.ts.map +1 -1
  533. package/ccw/dist/core/auth/csrf-middleware.js +26 -8
  534. package/ccw/dist/core/auth/csrf-middleware.js.map +1 -1
  535. package/ccw/dist/core/auth/middleware.d.ts.map +1 -1
  536. package/ccw/dist/core/auth/middleware.js +55 -0
  537. package/ccw/dist/core/auth/middleware.js.map +1 -1
  538. package/ccw/dist/core/core-memory-store.d.ts +99 -5
  539. package/ccw/dist/core/core-memory-store.d.ts.map +1 -1
  540. package/ccw/dist/core/core-memory-store.js +389 -56
  541. package/ccw/dist/core/core-memory-store.js.map +1 -1
  542. package/ccw/dist/core/data-aggregator.d.ts +6 -0
  543. package/ccw/dist/core/data-aggregator.d.ts.map +1 -1
  544. package/ccw/dist/core/data-aggregator.js +6 -35
  545. package/ccw/dist/core/data-aggregator.js.map +1 -1
  546. package/ccw/dist/core/hooks/context-limit-detector.d.ts +65 -0
  547. package/ccw/dist/core/hooks/context-limit-detector.d.ts.map +1 -0
  548. package/ccw/dist/core/hooks/context-limit-detector.js +91 -0
  549. package/ccw/dist/core/hooks/context-limit-detector.js.map +1 -0
  550. package/ccw/dist/core/hooks/index.d.ts +11 -0
  551. package/ccw/dist/core/hooks/index.d.ts.map +1 -0
  552. package/ccw/dist/core/hooks/index.js +16 -0
  553. package/ccw/dist/core/hooks/index.js.map +1 -0
  554. package/ccw/dist/core/hooks/keyword-detector.d.ts +106 -0
  555. package/ccw/dist/core/hooks/keyword-detector.d.ts.map +1 -0
  556. package/ccw/dist/core/hooks/keyword-detector.js +194 -0
  557. package/ccw/dist/core/hooks/keyword-detector.js.map +1 -0
  558. package/ccw/dist/core/hooks/recovery-handler.d.ts +114 -0
  559. package/ccw/dist/core/hooks/recovery-handler.d.ts.map +1 -0
  560. package/ccw/dist/core/hooks/recovery-handler.js +244 -0
  561. package/ccw/dist/core/hooks/recovery-handler.js.map +1 -0
  562. package/ccw/dist/core/hooks/stop-handler.d.ts +128 -0
  563. package/ccw/dist/core/hooks/stop-handler.d.ts.map +1 -0
  564. package/ccw/dist/core/hooks/stop-handler.js +269 -0
  565. package/ccw/dist/core/hooks/stop-handler.js.map +1 -0
  566. package/ccw/dist/core/hooks/user-abort-detector.d.ts +76 -0
  567. package/ccw/dist/core/hooks/user-abort-detector.d.ts.map +1 -0
  568. package/ccw/dist/core/hooks/user-abort-detector.js +168 -0
  569. package/ccw/dist/core/hooks/user-abort-detector.js.map +1 -0
  570. package/ccw/dist/core/lite-scanner-complete.d.ts +18 -3
  571. package/ccw/dist/core/lite-scanner-complete.d.ts.map +1 -1
  572. package/ccw/dist/core/lite-scanner-complete.js +54 -12
  573. package/ccw/dist/core/lite-scanner-complete.js.map +1 -1
  574. package/ccw/dist/core/lite-scanner.d.ts +74 -3
  575. package/ccw/dist/core/lite-scanner.d.ts.map +1 -1
  576. package/ccw/dist/core/lite-scanner.js +57 -12
  577. package/ccw/dist/core/lite-scanner.js.map +1 -1
  578. package/ccw/dist/core/memory-consolidation-pipeline.d.ts +126 -0
  579. package/ccw/dist/core/memory-consolidation-pipeline.d.ts.map +1 -0
  580. package/ccw/dist/core/memory-consolidation-pipeline.js +364 -0
  581. package/ccw/dist/core/memory-consolidation-pipeline.js.map +1 -0
  582. package/ccw/dist/core/memory-consolidation-prompts.d.ts +27 -0
  583. package/ccw/dist/core/memory-consolidation-prompts.d.ts.map +1 -0
  584. package/ccw/dist/core/memory-consolidation-prompts.js +103 -0
  585. package/ccw/dist/core/memory-consolidation-prompts.js.map +1 -0
  586. package/ccw/dist/core/memory-embedder-bridge.d.ts +22 -0
  587. package/ccw/dist/core/memory-embedder-bridge.d.ts.map +1 -1
  588. package/ccw/dist/core/memory-embedder-bridge.js +85 -0
  589. package/ccw/dist/core/memory-embedder-bridge.js.map +1 -1
  590. package/ccw/dist/core/memory-extraction-pipeline.d.ts +244 -0
  591. package/ccw/dist/core/memory-extraction-pipeline.d.ts.map +1 -0
  592. package/ccw/dist/core/memory-extraction-pipeline.js +934 -0
  593. package/ccw/dist/core/memory-extraction-pipeline.js.map +1 -0
  594. package/ccw/dist/core/memory-extraction-prompts.d.ts +29 -0
  595. package/ccw/dist/core/memory-extraction-prompts.d.ts.map +1 -0
  596. package/ccw/dist/core/memory-extraction-prompts.js +99 -0
  597. package/ccw/dist/core/memory-extraction-prompts.js.map +1 -0
  598. package/ccw/dist/core/memory-job-scheduler.d.ts +92 -0
  599. package/ccw/dist/core/memory-job-scheduler.d.ts.map +1 -0
  600. package/ccw/dist/core/memory-job-scheduler.js +264 -0
  601. package/ccw/dist/core/memory-job-scheduler.js.map +1 -0
  602. package/ccw/dist/core/memory-v2-config.d.ts +48 -0
  603. package/ccw/dist/core/memory-v2-config.d.ts.map +1 -0
  604. package/ccw/dist/core/memory-v2-config.js +51 -0
  605. package/ccw/dist/core/memory-v2-config.js.map +1 -0
  606. package/ccw/dist/core/mode-workflow-map.d.ts +148 -0
  607. package/ccw/dist/core/mode-workflow-map.d.ts.map +1 -0
  608. package/ccw/dist/core/mode-workflow-map.js +271 -0
  609. package/ccw/dist/core/mode-workflow-map.js.map +1 -0
  610. package/ccw/dist/core/pattern-detector.d.ts +99 -0
  611. package/ccw/dist/core/pattern-detector.d.ts.map +1 -0
  612. package/ccw/dist/core/pattern-detector.js +385 -0
  613. package/ccw/dist/core/pattern-detector.js.map +1 -0
  614. package/ccw/dist/core/routes/analysis-routes.d.ts +40 -0
  615. package/ccw/dist/core/routes/analysis-routes.d.ts.map +1 -0
  616. package/ccw/dist/core/routes/analysis-routes.js +172 -0
  617. package/ccw/dist/core/routes/analysis-routes.js.map +1 -0
  618. package/ccw/dist/core/routes/audit-routes.d.ts +14 -0
  619. package/ccw/dist/core/routes/audit-routes.d.ts.map +1 -0
  620. package/ccw/dist/core/routes/audit-routes.js +150 -0
  621. package/ccw/dist/core/routes/audit-routes.js.map +1 -0
  622. package/ccw/dist/core/routes/ccw-routes.d.ts.map +1 -1
  623. package/ccw/dist/core/routes/ccw-routes.js +87 -0
  624. package/ccw/dist/core/routes/ccw-routes.js.map +1 -1
  625. package/ccw/dist/core/routes/claude-routes.js +13 -13
  626. package/ccw/dist/core/routes/claude-routes.js.map +1 -1
  627. package/ccw/dist/core/routes/cli-routes.d.ts +6 -2
  628. package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
  629. package/ccw/dist/core/routes/cli-routes.js +308 -22
  630. package/ccw/dist/core/routes/cli-routes.js.map +1 -1
  631. package/ccw/dist/core/routes/cli-sessions-routes.d.ts +20 -0
  632. package/ccw/dist/core/routes/cli-sessions-routes.d.ts.map +1 -0
  633. package/ccw/dist/core/routes/cli-sessions-routes.js +449 -0
  634. package/ccw/dist/core/routes/cli-sessions-routes.js.map +1 -0
  635. package/ccw/dist/core/routes/cli-settings-routes.d.ts.map +1 -1
  636. package/ccw/dist/core/routes/cli-settings-routes.js +217 -3
  637. package/ccw/dist/core/routes/cli-settings-routes.js.map +1 -1
  638. package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -1
  639. package/ccw/dist/core/routes/codexlens/config-handlers.js +164 -26
  640. package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -1
  641. package/ccw/dist/core/routes/codexlens/index-handlers.d.ts.map +1 -1
  642. package/ccw/dist/core/routes/codexlens/index-handlers.js +98 -1
  643. package/ccw/dist/core/routes/codexlens/index-handlers.js.map +1 -1
  644. package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts.map +1 -1
  645. package/ccw/dist/core/routes/codexlens/semantic-handlers.js +308 -0
  646. package/ccw/dist/core/routes/codexlens/semantic-handlers.js.map +1 -1
  647. package/ccw/dist/core/routes/commands-routes.d.ts.map +1 -1
  648. package/ccw/dist/core/routes/commands-routes.js +399 -1
  649. package/ccw/dist/core/routes/commands-routes.js.map +1 -1
  650. package/ccw/dist/core/routes/config-routes.d.ts +22 -0
  651. package/ccw/dist/core/routes/config-routes.d.ts.map +1 -0
  652. package/ccw/dist/core/routes/config-routes.js +291 -0
  653. package/ccw/dist/core/routes/config-routes.js.map +1 -0
  654. package/ccw/dist/core/routes/core-memory-routes.d.ts.map +1 -1
  655. package/ccw/dist/core/routes/core-memory-routes.js +461 -5
  656. package/ccw/dist/core/routes/core-memory-routes.js.map +1 -1
  657. package/ccw/dist/core/routes/dashboard-routes.d.ts +15 -0
  658. package/ccw/dist/core/routes/dashboard-routes.d.ts.map +1 -0
  659. package/ccw/dist/core/routes/dashboard-routes.js +121 -0
  660. package/ccw/dist/core/routes/dashboard-routes.js.map +1 -0
  661. package/ccw/dist/core/routes/files-routes.d.ts.map +1 -1
  662. package/ccw/dist/core/routes/files-routes.js +296 -8
  663. package/ccw/dist/core/routes/files-routes.js.map +1 -1
  664. package/ccw/dist/core/routes/hooks-routes.d.ts.map +1 -1
  665. package/ccw/dist/core/routes/hooks-routes.js +274 -67
  666. package/ccw/dist/core/routes/hooks-routes.js.map +1 -1
  667. package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
  668. package/ccw/dist/core/routes/issue-routes.js +399 -27
  669. package/ccw/dist/core/routes/issue-routes.js.map +1 -1
  670. package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
  671. package/ccw/dist/core/routes/litellm-api-routes.js +74 -135
  672. package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
  673. package/ccw/dist/core/routes/mcp-routes.d.ts.map +1 -1
  674. package/ccw/dist/core/routes/mcp-routes.js +79 -15
  675. package/ccw/dist/core/routes/mcp-routes.js.map +1 -1
  676. package/ccw/dist/core/routes/mcp-templates-db.d.ts.map +1 -1
  677. package/ccw/dist/core/routes/mcp-templates-db.js +20 -7
  678. package/ccw/dist/core/routes/mcp-templates-db.js.map +1 -1
  679. package/ccw/dist/core/routes/memory-routes.d.ts.map +1 -1
  680. package/ccw/dist/core/routes/memory-routes.js +137 -0
  681. package/ccw/dist/core/routes/memory-routes.js.map +1 -1
  682. package/ccw/dist/core/routes/notification-routes.d.ts +10 -0
  683. package/ccw/dist/core/routes/notification-routes.d.ts.map +1 -0
  684. package/ccw/dist/core/routes/notification-routes.js +507 -0
  685. package/ccw/dist/core/routes/notification-routes.js.map +1 -0
  686. package/ccw/dist/core/routes/orchestrator-routes.d.ts +282 -0
  687. package/ccw/dist/core/routes/orchestrator-routes.d.ts.map +1 -0
  688. package/ccw/dist/core/routes/orchestrator-routes.js +1564 -0
  689. package/ccw/dist/core/routes/orchestrator-routes.js.map +1 -0
  690. package/ccw/dist/core/routes/provider-routes.d.ts +4 -0
  691. package/ccw/dist/core/routes/provider-routes.d.ts.map +1 -1
  692. package/ccw/dist/core/routes/provider-routes.js +45 -11
  693. package/ccw/dist/core/routes/provider-routes.js.map +1 -1
  694. package/ccw/dist/core/routes/queue-routes.d.ts +22 -0
  695. package/ccw/dist/core/routes/queue-routes.d.ts.map +1 -0
  696. package/ccw/dist/core/routes/queue-routes.js +164 -0
  697. package/ccw/dist/core/routes/queue-routes.js.map +1 -0
  698. package/ccw/dist/core/routes/skill-hub-routes.d.ts +77 -0
  699. package/ccw/dist/core/routes/skill-hub-routes.d.ts.map +1 -0
  700. package/ccw/dist/core/routes/skill-hub-routes.js +988 -0
  701. package/ccw/dist/core/routes/skill-hub-routes.js.map +1 -0
  702. package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
  703. package/ccw/dist/core/routes/skills-routes.js +105 -62
  704. package/ccw/dist/core/routes/skills-routes.js.map +1 -1
  705. package/ccw/dist/core/routes/spec-routes.d.ts +7 -0
  706. package/ccw/dist/core/routes/spec-routes.d.ts.map +1 -0
  707. package/ccw/dist/core/routes/spec-routes.js +266 -0
  708. package/ccw/dist/core/routes/spec-routes.js.map +1 -0
  709. package/ccw/dist/core/routes/status-routes.js +4 -4
  710. package/ccw/dist/core/routes/status-routes.js.map +1 -1
  711. package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
  712. package/ccw/dist/core/routes/system-routes.js +537 -6
  713. package/ccw/dist/core/routes/system-routes.js.map +1 -1
  714. package/ccw/dist/core/routes/team-routes.d.ts +27 -0
  715. package/ccw/dist/core/routes/team-routes.d.ts.map +1 -0
  716. package/ccw/dist/core/routes/team-routes.js +557 -0
  717. package/ccw/dist/core/routes/team-routes.js.map +1 -0
  718. package/ccw/dist/core/routes/unified-memory-routes.d.ts +16 -0
  719. package/ccw/dist/core/routes/unified-memory-routes.d.ts.map +1 -0
  720. package/ccw/dist/core/routes/unified-memory-routes.js +135 -0
  721. package/ccw/dist/core/routes/unified-memory-routes.js.map +1 -0
  722. package/ccw/dist/core/routes/unsplash-routes.d.ts +4 -0
  723. package/ccw/dist/core/routes/unsplash-routes.d.ts.map +1 -0
  724. package/ccw/dist/core/routes/unsplash-routes.js +197 -0
  725. package/ccw/dist/core/routes/unsplash-routes.js.map +1 -0
  726. package/ccw/dist/core/schemas/issue-schema.d.ts +115 -0
  727. package/ccw/dist/core/schemas/issue-schema.d.ts.map +1 -0
  728. package/ccw/dist/core/schemas/issue-schema.js +117 -0
  729. package/ccw/dist/core/schemas/issue-schema.js.map +1 -0
  730. package/ccw/dist/core/server.d.ts +1 -0
  731. package/ccw/dist/core/server.d.ts.map +1 -1
  732. package/ccw/dist/core/server.js +223 -218
  733. package/ccw/dist/core/server.js.map +1 -1
  734. package/ccw/dist/core/services/checkpoint-service.d.ts +215 -0
  735. package/ccw/dist/core/services/checkpoint-service.d.ts.map +1 -0
  736. package/ccw/dist/core/services/checkpoint-service.js +376 -0
  737. package/ccw/dist/core/services/checkpoint-service.js.map +1 -0
  738. package/ccw/dist/core/services/cli-instruction-assembler.d.ts +10 -0
  739. package/ccw/dist/core/services/cli-instruction-assembler.d.ts.map +1 -0
  740. package/ccw/dist/core/services/cli-instruction-assembler.js +28 -0
  741. package/ccw/dist/core/services/cli-instruction-assembler.js.map +1 -0
  742. package/ccw/dist/core/services/cli-launch-registry.d.ts +9 -0
  743. package/ccw/dist/core/services/cli-launch-registry.d.ts.map +1 -0
  744. package/ccw/dist/core/services/cli-launch-registry.js +40 -0
  745. package/ccw/dist/core/services/cli-launch-registry.js.map +1 -0
  746. package/ccw/dist/core/services/cli-session-audit.d.ts +15 -0
  747. package/ccw/dist/core/services/cli-session-audit.d.ts.map +1 -0
  748. package/ccw/dist/core/services/cli-session-audit.js +18 -0
  749. package/ccw/dist/core/services/cli-session-audit.js.map +1 -0
  750. package/ccw/dist/core/services/cli-session-command-builder.d.ts +20 -0
  751. package/ccw/dist/core/services/cli-session-command-builder.d.ts.map +1 -0
  752. package/ccw/dist/core/services/cli-session-command-builder.js +66 -0
  753. package/ccw/dist/core/services/cli-session-command-builder.js.map +1 -0
  754. package/ccw/dist/core/services/cli-session-manager.d.ts +84 -0
  755. package/ccw/dist/core/services/cli-session-manager.d.ts.map +1 -0
  756. package/ccw/dist/core/services/cli-session-manager.js +538 -0
  757. package/ccw/dist/core/services/cli-session-manager.js.map +1 -0
  758. package/ccw/dist/core/services/cli-session-mux.d.ts +18 -0
  759. package/ccw/dist/core/services/cli-session-mux.d.ts.map +1 -0
  760. package/ccw/dist/core/services/cli-session-mux.js +18 -0
  761. package/ccw/dist/core/services/cli-session-mux.js.map +1 -0
  762. package/ccw/dist/core/services/cli-session-policy.d.ts +15 -0
  763. package/ccw/dist/core/services/cli-session-policy.d.ts.map +1 -0
  764. package/ccw/dist/core/services/cli-session-policy.js +40 -0
  765. package/ccw/dist/core/services/cli-session-policy.js.map +1 -0
  766. package/ccw/dist/core/services/cli-session-share.d.ts +27 -0
  767. package/ccw/dist/core/services/cli-session-share.d.ts.map +1 -0
  768. package/ccw/dist/core/services/cli-session-share.js +85 -0
  769. package/ccw/dist/core/services/cli-session-share.js.map +1 -0
  770. package/ccw/dist/core/services/config-backup.d.ts +69 -0
  771. package/ccw/dist/core/services/config-backup.d.ts.map +1 -0
  772. package/ccw/dist/core/services/config-backup.js +171 -0
  773. package/ccw/dist/core/services/config-backup.js.map +1 -0
  774. package/ccw/dist/core/services/config-sync.d.ts +73 -0
  775. package/ccw/dist/core/services/config-sync.d.ts.map +1 -0
  776. package/ccw/dist/core/services/config-sync.js +235 -0
  777. package/ccw/dist/core/services/config-sync.js.map +1 -0
  778. package/ccw/dist/core/services/flow-executor.d.ts +204 -0
  779. package/ccw/dist/core/services/flow-executor.d.ts.map +1 -0
  780. package/ccw/dist/core/services/flow-executor.js +775 -0
  781. package/ccw/dist/core/services/flow-executor.js.map +1 -0
  782. package/ccw/dist/core/services/hook-context-service.d.ts +139 -0
  783. package/ccw/dist/core/services/hook-context-service.d.ts.map +1 -0
  784. package/ccw/dist/core/services/hook-context-service.js +248 -0
  785. package/ccw/dist/core/services/hook-context-service.js.map +1 -0
  786. package/ccw/dist/core/services/index.d.ts +22 -0
  787. package/ccw/dist/core/services/index.d.ts.map +1 -0
  788. package/ccw/dist/core/services/index.js +22 -0
  789. package/ccw/dist/core/services/index.js.map +1 -0
  790. package/ccw/dist/core/services/issue-service.d.ts +54 -0
  791. package/ccw/dist/core/services/issue-service.d.ts.map +1 -0
  792. package/ccw/dist/core/services/issue-service.js +107 -0
  793. package/ccw/dist/core/services/issue-service.js.map +1 -0
  794. package/ccw/dist/core/services/mode-registry-service.d.ts +254 -0
  795. package/ccw/dist/core/services/mode-registry-service.d.ts.map +1 -0
  796. package/ccw/dist/core/services/mode-registry-service.js +587 -0
  797. package/ccw/dist/core/services/mode-registry-service.js.map +1 -0
  798. package/ccw/dist/core/services/pending-question-service.d.ts +51 -0
  799. package/ccw/dist/core/services/pending-question-service.d.ts.map +1 -0
  800. package/ccw/dist/core/services/pending-question-service.js +201 -0
  801. package/ccw/dist/core/services/pending-question-service.js.map +1 -0
  802. package/ccw/dist/core/services/queue-scheduler-service.d.ts +136 -0
  803. package/ccw/dist/core/services/queue-scheduler-service.d.ts.map +1 -0
  804. package/ccw/dist/core/services/queue-scheduler-service.js +587 -0
  805. package/ccw/dist/core/services/queue-scheduler-service.js.map +1 -0
  806. package/ccw/dist/core/services/rate-limiter.d.ts +20 -0
  807. package/ccw/dist/core/services/rate-limiter.d.ts.map +1 -0
  808. package/ccw/dist/core/services/rate-limiter.js +33 -0
  809. package/ccw/dist/core/services/rate-limiter.js.map +1 -0
  810. package/ccw/dist/core/services/remote-notification-service.d.ts +132 -0
  811. package/ccw/dist/core/services/remote-notification-service.d.ts.map +1 -0
  812. package/ccw/dist/core/services/remote-notification-service.js +953 -0
  813. package/ccw/dist/core/services/remote-notification-service.js.map +1 -0
  814. package/ccw/dist/core/services/session-end-service.d.ts +155 -0
  815. package/ccw/dist/core/services/session-end-service.d.ts.map +1 -0
  816. package/ccw/dist/core/services/session-end-service.js +302 -0
  817. package/ccw/dist/core/services/session-end-service.js.map +1 -0
  818. package/ccw/dist/core/services/session-state-service.d.ts +148 -0
  819. package/ccw/dist/core/services/session-state-service.d.ts.map +1 -0
  820. package/ccw/dist/core/services/session-state-service.js +259 -0
  821. package/ccw/dist/core/services/session-state-service.js.map +1 -0
  822. package/ccw/dist/core/services/version-checker.d.ts +50 -0
  823. package/ccw/dist/core/services/version-checker.d.ts.map +1 -0
  824. package/ccw/dist/core/services/version-checker.js +141 -0
  825. package/ccw/dist/core/services/version-checker.js.map +1 -0
  826. package/ccw/dist/core/session-clustering-service.d.ts +43 -2
  827. package/ccw/dist/core/session-clustering-service.d.ts.map +1 -1
  828. package/ccw/dist/core/session-clustering-service.js +210 -6
  829. package/ccw/dist/core/session-clustering-service.js.map +1 -1
  830. package/ccw/dist/core/types/issue.d.ts +103 -0
  831. package/ccw/dist/core/types/issue.d.ts.map +1 -0
  832. package/ccw/dist/core/types/issue.js +6 -0
  833. package/ccw/dist/core/types/issue.js.map +1 -0
  834. package/ccw/dist/core/unified-context-builder.d.ts +88 -0
  835. package/ccw/dist/core/unified-context-builder.d.ts.map +1 -0
  836. package/ccw/dist/core/unified-context-builder.js +379 -0
  837. package/ccw/dist/core/unified-context-builder.js.map +1 -0
  838. package/ccw/dist/core/unified-memory-service.d.ts +142 -0
  839. package/ccw/dist/core/unified-memory-service.d.ts.map +1 -0
  840. package/ccw/dist/core/unified-memory-service.js +348 -0
  841. package/ccw/dist/core/unified-memory-service.js.map +1 -0
  842. package/ccw/dist/core/unified-vector-index.d.ts +171 -0
  843. package/ccw/dist/core/unified-vector-index.d.ts.map +1 -0
  844. package/ccw/dist/core/unified-vector-index.js +332 -0
  845. package/ccw/dist/core/unified-vector-index.js.map +1 -0
  846. package/ccw/dist/core/websocket.d.ts +195 -0
  847. package/ccw/dist/core/websocket.d.ts.map +1 -1
  848. package/ccw/dist/core/websocket.js +156 -25
  849. package/ccw/dist/core/websocket.js.map +1 -1
  850. package/ccw/dist/index.d.ts +0 -1
  851. package/ccw/dist/index.d.ts.map +1 -1
  852. package/ccw/dist/index.js +0 -1
  853. package/ccw/dist/index.js.map +1 -1
  854. package/ccw/dist/mcp-server/index.js +16 -8
  855. package/ccw/dist/mcp-server/index.js.map +1 -1
  856. package/ccw/dist/tools/ask-question.d.ts +43 -0
  857. package/ccw/dist/tools/ask-question.d.ts.map +1 -0
  858. package/ccw/dist/tools/ask-question.js +1061 -0
  859. package/ccw/dist/tools/ask-question.js.map +1 -0
  860. package/ccw/dist/tools/claude-cli-tools.d.ts +18 -4
  861. package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
  862. package/ccw/dist/tools/claude-cli-tools.js +44 -37
  863. package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
  864. package/ccw/dist/tools/claude-session-parser.d.ts +116 -0
  865. package/ccw/dist/tools/claude-session-parser.d.ts.map +1 -0
  866. package/ccw/dist/tools/claude-session-parser.js +364 -0
  867. package/ccw/dist/tools/claude-session-parser.js.map +1 -0
  868. package/ccw/dist/tools/cli-config-manager.d.ts +3 -0
  869. package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
  870. package/ccw/dist/tools/cli-config-manager.js +4 -1
  871. package/ccw/dist/tools/cli-config-manager.js.map +1 -1
  872. package/ccw/dist/tools/cli-executor-core.d.ts +24 -0
  873. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
  874. package/ccw/dist/tools/cli-executor-core.js +103 -8
  875. package/ccw/dist/tools/cli-executor-core.js.map +1 -1
  876. package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
  877. package/ccw/dist/tools/cli-executor-state.js +4 -4
  878. package/ccw/dist/tools/cli-executor-state.js.map +1 -1
  879. package/ccw/dist/tools/cli-executor-utils.d.ts +2 -0
  880. package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -1
  881. package/ccw/dist/tools/cli-executor-utils.js +14 -5
  882. package/ccw/dist/tools/cli-executor-utils.js.map +1 -1
  883. package/ccw/dist/tools/cli-history-store.d.ts +11 -6
  884. package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
  885. package/ccw/dist/tools/cli-history-store.js +134 -17
  886. package/ccw/dist/tools/cli-history-store.js.map +1 -1
  887. package/ccw/dist/tools/cli-output-converter.d.ts +7 -0
  888. package/ccw/dist/tools/cli-output-converter.d.ts.map +1 -1
  889. package/ccw/dist/tools/cli-output-converter.js +166 -16
  890. package/ccw/dist/tools/cli-output-converter.js.map +1 -1
  891. package/ccw/dist/tools/codex-lens.d.ts +13 -0
  892. package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
  893. package/ccw/dist/tools/codex-lens.js +200 -185
  894. package/ccw/dist/tools/codex-lens.js.map +1 -1
  895. package/ccw/dist/tools/command-registry.test.js +727 -0
  896. package/ccw/dist/tools/core-memory.d.ts +35 -1
  897. package/ccw/dist/tools/core-memory.d.ts.map +1 -1
  898. package/ccw/dist/tools/core-memory.js +195 -5
  899. package/ccw/dist/tools/core-memory.js.map +1 -1
  900. package/ccw/dist/tools/edit-file.d.ts.map +1 -1
  901. package/ccw/dist/tools/edit-file.js +69 -31
  902. package/ccw/dist/tools/edit-file.js.map +1 -1
  903. package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -1
  904. package/ccw/dist/tools/generate-module-docs.js +9 -14
  905. package/ccw/dist/tools/generate-module-docs.js.map +1 -1
  906. package/ccw/dist/tools/index.d.ts.map +1 -1
  907. package/ccw/dist/tools/index.js +8 -2
  908. package/ccw/dist/tools/index.js.map +1 -1
  909. package/ccw/dist/tools/native-session-discovery.d.ts +19 -2
  910. package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -1
  911. package/ccw/dist/tools/native-session-discovery.js +191 -20
  912. package/ccw/dist/tools/native-session-discovery.js.map +1 -1
  913. package/ccw/dist/tools/opencode-session-parser.d.ts +120 -0
  914. package/ccw/dist/tools/opencode-session-parser.d.ts.map +1 -0
  915. package/ccw/dist/tools/opencode-session-parser.js +330 -0
  916. package/ccw/dist/tools/opencode-session-parser.js.map +1 -0
  917. package/ccw/dist/tools/read-file.d.ts +5 -24
  918. package/ccw/dist/tools/read-file.d.ts.map +1 -1
  919. package/ccw/dist/tools/read-file.js +44 -282
  920. package/ccw/dist/tools/read-file.js.map +1 -1
  921. package/ccw/dist/tools/read-many-files.d.ts +15 -0
  922. package/ccw/dist/tools/read-many-files.d.ts.map +1 -0
  923. package/ccw/dist/tools/read-many-files.js +166 -0
  924. package/ccw/dist/tools/read-many-files.js.map +1 -0
  925. package/ccw/dist/tools/read-outline.d.ts +13 -0
  926. package/ccw/dist/tools/read-outline.d.ts.map +1 -0
  927. package/ccw/dist/tools/read-outline.js +86 -0
  928. package/ccw/dist/tools/read-outline.js.map +1 -0
  929. package/ccw/dist/tools/resume-strategy.d.ts.map +1 -1
  930. package/ccw/dist/tools/resume-strategy.js +16 -0
  931. package/ccw/dist/tools/resume-strategy.js.map +1 -1
  932. package/ccw/dist/tools/session-content-parser.d.ts +3 -3
  933. package/ccw/dist/tools/session-content-parser.d.ts.map +1 -1
  934. package/ccw/dist/tools/session-content-parser.js +40 -10
  935. package/ccw/dist/tools/session-content-parser.js.map +1 -1
  936. package/ccw/dist/tools/spec-index-builder.d.ts +140 -0
  937. package/ccw/dist/tools/spec-index-builder.d.ts.map +1 -0
  938. package/ccw/dist/tools/spec-index-builder.js +340 -0
  939. package/ccw/dist/tools/spec-index-builder.js.map +1 -0
  940. package/ccw/dist/tools/spec-init.d.ts +46 -0
  941. package/ccw/dist/tools/spec-init.d.ts.map +1 -0
  942. package/ccw/dist/tools/spec-init.js +226 -0
  943. package/ccw/dist/tools/spec-init.js.map +1 -0
  944. package/ccw/dist/tools/spec-keyword-extractor.d.ts +52 -0
  945. package/ccw/dist/tools/spec-keyword-extractor.d.ts.map +1 -0
  946. package/ccw/dist/tools/spec-keyword-extractor.js +183 -0
  947. package/ccw/dist/tools/spec-keyword-extractor.js.map +1 -0
  948. package/ccw/dist/tools/spec-loader.d.ts +119 -0
  949. package/ccw/dist/tools/spec-loader.d.ts.map +1 -0
  950. package/ccw/dist/tools/spec-loader.js +326 -0
  951. package/ccw/dist/tools/spec-loader.js.map +1 -0
  952. package/ccw/dist/tools/team-msg.d.ts +61 -0
  953. package/ccw/dist/tools/team-msg.d.ts.map +1 -0
  954. package/ccw/dist/tools/team-msg.js +331 -0
  955. package/ccw/dist/tools/team-msg.js.map +1 -0
  956. package/ccw/dist/tools/template-discovery.d.ts +1 -1
  957. package/ccw/dist/tools/template-discovery.js +2 -2
  958. package/ccw/dist/tools/template-discovery.js.map +1 -1
  959. package/ccw/dist/tools/ui-generate-preview.js +7 -7
  960. package/ccw/dist/tools/ui-generate-preview.js.map +1 -1
  961. package/ccw/dist/tools/update-module-claude.d.ts.map +1 -1
  962. package/ccw/dist/tools/update-module-claude.js +18 -32
  963. package/ccw/dist/tools/update-module-claude.js.map +1 -1
  964. package/ccw/dist/types/cli-settings.d.ts +139 -9
  965. package/ccw/dist/types/cli-settings.d.ts.map +1 -1
  966. package/ccw/dist/types/cli-settings.js +67 -13
  967. package/ccw/dist/types/cli-settings.js.map +1 -1
  968. package/ccw/dist/types/queue-types.d.ts +156 -0
  969. package/ccw/dist/types/queue-types.d.ts.map +1 -0
  970. package/ccw/dist/types/queue-types.js +6 -0
  971. package/ccw/dist/types/queue-types.js.map +1 -0
  972. package/ccw/dist/types/remote-notification.d.ts +209 -0
  973. package/ccw/dist/types/remote-notification.d.ts.map +1 -0
  974. package/ccw/dist/types/remote-notification.js +86 -0
  975. package/ccw/dist/types/remote-notification.js.map +1 -0
  976. package/ccw/dist/types/util.d.ts +28 -0
  977. package/ccw/dist/types/util.d.ts.map +1 -0
  978. package/ccw/dist/types/util.js +35 -0
  979. package/ccw/dist/types/util.js.map +1 -0
  980. package/ccw/dist/utils/dashboard-launcher.d.ts +36 -0
  981. package/ccw/dist/utils/dashboard-launcher.d.ts.map +1 -0
  982. package/ccw/dist/utils/dashboard-launcher.js +166 -0
  983. package/ccw/dist/utils/dashboard-launcher.js.map +1 -0
  984. package/ccw/dist/utils/db-loader.d.ts +15 -0
  985. package/ccw/dist/utils/db-loader.d.ts.map +1 -0
  986. package/ccw/dist/utils/db-loader.js +51 -0
  987. package/ccw/dist/utils/db-loader.js.map +1 -0
  988. package/ccw/dist/utils/file-reader.d.ts +73 -0
  989. package/ccw/dist/utils/file-reader.d.ts.map +1 -0
  990. package/ccw/dist/utils/file-reader.js +201 -0
  991. package/ccw/dist/utils/file-reader.js.map +1 -0
  992. package/ccw/dist/utils/outline-parser.d.ts +28 -0
  993. package/ccw/dist/utils/outline-parser.d.ts.map +1 -0
  994. package/ccw/dist/utils/outline-parser.js +273 -0
  995. package/ccw/dist/utils/outline-parser.js.map +1 -0
  996. package/ccw/dist/utils/outline-queries.d.ts +15 -0
  997. package/ccw/dist/utils/outline-queries.d.ts.map +1 -0
  998. package/ccw/dist/utils/outline-queries.js +141 -0
  999. package/ccw/dist/utils/outline-queries.js.map +1 -0
  1000. package/ccw/dist/utils/package-discovery.d.ts +69 -0
  1001. package/ccw/dist/utils/package-discovery.d.ts.map +1 -0
  1002. package/ccw/dist/utils/package-discovery.js +258 -0
  1003. package/ccw/dist/utils/package-discovery.js.map +1 -0
  1004. package/ccw/dist/utils/path-validator.d.ts +3 -3
  1005. package/ccw/dist/utils/path-validator.d.ts.map +1 -1
  1006. package/ccw/dist/utils/path-validator.js +12 -12
  1007. package/ccw/dist/utils/path-validator.js.map +1 -1
  1008. package/ccw/dist/utils/react-frontend.d.ts +19 -0
  1009. package/ccw/dist/utils/react-frontend.d.ts.map +1 -0
  1010. package/ccw/dist/utils/react-frontend.js +203 -0
  1011. package/ccw/dist/utils/react-frontend.js.map +1 -0
  1012. package/ccw/dist/utils/secret-redactor.d.ts +23 -0
  1013. package/ccw/dist/utils/secret-redactor.d.ts.map +1 -0
  1014. package/ccw/dist/utils/secret-redactor.js +48 -0
  1015. package/ccw/dist/utils/secret-redactor.js.map +1 -0
  1016. package/ccw/dist/utils/security-validation.d.ts +48 -0
  1017. package/ccw/dist/utils/security-validation.d.ts.map +1 -0
  1018. package/ccw/dist/utils/security-validation.js +117 -0
  1019. package/ccw/dist/utils/security-validation.js.map +1 -0
  1020. package/ccw/dist/utils/uv-manager.d.ts +3 -2
  1021. package/ccw/dist/utils/uv-manager.d.ts.map +1 -1
  1022. package/ccw/dist/utils/uv-manager.js +7 -4
  1023. package/ccw/dist/utils/uv-manager.js.map +1 -1
  1024. package/ccw/scripts/prepublish-clean.mjs +32 -0
  1025. package/ccw/scripts/unified_memory_embedder.py +473 -0
  1026. package/codex-lens/pyproject.toml +37 -46
  1027. package/codex-lens/src/codexlens/api/__init__.py +5 -0
  1028. package/codex-lens/src/codexlens/api/lsp_lifecycle.py +124 -0
  1029. package/codex-lens/src/codexlens/api/semantic.py +33 -22
  1030. package/codex-lens/src/codexlens/cli/commands.py +392 -552
  1031. package/codex-lens/src/codexlens/cli/embedding_manager.py +558 -367
  1032. package/codex-lens/src/codexlens/config.py +525 -129
  1033. package/codex-lens/src/codexlens/env_config.py +21 -1
  1034. package/codex-lens/src/codexlens/lsp/keepalive_bridge.py +135 -0
  1035. package/codex-lens/src/codexlens/lsp/lsp_bridge.py +33 -10
  1036. package/codex-lens/src/codexlens/lsp/lsp_graph_builder.py +12 -4
  1037. package/codex-lens/src/codexlens/lsp/standalone_manager.py +114 -21
  1038. package/codex-lens/src/codexlens/parsers/__init__.py +8 -2
  1039. package/codex-lens/src/codexlens/parsers/astgrep_binding.py +320 -0
  1040. package/codex-lens/src/codexlens/parsers/astgrep_js_ts_processor.py +306 -0
  1041. package/codex-lens/src/codexlens/parsers/astgrep_processor.py +1033 -0
  1042. package/codex-lens/src/codexlens/parsers/factory.py +10 -2
  1043. package/codex-lens/src/codexlens/parsers/patterns/__init__.py +5 -0
  1044. package/codex-lens/src/codexlens/parsers/patterns/javascript/__init__.py +92 -0
  1045. package/codex-lens/src/codexlens/parsers/patterns/python/__init__.py +204 -0
  1046. package/codex-lens/src/codexlens/parsers/patterns/python/call.yaml +87 -0
  1047. package/codex-lens/src/codexlens/parsers/patterns/python/imports.yaml +82 -0
  1048. package/codex-lens/src/codexlens/parsers/patterns/python/inherits.yaml +42 -0
  1049. package/codex-lens/src/codexlens/parsers/patterns/typescript/__init__.py +73 -0
  1050. package/codex-lens/src/codexlens/parsers/treesitter_parser.py +135 -9
  1051. package/codex-lens/src/codexlens/search/__init__.py +2 -0
  1052. package/codex-lens/src/codexlens/search/binary_searcher.py +67 -35
  1053. package/codex-lens/src/codexlens/search/chain_search.py +825 -251
  1054. package/codex-lens/src/codexlens/search/clustering/hdbscan_strategy.py +24 -2
  1055. package/codex-lens/src/codexlens/search/global_graph_expander.py +250 -0
  1056. package/codex-lens/src/codexlens/search/hybrid_search.py +11 -203
  1057. package/codex-lens/src/codexlens/search/ranking.py +8 -35
  1058. package/codex-lens/src/codexlens/semantic/reranker/api_reranker.py +41 -2
  1059. package/codex-lens/src/codexlens/storage/global_index.py +225 -5
  1060. package/codex-lens/src/codexlens/storage/index_tree.py +46 -0
  1061. package/codex-lens/src/codexlens/storage/path_mapper.py +8 -8
  1062. package/codex-lens/src/codexlens/watcher/incremental_indexer.py +55 -1
  1063. package/package.json +102 -92
  1064. package/.claude/CLAUDE.md +0 -44
  1065. package/.claude/commands/ccw-debug.md +0 -832
  1066. package/.claude/commands/codex-coordinator.md +0 -513
  1067. package/.claude/commands/memory/compact.md +0 -383
  1068. package/.claude/commands/memory/docs-full-cli.md +0 -471
  1069. package/.claude/commands/memory/docs-related-cli.md +0 -386
  1070. package/.claude/commands/memory/load.md +0 -240
  1071. package/.claude/commands/memory/tips.md +0 -332
  1072. package/.claude/commands/memory/update-full.md +0 -332
  1073. package/.claude/commands/memory/update-related.md +0 -332
  1074. package/.claude/commands/view.md +0 -367
  1075. package/.claude/commands/workflow/brainstorm/artifacts.md +0 -457
  1076. package/.claude/commands/workflow/brainstorm/auto-parallel.md +0 -433
  1077. package/.claude/commands/workflow/brainstorm/role-analysis.md +0 -705
  1078. package/.claude/commands/workflow/brainstorm/synthesis.md +0 -402
  1079. package/.claude/commands/workflow/execute.md +0 -548
  1080. package/.claude/commands/workflow/lite-execute.md +0 -743
  1081. package/.claude/commands/workflow/lite-fix.md +0 -809
  1082. package/.claude/commands/workflow/lite-lite-lite.md +0 -465
  1083. package/.claude/commands/workflow/lite-plan.md +0 -698
  1084. package/.claude/commands/workflow/multi-cli-plan.md +0 -572
  1085. package/.claude/commands/workflow/plan-verify.md +0 -362
  1086. package/.claude/commands/workflow/plan.md +0 -691
  1087. package/.claude/commands/workflow/replan.md +0 -648
  1088. package/.claude/commands/workflow/review-cycle-fix.md +0 -608
  1089. package/.claude/commands/workflow/review-module-cycle.md +0 -771
  1090. package/.claude/commands/workflow/review-session-cycle.md +0 -782
  1091. package/.claude/commands/workflow/review.md +0 -322
  1092. package/.claude/commands/workflow/tdd-plan.md +0 -630
  1093. package/.claude/commands/workflow/tdd-verify.md +0 -585
  1094. package/.claude/commands/workflow/test-cycle-execute.md +0 -504
  1095. package/.claude/commands/workflow/test-fix-gen.md +0 -699
  1096. package/.claude/commands/workflow/test-gen.md +0 -529
  1097. package/.claude/commands/workflow/tools/conflict-resolution.md +0 -604
  1098. package/.claude/commands/workflow/tools/context-gather.md +0 -404
  1099. package/.claude/commands/workflow/tools/task-generate-agent.md +0 -667
  1100. package/.claude/commands/workflow/tools/task-generate-tdd.md +0 -749
  1101. package/.claude/commands/workflow/tools/tdd-coverage-analysis.md +0 -309
  1102. package/.claude/commands/workflow/tools/test-concept-enhanced.md +0 -164
  1103. package/.claude/commands/workflow/tools/test-context-gather.md +0 -235
  1104. package/.claude/commands/workflow/tools/test-task-generate.md +0 -255
  1105. package/.claude/skills/ccw-loop/SKILL.md +0 -259
  1106. package/.claude/skills/ccw-loop/phases/actions/action-complete.md +0 -320
  1107. package/.claude/skills/ccw-loop/phases/actions/action-debug-with-file.md +0 -485
  1108. package/.claude/skills/ccw-loop/phases/actions/action-develop-with-file.md +0 -365
  1109. package/.claude/skills/ccw-loop/phases/actions/action-init.md +0 -200
  1110. package/.claude/skills/ccw-loop/phases/actions/action-menu.md +0 -192
  1111. package/.claude/skills/ccw-loop/phases/actions/action-validate-with-file.md +0 -307
  1112. package/.claude/skills/ccw-loop/phases/orchestrator.md +0 -486
  1113. package/.claude/skills/ccw-loop/phases/state-schema.md +0 -474
  1114. package/.claude/skills/ccw-loop/specs/action-catalog.md +0 -300
  1115. package/.claude/skills/ccw-loop/specs/loop-requirements.md +0 -192
  1116. package/.claude/skills/ccw-loop/templates/progress-template.md +0 -175
  1117. package/.claude/skills/ccw-loop/templates/understanding-template.md +0 -303
  1118. package/.claude/skills/ccw-loop/templates/validation-template.md +0 -258
  1119. package/.claude/skills/copyright-docs/SKILL.md +0 -132
  1120. package/.claude/skills/copyright-docs/phases/01-metadata-collection.md +0 -78
  1121. package/.claude/skills/copyright-docs/phases/01.5-project-exploration.md +0 -150
  1122. package/.claude/skills/copyright-docs/phases/02-deep-analysis.md +0 -664
  1123. package/.claude/skills/copyright-docs/phases/02.5-consolidation.md +0 -192
  1124. package/.claude/skills/copyright-docs/phases/04-document-assembly.md +0 -261
  1125. package/.claude/skills/copyright-docs/phases/05-compliance-refinement.md +0 -192
  1126. package/.claude/skills/copyright-docs/specs/cpcc-requirements.md +0 -121
  1127. package/.claude/skills/copyright-docs/templates/agent-base.md +0 -200
  1128. package/.claude/skills/lite-skill-generator/SKILL.md +0 -650
  1129. package/.claude/skills/lite-skill-generator/templates/simple-skill.md +0 -68
  1130. package/.claude/skills/lite-skill-generator/templates/style-guide.md +0 -64
  1131. package/.claude/skills/project-analyze/SKILL.md +0 -162
  1132. package/.claude/skills/project-analyze/phases/01-requirements-discovery.md +0 -79
  1133. package/.claude/skills/project-analyze/phases/02-project-exploration.md +0 -176
  1134. package/.claude/skills/project-analyze/phases/03-deep-analysis.md +0 -854
  1135. package/.claude/skills/project-analyze/phases/03.5-consolidation.md +0 -233
  1136. package/.claude/skills/project-analyze/phases/04-report-generation.md +0 -217
  1137. package/.claude/skills/project-analyze/phases/05-iterative-refinement.md +0 -124
  1138. package/.claude/skills/project-analyze/specs/quality-standards.md +0 -115
  1139. package/.claude/skills/project-analyze/specs/writing-style.md +0 -152
  1140. package/.claude/skills/prompt-enhancer/SKILL.md +0 -124
  1141. package/.claude/skills/software-manual/SKILL.md +0 -184
  1142. package/.claude/skills/software-manual/phases/01-requirements-discovery.md +0 -162
  1143. package/.claude/skills/software-manual/phases/02-project-exploration.md +0 -101
  1144. package/.claude/skills/software-manual/phases/02.5-api-extraction.md +0 -161
  1145. package/.claude/skills/software-manual/phases/03-parallel-analysis.md +0 -183
  1146. package/.claude/skills/software-manual/phases/03.5-consolidation.md +0 -82
  1147. package/.claude/skills/software-manual/phases/04-screenshot-capture.md +0 -89
  1148. package/.claude/skills/software-manual/phases/05-html-assembly.md +0 -132
  1149. package/.claude/skills/software-manual/phases/06-iterative-refinement.md +0 -259
  1150. package/.claude/skills/software-manual/scripts/api-extractor.md +0 -245
  1151. package/.claude/skills/software-manual/scripts/assemble_docsify.py +0 -584
  1152. package/.claude/skills/software-manual/scripts/bundle-libraries.md +0 -85
  1153. package/.claude/skills/software-manual/scripts/extract_apis.py +0 -270
  1154. package/.claude/skills/software-manual/scripts/screenshot-helper.md +0 -447
  1155. package/.claude/skills/software-manual/scripts/swagger-runner.md +0 -419
  1156. package/.claude/skills/software-manual/scripts/typedoc-runner.md +0 -357
  1157. package/.claude/skills/software-manual/specs/html-template.md +0 -325
  1158. package/.claude/skills/software-manual/specs/quality-standards.md +0 -253
  1159. package/.claude/skills/software-manual/specs/writing-style.md +0 -298
  1160. package/.claude/skills/software-manual/templates/css/docsify-base.css +0 -984
  1161. package/.claude/skills/software-manual/templates/css/wiki-base.css +0 -788
  1162. package/.claude/skills/software-manual/templates/css/wiki-dark.css +0 -278
  1163. package/.claude/skills/software-manual/templates/docsify-shell.html +0 -466
  1164. package/.claude/skills/software-manual/templates/tiddlywiki-shell.html +0 -327
  1165. package/.claude/skills/text-formatter/SKILL.md +0 -196
  1166. package/.claude/skills/text-formatter/phases/01-input-collection.md +0 -111
  1167. package/.claude/skills/text-formatter/phases/02-content-analysis.md +0 -248
  1168. package/.claude/skills/text-formatter/phases/03-format-transform.md +0 -245
  1169. package/.claude/skills/text-formatter/phases/04-output-preview.md +0 -183
  1170. package/.claude/skills/text-formatter/specs/callout-types.md +0 -293
  1171. package/.claude/skills/text-formatter/specs/element-mapping.md +0 -226
  1172. package/.claude/skills/text-formatter/specs/format-rules.md +0 -273
  1173. package/.claude/skills/text-formatter/templates/bbcode-template.md +0 -350
  1174. package/.claude/workflows/_template-compare-matrix.html +0 -692
  1175. package/.claude/workflows/chinese-response.md +0 -25
  1176. package/.claude/workflows/cli-templates/fix-plan-template.json +0 -75
  1177. package/.claude/workflows/cli-templates/fix-progress-template.json +0 -48
  1178. package/.claude/workflows/cli-templates/memory/style-skill-memory/skill-md-template.md +0 -299
  1179. package/.claude/workflows/cli-templates/planning-roles/data-architect.md +0 -120
  1180. package/.claude/workflows/cli-templates/planning-roles/product-manager.md +0 -119
  1181. package/.claude/workflows/cli-templates/planning-roles/product-owner.md +0 -261
  1182. package/.claude/workflows/cli-templates/planning-roles/scrum-master.md +0 -186
  1183. package/.claude/workflows/cli-templates/planning-roles/subject-matter-expert.md +0 -281
  1184. package/.claude/workflows/cli-templates/planning-roles/synthesis-role.md +0 -414
  1185. package/.claude/workflows/cli-templates/planning-roles/system-architect.md +0 -106
  1186. package/.claude/workflows/cli-templates/planning-roles/test-strategist.md +0 -124
  1187. package/.claude/workflows/cli-templates/planning-roles/ui-designer.md +0 -379
  1188. package/.claude/workflows/cli-templates/planning-roles/ux-expert.md +0 -240
  1189. package/.claude/workflows/cli-templates/prompts/analysis-analyze-code-patterns.txt +0 -37
  1190. package/.claude/workflows/cli-templates/prompts/analysis-analyze-performance.txt +0 -29
  1191. package/.claude/workflows/cli-templates/prompts/analysis-analyze-technical-document.txt +0 -33
  1192. package/.claude/workflows/cli-templates/prompts/analysis-assess-security-risks.txt +0 -29
  1193. package/.claude/workflows/cli-templates/prompts/analysis-diagnose-bug-root-cause.txt +0 -127
  1194. package/.claude/workflows/cli-templates/prompts/analysis-review-architecture.txt +0 -29
  1195. package/.claude/workflows/cli-templates/prompts/analysis-review-code-quality.txt +0 -28
  1196. package/.claude/workflows/cli-templates/prompts/analysis-review-quality-standards.txt +0 -29
  1197. package/.claude/workflows/cli-templates/prompts/analysis-trace-code-execution.txt +0 -115
  1198. package/.claude/workflows/cli-templates/prompts/development-debug-runtime-issues.txt +0 -55
  1199. package/.claude/workflows/cli-templates/prompts/development-generate-tests.txt +0 -70
  1200. package/.claude/workflows/cli-templates/prompts/development-implement-component-ui.txt +0 -55
  1201. package/.claude/workflows/cli-templates/prompts/development-implement-feature.txt +0 -58
  1202. package/.claude/workflows/cli-templates/prompts/development-refactor-codebase.txt +0 -55
  1203. package/.claude/workflows/cli-templates/prompts/documentation-api.txt +0 -15
  1204. package/.claude/workflows/cli-templates/prompts/documentation-folder-navigation.txt +0 -27
  1205. package/.claude/workflows/cli-templates/prompts/documentation-module-readme.txt +0 -49
  1206. package/.claude/workflows/cli-templates/prompts/documentation-project-architecture.txt +0 -41
  1207. package/.claude/workflows/cli-templates/prompts/documentation-project-examples.txt +0 -35
  1208. package/.claude/workflows/cli-templates/prompts/documentation-project-readme.txt +0 -35
  1209. package/.claude/workflows/cli-templates/prompts/documentation-swagger-api.txt +0 -266
  1210. package/.claude/workflows/cli-templates/prompts/memory-document-module-structure.txt +0 -165
  1211. package/.claude/workflows/cli-templates/prompts/planning-breakdown-task-steps.txt +0 -30
  1212. package/.claude/workflows/cli-templates/prompts/planning-design-component-spec.txt +0 -28
  1213. package/.claude/workflows/cli-templates/prompts/planning-evaluate-concept-feasibility.txt +0 -127
  1214. package/.claude/workflows/cli-templates/prompts/planning-plan-architecture-design.txt +0 -109
  1215. package/.claude/workflows/cli-templates/prompts/planning-plan-migration-strategy.txt +0 -30
  1216. package/.claude/workflows/cli-templates/prompts/rules-rule-api.txt +0 -122
  1217. package/.claude/workflows/cli-templates/prompts/rules-rule-components.txt +0 -122
  1218. package/.claude/workflows/cli-templates/prompts/rules-rule-config.txt +0 -89
  1219. package/.claude/workflows/cli-templates/prompts/rules-rule-core.txt +0 -60
  1220. package/.claude/workflows/cli-templates/prompts/rules-rule-patterns.txt +0 -70
  1221. package/.claude/workflows/cli-templates/prompts/rules-rule-testing.txt +0 -81
  1222. package/.claude/workflows/cli-templates/prompts/rules-tech-rules-agent-prompt.txt +0 -89
  1223. package/.claude/workflows/cli-templates/prompts/tech-tech-module-format.txt +0 -359
  1224. package/.claude/workflows/cli-templates/prompts/tech-tech-skill-index.txt +0 -185
  1225. package/.claude/workflows/cli-templates/prompts/test-test-concept-analysis.txt +0 -179
  1226. package/.claude/workflows/cli-templates/prompts/universal-universal-creative-style.txt +0 -95
  1227. package/.claude/workflows/cli-templates/prompts/universal-universal-rigorous-style.txt +0 -92
  1228. package/.claude/workflows/cli-templates/prompts/verification-codex-technical.txt +0 -28
  1229. package/.claude/workflows/cli-templates/prompts/verification-cross-validation.txt +0 -28
  1230. package/.claude/workflows/cli-templates/prompts/verification-gemini-strategic.txt +0 -27
  1231. package/.claude/workflows/cli-templates/prompts/workflow-analysis-results-structure.txt +0 -224
  1232. package/.claude/workflows/cli-templates/prompts/workflow-codex-feasibility-validation.txt +0 -176
  1233. package/.claude/workflows/cli-templates/prompts/workflow-gemini-solution-design.txt +0 -131
  1234. package/.claude/workflows/cli-templates/prompts/workflow-impl-plan-template.txt +0 -286
  1235. package/.claude/workflows/cli-templates/prompts/workflow-skill-aggregation.txt +0 -172
  1236. package/.claude/workflows/cli-templates/prompts/workflow-skill-conflict-patterns.txt +0 -94
  1237. package/.claude/workflows/cli-templates/prompts/workflow-skill-index.txt +0 -224
  1238. package/.claude/workflows/cli-templates/prompts/workflow-skill-lessons-learned.txt +0 -94
  1239. package/.claude/workflows/cli-templates/prompts/workflow-skill-sessions-timeline.txt +0 -53
  1240. package/.claude/workflows/cli-templates/prompts/workflow-task-json-agent-mode.txt +0 -123
  1241. package/.claude/workflows/cli-templates/prompts/workflow-task-json-cli-mode.txt +0 -182
  1242. package/.claude/workflows/cli-templates/protocols/analysis-protocol.md +0 -119
  1243. package/.claude/workflows/cli-templates/protocols/write-protocol.md +0 -136
  1244. package/.claude/workflows/cli-templates/schemas/conflict-resolution-schema.json +0 -151
  1245. package/.claude/workflows/cli-templates/schemas/debug-log-json-schema.json +0 -127
  1246. package/.claude/workflows/cli-templates/schemas/diagnosis-json-schema.json +0 -234
  1247. package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +0 -219
  1248. package/.claude/workflows/cli-templates/schemas/discovery-state-schema.json +0 -125
  1249. package/.claude/workflows/cli-templates/schemas/explore-json-schema.json +0 -124
  1250. package/.claude/workflows/cli-templates/schemas/fix-plan-json-schema.json +0 -298
  1251. package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +0 -170
  1252. package/.claude/workflows/cli-templates/schemas/multi-cli-discussion-schema.json +0 -421
  1253. package/.claude/workflows/cli-templates/schemas/plan-json-schema.json +0 -444
  1254. package/.claude/workflows/cli-templates/schemas/plan-verify-agent-schema.json +0 -47
  1255. package/.claude/workflows/cli-templates/schemas/project-guidelines-schema.json +0 -141
  1256. package/.claude/workflows/cli-templates/schemas/project-tech-schema.json +0 -221
  1257. package/.claude/workflows/cli-templates/schemas/queue-schema.json +0 -248
  1258. package/.claude/workflows/cli-templates/schemas/registry-schema.json +0 -94
  1259. package/.claude/workflows/cli-templates/schemas/review-deep-dive-results-schema.json +0 -82
  1260. package/.claude/workflows/cli-templates/schemas/review-dimension-results-schema.json +0 -51
  1261. package/.claude/workflows/cli-templates/schemas/solution-schema.json +0 -166
  1262. package/.claude/workflows/cli-templates/schemas/verify-json-schema.json +0 -158
  1263. package/.claude/workflows/cli-templates/tech-stacks/go-dev.md +0 -91
  1264. package/.claude/workflows/cli-templates/tech-stacks/java-dev.md +0 -107
  1265. package/.claude/workflows/cli-templates/tech-stacks/javascript-dev.md +0 -58
  1266. package/.claude/workflows/cli-templates/tech-stacks/python-dev.md +0 -79
  1267. package/.claude/workflows/cli-templates/tech-stacks/react-dev.md +0 -103
  1268. package/.claude/workflows/cli-templates/tech-stacks/typescript-dev.md +0 -83
  1269. package/.claude/workflows/cli-templates/ui-design/systems/animation-tokens.json +0 -247
  1270. package/.claude/workflows/cli-templates/ui-design/systems/design-tokens.json +0 -342
  1271. package/.claude/workflows/cli-templates/ui-design/systems/layout-templates.json +0 -145
  1272. package/.claude/workflows/cli-tools-usage.md +0 -538
  1273. package/.claude/workflows/coding-philosophy.md +0 -70
  1274. package/.claude/workflows/context-tools.md +0 -76
  1275. package/.claude/workflows/file-modification.md +0 -64
  1276. package/.claude/workflows/review-directory-specification.md +0 -336
  1277. package/.claude/workflows/task-core.md +0 -214
  1278. package/.claude/workflows/tool-strategy.md +0 -216
  1279. package/.claude/workflows/windows-platform.md +0 -19
  1280. package/.claude/workflows/workflow-architecture.md +0 -942
  1281. package/.codex/agents/ccw-loop-b-complete.md +0 -227
  1282. package/.codex/agents/ccw-loop-b-debug.md +0 -172
  1283. package/.codex/agents/ccw-loop-b-develop.md +0 -147
  1284. package/.codex/agents/ccw-loop-b-init.md +0 -82
  1285. package/.codex/agents/ccw-loop-b-validate.md +0 -204
  1286. package/.codex/agents/ccw-loop-executor.md +0 -260
  1287. package/.codex/prompts/analyze-with-file.md +0 -610
  1288. package/.codex/prompts/brainstorm-to-cycle.md +0 -456
  1289. package/.codex/prompts/brainstorm-with-file.md +0 -1004
  1290. package/.codex/prompts/clean.md +0 -414
  1291. package/.codex/prompts/compact.md +0 -380
  1292. package/.codex/prompts/debug-with-file.md +0 -608
  1293. package/.codex/prompts/execute.md +0 -277
  1294. package/.codex/prompts/issue-discover-by-prompt.md +0 -364
  1295. package/.codex/prompts/issue-discover.md +0 -261
  1296. package/.codex/prompts/issue-execute.md +0 -768
  1297. package/.codex/prompts/issue-new.md +0 -390
  1298. package/.codex/prompts/issue-plan.md +0 -246
  1299. package/.codex/prompts/issue-queue.md +0 -298
  1300. package/.codex/prompts/lite-execute.md +0 -684
  1301. package/.codex/prompts/lite-fix.md +0 -674
  1302. package/.codex/prompts/lite-plan-a.md +0 -341
  1303. package/.codex/prompts/lite-plan-b.md +0 -489
  1304. package/.codex/prompts/lite-plan-c.md +0 -605
  1305. package/.codex/prompts/merge-plans-with-file.md +0 -530
  1306. package/.codex/prompts/unified-execute-with-file.md +0 -722
  1307. package/.codex/skills/ccw-loop/README.md +0 -171
  1308. package/.codex/skills/ccw-loop/SKILL.md +0 -350
  1309. package/.codex/skills/ccw-loop/phases/actions/action-complete.md +0 -269
  1310. package/.codex/skills/ccw-loop/phases/actions/action-debug.md +0 -286
  1311. package/.codex/skills/ccw-loop/phases/actions/action-develop.md +0 -183
  1312. package/.codex/skills/ccw-loop/phases/actions/action-init.md +0 -164
  1313. package/.codex/skills/ccw-loop/phases/actions/action-menu.md +0 -205
  1314. package/.codex/skills/ccw-loop/phases/actions/action-validate.md +0 -250
  1315. package/.codex/skills/ccw-loop/phases/orchestrator.md +0 -416
  1316. package/.codex/skills/ccw-loop/phases/state-schema.md +0 -388
  1317. package/.codex/skills/ccw-loop/specs/action-catalog.md +0 -182
  1318. package/.codex/skills/ccw-loop-b/README.md +0 -301
  1319. package/.codex/skills/ccw-loop-b/SKILL.md +0 -323
  1320. package/.codex/skills/ccw-loop-b/phases/orchestrator.md +0 -257
  1321. package/.codex/skills/ccw-loop-b/phases/state-schema.md +0 -181
  1322. package/.codex/skills/ccw-loop-b/specs/action-catalog.md +0 -383
  1323. package/.codex/skills/codex-issue-plan-execute/SKILL.md +0 -214
  1324. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-complete.md +0 -173
  1325. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-execute.md +0 -220
  1326. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-init.md +0 -86
  1327. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-list.md +0 -165
  1328. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-plan.md +0 -170
  1329. package/.codex/skills/codex-issue-plan-execute/phases/orchestrator.md +0 -212
  1330. package/.codex/skills/codex-issue-plan-execute/phases/state-schema.md +0 -136
  1331. package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent-system.md +0 -32
  1332. package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent.md +0 -323
  1333. package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent-system.md +0 -32
  1334. package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent.md +0 -224
  1335. package/.codex/skills/codex-issue-plan-execute/specs/agent-roles.md +0 -468
  1336. package/.codex/skills/codex-issue-plan-execute/specs/issue-handling.md +0 -187
  1337. package/.codex/skills/codex-issue-plan-execute/specs/quality-standards.md +0 -231
  1338. package/.codex/skills/codex-issue-plan-execute/specs/solution-schema.md +0 -270
  1339. package/.codex/skills/codex-issue-plan-execute/specs/subagent-roles.md +0 -32
  1340. package/.codex/skills/parallel-dev-cycle/README.md +0 -385
  1341. package/.codex/skills/parallel-dev-cycle/phases/agents/code-developer.md +0 -327
  1342. package/.codex/skills/parallel-dev-cycle/phases/agents/exploration-planner.md +0 -285
  1343. package/.codex/skills/parallel-dev-cycle/phases/agents/requirements-analyst.md +0 -370
  1344. package/.codex/skills/parallel-dev-cycle/phases/agents/validation-archivist.md +0 -381
  1345. package/.codex/skills/parallel-dev-cycle/phases/orchestrator.md +0 -696
  1346. package/.codex/skills/parallel-dev-cycle/phases/state-schema.md +0 -436
  1347. package/.codex/skills/parallel-dev-cycle/skill.md +0 -194
  1348. package/.codex/skills/parallel-dev-cycle/specs/communication-optimization.md +0 -423
  1349. package/.codex/skills/parallel-dev-cycle/specs/coordination-protocol.md +0 -406
  1350. package/.codex/skills/parallel-dev-cycle/specs/versioning-strategy.md +0 -331
  1351. package/ccw/dist/core/dashboard-generator-patch.d.ts +0 -2
  1352. package/ccw/dist/core/dashboard-generator-patch.d.ts.map +0 -1
  1353. package/ccw/dist/core/dashboard-generator-patch.js +0 -48
  1354. package/ccw/dist/core/dashboard-generator-patch.js.map +0 -1
  1355. package/ccw/dist/core/dashboard-generator.d.ts +0 -8
  1356. package/ccw/dist/core/dashboard-generator.d.ts.map +0 -1
  1357. package/ccw/dist/core/dashboard-generator.js +0 -706
  1358. package/ccw/dist/core/dashboard-generator.js.map +0 -1
  1359. package/ccw/dist/core/routes/model-routes.d.ts +0 -11
  1360. package/ccw/dist/core/routes/model-routes.d.ts.map +0 -1
  1361. package/ccw/dist/core/routes/model-routes.js +0 -112
  1362. package/ccw/dist/core/routes/model-routes.js.map +0 -1
  1363. package/ccw/dist/tools/command-registry.test.d.ts +0 -14
  1364. package/ccw/dist/tools/command-registry.test.d.ts.map +0 -1
  1365. package/ccw/dist/tools/command-registry.test.js.map +0 -1
  1366. package/ccw/scripts/__pycache__/memory_embedder.cpython-313.pyc +0 -0
  1367. package/ccw/scripts/__pycache__/test_memory_embedder.cpython-313-pytest-8.4.2.pyc +0 -0
  1368. package/ccw/src/.workflow/.cli-history/history.db +0 -0
  1369. package/ccw/src/.workflow/.cli-history/history.db-shm +0 -0
  1370. package/ccw/src/.workflow/.cli-history/history.db-wal +0 -0
  1371. package/ccw/src/cli.ts +0 -326
  1372. package/ccw/src/commands/cli.ts +0 -1492
  1373. package/ccw/src/commands/core-memory.ts +0 -770
  1374. package/ccw/src/commands/hook.ts +0 -316
  1375. package/ccw/src/commands/install.ts +0 -799
  1376. package/ccw/src/commands/issue.ts +0 -3150
  1377. package/ccw/src/commands/list.ts +0 -37
  1378. package/ccw/src/commands/loop.ts +0 -344
  1379. package/ccw/src/commands/memory.ts +0 -1090
  1380. package/ccw/src/commands/serve.ts +0 -86
  1381. package/ccw/src/commands/session-path-resolver.ts +0 -372
  1382. package/ccw/src/commands/session.ts +0 -1141
  1383. package/ccw/src/commands/stop.ts +0 -138
  1384. package/ccw/src/commands/tool.ts +0 -216
  1385. package/ccw/src/commands/uninstall.ts +0 -309
  1386. package/ccw/src/commands/upgrade.ts +0 -352
  1387. package/ccw/src/commands/view.ts +0 -133
  1388. package/ccw/src/commands/workflow.ts +0 -348
  1389. package/ccw/src/config/.litellm-api-config-manager.ts.2025-12-23T11-57-43-727Z.bak +0 -441
  1390. package/ccw/src/config/cli-settings-manager.ts +0 -460
  1391. package/ccw/src/config/litellm-api-config-manager.ts +0 -1350
  1392. package/ccw/src/config/litellm-provider-models.ts +0 -222
  1393. package/ccw/src/config/provider-models.ts +0 -123
  1394. package/ccw/src/config/storage-paths.ts +0 -685
  1395. package/ccw/src/core/auth/csrf-manager.ts +0 -104
  1396. package/ccw/src/core/auth/csrf-middleware.ts +0 -161
  1397. package/ccw/src/core/auth/middleware.ts +0 -94
  1398. package/ccw/src/core/auth/token-manager.ts +0 -219
  1399. package/ccw/src/core/cache-manager.ts +0 -304
  1400. package/ccw/src/core/claude-freshness.ts +0 -339
  1401. package/ccw/src/core/core-memory-store.ts +0 -1529
  1402. package/ccw/src/core/cors.ts +0 -10
  1403. package/ccw/src/core/dashboard-generator-patch.ts +0 -47
  1404. package/ccw/src/core/dashboard-generator.ts +0 -802
  1405. package/ccw/src/core/data-aggregator.ts +0 -690
  1406. package/ccw/src/core/history-importer.ts +0 -625
  1407. package/ccw/src/core/lite-scanner-complete.ts +0 -473
  1408. package/ccw/src/core/lite-scanner.ts +0 -978
  1409. package/ccw/src/core/manifest.ts +0 -271
  1410. package/ccw/src/core/memory-embedder-bridge.ts +0 -258
  1411. package/ccw/src/core/memory-store.ts +0 -978
  1412. package/ccw/src/core/routes/auth-routes.ts +0 -98
  1413. package/ccw/src/core/routes/ccw-routes.ts +0 -86
  1414. package/ccw/src/core/routes/claude-routes.ts +0 -1512
  1415. package/ccw/src/core/routes/cli-routes.ts +0 -1002
  1416. package/ccw/src/core/routes/cli-settings-routes.ts +0 -279
  1417. package/ccw/src/core/routes/codexlens/README.md +0 -37
  1418. package/ccw/src/core/routes/codexlens/config-handlers.ts +0 -1273
  1419. package/ccw/src/core/routes/codexlens/index-handlers.ts +0 -354
  1420. package/ccw/src/core/routes/codexlens/semantic-handlers.ts +0 -932
  1421. package/ccw/src/core/routes/codexlens/utils.ts +0 -96
  1422. package/ccw/src/core/routes/codexlens/watcher-handlers.ts +0 -265
  1423. package/ccw/src/core/routes/codexlens-routes.ts +0 -23
  1424. package/ccw/src/core/routes/commands-routes.ts +0 -620
  1425. package/ccw/src/core/routes/core-memory-routes.ts +0 -607
  1426. package/ccw/src/core/routes/discovery-routes.ts +0 -664
  1427. package/ccw/src/core/routes/files-routes.ts +0 -502
  1428. package/ccw/src/core/routes/graph-routes.md +0 -164
  1429. package/ccw/src/core/routes/graph-routes.ts +0 -635
  1430. package/ccw/src/core/routes/help-routes.ts +0 -508
  1431. package/ccw/src/core/routes/hooks-routes.ts +0 -473
  1432. package/ccw/src/core/routes/issue-routes.ts +0 -1547
  1433. package/ccw/src/core/routes/litellm-api-routes.ts +0 -1482
  1434. package/ccw/src/core/routes/litellm-routes.ts +0 -115
  1435. package/ccw/src/core/routes/loop-routes.ts +0 -386
  1436. package/ccw/src/core/routes/loop-v2-routes.ts +0 -1470
  1437. package/ccw/src/core/routes/mcp-routes.ts +0 -1372
  1438. package/ccw/src/core/routes/mcp-templates-db.ts +0 -267
  1439. package/ccw/src/core/routes/memory-routes.ts +0 -1345
  1440. package/ccw/src/core/routes/nav-status-routes.ts +0 -325
  1441. package/ccw/src/core/routes/provider-routes.ts +0 -78
  1442. package/ccw/src/core/routes/rules-routes.ts +0 -1064
  1443. package/ccw/src/core/routes/session-routes.ts +0 -649
  1444. package/ccw/src/core/routes/skills-routes.ts +0 -1278
  1445. package/ccw/src/core/routes/status-routes.ts +0 -132
  1446. package/ccw/src/core/routes/system-routes.ts +0 -575
  1447. package/ccw/src/core/routes/task-routes.ts +0 -361
  1448. package/ccw/src/core/routes/test-loop-routes.ts +0 -312
  1449. package/ccw/src/core/routes/types.ts +0 -25
  1450. package/ccw/src/core/server.ts +0 -776
  1451. package/ccw/src/core/services/api-key-tester.ts +0 -166
  1452. package/ccw/src/core/services/health-check-service.ts +0 -366
  1453. package/ccw/src/core/session-clustering-service.ts +0 -1258
  1454. package/ccw/src/core/session-scanner.ts +0 -283
  1455. package/ccw/src/core/websocket.ts +0 -302
  1456. package/ccw/src/index.ts +0 -10
  1457. package/ccw/src/mcp-server/index.ts +0 -191
  1458. package/ccw/src/templates/assets/css/github-dark.min.css +0 -10
  1459. package/ccw/src/templates/assets/css/github.min.css +0 -10
  1460. package/ccw/src/templates/assets/js/cytoscape.min.js +0 -32
  1461. package/ccw/src/templates/assets/js/d3.min.js +0 -2
  1462. package/ccw/src/templates/assets/js/highlight.min.js +0 -1244
  1463. package/ccw/src/templates/assets/js/lucide.min.js +0 -12
  1464. package/ccw/src/templates/assets/js/marked.min.js +0 -69
  1465. package/ccw/src/templates/assets/js/tailwind.js +0 -83
  1466. package/ccw/src/templates/dashboard-css/01-base.css +0 -419
  1467. package/ccw/src/templates/dashboard-css/02-session.css +0 -831
  1468. package/ccw/src/templates/dashboard-css/03-tasks.css +0 -517
  1469. package/ccw/src/templates/dashboard-css/04-lite-tasks.css +0 -4354
  1470. package/ccw/src/templates/dashboard-css/05-context.css +0 -2206
  1471. package/ccw/src/templates/dashboard-css/06-cards.css +0 -1576
  1472. package/ccw/src/templates/dashboard-css/07-managers.css +0 -2107
  1473. package/ccw/src/templates/dashboard-css/08-review.css +0 -1266
  1474. package/ccw/src/templates/dashboard-css/09-explorer.css +0 -1408
  1475. package/ccw/src/templates/dashboard-css/10-cli-status.css +0 -539
  1476. package/ccw/src/templates/dashboard-css/11-cli-history.css +0 -271
  1477. package/ccw/src/templates/dashboard-css/12-cli-legacy.css +0 -896
  1478. package/ccw/src/templates/dashboard-css/13-cli-ccw.css +0 -199
  1479. package/ccw/src/templates/dashboard-css/14-cli-modals.css +0 -258
  1480. package/ccw/src/templates/dashboard-css/15-cli-endpoints.css +0 -305
  1481. package/ccw/src/templates/dashboard-css/16-cli-session.css +0 -241
  1482. package/ccw/src/templates/dashboard-css/17-cli-conversation.css +0 -283
  1483. package/ccw/src/templates/dashboard-css/18-cli-settings.css +0 -229
  1484. package/ccw/src/templates/dashboard-css/19-cli-native-session.css +0 -496
  1485. package/ccw/src/templates/dashboard-css/20-cli-taskqueue.css +0 -188
  1486. package/ccw/src/templates/dashboard-css/21-cli-toolmgmt.css +0 -820
  1487. package/ccw/src/templates/dashboard-css/22-cli-semantic.css +0 -240
  1488. package/ccw/src/templates/dashboard-css/23-memory.css +0 -2390
  1489. package/ccw/src/templates/dashboard-css/24-prompt-history.css +0 -1089
  1490. package/ccw/src/templates/dashboard-css/25-skills-rules.css +0 -326
  1491. package/ccw/src/templates/dashboard-css/26-claude-manager.css +0 -1087
  1492. package/ccw/src/templates/dashboard-css/27-graph-explorer.css +0 -1678
  1493. package/ccw/src/templates/dashboard-css/28-mcp-manager.css +0 -748
  1494. package/ccw/src/templates/dashboard-css/29-help.css +0 -264
  1495. package/ccw/src/templates/dashboard-css/30-core-memory.css +0 -1720
  1496. package/ccw/src/templates/dashboard-css/31-api-settings.css +0 -3002
  1497. package/ccw/src/templates/dashboard-css/32-issue-manager.css +0 -3619
  1498. package/ccw/src/templates/dashboard-css/33-cli-stream-viewer.css +0 -860
  1499. package/ccw/src/templates/dashboard-css/34-discovery.css +0 -783
  1500. package/ccw/src/templates/dashboard-css/36-loop-monitor.css +0 -1896
  1501. package/ccw/src/templates/dashboard-css/36-loop-monitor.css.backup +0 -1877
  1502. package/ccw/src/templates/dashboard-css/37-commands.css +0 -193
  1503. package/ccw/src/templates/dashboard-js/api.js +0 -225
  1504. package/ccw/src/templates/dashboard-js/components/_conflict_tab.js +0 -112
  1505. package/ccw/src/templates/dashboard-js/components/_exp_helpers.js +0 -54
  1506. package/ccw/src/templates/dashboard-js/components/_review_tab.js +0 -640
  1507. package/ccw/src/templates/dashboard-js/components/carousel.js +0 -398
  1508. package/ccw/src/templates/dashboard-js/components/cli-history.js +0 -913
  1509. package/ccw/src/templates/dashboard-js/components/cli-status.js +0 -1617
  1510. package/ccw/src/templates/dashboard-js/components/cli-stream-viewer.js +0 -985
  1511. package/ccw/src/templates/dashboard-js/components/flowchart.js +0 -493
  1512. package/ccw/src/templates/dashboard-js/components/global-notifications.js +0 -508
  1513. package/ccw/src/templates/dashboard-js/components/hook-manager.js +0 -1493
  1514. package/ccw/src/templates/dashboard-js/components/index-manager.js +0 -302
  1515. package/ccw/src/templates/dashboard-js/components/mcp-manager.js +0 -1760
  1516. package/ccw/src/templates/dashboard-js/components/modals.js +0 -326
  1517. package/ccw/src/templates/dashboard-js/components/navigation.js +0 -430
  1518. package/ccw/src/templates/dashboard-js/components/notifications.js +0 -934
  1519. package/ccw/src/templates/dashboard-js/components/sidebar.js +0 -31
  1520. package/ccw/src/templates/dashboard-js/components/storage-manager.js +0 -478
  1521. package/ccw/src/templates/dashboard-js/components/tabs-context.js +0 -1093
  1522. package/ccw/src/templates/dashboard-js/components/tabs-other.js +0 -424
  1523. package/ccw/src/templates/dashboard-js/components/task-drawer-core.js +0 -477
  1524. package/ccw/src/templates/dashboard-js/components/task-drawer-renderers.js +0 -447
  1525. package/ccw/src/templates/dashboard-js/components/task-queue-sidebar.js +0 -716
  1526. package/ccw/src/templates/dashboard-js/components/theme.js +0 -49
  1527. package/ccw/src/templates/dashboard-js/components/version-check.js +0 -339
  1528. package/ccw/src/templates/dashboard-js/help-i18n.js +0 -272
  1529. package/ccw/src/templates/dashboard-js/i18n.js +0 -5558
  1530. package/ccw/src/templates/dashboard-js/main.js +0 -158
  1531. package/ccw/src/templates/dashboard-js/services.js +0 -289
  1532. package/ccw/src/templates/dashboard-js/state.js +0 -245
  1533. package/ccw/src/templates/dashboard-js/utils.js +0 -199
  1534. package/ccw/src/templates/dashboard-js/views/api-settings.js +0 -5646
  1535. package/ccw/src/templates/dashboard-js/views/claude-manager.js +0 -1129
  1536. package/ccw/src/templates/dashboard-js/views/cli-manager.js +0 -3615
  1537. package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +0 -7123
  1538. package/ccw/src/templates/dashboard-js/views/commands-manager.js +0 -503
  1539. package/ccw/src/templates/dashboard-js/views/core-memory-clusters.js +0 -503
  1540. package/ccw/src/templates/dashboard-js/views/core-memory.js +0 -891
  1541. package/ccw/src/templates/dashboard-js/views/explorer.js +0 -888
  1542. package/ccw/src/templates/dashboard-js/views/fix-session.js +0 -180
  1543. package/ccw/src/templates/dashboard-js/views/graph-explorer.js +0 -1157
  1544. package/ccw/src/templates/dashboard-js/views/help.js +0 -1278
  1545. package/ccw/src/templates/dashboard-js/views/history.js +0 -390
  1546. package/ccw/src/templates/dashboard-js/views/home.js +0 -244
  1547. package/ccw/src/templates/dashboard-js/views/hook-manager.js +0 -696
  1548. package/ccw/src/templates/dashboard-js/views/issue-discovery.js +0 -730
  1549. package/ccw/src/templates/dashboard-js/views/issue-manager.js +0 -3248
  1550. package/ccw/src/templates/dashboard-js/views/lite-tasks.js +0 -3546
  1551. package/ccw/src/templates/dashboard-js/views/loop-monitor.js +0 -3345
  1552. package/ccw/src/templates/dashboard-js/views/mcp-manager.js +0 -2261
  1553. package/ccw/src/templates/dashboard-js/views/mcp-manager.js.backup +0 -1729
  1554. package/ccw/src/templates/dashboard-js/views/mcp-manager.js.new +0 -928
  1555. package/ccw/src/templates/dashboard-js/views/memory.js +0 -1221
  1556. package/ccw/src/templates/dashboard-js/views/project-overview.js +0 -548
  1557. package/ccw/src/templates/dashboard-js/views/prompt-history.js +0 -713
  1558. package/ccw/src/templates/dashboard-js/views/review-session.js +0 -1030
  1559. package/ccw/src/templates/dashboard-js/views/rules-manager.js +0 -880
  1560. package/ccw/src/templates/dashboard-js/views/session-detail.js +0 -781
  1561. package/ccw/src/templates/dashboard-js/views/skills-manager.js +0 -1282
  1562. package/ccw/src/templates/dashboard.html +0 -1104
  1563. package/ccw/src/templates/hooks-config-example.json +0 -60
  1564. package/ccw/src/templates/review-cycle-dashboard.html +0 -1930
  1565. package/ccw/src/templates/workflow-dashboard.html +0 -401
  1566. package/ccw/src/tools/README.md +0 -29
  1567. package/ccw/src/tools/classify-folders.ts +0 -245
  1568. package/ccw/src/tools/claude-cli-tools.ts +0 -1271
  1569. package/ccw/src/tools/cli-config-manager.ts +0 -169
  1570. package/ccw/src/tools/cli-executor-core.ts +0 -1665
  1571. package/ccw/src/tools/cli-executor-state.ts +0 -562
  1572. package/ccw/src/tools/cli-executor-utils.ts +0 -394
  1573. package/ccw/src/tools/cli-executor.ts +0 -7
  1574. package/ccw/src/tools/cli-history-store.ts +0 -1498
  1575. package/ccw/src/tools/cli-output-converter.ts +0 -1301
  1576. package/ccw/src/tools/cli-prompt-builder.ts +0 -487
  1577. package/ccw/src/tools/codex-lens-lsp.ts +0 -402
  1578. package/ccw/src/tools/codex-lens.ts +0 -1863
  1579. package/ccw/src/tools/command-registry.test.ts +0 -669
  1580. package/ccw/src/tools/command-registry.ts +0 -323
  1581. package/ccw/src/tools/context-cache-store.ts +0 -368
  1582. package/ccw/src/tools/context-cache.ts +0 -393
  1583. package/ccw/src/tools/convert-tokens-to-css.ts +0 -300
  1584. package/ccw/src/tools/core-memory.ts +0 -458
  1585. package/ccw/src/tools/detect-changed-modules.ts +0 -343
  1586. package/ccw/src/tools/discover-design-files.ts +0 -184
  1587. package/ccw/src/tools/edit-file.ts +0 -568
  1588. package/ccw/src/tools/generate-module-docs.ts +0 -442
  1589. package/ccw/src/tools/get-modules-by-depth.ts +0 -349
  1590. package/ccw/src/tools/index.ts +0 -384
  1591. package/ccw/src/tools/litellm-client.ts +0 -288
  1592. package/ccw/src/tools/litellm-executor.ts +0 -360
  1593. package/ccw/src/tools/loop-manager.ts +0 -519
  1594. package/ccw/src/tools/loop-state-manager.ts +0 -173
  1595. package/ccw/src/tools/loop-task-manager.ts +0 -391
  1596. package/ccw/src/tools/memory-update-queue.js +0 -493
  1597. package/ccw/src/tools/native-session-discovery.ts +0 -1034
  1598. package/ccw/src/tools/notifier.ts +0 -129
  1599. package/ccw/src/tools/pattern-parser.ts +0 -329
  1600. package/ccw/src/tools/read-file.ts +0 -410
  1601. package/ccw/src/tools/resume-strategy.ts +0 -345
  1602. package/ccw/src/tools/session-content-parser.ts +0 -619
  1603. package/ccw/src/tools/session-manager.ts +0 -1114
  1604. package/ccw/src/tools/skill-context-loader.ts +0 -213
  1605. package/ccw/src/tools/smart-context.ts +0 -228
  1606. package/ccw/src/tools/smart-search.ts +0 -2658
  1607. package/ccw/src/tools/smart-search.ts.backup +0 -1233
  1608. package/ccw/src/tools/storage-manager.ts +0 -455
  1609. package/ccw/src/tools/template-discovery.ts +0 -303
  1610. package/ccw/src/tools/ui-generate-preview.js +0 -350
  1611. package/ccw/src/tools/ui-instantiate-prototypes.js +0 -301
  1612. package/ccw/src/tools/update-module-claude.js +0 -380
  1613. package/ccw/src/tools/vscode-lsp.ts +0 -317
  1614. package/ccw/src/tools/write-file.ts +0 -222
  1615. package/ccw/src/types/cli-settings.ts +0 -137
  1616. package/ccw/src/types/config.ts +0 -11
  1617. package/ccw/src/types/index.ts +0 -4
  1618. package/ccw/src/types/litellm-api-config.ts +0 -456
  1619. package/ccw/src/types/loop.ts +0 -316
  1620. package/ccw/src/types/session.ts +0 -25
  1621. package/ccw/src/types/skill-types.ts +0 -99
  1622. package/ccw/src/types/tool.ts +0 -41
  1623. package/ccw/src/utils/browser-launcher.ts +0 -62
  1624. package/ccw/src/utils/codexlens-path.ts +0 -60
  1625. package/ccw/src/utils/exec-constants.ts +0 -24
  1626. package/ccw/src/utils/file-utils.ts +0 -48
  1627. package/ccw/src/utils/path-resolver.ts +0 -392
  1628. package/ccw/src/utils/path-validator.ts +0 -187
  1629. package/ccw/src/utils/project-root.ts +0 -73
  1630. package/ccw/src/utils/python-utils.ts +0 -140
  1631. package/ccw/src/utils/shell-escape.ts +0 -117
  1632. package/ccw/src/utils/ui.ts +0 -155
  1633. package/ccw/src/utils/update-checker.ts +0 -178
  1634. package/ccw/src/utils/uv-manager.ts +0 -797
  1635. package/ccw-litellm/src/ccw_litellm/__pycache__/__init__.cpython-310.pyc +0 -0
  1636. package/ccw-litellm/src/ccw_litellm/__pycache__/__init__.cpython-312.pyc +0 -0
  1637. package/ccw-litellm/src/ccw_litellm/__pycache__/__init__.cpython-313.pyc +0 -0
  1638. package/ccw-litellm/src/ccw_litellm/__pycache__/cli.cpython-313.pyc +0 -0
  1639. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/__init__.cpython-310.pyc +0 -0
  1640. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/__init__.cpython-312.pyc +0 -0
  1641. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/__init__.cpython-313.pyc +0 -0
  1642. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-310.pyc +0 -0
  1643. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-312.pyc +0 -0
  1644. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-313.pyc +0 -0
  1645. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-310.pyc +0 -0
  1646. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-312.pyc +0 -0
  1647. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-313.pyc +0 -0
  1648. package/ccw-litellm/src/ccw_litellm/config/__pycache__/__init__.cpython-310.pyc +0 -0
  1649. package/ccw-litellm/src/ccw_litellm/config/__pycache__/__init__.cpython-312.pyc +0 -0
  1650. package/ccw-litellm/src/ccw_litellm/config/__pycache__/__init__.cpython-313.pyc +0 -0
  1651. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-310.pyc +0 -0
  1652. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-312.pyc +0 -0
  1653. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-313.pyc +0 -0
  1654. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-310.pyc +0 -0
  1655. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-312.pyc +0 -0
  1656. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-313.pyc +0 -0
  1657. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/__init__.cpython-310.pyc +0 -0
  1658. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/__init__.cpython-312.pyc +0 -0
  1659. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/__init__.cpython-313.pyc +0 -0
  1660. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/embedder.cpython-310.pyc +0 -0
  1661. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/embedder.cpython-312.pyc +0 -0
  1662. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/embedder.cpython-313.pyc +0 -0
  1663. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/llm.cpython-310.pyc +0 -0
  1664. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/llm.cpython-312.pyc +0 -0
  1665. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/llm.cpython-313.pyc +0 -0
  1666. package/codex-lens/src/codexlens/.workflow/.cli-history/history.db +0 -0
  1667. package/codex-lens/src/codexlens/__pycache__/__init__.cpython-310.pyc +0 -0
  1668. package/codex-lens/src/codexlens/__pycache__/__init__.cpython-312.pyc +0 -0
  1669. package/codex-lens/src/codexlens/__pycache__/__init__.cpython-313.pyc +0 -0
  1670. package/codex-lens/src/codexlens/__pycache__/__main__.cpython-310.pyc +0 -0
  1671. package/codex-lens/src/codexlens/__pycache__/__main__.cpython-312.pyc +0 -0
  1672. package/codex-lens/src/codexlens/__pycache__/__main__.cpython-313.pyc +0 -0
  1673. package/codex-lens/src/codexlens/__pycache__/config.cpython-310.pyc +0 -0
  1674. package/codex-lens/src/codexlens/__pycache__/config.cpython-312.pyc +0 -0
  1675. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  1676. package/codex-lens/src/codexlens/__pycache__/entities.cpython-310.pyc +0 -0
  1677. package/codex-lens/src/codexlens/__pycache__/entities.cpython-312.pyc +0 -0
  1678. package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
  1679. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-310.pyc +0 -0
  1680. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-312.pyc +0 -0
  1681. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-313.pyc +0 -0
  1682. package/codex-lens/src/codexlens/__pycache__/errors.cpython-310.pyc +0 -0
  1683. package/codex-lens/src/codexlens/__pycache__/errors.cpython-312.pyc +0 -0
  1684. package/codex-lens/src/codexlens/__pycache__/errors.cpython-313.pyc +0 -0
  1685. package/codex-lens/src/codexlens/api/__pycache__/__init__.cpython-312.pyc +0 -0
  1686. package/codex-lens/src/codexlens/api/__pycache__/__init__.cpython-313.pyc +0 -0
  1687. package/codex-lens/src/codexlens/api/__pycache__/definition.cpython-312.pyc +0 -0
  1688. package/codex-lens/src/codexlens/api/__pycache__/definition.cpython-313.pyc +0 -0
  1689. package/codex-lens/src/codexlens/api/__pycache__/file_context.cpython-312.pyc +0 -0
  1690. package/codex-lens/src/codexlens/api/__pycache__/file_context.cpython-313.pyc +0 -0
  1691. package/codex-lens/src/codexlens/api/__pycache__/hover.cpython-312.pyc +0 -0
  1692. package/codex-lens/src/codexlens/api/__pycache__/hover.cpython-313.pyc +0 -0
  1693. package/codex-lens/src/codexlens/api/__pycache__/models.cpython-312.pyc +0 -0
  1694. package/codex-lens/src/codexlens/api/__pycache__/models.cpython-313.pyc +0 -0
  1695. package/codex-lens/src/codexlens/api/__pycache__/references.cpython-312.pyc +0 -0
  1696. package/codex-lens/src/codexlens/api/__pycache__/references.cpython-313.pyc +0 -0
  1697. package/codex-lens/src/codexlens/api/__pycache__/semantic.cpython-312.pyc +0 -0
  1698. package/codex-lens/src/codexlens/api/__pycache__/semantic.cpython-313.pyc +0 -0
  1699. package/codex-lens/src/codexlens/api/__pycache__/symbols.cpython-312.pyc +0 -0
  1700. package/codex-lens/src/codexlens/api/__pycache__/symbols.cpython-313.pyc +0 -0
  1701. package/codex-lens/src/codexlens/api/__pycache__/utils.cpython-312.pyc +0 -0
  1702. package/codex-lens/src/codexlens/api/__pycache__/utils.cpython-313.pyc +0 -0
  1703. package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-310.pyc +0 -0
  1704. package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-312.pyc +0 -0
  1705. package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-313.pyc +0 -0
  1706. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-310.pyc +0 -0
  1707. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-312.pyc +0 -0
  1708. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-313.pyc +0 -0
  1709. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-310.pyc +0 -0
  1710. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-312.pyc +0 -0
  1711. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-313.pyc +0 -0
  1712. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-310.pyc +0 -0
  1713. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-312.pyc +0 -0
  1714. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-313.pyc +0 -0
  1715. package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-310.pyc +0 -0
  1716. package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-312.pyc +0 -0
  1717. package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-313.pyc +0 -0
  1718. package/codex-lens/src/codexlens/hybrid_search/__pycache__/__init__.cpython-312.pyc +0 -0
  1719. package/codex-lens/src/codexlens/hybrid_search/__pycache__/__init__.cpython-313.pyc +0 -0
  1720. package/codex-lens/src/codexlens/hybrid_search/__pycache__/data_structures.cpython-312.pyc +0 -0
  1721. package/codex-lens/src/codexlens/hybrid_search/__pycache__/data_structures.cpython-313.pyc +0 -0
  1722. package/codex-lens/src/codexlens/hybrid_search/__pycache__/engine.cpython-313.pyc +0 -0
  1723. package/codex-lens/src/codexlens/indexing/__pycache__/__init__.cpython-313.pyc +0 -0
  1724. package/codex-lens/src/codexlens/indexing/__pycache__/embedding.cpython-313.pyc +0 -0
  1725. package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
  1726. package/codex-lens/src/codexlens/lsp/__pycache__/__init__.cpython-312.pyc +0 -0
  1727. package/codex-lens/src/codexlens/lsp/__pycache__/__init__.cpython-313.pyc +0 -0
  1728. package/codex-lens/src/codexlens/lsp/__pycache__/handlers.cpython-313.pyc +0 -0
  1729. package/codex-lens/src/codexlens/lsp/__pycache__/lsp_bridge.cpython-312.pyc +0 -0
  1730. package/codex-lens/src/codexlens/lsp/__pycache__/lsp_bridge.cpython-313.pyc +0 -0
  1731. package/codex-lens/src/codexlens/lsp/__pycache__/lsp_graph_builder.cpython-312.pyc +0 -0
  1732. package/codex-lens/src/codexlens/lsp/__pycache__/lsp_graph_builder.cpython-313.pyc +0 -0
  1733. package/codex-lens/src/codexlens/lsp/__pycache__/providers.cpython-313.pyc +0 -0
  1734. package/codex-lens/src/codexlens/lsp/__pycache__/server.cpython-313.pyc +0 -0
  1735. package/codex-lens/src/codexlens/lsp/__pycache__/standalone_manager.cpython-313.pyc +0 -0
  1736. package/codex-lens/src/codexlens/mcp/__pycache__/__init__.cpython-313.pyc +0 -0
  1737. package/codex-lens/src/codexlens/mcp/__pycache__/hooks.cpython-313.pyc +0 -0
  1738. package/codex-lens/src/codexlens/mcp/__pycache__/provider.cpython-313.pyc +0 -0
  1739. package/codex-lens/src/codexlens/mcp/__pycache__/schema.cpython-313.pyc +0 -0
  1740. package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-310.pyc +0 -0
  1741. package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-312.pyc +0 -0
  1742. package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-313.pyc +0 -0
  1743. package/codex-lens/src/codexlens/parsers/__pycache__/encoding.cpython-313.pyc +0 -0
  1744. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-310.pyc +0 -0
  1745. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-312.pyc +0 -0
  1746. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
  1747. package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-310.pyc +0 -0
  1748. package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-312.pyc +0 -0
  1749. package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-313.pyc +0 -0
  1750. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-310.pyc +0 -0
  1751. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-312.pyc +0 -0
  1752. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
  1753. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-310.pyc +0 -0
  1754. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-312.pyc +0 -0
  1755. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-313.pyc +0 -0
  1756. package/codex-lens/src/codexlens/search/__pycache__/binary_searcher.cpython-313.pyc +0 -0
  1757. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-310.pyc +0 -0
  1758. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-312.pyc +0 -0
  1759. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  1760. package/codex-lens/src/codexlens/search/__pycache__/enrichment.cpython-313.pyc +0 -0
  1761. package/codex-lens/src/codexlens/search/__pycache__/graph_expander.cpython-313.pyc +0 -0
  1762. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-310.pyc +0 -0
  1763. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-312.pyc +0 -0
  1764. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  1765. package/codex-lens/src/codexlens/search/__pycache__/query_parser.cpython-313.pyc +0 -0
  1766. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-310.pyc +0 -0
  1767. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-312.pyc +0 -0
  1768. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  1769. package/codex-lens/src/codexlens/search/association_tree/__pycache__/__init__.cpython-313.pyc +0 -0
  1770. package/codex-lens/src/codexlens/search/association_tree/__pycache__/builder.cpython-313.pyc +0 -0
  1771. package/codex-lens/src/codexlens/search/association_tree/__pycache__/data_structures.cpython-313.pyc +0 -0
  1772. package/codex-lens/src/codexlens/search/association_tree/__pycache__/deduplicator.cpython-313.pyc +0 -0
  1773. package/codex-lens/src/codexlens/search/clustering/__pycache__/__init__.cpython-312.pyc +0 -0
  1774. package/codex-lens/src/codexlens/search/clustering/__pycache__/__init__.cpython-313.pyc +0 -0
  1775. package/codex-lens/src/codexlens/search/clustering/__pycache__/base.cpython-312.pyc +0 -0
  1776. package/codex-lens/src/codexlens/search/clustering/__pycache__/base.cpython-313.pyc +0 -0
  1777. package/codex-lens/src/codexlens/search/clustering/__pycache__/dbscan_strategy.cpython-313.pyc +0 -0
  1778. package/codex-lens/src/codexlens/search/clustering/__pycache__/factory.cpython-312.pyc +0 -0
  1779. package/codex-lens/src/codexlens/search/clustering/__pycache__/factory.cpython-313.pyc +0 -0
  1780. package/codex-lens/src/codexlens/search/clustering/__pycache__/frequency_strategy.cpython-312.pyc +0 -0
  1781. package/codex-lens/src/codexlens/search/clustering/__pycache__/frequency_strategy.cpython-313.pyc +0 -0
  1782. package/codex-lens/src/codexlens/search/clustering/__pycache__/hdbscan_strategy.cpython-313.pyc +0 -0
  1783. package/codex-lens/src/codexlens/search/clustering/__pycache__/noop_strategy.cpython-312.pyc +0 -0
  1784. package/codex-lens/src/codexlens/search/clustering/__pycache__/noop_strategy.cpython-313.pyc +0 -0
  1785. package/codex-lens/src/codexlens/semantic/SPLADE_IMPLEMENTATION.md +0 -225
  1786. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-310.pyc +0 -0
  1787. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-312.pyc +0 -0
  1788. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
  1789. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-310.pyc +0 -0
  1790. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-312.pyc +0 -0
  1791. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-313.pyc +0 -0
  1792. package/codex-lens/src/codexlens/semantic/__pycache__/base.cpython-310.pyc +0 -0
  1793. package/codex-lens/src/codexlens/semantic/__pycache__/base.cpython-312.pyc +0 -0
  1794. package/codex-lens/src/codexlens/semantic/__pycache__/base.cpython-313.pyc +0 -0
  1795. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-310.pyc +0 -0
  1796. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-312.pyc +0 -0
  1797. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-313.pyc +0 -0
  1798. package/codex-lens/src/codexlens/semantic/__pycache__/code_extractor.cpython-313.pyc +0 -0
  1799. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-310.pyc +0 -0
  1800. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-312.pyc +0 -0
  1801. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
  1802. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-310.pyc +0 -0
  1803. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-312.pyc +0 -0
  1804. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-313.pyc +0 -0
  1805. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-310.pyc +0 -0
  1806. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-312.pyc +0 -0
  1807. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-313.pyc +0 -0
  1808. package/codex-lens/src/codexlens/semantic/__pycache__/graph_analyzer.cpython-313.pyc +0 -0
  1809. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-310.pyc +0 -0
  1810. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-312.pyc +0 -0
  1811. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-313.pyc +0 -0
  1812. package/codex-lens/src/codexlens/semantic/__pycache__/llm_enhancer.cpython-313.pyc +0 -0
  1813. package/codex-lens/src/codexlens/semantic/__pycache__/ollama_backend.cpython-313.pyc +0 -0
  1814. package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
  1815. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-310.pyc +0 -0
  1816. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-312.pyc +0 -0
  1817. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-313.pyc +0 -0
  1818. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-310.pyc +0 -0
  1819. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-312.pyc +0 -0
  1820. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
  1821. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-310.pyc +0 -0
  1822. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-312.pyc +0 -0
  1823. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-313.pyc +0 -0
  1824. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/api_reranker.cpython-310.pyc +0 -0
  1825. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/api_reranker.cpython-312.pyc +0 -0
  1826. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/api_reranker.cpython-313.pyc +0 -0
  1827. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/base.cpython-310.pyc +0 -0
  1828. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/base.cpython-312.pyc +0 -0
  1829. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/base.cpython-313.pyc +0 -0
  1830. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/factory.cpython-310.pyc +0 -0
  1831. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/factory.cpython-312.pyc +0 -0
  1832. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/factory.cpython-313.pyc +0 -0
  1833. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/fastembed_reranker.cpython-310.pyc +0 -0
  1834. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/fastembed_reranker.cpython-312.pyc +0 -0
  1835. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/fastembed_reranker.cpython-313.pyc +0 -0
  1836. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/legacy.cpython-310.pyc +0 -0
  1837. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/legacy.cpython-312.pyc +0 -0
  1838. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/legacy.cpython-313.pyc +0 -0
  1839. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/litellm_reranker.cpython-313.pyc +0 -0
  1840. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-310.pyc +0 -0
  1841. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-312.pyc +0 -0
  1842. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-313.pyc +0 -0
  1843. package/codex-lens/src/codexlens/semantic/splade_encoder.py +0 -567
  1844. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-310.pyc +0 -0
  1845. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-312.pyc +0 -0
  1846. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-313.pyc +0 -0
  1847. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-310.pyc +0 -0
  1848. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-312.pyc +0 -0
  1849. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  1850. package/codex-lens/src/codexlens/storage/__pycache__/file_cache.cpython-313.pyc +0 -0
  1851. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-310.pyc +0 -0
  1852. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-312.pyc +0 -0
  1853. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-313.pyc +0 -0
  1854. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-310.pyc +0 -0
  1855. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-312.pyc +0 -0
  1856. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
  1857. package/codex-lens/src/codexlens/storage/__pycache__/merkle_tree.cpython-313.pyc +0 -0
  1858. package/codex-lens/src/codexlens/storage/__pycache__/migration_manager.cpython-313.pyc +0 -0
  1859. package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-310.pyc +0 -0
  1860. package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-312.pyc +0 -0
  1861. package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-313.pyc +0 -0
  1862. package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-310.pyc +0 -0
  1863. package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-312.pyc +0 -0
  1864. package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-313.pyc +0 -0
  1865. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-310.pyc +0 -0
  1866. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-312.pyc +0 -0
  1867. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-313.pyc +0 -0
  1868. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-310.pyc +0 -0
  1869. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-312.pyc +0 -0
  1870. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
  1871. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-310.pyc +0 -0
  1872. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-312.pyc +0 -0
  1873. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-313.pyc +0 -0
  1874. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-310.pyc +0 -0
  1875. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-312.pyc +0 -0
  1876. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-313.pyc +0 -0
  1877. package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-310.pyc +0 -0
  1878. package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-312.pyc +0 -0
  1879. package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
  1880. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_001_normalize_keywords.cpython-313.pyc +0 -0
  1881. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_002_add_token_metadata.cpython-313.pyc +0 -0
  1882. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_003_code_relationships.cpython-313.pyc +0 -0
  1883. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_004_dual_fts.cpython-313.pyc +0 -0
  1884. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_005_cleanup_unused_fields.cpython-313.pyc +0 -0
  1885. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_006_enhance_relationships.cpython-313.pyc +0 -0
  1886. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-310.pyc +0 -0
  1887. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-312.pyc +0 -0
  1888. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-313.pyc +0 -0
  1889. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_008_add_merkle_hashes.cpython-313.pyc +0 -0
  1890. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_009_add_splade.cpython-313.pyc +0 -0
  1891. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_010_add_multi_vector_chunks.cpython-313.pyc +0 -0
  1892. package/codex-lens/src/codexlens/storage/migrations/migration_009_add_splade.py +0 -103
  1893. package/codex-lens/src/codexlens/storage/splade_index.py +0 -578
  1894. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-310.pyc +0 -0
  1895. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-312.pyc +0 -0
  1896. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-313.pyc +0 -0
  1897. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-310.pyc +0 -0
  1898. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-312.pyc +0 -0
  1899. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-313.pyc +0 -0
  1900. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-310.pyc +0 -0
  1901. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-312.pyc +0 -0
  1902. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-313.pyc +0 -0
  1903. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-310.pyc +0 -0
  1904. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-312.pyc +0 -0
  1905. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-313.pyc +0 -0
  1906. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-310.pyc +0 -0
  1907. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-312.pyc +0 -0
  1908. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-313.pyc +0 -0
@@ -1,3150 +0,0 @@
1
- /**
2
- * Issue Command - Unified JSONL storage with CLI & API compatibility
3
- * Storage: issues.jsonl + solutions/{issue-id}.jsonl + queue.json
4
- * Commands: init, list, status, task, bind, queue, next, done, retry
5
- */
6
-
7
- import chalk from 'chalk';
8
- import { execSync } from 'child_process';
9
- import inquirer from 'inquirer';
10
- import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync, statSync } from 'fs';
11
- import { join, resolve } from 'path';
12
- import { EXEC_TIMEOUTS } from '../utils/exec-constants.js';
13
-
14
- function isExecTimeoutError(error: unknown): boolean {
15
- const err = error as { code?: unknown; errno?: unknown; message?: unknown } | null;
16
- const code = err?.code ?? err?.errno;
17
- if (code === 'ETIMEDOUT') return true;
18
- const message = typeof err?.message === 'string' ? err.message : '';
19
- return message.includes('ETIMEDOUT');
20
- }
21
-
22
- // Handle EPIPE errors gracefully
23
- process.stdout.on('error', (err: NodeJS.ErrnoException) => {
24
- if (err.code === 'EPIPE') {
25
- process.exit(0);
26
- }
27
- throw err;
28
- });
29
-
30
- // ============ Interfaces ============
31
-
32
- interface IssueFeedback {
33
- type: 'failure' | 'clarification' | 'rejection';
34
- stage: string; // new/plan/execute
35
- content: string;
36
- created_at: string;
37
- }
38
-
39
- interface Issue {
40
- id: string;
41
- title: string;
42
- status: 'registered' | 'planning' | 'planned' | 'queued' | 'executing' | 'completed' | 'failed' | 'paused';
43
- priority: number;
44
- context: string; // Problem description (single source of truth)
45
- source?: 'github' | 'text' | 'discovery';
46
- source_url?: string;
47
- tags?: string[];
48
-
49
- // Optional structured fields
50
- expected_behavior?: string;
51
- actual_behavior?: string;
52
- affected_components?: string[];
53
-
54
- // Feedback history (failures + human clarifications)
55
- feedback?: IssueFeedback[];
56
-
57
- // Solution binding
58
- bound_solution_id: string | null;
59
-
60
- // Timestamps
61
- created_at: string;
62
- updated_at: string;
63
- planned_at?: string;
64
- queued_at?: string;
65
- completed_at?: string;
66
- }
67
-
68
- interface TaskTest {
69
- unit?: string[]; // Unit test requirements
70
- integration?: string[]; // Integration test requirements
71
- commands?: string[]; // Test commands to run
72
- coverage_target?: number; // Minimum coverage % (optional)
73
- }
74
-
75
- interface TaskAcceptance {
76
- criteria: string[]; // Acceptance criteria (testable)
77
- verification: string[]; // How to verify each criterion
78
- manual_checks?: string[]; // Manual verification steps if needed
79
- }
80
-
81
- interface TaskCommit {
82
- type: 'feat' | 'fix' | 'refactor' | 'test' | 'docs' | 'chore';
83
- scope: string; // Commit scope (e.g., "auth", "api")
84
- message_template: string; // Commit message template
85
- breaking?: boolean; // Breaking change flag
86
- }
87
-
88
- interface SolutionTask {
89
- id: string;
90
- title: string;
91
- scope: string;
92
- action: string;
93
- description?: string;
94
- modification_points?: { file: string; target: string; change: string }[];
95
-
96
- // Lifecycle phases (closed-loop)
97
- implementation: string[]; // Implementation steps
98
- test: TaskTest; // Test requirements
99
- regression: string[]; // Regression check points
100
- acceptance: TaskAcceptance; // Acceptance criteria & verification
101
- commit: TaskCommit; // Commit specification
102
-
103
- depends_on: string[];
104
- estimated_minutes?: number;
105
- status?: string;
106
- priority?: number;
107
- }
108
-
109
- interface Solution {
110
- id: string;
111
- description?: string;
112
- approach?: string; // Solution approach description
113
- tasks: SolutionTask[];
114
- exploration_context?: Record<string, any>;
115
- analysis?: { risk?: string; impact?: string; complexity?: string };
116
- score?: number;
117
- is_bound: boolean;
118
- created_at: string;
119
- bound_at?: string;
120
- }
121
-
122
- // Structured failure detail for debugging
123
- interface FailureDetail {
124
- task_id?: string; // Which task failed within the solution
125
- error_type: string; // e.g., "compilation", "test_failure", "timeout"
126
- message: string; // Human-readable error message
127
- stack_trace?: string; // Optional stack trace
128
- timestamp: string; // ISO timestamp
129
- }
130
-
131
- interface QueueItem {
132
- item_id: string; // Item ID in queue: T-1, T-2, ... (task-level) or S-1, S-2, ... (solution-level)
133
- issue_id: string;
134
- solution_id: string;
135
- task_id?: string; // Only for task-level queues
136
- status: 'pending' | 'ready' | 'executing' | 'completed' | 'failed' | 'blocked';
137
- execution_order: number;
138
- execution_group: string;
139
- depends_on: string[];
140
- semantic_priority: number;
141
- task_count?: number; // For solution-level queues
142
- files_touched?: string[]; // For solution-level queues
143
- queued_at?: string;
144
- started_at?: string;
145
- completed_at?: string;
146
- result?: Record<string, any>;
147
- failure_reason?: string; // Simple string (backward compat)
148
- failure_details?: FailureDetail; // Structured failure info
149
- failure_history?: FailureDetail[]; // Preserved on retry for debugging
150
- }
151
-
152
- interface QueueConflict {
153
- type: 'file_conflict' | 'dependency_conflict' | 'resource_conflict';
154
- tasks?: string[]; // Task IDs involved (task-level queues)
155
- solutions?: string[]; // Solution IDs involved (solution-level queues)
156
- file?: string; // Conflicting file path
157
- resolution: 'sequential' | 'merge' | 'manual';
158
- resolution_order?: string[];
159
- rationale?: string;
160
- resolved: boolean;
161
- }
162
-
163
- interface ExecutionGroup {
164
- id: string; // Group ID: P1, S1, etc.
165
- type: 'parallel' | 'sequential';
166
- task_count?: number; // For task-level queues
167
- solution_count?: number; // For solution-level queues
168
- tasks?: string[]; // Task IDs in this group (task-level)
169
- solutions?: string[]; // Solution IDs in this group (solution-level)
170
- }
171
-
172
- interface Queue {
173
- id: string; // Queue unique ID: QUE-YYYYMMDD-HHMMSS (derived from filename)
174
- name?: string; // Optional queue name
175
- status: 'active' | 'completed' | 'archived' | 'failed';
176
- issue_ids: string[]; // Issues in this queue
177
- tasks: QueueItem[]; // Task items (task-level queue)
178
- solutions?: QueueItem[]; // Solution items (solution-level queue)
179
- conflicts: QueueConflict[];
180
- execution_groups?: ExecutionGroup[];
181
- _metadata: {
182
- version: string;
183
- total_tasks: number;
184
- pending_count: number;
185
- executing_count: number;
186
- completed_count: number;
187
- failed_count: number;
188
- updated_at: string;
189
- merged_into?: string; // Queue ID this was merged into
190
- merged_at?: string; // Timestamp of merge
191
- };
192
- }
193
-
194
- interface QueueIndex {
195
- active_queue_id: string | null; // Single active queue (backward compat)
196
- active_queue_ids?: string[]; // Multiple active queues, ordered by priority
197
- queues: {
198
- id: string;
199
- status: string;
200
- priority?: number; // Queue execution priority (lower = higher priority)
201
- issue_ids: string[];
202
- total_tasks?: number; // For task-level queues
203
- total_solutions?: number; // For solution-level queues
204
- completed_tasks?: number; // For task-level queues
205
- completed_solutions?: number; // For solution-level queues
206
- created_at: string;
207
- completed_at?: string;
208
- }[];
209
- }
210
-
211
- interface IssueOptions {
212
- status?: string;
213
- title?: string;
214
- description?: string;
215
- executor?: string;
216
- priority?: string;
217
- solution?: string;
218
- solutionId?: string; // --solution-id <id> for filtering solutions
219
- result?: string;
220
- reason?: string;
221
- json?: boolean;
222
- force?: boolean;
223
- fail?: boolean;
224
- brief?: boolean; // List brief info only (id, title, status, priority, tags) - JSON format
225
- data?: string; // JSON data for create
226
- fromQueue?: boolean | string; // Sync statuses from queue (true=active, string=specific queue ID)
227
- queue?: string; // Target queue ID for multi-queue operations
228
- // GitHub pull options
229
- state?: string; // Issue state: open, closed, all
230
- limit?: number; // Maximum number of issues to pull
231
- labels?: string; // Filter by labels (comma-separated)
232
- }
233
-
234
- const ISSUES_DIR = '.workflow/issues';
235
-
236
- // ============ Status Constants ============
237
-
238
- const VALID_QUEUE_STATUSES = ['active', 'completed', 'archived', 'failed'] as const;
239
- const VALID_ITEM_STATUSES = ['pending', 'ready', 'executing', 'completed', 'failed', 'blocked'] as const;
240
- const VALID_ISSUE_STATUSES = ['registered', 'planning', 'planned', 'queued', 'executing', 'completed', 'failed', 'paused'] as const;
241
-
242
- type QueueStatus = typeof VALID_QUEUE_STATUSES[number];
243
- type QueueItemStatus = typeof VALID_ITEM_STATUSES[number];
244
- type IssueStatus = typeof VALID_ISSUE_STATUSES[number];
245
-
246
- /**
247
- * Validate queue status
248
- */
249
- function validateQueueStatus(status: string): status is QueueStatus {
250
- return VALID_QUEUE_STATUSES.includes(status as QueueStatus);
251
- }
252
-
253
- /**
254
- * Validate queue item status
255
- */
256
- function validateItemStatus(status: string): status is QueueItemStatus {
257
- return VALID_ITEM_STATUSES.includes(status as QueueItemStatus);
258
- }
259
-
260
- /**
261
- * Validate issue status
262
- */
263
- function validateIssueStatus(status: string): status is IssueStatus {
264
- return VALID_ISSUE_STATUSES.includes(status as IssueStatus);
265
- }
266
-
267
- // ============ Storage Layer (JSONL) ============
268
-
269
- /**
270
- * Cached project root to avoid repeated git command execution
271
- */
272
- let cachedProjectRoot: string | null = null;
273
-
274
- /**
275
- * Clear cached project root (for testing)
276
- */
277
- export function clearProjectRootCache(): void {
278
- cachedProjectRoot = null;
279
- }
280
-
281
- /**
282
- * Debug logging helper (enabled via CCW_DEBUG=true)
283
- */
284
- const DEBUG = process.env.CCW_DEBUG === 'true';
285
- function debugLog(msg: string): void {
286
- if (DEBUG) {
287
- console.log(`[ccw:worktree] ${msg}`);
288
- }
289
- }
290
-
291
- /**
292
- * Normalize path for comparison (handles Windows case sensitivity)
293
- */
294
- function normalizePath(p: string): string {
295
- const normalized = resolve(p);
296
- // Windows: normalize to lowercase for comparison
297
- return process.platform === 'win32' ? normalized.toLowerCase() : normalized;
298
- }
299
-
300
- /**
301
- * Try to resolve main repo from .git file (worktree link file)
302
- * .git file format: "gitdir: /path/to/main/.git/worktrees/name"
303
- */
304
- function resolveMainRepoFromGitFile(gitFilePath: string): string | null {
305
- try {
306
- const content = readFileSync(gitFilePath, 'utf-8').trim();
307
- // Parse "gitdir: /path/to/.git/worktrees/name"
308
- const match = content.match(/^gitdir:\s*(.+)$/);
309
- if (match) {
310
- const gitDir = match[1];
311
- // Navigate from .git/worktrees/name to .git to repo root
312
- // Pattern: /main/.git/worktrees/wt-name -> /main/.git -> /main
313
- const worktreesMatch = gitDir.match(/^(.+)[/\\]\.git[/\\]worktrees[/\\]/);
314
- if (worktreesMatch) {
315
- return worktreesMatch[1];
316
- }
317
- }
318
- } catch {
319
- // Failed to read or parse .git file
320
- }
321
- return null;
322
- }
323
-
324
- /**
325
- * Get the main repository root, even when running from a worktree.
326
- * This ensures .workflow/issues/ is always accessed from the main repo.
327
- */
328
- function getProjectRoot(): string {
329
- // Return cached result if available
330
- if (cachedProjectRoot) {
331
- debugLog(`Using cached project root: ${cachedProjectRoot}`);
332
- return cachedProjectRoot;
333
- }
334
-
335
- debugLog(`Detecting project root from cwd: ${process.cwd()}`);
336
-
337
- // Priority 1: Check CCW_MAIN_REPO environment variable
338
- const envMainRepo = process.env.CCW_MAIN_REPO;
339
- if (envMainRepo) {
340
- debugLog(`Found CCW_MAIN_REPO env: ${envMainRepo}`);
341
- const hasWorkflow = existsSync(join(envMainRepo, '.workflow'));
342
- const hasGit = existsSync(join(envMainRepo, '.git'));
343
-
344
- if (hasWorkflow || hasGit) {
345
- debugLog(`CCW_MAIN_REPO validated (workflow=${hasWorkflow}, git=${hasGit})`);
346
- cachedProjectRoot = envMainRepo;
347
- return envMainRepo;
348
- } else {
349
- console.warn('[ccw] CCW_MAIN_REPO is set but path is invalid (no .workflow or .git)');
350
- console.warn(`[ccw] Path: ${envMainRepo}`);
351
- }
352
- }
353
-
354
- // Priority 2: Try to detect if we're in a git worktree using git commands
355
- try {
356
- // Get the common git directory (points to main repo's .git)
357
- const gitCommonDir = execSync('git rev-parse --git-common-dir', {
358
- encoding: 'utf-8',
359
- stdio: ['pipe', 'pipe', 'pipe'],
360
- timeout: EXEC_TIMEOUTS.GIT_QUICK,
361
- }).trim();
362
-
363
- // Get the current git directory
364
- const gitDir = execSync('git rev-parse --git-dir', {
365
- encoding: 'utf-8',
366
- stdio: ['pipe', 'pipe', 'pipe'],
367
- timeout: EXEC_TIMEOUTS.GIT_QUICK,
368
- }).trim();
369
-
370
- debugLog(`Git common dir: ${gitCommonDir}`);
371
- debugLog(`Git dir: ${gitDir}`);
372
-
373
- // Normalize paths for comparison (Windows case insensitive)
374
- const normalizedCommon = normalizePath(gitCommonDir);
375
- const normalizedGit = normalizePath(gitDir);
376
-
377
- // If gitDir != gitCommonDir, we're in a worktree
378
- if (normalizedGit !== normalizedCommon && gitDir !== '.git') {
379
- // We're in a worktree - resolve to main repo
380
- const absoluteCommonDir = resolve(process.cwd(), gitCommonDir);
381
- // .git directory's parent is the repo root
382
- const mainRepoRoot = resolve(absoluteCommonDir, '..');
383
-
384
- debugLog(`Detected worktree, main repo: ${mainRepoRoot}`);
385
-
386
- // Verify .workflow or .git exists in main repo
387
- if (existsSync(join(mainRepoRoot, '.workflow')) || existsSync(join(mainRepoRoot, '.git'))) {
388
- debugLog(`Main repo validated, returning: ${mainRepoRoot}`);
389
- cachedProjectRoot = mainRepoRoot;
390
- return mainRepoRoot;
391
- }
392
- }
393
- } catch (err: unknown) {
394
- if (isExecTimeoutError(err)) {
395
- console.warn(`[issue] git rev-parse timed out after ${EXEC_TIMEOUTS.GIT_QUICK}ms; falling back to filesystem detection`);
396
- }
397
- debugLog(`Git command failed, falling back to filesystem detection`);
398
- // Git command failed - fall through to manual detection
399
- }
400
-
401
- // Priority 3: Standard detection with worktree file support: walk up to find .workflow or .git
402
- let dir = process.cwd();
403
- while (dir !== resolve(dir, '..')) {
404
- const gitPath = join(dir, '.git');
405
-
406
- // Check if .git is a file (worktree link) rather than directory
407
- if (existsSync(gitPath)) {
408
- try {
409
- const gitStat = statSync(gitPath);
410
- if (gitStat.isFile()) {
411
- // .git is a file - this is a worktree, try to resolve main repo
412
- const mainRepo = resolveMainRepoFromGitFile(gitPath);
413
- debugLog(`Parsed .git file, main repo: ${mainRepo}`);
414
-
415
- if (mainRepo) {
416
- // Verify main repo has .git directory (always true for main repo)
417
- // Don't require .workflow - it may not exist yet in a new repo
418
- const hasGit = existsSync(join(mainRepo, '.git'));
419
- const hasWorkflow = existsSync(join(mainRepo, '.workflow'));
420
-
421
- if (hasGit || hasWorkflow) {
422
- if (!hasWorkflow) {
423
- console.warn('[ccw] Worktree detected but main repo has no .workflow directory');
424
- console.warn(`[ccw] Main repo: ${mainRepo}`);
425
- console.warn('[ccw] Issue commands may fail until .workflow is created');
426
- console.warn('[ccw] Set CCW_MAIN_REPO environment variable to override detection');
427
- }
428
- debugLog(`Main repo validated via .git file (git=${hasGit}, workflow=${hasWorkflow})`);
429
- cachedProjectRoot = mainRepo;
430
- return mainRepo;
431
- }
432
- }
433
- }
434
- } catch {
435
- // stat failed, continue with normal logic
436
- debugLog(`Failed to stat ${gitPath}, continuing`);
437
- }
438
- }
439
-
440
- if (existsSync(join(dir, '.workflow')) || existsSync(gitPath)) {
441
- debugLog(`Found project root at: ${dir}`);
442
- cachedProjectRoot = dir;
443
- return dir;
444
- }
445
- dir = resolve(dir, '..');
446
- }
447
-
448
- debugLog(`No project root found, using cwd: ${process.cwd()}`);
449
- const fallback = process.cwd();
450
- cachedProjectRoot = fallback;
451
- return fallback;
452
- }
453
-
454
- function getIssuesDir(): string {
455
- return join(getProjectRoot(), ISSUES_DIR);
456
- }
457
-
458
- function ensureIssuesDir(): void {
459
- const dir = getIssuesDir();
460
- if (!existsSync(dir)) {
461
- mkdirSync(dir, { recursive: true });
462
- }
463
- }
464
-
465
- // ============ Issues JSONL ============
466
-
467
- export function readIssues(): Issue[] {
468
- const path = join(getIssuesDir(), 'issues.jsonl');
469
- if (!existsSync(path)) return [];
470
- try {
471
- return readFileSync(path, 'utf-8')
472
- .split('\n')
473
- .filter(line => line.trim())
474
- .map(line => JSON.parse(line));
475
- } catch {
476
- return [];
477
- }
478
- }
479
-
480
- export function writeIssues(issues: Issue[]): void {
481
- ensureIssuesDir();
482
- const path = join(getIssuesDir(), 'issues.jsonl');
483
- // Always add trailing newline for proper JSONL format
484
- const content = issues.map(i => JSON.stringify(i)).join('\n');
485
- writeFileSync(path, content ? content + '\n' : '', 'utf-8');
486
- }
487
-
488
- function findIssue(issueId: string): Issue | undefined {
489
- return readIssues().find(i => i.id === issueId);
490
- }
491
-
492
- // ============ Issue History JSONL ============
493
-
494
- function readIssueHistory(): Issue[] {
495
- const path = join(getIssuesDir(), 'issue-history.jsonl');
496
- if (!existsSync(path)) return [];
497
- try {
498
- return readFileSync(path, 'utf-8')
499
- .split('\n')
500
- .filter(line => line.trim())
501
- .map(line => JSON.parse(line));
502
- } catch {
503
- return [];
504
- }
505
- }
506
-
507
- function appendIssueHistory(issue: Issue): void {
508
- ensureIssuesDir();
509
- const path = join(getIssuesDir(), 'issue-history.jsonl');
510
- const line = JSON.stringify(issue) + '\n';
511
- // Append to history file
512
- if (existsSync(path)) {
513
- const content = readFileSync(path, 'utf-8');
514
- // Ensure proper newline before appending
515
- const needsNewline = content.length > 0 && !content.endsWith('\n');
516
- writeFileSync(path, (needsNewline ? '\n' : '') + line, { flag: 'a' });
517
- } else {
518
- writeFileSync(path, line, 'utf-8');
519
- }
520
- }
521
-
522
- /**
523
- * Move completed issue from issues.jsonl to issue-history.jsonl
524
- */
525
- function moveIssueToHistory(issueId: string): boolean {
526
- const issues = readIssues();
527
- const idx = issues.findIndex(i => i.id === issueId);
528
- if (idx === -1) return false;
529
-
530
- const issue = issues[idx];
531
- if (issue.status !== 'completed') return false;
532
-
533
- // Append to history
534
- appendIssueHistory(issue);
535
-
536
- // Remove from active issues
537
- issues.splice(idx, 1);
538
- writeIssues(issues);
539
-
540
- return true;
541
- }
542
-
543
- function updateIssue(issueId: string, updates: Partial<Issue>): boolean {
544
- const issues = readIssues();
545
- const idx = issues.findIndex(i => i.id === issueId);
546
- if (idx === -1) return false;
547
- issues[idx] = { ...issues[idx], ...updates, updated_at: new Date().toISOString() };
548
- writeIssues(issues);
549
-
550
- // Auto-move to history when completed
551
- if (updates.status === 'completed') {
552
- moveIssueToHistory(issueId);
553
- }
554
-
555
- return true;
556
- }
557
-
558
- /**
559
- * Generate auto-increment issue ID: ISS-YYYYMMDD-NNN
560
- */
561
- function generateIssueId(existingIssues: Issue[] = []): string {
562
- const today = new Date();
563
- const dateStr = today.toISOString().slice(0, 10).replace(/-/g, '');
564
- const prefix = `ISS-${dateStr}-`;
565
- const todayPattern = new RegExp(`^ISS-${dateStr}-(\\d{3})$`);
566
- let maxSeq = 0;
567
- for (const issue of existingIssues) {
568
- const match = issue.id.match(todayPattern);
569
- if (match) maxSeq = Math.max(maxSeq, parseInt(match[1], 10));
570
- }
571
- return `${prefix}${String(maxSeq + 1).padStart(3, '0')}`;
572
- }
573
-
574
- /**
575
- * Create a new issue with proper JSONL handling
576
- * Auto-generates ID if not provided
577
- */
578
- function createIssue(data: Partial<Issue>): Issue {
579
- const issues = readIssues();
580
- const issueId = data.id || generateIssueId(issues);
581
-
582
- if (issues.some(i => i.id === issueId)) {
583
- throw new Error(`Issue "${issueId}" already exists`);
584
- }
585
-
586
- const newIssue: Issue = {
587
- id: issueId,
588
- title: data.title || issueId,
589
- status: data.status || 'registered',
590
- priority: data.priority || 3,
591
- context: data.context || '',
592
- source: data.source,
593
- source_url: data.source_url,
594
- tags: data.tags,
595
- expected_behavior: data.expected_behavior,
596
- actual_behavior: data.actual_behavior,
597
- affected_components: data.affected_components,
598
- feedback: data.feedback,
599
- bound_solution_id: data.bound_solution_id || null,
600
- created_at: new Date().toISOString(),
601
- updated_at: new Date().toISOString()
602
- };
603
-
604
- issues.push(newIssue);
605
- writeIssues(issues);
606
- return newIssue;
607
- }
608
-
609
- // ============ Solutions JSONL ============
610
-
611
- function getSolutionsPath(issueId: string): string {
612
- return join(getIssuesDir(), 'solutions', `${issueId}.jsonl`);
613
- }
614
-
615
- export function readSolutions(issueId: string): Solution[] {
616
- const path = getSolutionsPath(issueId);
617
- if (!existsSync(path)) return [];
618
- try {
619
- return readFileSync(path, 'utf-8')
620
- .split('\n')
621
- .filter(line => line.trim())
622
- .map(line => JSON.parse(line));
623
- } catch {
624
- return [];
625
- }
626
- }
627
-
628
- export function writeSolutions(issueId: string, solutions: Solution[]): void {
629
- const dir = join(getIssuesDir(), 'solutions');
630
- if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
631
- // Always add trailing newline for proper JSONL format
632
- const content = solutions.map(s => JSON.stringify(s)).join('\n');
633
- writeFileSync(getSolutionsPath(issueId), content ? content + '\n' : '', 'utf-8');
634
- }
635
-
636
- function findSolution(issueId: string, solutionId: string): Solution | undefined {
637
- return readSolutions(issueId).find(s => s.id === solutionId);
638
- }
639
-
640
- function getBoundSolution(issueId: string): Solution | undefined {
641
- return readSolutions(issueId).find(s => s.is_bound);
642
- }
643
-
644
- /**
645
- * Generate solution ID in format: SOL-{issue-id}-{seq}
646
- * @param issueId - The issue ID to include in the solution ID
647
- * @param existingSolutions - Existing solutions to calculate next sequence number
648
- * @returns Solution ID like "SOL-GH-123-1" or "SOL-ISS-20251229-001-2"
649
- */
650
- function generateSolutionId(issueId: string, existingSolutions: Solution[] = []): string {
651
- // Find the highest existing sequence number for this issue
652
- const pattern = new RegExp(`^SOL-${issueId.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}-(\\d+)$`);
653
- let maxSeq = 0;
654
- for (const sol of existingSolutions) {
655
- const match = sol.id.match(pattern);
656
- if (match) {
657
- maxSeq = Math.max(maxSeq, parseInt(match[1], 10));
658
- }
659
- }
660
- return `SOL-${issueId}-${maxSeq + 1}`;
661
- }
662
-
663
- /**
664
- * Create a new solution with proper JSONL handling
665
- * Auto-generates ID if not provided
666
- */
667
- function createSolution(issueId: string, data: Partial<Solution>): Solution {
668
- const issue = findIssue(issueId);
669
- if (!issue) {
670
- throw new Error(`Issue "${issueId}" not found`);
671
- }
672
-
673
- const solutions = readSolutions(issueId);
674
- const solutionId = data.id || generateSolutionId(issueId, solutions);
675
-
676
- if (solutions.some(s => s.id === solutionId)) {
677
- throw new Error(`Solution "${solutionId}" already exists`);
678
- }
679
-
680
- const newSolution: Solution = {
681
- id: solutionId,
682
- description: data.description || '',
683
- approach: data.approach || '',
684
- tasks: data.tasks || [],
685
- exploration_context: data.exploration_context,
686
- analysis: data.analysis,
687
- score: data.score,
688
- is_bound: false,
689
- created_at: new Date().toISOString()
690
- };
691
-
692
- solutions.push(newSolution);
693
- writeSolutions(issueId, solutions);
694
- return newSolution;
695
- }
696
-
697
- // ============ Queue Management (Multi-Queue) ============
698
-
699
- function getQueuesDir(): string {
700
- return join(getIssuesDir(), 'queues');
701
- }
702
-
703
- function ensureQueuesDir(): void {
704
- const dir = getQueuesDir();
705
- if (!existsSync(dir)) {
706
- mkdirSync(dir, { recursive: true });
707
- }
708
- }
709
-
710
- function readQueueIndex(): QueueIndex {
711
- const path = join(getQueuesDir(), 'index.json');
712
- if (!existsSync(path)) {
713
- return { active_queue_id: null, queues: [] };
714
- }
715
- return JSON.parse(readFileSync(path, 'utf-8'));
716
- }
717
-
718
- function writeQueueIndex(index: QueueIndex): void {
719
- ensureQueuesDir();
720
- writeFileSync(join(getQueuesDir(), 'index.json'), JSON.stringify(index, null, 2), 'utf-8');
721
- }
722
-
723
- function generateQueueFileId(): string {
724
- const now = new Date();
725
- const ts = now.toISOString().replace(/[-:T]/g, '').slice(0, 14);
726
- return `QUE-${ts}`;
727
- }
728
-
729
- export function readQueue(queueId?: string): Queue | null {
730
- const index = readQueueIndex();
731
- const targetId = queueId || index.active_queue_id;
732
-
733
- if (!targetId) return null;
734
-
735
- const path = join(getQueuesDir(), `${targetId}.json`);
736
- if (!existsSync(path)) return null;
737
-
738
- return JSON.parse(readFileSync(path, 'utf-8'));
739
- }
740
-
741
- function readActiveQueue(): Queue {
742
- const queue = readQueue();
743
- if (queue) return queue;
744
-
745
- // Return empty queue structure if no active queue
746
- return createEmptyQueue();
747
- }
748
-
749
- function createEmptyQueue(): Queue {
750
- return {
751
- id: generateQueueFileId(),
752
- status: 'active',
753
- issue_ids: [],
754
- tasks: [],
755
- conflicts: [],
756
- _metadata: {
757
- version: '2.1',
758
- total_tasks: 0,
759
- pending_count: 0,
760
- executing_count: 0,
761
- completed_count: 0,
762
- failed_count: 0,
763
- updated_at: new Date().toISOString()
764
- }
765
- };
766
- }
767
-
768
- interface MergeResult {
769
- success: boolean;
770
- itemsMerged: number;
771
- totalItems: number;
772
- skippedDuplicates: number;
773
- reason?: string;
774
- }
775
-
776
- /**
777
- * Merge items from source queue into target queue
778
- * - Skips duplicate items (same issue_id + solution_id)
779
- * - Re-generates item IDs for merged items
780
- * - Marks source queue as 'archived' with metadata (or deletes if deleteSource=true)
781
- * - Updates queue index
782
- */
783
- function mergeQueues(target: Queue, source: Queue, options?: { deleteSource?: boolean }): MergeResult {
784
- const sourceItems = source.solutions || source.tasks || [];
785
- const targetItems = target.solutions || target.tasks || [];
786
-
787
- if (sourceItems.length === 0) {
788
- return { success: false, itemsMerged: 0, totalItems: targetItems.length, skippedDuplicates: 0, reason: 'Source queue is empty' };
789
- }
790
-
791
- // Ensure target has solutions array
792
- if (!target.solutions) {
793
- target.solutions = [];
794
- }
795
-
796
- let itemsMerged = 0;
797
- let skippedDuplicates = 0;
798
-
799
- for (const sourceItem of sourceItems) {
800
- // Skip if already exists in target (same issue_id + solution_id)
801
- const exists = target.solutions.some(
802
- t => t.issue_id === sourceItem.issue_id && t.solution_id === sourceItem.solution_id
803
- );
804
-
805
- if (exists) {
806
- skippedDuplicates++;
807
- continue;
808
- }
809
-
810
- // Add issue to target's issue_ids if not present
811
- if (!target.issue_ids.includes(sourceItem.issue_id)) {
812
- target.issue_ids.push(sourceItem.issue_id);
813
- }
814
-
815
- // Clone and add item with new item_id
816
- const newItem: QueueItem = {
817
- ...sourceItem,
818
- item_id: generateQueueItemId(target, 'solution'),
819
- execution_order: target.solutions.length + 1
820
- };
821
-
822
- target.solutions.push(newItem);
823
- itemsMerged++;
824
- }
825
-
826
- // Merge conflicts if any
827
- if (source.conflicts && source.conflicts.length > 0) {
828
- if (!target.conflicts) target.conflicts = [];
829
- target.conflicts.push(...source.conflicts);
830
- }
831
-
832
- // Write updated target queue
833
- writeQueue(target);
834
-
835
- // Handle source queue: delete or mark as archived
836
- const index = readQueueIndex();
837
-
838
- if (options?.deleteSource) {
839
- // Delete source queue file and remove from index
840
- const queuePath = join(getQueuesDir(), `${source.id}.json`);
841
- if (existsSync(queuePath)) {
842
- unlinkSync(queuePath);
843
- }
844
- index.queues = index.queues.filter(q => q.id !== source.id);
845
- } else {
846
- // Mark source queue as archived (was merged)
847
- source.status = 'archived';
848
- if (!source._metadata) {
849
- source._metadata = {
850
- version: '2.1',
851
- total_tasks: 0,
852
- pending_count: 0,
853
- executing_count: 0,
854
- completed_count: 0,
855
- failed_count: 0,
856
- updated_at: new Date().toISOString()
857
- };
858
- }
859
- source._metadata.merged_into = target.id;
860
- source._metadata.merged_at = new Date().toISOString();
861
- writeQueue(source);
862
-
863
- const sourceEntry = index.queues.find(q => q.id === source.id);
864
- if (sourceEntry) {
865
- sourceEntry.status = 'archived';
866
- }
867
- }
868
-
869
- // Update target entry in index
870
- const targetEntry = index.queues.find(q => q.id === target.id);
871
- if (targetEntry) {
872
- targetEntry.total_solutions = target.solutions.length;
873
- targetEntry.completed_solutions = target.solutions.filter(s => s.status === 'completed').length;
874
- targetEntry.issue_ids = target.issue_ids;
875
- }
876
- writeQueueIndex(index);
877
-
878
- return {
879
- success: itemsMerged > 0,
880
- itemsMerged,
881
- totalItems: target.solutions.length,
882
- skippedDuplicates,
883
- reason: itemsMerged === 0 ? 'All items already exist in target queue' : undefined
884
- };
885
- }
886
-
887
- // ============ Multi-Queue Helper Functions ============
888
-
889
- /**
890
- * Find which queue contains a given item ID
891
- * Supports both simple (S-1) and qualified (QUE-xxx:S-1) formats
892
- */
893
- function findItemQueue(itemId: string): { queue: Queue; item: QueueItem; itemIndex: number } | null {
894
- // Check if qualified format (QUE-xxx:S-1)
895
- const qualifiedMatch = itemId.match(/^(QUE-[^:]+):(.+)$/);
896
- if (qualifiedMatch) {
897
- const [, queueId, actualItemId] = qualifiedMatch;
898
- const queue = readQueue(queueId);
899
- if (!queue) return null;
900
- const items = queue.solutions || queue.tasks || [];
901
- const itemIndex = items.findIndex(i => i.item_id === actualItemId);
902
- if (itemIndex === -1) return null;
903
- return { queue, item: items[itemIndex], itemIndex };
904
- }
905
-
906
- // Search all queues for unqualified item ID
907
- const index = readQueueIndex();
908
- const activeQueueIds = index.active_queue_ids || (index.active_queue_id ? [index.active_queue_id] : []);
909
-
910
- // Search active queues first
911
- for (const queueId of activeQueueIds) {
912
- const queue = readQueue(queueId);
913
- if (!queue) continue;
914
- const items = queue.solutions || queue.tasks || [];
915
- const itemIndex = items.findIndex(i => i.item_id === itemId);
916
- if (itemIndex >= 0) {
917
- return { queue, item: items[itemIndex], itemIndex };
918
- }
919
- }
920
-
921
- // Search all other queues
922
- for (const queueEntry of index.queues) {
923
- if (activeQueueIds.includes(queueEntry.id)) continue;
924
- const queue = readQueue(queueEntry.id);
925
- if (!queue) continue;
926
- const items = queue.solutions || queue.tasks || [];
927
- const itemIndex = items.findIndex(i => i.item_id === itemId);
928
- if (itemIndex >= 0) {
929
- return { queue, item: items[itemIndex], itemIndex };
930
- }
931
- }
932
-
933
- return null;
934
- }
935
-
936
- /**
937
- * Get all active queues ordered by priority (lower = higher priority)
938
- * Falls back to creation date order
939
- */
940
- function getActiveQueues(): Queue[] {
941
- const index = readQueueIndex();
942
- const activeIds = index.active_queue_ids || (index.active_queue_id ? [index.active_queue_id] : []);
943
-
944
- const queues: Queue[] = [];
945
- for (const queueId of activeIds) {
946
- const queue = readQueue(queueId);
947
- if (queue && queue.status === 'active') {
948
- queues.push(queue);
949
- }
950
- }
951
-
952
- // Sort by priority field in index (lower = higher priority)
953
- const priorityMap = new Map<string, number>();
954
- for (const entry of index.queues) {
955
- priorityMap.set(entry.id, entry.priority ?? Number.MAX_SAFE_INTEGER);
956
- }
957
-
958
- queues.sort((a, b) => {
959
- const pa = priorityMap.get(a.id) ?? Number.MAX_SAFE_INTEGER;
960
- const pb = priorityMap.get(b.id) ?? Number.MAX_SAFE_INTEGER;
961
- if (pa !== pb) return pa - pb;
962
- // Fall back to creation date (from queue ID)
963
- return a.id.localeCompare(b.id);
964
- });
965
-
966
- return queues;
967
- }
968
-
969
- /**
970
- * Parse failure reason into structured FailureDetail
971
- * Detects JSON format vs plain string
972
- */
973
- function parseFailureReason(reason: string): FailureDetail {
974
- const timestamp = new Date().toISOString();
975
-
976
- // Try to parse as JSON first
977
- if (reason.trim().startsWith('{')) {
978
- try {
979
- const parsed = JSON.parse(reason);
980
- return {
981
- task_id: parsed.task_id,
982
- error_type: parsed.error_type || 'unknown',
983
- message: parsed.message || reason,
984
- stack_trace: parsed.stack_trace,
985
- timestamp
986
- };
987
- } catch {
988
- // Not valid JSON, treat as plain message
989
- }
990
- }
991
-
992
- // Plain string message
993
- return {
994
- error_type: 'execution_error',
995
- message: reason,
996
- timestamp
997
- };
998
- }
999
-
1000
- export function writeQueue(queue: Queue): void {
1001
- ensureQueuesDir();
1002
-
1003
- // Support both old (tasks) and new (solutions) queue format
1004
- const items = queue.solutions || queue.tasks || [];
1005
- const isSolutionQueue = !!queue.solutions;
1006
-
1007
- // Ensure _metadata exists (support queues with 'metadata' field from external sources)
1008
- if (!queue._metadata) {
1009
- const extMeta = (queue as any).metadata;
1010
- queue._metadata = {
1011
- version: '2.0',
1012
- total_tasks: extMeta?.total_tasks || items.length,
1013
- pending_count: items.filter(q => q.status === 'pending').length,
1014
- executing_count: items.filter(q => q.status === 'executing').length,
1015
- completed_count: items.filter(q => q.status === 'completed').length,
1016
- failed_count: items.filter(q => q.status === 'failed').length,
1017
- updated_at: new Date().toISOString()
1018
- };
1019
- }
1020
-
1021
- // Update metadata counts
1022
- queue._metadata.total_tasks = items.length;
1023
- queue._metadata.pending_count = items.filter(q => q.status === 'pending').length;
1024
- queue._metadata.executing_count = items.filter(q => q.status === 'executing').length;
1025
- queue._metadata.completed_count = items.filter(q => q.status === 'completed').length;
1026
- queue._metadata.failed_count = items.filter(q => q.status === 'failed').length;
1027
- queue._metadata.updated_at = new Date().toISOString();
1028
-
1029
- // Write queue file
1030
- const path = join(getQueuesDir(), `${queue.id}.json`);
1031
- writeFileSync(path, JSON.stringify(queue, null, 2), 'utf-8');
1032
-
1033
- // Update index
1034
- const index = readQueueIndex();
1035
- const existingIdx = index.queues.findIndex(q => q.id === queue.id);
1036
-
1037
- // Derive issue_ids from solutions if not present
1038
- const issueIds = queue.issue_ids || (isSolutionQueue
1039
- ? [...new Set(items.map(item => item.issue_id))]
1040
- : []);
1041
-
1042
- const indexEntry: QueueIndex['queues'][0] = {
1043
- id: queue.id,
1044
- status: queue.status,
1045
- issue_ids: issueIds,
1046
- created_at: queue.id.replace('QUE-', '').replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/, '$1-$2-$3T$4:$5:$6Z'), // Derive from ID
1047
- completed_at: queue.status === 'completed' ? new Date().toISOString() : undefined
1048
- };
1049
-
1050
- // Add format-specific counts
1051
- if (isSolutionQueue) {
1052
- indexEntry.total_solutions = items.length;
1053
- indexEntry.completed_solutions = queue._metadata.completed_count;
1054
- } else {
1055
- indexEntry.total_tasks = items.length;
1056
- indexEntry.completed_tasks = queue._metadata.completed_count;
1057
- }
1058
-
1059
- if (existingIdx >= 0) {
1060
- index.queues[existingIdx] = indexEntry;
1061
- } else {
1062
- index.queues.unshift(indexEntry);
1063
- }
1064
-
1065
- if (queue.status === 'active') {
1066
- index.active_queue_id = queue.id;
1067
- }
1068
-
1069
- writeQueueIndex(index);
1070
- }
1071
-
1072
- function generateQueueItemId(queue: Queue, level: 'solution' | 'task' = 'solution'): string {
1073
- const prefix = level === 'solution' ? 'S' : 'T';
1074
- const items = level === 'solution' ? (queue.solutions || []) : (queue.tasks || []);
1075
- const pattern = new RegExp(`^${prefix}-(\\d+)$`);
1076
-
1077
- const maxNum = items.reduce((max, q) => {
1078
- const match = q.item_id.match(pattern);
1079
- return match ? Math.max(max, parseInt(match[1])) : max;
1080
- }, 0);
1081
- return `${prefix}-${maxNum + 1}`;
1082
- }
1083
-
1084
- // ============ Commands ============
1085
-
1086
- /**
1087
- * create - Create issue from JSON data
1088
- * Usage: ccw issue create --data '{"title":"...", "context":"..."}'
1089
- * echo '{"title":"..."}' | ccw issue create
1090
- * Output: JSON with created issue (includes auto-generated ID)
1091
- */
1092
- async function createAction(options: IssueOptions): Promise<void> {
1093
- let jsonData: string | undefined = options.data;
1094
-
1095
- // Support stdin pipe input (avoids shell escaping issues)
1096
- if (!jsonData && !process.stdin.isTTY) {
1097
- try {
1098
- jsonData = readFileSync(0, 'utf-8').trim();
1099
- } catch {
1100
- // stdin not available or empty
1101
- }
1102
- }
1103
-
1104
- if (!jsonData) {
1105
- console.error(chalk.red('JSON data required'));
1106
- console.error(chalk.gray('Usage: ccw issue create --data \'{"title":"...", "context":"..."}\''));
1107
- console.error(chalk.gray(' echo \'{"title":"..."}\' | ccw issue create'));
1108
- process.exit(1);
1109
- }
1110
-
1111
- try {
1112
- const data = JSON.parse(jsonData);
1113
- const issue = createIssue(data);
1114
- console.log(JSON.stringify(issue, null, 2));
1115
- } catch (err) {
1116
- console.error(chalk.red((err as Error).message));
1117
- process.exit(1);
1118
- }
1119
- }
1120
-
1121
- /**
1122
- * pull - Pull issues from GitHub
1123
- * Usage: ccw issue pull [--state open|closed|all] [--limit N] [--labels label1,label2]
1124
- */
1125
- async function pullAction(options: IssueOptions): Promise<void> {
1126
- try {
1127
- // Check if gh CLI is available
1128
- try {
1129
- execSync('gh --version', { stdio: 'ignore', timeout: EXEC_TIMEOUTS.GIT_QUICK });
1130
- } catch {
1131
- console.error(chalk.red('GitHub CLI (gh) is not installed or not in PATH'));
1132
- console.error(chalk.gray('Install from: https://cli.github.com/'));
1133
- process.exit(1);
1134
- }
1135
-
1136
- // Build gh command with options
1137
- const state = options.state || 'open';
1138
- const limit = options.limit || 100;
1139
- let ghCommand = `gh issue list --state ${state} --limit ${limit} --json number,title,body,labels,url,state`;
1140
-
1141
- if (options.labels) {
1142
- ghCommand += ` --label "${options.labels}"`;
1143
- }
1144
-
1145
- console.log(chalk.cyan(`Fetching issues from GitHub (state: ${state}, limit: ${limit})...`));
1146
-
1147
- // Fetch issues from GitHub
1148
- const ghOutput = execSync(ghCommand, {
1149
- encoding: 'utf-8',
1150
- stdio: ['pipe', 'pipe', 'pipe'],
1151
- timeout: EXEC_TIMEOUTS.PROCESS_SPAWN,
1152
- }).trim();
1153
-
1154
- if (!ghOutput) {
1155
- console.log(chalk.yellow('No issues found on GitHub'));
1156
- return;
1157
- }
1158
-
1159
- const ghIssues = JSON.parse(ghOutput);
1160
- const existingIssues = readIssues();
1161
-
1162
- let imported = 0;
1163
- let skipped = 0;
1164
- let updated = 0;
1165
-
1166
- for (const ghIssue of ghIssues) {
1167
- const issueId = `GH-${ghIssue.number}`;
1168
- const existingIssue = existingIssues.find(i => i.id === issueId);
1169
-
1170
- // Prepare issue data
1171
- const issueData: Partial<Issue> = {
1172
- id: issueId,
1173
- title: ghIssue.title,
1174
- status: ghIssue.state === 'OPEN' ? 'registered' : 'completed',
1175
- priority: 3, // Default priority
1176
- context: ghIssue.body?.substring(0, 500) || ghIssue.title,
1177
- source: 'github',
1178
- source_url: ghIssue.url,
1179
- tags: ghIssue.labels?.map((l: any) => l.name) || [],
1180
- };
1181
-
1182
- if (existingIssue) {
1183
- // Update existing issue if state changed
1184
- if (existingIssue.source_url === ghIssue.url) {
1185
- // Check if status needs updating
1186
- const newStatus = ghIssue.state === 'OPEN' ? 'registered' : 'completed';
1187
- if (existingIssue.status !== newStatus || existingIssue.title !== ghIssue.title) {
1188
- existingIssue.title = ghIssue.title;
1189
- existingIssue.status = newStatus;
1190
- existingIssue.updated_at = new Date().toISOString();
1191
- updated++;
1192
- } else {
1193
- skipped++;
1194
- }
1195
- } else {
1196
- skipped++;
1197
- }
1198
- } else {
1199
- // Create new issue
1200
- try {
1201
- createIssue(issueData);
1202
- imported++;
1203
- } catch (err) {
1204
- console.error(chalk.red(`Failed to import issue #${ghIssue.number}: ${(err as Error).message}`));
1205
- }
1206
- }
1207
- }
1208
-
1209
- // Save updates if any
1210
- if (updated > 0) {
1211
- writeIssues(existingIssues);
1212
- }
1213
-
1214
- console.log(chalk.green(`\n✓ GitHub sync complete:`));
1215
- console.log(chalk.gray(` - Imported: ${imported} new issues`));
1216
- console.log(chalk.gray(` - Updated: ${updated} existing issues`));
1217
- console.log(chalk.gray(` - Skipped: ${skipped} unchanged issues`));
1218
-
1219
- if (options.json) {
1220
- console.log(JSON.stringify({ imported, updated, skipped, total: ghIssues.length }));
1221
- }
1222
- } catch (err) {
1223
- console.error(chalk.red(`Failed to pull issues from GitHub: ${(err as Error).message}`));
1224
- process.exit(1);
1225
- }
1226
- }
1227
-
1228
- /**
1229
- * solution - Create or read solutions
1230
- * Create: ccw issue solution <issue-id> --data '{"tasks":[...]}'
1231
- * Read: ccw issue solution <issue-id> [--brief] [--solution-id <id>]
1232
- * Brief: Returns { solution_id, files_touched[], task_count } for each solution
1233
- */
1234
- async function solutionAction(issueId: string | undefined, options: IssueOptions): Promise<void> {
1235
- if (!issueId) {
1236
- console.error(chalk.red('Issue ID required'));
1237
- console.error(chalk.gray('Usage: ccw issue solution <issue-id> [--brief] [--solution-id <id>]'));
1238
- console.error(chalk.gray(' ccw issue solution <issue-id> --data \'{"tasks":[...]}\''));
1239
- process.exit(1);
1240
- }
1241
-
1242
- let jsonData: string | undefined = options.data;
1243
-
1244
- // Support stdin pipe input (avoids shell escaping issues)
1245
- if (!jsonData && !process.stdin.isTTY) {
1246
- try {
1247
- jsonData = readFileSync(0, 'utf-8').trim();
1248
- } catch {
1249
- // stdin not available or empty
1250
- }
1251
- }
1252
-
1253
- // CREATE mode: if --data provided
1254
- if (jsonData) {
1255
- try {
1256
- const data = JSON.parse(jsonData);
1257
- const solution = createSolution(issueId, data);
1258
- console.log(JSON.stringify(solution, null, 2));
1259
- } catch (err) {
1260
- console.error(chalk.red((err as Error).message));
1261
- process.exit(1);
1262
- }
1263
- return;
1264
- }
1265
-
1266
- // READ mode: list solutions for issue
1267
- const issue = findIssue(issueId);
1268
- if (!issue) {
1269
- console.error(chalk.red(`Issue "${issueId}" not found`));
1270
- process.exit(1);
1271
- }
1272
-
1273
- const solutions = readSolutions(issueId);
1274
- if (solutions.length === 0) {
1275
- if (options.json || options.brief) {
1276
- console.log('[]');
1277
- } else {
1278
- console.log(chalk.yellow(`No solutions found for ${issueId}`));
1279
- }
1280
- return;
1281
- }
1282
-
1283
- // Filter by solution-id if specified
1284
- let targetSolutions = solutions;
1285
- if (options.solutionId) {
1286
- targetSolutions = solutions.filter(s => s.id === options.solutionId);
1287
- if (targetSolutions.length === 0) {
1288
- console.error(chalk.red(`Solution "${options.solutionId}" not found`));
1289
- process.exit(1);
1290
- }
1291
- }
1292
-
1293
- // Brief mode: extract files_touched from modification_points
1294
- if (options.brief) {
1295
- const briefSolutions = targetSolutions.map(sol => {
1296
- const filesTouched = new Set<string>();
1297
- for (const task of sol.tasks) {
1298
- if (task.modification_points) {
1299
- for (const mp of task.modification_points) {
1300
- if (mp.file) filesTouched.add(mp.file);
1301
- }
1302
- }
1303
- }
1304
- return {
1305
- solution_id: sol.id,
1306
- is_bound: sol.is_bound,
1307
- task_count: sol.tasks.length,
1308
- files_touched: Array.from(filesTouched)
1309
- };
1310
- });
1311
- console.log(JSON.stringify(briefSolutions, null, 2));
1312
- return;
1313
- }
1314
-
1315
- // JSON mode: full solutions
1316
- if (options.json) {
1317
- console.log(JSON.stringify(targetSolutions, null, 2));
1318
- return;
1319
- }
1320
-
1321
- // Human-readable output
1322
- console.log(chalk.bold.cyan(`\nSolutions for ${issueId}:\n`));
1323
- for (const sol of targetSolutions) {
1324
- const marker = sol.is_bound ? chalk.green('◉ BOUND') : chalk.gray('○');
1325
- console.log(`${marker} ${sol.id}`);
1326
- console.log(chalk.gray(` Tasks: ${sol.tasks.length}`));
1327
- if (sol.description) {
1328
- console.log(chalk.gray(` ${sol.description.substring(0, 80)}...`));
1329
- }
1330
- console.log();
1331
- }
1332
- }
1333
-
1334
- /**
1335
- * solutions - Batch query solutions for multiple issues
1336
- * Usage: ccw issue solutions --status planned --brief
1337
- */
1338
- async function solutionsAction(options: IssueOptions): Promise<void> {
1339
- // Get issues filtered by status
1340
- const issues = readIssues();
1341
- let targetIssues = issues;
1342
-
1343
- if (options.status) {
1344
- const statuses = options.status.split(',').map((s: string) => s.trim());
1345
- targetIssues = issues.filter((i: Issue) => statuses.includes(i.status));
1346
- }
1347
-
1348
- // Filter to only issues with bound_solution_id
1349
- const boundIssues = targetIssues.filter((i: Issue) => i.bound_solution_id);
1350
-
1351
- if (boundIssues.length === 0) {
1352
- if (options.json || options.brief) {
1353
- console.log('[]');
1354
- } else {
1355
- console.log(chalk.yellow('No bound solutions found'));
1356
- }
1357
- return;
1358
- }
1359
-
1360
- // Collect solutions for all bound issues
1361
- const allSolutions: Array<{
1362
- issue_id: string;
1363
- solution_id: string;
1364
- is_bound: boolean;
1365
- task_count: number;
1366
- files_touched: string[];
1367
- priority?: number;
1368
- }> = [];
1369
-
1370
- for (const issue of boundIssues) {
1371
- const solutions = readSolutions(issue.id);
1372
- const boundSolution = solutions.find(s => s.id === issue.bound_solution_id);
1373
-
1374
- if (boundSolution) {
1375
- const filesTouched = new Set<string>();
1376
- for (const task of boundSolution.tasks) {
1377
- if (task.modification_points) {
1378
- for (const mp of task.modification_points) {
1379
- if (mp.file) filesTouched.add(mp.file);
1380
- }
1381
- }
1382
- }
1383
-
1384
- allSolutions.push({
1385
- issue_id: issue.id,
1386
- solution_id: boundSolution.id,
1387
- is_bound: true,
1388
- task_count: boundSolution.tasks.length,
1389
- files_touched: Array.from(filesTouched),
1390
- priority: issue.priority
1391
- });
1392
- }
1393
- }
1394
-
1395
- // Brief mode: already minimal
1396
- if (options.brief || options.json) {
1397
- console.log(JSON.stringify(allSolutions, null, 2));
1398
- return;
1399
- }
1400
-
1401
- // Human-readable output
1402
- console.log(chalk.bold.cyan(`\nBound Solutions (${allSolutions.length}):\n`));
1403
- for (const sol of allSolutions) {
1404
- console.log(`${chalk.green('◉')} ${sol.issue_id} → ${sol.solution_id}`);
1405
- console.log(chalk.gray(` Tasks: ${sol.task_count}, Files: ${sol.files_touched.length}`));
1406
- }
1407
- }
1408
-
1409
- /**
1410
- * init - Initialize a new issue (manual ID)
1411
- */
1412
- async function initAction(issueId: string | undefined, options: IssueOptions): Promise<void> {
1413
- if (!issueId) {
1414
- console.error(chalk.red('Issue ID is required'));
1415
- console.error(chalk.gray('Usage: ccw issue init <issue-id> [--title "..."]'));
1416
- process.exit(1);
1417
- }
1418
-
1419
- const existing = findIssue(issueId);
1420
- if (existing && !options.force) {
1421
- console.error(chalk.red(`Issue "${issueId}" already exists`));
1422
- console.error(chalk.gray('Use --force to reinitialize'));
1423
- process.exit(1);
1424
- }
1425
-
1426
- const issues = readIssues().filter(i => i.id !== issueId);
1427
- const newIssue: Issue = {
1428
- id: issueId,
1429
- title: options.title || issueId,
1430
- status: 'registered',
1431
- priority: options.priority ? parseInt(options.priority) : 3,
1432
- context: options.description || '',
1433
- bound_solution_id: null,
1434
- created_at: new Date().toISOString(),
1435
- updated_at: new Date().toISOString()
1436
- };
1437
-
1438
- issues.push(newIssue);
1439
- writeIssues(issues);
1440
-
1441
- console.log(chalk.green(`✓ Issue "${issueId}" initialized`));
1442
- console.log(chalk.gray(` Next: ccw issue task ${issueId} --title "Task title"`));
1443
- }
1444
-
1445
- /**
1446
- * list - List issues or tasks
1447
- */
1448
- async function listAction(issueId: string | undefined, options: IssueOptions): Promise<void> {
1449
- if (!issueId) {
1450
- // List all issues
1451
- let issues = readIssues();
1452
-
1453
- // Filter by status if specified
1454
- if (options.status) {
1455
- const statuses = options.status.split(',').map(s => s.trim());
1456
- issues = issues.filter(i => statuses.includes(i.status));
1457
- }
1458
-
1459
- // Brief mode: minimal fields only (id, title, status, priority, tags, bound_solution_id)
1460
- if (options.brief) {
1461
- const briefIssues = issues.map(i => ({
1462
- id: i.id,
1463
- title: i.title,
1464
- status: i.status,
1465
- priority: i.priority,
1466
- tags: i.tags || [],
1467
- bound_solution_id: i.bound_solution_id
1468
- }));
1469
- console.log(JSON.stringify(briefIssues, null, 2));
1470
- return;
1471
- }
1472
-
1473
- if (options.json) {
1474
- console.log(JSON.stringify(issues, null, 2));
1475
- return;
1476
- }
1477
-
1478
- if (issues.length === 0) {
1479
- console.log(chalk.yellow('No issues found'));
1480
- console.log(chalk.gray('Create one with: ccw issue init <issue-id>'));
1481
- return;
1482
- }
1483
-
1484
- console.log(chalk.bold.cyan('\nIssues\n'));
1485
- console.log(chalk.gray('ID'.padEnd(20) + 'Status'.padEnd(15) + 'Solutions'.padEnd(12) + 'Title'));
1486
- console.log(chalk.gray('-'.repeat(70)));
1487
-
1488
- for (const issue of issues) {
1489
- const statusColor = {
1490
- 'registered': chalk.gray,
1491
- 'planning': chalk.blue,
1492
- 'planned': chalk.cyan,
1493
- 'queued': chalk.yellow,
1494
- 'executing': chalk.yellow,
1495
- 'completed': chalk.green,
1496
- 'failed': chalk.red,
1497
- 'paused': chalk.magenta
1498
- }[issue.status] || chalk.white;
1499
-
1500
- const solutionCount = readSolutions(issue.id).length;
1501
- const bound = issue.bound_solution_id ? `[${issue.bound_solution_id}]` : `${solutionCount}`;
1502
- console.log(
1503
- issue.id.padEnd(20) +
1504
- statusColor(issue.status.padEnd(15)) +
1505
- bound.padEnd(12) +
1506
- (issue.title || '').substring(0, 30)
1507
- );
1508
- }
1509
- return;
1510
- }
1511
-
1512
- // List tasks in bound solution
1513
- const issue = findIssue(issueId);
1514
- if (!issue) {
1515
- console.error(chalk.red(`Issue "${issueId}" not found`));
1516
- process.exit(1);
1517
- }
1518
-
1519
- const solution = getBoundSolution(issueId);
1520
- const tasks = solution?.tasks || [];
1521
-
1522
- if (options.json) {
1523
- console.log(JSON.stringify({ issue, solution, tasks }, null, 2));
1524
- return;
1525
- }
1526
-
1527
- console.log(chalk.bold.cyan(`\nIssue: ${issueId}\n`));
1528
- console.log(`Title: ${issue.title}`);
1529
- console.log(`Status: ${issue.status}`);
1530
- console.log(`Bound: ${issue.bound_solution_id || 'none'}`);
1531
- console.log();
1532
-
1533
- if (tasks.length === 0) {
1534
- console.log(chalk.yellow('No tasks (bind a solution first)'));
1535
- return;
1536
- }
1537
-
1538
- console.log(chalk.gray('ID'.padEnd(8) + 'Action'.padEnd(12) + 'Scope'.padEnd(20) + 'Title'));
1539
- console.log(chalk.gray('-'.repeat(70)));
1540
-
1541
- for (const task of tasks) {
1542
- console.log(
1543
- task.id.padEnd(8) +
1544
- task.action.padEnd(12) +
1545
- task.scope.substring(0, 18).padEnd(20) +
1546
- task.title.substring(0, 30)
1547
- );
1548
- }
1549
- }
1550
-
1551
- /**
1552
- * history - List completed issues from history
1553
- */
1554
- async function historyAction(options: IssueOptions): Promise<void> {
1555
- const history = readIssueHistory();
1556
-
1557
- // Brief mode: minimal fields only
1558
- if (options.brief) {
1559
- const briefHistory = history.map(i => ({
1560
- id: i.id,
1561
- title: i.title,
1562
- status: i.status,
1563
- completed_at: i.completed_at
1564
- }));
1565
- console.log(JSON.stringify(briefHistory, null, 2));
1566
- return;
1567
- }
1568
-
1569
- if (options.json) {
1570
- console.log(JSON.stringify(history, null, 2));
1571
- return;
1572
- }
1573
-
1574
- if (history.length === 0) {
1575
- console.log(chalk.yellow('No completed issues in history'));
1576
- return;
1577
- }
1578
-
1579
- console.log(chalk.bold.cyan('\nIssue History (Completed)\n'));
1580
- console.log(chalk.gray('ID'.padEnd(25) + 'Completed At'.padEnd(22) + 'Title'));
1581
- console.log(chalk.gray('-'.repeat(80)));
1582
-
1583
- for (const issue of history) {
1584
- const completedAt = issue.completed_at
1585
- ? new Date(issue.completed_at).toLocaleString()
1586
- : 'N/A';
1587
- console.log(
1588
- chalk.green(issue.id.padEnd(25)) +
1589
- completedAt.padEnd(22) +
1590
- (issue.title || '').substring(0, 35)
1591
- );
1592
- }
1593
-
1594
- console.log(chalk.gray(`\nTotal: ${history.length} completed issues`));
1595
- }
1596
-
1597
- /**
1598
- * status - Show detailed status
1599
- */
1600
- async function statusAction(issueId: string | undefined, options: IssueOptions): Promise<void> {
1601
- if (!issueId) {
1602
- // Show queue status
1603
- const queue = readActiveQueue();
1604
- const issues = readIssues();
1605
- const index = readQueueIndex();
1606
-
1607
- if (options.json) {
1608
- // Return full queue for programmatic access
1609
- console.log(JSON.stringify(queue, null, 2));
1610
- return;
1611
- }
1612
-
1613
- console.log(chalk.bold.cyan('\nSystem Status\n'));
1614
- console.log(`Issues: ${issues.length}`);
1615
- console.log(`Queues: ${index.queues.length} (Active: ${index.active_queue_id || 'none'})`);
1616
- console.log(`Active Queue: ${queue._metadata.total_tasks} tasks`);
1617
- console.log(` Pending: ${queue._metadata.pending_count}`);
1618
- console.log(` Executing: ${queue._metadata.executing_count}`);
1619
- console.log(` Completed: ${queue._metadata.completed_count}`);
1620
- console.log(` Failed: ${queue._metadata.failed_count}`);
1621
- return;
1622
- }
1623
-
1624
- const issue = findIssue(issueId);
1625
- if (!issue) {
1626
- console.error(chalk.red(`Issue "${issueId}" not found`));
1627
- process.exit(1);
1628
- }
1629
-
1630
- const solutions = readSolutions(issueId);
1631
- const boundSol = solutions.find(s => s.is_bound);
1632
-
1633
- if (options.json) {
1634
- console.log(JSON.stringify({ issue, solutions, bound: boundSol }, null, 2));
1635
- return;
1636
- }
1637
-
1638
- console.log(chalk.bold.cyan(`\nIssue: ${issueId}\n`));
1639
- console.log(`Title: ${issue.title}`);
1640
- console.log(`Status: ${issue.status}`);
1641
- console.log(`Priority: ${issue.priority}`);
1642
- console.log(`Created: ${issue.created_at}`);
1643
- console.log(`Updated: ${issue.updated_at}`);
1644
-
1645
- if (issue.context) {
1646
- console.log();
1647
- console.log(chalk.bold('Context:'));
1648
- console.log(issue.context.substring(0, 200));
1649
- }
1650
-
1651
- console.log();
1652
- console.log(chalk.bold(`Solutions (${solutions.length}):`));
1653
- for (const sol of solutions) {
1654
- const marker = sol.is_bound ? chalk.green('◉') : chalk.gray('○');
1655
- console.log(` ${marker} ${sol.id}: ${sol.tasks.length} tasks`);
1656
- }
1657
- }
1658
-
1659
- /**
1660
- * task - Add or update task (simplified - mainly for manual task management)
1661
- */
1662
- async function taskAction(issueId: string | undefined, taskId: string | undefined, options: IssueOptions): Promise<void> {
1663
- if (!issueId) {
1664
- console.error(chalk.red('Issue ID is required'));
1665
- console.error(chalk.gray('Usage: ccw issue task <issue-id> [task-id] --title "..."'));
1666
- process.exit(1);
1667
- }
1668
-
1669
- const issue = findIssue(issueId);
1670
- if (!issue) {
1671
- console.error(chalk.red(`Issue "${issueId}" not found`));
1672
- process.exit(1);
1673
- }
1674
-
1675
- const solutions = readSolutions(issueId);
1676
- let boundIdx = solutions.findIndex(s => s.is_bound);
1677
-
1678
- // Create default solution if none bound
1679
- if (boundIdx === -1) {
1680
- const newSol: Solution = {
1681
- id: generateSolutionId(issueId, solutions),
1682
- description: 'Manual tasks',
1683
- tasks: [],
1684
- is_bound: true,
1685
- created_at: new Date().toISOString(),
1686
- bound_at: new Date().toISOString()
1687
- };
1688
- solutions.push(newSol);
1689
- boundIdx = solutions.length - 1;
1690
- updateIssue(issueId, { bound_solution_id: newSol.id, status: 'planned' });
1691
- }
1692
-
1693
- const solution = solutions[boundIdx];
1694
-
1695
- if (taskId) {
1696
- // Update existing task
1697
- const taskIdx = solution.tasks.findIndex(t => t.id === taskId);
1698
- if (taskIdx === -1) {
1699
- console.error(chalk.red(`Task "${taskId}" not found`));
1700
- process.exit(1);
1701
- }
1702
-
1703
- if (options.title) solution.tasks[taskIdx].title = options.title;
1704
- if (options.status) solution.tasks[taskIdx].status = options.status;
1705
-
1706
- writeSolutions(issueId, solutions);
1707
- console.log(chalk.green(`✓ Task ${taskId} updated`));
1708
- } else {
1709
- // Add new task
1710
- if (!options.title) {
1711
- console.error(chalk.red('Task title is required (--title)'));
1712
- process.exit(1);
1713
- }
1714
-
1715
- const newTaskId = `T${solution.tasks.length + 1}`;
1716
- const newTask: SolutionTask = {
1717
- id: newTaskId,
1718
- title: options.title,
1719
- scope: '',
1720
- action: 'Implement',
1721
- description: options.description || options.title,
1722
- implementation: [],
1723
- test: {
1724
- unit: [],
1725
- commands: ['npm test']
1726
- },
1727
- regression: ['npm test'],
1728
- acceptance: {
1729
- criteria: ['Task completed successfully'],
1730
- verification: ['Manual verification']
1731
- },
1732
- commit: {
1733
- type: 'feat',
1734
- scope: 'core',
1735
- message_template: `feat(core): ${options.title}`
1736
- },
1737
- depends_on: []
1738
- };
1739
-
1740
- solution.tasks.push(newTask);
1741
- writeSolutions(issueId, solutions);
1742
- console.log(chalk.green(`✓ Task ${newTaskId} added to ${issueId}`));
1743
- }
1744
- }
1745
-
1746
- /**
1747
- * update - Update issue fields (status, priority, title, etc.)
1748
- * --from-queue: Sync statuses from active queue (auto-update queued issues)
1749
- */
1750
- async function updateAction(issueId: string | undefined, options: IssueOptions): Promise<void> {
1751
- // Handle --from-queue: Sync statuses from queue
1752
- if (options.fromQueue) {
1753
- // Determine queue ID: string value = specific queue, true = active queue
1754
- const queueId = typeof options.fromQueue === 'string' ? options.fromQueue : undefined;
1755
- const queue = queueId ? readQueue(queueId) : readActiveQueue();
1756
-
1757
- if (!queue) {
1758
- if (options.json) {
1759
- console.log(JSON.stringify({ success: false, message: `Queue not found: ${queueId}`, queued: [], unplanned: [] }));
1760
- } else {
1761
- console.log(chalk.red(`Queue not found: ${queueId}`));
1762
- }
1763
- return;
1764
- }
1765
-
1766
- const items = queue.solutions || queue.tasks || [];
1767
- const allIssues = readIssues();
1768
-
1769
- if (!queue.id || items.length === 0) {
1770
- if (options.json) {
1771
- console.log(JSON.stringify({ success: false, message: 'No active queue', queued: [], unplanned: [] }));
1772
- } else {
1773
- console.log(chalk.yellow('No active queue to sync from'));
1774
- }
1775
- return;
1776
- }
1777
-
1778
- // Get issue IDs from queue
1779
- const queuedIssueIds = new Set(items.map(item => item.issue_id));
1780
- const now = new Date().toISOString();
1781
-
1782
- // Track updates
1783
- const updated: string[] = [];
1784
- const unplanned: string[] = [];
1785
-
1786
- // Update queued issues
1787
- for (const issueId of queuedIssueIds) {
1788
- const issue = allIssues.find(i => i.id === issueId);
1789
- if (issue && issue.status !== 'queued' && issue.status !== 'executing' && issue.status !== 'completed') {
1790
- updateIssue(issueId, { status: 'queued', queued_at: now });
1791
- updated.push(issueId);
1792
- }
1793
- }
1794
-
1795
- // Find planned issues NOT in queue
1796
- for (const issue of allIssues) {
1797
- if (issue.status === 'planned' && issue.bound_solution_id && !queuedIssueIds.has(issue.id)) {
1798
- unplanned.push(issue.id);
1799
- }
1800
- }
1801
-
1802
- if (options.json) {
1803
- console.log(JSON.stringify({
1804
- success: true,
1805
- queue_id: queue.id,
1806
- queued: updated,
1807
- queued_count: updated.length,
1808
- unplanned: unplanned,
1809
- unplanned_count: unplanned.length
1810
- }, null, 2));
1811
- } else {
1812
- console.log(chalk.green(`✓ Synced from queue ${queue.id}`));
1813
- console.log(chalk.gray(` Updated to 'queued': ${updated.length} issues`));
1814
- if (updated.length > 0) {
1815
- updated.forEach(id => console.log(chalk.gray(` - ${id}`)));
1816
- }
1817
- if (unplanned.length > 0) {
1818
- console.log(chalk.yellow(` Planned but NOT in queue: ${unplanned.length} issues`));
1819
- unplanned.forEach(id => console.log(chalk.yellow(` - ${id}`)));
1820
- }
1821
- }
1822
- return;
1823
- }
1824
-
1825
- // Standard single-issue update
1826
- if (!issueId) {
1827
- console.error(chalk.red('Issue ID is required'));
1828
- console.error(chalk.gray('Usage: ccw issue update <issue-id> --status <status>'));
1829
- console.error(chalk.gray(' ccw issue update --from-queue [queue-id] (sync from queue)'));
1830
- process.exit(1);
1831
- }
1832
-
1833
- const issue = findIssue(issueId);
1834
- if (!issue) {
1835
- console.error(chalk.red(`Issue "${issueId}" not found`));
1836
- process.exit(1);
1837
- }
1838
-
1839
- const updates: Partial<Issue> = {};
1840
-
1841
- if (options.status) {
1842
- if (!validateIssueStatus(options.status)) {
1843
- console.error(chalk.red(`Invalid status: ${options.status}`));
1844
- console.error(chalk.gray(`Valid: ${VALID_ISSUE_STATUSES.join(', ')}`));
1845
- process.exit(1);
1846
- }
1847
- updates.status = options.status;
1848
-
1849
- // Auto-set timestamps based on status
1850
- if (options.status === 'planned') updates.planned_at = new Date().toISOString();
1851
- if (options.status === 'queued') updates.queued_at = new Date().toISOString();
1852
- if (options.status === 'completed') updates.completed_at = new Date().toISOString();
1853
- }
1854
-
1855
- if (options.priority) {
1856
- updates.priority = parseInt(options.priority);
1857
- }
1858
-
1859
- if (options.title) {
1860
- updates.title = options.title;
1861
- }
1862
-
1863
- if (options.description) {
1864
- updates.context = options.description;
1865
- }
1866
-
1867
- if (Object.keys(updates).length === 0) {
1868
- console.error(chalk.yellow('No updates specified'));
1869
- console.error(chalk.gray('Use --status, --priority, --title, or --description'));
1870
- return;
1871
- }
1872
-
1873
- updateIssue(issueId, updates);
1874
-
1875
- if (options.json) {
1876
- console.log(JSON.stringify({ success: true, issue_id: issueId, updates }));
1877
- } else {
1878
- console.log(chalk.green(`✓ Issue "${issueId}" updated`));
1879
- Object.entries(updates).forEach(([k, v]) => {
1880
- console.log(chalk.gray(` ${k}: ${v}`));
1881
- });
1882
- }
1883
- }
1884
-
1885
- /**
1886
- * bind - Register and/or bind a solution
1887
- */
1888
- async function bindAction(issueId: string | undefined, solutionId: string | undefined, options: IssueOptions): Promise<void> {
1889
- if (!issueId) {
1890
- console.error(chalk.red('Issue ID is required'));
1891
- console.error(chalk.gray('Usage: ccw issue bind <issue-id> [solution-id] [--solution <path>]'));
1892
- process.exit(1);
1893
- }
1894
-
1895
- const issue = findIssue(issueId);
1896
- if (!issue) {
1897
- console.error(chalk.red(`Issue "${issueId}" not found`));
1898
- process.exit(1);
1899
- }
1900
-
1901
- let solutions = readSolutions(issueId);
1902
-
1903
- // Register new solution from file if provided
1904
- if (options.solution) {
1905
- try {
1906
- const content = readFileSync(options.solution, 'utf-8');
1907
- const data = JSON.parse(content);
1908
- // Priority: CLI arg > file content ID > generate new (SOL-{issue-id}-{seq})
1909
- const newSol: Solution = {
1910
- id: solutionId || data.id || generateSolutionId(issueId, solutions),
1911
- description: data.description || data.approach_name || 'Imported solution',
1912
- tasks: data.tasks || [],
1913
- exploration_context: data.exploration_context,
1914
- analysis: data.analysis,
1915
- score: data.score,
1916
- is_bound: false,
1917
- created_at: new Date().toISOString()
1918
- };
1919
- solutions.push(newSol);
1920
- solutionId = newSol.id;
1921
- console.log(chalk.green(`✓ Solution ${solutionId} registered (${newSol.tasks.length} tasks)`));
1922
- } catch (e) {
1923
- console.error(chalk.red(`Failed to read solution file: ${options.solution}`));
1924
- process.exit(1);
1925
- }
1926
- }
1927
-
1928
- if (!solutionId) {
1929
- // List available solutions
1930
- if (solutions.length === 0) {
1931
- console.log(chalk.yellow('No solutions available'));
1932
- console.log(chalk.gray('Register one: ccw issue bind <issue-id> --solution <path>'));
1933
- return;
1934
- }
1935
-
1936
- console.log(chalk.bold.cyan(`\nSolutions for ${issueId}:\n`));
1937
- for (const sol of solutions) {
1938
- const marker = sol.is_bound ? chalk.green('◉') : chalk.gray('○');
1939
- console.log(` ${marker} ${sol.id}: ${sol.tasks.length} tasks - ${sol.description || ''}`);
1940
- }
1941
- return;
1942
- }
1943
-
1944
- // Bind the specified solution
1945
- const solIdx = solutions.findIndex(s => s.id === solutionId);
1946
- if (solIdx === -1) {
1947
- console.error(chalk.red(`Solution "${solutionId}" not found`));
1948
- process.exit(1);
1949
- }
1950
-
1951
- // Unbind all, bind selected
1952
- solutions = solutions.map(s => ({ ...s, is_bound: false }));
1953
- solutions[solIdx].is_bound = true;
1954
- solutions[solIdx].bound_at = new Date().toISOString();
1955
-
1956
- writeSolutions(issueId, solutions);
1957
- updateIssue(issueId, {
1958
- bound_solution_id: solutionId,
1959
- status: 'planned',
1960
- planned_at: new Date().toISOString()
1961
- });
1962
-
1963
- console.log(chalk.green(`✓ Solution ${solutionId} bound to ${issueId}`));
1964
- }
1965
-
1966
- /**
1967
- * queue - Queue management (list / add / history)
1968
- */
1969
- async function queueAction(subAction: string | undefined, issueId: string | undefined, options: IssueOptions): Promise<void> {
1970
- // List all queues (history)
1971
- if (subAction === 'list' || subAction === 'history') {
1972
- const index = readQueueIndex();
1973
-
1974
- // Brief mode: minimal queue index info
1975
- if (options.brief) {
1976
- const briefIndex = {
1977
- active_queue_id: index.active_queue_id,
1978
- queues: index.queues.map(q => ({
1979
- id: q.id,
1980
- status: q.status,
1981
- issue_ids: q.issue_ids,
1982
- total_solutions: q.total_solutions,
1983
- completed_solutions: q.completed_solutions
1984
- }))
1985
- };
1986
- console.log(JSON.stringify(briefIndex, null, 2));
1987
- return;
1988
- }
1989
-
1990
- if (options.json) {
1991
- console.log(JSON.stringify(index, null, 2));
1992
- return;
1993
- }
1994
-
1995
- console.log(chalk.bold.cyan('\nQueue History\n'));
1996
- console.log(chalk.gray(`Active: ${index.active_queue_id || 'none'}`));
1997
- console.log();
1998
-
1999
- if (index.queues.length === 0) {
2000
- console.log(chalk.yellow('No queues found'));
2001
- console.log(chalk.gray('Create one: ccw issue queue add <issue-id>'));
2002
- return;
2003
- }
2004
-
2005
- console.log(chalk.gray('ID'.padEnd(22) + 'Status'.padEnd(12) + 'Tasks'.padEnd(10) + 'Issues'));
2006
- console.log(chalk.gray('-'.repeat(70)));
2007
-
2008
- for (const q of index.queues) {
2009
- const statusColor = {
2010
- 'active': chalk.green,
2011
- 'completed': chalk.cyan,
2012
- 'archived': chalk.gray,
2013
- 'failed': chalk.red
2014
- }[q.status] || chalk.white;
2015
-
2016
- const marker = q.id === index.active_queue_id ? '→ ' : ' ';
2017
- console.log(
2018
- marker +
2019
- q.id.padEnd(20) +
2020
- statusColor(q.status.padEnd(12)) +
2021
- `${q.completed_tasks}/${q.total_tasks}`.padEnd(10) +
2022
- q.issue_ids.join(', ')
2023
- );
2024
- }
2025
- return;
2026
- }
2027
-
2028
- // Switch active queue
2029
- if (subAction === 'switch' && issueId) {
2030
- const queueId = issueId; // issueId is actually queue ID here
2031
- const targetQueue = readQueue(queueId);
2032
-
2033
- if (!targetQueue) {
2034
- console.error(chalk.red(`Queue "${queueId}" not found`));
2035
- process.exit(1);
2036
- }
2037
-
2038
- const index = readQueueIndex();
2039
- index.active_queue_id = queueId;
2040
- // Also update active_queue_ids for multi-queue support
2041
- index.active_queue_ids = [queueId];
2042
- writeQueueIndex(index);
2043
-
2044
- console.log(chalk.green(`✓ Switched to queue ${queueId}`));
2045
- return;
2046
- }
2047
-
2048
- // Set queue priority (lower = higher priority)
2049
- if (subAction === 'priority' && issueId) {
2050
- const queueId = issueId;
2051
- const priority = parseInt(options.priority || '0');
2052
-
2053
- if (isNaN(priority)) {
2054
- console.error(chalk.red('Invalid priority value (must be a number)'));
2055
- process.exit(1);
2056
- }
2057
-
2058
- const index = readQueueIndex();
2059
- const queueEntry = index.queues.find(q => q.id === queueId);
2060
-
2061
- if (!queueEntry) {
2062
- console.error(chalk.red(`Queue "${queueId}" not found`));
2063
- process.exit(1);
2064
- }
2065
-
2066
- queueEntry.priority = priority;
2067
- writeQueueIndex(index);
2068
-
2069
- console.log(chalk.green(`✓ Queue ${queueId} priority set to ${priority}`));
2070
- return;
2071
- }
2072
-
2073
- // Activate multiple queues at once
2074
- if (subAction === 'activate' && issueId) {
2075
- const queueIds = issueId.split(',').map(id => id.trim());
2076
- const index = readQueueIndex();
2077
-
2078
- // Validate all queue IDs
2079
- for (const queueId of queueIds) {
2080
- if (!index.queues.some(q => q.id === queueId)) {
2081
- console.error(chalk.red(`Queue "${queueId}" not found`));
2082
- process.exit(1);
2083
- }
2084
- }
2085
-
2086
- index.active_queue_ids = queueIds;
2087
- index.active_queue_id = queueIds[0] || null; // Backward compat
2088
- writeQueueIndex(index);
2089
-
2090
- console.log(chalk.green(`✓ Activated ${queueIds.length} queue(s): ${queueIds.join(', ')}`));
2091
- return;
2092
- }
2093
-
2094
- // DAG - Return dependency graph for parallel execution planning (solution-level)
2095
- if (subAction === 'dag') {
2096
- let queue: Queue;
2097
-
2098
- // Use explicit queue if provided via --queue or issueId, otherwise use active queue
2099
- if (options.queue) {
2100
- const targetQueue = readQueue(options.queue);
2101
- if (!targetQueue) {
2102
- console.log(JSON.stringify({ error: `Queue ${options.queue} not found`, nodes: [], edges: [], groups: [] }));
2103
- return;
2104
- }
2105
- queue = targetQueue;
2106
- } else if (issueId && issueId.startsWith('QUE-')) {
2107
- const targetQueue = readQueue(issueId);
2108
- if (!targetQueue) {
2109
- console.log(JSON.stringify({ error: `Queue ${issueId} not found`, nodes: [], edges: [], groups: [] }));
2110
- return;
2111
- }
2112
- queue = targetQueue;
2113
- } else {
2114
- queue = readActiveQueue();
2115
- }
2116
-
2117
- // Support both old (tasks) and new (solutions) queue format
2118
- const items = queue.solutions || queue.tasks || [];
2119
- if (!queue.id || items.length === 0) {
2120
- console.log(JSON.stringify({ error: 'No active queue', nodes: [], edges: [], groups: [] }));
2121
- return;
2122
- }
2123
-
2124
- // Build DAG nodes (solution-level)
2125
- const completedIds = new Set(items.filter(t => t.status === 'completed').map(t => t.item_id));
2126
- const failedIds = new Set(items.filter(t => t.status === 'failed').map(t => t.item_id));
2127
-
2128
- const nodes = items.map(item => ({
2129
- id: item.item_id,
2130
- issue_id: item.issue_id,
2131
- solution_id: item.solution_id,
2132
- status: item.status,
2133
- priority: item.semantic_priority,
2134
- depends_on: item.depends_on || [],
2135
- task_count: item.task_count || 1,
2136
- files_touched: item.files_touched || [],
2137
- // Calculate if ready (dependencies satisfied)
2138
- ready: item.status === 'pending' && (item.depends_on || []).every(d => completedIds.has(d)),
2139
- blocked_by: (item.depends_on || []).filter(d => !completedIds.has(d) && !failedIds.has(d))
2140
- }));
2141
-
2142
- // Build edges for visualization
2143
- const edges = items.flatMap(item =>
2144
- (item.depends_on || []).map(dep => ({ from: dep, to: item.item_id }))
2145
- );
2146
-
2147
- // Group ready items by execution_group
2148
- const readyItems = nodes.filter(n => n.ready || n.status === 'executing');
2149
- const groups: Record<string, string[]> = {};
2150
-
2151
- for (const item of items) {
2152
- if (readyItems.some(r => r.id === item.item_id)) {
2153
- const group = item.execution_group || 'P1';
2154
- if (!groups[group]) groups[group] = [];
2155
- groups[group].push(item.item_id);
2156
- }
2157
- }
2158
-
2159
- // Calculate parallel batches - prefer execution_groups from queue if available
2160
- const parallelBatches: string[][] = [];
2161
- const readyItemIds = new Set(readyItems.map(t => t.id));
2162
-
2163
- // Check if queue has pre-assigned execution_groups
2164
- if (queue.execution_groups && queue.execution_groups.length > 0) {
2165
- // Use agent-assigned execution groups
2166
- for (const group of queue.execution_groups) {
2167
- const groupItems = (group.solutions || group.tasks || [])
2168
- .filter((id: string) => readyItemIds.has(id));
2169
- if (groupItems.length > 0) {
2170
- if (group.type === 'parallel') {
2171
- // All items in parallel group can run together
2172
- parallelBatches.push(groupItems);
2173
- } else {
2174
- // Sequential group: each item is its own batch
2175
- for (const itemId of groupItems) {
2176
- parallelBatches.push([itemId]);
2177
- }
2178
- }
2179
- }
2180
- }
2181
- } else {
2182
- // Fallback: calculate parallel batches from file conflicts
2183
- const remainingReady = new Set(readyItemIds);
2184
-
2185
- while (remainingReady.size > 0) {
2186
- const batch: string[] = [];
2187
- const batchFiles = new Set<string>();
2188
-
2189
- for (const itemId of Array.from(remainingReady)) {
2190
- const item = items.find(t => t.item_id === itemId);
2191
- if (!item) continue;
2192
-
2193
- // Get all files touched by this solution
2194
- let solutionFiles: string[] = item.files_touched || [];
2195
-
2196
- // If not in queue item, fetch from solution definition
2197
- if (solutionFiles.length === 0) {
2198
- const solution = findSolution(item.issue_id, item.solution_id);
2199
- if (solution?.tasks) {
2200
- for (const task of solution.tasks) {
2201
- for (const mp of task.modification_points || []) {
2202
- solutionFiles.push(mp.file);
2203
- }
2204
- }
2205
- }
2206
- }
2207
-
2208
- const hasConflict = solutionFiles.some(f => batchFiles.has(f));
2209
-
2210
- if (!hasConflict) {
2211
- batch.push(itemId);
2212
- solutionFiles.forEach(f => batchFiles.add(f));
2213
- }
2214
- }
2215
-
2216
- if (batch.length === 0) {
2217
- // Fallback: take one at a time if all conflict
2218
- const first = Array.from(remainingReady)[0];
2219
- batch.push(first);
2220
- }
2221
-
2222
- parallelBatches.push(batch);
2223
- batch.forEach(id => remainingReady.delete(id));
2224
- }
2225
- }
2226
-
2227
- console.log(JSON.stringify({
2228
- queue_id: queue.id,
2229
- total: nodes.length,
2230
- ready_count: readyItems.length,
2231
- completed_count: completedIds.size,
2232
- nodes,
2233
- edges,
2234
- groups: Object.entries(groups).map(([id, solutions]) => ({ id, solutions })),
2235
- parallel_batches: parallelBatches,
2236
- _summary: {
2237
- can_parallel: parallelBatches[0]?.length || 0,
2238
- batches_needed: parallelBatches.length
2239
- }
2240
- }, null, 2));
2241
- return;
2242
- }
2243
-
2244
- // Merge queues: ccw issue queue merge <source-id> --queue <target-id>
2245
- if (subAction === 'merge' && issueId) {
2246
- const sourceQueueId = issueId; // issueId is actually source queue ID here
2247
- const targetQueueId = options.queue; // --queue option
2248
-
2249
- if (!targetQueueId) {
2250
- console.error(chalk.red('Target queue ID required'));
2251
- console.error(chalk.gray('Usage: ccw issue queue merge <source-id> --queue <target-id>'));
2252
- process.exit(1);
2253
- }
2254
-
2255
- const sourceQueue = readQueue(sourceQueueId);
2256
- const targetQueue = readQueue(targetQueueId);
2257
-
2258
- if (!sourceQueue) {
2259
- console.error(chalk.red(`Source queue "${sourceQueueId}" not found`));
2260
- process.exit(1);
2261
- }
2262
-
2263
- if (!targetQueue) {
2264
- console.error(chalk.red(`Target queue "${targetQueueId}" not found`));
2265
- process.exit(1);
2266
- }
2267
-
2268
- // mergeQueues marks source as 'archived' and updates index
2269
- const result = mergeQueues(targetQueue, sourceQueue);
2270
-
2271
- if (options.json) {
2272
- console.log(JSON.stringify({
2273
- success: result.success,
2274
- sourceQueueId,
2275
- targetQueueId,
2276
- itemsMerged: result.itemsMerged,
2277
- skippedDuplicates: result.skippedDuplicates,
2278
- totalItems: result.totalItems,
2279
- reason: result.reason
2280
- }, null, 2));
2281
- } else {
2282
- if (result.success) {
2283
- console.log(chalk.green(`✓ Merged ${result.itemsMerged} items from ${sourceQueueId} into ${targetQueueId}`));
2284
- if (result.skippedDuplicates > 0) {
2285
- console.log(chalk.gray(` Skipped ${result.skippedDuplicates} duplicate items`));
2286
- }
2287
- console.log(chalk.gray(` Total items in target: ${result.totalItems}`));
2288
- console.log(chalk.gray(` Source queue ${sourceQueueId} archived`));
2289
- } else {
2290
- console.log(chalk.yellow(`⚠ Merge skipped: ${result.reason}`));
2291
- }
2292
- }
2293
- return;
2294
- }
2295
-
2296
- // Archive current queue
2297
- if (subAction === 'archive') {
2298
- const queue = readActiveQueue();
2299
- const items = queue.solutions || queue.tasks || [];
2300
- if (!queue.id || items.length === 0) {
2301
- console.log(chalk.yellow('No active queue to archive'));
2302
- return;
2303
- }
2304
-
2305
- queue.status = 'archived';
2306
- writeQueue(queue);
2307
-
2308
- const index = readQueueIndex();
2309
- index.active_queue_id = null;
2310
- writeQueueIndex(index);
2311
-
2312
- console.log(chalk.green(`✓ Archived queue ${queue.id}`));
2313
- return;
2314
- }
2315
-
2316
- // Delete queue from history
2317
- if ((subAction === 'clear' || subAction === 'delete') && issueId) {
2318
- const queueId = issueId; // issueId is actually queue ID here
2319
- const queuePath = join(getQueuesDir(), `${queueId}.json`);
2320
-
2321
- if (!existsSync(queuePath)) {
2322
- console.error(chalk.red(`Queue "${queueId}" not found`));
2323
- process.exit(1);
2324
- }
2325
-
2326
- if (!options.force) {
2327
- const { proceed } = await inquirer.prompt([{
2328
- type: 'confirm',
2329
- name: 'proceed',
2330
- message: `Delete queue ${queueId}? This action cannot be undone.`,
2331
- default: false
2332
- }]);
2333
-
2334
- if (!proceed) {
2335
- console.log(chalk.yellow('Queue deletion cancelled'));
2336
- return;
2337
- }
2338
- }
2339
-
2340
- // Remove from index
2341
- const index = readQueueIndex();
2342
- index.queues = index.queues.filter(q => q.id !== queueId);
2343
- if (index.active_queue_id === queueId) {
2344
- index.active_queue_id = null;
2345
- }
2346
- writeQueueIndex(index);
2347
-
2348
- // Delete queue file
2349
- unlinkSync(queuePath);
2350
-
2351
- console.log(chalk.green(`✓ Deleted queue ${queueId}`));
2352
- return;
2353
- }
2354
-
2355
- // Add issue solution to queue (solution-level granularity)
2356
- if (subAction === 'add' && issueId) {
2357
- const issue = findIssue(issueId);
2358
- if (!issue) {
2359
- console.error(chalk.red(`Issue "${issueId}" not found`));
2360
- process.exit(1);
2361
- }
2362
-
2363
- const solution = getBoundSolution(issueId);
2364
- if (!solution) {
2365
- console.error(chalk.red(`No bound solution for "${issueId}"`));
2366
- console.error(chalk.gray('First bind a solution: ccw issue bind <issue-id> <solution-id>'));
2367
- process.exit(1);
2368
- }
2369
-
2370
- // Step 1: Create new queue (temporary, not active yet)
2371
- const newQueue = createEmptyQueue();
2372
- newQueue.solutions = [];
2373
-
2374
- // Add issue to queue's issue list
2375
- newQueue.issue_ids.push(issueId);
2376
-
2377
- // Collect all files touched by this solution
2378
- const filesTouched = new Set<string>();
2379
- for (const task of solution.tasks || []) {
2380
- for (const mp of task.modification_points || []) {
2381
- filesTouched.add(mp.file);
2382
- }
2383
- }
2384
-
2385
- // Create solution-level queue item (S-N)
2386
- newQueue.solutions.push({
2387
- item_id: generateQueueItemId(newQueue, 'solution'),
2388
- issue_id: issueId,
2389
- solution_id: solution.id,
2390
- status: 'pending',
2391
- execution_order: 1,
2392
- execution_group: 'P1',
2393
- depends_on: [],
2394
- semantic_priority: 0.5,
2395
- task_count: solution.tasks?.length || 0,
2396
- files_touched: Array.from(filesTouched)
2397
- });
2398
-
2399
- // Step 2: Write temporary queue file
2400
- writeQueue(newQueue);
2401
- updateIssue(issueId, { status: 'queued', queued_at: new Date().toISOString() });
2402
-
2403
- console.log(chalk.green(`✓ Created temporary queue ${newQueue.id}`));
2404
- console.log(chalk.gray(` Solution ${solution.id} (${solution.tasks?.length || 0} tasks)`));
2405
-
2406
- // Step 3: Check for existing active queue
2407
- const existingQueue = readQueue();
2408
- const hasActiveQueue = existingQueue && existingQueue.status === 'active' &&
2409
- (existingQueue.solutions?.length || existingQueue.tasks?.length || 0) > 0;
2410
-
2411
- if (!hasActiveQueue || options.force) {
2412
- // No active queue or force flag - set new queue as active
2413
- const index = readQueueIndex();
2414
- index.active_queue_id = newQueue.id;
2415
- writeQueueIndex(index);
2416
- console.log(chalk.green(`✓ Queue ${newQueue.id} activated`));
2417
- return;
2418
- }
2419
-
2420
- // Step 4: Active queue exists - prompt user
2421
- const existingItems = existingQueue!.solutions || existingQueue!.tasks || [];
2422
- console.log();
2423
- console.log(chalk.cyan(`Active queue exists: ${existingQueue!.id}`));
2424
- console.log(chalk.gray(` Issues: ${existingQueue!.issue_ids.join(', ')}`));
2425
- console.log(chalk.gray(` Items: ${existingItems.length} (${existingItems.filter(i => i.status === 'completed').length} completed)`));
2426
- console.log();
2427
-
2428
- const { action } = await inquirer.prompt([{
2429
- type: 'list',
2430
- name: 'action',
2431
- message: 'How would you like to proceed?',
2432
- choices: [
2433
- { name: 'Merge into existing queue', value: 'merge_to_existing' },
2434
- { name: 'Use new queue', value: 'use_new' },
2435
- { name: 'Cancel', value: 'cancel' }
2436
- ]
2437
- }]);
2438
-
2439
- // Step 5: Execute user choice
2440
- if (action === 'cancel') {
2441
- // Delete temporary queue
2442
- const queuePath = join(getQueuesDir(), `${newQueue.id}.json`);
2443
- unlinkSync(queuePath);
2444
- console.log(chalk.yellow(`✓ New queue deleted, keeping ${existingQueue!.id} active`));
2445
- return;
2446
- }
2447
-
2448
- if (action === 'use_new') {
2449
- // Switch to new queue
2450
- const index = readQueueIndex();
2451
- index.active_queue_id = newQueue.id;
2452
- writeQueueIndex(index);
2453
- console.log(chalk.green(`✓ Switched to new queue ${newQueue.id}`));
2454
- console.log(chalk.gray(` Previous queue ${existingQueue!.id} remains in history`));
2455
- return;
2456
- }
2457
-
2458
- if (action === 'merge_to_existing') {
2459
- // Merge new → existing, delete temporary queue
2460
- const mergeResult = mergeQueues(existingQueue!, newQueue, { deleteSource: true });
2461
- console.log(chalk.green(`✓ Merged ${mergeResult.itemsMerged} items into ${existingQueue!.id}`));
2462
- if (mergeResult.skippedDuplicates > 0) {
2463
- console.log(chalk.gray(` Skipped ${mergeResult.skippedDuplicates} duplicate items`));
2464
- }
2465
- console.log(chalk.gray(` Temporary queue ${newQueue.id} deleted`));
2466
- return;
2467
- }
2468
-
2469
- return;
2470
- }
2471
-
2472
- // Show current queue - use readQueue() to detect if queue actually exists
2473
- const queue = readQueue();
2474
-
2475
- // Handle no active queue case for all output modes
2476
- if (!queue) {
2477
- if (options.brief || options.json) {
2478
- console.log(JSON.stringify({
2479
- status: 'empty',
2480
- message: 'No active queue',
2481
- id: null,
2482
- issue_ids: [],
2483
- total: 0,
2484
- items: []
2485
- }, null, 2));
2486
- return;
2487
- }
2488
- // Human-readable output handled below
2489
- }
2490
-
2491
- // Brief mode: minimal queue info (id, issue_ids, item summaries)
2492
- if (options.brief) {
2493
- const items = queue!.solutions || queue!.tasks || [];
2494
- const briefQueue = {
2495
- id: queue!.id,
2496
- issue_ids: queue!.issue_ids || [],
2497
- total: items.length,
2498
- pending: items.filter(i => i.status === 'pending').length,
2499
- executing: items.filter(i => i.status === 'executing').length,
2500
- completed: items.filter(i => i.status === 'completed').length,
2501
- items: items.map(i => ({
2502
- item_id: i.item_id,
2503
- issue_id: i.issue_id,
2504
- solution_id: i.solution_id,
2505
- status: i.status,
2506
- task_count: i.task_count
2507
- }))
2508
- };
2509
- console.log(JSON.stringify(briefQueue, null, 2));
2510
- return;
2511
- }
2512
-
2513
- if (options.json) {
2514
- console.log(JSON.stringify(queue, null, 2));
2515
- return;
2516
- }
2517
-
2518
- console.log(chalk.bold.cyan('\nActive Queue\n'));
2519
-
2520
- // Handle no queue case (human-readable)
2521
- if (!queue) {
2522
- console.log(chalk.yellow('No active queue'));
2523
- console.log(chalk.gray('Create one: ccw issue queue add <issue-id>'));
2524
- console.log(chalk.gray('Or list history: ccw issue queue list'));
2525
- return;
2526
- }
2527
-
2528
- // Support both solution-level and task-level queues
2529
- const items = queue.solutions || queue.tasks || [];
2530
- const isSolutionLevel = !!(queue.solutions && queue.solutions.length > 0);
2531
-
2532
- if (items.length === 0) {
2533
- console.log(chalk.yellow(`Queue ${queue.id} is empty`));
2534
- console.log(chalk.gray('Add issues: ccw issue queue add <issue-id>'));
2535
- return;
2536
- }
2537
-
2538
- console.log(chalk.gray(`Queue: ${queue.id}`));
2539
- console.log(chalk.gray(`Issues: ${queue.issue_ids.join(', ')}`));
2540
- console.log(chalk.gray(`Total: ${items.length} | Pending: ${items.filter(i => i.status === 'pending').length} | Executing: ${items.filter(i => i.status === 'executing').length} | Completed: ${items.filter(i => i.status === 'completed').length}`));
2541
- console.log();
2542
-
2543
- if (isSolutionLevel) {
2544
- console.log(chalk.gray('ItemID'.padEnd(10) + 'Issue'.padEnd(15) + 'Tasks'.padEnd(8) + 'Status'));
2545
- } else {
2546
- console.log(chalk.gray('ItemID'.padEnd(10) + 'Issue'.padEnd(15) + 'Task'.padEnd(8) + 'Status'));
2547
- }
2548
- console.log(chalk.gray('-'.repeat(48)));
2549
-
2550
- for (const item of items) {
2551
- const statusColor = {
2552
- 'pending': chalk.gray,
2553
- 'ready': chalk.cyan,
2554
- 'executing': chalk.yellow,
2555
- 'completed': chalk.green,
2556
- 'failed': chalk.red,
2557
- 'blocked': chalk.magenta
2558
- }[item.status] || chalk.white;
2559
-
2560
- const thirdCol = isSolutionLevel
2561
- ? String(item.task_count || 0).padEnd(8)
2562
- : (item.task_id || '-').padEnd(8);
2563
-
2564
- let line = item.item_id.padEnd(10) +
2565
- item.issue_id.substring(0, 13).padEnd(15) +
2566
- thirdCol +
2567
- statusColor(item.status);
2568
-
2569
- // Show failure reason for failed items
2570
- if (item.status === 'failed') {
2571
- const reason = item.failure_details?.message || item.failure_reason;
2572
- if (reason) {
2573
- // Truncate to 40 chars for display
2574
- const shortReason = reason.length > 40 ? reason.substring(0, 37) + '...' : reason;
2575
- line += chalk.gray(` [${shortReason}]`);
2576
- }
2577
- // Show retry count if there's failure history
2578
- if (item.failure_history && item.failure_history.length > 0) {
2579
- line += chalk.gray(` (${item.failure_history.length} retry)`);
2580
- }
2581
- }
2582
-
2583
- console.log(line);
2584
- }
2585
- }
2586
-
2587
- /**
2588
- * next - Get next ready task for execution (JSON output)
2589
- * Accepts optional item_id to fetch a specific task directly
2590
- */
2591
- async function nextAction(itemId: string | undefined, options: IssueOptions): Promise<void> {
2592
- let queue: Queue;
2593
- let items: QueueItem[];
2594
-
2595
- // Determine which queue(s) to use
2596
- if (options.queue) {
2597
- // Explicit queue specified
2598
- const targetQueue = readQueue(options.queue);
2599
- if (!targetQueue) {
2600
- console.log(JSON.stringify({ status: 'error', message: `Queue ${options.queue} not found` }));
2601
- return;
2602
- }
2603
- queue = targetQueue;
2604
- items = queue.solutions || queue.tasks || [];
2605
- } else {
2606
- // Multi-queue: iterate active queues in priority order (serialized execution)
2607
- const activeQueues = getActiveQueues();
2608
-
2609
- if (activeQueues.length === 0) {
2610
- console.log(JSON.stringify({ status: 'empty', message: 'No active queues' }));
2611
- return;
2612
- }
2613
-
2614
- // Find first queue with incomplete items (serialized: complete Q1 before Q2)
2615
- let foundQueue: Queue | null = null;
2616
- for (const q of activeQueues) {
2617
- const queueItems = q.solutions || q.tasks || [];
2618
- const hasIncomplete = queueItems.some(i =>
2619
- i.status === 'pending' || i.status === 'executing'
2620
- );
2621
- if (hasIncomplete) {
2622
- foundQueue = q;
2623
- break;
2624
- }
2625
- }
2626
-
2627
- if (!foundQueue) {
2628
- console.log(JSON.stringify({ status: 'empty', message: 'All queues completed' }));
2629
- return;
2630
- }
2631
-
2632
- queue = foundQueue;
2633
- items = queue.solutions || queue.tasks || [];
2634
- }
2635
-
2636
- let nextItem: QueueItem | undefined;
2637
- let isResume = false;
2638
-
2639
- // If specific item_id provided, fetch that item directly
2640
- if (itemId) {
2641
- nextItem = items.find(t => t.item_id === itemId);
2642
- if (!nextItem) {
2643
- console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found in queue ${queue.id}` }));
2644
- return;
2645
- }
2646
- if (nextItem.status === 'completed') {
2647
- console.log(JSON.stringify({ status: 'completed', message: `Item ${itemId} already completed` }));
2648
- return;
2649
- }
2650
- if (nextItem.status === 'failed') {
2651
- console.log(JSON.stringify({ status: 'failed', message: `Item ${itemId} failed, use retry to reset` }));
2652
- return;
2653
- }
2654
- isResume = nextItem.status === 'executing';
2655
- } else {
2656
- // Auto-select: Priority 1 - executing, Priority 2 - ready pending
2657
- const executingItems = items.filter(item => item.status === 'executing');
2658
- const pendingItems = items.filter(item => {
2659
- if (item.status !== 'pending') return false;
2660
- return (item.depends_on || []).every(depId => {
2661
- const dep = items.find(q => q.item_id === depId);
2662
- return !dep || dep.status === 'completed';
2663
- });
2664
- });
2665
-
2666
- const readyItems = [...executingItems, ...pendingItems];
2667
-
2668
- if (readyItems.length === 0) {
2669
- console.log(JSON.stringify({
2670
- status: 'empty',
2671
- message: 'No ready items',
2672
- queue_id: queue.id,
2673
- queue_status: queue._metadata
2674
- }, null, 2));
2675
- return;
2676
- }
2677
-
2678
- readyItems.sort((a, b) => a.execution_order - b.execution_order);
2679
- nextItem = readyItems[0];
2680
- isResume = nextItem.status === 'executing';
2681
- }
2682
-
2683
- // Load FULL solution with all tasks
2684
- const solution = findSolution(nextItem.issue_id, nextItem.solution_id);
2685
-
2686
- if (!solution) {
2687
- console.log(JSON.stringify({ status: 'error', message: 'Solution not found' }));
2688
- process.exit(1);
2689
- }
2690
-
2691
- // Only update status if not already executing
2692
- if (!isResume) {
2693
- const idx = items.findIndex(q => q.item_id === nextItem.item_id);
2694
- items[idx].status = 'executing';
2695
- items[idx].started_at = new Date().toISOString();
2696
- // Write back to correct array
2697
- if (queue.solutions) {
2698
- queue.solutions = items;
2699
- } else {
2700
- queue.tasks = items;
2701
- }
2702
- writeQueue(queue);
2703
- updateIssue(nextItem.issue_id, { status: 'executing' });
2704
- }
2705
-
2706
- // Calculate queue stats
2707
- const stats = {
2708
- total: items.length,
2709
- completed: items.filter(q => q.status === 'completed').length,
2710
- failed: items.filter(q => q.status === 'failed').length,
2711
- executing: items.filter(q => q.status === 'executing').length,
2712
- pending: items.filter(q => q.status === 'pending').length
2713
- };
2714
- const remaining = stats.pending + stats.executing;
2715
-
2716
- // Calculate total estimated time for all tasks
2717
- const totalMinutes = solution.tasks?.reduce((sum, t) => sum + (t.estimated_minutes || 30), 0) || 30;
2718
-
2719
- console.log(JSON.stringify({
2720
- queue_id: queue.id,
2721
- item_id: nextItem.item_id,
2722
- issue_id: nextItem.issue_id,
2723
- solution_id: nextItem.solution_id,
2724
- // Return full solution object with all tasks
2725
- solution: {
2726
- id: solution.id,
2727
- approach: solution.approach,
2728
- tasks: solution.tasks || [],
2729
- exploration_context: solution.exploration_context || {}
2730
- },
2731
- resumed: isResume,
2732
- resume_note: isResume ? `Resuming interrupted item (started: ${nextItem.started_at})` : undefined,
2733
- execution_hints: {
2734
- task_count: solution.tasks?.length || 0,
2735
- estimated_minutes: totalMinutes
2736
- },
2737
- queue_progress: {
2738
- completed: stats.completed,
2739
- remaining: remaining,
2740
- total: stats.total,
2741
- progress: `${stats.completed}/${stats.total}`
2742
- }
2743
- }, null, 2));
2744
- }
2745
-
2746
- /**
2747
- * detail - Get task details by item_id (READ-ONLY, does NOT change status)
2748
- * Used for parallel execution: orchestrator gets dag, then dispatches with detail <id>
2749
- */
2750
- async function detailAction(itemId: string | undefined, options: IssueOptions): Promise<void> {
2751
- if (!itemId) {
2752
- console.log(JSON.stringify({ status: 'error', message: 'item_id is required' }));
2753
- return;
2754
- }
2755
-
2756
- let queue: Queue;
2757
- let queueItem: QueueItem | undefined;
2758
-
2759
- // Use explicit queue if provided, otherwise auto-detect
2760
- if (options.queue) {
2761
- const targetQueue = readQueue(options.queue);
2762
- if (!targetQueue) {
2763
- console.log(JSON.stringify({ status: 'error', message: `Queue ${options.queue} not found` }));
2764
- return;
2765
- }
2766
- queue = targetQueue;
2767
- const items = queue.solutions || queue.tasks || [];
2768
- queueItem = items.find(t => t.item_id === itemId);
2769
- } else {
2770
- // Auto-detect queue from item ID
2771
- const found = findItemQueue(itemId);
2772
- if (found) {
2773
- queue = found.queue;
2774
- queueItem = found.item;
2775
- } else {
2776
- console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found in any queue` }));
2777
- return;
2778
- }
2779
- }
2780
-
2781
- if (!queueItem) {
2782
- console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found` }));
2783
- return;
2784
- }
2785
-
2786
- // Load FULL solution with all tasks
2787
- const solution = findSolution(queueItem.issue_id, queueItem.solution_id);
2788
-
2789
- if (!solution) {
2790
- console.log(JSON.stringify({ status: 'error', message: 'Solution not found' }));
2791
- return;
2792
- }
2793
-
2794
- // Calculate total estimated time for all tasks
2795
- const totalMinutes = solution.tasks?.reduce((sum, t) => sum + (t.estimated_minutes || 30), 0) || 30;
2796
-
2797
- // Return FULL SOLUTION with all tasks (READ-ONLY - no status update)
2798
- console.log(JSON.stringify({
2799
- queue_id: queue.id,
2800
- item_id: queueItem.item_id,
2801
- issue_id: queueItem.issue_id,
2802
- solution_id: queueItem.solution_id,
2803
- status: queueItem.status,
2804
- // Return full solution object with all tasks
2805
- solution: {
2806
- id: solution.id,
2807
- approach: solution.approach,
2808
- tasks: solution.tasks || [],
2809
- exploration_context: solution.exploration_context || {}
2810
- },
2811
- execution_hints: {
2812
- task_count: solution.tasks?.length || 0,
2813
- estimated_minutes: totalMinutes
2814
- }
2815
- }, null, 2));
2816
- }
2817
-
2818
- /**
2819
- * done - Mark task completed or failed
2820
- */
2821
- async function doneAction(queueItemId: string | undefined, options: IssueOptions): Promise<void> {
2822
- if (!queueItemId) {
2823
- console.error(chalk.red('Item ID is required'));
2824
- console.error(chalk.gray('Usage: ccw issue done <item-id> [--fail] [--reason "..."] [--queue <queue-id>]'));
2825
- process.exit(1);
2826
- }
2827
-
2828
- let queue: Queue;
2829
- let items: QueueItem[];
2830
- let idx: number;
2831
-
2832
- // Use explicit queue if provided, otherwise auto-detect
2833
- if (options.queue) {
2834
- const targetQueue = readQueue(options.queue);
2835
- if (!targetQueue) {
2836
- console.error(chalk.red(`Queue "${options.queue}" not found`));
2837
- process.exit(1);
2838
- }
2839
- queue = targetQueue;
2840
- items = queue.solutions || queue.tasks || [];
2841
- idx = items.findIndex(q => q.item_id === queueItemId);
2842
- if (idx === -1) {
2843
- console.error(chalk.red(`Queue item "${queueItemId}" not found in queue ${options.queue}`));
2844
- process.exit(1);
2845
- }
2846
- } else {
2847
- // Auto-detect queue from item ID
2848
- const found = findItemQueue(queueItemId);
2849
- if (!found) {
2850
- console.error(chalk.red(`Queue item "${queueItemId}" not found in any queue`));
2851
- process.exit(1);
2852
- }
2853
- queue = found.queue;
2854
- items = queue.solutions || queue.tasks || [];
2855
- idx = found.itemIndex;
2856
- }
2857
-
2858
- const isFail = options.fail;
2859
- items[idx].status = isFail ? 'failed' : 'completed';
2860
- items[idx].completed_at = new Date().toISOString();
2861
-
2862
- if (isFail) {
2863
- const reason = options.reason || 'Unknown failure';
2864
- items[idx].failure_reason = reason; // Backward compat
2865
- items[idx].failure_details = parseFailureReason(reason); // Structured failure
2866
- } else if (options.result) {
2867
- try {
2868
- items[idx].result = JSON.parse(options.result);
2869
- } catch {
2870
- console.warn(chalk.yellow('Warning: Could not parse result JSON'));
2871
- }
2872
- }
2873
-
2874
- // Update issue status (solution = issue in new model)
2875
- const issueId = items[idx].issue_id;
2876
-
2877
- if (isFail) {
2878
- updateIssue(issueId, { status: 'failed' });
2879
- console.log(chalk.red(`✗ ${queueItemId} failed`));
2880
- } else {
2881
- updateIssue(issueId, { status: 'completed', completed_at: new Date().toISOString() });
2882
- console.log(chalk.green(`✓ ${queueItemId} completed`));
2883
- console.log(chalk.green(`✓ Issue ${issueId} completed`));
2884
- }
2885
-
2886
- // Check if entire queue is complete
2887
- const allQueueComplete = items.every(q => q.status === 'completed');
2888
- const anyQueueFailed = items.some(q => q.status === 'failed');
2889
-
2890
- if (allQueueComplete) {
2891
- queue.status = 'completed';
2892
- console.log(chalk.green(`\n✓ Queue ${queue.id} completed (all solutions done)`));
2893
- } else if (anyQueueFailed && items.every(q => q.status === 'completed' || q.status === 'failed')) {
2894
- queue.status = 'failed';
2895
- console.log(chalk.yellow(`\n⚠ Queue ${queue.id} has failed solutions`));
2896
- }
2897
-
2898
- // Write back to queue (update the correct array)
2899
- if (queue.solutions) {
2900
- queue.solutions = items;
2901
- } else {
2902
- queue.tasks = items;
2903
- }
2904
- writeQueue(queue);
2905
- }
2906
-
2907
- /**
2908
- * retry - Reset failed items to pending for re-execution
2909
- * Syncs failure details to Issue.feedback for planning phase
2910
- */
2911
- async function retryAction(issueId: string | undefined, options: IssueOptions): Promise<void> {
2912
- let queues: Queue[];
2913
-
2914
- // Use explicit queue if provided, otherwise use all active queues
2915
- if (options.queue) {
2916
- const targetQueue = readQueue(options.queue);
2917
- if (!targetQueue) {
2918
- console.log(chalk.red(`Queue "${options.queue}" not found`));
2919
- return;
2920
- }
2921
- queues = [targetQueue];
2922
- } else {
2923
- queues = getActiveQueues();
2924
- }
2925
-
2926
- if (queues.length === 0) {
2927
- console.log(chalk.yellow('No active queues'));
2928
- return;
2929
- }
2930
-
2931
- let totalUpdated = 0;
2932
- const updatedIssues = new Set<string>();
2933
-
2934
- for (const queue of queues) {
2935
- const items = queue.solutions || queue.tasks || [];
2936
- let queueUpdated = 0;
2937
-
2938
- for (const item of items) {
2939
- // Retry failed items only
2940
- if (item.status === 'failed') {
2941
- if (!issueId || item.issue_id === issueId) {
2942
- // Sync failure details to Issue.feedback (persistent for planning phase)
2943
- if (item.failure_details && item.issue_id) {
2944
- const issue = findIssue(item.issue_id);
2945
- if (issue) {
2946
- if (!issue.feedback) {
2947
- issue.feedback = [];
2948
- }
2949
-
2950
- // Add failure to feedback history
2951
- issue.feedback.push({
2952
- type: 'failure',
2953
- stage: 'execute',
2954
- content: JSON.stringify({
2955
- solution_id: item.solution_id,
2956
- task_id: item.failure_details.task_id,
2957
- error_type: item.failure_details.error_type,
2958
- message: item.failure_details.message,
2959
- stack_trace: item.failure_details.stack_trace,
2960
- queue_id: queue.id,
2961
- item_id: item.item_id
2962
- }),
2963
- created_at: item.failure_details.timestamp
2964
- });
2965
-
2966
- // Reset issue status to 'queued' for re-execution
2967
- // Failure details preserved in feedback for debugging
2968
- updateIssue(item.issue_id, {
2969
- status: 'queued',
2970
- updated_at: new Date().toISOString()
2971
- });
2972
-
2973
- updatedIssues.add(item.issue_id);
2974
- }
2975
- }
2976
-
2977
- // Preserve failure history before resetting
2978
- if (item.failure_details) {
2979
- if (!item.failure_history) {
2980
- item.failure_history = [];
2981
- }
2982
- item.failure_history.push(item.failure_details);
2983
- }
2984
-
2985
- // Reset QueueItem for retry (Issue status also reset to 'queued')
2986
- item.status = 'pending';
2987
- item.failure_reason = undefined;
2988
- item.failure_details = undefined;
2989
- item.started_at = undefined;
2990
- item.completed_at = undefined;
2991
- queueUpdated++;
2992
- }
2993
- }
2994
- }
2995
-
2996
- if (queueUpdated > 0) {
2997
- // Reset queue status if it was failed
2998
- if (queue.status === 'failed') {
2999
- queue.status = 'active';
3000
- }
3001
-
3002
- // Write back to queue
3003
- if (queue.solutions) {
3004
- queue.solutions = items;
3005
- } else {
3006
- queue.tasks = items;
3007
- }
3008
- writeQueue(queue);
3009
- totalUpdated += queueUpdated;
3010
- }
3011
- }
3012
-
3013
- if (totalUpdated === 0) {
3014
- console.log(chalk.yellow('No failed items to retry'));
3015
- return;
3016
- }
3017
-
3018
- console.log(chalk.green(`✓ Reset ${totalUpdated} item(s) to pending (failure history preserved)`));
3019
- if (updatedIssues.size > 0) {
3020
- console.log(chalk.cyan(`✓ Synced failure details to ${updatedIssues.size} issue(s) for planning phase`));
3021
- }
3022
- }
3023
-
3024
- // ============ Main Entry ============
3025
-
3026
- export async function issueCommand(
3027
- subcommand: string,
3028
- args: string | string[],
3029
- options: IssueOptions
3030
- ): Promise<void> {
3031
- const argsArray = Array.isArray(args) ? args : (args ? [args] : []);
3032
-
3033
- switch (subcommand) {
3034
- case 'create':
3035
- await createAction(options);
3036
- break;
3037
- case 'pull':
3038
- await pullAction(options);
3039
- break;
3040
- case 'solution':
3041
- await solutionAction(argsArray[0], options);
3042
- break;
3043
- case 'solutions':
3044
- await solutionsAction(options);
3045
- break;
3046
- case 'init':
3047
- await initAction(argsArray[0], options);
3048
- break;
3049
- case 'list':
3050
- await listAction(argsArray[0], options);
3051
- break;
3052
- case 'history':
3053
- await historyAction(options);
3054
- break;
3055
- case 'status':
3056
- await statusAction(argsArray[0], options);
3057
- break;
3058
- case 'task':
3059
- await taskAction(argsArray[0], argsArray[1], options);
3060
- break;
3061
- case 'bind':
3062
- await bindAction(argsArray[0], argsArray[1], options);
3063
- break;
3064
- case 'update':
3065
- await updateAction(argsArray[0], options);
3066
- break;
3067
- case 'queue':
3068
- await queueAction(argsArray[0], argsArray[1], options);
3069
- break;
3070
- case 'next':
3071
- await nextAction(argsArray[0], options);
3072
- break;
3073
- case 'detail':
3074
- await detailAction(argsArray[0], options);
3075
- break;
3076
- case 'done':
3077
- await doneAction(argsArray[0], options);
3078
- break;
3079
- case 'retry':
3080
- await retryAction(argsArray[0], options);
3081
- break;
3082
- // Legacy aliases
3083
- case 'register':
3084
- console.log(chalk.yellow('Deprecated: use "ccw issue bind <issue-id> --solution <path>"'));
3085
- await bindAction(argsArray[0], undefined, options);
3086
- break;
3087
- case 'complete':
3088
- await doneAction(argsArray[0], options);
3089
- break;
3090
- case 'fail':
3091
- await doneAction(argsArray[0], { ...options, fail: true });
3092
- break;
3093
- default:
3094
- console.log(chalk.bold.cyan('\nCCW Issue Management (v3.0 - Multi-Queue + Lifecycle)\n'));
3095
- console.log(chalk.bold('Core Commands:'));
3096
- console.log(chalk.gray(' create --data \'{"title":"..."}\' Create issue (auto-generates ID)'));
3097
- console.log(chalk.gray(' pull [--state open|closed|all] Pull issues from GitHub'));
3098
- console.log(chalk.gray(' [--limit N] [--labels label1,label2]'));
3099
- console.log(chalk.gray(' init <issue-id> Initialize new issue (manual ID)'));
3100
- console.log(chalk.gray(' list [issue-id] List issues or tasks'));
3101
- console.log(chalk.gray(' history List completed issues (from history)'));
3102
- console.log(chalk.gray(' status [issue-id] Show detailed status'));
3103
- console.log(chalk.gray(' solution <id> List solutions for issue'));
3104
- console.log(chalk.gray(' solution <id> --brief Brief: solution_id, files_touched, task_count'));
3105
- console.log(chalk.gray(' solution <id> --data \'{...}\' Create solution (auto-generates ID)'));
3106
- console.log(chalk.gray(' bind <issue-id> [sol-id] Bind solution'));
3107
- console.log(chalk.gray(' update <issue-id> --status <s> Update issue status'));
3108
- console.log(chalk.gray(' update --from-queue [queue-id] Sync statuses from queue (default: active)'));
3109
- console.log();
3110
- console.log(chalk.bold('Queue Commands:'));
3111
- console.log(chalk.gray(' queue Show active queue'));
3112
- console.log(chalk.gray(' queue list List all queues (history)'));
3113
- console.log(chalk.gray(' queue add <issue-id> Add issue to active queue (or create new)'));
3114
- console.log(chalk.gray(' queue switch <queue-id> Switch active queue'));
3115
- console.log(chalk.gray(' queue activate <q1,q2,...> Activate multiple queues (comma-separated)'));
3116
- console.log(chalk.gray(' queue priority <queue-id> Set queue priority (--priority N, lower=higher)'));
3117
- console.log(chalk.gray(' queue dag [--queue <id>] Get dependency graph (JSON) for parallel execution'));
3118
- console.log(chalk.gray(' queue archive Archive current queue'));
3119
- console.log(chalk.gray(' queue delete <queue-id> Delete queue from history'));
3120
- console.log(chalk.gray(' retry [issue-id] [--queue <id>] Retry failed tasks'));
3121
- console.log();
3122
- console.log(chalk.bold('Execution Endpoints:'));
3123
- console.log(chalk.gray(' next [item-id] [--queue <id>] Get & mark task executing (JSON)'));
3124
- console.log(chalk.gray(' detail <item-id> [--queue <id>] Get task details (READ-ONLY, for parallel)'));
3125
- console.log(chalk.gray(' done <item-id> [--queue <id>] Mark task completed'));
3126
- console.log(chalk.gray(' done <item-id> --fail --reason "." Mark task failed with reason (supports JSON)'));
3127
- console.log();
3128
- console.log(chalk.bold('Options:'));
3129
- console.log(chalk.gray(' --title <title> Issue/task title'));
3130
- console.log(chalk.gray(' --status <status> Filter by status (comma-separated)'));
3131
- console.log(chalk.gray(' --brief Brief JSON output (minimal fields)'));
3132
- console.log(chalk.gray(' --solution <path> Solution JSON file'));
3133
- console.log(chalk.gray(' --result <json> Execution result'));
3134
- console.log(chalk.gray(' --reason <text> Failure reason (string or JSON)'));
3135
- console.log(chalk.gray(' --queue <queue-id> Target queue for multi-queue operations'));
3136
- console.log(chalk.gray(' --priority <n> Queue priority (lower = higher)'));
3137
- console.log(chalk.gray(' --json JSON output'));
3138
- console.log(chalk.gray(' --force Force operation'));
3139
- console.log(chalk.gray(' --state <state> GitHub issue state (open/closed/all)'));
3140
- console.log(chalk.gray(' --limit <n> Max issues to pull from GitHub'));
3141
- console.log(chalk.gray(' --labels <labels> Filter by GitHub labels (comma-separated)'));
3142
- console.log();
3143
- console.log(chalk.bold('Storage:'));
3144
- console.log(chalk.gray(' .workflow/issues/issues.jsonl Active issues'));
3145
- console.log(chalk.gray(' .workflow/issues/issue-history.jsonl Completed issues'));
3146
- console.log(chalk.gray(' .workflow/issues/solutions/*.jsonl Solutions per issue'));
3147
- console.log(chalk.gray(' .workflow/issues/queues/ Queue files (multi-queue)'));
3148
- console.log(chalk.gray(' .workflow/issues/queues/index.json Queue index'));
3149
- }
3150
- }