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
@@ -4,8 +4,19 @@
4
4
  * Commands: init, list, status, task, bind, queue, next, done, retry
5
5
  */
6
6
  import chalk from 'chalk';
7
- import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync } from 'fs';
7
+ import { execSync } from 'child_process';
8
+ import inquirer from 'inquirer';
9
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync, statSync } from 'fs';
8
10
  import { join, resolve } from 'path';
11
+ import { EXEC_TIMEOUTS } from '../utils/exec-constants.js';
12
+ function isExecTimeoutError(error) {
13
+ const err = error;
14
+ const code = err?.code ?? err?.errno;
15
+ if (code === 'ETIMEDOUT')
16
+ return true;
17
+ const message = typeof err?.message === 'string' ? err.message : '';
18
+ return message.includes('ETIMEDOUT');
19
+ }
9
20
  // Handle EPIPE errors gracefully
10
21
  process.stdout.on('error', (err) => {
11
22
  if (err.code === 'EPIPE') {
@@ -15,10 +26,100 @@ process.stdout.on('error', (err) => {
15
26
  });
16
27
  const ISSUES_DIR = '.workflow/issues';
17
28
  // ============ Storage Layer (JSONL) ============
29
+ /**
30
+ * Normalize path for comparison (handles Windows case sensitivity)
31
+ */
32
+ function normalizePath(p) {
33
+ const normalized = resolve(p);
34
+ // Windows: normalize to lowercase for comparison
35
+ return process.platform === 'win32' ? normalized.toLowerCase() : normalized;
36
+ }
37
+ /**
38
+ * Try to resolve main repo from .git file (worktree link file)
39
+ * .git file format: "gitdir: /path/to/main/.git/worktrees/name"
40
+ */
41
+ function resolveMainRepoFromGitFile(gitFilePath) {
42
+ try {
43
+ const content = readFileSync(gitFilePath, 'utf-8').trim();
44
+ // Parse "gitdir: /path/to/.git/worktrees/name"
45
+ const match = content.match(/^gitdir:\s*(.+)$/);
46
+ if (match) {
47
+ const gitDir = match[1];
48
+ // Navigate from .git/worktrees/name to .git to repo root
49
+ // Pattern: /main/.git/worktrees/wt-name -> /main/.git -> /main
50
+ const worktreesMatch = gitDir.match(/^(.+)[/\\]\.git[/\\]worktrees[/\\]/);
51
+ if (worktreesMatch) {
52
+ return worktreesMatch[1];
53
+ }
54
+ }
55
+ }
56
+ catch {
57
+ // Failed to read or parse .git file
58
+ }
59
+ return null;
60
+ }
61
+ /**
62
+ * Get the main repository root, even when running from a worktree.
63
+ * This ensures .workflow/issues/ is always accessed from the main repo.
64
+ */
18
65
  function getProjectRoot() {
66
+ // First, try to detect if we're in a git worktree using git commands
67
+ try {
68
+ // Get the common git directory (points to main repo's .git)
69
+ const gitCommonDir = execSync('git rev-parse --git-common-dir', {
70
+ encoding: 'utf-8',
71
+ stdio: ['pipe', 'pipe', 'pipe'],
72
+ timeout: EXEC_TIMEOUTS.GIT_QUICK,
73
+ }).trim();
74
+ // Get the current git directory
75
+ const gitDir = execSync('git rev-parse --git-dir', {
76
+ encoding: 'utf-8',
77
+ stdio: ['pipe', 'pipe', 'pipe'],
78
+ timeout: EXEC_TIMEOUTS.GIT_QUICK,
79
+ }).trim();
80
+ // Normalize paths for comparison (Windows case insensitive)
81
+ const normalizedCommon = normalizePath(gitCommonDir);
82
+ const normalizedGit = normalizePath(gitDir);
83
+ // If gitDir != gitCommonDir, we're in a worktree
84
+ if (normalizedGit !== normalizedCommon && gitDir !== '.git') {
85
+ // We're in a worktree - resolve to main repo
86
+ const absoluteCommonDir = resolve(process.cwd(), gitCommonDir);
87
+ // .git directory's parent is the repo root
88
+ const mainRepoRoot = resolve(absoluteCommonDir, '..');
89
+ // Verify .workflow or .git exists in main repo
90
+ if (existsSync(join(mainRepoRoot, '.workflow')) || existsSync(join(mainRepoRoot, '.git'))) {
91
+ return mainRepoRoot;
92
+ }
93
+ }
94
+ }
95
+ catch (err) {
96
+ if (isExecTimeoutError(err)) {
97
+ console.warn(`[issue] git rev-parse timed out after ${EXEC_TIMEOUTS.GIT_QUICK}ms; falling back to filesystem detection`);
98
+ }
99
+ // Git command failed - fall through to manual detection
100
+ }
101
+ // Standard detection with worktree file support: walk up to find .workflow or .git
19
102
  let dir = process.cwd();
20
103
  while (dir !== resolve(dir, '..')) {
21
- if (existsSync(join(dir, '.workflow')) || existsSync(join(dir, '.git'))) {
104
+ const gitPath = join(dir, '.git');
105
+ // Check if .git is a file (worktree link) rather than directory
106
+ if (existsSync(gitPath)) {
107
+ try {
108
+ const gitStat = statSync(gitPath);
109
+ if (gitStat.isFile()) {
110
+ // .git is a file - this is a worktree, try to resolve main repo
111
+ const mainRepo = resolveMainRepoFromGitFile(gitPath);
112
+ if (mainRepo && existsSync(join(mainRepo, '.workflow'))) {
113
+ return mainRepo;
114
+ }
115
+ // If main repo doesn't have .workflow, fall back to current worktree
116
+ }
117
+ }
118
+ catch {
119
+ // stat failed, continue with normal logic
120
+ }
121
+ }
122
+ if (existsSync(join(dir, '.workflow')) || existsSync(gitPath)) {
22
123
  return dir;
23
124
  }
24
125
  dir = resolve(dir, '..');
@@ -35,7 +136,7 @@ function ensureIssuesDir() {
35
136
  }
36
137
  }
37
138
  // ============ Issues JSONL ============
38
- function readIssues() {
139
+ export function readIssues() {
39
140
  const path = join(getIssuesDir(), 'issues.jsonl');
40
141
  if (!existsSync(path))
41
142
  return [];
@@ -49,7 +150,7 @@ function readIssues() {
49
150
  return [];
50
151
  }
51
152
  }
52
- function writeIssues(issues) {
153
+ export function writeIssues(issues) {
53
154
  ensureIssuesDir();
54
155
  const path = join(getIssuesDir(), 'issues.jsonl');
55
156
  // Always add trailing newline for proper JSONL format
@@ -171,7 +272,7 @@ function createIssue(data) {
171
272
  function getSolutionsPath(issueId) {
172
273
  return join(getIssuesDir(), 'solutions', `${issueId}.jsonl`);
173
274
  }
174
- function readSolutions(issueId) {
275
+ export function readSolutions(issueId) {
175
276
  const path = getSolutionsPath(issueId);
176
277
  if (!existsSync(path))
177
278
  return [];
@@ -185,7 +286,7 @@ function readSolutions(issueId) {
185
286
  return [];
186
287
  }
187
288
  }
188
- function writeSolutions(issueId, solutions) {
289
+ export function writeSolutions(issueId, solutions) {
189
290
  const dir = join(getIssuesDir(), 'solutions');
190
291
  if (!existsSync(dir))
191
292
  mkdirSync(dir, { recursive: true });
@@ -272,7 +373,7 @@ function generateQueueFileId() {
272
373
  const ts = now.toISOString().replace(/[-:T]/g, '').slice(0, 14);
273
374
  return `QUE-${ts}`;
274
375
  }
275
- function readQueue(queueId) {
376
+ export function readQueue(queueId) {
276
377
  const index = readQueueIndex();
277
378
  const targetId = queueId || index.active_queue_id;
278
379
  if (!targetId)
@@ -307,7 +408,113 @@ function createEmptyQueue() {
307
408
  }
308
409
  };
309
410
  }
310
- function writeQueue(queue) {
411
+ // ============ Multi-Queue Helper Functions ============
412
+ /**
413
+ * Find which queue contains a given item ID
414
+ * Supports both simple (S-1) and qualified (QUE-xxx:S-1) formats
415
+ */
416
+ function findItemQueue(itemId) {
417
+ // Check if qualified format (QUE-xxx:S-1)
418
+ const qualifiedMatch = itemId.match(/^(QUE-[^:]+):(.+)$/);
419
+ if (qualifiedMatch) {
420
+ const [, queueId, actualItemId] = qualifiedMatch;
421
+ const queue = readQueue(queueId);
422
+ if (!queue)
423
+ return null;
424
+ const items = queue.solutions || queue.tasks || [];
425
+ const itemIndex = items.findIndex(i => i.item_id === actualItemId);
426
+ if (itemIndex === -1)
427
+ return null;
428
+ return { queue, item: items[itemIndex], itemIndex };
429
+ }
430
+ // Search all queues for unqualified item ID
431
+ const index = readQueueIndex();
432
+ const activeQueueIds = index.active_queue_ids || (index.active_queue_id ? [index.active_queue_id] : []);
433
+ // Search active queues first
434
+ for (const queueId of activeQueueIds) {
435
+ const queue = readQueue(queueId);
436
+ if (!queue)
437
+ continue;
438
+ const items = queue.solutions || queue.tasks || [];
439
+ const itemIndex = items.findIndex(i => i.item_id === itemId);
440
+ if (itemIndex >= 0) {
441
+ return { queue, item: items[itemIndex], itemIndex };
442
+ }
443
+ }
444
+ // Search all other queues
445
+ for (const queueEntry of index.queues) {
446
+ if (activeQueueIds.includes(queueEntry.id))
447
+ continue;
448
+ const queue = readQueue(queueEntry.id);
449
+ if (!queue)
450
+ continue;
451
+ const items = queue.solutions || queue.tasks || [];
452
+ const itemIndex = items.findIndex(i => i.item_id === itemId);
453
+ if (itemIndex >= 0) {
454
+ return { queue, item: items[itemIndex], itemIndex };
455
+ }
456
+ }
457
+ return null;
458
+ }
459
+ /**
460
+ * Get all active queues ordered by priority (lower = higher priority)
461
+ * Falls back to creation date order
462
+ */
463
+ function getActiveQueues() {
464
+ const index = readQueueIndex();
465
+ const activeIds = index.active_queue_ids || (index.active_queue_id ? [index.active_queue_id] : []);
466
+ const queues = [];
467
+ for (const queueId of activeIds) {
468
+ const queue = readQueue(queueId);
469
+ if (queue && queue.status === 'active') {
470
+ queues.push(queue);
471
+ }
472
+ }
473
+ // Sort by priority field in index (lower = higher priority)
474
+ const priorityMap = new Map();
475
+ for (const entry of index.queues) {
476
+ priorityMap.set(entry.id, entry.priority ?? Number.MAX_SAFE_INTEGER);
477
+ }
478
+ queues.sort((a, b) => {
479
+ const pa = priorityMap.get(a.id) ?? Number.MAX_SAFE_INTEGER;
480
+ const pb = priorityMap.get(b.id) ?? Number.MAX_SAFE_INTEGER;
481
+ if (pa !== pb)
482
+ return pa - pb;
483
+ // Fall back to creation date (from queue ID)
484
+ return a.id.localeCompare(b.id);
485
+ });
486
+ return queues;
487
+ }
488
+ /**
489
+ * Parse failure reason into structured FailureDetail
490
+ * Detects JSON format vs plain string
491
+ */
492
+ function parseFailureReason(reason) {
493
+ const timestamp = new Date().toISOString();
494
+ // Try to parse as JSON first
495
+ if (reason.trim().startsWith('{')) {
496
+ try {
497
+ const parsed = JSON.parse(reason);
498
+ return {
499
+ task_id: parsed.task_id,
500
+ error_type: parsed.error_type || 'unknown',
501
+ message: parsed.message || reason,
502
+ stack_trace: parsed.stack_trace,
503
+ timestamp
504
+ };
505
+ }
506
+ catch {
507
+ // Not valid JSON, treat as plain message
508
+ }
509
+ }
510
+ // Plain string message
511
+ return {
512
+ error_type: 'execution_error',
513
+ message: reason,
514
+ timestamp
515
+ };
516
+ }
517
+ export function writeQueue(queue) {
311
518
  ensureQueuesDir();
312
519
  // Support both old (tasks) and new (solutions) queue format
313
520
  const items = queue.solutions || queue.tasks || [];
@@ -414,16 +621,16 @@ async function createAction(options) {
414
621
  }
415
622
  }
416
623
  /**
417
- * solution - Create solution from JSON data
418
- * Usage: ccw issue solution <issue-id> --data '{"tasks":[...]}'
419
- * echo '{"tasks":[...]}' | ccw issue solution <issue-id>
420
- * Output: JSON with created solution (includes auto-generated ID)
624
+ * solution - Create or read solutions
625
+ * Create: ccw issue solution <issue-id> --data '{"tasks":[...]}'
626
+ * Read: ccw issue solution <issue-id> [--brief] [--solution-id <id>]
627
+ * Brief: Returns { solution_id, files_touched[], task_count } for each solution
421
628
  */
422
629
  async function solutionAction(issueId, options) {
423
630
  if (!issueId) {
424
631
  console.error(chalk.red('Issue ID required'));
425
- console.error(chalk.gray('Usage: ccw issue solution <issue-id> --data \'{"tasks":[...]}\''));
426
- console.error(chalk.gray(' echo \'{"tasks":[...]}\' | ccw issue solution <issue-id>'));
632
+ console.error(chalk.gray('Usage: ccw issue solution <issue-id> [--brief] [--solution-id <id>]'));
633
+ console.error(chalk.gray(' ccw issue solution <issue-id> --data \'{"tasks":[...]}\''));
427
634
  process.exit(1);
428
635
  }
429
636
  let jsonData = options.data;
@@ -436,20 +643,81 @@ async function solutionAction(issueId, options) {
436
643
  // stdin not available or empty
437
644
  }
438
645
  }
439
- if (!jsonData) {
440
- console.error(chalk.red('JSON data required'));
441
- console.error(chalk.gray('Usage: ccw issue solution <issue-id> --data \'{"tasks":[...]}\''));
442
- console.error(chalk.gray(' echo \'{"tasks":[...]}\' | ccw issue solution <issue-id>'));
646
+ // CREATE mode: if --data provided
647
+ if (jsonData) {
648
+ try {
649
+ const data = JSON.parse(jsonData);
650
+ const solution = createSolution(issueId, data);
651
+ console.log(JSON.stringify(solution, null, 2));
652
+ }
653
+ catch (err) {
654
+ console.error(chalk.red(err.message));
655
+ process.exit(1);
656
+ }
657
+ return;
658
+ }
659
+ // READ mode: list solutions for issue
660
+ const issue = findIssue(issueId);
661
+ if (!issue) {
662
+ console.error(chalk.red(`Issue "${issueId}" not found`));
443
663
  process.exit(1);
444
664
  }
445
- try {
446
- const data = JSON.parse(jsonData);
447
- const solution = createSolution(issueId, data);
448
- console.log(JSON.stringify(solution, null, 2));
665
+ const solutions = readSolutions(issueId);
666
+ if (solutions.length === 0) {
667
+ if (options.json || options.brief) {
668
+ console.log('[]');
669
+ }
670
+ else {
671
+ console.log(chalk.yellow(`No solutions found for ${issueId}`));
672
+ }
673
+ return;
449
674
  }
450
- catch (err) {
451
- console.error(chalk.red(err.message));
452
- process.exit(1);
675
+ // Filter by solution-id if specified
676
+ let targetSolutions = solutions;
677
+ if (options.solutionId) {
678
+ targetSolutions = solutions.filter(s => s.id === options.solutionId);
679
+ if (targetSolutions.length === 0) {
680
+ console.error(chalk.red(`Solution "${options.solutionId}" not found`));
681
+ process.exit(1);
682
+ }
683
+ }
684
+ // Brief mode: extract files_touched from modification_points
685
+ if (options.brief) {
686
+ const briefSolutions = targetSolutions.map(sol => {
687
+ const filesTouched = new Set();
688
+ for (const task of sol.tasks) {
689
+ if (task.modification_points) {
690
+ for (const mp of task.modification_points) {
691
+ if (mp.file)
692
+ filesTouched.add(mp.file);
693
+ }
694
+ }
695
+ }
696
+ return {
697
+ solution_id: sol.id,
698
+ is_bound: sol.is_bound,
699
+ task_count: sol.tasks.length,
700
+ files_touched: Array.from(filesTouched)
701
+ };
702
+ });
703
+ console.log(JSON.stringify(briefSolutions, null, 2));
704
+ return;
705
+ }
706
+ // JSON mode: full solutions
707
+ if (options.json) {
708
+ console.log(JSON.stringify(targetSolutions, null, 2));
709
+ return;
710
+ }
711
+ // Human-readable output
712
+ console.log(chalk.bold.cyan(`\nSolutions for ${issueId}:\n`));
713
+ for (const sol of targetSolutions) {
714
+ const marker = sol.is_bound ? chalk.green('◉ BOUND') : chalk.gray('○');
715
+ console.log(`${marker} ${sol.id}`);
716
+ console.log(chalk.gray(` Tasks: ${sol.tasks.length}`));
717
+ if (sol.description) {
718
+ console.log(chalk.gray(` ${sol.description.substring(0, 80)}...`));
719
+ }
720
+ console.log();
453
721
  }
454
722
  }
455
723
  /**
@@ -1001,13 +1269,71 @@ async function queueAction(subAction, issueId, options) {
1001
1269
  }
1002
1270
  const index = readQueueIndex();
1003
1271
  index.active_queue_id = queueId;
1272
+ // Also update active_queue_ids for multi-queue support
1273
+ index.active_queue_ids = [queueId];
1004
1274
  writeQueueIndex(index);
1005
1275
  console.log(chalk.green(`✓ Switched to queue ${queueId}`));
1006
1276
  return;
1007
1277
  }
1278
+ // Set queue priority (lower = higher priority)
1279
+ if (subAction === 'priority' && issueId) {
1280
+ const queueId = issueId;
1281
+ const priority = parseInt(options.priority || '0');
1282
+ if (isNaN(priority)) {
1283
+ console.error(chalk.red('Invalid priority value (must be a number)'));
1284
+ process.exit(1);
1285
+ }
1286
+ const index = readQueueIndex();
1287
+ const queueEntry = index.queues.find(q => q.id === queueId);
1288
+ if (!queueEntry) {
1289
+ console.error(chalk.red(`Queue "${queueId}" not found`));
1290
+ process.exit(1);
1291
+ }
1292
+ queueEntry.priority = priority;
1293
+ writeQueueIndex(index);
1294
+ console.log(chalk.green(`✓ Queue ${queueId} priority set to ${priority}`));
1295
+ return;
1296
+ }
1297
+ // Activate multiple queues at once
1298
+ if (subAction === 'activate' && issueId) {
1299
+ const queueIds = issueId.split(',').map(id => id.trim());
1300
+ const index = readQueueIndex();
1301
+ // Validate all queue IDs
1302
+ for (const queueId of queueIds) {
1303
+ if (!index.queues.some(q => q.id === queueId)) {
1304
+ console.error(chalk.red(`Queue "${queueId}" not found`));
1305
+ process.exit(1);
1306
+ }
1307
+ }
1308
+ index.active_queue_ids = queueIds;
1309
+ index.active_queue_id = queueIds[0] || null; // Backward compat
1310
+ writeQueueIndex(index);
1311
+ console.log(chalk.green(`✓ Activated ${queueIds.length} queue(s): ${queueIds.join(', ')}`));
1312
+ return;
1313
+ }
1008
1314
  // DAG - Return dependency graph for parallel execution planning (solution-level)
1009
1315
  if (subAction === 'dag') {
1010
- const queue = readActiveQueue();
1316
+ let queue;
1317
+ // Use explicit queue if provided via --queue or issueId, otherwise use active queue
1318
+ if (options.queue) {
1319
+ const targetQueue = readQueue(options.queue);
1320
+ if (!targetQueue) {
1321
+ console.log(JSON.stringify({ error: `Queue ${options.queue} not found`, nodes: [], edges: [], groups: [] }));
1322
+ return;
1323
+ }
1324
+ queue = targetQueue;
1325
+ }
1326
+ else if (issueId && issueId.startsWith('QUE-')) {
1327
+ const targetQueue = readQueue(issueId);
1328
+ if (!targetQueue) {
1329
+ console.log(JSON.stringify({ error: `Queue ${issueId} not found`, nodes: [], edges: [], groups: [] }));
1330
+ return;
1331
+ }
1332
+ queue = targetQueue;
1333
+ }
1334
+ else {
1335
+ queue = readActiveQueue();
1336
+ }
1011
1337
  // Support both old (tasks) and new (solutions) queue format
1012
1338
  const items = queue.solutions || queue.tasks || [];
1013
1339
  if (!queue.id || items.length === 0) {
@@ -1144,6 +1470,18 @@ async function queueAction(subAction, issueId, options) {
1144
1470
  console.error(chalk.red(`Queue "${queueId}" not found`));
1145
1471
  process.exit(1);
1146
1472
  }
1473
+ if (!options.force) {
1474
+ const { proceed } = await inquirer.prompt([{
1475
+ type: 'confirm',
1476
+ name: 'proceed',
1477
+ message: `Delete queue ${queueId}? This action cannot be undone.`,
1478
+ default: false
1479
+ }]);
1480
+ if (!proceed) {
1481
+ console.log(chalk.yellow('Queue deletion cancelled'));
1482
+ return;
1483
+ }
1484
+ }
1147
1485
  // Remove from index
1148
1486
  const index = readQueueIndex();
1149
1487
  index.queues = index.queues.filter(q => q.id !== queueId);
@@ -1279,10 +1617,24 @@ async function queueAction(subAction, issueId, options) {
1279
1617
  const thirdCol = isSolutionLevel
1280
1618
  ? String(item.task_count || 0).padEnd(8)
1281
1619
  : (item.task_id || '-').padEnd(8);
1282
- console.log(item.item_id.padEnd(10) +
1620
+ let line = item.item_id.padEnd(10) +
1283
1621
  item.issue_id.substring(0, 13).padEnd(15) +
1284
1622
  thirdCol +
1285
- statusColor(item.status));
1623
+ statusColor(item.status);
1624
+ // Show failure reason for failed items
1625
+ if (item.status === 'failed') {
1626
+ const reason = item.failure_details?.message || item.failure_reason;
1627
+ if (reason) {
1628
+ // Truncate to 40 chars for display
1629
+ const shortReason = reason.length > 40 ? reason.substring(0, 37) + '...' : reason;
1630
+ line += chalk.gray(` [${shortReason}]`);
1631
+ }
1632
+ // Show retry count if there's failure history
1633
+ if (item.failure_history && item.failure_history.length > 0) {
1634
+ line += chalk.gray(` (${item.failure_history.length} retry)`);
1635
+ }
1636
+ }
1637
+ console.log(line);
1286
1638
  }
1287
1639
  }
1288
1640
  /**
@@ -1290,16 +1642,50 @@ async function queueAction(subAction, issueId, options) {
1290
1642
  * Accepts optional item_id to fetch a specific task directly
1291
1643
  */
1292
1644
  async function nextAction(itemId, options) {
1293
- const queue = readActiveQueue();
1294
- // Support both old (tasks) and new (solutions) queue format
1295
- const items = queue.solutions || queue.tasks || [];
1645
+ let queue;
1646
+ let items;
1647
+ // Determine which queue(s) to use
1648
+ if (options.queue) {
1649
+ // Explicit queue specified
1650
+ const targetQueue = readQueue(options.queue);
1651
+ if (!targetQueue) {
1652
+ console.log(JSON.stringify({ status: 'error', message: `Queue ${options.queue} not found` }));
1653
+ return;
1654
+ }
1655
+ queue = targetQueue;
1656
+ items = queue.solutions || queue.tasks || [];
1657
+ }
1658
+ else {
1659
+ // Multi-queue: iterate active queues in priority order (serialized execution)
1660
+ const activeQueues = getActiveQueues();
1661
+ if (activeQueues.length === 0) {
1662
+ console.log(JSON.stringify({ status: 'empty', message: 'No active queues' }));
1663
+ return;
1664
+ }
1665
+ // Find first queue with incomplete items (serialized: complete Q1 before Q2)
1666
+ let foundQueue = null;
1667
+ for (const q of activeQueues) {
1668
+ const queueItems = q.solutions || q.tasks || [];
1669
+ const hasIncomplete = queueItems.some(i => i.status === 'pending' || i.status === 'executing');
1670
+ if (hasIncomplete) {
1671
+ foundQueue = q;
1672
+ break;
1673
+ }
1674
+ }
1675
+ if (!foundQueue) {
1676
+ console.log(JSON.stringify({ status: 'empty', message: 'All queues completed' }));
1677
+ return;
1678
+ }
1679
+ queue = foundQueue;
1680
+ items = queue.solutions || queue.tasks || [];
1681
+ }
1296
1682
  let nextItem;
1297
1683
  let isResume = false;
1298
1684
  // If specific item_id provided, fetch that item directly
1299
1685
  if (itemId) {
1300
1686
  nextItem = items.find(t => t.item_id === itemId);
1301
1687
  if (!nextItem) {
1302
- console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found` }));
1688
+ console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found in queue ${queue.id}` }));
1303
1689
  return;
1304
1690
  }
1305
1691
  if (nextItem.status === 'completed') {
@@ -1328,6 +1714,7 @@ async function nextAction(itemId, options) {
1328
1714
  console.log(JSON.stringify({
1329
1715
  status: 'empty',
1330
1716
  message: 'No ready items',
1717
+ queue_id: queue.id,
1331
1718
  queue_status: queue._metadata
1332
1719
  }, null, 2));
1333
1720
  return;
@@ -1369,6 +1756,7 @@ async function nextAction(itemId, options) {
1369
1756
  // Calculate total estimated time for all tasks
1370
1757
  const totalMinutes = solution.tasks?.reduce((sum, t) => sum + (t.estimated_minutes || 30), 0) || 30;
1371
1758
  console.log(JSON.stringify({
1759
+ queue_id: queue.id,
1372
1760
  item_id: nextItem.item_id,
1373
1761
  issue_id: nextItem.issue_id,
1374
1762
  solution_id: nextItem.solution_id,
@@ -1402,10 +1790,31 @@ async function detailAction(itemId, options) {
1402
1790
  console.log(JSON.stringify({ status: 'error', message: 'item_id is required' }));
1403
1791
  return;
1404
1792
  }
1405
- const queue = readActiveQueue();
1406
- // Support both old (tasks) and new (solutions) queue format
1407
- const items = queue.solutions || queue.tasks || [];
1408
- const queueItem = items.find(t => t.item_id === itemId);
1793
+ let queue;
1794
+ let queueItem;
1795
+ // Use explicit queue if provided, otherwise auto-detect
1796
+ if (options.queue) {
1797
+ const targetQueue = readQueue(options.queue);
1798
+ if (!targetQueue) {
1799
+ console.log(JSON.stringify({ status: 'error', message: `Queue ${options.queue} not found` }));
1800
+ return;
1801
+ }
1802
+ queue = targetQueue;
1803
+ const items = queue.solutions || queue.tasks || [];
1804
+ queueItem = items.find(t => t.item_id === itemId);
1805
+ }
1806
+ else {
1807
+ // Auto-detect queue from item ID
1808
+ const found = findItemQueue(itemId);
1809
+ if (found) {
1810
+ queue = found.queue;
1811
+ queueItem = found.item;
1812
+ }
1813
+ else {
1814
+ console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found in any queue` }));
1815
+ return;
1816
+ }
1817
+ }
1409
1818
  if (!queueItem) {
1410
1819
  console.log(JSON.stringify({ status: 'error', message: `Item ${itemId} not found` }));
1411
1820
  return;
@@ -1420,6 +1829,7 @@ async function detailAction(itemId, options) {
1420
1829
  const totalMinutes = solution.tasks?.reduce((sum, t) => sum + (t.estimated_minutes || 30), 0) || 30;
1421
1830
  // Return FULL SOLUTION with all tasks (READ-ONLY - no status update)
1422
1831
  console.log(JSON.stringify({
1832
+ queue_id: queue.id,
1423
1833
  item_id: queueItem.item_id,
1424
1834
  issue_id: queueItem.issue_id,
1425
1835
  solution_id: queueItem.solution_id,
@@ -1440,25 +1850,48 @@ async function detailAction(itemId, options) {
1440
1850
  /**
1441
1851
  * done - Mark task completed or failed
1442
1852
  */
1443
- async function doneAction(queueId, options) {
1444
- if (!queueId) {
1853
+ async function doneAction(queueItemId, options) {
1854
+ if (!queueItemId) {
1445
1855
  console.error(chalk.red('Item ID is required'));
1446
- console.error(chalk.gray('Usage: ccw issue done <item-id> [--fail] [--reason "..."]'));
1856
+ console.error(chalk.gray('Usage: ccw issue done <item-id> [--fail] [--reason "..."] [--queue <queue-id>]'));
1447
1857
  process.exit(1);
1448
1858
  }
1449
- const queue = readActiveQueue();
1450
- // Support both old (tasks) and new (solutions) queue format
1451
- const items = queue.solutions || queue.tasks || [];
1452
- const idx = items.findIndex(q => q.item_id === queueId);
1453
- if (idx === -1) {
1454
- console.error(chalk.red(`Queue item "${queueId}" not found`));
1455
- process.exit(1);
1859
+ let queue;
1860
+ let items;
1861
+ let idx;
1862
+ // Use explicit queue if provided, otherwise auto-detect
1863
+ if (options.queue) {
1864
+ const targetQueue = readQueue(options.queue);
1865
+ if (!targetQueue) {
1866
+ console.error(chalk.red(`Queue "${options.queue}" not found`));
1867
+ process.exit(1);
1868
+ }
1869
+ queue = targetQueue;
1870
+ items = queue.solutions || queue.tasks || [];
1871
+ idx = items.findIndex(q => q.item_id === queueItemId);
1872
+ if (idx === -1) {
1873
+ console.error(chalk.red(`Queue item "${queueItemId}" not found in queue ${options.queue}`));
1874
+ process.exit(1);
1875
+ }
1876
+ }
1877
+ else {
1878
+ // Auto-detect queue from item ID
1879
+ const found = findItemQueue(queueItemId);
1880
+ if (!found) {
1881
+ console.error(chalk.red(`Queue item "${queueItemId}" not found in any queue`));
1882
+ process.exit(1);
1883
+ }
1884
+ queue = found.queue;
1885
+ items = queue.solutions || queue.tasks || [];
1886
+ idx = found.itemIndex;
1456
1887
  }
1457
1888
  const isFail = options.fail;
1458
1889
  items[idx].status = isFail ? 'failed' : 'completed';
1459
1890
  items[idx].completed_at = new Date().toISOString();
1460
1891
  if (isFail) {
1461
- items[idx].failure_reason = options.reason || 'Unknown failure';
1892
+ const reason = options.reason || 'Unknown failure';
1893
+ items[idx].failure_reason = reason; // Backward compat
1894
+ items[idx].failure_details = parseFailureReason(reason); // Structured failure
1462
1895
  }
1463
1896
  else if (options.result) {
1464
1897
  try {
@@ -1472,11 +1905,11 @@ async function doneAction(queueId, options) {
1472
1905
  const issueId = items[idx].issue_id;
1473
1906
  if (isFail) {
1474
1907
  updateIssue(issueId, { status: 'failed' });
1475
- console.log(chalk.red(`✗ ${queueId} failed`));
1908
+ console.log(chalk.red(`✗ ${queueItemId} failed`));
1476
1909
  }
1477
1910
  else {
1478
1911
  updateIssue(issueId, { status: 'completed', completed_at: new Date().toISOString() });
1479
- console.log(chalk.green(`✓ ${queueId} completed`));
1912
+ console.log(chalk.green(`✓ ${queueItemId} completed`));
1480
1913
  console.log(chalk.green(`✓ Issue ${issueId} completed`));
1481
1914
  }
1482
1915
  // Check if entire queue is complete
@@ -1503,46 +1936,72 @@ async function doneAction(queueId, options) {
1503
1936
  * retry - Reset failed items to pending for re-execution
1504
1937
  */
1505
1938
  async function retryAction(issueId, options) {
1506
- const queue = readActiveQueue();
1507
- // Support both old (tasks) and new (solutions) queue format
1508
- const items = queue.solutions || queue.tasks || [];
1509
- if (!queue.id || items.length === 0) {
1510
- console.log(chalk.yellow('No active queue'));
1939
+ let queues;
1940
+ // Use explicit queue if provided, otherwise use all active queues
1941
+ if (options.queue) {
1942
+ const targetQueue = readQueue(options.queue);
1943
+ if (!targetQueue) {
1944
+ console.log(chalk.red(`Queue "${options.queue}" not found`));
1945
+ return;
1946
+ }
1947
+ queues = [targetQueue];
1948
+ }
1949
+ else {
1950
+ queues = getActiveQueues();
1951
+ }
1952
+ if (queues.length === 0) {
1953
+ console.log(chalk.yellow('No active queues'));
1511
1954
  return;
1512
1955
  }
1513
- let updated = 0;
1514
- for (const item of items) {
1515
- // Retry failed items only
1516
- if (item.status === 'failed') {
1517
- if (!issueId || item.issue_id === issueId) {
1518
- item.status = 'pending';
1519
- item.failure_reason = undefined;
1520
- item.started_at = undefined;
1521
- item.completed_at = undefined;
1522
- updated++;
1956
+ let totalUpdated = 0;
1957
+ for (const queue of queues) {
1958
+ const items = queue.solutions || queue.tasks || [];
1959
+ let queueUpdated = 0;
1960
+ for (const item of items) {
1961
+ // Retry failed items only
1962
+ if (item.status === 'failed') {
1963
+ if (!issueId || item.issue_id === issueId) {
1964
+ // Preserve failure history before resetting
1965
+ if (item.failure_details) {
1966
+ if (!item.failure_history) {
1967
+ item.failure_history = [];
1968
+ }
1969
+ item.failure_history.push(item.failure_details);
1970
+ }
1971
+ // Reset for retry
1972
+ item.status = 'pending';
1973
+ item.failure_reason = undefined;
1974
+ item.failure_details = undefined;
1975
+ item.started_at = undefined;
1976
+ item.completed_at = undefined;
1977
+ queueUpdated++;
1978
+ }
1979
+ }
1980
+ }
1981
+ if (queueUpdated > 0) {
1982
+ // Reset queue status if it was failed
1983
+ if (queue.status === 'failed') {
1984
+ queue.status = 'active';
1985
+ }
1986
+ // Write back to queue
1987
+ if (queue.solutions) {
1988
+ queue.solutions = items;
1989
+ }
1990
+ else {
1991
+ queue.tasks = items;
1523
1992
  }
1993
+ writeQueue(queue);
1994
+ totalUpdated += queueUpdated;
1524
1995
  }
1525
1996
  }
1526
- if (updated === 0) {
1997
+ if (totalUpdated === 0) {
1527
1998
  console.log(chalk.yellow('No failed items to retry'));
1528
1999
  return;
1529
2000
  }
1530
- // Reset queue status if it was failed
1531
- if (queue.status === 'failed') {
1532
- queue.status = 'active';
1533
- }
1534
- // Write back to queue
1535
- if (queue.solutions) {
1536
- queue.solutions = items;
1537
- }
1538
- else {
1539
- queue.tasks = items;
1540
- }
1541
- writeQueue(queue);
1542
2001
  if (issueId) {
1543
2002
  updateIssue(issueId, { status: 'queued' });
1544
2003
  }
1545
- console.log(chalk.green(`✓ Reset ${updated} item(s) to pending`));
2004
+ console.log(chalk.green(`✓ Reset ${totalUpdated} item(s) to pending (failure history preserved)`));
1546
2005
  }
1547
2006
  // ============ Main Entry ============
1548
2007
  export async function issueCommand(subcommand, args, options) {
@@ -1609,6 +2068,8 @@ export async function issueCommand(subcommand, args, options) {
1609
2068
  console.log(chalk.gray(' list [issue-id] List issues or tasks'));
1610
2069
  console.log(chalk.gray(' history List completed issues (from history)'));
1611
2070
  console.log(chalk.gray(' status [issue-id] Show detailed status'));
2071
+ console.log(chalk.gray(' solution <id> List solutions for issue'));
2072
+ console.log(chalk.gray(' solution <id> --brief Brief: solution_id, files_touched, task_count'));
1612
2073
  console.log(chalk.gray(' solution <id> --data \'{...}\' Create solution (auto-generates ID)'));
1613
2074
  console.log(chalk.gray(' bind <issue-id> [sol-id] Bind solution'));
1614
2075
  console.log(chalk.gray(' update <issue-id> --status <s> Update issue status'));
@@ -1619,16 +2080,18 @@ export async function issueCommand(subcommand, args, options) {
1619
2080
  console.log(chalk.gray(' queue list List all queues (history)'));
1620
2081
  console.log(chalk.gray(' queue add <issue-id> Add issue to active queue (or create new)'));
1621
2082
  console.log(chalk.gray(' queue switch <queue-id> Switch active queue'));
1622
- console.log(chalk.gray(' queue dag Get dependency graph (JSON) for parallel execution'));
2083
+ console.log(chalk.gray(' queue activate <q1,q2,...> Activate multiple queues (comma-separated)'));
2084
+ console.log(chalk.gray(' queue priority <queue-id> Set queue priority (--priority N, lower=higher)'));
2085
+ console.log(chalk.gray(' queue dag [--queue <id>] Get dependency graph (JSON) for parallel execution'));
1623
2086
  console.log(chalk.gray(' queue archive Archive current queue'));
1624
2087
  console.log(chalk.gray(' queue delete <queue-id> Delete queue from history'));
1625
- console.log(chalk.gray(' retry [issue-id] Retry failed tasks'));
2088
+ console.log(chalk.gray(' retry [issue-id] [--queue <id>] Retry failed tasks'));
1626
2089
  console.log();
1627
2090
  console.log(chalk.bold('Execution Endpoints:'));
1628
- console.log(chalk.gray(' next [item-id] Get & mark task executing (JSON)'));
1629
- console.log(chalk.gray(' detail <item-id> Get task details (READ-ONLY, for parallel)'));
1630
- console.log(chalk.gray(' done <item-id> Mark task completed'));
1631
- console.log(chalk.gray(' done <item-id> --fail Mark task failed'));
2091
+ console.log(chalk.gray(' next [item-id] [--queue <id>] Get & mark task executing (JSON)'));
2092
+ console.log(chalk.gray(' detail <item-id> [--queue <id>] Get task details (READ-ONLY, for parallel)'));
2093
+ console.log(chalk.gray(' done <item-id> [--queue <id>] Mark task completed'));
2094
+ console.log(chalk.gray(' done <item-id> --fail --reason "." Mark task failed with reason (supports JSON)'));
1632
2095
  console.log();
1633
2096
  console.log(chalk.bold('Options:'));
1634
2097
  console.log(chalk.gray(' --title <title> Issue/task title'));
@@ -1636,7 +2099,9 @@ export async function issueCommand(subcommand, args, options) {
1636
2099
  console.log(chalk.gray(' --brief Brief JSON output (minimal fields)'));
1637
2100
  console.log(chalk.gray(' --solution <path> Solution JSON file'));
1638
2101
  console.log(chalk.gray(' --result <json> Execution result'));
1639
- console.log(chalk.gray(' --reason <text> Failure reason'));
2102
+ console.log(chalk.gray(' --reason <text> Failure reason (string or JSON)'));
2103
+ console.log(chalk.gray(' --queue <queue-id> Target queue for multi-queue operations'));
2104
+ console.log(chalk.gray(' --priority <n> Queue priority (lower = higher)'));
1640
2105
  console.log(chalk.gray(' --json JSON output'));
1641
2106
  console.log(chalk.gray(' --force Force operation'));
1642
2107
  console.log();