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