claude-code-workflow 6.3.18 → 6.3.19

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 (822) hide show
  1. package/.claude/CLAUDE.md +8 -5
  2. package/.claude/agents/action-planning-agent.md +26 -2
  3. package/.claude/agents/code-developer.md +132 -43
  4. package/.claude/agents/debug-explore-agent.md +434 -0
  5. package/.claude/agents/test-fix-agent.md +14 -0
  6. package/.claude/commands/issue/discover.md +41 -0
  7. package/.claude/commands/issue/execute.md +200 -19
  8. package/.claude/commands/issue/new.md +1 -1
  9. package/.claude/commands/issue/plan.md +6 -1
  10. package/.claude/commands/issue/queue.md +94 -39
  11. package/.claude/commands/memory/swagger-docs.md +773 -0
  12. package/.claude/commands/workflow/brainstorm/auto-parallel.md +21 -21
  13. package/.claude/commands/workflow/execute.md +54 -34
  14. package/.claude/commands/workflow/lite-execute.md +48 -164
  15. package/.claude/commands/workflow/lite-fix.md +4 -4
  16. package/.claude/commands/workflow/lite-plan.md +5 -5
  17. package/.claude/commands/workflow/plan.md +27 -27
  18. package/.claude/commands/workflow/review.md +42 -17
  19. package/.claude/commands/workflow/tdd-plan.md +25 -25
  20. package/.claude/commands/workflow/test-fix-gen.md +10 -10
  21. package/.claude/commands/workflow/test-gen.md +14 -14
  22. package/.claude/commands/workflow/ui-design/explore-auto.md +21 -21
  23. package/.claude/commands/workflow/ui-design/imitate-auto.md +24 -24
  24. package/.claude/skills/_shared/SKILL-DESIGN-SPEC.md +693 -0
  25. package/.claude/skills/ccw/SKILL.md +462 -0
  26. package/.claude/skills/ccw/index/command-capabilities.json +127 -0
  27. package/.claude/skills/ccw/index/intent-rules.json +136 -0
  28. package/.claude/skills/ccw/index/workflow-chains.json +451 -0
  29. package/.claude/skills/ccw/phases/actions/bugfix.md +218 -0
  30. package/.claude/skills/ccw/phases/actions/coupled.md +194 -0
  31. package/.claude/skills/ccw/phases/actions/docs.md +93 -0
  32. package/.claude/skills/ccw/phases/actions/full.md +154 -0
  33. package/.claude/skills/ccw/phases/actions/issue.md +201 -0
  34. package/.claude/skills/ccw/phases/actions/rapid.md +104 -0
  35. package/.claude/skills/ccw/phases/actions/review-fix.md +84 -0
  36. package/.claude/skills/ccw/phases/actions/tdd.md +66 -0
  37. package/.claude/skills/ccw/phases/actions/ui.md +79 -0
  38. package/.claude/skills/ccw/phases/orchestrator.md +435 -0
  39. package/.claude/skills/ccw/specs/intent-classification.md +336 -0
  40. package/.claude/skills/ccw-help/SKILL.md +177 -0
  41. package/.claude/skills/ccw-help/index/all-agents.json +82 -0
  42. package/.claude/skills/{command-guide → ccw-help}/index/all-commands.json +183 -73
  43. package/.claude/skills/{command-guide → ccw-help}/index/by-category.json +187 -73
  44. package/.claude/skills/{command-guide → ccw-help}/index/by-use-case.json +295 -185
  45. package/.claude/skills/{command-guide → ccw-help}/index/command-relationships.json +19 -166
  46. package/.claude/skills/{command-guide → ccw-help}/index/essential-commands.json +10 -10
  47. package/.claude/skills/ccw-help/scripts/analyze_commands.py +337 -0
  48. package/.claude/skills/code-reviewer/README.md +340 -0
  49. package/.claude/skills/code-reviewer/SKILL.md +308 -0
  50. package/.claude/skills/code-reviewer/phases/01-code-discovery.md +246 -0
  51. package/.claude/skills/code-reviewer/phases/02-security-analysis.md +442 -0
  52. package/.claude/skills/code-reviewer/phases/03-best-practices-review.md +36 -0
  53. package/.claude/skills/code-reviewer/phases/04-report-generation.md +278 -0
  54. package/.claude/skills/code-reviewer/specs/best-practices-requirements.md +346 -0
  55. package/.claude/skills/code-reviewer/specs/quality-standards.md +252 -0
  56. package/.claude/skills/code-reviewer/specs/security-requirements.md +243 -0
  57. package/.claude/skills/code-reviewer/templates/best-practice-finding.md +234 -0
  58. package/.claude/skills/code-reviewer/templates/report-template.md +316 -0
  59. package/.claude/skills/code-reviewer/templates/security-finding.md +161 -0
  60. package/.claude/skills/skill-generator/SKILL.md +187 -0
  61. package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +239 -0
  62. package/.claude/skills/skill-generator/phases/02-structure-generation.md +207 -0
  63. package/.claude/skills/skill-generator/phases/03-phase-generation.md +802 -0
  64. package/.claude/skills/skill-generator/phases/04-specs-templates.md +328 -0
  65. package/.claude/skills/skill-generator/phases/05-validation.md +334 -0
  66. package/.claude/skills/skill-generator/specs/cli-integration.md +448 -0
  67. package/.claude/skills/skill-generator/specs/execution-modes.md +396 -0
  68. package/.claude/skills/skill-generator/specs/scripting-integration.md +265 -0
  69. package/.claude/skills/skill-generator/specs/skill-requirements.md +466 -0
  70. package/.claude/skills/skill-generator/templates/autonomous-action.md +517 -0
  71. package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +276 -0
  72. package/.claude/skills/skill-generator/templates/code-analysis-action.md +503 -0
  73. package/.claude/skills/skill-generator/templates/llm-action.md +355 -0
  74. package/.claude/skills/skill-generator/templates/script-bash.md +277 -0
  75. package/.claude/skills/skill-generator/templates/script-python.md +198 -0
  76. package/.claude/skills/skill-generator/templates/sequential-phase.md +441 -0
  77. package/.claude/skills/skill-generator/templates/skill-md.md +156 -0
  78. package/.claude/workflows/chinese-response.md +15 -28
  79. package/.claude/workflows/cli-templates/prompts/documentation/swagger-api.txt +266 -0
  80. package/.claude/workflows/cli-tools-usage.md +221 -177
  81. package/.claude/workflows/windows-platform.md +13 -10
  82. package/.codex/prompts/issue-execute.md +305 -82
  83. package/.codex/prompts/issue-queue.md +22 -0
  84. package/.codex/prompts/lite-execute.md +36 -11
  85. package/README.md +309 -305
  86. package/ccw/README.md +10 -4
  87. package/ccw/dist/cli.d.ts.map +1 -1
  88. package/ccw/dist/cli.js +4 -1
  89. package/ccw/dist/cli.js.map +1 -1
  90. package/ccw/dist/commands/cli.d.ts.map +1 -1
  91. package/ccw/dist/commands/cli.js +131 -34
  92. package/ccw/dist/commands/cli.js.map +1 -1
  93. package/ccw/dist/commands/issue.d.ts +152 -0
  94. package/ccw/dist/commands/issue.d.ts.map +1 -1
  95. package/ccw/dist/commands/issue.js +550 -85
  96. package/ccw/dist/commands/issue.js.map +1 -1
  97. package/ccw/dist/commands/serve.d.ts +1 -0
  98. package/ccw/dist/commands/serve.d.ts.map +1 -1
  99. package/ccw/dist/commands/serve.js +12 -5
  100. package/ccw/dist/commands/serve.js.map +1 -1
  101. package/ccw/dist/commands/stop.d.ts.map +1 -1
  102. package/ccw/dist/commands/stop.js +29 -5
  103. package/ccw/dist/commands/stop.js.map +1 -1
  104. package/ccw/dist/commands/tool.d.ts.map +1 -1
  105. package/ccw/dist/commands/tool.js +19 -2
  106. package/ccw/dist/commands/tool.js.map +1 -1
  107. package/ccw/dist/commands/view.d.ts +1 -0
  108. package/ccw/dist/commands/view.d.ts.map +1 -1
  109. package/ccw/dist/commands/view.js +10 -3
  110. package/ccw/dist/commands/view.js.map +1 -1
  111. package/ccw/dist/config/cli-settings-manager.d.ts +86 -0
  112. package/ccw/dist/config/cli-settings-manager.d.ts.map +1 -0
  113. package/ccw/dist/config/cli-settings-manager.js +392 -0
  114. package/ccw/dist/config/cli-settings-manager.js.map +1 -0
  115. package/ccw/dist/config/litellm-api-config-manager.d.ts +71 -5
  116. package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
  117. package/ccw/dist/config/litellm-api-config-manager.js +290 -20
  118. package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
  119. package/ccw/dist/core/auth/csrf-manager.d.ts +18 -0
  120. package/ccw/dist/core/auth/csrf-manager.d.ts.map +1 -0
  121. package/ccw/dist/core/auth/csrf-manager.js +80 -0
  122. package/ccw/dist/core/auth/csrf-manager.js.map +1 -0
  123. package/ccw/dist/core/auth/csrf-middleware.d.ts +8 -0
  124. package/ccw/dist/core/auth/csrf-middleware.d.ts.map +1 -0
  125. package/ccw/dist/core/auth/csrf-middleware.js +141 -0
  126. package/ccw/dist/core/auth/csrf-middleware.js.map +1 -0
  127. package/ccw/dist/core/auth/middleware.d.ts +15 -0
  128. package/ccw/dist/core/auth/middleware.d.ts.map +1 -0
  129. package/ccw/dist/core/auth/middleware.js +76 -0
  130. package/ccw/dist/core/auth/middleware.js.map +1 -0
  131. package/ccw/dist/core/auth/token-manager.d.ts +41 -0
  132. package/ccw/dist/core/auth/token-manager.d.ts.map +1 -0
  133. package/ccw/dist/core/auth/token-manager.js +171 -0
  134. package/ccw/dist/core/auth/token-manager.js.map +1 -0
  135. package/ccw/dist/core/cache-manager.d.ts +6 -6
  136. package/ccw/dist/core/cache-manager.d.ts.map +1 -1
  137. package/ccw/dist/core/cache-manager.js +70 -48
  138. package/ccw/dist/core/cache-manager.js.map +1 -1
  139. package/ccw/dist/core/claude-freshness.d.ts.map +1 -1
  140. package/ccw/dist/core/claude-freshness.js +23 -3
  141. package/ccw/dist/core/claude-freshness.js.map +1 -1
  142. package/ccw/dist/core/core-memory-store.d.ts.map +1 -1
  143. package/ccw/dist/core/core-memory-store.js +2 -1
  144. package/ccw/dist/core/core-memory-store.js.map +1 -1
  145. package/ccw/dist/core/cors.d.ts +3 -0
  146. package/ccw/dist/core/cors.d.ts.map +1 -0
  147. package/ccw/dist/core/cors.js +10 -0
  148. package/ccw/dist/core/cors.js.map +1 -0
  149. package/ccw/dist/core/dashboard-generator-patch.js +0 -1
  150. package/ccw/dist/core/dashboard-generator-patch.js.map +1 -1
  151. package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
  152. package/ccw/dist/core/dashboard-generator.js +417 -416
  153. package/ccw/dist/core/dashboard-generator.js.map +1 -1
  154. package/ccw/dist/core/data-aggregator.js +2 -2
  155. package/ccw/dist/core/data-aggregator.js.map +1 -1
  156. package/ccw/dist/core/lite-scanner.d.ts +1 -1
  157. package/ccw/dist/core/lite-scanner.d.ts.map +1 -1
  158. package/ccw/dist/core/lite-scanner.js +130 -127
  159. package/ccw/dist/core/lite-scanner.js.map +1 -1
  160. package/ccw/dist/core/routes/auth-routes.d.ts +12 -0
  161. package/ccw/dist/core/routes/auth-routes.d.ts.map +1 -0
  162. package/ccw/dist/core/routes/auth-routes.js +80 -0
  163. package/ccw/dist/core/routes/auth-routes.js.map +1 -0
  164. package/ccw/dist/core/routes/ccw-routes.d.ts +1 -14
  165. package/ccw/dist/core/routes/ccw-routes.d.ts.map +1 -1
  166. package/ccw/dist/core/routes/ccw-routes.js +9 -4
  167. package/ccw/dist/core/routes/ccw-routes.js.map +1 -1
  168. package/ccw/dist/core/routes/claude-routes.d.ts +1 -14
  169. package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
  170. package/ccw/dist/core/routes/claude-routes.js +98 -39
  171. package/ccw/dist/core/routes/claude-routes.js.map +1 -1
  172. package/ccw/dist/core/routes/cli-routes.d.ts +14 -12
  173. package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
  174. package/ccw/dist/core/routes/cli-routes.js +122 -43
  175. package/ccw/dist/core/routes/cli-routes.js.map +1 -1
  176. package/ccw/dist/core/routes/cli-settings-routes.d.ts +11 -0
  177. package/ccw/dist/core/routes/cli-settings-routes.d.ts.map +1 -0
  178. package/ccw/dist/core/routes/cli-settings-routes.js +204 -0
  179. package/ccw/dist/core/routes/cli-settings-routes.js.map +1 -0
  180. package/ccw/dist/core/routes/codexlens/config-handlers.d.ts +6 -0
  181. package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -0
  182. package/ccw/dist/core/routes/codexlens/config-handlers.js +1195 -0
  183. package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -0
  184. package/ccw/dist/core/routes/codexlens/index-handlers.d.ts +10 -0
  185. package/ccw/dist/core/routes/codexlens/index-handlers.d.ts.map +1 -0
  186. package/ccw/dist/core/routes/codexlens/index-handlers.js +322 -0
  187. package/ccw/dist/core/routes/codexlens/index-handlers.js.map +1 -0
  188. package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts +6 -0
  189. package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts.map +1 -0
  190. package/ccw/dist/core/routes/codexlens/semantic-handlers.js +865 -0
  191. package/ccw/dist/core/routes/codexlens/semantic-handlers.js.map +1 -0
  192. package/ccw/dist/core/routes/codexlens/utils.d.ts +23 -0
  193. package/ccw/dist/core/routes/codexlens/utils.d.ts.map +1 -0
  194. package/ccw/dist/core/routes/codexlens/utils.js +85 -0
  195. package/ccw/dist/core/routes/codexlens/utils.js.map +1 -0
  196. package/ccw/dist/core/routes/codexlens/watcher-handlers.d.ts +13 -0
  197. package/ccw/dist/core/routes/codexlens/watcher-handlers.d.ts.map +1 -0
  198. package/ccw/dist/core/routes/codexlens/watcher-handlers.js +235 -0
  199. package/ccw/dist/core/routes/codexlens/watcher-handlers.js.map +1 -0
  200. package/ccw/dist/core/routes/codexlens-routes.d.ts +2 -11
  201. package/ccw/dist/core/routes/codexlens-routes.d.ts.map +1 -1
  202. package/ccw/dist/core/routes/codexlens-routes.js +10 -981
  203. package/ccw/dist/core/routes/codexlens-routes.js.map +1 -1
  204. package/ccw/dist/core/routes/discovery-routes.d.ts +1 -35
  205. package/ccw/dist/core/routes/discovery-routes.d.ts.map +1 -1
  206. package/ccw/dist/core/routes/discovery-routes.js +25 -0
  207. package/ccw/dist/core/routes/discovery-routes.js.map +1 -1
  208. package/ccw/dist/core/routes/files-routes.d.ts +1 -14
  209. package/ccw/dist/core/routes/files-routes.d.ts.map +1 -1
  210. package/ccw/dist/core/routes/files-routes.js +57 -14
  211. package/ccw/dist/core/routes/files-routes.js.map +1 -1
  212. package/ccw/dist/core/routes/graph-routes.d.ts +1 -14
  213. package/ccw/dist/core/routes/graph-routes.d.ts.map +1 -1
  214. package/ccw/dist/core/routes/graph-routes.js +36 -37
  215. package/ccw/dist/core/routes/graph-routes.js.map +1 -1
  216. package/ccw/dist/core/routes/help-routes.d.ts +1 -14
  217. package/ccw/dist/core/routes/help-routes.d.ts.map +1 -1
  218. package/ccw/dist/core/routes/help-routes.js +5 -0
  219. package/ccw/dist/core/routes/help-routes.js.map +1 -1
  220. package/ccw/dist/core/routes/hooks-routes.d.ts +4 -14
  221. package/ccw/dist/core/routes/hooks-routes.d.ts.map +1 -1
  222. package/ccw/dist/core/routes/hooks-routes.js +43 -21
  223. package/ccw/dist/core/routes/hooks-routes.js.map +1 -1
  224. package/ccw/dist/core/routes/issue-routes.d.ts +1 -34
  225. package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
  226. package/ccw/dist/core/routes/issue-routes.js +24 -0
  227. package/ccw/dist/core/routes/issue-routes.js.map +1 -1
  228. package/ccw/dist/core/routes/litellm-api-routes.d.ts +1 -14
  229. package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
  230. package/ccw/dist/core/routes/litellm-api-routes.js +505 -48
  231. package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
  232. package/ccw/dist/core/routes/litellm-routes.d.ts +1 -14
  233. package/ccw/dist/core/routes/litellm-routes.d.ts.map +1 -1
  234. package/ccw/dist/core/routes/litellm-routes.js +28 -11
  235. package/ccw/dist/core/routes/litellm-routes.js.map +1 -1
  236. package/ccw/dist/core/routes/mcp-routes.d.ts +1 -14
  237. package/ccw/dist/core/routes/mcp-routes.d.ts.map +1 -1
  238. package/ccw/dist/core/routes/mcp-routes.js +99 -30
  239. package/ccw/dist/core/routes/mcp-routes.js.map +1 -1
  240. package/ccw/dist/core/routes/mcp-templates-db.d.ts.map +1 -1
  241. package/ccw/dist/core/routes/mcp-templates-db.js +30 -31
  242. package/ccw/dist/core/routes/mcp-templates-db.js.map +1 -1
  243. package/ccw/dist/core/routes/memory-routes.d.ts.map +1 -1
  244. package/ccw/dist/core/routes/memory-routes.js +74 -24
  245. package/ccw/dist/core/routes/memory-routes.js.map +1 -1
  246. package/ccw/dist/core/routes/nav-status-routes.d.ts +3 -0
  247. package/ccw/dist/core/routes/nav-status-routes.d.ts.map +1 -0
  248. package/ccw/dist/core/routes/nav-status-routes.js +217 -0
  249. package/ccw/dist/core/routes/nav-status-routes.js.map +1 -0
  250. package/ccw/dist/core/routes/rules-routes.d.ts +1 -14
  251. package/ccw/dist/core/routes/rules-routes.d.ts.map +1 -1
  252. package/ccw/dist/core/routes/rules-routes.js +481 -58
  253. package/ccw/dist/core/routes/rules-routes.js.map +1 -1
  254. package/ccw/dist/core/routes/session-routes.d.ts +1 -14
  255. package/ccw/dist/core/routes/session-routes.d.ts.map +1 -1
  256. package/ccw/dist/core/routes/session-routes.js +15 -3
  257. package/ccw/dist/core/routes/session-routes.js.map +1 -1
  258. package/ccw/dist/core/routes/skills-routes.d.ts +1 -14
  259. package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
  260. package/ccw/dist/core/routes/skills-routes.js +394 -112
  261. package/ccw/dist/core/routes/skills-routes.js.map +1 -1
  262. package/ccw/dist/core/routes/status-routes.d.ts +1 -14
  263. package/ccw/dist/core/routes/status-routes.d.ts.map +1 -1
  264. package/ccw/dist/core/routes/status-routes.js +4 -0
  265. package/ccw/dist/core/routes/status-routes.js.map +1 -1
  266. package/ccw/dist/core/routes/system-routes.d.ts +4 -10
  267. package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
  268. package/ccw/dist/core/routes/system-routes.js +6 -4
  269. package/ccw/dist/core/routes/system-routes.js.map +1 -1
  270. package/ccw/dist/core/routes/types.d.ts +19 -0
  271. package/ccw/dist/core/routes/types.d.ts.map +1 -0
  272. package/ccw/dist/core/routes/types.js +2 -0
  273. package/ccw/dist/core/routes/types.js.map +1 -0
  274. package/ccw/dist/core/server.d.ts.map +1 -1
  275. package/ccw/dist/core/server.js +201 -29
  276. package/ccw/dist/core/server.js.map +1 -1
  277. package/ccw/dist/core/services/api-key-tester.d.ts +31 -0
  278. package/ccw/dist/core/services/api-key-tester.d.ts.map +1 -0
  279. package/ccw/dist/core/services/api-key-tester.js +106 -0
  280. package/ccw/dist/core/services/api-key-tester.js.map +1 -0
  281. package/ccw/dist/core/services/health-check-service.d.ts +82 -0
  282. package/ccw/dist/core/services/health-check-service.d.ts.map +1 -0
  283. package/ccw/dist/core/services/health-check-service.js +271 -0
  284. package/ccw/dist/core/services/health-check-service.js.map +1 -0
  285. package/ccw/dist/core/websocket.d.ts +9 -7
  286. package/ccw/dist/core/websocket.d.ts.map +1 -1
  287. package/ccw/dist/core/websocket.js +9 -4
  288. package/ccw/dist/core/websocket.js.map +1 -1
  289. package/ccw/dist/tools/claude-cli-tools.d.ts +152 -28
  290. package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
  291. package/ccw/dist/tools/claude-cli-tools.js +490 -100
  292. package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
  293. package/ccw/dist/tools/cli-config-manager.d.ts +24 -8
  294. package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
  295. package/ccw/dist/tools/cli-config-manager.js +76 -156
  296. package/ccw/dist/tools/cli-config-manager.js.map +1 -1
  297. package/ccw/dist/tools/cli-executor-core.d.ts +85 -0
  298. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -0
  299. package/ccw/dist/tools/cli-executor-core.js +1310 -0
  300. package/ccw/dist/tools/cli-executor-core.js.map +1 -0
  301. package/ccw/dist/tools/cli-executor-state.d.ts +241 -0
  302. package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -0
  303. package/ccw/dist/tools/cli-executor-state.js +392 -0
  304. package/ccw/dist/tools/cli-executor-state.js.map +1 -0
  305. package/ccw/dist/tools/cli-executor-utils.d.ts +36 -0
  306. package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -0
  307. package/ccw/dist/tools/cli-executor-utils.js +298 -0
  308. package/ccw/dist/tools/cli-executor-utils.js.map +1 -0
  309. package/ccw/dist/tools/cli-executor.d.ts +3 -377
  310. package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
  311. package/ccw/dist/tools/cli-executor.js +3 -1884
  312. package/ccw/dist/tools/cli-executor.js.map +1 -1
  313. package/ccw/dist/tools/cli-history-store.d.ts +2 -0
  314. package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
  315. package/ccw/dist/tools/cli-history-store.js.map +1 -1
  316. package/ccw/dist/tools/cli-output-converter.d.ts +192 -0
  317. package/ccw/dist/tools/cli-output-converter.d.ts.map +1 -0
  318. package/ccw/dist/tools/cli-output-converter.js +1047 -0
  319. package/ccw/dist/tools/cli-output-converter.js.map +1 -0
  320. package/ccw/dist/tools/cli-prompt-builder.d.ts +113 -0
  321. package/ccw/dist/tools/cli-prompt-builder.d.ts.map +1 -0
  322. package/ccw/dist/tools/cli-prompt-builder.js +363 -0
  323. package/ccw/dist/tools/cli-prompt-builder.js.map +1 -0
  324. package/ccw/dist/tools/codex-lens.d.ts +15 -1
  325. package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
  326. package/ccw/dist/tools/codex-lens.js +289 -55
  327. package/ccw/dist/tools/codex-lens.js.map +1 -1
  328. package/ccw/dist/tools/detect-changed-modules.d.ts.map +1 -1
  329. package/ccw/dist/tools/detect-changed-modules.js +22 -4
  330. package/ccw/dist/tools/detect-changed-modules.js.map +1 -1
  331. package/ccw/dist/tools/index.d.ts.map +1 -1
  332. package/ccw/dist/tools/index.js +2 -0
  333. package/ccw/dist/tools/index.js.map +1 -1
  334. package/ccw/dist/tools/litellm-client.d.ts.map +1 -1
  335. package/ccw/dist/tools/litellm-client.js +10 -4
  336. package/ccw/dist/tools/litellm-client.js.map +1 -1
  337. package/ccw/dist/tools/litellm-executor.d.ts +2 -4
  338. package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
  339. package/ccw/dist/tools/litellm-executor.js +39 -8
  340. package/ccw/dist/tools/litellm-executor.js.map +1 -1
  341. package/ccw/dist/tools/native-session-discovery.d.ts +2 -0
  342. package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -1
  343. package/ccw/dist/tools/native-session-discovery.js +197 -1
  344. package/ccw/dist/tools/native-session-discovery.js.map +1 -1
  345. package/ccw/dist/tools/session-manager.d.ts.map +1 -1
  346. package/ccw/dist/tools/session-manager.js +79 -0
  347. package/ccw/dist/tools/session-manager.js.map +1 -1
  348. package/ccw/dist/tools/skill-context-loader.d.ts +15 -0
  349. package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -0
  350. package/ccw/dist/tools/skill-context-loader.js +198 -0
  351. package/ccw/dist/tools/skill-context-loader.js.map +1 -0
  352. package/ccw/dist/tools/smart-search.d.ts +8 -3
  353. package/ccw/dist/tools/smart-search.d.ts.map +1 -1
  354. package/ccw/dist/tools/smart-search.js +378 -75
  355. package/ccw/dist/tools/smart-search.js.map +1 -1
  356. package/ccw/dist/types/cli-settings.d.ts +86 -0
  357. package/ccw/dist/types/cli-settings.d.ts.map +1 -0
  358. package/ccw/dist/types/cli-settings.js +54 -0
  359. package/ccw/dist/types/cli-settings.js.map +1 -0
  360. package/ccw/dist/types/litellm-api-config.d.ts +40 -1
  361. package/ccw/dist/types/litellm-api-config.d.ts.map +1 -1
  362. package/ccw/dist/utils/exec-constants.d.ts +25 -0
  363. package/ccw/dist/utils/exec-constants.d.ts.map +1 -0
  364. package/ccw/dist/utils/exec-constants.js +25 -0
  365. package/ccw/dist/utils/exec-constants.js.map +1 -0
  366. package/ccw/dist/utils/path-resolver.d.ts +1 -0
  367. package/ccw/dist/utils/path-resolver.d.ts.map +1 -1
  368. package/ccw/dist/utils/path-resolver.js +48 -3
  369. package/ccw/dist/utils/path-resolver.js.map +1 -1
  370. package/ccw/dist/utils/path-validator.d.ts.map +1 -1
  371. package/ccw/dist/utils/path-validator.js +25 -6
  372. package/ccw/dist/utils/path-validator.js.map +1 -1
  373. package/ccw/dist/utils/python-utils.d.ts.map +1 -1
  374. package/ccw/dist/utils/python-utils.js +27 -7
  375. package/ccw/dist/utils/python-utils.js.map +1 -1
  376. package/ccw/dist/utils/shell-escape.d.ts +8 -0
  377. package/ccw/dist/utils/shell-escape.d.ts.map +1 -0
  378. package/ccw/dist/utils/shell-escape.js +24 -0
  379. package/ccw/dist/utils/shell-escape.js.map +1 -0
  380. package/ccw/dist/utils/uv-manager.d.ts +167 -0
  381. package/ccw/dist/utils/uv-manager.d.ts.map +1 -0
  382. package/ccw/dist/utils/uv-manager.js +644 -0
  383. package/ccw/dist/utils/uv-manager.js.map +1 -0
  384. package/ccw/src/cli.ts +4 -1
  385. package/ccw/src/commands/cli.ts +132 -34
  386. package/ccw/src/commands/issue.ts +605 -91
  387. package/ccw/src/commands/serve.ts +15 -5
  388. package/ccw/src/commands/stop.ts +32 -5
  389. package/ccw/src/commands/tool.ts +17 -2
  390. package/ccw/src/commands/view.ts +13 -3
  391. package/ccw/src/config/cli-settings-manager.ts +460 -0
  392. package/ccw/src/config/litellm-api-config-manager.ts +392 -57
  393. package/ccw/src/core/auth/csrf-manager.ts +104 -0
  394. package/ccw/src/core/auth/csrf-middleware.ts +159 -0
  395. package/ccw/src/core/auth/middleware.ts +94 -0
  396. package/ccw/src/core/auth/token-manager.ts +219 -0
  397. package/ccw/src/core/cache-manager.ts +64 -52
  398. package/ccw/src/core/claude-freshness.ts +26 -6
  399. package/ccw/src/core/core-memory-store.ts +2 -1
  400. package/ccw/src/core/cors.ts +10 -0
  401. package/ccw/src/core/dashboard-generator-patch.ts +47 -48
  402. package/ccw/src/core/dashboard-generator.ts +797 -744
  403. package/ccw/src/core/data-aggregator.ts +667 -667
  404. package/ccw/src/core/lite-scanner.ts +156 -140
  405. package/ccw/src/core/routes/auth-routes.ts +98 -0
  406. package/ccw/src/core/routes/ccw-routes.ts +10 -20
  407. package/ccw/src/core/routes/claude-routes.ts +101 -51
  408. package/ccw/src/core/routes/cli-routes.ts +152 -55
  409. package/ccw/src/core/routes/cli-settings-routes.ts +232 -0
  410. package/ccw/src/core/routes/codexlens/README.md +37 -0
  411. package/ccw/src/core/routes/codexlens/config-handlers.ts +1269 -0
  412. package/ccw/src/core/routes/codexlens/index-handlers.ts +354 -0
  413. package/ccw/src/core/routes/codexlens/semantic-handlers.ts +931 -0
  414. package/ccw/src/core/routes/codexlens/utils.ts +96 -0
  415. package/ccw/src/core/routes/codexlens/watcher-handlers.ts +265 -0
  416. package/ccw/src/core/routes/codexlens-routes.ts +11 -1044
  417. package/ccw/src/core/routes/discovery-routes.ts +1 -12
  418. package/ccw/src/core/routes/files-routes.ts +112 -40
  419. package/ccw/src/core/routes/graph-routes.ts +39 -46
  420. package/ccw/src/core/routes/help-routes.ts +2 -12
  421. package/ccw/src/core/routes/hooks-routes.ts +83 -44
  422. package/ccw/src/core/routes/issue-routes.ts +1 -12
  423. package/ccw/src/core/routes/litellm-api-routes.ts +566 -60
  424. package/ccw/src/core/routes/litellm-routes.ts +35 -27
  425. package/ccw/src/core/routes/mcp-routes.ts +157 -60
  426. package/ccw/src/core/routes/mcp-routes.ts.backup +549 -550
  427. package/ccw/src/core/routes/mcp-templates-db.ts +267 -268
  428. package/ccw/src/core/routes/memory-routes.ts +76 -22
  429. package/ccw/src/core/routes/nav-status-routes.ts +231 -0
  430. package/ccw/src/core/routes/rules-routes.ts +600 -81
  431. package/ccw/src/core/routes/session-routes.ts +28 -22
  432. package/ccw/src/core/routes/skills-routes.ts +452 -132
  433. package/ccw/src/core/routes/status-routes.ts +1 -12
  434. package/ccw/src/core/routes/system-routes.ts +15 -22
  435. package/ccw/src/core/routes/types.ts +25 -0
  436. package/ccw/src/core/server.ts +651 -468
  437. package/ccw/src/core/services/api-key-tester.ts +137 -0
  438. package/ccw/src/core/services/health-check-service.ts +340 -0
  439. package/ccw/src/core/websocket.ts +20 -12
  440. package/ccw/src/templates/dashboard-css/01-base.css +109 -0
  441. package/ccw/src/templates/dashboard-css/10-cli-status.css +202 -0
  442. package/ccw/src/templates/dashboard-css/21-cli-toolmgmt.css +308 -0
  443. package/ccw/src/templates/dashboard-css/30-core-memory.css +20 -0
  444. package/ccw/src/templates/dashboard-css/31-api-settings.css +751 -14
  445. package/ccw/src/templates/dashboard-css/33-cli-stream-viewer.css +230 -2
  446. package/ccw/src/templates/dashboard-js/api.js +5 -0
  447. package/ccw/src/templates/dashboard-js/components/cli-status.js +279 -107
  448. package/ccw/src/templates/dashboard-js/components/cli-stream-viewer.js +262 -20
  449. package/ccw/src/templates/dashboard-js/components/hook-manager.js +105 -5
  450. package/ccw/src/templates/dashboard-js/components/mcp-manager.js +317 -0
  451. package/ccw/src/templates/dashboard-js/components/navigation.js +45 -0
  452. package/ccw/src/templates/dashboard-js/components/notifications.js +128 -0
  453. package/ccw/src/templates/dashboard-js/i18n.js +4438 -3983
  454. package/ccw/src/templates/dashboard-js/main.js +71 -0
  455. package/ccw/src/templates/dashboard-js/services.js +289 -0
  456. package/ccw/src/templates/dashboard-js/views/api-settings.js +5613 -3361
  457. package/ccw/src/templates/dashboard-js/views/claude-manager.js +1 -7
  458. package/ccw/src/templates/dashboard-js/views/cli-manager.js +581 -87
  459. package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +6091 -1965
  460. package/ccw/src/templates/dashboard-js/views/core-memory.js +129 -20
  461. package/ccw/src/templates/dashboard-js/views/hook-manager.js +17 -3
  462. package/ccw/src/templates/dashboard-js/views/mcp-manager.js +63 -0
  463. package/ccw/src/templates/dashboard-js/views/project-overview.js +182 -37
  464. package/ccw/src/templates/dashboard-js/views/rules-manager.js +26 -3
  465. package/ccw/src/templates/dashboard-js/views/skills-manager.js +2 -42
  466. package/ccw/src/templates/dashboard.html +6 -0
  467. package/ccw/src/tools/README.md +29 -0
  468. package/ccw/src/tools/claude-cli-tools.ts +640 -125
  469. package/ccw/src/tools/cli-config-manager.ts +102 -172
  470. package/ccw/src/tools/cli-executor-core.ts +1533 -0
  471. package/ccw/src/tools/cli-executor-state.ts +560 -0
  472. package/ccw/src/tools/cli-executor-utils.ts +349 -0
  473. package/ccw/src/tools/cli-executor.ts +3 -2309
  474. package/ccw/src/tools/cli-history-store.ts +2 -0
  475. package/ccw/src/tools/cli-output-converter.ts +1237 -0
  476. package/ccw/src/tools/cli-prompt-builder.ts +487 -0
  477. package/ccw/src/tools/codex-lens.ts +324 -59
  478. package/ccw/src/tools/detect-changed-modules.ts +24 -6
  479. package/ccw/src/tools/index.ts +2 -0
  480. package/ccw/src/tools/litellm-client.ts +10 -4
  481. package/ccw/src/tools/litellm-executor.ts +146 -114
  482. package/ccw/src/tools/native-session-discovery.ts +209 -1
  483. package/ccw/src/tools/session-manager.ts +88 -0
  484. package/ccw/src/tools/skill-context-loader.ts +213 -0
  485. package/ccw/src/tools/smart-search.ts +427 -76
  486. package/ccw/src/types/cli-settings.ts +137 -0
  487. package/ccw/src/types/litellm-api-config.ts +55 -1
  488. package/ccw/src/utils/exec-constants.ts +24 -0
  489. package/ccw/src/utils/path-resolver.ts +49 -3
  490. package/ccw/src/utils/path-validator.ts +28 -6
  491. package/ccw/src/utils/python-utils.ts +140 -121
  492. package/ccw/src/utils/shell-escape.ts +30 -0
  493. package/ccw/src/utils/uv-manager.ts +796 -0
  494. package/ccw-litellm/src/ccw_litellm/__pycache__/__init__.cpython-310.pyc +0 -0
  495. package/ccw-litellm/src/ccw_litellm/__pycache__/__init__.cpython-312.pyc +0 -0
  496. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/__init__.cpython-310.pyc +0 -0
  497. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/__init__.cpython-312.pyc +0 -0
  498. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-310.pyc +0 -0
  499. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-312.pyc +0 -0
  500. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-313.pyc +0 -0
  501. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-310.pyc +0 -0
  502. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-312.pyc +0 -0
  503. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-313.pyc +0 -0
  504. package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +270 -251
  505. package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +33 -0
  506. package/ccw-litellm/src/ccw_litellm/config/__pycache__/__init__.cpython-310.pyc +0 -0
  507. package/ccw-litellm/src/ccw_litellm/config/__pycache__/__init__.cpython-312.pyc +0 -0
  508. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-310.pyc +0 -0
  509. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-312.pyc +0 -0
  510. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-313.pyc +0 -0
  511. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-310.pyc +0 -0
  512. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-312.pyc +0 -0
  513. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-313.pyc +0 -0
  514. package/ccw-litellm/src/ccw_litellm/config/loader.py +343 -316
  515. package/ccw-litellm/src/ccw_litellm/config/models.py +162 -130
  516. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/__init__.cpython-310.pyc +0 -0
  517. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/__init__.cpython-312.pyc +0 -0
  518. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/embedder.cpython-310.pyc +0 -0
  519. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/embedder.cpython-312.pyc +0 -0
  520. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/llm.cpython-310.pyc +0 -0
  521. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/llm.cpython-312.pyc +0 -0
  522. package/codex-lens/pyproject.toml +43 -0
  523. package/codex-lens/src/codexlens/__pycache__/__init__.cpython-310.pyc +0 -0
  524. package/codex-lens/src/codexlens/__pycache__/__init__.cpython-312.pyc +0 -0
  525. package/codex-lens/src/codexlens/__pycache__/__main__.cpython-310.pyc +0 -0
  526. package/codex-lens/src/codexlens/__pycache__/__main__.cpython-312.pyc +0 -0
  527. package/codex-lens/src/codexlens/__pycache__/config.cpython-310.pyc +0 -0
  528. package/codex-lens/src/codexlens/__pycache__/config.cpython-312.pyc +0 -0
  529. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  530. package/codex-lens/src/codexlens/__pycache__/entities.cpython-310.pyc +0 -0
  531. package/codex-lens/src/codexlens/__pycache__/entities.cpython-312.pyc +0 -0
  532. package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
  533. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-310.pyc +0 -0
  534. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-312.pyc +0 -0
  535. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-313.pyc +0 -0
  536. package/codex-lens/src/codexlens/__pycache__/errors.cpython-310.pyc +0 -0
  537. package/codex-lens/src/codexlens/__pycache__/errors.cpython-312.pyc +0 -0
  538. package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-310.pyc +0 -0
  539. package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-312.pyc +0 -0
  540. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-310.pyc +0 -0
  541. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-312.pyc +0 -0
  542. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-313.pyc +0 -0
  543. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-310.pyc +0 -0
  544. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-312.pyc +0 -0
  545. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-313.pyc +0 -0
  546. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-310.pyc +0 -0
  547. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-312.pyc +0 -0
  548. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-313.pyc +0 -0
  549. package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-310.pyc +0 -0
  550. package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-312.pyc +0 -0
  551. package/codex-lens/src/codexlens/cli/commands.py +4416 -2295
  552. package/codex-lens/src/codexlens/cli/embedding_manager.py +767 -14
  553. package/codex-lens/src/codexlens/cli/model_manager.py +676 -0
  554. package/codex-lens/src/codexlens/config.py +321 -12
  555. package/codex-lens/src/codexlens/entities.py +4 -1
  556. package/codex-lens/src/codexlens/env_config.py +298 -0
  557. package/codex-lens/src/codexlens/indexing/__init__.py +23 -1
  558. package/codex-lens/src/codexlens/indexing/__pycache__/__init__.cpython-313.pyc +0 -0
  559. package/codex-lens/src/codexlens/indexing/__pycache__/embedding.cpython-313.pyc +0 -0
  560. package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
  561. package/codex-lens/src/codexlens/indexing/embedding.py +582 -0
  562. package/codex-lens/src/codexlens/indexing/symbol_extractor.py +62 -28
  563. package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-310.pyc +0 -0
  564. package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-312.pyc +0 -0
  565. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-310.pyc +0 -0
  566. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-312.pyc +0 -0
  567. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
  568. package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-310.pyc +0 -0
  569. package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-312.pyc +0 -0
  570. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-310.pyc +0 -0
  571. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-312.pyc +0 -0
  572. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
  573. package/codex-lens/src/codexlens/parsers/factory.py +139 -10
  574. package/codex-lens/src/codexlens/parsers/treesitter_parser.py +487 -13
  575. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-310.pyc +0 -0
  576. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-312.pyc +0 -0
  577. package/codex-lens/src/codexlens/search/__pycache__/binary_searcher.cpython-313.pyc +0 -0
  578. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-310.pyc +0 -0
  579. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-312.pyc +0 -0
  580. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  581. package/codex-lens/src/codexlens/search/__pycache__/enrichment.cpython-313.pyc +0 -0
  582. package/codex-lens/src/codexlens/search/__pycache__/graph_expander.cpython-313.pyc +0 -0
  583. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-310.pyc +0 -0
  584. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-312.pyc +0 -0
  585. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  586. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-310.pyc +0 -0
  587. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-312.pyc +0 -0
  588. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  589. package/codex-lens/src/codexlens/search/binary_searcher.py +277 -0
  590. package/codex-lens/src/codexlens/search/chain_search.py +1642 -8
  591. package/codex-lens/src/codexlens/search/enrichment.py +21 -0
  592. package/codex-lens/src/codexlens/search/graph_expander.py +264 -0
  593. package/codex-lens/src/codexlens/search/hybrid_search.py +772 -37
  594. package/codex-lens/src/codexlens/search/ranking.py +347 -8
  595. package/codex-lens/src/codexlens/semantic/SPLADE_IMPLEMENTATION.md +225 -0
  596. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-310.pyc +0 -0
  597. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-312.pyc +0 -0
  598. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-310.pyc +0 -0
  599. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-312.pyc +0 -0
  600. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-313.pyc +0 -0
  601. package/codex-lens/src/codexlens/semantic/__pycache__/base.cpython-310.pyc +0 -0
  602. package/codex-lens/src/codexlens/semantic/__pycache__/base.cpython-312.pyc +0 -0
  603. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-310.pyc +0 -0
  604. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-312.pyc +0 -0
  605. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-310.pyc +0 -0
  606. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-312.pyc +0 -0
  607. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-310.pyc +0 -0
  608. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-312.pyc +0 -0
  609. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-313.pyc +0 -0
  610. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-310.pyc +0 -0
  611. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-312.pyc +0 -0
  612. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-313.pyc +0 -0
  613. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-310.pyc +0 -0
  614. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-312.pyc +0 -0
  615. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-313.pyc +0 -0
  616. package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
  617. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-310.pyc +0 -0
  618. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-312.pyc +0 -0
  619. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-313.pyc +0 -0
  620. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-310.pyc +0 -0
  621. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-312.pyc +0 -0
  622. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
  623. package/codex-lens/src/codexlens/semantic/ann_index.py +654 -0
  624. package/codex-lens/src/codexlens/semantic/factory.py +63 -3
  625. package/codex-lens/src/codexlens/semantic/gpu_support.py +19 -2
  626. package/codex-lens/src/codexlens/semantic/litellm_embedder.py +144 -144
  627. package/codex-lens/src/codexlens/semantic/reranker/__init__.py +25 -0
  628. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-310.pyc +0 -0
  629. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-313.pyc +0 -0
  630. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/api_reranker.cpython-310.pyc +0 -0
  631. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/api_reranker.cpython-313.pyc +0 -0
  632. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/base.cpython-310.pyc +0 -0
  633. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/base.cpython-313.pyc +0 -0
  634. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/factory.cpython-310.pyc +0 -0
  635. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/factory.cpython-313.pyc +0 -0
  636. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/fastembed_reranker.cpython-310.pyc +0 -0
  637. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/fastembed_reranker.cpython-313.pyc +0 -0
  638. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/legacy.cpython-310.pyc +0 -0
  639. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/legacy.cpython-313.pyc +0 -0
  640. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/litellm_reranker.cpython-313.pyc +0 -0
  641. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-310.pyc +0 -0
  642. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-313.pyc +0 -0
  643. package/codex-lens/src/codexlens/semantic/reranker/api_reranker.py +403 -0
  644. package/codex-lens/src/codexlens/semantic/reranker/base.py +46 -0
  645. package/codex-lens/src/codexlens/semantic/reranker/factory.py +159 -0
  646. package/codex-lens/src/codexlens/semantic/reranker/fastembed_reranker.py +257 -0
  647. package/codex-lens/src/codexlens/semantic/reranker/legacy.py +91 -0
  648. package/codex-lens/src/codexlens/semantic/reranker/litellm_reranker.py +214 -0
  649. package/codex-lens/src/codexlens/semantic/reranker/onnx_reranker.py +268 -0
  650. package/codex-lens/src/codexlens/semantic/splade_encoder.py +567 -0
  651. package/codex-lens/src/codexlens/semantic/vector_store.py +472 -352
  652. package/codex-lens/src/codexlens/storage/__init__.py +3 -0
  653. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-310.pyc +0 -0
  654. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-312.pyc +0 -0
  655. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-313.pyc +0 -0
  656. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-310.pyc +0 -0
  657. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-312.pyc +0 -0
  658. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  659. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-310.pyc +0 -0
  660. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-312.pyc +0 -0
  661. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-310.pyc +0 -0
  662. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-312.pyc +0 -0
  663. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
  664. package/codex-lens/src/codexlens/storage/__pycache__/merkle_tree.cpython-313.pyc +0 -0
  665. package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-310.pyc +0 -0
  666. package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-312.pyc +0 -0
  667. package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-310.pyc +0 -0
  668. package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-312.pyc +0 -0
  669. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-310.pyc +0 -0
  670. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-312.pyc +0 -0
  671. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-313.pyc +0 -0
  672. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-310.pyc +0 -0
  673. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-312.pyc +0 -0
  674. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
  675. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-310.pyc +0 -0
  676. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-312.pyc +0 -0
  677. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-310.pyc +0 -0
  678. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-312.pyc +0 -0
  679. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-313.pyc +0 -0
  680. package/codex-lens/src/codexlens/storage/dir_index.py +310 -12
  681. package/codex-lens/src/codexlens/storage/index_tree.py +194 -23
  682. package/codex-lens/src/codexlens/storage/merkle_tree.py +136 -0
  683. package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-310.pyc +0 -0
  684. package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-312.pyc +0 -0
  685. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_006_enhance_relationships.cpython-313.pyc +0 -0
  686. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-310.pyc +0 -0
  687. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-312.pyc +0 -0
  688. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-313.pyc +0 -0
  689. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_008_add_merkle_hashes.cpython-313.pyc +0 -0
  690. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_009_add_splade.cpython-313.pyc +0 -0
  691. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_010_add_multi_vector_chunks.cpython-313.pyc +0 -0
  692. package/codex-lens/src/codexlens/storage/migrations/migration_006_enhance_relationships.py +37 -0
  693. package/codex-lens/src/codexlens/storage/migrations/migration_007_add_graph_neighbors.py +47 -0
  694. package/codex-lens/src/codexlens/storage/migrations/migration_008_add_merkle_hashes.py +81 -0
  695. package/codex-lens/src/codexlens/storage/migrations/migration_009_add_splade.py +103 -0
  696. package/codex-lens/src/codexlens/storage/migrations/migration_010_add_multi_vector_chunks.py +162 -0
  697. package/codex-lens/src/codexlens/storage/splade_index.py +578 -0
  698. package/codex-lens/src/codexlens/storage/sqlite_store.py +508 -184
  699. package/codex-lens/src/codexlens/storage/vector_meta_store.py +415 -0
  700. package/codex-lens/src/codexlens/watcher/__init__.py +17 -0
  701. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-310.pyc +0 -0
  702. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-312.pyc +0 -0
  703. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-313.pyc +0 -0
  704. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-310.pyc +0 -0
  705. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-312.pyc +0 -0
  706. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-313.pyc +0 -0
  707. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-310.pyc +0 -0
  708. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-312.pyc +0 -0
  709. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-313.pyc +0 -0
  710. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-310.pyc +0 -0
  711. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-312.pyc +0 -0
  712. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-313.pyc +0 -0
  713. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-310.pyc +0 -0
  714. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-312.pyc +0 -0
  715. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-313.pyc +0 -0
  716. package/codex-lens/src/codexlens/watcher/events.py +82 -0
  717. package/codex-lens/src/codexlens/watcher/file_watcher.py +347 -0
  718. package/codex-lens/src/codexlens/watcher/incremental_indexer.py +369 -0
  719. package/codex-lens/src/codexlens/watcher/manager.py +255 -0
  720. package/package.json +4 -1
  721. package/.claude/commands/workflow/docs/analyze.md +0 -1467
  722. package/.claude/commands/workflow/docs/copyright.md +0 -1265
  723. package/.claude/skills/command-guide/SKILL.md +0 -388
  724. package/.claude/skills/command-guide/UPDATE-GUIDELINE.md +0 -592
  725. package/.claude/skills/command-guide/guides/cli-tools-guide.md +0 -410
  726. package/.claude/skills/command-guide/guides/examples.md +0 -537
  727. package/.claude/skills/command-guide/guides/getting-started.md +0 -242
  728. package/.claude/skills/command-guide/guides/implementation-details.md +0 -1010
  729. package/.claude/skills/command-guide/guides/index-structure.md +0 -326
  730. package/.claude/skills/command-guide/guides/troubleshooting.md +0 -92
  731. package/.claude/skills/command-guide/guides/ui-design-workflow-guide.md +0 -316
  732. package/.claude/skills/command-guide/guides/workflow-patterns.md +0 -662
  733. package/.claude/skills/command-guide/reference/agents/action-planning-agent.md +0 -855
  734. package/.claude/skills/command-guide/reference/agents/cli-execution-agent.md +0 -267
  735. package/.claude/skills/command-guide/reference/agents/cli-explore-agent.md +0 -182
  736. package/.claude/skills/command-guide/reference/agents/cli-lite-planning-agent.md +0 -446
  737. package/.claude/skills/command-guide/reference/agents/cli-planning-agent.md +0 -558
  738. package/.claude/skills/command-guide/reference/agents/code-developer.md +0 -311
  739. package/.claude/skills/command-guide/reference/agents/conceptual-planning-agent.md +0 -308
  740. package/.claude/skills/command-guide/reference/agents/context-search-agent.md +0 -581
  741. package/.claude/skills/command-guide/reference/agents/doc-generator.md +0 -330
  742. package/.claude/skills/command-guide/reference/agents/memory-bridge.md +0 -94
  743. package/.claude/skills/command-guide/reference/agents/test-context-search-agent.md +0 -400
  744. package/.claude/skills/command-guide/reference/agents/test-fix-agent.md +0 -344
  745. package/.claude/skills/command-guide/reference/agents/ui-design-agent.md +0 -593
  746. package/.claude/skills/command-guide/reference/agents/universal-executor.md +0 -131
  747. package/.claude/skills/command-guide/reference/commands/cli/cli-init.md +0 -440
  748. package/.claude/skills/command-guide/reference/commands/enhance-prompt.md +0 -93
  749. package/.claude/skills/command-guide/reference/commands/memory/code-map-memory.md +0 -687
  750. package/.claude/skills/command-guide/reference/commands/memory/docs-full-cli.md +0 -471
  751. package/.claude/skills/command-guide/reference/commands/memory/docs-related-cli.md +0 -386
  752. package/.claude/skills/command-guide/reference/commands/memory/docs.md +0 -616
  753. package/.claude/skills/command-guide/reference/commands/memory/load-skill-memory.md +0 -182
  754. package/.claude/skills/command-guide/reference/commands/memory/load.md +0 -240
  755. package/.claude/skills/command-guide/reference/commands/memory/skill-memory.md +0 -525
  756. package/.claude/skills/command-guide/reference/commands/memory/style-skill-memory.md +0 -396
  757. package/.claude/skills/command-guide/reference/commands/memory/tech-research.md +0 -314
  758. package/.claude/skills/command-guide/reference/commands/memory/update-full.md +0 -332
  759. package/.claude/skills/command-guide/reference/commands/memory/update-related.md +0 -332
  760. package/.claude/skills/command-guide/reference/commands/memory/workflow-skill-memory.md +0 -517
  761. package/.claude/skills/command-guide/reference/commands/task/breakdown.md +0 -204
  762. package/.claude/skills/command-guide/reference/commands/task/create.md +0 -152
  763. package/.claude/skills/command-guide/reference/commands/task/execute.md +0 -270
  764. package/.claude/skills/command-guide/reference/commands/task/replan.md +0 -437
  765. package/.claude/skills/command-guide/reference/commands/version.md +0 -254
  766. package/.claude/skills/command-guide/reference/commands/workflow/action-plan-verify.md +0 -447
  767. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/api-designer.md +0 -585
  768. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/artifacts.md +0 -452
  769. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/auto-parallel.md +0 -443
  770. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/data-architect.md +0 -220
  771. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-manager.md +0 -200
  772. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-owner.md +0 -200
  773. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/scrum-master.md +0 -200
  774. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
  775. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/synthesis.md +0 -398
  776. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/system-architect.md +0 -387
  777. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ui-designer.md +0 -221
  778. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ux-expert.md +0 -221
  779. package/.claude/skills/command-guide/reference/commands/workflow/execute.md +0 -465
  780. package/.claude/skills/command-guide/reference/commands/workflow/init.md +0 -164
  781. package/.claude/skills/command-guide/reference/commands/workflow/lite-execute.md +0 -748
  782. package/.claude/skills/command-guide/reference/commands/workflow/lite-fix.md +0 -664
  783. package/.claude/skills/command-guide/reference/commands/workflow/lite-plan.md +0 -645
  784. package/.claude/skills/command-guide/reference/commands/workflow/plan.md +0 -551
  785. package/.claude/skills/command-guide/reference/commands/workflow/replan.md +0 -515
  786. package/.claude/skills/command-guide/reference/commands/workflow/review-fix.md +0 -606
  787. package/.claude/skills/command-guide/reference/commands/workflow/review-module-cycle.md +0 -765
  788. package/.claude/skills/command-guide/reference/commands/workflow/review-session-cycle.md +0 -776
  789. package/.claude/skills/command-guide/reference/commands/workflow/review.md +0 -298
  790. package/.claude/skills/command-guide/reference/commands/workflow/session/complete.md +0 -547
  791. package/.claude/skills/command-guide/reference/commands/workflow/session/list.md +0 -114
  792. package/.claude/skills/command-guide/reference/commands/workflow/session/resume.md +0 -77
  793. package/.claude/skills/command-guide/reference/commands/workflow/session/start.md +0 -257
  794. package/.claude/skills/command-guide/reference/commands/workflow/tdd-plan.md +0 -460
  795. package/.claude/skills/command-guide/reference/commands/workflow/tdd-verify.md +0 -400
  796. package/.claude/skills/command-guide/reference/commands/workflow/test-cycle-execute.md +0 -498
  797. package/.claude/skills/command-guide/reference/commands/workflow/test-fix-gen.md +0 -699
  798. package/.claude/skills/command-guide/reference/commands/workflow/test-gen.md +0 -529
  799. package/.claude/skills/command-guide/reference/commands/workflow/tools/conflict-resolution.md +0 -766
  800. package/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +0 -433
  801. package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-agent.md +0 -487
  802. package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +0 -518
  803. package/.claude/skills/command-guide/reference/commands/workflow/tools/tdd-coverage-analysis.md +0 -309
  804. package/.claude/skills/command-guide/reference/commands/workflow/tools/test-concept-enhanced.md +0 -163
  805. package/.claude/skills/command-guide/reference/commands/workflow/tools/test-context-gather.md +0 -232
  806. package/.claude/skills/command-guide/reference/commands/workflow/tools/test-task-generate.md +0 -254
  807. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/animation-extract.md +0 -1150
  808. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/codify-style.md +0 -652
  809. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/design-sync.md +0 -454
  810. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/explore-auto.md +0 -678
  811. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/generate.md +0 -504
  812. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/imitate-auto.md +0 -745
  813. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/import-from-code.md +0 -537
  814. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/layout-extract.md +0 -788
  815. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/reference-page-generator.md +0 -356
  816. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/style-extract.md +0 -773
  817. package/.claude/skills/command-guide/scripts/analyze_commands.py +0 -502
  818. package/.claude/skills/command-guide/scripts/update-index.sh +0 -130
  819. package/.claude/skills/command-guide/templates/issue-bug.md +0 -104
  820. package/.claude/skills/command-guide/templates/issue-diagnosis.md +0 -275
  821. package/.claude/skills/command-guide/templates/issue-feature.md +0 -97
  822. package/.claude/skills/command-guide/templates/issue-question.md +0 -141
@@ -5,8 +5,19 @@
5
5
  */
6
6
 
7
7
  import chalk from 'chalk';
8
- import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync } from 'fs';
8
+ import { execSync } from 'child_process';
9
+ import inquirer from 'inquirer';
10
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync, statSync } from 'fs';
9
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
+ }
10
21
 
11
22
  // Handle EPIPE errors gracefully
12
23
  process.stdout.on('error', (err: NodeJS.ErrnoException) => {
@@ -108,6 +119,15 @@ interface Solution {
108
119
  bound_at?: string;
109
120
  }
110
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
+
111
131
  interface QueueItem {
112
132
  item_id: string; // Item ID in queue: T-1, T-2, ... (task-level) or S-1, S-2, ... (solution-level)
113
133
  issue_id: string;
@@ -124,7 +144,9 @@ interface QueueItem {
124
144
  started_at?: string;
125
145
  completed_at?: string;
126
146
  result?: Record<string, any>;
127
- failure_reason?: string;
147
+ failure_reason?: string; // Simple string (backward compat)
148
+ failure_details?: FailureDetail; // Structured failure info
149
+ failure_history?: FailureDetail[]; // Preserved on retry for debugging
128
150
  }
129
151
 
130
152
  interface QueueConflict {
@@ -168,10 +190,12 @@ interface Queue {
168
190
  }
169
191
 
170
192
  interface QueueIndex {
171
- active_queue_id: string | null;
193
+ active_queue_id: string | null; // Single active queue (backward compat)
194
+ active_queue_ids?: string[]; // Multiple active queues, ordered by priority
172
195
  queues: {
173
196
  id: string;
174
197
  status: string;
198
+ priority?: number; // Queue execution priority (lower = higher priority)
175
199
  issue_ids: string[];
176
200
  total_tasks?: number; // For task-level queues
177
201
  total_solutions?: number; // For solution-level queues
@@ -189,6 +213,7 @@ interface IssueOptions {
189
213
  executor?: string;
190
214
  priority?: string;
191
215
  solution?: string;
216
+ solutionId?: string; // --solution-id <id> for filtering solutions
192
217
  result?: string;
193
218
  reason?: string;
194
219
  json?: boolean;
@@ -197,16 +222,113 @@ interface IssueOptions {
197
222
  brief?: boolean; // List brief info only (id, title, status, priority, tags) - JSON format
198
223
  data?: string; // JSON data for create
199
224
  fromQueue?: boolean | string; // Sync statuses from queue (true=active, string=specific queue ID)
225
+ queue?: string; // Target queue ID for multi-queue operations
200
226
  }
201
227
 
202
228
  const ISSUES_DIR = '.workflow/issues';
203
229
 
204
230
  // ============ Storage Layer (JSONL) ============
205
231
 
232
+ /**
233
+ * Normalize path for comparison (handles Windows case sensitivity)
234
+ */
235
+ function normalizePath(p: string): string {
236
+ const normalized = resolve(p);
237
+ // Windows: normalize to lowercase for comparison
238
+ return process.platform === 'win32' ? normalized.toLowerCase() : normalized;
239
+ }
240
+
241
+ /**
242
+ * Try to resolve main repo from .git file (worktree link file)
243
+ * .git file format: "gitdir: /path/to/main/.git/worktrees/name"
244
+ */
245
+ function resolveMainRepoFromGitFile(gitFilePath: string): string | null {
246
+ try {
247
+ const content = readFileSync(gitFilePath, 'utf-8').trim();
248
+ // Parse "gitdir: /path/to/.git/worktrees/name"
249
+ const match = content.match(/^gitdir:\s*(.+)$/);
250
+ if (match) {
251
+ const gitDir = match[1];
252
+ // Navigate from .git/worktrees/name to .git to repo root
253
+ // Pattern: /main/.git/worktrees/wt-name -> /main/.git -> /main
254
+ const worktreesMatch = gitDir.match(/^(.+)[/\\]\.git[/\\]worktrees[/\\]/);
255
+ if (worktreesMatch) {
256
+ return worktreesMatch[1];
257
+ }
258
+ }
259
+ } catch {
260
+ // Failed to read or parse .git file
261
+ }
262
+ return null;
263
+ }
264
+
265
+ /**
266
+ * Get the main repository root, even when running from a worktree.
267
+ * This ensures .workflow/issues/ is always accessed from the main repo.
268
+ */
206
269
  function getProjectRoot(): string {
270
+ // First, try to detect if we're in a git worktree using git commands
271
+ try {
272
+ // Get the common git directory (points to main repo's .git)
273
+ const gitCommonDir = execSync('git rev-parse --git-common-dir', {
274
+ encoding: 'utf-8',
275
+ stdio: ['pipe', 'pipe', 'pipe'],
276
+ timeout: EXEC_TIMEOUTS.GIT_QUICK,
277
+ }).trim();
278
+
279
+ // Get the current git directory
280
+ const gitDir = execSync('git rev-parse --git-dir', {
281
+ encoding: 'utf-8',
282
+ stdio: ['pipe', 'pipe', 'pipe'],
283
+ timeout: EXEC_TIMEOUTS.GIT_QUICK,
284
+ }).trim();
285
+
286
+ // Normalize paths for comparison (Windows case insensitive)
287
+ const normalizedCommon = normalizePath(gitCommonDir);
288
+ const normalizedGit = normalizePath(gitDir);
289
+
290
+ // If gitDir != gitCommonDir, we're in a worktree
291
+ if (normalizedGit !== normalizedCommon && gitDir !== '.git') {
292
+ // We're in a worktree - resolve to main repo
293
+ const absoluteCommonDir = resolve(process.cwd(), gitCommonDir);
294
+ // .git directory's parent is the repo root
295
+ const mainRepoRoot = resolve(absoluteCommonDir, '..');
296
+
297
+ // Verify .workflow or .git exists in main repo
298
+ if (existsSync(join(mainRepoRoot, '.workflow')) || existsSync(join(mainRepoRoot, '.git'))) {
299
+ return mainRepoRoot;
300
+ }
301
+ }
302
+ } catch (err: unknown) {
303
+ if (isExecTimeoutError(err)) {
304
+ console.warn(`[issue] git rev-parse timed out after ${EXEC_TIMEOUTS.GIT_QUICK}ms; falling back to filesystem detection`);
305
+ }
306
+ // Git command failed - fall through to manual detection
307
+ }
308
+
309
+ // Standard detection with worktree file support: walk up to find .workflow or .git
207
310
  let dir = process.cwd();
208
311
  while (dir !== resolve(dir, '..')) {
209
- if (existsSync(join(dir, '.workflow')) || existsSync(join(dir, '.git'))) {
312
+ const gitPath = join(dir, '.git');
313
+
314
+ // Check if .git is a file (worktree link) rather than directory
315
+ if (existsSync(gitPath)) {
316
+ try {
317
+ const gitStat = statSync(gitPath);
318
+ if (gitStat.isFile()) {
319
+ // .git is a file - this is a worktree, try to resolve main repo
320
+ const mainRepo = resolveMainRepoFromGitFile(gitPath);
321
+ if (mainRepo && existsSync(join(mainRepo, '.workflow'))) {
322
+ return mainRepo;
323
+ }
324
+ // If main repo doesn't have .workflow, fall back to current worktree
325
+ }
326
+ } catch {
327
+ // stat failed, continue with normal logic
328
+ }
329
+ }
330
+
331
+ if (existsSync(join(dir, '.workflow')) || existsSync(gitPath)) {
210
332
  return dir;
211
333
  }
212
334
  dir = resolve(dir, '..');
@@ -227,7 +349,7 @@ function ensureIssuesDir(): void {
227
349
 
228
350
  // ============ Issues JSONL ============
229
351
 
230
- function readIssues(): Issue[] {
352
+ export function readIssues(): Issue[] {
231
353
  const path = join(getIssuesDir(), 'issues.jsonl');
232
354
  if (!existsSync(path)) return [];
233
355
  try {
@@ -240,7 +362,7 @@ function readIssues(): Issue[] {
240
362
  }
241
363
  }
242
364
 
243
- function writeIssues(issues: Issue[]): void {
365
+ export function writeIssues(issues: Issue[]): void {
244
366
  ensureIssuesDir();
245
367
  const path = join(getIssuesDir(), 'issues.jsonl');
246
368
  // Always add trailing newline for proper JSONL format
@@ -375,7 +497,7 @@ function getSolutionsPath(issueId: string): string {
375
497
  return join(getIssuesDir(), 'solutions', `${issueId}.jsonl`);
376
498
  }
377
499
 
378
- function readSolutions(issueId: string): Solution[] {
500
+ export function readSolutions(issueId: string): Solution[] {
379
501
  const path = getSolutionsPath(issueId);
380
502
  if (!existsSync(path)) return [];
381
503
  try {
@@ -388,7 +510,7 @@ function readSolutions(issueId: string): Solution[] {
388
510
  }
389
511
  }
390
512
 
391
- function writeSolutions(issueId: string, solutions: Solution[]): void {
513
+ export function writeSolutions(issueId: string, solutions: Solution[]): void {
392
514
  const dir = join(getIssuesDir(), 'solutions');
393
515
  if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
394
516
  // Always add trailing newline for proper JSONL format
@@ -489,7 +611,7 @@ function generateQueueFileId(): string {
489
611
  return `QUE-${ts}`;
490
612
  }
491
613
 
492
- function readQueue(queueId?: string): Queue | null {
614
+ export function readQueue(queueId?: string): Queue | null {
493
615
  const index = readQueueIndex();
494
616
  const targetId = queueId || index.active_queue_id;
495
617
 
@@ -528,7 +650,120 @@ function createEmptyQueue(): Queue {
528
650
  };
529
651
  }
530
652
 
531
- function writeQueue(queue: Queue): void {
653
+ // ============ Multi-Queue Helper Functions ============
654
+
655
+ /**
656
+ * Find which queue contains a given item ID
657
+ * Supports both simple (S-1) and qualified (QUE-xxx:S-1) formats
658
+ */
659
+ function findItemQueue(itemId: string): { queue: Queue; item: QueueItem; itemIndex: number } | null {
660
+ // Check if qualified format (QUE-xxx:S-1)
661
+ const qualifiedMatch = itemId.match(/^(QUE-[^:]+):(.+)$/);
662
+ if (qualifiedMatch) {
663
+ const [, queueId, actualItemId] = qualifiedMatch;
664
+ const queue = readQueue(queueId);
665
+ if (!queue) return null;
666
+ const items = queue.solutions || queue.tasks || [];
667
+ const itemIndex = items.findIndex(i => i.item_id === actualItemId);
668
+ if (itemIndex === -1) return null;
669
+ return { queue, item: items[itemIndex], itemIndex };
670
+ }
671
+
672
+ // Search all queues for unqualified item ID
673
+ const index = readQueueIndex();
674
+ const activeQueueIds = index.active_queue_ids || (index.active_queue_id ? [index.active_queue_id] : []);
675
+
676
+ // Search active queues first
677
+ for (const queueId of activeQueueIds) {
678
+ const queue = readQueue(queueId);
679
+ if (!queue) continue;
680
+ const items = queue.solutions || queue.tasks || [];
681
+ const itemIndex = items.findIndex(i => i.item_id === itemId);
682
+ if (itemIndex >= 0) {
683
+ return { queue, item: items[itemIndex], itemIndex };
684
+ }
685
+ }
686
+
687
+ // Search all other queues
688
+ for (const queueEntry of index.queues) {
689
+ if (activeQueueIds.includes(queueEntry.id)) continue;
690
+ const queue = readQueue(queueEntry.id);
691
+ if (!queue) continue;
692
+ const items = queue.solutions || queue.tasks || [];
693
+ const itemIndex = items.findIndex(i => i.item_id === itemId);
694
+ if (itemIndex >= 0) {
695
+ return { queue, item: items[itemIndex], itemIndex };
696
+ }
697
+ }
698
+
699
+ return null;
700
+ }
701
+
702
+ /**
703
+ * Get all active queues ordered by priority (lower = higher priority)
704
+ * Falls back to creation date order
705
+ */
706
+ function getActiveQueues(): Queue[] {
707
+ const index = readQueueIndex();
708
+ const activeIds = index.active_queue_ids || (index.active_queue_id ? [index.active_queue_id] : []);
709
+
710
+ const queues: Queue[] = [];
711
+ for (const queueId of activeIds) {
712
+ const queue = readQueue(queueId);
713
+ if (queue && queue.status === 'active') {
714
+ queues.push(queue);
715
+ }
716
+ }
717
+
718
+ // Sort by priority field in index (lower = higher priority)
719
+ const priorityMap = new Map<string, number>();
720
+ for (const entry of index.queues) {
721
+ priorityMap.set(entry.id, entry.priority ?? Number.MAX_SAFE_INTEGER);
722
+ }
723
+
724
+ queues.sort((a, b) => {
725
+ const pa = priorityMap.get(a.id) ?? Number.MAX_SAFE_INTEGER;
726
+ const pb = priorityMap.get(b.id) ?? Number.MAX_SAFE_INTEGER;
727
+ if (pa !== pb) return pa - pb;
728
+ // Fall back to creation date (from queue ID)
729
+ return a.id.localeCompare(b.id);
730
+ });
731
+
732
+ return queues;
733
+ }
734
+
735
+ /**
736
+ * Parse failure reason into structured FailureDetail
737
+ * Detects JSON format vs plain string
738
+ */
739
+ function parseFailureReason(reason: string): FailureDetail {
740
+ const timestamp = new Date().toISOString();
741
+
742
+ // Try to parse as JSON first
743
+ if (reason.trim().startsWith('{')) {
744
+ try {
745
+ const parsed = JSON.parse(reason);
746
+ return {
747
+ task_id: parsed.task_id,
748
+ error_type: parsed.error_type || 'unknown',
749
+ message: parsed.message || reason,
750
+ stack_trace: parsed.stack_trace,
751
+ timestamp
752
+ };
753
+ } catch {
754
+ // Not valid JSON, treat as plain message
755
+ }
756
+ }
757
+
758
+ // Plain string message
759
+ return {
760
+ error_type: 'execution_error',
761
+ message: reason,
762
+ timestamp
763
+ };
764
+ }
765
+
766
+ export function writeQueue(queue: Queue): void {
532
767
  ensureQueuesDir();
533
768
 
534
769
  // Support both old (tasks) and new (solutions) queue format
@@ -650,16 +885,16 @@ async function createAction(options: IssueOptions): Promise<void> {
650
885
  }
651
886
 
652
887
  /**
653
- * solution - Create solution from JSON data
654
- * Usage: ccw issue solution <issue-id> --data '{"tasks":[...]}'
655
- * echo '{"tasks":[...]}' | ccw issue solution <issue-id>
656
- * Output: JSON with created solution (includes auto-generated ID)
888
+ * solution - Create or read solutions
889
+ * Create: ccw issue solution <issue-id> --data '{"tasks":[...]}'
890
+ * Read: ccw issue solution <issue-id> [--brief] [--solution-id <id>]
891
+ * Brief: Returns { solution_id, files_touched[], task_count } for each solution
657
892
  */
658
893
  async function solutionAction(issueId: string | undefined, options: IssueOptions): Promise<void> {
659
894
  if (!issueId) {
660
895
  console.error(chalk.red('Issue ID required'));
661
- console.error(chalk.gray('Usage: ccw issue solution <issue-id> --data \'{"tasks":[...]}\''));
662
- console.error(chalk.gray(' echo \'{"tasks":[...]}\' | ccw issue solution <issue-id>'));
896
+ console.error(chalk.gray('Usage: ccw issue solution <issue-id> [--brief] [--solution-id <id>]'));
897
+ console.error(chalk.gray(' ccw issue solution <issue-id> --data \'{"tasks":[...]}\''));
663
898
  process.exit(1);
664
899
  }
665
900
 
@@ -674,21 +909,85 @@ async function solutionAction(issueId: string | undefined, options: IssueOptions
674
909
  }
675
910
  }
676
911
 
677
- if (!jsonData) {
678
- console.error(chalk.red('JSON data required'));
679
- console.error(chalk.gray('Usage: ccw issue solution <issue-id> --data \'{"tasks":[...]}\''));
680
- console.error(chalk.gray(' echo \'{"tasks":[...]}\' | ccw issue solution <issue-id>'));
681
- process.exit(1);
912
+ // CREATE mode: if --data provided
913
+ if (jsonData) {
914
+ try {
915
+ const data = JSON.parse(jsonData);
916
+ const solution = createSolution(issueId, data);
917
+ console.log(JSON.stringify(solution, null, 2));
918
+ } catch (err) {
919
+ console.error(chalk.red((err as Error).message));
920
+ process.exit(1);
921
+ }
922
+ return;
682
923
  }
683
924
 
684
- try {
685
- const data = JSON.parse(jsonData);
686
- const solution = createSolution(issueId, data);
687
- console.log(JSON.stringify(solution, null, 2));
688
- } catch (err) {
689
- console.error(chalk.red((err as Error).message));
925
+ // READ mode: list solutions for issue
926
+ const issue = findIssue(issueId);
927
+ if (!issue) {
928
+ console.error(chalk.red(`Issue "${issueId}" not found`));
690
929
  process.exit(1);
691
930
  }
931
+
932
+ const solutions = readSolutions(issueId);
933
+ if (solutions.length === 0) {
934
+ if (options.json || options.brief) {
935
+ console.log('[]');
936
+ } else {
937
+ console.log(chalk.yellow(`No solutions found for ${issueId}`));
938
+ }
939
+ return;
940
+ }
941
+
942
+ // Filter by solution-id if specified
943
+ let targetSolutions = solutions;
944
+ if (options.solutionId) {
945
+ targetSolutions = solutions.filter(s => s.id === options.solutionId);
946
+ if (targetSolutions.length === 0) {
947
+ console.error(chalk.red(`Solution "${options.solutionId}" not found`));
948
+ process.exit(1);
949
+ }
950
+ }
951
+
952
+ // Brief mode: extract files_touched from modification_points
953
+ if (options.brief) {
954
+ const briefSolutions = targetSolutions.map(sol => {
955
+ const filesTouched = new Set<string>();
956
+ for (const task of sol.tasks) {
957
+ if (task.modification_points) {
958
+ for (const mp of task.modification_points) {
959
+ if (mp.file) filesTouched.add(mp.file);
960
+ }
961
+ }
962
+ }
963
+ return {
964
+ solution_id: sol.id,
965
+ is_bound: sol.is_bound,
966
+ task_count: sol.tasks.length,
967
+ files_touched: Array.from(filesTouched)
968
+ };
969
+ });
970
+ console.log(JSON.stringify(briefSolutions, null, 2));
971
+ return;
972
+ }
973
+
974
+ // JSON mode: full solutions
975
+ if (options.json) {
976
+ console.log(JSON.stringify(targetSolutions, null, 2));
977
+ return;
978
+ }
979
+
980
+ // Human-readable output
981
+ console.log(chalk.bold.cyan(`\nSolutions for ${issueId}:\n`));
982
+ for (const sol of targetSolutions) {
983
+ const marker = sol.is_bound ? chalk.green('◉ BOUND') : chalk.gray('○');
984
+ console.log(`${marker} ${sol.id}`);
985
+ console.log(chalk.gray(` Tasks: ${sol.tasks.length}`));
986
+ if (sol.description) {
987
+ console.log(chalk.gray(` ${sol.description.substring(0, 80)}...`));
988
+ }
989
+ console.log();
990
+ }
692
991
  }
693
992
 
694
993
  /**
@@ -1323,15 +1622,82 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
1323
1622
 
1324
1623
  const index = readQueueIndex();
1325
1624
  index.active_queue_id = queueId;
1625
+ // Also update active_queue_ids for multi-queue support
1626
+ index.active_queue_ids = [queueId];
1326
1627
  writeQueueIndex(index);
1327
1628
 
1328
1629
  console.log(chalk.green(`✓ Switched to queue ${queueId}`));
1329
1630
  return;
1330
1631
  }
1331
1632
 
1633
+ // Set queue priority (lower = higher priority)
1634
+ if (subAction === 'priority' && issueId) {
1635
+ const queueId = issueId;
1636
+ const priority = parseInt(options.priority || '0');
1637
+
1638
+ if (isNaN(priority)) {
1639
+ console.error(chalk.red('Invalid priority value (must be a number)'));
1640
+ process.exit(1);
1641
+ }
1642
+
1643
+ const index = readQueueIndex();
1644
+ const queueEntry = index.queues.find(q => q.id === queueId);
1645
+
1646
+ if (!queueEntry) {
1647
+ console.error(chalk.red(`Queue "${queueId}" not found`));
1648
+ process.exit(1);
1649
+ }
1650
+
1651
+ queueEntry.priority = priority;
1652
+ writeQueueIndex(index);
1653
+
1654
+ console.log(chalk.green(`✓ Queue ${queueId} priority set to ${priority}`));
1655
+ return;
1656
+ }
1657
+
1658
+ // Activate multiple queues at once
1659
+ if (subAction === 'activate' && issueId) {
1660
+ const queueIds = issueId.split(',').map(id => id.trim());
1661
+ const index = readQueueIndex();
1662
+
1663
+ // Validate all queue IDs
1664
+ for (const queueId of queueIds) {
1665
+ if (!index.queues.some(q => q.id === queueId)) {
1666
+ console.error(chalk.red(`Queue "${queueId}" not found`));
1667
+ process.exit(1);
1668
+ }
1669
+ }
1670
+
1671
+ index.active_queue_ids = queueIds;
1672
+ index.active_queue_id = queueIds[0] || null; // Backward compat
1673
+ writeQueueIndex(index);
1674
+
1675
+ console.log(chalk.green(`✓ Activated ${queueIds.length} queue(s): ${queueIds.join(', ')}`));
1676
+ return;
1677
+ }
1678
+
1332
1679
  // DAG - Return dependency graph for parallel execution planning (solution-level)
1333
1680
  if (subAction === 'dag') {
1334
- const queue = readActiveQueue();
1681
+ let queue: Queue;
1682
+
1683
+ // Use explicit queue if provided via --queue or issueId, otherwise use active queue
1684
+ if (options.queue) {
1685
+ const targetQueue = readQueue(options.queue);
1686
+ if (!targetQueue) {
1687
+ console.log(JSON.stringify({ error: `Queue ${options.queue} not found`, nodes: [], edges: [], groups: [] }));
1688
+ return;
1689
+ }
1690
+ queue = targetQueue;
1691
+ } else if (issueId && issueId.startsWith('QUE-')) {
1692
+ const targetQueue = readQueue(issueId);
1693
+ if (!targetQueue) {
1694
+ console.log(JSON.stringify({ error: `Queue ${issueId} not found`, nodes: [], edges: [], groups: [] }));
1695
+ return;
1696
+ }
1697
+ queue = targetQueue;
1698
+ } else {
1699
+ queue = readActiveQueue();
1700
+ }
1335
1701
 
1336
1702
  // Support both old (tasks) and new (solutions) queue format
1337
1703
  const items = queue.solutions || queue.tasks || [];
@@ -1490,6 +1856,20 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
1490
1856
  process.exit(1);
1491
1857
  }
1492
1858
 
1859
+ if (!options.force) {
1860
+ const { proceed } = await inquirer.prompt([{
1861
+ type: 'confirm',
1862
+ name: 'proceed',
1863
+ message: `Delete queue ${queueId}? This action cannot be undone.`,
1864
+ default: false
1865
+ }]);
1866
+
1867
+ if (!proceed) {
1868
+ console.log(chalk.yellow('Queue deletion cancelled'));
1869
+ return;
1870
+ }
1871
+ }
1872
+
1493
1873
  // Remove from index
1494
1874
  const index = readQueueIndex();
1495
1875
  index.queues = index.queues.filter(q => q.id !== queueId);
@@ -1648,12 +2028,26 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
1648
2028
  ? String(item.task_count || 0).padEnd(8)
1649
2029
  : (item.task_id || '-').padEnd(8);
1650
2030
 
1651
- console.log(
1652
- item.item_id.padEnd(10) +
2031
+ let line = item.item_id.padEnd(10) +
1653
2032
  item.issue_id.substring(0, 13).padEnd(15) +
1654
2033
  thirdCol +
1655
- statusColor(item.status)
1656
- );
2034
+ statusColor(item.status);
2035
+
2036
+ // Show failure reason for failed items
2037
+ if (item.status === 'failed') {
2038
+ const reason = item.failure_details?.message || item.failure_reason;
2039
+ if (reason) {
2040
+ // Truncate to 40 chars for display
2041
+ const shortReason = reason.length > 40 ? reason.substring(0, 37) + '...' : reason;
2042
+ line += chalk.gray(` [${shortReason}]`);
2043
+ }
2044
+ // Show retry count if there's failure history
2045
+ if (item.failure_history && item.failure_history.length > 0) {
2046
+ line += chalk.gray(` (${item.failure_history.length} retry)`);
2047
+ }
2048
+ }
2049
+
2050
+ console.log(line);
1657
2051
  }
1658
2052
  }
1659
2053
 
@@ -1662,17 +2056,58 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
1662
2056
  * Accepts optional item_id to fetch a specific task directly
1663
2057
  */
1664
2058
  async function nextAction(itemId: string | undefined, options: IssueOptions): Promise<void> {
1665
- const queue = readActiveQueue();
1666
- // Support both old (tasks) and new (solutions) queue format
1667
- const items = queue.solutions || queue.tasks || [];
1668
- let nextItem: typeof items[0] | undefined;
2059
+ let queue: Queue;
2060
+ let items: QueueItem[];
2061
+
2062
+ // Determine which queue(s) to use
2063
+ if (options.queue) {
2064
+ // Explicit queue specified
2065
+ const targetQueue = readQueue(options.queue);
2066
+ if (!targetQueue) {
2067
+ console.log(JSON.stringify({ status: 'error', message: `Queue ${options.queue} not found` }));
2068
+ return;
2069
+ }
2070
+ queue = targetQueue;
2071
+ items = queue.solutions || queue.tasks || [];
2072
+ } else {
2073
+ // Multi-queue: iterate active queues in priority order (serialized execution)
2074
+ const activeQueues = getActiveQueues();
2075
+
2076
+ if (activeQueues.length === 0) {
2077
+ console.log(JSON.stringify({ status: 'empty', message: 'No active queues' }));
2078
+ return;
2079
+ }
2080
+
2081
+ // Find first queue with incomplete items (serialized: complete Q1 before Q2)
2082
+ let foundQueue: Queue | null = null;
2083
+ for (const q of activeQueues) {
2084
+ const queueItems = q.solutions || q.tasks || [];
2085
+ const hasIncomplete = queueItems.some(i =>
2086
+ i.status === 'pending' || i.status === 'executing'
2087
+ );
2088
+ if (hasIncomplete) {
2089
+ foundQueue = q;
2090
+ break;
2091
+ }
2092
+ }
2093
+
2094
+ if (!foundQueue) {
2095
+ console.log(JSON.stringify({ status: 'empty', message: 'All queues completed' }));
2096
+ return;
2097
+ }
2098
+
2099
+ queue = foundQueue;
2100
+ items = queue.solutions || queue.tasks || [];
2101
+ }
2102
+
2103
+ let nextItem: QueueItem | undefined;
1669
2104
  let isResume = false;
1670
2105
 
1671
2106
  // If specific item_id provided, fetch that item directly
1672
2107
  if (itemId) {
1673
2108
  nextItem = items.find(t => t.item_id === itemId);
1674
2109
  if (!nextItem) {
1675
- console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found` }));
2110
+ console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found in queue ${queue.id}` }));
1676
2111
  return;
1677
2112
  }
1678
2113
  if (nextItem.status === 'completed') {
@@ -1701,6 +2136,7 @@ async function nextAction(itemId: string | undefined, options: IssueOptions): Pr
1701
2136
  console.log(JSON.stringify({
1702
2137
  status: 'empty',
1703
2138
  message: 'No ready items',
2139
+ queue_id: queue.id,
1704
2140
  queue_status: queue._metadata
1705
2141
  }, null, 2));
1706
2142
  return;
@@ -1748,6 +2184,7 @@ async function nextAction(itemId: string | undefined, options: IssueOptions): Pr
1748
2184
  const totalMinutes = solution.tasks?.reduce((sum, t) => sum + (t.estimated_minutes || 30), 0) || 30;
1749
2185
 
1750
2186
  console.log(JSON.stringify({
2187
+ queue_id: queue.id,
1751
2188
  item_id: nextItem.item_id,
1752
2189
  issue_id: nextItem.issue_id,
1753
2190
  solution_id: nextItem.solution_id,
@@ -1783,10 +2220,30 @@ async function detailAction(itemId: string | undefined, options: IssueOptions):
1783
2220
  return;
1784
2221
  }
1785
2222
 
1786
- const queue = readActiveQueue();
1787
- // Support both old (tasks) and new (solutions) queue format
1788
- const items = queue.solutions || queue.tasks || [];
1789
- const queueItem = items.find(t => t.item_id === itemId);
2223
+ let queue: Queue;
2224
+ let queueItem: QueueItem | undefined;
2225
+
2226
+ // Use explicit queue if provided, otherwise auto-detect
2227
+ if (options.queue) {
2228
+ const targetQueue = readQueue(options.queue);
2229
+ if (!targetQueue) {
2230
+ console.log(JSON.stringify({ status: 'error', message: `Queue ${options.queue} not found` }));
2231
+ return;
2232
+ }
2233
+ queue = targetQueue;
2234
+ const items = queue.solutions || queue.tasks || [];
2235
+ queueItem = items.find(t => t.item_id === itemId);
2236
+ } else {
2237
+ // Auto-detect queue from item ID
2238
+ const found = findItemQueue(itemId);
2239
+ if (found) {
2240
+ queue = found.queue;
2241
+ queueItem = found.item;
2242
+ } else {
2243
+ console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found in any queue` }));
2244
+ return;
2245
+ }
2246
+ }
1790
2247
 
1791
2248
  if (!queueItem) {
1792
2249
  console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found` }));
@@ -1806,6 +2263,7 @@ async function detailAction(itemId: string | undefined, options: IssueOptions):
1806
2263
 
1807
2264
  // Return FULL SOLUTION with all tasks (READ-ONLY - no status update)
1808
2265
  console.log(JSON.stringify({
2266
+ queue_id: queue.id,
1809
2267
  item_id: queueItem.item_id,
1810
2268
  issue_id: queueItem.issue_id,
1811
2269
  solution_id: queueItem.solution_id,
@@ -1827,21 +2285,41 @@ async function detailAction(itemId: string | undefined, options: IssueOptions):
1827
2285
  /**
1828
2286
  * done - Mark task completed or failed
1829
2287
  */
1830
- async function doneAction(queueId: string | undefined, options: IssueOptions): Promise<void> {
1831
- if (!queueId) {
2288
+ async function doneAction(queueItemId: string | undefined, options: IssueOptions): Promise<void> {
2289
+ if (!queueItemId) {
1832
2290
  console.error(chalk.red('Item ID is required'));
1833
- console.error(chalk.gray('Usage: ccw issue done <item-id> [--fail] [--reason "..."]'));
2291
+ console.error(chalk.gray('Usage: ccw issue done <item-id> [--fail] [--reason "..."] [--queue <queue-id>]'));
1834
2292
  process.exit(1);
1835
2293
  }
1836
2294
 
1837
- const queue = readActiveQueue();
1838
- // Support both old (tasks) and new (solutions) queue format
1839
- const items = queue.solutions || queue.tasks || [];
1840
- const idx = items.findIndex(q => q.item_id === queueId);
2295
+ let queue: Queue;
2296
+ let items: QueueItem[];
2297
+ let idx: number;
1841
2298
 
1842
- if (idx === -1) {
1843
- console.error(chalk.red(`Queue item "${queueId}" not found`));
1844
- process.exit(1);
2299
+ // Use explicit queue if provided, otherwise auto-detect
2300
+ if (options.queue) {
2301
+ const targetQueue = readQueue(options.queue);
2302
+ if (!targetQueue) {
2303
+ console.error(chalk.red(`Queue "${options.queue}" not found`));
2304
+ process.exit(1);
2305
+ }
2306
+ queue = targetQueue;
2307
+ items = queue.solutions || queue.tasks || [];
2308
+ idx = items.findIndex(q => q.item_id === queueItemId);
2309
+ if (idx === -1) {
2310
+ console.error(chalk.red(`Queue item "${queueItemId}" not found in queue ${options.queue}`));
2311
+ process.exit(1);
2312
+ }
2313
+ } else {
2314
+ // Auto-detect queue from item ID
2315
+ const found = findItemQueue(queueItemId);
2316
+ if (!found) {
2317
+ console.error(chalk.red(`Queue item "${queueItemId}" not found in any queue`));
2318
+ process.exit(1);
2319
+ }
2320
+ queue = found.queue;
2321
+ items = queue.solutions || queue.tasks || [];
2322
+ idx = found.itemIndex;
1845
2323
  }
1846
2324
 
1847
2325
  const isFail = options.fail;
@@ -1849,7 +2327,9 @@ async function doneAction(queueId: string | undefined, options: IssueOptions): P
1849
2327
  items[idx].completed_at = new Date().toISOString();
1850
2328
 
1851
2329
  if (isFail) {
1852
- items[idx].failure_reason = options.reason || 'Unknown failure';
2330
+ const reason = options.reason || 'Unknown failure';
2331
+ items[idx].failure_reason = reason; // Backward compat
2332
+ items[idx].failure_details = parseFailureReason(reason); // Structured failure
1853
2333
  } else if (options.result) {
1854
2334
  try {
1855
2335
  items[idx].result = JSON.parse(options.result);
@@ -1863,10 +2343,10 @@ async function doneAction(queueId: string | undefined, options: IssueOptions): P
1863
2343
 
1864
2344
  if (isFail) {
1865
2345
  updateIssue(issueId, { status: 'failed' });
1866
- console.log(chalk.red(`✗ ${queueId} failed`));
2346
+ console.log(chalk.red(`✗ ${queueItemId} failed`));
1867
2347
  } else {
1868
2348
  updateIssue(issueId, { status: 'completed', completed_at: new Date().toISOString() });
1869
- console.log(chalk.green(`✓ ${queueId} completed`));
2349
+ console.log(chalk.green(`✓ ${queueItemId} completed`));
1870
2350
  console.log(chalk.green(`✓ Issue ${issueId} completed`));
1871
2351
  }
1872
2352
 
@@ -1895,53 +2375,81 @@ async function doneAction(queueId: string | undefined, options: IssueOptions): P
1895
2375
  * retry - Reset failed items to pending for re-execution
1896
2376
  */
1897
2377
  async function retryAction(issueId: string | undefined, options: IssueOptions): Promise<void> {
1898
- const queue = readActiveQueue();
1899
- // Support both old (tasks) and new (solutions) queue format
1900
- const items = queue.solutions || queue.tasks || [];
2378
+ let queues: Queue[];
1901
2379
 
1902
- if (!queue.id || items.length === 0) {
1903
- console.log(chalk.yellow('No active queue'));
2380
+ // Use explicit queue if provided, otherwise use all active queues
2381
+ if (options.queue) {
2382
+ const targetQueue = readQueue(options.queue);
2383
+ if (!targetQueue) {
2384
+ console.log(chalk.red(`Queue "${options.queue}" not found`));
2385
+ return;
2386
+ }
2387
+ queues = [targetQueue];
2388
+ } else {
2389
+ queues = getActiveQueues();
2390
+ }
2391
+
2392
+ if (queues.length === 0) {
2393
+ console.log(chalk.yellow('No active queues'));
1904
2394
  return;
1905
2395
  }
1906
2396
 
1907
- let updated = 0;
2397
+ let totalUpdated = 0;
1908
2398
 
1909
- for (const item of items) {
1910
- // Retry failed items only
1911
- if (item.status === 'failed') {
1912
- if (!issueId || item.issue_id === issueId) {
1913
- item.status = 'pending';
1914
- item.failure_reason = undefined;
1915
- item.started_at = undefined;
1916
- item.completed_at = undefined;
1917
- updated++;
2399
+ for (const queue of queues) {
2400
+ const items = queue.solutions || queue.tasks || [];
2401
+ let queueUpdated = 0;
2402
+
2403
+ for (const item of items) {
2404
+ // Retry failed items only
2405
+ if (item.status === 'failed') {
2406
+ if (!issueId || item.issue_id === issueId) {
2407
+ // Preserve failure history before resetting
2408
+ if (item.failure_details) {
2409
+ if (!item.failure_history) {
2410
+ item.failure_history = [];
2411
+ }
2412
+ item.failure_history.push(item.failure_details);
2413
+ }
2414
+
2415
+ // Reset for retry
2416
+ item.status = 'pending';
2417
+ item.failure_reason = undefined;
2418
+ item.failure_details = undefined;
2419
+ item.started_at = undefined;
2420
+ item.completed_at = undefined;
2421
+ queueUpdated++;
2422
+ }
1918
2423
  }
1919
2424
  }
1920
- }
1921
2425
 
1922
- if (updated === 0) {
1923
- console.log(chalk.yellow('No failed items to retry'));
1924
- return;
1925
- }
2426
+ if (queueUpdated > 0) {
2427
+ // Reset queue status if it was failed
2428
+ if (queue.status === 'failed') {
2429
+ queue.status = 'active';
2430
+ }
1926
2431
 
1927
- // Reset queue status if it was failed
1928
- if (queue.status === 'failed') {
1929
- queue.status = 'active';
2432
+ // Write back to queue
2433
+ if (queue.solutions) {
2434
+ queue.solutions = items;
2435
+ } else {
2436
+ queue.tasks = items;
2437
+ }
2438
+ writeQueue(queue);
2439
+ totalUpdated += queueUpdated;
2440
+ }
1930
2441
  }
1931
2442
 
1932
- // Write back to queue
1933
- if (queue.solutions) {
1934
- queue.solutions = items;
1935
- } else {
1936
- queue.tasks = items;
2443
+ if (totalUpdated === 0) {
2444
+ console.log(chalk.yellow('No failed items to retry'));
2445
+ return;
1937
2446
  }
1938
- writeQueue(queue);
1939
2447
 
1940
2448
  if (issueId) {
1941
2449
  updateIssue(issueId, { status: 'queued' });
1942
2450
  }
1943
2451
 
1944
- console.log(chalk.green(`✓ Reset ${updated} item(s) to pending`));
2452
+ console.log(chalk.green(`✓ Reset ${totalUpdated} item(s) to pending (failure history preserved)`));
1945
2453
  }
1946
2454
 
1947
2455
  // ============ Main Entry ============
@@ -2015,6 +2523,8 @@ export async function issueCommand(
2015
2523
  console.log(chalk.gray(' list [issue-id] List issues or tasks'));
2016
2524
  console.log(chalk.gray(' history List completed issues (from history)'));
2017
2525
  console.log(chalk.gray(' status [issue-id] Show detailed status'));
2526
+ console.log(chalk.gray(' solution <id> List solutions for issue'));
2527
+ console.log(chalk.gray(' solution <id> --brief Brief: solution_id, files_touched, task_count'));
2018
2528
  console.log(chalk.gray(' solution <id> --data \'{...}\' Create solution (auto-generates ID)'));
2019
2529
  console.log(chalk.gray(' bind <issue-id> [sol-id] Bind solution'));
2020
2530
  console.log(chalk.gray(' update <issue-id> --status <s> Update issue status'));
@@ -2025,16 +2535,18 @@ export async function issueCommand(
2025
2535
  console.log(chalk.gray(' queue list List all queues (history)'));
2026
2536
  console.log(chalk.gray(' queue add <issue-id> Add issue to active queue (or create new)'));
2027
2537
  console.log(chalk.gray(' queue switch <queue-id> Switch active queue'));
2028
- console.log(chalk.gray(' queue dag Get dependency graph (JSON) for parallel execution'));
2538
+ console.log(chalk.gray(' queue activate <q1,q2,...> Activate multiple queues (comma-separated)'));
2539
+ console.log(chalk.gray(' queue priority <queue-id> Set queue priority (--priority N, lower=higher)'));
2540
+ console.log(chalk.gray(' queue dag [--queue <id>] Get dependency graph (JSON) for parallel execution'));
2029
2541
  console.log(chalk.gray(' queue archive Archive current queue'));
2030
2542
  console.log(chalk.gray(' queue delete <queue-id> Delete queue from history'));
2031
- console.log(chalk.gray(' retry [issue-id] Retry failed tasks'));
2543
+ console.log(chalk.gray(' retry [issue-id] [--queue <id>] Retry failed tasks'));
2032
2544
  console.log();
2033
2545
  console.log(chalk.bold('Execution Endpoints:'));
2034
- console.log(chalk.gray(' next [item-id] Get & mark task executing (JSON)'));
2035
- console.log(chalk.gray(' detail <item-id> Get task details (READ-ONLY, for parallel)'));
2036
- console.log(chalk.gray(' done <item-id> Mark task completed'));
2037
- console.log(chalk.gray(' done <item-id> --fail Mark task failed'));
2546
+ console.log(chalk.gray(' next [item-id] [--queue <id>] Get & mark task executing (JSON)'));
2547
+ console.log(chalk.gray(' detail <item-id> [--queue <id>] Get task details (READ-ONLY, for parallel)'));
2548
+ console.log(chalk.gray(' done <item-id> [--queue <id>] Mark task completed'));
2549
+ console.log(chalk.gray(' done <item-id> --fail --reason "." Mark task failed with reason (supports JSON)'));
2038
2550
  console.log();
2039
2551
  console.log(chalk.bold('Options:'));
2040
2552
  console.log(chalk.gray(' --title <title> Issue/task title'));
@@ -2042,7 +2554,9 @@ export async function issueCommand(
2042
2554
  console.log(chalk.gray(' --brief Brief JSON output (minimal fields)'));
2043
2555
  console.log(chalk.gray(' --solution <path> Solution JSON file'));
2044
2556
  console.log(chalk.gray(' --result <json> Execution result'));
2045
- console.log(chalk.gray(' --reason <text> Failure reason'));
2557
+ console.log(chalk.gray(' --reason <text> Failure reason (string or JSON)'));
2558
+ console.log(chalk.gray(' --queue <queue-id> Target queue for multi-queue operations'));
2559
+ console.log(chalk.gray(' --priority <n> Queue priority (lower = higher)'));
2046
2560
  console.log(chalk.gray(' --json JSON output'));
2047
2561
  console.log(chalk.gray(' --force Force operation'));
2048
2562
  console.log();