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