Add help view and core memory styles

- Introduced styles for the help view including tab transitions, accordion animations, search highlighting, and responsive design.
- Implemented core memory styles with modal base styles, memory card designs, and knowledge graph visualization.
- Enhanced dark mode support across various components.
- Added loading states and empty state designs for better user experience.
This commit is contained in:
catlog22
2025-12-18 18:29:45 +08:00
parent 4577be71ce
commit 17af615fe2
46 changed files with 4941 additions and 4326 deletions

View File

@@ -758,11 +758,12 @@ async function executeCliTool(
const startTime = Date.now();
return new Promise((resolve, reject) => {
// Direct spawn without shell - CLI tools (codex/gemini/qwen) don't need shell wrapper
// This avoids Windows cmd.exe ENOENT errors and simplifies argument handling
// Windows requires shell: true for npm global commands (.cmd files)
// Unix-like systems can use shell: false for direct execution
const isWindows = process.platform === 'win32';
const child = spawn(command, args, {
cwd: workingDir,
shell: false,
shell: isWindows, // Enable shell on Windows for .cmd files
stdio: [useStdin ? 'pipe' : 'ignore', 'pipe', 'pipe']
});

View File

@@ -39,10 +39,16 @@ const ParamsSchema = z.object({
'init',
'search',
'search_files',
'status',
'symbol',
'check',
'update',
'bootstrap',
]),
path: z.string().optional(),
query: z.string().optional(),
mode: z.enum(['auto', 'text', 'semantic', 'exact', 'fuzzy', 'hybrid', 'vector', 'pure-vector']).default('auto'),
format: z.enum(['json', 'text', 'pretty']).default('json'),
languages: z.array(z.string()).optional(),
limit: z.number().default(20),
// Additional fields for internal functions
@@ -790,8 +796,13 @@ Note: For advanced operations (config, status, clean), use CLI directly: codexle
'init',
'search',
'search_files',
'status',
'symbol',
'check',
'update',
'bootstrap',
],
description: 'Action to perform: init (index directory), search (search code), search_files (search files only)',
description: 'Action to perform: init/update (index directory), search (search code), search_files (search files only), status (index status), symbol (extract symbols), check (check if ready), bootstrap (setup venv)',
},
path: {
type: 'string',
@@ -807,6 +818,12 @@ Note: For advanced operations (config, status, clean), use CLI directly: codexle
description: 'Search mode: auto (default, hybrid if embeddings exist), text/exact (FTS), hybrid (best), fuzzy, vector, semantic/pure-vector',
default: 'auto',
},
format: {
type: 'string',
enum: ['json', 'text', 'pretty'],
description: 'Output format: json (default), text, pretty',
default: 'json',
},
languages: {
type: 'array',
items: { type: 'string' },
@@ -847,9 +864,41 @@ export async function handler(params: Record<string, unknown>): Promise<ToolResu
result = await searchFiles(parsed.data);
break;
case 'status':
result = await getStatus(parsed.data);
break;
case 'symbol':
result = await extractSymbols(parsed.data);
break;
case 'check':
const checkStatus = await ensureReady();
result = {
success: checkStatus.ready,
ready: checkStatus.ready,
version: checkStatus.version,
error: checkStatus.error,
};
break;
case 'update':
// Update is an alias for init (incremental update)
result = await initIndex(parsed.data);
break;
case 'bootstrap':
const bootstrapResult = await bootstrapVenv();
result = {
success: bootstrapResult.success,
message: bootstrapResult.message,
error: bootstrapResult.error,
};
break;
default:
throw new Error(
`Unknown action: ${action}. Valid actions: init, search, search_files`
`Unknown action: ${action}. Valid actions: init, search, search_files, status, symbol, check, update, bootstrap`
);
}

View File

@@ -141,9 +141,11 @@ async function checkIndexStatus(path: string = '.'): Promise<IndexStatus> {
try {
// Strip ANSI color codes from JSON output
const cleanOutput = (result.output || '{}').replace(/\x1b\[[0-9;]*m/g, '');
const status = JSON.parse(cleanOutput);
const indexed = status.indexed === true || status.file_count > 0;
const parsed = JSON.parse(cleanOutput);
// Handle both direct and nested response formats (status returns {success, result: {...}})
const status = parsed.result || parsed;
const indexed = status.projects_count > 0 || status.total_files > 0;
// Get embeddings coverage from comprehensive status
const embeddingsData = status.embeddings || {};
const embeddingsCoverage = embeddingsData.coverage_percent || 0;
@@ -161,7 +163,7 @@ async function checkIndexStatus(path: string = '.'): Promise<IndexStatus> {
return {
indexed,
has_embeddings,
file_count: status.file_count,
file_count: status.total_files,
embeddings_coverage_percent: embeddingsCoverage,
warning,
};