feat: add Accordion component for UI and Zustand store for coordinator management

- Implemented Accordion component using Radix UI for collapsible sections.
- Created Zustand store to manage coordinator execution state, command chains, logs, and interactive questions.
- Added validation tests for CLI settings type definitions, ensuring type safety and correct behavior of helper functions.
This commit is contained in:
catlog22
2026-02-03 10:02:40 +08:00
parent bcb4af3ba0
commit 5483a72e9f
82 changed files with 6156 additions and 7605 deletions

View File

@@ -126,11 +126,16 @@ export function saveEndpointSettings(request: SaveEndpointRequest): SettingsOper
// Usage: ccw cli -p "..." --tool <name> --mode analysis
try {
const projectDir = os.homedir(); // Use home dir as base for global config
// Merge user-provided tags with cli-wrapper tag for proper type registration
const userTags = request.settings.tags || [];
const tags = [...new Set([...userTags, 'cli-wrapper'])]; // Dedupe and ensure cli-wrapper tag
addClaudeCustomEndpoint(projectDir, {
id: endpointId,
name: request.name,
enabled: request.enabled ?? true,
tags: ['cli-wrapper'] // cli-wrapper tag -> registers as type: 'cli-wrapper'
tags,
availableModels: request.settings.availableModels,
settingsFile: request.settings.settingsFile
});
console.log(`[CliSettings] Synced endpoint ${endpointId} to cli-tools.json tools (cli-wrapper)`);
} catch (syncError) {
@@ -306,11 +311,17 @@ export function toggleEndpointEnabled(endpointId: string, enabled: boolean): Set
// Sync enabled status with cli-tools.json tools (cli-wrapper type)
try {
const projectDir = os.homedir();
// Load full settings to get tags
const endpoint = loadEndpointSettings(endpointId);
const userTags = endpoint?.settings.tags || [];
const tags = [...new Set([...userTags, 'cli-wrapper'])]; // Dedupe and ensure cli-wrapper tag
addClaudeCustomEndpoint(projectDir, {
id: endpointId,
name: metadata.name,
enabled: enabled,
tags: ['cli-wrapper'] // cli-wrapper tag -> registers as type: 'cli-wrapper'
tags,
availableModels: endpoint?.settings.availableModels,
settingsFile: endpoint?.settings.settingsFile
});
console.log(`[CliSettings] Synced endpoint ${endpointId} enabled=${enabled} to cli-tools.json tools`);
} catch (syncError) {