claude-flow 2.7.15 → 2.7.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/claude-flow CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
  # Claude-Flow Smart Dispatcher - Detects and uses the best available runtime
3
3
 
4
- VERSION="2.7.15"
4
+ VERSION="2.7.16"
5
5
 
6
6
  # Determine the correct path based on how the script is invoked
7
7
  if [ -L "$0" ]; then
@@ -24,6 +24,9 @@ export class HelpFormatter {
24
24
  if (info.examples && info.examples.length > 0) {
25
25
  sections.push(this.formatSection('EXAMPLES', info.examples));
26
26
  }
27
+ if (info.details) {
28
+ sections.push('\n' + info.details);
29
+ }
27
30
  if (info.commands && info.commands.length > 0) {
28
31
  sections.push(`Run '${info.name} <command> --help' for more information on a command.`);
29
32
  }
@@ -85,9 +88,4 @@ export class HelpFormatter {
85
88
  }
86
89
  }
87
90
 
88
- //# sourceMappingURL=help-formatter.js.map/\s+/g, ' ');
89
- return text;
90
- }
91
- }
92
-
93
91
  //# sourceMappingURL=help-formatter.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/help-formatter.ts"],"sourcesContent":["/**\n * Standardized CLI Help Formatter\n * Follows Unix/Linux conventions for help output\n */\n\nexport interface CommandInfo {\n name: string;\n description: string;\n usage?: string;\n commands?: CommandItem[];\n options?: OptionItem[];\n examples?: string[];\n globalOptions?: OptionItem[];\n}\n\nexport interface CommandItem {\n name: string;\n description: string;\n aliases?: string[];\n}\n\nexport interface OptionItem {\n flags: string;\n description: string;\n defaultValue?: string;\n validValues?: string[];\n}\n\nexport class HelpFormatter {\n private static readonly INDENT = ' ';\n private static readonly COLUMN_GAP = 2;\n private static readonly MIN_DESCRIPTION_COLUMN = 25;\n\n /**\n * Format main command help\n */\n static formatHelp(info: CommandInfo): string {\n const sections: string[] = [];\n\n // NAME section\n sections.push(this.formatSection('NAME', [`${info.name} - ${info.description}`]));\n\n // SYNOPSIS section\n if (info.usage) {\n sections.push(this.formatSection('SYNOPSIS', [info.usage]));\n }\n\n // COMMANDS section\n if (info.commands && info.commands.length > 0) {\n sections.push(this.formatSection('COMMANDS', this.formatCommands(info.commands)));\n }\n\n // OPTIONS section\n if (info.options && info.options.length > 0) {\n sections.push(this.formatSection('OPTIONS', this.formatOptions(info.options)));\n }\n\n // GLOBAL OPTIONS section\n if (info.globalOptions && info.globalOptions.length > 0) {\n sections.push(this.formatSection('GLOBAL OPTIONS', this.formatOptions(info.globalOptions)));\n }\n\n // EXAMPLES section\n if (info.examples && info.examples.length > 0) {\n sections.push(this.formatSection('EXAMPLES', info.examples));\n }\n\n // Footer\n if (info.commands && info.commands.length > 0) {\n sections.push(`Run '${info.name} <command> --help' for more information on a command.`);\n }\n\n return sections.join('\\n\\n');\n }\n\n /**\n * Format error message with usage hint\n */\n static formatError(error: string, command: string, usage?: string): string {\n const lines: string[] = [`Error: ${error}`, ''];\n\n if (usage) {\n lines.push(`Usage: ${usage}`);\n }\n\n lines.push(`Try '${command} --help' for more information.`);\n\n return lines.join('\\n');\n }\n\n /**\n * Format validation error with valid options\n */\n static formatValidationError(\n value: string,\n paramName: string,\n validOptions: string[],\n command: string,\n ): string {\n return this.formatError(\n `'${value}' is not a valid ${paramName}. Valid options are: ${validOptions.join(', ')}.`,\n command,\n );\n }\n\n private static formatSection(title: string, content: string[]): string {\n return `${title}\\n${content.map((line) => `${this.INDENT}${line}`).join('\\n')}`;\n }\n\n private static formatCommands(commands: CommandItem[]): string[] {\n const maxNameLength = Math.max(\n this.MIN_DESCRIPTION_COLUMN,\n ...commands.map((cmd) => {\n const nameLength = cmd.name.length;\n const aliasLength = cmd.aliases ? ` (${cmd.aliases.join(', ')})`.length : 0;\n return nameLength + aliasLength;\n }),\n );\n\n return commands.map((cmd) => {\n let name = cmd.name;\n if (cmd.aliases && cmd.aliases.length > 0) {\n name += ` (${cmd.aliases.join(', ')})`;\n }\n const padding = ' '.repeat(maxNameLength - name.length + this.COLUMN_GAP);\n return `${name}${padding}${cmd.description}`;\n });\n }\n\n private static formatOptions(options: OptionItem[]): string[] {\n const maxFlagsLength = Math.max(\n this.MIN_DESCRIPTION_COLUMN,\n ...options.map((opt) => opt.flags.length),\n );\n\n return options.map((opt) => {\n const padding = ' '.repeat(maxFlagsLength - opt.flags.length + this.COLUMN_GAP);\n let description = opt.description;\n\n // Add default value\n if (opt.defaultValue !== undefined) {\n description += ` [default: ${opt.defaultValue}]`;\n }\n\n // Add valid values on next line if present\n if (opt.validValues && opt.validValues.length > 0) {\n const validValuesLine =\n ' '.repeat(maxFlagsLength + this.COLUMN_GAP) + `Valid: ${opt.validValues.join(', ')}`;\n return `${opt.flags}${padding}${description}\\n${this.INDENT}${validValuesLine}`;\n }\n\n return `${opt.flags}${padding}${description}`;\n });\n }\n\n /**\n * Strip ANSI color codes and emojis from text\n */\n static stripFormatting(text: string): string {\n // Remove ANSI color codes\n text = text.replace(/\\x1b\\[[0-9;]*m/g, '');\n\n // Remove common emojis used in the CLI\n const emojiPattern =\n /[\\u{1F300}-\\u{1F9FF}]|[\\u{2600}-\\u{27BF}]|[\\u{1F000}-\\u{1F6FF}]|[\\u{1F680}-\\u{1F6FF}]/gu;\n text = text.replace(emojiPattern, '').trim();\n\n // Remove multiple spaces\n text = text.replace(/\\s+/g, ' ');\n\n return text;\n }\n}\n"],"names":["HelpFormatter","INDENT","COLUMN_GAP","MIN_DESCRIPTION_COLUMN","formatHelp","info","sections","push","formatSection","name","description","usage","commands","length","formatCommands","options","formatOptions","globalOptions","examples","join","formatError","error","command","lines","formatValidationError","value","paramName","validOptions","title","content","map","line","maxNameLength","Math","max","cmd","nameLength","aliasLength","aliases","padding","repeat","maxFlagsLength","opt","flags","defaultValue","undefined","validValues","validValuesLine","stripFormatting","text","replace","emojiPattern","trim"],"mappings":"AA4BA,OAAO,MAAMA;IACX,OAAwBC,SAAS,OAAO;IACxC,OAAwBC,aAAa,EAAE;IACvC,OAAwBC,yBAAyB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;QAE5B,OAAOD;IACT;AACF"}
1
+ {"version":3,"sources":["../../../src/cli/help-formatter.js"],"sourcesContent":["/**\n * Standardized CLI Help Formatter\n * Follows Unix/Linux conventions for help output\n */\n\nexport class HelpFormatter {\n static INDENT = ' ';\n static COLUMN_GAP = 2;\n static MIN_DESCRIPTION_COLUMN = 25;\n\n /**\n * Format main command help\n */\n static formatHelp(info) {\n const sections = [];\n\n // NAME section\n sections.push(this.formatSection('NAME', [`${info.name} - ${info.description}`]));\n\n // SYNOPSIS section\n if (info.usage) {\n sections.push(this.formatSection('SYNOPSIS', [info.usage]));\n }\n\n // COMMANDS section\n if (info.commands && info.commands.length > 0) {\n sections.push(this.formatSection('COMMANDS', this.formatCommands(info.commands)));\n }\n\n // OPTIONS section\n if (info.options && info.options.length > 0) {\n sections.push(this.formatSection('OPTIONS', this.formatOptions(info.options)));\n }\n\n // GLOBAL OPTIONS section\n if (info.globalOptions && info.globalOptions.length > 0) {\n sections.push(this.formatSection('GLOBAL OPTIONS', this.formatOptions(info.globalOptions)));\n }\n\n // EXAMPLES section\n if (info.examples && info.examples.length > 0) {\n sections.push(this.formatSection('EXAMPLES', info.examples));\n }\n\n // DETAILS section (additional information)\n if (info.details) {\n sections.push('\\n' + info.details);\n }\n\n // Footer\n if (info.commands && info.commands.length > 0) {\n sections.push(`Run '${info.name} <command> --help' for more information on a command.`);\n }\n\n return sections.join('\\n\\n');\n }\n\n /**\n * Format error message with usage hint\n */\n static formatError(error, command, usage) {\n const lines = [`Error: ${error}`, ''];\n\n if (usage) {\n lines.push(`Usage: ${usage}`);\n }\n\n lines.push(`Try '${command} --help' for more information.`);\n\n return lines.join('\\n');\n }\n\n /**\n * Format validation error with valid options\n */\n static formatValidationError(value, paramName, validOptions, command) {\n return this.formatError(\n `'${value}' is not a valid ${paramName}. Valid options are: ${validOptions.join(', ')}.`,\n command,\n );\n }\n\n static formatSection(title, content) {\n return `${title}\\n${content.map((line) => `${this.INDENT}${line}`).join('\\n')}`;\n }\n\n static formatCommands(commands) {\n const maxNameLength = Math.max(\n this.MIN_DESCRIPTION_COLUMN,\n ...commands.map((cmd) => {\n const nameLength = cmd.name.length;\n const aliasLength = cmd.aliases ? ` (${cmd.aliases.join(', ')})`.length : 0;\n return nameLength + aliasLength;\n }),\n );\n\n return commands.map((cmd) => {\n let name = cmd.name;\n if (cmd.aliases && cmd.aliases.length > 0) {\n name += ` (${cmd.aliases.join(', ')})`;\n }\n const padding = ' '.repeat(maxNameLength - name.length + this.COLUMN_GAP);\n return `${name}${padding}${cmd.description}`;\n });\n }\n\n static formatOptions(options) {\n const maxFlagsLength = Math.max(\n this.MIN_DESCRIPTION_COLUMN,\n ...options.map((opt) => opt.flags.length),\n );\n\n return options.map((opt) => {\n const padding = ' '.repeat(maxFlagsLength - opt.flags.length + this.COLUMN_GAP);\n let description = opt.description;\n\n // Add default value\n if (opt.defaultValue !== undefined) {\n description += ` [default: ${opt.defaultValue}]`;\n }\n\n // Add valid values on next line if present\n if (opt.validValues && opt.validValues.length > 0) {\n const validValuesLine =\n ' '.repeat(maxFlagsLength + this.COLUMN_GAP) + `Valid: ${opt.validValues.join(', ')}`;\n return `${opt.flags}${padding}${description}\\n${this.INDENT}${validValuesLine}`;\n }\n\n return `${opt.flags}${padding}${description}`;\n });\n }\n\n /**\n * Strip ANSI color codes and emojis from text\n */\n static stripFormatting(text) {\n // Remove ANSI color codes\n text = text.replace(/\\x1b\\[[0-9;]*m/g, '');\n\n // Remove common emojis used in the CLI\n const emojiPattern =\n /[\\u{1F300}-\\u{1F9FF}]|[\\u{2600}-\\u{27BF}]|[\\u{1F000}-\\u{1F6FF}]|[\\u{1F680}-\\u{1F6FF}]/gu;\n text = text.replace(emojiPattern, '').trim();\n\n // Remove multiple spaces\n text = text.replace(/\\s+/g, ' ');\n\n return text;\n }\n}\n"],"names":["HelpFormatter","INDENT","COLUMN_GAP","MIN_DESCRIPTION_COLUMN","formatHelp","info","sections","push","formatSection","name","description","usage","commands","length","formatCommands","options","formatOptions","globalOptions","examples","details","join","formatError","error","command","lines","formatValidationError","value","paramName","validOptions","title","content","map","line","maxNameLength","Math","max","cmd","nameLength","aliasLength","aliases","padding","repeat","maxFlagsLength","opt","flags","defaultValue","undefined","validValues","validValuesLine","stripFormatting","text","replace","emojiPattern","trim"],"mappings":"AAKA,OAAO,MAAMA;IACX,OAAOC,SAAS,OAAO;IACvB,OAAOC,aAAa,EAAE;IACtB,OAAOC,yBAAyB,GAAG;IAKnC,OAAOC,WAAWC,IAAI,EAAE;QACtB,MAAMC,WAAW,EAAE;QAGnBA,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,QAAQ;YAAC,GAAGH,KAAKI,IAAI,CAAC,GAAG,EAAEJ,KAAKK,WAAW,EAAE;SAAC;QAG/E,IAAIL,KAAKM,KAAK,EAAE;YACdL,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,YAAY;gBAACH,KAAKM,KAAK;aAAC;QAC3D;QAGA,IAAIN,KAAKO,QAAQ,IAAIP,KAAKO,QAAQ,CAACC,MAAM,GAAG,GAAG;YAC7CP,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,YAAY,IAAI,CAACM,cAAc,CAACT,KAAKO,QAAQ;QAChF;QAGA,IAAIP,KAAKU,OAAO,IAAIV,KAAKU,OAAO,CAACF,MAAM,GAAG,GAAG;YAC3CP,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,WAAW,IAAI,CAACQ,aAAa,CAACX,KAAKU,OAAO;QAC7E;QAGA,IAAIV,KAAKY,aAAa,IAAIZ,KAAKY,aAAa,CAACJ,MAAM,GAAG,GAAG;YACvDP,SAASC,IAAI,CAAC,IAAI,CAACC,aAAa,CAAC,kBAAkB,IAAI,CAACQ,aAAa,CAACX,KAAKY,aAAa;QAC1F;QAGA,IAAIZ,KAAKa,QAAQ,IAAIb,KAAKa,QAAQ,CAACL,MAAM,GAAG,GAAG;YAC7CP,SAASC,IAAI,CAAC,IAAI,CAACC,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,GAAGuB,IAAIC,KAAK,GAAGJ,UAAU9B,YAAY,EAAE,EAAE,IAAI,CAACT,MAAM,GAAG+C,iBAAiB;YACjF;YAEA,OAAO,GAAGL,IAAIC,KAAK,GAAGJ,UAAU9B,aAAa;QAC/C;IACF;IAKA,OAAOuC,gBAAgBC,IAAI,EAAE;QAE3BA,OAAOA,KAAKC,OAAO,CAAC,mBAAmB;QAGvC,MAAMC,eACJ;QACFF,OAAOA,KAAKC,OAAO,CAACC,cAAc,IAAIC,IAAI;QAG1CH,OAAOA,KAAKC,OAAO,CAAC,QAAQ;QAE5B,OAAOD;IACT;AACF"}AEgC,IAAIE,YAAY,CAAC,CAAC,CAAC;YAClD;YAGA,IAAIF,IAAII,WAAW,IAAIJ,IAAII,WAAW,CAACjC,MAAM,GAAG,GAAG;gBACjD,MAAMkC,kBACJ,IAAIP,MAAM,CAACC,iBAAiB,IAAI,CAACvC,UAAU,IAAI,CAAC,OAAO,EAAEwC,IAAII,WAAW,CAAC3B,IAAI,CAAC,OAAO;gBACvF,OAAO,GAAGuB,IAAIC,KAAK,GAAGJ,UAAU7B,YAAY,EAAE,EAAE,IAAI,CAACT,MAAM,GAAG8C,iBAAiB;YACjF;YAEA,OAAO,GAAGL,IAAIC,KAAK,GAAGJ,UAAU7B,aAAa;QAC/C;IACF;IAKA,OAAOsC,gBAAgBC,IAAY,EAAU;QAE3CA,OAAOA,KAAKC,OAAO,CAAC,mBAAmB;QAGvC,MAAMC,eACJ;QACFF,OAAOA,KAAKC,OAAO,CAACC,cAAc,IAAIC,IAAI;QAG1CH,OAAOA,KAAKC,OAAO,CAAC,QAAQ;QAE5B,OAAOD;IACT;AACF"}
@@ -1,144 +1,126 @@
1
- import { printSuccess, printError, printWarning, readJsonFile, writeJsonFile, fileExists } from '../utils.js';
2
- export async function configCommand(subArgs, flags) {
3
- const configCmd = subArgs[0];
4
- switch(configCmd){
5
- case 'init':
6
- await initConfig(subArgs, flags);
7
- break;
8
- case 'show':
9
- await showConfig(subArgs, flags);
10
- break;
11
- case 'get':
12
- await getConfigValue(subArgs, flags);
13
- break;
14
- case 'set':
15
- await setConfigValue(subArgs, flags);
16
- break;
17
- case 'validate':
18
- await validateConfig(subArgs, flags);
19
- break;
20
- case 'reset':
21
- await resetConfig(subArgs, flags);
22
- break;
23
- default:
24
- showConfigHelp();
25
- }
26
- }
27
- async function initConfig(subArgs, flags) {
28
- const force = subArgs.includes('--force') || subArgs.includes('-f');
29
- const configFile = 'claude-flow.config.json';
30
- try {
31
- const exists = await fileExists(configFile);
32
- if (exists && !force) {
33
- printWarning('Configuration file already exists');
34
- console.log('Use --force to overwrite existing configuration');
35
- return;
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import inquirer from 'inquirer';
4
+ import { ProviderManager } from '../../execution/provider-manager.js';
5
+ export function createConfigCommand() {
6
+ const config = new Command('config').description('Manage provider configuration');
7
+ config.command('set-provider').description('Set default provider').argument('<provider>', 'Provider name (anthropic, openrouter, onnx, gemini)').option('-m, --model <model>', 'Default model for provider').action(async (provider, options)=>{
8
+ try {
9
+ const manager = new ProviderManager();
10
+ await manager.setDefaultProvider(provider);
11
+ if (options.model) {
12
+ await manager.configureProvider(provider, {
13
+ model: options.model,
14
+ enabled: true
15
+ });
16
+ }
17
+ console.log(chalk.green(`✓ Default provider set to: ${provider}`));
18
+ if (options.model) {
19
+ console.log(chalk.green(`✓ Default model set to: ${options.model}`));
20
+ }
21
+ } catch (error) {
22
+ console.error(chalk.red('✗ Error:'), error.message);
23
+ process.exit(1);
36
24
  }
37
- printSuccess('Initializing Claude-Flow configuration...');
38
- const defaultConfig = {
39
- version: '1.0.71',
40
- terminal: {
41
- poolSize: 10,
42
- recycleAfter: 20,
43
- healthCheckInterval: 30000,
44
- type: 'auto'
45
- },
46
- orchestrator: {
47
- maxConcurrentTasks: 10,
48
- taskTimeout: 300000,
49
- defaultPriority: 5
50
- },
51
- memory: {
52
- backend: 'json',
53
- path: './memory/claude-flow-data.json',
54
- cacheSize: 1000,
55
- indexing: true
56
- },
57
- agents: {
58
- maxAgents: 20,
59
- defaultCapabilities: [
60
- 'research',
61
- 'code',
62
- 'terminal'
63
- ],
64
- resourceLimits: {
65
- memory: '1GB',
66
- cpu: '50%'
67
- }
68
- },
69
- mcp: {
70
- port: 3000,
71
- host: 'localhost',
72
- timeout: 30000
73
- },
74
- logging: {
75
- level: 'info',
76
- file: './claude-flow.log',
77
- maxSize: '10MB',
78
- maxFiles: 5
25
+ });
26
+ config.command('list-providers').alias('list').description('List configured providers').option('-f, --format <format>', 'Output format (text, json)', 'text').action(async (options)=>{
27
+ try {
28
+ const manager = new ProviderManager();
29
+ const providers = manager.listProviders();
30
+ const defaultProvider = manager.getDefaultProvider();
31
+ if (options.format === 'json') {
32
+ console.log(JSON.stringify({
33
+ defaultProvider,
34
+ providers
35
+ }, null, 2));
36
+ } else {
37
+ console.log(chalk.cyan('\n📋 Configured Providers:\n'));
38
+ console.log(chalk.white(`Default: ${chalk.bold(defaultProvider)}\n`));
39
+ providers.forEach((provider)=>{
40
+ const isDefault = provider.name === defaultProvider;
41
+ const prefix = isDefault ? chalk.green('●') : chalk.gray('○');
42
+ const status = provider.enabled ? chalk.green('enabled') : chalk.gray('disabled');
43
+ console.log(`${prefix} ${chalk.bold(provider.name)}`);
44
+ console.log(` Model: ${provider.model || 'default'}`);
45
+ console.log(` Priority: ${provider.priority || 'balanced'}`);
46
+ console.log(` Status: ${status}`);
47
+ console.log('');
48
+ });
79
49
  }
80
- };
81
- await writeJsonFile(configFile, defaultConfig);
82
- console.log(`✓ Created ${configFile}`);
83
- console.log('✓ Default settings configured');
84
- console.log('\nNext steps:');
85
- console.log('1. Review settings: claude-flow config show');
86
- console.log('2. Customize values: claude-flow config set <key> <value>');
87
- console.log('3. Validate config: claude-flow config validate');
88
- } catch (err) {
89
- printError(`Failed to initialize configuration: ${err.message}`);
90
- }
91
- }
92
- async function showConfig(subArgs, flags) {
93
- const configFile = 'claude-flow.config.json';
94
- const format = getFlag(subArgs, '--format') || 'pretty';
95
- try {
96
- const config = await readJsonFile(configFile);
97
- printSuccess('Current configuration:');
98
- if (format === 'json') {
99
- console.log(JSON.stringify(config, null, 2));
100
- } else {
101
- console.log('\n📋 System Configuration:');
102
- console.log(` Version: ${config.version || 'unknown'}`);
103
- console.log('\n🖥️ Terminal Pool:');
104
- console.log(` Pool Size: ${config.terminal?.poolSize || 10}`);
105
- console.log(` Recycle After: ${config.terminal?.recycleAfter || 20} commands`);
106
- console.log(` Health Check: ${config.terminal?.healthCheckInterval || 30000}ms`);
107
- console.log('\n🎭 Orchestrator:');
108
- console.log(` Max Concurrent Tasks: ${config.orchestrator?.maxConcurrentTasks || 10}`);
109
- console.log(` Task Timeout: ${config.orchestrator?.taskTimeout || 300000}ms`);
110
- console.log('\n💾 Memory:');
111
- console.log(` Backend: ${config.memory?.backend || 'json'}`);
112
- console.log(` Path: ${config.memory?.path || './memory/claude-flow-data.json'}`);
113
- console.log('\n🤖 Agents:');
114
- console.log(` Max Agents: ${config.agents?.maxAgents || 20}`);
115
- console.log(` Resource Limits: ${JSON.stringify(config.agents?.resourceLimits || {})}`);
50
+ } catch (error) {
51
+ console.error(chalk.red('✗ Error:'), error.message);
52
+ process.exit(1);
116
53
  }
117
- } catch (err) {
118
- printError('Configuration file not found');
119
- console.log('Run "claude-flow config init" to create default configuration');
120
- }
121
- }
122
- async function getConfigValue(subArgs, flags) {
123
- const key = subArgs[1];
124
- const configFile = 'claude-flow.config.json';
125
- if (!key) {
126
- printError('Usage: config get <key>');
127
- console.log('Examples:');
128
- console.log(' claude-flow config get terminal.poolSize');
129
- console.log(' claude-flow config get orchestrator.maxConcurrentTasks');
130
- return;
131
- }
132
- try {
133
- const config = await readJsonFile(configFile);
134
- const value = getNestedValue(config, key);
135
- if (value !== undefined) {
136
- console.log(`${key}: ${JSON.stringify(value)}`);
137
- } else {
138
- printWarning(`Configuration key '${key}' not found`);
54
+ });
55
+ config.command('wizard').description('Interactive provider configuration wizard').action(async ()=>{
56
+ try {
57
+ const manager = new ProviderManager();
58
+ console.log(chalk.cyan('\n🧙 Provider Configuration Wizard\n'));
59
+ const answers = await inquirer.prompt([
60
+ {
61
+ type: 'list',
62
+ name: 'defaultProvider',
63
+ message: 'Select default provider:',
64
+ choices: [
65
+ {
66
+ name: 'Anthropic (Highest quality)',
67
+ value: 'anthropic'
68
+ },
69
+ {
70
+ name: 'OpenRouter (99% cost savings)',
71
+ value: 'openrouter'
72
+ },
73
+ {
74
+ name: 'ONNX (Free local inference)',
75
+ value: 'onnx'
76
+ },
77
+ {
78
+ name: 'Gemini (Free tier)',
79
+ value: 'gemini'
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ type: 'list',
85
+ name: 'optimization',
86
+ message: 'Optimization priority:',
87
+ choices: [
88
+ {
89
+ name: 'Balanced (recommended)',
90
+ value: 'balanced'
91
+ },
92
+ {
93
+ name: 'Cost (cheapest)',
94
+ value: 'cost'
95
+ },
96
+ {
97
+ name: 'Quality (best results)',
98
+ value: 'quality'
99
+ },
100
+ {
101
+ name: 'Speed (fastest)',
102
+ value: 'speed'
103
+ },
104
+ {
105
+ name: 'Privacy (local only)',
106
+ value: 'privacy'
107
+ }
108
+ ]
109
+ }
110
+ ]);
111
+ await manager.setDefaultProvider(answers.defaultProvider);
112
+ console.log(chalk.green('\n✓ Configuration saved successfully!'));
113
+ console.log(chalk.gray(`\nDefault provider: ${answers.defaultProvider}`));
114
+ console.log(chalk.gray(`Optimization: ${answers.optimization}`));
115
+ } catch (error) {
116
+ console.error(chalk.red('\n✗ Error:'), error.message);
117
+ process.exit(1);
139
118
  }
140
- } catch (err) {
141
- printError('Configuration file not found');
119
+ });
120
+ return config;
121
+ }
122
+
123
+ //# sourceMappingURL=config.js.map printError('Configuration file not found');
142
124
  console.log('Run "claude-flow config init" to create configuration');
143
125
  }
144
126
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/simple-commands/config.js"],"sourcesContent":["// config.js - Configuration management commands\nimport {\n printSuccess,\n printError,\n printWarning,\n readJsonFile,\n writeJsonFile,\n fileExists,\n} from '../utils.js';\n\nexport async function configCommand(subArgs, flags) {\n const configCmd = subArgs[0];\n\n switch (configCmd) {\n case 'init':\n await initConfig(subArgs, flags);\n break;\n\n case 'show':\n await showConfig(subArgs, flags);\n break;\n\n case 'get':\n await getConfigValue(subArgs, flags);\n break;\n\n case 'set':\n await setConfigValue(subArgs, flags);\n break;\n\n case 'validate':\n await validateConfig(subArgs, flags);\n break;\n\n case 'reset':\n await resetConfig(subArgs, flags);\n break;\n\n default:\n showConfigHelp();\n }\n}\n\nasync function initConfig(subArgs, flags) {\n const force = subArgs.includes('--force') || subArgs.includes('-f');\n const configFile = 'claude-flow.config.json';\n\n try {\n // Check if config already exists\n const exists = await fileExists(configFile);\n if (exists && !force) {\n printWarning('Configuration file already exists');\n console.log('Use --force to overwrite existing configuration');\n return;\n }\n\n printSuccess('Initializing Claude-Flow configuration...');\n\n // Create default configuration\n const defaultConfig = {\n version: '1.0.71',\n terminal: {\n poolSize: 10,\n recycleAfter: 20,\n healthCheckInterval: 30000,\n type: 'auto',\n },\n orchestrator: {\n maxConcurrentTasks: 10,\n taskTimeout: 300000,\n defaultPriority: 5,\n },\n memory: {\n backend: 'json',\n path: './memory/claude-flow-data.json',\n cacheSize: 1000,\n indexing: true,\n },\n agents: {\n maxAgents: 20,\n defaultCapabilities: ['research', 'code', 'terminal'],\n resourceLimits: {\n memory: '1GB',\n cpu: '50%',\n },\n },\n mcp: {\n port: 3000,\n host: 'localhost',\n timeout: 30000,\n },\n logging: {\n level: 'info',\n file: './claude-flow.log',\n maxSize: '10MB',\n maxFiles: 5,\n },\n };\n\n await writeJsonFile(configFile, defaultConfig);\n console.log(`✓ Created ${configFile}`);\n console.log('✓ Default settings configured');\n console.log('\\nNext steps:');\n console.log('1. Review settings: claude-flow config show');\n console.log('2. Customize values: claude-flow config set <key> <value>');\n console.log('3. Validate config: claude-flow config validate');\n } catch (err) {\n printError(`Failed to initialize configuration: ${err.message}`);\n }\n}\n\nasync function showConfig(subArgs, flags) {\n const configFile = 'claude-flow.config.json';\n const format = getFlag(subArgs, '--format') || 'pretty';\n\n try {\n const config = await readJsonFile(configFile);\n\n printSuccess('Current configuration:');\n\n if (format === 'json') {\n console.log(JSON.stringify(config, null, 2));\n } else {\n // Pretty format\n console.log('\\n📋 System Configuration:');\n console.log(` Version: ${config.version || 'unknown'}`);\n console.log('\\n🖥️ Terminal Pool:');\n console.log(` Pool Size: ${config.terminal?.poolSize || 10}`);\n console.log(` Recycle After: ${config.terminal?.recycleAfter || 20} commands`);\n console.log(` Health Check: ${config.terminal?.healthCheckInterval || 30000}ms`);\n console.log('\\n🎭 Orchestrator:');\n console.log(` Max Concurrent Tasks: ${config.orchestrator?.maxConcurrentTasks || 10}`);\n console.log(` Task Timeout: ${config.orchestrator?.taskTimeout || 300000}ms`);\n console.log('\\n💾 Memory:');\n console.log(` Backend: ${config.memory?.backend || 'json'}`);\n console.log(` Path: ${config.memory?.path || './memory/claude-flow-data.json'}`);\n console.log('\\n🤖 Agents:');\n console.log(` Max Agents: ${config.agents?.maxAgents || 20}`);\n console.log(` Resource Limits: ${JSON.stringify(config.agents?.resourceLimits || {})}`);\n }\n } catch (err) {\n printError('Configuration file not found');\n console.log('Run \"claude-flow config init\" to create default configuration');\n }\n}\n\nasync function getConfigValue(subArgs, flags) {\n const key = subArgs[1];\n const configFile = 'claude-flow.config.json';\n\n if (!key) {\n printError('Usage: config get <key>');\n console.log('Examples:');\n console.log(' claude-flow config get terminal.poolSize');\n console.log(' claude-flow config get orchestrator.maxConcurrentTasks');\n return;\n }\n\n try {\n const config = await readJsonFile(configFile);\n const value = getNestedValue(config, key);\n\n if (value !== undefined) {\n console.log(`${key}: ${JSON.stringify(value)}`);\n } else {\n printWarning(`Configuration key '${key}' not found`);\n }\n } catch (err) {\n printError('Configuration file not found');\n console.log('Run \"claude-flow config init\" to create configuration');\n }\n}\n\nasync function setConfigValue(subArgs, flags) {\n const key = subArgs[1];\n const value = subArgs[2];\n const configFile = 'claude-flow.config.json';\n\n if (!key || value === undefined) {\n printError('Usage: config set <key> <value>');\n console.log('Examples:');\n console.log(' claude-flow config set terminal.poolSize 15');\n console.log(' claude-flow config set orchestrator.taskTimeout 600000');\n return;\n }\n\n try {\n let config = await readJsonFile(configFile, {});\n\n // Parse value appropriately\n let parsedValue = value;\n if (value === 'true') parsedValue = true;\n else if (value === 'false') parsedValue = false;\n else if (!isNaN(value) && value.trim() !== '') parsedValue = Number(value);\n\n // Set nested value\n setNestedValue(config, key, parsedValue);\n\n await writeJsonFile(configFile, config);\n printSuccess(`Set ${key} = ${JSON.stringify(parsedValue)}`);\n } catch (err) {\n printError(`Failed to set configuration: ${err.message}`);\n }\n}\n\nasync function validateConfig(subArgs, flags) {\n const configFile = 'claude-flow.config.json';\n\n try {\n const config = await readJsonFile(configFile);\n\n printSuccess('Validating configuration...');\n\n const errors = [];\n const warnings = [];\n\n // Validate required sections\n const requiredSections = ['terminal', 'orchestrator', 'memory'];\n for (const section of requiredSections) {\n if (!config[section]) {\n errors.push(`Missing required section: ${section}`);\n }\n }\n\n // Validate specific values\n if (\n config.terminal?.poolSize &&\n (config.terminal.poolSize < 1 || config.terminal.poolSize > 100)\n ) {\n warnings.push('Terminal pool size should be between 1 and 100');\n }\n\n if (config.orchestrator?.maxConcurrentTasks && config.orchestrator.maxConcurrentTasks < 1) {\n errors.push('Max concurrent tasks must be at least 1');\n }\n\n if (config.agents?.maxAgents && config.agents.maxAgents < 1) {\n errors.push('Max agents must be at least 1');\n }\n\n // Report results\n if (errors.length === 0 && warnings.length === 0) {\n printSuccess('✅ Configuration is valid');\n } else {\n if (errors.length > 0) {\n printError(`Found ${errors.length} error(s):`);\n errors.forEach((error) => console.log(` ❌ ${error}`));\n }\n\n if (warnings.length > 0) {\n printWarning(`Found ${warnings.length} warning(s):`);\n warnings.forEach((warning) => console.log(` ⚠️ ${warning}`));\n }\n }\n } catch (err) {\n printError('Configuration file not found or invalid');\n console.log('Run \"claude-flow config init\" to create valid configuration');\n }\n}\n\nasync function resetConfig(subArgs, flags) {\n const force = subArgs.includes('--force') || subArgs.includes('-f');\n\n if (!force) {\n printWarning('This will reset configuration to defaults');\n console.log('Use --force to confirm reset');\n return;\n }\n\n await initConfig(['--force'], flags);\n printSuccess('Configuration reset to defaults');\n}\n\n// Helper functions\nfunction getNestedValue(obj, path) {\n return path.split('.').reduce((current, key) => current?.[key], obj);\n}\n\nfunction setNestedValue(obj, path, value) {\n const keys = path.split('.');\n const last = keys.pop();\n const target = keys.reduce((current, key) => {\n if (!current[key]) current[key] = {};\n return current[key];\n }, obj);\n target[last] = value;\n}\n\nfunction getFlag(args, flagName) {\n const index = args.indexOf(flagName);\n return index !== -1 && index + 1 < args.length ? args[index + 1] : null;\n}\n\n// fileExists is now imported from utils.js\n\nfunction showConfigHelp() {\n console.log('Configuration commands:');\n console.log(' init [--force] Create default configuration');\n console.log(' show [--format json] Display current configuration');\n console.log(' get <key> Get configuration value');\n console.log(' set <key> <value> Set configuration value');\n console.log(' validate Validate configuration');\n console.log(' reset --force Reset to defaults');\n console.log();\n console.log('Configuration Keys:');\n console.log(' terminal.poolSize Terminal pool size');\n console.log(' terminal.recycleAfter Commands before recycle');\n console.log(' orchestrator.maxConcurrentTasks Max parallel tasks');\n console.log(' orchestrator.taskTimeout Task timeout in ms');\n console.log(' memory.backend Memory storage backend');\n console.log(' memory.path Memory database path');\n console.log(' agents.maxAgents Maximum number of agents');\n console.log();\n console.log('Examples:');\n console.log(' claude-flow config init');\n console.log(' claude-flow config set terminal.poolSize 15');\n console.log(' claude-flow config get orchestrator.maxConcurrentTasks');\n console.log(' claude-flow config validate');\n}\n"],"names":["printSuccess","printError","printWarning","readJsonFile","writeJsonFile","fileExists","configCommand","subArgs","flags","configCmd","initConfig","showConfig","getConfigValue","setConfigValue","validateConfig","resetConfig","showConfigHelp","force","includes","configFile","exists","console","log","defaultConfig","version","terminal","poolSize","recycleAfter","healthCheckInterval","type","orchestrator","maxConcurrentTasks","taskTimeout","defaultPriority","memory","backend","path","cacheSize","indexing","agents","maxAgents","defaultCapabilities","resourceLimits","cpu","mcp","port","host","timeout","logging","level","file","maxSize","maxFiles","err","message","format","getFlag","config","JSON","stringify","key","value","getNestedValue","undefined","parsedValue","isNaN","trim","Number","setNestedValue","errors","warnings","requiredSections","section","push","length","forEach","error","warning","obj","split","reduce","current","keys","last","pop","target","args","flagName","index","indexOf"],"mappings":"AACA,SACEA,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,YAAY,EACZC,aAAa,EACbC,UAAU,QACL,cAAc;AAErB,OAAO,eAAeC,cAAcC,OAAO,EAAEC,KAAK;IAChD,MAAMC,YAAYF,OAAO,CAAC,EAAE;IAE5B,OAAQE;QACN,KAAK;YACH,MAAMC,WAAWH,SAASC;YAC1B;QAEF,KAAK;YACH,MAAMG,WAAWJ,SAASC;YAC1B;QAEF,KAAK;YACH,MAAMI,eAAeL,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMK,eAAeN,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMM,eAAeP,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMO,YAAYR,SAASC;YAC3B;QAEF;YACEQ;IACJ;AACF;AAEA,eAAeN,WAAWH,OAAO,EAAEC,KAAK;IACtC,MAAMS,QAAQV,QAAQW,QAAQ,CAAC,cAAcX,QAAQW,QAAQ,CAAC;IAC9D,MAAMC,aAAa;IAEnB,IAAI;QAEF,MAAMC,SAAS,MAAMf,WAAWc;QAChC,IAAIC,UAAU,CAACH,OAAO;YACpBf,aAAa;YACbmB,QAAQC,GAAG,CAAC;YACZ;QACF;QAEAtB,aAAa;QAGb,MAAMuB,gBAAgB;YACpBC,SAAS;YACTC,UAAU;gBACRC,UAAU;gBACVC,cAAc;gBACdC,qBAAqB;gBACrBC,MAAM;YACR;YACAC,cAAc;gBACZC,oBAAoB;gBACpBC,aAAa;gBACbC,iBAAiB;YACnB;YACAC,QAAQ;gBACNC,S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-commands/config.ts"],"sourcesContent":["/**\n * Config CLI Commands - Manage provider configuration\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport inquirer from 'inquirer';\nimport { ProviderManager } from '../../execution/provider-manager.js';\n\nexport function createConfigCommand(): Command {\n const config = new Command('config')\n .description('Manage provider configuration');\n\n // config set-provider command\n config\n .command('set-provider')\n .description('Set default provider')\n .argument('<provider>', 'Provider name (anthropic, openrouter, onnx, gemini)')\n .option('-m, --model <model>', 'Default model for provider')\n .action(async (provider, options) => {\n try {\n const manager = new ProviderManager();\n\n await manager.setDefaultProvider(provider);\n\n if (options.model) {\n await manager.configureProvider(provider, {\n model: options.model,\n enabled: true,\n } as any);\n }\n\n console.log(chalk.green(`✓ Default provider set to: ${provider}`));\n if (options.model) {\n console.log(chalk.green(`✓ Default model set to: ${options.model}`));\n }\n } catch (error: any) {\n console.error(chalk.red('✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\n // config list-providers command\n config\n .command('list-providers')\n .alias('list')\n .description('List configured providers')\n .option('-f, --format <format>', 'Output format (text, json)', 'text')\n .action(async (options) => {\n try {\n const manager = new ProviderManager();\n const providers = manager.listProviders();\n const defaultProvider = manager.getDefaultProvider();\n\n if (options.format === 'json') {\n console.log(JSON.stringify({ defaultProvider, providers }, null, 2));\n } else {\n console.log(chalk.cyan('\\n📋 Configured Providers:\\n'));\n console.log(chalk.white(`Default: ${chalk.bold(defaultProvider)}\\n`));\n\n providers.forEach(provider => {\n const isDefault = provider.name === defaultProvider;\n const prefix = isDefault ? chalk.green('●') : chalk.gray('○');\n const status = provider.enabled ? chalk.green('enabled') : chalk.gray('disabled');\n\n console.log(`${prefix} ${chalk.bold(provider.name)}`);\n console.log(` Model: ${provider.model || 'default'}`);\n console.log(` Priority: ${provider.priority || 'balanced'}`);\n console.log(` Status: ${status}`);\n console.log('');\n });\n }\n } catch (error: any) {\n console.error(chalk.red('✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\n // config wizard command\n config\n .command('wizard')\n .description('Interactive provider configuration wizard')\n .action(async () => {\n try {\n const manager = new ProviderManager();\n\n console.log(chalk.cyan('\\n🧙 Provider Configuration Wizard\\n'));\n\n const answers = await inquirer.prompt([\n {\n type: 'list',\n name: 'defaultProvider',\n message: 'Select default provider:',\n choices: [\n { name: 'Anthropic (Highest quality)', value: 'anthropic' },\n { name: 'OpenRouter (99% cost savings)', value: 'openrouter' },\n { name: 'ONNX (Free local inference)', value: 'onnx' },\n { name: 'Gemini (Free tier)', value: 'gemini' },\n ],\n },\n {\n type: 'list',\n name: 'optimization',\n message: 'Optimization priority:',\n choices: [\n { name: 'Balanced (recommended)', value: 'balanced' },\n { name: 'Cost (cheapest)', value: 'cost' },\n { name: 'Quality (best results)', value: 'quality' },\n { name: 'Speed (fastest)', value: 'speed' },\n { name: 'Privacy (local only)', value: 'privacy' },\n ],\n },\n ]);\n\n await manager.setDefaultProvider(answers.defaultProvider);\n\n console.log(chalk.green('\\n✓ Configuration saved successfully!'));\n console.log(chalk.gray(`\\nDefault provider: ${answers.defaultProvider}`));\n console.log(chalk.gray(`Optimization: ${answers.optimization}`));\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\n return config;\n}\n"],"names":["Command","chalk","inquirer","ProviderManager","createConfigCommand","config","description","command","argument","option","action","provider","options","manager","setDefaultProvider","model","configureProvider","enabled","console","log","green","error","red","message","process","exit","alias","providers","listProviders","defaultProvider","getDefaultProvider","format","JSON","stringify","cyan","white","bold","forEach","isDefault","name","prefix","gray","status","priority","answers","prompt","type","choices","value","optimization"],"mappings":"AAIA,SAASA,OAAO,QAAQ,YAAY;AACpC,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,cAAc,WAAW;AAChC,SAASC,eAAe,QAAQ,sCAAsC;AAEtE,OAAO,SAASC;IACd,MAAMC,SAAS,IAAIL,QAAQ,UACxBM,WAAW,CAAC;IAGfD,OACGE,OAAO,CAAC,gBACRD,WAAW,CAAC,wBACZE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BS,OAAO;wBAAO;wBACzC;4BAAET,MAAM;4BAA0BS,OAAO;wBAAU;wBACnD;4BAAET,MAAM;4BAAmBS,OAAO;wBAAQ;wBAC1C;4BAAET,MAAM;4BAAwBS,OAAO;wBAAU;qBAClD;gBACH;aACD;YAED,MAAMnC,QAAQC,kBAAkB,CAAC8B,QAAQf,eAAe;YAExDX,QAAQC,GAAG,CAAClB,MAAMmB,KAAK,CAAC;YACxBF,QAAQC,GAAG,CAAClB,MAAMwC,IAAI,CAAC,CAAC,oBAAoB,EAAEG,QAAQf,eAAe,EAAE;YACvEX,QAAQC,GAAG,CAAClB,MAAMwC,IAAI,CAAC,CAAC,cAAc,EAAEG,QAAQK,YAAY,EAAE;QAChE,EAAE,OAAO5B,OAAY;YACnBH,QAAQG,KAAK,CAACpB,MAAMqB,GAAG,CAAC,eAAeD,MAAME,OAAO;YACpDC,QAAQC,IAAI,CAAC;QACf;IACF;IAEF,OAAOpB;AACT"}lags) {\n const force = subArgs.includes('--force') || subArgs.includes('-f');\n\n if (!force) {\n printWarning('This will reset configuration to defaults');\n console.log('Use --force to confirm reset');\n return;\n }\n\n await initConfig(['--force'], flags);\n printSuccess('Configuration reset to defaults');\n}\n\n// Helper functions\nfunction getNestedValue(obj, path) {\n return path.split('.').reduce((current, key) => current?.[key], obj);\n}\n\nfunction setNestedValue(obj, path, value) {\n const keys = path.split('.');\n const last = keys.pop();\n const target = keys.reduce((current, key) => {\n if (!current[key]) current[key] = {};\n return current[key];\n }, obj);\n target[last] = value;\n}\n\nfunction getFlag(args, flagName) {\n const index = args.indexOf(flagName);\n return index !== -1 && index + 1 < args.length ? args[index + 1] : null;\n}\n\n// fileExists is now imported from utils.js\n\nfunction showConfigHelp() {\n console.log('Configuration commands:');\n console.log(' init [--force] Create default configuration');\n console.log(' show [--format json] Display current configuration');\n console.log(' get <key> Get configuration value');\n console.log(' set <key> <value> Set configuration value');\n console.log(' validate Validate configuration');\n console.log(' reset --force Reset to defaults');\n console.log();\n console.log('Configuration Keys:');\n console.log(' terminal.poolSize Terminal pool size');\n console.log(' terminal.recycleAfter Commands before recycle');\n console.log(' orchestrator.maxConcurrentTasks Max parallel tasks');\n console.log(' orchestrator.taskTimeout Task timeout in ms');\n console.log(' memory.backend Memory storage backend');\n console.log(' memory.path Memory database path');\n console.log(' agents.maxAgents Maximum number of agents');\n console.log();\n console.log('Examples:');\n console.log(' claude-flow config init');\n console.log(' claude-flow config set terminal.poolSize 15');\n console.log(' claude-flow config get orchestrator.maxConcurrentTasks');\n console.log(' claude-flow config validate');\n}\n"],"names":["printSuccess","printError","printWarning","readJsonFile","writeJsonFile","fileExists","configCommand","subArgs","flags","configCmd","initConfig","showConfig","getConfigValue","setConfigValue","validateConfig","resetConfig","showConfigHelp","force","includes","configFile","exists","console","log","defaultConfig","version","terminal","poolSize","recycleAfter","healthCheckInterval","type","orchestrator","maxConcurrentTasks","taskTimeout","defaultPriority","memory","backend","path","cacheSize","indexing","agents","maxAgents","defaultCapabilities","resourceLimits","cpu","mcp","port","host","timeout","logging","level","file","maxSize","maxFiles","err","message","format","getFlag","config","JSON","stringify","key","value","getNestedValue","undefined","parsedValue","isNaN","trim","Number","setNestedValue","errors","warnings","requiredSections","section","push","length","forEach","error","warning","obj","split","reduce","current","keys","last","pop","target","args","flagName","index","indexOf"],"mappings":"AACA,SACEA,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,YAAY,EACZC,aAAa,EACbC,UAAU,QACL,cAAc;AAErB,OAAO,eAAeC,cAAcC,OAAO,EAAEC,KAAK;IAChD,MAAMC,YAAYF,OAAO,CAAC,EAAE;IAE5B,OAAQE;QACN,KAAK;YACH,MAAMC,WAAWH,SAASC;YAC1B;QAEF,KAAK;YACH,MAAMG,WAAWJ,SAASC;YAC1B;QAEF,KAAK;YACH,MAAMI,eAAeL,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMK,eAAeN,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMM,eAAeP,SAASC;YAC9B;QAEF,KA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,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG;IACXD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG;IACXD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd"}
@@ -328,9 +328,15 @@ async function detectMemoryMode(flags, subArgs) {
328
328
  printInfo('🗄️ Initialized SQLite backend (.swarm/memory.db)');
329
329
  return 'reasoningbank';
330
330
  } catch (error) {
331
- printWarning(`⚠️ SQLite unavailable, using JSON fallback`);
332
- printWarning(` Reason: ${error.message}`);
333
- return 'basic';
331
+ const isBetterSqliteError = error.message?.includes('BetterSqlite3') || error.message?.includes('better-sqlite3');
332
+ const isNpx = process.env.npm_config_user_agent?.includes('npx') || process.cwd().includes('_npx');
333
+ if (isBetterSqliteError && isNpx) {
334
+ return 'basic';
335
+ } else {
336
+ printWarning(`⚠️ SQLite unavailable, using JSON fallback`);
337
+ printWarning(` Reason: ${error.message}`);
338
+ return 'basic';
339
+ }
334
340
  }
335
341
  }
336
342
  async function isReasoningBankInitialized() {