feat: enhance spec loading capabilities and add new categories

- Added support for loading specs from new categories: debug, test, review, and validation.
- Updated various agents and skills to include instructions for loading project context from the new spec categories.
- Introduced new spec documents for test conventions, review standards, and validation rules to improve project guidelines.
- Enhanced the frontend to support new watcher settings and display auto-watch status.
- Improved the spec index builder to accommodate new categories and ensure proper loading of specifications.
This commit is contained in:
catlog22
2026-03-20 15:06:57 +08:00
parent 2b43b6be7b
commit d843112094
39 changed files with 356 additions and 29 deletions

View File

@@ -66,11 +66,19 @@ const ENV_GROUPS: EnvGroup[] = [
{ key: 'CODEXLENS_DB_PATH', label: 'DB Path' },
{ key: 'CODEXLENS_INDEX_WORKERS', label: 'Index Workers' },
{ key: 'CODEXLENS_CODE_AWARE_CHUNKING', label: 'Code Aware Chunking' },
{ key: 'CODEXLENS_AST_CHUNKING', label: 'AST Chunking' },
{ key: 'CODEXLENS_MAX_FILE_SIZE', label: 'Max File Size' },
{ key: 'CODEXLENS_HNSW_EF', label: 'HNSW EF' },
{ key: 'CODEXLENS_HNSW_M', label: 'HNSW M' },
],
},
{
title: 'watcher',
fields: [
{ key: 'CODEXLENS_AUTO_WATCH', label: 'Auto Watch' },
{ key: 'CODEXLENS_WATCHER_DEBOUNCE_MS', label: 'Watch Debounce (ms)' },
],
},
];
// Fields that are only relevant in API mode
@@ -95,6 +103,9 @@ const FIELD_DEFAULTS: Record<string, string> = {
CODEXLENS_RERANKER_BATCH_SIZE: '32',
CODEXLENS_INDEX_WORKERS: '2',
CODEXLENS_CODE_AWARE_CHUNKING: 'true',
CODEXLENS_AST_CHUNKING: 'true',
CODEXLENS_AUTO_WATCH: 'false',
CODEXLENS_WATCHER_DEBOUNCE_MS: '1000',
CODEXLENS_MAX_FILE_SIZE: '1000000',
CODEXLENS_HNSW_EF: '150',
CODEXLENS_HNSW_M: '32',

View File

@@ -10,7 +10,7 @@ import { useQueryClient } from '@tanstack/react-query';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { useIndexStatus, useSyncIndex, useRebuildIndex, codexLensKeys, type IndexStatusData } from '@/hooks/useCodexLens';
import { useIndexStatus, useSyncIndex, useRebuildIndex, useWatcherStatus, codexLensKeys, type IndexStatusData } from '@/hooks/useCodexLens';
import { useWorkflowStore, selectProjectPath } from '@/stores/workflowStore';
interface ProjectStatusCardProps {
@@ -131,8 +131,17 @@ export function IndexManagerTab() {
}
};
const { autoWatch } = useWatcherStatus();
return (
<div className="space-y-4">
{/* Global watcher status */}
<div className="flex items-center gap-2">
<span className={`text-xs px-2 py-0.5 rounded-full ${autoWatch ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'}`}>
{autoWatch ? 'Auto-watch ON' : 'Auto-watch OFF'}
</span>
</div>
{/* Add project path */}
<div className="flex gap-2">
<Input

View File

@@ -204,3 +204,18 @@ export function useCodexLensMcpConfig() {
staleTime: 30_000,
});
}
// ========================================
// Watcher Status Hook
// ========================================
export function useWatcherStatus() {
const { data: envData } = useCodexLensEnv();
const autoWatch = envData?.values?.CODEXLENS_AUTO_WATCH === 'true';
const debounceMs = envData?.values?.CODEXLENS_WATCHER_DEBOUNCE_MS || '1000';
return {
autoWatch,
debounceMs,
};
}