diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index ed9d5dc7..a0745467 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -2,7 +2,7 @@ - **CLI Tools Usage**: @~/.claude/workflows/cli-tools-usage.md - **Coding Philosophy**: @~/.claude/workflows/coding-philosophy.md -- **Context Requirements**: @~/.claude/workflows/context-tools.md +- **Context Requirements**: @~/.claude/workflows/context-tools-ace.md - **File Modification**: @~/.claude/workflows/file-modification.md - **CLI Endpoints Config**: @.claude/cli-tools.json diff --git a/.claude/cli-tools.json b/.claude/cli-tools.json index ccd49e1e..7e8d5267 100644 --- a/.claude/cli-tools.json +++ b/.claude/cli-tools.json @@ -1,5 +1,4 @@ { - "$schema": "./cli-tools.schema.json", "version": "1.0.0", "tools": { "gemini": { @@ -41,6 +40,8 @@ "injectionMode": "auto", "defaultPrefix": "", "defaultSuffix": "" - } - } -} + }, + "codeIndexMcp": "ace" + }, + "$schema": "./cli-tools.schema.json" +} \ No newline at end of file diff --git a/ccw/src/templates/dashboard-css/18-cli-settings.css b/ccw/src/templates/dashboard-css/18-cli-settings.css index 5da24789..64601fff 100644 --- a/ccw/src/templates/dashboard-css/18-cli-settings.css +++ b/ccw/src/templates/dashboard-css/18-cli-settings.css @@ -158,3 +158,37 @@ pointer-events: none; } +/* Code Index MCP Toggle Buttons */ +.code-mcp-btn { + padding: 0.375rem 0.75rem; + font-size: 0.75rem; + font-weight: 500; + border-radius: 0.375rem; + border: none; + cursor: pointer; + transition: all 0.15s ease; + background: transparent; + color: hsl(var(--muted-foreground)); +} + +.code-mcp-btn:hover { + color: hsl(var(--foreground)); + background: hsl(var(--muted) / 0.5); +} + +.code-mcp-btn.active, +.code-mcp-btn[class*="bg-primary"] { + background: hsl(var(--primary)); + color: hsl(var(--primary-foreground)); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); +} + +.code-mcp-toggle { + display: flex; + align-items: center; + gap: 0.25rem; + background: hsl(var(--muted)); + border-radius: 0.5rem; + padding: 0.125rem; +} + diff --git a/ccw/src/templates/dashboard-js/components/cli-status.js b/ccw/src/templates/dashboard-js/components/cli-status.js index a5cab49a..03dbc8d7 100644 --- a/ccw/src/templates/dashboard-js/components/cli-status.js +++ b/ccw/src/templates/dashboard-js/components/cli-status.js @@ -776,7 +776,9 @@ async function setCodeIndexMcpProvider(provider) { window.claudeCliToolsConfig.settings.codeIndexMcp = provider; } showRefreshToast(`Code Index MCP switched to ${provider === 'ace' ? 'ACE (Augment)' : 'CodexLens'}`, 'success'); - renderCliStatus(); + // Re-render both CLI status and settings section + if (typeof renderCliStatus === 'function') renderCliStatus(); + if (typeof renderCliSettingsSection === 'function') renderCliSettingsSection(); } else { const data = await response.json(); showRefreshToast(`Failed to switch Code Index MCP: ${data.error}`, 'error'); diff --git a/ccw/src/templates/dashboard-js/i18n.js b/ccw/src/templates/dashboard-js/i18n.js index b77bbaea..1888e694 100644 --- a/ccw/src/templates/dashboard-js/i18n.js +++ b/ccw/src/templates/dashboard-js/i18n.js @@ -546,7 +546,9 @@ const i18n = { 'cli.recursiveQueryDesc': 'Aggregate CLI history and memory data from parent and child projects', 'cli.maxContextFiles': 'Max Context Files', 'cli.maxContextFilesDesc': 'Maximum files to include in smart context', - + 'cli.codeIndexMcp': 'Code Index MCP', + 'cli.codeIndexMcpDesc': 'Code search provider (updates CLAUDE.md context-tools reference)', + // CCW Install 'ccw.install': 'CCW Install', 'ccw.installations': 'installation', @@ -2254,7 +2256,9 @@ const i18n = { 'cli.recursiveQueryDesc': '聚合显示父项目和子项目的 CLI 历史与内存数据', 'cli.maxContextFiles': '最大上下文文件数', 'cli.maxContextFilesDesc': '智能上下文包含的最大文件数', - + 'cli.codeIndexMcp': '代码索引 MCP', + 'cli.codeIndexMcpDesc': '代码搜索提供者 (更新 CLAUDE.md 的 context-tools 引用)', + // CCW Install 'ccw.install': 'CCW 安装', 'ccw.installations': '个安装', diff --git a/ccw/src/templates/dashboard-js/views/cli-manager.js b/ccw/src/templates/dashboard-js/views/cli-manager.js index a9d66c3c..46b8b1b0 100644 --- a/ccw/src/templates/dashboard-js/views/cli-manager.js +++ b/ccw/src/templates/dashboard-js/views/cli-manager.js @@ -987,6 +987,23 @@ function renderCliSettingsSection() { '' + '
' + t('cli.maxContextFilesDesc') + '
' + '' + + '' + t('cli.codeIndexMcpDesc') + '
' + + '