+
${t('mcp.cmd')}
- ${escapeHtml(template.serverConfig.command)}
+ ${escapeHtml(template.serverConfig.command)}
${template.serverConfig.args && template.serverConfig.args.length > 0 ? `
${t('mcp.args')}
- ${escapeHtml(template.serverConfig.args.slice(0, 2).join(' '))}${template.serverConfig.args.length > 2 ? '...' : ''}
+ ${escapeHtml(template.serverConfig.args.slice(0, 3).join(' '))}${template.serverConfig.args.length > 3 ? '...' : ''}
` : ''}
diff --git a/ccw/src/tools/codex-lens.ts b/ccw/src/tools/codex-lens.ts
index edb0a3df..5920fb19 100644
--- a/ccw/src/tools/codex-lens.ts
+++ b/ccw/src/tools/codex-lens.ts
@@ -45,6 +45,12 @@ const ParamsSchema = z.object({
mode: z.enum(['auto', 'text', 'semantic', 'exact', 'fuzzy', 'hybrid', 'vector', 'pure-vector']).default('auto'),
languages: z.array(z.string()).optional(),
limit: z.number().default(20),
+ // Additional fields for internal functions
+ file: z.string().optional(),
+ key: z.string().optional(),
+ value: z.string().optional(),
+ newPath: z.string().optional(),
+ all: z.boolean().optional(),
});
type Params = z.infer
;
diff --git a/ccw/src/tools/index.ts b/ccw/src/tools/index.ts
index 9ef0650c..a1828ab5 100644
--- a/ccw/src/tools/index.ts
+++ b/ccw/src/tools/index.ts
@@ -18,7 +18,7 @@ import * as convertTokensToCssMod from './convert-tokens-to-css.js';
import * as sessionManagerMod from './session-manager.js';
import * as cliExecutorMod from './cli-executor.js';
import * as smartSearchMod from './smart-search.js';
-import * as codexLensMod from './codex-lens.js';
+// codex_lens removed - functionality integrated into smart_search
import * as readFileMod from './read-file.js';
// Import legacy JS tools
@@ -297,7 +297,7 @@ registerTool(toLegacyTool(convertTokensToCssMod));
registerTool(toLegacyTool(sessionManagerMod));
registerTool(toLegacyTool(cliExecutorMod));
registerTool(toLegacyTool(smartSearchMod));
-registerTool(toLegacyTool(codexLensMod));
+// codex_lens removed - functionality integrated into smart_search
registerTool(toLegacyTool(readFileMod));
// Register legacy JS tools
diff --git a/test_embeddings_improvements.py b/test_embeddings_improvements.py
new file mode 100644
index 00000000..aa78c886
--- /dev/null
+++ b/test_embeddings_improvements.py
@@ -0,0 +1,146 @@
+"""Test script to verify embeddings improvements in init and status commands."""
+
+import json
+import subprocess
+import sys
+from pathlib import Path
+
+def run_command(cmd):
+ """Run a command and capture output."""
+ result = subprocess.run(
+ cmd,
+ shell=True,
+ capture_output=True,
+ text=True,
+ )
+ return result.stdout, result.stderr, result.returncode
+
+def test_init_embeddings():
+ """Test that init command reports embeddings statistics."""
+ print("Testing init command with embeddings reporting...")
+
+ # Create a temporary test directory
+ test_dir = Path("test_temp_project")
+ test_dir.mkdir(exist_ok=True)
+
+ # Create a simple Python file
+ test_file = test_dir / "test.py"
+ test_file.write_text("""
+def hello_world():
+ print("Hello, World!")
+
+def add_numbers(a, b):
+ return a + b
+""")
+
+ # Run init with JSON output
+ cmd = f"codexlens init {test_dir} --json --no-embeddings"
+ stdout, stderr, returncode = run_command(cmd)
+
+ if returncode != 0:
+ print(f"❌ Init command failed: {stderr}")
+ return False
+
+ try:
+ result = json.loads(stdout)
+
+ # Check for embeddings field
+ if "embeddings" not in result.get("result", {}):
+ print("❌ Missing 'embeddings' field in result")
+ return False
+
+ embeddings = result["result"]["embeddings"]
+
+ # Check required fields
+ required_fields = ["generated", "error"]
+ for field in required_fields:
+ if field not in embeddings:
+ print(f"❌ Missing required field '{field}' in embeddings")
+ return False
+
+ # Since we used --no-embeddings, it should show as not generated
+ if embeddings["generated"]:
+ print("❌ Expected embeddings to not be generated with --no-embeddings")
+ return False
+
+ print("✅ Init command embeddings reporting works correctly")
+ return True
+
+ except json.JSONDecodeError as e:
+ print(f"❌ Failed to parse JSON output: {e}")
+ print(f"Output: {stdout}")
+ return False
+ finally:
+ # Cleanup
+ import shutil
+ if test_dir.exists():
+ shutil.rmtree(test_dir)
+
+def test_status_embeddings():
+ """Test that status command reports embeddings coverage."""
+ print("\nTesting status command with embeddings coverage...")
+
+ # Run status with JSON output
+ cmd = "codexlens status --json"
+ stdout, stderr, returncode = run_command(cmd)
+
+ if returncode != 0:
+ print(f"❌ Status command failed: {stderr}")
+ return False
+
+ try:
+ result = json.loads(stdout)
+
+ # Check for features field
+ if "features" not in result.get("result", {}):
+ print("❌ Missing 'features' field in result")
+ return False
+
+ features = result["result"]["features"]
+
+ # Check that vector_search field exists (may be true or false)
+ if "vector_search" not in features:
+ print("❌ Missing 'vector_search' field in features")
+ return False
+
+ # Check if embeddings info is present (optional, depends on whether embeddings exist)
+ embeddings = result["result"].get("embeddings")
+ if embeddings:
+ print(f" Embeddings coverage: {embeddings.get('coverage_percent', 0):.1f}%")
+ print(f" Files with embeddings: {embeddings.get('files_with_embeddings', 0)}/{embeddings.get('total_files', 0)}")
+ print(f" Total chunks: {embeddings.get('total_chunks', 0)}")
+ else:
+ print(" No embeddings found (this is OK if none were generated)")
+
+ print("✅ Status command embeddings reporting works correctly")
+ return True
+
+ except json.JSONDecodeError as e:
+ print(f"❌ Failed to parse JSON output: {e}")
+ print(f"Output: {stdout}")
+ return False
+
+def main():
+ """Run all tests."""
+ print("=== Testing CodexLens Embeddings Improvements ===\n")
+
+ results = []
+
+ # Test init command
+ results.append(("Init embeddings reporting", test_init_embeddings()))
+
+ # Test status command
+ results.append(("Status embeddings coverage", test_status_embeddings()))
+
+ # Print summary
+ print("\n=== Test Summary ===")
+ for name, passed in results:
+ status = "✅ PASS" if passed else "❌ FAIL"
+ print(f"{status}: {name}")
+
+ # Return exit code
+ all_passed = all(passed for _, passed in results)
+ return 0 if all_passed else 1
+
+if __name__ == "__main__":
+ sys.exit(main())