claude-flow 2.7.25 → 2.7.26
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 +1 -1
- package/dist/src/cli/help-formatter.js +0 -5
- package/dist/src/cli/simple-cli.js +172 -182
- package/dist/src/cli/simple-commands/config.js +257 -115
- package/dist/src/cli/simple-commands/config.js.map +1 -1
- package/dist/src/core/version.js +1 -1
- package/docs/TRANSFORMER_INITIALIZATION_ISSUE.md +89 -17
- package/docs/V2.7.25_RELEASE_NOTES.md +249 -0
- package/package.json +2 -2
|
@@ -1,123 +1,265 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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;
|
|
36
|
+
}
|
|
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
|
|
20
79
|
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
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 || {})}`);
|
|
24
116
|
}
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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`);
|
|
139
|
+
}
|
|
140
|
+
} catch (err) {
|
|
141
|
+
printError('Configuration file not found');
|
|
142
|
+
console.log('Run "claude-flow config init" to create configuration');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async function setConfigValue(subArgs, flags) {
|
|
146
|
+
const key = subArgs[1];
|
|
147
|
+
const value = subArgs[2];
|
|
148
|
+
const configFile = 'claude-flow.config.json';
|
|
149
|
+
if (!key || value === undefined) {
|
|
150
|
+
printError('Usage: config set <key> <value>');
|
|
151
|
+
console.log('Examples:');
|
|
152
|
+
console.log(' claude-flow config set terminal.poolSize 15');
|
|
153
|
+
console.log(' claude-flow config set orchestrator.taskTimeout 600000');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
let config = await readJsonFile(configFile, {});
|
|
158
|
+
let parsedValue = value;
|
|
159
|
+
if (value === 'true') parsedValue = true;
|
|
160
|
+
else if (value === 'false') parsedValue = false;
|
|
161
|
+
else if (!isNaN(value) && value.trim() !== '') parsedValue = Number(value);
|
|
162
|
+
setNestedValue(config, key, parsedValue);
|
|
163
|
+
await writeJsonFile(configFile, config);
|
|
164
|
+
printSuccess(`Set ${key} = ${JSON.stringify(parsedValue)}`);
|
|
165
|
+
} catch (err) {
|
|
166
|
+
printError(`Failed to set configuration: ${err.message}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async function validateConfig(subArgs, flags) {
|
|
170
|
+
const configFile = 'claude-flow.config.json';
|
|
171
|
+
try {
|
|
172
|
+
const config = await readJsonFile(configFile);
|
|
173
|
+
printSuccess('Validating configuration...');
|
|
174
|
+
const errors = [];
|
|
175
|
+
const warnings = [];
|
|
176
|
+
const requiredSections = [
|
|
177
|
+
'terminal',
|
|
178
|
+
'orchestrator',
|
|
179
|
+
'memory'
|
|
180
|
+
];
|
|
181
|
+
for (const section of requiredSections){
|
|
182
|
+
if (!config[section]) {
|
|
183
|
+
errors.push(`Missing required section: ${section}`);
|
|
49
184
|
}
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.error(chalk.red('✗ Error:'), error.message);
|
|
52
|
-
process.exit(1);
|
|
53
185
|
}
|
|
54
|
-
|
|
55
|
-
|
|
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);
|
|
186
|
+
if (config.terminal?.poolSize && (config.terminal.poolSize < 1 || config.terminal.poolSize > 100)) {
|
|
187
|
+
warnings.push('Terminal pool size should be between 1 and 100');
|
|
118
188
|
}
|
|
119
|
-
|
|
120
|
-
|
|
189
|
+
if (config.orchestrator?.maxConcurrentTasks && config.orchestrator.maxConcurrentTasks < 1) {
|
|
190
|
+
errors.push('Max concurrent tasks must be at least 1');
|
|
191
|
+
}
|
|
192
|
+
if (config.agents?.maxAgents && config.agents.maxAgents < 1) {
|
|
193
|
+
errors.push('Max agents must be at least 1');
|
|
194
|
+
}
|
|
195
|
+
if (errors.length === 0 && warnings.length === 0) {
|
|
196
|
+
printSuccess('✅ Configuration is valid');
|
|
197
|
+
} else {
|
|
198
|
+
if (errors.length > 0) {
|
|
199
|
+
printError(`Found ${errors.length} error(s):`);
|
|
200
|
+
errors.forEach((error)=>console.log(` ❌ ${error}`));
|
|
201
|
+
}
|
|
202
|
+
if (warnings.length > 0) {
|
|
203
|
+
printWarning(`Found ${warnings.length} warning(s):`);
|
|
204
|
+
warnings.forEach((warning)=>console.log(` ⚠️ ${warning}`));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
} catch (err) {
|
|
208
|
+
printError('Configuration file not found or invalid');
|
|
209
|
+
console.log('Run "claude-flow config init" to create valid configuration');
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async function resetConfig(subArgs, flags) {
|
|
213
|
+
const force = subArgs.includes('--force') || subArgs.includes('-f');
|
|
214
|
+
if (!force) {
|
|
215
|
+
printWarning('This will reset configuration to defaults');
|
|
216
|
+
console.log('Use --force to confirm reset');
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
await initConfig([
|
|
220
|
+
'--force'
|
|
221
|
+
], flags);
|
|
222
|
+
printSuccess('Configuration reset to defaults');
|
|
223
|
+
}
|
|
224
|
+
function getNestedValue(obj, path) {
|
|
225
|
+
return path.split('.').reduce((current, key)=>current?.[key], obj);
|
|
226
|
+
}
|
|
227
|
+
function setNestedValue(obj, path, value) {
|
|
228
|
+
const keys = path.split('.');
|
|
229
|
+
const last = keys.pop();
|
|
230
|
+
const target = keys.reduce((current, key)=>{
|
|
231
|
+
if (!current[key]) current[key] = {};
|
|
232
|
+
return current[key];
|
|
233
|
+
}, obj);
|
|
234
|
+
target[last] = value;
|
|
235
|
+
}
|
|
236
|
+
function getFlag(args, flagName) {
|
|
237
|
+
const index = args.indexOf(flagName);
|
|
238
|
+
return index !== -1 && index + 1 < args.length ? args[index + 1] : null;
|
|
239
|
+
}
|
|
240
|
+
function showConfigHelp() {
|
|
241
|
+
console.log('Configuration commands:');
|
|
242
|
+
console.log(' init [--force] Create default configuration');
|
|
243
|
+
console.log(' show [--format json] Display current configuration');
|
|
244
|
+
console.log(' get <key> Get configuration value');
|
|
245
|
+
console.log(' set <key> <value> Set configuration value');
|
|
246
|
+
console.log(' validate Validate configuration');
|
|
247
|
+
console.log(' reset --force Reset to defaults');
|
|
248
|
+
console.log();
|
|
249
|
+
console.log('Configuration Keys:');
|
|
250
|
+
console.log(' terminal.poolSize Terminal pool size');
|
|
251
|
+
console.log(' terminal.recycleAfter Commands before recycle');
|
|
252
|
+
console.log(' orchestrator.maxConcurrentTasks Max parallel tasks');
|
|
253
|
+
console.log(' orchestrator.taskTimeout Task timeout in ms');
|
|
254
|
+
console.log(' memory.backend Memory storage backend');
|
|
255
|
+
console.log(' memory.path Memory database path');
|
|
256
|
+
console.log(' agents.maxAgents Maximum number of agents');
|
|
257
|
+
console.log();
|
|
258
|
+
console.log('Examples:');
|
|
259
|
+
console.log(' claude-flow config init');
|
|
260
|
+
console.log(' claude-flow config set terminal.poolSize 15');
|
|
261
|
+
console.log(' claude-flow config get orchestrator.maxConcurrentTasks');
|
|
262
|
+
console.log(' claude-flow config validate');
|
|
121
263
|
}
|
|
122
264
|
|
|
123
265
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/simple-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,MA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ACNhB,SAAS;oBACTwB,SAAS;wBACP;4BAAER,MAAM;4BAA0BS,OAAO;wBAAW;wBACpD;4BAAET,MAAM;4BAAmBS,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;QA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,QAAQ,EAAE,GAAG;AACrE;AAIA,SAASxE;IACPK,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;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"}
|
|
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;Y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AAKA,QAAQ,IAAIF,KAAKZ,MAAM,GAAGY,IAAI,CAACE,QAAQ,EAAE,GAAG;AACrE;AAIA,SAASxE;IACPK,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;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"}
|
package/dist/src/core/version.js
CHANGED
|
@@ -1,19 +1,50 @@
|
|
|
1
1
|
# Transformer Model Initialization Issue in npx
|
|
2
2
|
|
|
3
|
-
## Status:
|
|
3
|
+
## Status: ✅ RESOLVED in v2.7.25
|
|
4
4
|
|
|
5
|
-
**Date:**
|
|
6
|
-
**
|
|
7
|
-
**
|
|
5
|
+
**Date:** January 25, 2025
|
|
6
|
+
**Resolution:** agentic-flow@1.8.9 detects npx environment and skips transformer loading
|
|
7
|
+
**Versions:** claude-flow@2.7.25, agentic-flow@1.8.9
|
|
8
|
+
**Impact:** Zero - Clean user experience with appropriate messaging
|
|
8
9
|
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
+
## Historical Context (Issue from v2.7.24)
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
**Previous Issue:** October 25, 2025
|
|
15
|
+
**Affected Versions:** claude-flow@2.7.24, agentic-flow@1.8.7
|
|
16
|
+
**Impact:** Low - System worked but showed confusing errors
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Resolution (v2.7.25 with agentic-flow@1.8.9)
|
|
16
21
|
|
|
22
|
+
**Solution Implemented:**
|
|
23
|
+
- NPX environment detection added to agentic-flow@1.8.9
|
|
24
|
+
- Transformer initialization skipped automatically in npx
|
|
25
|
+
- Clean, professional output with helpful user guidance
|
|
26
|
+
- Hash-based embeddings used by default in npx
|
|
27
|
+
|
|
28
|
+
**Result:**
|
|
29
|
+
```bash
|
|
30
|
+
npx claude-flow@alpha memory store "test" "value"
|
|
31
|
+
|
|
32
|
+
[Embeddings] NPX environment detected - using hash-based embeddings
|
|
33
|
+
[Embeddings] For semantic search, install globally: npm install -g claude-flow
|
|
34
|
+
✅ Stored successfully
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
No more ONNX/WASM errors! Clean user experience maintained.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Historical Summary (v2.7.24 Issue)
|
|
42
|
+
|
|
43
|
+
When using `npx claude-flow@alpha memory` commands in v2.7.24, the local transformer model (Xenova/all-MiniLM-L6-v2) failed to initialize in npx temporary directories due to ONNX runtime and WASM backend issues. The system gracefully fell back to hash-based embeddings, maintaining full functionality but showing confusing error messages.
|
|
44
|
+
|
|
45
|
+
## Historical Error Output (v2.7.24)
|
|
46
|
+
|
|
47
|
+
**Before fix:**
|
|
17
48
|
```bash
|
|
18
49
|
npx claude-flow@alpha memory store "test" "Local embeddings working!"
|
|
19
50
|
|
|
@@ -33,6 +64,15 @@ Using `wasm` as a fallback.
|
|
|
33
64
|
✅ ✅ Stored successfully in ReasoningBank ← Still works!
|
|
34
65
|
```
|
|
35
66
|
|
|
67
|
+
**After fix (v2.7.25):**
|
|
68
|
+
```bash
|
|
69
|
+
npx claude-flow@alpha memory store "test" "Clean experience!"
|
|
70
|
+
|
|
71
|
+
[Embeddings] NPX environment detected - using hash-based embeddings
|
|
72
|
+
[Embeddings] For semantic search, install globally: npm install -g claude-flow
|
|
73
|
+
✅ Stored successfully in ReasoningBank
|
|
74
|
+
```
|
|
75
|
+
|
|
36
76
|
## Root Causes
|
|
37
77
|
|
|
38
78
|
### 1. ONNX Runtime Issue
|
|
@@ -347,16 +387,48 @@ For best semantic search quality, install globally instead of using npx.
|
|
|
347
387
|
|
|
348
388
|
---
|
|
349
389
|
|
|
350
|
-
##
|
|
390
|
+
## ✅ Resolution Implemented (v2.7.25)
|
|
391
|
+
|
|
392
|
+
The transformer initialization issue has been **completely resolved** in v2.7.25 with agentic-flow@1.8.9.
|
|
393
|
+
|
|
394
|
+
**What was implemented:**
|
|
395
|
+
1. ✅ NPX environment detection
|
|
396
|
+
2. ✅ Automatic skip of transformer loading in npx
|
|
397
|
+
3. ✅ Clean, helpful user messaging
|
|
398
|
+
4. ✅ Full backward compatibility
|
|
399
|
+
|
|
400
|
+
**Implementation Details (agentic-flow@1.8.9):**
|
|
401
|
+
```typescript
|
|
402
|
+
// NPX detection added to embeddings.ts
|
|
403
|
+
const isNpx = process.env.npm_config_user_agent?.includes('npx') ||
|
|
404
|
+
process.cwd().includes('_npx') ||
|
|
405
|
+
process.cwd().includes('npm/_npx');
|
|
406
|
+
|
|
407
|
+
if (isNpx && !process.env.FORCE_TRANSFORMERS) {
|
|
408
|
+
console.log('[Embeddings] NPX environment detected - using hash-based embeddings');
|
|
409
|
+
console.log('[Embeddings] For semantic search, install globally: npm install -g claude-flow');
|
|
410
|
+
return false; // Skip transformer initialization cleanly
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**Benefits:**
|
|
415
|
+
- **Zero errors** - No more confusing ONNX/WASM messages
|
|
416
|
+
- **Professional UX** - Clean output with helpful guidance
|
|
417
|
+
- **Full functionality** - All memory commands work perfectly
|
|
418
|
+
- **Clear upgrade path** - Users know how to get semantic search
|
|
419
|
+
|
|
420
|
+
**Status:** ✅ **RESOLVED** - No further action needed
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## Historical Conclusion (v2.7.24)
|
|
351
425
|
|
|
352
|
-
The transformer initialization issue in npx
|
|
353
|
-
handled gracefully. The system
|
|
354
|
-
as a fallback. Users who
|
|
426
|
+
The transformer initialization issue in npx was a known limitation that was being
|
|
427
|
+
handled gracefully with fallback. The system remained fully functional with hash-based embeddings
|
|
428
|
+
as a fallback. Users who needed true semantic search could install globally.
|
|
355
429
|
|
|
356
|
-
**Priority:** Medium - System
|
|
430
|
+
**Priority:** Medium - System worked, but showed confusing error messages
|
|
357
431
|
|
|
358
|
-
**
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
3. Improve WASM backend initialization
|
|
362
|
-
4. Update documentation to clarify behavior
|
|
432
|
+
**Resolution Timeline:**
|
|
433
|
+
- October 25, 2025: Issue documented in v2.7.24
|
|
434
|
+
- January 25, 2025: Resolved in v2.7.25 with agentic-flow@1.8.9
|