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,3615 +0,0 @@
|
|
|
1
|
-
// CLI Manager View
|
|
2
|
-
// Main view combining CLI status and CCW installations panels (two-column layout)
|
|
3
|
-
|
|
4
|
-
// ========== CLI Manager State ==========
|
|
5
|
-
var currentCliExecution = null;
|
|
6
|
-
var cliExecutionOutput = '';
|
|
7
|
-
var ccwInstallations = [];
|
|
8
|
-
var ccwEndpointTools = [];
|
|
9
|
-
var cliWrapperEndpoints = []; // CLI封装 endpoints from /api/cli/settings
|
|
10
|
-
var cliToolConfig = null; // Store loaded CLI config
|
|
11
|
-
var predefinedModels = {}; // Store predefined models per tool
|
|
12
|
-
|
|
13
|
-
// ========== Cache Key Mapping ==========
|
|
14
|
-
// 缓存键映射(旧键名 -> 新键名)
|
|
15
|
-
var CLI_CACHE_KEY_MAP = {
|
|
16
|
-
toolConfig: 'cli-config',
|
|
17
|
-
toolStatus: 'cli-status',
|
|
18
|
-
installations: 'cli-installations',
|
|
19
|
-
endpointTools: 'cli-endpoint-tools',
|
|
20
|
-
litellmEndpoints: 'cli-litellm-endpoints',
|
|
21
|
-
customEndpoints: 'cli-custom-endpoints',
|
|
22
|
-
wrapperEndpoints: 'cli-wrapper-endpoints'
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// ========== CLI Cache Bridge ==========
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 获取 CLI 缓存数据
|
|
29
|
-
* @param {string} key - 缓存键
|
|
30
|
-
* @returns {*} 缓存的数据或 null
|
|
31
|
-
*/
|
|
32
|
-
function getCliCachedData(key) {
|
|
33
|
-
if (!window.cacheManager) return null;
|
|
34
|
-
var newKey = CLI_CACHE_KEY_MAP[key] || key;
|
|
35
|
-
return window.cacheManager.get(newKey);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 设置 CLI 缓存数据
|
|
40
|
-
* @param {string} key - 缓存键
|
|
41
|
-
* @param {*} data - 要缓存的数据
|
|
42
|
-
* @param {number} ttl - 缓存 TTL(毫秒),默认 5 分钟
|
|
43
|
-
*/
|
|
44
|
-
function setCliCacheData(key, data, ttl) {
|
|
45
|
-
if (!window.cacheManager) return;
|
|
46
|
-
ttl = ttl || 300000;
|
|
47
|
-
var newKey = CLI_CACHE_KEY_MAP[key] || key;
|
|
48
|
-
window.cacheManager.set(newKey, data, ttl);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 注册 CLI 相关数据源到预加载服务
|
|
53
|
-
* 仅在数据源尚未注册时添加
|
|
54
|
-
*/
|
|
55
|
-
function registerCliDataSources() {
|
|
56
|
-
if (!window.preloadService) return;
|
|
57
|
-
|
|
58
|
-
var sources = [
|
|
59
|
-
{ key: 'cli-installations', url: '/api/ccw/installations', priority: false, ttl: 300000 },
|
|
60
|
-
{ key: 'cli-endpoint-tools', url: '/api/ccw/tools', priority: false, ttl: 300000 },
|
|
61
|
-
{ key: 'cli-litellm-endpoints', url: '/api/litellm-api/config', priority: false, ttl: 300000 },
|
|
62
|
-
{ key: 'cli-custom-endpoints', url: '/api/cli/endpoints', priority: false, ttl: 300000 },
|
|
63
|
-
{ key: 'cli-wrapper-endpoints', url: '/api/cli/settings', priority: false, ttl: 300000 }
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
sources.forEach(function(src) {
|
|
67
|
-
if (!window.preloadService.sources.has(src.key)) {
|
|
68
|
-
window.preloadService.register(src.key,
|
|
69
|
-
function() { return fetch(src.url).then(function(r) { return r.ok ? r.json() : Promise.reject(r); }); },
|
|
70
|
-
{ isHighPriority: src.priority, ttl: src.ttl }
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// ========== CSRF Token Management ==========
|
|
77
|
-
var csrfToken = null; // Store CSRF token for state-changing requests
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Fetch wrapper that handles CSRF token management
|
|
81
|
-
* Captures new token from response and includes token in requests
|
|
82
|
-
*/
|
|
83
|
-
async function csrfFetch(url, options) {
|
|
84
|
-
options = options || {};
|
|
85
|
-
options.headers = options.headers || {};
|
|
86
|
-
|
|
87
|
-
// Add CSRF token header for state-changing methods
|
|
88
|
-
var method = (options.method || 'GET').toUpperCase();
|
|
89
|
-
|
|
90
|
-
// Auto-initialize CSRF token for state-changing requests
|
|
91
|
-
if (['POST', 'PUT', 'PATCH', 'DELETE'].indexOf(method) !== -1) {
|
|
92
|
-
await initCsrfToken();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (['POST', 'PUT', 'PATCH', 'DELETE'].indexOf(method) !== -1 && csrfToken) {
|
|
96
|
-
options.headers['X-CSRF-Token'] = csrfToken;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var response = await fetch(url, options);
|
|
100
|
-
|
|
101
|
-
// Capture new CSRF token from response
|
|
102
|
-
var newToken = response.headers.get('X-CSRF-Token');
|
|
103
|
-
if (newToken) {
|
|
104
|
-
csrfToken = newToken;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return response;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Initialize CSRF token by fetching from server
|
|
112
|
-
* Should be called before any state-changing requests
|
|
113
|
-
*/
|
|
114
|
-
async function initCsrfToken() {
|
|
115
|
-
if (csrfToken) return; // Already initialized
|
|
116
|
-
|
|
117
|
-
try {
|
|
118
|
-
var response = await fetch('/api/csrf-token');
|
|
119
|
-
if (response.ok) {
|
|
120
|
-
var data = await response.json();
|
|
121
|
-
csrfToken = data.csrfToken || response.headers.get('X-CSRF-Token');
|
|
122
|
-
}
|
|
123
|
-
} catch (err) {
|
|
124
|
-
console.warn('[CLI Manager] Failed to fetch CSRF token:', err);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// ========== Active Execution Sync ==========
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Sync active CLI executions from server
|
|
132
|
-
* Called when view is opened to restore running execution state
|
|
133
|
-
* Note: Renamed from syncActiveExecutions to avoid conflict with cli-stream-viewer.js
|
|
134
|
-
*/
|
|
135
|
-
async function syncActiveExecutionsForManager() {
|
|
136
|
-
try {
|
|
137
|
-
var response = await fetch('/api/cli/active');
|
|
138
|
-
if (!response.ok) return;
|
|
139
|
-
|
|
140
|
-
var data = await response.json();
|
|
141
|
-
if (!data.executions || data.executions.length === 0) return;
|
|
142
|
-
|
|
143
|
-
// Restore the first active execution
|
|
144
|
-
var active = data.executions[0];
|
|
145
|
-
|
|
146
|
-
// Restore execution state
|
|
147
|
-
currentCliExecution = {
|
|
148
|
-
executionId: active.id,
|
|
149
|
-
tool: active.tool,
|
|
150
|
-
mode: active.mode,
|
|
151
|
-
startTime: active.startTime
|
|
152
|
-
};
|
|
153
|
-
cliExecutionOutput = active.output || '';
|
|
154
|
-
|
|
155
|
-
// Update UI if output panel exists
|
|
156
|
-
var outputPanel = document.getElementById('cli-output-panel');
|
|
157
|
-
var outputContent = document.getElementById('cli-output-content');
|
|
158
|
-
|
|
159
|
-
if (outputPanel && outputContent) {
|
|
160
|
-
outputPanel.style.display = 'block';
|
|
161
|
-
outputContent.textContent = cliExecutionOutput;
|
|
162
|
-
outputContent.scrollTop = outputContent.scrollHeight;
|
|
163
|
-
|
|
164
|
-
// Update status indicator
|
|
165
|
-
var statusIndicator = outputPanel.querySelector('.cli-status-indicator');
|
|
166
|
-
if (statusIndicator) {
|
|
167
|
-
statusIndicator.className = 'cli-status-indicator running';
|
|
168
|
-
statusIndicator.textContent = t('cli.running') || 'Running...';
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
console.log('[CLI Manager] Restored active execution:', active.id);
|
|
173
|
-
} catch (err) {
|
|
174
|
-
console.warn('[CLI Manager] Failed to sync active executions:', err);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// ========== Navigation Helpers ==========
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Navigate to CodexLens Manager page
|
|
182
|
-
*/
|
|
183
|
-
function navigateToCodexLensManager() {
|
|
184
|
-
var navItem = document.querySelector('.nav-item[data-view="codexlens-manager"]');
|
|
185
|
-
if (navItem) {
|
|
186
|
-
navItem.click();
|
|
187
|
-
} else {
|
|
188
|
-
// Fallback: try to render directly
|
|
189
|
-
if (typeof renderCodexLensManager === 'function') {
|
|
190
|
-
currentView = 'codexlens-manager';
|
|
191
|
-
renderCodexLensManager();
|
|
192
|
-
} else {
|
|
193
|
-
showRefreshToast(t('common.error') + ': CodexLens Manager not available', 'error');
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// ========== CCW Installations ==========
|
|
199
|
-
async function loadCcwInstallations() {
|
|
200
|
-
try {
|
|
201
|
-
var response = await fetch('/api/ccw/installations');
|
|
202
|
-
if (!response.ok) throw new Error('Failed to load CCW installations');
|
|
203
|
-
var data = await response.json();
|
|
204
|
-
ccwInstallations = data.installations || [];
|
|
205
|
-
return ccwInstallations;
|
|
206
|
-
} catch (err) {
|
|
207
|
-
console.error('Failed to load CCW installations:', err);
|
|
208
|
-
ccwInstallations = [];
|
|
209
|
-
return [];
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// ========== CCW Endpoint Tools ==========
|
|
214
|
-
async function loadCcwEndpointTools() {
|
|
215
|
-
try {
|
|
216
|
-
var response = await fetch('/api/ccw/tools');
|
|
217
|
-
if (!response.ok) throw new Error('Failed to load CCW endpoint tools');
|
|
218
|
-
var data = await response.json();
|
|
219
|
-
ccwEndpointTools = data.tools || [];
|
|
220
|
-
return ccwEndpointTools;
|
|
221
|
-
} catch (err) {
|
|
222
|
-
console.error('Failed to load CCW endpoint tools:', err);
|
|
223
|
-
ccwEndpointTools = [];
|
|
224
|
-
return [];
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// ========== LiteLLM API Endpoints ==========
|
|
229
|
-
var litellmApiEndpoints = [];
|
|
230
|
-
var cliCustomEndpoints = [];
|
|
231
|
-
|
|
232
|
-
async function loadLitellmApiEndpoints() {
|
|
233
|
-
try {
|
|
234
|
-
var response = await fetch('/api/litellm-api/config');
|
|
235
|
-
if (!response.ok) throw new Error('Failed to load LiteLLM endpoints');
|
|
236
|
-
var data = await response.json();
|
|
237
|
-
litellmApiEndpoints = data.endpoints || [];
|
|
238
|
-
window.litellmApiConfig = data;
|
|
239
|
-
return litellmApiEndpoints;
|
|
240
|
-
} catch (err) {
|
|
241
|
-
console.error('Failed to load LiteLLM endpoints:', err);
|
|
242
|
-
litellmApiEndpoints = [];
|
|
243
|
-
return [];
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
async function loadCliCustomEndpoints() {
|
|
248
|
-
try {
|
|
249
|
-
var response = await fetch('/api/cli/endpoints');
|
|
250
|
-
if (!response.ok) throw new Error('Failed to load CLI custom endpoints');
|
|
251
|
-
var data = await response.json();
|
|
252
|
-
cliCustomEndpoints = data.endpoints || [];
|
|
253
|
-
return cliCustomEndpoints;
|
|
254
|
-
} catch (err) {
|
|
255
|
-
console.error('Failed to load CLI custom endpoints:', err);
|
|
256
|
-
cliCustomEndpoints = [];
|
|
257
|
-
return [];
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// ========== CLI Wrapper Endpoints (CLI封装) ==========
|
|
262
|
-
async function loadCliWrapperEndpoints() {
|
|
263
|
-
try {
|
|
264
|
-
var response = await fetch('/api/cli/settings');
|
|
265
|
-
if (!response.ok) throw new Error('Failed to load CLI wrapper endpoints');
|
|
266
|
-
var data = await response.json();
|
|
267
|
-
cliWrapperEndpoints = data.endpoints || [];
|
|
268
|
-
return cliWrapperEndpoints;
|
|
269
|
-
} catch (err) {
|
|
270
|
-
console.error('Failed to load CLI wrapper endpoints:', err);
|
|
271
|
-
cliWrapperEndpoints = [];
|
|
272
|
-
return [];
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
async function toggleCliWrapperEnabled(endpointId, enabled) {
|
|
277
|
-
try {
|
|
278
|
-
await initCsrfToken();
|
|
279
|
-
var response = await csrfFetch('/api/cli/settings/' + endpointId, {
|
|
280
|
-
method: 'PUT',
|
|
281
|
-
headers: { 'Content-Type': 'application/json' },
|
|
282
|
-
body: JSON.stringify({ enabled: enabled })
|
|
283
|
-
});
|
|
284
|
-
if (!response.ok) throw new Error('Failed to update CLI wrapper endpoint');
|
|
285
|
-
var data = await response.json();
|
|
286
|
-
if (data.success) {
|
|
287
|
-
// Update local state
|
|
288
|
-
var idx = cliWrapperEndpoints.findIndex(function(e) { return e.id === endpointId; });
|
|
289
|
-
if (idx >= 0) {
|
|
290
|
-
cliWrapperEndpoints[idx].enabled = enabled;
|
|
291
|
-
}
|
|
292
|
-
showRefreshToast((enabled ? t('cli.enabled') || 'Enabled' : t('cli.disabled') || 'Disabled') + ': ' + endpointId, 'success');
|
|
293
|
-
}
|
|
294
|
-
return data;
|
|
295
|
-
} catch (err) {
|
|
296
|
-
showRefreshToast((t('cli.updateFailed') || 'Failed to update') + ': ' + err.message, 'error');
|
|
297
|
-
throw err;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
async function toggleEndpointEnabled(endpointId, enabled) {
|
|
302
|
-
try {
|
|
303
|
-
await initCsrfToken();
|
|
304
|
-
var response = await csrfFetch('/api/cli/endpoints/' + endpointId, {
|
|
305
|
-
method: 'PUT',
|
|
306
|
-
headers: { 'Content-Type': 'application/json' },
|
|
307
|
-
body: JSON.stringify({ enabled: enabled })
|
|
308
|
-
});
|
|
309
|
-
if (!response.ok) throw new Error('Failed to update endpoint');
|
|
310
|
-
var data = await response.json();
|
|
311
|
-
if (data.success) {
|
|
312
|
-
// Update local state
|
|
313
|
-
var idx = cliCustomEndpoints.findIndex(function(e) { return e.id === endpointId; });
|
|
314
|
-
if (idx >= 0) {
|
|
315
|
-
cliCustomEndpoints[idx].enabled = enabled;
|
|
316
|
-
}
|
|
317
|
-
showRefreshToast((enabled ? 'Enabled' : 'Disabled') + ' endpoint: ' + endpointId, 'success');
|
|
318
|
-
}
|
|
319
|
-
return data;
|
|
320
|
-
} catch (err) {
|
|
321
|
-
showRefreshToast('Failed to update endpoint: ' + err.message, 'error');
|
|
322
|
-
throw err;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
async function syncEndpointToCliTools(endpoint) {
|
|
327
|
-
try {
|
|
328
|
-
await initCsrfToken();
|
|
329
|
-
var response = await csrfFetch('/api/cli/endpoints', {
|
|
330
|
-
method: 'POST',
|
|
331
|
-
headers: { 'Content-Type': 'application/json' },
|
|
332
|
-
body: JSON.stringify({
|
|
333
|
-
id: endpoint.id,
|
|
334
|
-
name: endpoint.name,
|
|
335
|
-
enabled: true
|
|
336
|
-
})
|
|
337
|
-
});
|
|
338
|
-
if (!response.ok) throw new Error('Failed to sync endpoint');
|
|
339
|
-
var data = await response.json();
|
|
340
|
-
if (data.success) {
|
|
341
|
-
cliCustomEndpoints = data.endpoints;
|
|
342
|
-
showRefreshToast('Endpoint synced to CLI tools: ' + endpoint.id, 'success');
|
|
343
|
-
renderToolsSection();
|
|
344
|
-
}
|
|
345
|
-
return data;
|
|
346
|
-
} catch (err) {
|
|
347
|
-
showRefreshToast('Failed to sync endpoint: ' + err.message, 'error');
|
|
348
|
-
throw err;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
window.toggleEndpointEnabled = toggleEndpointEnabled;
|
|
353
|
-
window.syncEndpointToCliTools = syncEndpointToCliTools;
|
|
354
|
-
|
|
355
|
-
// ========== CLI Tool Configuration ==========
|
|
356
|
-
async function loadCliToolConfig() {
|
|
357
|
-
// 尝试从缓存获取
|
|
358
|
-
var cached = getCliCachedData('toolConfig');
|
|
359
|
-
if (cached) {
|
|
360
|
-
cliToolConfig = cached.config || null;
|
|
361
|
-
predefinedModels = cached.predefinedModels || {};
|
|
362
|
-
return cached;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
try {
|
|
366
|
-
var response = await fetch('/api/cli/config');
|
|
367
|
-
if (!response.ok) throw new Error('Failed to load CLI config');
|
|
368
|
-
var data = await response.json();
|
|
369
|
-
cliToolConfig = data.config || null;
|
|
370
|
-
predefinedModels = data.predefinedModels || {};
|
|
371
|
-
|
|
372
|
-
// 缓存结果
|
|
373
|
-
setCliCacheData('toolConfig', data);
|
|
374
|
-
return data;
|
|
375
|
-
} catch (err) {
|
|
376
|
-
console.error('Failed to load CLI config:', err);
|
|
377
|
-
cliToolConfig = null;
|
|
378
|
-
predefinedModels = {};
|
|
379
|
-
return null;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
async function updateCliToolConfig(tool, updates) {
|
|
384
|
-
try {
|
|
385
|
-
// Ensure CSRF token is initialized before making state-changing request
|
|
386
|
-
await initCsrfToken();
|
|
387
|
-
|
|
388
|
-
var response = await csrfFetch('/api/cli/config/' + tool, {
|
|
389
|
-
method: 'PUT',
|
|
390
|
-
headers: { 'Content-Type': 'application/json' },
|
|
391
|
-
body: JSON.stringify(updates)
|
|
392
|
-
});
|
|
393
|
-
var data = await response.json();
|
|
394
|
-
if (!response.ok) {
|
|
395
|
-
throw new Error(data.error || 'Failed to update CLI config');
|
|
396
|
-
}
|
|
397
|
-
if (data.success && cliToolConfig && cliToolConfig.tools) {
|
|
398
|
-
cliToolConfig.tools[tool] = data.config;
|
|
399
|
-
// Invalidate cache to ensure fresh data on page refresh
|
|
400
|
-
if (window.cacheManager) {
|
|
401
|
-
window.cacheManager.invalidate('cli-config');
|
|
402
|
-
window.cacheManager.invalidate('cli-tools-config');
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return data;
|
|
406
|
-
} catch (err) {
|
|
407
|
-
console.error('Failed to update CLI config:', err);
|
|
408
|
-
throw err;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
// ========== Tool Configuration Modal ==========
|
|
413
|
-
async function showToolConfigModal(toolName) {
|
|
414
|
-
// Load config if not already loaded
|
|
415
|
-
if (!cliToolConfig) {
|
|
416
|
-
await loadCliToolConfig();
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
var toolConfig = cliToolConfig && cliToolConfig.tools ? cliToolConfig.tools[toolName] : null;
|
|
420
|
-
var models = predefinedModels[toolName] || [];
|
|
421
|
-
var status = cliToolStatus[toolName] || {};
|
|
422
|
-
|
|
423
|
-
if (!toolConfig) {
|
|
424
|
-
toolConfig = { enabled: true, primaryModel: '', secondaryModel: '' };
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
var content = buildToolConfigModalContent(toolName, toolConfig, models, status);
|
|
428
|
-
showModal('Configure ' + toolName.charAt(0).toUpperCase() + toolName.slice(1), content, { size: 'md' });
|
|
429
|
-
|
|
430
|
-
// Initialize event handlers after modal is shown
|
|
431
|
-
setTimeout(function() {
|
|
432
|
-
initToolConfigModalEvents(toolName, toolConfig, models);
|
|
433
|
-
}, 100);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
function buildToolConfigModalContent(tool, config, models, status) {
|
|
437
|
-
var isAvailable = status.available;
|
|
438
|
-
var isEnabled = config.enabled;
|
|
439
|
-
|
|
440
|
-
// Check if model is custom (not in predefined list or empty)
|
|
441
|
-
var isPrimaryCustom = !config.primaryModel || models.indexOf(config.primaryModel) === -1;
|
|
442
|
-
var isSecondaryCustom = !config.secondaryModel || models.indexOf(config.secondaryModel) === -1;
|
|
443
|
-
|
|
444
|
-
var modelsOptionsHtml = function(selected, isCustom) {
|
|
445
|
-
var html = '';
|
|
446
|
-
for (var i = 0; i < models.length; i++) {
|
|
447
|
-
var m = models[i];
|
|
448
|
-
html += '<option value="' + escapeHtml(m) + '"' + (m === selected && !isCustom ? ' selected' : '') + '>' + escapeHtml(m) + '</option>';
|
|
449
|
-
}
|
|
450
|
-
html += '<option value="__custom__"' + (isCustom ? ' selected' : '') + '>Custom...</option>';
|
|
451
|
-
return html;
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
return '<div class="tool-config-modal">' +
|
|
455
|
-
// Status Section
|
|
456
|
-
'<div class="tool-config-section">' +
|
|
457
|
-
'<h4>Status</h4>' +
|
|
458
|
-
'<div class="tool-config-badges">' +
|
|
459
|
-
'<span class="badge ' + (isAvailable ? 'badge-success' : 'badge-muted') + '">' +
|
|
460
|
-
'<i data-lucide="' + (isAvailable ? 'check-circle' : 'circle-dashed') + '" class="w-3 h-3"></i> ' +
|
|
461
|
-
(isAvailable ? 'Installed' : 'Not Installed') +
|
|
462
|
-
'</span>' +
|
|
463
|
-
'<span class="badge ' + (isEnabled ? 'badge-primary' : 'badge-muted') + '">' +
|
|
464
|
-
'<i data-lucide="' + (isEnabled ? 'toggle-right' : 'toggle-left') + '" class="w-3 h-3"></i> ' +
|
|
465
|
-
(isEnabled ? 'Enabled' : 'Disabled') +
|
|
466
|
-
'</span>' +
|
|
467
|
-
'</div>' +
|
|
468
|
-
'</div>' +
|
|
469
|
-
|
|
470
|
-
// Actions Section
|
|
471
|
-
'<div class="tool-config-section">' +
|
|
472
|
-
'<h4>Actions</h4>' +
|
|
473
|
-
'<div class="tool-config-actions">' +
|
|
474
|
-
'<button class="btn-sm ' + (isEnabled ? 'btn-outline' : 'btn-primary') + '" id="toggleEnableBtn" ' + (!isAvailable ? 'disabled' : '') + '>' +
|
|
475
|
-
'<i data-lucide="' + (isEnabled ? 'toggle-left' : 'toggle-right') + '" class="w-3 h-3"></i> ' +
|
|
476
|
-
(isEnabled ? 'Disable' : 'Enable') +
|
|
477
|
-
'</button>' +
|
|
478
|
-
'<button class="btn-sm ' + (isAvailable ? 'btn-outline btn-danger-outline' : 'btn-primary') + '" id="installBtn">' +
|
|
479
|
-
'<i data-lucide="' + (isAvailable ? 'trash-2' : 'download') + '" class="w-3 h-3"></i> ' +
|
|
480
|
-
(isAvailable ? 'Uninstall' : 'Install') +
|
|
481
|
-
'</button>' +
|
|
482
|
-
'</div>' +
|
|
483
|
-
'</div>' +
|
|
484
|
-
|
|
485
|
-
// Available Models Section - Unified input with inline models
|
|
486
|
-
'<div class="tool-config-section">' +
|
|
487
|
-
'<h4>Available Models <span class="text-muted">(shown in dropdowns below)</span></h4>' +
|
|
488
|
-
'<div class="tags-unified-input" id="modelsUnifiedInput">' +
|
|
489
|
-
(config.availableModels || models).map(function(model) {
|
|
490
|
-
return '<span class="tag-item tag-model">' + escapeHtml(model) + '<button type="button" class="tag-remove" data-model="' + escapeHtml(model) + '">×</button></span>';
|
|
491
|
-
}).join('') +
|
|
492
|
-
'<input type="text" id="modelInput" class="tag-inline-input" placeholder="Enter model name and press Enter" />' +
|
|
493
|
-
'</div>' +
|
|
494
|
-
'<p class="text-muted text-xs mt-1"><i data-lucide="info" class="w-3 h-3"></i> Click × to remove, type to add new models</p>' +
|
|
495
|
-
'</div>' +
|
|
496
|
-
|
|
497
|
-
// Primary Model Section
|
|
498
|
-
'<div class="tool-config-section">' +
|
|
499
|
-
'<h4>Primary Model <span class="text-muted">(CLI endpoint calls)</span></h4>' +
|
|
500
|
-
'<div class="model-select-group">' +
|
|
501
|
-
'<select id="primaryModelSelect" class="tool-config-select">' +
|
|
502
|
-
modelsOptionsHtml(config.primaryModel, isPrimaryCustom) +
|
|
503
|
-
'</select>' +
|
|
504
|
-
'<input type="text" id="primaryModelCustom" class="tool-config-input" ' +
|
|
505
|
-
'style="display: ' + (isPrimaryCustom ? 'block' : 'none') + ';" ' +
|
|
506
|
-
'placeholder="Enter model name (e.g., gemini-2.5-pro)" ' +
|
|
507
|
-
'value="' + (isPrimaryCustom && config.primaryModel ? escapeHtml(config.primaryModel) : '') + '" />' +
|
|
508
|
-
'</div>' +
|
|
509
|
-
'</div>' +
|
|
510
|
-
|
|
511
|
-
// Secondary Model Section
|
|
512
|
-
'<div class="tool-config-section">' +
|
|
513
|
-
'<h4>Secondary Model <span class="text-muted">(internal tools)</span></h4>' +
|
|
514
|
-
'<div class="model-select-group">' +
|
|
515
|
-
'<select id="secondaryModelSelect" class="tool-config-select">' +
|
|
516
|
-
modelsOptionsHtml(config.secondaryModel, isSecondaryCustom) +
|
|
517
|
-
'</select>' +
|
|
518
|
-
'<input type="text" id="secondaryModelCustom" class="tool-config-input" ' +
|
|
519
|
-
'style="display: ' + (isSecondaryCustom ? 'block' : 'none') + ';" ' +
|
|
520
|
-
'placeholder="Enter model name (e.g., gemini-2.5-flash)" ' +
|
|
521
|
-
'value="' + (isSecondaryCustom && config.secondaryModel ? escapeHtml(config.secondaryModel) : '') + '" />' +
|
|
522
|
-
'</div>' +
|
|
523
|
-
'</div>' +
|
|
524
|
-
|
|
525
|
-
// Tags Section - Unified input with inline tags
|
|
526
|
-
'<div class="tool-config-section">' +
|
|
527
|
-
'<h4>Tags <span class="text-muted">(optional labels)</span></h4>' +
|
|
528
|
-
'<div class="tags-unified-input" id="tagsUnifiedInput">' +
|
|
529
|
-
(config.tags || []).map(function(tag) {
|
|
530
|
-
return '<span class="tag-item tag-' + escapeHtml(tag) + '">' + escapeHtml(tag) + '<button type="button" class="tag-remove" data-tag="' + escapeHtml(tag) + '">×</button></span>';
|
|
531
|
-
}).join('') +
|
|
532
|
-
'<input type="text" id="tagInput" class="tag-inline-input" placeholder="输入标签按 Enter 添加" />' +
|
|
533
|
-
'</div>' +
|
|
534
|
-
'<div class="predefined-tags-row">' +
|
|
535
|
-
'<button type="button" class="predefined-tag-btn" data-tag="分析"><i data-lucide="search" class="w-3 h-3"></i> 分析</button>' +
|
|
536
|
-
'<button type="button" class="predefined-tag-btn" data-tag="编码"><i data-lucide="code" class="w-3 h-3"></i> 编码</button>' +
|
|
537
|
-
'<button type="button" class="predefined-tag-btn" data-tag="Debug"><i data-lucide="bug" class="w-3 h-3"></i> Debug</button>' +
|
|
538
|
-
'<button type="button" class="predefined-tag-btn" data-tag="重构"><i data-lucide="refresh-cw" class="w-3 h-3"></i> 重构</button>' +
|
|
539
|
-
'<button type="button" class="predefined-tag-btn" data-tag="测试"><i data-lucide="check-square" class="w-3 h-3"></i> 测试</button>' +
|
|
540
|
-
'<button type="button" class="predefined-tag-btn" data-tag="文档"><i data-lucide="file-text" class="w-3 h-3"></i> 文档</button>' +
|
|
541
|
-
'</div>' +
|
|
542
|
-
'</div>' +
|
|
543
|
-
|
|
544
|
-
// Environment File Section (only for builtin tools: gemini, qwen)
|
|
545
|
-
(tool === 'gemini' || tool === 'qwen' ? (
|
|
546
|
-
'<div class="tool-config-section">' +
|
|
547
|
-
'<h4><i data-lucide="file-key" class="w-3.5 h-3.5"></i> ' + t('cli.envFile') + ' <span class="text-muted">' + t('cli.envFileOptional') + '</span></h4>' +
|
|
548
|
-
'<div class="env-file-input-group">' +
|
|
549
|
-
'<div class="env-file-input-row">' +
|
|
550
|
-
'<input type="text" id="envFileInput" class="tool-config-input" ' +
|
|
551
|
-
'placeholder="' + t('cli.envFilePlaceholder') + '" ' +
|
|
552
|
-
'value="' + (config.envFile ? escapeHtml(config.envFile) : '') + '" />' +
|
|
553
|
-
'<button type="button" class="btn-sm btn-outline" id="envFileBrowseBtn">' +
|
|
554
|
-
'<i data-lucide="folder-open" class="w-3.5 h-3.5"></i> ' + t('cli.envFileBrowse') +
|
|
555
|
-
'</button>' +
|
|
556
|
-
'</div>' +
|
|
557
|
-
'<p class="env-file-hint">' +
|
|
558
|
-
'<i data-lucide="info" class="w-3 h-3"></i> ' +
|
|
559
|
-
t('cli.envFileHint') +
|
|
560
|
-
'</p>' +
|
|
561
|
-
'</div>' +
|
|
562
|
-
'</div>'
|
|
563
|
-
) : '') +
|
|
564
|
-
|
|
565
|
-
// Claude Settings File Section (only for builtin claude type)
|
|
566
|
-
(tool === 'claude' && config.type === 'builtin' ? (
|
|
567
|
-
'<div class="tool-config-section">' +
|
|
568
|
-
'<h4><i data-lucide="file-key" class="w-3.5 h-3.5"></i> Settings File <span class="text-muted">(optional)</span></h4>' +
|
|
569
|
-
'<div class="env-file-input-group">' +
|
|
570
|
-
'<div class="env-file-input-row">' +
|
|
571
|
-
'<input type="text" id="claudeSettingsFileInput" class="tool-config-input" ' +
|
|
572
|
-
'placeholder="~/path/to/settings.json or D:\\path\\to\\settings.json" ' +
|
|
573
|
-
'value="' + (config.settingsFile ? escapeHtml(config.settingsFile) : '') + '" />' +
|
|
574
|
-
'<button type="button" class="btn-sm btn-outline" id="claudeSettingsFileBrowseBtn">' +
|
|
575
|
-
'<i data-lucide="folder-open" class="w-3.5 h-3.5"></i> Browse' +
|
|
576
|
-
'</button>' +
|
|
577
|
-
'</div>' +
|
|
578
|
-
'<p class="env-file-hint">' +
|
|
579
|
-
'<i data-lucide="info" class="w-3 h-3"></i> ' +
|
|
580
|
-
'Path to Claude CLI settings.json file (supports ~, absolute, and Windows paths)' +
|
|
581
|
-
'</p>' +
|
|
582
|
-
'</div>' +
|
|
583
|
-
'</div>'
|
|
584
|
-
) : '') +
|
|
585
|
-
|
|
586
|
-
// Footer
|
|
587
|
-
'<div class="tool-config-footer">' +
|
|
588
|
-
'<button class="btn btn-outline" onclick="closeModal()">' + t('common.cancel') + '</button>' +
|
|
589
|
-
'<button class="btn btn-primary" id="saveConfigBtn">' +
|
|
590
|
-
'<i data-lucide="save" class="w-3.5 h-3.5"></i> ' + t('common.save') +
|
|
591
|
-
'</button>' +
|
|
592
|
-
'</div>' +
|
|
593
|
-
'</div>';
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
// ========== File Browser Modal ==========
|
|
597
|
-
|
|
598
|
-
var fileBrowserState = {
|
|
599
|
-
currentPath: '',
|
|
600
|
-
showHidden: false,
|
|
601
|
-
onSelect: null
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
function showFileBrowserModal(onSelect) {
|
|
605
|
-
fileBrowserState.onSelect = onSelect;
|
|
606
|
-
fileBrowserState.showHidden = true;
|
|
607
|
-
|
|
608
|
-
// Create modal overlay
|
|
609
|
-
var overlay = document.createElement('div');
|
|
610
|
-
overlay.id = 'fileBrowserOverlay';
|
|
611
|
-
overlay.className = 'modal-overlay';
|
|
612
|
-
overlay.innerHTML = buildFileBrowserModalContent();
|
|
613
|
-
document.body.appendChild(overlay);
|
|
614
|
-
|
|
615
|
-
// Load initial directory (home)
|
|
616
|
-
loadFileBrowserDirectory('');
|
|
617
|
-
|
|
618
|
-
// Initialize events
|
|
619
|
-
initFileBrowserEvents();
|
|
620
|
-
|
|
621
|
-
// Initialize icons
|
|
622
|
-
if (window.lucide) lucide.createIcons();
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
function buildFileBrowserModalContent() {
|
|
626
|
-
// Detect if Windows
|
|
627
|
-
var isWindows = navigator.platform.indexOf('Win') > -1;
|
|
628
|
-
var driveButtons = '';
|
|
629
|
-
if (isWindows) {
|
|
630
|
-
driveButtons = '<div class="file-browser-drives">' +
|
|
631
|
-
'<button class="btn-xs btn-outline drive-btn" data-drive="C:/">C:</button>' +
|
|
632
|
-
'<button class="btn-xs btn-outline drive-btn" data-drive="D:/">D:</button>' +
|
|
633
|
-
'<button class="btn-xs btn-outline drive-btn" data-drive="E:/">E:</button>' +
|
|
634
|
-
'</div>';
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
return '<div class="modal-content file-browser-modal">' +
|
|
638
|
-
'<div class="modal-header">' +
|
|
639
|
-
'<h3><i data-lucide="folder-open" class="w-4 h-4"></i> ' + t('cli.fileBrowser') + '</h3>' +
|
|
640
|
-
'<button class="modal-close" id="fileBrowserCloseBtn">×</button>' +
|
|
641
|
-
'</div>' +
|
|
642
|
-
'<div class="modal-body">' +
|
|
643
|
-
'<div class="file-browser-toolbar">' +
|
|
644
|
-
'<button class="btn-sm btn-outline" id="fileBrowserUpBtn" title="' + t('cli.fileBrowserUp') + '">' +
|
|
645
|
-
'<i data-lucide="arrow-up" class="w-3.5 h-3.5"></i>' +
|
|
646
|
-
'</button>' +
|
|
647
|
-
'<button class="btn-sm btn-outline" id="fileBrowserHomeBtn" title="' + t('cli.fileBrowserHome') + '">' +
|
|
648
|
-
'<i data-lucide="home" class="w-3.5 h-3.5"></i>' +
|
|
649
|
-
'</button>' +
|
|
650
|
-
driveButtons +
|
|
651
|
-
'<input type="text" id="fileBrowserPathInput" class="file-browser-path" placeholder="Enter path and press Enter" />' +
|
|
652
|
-
'<label class="file-browser-hidden-toggle">' +
|
|
653
|
-
'<input type="checkbox" id="fileBrowserShowHidden" checked />' +
|
|
654
|
-
'<span>' + t('cli.fileBrowserShowHidden') + '</span>' +
|
|
655
|
-
'</label>' +
|
|
656
|
-
'</div>' +
|
|
657
|
-
'<div class="file-browser-list" id="fileBrowserList">' +
|
|
658
|
-
'<div class="file-browser-loading"><i data-lucide="loader-2" class="w-5 h-5 animate-spin"></i></div>' +
|
|
659
|
-
'</div>' +
|
|
660
|
-
'</div>' +
|
|
661
|
-
'<div class="modal-footer">' +
|
|
662
|
-
'<button class="btn btn-outline" id="fileBrowserCancelBtn">' + t('cli.fileBrowserCancel') + '</button>' +
|
|
663
|
-
'<button class="btn btn-primary" id="fileBrowserSelectBtn" disabled>' +
|
|
664
|
-
'<i data-lucide="check" class="w-3.5 h-3.5"></i> ' + t('cli.fileBrowserSelect') +
|
|
665
|
-
'</button>' +
|
|
666
|
-
'</div>' +
|
|
667
|
-
'</div>';
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
async function loadFileBrowserDirectory(path) {
|
|
671
|
-
var listContainer = document.getElementById('fileBrowserList');
|
|
672
|
-
var pathInput = document.getElementById('fileBrowserPathInput');
|
|
673
|
-
|
|
674
|
-
if (listContainer) {
|
|
675
|
-
listContainer.innerHTML = '<div class="file-browser-loading"><i data-lucide="loader-2" class="w-5 h-5 animate-spin"></i></div>';
|
|
676
|
-
if (window.lucide) lucide.createIcons();
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
try {
|
|
680
|
-
var response = await fetch('/api/dialog/browse', {
|
|
681
|
-
method: 'POST',
|
|
682
|
-
headers: { 'Content-Type': 'application/json' },
|
|
683
|
-
body: JSON.stringify({ path: path, showHidden: fileBrowserState.showHidden })
|
|
684
|
-
});
|
|
685
|
-
|
|
686
|
-
if (!response.ok) {
|
|
687
|
-
throw new Error('Failed to load directory');
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
var data = await response.json();
|
|
691
|
-
fileBrowserState.currentPath = data.currentPath;
|
|
692
|
-
|
|
693
|
-
if (pathInput) {
|
|
694
|
-
pathInput.value = data.currentPath;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
renderFileBrowserItems(data.items);
|
|
698
|
-
} catch (err) {
|
|
699
|
-
console.error('Failed to load directory:', err);
|
|
700
|
-
if (listContainer) {
|
|
701
|
-
listContainer.innerHTML = '<div class="file-browser-error">' +
|
|
702
|
-
'<p>' + t('cli.fileBrowserApiError') + '</p>' +
|
|
703
|
-
'<p class="file-browser-hint">' + t('cli.fileBrowserManualHint') + '</p>' +
|
|
704
|
-
'</div>';
|
|
705
|
-
}
|
|
706
|
-
// Enable manual path entry mode - enable select button when path is typed
|
|
707
|
-
var selectBtn = document.getElementById('fileBrowserSelectBtn');
|
|
708
|
-
var pathInput = document.getElementById('fileBrowserPathInput');
|
|
709
|
-
if (selectBtn && pathInput) {
|
|
710
|
-
selectBtn.disabled = false;
|
|
711
|
-
pathInput.focus();
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
function renderFileBrowserItems(items) {
|
|
717
|
-
var listContainer = document.getElementById('fileBrowserList');
|
|
718
|
-
if (!listContainer) return;
|
|
719
|
-
|
|
720
|
-
if (!items || items.length === 0) {
|
|
721
|
-
listContainer.innerHTML = '<div class="file-browser-empty">Empty directory</div>';
|
|
722
|
-
return;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
var html = items.map(function(item) {
|
|
726
|
-
var icon = item.isDirectory ? 'folder' : 'file';
|
|
727
|
-
var itemClass = 'file-browser-item' + (item.isDirectory ? ' is-directory' : ' is-file');
|
|
728
|
-
return '<div class="' + itemClass + '" data-path="' + escapeHtml(item.path) + '" data-is-dir="' + item.isDirectory + '">' +
|
|
729
|
-
'<i data-lucide="' + icon + '" class="w-4 h-4"></i>' +
|
|
730
|
-
'<span class="file-browser-item-name">' + escapeHtml(item.name) + '</span>' +
|
|
731
|
-
'</div>';
|
|
732
|
-
}).join('');
|
|
733
|
-
|
|
734
|
-
listContainer.innerHTML = html;
|
|
735
|
-
|
|
736
|
-
// Initialize icons
|
|
737
|
-
if (window.lucide) lucide.createIcons();
|
|
738
|
-
|
|
739
|
-
// Add click handlers
|
|
740
|
-
listContainer.querySelectorAll('.file-browser-item').forEach(function(el) {
|
|
741
|
-
el.onclick = function() {
|
|
742
|
-
var isDir = el.getAttribute('data-is-dir') === 'true';
|
|
743
|
-
var path = el.getAttribute('data-path');
|
|
744
|
-
|
|
745
|
-
if (isDir) {
|
|
746
|
-
// Navigate into directory
|
|
747
|
-
loadFileBrowserDirectory(path);
|
|
748
|
-
} else {
|
|
749
|
-
// Select file
|
|
750
|
-
listContainer.querySelectorAll('.file-browser-item').forEach(function(item) {
|
|
751
|
-
item.classList.remove('selected');
|
|
752
|
-
});
|
|
753
|
-
el.classList.add('selected');
|
|
754
|
-
|
|
755
|
-
// Enable select button
|
|
756
|
-
var selectBtn = document.getElementById('fileBrowserSelectBtn');
|
|
757
|
-
if (selectBtn) {
|
|
758
|
-
selectBtn.disabled = false;
|
|
759
|
-
selectBtn.setAttribute('data-selected-path', path);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
|
|
764
|
-
// Double-click to select file or enter directory
|
|
765
|
-
el.ondblclick = function() {
|
|
766
|
-
var isDir = el.getAttribute('data-is-dir') === 'true';
|
|
767
|
-
var path = el.getAttribute('data-path');
|
|
768
|
-
|
|
769
|
-
if (isDir) {
|
|
770
|
-
loadFileBrowserDirectory(path);
|
|
771
|
-
} else {
|
|
772
|
-
// Select and close
|
|
773
|
-
closeFileBrowserModal(path);
|
|
774
|
-
}
|
|
775
|
-
};
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
function initFileBrowserEvents() {
|
|
780
|
-
// Close button
|
|
781
|
-
var closeBtn = document.getElementById('fileBrowserCloseBtn');
|
|
782
|
-
if (closeBtn) {
|
|
783
|
-
closeBtn.onclick = function() { closeFileBrowserModal(null); };
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
// Cancel button
|
|
787
|
-
var cancelBtn = document.getElementById('fileBrowserCancelBtn');
|
|
788
|
-
if (cancelBtn) {
|
|
789
|
-
cancelBtn.onclick = function() { closeFileBrowserModal(null); };
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
// Select button
|
|
793
|
-
var selectBtn = document.getElementById('fileBrowserSelectBtn');
|
|
794
|
-
if (selectBtn) {
|
|
795
|
-
selectBtn.onclick = function() {
|
|
796
|
-
// First try selected path from list, then fall back to path input
|
|
797
|
-
var path = selectBtn.getAttribute('data-selected-path');
|
|
798
|
-
if (!path) {
|
|
799
|
-
var pathInput = document.getElementById('fileBrowserPathInput');
|
|
800
|
-
if (pathInput && pathInput.value.trim()) {
|
|
801
|
-
path = pathInput.value.trim();
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
if (path) {
|
|
805
|
-
closeFileBrowserModal(path);
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
// Up button
|
|
811
|
-
var upBtn = document.getElementById('fileBrowserUpBtn');
|
|
812
|
-
if (upBtn) {
|
|
813
|
-
upBtn.onclick = function() {
|
|
814
|
-
// Get parent path
|
|
815
|
-
var currentPath = fileBrowserState.currentPath;
|
|
816
|
-
var parentPath = currentPath.replace(/[/\\][^/\\]+$/, '') || '/';
|
|
817
|
-
loadFileBrowserDirectory(parentPath);
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
// Home button
|
|
822
|
-
var homeBtn = document.getElementById('fileBrowserHomeBtn');
|
|
823
|
-
if (homeBtn) {
|
|
824
|
-
homeBtn.onclick = function() {
|
|
825
|
-
loadFileBrowserDirectory('');
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
// Drive buttons (Windows)
|
|
830
|
-
document.querySelectorAll('.drive-btn').forEach(function(btn) {
|
|
831
|
-
btn.onclick = function() {
|
|
832
|
-
var drive = btn.getAttribute('data-drive');
|
|
833
|
-
if (drive) {
|
|
834
|
-
loadFileBrowserDirectory(drive);
|
|
835
|
-
}
|
|
836
|
-
};
|
|
837
|
-
});
|
|
838
|
-
|
|
839
|
-
// Path input - allow manual entry
|
|
840
|
-
var pathInput = document.getElementById('fileBrowserPathInput');
|
|
841
|
-
if (pathInput) {
|
|
842
|
-
pathInput.onkeydown = function(e) {
|
|
843
|
-
if (e.key === 'Enter') {
|
|
844
|
-
e.preventDefault();
|
|
845
|
-
var path = pathInput.value.trim();
|
|
846
|
-
if (path) {
|
|
847
|
-
loadFileBrowserDirectory(path);
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
};
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
// Show hidden checkbox
|
|
854
|
-
var showHiddenCheckbox = document.getElementById('fileBrowserShowHidden');
|
|
855
|
-
if (showHiddenCheckbox) {
|
|
856
|
-
showHiddenCheckbox.checked = true; // Default to show hidden
|
|
857
|
-
fileBrowserState.showHidden = true;
|
|
858
|
-
showHiddenCheckbox.onchange = function() {
|
|
859
|
-
fileBrowserState.showHidden = showHiddenCheckbox.checked;
|
|
860
|
-
loadFileBrowserDirectory(fileBrowserState.currentPath);
|
|
861
|
-
};
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
// Click outside to close
|
|
865
|
-
var overlay = document.getElementById('fileBrowserOverlay');
|
|
866
|
-
if (overlay) {
|
|
867
|
-
overlay.onclick = function(e) {
|
|
868
|
-
if (e.target === overlay) {
|
|
869
|
-
closeFileBrowserModal(null);
|
|
870
|
-
}
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
function closeFileBrowserModal(selectedPath) {
|
|
876
|
-
var overlay = document.getElementById('fileBrowserOverlay');
|
|
877
|
-
if (overlay) {
|
|
878
|
-
overlay.remove();
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
if (fileBrowserState.onSelect && selectedPath) {
|
|
882
|
-
fileBrowserState.onSelect(selectedPath);
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
fileBrowserState.onSelect = null;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
function initToolConfigModalEvents(tool, currentConfig, models) {
|
|
889
|
-
// Local tags state (copy from config)
|
|
890
|
-
var currentTags = (currentConfig.tags || []).slice();
|
|
891
|
-
// Local available models state (copy from config or use defaults)
|
|
892
|
-
var currentModels = (currentConfig.availableModels || models).slice();
|
|
893
|
-
|
|
894
|
-
// Helper to render tags inline with input
|
|
895
|
-
function renderTags() {
|
|
896
|
-
var container = document.getElementById('tagsUnifiedInput');
|
|
897
|
-
var input = document.getElementById('tagInput');
|
|
898
|
-
if (!container) return;
|
|
899
|
-
|
|
900
|
-
// Remove existing tag items but keep the input
|
|
901
|
-
container.querySelectorAll('.tag-item').forEach(function(el) { el.remove(); });
|
|
902
|
-
|
|
903
|
-
// Insert tags before the input
|
|
904
|
-
currentTags.forEach(function(tag) {
|
|
905
|
-
var tagEl = document.createElement('span');
|
|
906
|
-
tagEl.className = 'tag-item tag-' + escapeHtml(tag);
|
|
907
|
-
tagEl.innerHTML = escapeHtml(tag) + '<button type="button" class="tag-remove" data-tag="' + escapeHtml(tag) + '">×</button>';
|
|
908
|
-
container.insertBefore(tagEl, input);
|
|
909
|
-
});
|
|
910
|
-
|
|
911
|
-
// Re-attach remove handlers
|
|
912
|
-
container.querySelectorAll('.tag-remove').forEach(function(btn) {
|
|
913
|
-
btn.onclick = function(e) {
|
|
914
|
-
e.stopPropagation();
|
|
915
|
-
var tagToRemove = this.getAttribute('data-tag');
|
|
916
|
-
currentTags = currentTags.filter(function(t) { return t !== tagToRemove; });
|
|
917
|
-
renderTags();
|
|
918
|
-
};
|
|
919
|
-
});
|
|
920
|
-
|
|
921
|
-
// Update predefined tag buttons state
|
|
922
|
-
document.querySelectorAll('.predefined-tag-btn').forEach(function(btn) {
|
|
923
|
-
var tag = btn.getAttribute('data-tag');
|
|
924
|
-
if (currentTags.indexOf(tag) !== -1) {
|
|
925
|
-
btn.classList.add('selected');
|
|
926
|
-
btn.disabled = true;
|
|
927
|
-
} else {
|
|
928
|
-
btn.classList.remove('selected');
|
|
929
|
-
btn.disabled = false;
|
|
930
|
-
}
|
|
931
|
-
});
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
// Helper to render available models inline with input
|
|
935
|
-
function renderModels() {
|
|
936
|
-
var container = document.getElementById('modelsUnifiedInput');
|
|
937
|
-
var input = document.getElementById('modelInput');
|
|
938
|
-
if (!container) return;
|
|
939
|
-
|
|
940
|
-
// Remove existing model items but keep the input
|
|
941
|
-
container.querySelectorAll('.tag-item').forEach(function(el) { el.remove(); });
|
|
942
|
-
|
|
943
|
-
// Insert models before the input
|
|
944
|
-
currentModels.forEach(function(model) {
|
|
945
|
-
var modelEl = document.createElement('span');
|
|
946
|
-
modelEl.className = 'tag-item tag-model';
|
|
947
|
-
modelEl.innerHTML = escapeHtml(model) + '<button type="button" class="tag-remove" data-model="' + escapeHtml(model) + '">×</button>';
|
|
948
|
-
container.insertBefore(modelEl, input);
|
|
949
|
-
});
|
|
950
|
-
|
|
951
|
-
// Re-attach remove handlers
|
|
952
|
-
container.querySelectorAll('.tag-remove').forEach(function(btn) {
|
|
953
|
-
btn.onclick = function(e) {
|
|
954
|
-
e.stopPropagation();
|
|
955
|
-
var modelToRemove = this.getAttribute('data-model');
|
|
956
|
-
currentModels = currentModels.filter(function(m) { return m !== modelToRemove; });
|
|
957
|
-
renderModels();
|
|
958
|
-
updateModelSelects();
|
|
959
|
-
};
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
// Helper to update model select dropdowns with current model list
|
|
964
|
-
function updateModelSelects() {
|
|
965
|
-
var primarySelect = document.getElementById('primaryModelSelect');
|
|
966
|
-
var secondarySelect = document.getElementById('secondaryModelSelect');
|
|
967
|
-
if (!primarySelect || !secondarySelect) return;
|
|
968
|
-
|
|
969
|
-
var primaryValue = primarySelect.value;
|
|
970
|
-
var secondaryValue = secondarySelect.value;
|
|
971
|
-
|
|
972
|
-
// Rebuild options
|
|
973
|
-
var buildOptions = function(selectedValue) {
|
|
974
|
-
var html = '';
|
|
975
|
-
currentModels.forEach(function(m) {
|
|
976
|
-
html += '<option value="' + escapeHtml(m) + '"' + (m === selectedValue ? ' selected' : '') + '>' + escapeHtml(m) + '</option>';
|
|
977
|
-
});
|
|
978
|
-
html += '<option value="__custom__"' + (selectedValue === '__custom__' ? ' selected' : '') + '>Custom...</option>';
|
|
979
|
-
return html;
|
|
980
|
-
};
|
|
981
|
-
|
|
982
|
-
primarySelect.innerHTML = buildOptions(primaryValue);
|
|
983
|
-
secondarySelect.innerHTML = buildOptions(secondaryValue);
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
// Click on unified input container focuses the input
|
|
987
|
-
var unifiedInput = document.getElementById('tagsUnifiedInput');
|
|
988
|
-
if (unifiedInput) {
|
|
989
|
-
unifiedInput.onclick = function(e) {
|
|
990
|
-
if (e.target === this) {
|
|
991
|
-
document.getElementById('tagInput').focus();
|
|
992
|
-
}
|
|
993
|
-
};
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
// Click on models unified input container focuses the input
|
|
997
|
-
var modelsUnifiedInput = document.getElementById('modelsUnifiedInput');
|
|
998
|
-
if (modelsUnifiedInput) {
|
|
999
|
-
modelsUnifiedInput.onclick = function(e) {
|
|
1000
|
-
if (e.target === this) {
|
|
1001
|
-
document.getElementById('modelInput').focus();
|
|
1002
|
-
}
|
|
1003
|
-
};
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
// Tag input handler
|
|
1007
|
-
var tagInput = document.getElementById('tagInput');
|
|
1008
|
-
if (tagInput) {
|
|
1009
|
-
tagInput.onkeydown = function(e) {
|
|
1010
|
-
if (e.key === 'Enter') {
|
|
1011
|
-
e.preventDefault();
|
|
1012
|
-
var newTag = this.value.trim();
|
|
1013
|
-
if (newTag && currentTags.indexOf(newTag) === -1) {
|
|
1014
|
-
currentTags.push(newTag);
|
|
1015
|
-
renderTags();
|
|
1016
|
-
}
|
|
1017
|
-
this.value = '';
|
|
1018
|
-
}
|
|
1019
|
-
};
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
// Predefined tag click handlers
|
|
1023
|
-
document.querySelectorAll('.predefined-tag-btn').forEach(function(btn) {
|
|
1024
|
-
btn.onclick = function() {
|
|
1025
|
-
var tag = this.getAttribute('data-tag');
|
|
1026
|
-
if (tag && currentTags.indexOf(tag) === -1) {
|
|
1027
|
-
currentTags.push(tag);
|
|
1028
|
-
renderTags();
|
|
1029
|
-
}
|
|
1030
|
-
};
|
|
1031
|
-
});
|
|
1032
|
-
|
|
1033
|
-
// Model input handler
|
|
1034
|
-
var modelInput = document.getElementById('modelInput');
|
|
1035
|
-
if (modelInput) {
|
|
1036
|
-
modelInput.onkeydown = function(e) {
|
|
1037
|
-
if (e.key === 'Enter') {
|
|
1038
|
-
e.preventDefault();
|
|
1039
|
-
var newModel = this.value.trim();
|
|
1040
|
-
if (newModel && currentModels.indexOf(newModel) === -1) {
|
|
1041
|
-
currentModels.push(newModel);
|
|
1042
|
-
renderModels();
|
|
1043
|
-
updateModelSelects();
|
|
1044
|
-
}
|
|
1045
|
-
this.value = '';
|
|
1046
|
-
}
|
|
1047
|
-
};
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
// Initialize tags display
|
|
1051
|
-
renderTags();
|
|
1052
|
-
// Initialize models display
|
|
1053
|
-
renderModels();
|
|
1054
|
-
// Initialize lucide icons for predefined buttons
|
|
1055
|
-
if (window.lucide) lucide.createIcons();
|
|
1056
|
-
|
|
1057
|
-
// Toggle Enable/Disable
|
|
1058
|
-
var toggleBtn = document.getElementById('toggleEnableBtn');
|
|
1059
|
-
if (toggleBtn) {
|
|
1060
|
-
toggleBtn.onclick = async function() {
|
|
1061
|
-
var newEnabled = !currentConfig.enabled;
|
|
1062
|
-
try {
|
|
1063
|
-
await updateCliToolConfig(tool, { enabled: newEnabled });
|
|
1064
|
-
showRefreshToast(tool + ' ' + (newEnabled ? 'enabled' : 'disabled'), 'success');
|
|
1065
|
-
closeModal();
|
|
1066
|
-
renderToolsSection();
|
|
1067
|
-
if (window.lucide) lucide.createIcons();
|
|
1068
|
-
} catch (err) {
|
|
1069
|
-
showRefreshToast('Failed to update: ' + err.message, 'error');
|
|
1070
|
-
}
|
|
1071
|
-
};
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
// Install/Uninstall
|
|
1075
|
-
var installBtn = document.getElementById('installBtn');
|
|
1076
|
-
if (installBtn) {
|
|
1077
|
-
installBtn.onclick = function() {
|
|
1078
|
-
var status = cliToolStatus[tool] || {};
|
|
1079
|
-
closeModal();
|
|
1080
|
-
|
|
1081
|
-
if (status.available) {
|
|
1082
|
-
openCliUninstallWizard(tool);
|
|
1083
|
-
} else {
|
|
1084
|
-
openCliInstallWizard(tool);
|
|
1085
|
-
}
|
|
1086
|
-
};
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
// Model select handlers
|
|
1090
|
-
var primarySelect = document.getElementById('primaryModelSelect');
|
|
1091
|
-
var primaryCustom = document.getElementById('primaryModelCustom');
|
|
1092
|
-
var secondarySelect = document.getElementById('secondaryModelSelect');
|
|
1093
|
-
var secondaryCustom = document.getElementById('secondaryModelCustom');
|
|
1094
|
-
|
|
1095
|
-
if (primarySelect && primaryCustom) {
|
|
1096
|
-
primarySelect.onchange = function() {
|
|
1097
|
-
if (this.value === '__custom__') {
|
|
1098
|
-
primaryCustom.style.display = 'block';
|
|
1099
|
-
primaryCustom.focus();
|
|
1100
|
-
} else {
|
|
1101
|
-
primaryCustom.style.display = 'none';
|
|
1102
|
-
primaryCustom.value = '';
|
|
1103
|
-
}
|
|
1104
|
-
};
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
if (secondarySelect && secondaryCustom) {
|
|
1108
|
-
secondarySelect.onchange = function() {
|
|
1109
|
-
if (this.value === '__custom__') {
|
|
1110
|
-
secondaryCustom.style.display = 'block';
|
|
1111
|
-
secondaryCustom.focus();
|
|
1112
|
-
} else {
|
|
1113
|
-
secondaryCustom.style.display = 'none';
|
|
1114
|
-
secondaryCustom.value = '';
|
|
1115
|
-
}
|
|
1116
|
-
};
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
// Save button
|
|
1120
|
-
var saveBtn = document.getElementById('saveConfigBtn');
|
|
1121
|
-
if (saveBtn) {
|
|
1122
|
-
saveBtn.onclick = async function() {
|
|
1123
|
-
var primaryModel = primarySelect.value === '__custom__'
|
|
1124
|
-
? primaryCustom.value.trim()
|
|
1125
|
-
: primarySelect.value;
|
|
1126
|
-
var secondaryModel = secondarySelect.value === '__custom__'
|
|
1127
|
-
? secondaryCustom.value.trim()
|
|
1128
|
-
: secondarySelect.value;
|
|
1129
|
-
|
|
1130
|
-
if (!primaryModel) {
|
|
1131
|
-
showRefreshToast('Primary model is required', 'error');
|
|
1132
|
-
return;
|
|
1133
|
-
}
|
|
1134
|
-
if (!secondaryModel) {
|
|
1135
|
-
showRefreshToast('Secondary model is required', 'error');
|
|
1136
|
-
return;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
if (currentModels.length === 0) {
|
|
1140
|
-
showRefreshToast('At least one available model is required', 'error');
|
|
1141
|
-
return;
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
// Get envFile value (only for gemini/qwen)
|
|
1145
|
-
var envFileInput = document.getElementById('envFileInput');
|
|
1146
|
-
var envFile = envFileInput ? envFileInput.value.trim() : '';
|
|
1147
|
-
|
|
1148
|
-
// Get settingsFile value (only for builtin claude)
|
|
1149
|
-
var claudeSettingsFileInput = document.getElementById('claudeSettingsFileInput');
|
|
1150
|
-
var settingsFile = claudeSettingsFileInput ? claudeSettingsFileInput.value.trim() : '';
|
|
1151
|
-
|
|
1152
|
-
try {
|
|
1153
|
-
var updateData = {
|
|
1154
|
-
primaryModel: primaryModel,
|
|
1155
|
-
secondaryModel: secondaryModel,
|
|
1156
|
-
availableModels: currentModels,
|
|
1157
|
-
tags: currentTags
|
|
1158
|
-
};
|
|
1159
|
-
|
|
1160
|
-
// Only include envFile for gemini/qwen tools
|
|
1161
|
-
if (tool === 'gemini' || tool === 'qwen') {
|
|
1162
|
-
updateData.envFile = envFile || null;
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
// Only include settingsFile for builtin claude tool
|
|
1166
|
-
if (tool === 'claude' && config.type === 'builtin') {
|
|
1167
|
-
updateData.settingsFile = settingsFile || null;
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
await updateCliToolConfig(tool, updateData);
|
|
1171
|
-
// Reload config to reflect changes
|
|
1172
|
-
await loadCliToolConfig();
|
|
1173
|
-
showRefreshToast('Configuration saved', 'success');
|
|
1174
|
-
closeModal();
|
|
1175
|
-
renderToolsSection();
|
|
1176
|
-
if (window.lucide) lucide.createIcons();
|
|
1177
|
-
} catch (err) {
|
|
1178
|
-
showRefreshToast('Failed to save: ' + err.message, 'error');
|
|
1179
|
-
}
|
|
1180
|
-
};
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
// Environment file browse button (only for gemini/qwen)
|
|
1184
|
-
var envFileBrowseBtn = document.getElementById('envFileBrowseBtn');
|
|
1185
|
-
if (envFileBrowseBtn) {
|
|
1186
|
-
envFileBrowseBtn.onclick = function() {
|
|
1187
|
-
showFileBrowserModal(function(selectedPath) {
|
|
1188
|
-
var envFileInput = document.getElementById('envFileInput');
|
|
1189
|
-
if (envFileInput && selectedPath) {
|
|
1190
|
-
envFileInput.value = selectedPath;
|
|
1191
|
-
envFileInput.focus();
|
|
1192
|
-
}
|
|
1193
|
-
});
|
|
1194
|
-
};
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
// Claude Settings File browse button (only for builtin claude)
|
|
1198
|
-
var claudeSettingsFileBrowseBtn = document.getElementById('claudeSettingsFileBrowseBtn');
|
|
1199
|
-
if (claudeSettingsFileBrowseBtn) {
|
|
1200
|
-
claudeSettingsFileBrowseBtn.onclick = function() {
|
|
1201
|
-
showFileBrowserModal(function(selectedPath) {
|
|
1202
|
-
var claudeSettingsFileInput = document.getElementById('claudeSettingsFileInput');
|
|
1203
|
-
if (claudeSettingsFileInput && selectedPath) {
|
|
1204
|
-
claudeSettingsFileInput.value = selectedPath;
|
|
1205
|
-
claudeSettingsFileInput.focus();
|
|
1206
|
-
}
|
|
1207
|
-
});
|
|
1208
|
-
};
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
// Initialize lucide icons in modal
|
|
1212
|
-
if (window.lucide) lucide.createIcons();
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
// ========== Rendering ==========
|
|
1216
|
-
|
|
1217
|
-
/**
|
|
1218
|
-
* 构建 CLI Manager 骨架屏
|
|
1219
|
-
* @returns {string} HTML 字符串
|
|
1220
|
-
*/
|
|
1221
|
-
function buildCliManagerSkeleton() {
|
|
1222
|
-
return '<div class="space-y-6">' +
|
|
1223
|
-
'<div class="flex items-center justify-between mb-4">' +
|
|
1224
|
-
'<h2 class="text-lg font-semibold">' + (t('title.cliTools') || 'CLI Tools & CCW') + '</h2>' +
|
|
1225
|
-
'</div>' +
|
|
1226
|
-
'<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">' +
|
|
1227
|
-
// 左侧 Tools 区域骨架
|
|
1228
|
-
'<div class="card p-4">' +
|
|
1229
|
-
'<div class="animate-pulse space-y-4">' +
|
|
1230
|
-
'<div class="h-4 bg-muted rounded w-1/3"></div>' +
|
|
1231
|
-
'<div class="h-16 bg-muted rounded"></div>' +
|
|
1232
|
-
'<div class="h-16 bg-muted rounded"></div>' +
|
|
1233
|
-
'<div class="h-16 bg-muted rounded"></div>' +
|
|
1234
|
-
'</div>' +
|
|
1235
|
-
'</div>' +
|
|
1236
|
-
// 右侧 CCW 区域骨架
|
|
1237
|
-
'<div class="card p-4">' +
|
|
1238
|
-
'<div class="animate-pulse space-y-4">' +
|
|
1239
|
-
'<div class="h-4 bg-muted rounded w-1/3"></div>' +
|
|
1240
|
-
'<div class="h-20 bg-muted rounded"></div>' +
|
|
1241
|
-
'<div class="h-20 bg-muted rounded"></div>' +
|
|
1242
|
-
'</div>' +
|
|
1243
|
-
'</div>' +
|
|
1244
|
-
'</div>' +
|
|
1245
|
-
// 底部区域骨架
|
|
1246
|
-
'<div class="card p-4">' +
|
|
1247
|
-
'<div class="animate-pulse space-y-4">' +
|
|
1248
|
-
'<div class="h-4 bg-muted rounded w-1/4"></div>' +
|
|
1249
|
-
'<div class="h-12 bg-muted rounded"></div>' +
|
|
1250
|
-
'</div>' +
|
|
1251
|
-
'</div>' +
|
|
1252
|
-
'</div>';
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
/**
|
|
1256
|
-
* 渲染 CLI Manager 实际内容(内部容器结构 + 各子面板)
|
|
1257
|
-
* @param {HTMLElement} container - 主容器元素
|
|
1258
|
-
*/
|
|
1259
|
-
function renderCliManagerContent(container) {
|
|
1260
|
-
container.innerHTML = '<div class="status-manager">' +
|
|
1261
|
-
'<div class="status-two-column">' +
|
|
1262
|
-
'<div class="cli-section" id="tools-section"></div>' +
|
|
1263
|
-
'<div class="cli-section" id="ccw-section"></div>' +
|
|
1264
|
-
'</div>' +
|
|
1265
|
-
'<div class="cli-section" id="language-settings-section" style="margin-top: 1.5rem;"></div>' +
|
|
1266
|
-
'<div class="cli-settings-section" id="cli-settings-section" style="margin-top: 1.5rem;"></div>' +
|
|
1267
|
-
'<div class="cli-section" id="ccw-endpoint-tools-section" style="margin-top: 1.5rem;"></div>' +
|
|
1268
|
-
'</div>' +
|
|
1269
|
-
'<section id="storageCard" class="mb-6"></section>';
|
|
1270
|
-
|
|
1271
|
-
// 渲染子面板
|
|
1272
|
-
renderToolsSection();
|
|
1273
|
-
renderCcwSection();
|
|
1274
|
-
renderLanguageSettingsSection();
|
|
1275
|
-
renderCliSettingsSection();
|
|
1276
|
-
renderCcwEndpointToolsSection();
|
|
1277
|
-
|
|
1278
|
-
// 初始化存储管理器卡片
|
|
1279
|
-
if (typeof initStorageManager === 'function') {
|
|
1280
|
-
initStorageManager();
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
// 初始化 Lucide 图标
|
|
1284
|
-
if (window.lucide) lucide.createIcons();
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
async function renderCliManager() {
|
|
1288
|
-
var container = document.getElementById('mainContent');
|
|
1289
|
-
if (!container) return;
|
|
1290
|
-
|
|
1291
|
-
// 隐藏统计网格和搜索框
|
|
1292
|
-
var statsGrid = document.getElementById('statsGrid');
|
|
1293
|
-
var searchInput = document.getElementById('searchInput');
|
|
1294
|
-
if (statsGrid) statsGrid.style.display = 'none';
|
|
1295
|
-
if (searchInput) searchInput.parentElement.style.display = 'none';
|
|
1296
|
-
|
|
1297
|
-
// 注册数据源(如果尚未注册)
|
|
1298
|
-
registerCliDataSources();
|
|
1299
|
-
|
|
1300
|
-
// 1. 立即显示骨架屏
|
|
1301
|
-
container.innerHTML = buildCliManagerSkeleton();
|
|
1302
|
-
if (window.lucide) lucide.createIcons();
|
|
1303
|
-
|
|
1304
|
-
// 2. 尝试从缓存渲染(快速展示)
|
|
1305
|
-
var cachedConfig = getCliCachedData('toolConfig');
|
|
1306
|
-
var cachedStatus = getCliCachedData('toolStatus');
|
|
1307
|
-
var hasCachedData = cachedConfig && cachedStatus;
|
|
1308
|
-
|
|
1309
|
-
if (hasCachedData) {
|
|
1310
|
-
// 应用缓存数据
|
|
1311
|
-
cliToolConfig = cachedConfig.config;
|
|
1312
|
-
predefinedModels = cachedConfig.predefinedModels || {};
|
|
1313
|
-
// 立即渲染缓存数据
|
|
1314
|
-
renderCliManagerContent(container);
|
|
1315
|
-
console.log('[CLI Manager] Rendered from cache');
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
// 3. 后台加载最新数据
|
|
1319
|
-
try {
|
|
1320
|
-
await Promise.all([
|
|
1321
|
-
loadCliToolsConfig(),
|
|
1322
|
-
loadCliToolStatus(),
|
|
1323
|
-
loadCodexLensStatus(),
|
|
1324
|
-
loadCcwInstallations(),
|
|
1325
|
-
loadCcwEndpointTools(),
|
|
1326
|
-
loadLitellmApiEndpoints(),
|
|
1327
|
-
loadCliCustomEndpoints(),
|
|
1328
|
-
loadCliWrapperEndpoints()
|
|
1329
|
-
]);
|
|
1330
|
-
|
|
1331
|
-
// 4. 用最新数据更新 UI(如果之前未渲染或数据有变化)
|
|
1332
|
-
renderCliManagerContent(container);
|
|
1333
|
-
console.log('[CLI Manager] Rendered with fresh data');
|
|
1334
|
-
} catch (err) {
|
|
1335
|
-
console.error('[CLI Manager] Failed to load data:', err);
|
|
1336
|
-
// 如果没有缓存数据且加载失败,显示错误提示
|
|
1337
|
-
if (!hasCachedData) {
|
|
1338
|
-
container.innerHTML = '<div class="card p-4 text-center">' +
|
|
1339
|
-
'<i data-lucide="alert-circle" class="w-8 h-8 text-muted-foreground mx-auto mb-2"></i>' +
|
|
1340
|
-
'<p class="text-muted-foreground">' + (t('common.loadFailed') || 'Failed to load data') + '</p>' +
|
|
1341
|
-
'<button class="btn btn-sm mt-2" onclick="renderCliManager()">' +
|
|
1342
|
-
'<i data-lucide="refresh-cw" class="w-3 h-3 mr-1"></i>' +
|
|
1343
|
-
(t('common.retry') || 'Retry') +
|
|
1344
|
-
'</button>' +
|
|
1345
|
-
'</div>';
|
|
1346
|
-
if (window.lucide) lucide.createIcons();
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
// 同步活动执行
|
|
1351
|
-
syncActiveExecutionsForManager();
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
// ========== Helper Functions ==========
|
|
1355
|
-
|
|
1356
|
-
/**
|
|
1357
|
-
* Get selected embedding model from dropdown
|
|
1358
|
-
* @returns {string} Selected model profile (code, fast, multilingual, balanced)
|
|
1359
|
-
*/
|
|
1360
|
-
function getSelectedModel() {
|
|
1361
|
-
var select = document.getElementById('codexlensModelSelect');
|
|
1362
|
-
return select ? select.value : 'code';
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
/**
|
|
1366
|
-
* Build model select options HTML, showing only installed models
|
|
1367
|
-
* @returns {string} HTML string for select options
|
|
1368
|
-
*/
|
|
1369
|
-
function buildModelSelectOptions() {
|
|
1370
|
-
var installedModels = window.cliToolsStatus?.codexlens?.installedModels || [];
|
|
1371
|
-
var allModels = window.cliToolsStatus?.codexlens?.allModels || [];
|
|
1372
|
-
|
|
1373
|
-
// Model display configuration
|
|
1374
|
-
var modelConfig = {
|
|
1375
|
-
'code': { label: t('index.modelCode') || 'Code (768d)', star: true },
|
|
1376
|
-
'base': { label: t('index.modelBase') || 'Base (768d)', star: false },
|
|
1377
|
-
'fast': { label: t('index.modelFast') || 'Fast (384d)', star: false },
|
|
1378
|
-
'minilm': { label: t('index.modelMinilm') || 'MiniLM (384d)', star: false },
|
|
1379
|
-
'multilingual': { label: t('index.modelMultilingual') || 'Multilingual (1024d)', warn: true },
|
|
1380
|
-
'balanced': { label: t('index.modelBalanced') || 'Balanced (1024d)', warn: true }
|
|
1381
|
-
};
|
|
1382
|
-
|
|
1383
|
-
// If no models installed, show placeholder
|
|
1384
|
-
if (installedModels.length === 0) {
|
|
1385
|
-
return '<option value="" disabled selected>' + (t('index.noModelsInstalled') || 'No models installed') + '</option>';
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
// Build options for installed models only
|
|
1389
|
-
var options = '';
|
|
1390
|
-
var firstInstalled = null;
|
|
1391
|
-
|
|
1392
|
-
// Preferred order: code, fast, minilm, base, multilingual, balanced
|
|
1393
|
-
var preferredOrder = ['code', 'fast', 'minilm', 'base', 'multilingual', 'balanced'];
|
|
1394
|
-
|
|
1395
|
-
preferredOrder.forEach(function(profile) {
|
|
1396
|
-
if (installedModels.includes(profile) && modelConfig[profile]) {
|
|
1397
|
-
var config = modelConfig[profile];
|
|
1398
|
-
var style = config.warn ? ' style="color: var(--muted-foreground)"' : '';
|
|
1399
|
-
var suffix = config.star ? ' ⭐' : (config.warn ? ' ⚠️' : '');
|
|
1400
|
-
var selected = !firstInstalled ? ' selected' : '';
|
|
1401
|
-
if (!firstInstalled) firstInstalled = profile;
|
|
1402
|
-
options += '<option value="' + profile + '"' + style + selected + '>' + config.label + suffix + '</option>';
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
|
|
1406
|
-
return options;
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
// ========== Tools Section (Left Column) ==========
|
|
1410
|
-
function renderToolsSection() {
|
|
1411
|
-
var container = document.getElementById('tools-section');
|
|
1412
|
-
if (!container) return;
|
|
1413
|
-
|
|
1414
|
-
var toolDescriptions = {
|
|
1415
|
-
gemini: t('cli.geminiDesc'),
|
|
1416
|
-
qwen: t('cli.qwenDesc'),
|
|
1417
|
-
codex: t('cli.codexDesc'),
|
|
1418
|
-
claude: t('cli.claudeDesc') || 'Anthropic Claude Code CLI for AI-assisted development',
|
|
1419
|
-
opencode: t('cli.opencodeDesc') || 'OpenCode CLI - Multi-provider AI coding assistant'
|
|
1420
|
-
};
|
|
1421
|
-
|
|
1422
|
-
var tools = ['gemini', 'qwen', 'codex', 'claude', 'opencode'];
|
|
1423
|
-
var available = Object.values(cliToolStatus).filter(function(t) { return t.available; }).length;
|
|
1424
|
-
|
|
1425
|
-
var toolsHtml = tools.map(function(tool) {
|
|
1426
|
-
var status = cliToolStatus[tool] || {};
|
|
1427
|
-
var isAvailable = status.available;
|
|
1428
|
-
var toolConfig = cliToolConfig && cliToolConfig.tools ? cliToolConfig.tools[tool] : null;
|
|
1429
|
-
var tags = toolConfig && toolConfig.tags ? toolConfig.tags : [];
|
|
1430
|
-
|
|
1431
|
-
// Build tags HTML with color classes
|
|
1432
|
-
var tagsHtml = tags.length > 0
|
|
1433
|
-
? '<div class="tool-tags">' + tags.map(function(tag) {
|
|
1434
|
-
return '<span class="tool-tag tag-' + escapeHtml(tag) + '">' + escapeHtml(tag) + '</span>';
|
|
1435
|
-
}).join('') + '</div>'
|
|
1436
|
-
: '';
|
|
1437
|
-
|
|
1438
|
-
return '<div class="tool-item clickable ' + (isAvailable ? 'available' : 'unavailable') + '" onclick="showToolConfigModal(\'' + tool + '\')">' +
|
|
1439
|
-
'<div class="tool-item-left">' +
|
|
1440
|
-
'<span class="tool-status-dot ' + (isAvailable ? 'status-available' : 'status-unavailable') + '"></span>' +
|
|
1441
|
-
'<div class="tool-item-info">' +
|
|
1442
|
-
'<div class="tool-item-name">' + tool.charAt(0).toUpperCase() + tool.slice(1) +
|
|
1443
|
-
'<i data-lucide="settings" class="w-3 h-3 tool-config-icon"></i>' +
|
|
1444
|
-
'</div>' +
|
|
1445
|
-
'<div class="tool-item-desc">' + toolDescriptions[tool] + '</div>' +
|
|
1446
|
-
tagsHtml +
|
|
1447
|
-
'</div>' +
|
|
1448
|
-
'</div>' +
|
|
1449
|
-
'<div class="tool-item-right">' +
|
|
1450
|
-
(isAvailable
|
|
1451
|
-
? '<span class="tool-status-text success"><i data-lucide="check-circle" class="w-3.5 h-3.5"></i> ' + t('cli.ready') + '</span>'
|
|
1452
|
-
: '<span class="tool-status-text muted"><i data-lucide="circle-dashed" class="w-3.5 h-3.5"></i> ' + t('cli.notInstalled') + '</span>') +
|
|
1453
|
-
'</div>' +
|
|
1454
|
-
'</div>';
|
|
1455
|
-
}).join('');
|
|
1456
|
-
|
|
1457
|
-
// CodexLens and Semantic Search removed from this list
|
|
1458
|
-
// They are managed in the dedicated CodexLens Manager page (left menu)
|
|
1459
|
-
|
|
1460
|
-
// API Endpoints section
|
|
1461
|
-
var apiEndpointsHtml = '';
|
|
1462
|
-
if (litellmApiEndpoints.length > 0) {
|
|
1463
|
-
var endpointItems = litellmApiEndpoints.map(function(endpoint) {
|
|
1464
|
-
// Check if endpoint is synced to CLI tools
|
|
1465
|
-
var cliEndpoint = cliCustomEndpoints.find(function(e) { return e.id === endpoint.id; });
|
|
1466
|
-
var isSynced = !!cliEndpoint;
|
|
1467
|
-
var isEnabled = cliEndpoint ? cliEndpoint.enabled : false;
|
|
1468
|
-
|
|
1469
|
-
// Find provider info
|
|
1470
|
-
var provider = (window.litellmApiConfig?.providers || []).find(function(p) { return p.id === endpoint.providerId; });
|
|
1471
|
-
var providerName = provider ? provider.name : endpoint.providerId;
|
|
1472
|
-
|
|
1473
|
-
return '<div class="tool-item ' + (isSynced && isEnabled ? 'available' : 'unavailable') + '">' +
|
|
1474
|
-
'<div class="tool-item-left">' +
|
|
1475
|
-
'<span class="tool-status-dot ' + (isSynced && isEnabled ? 'status-available' : 'status-unavailable') + '"></span>' +
|
|
1476
|
-
'<div class="tool-item-info">' +
|
|
1477
|
-
'<div class="tool-item-name">' + endpoint.id + ' <span class="tool-type-badge">API</span></div>' +
|
|
1478
|
-
'<div class="tool-item-desc">' + endpoint.model + ' (' + providerName + ')</div>' +
|
|
1479
|
-
'</div>' +
|
|
1480
|
-
'</div>' +
|
|
1481
|
-
'<div class="tool-item-right">' +
|
|
1482
|
-
(isSynced
|
|
1483
|
-
? '<label class="toggle-switch" onclick="event.stopPropagation()">' +
|
|
1484
|
-
'<input type="checkbox" ' + (isEnabled ? 'checked' : '') + ' onchange="toggleEndpointEnabled(\'' + endpoint.id + '\', this.checked); renderToolsSection();">' +
|
|
1485
|
-
'<span class="toggle-slider"></span>' +
|
|
1486
|
-
'</label>'
|
|
1487
|
-
: '<button class="btn-sm btn-primary" onclick="event.stopPropagation(); syncEndpointToCliTools({id: \'' + endpoint.id + '\', name: \'' + endpoint.name + '\'})">' +
|
|
1488
|
-
'<i data-lucide="plus" class="w-3 h-3"></i> ' + (t('cli.addToCli') || 'Add to CLI') +
|
|
1489
|
-
'</button>') +
|
|
1490
|
-
'</div>' +
|
|
1491
|
-
'</div>';
|
|
1492
|
-
}).join('');
|
|
1493
|
-
|
|
1494
|
-
apiEndpointsHtml = '<div class="tools-subsection" style="margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);">' +
|
|
1495
|
-
'<div class="section-header-left" style="margin-bottom: 0.5rem;">' +
|
|
1496
|
-
'<h4 style="font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem;">' +
|
|
1497
|
-
'<i data-lucide="cloud" class="w-4 h-4"></i> ' + (t('cli.apiEndpoints') || 'API Endpoints') +
|
|
1498
|
-
'</h4>' +
|
|
1499
|
-
'<span class="section-count">' + litellmApiEndpoints.length + ' ' + (t('cli.configured') || 'configured') + '</span>' +
|
|
1500
|
-
'</div>' +
|
|
1501
|
-
'<div class="tools-list">' + endpointItems + '</div>' +
|
|
1502
|
-
'</div>';
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
// CLI Wrapper (CLI封装) section
|
|
1506
|
-
var cliWrapperHtml = '';
|
|
1507
|
-
if (cliWrapperEndpoints.length > 0) {
|
|
1508
|
-
var wrapperItems = cliWrapperEndpoints.map(function(endpoint) {
|
|
1509
|
-
var isEnabled = endpoint.enabled !== false;
|
|
1510
|
-
var desc = endpoint.description || (t('cli.customClaudeSettings') || 'Custom Claude CLI settings');
|
|
1511
|
-
// Show command hint with name for easy copying
|
|
1512
|
-
var commandHint = 'ccw cli --tool ' + endpoint.name;
|
|
1513
|
-
|
|
1514
|
-
return '<div class="tool-item clickable ' + (isEnabled ? 'available' : 'unavailable') + '" onclick="navigateToApiSettings(\'' + endpoint.id + '\')">' +
|
|
1515
|
-
'<div class="tool-item-left">' +
|
|
1516
|
-
'<span class="tool-status-dot ' + (isEnabled ? 'status-available' : 'status-unavailable') + '"></span>' +
|
|
1517
|
-
'<div class="tool-item-info">' +
|
|
1518
|
-
'<div class="tool-item-name">' + escapeHtml(endpoint.name) + ' <span class="tool-type-badge" style="background: var(--primary); color: white;">' + (t('cli.wrapper') || 'Wrapper') + '</span></div>' +
|
|
1519
|
-
'<div class="tool-item-desc">' + escapeHtml(desc) + '</div>' +
|
|
1520
|
-
'<div class="tool-item-command" style="font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted-foreground); margin-top: 0.25rem;">' + escapeHtml(commandHint) + '</div>' +
|
|
1521
|
-
'</div>' +
|
|
1522
|
-
'</div>' +
|
|
1523
|
-
'<div class="tool-item-right">' +
|
|
1524
|
-
'<label class="toggle-switch" onclick="event.stopPropagation()">' +
|
|
1525
|
-
'<input type="checkbox" ' + (isEnabled ? 'checked' : '') + ' onchange="toggleCliWrapperEnabled(\'' + endpoint.id + '\', this.checked); renderToolsSection();">' +
|
|
1526
|
-
'<span class="toggle-slider"></span>' +
|
|
1527
|
-
'</label>' +
|
|
1528
|
-
'</div>' +
|
|
1529
|
-
'</div>';
|
|
1530
|
-
}).join('');
|
|
1531
|
-
|
|
1532
|
-
var enabledCount = cliWrapperEndpoints.filter(function(e) { return e.enabled !== false; }).length;
|
|
1533
|
-
cliWrapperHtml = '<div class="tools-subsection" style="margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);">' +
|
|
1534
|
-
'<div class="section-header-left" style="margin-bottom: 0.5rem;">' +
|
|
1535
|
-
'<h4 style="font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem;">' +
|
|
1536
|
-
'<i data-lucide="package-2" class="w-4 h-4"></i> ' + (t('cli.cliWrapper') || 'CLI Wrapper') +
|
|
1537
|
-
'</h4>' +
|
|
1538
|
-
'<span class="section-count">' + enabledCount + '/' + cliWrapperEndpoints.length + ' ' + (t('cli.enabled') || 'enabled') + '</span>' +
|
|
1539
|
-
'</div>' +
|
|
1540
|
-
'<div class="tools-list">' + wrapperItems + '</div>' +
|
|
1541
|
-
'</div>';
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
container.innerHTML = '<div class="section-header">' +
|
|
1545
|
-
'<div class="section-header-left">' +
|
|
1546
|
-
'<h3><i data-lucide="terminal" class="w-4 h-4"></i> ' + t('cli.tools') + '</h3>' +
|
|
1547
|
-
'<span class="section-count">' + available + '/' + tools.length + ' ' + t('cli.available') + '</span>' +
|
|
1548
|
-
'</div>' +
|
|
1549
|
-
'<button class="btn-icon" onclick="refreshAllCliStatus()" title="' + t('cli.refreshStatus') + '">' +
|
|
1550
|
-
'<i data-lucide="refresh-cw" class="w-4 h-4"></i>' +
|
|
1551
|
-
'</button>' +
|
|
1552
|
-
'</div>' +
|
|
1553
|
-
'<div class="tools-list">' +
|
|
1554
|
-
toolsHtml +
|
|
1555
|
-
'</div>' +
|
|
1556
|
-
apiEndpointsHtml +
|
|
1557
|
-
cliWrapperHtml;
|
|
1558
|
-
|
|
1559
|
-
if (window.lucide) lucide.createIcons();
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
/**
|
|
1563
|
-
* Navigate to API Settings page and open the CLI wrapper endpoint for editing
|
|
1564
|
-
*/
|
|
1565
|
-
function navigateToApiSettings(endpointId) {
|
|
1566
|
-
// Store the endpoint ID to edit after navigation
|
|
1567
|
-
window.pendingCliWrapperEdit = endpointId;
|
|
1568
|
-
|
|
1569
|
-
var navItem = document.querySelector('.nav-item[data-view="api-settings"]');
|
|
1570
|
-
if (navItem) {
|
|
1571
|
-
navItem.click();
|
|
1572
|
-
} else {
|
|
1573
|
-
// Fallback: try to render directly
|
|
1574
|
-
if (typeof renderApiSettings === 'function') {
|
|
1575
|
-
currentView = 'api-settings';
|
|
1576
|
-
renderApiSettings();
|
|
1577
|
-
} else {
|
|
1578
|
-
showRefreshToast(t('common.error') + ': API Settings not available', 'error');
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
// ========== CCW Section (Right Column) ==========
|
|
1584
|
-
function renderCcwSection() {
|
|
1585
|
-
var container = document.getElementById('ccw-section');
|
|
1586
|
-
if (!container) return;
|
|
1587
|
-
|
|
1588
|
-
var installationsHtml = '';
|
|
1589
|
-
|
|
1590
|
-
if (ccwInstallations.length === 0) {
|
|
1591
|
-
installationsHtml = '<div class="ccw-empty-state">' +
|
|
1592
|
-
'<i data-lucide="package-x" class="w-8 h-8"></i>' +
|
|
1593
|
-
'<p>' + t('ccw.noInstallations') + '</p>' +
|
|
1594
|
-
'<button class="btn btn-sm btn-primary" onclick="showCcwInstallModal()">' +
|
|
1595
|
-
'<i data-lucide="download" class="w-3 h-3"></i> ' + t('ccw.installCcw') + '</button>' +
|
|
1596
|
-
'</div>';
|
|
1597
|
-
} else {
|
|
1598
|
-
installationsHtml = '<div class="ccw-list">';
|
|
1599
|
-
for (var i = 0; i < ccwInstallations.length; i++) {
|
|
1600
|
-
var inst = ccwInstallations[i];
|
|
1601
|
-
var isGlobal = inst.installation_mode === 'Global';
|
|
1602
|
-
var modeIcon = isGlobal ? 'home' : 'folder';
|
|
1603
|
-
var version = inst.application_version || 'unknown';
|
|
1604
|
-
var installDate = new Date(inst.installation_date).toLocaleDateString();
|
|
1605
|
-
|
|
1606
|
-
installationsHtml += '<div class="ccw-item">' +
|
|
1607
|
-
'<div class="ccw-item-left">' +
|
|
1608
|
-
'<div class="ccw-item-mode ' + (isGlobal ? 'global' : 'path') + '">' +
|
|
1609
|
-
'<i data-lucide="' + modeIcon + '" class="w-4 h-4"></i>' +
|
|
1610
|
-
'</div>' +
|
|
1611
|
-
'<div class="ccw-item-info">' +
|
|
1612
|
-
'<div class="ccw-item-header">' +
|
|
1613
|
-
'<span class="ccw-item-name">' + inst.installation_mode + '</span>' +
|
|
1614
|
-
'<span class="ccw-version-tag">v' + version + '</span>' +
|
|
1615
|
-
'</div>' +
|
|
1616
|
-
'<div class="ccw-item-path" title="' + inst.installation_path + '">' + escapeHtml(inst.installation_path) + '</div>' +
|
|
1617
|
-
'<div class="ccw-item-meta">' +
|
|
1618
|
-
'<span><i data-lucide="calendar" class="w-3 h-3"></i> ' + installDate + '</span>' +
|
|
1619
|
-
'<span><i data-lucide="file" class="w-3 h-3"></i> ' + (inst.files_count || 0) + ' files</span>' +
|
|
1620
|
-
'</div>' +
|
|
1621
|
-
'</div>' +
|
|
1622
|
-
'</div>' +
|
|
1623
|
-
'<div class="ccw-item-actions">' +
|
|
1624
|
-
'<button class="btn-icon btn-icon-sm" onclick="runCcwUpgrade()" title="Upgrade">' +
|
|
1625
|
-
'<i data-lucide="arrow-up-circle" class="w-4 h-4"></i>' +
|
|
1626
|
-
'</button>' +
|
|
1627
|
-
'<button class="btn-icon btn-icon-sm btn-danger" onclick="confirmCcwUninstall(\'' + escapeHtml(inst.installation_path) + '\')" title="Uninstall">' +
|
|
1628
|
-
'<i data-lucide="trash-2" class="w-4 h-4"></i>' +
|
|
1629
|
-
'</button>' +
|
|
1630
|
-
'</div>' +
|
|
1631
|
-
'</div>';
|
|
1632
|
-
}
|
|
1633
|
-
installationsHtml += '</div>';
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
container.innerHTML = '<div class="section-header">' +
|
|
1637
|
-
'<div class="section-header-left">' +
|
|
1638
|
-
'<h3><i data-lucide="package" class="w-4 h-4"></i> ' + t('ccw.install') + '</h3>' +
|
|
1639
|
-
'<span class="section-count">' + ccwInstallations.length + ' ' + (ccwInstallations.length !== 1 ? t('ccw.installationsPlural') : t('ccw.installations')) + '</span>' +
|
|
1640
|
-
'</div>' +
|
|
1641
|
-
'<div class="section-header-actions">' +
|
|
1642
|
-
'<button class="btn-icon" onclick="showCcwInstallModal()" title="Add Installation">' +
|
|
1643
|
-
'<i data-lucide="plus" class="w-4 h-4"></i>' +
|
|
1644
|
-
'</button>' +
|
|
1645
|
-
'<button class="btn-icon" onclick="loadCcwInstallations().then(function() { renderCcwSection(); if (window.lucide) lucide.createIcons(); })" title="Refresh">' +
|
|
1646
|
-
'<i data-lucide="refresh-cw" class="w-4 h-4"></i>' +
|
|
1647
|
-
'</button>' +
|
|
1648
|
-
'</div>' +
|
|
1649
|
-
'</div>' +
|
|
1650
|
-
installationsHtml;
|
|
1651
|
-
|
|
1652
|
-
if (window.lucide) lucide.createIcons();
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
// ========== Language Settings State ==========
|
|
1656
|
-
var chineseResponseEnabled = false;
|
|
1657
|
-
var chineseResponseLoading = false;
|
|
1658
|
-
var codexChineseResponseEnabled = false;
|
|
1659
|
-
var codexChineseResponseLoading = false;
|
|
1660
|
-
var codexChineseNeedsMigration = false; // Track if Codex needs migration from old @ reference
|
|
1661
|
-
var codexCliEnhancementEnabled = false;
|
|
1662
|
-
var codexCliEnhancementLoading = false;
|
|
1663
|
-
var windowsPlatformEnabled = false;
|
|
1664
|
-
var windowsPlatformLoading = false;
|
|
1665
|
-
|
|
1666
|
-
// ========== Language Settings Section ==========
|
|
1667
|
-
async function loadLanguageSettings() {
|
|
1668
|
-
try {
|
|
1669
|
-
var response = await fetch('/api/language/chinese-response');
|
|
1670
|
-
if (!response.ok) throw new Error('Failed to load language settings');
|
|
1671
|
-
var data = await response.json();
|
|
1672
|
-
chineseResponseEnabled = data.claudeEnabled || data.enabled || false;
|
|
1673
|
-
codexChineseResponseEnabled = data.codexEnabled || false;
|
|
1674
|
-
codexChineseNeedsMigration = data.codexNeedsMigration || false; // Track migration status
|
|
1675
|
-
return data;
|
|
1676
|
-
} catch (err) {
|
|
1677
|
-
console.error('Failed to load language settings:', err);
|
|
1678
|
-
chineseResponseEnabled = false;
|
|
1679
|
-
codexChineseResponseEnabled = false;
|
|
1680
|
-
codexChineseNeedsMigration = false;
|
|
1681
|
-
return { claudeEnabled: false, codexEnabled: false, codexNeedsMigration: false, guidelinesExists: false };
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
async function loadWindowsPlatformSettings() {
|
|
1686
|
-
try {
|
|
1687
|
-
var response = await fetch('/api/language/windows-platform');
|
|
1688
|
-
if (!response.ok) throw new Error('Failed to load Windows platform settings');
|
|
1689
|
-
var data = await response.json();
|
|
1690
|
-
windowsPlatformEnabled = data.enabled || false;
|
|
1691
|
-
return data;
|
|
1692
|
-
} catch (err) {
|
|
1693
|
-
console.error('Failed to load Windows platform settings:', err);
|
|
1694
|
-
windowsPlatformEnabled = false;
|
|
1695
|
-
return { enabled: false, guidelinesExists: false };
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
async function loadCodexCliEnhancementSettings() {
|
|
1700
|
-
try {
|
|
1701
|
-
var response = await fetch('/api/language/codex-cli-enhancement');
|
|
1702
|
-
if (!response.ok) throw new Error('Failed to load Codex CLI enhancement settings');
|
|
1703
|
-
var data = await response.json();
|
|
1704
|
-
codexCliEnhancementEnabled = data.enabled || false;
|
|
1705
|
-
return data;
|
|
1706
|
-
} catch (err) {
|
|
1707
|
-
console.error('Failed to load Codex CLI enhancement settings:', err);
|
|
1708
|
-
codexCliEnhancementEnabled = false;
|
|
1709
|
-
return { enabled: false, guidelinesExists: false };
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1712
|
-
|
|
1713
|
-
async function toggleChineseResponse(enabled, target) {
|
|
1714
|
-
// target: 'claude' (default) or 'codex'
|
|
1715
|
-
target = target || 'claude';
|
|
1716
|
-
var isCodex = target === 'codex';
|
|
1717
|
-
var loadingVar = isCodex ? 'codexChineseResponseLoading' : 'chineseResponseLoading';
|
|
1718
|
-
|
|
1719
|
-
if (isCodex ? codexChineseResponseLoading : chineseResponseLoading) return;
|
|
1720
|
-
|
|
1721
|
-
// Pre-check: verify CCW workflows are installed (only when enabling)
|
|
1722
|
-
if (enabled && typeof ccwInstallStatus !== 'undefined' && !ccwInstallStatus.installed) {
|
|
1723
|
-
var missingFile = ccwInstallStatus.missingFiles.find(function(f) { return f === 'chinese-response.md'; });
|
|
1724
|
-
if (missingFile) {
|
|
1725
|
-
showRefreshToast(t('lang.installRequired'), 'warning');
|
|
1726
|
-
return;
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
if (isCodex) {
|
|
1731
|
-
codexChineseResponseLoading = true;
|
|
1732
|
-
} else {
|
|
1733
|
-
chineseResponseLoading = true;
|
|
1734
|
-
}
|
|
1735
|
-
|
|
1736
|
-
try {
|
|
1737
|
-
var response = await fetch('/api/language/chinese-response', {
|
|
1738
|
-
method: 'POST',
|
|
1739
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1740
|
-
body: JSON.stringify({ enabled: enabled, target: target })
|
|
1741
|
-
});
|
|
1742
|
-
|
|
1743
|
-
if (!response.ok) {
|
|
1744
|
-
var errData = await response.json();
|
|
1745
|
-
// Show specific error message from backend
|
|
1746
|
-
var errorMsg = errData.error || 'Failed to update setting';
|
|
1747
|
-
if (errorMsg.includes('not found')) {
|
|
1748
|
-
showRefreshToast(t('lang.installRequired'), 'warning');
|
|
1749
|
-
} else {
|
|
1750
|
-
showRefreshToast((enabled ? t('lang.enableFailed') : t('lang.disableFailed')) + ': ' + errorMsg, 'error');
|
|
1751
|
-
}
|
|
1752
|
-
throw new Error(errorMsg);
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
var data = await response.json();
|
|
1756
|
-
if (isCodex) {
|
|
1757
|
-
codexChineseResponseEnabled = data.enabled;
|
|
1758
|
-
// Handle migration status
|
|
1759
|
-
if (data.migrated) {
|
|
1760
|
-
codexChineseNeedsMigration = false;
|
|
1761
|
-
showRefreshToast('Codex: 已从 @ 引用迁移到直接文本拼接', 'success');
|
|
1762
|
-
}
|
|
1763
|
-
} else {
|
|
1764
|
-
chineseResponseEnabled = data.enabled;
|
|
1765
|
-
}
|
|
1766
|
-
|
|
1767
|
-
// Update UI
|
|
1768
|
-
renderLanguageSettingsSection();
|
|
1769
|
-
|
|
1770
|
-
// Show toast (skip if migration message already shown)
|
|
1771
|
-
var toolName = isCodex ? 'Codex' : 'Claude';
|
|
1772
|
-
if (!data.migrated) {
|
|
1773
|
-
showRefreshToast(toolName + ': ' + (enabled ? t('lang.enableSuccess') : t('lang.disableSuccess')), 'success');
|
|
1774
|
-
}
|
|
1775
|
-
} catch (err) {
|
|
1776
|
-
console.error('Failed to toggle Chinese response:', err);
|
|
1777
|
-
// Error already shown in the !response.ok block
|
|
1778
|
-
} finally {
|
|
1779
|
-
if (isCodex) {
|
|
1780
|
-
codexChineseResponseLoading = false;
|
|
1781
|
-
} else {
|
|
1782
|
-
chineseResponseLoading = false;
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
async function toggleWindowsPlatform(enabled) {
|
|
1788
|
-
if (windowsPlatformLoading) return;
|
|
1789
|
-
|
|
1790
|
-
// Pre-check: verify CCW workflows are installed (only when enabling)
|
|
1791
|
-
if (enabled && typeof ccwInstallStatus !== 'undefined' && !ccwInstallStatus.installed) {
|
|
1792
|
-
var missingFile = ccwInstallStatus.missingFiles.find(function(f) { return f === 'windows-platform.md'; });
|
|
1793
|
-
if (missingFile) {
|
|
1794
|
-
showRefreshToast(t('lang.installRequired'), 'warning');
|
|
1795
|
-
return;
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
windowsPlatformLoading = true;
|
|
1800
|
-
|
|
1801
|
-
try {
|
|
1802
|
-
var response = await fetch('/api/language/windows-platform', {
|
|
1803
|
-
method: 'POST',
|
|
1804
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1805
|
-
body: JSON.stringify({ enabled: enabled })
|
|
1806
|
-
});
|
|
1807
|
-
|
|
1808
|
-
if (!response.ok) {
|
|
1809
|
-
var errData = await response.json();
|
|
1810
|
-
// Show specific error message from backend
|
|
1811
|
-
var errorMsg = errData.error || 'Failed to update setting';
|
|
1812
|
-
if (errorMsg.includes('not found')) {
|
|
1813
|
-
showRefreshToast(t('lang.installRequired'), 'warning');
|
|
1814
|
-
} else {
|
|
1815
|
-
showRefreshToast((enabled ? t('lang.windowsEnableFailed') : t('lang.windowsDisableFailed')) + ': ' + errorMsg, 'error');
|
|
1816
|
-
}
|
|
1817
|
-
throw new Error(errorMsg);
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
var data = await response.json();
|
|
1821
|
-
windowsPlatformEnabled = data.enabled;
|
|
1822
|
-
|
|
1823
|
-
// Update UI
|
|
1824
|
-
renderLanguageSettingsSection();
|
|
1825
|
-
|
|
1826
|
-
// Show toast
|
|
1827
|
-
showRefreshToast(enabled ? t('lang.windowsEnableSuccess') : t('lang.windowsDisableSuccess'), 'success');
|
|
1828
|
-
} catch (err) {
|
|
1829
|
-
console.error('Failed to toggle Windows platform:', err);
|
|
1830
|
-
// Error already shown in the !response.ok block
|
|
1831
|
-
} finally {
|
|
1832
|
-
windowsPlatformLoading = false;
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
async function toggleCodexCliEnhancement(enabled) {
|
|
1837
|
-
if (codexCliEnhancementLoading) return;
|
|
1838
|
-
|
|
1839
|
-
// Pre-check: verify CCW workflows are installed (only when enabling)
|
|
1840
|
-
if (enabled && typeof ccwInstallStatus !== 'undefined' && !ccwInstallStatus.installed) {
|
|
1841
|
-
var missingFile = ccwInstallStatus.missingFiles.find(function(f) { return f === 'cli-tools-usage.md'; });
|
|
1842
|
-
if (missingFile) {
|
|
1843
|
-
showRefreshToast(t('lang.installRequired'), 'warning');
|
|
1844
|
-
return;
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
codexCliEnhancementLoading = true;
|
|
1849
|
-
|
|
1850
|
-
try {
|
|
1851
|
-
var response = await fetch('/api/language/codex-cli-enhancement', {
|
|
1852
|
-
method: 'POST',
|
|
1853
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1854
|
-
body: JSON.stringify({ enabled: enabled, action: 'toggle' })
|
|
1855
|
-
});
|
|
1856
|
-
|
|
1857
|
-
if (!response.ok) {
|
|
1858
|
-
var errData = await response.json();
|
|
1859
|
-
// Show specific error message from backend
|
|
1860
|
-
var errorMsg = errData.error || 'Failed to update setting';
|
|
1861
|
-
if (errorMsg.includes('not found')) {
|
|
1862
|
-
showRefreshToast(t('lang.installRequired'), 'warning');
|
|
1863
|
-
} else {
|
|
1864
|
-
showRefreshToast((enabled ? t('lang.enableFailed') : t('lang.disableFailed')) + ': ' + errorMsg, 'error');
|
|
1865
|
-
}
|
|
1866
|
-
throw new Error(errorMsg);
|
|
1867
|
-
}
|
|
1868
|
-
|
|
1869
|
-
var data = await response.json();
|
|
1870
|
-
codexCliEnhancementEnabled = data.enabled;
|
|
1871
|
-
|
|
1872
|
-
// Update UI
|
|
1873
|
-
renderLanguageSettingsSection();
|
|
1874
|
-
|
|
1875
|
-
// Show toast
|
|
1876
|
-
showRefreshToast('Codex CLI Enhancement: ' + (enabled ? t('lang.enableSuccess') : t('lang.disableSuccess')), 'success');
|
|
1877
|
-
} catch (err) {
|
|
1878
|
-
console.error('Failed to toggle Codex CLI enhancement:', err);
|
|
1879
|
-
// Error already shown in the !response.ok block
|
|
1880
|
-
} finally {
|
|
1881
|
-
codexCliEnhancementLoading = false;
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
async function refreshCodexCliEnhancement() {
|
|
1886
|
-
if (codexCliEnhancementLoading) return;
|
|
1887
|
-
|
|
1888
|
-
codexCliEnhancementLoading = true;
|
|
1889
|
-
|
|
1890
|
-
try {
|
|
1891
|
-
var response = await fetch('/api/language/codex-cli-enhancement', {
|
|
1892
|
-
method: 'POST',
|
|
1893
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1894
|
-
body: JSON.stringify({ action: 'refresh' })
|
|
1895
|
-
});
|
|
1896
|
-
|
|
1897
|
-
if (!response.ok) {
|
|
1898
|
-
var errData = await response.json();
|
|
1899
|
-
var errorMsg = errData.error || 'Failed to refresh setting';
|
|
1900
|
-
if (errorMsg.includes('not found')) {
|
|
1901
|
-
showRefreshToast(t('lang.installRequired'), 'warning');
|
|
1902
|
-
} else if (errorMsg.includes('not enabled')) {
|
|
1903
|
-
showRefreshToast('CLI 调用增强未启用', 'warning');
|
|
1904
|
-
} else {
|
|
1905
|
-
showRefreshToast('刷新失败: ' + errorMsg, 'error');
|
|
1906
|
-
}
|
|
1907
|
-
throw new Error(errorMsg);
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
var data = await response.json();
|
|
1911
|
-
|
|
1912
|
-
// Update UI
|
|
1913
|
-
renderLanguageSettingsSection();
|
|
1914
|
-
|
|
1915
|
-
// Show toast
|
|
1916
|
-
showRefreshToast('CLI 调用增强已刷新', 'success');
|
|
1917
|
-
} catch (err) {
|
|
1918
|
-
console.error('Failed to refresh Codex CLI enhancement:', err);
|
|
1919
|
-
// Error already shown in the !response.ok block
|
|
1920
|
-
} finally {
|
|
1921
|
-
codexCliEnhancementLoading = false;
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
async function renderLanguageSettingsSection() {
|
|
1926
|
-
var container = document.getElementById('language-settings-section');
|
|
1927
|
-
if (!container) return;
|
|
1928
|
-
|
|
1929
|
-
// Load current state if not loaded
|
|
1930
|
-
if (!chineseResponseEnabled && !codexChineseResponseEnabled && !chineseResponseLoading) {
|
|
1931
|
-
await loadLanguageSettings();
|
|
1932
|
-
}
|
|
1933
|
-
if (!windowsPlatformEnabled && !windowsPlatformLoading) {
|
|
1934
|
-
await loadWindowsPlatformSettings();
|
|
1935
|
-
}
|
|
1936
|
-
if (!codexCliEnhancementEnabled && !codexCliEnhancementLoading) {
|
|
1937
|
-
await loadCodexCliEnhancementSettings();
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
|
-
var settingsHtml = '<div class="section-header">' +
|
|
1941
|
-
'<div class="section-header-left">' +
|
|
1942
|
-
'<h3><i data-lucide="languages" class="w-4 h-4"></i> ' + t('lang.settings') + '</h3>' +
|
|
1943
|
-
'</div>' +
|
|
1944
|
-
'</div>' +
|
|
1945
|
-
'<div class="cli-settings-grid" style="grid-template-columns: 1fr 1fr;">' +
|
|
1946
|
-
// Chinese Response - Claude
|
|
1947
|
-
'<div class="cli-setting-item">' +
|
|
1948
|
-
'<label class="cli-setting-label">' +
|
|
1949
|
-
'<i data-lucide="message-square-text" class="w-3 h-3"></i>' +
|
|
1950
|
-
t('lang.chinese') + ' <span class="badge badge-sm badge-primary">Claude</span>' +
|
|
1951
|
-
'</label>' +
|
|
1952
|
-
'<div class="cli-setting-control">' +
|
|
1953
|
-
'<label class="cli-toggle">' +
|
|
1954
|
-
'<input type="checkbox"' + (chineseResponseEnabled ? ' checked' : '') + ' onchange="toggleChineseResponse(this.checked, \'claude\')"' + (chineseResponseLoading ? ' disabled' : '') + '>' +
|
|
1955
|
-
'<span class="cli-toggle-slider"></span>' +
|
|
1956
|
-
'</label>' +
|
|
1957
|
-
'<span class="cli-setting-status ' + (chineseResponseEnabled ? 'enabled' : 'disabled') + '">' +
|
|
1958
|
-
(chineseResponseEnabled ? t('lang.enabled') : t('lang.disabled')) +
|
|
1959
|
-
'</span>' +
|
|
1960
|
-
'</div>' +
|
|
1961
|
-
'<p class="cli-setting-desc">' + t('lang.chineseDescClaude') + '</p>' +
|
|
1962
|
-
'</div>' +
|
|
1963
|
-
// Chinese Response - Codex
|
|
1964
|
-
'<div class="cli-setting-item">' +
|
|
1965
|
-
'<label class="cli-setting-label">' +
|
|
1966
|
-
'<i data-lucide="message-square-text" class="w-3 h-3"></i>' +
|
|
1967
|
-
t('lang.chinese') + ' <span class="badge badge-sm badge-secondary">Codex</span>' +
|
|
1968
|
-
'</label>' +
|
|
1969
|
-
'<div class="cli-setting-control">' +
|
|
1970
|
-
'<label class="cli-toggle">' +
|
|
1971
|
-
'<input type="checkbox"' + (codexChineseResponseEnabled ? ' checked' : '') + ' onchange="toggleChineseResponse(this.checked, \'codex\')"' + (codexChineseResponseLoading ? ' disabled' : '') + '>' +
|
|
1972
|
-
'<span class="cli-toggle-slider"></span>' +
|
|
1973
|
-
'</label>' +
|
|
1974
|
-
'<span class="cli-setting-status ' + (codexChineseResponseEnabled ? 'enabled' : 'disabled') + '">' +
|
|
1975
|
-
(codexChineseResponseEnabled ? t('lang.enabled') : t('lang.disabled')) +
|
|
1976
|
-
'</span>' +
|
|
1977
|
-
'</div>' +
|
|
1978
|
-
'<p class="cli-setting-desc">' + t('lang.chineseDescCodex') +
|
|
1979
|
-
(codexChineseNeedsMigration ? '<br><span style="color: #f59e0b; font-size: 0.85em;">⚠️ 检测到旧格式(@引用),请关闭后重新启用以迁移到新格式</span>' : '') +
|
|
1980
|
-
'</p>' +
|
|
1981
|
-
'</div>' +
|
|
1982
|
-
// Windows Platform
|
|
1983
|
-
'<div class="cli-setting-item">' +
|
|
1984
|
-
'<label class="cli-setting-label">' +
|
|
1985
|
-
'<i data-lucide="monitor" class="w-3 h-3"></i>' +
|
|
1986
|
-
t('lang.windows') +
|
|
1987
|
-
'</label>' +
|
|
1988
|
-
'<div class="cli-setting-control">' +
|
|
1989
|
-
'<label class="cli-toggle">' +
|
|
1990
|
-
'<input type="checkbox"' + (windowsPlatformEnabled ? ' checked' : '') + ' onchange="toggleWindowsPlatform(this.checked)"' + (windowsPlatformLoading ? ' disabled' : '') + '>' +
|
|
1991
|
-
'<span class="cli-toggle-slider"></span>' +
|
|
1992
|
-
'</label>' +
|
|
1993
|
-
'<span class="cli-setting-status ' + (windowsPlatformEnabled ? 'enabled' : 'disabled') + '">' +
|
|
1994
|
-
(windowsPlatformEnabled ? t('lang.enabled') : t('lang.disabled')) +
|
|
1995
|
-
'</span>' +
|
|
1996
|
-
'</div>' +
|
|
1997
|
-
'<p class="cli-setting-desc">' + t('lang.windowsDesc') + '</p>' +
|
|
1998
|
-
'</div>' +
|
|
1999
|
-
// CLI Enhancement - Codex
|
|
2000
|
-
'<div class="cli-setting-item">' +
|
|
2001
|
-
'<label class="cli-setting-label">' +
|
|
2002
|
-
'<i data-lucide="terminal" class="w-3 h-3"></i>' +
|
|
2003
|
-
'CLI 调用增强 <span class="badge badge-sm badge-secondary">Codex</span>' +
|
|
2004
|
-
'</label>' +
|
|
2005
|
-
'<div class="cli-setting-control">' +
|
|
2006
|
-
'<label class="cli-toggle">' +
|
|
2007
|
-
'<input type="checkbox"' + (codexCliEnhancementEnabled ? ' checked' : '') + ' onchange="toggleCodexCliEnhancement(this.checked)"' + (codexCliEnhancementLoading ? ' disabled' : '') + '>' +
|
|
2008
|
-
'<span class="cli-toggle-slider"></span>' +
|
|
2009
|
-
'</label>' +
|
|
2010
|
-
'<span class="cli-setting-status ' + (codexCliEnhancementEnabled ? 'enabled' : 'disabled') + '">' +
|
|
2011
|
-
(codexCliEnhancementEnabled ? t('lang.enabled') : t('lang.disabled')) +
|
|
2012
|
-
'</span>' +
|
|
2013
|
-
(codexCliEnhancementEnabled ?
|
|
2014
|
-
'<button class="btn-icon-sm" onclick="refreshCodexCliEnhancement()" title="刷新 CLI 配置"' + (codexCliEnhancementLoading ? ' disabled' : '') + '>' +
|
|
2015
|
-
'<i data-lucide="refresh-cw" class="w-3 h-3"></i>' +
|
|
2016
|
-
'</button>'
|
|
2017
|
-
: '') +
|
|
2018
|
-
'</div>' +
|
|
2019
|
-
'<p class="cli-setting-desc">为 Codex 启用多 CLI 工具调用功能,自动拼接 cli-tools-usage.md 和 cli-tools.json 配置' +
|
|
2020
|
-
(codexCliEnhancementEnabled ? '<br><span style="color: var(--text-muted); font-size: 0.85em;">💡 配置文件变更后,点击刷新按钮更新内容</span>' : '') +
|
|
2021
|
-
'</p>' +
|
|
2022
|
-
'</div>' +
|
|
2023
|
-
'</div>';
|
|
2024
|
-
|
|
2025
|
-
container.innerHTML = settingsHtml;
|
|
2026
|
-
if (window.lucide) lucide.createIcons();
|
|
2027
|
-
}
|
|
2028
|
-
|
|
2029
|
-
// ========== CLI Settings Section (Full Width) ==========
|
|
2030
|
-
function renderCliSettingsSection() {
|
|
2031
|
-
var container = document.getElementById('cli-settings-section');
|
|
2032
|
-
if (!container) return;
|
|
2033
|
-
|
|
2034
|
-
var settingsHtml = '<div class="section-header">' +
|
|
2035
|
-
'<div class="section-header-left">' +
|
|
2036
|
-
'<h3><i data-lucide="settings" class="w-4 h-4"></i> ' + t('cli.settings') + '</h3>' +
|
|
2037
|
-
'</div>' +
|
|
2038
|
-
'</div>' +
|
|
2039
|
-
'<div class="cli-settings-grid">' +
|
|
2040
|
-
'<div class="cli-setting-item">' +
|
|
2041
|
-
'<label class="cli-setting-label">' +
|
|
2042
|
-
'<i data-lucide="layers" class="w-3 h-3"></i>' +
|
|
2043
|
-
t('cli.promptFormat') +
|
|
2044
|
-
'</label>' +
|
|
2045
|
-
'<div class="cli-setting-control">' +
|
|
2046
|
-
'<select class="cli-setting-select" onchange="setPromptFormat(this.value)">' +
|
|
2047
|
-
'<option value="plain"' + (promptConcatFormat === 'plain' ? ' selected' : '') + '>Plain Text</option>' +
|
|
2048
|
-
'<option value="yaml"' + (promptConcatFormat === 'yaml' ? ' selected' : '') + '>YAML</option>' +
|
|
2049
|
-
'<option value="json"' + (promptConcatFormat === 'json' ? ' selected' : '') + '>JSON</option>' +
|
|
2050
|
-
'</select>' +
|
|
2051
|
-
'</div>' +
|
|
2052
|
-
'<p class="cli-setting-desc">' + t('cli.promptFormatDesc') + '</p>' +
|
|
2053
|
-
'</div>' +
|
|
2054
|
-
'<div class="cli-setting-item">' +
|
|
2055
|
-
'<label class="cli-setting-label">' +
|
|
2056
|
-
'<i data-lucide="database" class="w-3 h-3"></i>' +
|
|
2057
|
-
t('cli.storageBackend') +
|
|
2058
|
-
'</label>' +
|
|
2059
|
-
'<div class="cli-setting-control">' +
|
|
2060
|
-
'<span class="cli-setting-value">SQLite</span>' +
|
|
2061
|
-
'</div>' +
|
|
2062
|
-
'<p class="cli-setting-desc">' + t('cli.storageBackendDesc') + '</p>' +
|
|
2063
|
-
'</div>' +
|
|
2064
|
-
'<div class="cli-setting-item">' +
|
|
2065
|
-
'<label class="cli-setting-label">' +
|
|
2066
|
-
'<i data-lucide="sparkles" class="w-3 h-3"></i>' +
|
|
2067
|
-
t('cli.smartContext') +
|
|
2068
|
-
'</label>' +
|
|
2069
|
-
'<div class="cli-setting-control">' +
|
|
2070
|
-
'<label class="cli-toggle">' +
|
|
2071
|
-
'<input type="checkbox"' + (smartContextEnabled ? ' checked' : '') + ' onchange="setSmartContextEnabled(this.checked)">' +
|
|
2072
|
-
'<span class="cli-toggle-slider"></span>' +
|
|
2073
|
-
'</label>' +
|
|
2074
|
-
'</div>' +
|
|
2075
|
-
'<p class="cli-setting-desc">' + t('cli.smartContextDesc') + '</p>' +
|
|
2076
|
-
'</div>' +
|
|
2077
|
-
'<div class="cli-setting-item">' +
|
|
2078
|
-
'<label class="cli-setting-label">' +
|
|
2079
|
-
'<i data-lucide="refresh-cw" class="w-3 h-3"></i>' +
|
|
2080
|
-
t('cli.nativeResume') +
|
|
2081
|
-
'</label>' +
|
|
2082
|
-
'<div class="cli-setting-control">' +
|
|
2083
|
-
'<label class="cli-toggle">' +
|
|
2084
|
-
'<input type="checkbox"' + (nativeResumeEnabled ? ' checked' : '') + ' onchange="setNativeResumeEnabled(this.checked)">' +
|
|
2085
|
-
'<span class="cli-toggle-slider"></span>' +
|
|
2086
|
-
'</label>' +
|
|
2087
|
-
'</div>' +
|
|
2088
|
-
'<p class="cli-setting-desc">' + t('cli.nativeResumeDesc') + '</p>' +
|
|
2089
|
-
'</div>' +
|
|
2090
|
-
'<div class="cli-setting-item">' +
|
|
2091
|
-
'<label class="cli-setting-label">' +
|
|
2092
|
-
'<i data-lucide="git-branch" class="w-3 h-3"></i>' +
|
|
2093
|
-
t('cli.recursiveQuery') +
|
|
2094
|
-
'</label>' +
|
|
2095
|
-
'<div class="cli-setting-control">' +
|
|
2096
|
-
'<label class="cli-toggle">' +
|
|
2097
|
-
'<input type="checkbox"' + (recursiveQueryEnabled ? ' checked' : '') + ' onchange="setRecursiveQueryEnabled(this.checked)">' +
|
|
2098
|
-
'<span class="cli-toggle-slider"></span>' +
|
|
2099
|
-
'</label>' +
|
|
2100
|
-
'</div>' +
|
|
2101
|
-
'<p class="cli-setting-desc">' + t('cli.recursiveQueryDesc') + '</p>' +
|
|
2102
|
-
'</div>' +
|
|
2103
|
-
'<div class="cli-setting-item' + (!smartContextEnabled ? ' disabled' : '') + '">' +
|
|
2104
|
-
'<label class="cli-setting-label">' +
|
|
2105
|
-
'<i data-lucide="files" class="w-3 h-3"></i>' +
|
|
2106
|
-
t('cli.maxContextFiles') +
|
|
2107
|
-
'</label>' +
|
|
2108
|
-
'<div class="cli-setting-control">' +
|
|
2109
|
-
'<select class="cli-setting-select" onchange="setSmartContextMaxFiles(this.value)"' + (!smartContextEnabled ? ' disabled' : '') + '>' +
|
|
2110
|
-
'<option value="5"' + (smartContextMaxFiles === 5 ? ' selected' : '') + '>5 files</option>' +
|
|
2111
|
-
'<option value="10"' + (smartContextMaxFiles === 10 ? ' selected' : '') + '>10 files</option>' +
|
|
2112
|
-
'<option value="20"' + (smartContextMaxFiles === 20 ? ' selected' : '') + '>20 files</option>' +
|
|
2113
|
-
'</select>' +
|
|
2114
|
-
'</div>' +
|
|
2115
|
-
'<p class="cli-setting-desc">' + t('cli.maxContextFilesDesc') + '</p>' +
|
|
2116
|
-
'</div>' +
|
|
2117
|
-
'</div>';
|
|
2118
|
-
|
|
2119
|
-
container.innerHTML = settingsHtml;
|
|
2120
|
-
if (window.lucide) lucide.createIcons();
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
// ========== CCW Endpoint Tools Section (Full Width) ==========
|
|
2124
|
-
function renderCcwEndpointToolsSection() {
|
|
2125
|
-
var container = document.getElementById('ccw-endpoint-tools-section');
|
|
2126
|
-
if (!container) return;
|
|
2127
|
-
|
|
2128
|
-
var count = (ccwEndpointTools || []).length;
|
|
2129
|
-
var toolsHtml = '';
|
|
2130
|
-
|
|
2131
|
-
if (!ccwEndpointTools || ccwEndpointTools.length === 0) {
|
|
2132
|
-
toolsHtml = '<div class="ccw-empty-state">' +
|
|
2133
|
-
'<i data-lucide="wrench" class="w-8 h-8"></i>' +
|
|
2134
|
-
'<p>' + t('ccw.noEndpointTools') + '</p>' +
|
|
2135
|
-
'<button class="btn btn-sm btn-primary" onclick="loadCcwEndpointTools().then(function() { renderCcwEndpointToolsSection(); if (window.lucide) lucide.createIcons(); })">' +
|
|
2136
|
-
'<i data-lucide="refresh-cw" class="w-3 h-3"></i> ' + t('common.refresh') + '</button>' +
|
|
2137
|
-
'</div>';
|
|
2138
|
-
} else {
|
|
2139
|
-
toolsHtml = '<div class="endpoint-tools-grid">' +
|
|
2140
|
-
ccwEndpointTools.map(function(t, idx) {
|
|
2141
|
-
var name = t && t.name ? String(t.name) : 'unknown';
|
|
2142
|
-
var desc = t && t.description ? String(t.description) : '';
|
|
2143
|
-
var requiredCount = (t && t.parameters && Array.isArray(t.parameters.required)) ? t.parameters.required.length : 0;
|
|
2144
|
-
var propsCount = (t && t.parameters && t.parameters.properties) ? Object.keys(t.parameters.properties).length : 0;
|
|
2145
|
-
var shortDesc = desc.length > 60 ? desc.substring(0, 60) + '...' : desc;
|
|
2146
|
-
|
|
2147
|
-
return '<div class="endpoint-tool-card" onclick="showEndpointToolDetail(' + idx + ')">' +
|
|
2148
|
-
'<div class="endpoint-tool-header">' +
|
|
2149
|
-
'<span class="endpoint-tool-dot"></span>' +
|
|
2150
|
-
'<span class="endpoint-tool-name">' + escapeHtml(name) + '</span>' +
|
|
2151
|
-
'</div>' +
|
|
2152
|
-
'<div class="endpoint-tool-desc">' + escapeHtml(shortDesc || 'No description') + '</div>' +
|
|
2153
|
-
'<div class="endpoint-tool-meta">' +
|
|
2154
|
-
'<span class="endpoint-tool-params">' +
|
|
2155
|
-
'<i data-lucide="braces" class="w-3 h-3"></i> ' + propsCount +
|
|
2156
|
-
'</span>' +
|
|
2157
|
-
(requiredCount > 0 ? '<span class="endpoint-tool-required">' + requiredCount + ' required</span>' : '') +
|
|
2158
|
-
'</div>' +
|
|
2159
|
-
'</div>';
|
|
2160
|
-
}).join('') +
|
|
2161
|
-
'</div>';
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
container.innerHTML = '<div class="section-header">' +
|
|
2165
|
-
'<div class="section-header-left">' +
|
|
2166
|
-
'<h3><i data-lucide="server" class="w-4 h-4"></i> ' + t('ccw.endpointTools') + '</h3>' +
|
|
2167
|
-
'<span class="section-count">' + count + ' ' + (count !== 1 ? t('ccw.tools') : t('ccw.tool')) + '</span>' +
|
|
2168
|
-
'</div>' +
|
|
2169
|
-
'<button class="btn-icon" onclick="loadCcwEndpointTools().then(function() { renderCcwEndpointToolsSection(); if (window.lucide) lucide.createIcons(); })" title="Refresh">' +
|
|
2170
|
-
'<i data-lucide="refresh-cw" class="w-4 h-4"></i>' +
|
|
2171
|
-
'</button>' +
|
|
2172
|
-
'</div>' +
|
|
2173
|
-
toolsHtml;
|
|
2174
|
-
|
|
2175
|
-
if (window.lucide) lucide.createIcons();
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
// ========== Endpoint Tool Detail Modal ==========
|
|
2179
|
-
function showEndpointToolDetail(toolIndex) {
|
|
2180
|
-
var tool = ccwEndpointTools[toolIndex];
|
|
2181
|
-
if (!tool) return;
|
|
2182
|
-
|
|
2183
|
-
var name = tool.name || 'unknown';
|
|
2184
|
-
var desc = tool.description || 'No description available';
|
|
2185
|
-
var params = tool.parameters || {};
|
|
2186
|
-
var properties = params.properties || {};
|
|
2187
|
-
var required = params.required || [];
|
|
2188
|
-
|
|
2189
|
-
// Build parameters table
|
|
2190
|
-
var paramsHtml = '';
|
|
2191
|
-
var propKeys = Object.keys(properties);
|
|
2192
|
-
|
|
2193
|
-
if (propKeys.length > 0) {
|
|
2194
|
-
paramsHtml = '<div class="tool-detail-params">' +
|
|
2195
|
-
'<h4><i data-lucide="settings-2" class="w-4 h-4"></i> Parameters</h4>' +
|
|
2196
|
-
'<div class="tool-params-list">';
|
|
2197
|
-
|
|
2198
|
-
for (var i = 0; i < propKeys.length; i++) {
|
|
2199
|
-
var key = propKeys[i];
|
|
2200
|
-
var prop = properties[key];
|
|
2201
|
-
var isRequired = required.indexOf(key) !== -1;
|
|
2202
|
-
var propType = prop.type || 'any';
|
|
2203
|
-
var propDesc = prop.description || '';
|
|
2204
|
-
var propDefault = prop.default !== undefined ? JSON.stringify(prop.default) : null;
|
|
2205
|
-
var propEnum = prop.enum ? prop.enum.join(', ') : null;
|
|
2206
|
-
|
|
2207
|
-
paramsHtml += '<div class="tool-param-item">' +
|
|
2208
|
-
'<div class="tool-param-header">' +
|
|
2209
|
-
'<code class="tool-param-name">' + escapeHtml(key) + '</code>' +
|
|
2210
|
-
'<span class="tool-param-type">' + escapeHtml(propType) + '</span>' +
|
|
2211
|
-
(isRequired ? '<span class="tool-param-required">required</span>' : '<span class="tool-param-optional">optional</span>') +
|
|
2212
|
-
'</div>' +
|
|
2213
|
-
(propDesc ? '<div class="tool-param-desc">' + escapeHtml(propDesc) + '</div>' : '') +
|
|
2214
|
-
(propDefault ? '<div class="tool-param-default">Default: <code>' + escapeHtml(propDefault) + '</code></div>' : '') +
|
|
2215
|
-
(propEnum ? '<div class="tool-param-enum">Options: <code>' + escapeHtml(propEnum) + '</code></div>' : '') +
|
|
2216
|
-
'</div>';
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
|
-
paramsHtml += '</div></div>';
|
|
2220
|
-
} else {
|
|
2221
|
-
paramsHtml = '<div class="tool-detail-no-params">' +
|
|
2222
|
-
'<i data-lucide="info" class="w-4 h-4"></i>' +
|
|
2223
|
-
'<span>This tool has no parameters</span>' +
|
|
2224
|
-
'</div>';
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
// Usage example
|
|
2228
|
-
var usageExample = 'ccw tool exec ' + name;
|
|
2229
|
-
if (propKeys.length > 0) {
|
|
2230
|
-
var exampleParams = {};
|
|
2231
|
-
for (var j = 0; j < Math.min(propKeys.length, 2); j++) {
|
|
2232
|
-
var k = propKeys[j];
|
|
2233
|
-
var p = properties[k];
|
|
2234
|
-
if (p.type === 'string') exampleParams[k] = '<value>';
|
|
2235
|
-
else if (p.type === 'boolean') exampleParams[k] = true;
|
|
2236
|
-
else if (p.type === 'number') exampleParams[k] = 0;
|
|
2237
|
-
else exampleParams[k] = '<value>';
|
|
2238
|
-
}
|
|
2239
|
-
usageExample += " '" + JSON.stringify(exampleParams) + "'";
|
|
2240
|
-
}
|
|
2241
|
-
|
|
2242
|
-
var modalContent = '<div class="tool-detail-modal">' +
|
|
2243
|
-
'<div class="tool-detail-header">' +
|
|
2244
|
-
'<div class="tool-detail-icon"><i data-lucide="terminal" class="w-6 h-6"></i></div>' +
|
|
2245
|
-
'<div class="tool-detail-title">' +
|
|
2246
|
-
'<h3>' + escapeHtml(name) + '</h3>' +
|
|
2247
|
-
'<span class="tool-detail-badge">endpoint tool</span>' +
|
|
2248
|
-
'</div>' +
|
|
2249
|
-
'</div>' +
|
|
2250
|
-
'<div class="tool-detail-desc">' + escapeHtml(desc) + '</div>' +
|
|
2251
|
-
paramsHtml +
|
|
2252
|
-
'<div class="tool-detail-usage">' +
|
|
2253
|
-
'<h4><i data-lucide="terminal-square" class="w-4 h-4"></i> Usage Example</h4>' +
|
|
2254
|
-
'<div class="tool-usage-code">' +
|
|
2255
|
-
'<code>' + escapeHtml(usageExample) + '</code>' +
|
|
2256
|
-
'<button class="tool-copy-btn" onclick="copyToolUsage(this, \'' + escapeHtml(usageExample.replace(/'/g, "\\'")) + '\')" title="Copy">' +
|
|
2257
|
-
'<i data-lucide="copy" class="w-3.5 h-3.5"></i>' +
|
|
2258
|
-
'</button>' +
|
|
2259
|
-
'</div>' +
|
|
2260
|
-
'</div>' +
|
|
2261
|
-
'</div>';
|
|
2262
|
-
|
|
2263
|
-
showModal(name, modalContent, { size: 'lg' });
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
function copyToolUsage(btn, text) {
|
|
2267
|
-
navigator.clipboard.writeText(text).then(function() {
|
|
2268
|
-
var icon = btn.querySelector('i');
|
|
2269
|
-
if (icon) {
|
|
2270
|
-
icon.setAttribute('data-lucide', 'check');
|
|
2271
|
-
if (window.lucide) lucide.createIcons();
|
|
2272
|
-
setTimeout(function() {
|
|
2273
|
-
icon.setAttribute('data-lucide', 'copy');
|
|
2274
|
-
if (window.lucide) lucide.createIcons();
|
|
2275
|
-
}, 2000);
|
|
2276
|
-
}
|
|
2277
|
-
});
|
|
2278
|
-
}
|
|
2279
|
-
|
|
2280
|
-
// CCW Install Carousel State
|
|
2281
|
-
var ccwCarouselIndex = 0;
|
|
2282
|
-
|
|
2283
|
-
function renderCcwInstallPanel() {
|
|
2284
|
-
var container = document.getElementById('ccw-install-panel');
|
|
2285
|
-
if (!container) return;
|
|
2286
|
-
|
|
2287
|
-
var html = '<div class="cli-status-header"><h3><i data-lucide="package" class="w-4 h-4"></i> CCW Installations</h3>' +
|
|
2288
|
-
'<div class="ccw-header-actions">' +
|
|
2289
|
-
'<button class="btn-icon" onclick="showCcwInstallModal()" title="Add Installation">' +
|
|
2290
|
-
'<i data-lucide="plus" class="w-4 h-4"></i></button>' +
|
|
2291
|
-
'<button class="btn-icon" onclick="loadCcwInstallations().then(function() { renderCcwInstallPanel(); })" title="Refresh">' +
|
|
2292
|
-
'<i data-lucide="refresh-cw" class="w-4 h-4"></i></button>' +
|
|
2293
|
-
'</div></div>' +
|
|
2294
|
-
'<div class="ccw-install-content">';
|
|
2295
|
-
|
|
2296
|
-
if (ccwInstallations.length === 0) {
|
|
2297
|
-
html += '<div class="ccw-empty-state">' +
|
|
2298
|
-
'<i data-lucide="package-x" class="w-8 h-8"></i>' +
|
|
2299
|
-
'<p>No installations found</p>' +
|
|
2300
|
-
'<button class="btn btn-sm btn-primary" onclick="showCcwInstallModal()">' +
|
|
2301
|
-
'<i data-lucide="download" class="w-3 h-3"></i> Install CCW</button></div>';
|
|
2302
|
-
} else {
|
|
2303
|
-
// Carousel container
|
|
2304
|
-
html += '<div class="ccw-carousel-wrapper">';
|
|
2305
|
-
|
|
2306
|
-
// Left arrow (show only if more than 1 installation)
|
|
2307
|
-
if (ccwInstallations.length > 1) {
|
|
2308
|
-
html += '<button class="ccw-carousel-btn ccw-carousel-prev" onclick="ccwCarouselPrev()" title="Previous">' +
|
|
2309
|
-
'<i data-lucide="chevron-left" class="w-4 h-4"></i></button>';
|
|
2310
|
-
}
|
|
2311
|
-
|
|
2312
|
-
html += '<div class="ccw-carousel-track" id="ccwCarouselTrack">';
|
|
2313
|
-
|
|
2314
|
-
for (var i = 0; i < ccwInstallations.length; i++) {
|
|
2315
|
-
var inst = ccwInstallations[i];
|
|
2316
|
-
var isGlobal = inst.installation_mode === 'Global';
|
|
2317
|
-
var modeIcon = isGlobal ? 'home' : 'folder';
|
|
2318
|
-
var version = inst.application_version || 'unknown';
|
|
2319
|
-
var installDate = new Date(inst.installation_date).toLocaleDateString();
|
|
2320
|
-
var activeClass = i === ccwCarouselIndex ? 'active' : '';
|
|
2321
|
-
|
|
2322
|
-
html += '<div class="ccw-carousel-card ' + activeClass + '" data-index="' + i + '">' +
|
|
2323
|
-
'<div class="ccw-card-header">' +
|
|
2324
|
-
'<div class="ccw-card-mode ' + (isGlobal ? 'global' : 'path') + '">' +
|
|
2325
|
-
'<i data-lucide="' + modeIcon + '" class="w-4 h-4"></i>' +
|
|
2326
|
-
'<span>' + inst.installation_mode + '</span>' +
|
|
2327
|
-
'</div>' +
|
|
2328
|
-
'<div class="ccw-card-header-right">' +
|
|
2329
|
-
'<span class="ccw-version-tag">v' + version + '</span>' +
|
|
2330
|
-
'<button class="btn-icon btn-icon-sm" onclick="runCcwUpgrade()" title="Upgrade">' +
|
|
2331
|
-
'<i data-lucide="arrow-up-circle" class="w-3.5 h-3.5"></i></button>' +
|
|
2332
|
-
'<button class="btn-icon btn-icon-sm btn-danger" onclick="confirmCcwUninstall(\'' + escapeHtml(inst.installation_path) + '\')" title="Uninstall">' +
|
|
2333
|
-
'<i data-lucide="trash-2" class="w-3.5 h-3.5"></i></button>' +
|
|
2334
|
-
'</div>' +
|
|
2335
|
-
'</div>' +
|
|
2336
|
-
'<div class="ccw-card-path" title="' + inst.installation_path + '">' + escapeHtml(inst.installation_path) + '</div>' +
|
|
2337
|
-
'<div class="ccw-card-meta">' +
|
|
2338
|
-
'<span><i data-lucide="calendar" class="w-3 h-3"></i> ' + installDate + '</span>' +
|
|
2339
|
-
'<span><i data-lucide="file" class="w-3 h-3"></i> ' + (inst.files_count || 0) + ' files</span>' +
|
|
2340
|
-
'</div>' +
|
|
2341
|
-
'</div>';
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
html += '</div>';
|
|
2345
|
-
|
|
2346
|
-
// Right arrow (show only if more than 1 installation)
|
|
2347
|
-
if (ccwInstallations.length > 1) {
|
|
2348
|
-
html += '<button class="ccw-carousel-btn ccw-carousel-next" onclick="ccwCarouselNext()" title="Next">' +
|
|
2349
|
-
'<i data-lucide="chevron-right" class="w-4 h-4"></i></button>';
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
|
-
html += '</div>';
|
|
2353
|
-
|
|
2354
|
-
// Dots indicator (show only if more than 1 installation)
|
|
2355
|
-
if (ccwInstallations.length > 1) {
|
|
2356
|
-
html += '<div class="ccw-carousel-dots">';
|
|
2357
|
-
for (var j = 0; j < ccwInstallations.length; j++) {
|
|
2358
|
-
var dotActive = j === ccwCarouselIndex ? 'active' : '';
|
|
2359
|
-
html += '<button class="ccw-carousel-dot ' + dotActive + '" onclick="ccwCarouselGoTo(' + j + ')"></button>';
|
|
2360
|
-
}
|
|
2361
|
-
html += '</div>';
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
html += '</div>';
|
|
2366
|
-
container.innerHTML = html;
|
|
2367
|
-
if (window.lucide) lucide.createIcons();
|
|
2368
|
-
|
|
2369
|
-
// Update carousel position
|
|
2370
|
-
updateCcwCarouselPosition();
|
|
2371
|
-
}
|
|
2372
|
-
|
|
2373
|
-
function ccwCarouselPrev() {
|
|
2374
|
-
if (ccwCarouselIndex > 0) {
|
|
2375
|
-
ccwCarouselIndex--;
|
|
2376
|
-
updateCcwCarouselPosition();
|
|
2377
|
-
updateCcwCarouselDots();
|
|
2378
|
-
}
|
|
2379
|
-
}
|
|
2380
|
-
|
|
2381
|
-
function ccwCarouselNext() {
|
|
2382
|
-
if (ccwCarouselIndex < ccwInstallations.length - 1) {
|
|
2383
|
-
ccwCarouselIndex++;
|
|
2384
|
-
updateCcwCarouselPosition();
|
|
2385
|
-
updateCcwCarouselDots();
|
|
2386
|
-
}
|
|
2387
|
-
}
|
|
2388
|
-
|
|
2389
|
-
function ccwCarouselGoTo(index) {
|
|
2390
|
-
ccwCarouselIndex = index;
|
|
2391
|
-
updateCcwCarouselPosition();
|
|
2392
|
-
updateCcwCarouselDots();
|
|
2393
|
-
}
|
|
2394
|
-
|
|
2395
|
-
function updateCcwCarouselPosition() {
|
|
2396
|
-
var track = document.getElementById('ccwCarouselTrack');
|
|
2397
|
-
if (track) {
|
|
2398
|
-
track.style.transform = 'translateX(-' + (ccwCarouselIndex * 100) + '%)';
|
|
2399
|
-
}
|
|
2400
|
-
|
|
2401
|
-
// Update card active states
|
|
2402
|
-
var cards = document.querySelectorAll('.ccw-carousel-card');
|
|
2403
|
-
cards.forEach(function(card, idx) {
|
|
2404
|
-
card.classList.toggle('active', idx === ccwCarouselIndex);
|
|
2405
|
-
});
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2408
|
-
function updateCcwCarouselDots() {
|
|
2409
|
-
var dots = document.querySelectorAll('.ccw-carousel-dot');
|
|
2410
|
-
dots.forEach(function(dot, idx) {
|
|
2411
|
-
dot.classList.toggle('active', idx === ccwCarouselIndex);
|
|
2412
|
-
});
|
|
2413
|
-
}
|
|
2414
|
-
|
|
2415
|
-
// CCW Install Modal
|
|
2416
|
-
function showCcwInstallModal() {
|
|
2417
|
-
var modalContent = '<div class="ccw-install-modal">' +
|
|
2418
|
-
'<div class="ccw-install-options">' +
|
|
2419
|
-
'<div class="ccw-install-option" onclick="selectCcwInstallMode(\'Global\')">' +
|
|
2420
|
-
'<div class="ccw-option-icon global"><i data-lucide="home" class="w-6 h-6"></i></div>' +
|
|
2421
|
-
'<div class="ccw-option-info">' +
|
|
2422
|
-
'<div class="ccw-option-title">Global Installation</div>' +
|
|
2423
|
-
'<div class="ccw-option-desc">Install to user home directory (~/.claude)</div>' +
|
|
2424
|
-
'</div>' +
|
|
2425
|
-
'<i data-lucide="chevron-right" class="w-4 h-4 text-muted-foreground"></i>' +
|
|
2426
|
-
'</div>' +
|
|
2427
|
-
'<div class="ccw-install-option" onclick="toggleCcwPathInput()">' +
|
|
2428
|
-
'<div class="ccw-option-icon path"><i data-lucide="folder" class="w-6 h-6"></i></div>' +
|
|
2429
|
-
'<div class="ccw-option-info">' +
|
|
2430
|
-
'<div class="ccw-option-title">Path Installation</div>' +
|
|
2431
|
-
'<div class="ccw-option-desc">Install to a specific project folder</div>' +
|
|
2432
|
-
'</div>' +
|
|
2433
|
-
'<i data-lucide="chevron-right" class="w-4 h-4 text-muted-foreground"></i>' +
|
|
2434
|
-
'</div>' +
|
|
2435
|
-
'</div>' +
|
|
2436
|
-
'<div class="ccw-path-input-section hidden" id="ccwPathInputSection">' +
|
|
2437
|
-
'<div class="ccw-path-input-group">' +
|
|
2438
|
-
'<label>Installation Path</label>' +
|
|
2439
|
-
'<input type="text" id="ccwInstallPath" class="cli-textarea" placeholder="D:/projects/my-project" value="' + (projectPath || '') + '">' +
|
|
2440
|
-
'</div>' +
|
|
2441
|
-
'<div class="ccw-install-action">' +
|
|
2442
|
-
'<button class="btn btn-primary" onclick="executeCcwInstall()">' +
|
|
2443
|
-
'<i data-lucide="download" class="w-4 h-4"></i> Install to Path</button>' +
|
|
2444
|
-
'</div>' +
|
|
2445
|
-
'</div>' +
|
|
2446
|
-
'</div>';
|
|
2447
|
-
|
|
2448
|
-
showModal('Install CCW', modalContent);
|
|
2449
|
-
}
|
|
2450
|
-
|
|
2451
|
-
function selectCcwInstallMode(mode) {
|
|
2452
|
-
if (mode === 'Global') {
|
|
2453
|
-
closeModal();
|
|
2454
|
-
runCcwInstall('Global');
|
|
2455
|
-
}
|
|
2456
|
-
}
|
|
2457
|
-
|
|
2458
|
-
function toggleCcwPathInput() {
|
|
2459
|
-
var section = document.getElementById('ccwPathInputSection');
|
|
2460
|
-
if (section) {
|
|
2461
|
-
section.classList.toggle('hidden');
|
|
2462
|
-
if (!section.classList.contains('hidden')) {
|
|
2463
|
-
var input = document.getElementById('ccwInstallPath');
|
|
2464
|
-
if (input) input.focus();
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
|
|
2469
|
-
function executeCcwInstall() {
|
|
2470
|
-
var input = document.getElementById('ccwInstallPath');
|
|
2471
|
-
var path = input ? input.value.trim() : '';
|
|
2472
|
-
|
|
2473
|
-
if (!path) {
|
|
2474
|
-
showRefreshToast('Please enter a path', 'error');
|
|
2475
|
-
return;
|
|
2476
|
-
}
|
|
2477
|
-
|
|
2478
|
-
closeModal();
|
|
2479
|
-
runCcwInstall('Path', path);
|
|
2480
|
-
}
|
|
2481
|
-
|
|
2482
|
-
function truncatePath(path) {
|
|
2483
|
-
if (!path) return '';
|
|
2484
|
-
var maxLen = 35;
|
|
2485
|
-
if (path.length <= maxLen) return path;
|
|
2486
|
-
return '...' + path.slice(-maxLen + 3);
|
|
2487
|
-
}
|
|
2488
|
-
|
|
2489
|
-
function renderCliExecutePanel() {
|
|
2490
|
-
var container = document.getElementById('cli-execute-panel');
|
|
2491
|
-
if (!container) return;
|
|
2492
|
-
|
|
2493
|
-
var tools = ['gemini', 'qwen', 'codex'];
|
|
2494
|
-
var modes = ['analysis', 'write', 'auto'];
|
|
2495
|
-
|
|
2496
|
-
var html = '<div class="cli-execute-header"><h3>Quick Execute</h3></div>' +
|
|
2497
|
-
'<div class="cli-execute-form"><div class="cli-execute-row">' +
|
|
2498
|
-
'<div class="cli-form-group"><label for="cli-exec-tool">Tool</label>' +
|
|
2499
|
-
'<select id="cli-exec-tool" class="cli-select">';
|
|
2500
|
-
for (var i = 0; i < tools.length; i++) {
|
|
2501
|
-
var tool = tools[i];
|
|
2502
|
-
var selected = tool === defaultCliTool ? 'selected' : '';
|
|
2503
|
-
html += '<option value="' + tool + '" ' + selected + '>' + tool.charAt(0).toUpperCase() + tool.slice(1) + '</option>';
|
|
2504
|
-
}
|
|
2505
|
-
html += '</select></div>' +
|
|
2506
|
-
'<div class="cli-form-group"><label for="cli-exec-mode">Mode</label>' +
|
|
2507
|
-
'<select id="cli-exec-mode" class="cli-select">';
|
|
2508
|
-
for (var j = 0; j < modes.length; j++) {
|
|
2509
|
-
var mode = modes[j];
|
|
2510
|
-
var sel = mode === 'analysis' ? 'selected' : '';
|
|
2511
|
-
html += '<option value="' + mode + '" ' + sel + '>' + mode.charAt(0).toUpperCase() + mode.slice(1) + '</option>';
|
|
2512
|
-
}
|
|
2513
|
-
html += '</select></div></div>' +
|
|
2514
|
-
'<div class="cli-form-group"><label for="cli-exec-prompt">Prompt</label>' +
|
|
2515
|
-
'<textarea id="cli-exec-prompt" class="cli-textarea" placeholder="Enter your prompt..."></textarea></div>' +
|
|
2516
|
-
'<div class="cli-execute-actions">' +
|
|
2517
|
-
'<button class="btn btn-primary" onclick="executeCliFromDashboard()" ' + (currentCliExecution ? 'disabled' : '') + '>' +
|
|
2518
|
-
'<i data-lucide="play" class="w-4 h-4"></i> Execute</button></div></div>';
|
|
2519
|
-
container.innerHTML = html;
|
|
2520
|
-
if (window.lucide) lucide.createIcons();
|
|
2521
|
-
}
|
|
2522
|
-
|
|
2523
|
-
// ========== CCW Actions ==========
|
|
2524
|
-
function runCcwInstall(mode, customPath) {
|
|
2525
|
-
var command;
|
|
2526
|
-
if (mode === 'Global') {
|
|
2527
|
-
command = 'ccw install --mode Global';
|
|
2528
|
-
} else {
|
|
2529
|
-
var installPath = customPath || projectPath;
|
|
2530
|
-
command = 'ccw install --mode Path --path "' + installPath + '"';
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
// Copy command to clipboard
|
|
2534
|
-
if (navigator.clipboard) {
|
|
2535
|
-
navigator.clipboard.writeText(command).then(function() {
|
|
2536
|
-
showRefreshToast('Command copied: ' + command, 'success');
|
|
2537
|
-
}).catch(function() {
|
|
2538
|
-
showRefreshToast('Run: ' + command, 'info');
|
|
2539
|
-
});
|
|
2540
|
-
} else {
|
|
2541
|
-
showRefreshToast('Run: ' + command, 'info');
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2544
|
-
|
|
2545
|
-
async function runCcwUpgrade() {
|
|
2546
|
-
showRefreshToast(t('ccw.upgradeStarting'), 'info');
|
|
2547
|
-
|
|
2548
|
-
try {
|
|
2549
|
-
var response = await fetch('/api/ccw/upgrade', {
|
|
2550
|
-
method: 'POST',
|
|
2551
|
-
headers: { 'Content-Type': 'application/json' },
|
|
2552
|
-
body: JSON.stringify({})
|
|
2553
|
-
});
|
|
2554
|
-
|
|
2555
|
-
var result = await response.json();
|
|
2556
|
-
|
|
2557
|
-
if (result.success) {
|
|
2558
|
-
showRefreshToast(t('ccw.upgradeCompleted'), 'success');
|
|
2559
|
-
// Reload installations after upgrade
|
|
2560
|
-
setTimeout(function() {
|
|
2561
|
-
loadCcwInstallations().then(function() {
|
|
2562
|
-
renderCcwInstallPanel();
|
|
2563
|
-
});
|
|
2564
|
-
}, 1000);
|
|
2565
|
-
} else {
|
|
2566
|
-
showRefreshToast(t('ccw.upgradeFailed', { error: result.error || 'Unknown error' }), 'error');
|
|
2567
|
-
}
|
|
2568
|
-
} catch (err) {
|
|
2569
|
-
showRefreshToast(t('ccw.upgradeFailed', { error: err.message }), 'error');
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
|
-
|
|
2573
|
-
function confirmCcwUninstall(installPath) {
|
|
2574
|
-
if (confirm(t('ccw.uninstallConfirm') + '\n' + (installPath || 'Current installation'))) {
|
|
2575
|
-
var command = installPath
|
|
2576
|
-
? 'ccw uninstall --path "' + installPath + '"'
|
|
2577
|
-
: 'ccw uninstall';
|
|
2578
|
-
|
|
2579
|
-
if (navigator.clipboard) {
|
|
2580
|
-
navigator.clipboard.writeText(command).then(function() {
|
|
2581
|
-
showRefreshToast('Command copied: ' + command, 'success');
|
|
2582
|
-
}).catch(function() {
|
|
2583
|
-
showRefreshToast('Run: ' + command, 'info');
|
|
2584
|
-
});
|
|
2585
|
-
} else {
|
|
2586
|
-
showRefreshToast('Run: ' + command, 'info');
|
|
2587
|
-
}
|
|
2588
|
-
}
|
|
2589
|
-
}
|
|
2590
|
-
|
|
2591
|
-
// ========== Execution ==========
|
|
2592
|
-
async function executeCliFromDashboard() {
|
|
2593
|
-
var toolEl = document.getElementById('cli-exec-tool');
|
|
2594
|
-
var modeEl = document.getElementById('cli-exec-mode');
|
|
2595
|
-
var promptEl = document.getElementById('cli-exec-prompt');
|
|
2596
|
-
|
|
2597
|
-
var tool = toolEl ? toolEl.value : 'gemini';
|
|
2598
|
-
var mode = modeEl ? modeEl.value : 'analysis';
|
|
2599
|
-
var prompt = promptEl ? promptEl.value.trim() : '';
|
|
2600
|
-
|
|
2601
|
-
if (!prompt) {
|
|
2602
|
-
showRefreshToast(t('toast.enterPrompt'), 'error');
|
|
2603
|
-
return;
|
|
2604
|
-
}
|
|
2605
|
-
|
|
2606
|
-
currentCliExecution = { tool: tool, mode: mode, prompt: prompt, startTime: Date.now() };
|
|
2607
|
-
cliExecutionOutput = '';
|
|
2608
|
-
|
|
2609
|
-
var outputPanel = document.getElementById('cli-output-panel');
|
|
2610
|
-
var outputContent = document.getElementById('cli-output-content');
|
|
2611
|
-
var statusIndicator = document.getElementById('cli-output-status-indicator');
|
|
2612
|
-
var statusText = document.getElementById('cli-output-status-text');
|
|
2613
|
-
|
|
2614
|
-
if (outputPanel) outputPanel.classList.remove('hidden');
|
|
2615
|
-
if (outputContent) outputContent.textContent = '';
|
|
2616
|
-
if (statusIndicator) statusIndicator.className = 'status-indicator running';
|
|
2617
|
-
if (statusText) statusText.textContent = 'Running...';
|
|
2618
|
-
|
|
2619
|
-
var execBtn = document.querySelector('.cli-execute-actions .btn-primary');
|
|
2620
|
-
if (execBtn) execBtn.disabled = true;
|
|
2621
|
-
|
|
2622
|
-
try {
|
|
2623
|
-
var response = await fetch('/api/cli/execute', {
|
|
2624
|
-
method: 'POST',
|
|
2625
|
-
headers: { 'Content-Type': 'application/json' },
|
|
2626
|
-
body: JSON.stringify({
|
|
2627
|
-
tool: tool,
|
|
2628
|
-
mode: mode,
|
|
2629
|
-
prompt: prompt,
|
|
2630
|
-
dir: projectPath,
|
|
2631
|
-
format: promptConcatFormat,
|
|
2632
|
-
smartContext: {
|
|
2633
|
-
enabled: smartContextEnabled,
|
|
2634
|
-
maxFiles: smartContextMaxFiles
|
|
2635
|
-
}
|
|
2636
|
-
})
|
|
2637
|
-
});
|
|
2638
|
-
var result = await response.json();
|
|
2639
|
-
|
|
2640
|
-
if (statusIndicator) statusIndicator.className = 'status-indicator ' + (result.success ? 'success' : 'error');
|
|
2641
|
-
if (statusText) {
|
|
2642
|
-
var duration = formatDuration(result.execution ? result.execution.duration_ms : (Date.now() - currentCliExecution.startTime));
|
|
2643
|
-
statusText.textContent = result.success ? 'Completed in ' + duration : 'Failed: ' + (result.error || 'Unknown');
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2646
|
-
await loadCliHistory();
|
|
2647
|
-
renderCliHistory();
|
|
2648
|
-
showRefreshToast(result.success ? t('toast.completed') : (result.error || t('toast.failed')), result.success ? 'success' : 'error');
|
|
2649
|
-
} catch (error) {
|
|
2650
|
-
if (statusIndicator) statusIndicator.className = 'status-indicator error';
|
|
2651
|
-
if (statusText) statusText.textContent = 'Error: ' + error.message;
|
|
2652
|
-
showRefreshToast(t('toast.error', { error: error.message }), 'error');
|
|
2653
|
-
}
|
|
2654
|
-
|
|
2655
|
-
currentCliExecution = null;
|
|
2656
|
-
if (execBtn) execBtn.disabled = false;
|
|
2657
|
-
}
|
|
2658
|
-
|
|
2659
|
-
// ========== WebSocket Event Handlers ==========
|
|
2660
|
-
function handleCliExecutionStarted(payload) {
|
|
2661
|
-
currentCliExecution = {
|
|
2662
|
-
executionId: payload.executionId,
|
|
2663
|
-
tool: payload.tool,
|
|
2664
|
-
mode: payload.mode,
|
|
2665
|
-
startTime: new Date(payload.timestamp).getTime()
|
|
2666
|
-
};
|
|
2667
|
-
cliExecutionOutput = '';
|
|
2668
|
-
|
|
2669
|
-
// Show toast notification
|
|
2670
|
-
if (typeof addGlobalNotification === 'function') {
|
|
2671
|
-
addGlobalNotification('info', 'CLI ' + payload.tool + ' started', payload.mode + ' mode', 'CLI');
|
|
2672
|
-
}
|
|
2673
|
-
|
|
2674
|
-
if (currentView === 'cli-manager') {
|
|
2675
|
-
var outputPanel = document.getElementById('cli-output-panel');
|
|
2676
|
-
var outputContent = document.getElementById('cli-output-content');
|
|
2677
|
-
var statusIndicator = document.getElementById('cli-output-status-indicator');
|
|
2678
|
-
var statusText = document.getElementById('cli-output-status-text');
|
|
2679
|
-
|
|
2680
|
-
if (outputPanel) outputPanel.classList.remove('hidden');
|
|
2681
|
-
if (outputContent) outputContent.textContent = '';
|
|
2682
|
-
if (statusIndicator) statusIndicator.className = 'status-indicator running';
|
|
2683
|
-
if (statusText) statusText.textContent = 'Running ' + payload.tool + ' (' + payload.mode + ')...';
|
|
2684
|
-
}
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
function handleCliOutput(payload) {
|
|
2688
|
-
cliExecutionOutput += payload.data;
|
|
2689
|
-
var outputContent = document.getElementById('cli-output-content');
|
|
2690
|
-
if (outputContent) {
|
|
2691
|
-
outputContent.textContent = cliExecutionOutput;
|
|
2692
|
-
outputContent.scrollTop = outputContent.scrollHeight;
|
|
2693
|
-
}
|
|
2694
|
-
}
|
|
2695
|
-
|
|
2696
|
-
function handleCliExecutionCompleted(payload) {
|
|
2697
|
-
var statusIndicator = document.getElementById('cli-output-status-indicator');
|
|
2698
|
-
var statusText = document.getElementById('cli-output-status-text');
|
|
2699
|
-
|
|
2700
|
-
if (statusIndicator) statusIndicator.className = 'status-indicator ' + (payload.success ? 'success' : 'error');
|
|
2701
|
-
if (statusText) statusText.textContent = payload.success ? 'Completed in ' + formatDuration(payload.duration_ms) : 'Failed: ' + payload.status;
|
|
2702
|
-
|
|
2703
|
-
// Show toast notification
|
|
2704
|
-
if (typeof addGlobalNotification === 'function') {
|
|
2705
|
-
if (payload.success) {
|
|
2706
|
-
addGlobalNotification('success', 'CLI execution completed', formatDuration(payload.duration_ms), 'CLI');
|
|
2707
|
-
} else {
|
|
2708
|
-
addGlobalNotification('error', 'CLI execution failed', payload.status, 'CLI');
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
|
|
2712
|
-
currentCliExecution = null;
|
|
2713
|
-
if (currentView === 'cli-manager') {
|
|
2714
|
-
loadCliHistory().then(function() { renderCliHistory(); });
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
|
-
function handleCliExecutionError(payload) {
|
|
2719
|
-
var statusIndicator = document.getElementById('cli-output-status-indicator');
|
|
2720
|
-
var statusText = document.getElementById('cli-output-status-text');
|
|
2721
|
-
|
|
2722
|
-
if (statusIndicator) statusIndicator.className = 'status-indicator error';
|
|
2723
|
-
if (statusText) statusText.textContent = 'Error: ' + payload.error;
|
|
2724
|
-
|
|
2725
|
-
// Show toast notification
|
|
2726
|
-
if (typeof addGlobalNotification === 'function') {
|
|
2727
|
-
addGlobalNotification('error', 'CLI execution error', payload.error, 'CLI');
|
|
2728
|
-
}
|
|
2729
|
-
|
|
2730
|
-
currentCliExecution = null;
|
|
2731
|
-
}
|
|
2732
|
-
|
|
2733
|
-
// ========== CLI Tool Install/Uninstall Wizards ==========
|
|
2734
|
-
function openCliInstallWizard(toolName) {
|
|
2735
|
-
var toolDescriptions = {
|
|
2736
|
-
gemini: 'Google AI for code analysis and generation',
|
|
2737
|
-
qwen: 'Alibaba AI assistant for coding',
|
|
2738
|
-
codex: 'OpenAI code generation and understanding',
|
|
2739
|
-
claude: 'Anthropic AI assistant'
|
|
2740
|
-
};
|
|
2741
|
-
|
|
2742
|
-
var toolPackages = {
|
|
2743
|
-
gemini: '@google/gemini-cli',
|
|
2744
|
-
qwen: '@qwen-code/qwen-code',
|
|
2745
|
-
codex: '@openai/codex',
|
|
2746
|
-
claude: '@anthropic-ai/claude-code'
|
|
2747
|
-
};
|
|
2748
|
-
|
|
2749
|
-
var modal = document.createElement('div');
|
|
2750
|
-
modal.id = 'cliInstallModal';
|
|
2751
|
-
modal.className = 'fixed inset-0 bg-black/50 flex items-center justify-center z-50';
|
|
2752
|
-
modal.innerHTML =
|
|
2753
|
-
'<div class="bg-card rounded-lg shadow-xl w-full max-w-md mx-4 overflow-hidden">' +
|
|
2754
|
-
'<div class="p-6">' +
|
|
2755
|
-
'<div class="flex items-center gap-3 mb-4">' +
|
|
2756
|
-
'<div class="w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center">' +
|
|
2757
|
-
'<i data-lucide="download" class="w-5 h-5 text-primary"></i>' +
|
|
2758
|
-
'</div>' +
|
|
2759
|
-
'<div>' +
|
|
2760
|
-
'<h3 class="text-lg font-semibold">Install ' + toolName.charAt(0).toUpperCase() + toolName.slice(1) + '</h3>' +
|
|
2761
|
-
'<p class="text-sm text-muted-foreground">' + (toolDescriptions[toolName] || 'CLI tool') + '</p>' +
|
|
2762
|
-
'</div>' +
|
|
2763
|
-
'</div>' +
|
|
2764
|
-
'<div class="space-y-4">' +
|
|
2765
|
-
'<div class="bg-muted/50 rounded-lg p-4">' +
|
|
2766
|
-
'<h4 class="font-medium mb-2">What will be installed:</h4>' +
|
|
2767
|
-
'<ul class="text-sm space-y-2 text-muted-foreground">' +
|
|
2768
|
-
'<li class="flex items-start gap-2">' +
|
|
2769
|
-
'<i data-lucide="check" class="w-4 h-4 text-success mt-0.5"></i>' +
|
|
2770
|
-
'<span><strong>NPM Package:</strong> <code class="bg-muted px-1 rounded">' + (toolPackages[toolName] || toolName) + '</code></span>' +
|
|
2771
|
-
'</li>' +
|
|
2772
|
-
'<li class="flex items-start gap-2">' +
|
|
2773
|
-
'<i data-lucide="check" class="w-4 h-4 text-success mt-0.5"></i>' +
|
|
2774
|
-
'<span><strong>Global installation</strong> - Available system-wide</span>' +
|
|
2775
|
-
'</li>' +
|
|
2776
|
-
'<li class="flex items-start gap-2">' +
|
|
2777
|
-
'<i data-lucide="check" class="w-4 h-4 text-success mt-0.5"></i>' +
|
|
2778
|
-
'<span><strong>CLI commands</strong> - Accessible from terminal</span>' +
|
|
2779
|
-
'</li>' +
|
|
2780
|
-
'</ul>' +
|
|
2781
|
-
'</div>' +
|
|
2782
|
-
'<div class="bg-primary/5 border border-primary/20 rounded-lg p-3">' +
|
|
2783
|
-
'<div class="flex items-start gap-2">' +
|
|
2784
|
-
'<i data-lucide="info" class="w-4 h-4 text-primary mt-0.5"></i>' +
|
|
2785
|
-
'<div class="text-sm text-muted-foreground">' +
|
|
2786
|
-
'<p class="font-medium text-foreground">Installation Method</p>' +
|
|
2787
|
-
'<p class="mt-1">Uses <code class="bg-muted px-1 rounded">npm install -g</code></p>' +
|
|
2788
|
-
'<p class="mt-1">First installation may take 1-2 minutes depending on network speed.</p>' +
|
|
2789
|
-
'</div>' +
|
|
2790
|
-
'</div>' +
|
|
2791
|
-
'</div>' +
|
|
2792
|
-
'<div id="cliInstallProgress" class="hidden">' +
|
|
2793
|
-
'<div class="flex items-center gap-3">' +
|
|
2794
|
-
'<div class="animate-spin w-5 h-5 border-2 border-primary border-t-transparent rounded-full"></div>' +
|
|
2795
|
-
'<span class="text-sm" id="cliInstallStatus">Starting installation...</span>' +
|
|
2796
|
-
'</div>' +
|
|
2797
|
-
'<div class="mt-2 h-2 bg-muted rounded-full overflow-hidden">' +
|
|
2798
|
-
'<div id="cliInstallProgressBar" class="h-full bg-primary transition-all duration-300" style="width: 0%"></div>' +
|
|
2799
|
-
'</div>' +
|
|
2800
|
-
'</div>' +
|
|
2801
|
-
'</div>' +
|
|
2802
|
-
'</div>' +
|
|
2803
|
-
'<div class="border-t border-border p-4 flex justify-end gap-3 bg-muted/30">' +
|
|
2804
|
-
'<button class="btn-outline px-4 py-2" onclick="closeCliInstallWizard()">Cancel</button>' +
|
|
2805
|
-
'<button id="cliInstallBtn" class="btn-primary px-4 py-2" onclick="startCliInstall(\'' + toolName + '\')">' +
|
|
2806
|
-
'<i data-lucide="download" class="w-4 h-4 mr-2"></i>' +
|
|
2807
|
-
'Install Now' +
|
|
2808
|
-
'</button>' +
|
|
2809
|
-
'</div>' +
|
|
2810
|
-
'</div>';
|
|
2811
|
-
|
|
2812
|
-
document.body.appendChild(modal);
|
|
2813
|
-
|
|
2814
|
-
if (window.lucide) {
|
|
2815
|
-
lucide.createIcons();
|
|
2816
|
-
}
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
function closeCliInstallWizard() {
|
|
2820
|
-
var modal = document.getElementById('cliInstallModal');
|
|
2821
|
-
if (modal) {
|
|
2822
|
-
modal.remove();
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
|
|
2826
|
-
async function startCliInstall(toolName) {
|
|
2827
|
-
var progressDiv = document.getElementById('cliInstallProgress');
|
|
2828
|
-
var installBtn = document.getElementById('cliInstallBtn');
|
|
2829
|
-
var statusText = document.getElementById('cliInstallStatus');
|
|
2830
|
-
var progressBar = document.getElementById('cliInstallProgressBar');
|
|
2831
|
-
|
|
2832
|
-
progressDiv.classList.remove('hidden');
|
|
2833
|
-
installBtn.disabled = true;
|
|
2834
|
-
installBtn.innerHTML = '<span class="animate-pulse">Installing...</span>';
|
|
2835
|
-
|
|
2836
|
-
var stages = [
|
|
2837
|
-
{ progress: 20, text: 'Connecting to NPM registry...' },
|
|
2838
|
-
{ progress: 40, text: 'Downloading package...' },
|
|
2839
|
-
{ progress: 60, text: 'Installing dependencies...' },
|
|
2840
|
-
{ progress: 80, text: 'Setting up CLI commands...' },
|
|
2841
|
-
{ progress: 95, text: 'Finalizing installation...' }
|
|
2842
|
-
];
|
|
2843
|
-
|
|
2844
|
-
var currentStage = 0;
|
|
2845
|
-
var progressInterval = setInterval(function() {
|
|
2846
|
-
if (currentStage < stages.length) {
|
|
2847
|
-
statusText.textContent = stages[currentStage].text;
|
|
2848
|
-
progressBar.style.width = stages[currentStage].progress + '%';
|
|
2849
|
-
currentStage++;
|
|
2850
|
-
}
|
|
2851
|
-
}, 1000);
|
|
2852
|
-
|
|
2853
|
-
try {
|
|
2854
|
-
var response = await fetch('/api/cli/install', {
|
|
2855
|
-
method: 'POST',
|
|
2856
|
-
headers: { 'Content-Type': 'application/json' },
|
|
2857
|
-
body: JSON.stringify({ tool: toolName })
|
|
2858
|
-
});
|
|
2859
|
-
|
|
2860
|
-
clearInterval(progressInterval);
|
|
2861
|
-
var result = await response.json();
|
|
2862
|
-
|
|
2863
|
-
if (result.success) {
|
|
2864
|
-
progressBar.style.width = '100%';
|
|
2865
|
-
statusText.textContent = 'Installation complete!';
|
|
2866
|
-
|
|
2867
|
-
setTimeout(function() {
|
|
2868
|
-
closeCliInstallWizard();
|
|
2869
|
-
showRefreshToast(toolName + ' installed successfully!', 'success');
|
|
2870
|
-
loadCliToolStatus().then(function() {
|
|
2871
|
-
renderToolsSection();
|
|
2872
|
-
if (window.lucide) lucide.createIcons();
|
|
2873
|
-
});
|
|
2874
|
-
}, 1000);
|
|
2875
|
-
} else {
|
|
2876
|
-
statusText.textContent = 'Error: ' + result.error;
|
|
2877
|
-
progressBar.classList.add('bg-destructive');
|
|
2878
|
-
installBtn.disabled = false;
|
|
2879
|
-
installBtn.innerHTML = '<i data-lucide="refresh-cw" class="w-4 h-4 mr-2"></i> Retry';
|
|
2880
|
-
if (window.lucide) lucide.createIcons();
|
|
2881
|
-
}
|
|
2882
|
-
} catch (err) {
|
|
2883
|
-
clearInterval(progressInterval);
|
|
2884
|
-
statusText.textContent = 'Error: ' + err.message;
|
|
2885
|
-
progressBar.classList.add('bg-destructive');
|
|
2886
|
-
installBtn.disabled = false;
|
|
2887
|
-
installBtn.innerHTML = '<i data-lucide="refresh-cw" class="w-4 h-4 mr-2"></i> Retry';
|
|
2888
|
-
if (window.lucide) lucide.createIcons();
|
|
2889
|
-
}
|
|
2890
|
-
}
|
|
2891
|
-
|
|
2892
|
-
function openCliUninstallWizard(toolName) {
|
|
2893
|
-
var modal = document.createElement('div');
|
|
2894
|
-
modal.id = 'cliUninstallModal';
|
|
2895
|
-
modal.className = 'fixed inset-0 bg-black/50 flex items-center justify-center z-50';
|
|
2896
|
-
modal.innerHTML =
|
|
2897
|
-
'<div class="bg-card rounded-lg shadow-xl w-full max-w-md mx-4 overflow-hidden">' +
|
|
2898
|
-
'<div class="p-6">' +
|
|
2899
|
-
'<div class="flex items-center gap-3 mb-4">' +
|
|
2900
|
-
'<div class="w-10 h-10 rounded-full bg-destructive/10 flex items-center justify-center">' +
|
|
2901
|
-
'<i data-lucide="trash-2" class="w-5 h-5 text-destructive"></i>' +
|
|
2902
|
-
'</div>' +
|
|
2903
|
-
'<div>' +
|
|
2904
|
-
'<h3 class="text-lg font-semibold">Uninstall ' + toolName.charAt(0).toUpperCase() + toolName.slice(1) + '</h3>' +
|
|
2905
|
-
'<p class="text-sm text-muted-foreground">Remove CLI tool from system</p>' +
|
|
2906
|
-
'</div>' +
|
|
2907
|
-
'</div>' +
|
|
2908
|
-
'<div class="space-y-4">' +
|
|
2909
|
-
'<div class="bg-destructive/5 border border-destructive/20 rounded-lg p-4">' +
|
|
2910
|
-
'<h4 class="font-medium text-destructive mb-2">What will be removed:</h4>' +
|
|
2911
|
-
'<ul class="text-sm space-y-2 text-muted-foreground">' +
|
|
2912
|
-
'<li class="flex items-start gap-2">' +
|
|
2913
|
-
'<i data-lucide="x" class="w-4 h-4 text-destructive mt-0.5"></i>' +
|
|
2914
|
-
'<span>Global NPM package</span>' +
|
|
2915
|
-
'</li>' +
|
|
2916
|
-
'<li class="flex items-start gap-2">' +
|
|
2917
|
-
'<i data-lucide="x" class="w-4 h-4 text-destructive mt-0.5"></i>' +
|
|
2918
|
-
'<span>CLI commands and executables</span>' +
|
|
2919
|
-
'</li>' +
|
|
2920
|
-
'<li class="flex items-start gap-2">' +
|
|
2921
|
-
'<i data-lucide="x" class="w-4 h-4 text-destructive mt-0.5"></i>' +
|
|
2922
|
-
'<span>Tool configuration (if any)</span>' +
|
|
2923
|
-
'</li>' +
|
|
2924
|
-
'</ul>' +
|
|
2925
|
-
'</div>' +
|
|
2926
|
-
'<div class="bg-warning/10 border border-warning/20 rounded-lg p-3">' +
|
|
2927
|
-
'<div class="flex items-start gap-2">' +
|
|
2928
|
-
'<i data-lucide="alert-triangle" class="w-4 h-4 text-warning mt-0.5"></i>' +
|
|
2929
|
-
'<div class="text-sm">' +
|
|
2930
|
-
'<p class="font-medium text-warning">Note</p>' +
|
|
2931
|
-
'<p class="text-muted-foreground">You can reinstall this tool anytime from the CLI Manager.</p>' +
|
|
2932
|
-
'</div>' +
|
|
2933
|
-
'</div>' +
|
|
2934
|
-
'</div>' +
|
|
2935
|
-
'<div id="cliUninstallProgress" class="hidden">' +
|
|
2936
|
-
'<div class="flex items-center gap-3">' +
|
|
2937
|
-
'<div class="animate-spin w-5 h-5 border-2 border-destructive border-t-transparent rounded-full"></div>' +
|
|
2938
|
-
'<span class="text-sm" id="cliUninstallStatus">Removing package...</span>' +
|
|
2939
|
-
'</div>' +
|
|
2940
|
-
'<div class="mt-2 h-2 bg-muted rounded-full overflow-hidden">' +
|
|
2941
|
-
'<div id="cliUninstallProgressBar" class="h-full bg-destructive transition-all duration-300" style="width: 0%"></div>' +
|
|
2942
|
-
'</div>' +
|
|
2943
|
-
'</div>' +
|
|
2944
|
-
'</div>' +
|
|
2945
|
-
'</div>' +
|
|
2946
|
-
'<div class="border-t border-border p-4 flex justify-end gap-3 bg-muted/30">' +
|
|
2947
|
-
'<button class="btn-outline px-4 py-2" onclick="closeCliUninstallWizard()">Cancel</button>' +
|
|
2948
|
-
'<button id="cliUninstallBtn" class="btn-destructive px-4 py-2" onclick="startCliUninstall(\'' + toolName + '\')">' +
|
|
2949
|
-
'<i data-lucide="trash-2" class="w-4 h-4 mr-2"></i>' +
|
|
2950
|
-
'Uninstall' +
|
|
2951
|
-
'</button>' +
|
|
2952
|
-
'</div>' +
|
|
2953
|
-
'</div>';
|
|
2954
|
-
|
|
2955
|
-
document.body.appendChild(modal);
|
|
2956
|
-
|
|
2957
|
-
if (window.lucide) {
|
|
2958
|
-
lucide.createIcons();
|
|
2959
|
-
}
|
|
2960
|
-
}
|
|
2961
|
-
|
|
2962
|
-
function closeCliUninstallWizard() {
|
|
2963
|
-
var modal = document.getElementById('cliUninstallModal');
|
|
2964
|
-
if (modal) {
|
|
2965
|
-
modal.remove();
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2969
|
-
async function startCliUninstall(toolName) {
|
|
2970
|
-
var progressDiv = document.getElementById('cliUninstallProgress');
|
|
2971
|
-
var uninstallBtn = document.getElementById('cliUninstallBtn');
|
|
2972
|
-
var statusText = document.getElementById('cliUninstallStatus');
|
|
2973
|
-
var progressBar = document.getElementById('cliUninstallProgressBar');
|
|
2974
|
-
|
|
2975
|
-
progressDiv.classList.remove('hidden');
|
|
2976
|
-
uninstallBtn.disabled = true;
|
|
2977
|
-
uninstallBtn.innerHTML = '<span class="animate-pulse">Uninstalling...</span>';
|
|
2978
|
-
|
|
2979
|
-
var stages = [
|
|
2980
|
-
{ progress: 33, text: 'Removing package files...' },
|
|
2981
|
-
{ progress: 66, text: 'Cleaning up dependencies...' },
|
|
2982
|
-
{ progress: 90, text: 'Finalizing removal...' }
|
|
2983
|
-
];
|
|
2984
|
-
|
|
2985
|
-
var currentStage = 0;
|
|
2986
|
-
var progressInterval = setInterval(function() {
|
|
2987
|
-
if (currentStage < stages.length) {
|
|
2988
|
-
statusText.textContent = stages[currentStage].text;
|
|
2989
|
-
progressBar.style.width = stages[currentStage].progress + '%';
|
|
2990
|
-
currentStage++;
|
|
2991
|
-
}
|
|
2992
|
-
}, 500);
|
|
2993
|
-
|
|
2994
|
-
try {
|
|
2995
|
-
var response = await fetch('/api/cli/uninstall', {
|
|
2996
|
-
method: 'POST',
|
|
2997
|
-
headers: { 'Content-Type': 'application/json' },
|
|
2998
|
-
body: JSON.stringify({ tool: toolName })
|
|
2999
|
-
});
|
|
3000
|
-
|
|
3001
|
-
clearInterval(progressInterval);
|
|
3002
|
-
var result = await response.json();
|
|
3003
|
-
|
|
3004
|
-
if (result.success) {
|
|
3005
|
-
progressBar.style.width = '100%';
|
|
3006
|
-
statusText.textContent = 'Uninstallation complete!';
|
|
3007
|
-
|
|
3008
|
-
setTimeout(function() {
|
|
3009
|
-
closeCliUninstallWizard();
|
|
3010
|
-
showRefreshToast(toolName + ' uninstalled successfully!', 'success');
|
|
3011
|
-
loadCliToolStatus().then(function() {
|
|
3012
|
-
renderToolsSection();
|
|
3013
|
-
if (window.lucide) lucide.createIcons();
|
|
3014
|
-
});
|
|
3015
|
-
}, 1000);
|
|
3016
|
-
} else {
|
|
3017
|
-
statusText.textContent = 'Error: ' + result.error;
|
|
3018
|
-
progressBar.classList.remove('bg-destructive');
|
|
3019
|
-
progressBar.classList.add('bg-destructive');
|
|
3020
|
-
uninstallBtn.disabled = false;
|
|
3021
|
-
uninstallBtn.innerHTML = '<i data-lucide="refresh-cw" class="w-4 h-4 mr-2"></i> Retry';
|
|
3022
|
-
if (window.lucide) lucide.createIcons();
|
|
3023
|
-
}
|
|
3024
|
-
} catch (err) {
|
|
3025
|
-
clearInterval(progressInterval);
|
|
3026
|
-
statusText.textContent = 'Error: ' + err.message;
|
|
3027
|
-
progressBar.classList.remove('bg-destructive');
|
|
3028
|
-
progressBar.classList.add('bg-destructive');
|
|
3029
|
-
uninstallBtn.disabled = false;
|
|
3030
|
-
uninstallBtn.innerHTML = '<i data-lucide="refresh-cw" class="w-4 h-4 mr-2"></i> Retry';
|
|
3031
|
-
if (window.lucide) lucide.createIcons();
|
|
3032
|
-
}
|
|
3033
|
-
}
|
|
3034
|
-
|
|
3035
|
-
// ========== CodexLens Configuration Modal ==========
|
|
3036
|
-
async function showCodexLensConfigModal() {
|
|
3037
|
-
var loadingContent = '<div class="text-center py-8">' +
|
|
3038
|
-
'<div class="animate-spin w-8 h-8 border-2 border-primary border-t-transparent rounded-full mx-auto mb-4"></div>' +
|
|
3039
|
-
'<p class="text-muted-foreground">' + t('codexlens.loadingConfig') + '</p>' +
|
|
3040
|
-
'</div>';
|
|
3041
|
-
|
|
3042
|
-
showModal(t('codexlens.config'), loadingContent, { size: 'md' });
|
|
3043
|
-
|
|
3044
|
-
try {
|
|
3045
|
-
// Fetch current configuration
|
|
3046
|
-
var response = await fetch('/api/codexlens/config');
|
|
3047
|
-
var config = await response.json();
|
|
3048
|
-
|
|
3049
|
-
var content = buildCodexLensConfigContent(config);
|
|
3050
|
-
showModal('CodexLens Configuration', content, { size: 'md' });
|
|
3051
|
-
|
|
3052
|
-
setTimeout(function() {
|
|
3053
|
-
initCodexLensConfigEvents(config);
|
|
3054
|
-
if (window.lucide) lucide.createIcons();
|
|
3055
|
-
}, 100);
|
|
3056
|
-
} catch (err) {
|
|
3057
|
-
var errorContent = '<div class="bg-destructive/10 border border-destructive/20 rounded-lg p-4">' +
|
|
3058
|
-
'<div class="flex items-start gap-2">' +
|
|
3059
|
-
'<i data-lucide="alert-circle" class="w-5 h-5 text-destructive mt-0.5"></i>' +
|
|
3060
|
-
'<div>' +
|
|
3061
|
-
'<p class="font-medium text-destructive">Failed to load configuration</p>' +
|
|
3062
|
-
'<p class="text-sm text-muted-foreground mt-1">' + err.message + '</p>' +
|
|
3063
|
-
'</div>' +
|
|
3064
|
-
'</div>' +
|
|
3065
|
-
'</div>';
|
|
3066
|
-
showModal('CodexLens Configuration', errorContent, { size: 'md' });
|
|
3067
|
-
}
|
|
3068
|
-
}
|
|
3069
|
-
|
|
3070
|
-
function buildCodexLensConfigContent(config) {
|
|
3071
|
-
var status = codexLensStatus || {};
|
|
3072
|
-
var isInstalled = status.ready;
|
|
3073
|
-
var indexDir = config.index_dir || '~/.codexlens/indexes';
|
|
3074
|
-
var currentWorkspace = config.current_workspace || 'None';
|
|
3075
|
-
var indexCount = config.index_count || 0;
|
|
3076
|
-
|
|
3077
|
-
return '<div class="tool-config-modal">' +
|
|
3078
|
-
// Status Section
|
|
3079
|
-
'<div class="tool-config-section">' +
|
|
3080
|
-
'<h4>' + t('codexlens.status') + '</h4>' +
|
|
3081
|
-
'<div class="tool-config-badges">' +
|
|
3082
|
-
'<span class="badge ' + (isInstalled ? 'badge-success' : 'badge-muted') + '">' +
|
|
3083
|
-
'<i data-lucide="' + (isInstalled ? 'check-circle' : 'circle-dashed') + '" class="w-3 h-3"></i> ' +
|
|
3084
|
-
(isInstalled ? t('codexlens.installed') : t('codexlens.notInstalled')) +
|
|
3085
|
-
'</span>' +
|
|
3086
|
-
'<span class="badge badge-primary">' +
|
|
3087
|
-
'<i data-lucide="database" class="w-3 h-3"></i> ' + indexCount + ' ' + t('codexlens.indexes') +
|
|
3088
|
-
'</span>' +
|
|
3089
|
-
'</div>' +
|
|
3090
|
-
(currentWorkspace !== 'None'
|
|
3091
|
-
? '<div class="mt-3 p-3 bg-muted/30 rounded-lg">' +
|
|
3092
|
-
'<p class="text-sm text-muted-foreground mb-1">' + t('codexlens.currentWorkspace') + ':</p>' +
|
|
3093
|
-
'<p class="text-sm font-mono break-all">' + escapeHtml(currentWorkspace) + '</p>' +
|
|
3094
|
-
'</div>'
|
|
3095
|
-
: '') +
|
|
3096
|
-
'</div>' +
|
|
3097
|
-
|
|
3098
|
-
// Index Storage Path Section
|
|
3099
|
-
'<div class="tool-config-section">' +
|
|
3100
|
-
'<h4>' + t('codexlens.indexStoragePath') + ' <span class="text-muted">(' + t('codexlens.whereIndexesStored') + ')</span></h4>' +
|
|
3101
|
-
'<div class="space-y-3">' +
|
|
3102
|
-
'<div class="bg-muted/30 rounded-lg p-3">' +
|
|
3103
|
-
'<p class="text-sm text-muted-foreground mb-2">' + t('codexlens.currentPath') + ':</p>' +
|
|
3104
|
-
'<p class="text-sm font-mono break-all bg-background px-2 py-1 rounded border border-border">' +
|
|
3105
|
-
escapeHtml(indexDir) +
|
|
3106
|
-
'</p>' +
|
|
3107
|
-
'</div>' +
|
|
3108
|
-
'<div>' +
|
|
3109
|
-
'<label class="text-sm font-medium mb-2 block">' + t('codexlens.newStoragePath') + ':</label>' +
|
|
3110
|
-
'<input type="text" id="indexDirInput" class="tool-config-input w-full" ' +
|
|
3111
|
-
'placeholder="' + t('codexlens.pathPlaceholder') + '" ' +
|
|
3112
|
-
'value="' + escapeHtml(indexDir) + '" />' +
|
|
3113
|
-
'<p class="text-xs text-muted-foreground mt-2">' +
|
|
3114
|
-
'<i data-lucide="info" class="w-3 h-3 inline"></i> ' +
|
|
3115
|
-
t('codexlens.pathInfo') +
|
|
3116
|
-
'</p>' +
|
|
3117
|
-
'</div>' +
|
|
3118
|
-
'<div class="bg-warning/10 border border-warning/20 rounded-lg p-3">' +
|
|
3119
|
-
'<div class="flex items-start gap-2">' +
|
|
3120
|
-
'<i data-lucide="alert-triangle" class="w-4 h-4 text-warning mt-0.5"></i>' +
|
|
3121
|
-
'<div class="text-sm">' +
|
|
3122
|
-
'<p class="font-medium text-warning">' + t('codexlens.migrationRequired') + '</p>' +
|
|
3123
|
-
'<p class="text-muted-foreground mt-1">' + t('codexlens.migrationWarning') + '</p>' +
|
|
3124
|
-
'</div>' +
|
|
3125
|
-
'</div>' +
|
|
3126
|
-
'</div>' +
|
|
3127
|
-
'</div>' +
|
|
3128
|
-
'</div>' +
|
|
3129
|
-
|
|
3130
|
-
// Actions Section
|
|
3131
|
-
'<div class="tool-config-section">' +
|
|
3132
|
-
'<h4>' + t('codexlens.actions') + '</h4>' +
|
|
3133
|
-
'<div class="tool-config-actions">' +
|
|
3134
|
-
(isInstalled
|
|
3135
|
-
? '<button class="btn-sm btn-outline" onclick="event.stopPropagation(); initCodexLensIndex()">' +
|
|
3136
|
-
'<i data-lucide="database" class="w-3 h-3"></i> ' + t('codexlens.initializeIndex') +
|
|
3137
|
-
'</button>' +
|
|
3138
|
-
'<button class="btn-sm btn-outline" onclick="event.stopPropagation(); cleanCurrentWorkspaceIndex()">' +
|
|
3139
|
-
'<i data-lucide="folder-x" class="w-3 h-3"></i> ' + t('codexlens.cleanCurrentWorkspace') +
|
|
3140
|
-
'</button>' +
|
|
3141
|
-
'<button class="btn-sm btn-outline" onclick="event.stopPropagation(); cleanCodexLensIndexes()">' +
|
|
3142
|
-
'<i data-lucide="trash" class="w-3 h-3"></i> ' + t('codexlens.cleanAllIndexes') +
|
|
3143
|
-
'</button>' +
|
|
3144
|
-
'<button class="btn-sm btn-outline btn-danger" onclick="event.stopPropagation(); uninstallCodexLens()">' +
|
|
3145
|
-
'<i data-lucide="trash-2" class="w-3 h-3"></i> ' + t('cli.uninstall') +
|
|
3146
|
-
'</button>'
|
|
3147
|
-
: '<button class="btn-sm btn-primary" onclick="event.stopPropagation(); installCodexLens()">' +
|
|
3148
|
-
'<i data-lucide="download" class="w-3 h-3"></i> ' + t('codexlens.installCodexLens') +
|
|
3149
|
-
'</button>') +
|
|
3150
|
-
'</div>' +
|
|
3151
|
-
'</div>' +
|
|
3152
|
-
|
|
3153
|
-
// Semantic Dependencies Section
|
|
3154
|
-
(isInstalled
|
|
3155
|
-
? '<div class="tool-config-section">' +
|
|
3156
|
-
'<h4>' + t('codexlens.semanticDeps') + '</h4>' +
|
|
3157
|
-
'<div id="semanticDepsStatus" class="space-y-2">' +
|
|
3158
|
-
'<div class="text-sm text-muted-foreground">' + t('codexlens.checkingDeps') + '</div>' +
|
|
3159
|
-
'</div>' +
|
|
3160
|
-
'</div>'
|
|
3161
|
-
: '') +
|
|
3162
|
-
|
|
3163
|
-
// Model Management Section
|
|
3164
|
-
(isInstalled
|
|
3165
|
-
? '<div class="tool-config-section">' +
|
|
3166
|
-
'<h4>' + t('codexlens.modelManagement') + '</h4>' +
|
|
3167
|
-
'<div id="modelListContainer" class="space-y-2">' +
|
|
3168
|
-
'<div class="text-sm text-muted-foreground">' + t('codexlens.loadingModels') + '</div>' +
|
|
3169
|
-
'</div>' +
|
|
3170
|
-
'</div>'
|
|
3171
|
-
: '') +
|
|
3172
|
-
|
|
3173
|
-
// Test Search Section
|
|
3174
|
-
(isInstalled
|
|
3175
|
-
? '<div class="tool-config-section">' +
|
|
3176
|
-
'<h4>' + t('codexlens.testSearch') + ' <span class="text-muted">(' + t('codexlens.testFunctionality') + ')</span></h4>' +
|
|
3177
|
-
'<div class="space-y-3">' +
|
|
3178
|
-
'<div class="flex gap-2">' +
|
|
3179
|
-
'<select id="searchTypeSelect" class="tool-config-select flex-1">' +
|
|
3180
|
-
'<option value="search">' + t('codexlens.textSearch') + '</option>' +
|
|
3181
|
-
'<option value="search_files">' + t('codexlens.fileSearch') + '</option>' +
|
|
3182
|
-
'<option value="symbol">' + t('codexlens.symbolSearch') + '</option>' +
|
|
3183
|
-
'</select>' +
|
|
3184
|
-
'<select id="searchModeSelect" class="tool-config-select flex-1">' +
|
|
3185
|
-
'<option value="exact">' + t('codexlens.exactMode') + '</option>' +
|
|
3186
|
-
'<option value="fuzzy">' + t('codexlens.fuzzyMode') + '</option>' +
|
|
3187
|
-
'<option value="hybrid">' + t('codexlens.hybridMode') + '</option>' +
|
|
3188
|
-
'<option value="vector">' + t('codexlens.vectorMode') + '</option>' +
|
|
3189
|
-
'</select>' +
|
|
3190
|
-
'</div>' +
|
|
3191
|
-
'<div>' +
|
|
3192
|
-
'<input type="text" id="searchQueryInput" class="tool-config-input w-full" ' +
|
|
3193
|
-
'placeholder="' + t('codexlens.searchPlaceholder') + '" />' +
|
|
3194
|
-
'</div>' +
|
|
3195
|
-
'<div>' +
|
|
3196
|
-
'<button class="btn-sm btn-primary w-full" id="runSearchBtn">' +
|
|
3197
|
-
'<i data-lucide="search" class="w-3 h-3"></i> ' + t('codexlens.runSearch') +
|
|
3198
|
-
'</button>' +
|
|
3199
|
-
'</div>' +
|
|
3200
|
-
'<div id="searchResults" class="hidden">' +
|
|
3201
|
-
'<div class="bg-muted/30 rounded-lg p-3 max-h-64 overflow-y-auto">' +
|
|
3202
|
-
'<div class="flex items-center justify-between mb-2">' +
|
|
3203
|
-
'<p class="text-sm font-medium">' + t('codexlens.results') + ':</p>' +
|
|
3204
|
-
'<span id="searchResultCount" class="text-xs text-muted-foreground"></span>' +
|
|
3205
|
-
'</div>' +
|
|
3206
|
-
'<pre id="searchResultContent" class="text-xs font-mono whitespace-pre-wrap break-all"></pre>' +
|
|
3207
|
-
'</div>' +
|
|
3208
|
-
'</div>' +
|
|
3209
|
-
'</div>' +
|
|
3210
|
-
'</div>'
|
|
3211
|
-
: '') +
|
|
3212
|
-
|
|
3213
|
-
// Footer
|
|
3214
|
-
'<div class="tool-config-footer">' +
|
|
3215
|
-
'<button class="btn btn-outline" onclick="closeModal()">' + t('common.cancel') + '</button>' +
|
|
3216
|
-
'<button class="btn btn-primary" id="saveCodexLensConfigBtn">' +
|
|
3217
|
-
'<i data-lucide="save" class="w-3.5 h-3.5"></i> ' + t('codexlens.saveConfig') +
|
|
3218
|
-
'</button>' +
|
|
3219
|
-
'</div>' +
|
|
3220
|
-
'</div>';
|
|
3221
|
-
}
|
|
3222
|
-
|
|
3223
|
-
function initCodexLensConfigEvents(currentConfig) {
|
|
3224
|
-
var saveBtn = document.getElementById('saveCodexLensConfigBtn');
|
|
3225
|
-
if (saveBtn) {
|
|
3226
|
-
saveBtn.onclick = async function() {
|
|
3227
|
-
var indexDirInput = document.getElementById('indexDirInput');
|
|
3228
|
-
var newIndexDir = indexDirInput ? indexDirInput.value.trim() : '';
|
|
3229
|
-
|
|
3230
|
-
if (!newIndexDir) {
|
|
3231
|
-
showRefreshToast(t('codexlens.pathEmpty'), 'error');
|
|
3232
|
-
return;
|
|
3233
|
-
}
|
|
3234
|
-
|
|
3235
|
-
if (newIndexDir === currentConfig.index_dir) {
|
|
3236
|
-
closeModal();
|
|
3237
|
-
return;
|
|
3238
|
-
}
|
|
3239
|
-
|
|
3240
|
-
saveBtn.disabled = true;
|
|
3241
|
-
saveBtn.innerHTML = '<span class="animate-pulse">' + t('common.saving') + '</span>';
|
|
3242
|
-
|
|
3243
|
-
try {
|
|
3244
|
-
var response = await fetch('/api/codexlens/config', {
|
|
3245
|
-
method: 'POST',
|
|
3246
|
-
headers: { 'Content-Type': 'application/json' },
|
|
3247
|
-
body: JSON.stringify({ index_dir: newIndexDir })
|
|
3248
|
-
});
|
|
3249
|
-
|
|
3250
|
-
var result = await response.json();
|
|
3251
|
-
|
|
3252
|
-
if (result.success) {
|
|
3253
|
-
showRefreshToast(t('codexlens.configSaved'), 'success');
|
|
3254
|
-
closeModal();
|
|
3255
|
-
|
|
3256
|
-
// Refresh CodexLens status
|
|
3257
|
-
if (typeof loadCodexLensStatus === 'function') {
|
|
3258
|
-
await loadCodexLensStatus();
|
|
3259
|
-
renderToolsSection();
|
|
3260
|
-
if (window.lucide) lucide.createIcons();
|
|
3261
|
-
}
|
|
3262
|
-
} else {
|
|
3263
|
-
showRefreshToast(t('common.saveFailed') + ': ' + result.error, 'error');
|
|
3264
|
-
saveBtn.disabled = false;
|
|
3265
|
-
saveBtn.innerHTML = '<i data-lucide="save" class="w-3.5 h-3.5"></i> ' + t('codexlens.saveConfig');
|
|
3266
|
-
if (window.lucide) lucide.createIcons();
|
|
3267
|
-
}
|
|
3268
|
-
} catch (err) {
|
|
3269
|
-
showRefreshToast(t('common.error') + ': ' + err.message, 'error');
|
|
3270
|
-
saveBtn.disabled = false;
|
|
3271
|
-
saveBtn.innerHTML = '<i data-lucide="save" class="w-3.5 h-3.5"></i> ' + t('codexlens.saveConfig');
|
|
3272
|
-
if (window.lucide) lucide.createIcons();
|
|
3273
|
-
}
|
|
3274
|
-
};
|
|
3275
|
-
}
|
|
3276
|
-
|
|
3277
|
-
// Test Search Button
|
|
3278
|
-
var runSearchBtn = document.getElementById('runSearchBtn');
|
|
3279
|
-
if (runSearchBtn) {
|
|
3280
|
-
runSearchBtn.onclick = async function() {
|
|
3281
|
-
var searchType = document.getElementById('searchTypeSelect').value;
|
|
3282
|
-
var searchMode = document.getElementById('searchModeSelect').value;
|
|
3283
|
-
var query = document.getElementById('searchQueryInput').value.trim();
|
|
3284
|
-
var resultsDiv = document.getElementById('searchResults');
|
|
3285
|
-
var resultCount = document.getElementById('searchResultCount');
|
|
3286
|
-
var resultContent = document.getElementById('searchResultContent');
|
|
3287
|
-
|
|
3288
|
-
if (!query) {
|
|
3289
|
-
showRefreshToast(t('codexlens.enterQuery'), 'warning');
|
|
3290
|
-
return;
|
|
3291
|
-
}
|
|
3292
|
-
|
|
3293
|
-
runSearchBtn.disabled = true;
|
|
3294
|
-
runSearchBtn.innerHTML = '<span class="animate-pulse">' + t('codexlens.searching') + '</span>';
|
|
3295
|
-
resultsDiv.classList.add('hidden');
|
|
3296
|
-
|
|
3297
|
-
try {
|
|
3298
|
-
var endpoint = '/api/codexlens/' + searchType;
|
|
3299
|
-
var params = new URLSearchParams({ query: query, limit: '20' });
|
|
3300
|
-
// Add mode parameter for search and search_files (not for symbol search)
|
|
3301
|
-
if (searchType === 'search' || searchType === 'search_files') {
|
|
3302
|
-
params.append('mode', searchMode);
|
|
3303
|
-
}
|
|
3304
|
-
|
|
3305
|
-
var response = await fetch(endpoint + '?' + params.toString());
|
|
3306
|
-
var result = await response.json();
|
|
3307
|
-
|
|
3308
|
-
console.log('[CodexLens Test] Search result:', result);
|
|
3309
|
-
|
|
3310
|
-
if (result.success) {
|
|
3311
|
-
var results = result.results || result.files || [];
|
|
3312
|
-
resultCount.textContent = results.length + ' ' + t('codexlens.resultsCount');
|
|
3313
|
-
resultContent.textContent = JSON.stringify(results, null, 2);
|
|
3314
|
-
resultsDiv.classList.remove('hidden');
|
|
3315
|
-
showRefreshToast(t('codexlens.searchCompleted') + ': ' + results.length + ' ' + t('codexlens.resultsCount'), 'success');
|
|
3316
|
-
} else {
|
|
3317
|
-
resultContent.textContent = t('common.error') + ': ' + (result.error || t('common.unknownError'));
|
|
3318
|
-
resultsDiv.classList.remove('hidden');
|
|
3319
|
-
showRefreshToast(t('codexlens.searchFailed') + ': ' + result.error, 'error');
|
|
3320
|
-
}
|
|
3321
|
-
|
|
3322
|
-
runSearchBtn.disabled = false;
|
|
3323
|
-
runSearchBtn.innerHTML = '<i data-lucide="search" class="w-3 h-3"></i> ' + t('codexlens.runSearch');
|
|
3324
|
-
if (window.lucide) lucide.createIcons();
|
|
3325
|
-
} catch (err) {
|
|
3326
|
-
console.error('[CodexLens Test] Error:', err);
|
|
3327
|
-
resultContent.textContent = t('common.exception') + ': ' + err.message;
|
|
3328
|
-
resultsDiv.classList.remove('hidden');
|
|
3329
|
-
showRefreshToast(t('common.error') + ': ' + err.message, 'error');
|
|
3330
|
-
runSearchBtn.disabled = false;
|
|
3331
|
-
runSearchBtn.innerHTML = '<i data-lucide="search" class="w-3 h-3"></i> ' + t('codexlens.runSearch');
|
|
3332
|
-
if (window.lucide) lucide.createIcons();
|
|
3333
|
-
}
|
|
3334
|
-
};
|
|
3335
|
-
}
|
|
3336
|
-
|
|
3337
|
-
// Load semantic dependencies status
|
|
3338
|
-
loadSemanticDepsStatus();
|
|
3339
|
-
|
|
3340
|
-
// Load model list
|
|
3341
|
-
loadModelList();
|
|
3342
|
-
}
|
|
3343
|
-
|
|
3344
|
-
// Load semantic dependencies status
|
|
3345
|
-
async function loadSemanticDepsStatus() {
|
|
3346
|
-
var container = document.getElementById('semanticDepsStatus');
|
|
3347
|
-
if (!container) return;
|
|
3348
|
-
|
|
3349
|
-
try {
|
|
3350
|
-
var response = await fetch('/api/codexlens/semantic/status');
|
|
3351
|
-
var result = await response.json();
|
|
3352
|
-
|
|
3353
|
-
if (result.available) {
|
|
3354
|
-
container.innerHTML =
|
|
3355
|
-
'<div class="flex items-center gap-2 text-sm">' +
|
|
3356
|
-
'<i data-lucide="check-circle" class="w-4 h-4 text-success"></i>' +
|
|
3357
|
-
'<span>' + t('codexlens.semanticInstalled') + '</span>' +
|
|
3358
|
-
'<span class="text-muted-foreground">(' + (result.backend || 'fastembed') + ')</span>' +
|
|
3359
|
-
'</div>';
|
|
3360
|
-
} else {
|
|
3361
|
-
container.innerHTML =
|
|
3362
|
-
'<div class="space-y-2">' +
|
|
3363
|
-
'<div class="flex items-center gap-2 text-sm text-muted-foreground">' +
|
|
3364
|
-
'<i data-lucide="alert-circle" class="w-4 h-4"></i>' +
|
|
3365
|
-
'<span>' + t('codexlens.semanticNotInstalled') + '</span>' +
|
|
3366
|
-
'</div>' +
|
|
3367
|
-
'<button class="btn-sm btn-outline" onclick="installSemanticDeps()">' +
|
|
3368
|
-
'<i data-lucide="download" class="w-3 h-3"></i> ' + t('codexlens.installDeps') +
|
|
3369
|
-
'</button>' +
|
|
3370
|
-
'</div>';
|
|
3371
|
-
}
|
|
3372
|
-
if (window.lucide) lucide.createIcons();
|
|
3373
|
-
} catch (err) {
|
|
3374
|
-
container.innerHTML =
|
|
3375
|
-
'<div class="text-sm text-error">' + t('common.error') + ': ' + err.message + '</div>';
|
|
3376
|
-
}
|
|
3377
|
-
}
|
|
3378
|
-
|
|
3379
|
-
// Install semantic dependencies
|
|
3380
|
-
async function installSemanticDeps() {
|
|
3381
|
-
var container = document.getElementById('semanticDepsStatus');
|
|
3382
|
-
if (!container) return;
|
|
3383
|
-
|
|
3384
|
-
container.innerHTML =
|
|
3385
|
-
'<div class="text-sm text-muted-foreground animate-pulse">' + t('codexlens.installingDeps') + '</div>';
|
|
3386
|
-
|
|
3387
|
-
try {
|
|
3388
|
-
var response = await csrfFetch('/api/codexlens/semantic/install', { method: 'POST' });
|
|
3389
|
-
var result = await response.json();
|
|
3390
|
-
|
|
3391
|
-
if (result.success) {
|
|
3392
|
-
showRefreshToast(t('codexlens.depsInstalled'), 'success');
|
|
3393
|
-
await loadSemanticDepsStatus();
|
|
3394
|
-
await loadModelList();
|
|
3395
|
-
} else {
|
|
3396
|
-
showRefreshToast(t('codexlens.depsInstallFailed') + ': ' + result.error, 'error');
|
|
3397
|
-
await loadSemanticDepsStatus();
|
|
3398
|
-
}
|
|
3399
|
-
} catch (err) {
|
|
3400
|
-
showRefreshToast(t('common.error') + ': ' + err.message, 'error');
|
|
3401
|
-
await loadSemanticDepsStatus();
|
|
3402
|
-
}
|
|
3403
|
-
}
|
|
3404
|
-
|
|
3405
|
-
// Load model list
|
|
3406
|
-
async function loadModelList() {
|
|
3407
|
-
var container = document.getElementById('modelListContainer');
|
|
3408
|
-
if (!container) return;
|
|
3409
|
-
|
|
3410
|
-
try {
|
|
3411
|
-
var response = await fetch('/api/codexlens/models');
|
|
3412
|
-
var result = await response.json();
|
|
3413
|
-
|
|
3414
|
-
if (!result.success || !result.result || !result.result.models) {
|
|
3415
|
-
container.innerHTML =
|
|
3416
|
-
'<div class="text-sm text-muted-foreground">' + t('codexlens.semanticNotInstalled') + '</div>';
|
|
3417
|
-
return;
|
|
3418
|
-
}
|
|
3419
|
-
|
|
3420
|
-
var models = result.result.models;
|
|
3421
|
-
var html = '<div class="space-y-2">';
|
|
3422
|
-
|
|
3423
|
-
models.forEach(function(model) {
|
|
3424
|
-
var statusIcon = model.installed
|
|
3425
|
-
? '<i data-lucide="check-circle" class="w-4 h-4 text-success"></i>'
|
|
3426
|
-
: '<i data-lucide="circle" class="w-4 h-4 text-muted"></i>';
|
|
3427
|
-
|
|
3428
|
-
var sizeText = model.installed
|
|
3429
|
-
? model.actual_size_mb.toFixed(1) + ' MB'
|
|
3430
|
-
: '~' + model.estimated_size_mb + ' MB';
|
|
3431
|
-
|
|
3432
|
-
var actionBtn = model.installed
|
|
3433
|
-
? '<button class="btn-sm btn-outline btn-danger" onclick="deleteModel(\'' + model.profile + '\')">' +
|
|
3434
|
-
'<i data-lucide="trash-2" class="w-3 h-3"></i> ' + t('codexlens.deleteModel') +
|
|
3435
|
-
'</button>'
|
|
3436
|
-
: '<button class="btn-sm btn-outline" onclick="downloadModel(\'' + model.profile + '\')">' +
|
|
3437
|
-
'<i data-lucide="download" class="w-3 h-3"></i> ' + t('codexlens.downloadModel') +
|
|
3438
|
-
'</button>';
|
|
3439
|
-
|
|
3440
|
-
html +=
|
|
3441
|
-
'<div class="border rounded-lg p-3 space-y-2" id="model-' + model.profile + '">' +
|
|
3442
|
-
'<div class="flex items-start justify-between">' +
|
|
3443
|
-
'<div class="flex-1">' +
|
|
3444
|
-
'<div class="flex items-center gap-2 mb-1">' +
|
|
3445
|
-
statusIcon +
|
|
3446
|
-
'<span class="font-medium">' + model.profile + '</span>' +
|
|
3447
|
-
'<span class="text-xs text-muted-foreground">(' + model.dimensions + ' dims)</span>' +
|
|
3448
|
-
'</div>' +
|
|
3449
|
-
'<div class="text-xs text-muted-foreground mb-1">' + model.model_name + '</div>' +
|
|
3450
|
-
'<div class="text-xs text-muted-foreground">' + model.use_case + '</div>' +
|
|
3451
|
-
'</div>' +
|
|
3452
|
-
'<div class="text-right">' +
|
|
3453
|
-
'<div class="text-xs text-muted-foreground mb-2">' + sizeText + '</div>' +
|
|
3454
|
-
actionBtn +
|
|
3455
|
-
'</div>' +
|
|
3456
|
-
'</div>' +
|
|
3457
|
-
'</div>';
|
|
3458
|
-
});
|
|
3459
|
-
|
|
3460
|
-
html += '</div>';
|
|
3461
|
-
container.innerHTML = html;
|
|
3462
|
-
if (window.lucide) lucide.createIcons();
|
|
3463
|
-
} catch (err) {
|
|
3464
|
-
container.innerHTML =
|
|
3465
|
-
'<div class="text-sm text-error">' + t('common.error') + ': ' + err.message + '</div>';
|
|
3466
|
-
}
|
|
3467
|
-
}
|
|
3468
|
-
|
|
3469
|
-
// Download model
|
|
3470
|
-
async function downloadModel(profile) {
|
|
3471
|
-
var modelCard = document.getElementById('model-' + profile);
|
|
3472
|
-
if (!modelCard) return;
|
|
3473
|
-
|
|
3474
|
-
var originalHTML = modelCard.innerHTML;
|
|
3475
|
-
modelCard.innerHTML =
|
|
3476
|
-
'<div class="flex items-center justify-center p-3">' +
|
|
3477
|
-
'<span class="text-sm text-muted-foreground animate-pulse">' + t('codexlens.downloading') + '</span>' +
|
|
3478
|
-
'</div>';
|
|
3479
|
-
|
|
3480
|
-
try {
|
|
3481
|
-
var response = await fetch('/api/codexlens/models/download', {
|
|
3482
|
-
method: 'POST',
|
|
3483
|
-
headers: { 'Content-Type': 'application/json' },
|
|
3484
|
-
body: JSON.stringify({ profile: profile })
|
|
3485
|
-
});
|
|
3486
|
-
|
|
3487
|
-
var result = await response.json();
|
|
3488
|
-
|
|
3489
|
-
if (result.success) {
|
|
3490
|
-
showRefreshToast(t('codexlens.modelDownloaded') + ': ' + profile, 'success');
|
|
3491
|
-
await loadModelList();
|
|
3492
|
-
} else {
|
|
3493
|
-
showRefreshToast(t('codexlens.modelDownloadFailed') + ': ' + result.error, 'error');
|
|
3494
|
-
modelCard.innerHTML = originalHTML;
|
|
3495
|
-
if (window.lucide) lucide.createIcons();
|
|
3496
|
-
}
|
|
3497
|
-
} catch (err) {
|
|
3498
|
-
showRefreshToast(t('common.error') + ': ' + err.message, 'error');
|
|
3499
|
-
modelCard.innerHTML = originalHTML;
|
|
3500
|
-
if (window.lucide) lucide.createIcons();
|
|
3501
|
-
}
|
|
3502
|
-
}
|
|
3503
|
-
|
|
3504
|
-
// Delete model
|
|
3505
|
-
async function deleteModel(profile) {
|
|
3506
|
-
if (!confirm(t('codexlens.deleteModelConfirm') + ' ' + profile + '?')) {
|
|
3507
|
-
return;
|
|
3508
|
-
}
|
|
3509
|
-
|
|
3510
|
-
var modelCard = document.getElementById('model-' + profile);
|
|
3511
|
-
if (!modelCard) return;
|
|
3512
|
-
|
|
3513
|
-
var originalHTML = modelCard.innerHTML;
|
|
3514
|
-
modelCard.innerHTML =
|
|
3515
|
-
'<div class="flex items-center justify-center p-3">' +
|
|
3516
|
-
'<span class="text-sm text-muted-foreground animate-pulse">' + t('codexlens.deleting') + '</span>' +
|
|
3517
|
-
'</div>';
|
|
3518
|
-
|
|
3519
|
-
try {
|
|
3520
|
-
var response = await fetch('/api/codexlens/models/delete', {
|
|
3521
|
-
method: 'POST',
|
|
3522
|
-
headers: { 'Content-Type': 'application/json' },
|
|
3523
|
-
body: JSON.stringify({ profile: profile })
|
|
3524
|
-
});
|
|
3525
|
-
|
|
3526
|
-
var result = await response.json();
|
|
3527
|
-
|
|
3528
|
-
if (result.success) {
|
|
3529
|
-
showRefreshToast(t('codexlens.modelDeleted') + ': ' + profile, 'success');
|
|
3530
|
-
await loadModelList();
|
|
3531
|
-
} else {
|
|
3532
|
-
showRefreshToast(t('codexlens.modelDeleteFailed') + ': ' + result.error, 'error');
|
|
3533
|
-
modelCard.innerHTML = originalHTML;
|
|
3534
|
-
if (window.lucide) lucide.createIcons();
|
|
3535
|
-
}
|
|
3536
|
-
} catch (err) {
|
|
3537
|
-
showRefreshToast(t('common.error') + ': ' + err.message, 'error');
|
|
3538
|
-
modelCard.innerHTML = originalHTML;
|
|
3539
|
-
if (window.lucide) lucide.createIcons();
|
|
3540
|
-
}
|
|
3541
|
-
}
|
|
3542
|
-
/**
|
|
3543
|
-
* Clean current workspace index
|
|
3544
|
-
*/
|
|
3545
|
-
async function cleanCurrentWorkspaceIndex() {
|
|
3546
|
-
if (!confirm(t('codexlens.cleanCurrentWorkspaceConfirm'))) {
|
|
3547
|
-
return;
|
|
3548
|
-
}
|
|
3549
|
-
|
|
3550
|
-
try {
|
|
3551
|
-
showRefreshToast(t('codexlens.cleaning'), 'info');
|
|
3552
|
-
|
|
3553
|
-
// Get current workspace path (projectPath is a global variable from state.js)
|
|
3554
|
-
var workspacePath = projectPath;
|
|
3555
|
-
|
|
3556
|
-
var response = await fetch('/api/codexlens/clean', {
|
|
3557
|
-
method: 'POST',
|
|
3558
|
-
headers: { 'Content-Type': 'application/json' },
|
|
3559
|
-
body: JSON.stringify({ path: workspacePath })
|
|
3560
|
-
});
|
|
3561
|
-
|
|
3562
|
-
var result = await response.json();
|
|
3563
|
-
|
|
3564
|
-
if (result.success) {
|
|
3565
|
-
showRefreshToast(t('codexlens.cleanCurrentWorkspaceSuccess'), 'success');
|
|
3566
|
-
|
|
3567
|
-
// Refresh status
|
|
3568
|
-
if (typeof loadCodexLensStatus === 'function') {
|
|
3569
|
-
await loadCodexLensStatus();
|
|
3570
|
-
renderToolsSection();
|
|
3571
|
-
if (window.lucide) lucide.createIcons();
|
|
3572
|
-
}
|
|
3573
|
-
} else {
|
|
3574
|
-
showRefreshToast(t('codexlens.cleanFailed') + ': ' + result.error, 'error');
|
|
3575
|
-
}
|
|
3576
|
-
} catch (err) {
|
|
3577
|
-
showRefreshToast(t('common.error') + ': ' + err.message, 'error');
|
|
3578
|
-
}
|
|
3579
|
-
}
|
|
3580
|
-
|
|
3581
|
-
/**
|
|
3582
|
-
* Clean all CodexLens indexes
|
|
3583
|
-
*/
|
|
3584
|
-
async function cleanCodexLensIndexes() {
|
|
3585
|
-
if (!confirm(t('codexlens.cleanConfirm'))) {
|
|
3586
|
-
return;
|
|
3587
|
-
}
|
|
3588
|
-
|
|
3589
|
-
try {
|
|
3590
|
-
showRefreshToast(t('codexlens.cleaning'), 'info');
|
|
3591
|
-
|
|
3592
|
-
var response = await fetch('/api/codexlens/clean', {
|
|
3593
|
-
method: 'POST',
|
|
3594
|
-
headers: { 'Content-Type': 'application/json' },
|
|
3595
|
-
body: JSON.stringify({ all: true })
|
|
3596
|
-
});
|
|
3597
|
-
|
|
3598
|
-
var result = await response.json();
|
|
3599
|
-
|
|
3600
|
-
if (result.success) {
|
|
3601
|
-
showRefreshToast(t('codexlens.cleanSuccess'), 'success');
|
|
3602
|
-
|
|
3603
|
-
// Refresh status
|
|
3604
|
-
if (typeof loadCodexLensStatus === 'function') {
|
|
3605
|
-
await loadCodexLensStatus();
|
|
3606
|
-
renderToolsSection();
|
|
3607
|
-
if (window.lucide) lucide.createIcons();
|
|
3608
|
-
}
|
|
3609
|
-
} else {
|
|
3610
|
-
showRefreshToast(t('codexlens.cleanFailed') + ': ' + result.error, 'error');
|
|
3611
|
-
}
|
|
3612
|
-
} catch (err) {
|
|
3613
|
-
showRefreshToast(t('common.error') + ': ' + err.message, 'error');
|
|
3614
|
-
}
|
|
3615
|
-
}
|