From 3d4813240df790e55535c19f7916a54341fde36c Mon Sep 17 00:00:00 2001 From: rUv Date: Mon, 5 Jan 2026 19:40:01 +0000 Subject: [PATCH] checkpoint: File edit: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🚀 Generated with [Claude Code](https://claude.com/claude-code) 📊 V3 Development Progress Checkpoint Co-Authored-By: Claude Sonnet 4 --- v3/@claude-flow/cli/src/init/executor.ts | 45 +++++++++++++++++++----- v3/@claude-flow/cli/src/prompt.ts | 3 +- v3/@claude-flow/cli/src/types.ts | 2 ++ 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/v3/@claude-flow/cli/src/init/executor.ts b/v3/@claude-flow/cli/src/init/executor.ts index 8d6ebabcee..bd5426cc94 100644 --- a/v3/@claude-flow/cli/src/init/executor.ts +++ b/v3/@claude-flow/cli/src/init/executor.ts @@ -542,16 +542,45 @@ neural/ * Find source directory for skills/commands/agents */ function findSourceDir(type: 'skills' | 'commands' | 'agents'): string | null { - const possiblePaths = [ - // Installed package - path.join(__dirname, '..', '..', '..', '..', '..', '.claude', type), - // Plugin directory - path.join(__dirname, '..', '..', '..', '..', '..', 'plugin', type), - // V2 directory for agents - path.join(__dirname, '..', '..', '..', '..', '..', 'v2', '.claude', type), - // Root .claude directory + // Build list of possible paths to check + const possiblePaths: string[] = []; + + // From dist/src/init -> go up to project root + // __dirname is typically /path/to/v3/@claude-flow/cli/dist/src/init + const distPath = __dirname; + + // Try to find the project root by looking for .claude directory + let currentDir = distPath; + for (let i = 0; i < 10; i++) { + const parentDir = path.dirname(currentDir); + const dotClaudePath = path.join(parentDir, '.claude', type); + if (fs.existsSync(dotClaudePath)) { + possiblePaths.push(dotClaudePath); + } + currentDir = parentDir; + } + + // Also check relative to process.cwd() for development + const cwdBased = [ + path.join(process.cwd(), '.claude', type), path.join(process.cwd(), '..', '.claude', type), + path.join(process.cwd(), '..', '..', '.claude', type), ]; + possiblePaths.push(...cwdBased); + + // Check v2 directory for agents + if (type === 'agents') { + possiblePaths.push( + path.join(process.cwd(), 'v2', '.claude', type), + path.join(process.cwd(), '..', 'v2', '.claude', type), + ); + } + + // Plugin directory + possiblePaths.push( + path.join(process.cwd(), 'plugin', type), + path.join(process.cwd(), '..', 'plugin', type), + ); for (const p of possiblePaths) { if (fs.existsSync(p)) { diff --git a/v3/@claude-flow/cli/src/prompt.ts b/v3/@claude-flow/cli/src/prompt.ts index f8a5d6a191..af450ce1a5 100644 --- a/v3/@claude-flow/cli/src/prompt.ts +++ b/v3/@claude-flow/cli/src/prompt.ts @@ -309,7 +309,8 @@ class PromptManager { // Initialize selection state const selected = new Set(); for (let i = 0; i < choices.length; i++) { - if (defaultValues.includes(choices[i].value)) { + // Check both default array and individual selected property + if (defaultValues.includes(choices[i].value) || choices[i].selected) { selected.add(i); } } diff --git a/v3/@claude-flow/cli/src/types.ts b/v3/@claude-flow/cli/src/types.ts index d118ff1546..4340957622 100644 --- a/v3/@claude-flow/cli/src/types.ts +++ b/v3/@claude-flow/cli/src/types.ts @@ -192,6 +192,8 @@ export interface SelectOption { label: string; hint?: string; disabled?: boolean; + /** For multiselect: whether this option is selected by default */ + selected?: boolean; } export interface SelectPromptOptions {