claude-flow 2.7.0-alpha.6 → 2.7.0-alpha.8
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/README.md +2 -32
- package/bin/claude-flow +8 -8
- package/dist/src/cli/help-formatter.js +5 -0
- package/dist/src/cli/simple-commands/config.js +137 -119
- package/dist/src/cli/simple-commands/config.js.map +1 -1
- package/dist/src/cli/simple-commands/memory.js +22 -15
- package/dist/src/cli/simple-commands/memory.js.map +1 -1
- package/dist/src/cli/simple-commands/performance-metrics.js +231 -1
- package/dist/src/cli/simple-commands/performance-metrics.js.map +1 -1
- package/dist/src/cli/validation-helper.js.map +1 -1
- package/dist/src/reasoningbank/reasoningbank-adapter.js.map +1 -1
- package/dist/src/utils/key-redactor.js.map +1 -1
- package/dist/src/utils/metrics-reader.js +37 -39
- package/dist/src/utils/metrics-reader.js.map +1 -1
- package/docs/.claude-flow/metrics/agent-metrics.json +1 -0
- package/docs/.claude-flow/metrics/performance.json +9 -0
- package/docs/.claude-flow/metrics/task-metrics.json +10 -0
- package/docs/CLI-MEMORY-COMMANDS-WORKING.md +150 -0
- package/docs/INDEX.md +36 -5
- package/docs/PERFORMANCE-JSON-IMPROVEMENTS.md +277 -0
- package/docs/PERFORMANCE-METRICS-GUIDE.md +259 -0
- package/docs/integrations/README.md +61 -0
- package/docs/{AGENTIC_FLOW_SECURITY_TEST_REPORT.md → integrations/agentic-flow/AGENTIC_FLOW_SECURITY_TEST_REPORT.md} +7 -7
- package/docs/integrations/reasoningbank/MIGRATION-v1.5.13.md +189 -0
- package/docs/{REASONINGBANK-STATUS.md → integrations/reasoningbank/REASONINGBANK-STATUS.md} +60 -33
- package/docs/reports/README.md +49 -0
- package/docs/reports/REASONINGBANK_STATUS_UPDATE_v2_7_0_alpha_7.md +366 -0
- package/docs/reports/validation/DOCKER-VALIDATION-REPORT-v2.7.0-alpha.7.md +361 -0
- package/docs/reports/validation/DOCKER_SQL_FALLBACK_VALIDATION.md +398 -0
- package/docs/{MEMORY_REDACTION_TEST_REPORT.md → reports/validation/MEMORY_REDACTION_TEST_REPORT.md} +7 -7
- package/docs/reports/validation/SQL_FALLBACK_VALIDATION_REPORT.md +405 -0
- package/docs/reports/validation/VALIDATION-SUMMARY.md +192 -0
- package/docs/setup/MCP-SETUP-GUIDE.md +154 -0
- package/docs/technical/README.md +36 -0
- package/docs/technical/fixes/WASM-ESM-FIX-SUMMARY.md +114 -0
- package/package.json +6 -6
- package/src/cli/simple-commands/memory.js +27 -17
- package/src/cli/simple-commands/performance-metrics.js +268 -2
- package/src/reasoningbank/reasoningbank-adapter.js +184 -131
- /package/docs/{AGENT-BOOSTER-INTEGRATION.md → integrations/agent-booster/AGENT-BOOSTER-INTEGRATION.md} +0 -0
- /package/docs/{AGENTIC-FLOW-INTEGRATION-GUIDE.md → integrations/agentic-flow/AGENTIC-FLOW-INTEGRATION-GUIDE.md} +0 -0
- /package/docs/{AGENTIC_FLOW_EXECUTION_FIX_REPORT.md → integrations/agentic-flow/AGENTIC_FLOW_EXECUTION_FIX_REPORT.md} +0 -0
- /package/docs/{AGENTIC_FLOW_INTEGRATION_STATUS.md → integrations/agentic-flow/AGENTIC_FLOW_INTEGRATION_STATUS.md} +0 -0
- /package/docs/{AGENTIC_FLOW_MVP_COMPLETE.md → integrations/agentic-flow/AGENTIC_FLOW_MVP_COMPLETE.md} +0 -0
- /package/docs/{epic-sdk-integration.md → integrations/epic-sdk/epic-sdk-integration.md} +0 -0
- /package/docs/{REASONING-AGENTS.md → integrations/reasoningbank/REASONING-AGENTS.md} +0 -0
- /package/docs/{REASONINGBANK-AGENT-CREATION-GUIDE.md → integrations/reasoningbank/REASONINGBANK-AGENT-CREATION-GUIDE.md} +0 -0
- /package/docs/{REASONINGBANK-ANALYSIS-COMPLETE.md → integrations/reasoningbank/REASONINGBANK-ANALYSIS-COMPLETE.md} +0 -0
- /package/docs/{REASONINGBANK-BENCHMARK-RESULTS.md → integrations/reasoningbank/REASONINGBANK-BENCHMARK-RESULTS.md} +0 -0
- /package/docs/{REASONINGBANK-BENCHMARK.md → integrations/reasoningbank/REASONINGBANK-BENCHMARK.md} +0 -0
- /package/docs/{REASONINGBANK-CLI-INTEGRATION.md → integrations/reasoningbank/REASONINGBANK-CLI-INTEGRATION.md} +0 -0
- /package/docs/{REASONINGBANK-CORE-INTEGRATION.md → integrations/reasoningbank/REASONINGBANK-CORE-INTEGRATION.md} +0 -0
- /package/docs/{REASONINGBANK-COST-OPTIMIZATION.md → integrations/reasoningbank/REASONINGBANK-COST-OPTIMIZATION.md} +0 -0
- /package/docs/{REASONINGBANK-DEMO.md → integrations/reasoningbank/REASONINGBANK-DEMO.md} +0 -0
- /package/docs/{REASONINGBANK-INTEGRATION-COMPLETE.md → integrations/reasoningbank/REASONINGBANK-INTEGRATION-COMPLETE.md} +0 -0
- /package/docs/{REASONINGBANK-INTEGRATION-STATUS.md → integrations/reasoningbank/REASONINGBANK-INTEGRATION-STATUS.md} +0 -0
- /package/docs/{REASONINGBANK-VALIDATION.md → integrations/reasoningbank/REASONINGBANK-VALIDATION.md} +0 -0
- /package/docs/{REASONINGBANK_ARCHITECTURE.md → integrations/reasoningbank/REASONINGBANK_ARCHITECTURE.md} +0 -0
- /package/docs/{REASONINGBANK_INTEGRATION_COMPLETE.md → integrations/reasoningbank/REASONINGBANK_INTEGRATION_COMPLETE.md} +0 -0
- /package/docs/{REASONINGBANK_INTEGRATION_PLAN.md → integrations/reasoningbank/REASONINGBANK_INTEGRATION_PLAN.md} +0 -0
- /package/docs/{DEEP_REVIEW_COMPREHENSIVE_REPORT.md → reports/analysis/DEEP_REVIEW_COMPREHENSIVE_REPORT.md} +0 -0
- /package/docs/{REGRESSION-ANALYSIS-REPORT.md → reports/analysis/REGRESSION-ANALYSIS-REPORT.md} +0 -0
- /package/docs/{COMMIT_SUMMARY.md → reports/releases/COMMIT_SUMMARY.md} +0 -0
- /package/docs/{INTEGRATION_COMPLETE.md → reports/releases/INTEGRATION_COMPLETE.md} +0 -0
- /package/docs/{PRE_RELEASE_FIXES_REPORT.md → reports/releases/PRE_RELEASE_FIXES_REPORT.md} +0 -0
- /package/docs/{RELEASE_v2.6.0-alpha.2.md → reports/releases/RELEASE_v2.6.0-alpha.2.md} +0 -0
- /package/docs/{COMMAND-VERIFICATION-REPORT.md → reports/validation/COMMAND-VERIFICATION-REPORT.md} +0 -0
- /package/docs/{DOCKER-VALIDATION-REPORT.md → reports/validation/DOCKER-VALIDATION-REPORT.md} +0 -0
- /package/docs/{FINAL_PRE_PUBLISH_VALIDATION.md → reports/validation/FINAL_PRE_PUBLISH_VALIDATION.md} +0 -0
- /package/docs/{FINAL_VALIDATION_REPORT.md → reports/validation/FINAL_VALIDATION_REPORT.md} +0 -0
- /package/docs/{ENV-SETUP-GUIDE.md → setup/ENV-SETUP-GUIDE.md} +0 -0
- /package/docs/{HOOKS-V2-MODIFICATION.md → technical/fixes/HOOKS-V2-MODIFICATION.md} +0 -0
- /package/docs/{PERFORMANCE-SYSTEMS-STATUS.md → technical/performance/PERFORMANCE-SYSTEMS-STATUS.md} +0 -0
package/README.md
CHANGED
|
@@ -39,39 +39,9 @@
|
|
|
39
39
|
- 🛡️ **Safety**: Auto-adds `-i` to `rm` commands, detects sensitive keywords
|
|
40
40
|
- 📁 **Organization**: Auto-routes files (tests→`/tests/`, src→`/src/`)
|
|
41
41
|
- ⚡ **Productivity**: Alias expansion (`ll`→`ls -lah`), conventional commits
|
|
42
|
-
|
|
43
|
-
**Quick Start:**
|
|
44
|
-
|
|
45
|
-
**Option 1: Direct Plugin Installation** (Recommended)
|
|
46
|
-
```bash
|
|
47
|
-
# In Claude Code, run:
|
|
48
|
-
/plugin ruvnet/claude-flow
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**Option 2: Via NPM**
|
|
52
|
-
```bash
|
|
53
|
-
npx claude-flow@alpha init --force # Auto-configures .claude-plugin/hooks/hooks.json
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Examples:**
|
|
57
|
-
```bash
|
|
58
|
-
rm test.txt → rm -i test.txt # Safety
|
|
59
|
-
test.js → src/test.js # Organization
|
|
60
|
-
git commit -m "fix" → [fix] fix + co-author # Commits
|
|
61
|
-
```
|
|
62
|
-
|
|
42
|
+
|
|
63
43
|
> 📚 **Docs**: [HOOKS-V2-MODIFICATION.md](./docs/HOOKS-V2-MODIFICATION.md) | **Plugin**: `.claude-plugin/` | **Composable** with `agent-booster`
|
|
64
|
-
|
|
65
|
-
## 🌐 **Flow Nexus Cloud Platform**
|
|
66
|
-
|
|
67
|
-
**NEW**: Claude-Flow v2.0.0 now includes **Flow Nexus integration** - a cloud-powered AI development platform featuring:
|
|
68
|
-
|
|
69
|
-
- **E2B Sandboxes**: Secure isolated environments for Node.js, Python, React, Next.js
|
|
70
|
-
- **AI Swarms**: Deploy multi-agent systems in cloud infrastructure
|
|
71
|
-
- **Neural Training**: Distributed machine learning with custom model deployment
|
|
72
|
-
- **Challenges & Marketplace**: Coding challenges with rUv credit rewards and template marketplace
|
|
73
|
-
- **Workflow Automation**: Event-driven automation with message queue processing
|
|
74
|
-
|
|
44
|
+
|
|
75
45
|
> 📚 **Complete documentation**: Visit [flow-nexus.ruv.io](https://flow-nexus.ruv.io) for comprehensive guides, tutorials, and API reference. Also see issue # https://github.com/ruvnet/claude-flow/issues/732
|
|
76
46
|
|
|
77
47
|
## ⚡ **Try v2.0.0 Alpha in 4 Commands**
|
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.0-alpha.
|
|
4
|
+
VERSION="2.7.0-alpha.8"
|
|
5
5
|
|
|
6
6
|
# Determine the correct path based on how the script is invoked
|
|
7
7
|
if [ -L "$0" ]; then
|
|
@@ -48,16 +48,16 @@ for arg in "$@"; do
|
|
|
48
48
|
fi
|
|
49
49
|
done
|
|
50
50
|
|
|
51
|
-
# Use Node.js with TypeScript support
|
|
51
|
+
# Use Node.js with TypeScript support and WASM modules enabled
|
|
52
52
|
if [ -f "$ROOT_DIR/src/cli/simple-cli.js" ]; then
|
|
53
|
-
# Use node for JavaScript version
|
|
54
|
-
exec node "$ROOT_DIR/src/cli/simple-cli.js" "$@"
|
|
53
|
+
# Use node for JavaScript version with WASM support
|
|
54
|
+
exec node --experimental-wasm-modules "$ROOT_DIR/src/cli/simple-cli.js" "$@"
|
|
55
55
|
elif command -v tsx >/dev/null 2>&1 && [ -f "$ROOT_DIR/src/cli/simple-cli.ts" ]; then
|
|
56
|
-
# Use tsx for TypeScript functionality
|
|
57
|
-
exec tsx "$ROOT_DIR/src/cli/simple-cli.ts" "$@"
|
|
56
|
+
# Use tsx for TypeScript functionality with WASM support
|
|
57
|
+
exec tsx --experimental-wasm-modules "$ROOT_DIR/src/cli/simple-cli.ts" "$@"
|
|
58
58
|
elif [ -f "$ROOT_DIR/src/cli/simple-cli.ts" ]; then
|
|
59
|
-
# Try to use npx tsx as fallback
|
|
60
|
-
exec npx tsx "$ROOT_DIR/src/cli/simple-cli.ts" "$@"
|
|
59
|
+
# Try to use npx tsx as fallback with WASM support
|
|
60
|
+
exec npx tsx --experimental-wasm-modules "$ROOT_DIR/src/cli/simple-cli.ts" "$@"
|
|
61
61
|
else
|
|
62
62
|
# No runtime available, show help
|
|
63
63
|
echo "🧠 Claude-Flow v$VERSION - Advanced AI Agent Orchestration System"
|
|
@@ -1,126 +1,144 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
});
|
|
49
|
-
}
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.error(chalk.red('✗ Error:'), error.message);
|
|
52
|
-
process.exit(1);
|
|
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;
|
|
53
36
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
]
|
|
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%'
|
|
109
67
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
|
79
|
+
}
|
|
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 || {})}`);
|
|
118
116
|
}
|
|
119
|
-
})
|
|
120
|
-
|
|
117
|
+
} catch (err) {
|
|
118
|
+
printError('Configuration file not found');
|
|
119
|
+
console.log('Run "claude-flow config init" to create default configuration');
|
|
120
|
+
}
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
|
|
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');
|
|
124
142
|
console.log('Run "claude-flow config init" to create configuration');
|
|
125
143
|
}
|
|
126
144
|
}
|
|
@@ -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,MAAMC,SAAS,IAAIL,QAAQ,UACxBM,WAAW,CAAC;IAGfD,OACGE,OAAO,CAAC,gBACRD,WAAW,CAAC,wBACZE,QAAQ,CAAC,cAAc,uDACvBC,MAAM,CAAC,uBAAuB,8BAC9BC,MAAM,CAAC,OAAOC,UAAUC;QACvB,IAAI;YACF,MAAMC,UAAU,IAAIV;YAEpB,MAAMU,QAAQC,kBAAkB,CAACH;YAEjC,IAAIC,QAAQG,KAAK,EAAE;gBACjB,MAAMF,QAAQG,iBAAiB,CAACL,UAAU;oBACxCI,OAAOH,QAAQG,KAAK;oBACpBE,SAAS;gBACX;YACF;YAEAC,QAAQC,GAAG,CAAClB,MAAMmB,KAAK,CAAC,CAAC,2BAA2B,EAAET,UAAU;YAChE,IAAIC,QAAQG,KAAK,EAAE;gBACjBG,QAAQC,GAAG,CAAClB,MAAMmB,KAAK,CAAC,CAAC,wBAAwB,EAAER,QAAQG,KAAK,EAAE;YACpE;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ACpB,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,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,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d"}
|
|
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;Y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IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd"}
|
|
@@ -315,7 +315,11 @@ async function detectMemoryMode(flags, subArgs) {
|
|
|
315
315
|
const initialized = await isReasoningBankInitialized();
|
|
316
316
|
return initialized ? 'reasoningbank' : 'basic';
|
|
317
317
|
}
|
|
318
|
-
|
|
318
|
+
if (flags?.basic || subArgs.includes('--basic')) {
|
|
319
|
+
return 'basic';
|
|
320
|
+
}
|
|
321
|
+
const initialized = await isReasoningBankInitialized();
|
|
322
|
+
return initialized ? 'reasoningbank' : 'basic';
|
|
319
323
|
}
|
|
320
324
|
async function isReasoningBankInitialized() {
|
|
321
325
|
try {
|
|
@@ -590,14 +594,15 @@ async function checkBasicMode() {
|
|
|
590
594
|
async function showCurrentMode() {
|
|
591
595
|
const rbInitialized = await isReasoningBankInitialized();
|
|
592
596
|
printInfo('📊 Current Memory Configuration:\n');
|
|
593
|
-
console.log('Default Mode:
|
|
597
|
+
console.log('Default Mode: AUTO (smart selection with JSON fallback)');
|
|
594
598
|
console.log('Available Modes:');
|
|
595
|
-
console.log(' • Basic Mode: Always available');
|
|
596
|
-
console.log(` • ReasoningBank Mode: ${rbInitialized ? 'Initialized ✅' : 'Not initialized ⚠️'}`);
|
|
597
|
-
console.log('\n💡
|
|
598
|
-
console.log('
|
|
599
|
-
console.log(' --
|
|
600
|
-
console.log('
|
|
599
|
+
console.log(' • Basic Mode: Always available (JSON storage)');
|
|
600
|
+
console.log(` • ReasoningBank Mode: ${rbInitialized ? 'Initialized ✅ (will be used by default)' : 'Not initialized ⚠️ (JSON fallback active)'}`);
|
|
601
|
+
console.log('\n💡 Mode Behavior:');
|
|
602
|
+
console.log(' (no flag) → AUTO: Use ReasoningBank if initialized, else JSON');
|
|
603
|
+
console.log(' --reasoningbank or --rb → Force ReasoningBank mode');
|
|
604
|
+
console.log(' --basic → Force JSON mode');
|
|
605
|
+
console.log(' --auto → Same as default (explicit)');
|
|
601
606
|
}
|
|
602
607
|
async function migrateMemory(subArgs, flags) {
|
|
603
608
|
const targetMode = flags?.to || getArgValue(subArgs, '--to');
|
|
@@ -656,10 +661,11 @@ function showMemoryHelp() {
|
|
|
656
661
|
console.log(' --redact 🔒 Enable API key redaction (security feature)');
|
|
657
662
|
console.log(' --secure Alias for --redact');
|
|
658
663
|
console.log();
|
|
659
|
-
console.log('🎯 Mode Selection
|
|
660
|
-
console.log('
|
|
661
|
-
console.log(' --
|
|
662
|
-
console.log('
|
|
664
|
+
console.log('🎯 Mode Selection:');
|
|
665
|
+
console.log(' (no flag) AUTO MODE (default) - Uses ReasoningBank if initialized, else JSON fallback');
|
|
666
|
+
console.log(' --reasoningbank, --rb Force ReasoningBank mode (AI-powered)');
|
|
667
|
+
console.log(' --basic Force Basic mode (JSON storage)');
|
|
668
|
+
console.log(' --auto Explicit auto-detect (same as default)');
|
|
663
669
|
console.log();
|
|
664
670
|
console.log('🔒 Security Features (v2.6.0):');
|
|
665
671
|
console.log(' API Key Protection: Automatically detects and redacts sensitive data');
|
|
@@ -687,9 +693,10 @@ function showMemoryHelp() {
|
|
|
687
693
|
console.log(' memory mode # Show current configuration');
|
|
688
694
|
console.log();
|
|
689
695
|
console.log('💡 Tips:');
|
|
690
|
-
console.log(' •
|
|
691
|
-
console.log(' •
|
|
692
|
-
console.log(' •
|
|
696
|
+
console.log(' • AUTO MODE (default): Automatically uses best available storage');
|
|
697
|
+
console.log(' • ReasoningBank: AI-powered semantic search (learns from patterns)');
|
|
698
|
+
console.log(' • JSON fallback: Always available, fast, simple key-value storage');
|
|
699
|
+
console.log(' • Initialize ReasoningBank once: "memory init --reasoningbank"');
|
|
693
700
|
console.log(' • Always use --redact when storing API keys or secrets!');
|
|
694
701
|
}
|
|
695
702
|
|