claude-code-workflow 6.3.53 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/action-planning-agent.md +358 -188
- package/.claude/agents/cli-execution-agent.md +13 -12
- package/.claude/agents/cli-explore-agent.md +66 -11
- package/.claude/agents/cli-lite-planning-agent.md +908 -892
- package/.claude/agents/cli-roadmap-plan-agent.md +1001 -0
- package/.claude/agents/code-developer.md +75 -85
- package/.claude/agents/conceptual-planning-agent.md +49 -19
- package/.claude/agents/context-search-agent.md +96 -19
- package/.claude/agents/debug-explore-agent.md +439 -436
- package/.claude/agents/issue-plan-agent.md +15 -11
- package/.claude/agents/memory-bridge.md +2 -2
- package/.claude/agents/tdd-developer.md +84 -107
- package/.claude/agents/team-worker.md +440 -0
- package/.claude/agents/test-action-planning-agent.md +684 -0
- package/.claude/agents/test-fix-agent.md +24 -12
- package/.claude/agents/ui-design-agent.md +3 -3
- package/.claude/agents/universal-executor.md +1 -1
- package/.claude/commands/ccw-coordinator.md +316 -62
- package/.claude/commands/ccw.md +502 -172
- package/.claude/commands/cli/cli-init.md +441 -441
- package/.claude/commands/flow-create.md +666 -0
- package/.claude/commands/issue/convert-to-plan.md +21 -19
- package/.claude/commands/issue/discover-by-prompt.md +2 -2
- package/.claude/commands/issue/discover.md +4 -4
- package/.claude/commands/issue/execute.md +43 -15
- package/.claude/commands/issue/from-brainstorm.md +5 -5
- package/.claude/commands/issue/plan.md +335 -335
- package/.claude/commands/issue/queue.md +1 -1
- package/.claude/commands/memory/prepare.md +240 -0
- package/.claude/commands/memory/style-skill-memory.md +2 -2
- package/.claude/commands/workflow/analyze-with-file.md +639 -667
- package/.claude/commands/workflow/brainstorm-with-file.md +779 -1153
- package/.claude/commands/workflow/clean.md +572 -548
- package/.claude/commands/workflow/collaborative-plan-with-file.md +635 -761
- package/.claude/commands/workflow/debug-with-file.md +648 -672
- package/.claude/commands/workflow/init-guidelines.md +447 -0
- package/.claude/commands/workflow/init-specs.md +380 -0
- package/.claude/commands/workflow/init.md +291 -224
- package/.claude/commands/workflow/integration-test-cycle.md +932 -0
- package/.claude/commands/workflow/refactor-cycle.md +852 -0
- package/.claude/commands/workflow/roadmap-with-file.md +544 -0
- package/.claude/commands/workflow/session/complete.md +139 -203
- package/.claude/commands/workflow/session/solidify.md +453 -303
- package/.claude/commands/workflow/session/start.md +202 -202
- package/.claude/commands/workflow/session/sync.md +201 -0
- package/.claude/commands/workflow/ui-design/codify-style.md +20 -20
- package/.claude/commands/workflow/ui-design/design-sync.md +7 -7
- package/.claude/commands/workflow/ui-design/explore-auto.md +16 -16
- package/.claude/commands/workflow/ui-design/generate.md +1 -1
- package/.claude/commands/workflow/ui-design/imitate-auto.md +19 -19
- package/.claude/commands/workflow/ui-design/import-from-code.md +540 -540
- package/.claude/commands/workflow/unified-execute-with-file.md +864 -904
- package/.claude/scripts/cleanup-ghost-commands.mjs +402 -0
- package/.claude/skills/_shared/COMMAND-TO-SKILL-CONVERSION.md +741 -0
- package/.claude/skills/brainstorm/SKILL.md +382 -0
- package/.claude/skills/brainstorm/phases/01-mode-routing.md +207 -0
- package/.claude/skills/brainstorm/phases/02-artifacts.md +457 -0
- package/.claude/skills/brainstorm/phases/03-role-analysis.md +718 -0
- package/.claude/skills/brainstorm/phases/04-synthesis.md +817 -0
- package/.claude/skills/ccw-help/SKILL.md +176 -176
- package/.claude/skills/ccw-help/index/all-commands.json +376 -805
- package/.claude/skills/ccw-help/index/by-category.json +400 -833
- package/.claude/skills/ccw-help/index/by-use-case.json +388 -819
- package/.claude/skills/ccw-help/index/command-relationships.json +15 -160
- package/.claude/skills/ccw-help/index/essential-commands.json +13 -90
- package/.claude/skills/command-generator/SKILL.md +190 -0
- package/.claude/skills/command-generator/phases/01-parameter-validation.md +174 -0
- package/.claude/skills/command-generator/phases/02-target-path-resolution.md +171 -0
- package/.claude/skills/command-generator/phases/03-template-loading.md +123 -0
- package/.claude/skills/command-generator/phases/04-content-formatting.md +184 -0
- package/.claude/skills/command-generator/phases/05-file-generation.md +185 -0
- package/.claude/skills/command-generator/specs/command-design-spec.md +160 -0
- package/.claude/skills/command-generator/templates/command-md.md +75 -0
- package/.claude/skills/issue-manage/SKILL.md +291 -285
- package/.claude/skills/memory-capture/SKILL.md +129 -0
- package/.claude/skills/memory-capture/phases/01-compact.md +254 -0
- package/.claude/skills/memory-capture/phases/02-tips.md +206 -0
- package/.claude/skills/memory-manage/SKILL.md +229 -0
- package/.claude/skills/memory-manage/phases/01-update-full.md +316 -0
- package/.claude/skills/memory-manage/phases/02-update-related.md +267 -0
- package/.claude/skills/memory-manage/phases/03-update-single.md +306 -0
- package/.claude/skills/memory-manage/phases/04-docs-full.md +435 -0
- package/.claude/skills/memory-manage/phases/05-docs-related.md +315 -0
- package/.claude/skills/review-cycle/SKILL.md +128 -0
- package/.claude/skills/review-cycle/phases/review-fix.md +760 -0
- package/.claude/skills/review-cycle/phases/review-module.md +764 -0
- package/.claude/skills/review-cycle/phases/review-session.md +775 -0
- package/.claude/skills/skill-generator/templates/llm-action.md +3 -3
- package/.claude/skills/spec-generator/README.md +81 -0
- package/.claude/skills/spec-generator/SKILL.md +290 -0
- package/.claude/skills/spec-generator/phases/01-5-requirement-clarification.md +404 -0
- package/.claude/skills/spec-generator/phases/01-discovery.md +242 -0
- package/.claude/skills/spec-generator/phases/02-product-brief.md +247 -0
- package/.claude/skills/spec-generator/phases/03-requirements.md +179 -0
- package/.claude/skills/spec-generator/phases/04-architecture.md +213 -0
- package/.claude/skills/spec-generator/phases/05-epics-stories.md +168 -0
- package/.claude/skills/spec-generator/phases/06-readiness-check.md +449 -0
- package/.claude/skills/spec-generator/specs/document-standards.md +248 -0
- package/.claude/skills/spec-generator/specs/quality-gates.md +219 -0
- package/.claude/skills/spec-generator/templates/architecture-doc.md +254 -0
- package/.claude/skills/spec-generator/templates/epics-template.md +196 -0
- package/.claude/skills/spec-generator/templates/product-brief.md +133 -0
- package/.claude/skills/spec-generator/templates/requirements-prd.md +224 -0
- package/.claude/skills/team-brainstorm/SKILL.md +407 -0
- package/.claude/skills/team-brainstorm/roles/challenger.md +167 -0
- package/.claude/skills/team-brainstorm/roles/coordinator.md +257 -0
- package/.claude/skills/team-brainstorm/roles/evaluator.md +157 -0
- package/.claude/skills/team-brainstorm/roles/ideator.md +160 -0
- package/.claude/skills/team-brainstorm/roles/synthesizer.md +168 -0
- package/.claude/skills/team-brainstorm/specs/team-config.json +86 -0
- package/.claude/skills/team-coordinate/SKILL.md +445 -0
- package/.claude/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +197 -0
- package/.claude/skills/team-coordinate/roles/coordinator/commands/dispatch.md +85 -0
- package/.claude/skills/team-coordinate/roles/coordinator/commands/monitor.md +296 -0
- package/.claude/skills/team-coordinate/roles/coordinator/role.md +283 -0
- package/.claude/skills/team-coordinate/specs/role-template.md +434 -0
- package/.claude/skills/team-coordinate/subagents/discuss-subagent.md +133 -0
- package/.claude/skills/team-coordinate/subagents/explore-subagent.md +120 -0
- package/.claude/skills/team-coordinate-v2/SKILL.md +265 -0
- package/.claude/skills/team-coordinate-v2/roles/coordinator/commands/analyze-task.md +185 -0
- package/.claude/skills/team-coordinate-v2/roles/coordinator/commands/dispatch.md +87 -0
- package/.claude/skills/team-coordinate-v2/roles/coordinator/commands/monitor.md +301 -0
- package/.claude/skills/team-coordinate-v2/roles/coordinator/role.md +297 -0
- package/.claude/skills/team-coordinate-v2/specs/role-spec-template.md +295 -0
- package/.claude/skills/team-coordinate-v2/subagents/discuss-subagent.md +133 -0
- package/.claude/skills/team-coordinate-v2/subagents/explore-subagent.md +120 -0
- package/.claude/skills/team-executor/SKILL.md +372 -0
- package/.claude/skills/team-executor/roles/executor/commands/monitor.md +277 -0
- package/.claude/skills/team-executor/roles/executor/role.md +202 -0
- package/.claude/skills/team-executor/specs/session-schema.md +272 -0
- package/.claude/skills/team-executor-v2/SKILL.md +215 -0
- package/.claude/skills/team-executor-v2/roles/executor/commands/monitor.md +239 -0
- package/.claude/skills/team-executor-v2/roles/executor/role.md +171 -0
- package/.claude/skills/team-executor-v2/specs/session-schema.md +264 -0
- package/.claude/skills/team-frontend/SKILL.md +426 -0
- package/.claude/skills/team-frontend/roles/analyst/commands/design-intelligence.md +150 -0
- package/.claude/skills/team-frontend/roles/analyst/role.md +225 -0
- package/.claude/skills/team-frontend/roles/architect/role.md +219 -0
- package/.claude/skills/team-frontend/roles/coordinator/role.md +257 -0
- package/.claude/skills/team-frontend/roles/developer/role.md +238 -0
- package/.claude/skills/team-frontend/roles/qa/commands/pre-delivery-checklist.md +116 -0
- package/.claude/skills/team-frontend/roles/qa/role.md +257 -0
- package/.claude/skills/team-frontend/specs/team-config.json +84 -0
- package/.claude/skills/team-issue/SKILL.md +425 -0
- package/.claude/skills/team-issue/roles/coordinator.md +340 -0
- package/.claude/skills/team-issue/roles/explorer.md +212 -0
- package/.claude/skills/team-issue/roles/implementer.md +322 -0
- package/.claude/skills/team-issue/roles/integrator.md +241 -0
- package/.claude/skills/team-issue/roles/planner.md +207 -0
- package/.claude/skills/team-issue/roles/reviewer.md +268 -0
- package/.claude/skills/team-issue/specs/team-config.json +70 -0
- package/.claude/skills/team-iterdev/SKILL.md +493 -0
- package/.claude/skills/team-iterdev/roles/architect.md +265 -0
- package/.claude/skills/team-iterdev/roles/coordinator.md +423 -0
- package/.claude/skills/team-iterdev/roles/developer.md +280 -0
- package/.claude/skills/team-iterdev/roles/reviewer.md +307 -0
- package/.claude/skills/team-iterdev/roles/tester.md +253 -0
- package/.claude/skills/team-iterdev/specs/team-config.json +172 -0
- package/.claude/skills/team-lifecycle-v3/SKILL.md +384 -0
- package/.claude/skills/team-lifecycle-v3/roles/analyst/role.md +113 -0
- package/.claude/skills/team-lifecycle-v3/roles/architect/commands/assess.md +193 -0
- package/.claude/skills/team-lifecycle-v3/roles/architect/role.md +103 -0
- package/.claude/skills/team-lifecycle-v3/roles/coordinator/commands/dispatch.md +142 -0
- package/.claude/skills/team-lifecycle-v3/roles/coordinator/commands/monitor.md +180 -0
- package/.claude/skills/team-lifecycle-v3/roles/coordinator/role.md +209 -0
- package/.claude/skills/team-lifecycle-v3/roles/discussant/commands/critique.md +136 -0
- package/.claude/skills/team-lifecycle-v3/roles/discussant/role.md +128 -0
- package/.claude/skills/team-lifecycle-v3/roles/executor/commands/implement.md +166 -0
- package/.claude/skills/team-lifecycle-v3/roles/executor/role.md +103 -0
- package/.claude/skills/team-lifecycle-v3/roles/explorer/role.md +91 -0
- package/.claude/skills/team-lifecycle-v3/roles/fe-developer/role.md +111 -0
- package/.claude/skills/team-lifecycle-v3/roles/fe-qa/commands/pre-delivery-checklist.md +152 -0
- package/.claude/skills/team-lifecycle-v3/roles/fe-qa/role.md +113 -0
- package/.claude/skills/team-lifecycle-v3/roles/planner/commands/explore.md +154 -0
- package/.claude/skills/team-lifecycle-v3/roles/planner/role.md +120 -0
- package/.claude/skills/team-lifecycle-v3/roles/reviewer/commands/code-review.md +163 -0
- package/.claude/skills/team-lifecycle-v3/roles/reviewer/commands/spec-quality.md +202 -0
- package/.claude/skills/team-lifecycle-v3/roles/reviewer/role.md +104 -0
- package/.claude/skills/team-lifecycle-v3/roles/tester/commands/validate.md +152 -0
- package/.claude/skills/team-lifecycle-v3/roles/tester/role.md +108 -0
- package/.claude/skills/team-lifecycle-v3/roles/writer/commands/generate-doc.md +187 -0
- package/.claude/skills/team-lifecycle-v3/roles/writer/role.md +96 -0
- package/.claude/skills/team-lifecycle-v3/specs/document-standards.md +192 -0
- package/.claude/skills/team-lifecycle-v3/specs/quality-gates.md +207 -0
- package/.claude/skills/team-lifecycle-v3/specs/team-config.json +158 -0
- package/.claude/skills/team-lifecycle-v3/templates/architecture-doc.md +254 -0
- package/.claude/skills/team-lifecycle-v3/templates/epics-template.md +196 -0
- package/.claude/skills/team-lifecycle-v3/templates/product-brief.md +133 -0
- package/.claude/skills/team-lifecycle-v3/templates/requirements-prd.md +224 -0
- package/.claude/skills/team-lifecycle-v4/SKILL.md +643 -0
- package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +174 -0
- package/.claude/skills/team-lifecycle-v4/roles/architect/commands/assess.md +193 -0
- package/.claude/skills/team-lifecycle-v4/roles/architect/role.md +103 -0
- package/.claude/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +198 -0
- package/.claude/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +413 -0
- package/.claude/skills/team-lifecycle-v4/roles/coordinator/role.md +230 -0
- package/.claude/skills/team-lifecycle-v4/roles/executor/commands/implement.md +166 -0
- package/.claude/skills/team-lifecycle-v4/roles/executor/role.md +103 -0
- package/.claude/skills/team-lifecycle-v4/roles/fe-developer/role.md +111 -0
- package/.claude/skills/team-lifecycle-v4/roles/fe-qa/commands/pre-delivery-checklist.md +152 -0
- package/.claude/skills/team-lifecycle-v4/roles/fe-qa/role.md +113 -0
- package/.claude/skills/team-lifecycle-v4/roles/planner/commands/explore.md +172 -0
- package/.claude/skills/team-lifecycle-v4/roles/planner/role.md +139 -0
- package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/code-review.md +163 -0
- package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/spec-quality.md +202 -0
- package/.claude/skills/team-lifecycle-v4/roles/reviewer/role.md +150 -0
- package/.claude/skills/team-lifecycle-v4/roles/tester/commands/validate.md +152 -0
- package/.claude/skills/team-lifecycle-v4/roles/tester/role.md +108 -0
- package/.claude/skills/team-lifecycle-v4/roles/writer/commands/generate-doc.md +192 -0
- package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +246 -0
- package/.claude/skills/team-lifecycle-v4/specs/document-standards.md +192 -0
- package/.claude/skills/team-lifecycle-v4/specs/quality-gates.md +207 -0
- package/.claude/skills/team-lifecycle-v4/specs/team-config.json +200 -0
- package/.claude/skills/team-lifecycle-v4/subagents/discuss-subagent.md +169 -0
- package/.claude/skills/team-lifecycle-v4/subagents/doc-generation-subagent.md +62 -0
- package/.claude/skills/team-lifecycle-v4/subagents/explore-subagent.md +172 -0
- package/.claude/skills/team-lifecycle-v4/templates/architecture-doc.md +254 -0
- package/.claude/skills/team-lifecycle-v4/templates/epics-template.md +196 -0
- package/.claude/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
- package/.claude/skills/team-lifecycle-v4/templates/requirements-prd.md +224 -0
- package/.claude/skills/team-lifecycle-v5/SKILL.md +320 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/analyst.md +93 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/architect.md +76 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/executor.md +67 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/fe-developer.md +79 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/fe-qa.md +79 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/planner.md +98 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/reviewer.md +94 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/tester.md +76 -0
- package/.claude/skills/team-lifecycle-v5/role-specs/writer.md +126 -0
- package/.claude/skills/team-lifecycle-v5/roles/coordinator/commands/dispatch.md +178 -0
- package/.claude/skills/team-lifecycle-v5/roles/coordinator/commands/monitor.md +237 -0
- package/.claude/skills/team-lifecycle-v5/roles/coordinator/role.md +194 -0
- package/.claude/skills/team-lifecycle-v5/specs/document-standards.md +192 -0
- package/.claude/skills/team-lifecycle-v5/specs/quality-gates.md +207 -0
- package/.claude/skills/team-lifecycle-v5/specs/team-config.json +218 -0
- package/.claude/skills/team-lifecycle-v5/subagents/discuss-subagent.md +169 -0
- package/.claude/skills/team-lifecycle-v5/subagents/doc-generation-subagent.md +62 -0
- package/.claude/skills/team-lifecycle-v5/subagents/explore-subagent.md +172 -0
- package/.claude/skills/team-lifecycle-v5/templates/architecture-doc.md +254 -0
- package/.claude/skills/team-lifecycle-v5/templates/epics-template.md +196 -0
- package/.claude/skills/team-lifecycle-v5/templates/product-brief.md +133 -0
- package/.claude/skills/team-lifecycle-v5/templates/requirements-prd.md +224 -0
- package/.claude/skills/team-planex/SKILL.md +439 -0
- package/.claude/skills/team-planex/roles/executor.md +356 -0
- package/.claude/skills/team-planex/roles/planner.md +315 -0
- package/.claude/skills/team-quality-assurance/SKILL.md +466 -0
- package/.claude/skills/team-quality-assurance/roles/analyst/commands/quality-report.md +360 -0
- package/.claude/skills/team-quality-assurance/roles/analyst/role.md +186 -0
- package/.claude/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +169 -0
- package/.claude/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +336 -0
- package/.claude/skills/team-quality-assurance/roles/coordinator/role.md +195 -0
- package/.claude/skills/team-quality-assurance/roles/executor/commands/run-fix-cycle.md +220 -0
- package/.claude/skills/team-quality-assurance/roles/executor/role.md +179 -0
- package/.claude/skills/team-quality-assurance/roles/generator/commands/generate-tests.md +258 -0
- package/.claude/skills/team-quality-assurance/roles/generator/role.md +172 -0
- package/.claude/skills/team-quality-assurance/roles/scout/commands/scan.md +216 -0
- package/.claude/skills/team-quality-assurance/roles/scout/role.md +244 -0
- package/.claude/skills/team-quality-assurance/roles/strategist/commands/analyze-scope.md +221 -0
- package/.claude/skills/team-quality-assurance/roles/strategist/role.md +166 -0
- package/.claude/skills/team-quality-assurance/specs/team-config.json +131 -0
- package/.claude/skills/team-review/SKILL.md +264 -0
- package/.claude/skills/team-review/roles/coordinator/commands/dispatch.md +145 -0
- package/.claude/skills/team-review/roles/coordinator/commands/monitor.md +218 -0
- package/.claude/skills/team-review/roles/coordinator/role.md +244 -0
- package/.claude/skills/team-review/roles/fixer/commands/execute-fixes.md +163 -0
- package/.claude/skills/team-review/roles/fixer/commands/plan-fixes.md +187 -0
- package/.claude/skills/team-review/roles/fixer/role.md +247 -0
- package/.claude/skills/team-review/roles/reviewer/commands/deep-analyze.md +186 -0
- package/.claude/skills/team-review/roles/reviewer/commands/generate-report.md +174 -0
- package/.claude/skills/team-review/roles/reviewer/role.md +233 -0
- package/.claude/skills/team-review/roles/scanner/commands/semantic-scan.md +186 -0
- package/.claude/skills/team-review/roles/scanner/commands/toolchain-scan.md +187 -0
- package/.claude/skills/team-review/roles/scanner/role.md +255 -0
- package/.claude/skills/team-review/specs/dimensions.md +82 -0
- package/.claude/skills/team-review/specs/finding-schema.json +82 -0
- package/.claude/skills/team-review/specs/team-config.json +27 -0
- package/.claude/skills/team-roadmap-dev/SKILL.md +389 -0
- package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/dispatch.md +213 -0
- package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +378 -0
- package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/pause.md +91 -0
- package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/resume.md +138 -0
- package/.claude/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +287 -0
- package/.claude/skills/team-roadmap-dev/roles/coordinator/role.md +237 -0
- package/.claude/skills/team-roadmap-dev/roles/executor/commands/implement.md +309 -0
- package/.claude/skills/team-roadmap-dev/roles/executor/role.md +220 -0
- package/.claude/skills/team-roadmap-dev/roles/planner/commands/create-plans.md +362 -0
- package/.claude/skills/team-roadmap-dev/roles/planner/commands/research.md +219 -0
- package/.claude/skills/team-roadmap-dev/roles/planner/role.md +243 -0
- package/.claude/skills/team-roadmap-dev/roles/verifier/commands/verify.md +335 -0
- package/.claude/skills/team-roadmap-dev/roles/verifier/role.md +247 -0
- package/.claude/skills/team-roadmap-dev/specs/team-config.json +96 -0
- package/.claude/skills/team-tech-debt/SKILL.md +473 -0
- package/.claude/skills/team-tech-debt/roles/assessor/commands/evaluate.md +164 -0
- package/.claude/skills/team-tech-debt/roles/assessor/role.md +187 -0
- package/.claude/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +157 -0
- package/.claude/skills/team-tech-debt/roles/coordinator/commands/monitor.md +434 -0
- package/.claude/skills/team-tech-debt/roles/coordinator/role.md +387 -0
- package/.claude/skills/team-tech-debt/roles/executor/commands/remediate.md +180 -0
- package/.claude/skills/team-tech-debt/roles/executor/role.md +228 -0
- package/.claude/skills/team-tech-debt/roles/planner/commands/create-plan.md +165 -0
- package/.claude/skills/team-tech-debt/roles/planner/role.md +190 -0
- package/.claude/skills/team-tech-debt/roles/scanner/commands/scan-debt.md +388 -0
- package/.claude/skills/team-tech-debt/roles/scanner/role.md +225 -0
- package/.claude/skills/team-tech-debt/roles/validator/commands/verify.md +203 -0
- package/.claude/skills/team-tech-debt/roles/validator/role.md +237 -0
- package/.claude/skills/team-tech-debt/specs/team-config.json +132 -0
- package/.claude/skills/team-testing/SKILL.md +362 -0
- package/.claude/skills/team-testing/roles/analyst.md +265 -0
- package/.claude/skills/team-testing/roles/coordinator.md +304 -0
- package/.claude/skills/team-testing/roles/executor.md +300 -0
- package/.claude/skills/team-testing/roles/generator.md +272 -0
- package/.claude/skills/team-testing/roles/strategist.md +218 -0
- package/.claude/skills/team-testing/specs/team-config.json +93 -0
- package/.claude/skills/team-uidesign/SKILL.md +419 -0
- package/.claude/skills/team-uidesign/roles/coordinator.md +315 -0
- package/.claude/skills/team-uidesign/roles/designer.md +251 -0
- package/.claude/skills/team-uidesign/roles/implementer.md +280 -0
- package/.claude/skills/team-uidesign/roles/researcher.md +286 -0
- package/.claude/skills/team-uidesign/roles/reviewer.md +301 -0
- package/.claude/skills/team-uidesign/specs/team-config.json +107 -0
- package/.claude/skills/team-ultra-analyze/SKILL.md +444 -0
- package/.claude/skills/team-ultra-analyze/roles/analyst/commands/analyze.md +210 -0
- package/.claude/skills/team-ultra-analyze/roles/analyst/role.md +253 -0
- package/.claude/skills/team-ultra-analyze/roles/coordinator/commands/dispatch.md +237 -0
- package/.claude/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +461 -0
- package/.claude/skills/team-ultra-analyze/roles/coordinator/role.md +354 -0
- package/.claude/skills/team-ultra-analyze/roles/discussant/commands/deepen.md +222 -0
- package/.claude/skills/team-ultra-analyze/roles/discussant/role.md +227 -0
- package/.claude/skills/team-ultra-analyze/roles/explorer/commands/explore.md +194 -0
- package/.claude/skills/team-ultra-analyze/roles/explorer/role.md +219 -0
- package/.claude/skills/team-ultra-analyze/roles/synthesizer/commands/synthesize.md +255 -0
- package/.claude/skills/team-ultra-analyze/roles/synthesizer/role.md +251 -0
- package/.claude/skills/team-ultra-analyze/specs/team-config.json +131 -0
- package/.claude/skills/workflow-execute/SKILL.md +625 -0
- package/.claude/skills/workflow-execute/phases/06-review.md +215 -0
- package/.claude/skills/workflow-lite-plan/SKILL.md +174 -0
- package/.claude/skills/workflow-lite-plan/phases/01-lite-plan.md +762 -0
- package/.claude/skills/workflow-lite-plan/phases/02-lite-execute.md +786 -0
- package/.claude/skills/workflow-multi-cli-plan/SKILL.md +163 -0
- package/.claude/skills/workflow-multi-cli-plan/phases/01-multi-cli-plan.md +604 -0
- package/.claude/skills/workflow-multi-cli-plan/phases/02-lite-execute.md +788 -0
- package/.claude/skills/workflow-plan/SKILL.md +441 -0
- package/.claude/skills/workflow-plan/phases/01-session-discovery.md +99 -0
- package/.claude/skills/workflow-plan/phases/02-context-gathering.md +338 -0
- package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -0
- package/.claude/skills/workflow-plan/phases/04-task-generation.md +433 -0
- package/.claude/skills/workflow-plan/phases/05-plan-verify.md +391 -0
- package/.claude/skills/workflow-plan/phases/06-replan.md +594 -0
- package/.claude/skills/workflow-skill-designer/SKILL.md +496 -0
- package/.claude/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
- package/.claude/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
- package/.claude/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
- package/.claude/skills/workflow-skill-designer/phases/04-validation.md +471 -0
- package/.claude/skills/workflow-tdd/SKILL.md +502 -0
- package/.claude/skills/workflow-tdd/phases/01-session-discovery.md +57 -0
- package/.claude/skills/workflow-tdd/phases/02-context-gathering.md +406 -0
- package/.claude/skills/workflow-tdd/phases/03-test-coverage-analysis.md +172 -0
- package/.claude/skills/workflow-tdd/phases/04-conflict-resolution.md +426 -0
- package/.claude/skills/workflow-tdd/phases/05-tdd-task-generation.md +472 -0
- package/.claude/skills/workflow-tdd/phases/06-tdd-structure-validation.md +189 -0
- package/.claude/skills/workflow-tdd/phases/07-tdd-verify.md +635 -0
- package/.claude/skills/workflow-test-fix/SKILL.md +458 -0
- package/.claude/skills/workflow-test-fix/phases/01-session-start.md +60 -0
- package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +492 -0
- package/.claude/skills/workflow-test-fix/phases/03-test-concept-enhanced.md +150 -0
- package/.claude/skills/workflow-test-fix/phases/04-test-task-generate.md +346 -0
- package/.claude/skills/workflow-test-fix/phases/05-test-cycle-execute.md +537 -0
- package/.codex/AGENTS.md +126 -122
- package/.codex/agents/action-planning-agent.md +88 -93
- package/.codex/agents/cli-execution-agent.md +4 -4
- package/.codex/agents/cli-explore-agent.md +56 -11
- package/.codex/agents/cli-lite-planning-agent.md +906 -736
- package/.codex/agents/code-developer.md +147 -38
- package/.codex/agents/conceptual-planning-agent.md +5 -5
- package/.codex/agents/context-search-agent.md +8 -4
- package/.codex/agents/issue-plan-agent.md +11 -11
- package/.codex/agents/memory-bridge.md +2 -2
- package/.codex/agents/tdd-developer.md +512 -0
- package/.codex/agents/test-action-planning-agent.md +684 -0
- package/.codex/agents/test-fix-agent.md +19 -7
- package/.codex/agents/ui-design-agent.md +3 -3
- package/.codex/prompts/prep-cycle.md +416 -0
- package/.codex/prompts/prep-plan.md +371 -0
- package/.codex/skills/analyze-with-file/EXECUTE.md +716 -0
- package/.codex/skills/analyze-with-file/SKILL.md +1049 -0
- package/.codex/skills/brainstorm-with-file/SKILL.md +1033 -0
- package/.codex/skills/clean/SKILL.md +421 -0
- package/.codex/skills/collaborative-plan-with-file/SKILL.md +822 -0
- package/.codex/skills/debug-with-file/SKILL.md +617 -0
- package/.codex/skills/issue-discover/SKILL.md +353 -0
- package/.codex/skills/issue-discover/phases/01-issue-new.md +334 -0
- package/.codex/skills/issue-discover/phases/02-discover.md +369 -0
- package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +531 -0
- package/.codex/skills/issue-discover/phases/04-quick-execute.md +241 -0
- package/.codex/skills/memory-compact/SKILL.md +381 -0
- package/.codex/skills/parallel-dev-cycle/SKILL.md +401 -0
- package/.codex/skills/parallel-dev-cycle/phases/00-prep-checklist.md +191 -0
- package/.codex/skills/parallel-dev-cycle/phases/01-session-init.md +261 -0
- package/.codex/skills/parallel-dev-cycle/phases/02-agent-execution.md +449 -0
- package/.codex/skills/parallel-dev-cycle/phases/03-result-aggregation.md +230 -0
- package/.codex/skills/parallel-dev-cycle/phases/04-completion-summary.md +109 -0
- package/.codex/skills/parallel-dev-cycle/roles/code-developer.md +392 -0
- package/.codex/skills/parallel-dev-cycle/roles/exploration-planner.md +352 -0
- package/.codex/skills/parallel-dev-cycle/roles/requirements-analyst.md +433 -0
- package/.codex/skills/parallel-dev-cycle/roles/validation-archivist.md +447 -0
- package/.codex/skills/review-cycle/SKILL.md +476 -0
- package/.codex/skills/review-cycle/phases/01-discovery-initialization.md +341 -0
- package/.codex/skills/review-cycle/phases/02-parallel-review.md +546 -0
- package/.codex/skills/review-cycle/phases/03-aggregation.md +74 -0
- package/.codex/skills/review-cycle/phases/04-iterative-deep-dive.md +333 -0
- package/.codex/skills/review-cycle/phases/05-review-completion.md +173 -0
- package/.codex/skills/review-cycle/phases/06-fix-discovery-batching.md +238 -0
- package/.codex/skills/review-cycle/phases/07-fix-parallel-planning.md +223 -0
- package/.codex/skills/review-cycle/phases/08-fix-execution.md +238 -0
- package/.codex/skills/review-cycle/phases/09-fix-completion.md +141 -0
- package/.codex/skills/roadmap-with-file/SKILL.md +898 -0
- package/.codex/skills/team-lifecycle/agents/analyst.md +424 -0
- package/.codex/skills/team-lifecycle/agents/architect.md +274 -0
- package/.codex/skills/team-lifecycle/agents/discuss-agent.md +422 -0
- package/.codex/skills/team-lifecycle/agents/executor.md +423 -0
- package/.codex/skills/team-lifecycle/agents/explore-agent.md +471 -0
- package/.codex/skills/team-lifecycle/agents/fe-developer.md +239 -0
- package/.codex/skills/team-lifecycle/agents/fe-qa.md +357 -0
- package/.codex/skills/team-lifecycle/agents/planner.md +437 -0
- package/.codex/skills/team-lifecycle/agents/reviewer.md +483 -0
- package/.codex/skills/team-lifecycle/agents/tester.md +423 -0
- package/.codex/skills/team-lifecycle/agents/writer.md +502 -0
- package/.codex/skills/team-lifecycle/orchestrator.md +817 -0
- package/.codex/skills/team-lifecycle/phases/01-requirement-clarification.md +209 -0
- package/.codex/skills/team-lifecycle/phases/02-team-initialization.md +205 -0
- package/.codex/skills/team-lifecycle/phases/03-task-chain-creation.md +251 -0
- package/.codex/skills/team-lifecycle/phases/04-pipeline-coordination.md +719 -0
- package/.codex/skills/team-lifecycle/phases/05-completion-report.md +288 -0
- package/.codex/skills/team-lifecycle/specs/document-standards.md +192 -0
- package/.codex/skills/team-lifecycle/specs/quality-gates.md +207 -0
- package/.codex/skills/team-lifecycle/templates/architecture-doc.md +254 -0
- package/.codex/skills/team-lifecycle/templates/epics-template.md +196 -0
- package/.codex/skills/team-lifecycle/templates/product-brief.md +133 -0
- package/.codex/skills/team-lifecycle/templates/requirements-prd.md +224 -0
- package/.codex/skills/team-planex/agents/executor.md +217 -0
- package/.codex/skills/team-planex/agents/planner.md +183 -0
- package/.codex/skills/team-planex/orchestrator.md +284 -0
- package/.codex/skills/unified-execute-with-file/SKILL.md +786 -0
- package/.codex/skills/workflow-test-fix-cycle/SKILL.md +391 -0
- package/.codex/skills/workflow-test-fix-cycle/phases/01-test-fix-gen.md +452 -0
- package/.codex/skills/workflow-test-fix-cycle/phases/02-test-cycle-execute.md +476 -0
- package/README.md +187 -157
- package/ccw/README.md +46 -0
- package/ccw/bin/ccw-mcp.js +16 -1
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +58 -2
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/cli.d.ts +3 -0
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +109 -63
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/commands/core-memory.d.ts +5 -0
- package/ccw/dist/commands/core-memory.d.ts.map +1 -1
- package/ccw/dist/commands/core-memory.js +307 -2
- package/ccw/dist/commands/core-memory.js.map +1 -1
- package/ccw/dist/commands/hook.d.ts +3 -1
- package/ccw/dist/commands/hook.d.ts.map +1 -1
- package/ccw/dist/commands/hook.js +669 -85
- package/ccw/dist/commands/hook.js.map +1 -1
- package/ccw/dist/commands/install.d.ts +12 -0
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +313 -3
- package/ccw/dist/commands/install.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +18 -5
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +58 -19
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/commands/memory.d.ts +1 -1
- package/ccw/dist/commands/memory.d.ts.map +1 -1
- package/ccw/dist/commands/memory.js +371 -1
- package/ccw/dist/commands/memory.js.map +1 -1
- package/ccw/dist/commands/serve.d.ts.map +1 -1
- package/ccw/dist/commands/serve.js +74 -4
- package/ccw/dist/commands/serve.js.map +1 -1
- package/ccw/dist/commands/spec.d.ts +24 -0
- package/ccw/dist/commands/spec.d.ts.map +1 -0
- package/ccw/dist/commands/spec.js +374 -0
- package/ccw/dist/commands/spec.js.map +1 -0
- package/ccw/dist/commands/stop.d.ts +0 -4
- package/ccw/dist/commands/stop.d.ts.map +1 -1
- package/ccw/dist/commands/stop.js +135 -12
- package/ccw/dist/commands/stop.js.map +1 -1
- package/ccw/dist/commands/team.d.ts +27 -0
- package/ccw/dist/commands/team.d.ts.map +1 -0
- package/ccw/dist/commands/team.js +164 -0
- package/ccw/dist/commands/team.js.map +1 -0
- package/ccw/dist/commands/upgrade.js +4 -2
- package/ccw/dist/commands/upgrade.js.map +1 -1
- package/ccw/dist/commands/view.d.ts.map +1 -1
- package/ccw/dist/commands/view.js +2 -3
- package/ccw/dist/commands/view.js.map +1 -1
- package/ccw/dist/commands/workflow.js +2 -2
- package/ccw/dist/commands/workflow.js.map +1 -1
- package/ccw/dist/config/cli-settings-manager.d.ts +12 -3
- package/ccw/dist/config/cli-settings-manager.d.ts.map +1 -1
- package/ccw/dist/config/cli-settings-manager.js +146 -12
- package/ccw/dist/config/cli-settings-manager.js.map +1 -1
- package/ccw/dist/config/litellm-static-models.d.ts +30 -0
- package/ccw/dist/config/litellm-static-models.d.ts.map +1 -0
- package/ccw/dist/config/litellm-static-models.js +82 -0
- package/ccw/dist/config/litellm-static-models.js.map +1 -0
- package/ccw/dist/config/provider-models.d.ts +5 -32
- package/ccw/dist/config/provider-models.d.ts.map +1 -1
- package/ccw/dist/config/provider-models.js +5 -103
- package/ccw/dist/config/provider-models.js.map +1 -1
- package/ccw/dist/config/remote-notification-config.d.ts +32 -0
- package/ccw/dist/config/remote-notification-config.d.ts.map +1 -0
- package/ccw/dist/config/remote-notification-config.js +131 -0
- package/ccw/dist/config/remote-notification-config.js.map +1 -0
- package/ccw/dist/config/storage-paths.d.ts +22 -0
- package/ccw/dist/config/storage-paths.d.ts.map +1 -1
- package/ccw/dist/config/storage-paths.js +27 -0
- package/ccw/dist/config/storage-paths.js.map +1 -1
- package/ccw/dist/core/a2ui/A2UITypes.d.ts +143 -0
- package/ccw/dist/core/a2ui/A2UITypes.d.ts.map +1 -0
- package/ccw/dist/core/a2ui/A2UITypes.js +84 -0
- package/ccw/dist/core/a2ui/A2UITypes.js.map +1 -0
- package/ccw/dist/core/a2ui/A2UIWebSocketHandler.d.ts +170 -0
- package/ccw/dist/core/a2ui/A2UIWebSocketHandler.d.ts.map +1 -0
- package/ccw/dist/core/a2ui/A2UIWebSocketHandler.js +718 -0
- package/ccw/dist/core/a2ui/A2UIWebSocketHandler.js.map +1 -0
- package/ccw/dist/core/a2ui/index.d.ts +3 -0
- package/ccw/dist/core/a2ui/index.d.ts.map +1 -0
- package/ccw/dist/core/a2ui/index.js +6 -0
- package/ccw/dist/core/a2ui/index.js.map +1 -0
- package/ccw/dist/core/auth/csrf-middleware.d.ts.map +1 -1
- package/ccw/dist/core/auth/csrf-middleware.js +26 -8
- package/ccw/dist/core/auth/csrf-middleware.js.map +1 -1
- package/ccw/dist/core/auth/middleware.d.ts.map +1 -1
- package/ccw/dist/core/auth/middleware.js +55 -0
- package/ccw/dist/core/auth/middleware.js.map +1 -1
- package/ccw/dist/core/core-memory-store.d.ts +99 -5
- package/ccw/dist/core/core-memory-store.d.ts.map +1 -1
- package/ccw/dist/core/core-memory-store.js +389 -56
- package/ccw/dist/core/core-memory-store.js.map +1 -1
- package/ccw/dist/core/data-aggregator.d.ts +6 -0
- package/ccw/dist/core/data-aggregator.d.ts.map +1 -1
- package/ccw/dist/core/data-aggregator.js +6 -35
- package/ccw/dist/core/data-aggregator.js.map +1 -1
- package/ccw/dist/core/hooks/context-limit-detector.d.ts +65 -0
- package/ccw/dist/core/hooks/context-limit-detector.d.ts.map +1 -0
- package/ccw/dist/core/hooks/context-limit-detector.js +91 -0
- package/ccw/dist/core/hooks/context-limit-detector.js.map +1 -0
- package/ccw/dist/core/hooks/index.d.ts +11 -0
- package/ccw/dist/core/hooks/index.d.ts.map +1 -0
- package/ccw/dist/core/hooks/index.js +16 -0
- package/ccw/dist/core/hooks/index.js.map +1 -0
- package/ccw/dist/core/hooks/keyword-detector.d.ts +106 -0
- package/ccw/dist/core/hooks/keyword-detector.d.ts.map +1 -0
- package/ccw/dist/core/hooks/keyword-detector.js +194 -0
- package/ccw/dist/core/hooks/keyword-detector.js.map +1 -0
- package/ccw/dist/core/hooks/recovery-handler.d.ts +114 -0
- package/ccw/dist/core/hooks/recovery-handler.d.ts.map +1 -0
- package/ccw/dist/core/hooks/recovery-handler.js +244 -0
- package/ccw/dist/core/hooks/recovery-handler.js.map +1 -0
- package/ccw/dist/core/hooks/stop-handler.d.ts +128 -0
- package/ccw/dist/core/hooks/stop-handler.d.ts.map +1 -0
- package/ccw/dist/core/hooks/stop-handler.js +269 -0
- package/ccw/dist/core/hooks/stop-handler.js.map +1 -0
- package/ccw/dist/core/hooks/user-abort-detector.d.ts +76 -0
- package/ccw/dist/core/hooks/user-abort-detector.d.ts.map +1 -0
- package/ccw/dist/core/hooks/user-abort-detector.js +168 -0
- package/ccw/dist/core/hooks/user-abort-detector.js.map +1 -0
- package/ccw/dist/core/lite-scanner-complete.d.ts +18 -3
- package/ccw/dist/core/lite-scanner-complete.d.ts.map +1 -1
- package/ccw/dist/core/lite-scanner-complete.js +54 -12
- package/ccw/dist/core/lite-scanner-complete.js.map +1 -1
- package/ccw/dist/core/lite-scanner.d.ts +74 -3
- package/ccw/dist/core/lite-scanner.d.ts.map +1 -1
- package/ccw/dist/core/lite-scanner.js +57 -12
- package/ccw/dist/core/lite-scanner.js.map +1 -1
- package/ccw/dist/core/memory-consolidation-pipeline.d.ts +126 -0
- package/ccw/dist/core/memory-consolidation-pipeline.d.ts.map +1 -0
- package/ccw/dist/core/memory-consolidation-pipeline.js +364 -0
- package/ccw/dist/core/memory-consolidation-pipeline.js.map +1 -0
- package/ccw/dist/core/memory-consolidation-prompts.d.ts +27 -0
- package/ccw/dist/core/memory-consolidation-prompts.d.ts.map +1 -0
- package/ccw/dist/core/memory-consolidation-prompts.js +103 -0
- package/ccw/dist/core/memory-consolidation-prompts.js.map +1 -0
- package/ccw/dist/core/memory-embedder-bridge.d.ts +22 -0
- package/ccw/dist/core/memory-embedder-bridge.d.ts.map +1 -1
- package/ccw/dist/core/memory-embedder-bridge.js +85 -0
- package/ccw/dist/core/memory-embedder-bridge.js.map +1 -1
- package/ccw/dist/core/memory-extraction-pipeline.d.ts +244 -0
- package/ccw/dist/core/memory-extraction-pipeline.d.ts.map +1 -0
- package/ccw/dist/core/memory-extraction-pipeline.js +934 -0
- package/ccw/dist/core/memory-extraction-pipeline.js.map +1 -0
- package/ccw/dist/core/memory-extraction-prompts.d.ts +29 -0
- package/ccw/dist/core/memory-extraction-prompts.d.ts.map +1 -0
- package/ccw/dist/core/memory-extraction-prompts.js +99 -0
- package/ccw/dist/core/memory-extraction-prompts.js.map +1 -0
- package/ccw/dist/core/memory-job-scheduler.d.ts +92 -0
- package/ccw/dist/core/memory-job-scheduler.d.ts.map +1 -0
- package/ccw/dist/core/memory-job-scheduler.js +264 -0
- package/ccw/dist/core/memory-job-scheduler.js.map +1 -0
- package/ccw/dist/core/memory-v2-config.d.ts +48 -0
- package/ccw/dist/core/memory-v2-config.d.ts.map +1 -0
- package/ccw/dist/core/memory-v2-config.js +51 -0
- package/ccw/dist/core/memory-v2-config.js.map +1 -0
- package/ccw/dist/core/mode-workflow-map.d.ts +148 -0
- package/ccw/dist/core/mode-workflow-map.d.ts.map +1 -0
- package/ccw/dist/core/mode-workflow-map.js +271 -0
- package/ccw/dist/core/mode-workflow-map.js.map +1 -0
- package/ccw/dist/core/pattern-detector.d.ts +99 -0
- package/ccw/dist/core/pattern-detector.d.ts.map +1 -0
- package/ccw/dist/core/pattern-detector.js +385 -0
- package/ccw/dist/core/pattern-detector.js.map +1 -0
- package/ccw/dist/core/routes/analysis-routes.d.ts +40 -0
- package/ccw/dist/core/routes/analysis-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/analysis-routes.js +172 -0
- package/ccw/dist/core/routes/analysis-routes.js.map +1 -0
- package/ccw/dist/core/routes/audit-routes.d.ts +14 -0
- package/ccw/dist/core/routes/audit-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/audit-routes.js +150 -0
- package/ccw/dist/core/routes/audit-routes.js.map +1 -0
- package/ccw/dist/core/routes/ccw-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/ccw-routes.js +87 -0
- package/ccw/dist/core/routes/ccw-routes.js.map +1 -1
- package/ccw/dist/core/routes/claude-routes.js +13 -13
- package/ccw/dist/core/routes/claude-routes.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts +6 -2
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js +308 -22
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/cli-sessions-routes.d.ts +20 -0
- package/ccw/dist/core/routes/cli-sessions-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/cli-sessions-routes.js +449 -0
- package/ccw/dist/core/routes/cli-sessions-routes.js.map +1 -0
- package/ccw/dist/core/routes/cli-settings-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-settings-routes.js +217 -3
- package/ccw/dist/core/routes/cli-settings-routes.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.js +164 -26
- package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/index-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/index-handlers.js +98 -1
- package/ccw/dist/core/routes/codexlens/index-handlers.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/semantic-handlers.js +308 -0
- package/ccw/dist/core/routes/codexlens/semantic-handlers.js.map +1 -1
- package/ccw/dist/core/routes/commands-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/commands-routes.js +399 -1
- package/ccw/dist/core/routes/commands-routes.js.map +1 -1
- package/ccw/dist/core/routes/config-routes.d.ts +22 -0
- package/ccw/dist/core/routes/config-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/config-routes.js +291 -0
- package/ccw/dist/core/routes/config-routes.js.map +1 -0
- package/ccw/dist/core/routes/core-memory-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/core-memory-routes.js +461 -5
- package/ccw/dist/core/routes/core-memory-routes.js.map +1 -1
- package/ccw/dist/core/routes/dashboard-routes.d.ts +15 -0
- package/ccw/dist/core/routes/dashboard-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/dashboard-routes.js +121 -0
- package/ccw/dist/core/routes/dashboard-routes.js.map +1 -0
- package/ccw/dist/core/routes/files-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/files-routes.js +296 -8
- package/ccw/dist/core/routes/files-routes.js.map +1 -1
- package/ccw/dist/core/routes/hooks-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/hooks-routes.js +274 -67
- package/ccw/dist/core/routes/hooks-routes.js.map +1 -1
- package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/issue-routes.js +399 -27
- package/ccw/dist/core/routes/issue-routes.js.map +1 -1
- package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/litellm-api-routes.js +74 -135
- package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
- package/ccw/dist/core/routes/mcp-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/mcp-routes.js +79 -15
- 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 +20 -7
- 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 +137 -0
- package/ccw/dist/core/routes/memory-routes.js.map +1 -1
- package/ccw/dist/core/routes/notification-routes.d.ts +10 -0
- package/ccw/dist/core/routes/notification-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/notification-routes.js +507 -0
- package/ccw/dist/core/routes/notification-routes.js.map +1 -0
- package/ccw/dist/core/routes/orchestrator-routes.d.ts +282 -0
- package/ccw/dist/core/routes/orchestrator-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/orchestrator-routes.js +1564 -0
- package/ccw/dist/core/routes/orchestrator-routes.js.map +1 -0
- package/ccw/dist/core/routes/provider-routes.d.ts +4 -0
- package/ccw/dist/core/routes/provider-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/provider-routes.js +45 -11
- package/ccw/dist/core/routes/provider-routes.js.map +1 -1
- package/ccw/dist/core/routes/queue-routes.d.ts +22 -0
- package/ccw/dist/core/routes/queue-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/queue-routes.js +164 -0
- package/ccw/dist/core/routes/queue-routes.js.map +1 -0
- package/ccw/dist/core/routes/skill-hub-routes.d.ts +77 -0
- package/ccw/dist/core/routes/skill-hub-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/skill-hub-routes.js +988 -0
- package/ccw/dist/core/routes/skill-hub-routes.js.map +1 -0
- package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/skills-routes.js +105 -62
- package/ccw/dist/core/routes/skills-routes.js.map +1 -1
- package/ccw/dist/core/routes/spec-routes.d.ts +7 -0
- package/ccw/dist/core/routes/spec-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/spec-routes.js +266 -0
- package/ccw/dist/core/routes/spec-routes.js.map +1 -0
- package/ccw/dist/core/routes/status-routes.js +4 -4
- package/ccw/dist/core/routes/status-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +537 -6
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/dist/core/routes/team-routes.d.ts +27 -0
- package/ccw/dist/core/routes/team-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/team-routes.js +557 -0
- package/ccw/dist/core/routes/team-routes.js.map +1 -0
- package/ccw/dist/core/routes/unified-memory-routes.d.ts +16 -0
- package/ccw/dist/core/routes/unified-memory-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/unified-memory-routes.js +135 -0
- package/ccw/dist/core/routes/unified-memory-routes.js.map +1 -0
- package/ccw/dist/core/routes/unsplash-routes.d.ts +4 -0
- package/ccw/dist/core/routes/unsplash-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/unsplash-routes.js +197 -0
- package/ccw/dist/core/routes/unsplash-routes.js.map +1 -0
- package/ccw/dist/core/schemas/issue-schema.d.ts +115 -0
- package/ccw/dist/core/schemas/issue-schema.d.ts.map +1 -0
- package/ccw/dist/core/schemas/issue-schema.js +117 -0
- package/ccw/dist/core/schemas/issue-schema.js.map +1 -0
- package/ccw/dist/core/server.d.ts +1 -0
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +223 -218
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/core/services/checkpoint-service.d.ts +215 -0
- package/ccw/dist/core/services/checkpoint-service.d.ts.map +1 -0
- package/ccw/dist/core/services/checkpoint-service.js +376 -0
- package/ccw/dist/core/services/checkpoint-service.js.map +1 -0
- package/ccw/dist/core/services/cli-instruction-assembler.d.ts +10 -0
- package/ccw/dist/core/services/cli-instruction-assembler.d.ts.map +1 -0
- package/ccw/dist/core/services/cli-instruction-assembler.js +28 -0
- package/ccw/dist/core/services/cli-instruction-assembler.js.map +1 -0
- package/ccw/dist/core/services/cli-launch-registry.d.ts +9 -0
- package/ccw/dist/core/services/cli-launch-registry.d.ts.map +1 -0
- package/ccw/dist/core/services/cli-launch-registry.js +40 -0
- package/ccw/dist/core/services/cli-launch-registry.js.map +1 -0
- package/ccw/dist/core/services/cli-session-audit.d.ts +15 -0
- package/ccw/dist/core/services/cli-session-audit.d.ts.map +1 -0
- package/ccw/dist/core/services/cli-session-audit.js +18 -0
- package/ccw/dist/core/services/cli-session-audit.js.map +1 -0
- package/ccw/dist/core/services/cli-session-command-builder.d.ts +20 -0
- package/ccw/dist/core/services/cli-session-command-builder.d.ts.map +1 -0
- package/ccw/dist/core/services/cli-session-command-builder.js +66 -0
- package/ccw/dist/core/services/cli-session-command-builder.js.map +1 -0
- package/ccw/dist/core/services/cli-session-manager.d.ts +84 -0
- package/ccw/dist/core/services/cli-session-manager.d.ts.map +1 -0
- package/ccw/dist/core/services/cli-session-manager.js +538 -0
- package/ccw/dist/core/services/cli-session-manager.js.map +1 -0
- package/ccw/dist/core/services/cli-session-mux.d.ts +18 -0
- package/ccw/dist/core/services/cli-session-mux.d.ts.map +1 -0
- package/ccw/dist/core/services/cli-session-mux.js +18 -0
- package/ccw/dist/core/services/cli-session-mux.js.map +1 -0
- package/ccw/dist/core/services/cli-session-policy.d.ts +15 -0
- package/ccw/dist/core/services/cli-session-policy.d.ts.map +1 -0
- package/ccw/dist/core/services/cli-session-policy.js +40 -0
- package/ccw/dist/core/services/cli-session-policy.js.map +1 -0
- package/ccw/dist/core/services/cli-session-share.d.ts +27 -0
- package/ccw/dist/core/services/cli-session-share.d.ts.map +1 -0
- package/ccw/dist/core/services/cli-session-share.js +85 -0
- package/ccw/dist/core/services/cli-session-share.js.map +1 -0
- package/ccw/dist/core/services/config-backup.d.ts +69 -0
- package/ccw/dist/core/services/config-backup.d.ts.map +1 -0
- package/ccw/dist/core/services/config-backup.js +171 -0
- package/ccw/dist/core/services/config-backup.js.map +1 -0
- package/ccw/dist/core/services/config-sync.d.ts +73 -0
- package/ccw/dist/core/services/config-sync.d.ts.map +1 -0
- package/ccw/dist/core/services/config-sync.js +235 -0
- package/ccw/dist/core/services/config-sync.js.map +1 -0
- package/ccw/dist/core/services/flow-executor.d.ts +204 -0
- package/ccw/dist/core/services/flow-executor.d.ts.map +1 -0
- package/ccw/dist/core/services/flow-executor.js +775 -0
- package/ccw/dist/core/services/flow-executor.js.map +1 -0
- package/ccw/dist/core/services/hook-context-service.d.ts +139 -0
- package/ccw/dist/core/services/hook-context-service.d.ts.map +1 -0
- package/ccw/dist/core/services/hook-context-service.js +248 -0
- package/ccw/dist/core/services/hook-context-service.js.map +1 -0
- package/ccw/dist/core/services/index.d.ts +22 -0
- package/ccw/dist/core/services/index.d.ts.map +1 -0
- package/ccw/dist/core/services/index.js +22 -0
- package/ccw/dist/core/services/index.js.map +1 -0
- package/ccw/dist/core/services/issue-service.d.ts +54 -0
- package/ccw/dist/core/services/issue-service.d.ts.map +1 -0
- package/ccw/dist/core/services/issue-service.js +107 -0
- package/ccw/dist/core/services/issue-service.js.map +1 -0
- package/ccw/dist/core/services/mode-registry-service.d.ts +254 -0
- package/ccw/dist/core/services/mode-registry-service.d.ts.map +1 -0
- package/ccw/dist/core/services/mode-registry-service.js +587 -0
- package/ccw/dist/core/services/mode-registry-service.js.map +1 -0
- package/ccw/dist/core/services/pending-question-service.d.ts +51 -0
- package/ccw/dist/core/services/pending-question-service.d.ts.map +1 -0
- package/ccw/dist/core/services/pending-question-service.js +201 -0
- package/ccw/dist/core/services/pending-question-service.js.map +1 -0
- package/ccw/dist/core/services/queue-scheduler-service.d.ts +136 -0
- package/ccw/dist/core/services/queue-scheduler-service.d.ts.map +1 -0
- package/ccw/dist/core/services/queue-scheduler-service.js +587 -0
- package/ccw/dist/core/services/queue-scheduler-service.js.map +1 -0
- package/ccw/dist/core/services/rate-limiter.d.ts +20 -0
- package/ccw/dist/core/services/rate-limiter.d.ts.map +1 -0
- package/ccw/dist/core/services/rate-limiter.js +33 -0
- package/ccw/dist/core/services/rate-limiter.js.map +1 -0
- package/ccw/dist/core/services/remote-notification-service.d.ts +132 -0
- package/ccw/dist/core/services/remote-notification-service.d.ts.map +1 -0
- package/ccw/dist/core/services/remote-notification-service.js +953 -0
- package/ccw/dist/core/services/remote-notification-service.js.map +1 -0
- package/ccw/dist/core/services/session-end-service.d.ts +155 -0
- package/ccw/dist/core/services/session-end-service.d.ts.map +1 -0
- package/ccw/dist/core/services/session-end-service.js +302 -0
- package/ccw/dist/core/services/session-end-service.js.map +1 -0
- package/ccw/dist/core/services/session-state-service.d.ts +148 -0
- package/ccw/dist/core/services/session-state-service.d.ts.map +1 -0
- package/ccw/dist/core/services/session-state-service.js +259 -0
- package/ccw/dist/core/services/session-state-service.js.map +1 -0
- package/ccw/dist/core/services/version-checker.d.ts +50 -0
- package/ccw/dist/core/services/version-checker.d.ts.map +1 -0
- package/ccw/dist/core/services/version-checker.js +141 -0
- package/ccw/dist/core/services/version-checker.js.map +1 -0
- package/ccw/dist/core/session-clustering-service.d.ts +43 -2
- package/ccw/dist/core/session-clustering-service.d.ts.map +1 -1
- package/ccw/dist/core/session-clustering-service.js +210 -6
- package/ccw/dist/core/session-clustering-service.js.map +1 -1
- package/ccw/dist/core/types/issue.d.ts +103 -0
- package/ccw/dist/core/types/issue.d.ts.map +1 -0
- package/ccw/dist/core/types/issue.js +6 -0
- package/ccw/dist/core/types/issue.js.map +1 -0
- package/ccw/dist/core/unified-context-builder.d.ts +88 -0
- package/ccw/dist/core/unified-context-builder.d.ts.map +1 -0
- package/ccw/dist/core/unified-context-builder.js +379 -0
- package/ccw/dist/core/unified-context-builder.js.map +1 -0
- package/ccw/dist/core/unified-memory-service.d.ts +142 -0
- package/ccw/dist/core/unified-memory-service.d.ts.map +1 -0
- package/ccw/dist/core/unified-memory-service.js +348 -0
- package/ccw/dist/core/unified-memory-service.js.map +1 -0
- package/ccw/dist/core/unified-vector-index.d.ts +171 -0
- package/ccw/dist/core/unified-vector-index.d.ts.map +1 -0
- package/ccw/dist/core/unified-vector-index.js +332 -0
- package/ccw/dist/core/unified-vector-index.js.map +1 -0
- package/ccw/dist/core/websocket.d.ts +195 -0
- package/ccw/dist/core/websocket.d.ts.map +1 -1
- package/ccw/dist/core/websocket.js +156 -25
- package/ccw/dist/core/websocket.js.map +1 -1
- package/ccw/dist/index.d.ts +0 -1
- package/ccw/dist/index.d.ts.map +1 -1
- package/ccw/dist/index.js +0 -1
- package/ccw/dist/index.js.map +1 -1
- package/ccw/dist/mcp-server/index.js +16 -8
- package/ccw/dist/mcp-server/index.js.map +1 -1
- package/ccw/dist/tools/ask-question.d.ts +43 -0
- package/ccw/dist/tools/ask-question.d.ts.map +1 -0
- package/ccw/dist/tools/ask-question.js +1061 -0
- package/ccw/dist/tools/ask-question.js.map +1 -0
- package/ccw/dist/tools/claude-cli-tools.d.ts +18 -4
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +44 -37
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/claude-session-parser.d.ts +116 -0
- package/ccw/dist/tools/claude-session-parser.d.ts.map +1 -0
- package/ccw/dist/tools/claude-session-parser.js +364 -0
- package/ccw/dist/tools/claude-session-parser.js.map +1 -0
- package/ccw/dist/tools/cli-config-manager.d.ts +3 -0
- package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
- package/ccw/dist/tools/cli-config-manager.js +4 -1
- package/ccw/dist/tools/cli-config-manager.js.map +1 -1
- package/ccw/dist/tools/cli-executor-core.d.ts +24 -0
- package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-core.js +103 -8
- package/ccw/dist/tools/cli-executor-core.js.map +1 -1
- package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-state.js +4 -4
- package/ccw/dist/tools/cli-executor-state.js.map +1 -1
- package/ccw/dist/tools/cli-executor-utils.d.ts +2 -0
- package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-utils.js +14 -5
- package/ccw/dist/tools/cli-executor-utils.js.map +1 -1
- package/ccw/dist/tools/cli-history-store.d.ts +11 -6
- package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.js +134 -17
- package/ccw/dist/tools/cli-history-store.js.map +1 -1
- package/ccw/dist/tools/cli-output-converter.d.ts +7 -0
- package/ccw/dist/tools/cli-output-converter.d.ts.map +1 -1
- package/ccw/dist/tools/cli-output-converter.js +166 -16
- package/ccw/dist/tools/cli-output-converter.js.map +1 -1
- package/ccw/dist/tools/codex-lens.d.ts +13 -0
- package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens.js +200 -185
- package/ccw/dist/tools/codex-lens.js.map +1 -1
- package/ccw/dist/tools/command-registry.test.js +727 -0
- package/ccw/dist/tools/core-memory.d.ts +35 -1
- package/ccw/dist/tools/core-memory.d.ts.map +1 -1
- package/ccw/dist/tools/core-memory.js +195 -5
- package/ccw/dist/tools/core-memory.js.map +1 -1
- package/ccw/dist/tools/edit-file.d.ts.map +1 -1
- package/ccw/dist/tools/edit-file.js +69 -31
- package/ccw/dist/tools/edit-file.js.map +1 -1
- package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -1
- package/ccw/dist/tools/generate-module-docs.js +9 -14
- package/ccw/dist/tools/generate-module-docs.js.map +1 -1
- package/ccw/dist/tools/index.d.ts.map +1 -1
- package/ccw/dist/tools/index.js +8 -2
- package/ccw/dist/tools/index.js.map +1 -1
- package/ccw/dist/tools/native-session-discovery.d.ts +19 -2
- package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -1
- package/ccw/dist/tools/native-session-discovery.js +191 -20
- package/ccw/dist/tools/native-session-discovery.js.map +1 -1
- package/ccw/dist/tools/opencode-session-parser.d.ts +120 -0
- package/ccw/dist/tools/opencode-session-parser.d.ts.map +1 -0
- package/ccw/dist/tools/opencode-session-parser.js +330 -0
- package/ccw/dist/tools/opencode-session-parser.js.map +1 -0
- package/ccw/dist/tools/read-file.d.ts +5 -24
- package/ccw/dist/tools/read-file.d.ts.map +1 -1
- package/ccw/dist/tools/read-file.js +44 -282
- package/ccw/dist/tools/read-file.js.map +1 -1
- package/ccw/dist/tools/read-many-files.d.ts +15 -0
- package/ccw/dist/tools/read-many-files.d.ts.map +1 -0
- package/ccw/dist/tools/read-many-files.js +166 -0
- package/ccw/dist/tools/read-many-files.js.map +1 -0
- package/ccw/dist/tools/read-outline.d.ts +13 -0
- package/ccw/dist/tools/read-outline.d.ts.map +1 -0
- package/ccw/dist/tools/read-outline.js +86 -0
- package/ccw/dist/tools/read-outline.js.map +1 -0
- package/ccw/dist/tools/resume-strategy.d.ts.map +1 -1
- package/ccw/dist/tools/resume-strategy.js +16 -0
- package/ccw/dist/tools/resume-strategy.js.map +1 -1
- package/ccw/dist/tools/session-content-parser.d.ts +3 -3
- package/ccw/dist/tools/session-content-parser.d.ts.map +1 -1
- package/ccw/dist/tools/session-content-parser.js +40 -10
- package/ccw/dist/tools/session-content-parser.js.map +1 -1
- package/ccw/dist/tools/spec-index-builder.d.ts +140 -0
- package/ccw/dist/tools/spec-index-builder.d.ts.map +1 -0
- package/ccw/dist/tools/spec-index-builder.js +340 -0
- package/ccw/dist/tools/spec-index-builder.js.map +1 -0
- package/ccw/dist/tools/spec-init.d.ts +46 -0
- package/ccw/dist/tools/spec-init.d.ts.map +1 -0
- package/ccw/dist/tools/spec-init.js +226 -0
- package/ccw/dist/tools/spec-init.js.map +1 -0
- package/ccw/dist/tools/spec-keyword-extractor.d.ts +52 -0
- package/ccw/dist/tools/spec-keyword-extractor.d.ts.map +1 -0
- package/ccw/dist/tools/spec-keyword-extractor.js +183 -0
- package/ccw/dist/tools/spec-keyword-extractor.js.map +1 -0
- package/ccw/dist/tools/spec-loader.d.ts +119 -0
- package/ccw/dist/tools/spec-loader.d.ts.map +1 -0
- package/ccw/dist/tools/spec-loader.js +326 -0
- package/ccw/dist/tools/spec-loader.js.map +1 -0
- package/ccw/dist/tools/team-msg.d.ts +61 -0
- package/ccw/dist/tools/team-msg.d.ts.map +1 -0
- package/ccw/dist/tools/team-msg.js +331 -0
- package/ccw/dist/tools/team-msg.js.map +1 -0
- package/ccw/dist/tools/template-discovery.d.ts +1 -1
- package/ccw/dist/tools/template-discovery.js +2 -2
- package/ccw/dist/tools/template-discovery.js.map +1 -1
- package/ccw/dist/tools/ui-generate-preview.js +7 -7
- package/ccw/dist/tools/ui-generate-preview.js.map +1 -1
- package/ccw/dist/tools/update-module-claude.d.ts.map +1 -1
- package/ccw/dist/tools/update-module-claude.js +18 -32
- package/ccw/dist/tools/update-module-claude.js.map +1 -1
- package/ccw/dist/types/cli-settings.d.ts +139 -9
- package/ccw/dist/types/cli-settings.d.ts.map +1 -1
- package/ccw/dist/types/cli-settings.js +67 -13
- package/ccw/dist/types/cli-settings.js.map +1 -1
- package/ccw/dist/types/queue-types.d.ts +156 -0
- package/ccw/dist/types/queue-types.d.ts.map +1 -0
- package/ccw/dist/types/queue-types.js +6 -0
- package/ccw/dist/types/queue-types.js.map +1 -0
- package/ccw/dist/types/remote-notification.d.ts +209 -0
- package/ccw/dist/types/remote-notification.d.ts.map +1 -0
- package/ccw/dist/types/remote-notification.js +86 -0
- package/ccw/dist/types/remote-notification.js.map +1 -0
- package/ccw/dist/types/util.d.ts +28 -0
- package/ccw/dist/types/util.d.ts.map +1 -0
- package/ccw/dist/types/util.js +35 -0
- package/ccw/dist/types/util.js.map +1 -0
- package/ccw/dist/utils/dashboard-launcher.d.ts +36 -0
- package/ccw/dist/utils/dashboard-launcher.d.ts.map +1 -0
- package/ccw/dist/utils/dashboard-launcher.js +166 -0
- package/ccw/dist/utils/dashboard-launcher.js.map +1 -0
- package/ccw/dist/utils/db-loader.d.ts +15 -0
- package/ccw/dist/utils/db-loader.d.ts.map +1 -0
- package/ccw/dist/utils/db-loader.js +51 -0
- package/ccw/dist/utils/db-loader.js.map +1 -0
- package/ccw/dist/utils/file-reader.d.ts +73 -0
- package/ccw/dist/utils/file-reader.d.ts.map +1 -0
- package/ccw/dist/utils/file-reader.js +201 -0
- package/ccw/dist/utils/file-reader.js.map +1 -0
- package/ccw/dist/utils/outline-parser.d.ts +28 -0
- package/ccw/dist/utils/outline-parser.d.ts.map +1 -0
- package/ccw/dist/utils/outline-parser.js +273 -0
- package/ccw/dist/utils/outline-parser.js.map +1 -0
- package/ccw/dist/utils/outline-queries.d.ts +15 -0
- package/ccw/dist/utils/outline-queries.d.ts.map +1 -0
- package/ccw/dist/utils/outline-queries.js +141 -0
- package/ccw/dist/utils/outline-queries.js.map +1 -0
- package/ccw/dist/utils/package-discovery.d.ts +69 -0
- package/ccw/dist/utils/package-discovery.d.ts.map +1 -0
- package/ccw/dist/utils/package-discovery.js +258 -0
- package/ccw/dist/utils/package-discovery.js.map +1 -0
- package/ccw/dist/utils/path-validator.d.ts +3 -3
- package/ccw/dist/utils/path-validator.d.ts.map +1 -1
- package/ccw/dist/utils/path-validator.js +12 -12
- package/ccw/dist/utils/path-validator.js.map +1 -1
- package/ccw/dist/utils/react-frontend.d.ts +19 -0
- package/ccw/dist/utils/react-frontend.d.ts.map +1 -0
- package/ccw/dist/utils/react-frontend.js +203 -0
- package/ccw/dist/utils/react-frontend.js.map +1 -0
- package/ccw/dist/utils/secret-redactor.d.ts +23 -0
- package/ccw/dist/utils/secret-redactor.d.ts.map +1 -0
- package/ccw/dist/utils/secret-redactor.js +48 -0
- package/ccw/dist/utils/secret-redactor.js.map +1 -0
- package/ccw/dist/utils/security-validation.d.ts +48 -0
- package/ccw/dist/utils/security-validation.d.ts.map +1 -0
- package/ccw/dist/utils/security-validation.js +117 -0
- package/ccw/dist/utils/security-validation.js.map +1 -0
- package/ccw/dist/utils/uv-manager.d.ts +3 -2
- package/ccw/dist/utils/uv-manager.d.ts.map +1 -1
- package/ccw/dist/utils/uv-manager.js +7 -4
- package/ccw/dist/utils/uv-manager.js.map +1 -1
- package/ccw/scripts/prepublish-clean.mjs +32 -0
- package/ccw/scripts/unified_memory_embedder.py +473 -0
- package/codex-lens/pyproject.toml +37 -46
- package/codex-lens/src/codexlens/api/__init__.py +5 -0
- package/codex-lens/src/codexlens/api/lsp_lifecycle.py +124 -0
- package/codex-lens/src/codexlens/api/semantic.py +33 -22
- package/codex-lens/src/codexlens/cli/commands.py +392 -552
- package/codex-lens/src/codexlens/cli/embedding_manager.py +558 -367
- package/codex-lens/src/codexlens/config.py +525 -129
- package/codex-lens/src/codexlens/env_config.py +21 -1
- package/codex-lens/src/codexlens/lsp/keepalive_bridge.py +135 -0
- package/codex-lens/src/codexlens/lsp/lsp_bridge.py +33 -10
- package/codex-lens/src/codexlens/lsp/lsp_graph_builder.py +12 -4
- package/codex-lens/src/codexlens/lsp/standalone_manager.py +114 -21
- package/codex-lens/src/codexlens/parsers/__init__.py +8 -2
- package/codex-lens/src/codexlens/parsers/astgrep_binding.py +320 -0
- package/codex-lens/src/codexlens/parsers/astgrep_js_ts_processor.py +306 -0
- package/codex-lens/src/codexlens/parsers/astgrep_processor.py +1033 -0
- package/codex-lens/src/codexlens/parsers/factory.py +10 -2
- package/codex-lens/src/codexlens/parsers/patterns/__init__.py +5 -0
- package/codex-lens/src/codexlens/parsers/patterns/javascript/__init__.py +92 -0
- package/codex-lens/src/codexlens/parsers/patterns/python/__init__.py +204 -0
- package/codex-lens/src/codexlens/parsers/patterns/python/call.yaml +87 -0
- package/codex-lens/src/codexlens/parsers/patterns/python/imports.yaml +82 -0
- package/codex-lens/src/codexlens/parsers/patterns/python/inherits.yaml +42 -0
- package/codex-lens/src/codexlens/parsers/patterns/typescript/__init__.py +73 -0
- package/codex-lens/src/codexlens/parsers/treesitter_parser.py +135 -9
- package/codex-lens/src/codexlens/search/__init__.py +2 -0
- package/codex-lens/src/codexlens/search/binary_searcher.py +67 -35
- package/codex-lens/src/codexlens/search/chain_search.py +825 -251
- package/codex-lens/src/codexlens/search/clustering/hdbscan_strategy.py +24 -2
- package/codex-lens/src/codexlens/search/global_graph_expander.py +250 -0
- package/codex-lens/src/codexlens/search/hybrid_search.py +11 -203
- package/codex-lens/src/codexlens/search/ranking.py +8 -35
- package/codex-lens/src/codexlens/semantic/reranker/api_reranker.py +41 -2
- package/codex-lens/src/codexlens/storage/global_index.py +225 -5
- package/codex-lens/src/codexlens/storage/index_tree.py +46 -0
- package/codex-lens/src/codexlens/storage/path_mapper.py +8 -8
- package/codex-lens/src/codexlens/watcher/incremental_indexer.py +55 -1
- package/package.json +102 -92
- package/.claude/CLAUDE.md +0 -44
- package/.claude/commands/ccw-debug.md +0 -832
- package/.claude/commands/codex-coordinator.md +0 -513
- package/.claude/commands/memory/compact.md +0 -383
- package/.claude/commands/memory/docs-full-cli.md +0 -471
- package/.claude/commands/memory/docs-related-cli.md +0 -386
- package/.claude/commands/memory/load.md +0 -240
- package/.claude/commands/memory/tips.md +0 -332
- package/.claude/commands/memory/update-full.md +0 -332
- package/.claude/commands/memory/update-related.md +0 -332
- package/.claude/commands/view.md +0 -367
- package/.claude/commands/workflow/brainstorm/artifacts.md +0 -457
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +0 -433
- package/.claude/commands/workflow/brainstorm/role-analysis.md +0 -705
- package/.claude/commands/workflow/brainstorm/synthesis.md +0 -402
- package/.claude/commands/workflow/execute.md +0 -548
- package/.claude/commands/workflow/lite-execute.md +0 -743
- package/.claude/commands/workflow/lite-fix.md +0 -809
- package/.claude/commands/workflow/lite-lite-lite.md +0 -465
- package/.claude/commands/workflow/lite-plan.md +0 -698
- package/.claude/commands/workflow/multi-cli-plan.md +0 -572
- package/.claude/commands/workflow/plan-verify.md +0 -362
- package/.claude/commands/workflow/plan.md +0 -691
- package/.claude/commands/workflow/replan.md +0 -648
- package/.claude/commands/workflow/review-cycle-fix.md +0 -608
- package/.claude/commands/workflow/review-module-cycle.md +0 -771
- package/.claude/commands/workflow/review-session-cycle.md +0 -782
- package/.claude/commands/workflow/review.md +0 -322
- package/.claude/commands/workflow/tdd-plan.md +0 -630
- package/.claude/commands/workflow/tdd-verify.md +0 -585
- package/.claude/commands/workflow/test-cycle-execute.md +0 -504
- package/.claude/commands/workflow/test-fix-gen.md +0 -699
- package/.claude/commands/workflow/test-gen.md +0 -529
- package/.claude/commands/workflow/tools/conflict-resolution.md +0 -604
- package/.claude/commands/workflow/tools/context-gather.md +0 -404
- package/.claude/commands/workflow/tools/task-generate-agent.md +0 -667
- package/.claude/commands/workflow/tools/task-generate-tdd.md +0 -749
- package/.claude/commands/workflow/tools/tdd-coverage-analysis.md +0 -309
- package/.claude/commands/workflow/tools/test-concept-enhanced.md +0 -164
- package/.claude/commands/workflow/tools/test-context-gather.md +0 -235
- package/.claude/commands/workflow/tools/test-task-generate.md +0 -255
- package/.claude/skills/ccw-loop/SKILL.md +0 -259
- package/.claude/skills/ccw-loop/phases/actions/action-complete.md +0 -320
- package/.claude/skills/ccw-loop/phases/actions/action-debug-with-file.md +0 -485
- package/.claude/skills/ccw-loop/phases/actions/action-develop-with-file.md +0 -365
- package/.claude/skills/ccw-loop/phases/actions/action-init.md +0 -200
- package/.claude/skills/ccw-loop/phases/actions/action-menu.md +0 -192
- package/.claude/skills/ccw-loop/phases/actions/action-validate-with-file.md +0 -307
- package/.claude/skills/ccw-loop/phases/orchestrator.md +0 -486
- package/.claude/skills/ccw-loop/phases/state-schema.md +0 -474
- package/.claude/skills/ccw-loop/specs/action-catalog.md +0 -300
- package/.claude/skills/ccw-loop/specs/loop-requirements.md +0 -192
- package/.claude/skills/ccw-loop/templates/progress-template.md +0 -175
- package/.claude/skills/ccw-loop/templates/understanding-template.md +0 -303
- package/.claude/skills/ccw-loop/templates/validation-template.md +0 -258
- package/.claude/skills/copyright-docs/SKILL.md +0 -132
- package/.claude/skills/copyright-docs/phases/01-metadata-collection.md +0 -78
- package/.claude/skills/copyright-docs/phases/01.5-project-exploration.md +0 -150
- package/.claude/skills/copyright-docs/phases/02-deep-analysis.md +0 -664
- package/.claude/skills/copyright-docs/phases/02.5-consolidation.md +0 -192
- package/.claude/skills/copyright-docs/phases/04-document-assembly.md +0 -261
- package/.claude/skills/copyright-docs/phases/05-compliance-refinement.md +0 -192
- package/.claude/skills/copyright-docs/specs/cpcc-requirements.md +0 -121
- package/.claude/skills/copyright-docs/templates/agent-base.md +0 -200
- package/.claude/skills/lite-skill-generator/SKILL.md +0 -650
- package/.claude/skills/lite-skill-generator/templates/simple-skill.md +0 -68
- package/.claude/skills/lite-skill-generator/templates/style-guide.md +0 -64
- package/.claude/skills/project-analyze/SKILL.md +0 -162
- package/.claude/skills/project-analyze/phases/01-requirements-discovery.md +0 -79
- package/.claude/skills/project-analyze/phases/02-project-exploration.md +0 -176
- package/.claude/skills/project-analyze/phases/03-deep-analysis.md +0 -854
- package/.claude/skills/project-analyze/phases/03.5-consolidation.md +0 -233
- package/.claude/skills/project-analyze/phases/04-report-generation.md +0 -217
- package/.claude/skills/project-analyze/phases/05-iterative-refinement.md +0 -124
- package/.claude/skills/project-analyze/specs/quality-standards.md +0 -115
- package/.claude/skills/project-analyze/specs/writing-style.md +0 -152
- package/.claude/skills/prompt-enhancer/SKILL.md +0 -124
- package/.claude/skills/software-manual/SKILL.md +0 -184
- package/.claude/skills/software-manual/phases/01-requirements-discovery.md +0 -162
- package/.claude/skills/software-manual/phases/02-project-exploration.md +0 -101
- package/.claude/skills/software-manual/phases/02.5-api-extraction.md +0 -161
- package/.claude/skills/software-manual/phases/03-parallel-analysis.md +0 -183
- package/.claude/skills/software-manual/phases/03.5-consolidation.md +0 -82
- package/.claude/skills/software-manual/phases/04-screenshot-capture.md +0 -89
- package/.claude/skills/software-manual/phases/05-html-assembly.md +0 -132
- package/.claude/skills/software-manual/phases/06-iterative-refinement.md +0 -259
- package/.claude/skills/software-manual/scripts/api-extractor.md +0 -245
- package/.claude/skills/software-manual/scripts/assemble_docsify.py +0 -584
- package/.claude/skills/software-manual/scripts/bundle-libraries.md +0 -85
- package/.claude/skills/software-manual/scripts/extract_apis.py +0 -270
- package/.claude/skills/software-manual/scripts/screenshot-helper.md +0 -447
- package/.claude/skills/software-manual/scripts/swagger-runner.md +0 -419
- package/.claude/skills/software-manual/scripts/typedoc-runner.md +0 -357
- package/.claude/skills/software-manual/specs/html-template.md +0 -325
- package/.claude/skills/software-manual/specs/quality-standards.md +0 -253
- package/.claude/skills/software-manual/specs/writing-style.md +0 -298
- package/.claude/skills/software-manual/templates/css/docsify-base.css +0 -984
- package/.claude/skills/software-manual/templates/css/wiki-base.css +0 -788
- package/.claude/skills/software-manual/templates/css/wiki-dark.css +0 -278
- package/.claude/skills/software-manual/templates/docsify-shell.html +0 -466
- package/.claude/skills/software-manual/templates/tiddlywiki-shell.html +0 -327
- package/.claude/skills/text-formatter/SKILL.md +0 -196
- package/.claude/skills/text-formatter/phases/01-input-collection.md +0 -111
- package/.claude/skills/text-formatter/phases/02-content-analysis.md +0 -248
- package/.claude/skills/text-formatter/phases/03-format-transform.md +0 -245
- package/.claude/skills/text-formatter/phases/04-output-preview.md +0 -183
- package/.claude/skills/text-formatter/specs/callout-types.md +0 -293
- package/.claude/skills/text-formatter/specs/element-mapping.md +0 -226
- package/.claude/skills/text-formatter/specs/format-rules.md +0 -273
- package/.claude/skills/text-formatter/templates/bbcode-template.md +0 -350
- package/.claude/workflows/_template-compare-matrix.html +0 -692
- package/.claude/workflows/chinese-response.md +0 -25
- package/.claude/workflows/cli-templates/fix-plan-template.json +0 -75
- package/.claude/workflows/cli-templates/fix-progress-template.json +0 -48
- package/.claude/workflows/cli-templates/memory/style-skill-memory/skill-md-template.md +0 -299
- package/.claude/workflows/cli-templates/planning-roles/data-architect.md +0 -120
- package/.claude/workflows/cli-templates/planning-roles/product-manager.md +0 -119
- package/.claude/workflows/cli-templates/planning-roles/product-owner.md +0 -261
- package/.claude/workflows/cli-templates/planning-roles/scrum-master.md +0 -186
- package/.claude/workflows/cli-templates/planning-roles/subject-matter-expert.md +0 -281
- package/.claude/workflows/cli-templates/planning-roles/synthesis-role.md +0 -414
- package/.claude/workflows/cli-templates/planning-roles/system-architect.md +0 -106
- package/.claude/workflows/cli-templates/planning-roles/test-strategist.md +0 -124
- package/.claude/workflows/cli-templates/planning-roles/ui-designer.md +0 -379
- package/.claude/workflows/cli-templates/planning-roles/ux-expert.md +0 -240
- package/.claude/workflows/cli-templates/prompts/analysis-analyze-code-patterns.txt +0 -37
- package/.claude/workflows/cli-templates/prompts/analysis-analyze-performance.txt +0 -29
- package/.claude/workflows/cli-templates/prompts/analysis-analyze-technical-document.txt +0 -33
- package/.claude/workflows/cli-templates/prompts/analysis-assess-security-risks.txt +0 -29
- package/.claude/workflows/cli-templates/prompts/analysis-diagnose-bug-root-cause.txt +0 -127
- package/.claude/workflows/cli-templates/prompts/analysis-review-architecture.txt +0 -29
- package/.claude/workflows/cli-templates/prompts/analysis-review-code-quality.txt +0 -28
- package/.claude/workflows/cli-templates/prompts/analysis-review-quality-standards.txt +0 -29
- package/.claude/workflows/cli-templates/prompts/analysis-trace-code-execution.txt +0 -115
- package/.claude/workflows/cli-templates/prompts/development-debug-runtime-issues.txt +0 -55
- package/.claude/workflows/cli-templates/prompts/development-generate-tests.txt +0 -70
- package/.claude/workflows/cli-templates/prompts/development-implement-component-ui.txt +0 -55
- package/.claude/workflows/cli-templates/prompts/development-implement-feature.txt +0 -58
- package/.claude/workflows/cli-templates/prompts/development-refactor-codebase.txt +0 -55
- package/.claude/workflows/cli-templates/prompts/documentation-api.txt +0 -15
- package/.claude/workflows/cli-templates/prompts/documentation-folder-navigation.txt +0 -27
- package/.claude/workflows/cli-templates/prompts/documentation-module-readme.txt +0 -49
- package/.claude/workflows/cli-templates/prompts/documentation-project-architecture.txt +0 -41
- package/.claude/workflows/cli-templates/prompts/documentation-project-examples.txt +0 -35
- package/.claude/workflows/cli-templates/prompts/documentation-project-readme.txt +0 -35
- package/.claude/workflows/cli-templates/prompts/documentation-swagger-api.txt +0 -266
- package/.claude/workflows/cli-templates/prompts/memory-document-module-structure.txt +0 -165
- package/.claude/workflows/cli-templates/prompts/planning-breakdown-task-steps.txt +0 -30
- package/.claude/workflows/cli-templates/prompts/planning-design-component-spec.txt +0 -28
- package/.claude/workflows/cli-templates/prompts/planning-evaluate-concept-feasibility.txt +0 -127
- package/.claude/workflows/cli-templates/prompts/planning-plan-architecture-design.txt +0 -109
- package/.claude/workflows/cli-templates/prompts/planning-plan-migration-strategy.txt +0 -30
- package/.claude/workflows/cli-templates/prompts/rules-rule-api.txt +0 -122
- package/.claude/workflows/cli-templates/prompts/rules-rule-components.txt +0 -122
- package/.claude/workflows/cli-templates/prompts/rules-rule-config.txt +0 -89
- package/.claude/workflows/cli-templates/prompts/rules-rule-core.txt +0 -60
- package/.claude/workflows/cli-templates/prompts/rules-rule-patterns.txt +0 -70
- package/.claude/workflows/cli-templates/prompts/rules-rule-testing.txt +0 -81
- package/.claude/workflows/cli-templates/prompts/rules-tech-rules-agent-prompt.txt +0 -89
- package/.claude/workflows/cli-templates/prompts/tech-tech-module-format.txt +0 -359
- package/.claude/workflows/cli-templates/prompts/tech-tech-skill-index.txt +0 -185
- package/.claude/workflows/cli-templates/prompts/test-test-concept-analysis.txt +0 -179
- package/.claude/workflows/cli-templates/prompts/universal-universal-creative-style.txt +0 -95
- package/.claude/workflows/cli-templates/prompts/universal-universal-rigorous-style.txt +0 -92
- package/.claude/workflows/cli-templates/prompts/verification-codex-technical.txt +0 -28
- package/.claude/workflows/cli-templates/prompts/verification-cross-validation.txt +0 -28
- package/.claude/workflows/cli-templates/prompts/verification-gemini-strategic.txt +0 -27
- package/.claude/workflows/cli-templates/prompts/workflow-analysis-results-structure.txt +0 -224
- package/.claude/workflows/cli-templates/prompts/workflow-codex-feasibility-validation.txt +0 -176
- package/.claude/workflows/cli-templates/prompts/workflow-gemini-solution-design.txt +0 -131
- package/.claude/workflows/cli-templates/prompts/workflow-impl-plan-template.txt +0 -286
- package/.claude/workflows/cli-templates/prompts/workflow-skill-aggregation.txt +0 -172
- package/.claude/workflows/cli-templates/prompts/workflow-skill-conflict-patterns.txt +0 -94
- package/.claude/workflows/cli-templates/prompts/workflow-skill-index.txt +0 -224
- package/.claude/workflows/cli-templates/prompts/workflow-skill-lessons-learned.txt +0 -94
- package/.claude/workflows/cli-templates/prompts/workflow-skill-sessions-timeline.txt +0 -53
- package/.claude/workflows/cli-templates/prompts/workflow-task-json-agent-mode.txt +0 -123
- package/.claude/workflows/cli-templates/prompts/workflow-task-json-cli-mode.txt +0 -182
- package/.claude/workflows/cli-templates/protocols/analysis-protocol.md +0 -119
- package/.claude/workflows/cli-templates/protocols/write-protocol.md +0 -136
- package/.claude/workflows/cli-templates/schemas/conflict-resolution-schema.json +0 -151
- package/.claude/workflows/cli-templates/schemas/debug-log-json-schema.json +0 -127
- package/.claude/workflows/cli-templates/schemas/diagnosis-json-schema.json +0 -234
- package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +0 -219
- package/.claude/workflows/cli-templates/schemas/discovery-state-schema.json +0 -125
- package/.claude/workflows/cli-templates/schemas/explore-json-schema.json +0 -124
- package/.claude/workflows/cli-templates/schemas/fix-plan-json-schema.json +0 -298
- package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +0 -170
- package/.claude/workflows/cli-templates/schemas/multi-cli-discussion-schema.json +0 -421
- package/.claude/workflows/cli-templates/schemas/plan-json-schema.json +0 -444
- package/.claude/workflows/cli-templates/schemas/plan-verify-agent-schema.json +0 -47
- package/.claude/workflows/cli-templates/schemas/project-guidelines-schema.json +0 -141
- package/.claude/workflows/cli-templates/schemas/project-tech-schema.json +0 -221
- package/.claude/workflows/cli-templates/schemas/queue-schema.json +0 -248
- package/.claude/workflows/cli-templates/schemas/registry-schema.json +0 -94
- package/.claude/workflows/cli-templates/schemas/review-deep-dive-results-schema.json +0 -82
- package/.claude/workflows/cli-templates/schemas/review-dimension-results-schema.json +0 -51
- package/.claude/workflows/cli-templates/schemas/solution-schema.json +0 -166
- package/.claude/workflows/cli-templates/schemas/verify-json-schema.json +0 -158
- package/.claude/workflows/cli-templates/tech-stacks/go-dev.md +0 -91
- package/.claude/workflows/cli-templates/tech-stacks/java-dev.md +0 -107
- package/.claude/workflows/cli-templates/tech-stacks/javascript-dev.md +0 -58
- package/.claude/workflows/cli-templates/tech-stacks/python-dev.md +0 -79
- package/.claude/workflows/cli-templates/tech-stacks/react-dev.md +0 -103
- package/.claude/workflows/cli-templates/tech-stacks/typescript-dev.md +0 -83
- package/.claude/workflows/cli-templates/ui-design/systems/animation-tokens.json +0 -247
- package/.claude/workflows/cli-templates/ui-design/systems/design-tokens.json +0 -342
- package/.claude/workflows/cli-templates/ui-design/systems/layout-templates.json +0 -145
- package/.claude/workflows/cli-tools-usage.md +0 -538
- package/.claude/workflows/coding-philosophy.md +0 -70
- package/.claude/workflows/context-tools.md +0 -76
- package/.claude/workflows/file-modification.md +0 -64
- package/.claude/workflows/review-directory-specification.md +0 -336
- package/.claude/workflows/task-core.md +0 -214
- package/.claude/workflows/tool-strategy.md +0 -216
- package/.claude/workflows/windows-platform.md +0 -19
- package/.claude/workflows/workflow-architecture.md +0 -942
- package/.codex/agents/ccw-loop-b-complete.md +0 -227
- package/.codex/agents/ccw-loop-b-debug.md +0 -172
- package/.codex/agents/ccw-loop-b-develop.md +0 -147
- package/.codex/agents/ccw-loop-b-init.md +0 -82
- package/.codex/agents/ccw-loop-b-validate.md +0 -204
- package/.codex/agents/ccw-loop-executor.md +0 -260
- package/.codex/prompts/analyze-with-file.md +0 -610
- package/.codex/prompts/brainstorm-to-cycle.md +0 -456
- package/.codex/prompts/brainstorm-with-file.md +0 -1004
- package/.codex/prompts/clean.md +0 -414
- package/.codex/prompts/compact.md +0 -380
- package/.codex/prompts/debug-with-file.md +0 -608
- package/.codex/prompts/execute.md +0 -277
- package/.codex/prompts/issue-discover-by-prompt.md +0 -364
- package/.codex/prompts/issue-discover.md +0 -261
- package/.codex/prompts/issue-execute.md +0 -768
- package/.codex/prompts/issue-new.md +0 -390
- package/.codex/prompts/issue-plan.md +0 -246
- package/.codex/prompts/issue-queue.md +0 -298
- package/.codex/prompts/lite-execute.md +0 -684
- package/.codex/prompts/lite-fix.md +0 -674
- package/.codex/prompts/lite-plan-a.md +0 -341
- package/.codex/prompts/lite-plan-b.md +0 -489
- package/.codex/prompts/lite-plan-c.md +0 -605
- package/.codex/prompts/merge-plans-with-file.md +0 -530
- package/.codex/prompts/unified-execute-with-file.md +0 -722
- package/.codex/skills/ccw-loop/README.md +0 -171
- package/.codex/skills/ccw-loop/SKILL.md +0 -350
- package/.codex/skills/ccw-loop/phases/actions/action-complete.md +0 -269
- package/.codex/skills/ccw-loop/phases/actions/action-debug.md +0 -286
- package/.codex/skills/ccw-loop/phases/actions/action-develop.md +0 -183
- package/.codex/skills/ccw-loop/phases/actions/action-init.md +0 -164
- package/.codex/skills/ccw-loop/phases/actions/action-menu.md +0 -205
- package/.codex/skills/ccw-loop/phases/actions/action-validate.md +0 -250
- package/.codex/skills/ccw-loop/phases/orchestrator.md +0 -416
- package/.codex/skills/ccw-loop/phases/state-schema.md +0 -388
- package/.codex/skills/ccw-loop/specs/action-catalog.md +0 -182
- package/.codex/skills/ccw-loop-b/README.md +0 -301
- package/.codex/skills/ccw-loop-b/SKILL.md +0 -323
- package/.codex/skills/ccw-loop-b/phases/orchestrator.md +0 -257
- package/.codex/skills/ccw-loop-b/phases/state-schema.md +0 -181
- package/.codex/skills/ccw-loop-b/specs/action-catalog.md +0 -383
- package/.codex/skills/codex-issue-plan-execute/SKILL.md +0 -214
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-complete.md +0 -173
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-execute.md +0 -220
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-init.md +0 -86
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-list.md +0 -165
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-plan.md +0 -170
- package/.codex/skills/codex-issue-plan-execute/phases/orchestrator.md +0 -212
- package/.codex/skills/codex-issue-plan-execute/phases/state-schema.md +0 -136
- package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent-system.md +0 -32
- package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent.md +0 -323
- package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent-system.md +0 -32
- package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent.md +0 -224
- package/.codex/skills/codex-issue-plan-execute/specs/agent-roles.md +0 -468
- package/.codex/skills/codex-issue-plan-execute/specs/issue-handling.md +0 -187
- package/.codex/skills/codex-issue-plan-execute/specs/quality-standards.md +0 -231
- package/.codex/skills/codex-issue-plan-execute/specs/solution-schema.md +0 -270
- package/.codex/skills/codex-issue-plan-execute/specs/subagent-roles.md +0 -32
- package/.codex/skills/parallel-dev-cycle/README.md +0 -385
- package/.codex/skills/parallel-dev-cycle/phases/agents/code-developer.md +0 -327
- package/.codex/skills/parallel-dev-cycle/phases/agents/exploration-planner.md +0 -285
- package/.codex/skills/parallel-dev-cycle/phases/agents/requirements-analyst.md +0 -370
- package/.codex/skills/parallel-dev-cycle/phases/agents/validation-archivist.md +0 -381
- package/.codex/skills/parallel-dev-cycle/phases/orchestrator.md +0 -696
- package/.codex/skills/parallel-dev-cycle/phases/state-schema.md +0 -436
- package/.codex/skills/parallel-dev-cycle/skill.md +0 -194
- package/.codex/skills/parallel-dev-cycle/specs/communication-optimization.md +0 -423
- package/.codex/skills/parallel-dev-cycle/specs/coordination-protocol.md +0 -406
- package/.codex/skills/parallel-dev-cycle/specs/versioning-strategy.md +0 -331
- package/ccw/dist/core/dashboard-generator-patch.d.ts +0 -2
- package/ccw/dist/core/dashboard-generator-patch.d.ts.map +0 -1
- package/ccw/dist/core/dashboard-generator-patch.js +0 -48
- package/ccw/dist/core/dashboard-generator-patch.js.map +0 -1
- package/ccw/dist/core/dashboard-generator.d.ts +0 -8
- package/ccw/dist/core/dashboard-generator.d.ts.map +0 -1
- package/ccw/dist/core/dashboard-generator.js +0 -706
- package/ccw/dist/core/dashboard-generator.js.map +0 -1
- package/ccw/dist/core/routes/model-routes.d.ts +0 -11
- package/ccw/dist/core/routes/model-routes.d.ts.map +0 -1
- package/ccw/dist/core/routes/model-routes.js +0 -112
- package/ccw/dist/core/routes/model-routes.js.map +0 -1
- package/ccw/dist/tools/command-registry.test.d.ts +0 -14
- package/ccw/dist/tools/command-registry.test.d.ts.map +0 -1
- package/ccw/dist/tools/command-registry.test.js.map +0 -1
- package/ccw/scripts/__pycache__/memory_embedder.cpython-313.pyc +0 -0
- package/ccw/scripts/__pycache__/test_memory_embedder.cpython-313-pytest-8.4.2.pyc +0 -0
- package/ccw/src/.workflow/.cli-history/history.db +0 -0
- package/ccw/src/.workflow/.cli-history/history.db-shm +0 -0
- package/ccw/src/.workflow/.cli-history/history.db-wal +0 -0
- package/ccw/src/cli.ts +0 -326
- package/ccw/src/commands/cli.ts +0 -1492
- package/ccw/src/commands/core-memory.ts +0 -770
- package/ccw/src/commands/hook.ts +0 -316
- package/ccw/src/commands/install.ts +0 -799
- package/ccw/src/commands/issue.ts +0 -3150
- package/ccw/src/commands/list.ts +0 -37
- package/ccw/src/commands/loop.ts +0 -344
- package/ccw/src/commands/memory.ts +0 -1090
- package/ccw/src/commands/serve.ts +0 -86
- package/ccw/src/commands/session-path-resolver.ts +0 -372
- package/ccw/src/commands/session.ts +0 -1141
- package/ccw/src/commands/stop.ts +0 -138
- package/ccw/src/commands/tool.ts +0 -216
- package/ccw/src/commands/uninstall.ts +0 -309
- package/ccw/src/commands/upgrade.ts +0 -352
- package/ccw/src/commands/view.ts +0 -133
- package/ccw/src/commands/workflow.ts +0 -348
- package/ccw/src/config/.litellm-api-config-manager.ts.2025-12-23T11-57-43-727Z.bak +0 -441
- package/ccw/src/config/cli-settings-manager.ts +0 -460
- package/ccw/src/config/litellm-api-config-manager.ts +0 -1350
- package/ccw/src/config/litellm-provider-models.ts +0 -222
- package/ccw/src/config/provider-models.ts +0 -123
- package/ccw/src/config/storage-paths.ts +0 -685
- package/ccw/src/core/auth/csrf-manager.ts +0 -104
- package/ccw/src/core/auth/csrf-middleware.ts +0 -161
- package/ccw/src/core/auth/middleware.ts +0 -94
- package/ccw/src/core/auth/token-manager.ts +0 -219
- package/ccw/src/core/cache-manager.ts +0 -304
- package/ccw/src/core/claude-freshness.ts +0 -339
- package/ccw/src/core/core-memory-store.ts +0 -1529
- package/ccw/src/core/cors.ts +0 -10
- package/ccw/src/core/dashboard-generator-patch.ts +0 -47
- package/ccw/src/core/dashboard-generator.ts +0 -802
- package/ccw/src/core/data-aggregator.ts +0 -690
- package/ccw/src/core/history-importer.ts +0 -625
- package/ccw/src/core/lite-scanner-complete.ts +0 -473
- package/ccw/src/core/lite-scanner.ts +0 -978
- package/ccw/src/core/manifest.ts +0 -271
- package/ccw/src/core/memory-embedder-bridge.ts +0 -258
- package/ccw/src/core/memory-store.ts +0 -978
- package/ccw/src/core/routes/auth-routes.ts +0 -98
- package/ccw/src/core/routes/ccw-routes.ts +0 -86
- package/ccw/src/core/routes/claude-routes.ts +0 -1512
- package/ccw/src/core/routes/cli-routes.ts +0 -1002
- package/ccw/src/core/routes/cli-settings-routes.ts +0 -279
- package/ccw/src/core/routes/codexlens/README.md +0 -37
- package/ccw/src/core/routes/codexlens/config-handlers.ts +0 -1273
- package/ccw/src/core/routes/codexlens/index-handlers.ts +0 -354
- package/ccw/src/core/routes/codexlens/semantic-handlers.ts +0 -932
- package/ccw/src/core/routes/codexlens/utils.ts +0 -96
- package/ccw/src/core/routes/codexlens/watcher-handlers.ts +0 -265
- package/ccw/src/core/routes/codexlens-routes.ts +0 -23
- package/ccw/src/core/routes/commands-routes.ts +0 -620
- package/ccw/src/core/routes/core-memory-routes.ts +0 -607
- package/ccw/src/core/routes/discovery-routes.ts +0 -664
- package/ccw/src/core/routes/files-routes.ts +0 -502
- package/ccw/src/core/routes/graph-routes.md +0 -164
- package/ccw/src/core/routes/graph-routes.ts +0 -635
- package/ccw/src/core/routes/help-routes.ts +0 -508
- package/ccw/src/core/routes/hooks-routes.ts +0 -473
- package/ccw/src/core/routes/issue-routes.ts +0 -1547
- package/ccw/src/core/routes/litellm-api-routes.ts +0 -1482
- package/ccw/src/core/routes/litellm-routes.ts +0 -115
- package/ccw/src/core/routes/loop-routes.ts +0 -386
- package/ccw/src/core/routes/loop-v2-routes.ts +0 -1470
- package/ccw/src/core/routes/mcp-routes.ts +0 -1372
- package/ccw/src/core/routes/mcp-templates-db.ts +0 -267
- package/ccw/src/core/routes/memory-routes.ts +0 -1345
- package/ccw/src/core/routes/nav-status-routes.ts +0 -325
- package/ccw/src/core/routes/provider-routes.ts +0 -78
- package/ccw/src/core/routes/rules-routes.ts +0 -1064
- package/ccw/src/core/routes/session-routes.ts +0 -649
- package/ccw/src/core/routes/skills-routes.ts +0 -1278
- package/ccw/src/core/routes/status-routes.ts +0 -132
- package/ccw/src/core/routes/system-routes.ts +0 -575
- package/ccw/src/core/routes/task-routes.ts +0 -361
- package/ccw/src/core/routes/test-loop-routes.ts +0 -312
- package/ccw/src/core/routes/types.ts +0 -25
- package/ccw/src/core/server.ts +0 -776
- package/ccw/src/core/services/api-key-tester.ts +0 -166
- package/ccw/src/core/services/health-check-service.ts +0 -366
- package/ccw/src/core/session-clustering-service.ts +0 -1258
- package/ccw/src/core/session-scanner.ts +0 -283
- package/ccw/src/core/websocket.ts +0 -302
- package/ccw/src/index.ts +0 -10
- package/ccw/src/mcp-server/index.ts +0 -191
- package/ccw/src/templates/assets/css/github-dark.min.css +0 -10
- package/ccw/src/templates/assets/css/github.min.css +0 -10
- package/ccw/src/templates/assets/js/cytoscape.min.js +0 -32
- package/ccw/src/templates/assets/js/d3.min.js +0 -2
- package/ccw/src/templates/assets/js/highlight.min.js +0 -1244
- package/ccw/src/templates/assets/js/lucide.min.js +0 -12
- package/ccw/src/templates/assets/js/marked.min.js +0 -69
- package/ccw/src/templates/assets/js/tailwind.js +0 -83
- package/ccw/src/templates/dashboard-css/01-base.css +0 -419
- package/ccw/src/templates/dashboard-css/02-session.css +0 -831
- package/ccw/src/templates/dashboard-css/03-tasks.css +0 -517
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +0 -4354
- package/ccw/src/templates/dashboard-css/05-context.css +0 -2206
- package/ccw/src/templates/dashboard-css/06-cards.css +0 -1576
- package/ccw/src/templates/dashboard-css/07-managers.css +0 -2107
- package/ccw/src/templates/dashboard-css/08-review.css +0 -1266
- package/ccw/src/templates/dashboard-css/09-explorer.css +0 -1408
- package/ccw/src/templates/dashboard-css/10-cli-status.css +0 -539
- package/ccw/src/templates/dashboard-css/11-cli-history.css +0 -271
- package/ccw/src/templates/dashboard-css/12-cli-legacy.css +0 -896
- package/ccw/src/templates/dashboard-css/13-cli-ccw.css +0 -199
- package/ccw/src/templates/dashboard-css/14-cli-modals.css +0 -258
- package/ccw/src/templates/dashboard-css/15-cli-endpoints.css +0 -305
- package/ccw/src/templates/dashboard-css/16-cli-session.css +0 -241
- package/ccw/src/templates/dashboard-css/17-cli-conversation.css +0 -283
- package/ccw/src/templates/dashboard-css/18-cli-settings.css +0 -229
- package/ccw/src/templates/dashboard-css/19-cli-native-session.css +0 -496
- package/ccw/src/templates/dashboard-css/20-cli-taskqueue.css +0 -188
- package/ccw/src/templates/dashboard-css/21-cli-toolmgmt.css +0 -820
- package/ccw/src/templates/dashboard-css/22-cli-semantic.css +0 -240
- package/ccw/src/templates/dashboard-css/23-memory.css +0 -2390
- package/ccw/src/templates/dashboard-css/24-prompt-history.css +0 -1089
- package/ccw/src/templates/dashboard-css/25-skills-rules.css +0 -326
- package/ccw/src/templates/dashboard-css/26-claude-manager.css +0 -1087
- package/ccw/src/templates/dashboard-css/27-graph-explorer.css +0 -1678
- package/ccw/src/templates/dashboard-css/28-mcp-manager.css +0 -748
- package/ccw/src/templates/dashboard-css/29-help.css +0 -264
- package/ccw/src/templates/dashboard-css/30-core-memory.css +0 -1720
- package/ccw/src/templates/dashboard-css/31-api-settings.css +0 -3002
- package/ccw/src/templates/dashboard-css/32-issue-manager.css +0 -3619
- package/ccw/src/templates/dashboard-css/33-cli-stream-viewer.css +0 -860
- package/ccw/src/templates/dashboard-css/34-discovery.css +0 -783
- package/ccw/src/templates/dashboard-css/36-loop-monitor.css +0 -1896
- package/ccw/src/templates/dashboard-css/36-loop-monitor.css.backup +0 -1877
- package/ccw/src/templates/dashboard-css/37-commands.css +0 -193
- package/ccw/src/templates/dashboard-js/api.js +0 -225
- package/ccw/src/templates/dashboard-js/components/_conflict_tab.js +0 -112
- package/ccw/src/templates/dashboard-js/components/_exp_helpers.js +0 -54
- package/ccw/src/templates/dashboard-js/components/_review_tab.js +0 -640
- package/ccw/src/templates/dashboard-js/components/carousel.js +0 -398
- package/ccw/src/templates/dashboard-js/components/cli-history.js +0 -913
- package/ccw/src/templates/dashboard-js/components/cli-status.js +0 -1617
- package/ccw/src/templates/dashboard-js/components/cli-stream-viewer.js +0 -985
- package/ccw/src/templates/dashboard-js/components/flowchart.js +0 -493
- package/ccw/src/templates/dashboard-js/components/global-notifications.js +0 -508
- package/ccw/src/templates/dashboard-js/components/hook-manager.js +0 -1493
- package/ccw/src/templates/dashboard-js/components/index-manager.js +0 -302
- package/ccw/src/templates/dashboard-js/components/mcp-manager.js +0 -1760
- package/ccw/src/templates/dashboard-js/components/modals.js +0 -326
- package/ccw/src/templates/dashboard-js/components/navigation.js +0 -430
- package/ccw/src/templates/dashboard-js/components/notifications.js +0 -934
- package/ccw/src/templates/dashboard-js/components/sidebar.js +0 -31
- package/ccw/src/templates/dashboard-js/components/storage-manager.js +0 -478
- package/ccw/src/templates/dashboard-js/components/tabs-context.js +0 -1093
- package/ccw/src/templates/dashboard-js/components/tabs-other.js +0 -424
- package/ccw/src/templates/dashboard-js/components/task-drawer-core.js +0 -477
- package/ccw/src/templates/dashboard-js/components/task-drawer-renderers.js +0 -447
- package/ccw/src/templates/dashboard-js/components/task-queue-sidebar.js +0 -716
- package/ccw/src/templates/dashboard-js/components/theme.js +0 -49
- package/ccw/src/templates/dashboard-js/components/version-check.js +0 -339
- package/ccw/src/templates/dashboard-js/help-i18n.js +0 -272
- package/ccw/src/templates/dashboard-js/i18n.js +0 -5558
- package/ccw/src/templates/dashboard-js/main.js +0 -158
- package/ccw/src/templates/dashboard-js/services.js +0 -289
- package/ccw/src/templates/dashboard-js/state.js +0 -245
- package/ccw/src/templates/dashboard-js/utils.js +0 -199
- package/ccw/src/templates/dashboard-js/views/api-settings.js +0 -5646
- package/ccw/src/templates/dashboard-js/views/claude-manager.js +0 -1129
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +0 -3615
- package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +0 -7123
- package/ccw/src/templates/dashboard-js/views/commands-manager.js +0 -503
- package/ccw/src/templates/dashboard-js/views/core-memory-clusters.js +0 -503
- package/ccw/src/templates/dashboard-js/views/core-memory.js +0 -891
- package/ccw/src/templates/dashboard-js/views/explorer.js +0 -888
- package/ccw/src/templates/dashboard-js/views/fix-session.js +0 -180
- package/ccw/src/templates/dashboard-js/views/graph-explorer.js +0 -1157
- package/ccw/src/templates/dashboard-js/views/help.js +0 -1278
- package/ccw/src/templates/dashboard-js/views/history.js +0 -390
- package/ccw/src/templates/dashboard-js/views/home.js +0 -244
- package/ccw/src/templates/dashboard-js/views/hook-manager.js +0 -696
- package/ccw/src/templates/dashboard-js/views/issue-discovery.js +0 -730
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +0 -3248
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +0 -3546
- package/ccw/src/templates/dashboard-js/views/loop-monitor.js +0 -3345
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +0 -2261
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js.backup +0 -1729
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js.new +0 -928
- package/ccw/src/templates/dashboard-js/views/memory.js +0 -1221
- package/ccw/src/templates/dashboard-js/views/project-overview.js +0 -548
- package/ccw/src/templates/dashboard-js/views/prompt-history.js +0 -713
- package/ccw/src/templates/dashboard-js/views/review-session.js +0 -1030
- package/ccw/src/templates/dashboard-js/views/rules-manager.js +0 -880
- package/ccw/src/templates/dashboard-js/views/session-detail.js +0 -781
- package/ccw/src/templates/dashboard-js/views/skills-manager.js +0 -1282
- package/ccw/src/templates/dashboard.html +0 -1104
- package/ccw/src/templates/hooks-config-example.json +0 -60
- package/ccw/src/templates/review-cycle-dashboard.html +0 -1930
- package/ccw/src/templates/workflow-dashboard.html +0 -401
- package/ccw/src/tools/README.md +0 -29
- package/ccw/src/tools/classify-folders.ts +0 -245
- package/ccw/src/tools/claude-cli-tools.ts +0 -1271
- package/ccw/src/tools/cli-config-manager.ts +0 -169
- package/ccw/src/tools/cli-executor-core.ts +0 -1665
- package/ccw/src/tools/cli-executor-state.ts +0 -562
- package/ccw/src/tools/cli-executor-utils.ts +0 -394
- package/ccw/src/tools/cli-executor.ts +0 -7
- package/ccw/src/tools/cli-history-store.ts +0 -1498
- package/ccw/src/tools/cli-output-converter.ts +0 -1301
- package/ccw/src/tools/cli-prompt-builder.ts +0 -487
- package/ccw/src/tools/codex-lens-lsp.ts +0 -402
- package/ccw/src/tools/codex-lens.ts +0 -1863
- package/ccw/src/tools/command-registry.test.ts +0 -669
- package/ccw/src/tools/command-registry.ts +0 -323
- package/ccw/src/tools/context-cache-store.ts +0 -368
- package/ccw/src/tools/context-cache.ts +0 -393
- package/ccw/src/tools/convert-tokens-to-css.ts +0 -300
- package/ccw/src/tools/core-memory.ts +0 -458
- package/ccw/src/tools/detect-changed-modules.ts +0 -343
- package/ccw/src/tools/discover-design-files.ts +0 -184
- package/ccw/src/tools/edit-file.ts +0 -568
- package/ccw/src/tools/generate-module-docs.ts +0 -442
- package/ccw/src/tools/get-modules-by-depth.ts +0 -349
- package/ccw/src/tools/index.ts +0 -384
- package/ccw/src/tools/litellm-client.ts +0 -288
- package/ccw/src/tools/litellm-executor.ts +0 -360
- package/ccw/src/tools/loop-manager.ts +0 -519
- package/ccw/src/tools/loop-state-manager.ts +0 -173
- package/ccw/src/tools/loop-task-manager.ts +0 -391
- package/ccw/src/tools/memory-update-queue.js +0 -493
- package/ccw/src/tools/native-session-discovery.ts +0 -1034
- package/ccw/src/tools/notifier.ts +0 -129
- package/ccw/src/tools/pattern-parser.ts +0 -329
- package/ccw/src/tools/read-file.ts +0 -410
- package/ccw/src/tools/resume-strategy.ts +0 -345
- package/ccw/src/tools/session-content-parser.ts +0 -619
- package/ccw/src/tools/session-manager.ts +0 -1114
- package/ccw/src/tools/skill-context-loader.ts +0 -213
- package/ccw/src/tools/smart-context.ts +0 -228
- package/ccw/src/tools/smart-search.ts +0 -2658
- package/ccw/src/tools/smart-search.ts.backup +0 -1233
- package/ccw/src/tools/storage-manager.ts +0 -455
- package/ccw/src/tools/template-discovery.ts +0 -303
- package/ccw/src/tools/ui-generate-preview.js +0 -350
- package/ccw/src/tools/ui-instantiate-prototypes.js +0 -301
- package/ccw/src/tools/update-module-claude.js +0 -380
- package/ccw/src/tools/vscode-lsp.ts +0 -317
- package/ccw/src/tools/write-file.ts +0 -222
- package/ccw/src/types/cli-settings.ts +0 -137
- package/ccw/src/types/config.ts +0 -11
- package/ccw/src/types/index.ts +0 -4
- package/ccw/src/types/litellm-api-config.ts +0 -456
- package/ccw/src/types/loop.ts +0 -316
- package/ccw/src/types/session.ts +0 -25
- package/ccw/src/types/skill-types.ts +0 -99
- package/ccw/src/types/tool.ts +0 -41
- package/ccw/src/utils/browser-launcher.ts +0 -62
- package/ccw/src/utils/codexlens-path.ts +0 -60
- package/ccw/src/utils/exec-constants.ts +0 -24
- package/ccw/src/utils/file-utils.ts +0 -48
- package/ccw/src/utils/path-resolver.ts +0 -392
- package/ccw/src/utils/path-validator.ts +0 -187
- package/ccw/src/utils/project-root.ts +0 -73
- package/ccw/src/utils/python-utils.ts +0 -140
- package/ccw/src/utils/shell-escape.ts +0 -117
- package/ccw/src/utils/ui.ts +0 -155
- package/ccw/src/utils/update-checker.ts +0 -178
- package/ccw/src/utils/uv-manager.ts +0 -797
- 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/__pycache__/__init__.cpython-313.pyc +0 -0
- package/ccw-litellm/src/ccw_litellm/__pycache__/cli.cpython-313.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__/__init__.cpython-313.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/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__/__init__.cpython-313.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/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__/__init__.cpython-313.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__/embedder.cpython-313.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/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/llm.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/.workflow/.cli-history/history.db +0 -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__/__init__.cpython-313.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__/__main__.cpython-313.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/__pycache__/errors.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/__init__.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/definition.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/definition.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/file_context.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/file_context.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/hover.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/hover.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/models.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/models.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/references.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/references.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/semantic.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/semantic.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/symbols.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/symbols.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/utils.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/api/__pycache__/utils.cpython-313.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__/__init__.cpython-313.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/__pycache__/output.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/hybrid_search/__pycache__/__init__.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/hybrid_search/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/hybrid_search/__pycache__/data_structures.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/hybrid_search/__pycache__/data_structures.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/hybrid_search/__pycache__/engine.cpython-313.pyc +0 -0
- 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/lsp/__pycache__/__init__.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/handlers.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/lsp_bridge.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/lsp_bridge.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/lsp_graph_builder.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/lsp_graph_builder.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/providers.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/server.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/lsp/__pycache__/standalone_manager.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/mcp/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/mcp/__pycache__/hooks.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/mcp/__pycache__/provider.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/mcp/__pycache__/schema.cpython-313.pyc +0 -0
- 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__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/encoding.cpython-313.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__/tokenizer.cpython-313.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/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__/__init__.cpython-313.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__/query_parser.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/association_tree/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/association_tree/__pycache__/builder.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/association_tree/__pycache__/data_structures.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/association_tree/__pycache__/deduplicator.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/__init__.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/base.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/base.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/dbscan_strategy.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/factory.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/factory.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/frequency_strategy.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/frequency_strategy.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/hdbscan_strategy.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/noop_strategy.cpython-312.pyc +0 -0
- package/codex-lens/src/codexlens/search/clustering/__pycache__/noop_strategy.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/SPLADE_IMPLEMENTATION.md +0 -225
- 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__/__init__.cpython-313.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__/base.cpython-313.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__/chunker.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/code_extractor.cpython-313.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__/embedder.cpython-313.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__/graph_analyzer.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__/llm_enhancer.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/ollama_backend.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/reranker/__pycache__/__init__.cpython-310.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-312.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-312.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-312.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-312.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-312.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-312.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-312.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/splade_encoder.py +0 -567
- 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__/file_cache.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__/global_index.cpython-313.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__/migration_manager.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__/path_mapper.cpython-313.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__/registry.cpython-313.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__/sqlite_utils.cpython-313.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/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__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_001_normalize_keywords.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_002_add_token_metadata.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_003_code_relationships.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_004_dual_fts.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_005_cleanup_unused_fields.cpython-313.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_009_add_splade.py +0 -103
- package/codex-lens/src/codexlens/storage/splade_index.py +0 -578
- 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
|
@@ -1,1665 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Executor Tool - Unified execution for external CLI tools
|
|
3
|
-
* Supports Gemini, Qwen, and Codex with streaming output
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
import type { ToolSchema, ToolResult } from '../types/tool.js';
|
|
8
|
-
import { spawn, ChildProcess } from 'child_process';
|
|
9
|
-
import * as fs from 'fs';
|
|
10
|
-
import * as path from 'path';
|
|
11
|
-
import * as os from 'os';
|
|
12
|
-
import { validatePath, resolvePath } from '../utils/path-resolver.js';
|
|
13
|
-
import { escapeWindowsArg } from '../utils/shell-escape.js';
|
|
14
|
-
import { buildCommand, checkToolAvailability, clearToolCache, debugLog, errorLog, type NativeResumeConfig, type ToolAvailability } from './cli-executor-utils.js';
|
|
15
|
-
import type { ConversationRecord, ConversationTurn, ExecutionOutput, ExecutionRecord } from './cli-executor-state.js';
|
|
16
|
-
import {
|
|
17
|
-
createOutputParser,
|
|
18
|
-
type CliOutputUnit,
|
|
19
|
-
type IOutputParser,
|
|
20
|
-
flattenOutputUnits
|
|
21
|
-
} from './cli-output-converter.js';
|
|
22
|
-
import {
|
|
23
|
-
buildMergedPrompt,
|
|
24
|
-
buildMultiTurnPrompt,
|
|
25
|
-
mergeConversations,
|
|
26
|
-
type MergeResult
|
|
27
|
-
} from './cli-prompt-builder.js';
|
|
28
|
-
import {
|
|
29
|
-
convertToConversation,
|
|
30
|
-
ensureHistoryDir,
|
|
31
|
-
getExecutionDetail,
|
|
32
|
-
getExecutionHistory,
|
|
33
|
-
getSqliteStore,
|
|
34
|
-
loadConversation,
|
|
35
|
-
saveConversation
|
|
36
|
-
} from './cli-executor-state.js';
|
|
37
|
-
|
|
38
|
-
// Track current running child process for cleanup on interruption
|
|
39
|
-
let currentChildProcess: ChildProcess | null = null;
|
|
40
|
-
let killTimeout: NodeJS.Timeout | null = null;
|
|
41
|
-
let killTimeoutProcess: ChildProcess | null = null;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Kill the current running CLI child process
|
|
45
|
-
* Called when parent process receives SIGINT/SIGTERM
|
|
46
|
-
*/
|
|
47
|
-
export function killCurrentCliProcess(): boolean {
|
|
48
|
-
const child = currentChildProcess;
|
|
49
|
-
if (!child || child.killed) return false;
|
|
50
|
-
|
|
51
|
-
debugLog('KILL', 'Killing current child process', { pid: child.pid });
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
child.kill('SIGTERM');
|
|
55
|
-
} catch {
|
|
56
|
-
// Ignore kill errors (process may already be gone)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (killTimeout) {
|
|
60
|
-
clearTimeout(killTimeout);
|
|
61
|
-
killTimeout = null;
|
|
62
|
-
killTimeoutProcess = null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Force kill after 2 seconds if still running.
|
|
66
|
-
killTimeoutProcess = child;
|
|
67
|
-
killTimeout = setTimeout(() => {
|
|
68
|
-
const target = killTimeoutProcess;
|
|
69
|
-
if (!target || target !== currentChildProcess) return;
|
|
70
|
-
if (target.killed) return;
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
target.kill('SIGKILL');
|
|
74
|
-
} catch {
|
|
75
|
-
// Ignore kill errors (process may already be gone)
|
|
76
|
-
}
|
|
77
|
-
}, 2000);
|
|
78
|
-
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// LiteLLM integration
|
|
83
|
-
import { executeLiteLLMEndpoint } from './litellm-executor.js';
|
|
84
|
-
import { findEndpointById } from '../config/litellm-api-config-manager.js';
|
|
85
|
-
|
|
86
|
-
// CLI Settings (CLI封装) integration
|
|
87
|
-
import { loadEndpointSettings, getSettingsFilePath, findEndpoint } from '../config/cli-settings-manager.js';
|
|
88
|
-
import { loadClaudeCliTools, getToolConfig, getPrimaryModel } from './claude-cli-tools.js';
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Parse .env file content into key-value pairs
|
|
92
|
-
* Supports: KEY=value, KEY="value", KEY='value', comments (#), empty lines
|
|
93
|
-
*/
|
|
94
|
-
function parseEnvFile(content: string): Record<string, string> {
|
|
95
|
-
const env: Record<string, string> = {};
|
|
96
|
-
const lines = content.split(/\r?\n/);
|
|
97
|
-
|
|
98
|
-
for (const line of lines) {
|
|
99
|
-
// Skip empty lines and comments
|
|
100
|
-
const trimmed = line.trim();
|
|
101
|
-
if (!trimmed || trimmed.startsWith('#')) continue;
|
|
102
|
-
|
|
103
|
-
// Find first = sign
|
|
104
|
-
const eqIndex = trimmed.indexOf('=');
|
|
105
|
-
if (eqIndex === -1) continue;
|
|
106
|
-
|
|
107
|
-
const key = trimmed.substring(0, eqIndex).trim();
|
|
108
|
-
let value = trimmed.substring(eqIndex + 1).trim();
|
|
109
|
-
|
|
110
|
-
// Remove surrounding quotes if present
|
|
111
|
-
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
112
|
-
(value.startsWith("'") && value.endsWith("'"))) {
|
|
113
|
-
value = value.slice(1, -1);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (key) {
|
|
117
|
-
env[key] = value;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return env;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Load environment variables from .env file
|
|
126
|
-
* Supports ~ for home directory expansion
|
|
127
|
-
*/
|
|
128
|
-
function loadEnvFile(envFilePath: string): Record<string, string> {
|
|
129
|
-
try {
|
|
130
|
-
// Expand ~ to home directory
|
|
131
|
-
let resolvedPath = envFilePath;
|
|
132
|
-
if (resolvedPath.startsWith('~')) {
|
|
133
|
-
resolvedPath = path.join(os.homedir(), resolvedPath.slice(1));
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Resolve relative paths
|
|
137
|
-
if (!path.isAbsolute(resolvedPath)) {
|
|
138
|
-
resolvedPath = path.resolve(resolvedPath);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (!fs.existsSync(resolvedPath)) {
|
|
142
|
-
debugLog('ENV_FILE', `Env file not found: ${resolvedPath}`);
|
|
143
|
-
return {};
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const content = fs.readFileSync(resolvedPath, 'utf-8');
|
|
147
|
-
const envVars = parseEnvFile(content);
|
|
148
|
-
debugLog('ENV_FILE', `Loaded ${Object.keys(envVars).length} env vars from ${resolvedPath}`);
|
|
149
|
-
return envVars;
|
|
150
|
-
} catch (err) {
|
|
151
|
-
errorLog('ENV_FILE', `Failed to load env file: ${envFilePath}`, err as Error);
|
|
152
|
-
return {};
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Execute Claude CLI with custom settings file (CLI封装)
|
|
158
|
-
*/
|
|
159
|
-
interface ClaudeWithSettingsParams {
|
|
160
|
-
prompt: string;
|
|
161
|
-
settingsPath: string;
|
|
162
|
-
endpointId: string;
|
|
163
|
-
mode: 'analysis' | 'write' | 'auto' | 'review';
|
|
164
|
-
workingDir: string;
|
|
165
|
-
cd?: string;
|
|
166
|
-
includeDirs?: string[];
|
|
167
|
-
customId?: string;
|
|
168
|
-
onOutput?: (unit: CliOutputUnit) => void;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
async function executeClaudeWithSettings(params: ClaudeWithSettingsParams): Promise<ExecutionOutput> {
|
|
172
|
-
const { prompt, settingsPath, endpointId, mode, workingDir, cd, includeDirs, customId, onOutput } = params;
|
|
173
|
-
|
|
174
|
-
const startTime = Date.now();
|
|
175
|
-
const conversationId = customId || `${Date.now()}-${endpointId}`;
|
|
176
|
-
|
|
177
|
-
// Build claude command with --settings flag
|
|
178
|
-
const args: string[] = [
|
|
179
|
-
'--settings', settingsPath,
|
|
180
|
-
'--print' // Non-interactive mode
|
|
181
|
-
];
|
|
182
|
-
|
|
183
|
-
// Add mode-specific flags
|
|
184
|
-
if (mode === 'write') {
|
|
185
|
-
args.push('--dangerously-skip-permissions');
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Add working directory if specified
|
|
189
|
-
if (cd) {
|
|
190
|
-
args.push('--cd', cd);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// Add include directories
|
|
194
|
-
if (includeDirs && includeDirs.length > 0) {
|
|
195
|
-
for (const dir of includeDirs) {
|
|
196
|
-
args.push('--add-dir', dir);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// Add prompt as argument
|
|
201
|
-
args.push('-p', prompt);
|
|
202
|
-
|
|
203
|
-
debugLog('CLAUDE_SETTINGS', `Executing claude with settings`, {
|
|
204
|
-
settingsPath,
|
|
205
|
-
endpointId,
|
|
206
|
-
mode,
|
|
207
|
-
workingDir,
|
|
208
|
-
args
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
return new Promise((resolve, reject) => {
|
|
212
|
-
const isWindows = process.platform === 'win32';
|
|
213
|
-
const command = 'claude';
|
|
214
|
-
const commandToSpawn = isWindows ? escapeWindowsArg(command) : command;
|
|
215
|
-
const argsToSpawn = isWindows ? args.map(escapeWindowsArg) : args;
|
|
216
|
-
|
|
217
|
-
const child = spawn(commandToSpawn, argsToSpawn, {
|
|
218
|
-
cwd: workingDir,
|
|
219
|
-
shell: isWindows,
|
|
220
|
-
stdio: ['ignore', 'pipe', 'pipe']
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
// Track current child process for cleanup
|
|
224
|
-
currentChildProcess = child;
|
|
225
|
-
|
|
226
|
-
let stdout = '';
|
|
227
|
-
let stderr = '';
|
|
228
|
-
const outputUnits: CliOutputUnit[] = [];
|
|
229
|
-
|
|
230
|
-
child.stdout!.on('data', (data: Buffer) => {
|
|
231
|
-
const text = data.toString();
|
|
232
|
-
stdout += text;
|
|
233
|
-
|
|
234
|
-
const unit: CliOutputUnit = {
|
|
235
|
-
type: 'stdout',
|
|
236
|
-
content: text,
|
|
237
|
-
timestamp: new Date().toISOString()
|
|
238
|
-
};
|
|
239
|
-
outputUnits.push(unit);
|
|
240
|
-
|
|
241
|
-
if (onOutput) {
|
|
242
|
-
onOutput(unit);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
child.stderr!.on('data', (data: Buffer) => {
|
|
247
|
-
const text = data.toString();
|
|
248
|
-
stderr += text;
|
|
249
|
-
|
|
250
|
-
const unit: CliOutputUnit = {
|
|
251
|
-
type: 'stderr',
|
|
252
|
-
content: text,
|
|
253
|
-
timestamp: new Date().toISOString()
|
|
254
|
-
};
|
|
255
|
-
outputUnits.push(unit);
|
|
256
|
-
|
|
257
|
-
if (onOutput) {
|
|
258
|
-
onOutput(unit);
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
child.on('close', (code) => {
|
|
263
|
-
currentChildProcess = null;
|
|
264
|
-
|
|
265
|
-
const endTime = Date.now();
|
|
266
|
-
const duration = endTime - startTime;
|
|
267
|
-
|
|
268
|
-
// Determine status
|
|
269
|
-
let status: 'success' | 'error' = 'success';
|
|
270
|
-
if (code !== 0) {
|
|
271
|
-
const hasValidOutput = stdout.trim().length > 0;
|
|
272
|
-
const hasFatalError = stderr.includes('FATAL') ||
|
|
273
|
-
stderr.includes('Authentication failed') ||
|
|
274
|
-
stderr.includes('API key');
|
|
275
|
-
|
|
276
|
-
if (hasValidOutput && !hasFatalError) {
|
|
277
|
-
status = 'success';
|
|
278
|
-
} else {
|
|
279
|
-
status = 'error';
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
const execution: ExecutionRecord = {
|
|
284
|
-
id: conversationId,
|
|
285
|
-
timestamp: new Date(startTime).toISOString(),
|
|
286
|
-
tool: 'claude',
|
|
287
|
-
model: endpointId, // Use endpoint ID as model identifier
|
|
288
|
-
mode,
|
|
289
|
-
prompt,
|
|
290
|
-
status,
|
|
291
|
-
exit_code: code,
|
|
292
|
-
duration_ms: duration,
|
|
293
|
-
output: {
|
|
294
|
-
stdout: stdout.substring(0, 10240),
|
|
295
|
-
stderr: stderr.substring(0, 2048),
|
|
296
|
-
truncated: stdout.length > 10240 || stderr.length > 2048
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
const conversation = convertToConversation(execution);
|
|
301
|
-
|
|
302
|
-
// Save to history
|
|
303
|
-
try {
|
|
304
|
-
saveConversation(workingDir, conversation);
|
|
305
|
-
} catch (err) {
|
|
306
|
-
console.error('[CLI Executor] Failed to save CLI封装 history:', (err as Error).message);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
resolve({
|
|
310
|
-
success: status === 'success',
|
|
311
|
-
execution,
|
|
312
|
-
conversation,
|
|
313
|
-
stdout,
|
|
314
|
-
stderr
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
child.on('error', (error) => {
|
|
319
|
-
currentChildProcess = null;
|
|
320
|
-
reject(new Error(`Failed to spawn claude: ${error.message}`));
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// Native resume support
|
|
326
|
-
import {
|
|
327
|
-
trackNewSession,
|
|
328
|
-
getNativeResumeArgs,
|
|
329
|
-
supportsNativeResume,
|
|
330
|
-
calculateProjectHash
|
|
331
|
-
} from './native-session-discovery.js';
|
|
332
|
-
import {
|
|
333
|
-
determineResumeStrategy,
|
|
334
|
-
buildContextPrefix,
|
|
335
|
-
getResumeModeDescription,
|
|
336
|
-
type ResumeDecision
|
|
337
|
-
} from './resume-strategy.js';
|
|
338
|
-
import {
|
|
339
|
-
isToolEnabled as isToolEnabledFromConfig,
|
|
340
|
-
enableTool as enableToolFromConfig,
|
|
341
|
-
disableTool as disableToolFromConfig
|
|
342
|
-
} from './cli-config-manager.js';
|
|
343
|
-
|
|
344
|
-
// Built-in CLI tools
|
|
345
|
-
const BUILTIN_CLI_TOOLS = ['gemini', 'qwen', 'codex', 'opencode', 'claude'] as const;
|
|
346
|
-
type BuiltinCliTool = typeof BUILTIN_CLI_TOOLS[number];
|
|
347
|
-
|
|
348
|
-
// Define Zod schema for validation
|
|
349
|
-
// tool accepts built-in tools or custom endpoint IDs (CLI封装)
|
|
350
|
-
const ParamsSchema = z.object({
|
|
351
|
-
tool: z.string().min(1, 'Tool is required'), // Accept any tool ID (built-in or custom endpoint)
|
|
352
|
-
prompt: z.string(), // Prompt can be empty for review mode with target flags
|
|
353
|
-
mode: z.enum(['analysis', 'write', 'auto', 'review']).default('analysis'),
|
|
354
|
-
format: z.enum(['plain', 'yaml', 'json']).default('plain'), // Multi-turn prompt concatenation format
|
|
355
|
-
model: z.string().optional(),
|
|
356
|
-
cd: z.string().optional(),
|
|
357
|
-
includeDirs: z.string().optional(),
|
|
358
|
-
// timeout removed - controlled by external caller (bash timeout)
|
|
359
|
-
resume: z.union([z.boolean(), z.string()]).optional(), // true = last, string = single ID or comma-separated IDs
|
|
360
|
-
id: z.string().optional(), // Custom execution ID (e.g., IMPL-001-step1)
|
|
361
|
-
noNative: z.boolean().optional(), // Force prompt concatenation instead of native resume
|
|
362
|
-
category: z.enum(['user', 'internal', 'insight']).default('user'), // Execution category for tracking
|
|
363
|
-
parentExecutionId: z.string().optional(), // Parent execution ID for fork/retry scenarios
|
|
364
|
-
stream: z.boolean().default(false), // false = cache full output (default), true = stream output via callback
|
|
365
|
-
outputFormat: z.enum(['text', 'json-lines']).optional().default('json-lines'), // Output parsing format (default: json-lines for type badges)
|
|
366
|
-
// Codex review options
|
|
367
|
-
uncommitted: z.boolean().optional(), // Review uncommitted changes (default for review mode)
|
|
368
|
-
base: z.string().optional(), // Review changes against base branch
|
|
369
|
-
commit: z.string().optional(), // Review changes from specific commit
|
|
370
|
-
title: z.string().optional(), // Optional title for review summary
|
|
371
|
-
// Rules env vars (PROTO, TMPL) - will be passed to subprocess environment
|
|
372
|
-
rulesEnv: z.object({
|
|
373
|
-
PROTO: z.string().optional(),
|
|
374
|
-
TMPL: z.string().optional(),
|
|
375
|
-
}).optional(),
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
type Params = z.infer<typeof ParamsSchema>;
|
|
379
|
-
|
|
380
|
-
type NonEmptyArray<T> = [T, ...T[]];
|
|
381
|
-
|
|
382
|
-
function assertNonEmptyArray<T>(items: T[], message: string): asserts items is NonEmptyArray<T> {
|
|
383
|
-
if (items.length === 0) {
|
|
384
|
-
throw new Error(message);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Execute CLI tool with streaming output
|
|
390
|
-
*/
|
|
391
|
-
async function executeCliTool(
|
|
392
|
-
params: Record<string, unknown>,
|
|
393
|
-
onOutput?: ((unit: CliOutputUnit) => void) | null
|
|
394
|
-
): Promise<ExecutionOutput> {
|
|
395
|
-
const parsed = ParamsSchema.safeParse(params);
|
|
396
|
-
if (!parsed.success) {
|
|
397
|
-
throw new Error(`Invalid params: ${parsed.error.message}`);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
const { tool, prompt, mode, format, model, cd, includeDirs, resume, id: customId, noNative, category, parentExecutionId, outputFormat, uncommitted, base, commit, title, rulesEnv } = parsed.data;
|
|
401
|
-
|
|
402
|
-
// Validate and determine working directory early (needed for conversation lookup)
|
|
403
|
-
let workingDir: string;
|
|
404
|
-
if (cd) {
|
|
405
|
-
const validation = validatePath(cd, { mustExist: true });
|
|
406
|
-
if (!validation.valid) {
|
|
407
|
-
throw new Error(`Invalid working directory (--cd): ${validation.error}. Path: ${cd}`);
|
|
408
|
-
}
|
|
409
|
-
workingDir = validation.path!;
|
|
410
|
-
} else {
|
|
411
|
-
workingDir = process.cwd();
|
|
412
|
-
}
|
|
413
|
-
ensureHistoryDir(workingDir); // Ensure history directory exists
|
|
414
|
-
|
|
415
|
-
// NEW: Check if model is a custom LiteLLM endpoint ID
|
|
416
|
-
if (model) {
|
|
417
|
-
const endpoint = findEndpointById(workingDir, model);
|
|
418
|
-
if (endpoint) {
|
|
419
|
-
// Route to LiteLLM executor
|
|
420
|
-
if (onOutput) {
|
|
421
|
-
onOutput({
|
|
422
|
-
type: 'stderr',
|
|
423
|
-
content: `[Routing to LiteLLM endpoint: ${model}]\n`,
|
|
424
|
-
timestamp: new Date().toISOString()
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
const result = await executeLiteLLMEndpoint({
|
|
429
|
-
prompt,
|
|
430
|
-
endpointId: model,
|
|
431
|
-
baseDir: workingDir,
|
|
432
|
-
cwd: cd,
|
|
433
|
-
includeDirs: includeDirs ? includeDirs.split(',').map(d => d.trim()) : undefined,
|
|
434
|
-
enableCache: true,
|
|
435
|
-
onOutput: onOutput || undefined,
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
// Convert LiteLLM result to ExecutionOutput format
|
|
439
|
-
const startTime = Date.now();
|
|
440
|
-
const endTime = Date.now();
|
|
441
|
-
const duration = endTime - startTime;
|
|
442
|
-
|
|
443
|
-
const execution: ExecutionRecord = {
|
|
444
|
-
id: customId || `${Date.now()}-litellm`,
|
|
445
|
-
timestamp: new Date(startTime).toISOString(),
|
|
446
|
-
tool: 'litellm',
|
|
447
|
-
model: result.model,
|
|
448
|
-
mode,
|
|
449
|
-
prompt,
|
|
450
|
-
status: result.success ? 'success' : 'error',
|
|
451
|
-
exit_code: result.success ? 0 : 1,
|
|
452
|
-
duration_ms: duration,
|
|
453
|
-
output: {
|
|
454
|
-
stdout: result.output,
|
|
455
|
-
stderr: result.error || '',
|
|
456
|
-
truncated: false,
|
|
457
|
-
},
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
const conversation = convertToConversation(execution);
|
|
461
|
-
|
|
462
|
-
// Try to save to history
|
|
463
|
-
try {
|
|
464
|
-
saveConversation(workingDir, conversation);
|
|
465
|
-
} catch (err) {
|
|
466
|
-
console.error('[CLI Executor] Failed to save LiteLLM history:', (err as Error).message);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
return {
|
|
470
|
-
success: result.success,
|
|
471
|
-
execution,
|
|
472
|
-
conversation,
|
|
473
|
-
stdout: result.output,
|
|
474
|
-
stderr: result.error || '',
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
// Check if tool is a custom CLI封装 endpoint (not a built-in tool)
|
|
480
|
-
const isBuiltinTool = BUILTIN_CLI_TOOLS.includes(tool as BuiltinCliTool);
|
|
481
|
-
if (!isBuiltinTool) {
|
|
482
|
-
// Check if it's a CLI封装 endpoint (by ID or name)
|
|
483
|
-
const cliSettings = findEndpoint(tool);
|
|
484
|
-
if (cliSettings && cliSettings.enabled) {
|
|
485
|
-
// Route to Claude CLI with --settings flag
|
|
486
|
-
const settingsPath = getSettingsFilePath(cliSettings.id);
|
|
487
|
-
const displayName = cliSettings.name !== cliSettings.id ? `${cliSettings.name} (${cliSettings.id})` : cliSettings.id;
|
|
488
|
-
if (onOutput) {
|
|
489
|
-
onOutput({
|
|
490
|
-
type: 'stderr',
|
|
491
|
-
content: `[Routing to CLI封装 endpoint: ${displayName} via claude --settings]\n`,
|
|
492
|
-
timestamp: new Date().toISOString()
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
// Execute claude CLI with settings file
|
|
497
|
-
const result = await executeClaudeWithSettings({
|
|
498
|
-
prompt,
|
|
499
|
-
settingsPath,
|
|
500
|
-
endpointId: cliSettings.id,
|
|
501
|
-
mode,
|
|
502
|
-
workingDir,
|
|
503
|
-
cd,
|
|
504
|
-
includeDirs: includeDirs ? includeDirs.split(',').map(d => d.trim()) : undefined,
|
|
505
|
-
customId,
|
|
506
|
-
onOutput: onOutput || undefined
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
return result;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
// Check cli-tools.json for CLI wrapper tools or API endpoints
|
|
513
|
-
const cliToolsConfig = loadClaudeCliTools(workingDir);
|
|
514
|
-
|
|
515
|
-
// First check if tool is a cli-wrapper in tools section
|
|
516
|
-
const cliWrapperTool = Object.entries(cliToolsConfig.tools).find(
|
|
517
|
-
([name, t]) => name.toLowerCase() === tool.toLowerCase() && t.type === 'cli-wrapper' && t.enabled
|
|
518
|
-
);
|
|
519
|
-
if (cliWrapperTool) {
|
|
520
|
-
const [toolName] = cliWrapperTool;
|
|
521
|
-
// Check if there's a corresponding CLI封装 settings file
|
|
522
|
-
const cliSettingsForTool = findEndpoint(toolName);
|
|
523
|
-
if (cliSettingsForTool) {
|
|
524
|
-
const settingsPath = getSettingsFilePath(cliSettingsForTool.id);
|
|
525
|
-
if (onOutput) {
|
|
526
|
-
onOutput({
|
|
527
|
-
type: 'stderr',
|
|
528
|
-
content: `[Routing to CLI wrapper tool: ${toolName} via claude --settings]\n`,
|
|
529
|
-
timestamp: new Date().toISOString()
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
const result = await executeClaudeWithSettings({
|
|
534
|
-
prompt,
|
|
535
|
-
settingsPath,
|
|
536
|
-
endpointId: cliSettingsForTool.id,
|
|
537
|
-
mode,
|
|
538
|
-
workingDir,
|
|
539
|
-
cd,
|
|
540
|
-
includeDirs: includeDirs ? includeDirs.split(',').map(d => d.trim()) : undefined,
|
|
541
|
-
customId,
|
|
542
|
-
onOutput: onOutput || undefined
|
|
543
|
-
});
|
|
544
|
-
|
|
545
|
-
return result;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
// Check tools with type: 'api-endpoint' -> route to LiteLLM
|
|
550
|
-
const apiEndpointTool = Object.entries(cliToolsConfig.tools).find(
|
|
551
|
-
([name, t]) => t.type === 'api-endpoint' && t.enabled &&
|
|
552
|
-
(t.id === tool || name === tool || name.toLowerCase() === tool.toLowerCase())
|
|
553
|
-
);
|
|
554
|
-
if (apiEndpointTool) {
|
|
555
|
-
const [toolName, toolConfig] = apiEndpointTool;
|
|
556
|
-
// id field is the LiteLLM endpoint ID (e.g., "g25")
|
|
557
|
-
const litellmEndpointId = toolConfig.id || toolName;
|
|
558
|
-
|
|
559
|
-
// Use configured primary model if no explicit model provided
|
|
560
|
-
// This allows --model parameter to override the tool's primaryModel
|
|
561
|
-
// Use undefined if primaryModel is empty string (endpoint.model will be used as fallback)
|
|
562
|
-
const apiEndpointEffectiveModel = model || (toolConfig.primaryModel || undefined);
|
|
563
|
-
|
|
564
|
-
// Find LiteLLM endpoint configuration
|
|
565
|
-
const litellmEndpoint = findEndpointById(workingDir, litellmEndpointId);
|
|
566
|
-
if (litellmEndpoint) {
|
|
567
|
-
if (onOutput) {
|
|
568
|
-
onOutput({
|
|
569
|
-
type: 'stderr',
|
|
570
|
-
content: `[Routing to LiteLLM API endpoint: ${toolName} (${litellmEndpointId})]\n`,
|
|
571
|
-
timestamp: new Date().toISOString()
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
// Execute via LiteLLM with model override
|
|
576
|
-
const result = await executeLiteLLMEndpoint({
|
|
577
|
-
prompt,
|
|
578
|
-
endpointId: litellmEndpointId,
|
|
579
|
-
baseDir: workingDir,
|
|
580
|
-
cwd: cd || workingDir,
|
|
581
|
-
includeDirs: includeDirs ? includeDirs.split(',').map(d => d.trim()) : undefined,
|
|
582
|
-
model: apiEndpointEffectiveModel, // Pass effective model (--model or primaryModel)
|
|
583
|
-
onOutput: onOutput || undefined,
|
|
584
|
-
});
|
|
585
|
-
|
|
586
|
-
// Convert LiteLLM result to ExecutionOutput format
|
|
587
|
-
const startTime = Date.now();
|
|
588
|
-
const endTime = Date.now();
|
|
589
|
-
const duration = endTime - startTime;
|
|
590
|
-
|
|
591
|
-
const execution: ExecutionRecord = {
|
|
592
|
-
id: customId || `${Date.now()}-litellm`,
|
|
593
|
-
timestamp: new Date(startTime).toISOString(),
|
|
594
|
-
tool: toolName,
|
|
595
|
-
model: result.model, // Use effective model from result (reflects any override)
|
|
596
|
-
mode,
|
|
597
|
-
prompt,
|
|
598
|
-
status: result.success ? 'success' : 'error',
|
|
599
|
-
exit_code: result.success ? 0 : 1,
|
|
600
|
-
duration_ms: duration,
|
|
601
|
-
output: {
|
|
602
|
-
stdout: result.output,
|
|
603
|
-
stderr: result.error || '',
|
|
604
|
-
truncated: false
|
|
605
|
-
}
|
|
606
|
-
};
|
|
607
|
-
|
|
608
|
-
const conversation = convertToConversation(execution);
|
|
609
|
-
|
|
610
|
-
// Try to save to history
|
|
611
|
-
try {
|
|
612
|
-
saveConversation(workingDir, conversation);
|
|
613
|
-
} catch (err) {
|
|
614
|
-
console.error('[CLI Executor] Failed to save LiteLLM history:', (err as Error).message);
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
return {
|
|
618
|
-
success: result.success,
|
|
619
|
-
execution,
|
|
620
|
-
conversation,
|
|
621
|
-
stdout: result.output,
|
|
622
|
-
stderr: result.error || '',
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
// Tool not found
|
|
628
|
-
throw new Error(`Unknown tool: ${tool}. Use one of: ${BUILTIN_CLI_TOOLS.join(', ')} or a registered CLI封装 endpoint name.`);
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// Get SQLite store for native session lookup
|
|
632
|
-
const store = await getSqliteStore(workingDir);
|
|
633
|
-
|
|
634
|
-
// Determine conversation ID and load existing conversation
|
|
635
|
-
// Logic:
|
|
636
|
-
// - If --resume <id1,id2,...> (multiple IDs): merge conversations
|
|
637
|
-
// - With --id: create new merged conversation
|
|
638
|
-
// - Without --id: append to ALL source conversations
|
|
639
|
-
// - If --resume <id> AND --id <newId>: fork - read context from resume ID, create new conversation with newId
|
|
640
|
-
// - If --id provided (no resume): use that ID (create new or append)
|
|
641
|
-
// - If --resume <id> without --id: use resume ID (append to existing)
|
|
642
|
-
// - No params: create new with auto-generated ID
|
|
643
|
-
let conversationId: string;
|
|
644
|
-
let existingConversation: ConversationRecord | null = null;
|
|
645
|
-
let contextConversation: ConversationRecord | null = null; // For fork scenario
|
|
646
|
-
let mergeResult: MergeResult | null = null; // For merge scenario
|
|
647
|
-
let sourceConversations: ConversationRecord[] = []; // All source conversations for merge
|
|
648
|
-
|
|
649
|
-
// Parse resume IDs (can be comma-separated for merge)
|
|
650
|
-
const resumeIds: string[] = resume
|
|
651
|
-
? (typeof resume === 'string' ? resume.split(',').map(id => id.trim()).filter(Boolean) : [])
|
|
652
|
-
: [];
|
|
653
|
-
const isMerge = resumeIds.length > 1;
|
|
654
|
-
const resumeId = resumeIds.length === 1 ? resumeIds[0] : null;
|
|
655
|
-
|
|
656
|
-
if (isMerge) {
|
|
657
|
-
// Merge scenario: multiple resume IDs
|
|
658
|
-
sourceConversations = resumeIds
|
|
659
|
-
.map(id => loadConversation(workingDir, id))
|
|
660
|
-
.filter((c): c is ConversationRecord => c !== null);
|
|
661
|
-
|
|
662
|
-
// Guard against empty merge sources before accessing sourceConversations[0].
|
|
663
|
-
assertNonEmptyArray(
|
|
664
|
-
sourceConversations,
|
|
665
|
-
`No valid conversations found for merge: ${resumeIds.join(', ')}`
|
|
666
|
-
);
|
|
667
|
-
|
|
668
|
-
mergeResult = mergeConversations(sourceConversations);
|
|
669
|
-
debugLog('MERGE', 'Merged conversations', {
|
|
670
|
-
sourceConversationCount: sourceConversations.length,
|
|
671
|
-
resumeIds
|
|
672
|
-
});
|
|
673
|
-
|
|
674
|
-
if (customId) {
|
|
675
|
-
// Create new merged conversation with custom ID
|
|
676
|
-
conversationId = customId;
|
|
677
|
-
existingConversation = loadConversation(workingDir, customId);
|
|
678
|
-
} else {
|
|
679
|
-
// Will append to ALL source conversations (handled in save logic)
|
|
680
|
-
// Use first source conversation ID as primary
|
|
681
|
-
conversationId = sourceConversations[0].id;
|
|
682
|
-
existingConversation = sourceConversations[0];
|
|
683
|
-
}
|
|
684
|
-
} else if (customId && resumeId) {
|
|
685
|
-
// Fork: read context from resume ID, but create new conversation with custom ID
|
|
686
|
-
conversationId = customId;
|
|
687
|
-
contextConversation = loadConversation(workingDir, resumeId);
|
|
688
|
-
existingConversation = loadConversation(workingDir, customId);
|
|
689
|
-
} else if (customId) {
|
|
690
|
-
// Use custom ID - may be new or existing
|
|
691
|
-
conversationId = customId;
|
|
692
|
-
existingConversation = loadConversation(workingDir, customId);
|
|
693
|
-
} else if (resumeId) {
|
|
694
|
-
// Resume single ID without new ID - append to existing conversation
|
|
695
|
-
conversationId = resumeId;
|
|
696
|
-
existingConversation = loadConversation(workingDir, resumeId);
|
|
697
|
-
} else if (resume) {
|
|
698
|
-
// resume=true: get last conversation for this tool
|
|
699
|
-
const history = getExecutionHistory(workingDir, { limit: 1, tool });
|
|
700
|
-
if (history.executions.length > 0) {
|
|
701
|
-
conversationId = history.executions[0].id;
|
|
702
|
-
existingConversation = loadConversation(workingDir, conversationId);
|
|
703
|
-
} else {
|
|
704
|
-
// No previous conversation, create new
|
|
705
|
-
conversationId = `${Date.now()}-${tool}`;
|
|
706
|
-
}
|
|
707
|
-
} else {
|
|
708
|
-
// New conversation with auto-generated ID
|
|
709
|
-
conversationId = `${Date.now()}-${tool}`;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
// Determine resume strategy (native vs prompt-concat vs hybrid)
|
|
713
|
-
let resumeDecision: ResumeDecision | null = null;
|
|
714
|
-
let nativeResumeConfig: NativeResumeConfig | undefined;
|
|
715
|
-
|
|
716
|
-
// resume=true (latest) - use native latest if supported
|
|
717
|
-
if (resume === true && !noNative && supportsNativeResume(tool)) {
|
|
718
|
-
resumeDecision = {
|
|
719
|
-
strategy: 'native',
|
|
720
|
-
isLatest: true,
|
|
721
|
-
primaryConversationId: conversationId
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
// Use strategy engine for complex scenarios
|
|
725
|
-
else if (resumeIds.length > 0 && !noNative) {
|
|
726
|
-
resumeDecision = determineResumeStrategy({
|
|
727
|
-
tool,
|
|
728
|
-
resumeIds,
|
|
729
|
-
customId,
|
|
730
|
-
// Force prompt-concat if noNative flag is set OR if tool doesn't support native resume
|
|
731
|
-
// (e.g., codex resume requires TTY which spawn() doesn't provide)
|
|
732
|
-
forcePromptConcat: noNative || !supportsNativeResume(tool),
|
|
733
|
-
getNativeSessionId: (ccwId) => store.getNativeSessionId(ccwId),
|
|
734
|
-
getConversation: (ccwId) => loadConversation(workingDir, ccwId),
|
|
735
|
-
getConversationTool: (ccwId) => {
|
|
736
|
-
const conv = loadConversation(workingDir, ccwId);
|
|
737
|
-
return conv?.tool || null;
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
// Configure native resume if strategy decided to use it
|
|
743
|
-
if (resumeDecision && (resumeDecision.strategy === 'native' || resumeDecision.strategy === 'hybrid')) {
|
|
744
|
-
nativeResumeConfig = {
|
|
745
|
-
enabled: true,
|
|
746
|
-
sessionId: resumeDecision.nativeSessionId,
|
|
747
|
-
isLatest: resumeDecision.isLatest
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
// Build final prompt with conversation context
|
|
752
|
-
// For native: minimal prompt (native tool handles context)
|
|
753
|
-
// For hybrid: context prefix from other conversations + new prompt
|
|
754
|
-
// For prompt-concat: full multi-turn prompt
|
|
755
|
-
let finalPrompt = prompt;
|
|
756
|
-
|
|
757
|
-
if (resumeDecision?.strategy === 'native') {
|
|
758
|
-
// Native mode: just use the new prompt, tool handles context
|
|
759
|
-
finalPrompt = prompt;
|
|
760
|
-
} else if (resumeDecision?.strategy === 'hybrid' && resumeDecision.contextTurns?.length) {
|
|
761
|
-
// Hybrid mode: add context prefix from other conversations
|
|
762
|
-
const contextPrefix = buildContextPrefix(resumeDecision.contextTurns, format);
|
|
763
|
-
finalPrompt = contextPrefix + prompt;
|
|
764
|
-
} else if (mergeResult && mergeResult.mergedTurns.length > 0) {
|
|
765
|
-
// Full merge: use merged prompt
|
|
766
|
-
finalPrompt = buildMergedPrompt(mergeResult, prompt, format);
|
|
767
|
-
} else {
|
|
768
|
-
// Standard prompt-concat
|
|
769
|
-
const conversationForContext = contextConversation || existingConversation;
|
|
770
|
-
if (conversationForContext && conversationForContext.turns.length > 0) {
|
|
771
|
-
finalPrompt = buildMultiTurnPrompt(conversationForContext, prompt, format);
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
// Check tool availability
|
|
776
|
-
const toolStatus = await checkToolAvailability(tool);
|
|
777
|
-
if (!toolStatus.available) {
|
|
778
|
-
throw new Error(`CLI tool not available: ${tool}. Please ensure it is installed and in PATH.`);
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
// Log resume mode for debugging
|
|
782
|
-
if (resumeDecision) {
|
|
783
|
-
const modeDesc = getResumeModeDescription(resumeDecision);
|
|
784
|
-
if (onOutput) {
|
|
785
|
-
onOutput({
|
|
786
|
-
type: 'stderr',
|
|
787
|
-
content: `[Resume mode: ${modeDesc}]\n`,
|
|
788
|
-
timestamp: new Date().toISOString()
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
// Use configured primary model if no explicit model provided
|
|
794
|
-
const effectiveModel = model || getPrimaryModel(workingDir, tool);
|
|
795
|
-
|
|
796
|
-
// Load and validate settings file for Claude tool (builtin only)
|
|
797
|
-
let settingsFilePath: string | undefined;
|
|
798
|
-
if (tool === 'claude') {
|
|
799
|
-
const toolConfig = getToolConfig(workingDir, tool);
|
|
800
|
-
if (toolConfig.settingsFile) {
|
|
801
|
-
try {
|
|
802
|
-
const resolved = resolvePath(toolConfig.settingsFile);
|
|
803
|
-
if (fs.existsSync(resolved)) {
|
|
804
|
-
settingsFilePath = resolved;
|
|
805
|
-
debugLog('SETTINGS_FILE', `Resolved Claude settings file`, { configured: toolConfig.settingsFile, resolved });
|
|
806
|
-
} else {
|
|
807
|
-
errorLog('SETTINGS_FILE', `Claude settings file not found, skipping`, { configured: toolConfig.settingsFile, resolved });
|
|
808
|
-
}
|
|
809
|
-
} catch (err) {
|
|
810
|
-
errorLog('SETTINGS_FILE', `Failed to resolve Claude settings file`, { configured: toolConfig.settingsFile, error: (err as Error).message });
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
// Build command
|
|
816
|
-
const { command, args, useStdin, outputFormat: autoDetectedFormat } = buildCommand({
|
|
817
|
-
tool,
|
|
818
|
-
prompt: finalPrompt,
|
|
819
|
-
mode,
|
|
820
|
-
model: effectiveModel,
|
|
821
|
-
dir: cd,
|
|
822
|
-
include: includeDirs,
|
|
823
|
-
nativeResume: nativeResumeConfig,
|
|
824
|
-
settingsFile: settingsFilePath,
|
|
825
|
-
reviewOptions: mode === 'review' ? { uncommitted, base, commit, title } : undefined
|
|
826
|
-
});
|
|
827
|
-
|
|
828
|
-
// Use auto-detected format (from buildCommand) if available, otherwise use passed outputFormat
|
|
829
|
-
const finalOutputFormat = autoDetectedFormat || outputFormat;
|
|
830
|
-
|
|
831
|
-
// Create output parser and IR storage
|
|
832
|
-
const parser = createOutputParser(finalOutputFormat);
|
|
833
|
-
const allOutputUnits: CliOutputUnit[] = [];
|
|
834
|
-
|
|
835
|
-
const startTime = Date.now();
|
|
836
|
-
|
|
837
|
-
debugLog('EXEC', `Starting CLI execution`, {
|
|
838
|
-
tool,
|
|
839
|
-
mode,
|
|
840
|
-
workingDir,
|
|
841
|
-
conversationId,
|
|
842
|
-
promptLength: finalPrompt.length,
|
|
843
|
-
hasResume: !!resume,
|
|
844
|
-
hasCustomId: !!customId,
|
|
845
|
-
outputFormat: finalOutputFormat
|
|
846
|
-
});
|
|
847
|
-
|
|
848
|
-
return new Promise((resolve, reject) => {
|
|
849
|
-
// Windows requires shell: true for npm global commands (.cmd files)
|
|
850
|
-
// Unix-like systems can use shell: false for direct execution
|
|
851
|
-
const isWindows = process.platform === 'win32';
|
|
852
|
-
|
|
853
|
-
// When using cmd.exe via `shell: true`, escape args to prevent metacharacter injection.
|
|
854
|
-
const commandToSpawn = isWindows ? escapeWindowsArg(command) : command;
|
|
855
|
-
const argsToSpawn = isWindows ? args.map(escapeWindowsArg) : args;
|
|
856
|
-
|
|
857
|
-
// Load custom environment variables from envFile if configured (for gemini/qwen)
|
|
858
|
-
const toolConfig = getToolConfig(workingDir, tool);
|
|
859
|
-
let customEnv: Record<string, string> = {};
|
|
860
|
-
if (toolConfig.envFile) {
|
|
861
|
-
customEnv = loadEnvFile(toolConfig.envFile);
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
// Merge custom env with process.env (custom env takes precedence)
|
|
865
|
-
// Also include rulesEnv for $PROTO and $TMPL template variables
|
|
866
|
-
const spawnEnv = {
|
|
867
|
-
...process.env,
|
|
868
|
-
...customEnv,
|
|
869
|
-
...(rulesEnv || {})
|
|
870
|
-
};
|
|
871
|
-
|
|
872
|
-
debugLog('SPAWN', `Spawning process`, {
|
|
873
|
-
command,
|
|
874
|
-
args,
|
|
875
|
-
cwd: workingDir,
|
|
876
|
-
shell: isWindows,
|
|
877
|
-
useStdin,
|
|
878
|
-
platform: process.platform,
|
|
879
|
-
fullCommand: `${command} ${args.join(' ')}`,
|
|
880
|
-
hasCustomEnv: Object.keys(customEnv).length > 0,
|
|
881
|
-
customEnvKeys: Object.keys(customEnv),
|
|
882
|
-
...(isWindows ? { escapedCommand: commandToSpawn, escapedArgs: argsToSpawn, escapedFullCommand: `${commandToSpawn} ${argsToSpawn.join(' ')}` } : {})
|
|
883
|
-
});
|
|
884
|
-
|
|
885
|
-
const child = spawn(commandToSpawn, argsToSpawn, {
|
|
886
|
-
cwd: workingDir,
|
|
887
|
-
shell: isWindows, // Enable shell on Windows for .cmd files
|
|
888
|
-
stdio: [useStdin ? 'pipe' : 'ignore', 'pipe', 'pipe'],
|
|
889
|
-
env: spawnEnv
|
|
890
|
-
});
|
|
891
|
-
|
|
892
|
-
// Track current child process for cleanup on interruption
|
|
893
|
-
currentChildProcess = child;
|
|
894
|
-
|
|
895
|
-
debugLog('SPAWN', `Process spawned`, { pid: child.pid });
|
|
896
|
-
|
|
897
|
-
// Write prompt to stdin if using stdin mode (for gemini/qwen)
|
|
898
|
-
if (useStdin && child.stdin) {
|
|
899
|
-
debugLog('STDIN', `Writing prompt to stdin (${finalPrompt.length} bytes)`);
|
|
900
|
-
child.stdin.write(finalPrompt);
|
|
901
|
-
child.stdin.end();
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
let stdout = '';
|
|
905
|
-
let stderr = '';
|
|
906
|
-
|
|
907
|
-
// Handle stdout
|
|
908
|
-
child.stdout!.on('data', (data: Buffer) => {
|
|
909
|
-
const text = data.toString();
|
|
910
|
-
stdout += text;
|
|
911
|
-
|
|
912
|
-
// Parse into IR units
|
|
913
|
-
const units = parser.parse(data, 'stdout');
|
|
914
|
-
allOutputUnits.push(...units);
|
|
915
|
-
|
|
916
|
-
if (onOutput) {
|
|
917
|
-
// Send each IR unit to callback
|
|
918
|
-
for (const unit of units) {
|
|
919
|
-
onOutput(unit);
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
});
|
|
923
|
-
|
|
924
|
-
// Handle stderr
|
|
925
|
-
child.stderr!.on('data', (data: Buffer) => {
|
|
926
|
-
const text = data.toString();
|
|
927
|
-
stderr += text;
|
|
928
|
-
|
|
929
|
-
// Parse into IR units
|
|
930
|
-
const units = parser.parse(data, 'stderr');
|
|
931
|
-
allOutputUnits.push(...units);
|
|
932
|
-
|
|
933
|
-
if (onOutput) {
|
|
934
|
-
// Send each IR unit to callback
|
|
935
|
-
for (const unit of units) {
|
|
936
|
-
onOutput(unit);
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
});
|
|
940
|
-
|
|
941
|
-
// Handle completion
|
|
942
|
-
child.on('close', async (code) => {
|
|
943
|
-
if (killTimeout && killTimeoutProcess === child) {
|
|
944
|
-
clearTimeout(killTimeout);
|
|
945
|
-
killTimeout = null;
|
|
946
|
-
killTimeoutProcess = null;
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
// Clear current child process reference
|
|
950
|
-
currentChildProcess = null;
|
|
951
|
-
|
|
952
|
-
// Flush remaining buffer from parser
|
|
953
|
-
const remainingUnits = parser.flush();
|
|
954
|
-
allOutputUnits.push(...remainingUnits);
|
|
955
|
-
if (onOutput) {
|
|
956
|
-
for (const unit of remainingUnits) {
|
|
957
|
-
onOutput(unit);
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
const endTime = Date.now();
|
|
962
|
-
const duration = endTime - startTime;
|
|
963
|
-
|
|
964
|
-
debugLog('CLOSE', `Process closed`, {
|
|
965
|
-
exitCode: code,
|
|
966
|
-
duration: `${duration}ms`,
|
|
967
|
-
stdoutLength: stdout.length,
|
|
968
|
-
stderrLength: stderr.length,
|
|
969
|
-
outputUnitsCount: allOutputUnits.length
|
|
970
|
-
});
|
|
971
|
-
|
|
972
|
-
// Determine status - prioritize output content over exit code
|
|
973
|
-
let status: 'success' | 'error' = 'success';
|
|
974
|
-
if (code !== 0) {
|
|
975
|
-
// Non-zero exit code doesn't always mean failure
|
|
976
|
-
// Check if there's valid output (AI response) - treat as success
|
|
977
|
-
const hasValidOutput = stdout.trim().length > 0;
|
|
978
|
-
const hasFatalError = stderr.includes('FATAL') ||
|
|
979
|
-
stderr.includes('Authentication failed') ||
|
|
980
|
-
stderr.includes('API key') ||
|
|
981
|
-
stderr.includes('rate limit exceeded');
|
|
982
|
-
|
|
983
|
-
debugLog('STATUS', `Non-zero exit code analysis`, {
|
|
984
|
-
exitCode: code,
|
|
985
|
-
hasValidOutput,
|
|
986
|
-
hasFatalError,
|
|
987
|
-
stderrPreview: stderr.substring(0, 500)
|
|
988
|
-
});
|
|
989
|
-
|
|
990
|
-
if (hasValidOutput && !hasFatalError) {
|
|
991
|
-
// Has output and no fatal errors - treat as success despite exit code
|
|
992
|
-
status = 'success';
|
|
993
|
-
debugLog('STATUS', `Treating as success (has valid output, no fatal errors)`);
|
|
994
|
-
} else {
|
|
995
|
-
status = 'error';
|
|
996
|
-
errorLog('EXEC', `CLI execution failed`, undefined, {
|
|
997
|
-
exitCode: code,
|
|
998
|
-
tool,
|
|
999
|
-
command,
|
|
1000
|
-
args,
|
|
1001
|
-
workingDir,
|
|
1002
|
-
stderrFull: stderr,
|
|
1003
|
-
stdoutPreview: stdout.substring(0, 200)
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
} else {
|
|
1007
|
-
debugLog('STATUS', `Execution successful (exit code 0)`);
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
// Create new turn - cache full output when not streaming (default)
|
|
1011
|
-
const shouldCache = !parsed.data.stream;
|
|
1012
|
-
|
|
1013
|
-
// Compute parsed output (filtered, intermediate content removed) for general display
|
|
1014
|
-
const computedParsedOutput = flattenOutputUnits(allOutputUnits, {
|
|
1015
|
-
excludeTypes: ['stderr', 'progress', 'metadata', 'system', 'tool_call', 'thought', 'code', 'file_diff', 'streaming_content'],
|
|
1016
|
-
stripCommandJsonBlocks: true // Strip embedded command execution JSON from agent_message
|
|
1017
|
-
});
|
|
1018
|
-
|
|
1019
|
-
// Compute final output (only agent_message) for --final flag
|
|
1020
|
-
const computedFinalOutput = flattenOutputUnits(allOutputUnits, {
|
|
1021
|
-
includeTypes: ['agent_message'],
|
|
1022
|
-
stripCommandJsonBlocks: true // Strip embedded command execution JSON from agent_message
|
|
1023
|
-
});
|
|
1024
|
-
|
|
1025
|
-
const newTurnOutput = {
|
|
1026
|
-
stdout: stdout.substring(0, 10240), // Truncate preview to 10KB
|
|
1027
|
-
stderr: stderr.substring(0, 2048), // Truncate preview to 2KB
|
|
1028
|
-
truncated: stdout.length > 10240 || stderr.length > 2048,
|
|
1029
|
-
cached: shouldCache,
|
|
1030
|
-
stdout_full: shouldCache ? stdout : undefined,
|
|
1031
|
-
stderr_full: shouldCache ? stderr : undefined,
|
|
1032
|
-
parsed_output: computedParsedOutput || undefined, // Filtered output for general display
|
|
1033
|
-
final_output: computedFinalOutput || undefined, // Agent message only for --final flag
|
|
1034
|
-
structured: allOutputUnits // Save structured IR units
|
|
1035
|
-
};
|
|
1036
|
-
|
|
1037
|
-
// Determine base turn number for merge scenarios
|
|
1038
|
-
const baseTurnNumber = isMerge && mergeResult
|
|
1039
|
-
? mergeResult.mergedTurns.length + 1
|
|
1040
|
-
: (existingConversation ? existingConversation.turns.length + 1 : 1);
|
|
1041
|
-
|
|
1042
|
-
const newTurn: ConversationTurn = {
|
|
1043
|
-
turn: baseTurnNumber,
|
|
1044
|
-
timestamp: new Date(startTime).toISOString(),
|
|
1045
|
-
prompt,
|
|
1046
|
-
duration_ms: duration,
|
|
1047
|
-
status,
|
|
1048
|
-
exit_code: code,
|
|
1049
|
-
output: newTurnOutput
|
|
1050
|
-
};
|
|
1051
|
-
|
|
1052
|
-
// Create or update conversation record
|
|
1053
|
-
let conversation: ConversationRecord;
|
|
1054
|
-
|
|
1055
|
-
if (isMerge && mergeResult && !customId) {
|
|
1056
|
-
// Merge without --id: append to ALL source conversations
|
|
1057
|
-
// Save new turn to each source conversation
|
|
1058
|
-
const savedConversations: ConversationRecord[] = [];
|
|
1059
|
-
for (const srcConv of sourceConversations) {
|
|
1060
|
-
const turnForSrc: ConversationTurn = {
|
|
1061
|
-
...newTurn,
|
|
1062
|
-
turn: srcConv.turns.length + 1 // Use each conversation's turn count
|
|
1063
|
-
};
|
|
1064
|
-
const updatedConv: ConversationRecord = {
|
|
1065
|
-
...srcConv,
|
|
1066
|
-
updated_at: new Date().toISOString(),
|
|
1067
|
-
total_duration_ms: srcConv.total_duration_ms + duration,
|
|
1068
|
-
turn_count: srcConv.turns.length + 1,
|
|
1069
|
-
latest_status: status,
|
|
1070
|
-
turns: [...srcConv.turns, turnForSrc]
|
|
1071
|
-
};
|
|
1072
|
-
savedConversations.push(updatedConv);
|
|
1073
|
-
}
|
|
1074
|
-
// Use first conversation as primary
|
|
1075
|
-
conversation = savedConversations[0];
|
|
1076
|
-
// Save all source conversations
|
|
1077
|
-
try {
|
|
1078
|
-
for (const conv of savedConversations) {
|
|
1079
|
-
saveConversation(workingDir, conv);
|
|
1080
|
-
}
|
|
1081
|
-
} catch (err) {
|
|
1082
|
-
console.error('[CLI Executor] Failed to save merged histories:', (err as Error).message);
|
|
1083
|
-
}
|
|
1084
|
-
} else if (isMerge && mergeResult && customId) {
|
|
1085
|
-
// Merge with --id: create new conversation with merged turns + new turn
|
|
1086
|
-
// Convert merged turns to regular turns (without source_id)
|
|
1087
|
-
const mergedTurns: ConversationTurn[] = mergeResult.mergedTurns.map((mt, idx) => ({
|
|
1088
|
-
turn: idx + 1,
|
|
1089
|
-
timestamp: mt.timestamp,
|
|
1090
|
-
prompt: mt.prompt,
|
|
1091
|
-
duration_ms: mt.duration_ms,
|
|
1092
|
-
status: mt.status,
|
|
1093
|
-
exit_code: mt.exit_code,
|
|
1094
|
-
output: mt.output
|
|
1095
|
-
}));
|
|
1096
|
-
|
|
1097
|
-
conversation = existingConversation
|
|
1098
|
-
? {
|
|
1099
|
-
...existingConversation,
|
|
1100
|
-
updated_at: new Date().toISOString(),
|
|
1101
|
-
total_duration_ms: existingConversation.total_duration_ms + duration,
|
|
1102
|
-
turn_count: existingConversation.turns.length + 1,
|
|
1103
|
-
latest_status: status,
|
|
1104
|
-
turns: [...existingConversation.turns, newTurn]
|
|
1105
|
-
}
|
|
1106
|
-
: {
|
|
1107
|
-
id: conversationId,
|
|
1108
|
-
created_at: new Date(startTime).toISOString(),
|
|
1109
|
-
updated_at: new Date().toISOString(),
|
|
1110
|
-
tool,
|
|
1111
|
-
model: model || 'default',
|
|
1112
|
-
mode,
|
|
1113
|
-
category,
|
|
1114
|
-
total_duration_ms: mergeResult.totalDuration + duration,
|
|
1115
|
-
turn_count: mergedTurns.length + 1,
|
|
1116
|
-
latest_status: status,
|
|
1117
|
-
turns: [...mergedTurns, newTurn]
|
|
1118
|
-
};
|
|
1119
|
-
// Save merged conversation
|
|
1120
|
-
try {
|
|
1121
|
-
saveConversation(workingDir, conversation);
|
|
1122
|
-
} catch (err) {
|
|
1123
|
-
console.error('[CLI Executor] Failed to save merged conversation:', (err as Error).message);
|
|
1124
|
-
}
|
|
1125
|
-
} else {
|
|
1126
|
-
// Normal scenario: single conversation
|
|
1127
|
-
conversation = existingConversation
|
|
1128
|
-
? {
|
|
1129
|
-
...existingConversation,
|
|
1130
|
-
updated_at: new Date().toISOString(),
|
|
1131
|
-
total_duration_ms: existingConversation.total_duration_ms + duration,
|
|
1132
|
-
turn_count: existingConversation.turns.length + 1,
|
|
1133
|
-
latest_status: status,
|
|
1134
|
-
turns: [...existingConversation.turns, newTurn]
|
|
1135
|
-
}
|
|
1136
|
-
: {
|
|
1137
|
-
id: conversationId,
|
|
1138
|
-
created_at: new Date(startTime).toISOString(),
|
|
1139
|
-
updated_at: new Date().toISOString(),
|
|
1140
|
-
tool,
|
|
1141
|
-
model: model || 'default',
|
|
1142
|
-
mode,
|
|
1143
|
-
category,
|
|
1144
|
-
total_duration_ms: duration,
|
|
1145
|
-
turn_count: 1,
|
|
1146
|
-
latest_status: status,
|
|
1147
|
-
turns: [newTurn],
|
|
1148
|
-
parent_execution_id: parentExecutionId
|
|
1149
|
-
};
|
|
1150
|
-
// Try to save conversation to history
|
|
1151
|
-
try {
|
|
1152
|
-
saveConversation(workingDir, conversation);
|
|
1153
|
-
} catch (err) {
|
|
1154
|
-
// Non-fatal: continue even if history save fails
|
|
1155
|
-
console.error('[CLI Executor] Failed to save history:', (err as Error).message);
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
// Track native session after execution (awaited to prevent process hang)
|
|
1160
|
-
// Pass prompt for precise matching in parallel execution scenarios
|
|
1161
|
-
try {
|
|
1162
|
-
const nativeSession = await trackNewSession(tool, new Date(startTime), workingDir, prompt);
|
|
1163
|
-
if (nativeSession) {
|
|
1164
|
-
// Save native session mapping
|
|
1165
|
-
try {
|
|
1166
|
-
store.saveNativeSessionMapping({
|
|
1167
|
-
ccw_id: conversationId,
|
|
1168
|
-
tool,
|
|
1169
|
-
native_session_id: nativeSession.sessionId,
|
|
1170
|
-
native_session_path: nativeSession.filePath,
|
|
1171
|
-
project_hash: nativeSession.projectHash,
|
|
1172
|
-
created_at: new Date().toISOString()
|
|
1173
|
-
});
|
|
1174
|
-
} catch (err) {
|
|
1175
|
-
console.error('[CLI Executor] Failed to save native session mapping:', (err as Error).message);
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
} catch (err) {
|
|
1179
|
-
console.error('[CLI Executor] Failed to track native session:', (err as Error).message);
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
// Create legacy execution record for backward compatibility
|
|
1183
|
-
const execution: ExecutionRecord = {
|
|
1184
|
-
id: conversationId,
|
|
1185
|
-
timestamp: new Date(startTime).toISOString(),
|
|
1186
|
-
tool,
|
|
1187
|
-
model: effectiveModel || 'default',
|
|
1188
|
-
mode,
|
|
1189
|
-
prompt,
|
|
1190
|
-
status,
|
|
1191
|
-
exit_code: code,
|
|
1192
|
-
duration_ms: duration,
|
|
1193
|
-
output: newTurnOutput,
|
|
1194
|
-
parsedOutput: computedParsedOutput, // Use already-computed filtered output
|
|
1195
|
-
finalOutput: computedFinalOutput // Use already-computed agent_message only output
|
|
1196
|
-
};
|
|
1197
|
-
|
|
1198
|
-
resolve({
|
|
1199
|
-
success: status === 'success',
|
|
1200
|
-
execution,
|
|
1201
|
-
conversation,
|
|
1202
|
-
stdout,
|
|
1203
|
-
stderr,
|
|
1204
|
-
parsedOutput: execution.parsedOutput,
|
|
1205
|
-
finalOutput: execution.finalOutput
|
|
1206
|
-
});
|
|
1207
|
-
});
|
|
1208
|
-
|
|
1209
|
-
// Handle errors
|
|
1210
|
-
child.on('error', (error) => {
|
|
1211
|
-
errorLog('SPAWN', `Failed to spawn process`, error, {
|
|
1212
|
-
tool,
|
|
1213
|
-
command,
|
|
1214
|
-
args,
|
|
1215
|
-
workingDir,
|
|
1216
|
-
fullCommand: `${command} ${args.join(' ')}`,
|
|
1217
|
-
platform: process.platform,
|
|
1218
|
-
path: process.env.PATH?.split(process.platform === 'win32' ? ';' : ':').slice(0, 10).join('\n ') + '...'
|
|
1219
|
-
});
|
|
1220
|
-
reject(new Error(`Failed to spawn ${tool}: ${error.message}\n Command: ${command} ${args.join(' ')}\n Working Dir: ${workingDir}`));
|
|
1221
|
-
});
|
|
1222
|
-
|
|
1223
|
-
// Timeout controlled by external caller (bash timeout)
|
|
1224
|
-
// When parent process terminates, child will be cleaned up via process exit handler
|
|
1225
|
-
});
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
// Tool schema for MCP
|
|
1229
|
-
export const schema: ToolSchema = {
|
|
1230
|
-
name: 'cli_executor',
|
|
1231
|
-
description: `Execute external CLI tools (gemini/qwen/codex) with unified interface.
|
|
1232
|
-
Modes:
|
|
1233
|
-
- analysis: Read-only operations (default)
|
|
1234
|
-
- write: File modifications allowed
|
|
1235
|
-
- auto: Full autonomous operations (codex only)
|
|
1236
|
-
- review: Code review mode (codex uses 'codex review' subcommand, others accept but no operation change)`,
|
|
1237
|
-
inputSchema: {
|
|
1238
|
-
type: 'object',
|
|
1239
|
-
properties: {
|
|
1240
|
-
tool: {
|
|
1241
|
-
type: 'string',
|
|
1242
|
-
enum: ['gemini', 'qwen', 'codex'],
|
|
1243
|
-
description: 'CLI tool to execute'
|
|
1244
|
-
},
|
|
1245
|
-
prompt: {
|
|
1246
|
-
type: 'string',
|
|
1247
|
-
description: 'Prompt to send to the CLI tool'
|
|
1248
|
-
},
|
|
1249
|
-
mode: {
|
|
1250
|
-
type: 'string',
|
|
1251
|
-
enum: ['analysis', 'write', 'auto', 'review'],
|
|
1252
|
-
description: 'Execution mode (default: analysis). review mode uses codex review subcommand for codex tool.',
|
|
1253
|
-
default: 'analysis'
|
|
1254
|
-
},
|
|
1255
|
-
model: {
|
|
1256
|
-
type: 'string',
|
|
1257
|
-
description: 'Model override (tool-specific)'
|
|
1258
|
-
},
|
|
1259
|
-
cd: {
|
|
1260
|
-
type: 'string',
|
|
1261
|
-
description: 'Working directory for execution (-C for codex)'
|
|
1262
|
-
},
|
|
1263
|
-
includeDirs: {
|
|
1264
|
-
type: 'string',
|
|
1265
|
-
description: 'Additional directories (comma-separated). Maps to --include-directories for gemini/qwen, --add-dir for codex'
|
|
1266
|
-
}
|
|
1267
|
-
// timeout removed - controlled by external caller (bash timeout)
|
|
1268
|
-
},
|
|
1269
|
-
required: ['tool', 'prompt']
|
|
1270
|
-
}
|
|
1271
|
-
};
|
|
1272
|
-
|
|
1273
|
-
// Handler function
|
|
1274
|
-
export async function handler(params: Record<string, unknown>): Promise<ToolResult<ExecutionOutput>> {
|
|
1275
|
-
try {
|
|
1276
|
-
const result = await executeCliTool(params);
|
|
1277
|
-
return {
|
|
1278
|
-
success: result.success,
|
|
1279
|
-
result
|
|
1280
|
-
};
|
|
1281
|
-
} catch (error) {
|
|
1282
|
-
return {
|
|
1283
|
-
success: false,
|
|
1284
|
-
error: `CLI execution failed: ${(error as Error).message}`
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
export {
|
|
1290
|
-
batchDeleteExecutionsAsync,
|
|
1291
|
-
deleteExecution,
|
|
1292
|
-
deleteExecutionAsync,
|
|
1293
|
-
getConversationDetail,
|
|
1294
|
-
getConversationDetailWithNativeInfo,
|
|
1295
|
-
getExecutionDetail,
|
|
1296
|
-
getExecutionHistory,
|
|
1297
|
-
getExecutionHistoryAsync
|
|
1298
|
-
} from './cli-executor-state.js';
|
|
1299
|
-
|
|
1300
|
-
/**
|
|
1301
|
-
* Get status of all CLI tools
|
|
1302
|
-
* Dynamically reads tools from config file
|
|
1303
|
-
* Handles different tool types:
|
|
1304
|
-
* - builtin: Check system PATH availability
|
|
1305
|
-
* - cli-wrapper: Check CLI Settings configuration exists
|
|
1306
|
-
* - api-endpoint: Check LiteLLM endpoint configuration exists
|
|
1307
|
-
*/
|
|
1308
|
-
export async function getCliToolsStatus(): Promise<Record<string, ToolAvailability>> {
|
|
1309
|
-
const funcStart = Date.now();
|
|
1310
|
-
debugLog('PERF', 'getCliToolsStatus START');
|
|
1311
|
-
|
|
1312
|
-
// Default built-in tools
|
|
1313
|
-
const builtInTools = ['gemini', 'qwen', 'codex', 'claude', 'opencode'];
|
|
1314
|
-
|
|
1315
|
-
// Try to get tools from config with their types
|
|
1316
|
-
interface ToolInfo {
|
|
1317
|
-
name: string;
|
|
1318
|
-
type?: 'builtin' | 'cli-wrapper' | 'api-endpoint';
|
|
1319
|
-
enabled?: boolean;
|
|
1320
|
-
id?: string; // For api-endpoint type
|
|
1321
|
-
}
|
|
1322
|
-
let toolsInfo: ToolInfo[] = builtInTools.map(name => ({ name, type: 'builtin' }));
|
|
1323
|
-
|
|
1324
|
-
const configLoadStart = Date.now();
|
|
1325
|
-
try {
|
|
1326
|
-
// Dynamic import to avoid circular dependencies
|
|
1327
|
-
const { loadClaudeCliTools } = await import('./claude-cli-tools.js');
|
|
1328
|
-
const config = loadClaudeCliTools(configBaseDir);
|
|
1329
|
-
if (config.tools && typeof config.tools === 'object') {
|
|
1330
|
-
// Build complete tool info list from config
|
|
1331
|
-
const configToolsInfo: ToolInfo[] = Object.entries(config.tools).map(([name, toolConfig]) => ({
|
|
1332
|
-
name,
|
|
1333
|
-
type: toolConfig.type || 'builtin',
|
|
1334
|
-
enabled: toolConfig.enabled !== false,
|
|
1335
|
-
id: toolConfig.id
|
|
1336
|
-
}));
|
|
1337
|
-
|
|
1338
|
-
// Merge: config tools take precedence over built-in defaults
|
|
1339
|
-
const toolsMap = new Map<string, ToolInfo>();
|
|
1340
|
-
toolsInfo.forEach(t => toolsMap.set(t.name, t));
|
|
1341
|
-
configToolsInfo.forEach(t => toolsMap.set(t.name, t));
|
|
1342
|
-
toolsInfo = Array.from(toolsMap.values());
|
|
1343
|
-
}
|
|
1344
|
-
} catch (e) {
|
|
1345
|
-
// Fallback to built-in tools if config load fails
|
|
1346
|
-
debugLog('cli-executor', `Using built-in tools (config load failed: ${(e as Error).message})`);
|
|
1347
|
-
}
|
|
1348
|
-
debugLog('PERF', `Config load: ${Date.now() - configLoadStart}ms, tools: ${toolsInfo.length}`);
|
|
1349
|
-
|
|
1350
|
-
const results: Record<string, ToolAvailability> = {};
|
|
1351
|
-
const toolTimings: Record<string, number> = {};
|
|
1352
|
-
|
|
1353
|
-
const checksStart = Date.now();
|
|
1354
|
-
await Promise.all(toolsInfo.map(async (toolInfo) => {
|
|
1355
|
-
const { name, type, enabled, id } = toolInfo;
|
|
1356
|
-
const toolStart = Date.now();
|
|
1357
|
-
|
|
1358
|
-
// Check availability based on tool type
|
|
1359
|
-
if (type === 'cli-wrapper') {
|
|
1360
|
-
// For cli-wrapper: check if CLI Settings configuration exists
|
|
1361
|
-
try {
|
|
1362
|
-
const { findEndpoint } = await import('../config/cli-settings-manager.js');
|
|
1363
|
-
const endpoint = findEndpoint(name);
|
|
1364
|
-
if (endpoint && endpoint.enabled) {
|
|
1365
|
-
results[name] = {
|
|
1366
|
-
available: true,
|
|
1367
|
-
path: `cli-settings:${endpoint.id}` // Virtual path indicating CLI Settings source
|
|
1368
|
-
};
|
|
1369
|
-
} else {
|
|
1370
|
-
results[name] = { available: false, path: null };
|
|
1371
|
-
}
|
|
1372
|
-
} catch (e) {
|
|
1373
|
-
debugLog('cli-executor', `Failed to check cli-wrapper ${name}: ${(e as Error).message}`);
|
|
1374
|
-
results[name] = { available: false, path: null };
|
|
1375
|
-
}
|
|
1376
|
-
} else if (type === 'api-endpoint') {
|
|
1377
|
-
// For api-endpoint: check if LiteLLM endpoint configuration exists
|
|
1378
|
-
try {
|
|
1379
|
-
const { findEndpointById } = await import('../config/litellm-api-config-manager.js');
|
|
1380
|
-
const endpointId = id || name;
|
|
1381
|
-
const endpoint = findEndpointById(configBaseDir, endpointId);
|
|
1382
|
-
if (endpoint && enabled !== false) {
|
|
1383
|
-
results[name] = {
|
|
1384
|
-
available: true,
|
|
1385
|
-
path: `litellm:${endpointId}` // Virtual path indicating LiteLLM source
|
|
1386
|
-
};
|
|
1387
|
-
} else {
|
|
1388
|
-
results[name] = { available: false, path: null };
|
|
1389
|
-
}
|
|
1390
|
-
} catch (e) {
|
|
1391
|
-
debugLog('cli-executor', `Failed to check api-endpoint ${name}: ${(e as Error).message}`);
|
|
1392
|
-
results[name] = { available: false, path: null };
|
|
1393
|
-
}
|
|
1394
|
-
} else {
|
|
1395
|
-
// For builtin: check system PATH availability
|
|
1396
|
-
results[name] = await checkToolAvailability(name);
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
toolTimings[name] = Date.now() - toolStart;
|
|
1400
|
-
}));
|
|
1401
|
-
|
|
1402
|
-
debugLog('PERF', `Tool checks: ${Date.now() - checksStart}ms | Individual: ${JSON.stringify(toolTimings)}`);
|
|
1403
|
-
debugLog('PERF', `getCliToolsStatus TOTAL: ${Date.now() - funcStart}ms`);
|
|
1404
|
-
|
|
1405
|
-
return results;
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
// CLI tool package mapping
|
|
1409
|
-
const CLI_TOOL_PACKAGES: Record<string, string> = {
|
|
1410
|
-
gemini: '@google/gemini-cli',
|
|
1411
|
-
qwen: '@qwen-code/qwen-code',
|
|
1412
|
-
codex: '@openai/codex',
|
|
1413
|
-
claude: '@anthropic-ai/claude-code',
|
|
1414
|
-
opencode: 'opencode' // https://opencode.ai - installed via npm/pnpm/bun/brew
|
|
1415
|
-
};
|
|
1416
|
-
|
|
1417
|
-
// Disabled tools storage (in-memory fallback, main storage is in cli-config.json)
|
|
1418
|
-
const disabledTools = new Set<string>();
|
|
1419
|
-
|
|
1420
|
-
// Default working directory for config operations
|
|
1421
|
-
let configBaseDir = process.cwd();
|
|
1422
|
-
|
|
1423
|
-
/**
|
|
1424
|
-
* Set the base directory for config operations
|
|
1425
|
-
*/
|
|
1426
|
-
export function setConfigBaseDir(dir: string): void {
|
|
1427
|
-
configBaseDir = dir;
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
/**
|
|
1431
|
-
* Install a CLI tool via npm
|
|
1432
|
-
*/
|
|
1433
|
-
export async function installCliTool(tool: string): Promise<{ success: boolean; error?: string }> {
|
|
1434
|
-
const packageName = CLI_TOOL_PACKAGES[tool];
|
|
1435
|
-
if (!packageName) {
|
|
1436
|
-
return { success: false, error: `Unknown tool: ${tool}` };
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
return new Promise((resolve) => {
|
|
1440
|
-
const child = spawn('npm', ['install', '-g', packageName], {
|
|
1441
|
-
shell: true,
|
|
1442
|
-
stdio: ['ignore', 'pipe', 'pipe']
|
|
1443
|
-
});
|
|
1444
|
-
|
|
1445
|
-
let stderr = '';
|
|
1446
|
-
child.stderr?.on('data', (data) => { stderr += data.toString(); });
|
|
1447
|
-
|
|
1448
|
-
child.on('close', (code) => {
|
|
1449
|
-
// Clear cache to force re-check
|
|
1450
|
-
clearToolCache();
|
|
1451
|
-
|
|
1452
|
-
if (code === 0) {
|
|
1453
|
-
resolve({ success: true });
|
|
1454
|
-
} else {
|
|
1455
|
-
resolve({ success: false, error: stderr || `npm install failed with code ${code}` });
|
|
1456
|
-
}
|
|
1457
|
-
});
|
|
1458
|
-
|
|
1459
|
-
child.on('error', (err) => {
|
|
1460
|
-
resolve({ success: false, error: err.message });
|
|
1461
|
-
});
|
|
1462
|
-
|
|
1463
|
-
// Timeout after 2 minutes
|
|
1464
|
-
setTimeout(() => {
|
|
1465
|
-
child.kill();
|
|
1466
|
-
resolve({ success: false, error: 'Installation timed out' });
|
|
1467
|
-
}, 120000);
|
|
1468
|
-
});
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
/**
|
|
1472
|
-
* Uninstall a CLI tool via npm
|
|
1473
|
-
*/
|
|
1474
|
-
export async function uninstallCliTool(tool: string): Promise<{ success: boolean; error?: string }> {
|
|
1475
|
-
const packageName = CLI_TOOL_PACKAGES[tool];
|
|
1476
|
-
if (!packageName) {
|
|
1477
|
-
return { success: false, error: `Unknown tool: ${tool}` };
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
return new Promise((resolve) => {
|
|
1481
|
-
const child = spawn('npm', ['uninstall', '-g', packageName], {
|
|
1482
|
-
shell: true,
|
|
1483
|
-
stdio: ['ignore', 'pipe', 'pipe']
|
|
1484
|
-
});
|
|
1485
|
-
|
|
1486
|
-
let stderr = '';
|
|
1487
|
-
child.stderr?.on('data', (data) => { stderr += data.toString(); });
|
|
1488
|
-
|
|
1489
|
-
child.on('close', (code) => {
|
|
1490
|
-
// Clear cache to force re-check
|
|
1491
|
-
clearToolCache();
|
|
1492
|
-
|
|
1493
|
-
if (code === 0) {
|
|
1494
|
-
resolve({ success: true });
|
|
1495
|
-
} else {
|
|
1496
|
-
resolve({ success: false, error: stderr || `npm uninstall failed with code ${code}` });
|
|
1497
|
-
}
|
|
1498
|
-
});
|
|
1499
|
-
|
|
1500
|
-
child.on('error', (err) => {
|
|
1501
|
-
resolve({ success: false, error: err.message });
|
|
1502
|
-
});
|
|
1503
|
-
|
|
1504
|
-
// Timeout after 1 minute
|
|
1505
|
-
setTimeout(() => {
|
|
1506
|
-
child.kill();
|
|
1507
|
-
resolve({ success: false, error: 'Uninstallation timed out' });
|
|
1508
|
-
}, 60000);
|
|
1509
|
-
});
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
/**
|
|
1513
|
-
* Enable a CLI tool (updates config file)
|
|
1514
|
-
*/
|
|
1515
|
-
export function enableCliTool(tool: string): { success: boolean } {
|
|
1516
|
-
try {
|
|
1517
|
-
enableToolFromConfig(configBaseDir, tool);
|
|
1518
|
-
disabledTools.delete(tool); // Also update in-memory fallback
|
|
1519
|
-
return { success: true };
|
|
1520
|
-
} catch (err) {
|
|
1521
|
-
console.error('[cli-executor] Error enabling tool:', err);
|
|
1522
|
-
disabledTools.delete(tool); // Fallback to in-memory
|
|
1523
|
-
return { success: true };
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
/**
|
|
1528
|
-
* Disable a CLI tool (updates config file)
|
|
1529
|
-
*/
|
|
1530
|
-
export function disableCliTool(tool: string): { success: boolean } {
|
|
1531
|
-
try {
|
|
1532
|
-
disableToolFromConfig(configBaseDir, tool);
|
|
1533
|
-
disabledTools.add(tool); // Also update in-memory fallback
|
|
1534
|
-
return { success: true };
|
|
1535
|
-
} catch (err) {
|
|
1536
|
-
console.error('[cli-executor] Error disabling tool:', err);
|
|
1537
|
-
disabledTools.add(tool); // Fallback to in-memory
|
|
1538
|
-
return { success: true };
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
/**
|
|
1543
|
-
* Check if a tool is enabled (reads from config file)
|
|
1544
|
-
*/
|
|
1545
|
-
export function isToolEnabled(tool: string): boolean {
|
|
1546
|
-
try {
|
|
1547
|
-
return isToolEnabledFromConfig(configBaseDir, tool);
|
|
1548
|
-
} catch {
|
|
1549
|
-
// Fallback to in-memory check
|
|
1550
|
-
return !disabledTools.has(tool);
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
/**
|
|
1555
|
-
* Get full status of all CLI tools including enabled state
|
|
1556
|
-
*/
|
|
1557
|
-
export async function getCliToolsFullStatus(): Promise<Record<string, {
|
|
1558
|
-
available: boolean;
|
|
1559
|
-
enabled: boolean;
|
|
1560
|
-
path: string | null;
|
|
1561
|
-
packageName: string;
|
|
1562
|
-
}>> {
|
|
1563
|
-
const tools = Object.keys(CLI_TOOL_PACKAGES);
|
|
1564
|
-
const results: Record<string, {
|
|
1565
|
-
available: boolean;
|
|
1566
|
-
enabled: boolean;
|
|
1567
|
-
path: string | null;
|
|
1568
|
-
packageName: string;
|
|
1569
|
-
}> = {};
|
|
1570
|
-
|
|
1571
|
-
await Promise.all(tools.map(async (tool) => {
|
|
1572
|
-
const availability = await checkToolAvailability(tool);
|
|
1573
|
-
results[tool] = {
|
|
1574
|
-
available: availability.available,
|
|
1575
|
-
enabled: isToolEnabled(tool),
|
|
1576
|
-
path: availability.path,
|
|
1577
|
-
packageName: CLI_TOOL_PACKAGES[tool]
|
|
1578
|
-
};
|
|
1579
|
-
}));
|
|
1580
|
-
|
|
1581
|
-
return results;
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
/**
|
|
1586
|
-
* Build continuation prompt with previous conversation context (legacy)
|
|
1587
|
-
*/
|
|
1588
|
-
function buildContinuationPrompt(previous: ExecutionRecord, additionalPrompt?: string): string {
|
|
1589
|
-
const parts: string[] = [];
|
|
1590
|
-
|
|
1591
|
-
// Add previous conversation context
|
|
1592
|
-
parts.push('=== PREVIOUS CONVERSATION ===');
|
|
1593
|
-
parts.push('');
|
|
1594
|
-
parts.push('USER PROMPT:');
|
|
1595
|
-
parts.push(previous.prompt);
|
|
1596
|
-
parts.push('');
|
|
1597
|
-
parts.push('ASSISTANT RESPONSE:');
|
|
1598
|
-
parts.push(previous.output.stdout || '[No output recorded]');
|
|
1599
|
-
parts.push('');
|
|
1600
|
-
parts.push('=== CONTINUATION ===');
|
|
1601
|
-
parts.push('');
|
|
1602
|
-
|
|
1603
|
-
if (additionalPrompt) {
|
|
1604
|
-
parts.push(additionalPrompt);
|
|
1605
|
-
} else {
|
|
1606
|
-
parts.push('Continue from where we left off. What should we do next?');
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
return parts.join('\n');
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
/**
|
|
1613
|
-
* Get previous execution for resume
|
|
1614
|
-
* @param baseDir - Working directory
|
|
1615
|
-
* @param tool - Tool to filter by
|
|
1616
|
-
* @param resume - true for last, or execution ID string
|
|
1617
|
-
*/
|
|
1618
|
-
function getPreviousExecution(baseDir: string, tool: string, resume: boolean | string): ExecutionRecord | null {
|
|
1619
|
-
if (typeof resume === 'string') {
|
|
1620
|
-
// Resume specific execution by ID
|
|
1621
|
-
return getExecutionDetail(baseDir, resume);
|
|
1622
|
-
} else if (resume === true) {
|
|
1623
|
-
// Resume last execution for this tool
|
|
1624
|
-
const history = getExecutionHistory(baseDir, { limit: 1, tool });
|
|
1625
|
-
if (history.executions.length === 0) {
|
|
1626
|
-
return null;
|
|
1627
|
-
}
|
|
1628
|
-
return getExecutionDetail(baseDir, history.executions[0].id);
|
|
1629
|
-
}
|
|
1630
|
-
return null;
|
|
1631
|
-
}
|
|
1632
|
-
|
|
1633
|
-
/**
|
|
1634
|
-
* Latest execution + native session history functions are re-exported from state.
|
|
1635
|
-
*/
|
|
1636
|
-
export {
|
|
1637
|
-
getEnrichedConversation,
|
|
1638
|
-
getFormattedNativeConversation,
|
|
1639
|
-
getHistoryWithNativeInfo,
|
|
1640
|
-
getLatestExecution,
|
|
1641
|
-
getNativeConversationPairs,
|
|
1642
|
-
getNativeSessionContent
|
|
1643
|
-
} from './cli-executor-state.js';
|
|
1644
|
-
|
|
1645
|
-
// Export types
|
|
1646
|
-
export type { ExecutionCategory, ConversationRecord, ConversationTurn, ExecutionRecord } from './cli-executor-state.js';
|
|
1647
|
-
export type { PromptFormat, ConcatOptions } from './cli-prompt-builder.js';
|
|
1648
|
-
|
|
1649
|
-
// Export utility functions and tool definition for backward compatibility
|
|
1650
|
-
export { executeCliTool, checkToolAvailability, clearToolCache };
|
|
1651
|
-
|
|
1652
|
-
// Export env file utilities for testing
|
|
1653
|
-
export { parseEnvFile, loadEnvFile };
|
|
1654
|
-
|
|
1655
|
-
// Export prompt concatenation utilities
|
|
1656
|
-
export { PromptConcatenator, createPromptConcatenator, buildPrompt, buildMultiTurnPrompt } from './cli-prompt-builder.js';
|
|
1657
|
-
|
|
1658
|
-
// Note: Async storage functions (getExecutionHistoryAsync, deleteExecutionAsync,
|
|
1659
|
-
// batchDeleteExecutionsAsync) are exported at declaration site - SQLite storage only
|
|
1660
|
-
|
|
1661
|
-
// Export tool definition (for legacy imports) - This allows direct calls to execute with onOutput
|
|
1662
|
-
export const cliExecutorTool = {
|
|
1663
|
-
schema,
|
|
1664
|
-
execute: executeCliTool // Use executeCliTool directly which supports onOutput callback
|
|
1665
|
-
};
|