claude-flow 2.5.0-alpha.141 ā 2.7.0-alpha
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/.claude/agents/reasoning/README.md +171 -0
- package/.claude/agents/reasoning/agent.md +816 -0
- package/.claude/agents/reasoning/example-reasoning-agent-template.md +362 -0
- package/.claude/agents/reasoning/goal-planner.md +73 -0
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/settings.json +3 -3
- package/.claude/sparc-modes.json +108 -0
- package/README.md +1 -6
- package/bin/claude-flow +1 -1
- package/dist/src/cli/command-registry.js +70 -6
- package/dist/src/cli/command-registry.js.map +1 -1
- package/dist/src/cli/help-formatter.js +0 -3
- package/dist/src/cli/help-formatter.js.map +1 -1
- package/dist/src/cli/help-text.js +53 -5
- package/dist/src/cli/help-text.js.map +1 -1
- package/dist/src/cli/simple-cli.js +182 -172
- package/dist/src/cli/simple-cli.js.map +1 -1
- package/dist/src/cli/simple-commands/agent-booster.js +415 -0
- package/dist/src/cli/simple-commands/agent-booster.js.map +1 -0
- package/dist/src/cli/simple-commands/agent.js +856 -13
- package/dist/src/cli/simple-commands/agent.js.map +1 -1
- package/dist/src/cli/simple-commands/env-template.js +180 -0
- package/dist/src/cli/simple-commands/env-template.js.map +1 -0
- package/dist/src/cli/simple-commands/init/help.js +23 -0
- package/dist/src/cli/simple-commands/init/help.js.map +1 -1
- package/dist/src/cli/simple-commands/init/index.js +63 -0
- package/dist/src/cli/simple-commands/init/index.js.map +1 -1
- package/dist/src/cli/simple-commands/memory.js +307 -16
- package/dist/src/cli/simple-commands/memory.js.map +1 -1
- package/dist/src/cli/simple-commands/proxy.js +304 -0
- package/dist/src/cli/simple-commands/proxy.js.map +1 -0
- package/dist/src/cli/simple-commands/sparc.js +16 -19
- package/dist/src/cli/simple-commands/sparc.js.map +1 -1
- package/dist/src/cli/validation-helper.js.map +1 -1
- package/dist/src/core/version.js +1 -1
- package/dist/src/execution/agent-executor.js +181 -0
- package/dist/src/execution/agent-executor.js.map +1 -0
- package/dist/src/execution/index.js +12 -0
- package/dist/src/execution/index.js.map +1 -0
- package/dist/src/execution/provider-manager.js +110 -0
- package/dist/src/execution/provider-manager.js.map +1 -0
- package/dist/src/hooks/redaction-hook.js +89 -0
- package/dist/src/hooks/redaction-hook.js.map +1 -0
- package/dist/src/memory/swarm-memory.js +340 -421
- package/dist/src/memory/swarm-memory.js.map +1 -1
- package/dist/src/utils/key-redactor.js +108 -0
- package/dist/src/utils/key-redactor.js.map +1 -0
- package/dist/src/utils/metrics-reader.js +37 -39
- package/dist/src/utils/metrics-reader.js.map +1 -1
- package/docs/AGENT-BOOSTER-INTEGRATION.md +407 -0
- package/docs/AGENTIC-FLOW-INTEGRATION-GUIDE.md +753 -0
- package/docs/AGENTIC_FLOW_EXECUTION_FIX_REPORT.md +474 -0
- package/docs/AGENTIC_FLOW_INTEGRATION_STATUS.md +143 -0
- package/docs/AGENTIC_FLOW_MVP_COMPLETE.md +367 -0
- package/docs/AGENTIC_FLOW_SECURITY_TEST_REPORT.md +369 -0
- package/docs/COMMAND-VERIFICATION-REPORT.md +441 -0
- package/docs/COMMIT_SUMMARY.md +247 -0
- package/docs/DEEP_REVIEW_COMPREHENSIVE_REPORT.md +922 -0
- package/docs/DOCKER-VALIDATION-REPORT.md +281 -0
- package/docs/ENV-SETUP-GUIDE.md +270 -0
- package/docs/FINAL_PRE_PUBLISH_VALIDATION.md +823 -0
- package/docs/FINAL_VALIDATION_REPORT.md +165 -0
- package/docs/HOOKS-V2-MODIFICATION.md +146 -0
- package/docs/INDEX.md +568 -0
- package/docs/INTEGRATION_COMPLETE.md +414 -0
- package/docs/MEMORY_REDACTION_TEST_REPORT.md +300 -0
- package/docs/PERFORMANCE-SYSTEMS-STATUS.md +340 -0
- package/docs/PRE_RELEASE_FIXES_REPORT.md +435 -0
- package/docs/README.md +35 -0
- package/docs/REASONING-AGENTS.md +482 -0
- package/docs/REASONINGBANK-AGENT-CREATION-GUIDE.md +813 -0
- package/docs/REASONINGBANK-ANALYSIS-COMPLETE.md +479 -0
- package/docs/REASONINGBANK-BENCHMARK-RESULTS.md +166 -0
- package/docs/REASONINGBANK-BENCHMARK.md +396 -0
- package/docs/REASONINGBANK-CLI-INTEGRATION.md +455 -0
- package/docs/REASONINGBANK-CORE-INTEGRATION.md +658 -0
- package/docs/REASONINGBANK-COST-OPTIMIZATION.md +329 -0
- package/docs/REASONINGBANK-DEMO.md +419 -0
- package/docs/REASONINGBANK-INTEGRATION-COMPLETE.md +249 -0
- package/docs/REASONINGBANK-VALIDATION.md +532 -0
- package/docs/REASONINGBANK_ARCHITECTURE.md +475 -0
- package/docs/REASONINGBANK_INTEGRATION_COMPLETE.md +558 -0
- package/docs/REASONINGBANK_INTEGRATION_PLAN.md +1188 -0
- package/docs/REGRESSION-ANALYSIS-REPORT.md +500 -0
- package/docs/RELEASE_v2.6.0-alpha.2.md +658 -0
- package/docs/api/API_DOCUMENTATION.md +721 -0
- package/docs/architecture/ARCHITECTURE.md +1690 -0
- package/docs/ci-cd/README.md +368 -0
- package/docs/development/DEPLOYMENT.md +2348 -0
- package/docs/development/DEVELOPMENT_WORKFLOW.md +1333 -0
- package/docs/development/build-analysis-report.md +252 -0
- package/docs/development/pair-optimization.md +156 -0
- package/docs/development/token-tracking-status.md +103 -0
- package/docs/development/training-pipeline-demo.md +163 -0
- package/docs/development/training-pipeline-real-only.md +196 -0
- package/docs/epic-sdk-integration.md +1269 -0
- package/docs/experimental/RIEMANN_HYPOTHESIS_PROOF.md +124 -0
- package/docs/experimental/computational_verification.py +436 -0
- package/docs/experimental/novel_approaches.md +560 -0
- package/docs/experimental/riemann_hypothesis_analysis.md +263 -0
- package/docs/experimental/riemann_proof_attempt.md +124 -0
- package/docs/experimental/riemann_synthesis.md +277 -0
- package/docs/experimental/verification_results.json +12 -0
- package/docs/experimental/visualization_insights.md +720 -0
- package/docs/guides/USER_GUIDE.md +1138 -0
- package/docs/guides/token-tracking-guide.md +291 -0
- package/docs/reference/AGENTS.md +1011 -0
- package/docs/reference/MCP_TOOLS.md +2188 -0
- package/docs/reference/SPARC.md +717 -0
- package/docs/reference/SWARM.md +2000 -0
- package/docs/sdk/CLAUDE-CODE-SDK-DEEP-ANALYSIS.md +649 -0
- package/docs/sdk/CLAUDE-FLOW-SDK-INTEGRATION-ANALYSIS.md +242 -0
- package/docs/sdk/INTEGRATION-ROADMAP.md +420 -0
- package/docs/sdk/MCP-TOOLS-UPDATE.md +270 -0
- package/docs/sdk/SDK-ADVANCED-FEATURES-INTEGRATION.md +723 -0
- package/docs/sdk/SDK-ALL-FEATURES-INTEGRATION-MATRIX.md +612 -0
- package/docs/sdk/SDK-INTEGRATION-COMPLETE.md +358 -0
- package/docs/sdk/SDK-INTEGRATION-PHASES-V2.5.md +750 -0
- package/docs/sdk/SDK-LEVERAGE-REAL-FEATURES.md +676 -0
- package/docs/sdk/SDK-VALIDATION-RESULTS.md +400 -0
- package/docs/sdk/epic-sdk-integration.md +1269 -0
- package/docs/setup/remote-setup.md +93 -0
- package/docs/validation/final-validation-summary.md +220 -0
- package/docs/validation/verification-integration.md +190 -0
- package/docs/validation/verification-validation.md +349 -0
- package/docs/wiki/background-commands.md +1213 -0
- package/docs/wiki/session-persistence.md +342 -0
- package/docs/wiki/stream-chain-command.md +537 -0
- package/package.json +4 -2
- package/src/cli/command-registry.js +70 -5
- package/src/cli/help-text.js +26 -5
- package/src/cli/simple-cli.ts +18 -7
- package/src/cli/simple-commands/agent-booster.js +515 -0
- package/src/cli/simple-commands/agent.js +1001 -12
- package/src/cli/simple-commands/agent.ts +137 -0
- package/src/cli/simple-commands/config.ts +127 -0
- package/src/cli/simple-commands/env-template.js +190 -0
- package/src/cli/simple-commands/init/help.js +23 -0
- package/src/cli/simple-commands/init/index.js +84 -6
- package/src/cli/simple-commands/memory.js +363 -16
- package/src/cli/simple-commands/proxy.js +384 -0
- package/src/cli/simple-commands/sparc.js +16 -19
- package/src/execution/agent-executor.ts +306 -0
- package/src/execution/index.ts +19 -0
- package/src/execution/provider-manager.ts +187 -0
- package/src/hooks/redaction-hook.ts +115 -0
- package/src/utils/key-redactor.js +178 -0
- package/src/utils/key-redactor.ts +184 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/simple-commands/agent.js"],"sourcesContent":["// agent.js - Agent management commands\nimport { printSuccess, printError, printWarning } from '../utils.js';\nimport { onAgentSpawn, onAgentAction } from './performance-hooks.js';\n\nexport async function agentCommand(subArgs, flags) {\n const agentCmd = subArgs[0];\n\n switch (agentCmd) {\n case 'spawn':\n await spawnAgent(subArgs, flags);\n break;\n\n case 'list':\n await listAgents(subArgs, flags);\n break;\n\n case 'hierarchy':\n await manageHierarchy(subArgs, flags);\n break;\n\n case 'network':\n await manageNetwork(subArgs, flags);\n break;\n\n case 'ecosystem':\n await manageEcosystem(subArgs, flags);\n break;\n\n case 'provision':\n await provisionAgent(subArgs, flags);\n break;\n\n case 'terminate':\n await terminateAgent(subArgs, flags);\n break;\n\n case 'info':\n await showAgentInfo(subArgs, flags);\n break;\n\n default:\n showAgentHelp();\n }\n}\n\nasync function spawnAgent(subArgs, flags) {\n const agentType = subArgs[1] || 'general';\n const agentName = getFlag(subArgs, '--name') || flags.name || `agent-${Date.now()}`;\n const agentId = `${agentType}-${Date.now()}`;\n\n // Create the agent object\n const agent = {\n id: agentId,\n name: agentName,\n type: agentType,\n status: 'active',\n activeTasks: 0,\n lastActivity: Date.now(),\n capabilities: getAgentCapabilities(agentType),\n createdAt: Date.now()\n };\n\n // Store agent in session/agents directory\n const { promises: fs } = await import('fs');\n const path = await import('path');\n \n // Ensure agents directory exists\n const agentsDir = '.claude-flow/agents';\n await fs.mkdir(agentsDir, { recursive: true });\n \n // Save agent data\n const agentFile = path.join(agentsDir, `${agentId}.json`);\n await fs.writeFile(agentFile, JSON.stringify(agent, null, 2));\n \n // Update performance metrics\n const perfFile = '.claude-flow/metrics/performance.json';\n try {\n const perfData = JSON.parse(await fs.readFile(perfFile, 'utf8'));\n perfData.totalAgents = (perfData.totalAgents || 0) + 1;\n perfData.activeAgents = (perfData.activeAgents || 0) + 1;\n await fs.writeFile(perfFile, JSON.stringify(perfData, null, 2));\n } catch (e) {\n // Create new performance file if doesn't exist\n await fs.writeFile(perfFile, JSON.stringify({\n startTime: Date.now(),\n totalTasks: 0,\n successfulTasks: 0,\n failedTasks: 0,\n totalAgents: 1,\n activeAgents: 1,\n neuralEvents: 0\n }, null, 2));\n }\n\n printSuccess(`ā
Spawned ${agentType} agent: ${agentName}`);\n console.log('š¤ Agent successfully created:');\n console.log(` ID: ${agentId}`);\n console.log(` Type: ${agentType}`);\n console.log(` Name: ${agentName}`);\n console.log(` Capabilities: ${agent.capabilities.join(', ')}`);\n console.log(` Status: ${agent.status}`);\n console.log(` Location: ${agentFile}`);\n \n // Track agent spawn for performance metrics\n await onAgentSpawn(agentId, agentType, { name: agentName });\n}\n\nfunction getAgentCapabilities(type) {\n const capabilities = {\n researcher: ['Research', 'Analysis', 'Information Gathering', 'Documentation'],\n coder: ['Code Generation', 'Implementation', 'Refactoring', 'Debugging'],\n tester: ['Testing', 'Validation', 'Quality Assurance', 'Performance Testing'],\n analyst: ['Data Analysis', 'Pattern Recognition', 'Reporting', 'Optimization'],\n coordinator: ['Task Management', 'Workflow Orchestration', 'Resource Allocation'],\n general: ['Research', 'Analysis', 'Code Generation']\n };\n return capabilities[type] || capabilities.general;\n}\n\nasync function listAgents(subArgs, flags) {\n const { promises: fs } = await import('fs');\n const path = await import('path');\n \n const agentsDir = '.claude-flow/agents';\n const agents = [];\n \n try {\n const agentFiles = await fs.readdir(agentsDir);\n for (const file of agentFiles) {\n if (file.endsWith('.json')) {\n try {\n const content = await fs.readFile(path.join(agentsDir, file), 'utf8');\n const agent = JSON.parse(content);\n agents.push(agent);\n } catch {\n // Skip invalid agent files\n }\n }\n }\n } catch {\n // Agents directory doesn't exist yet\n }\n \n if (agents.length > 0) {\n printSuccess(`Active agents (${agents.length}):`);\n agents.forEach(agent => {\n const statusEmoji = agent.status === 'active' ? 'š¢' : 'š”';\n console.log(`${statusEmoji} ${agent.name} (${agent.type})`);\n console.log(` ID: ${agent.id}`);\n console.log(` Status: ${agent.status}`);\n console.log(` Tasks: ${agent.activeTasks}`);\n console.log(` Created: ${new Date(agent.createdAt).toLocaleString()}`);\n console.log('');\n });\n } else {\n console.log('š No agents currently active');\n console.log('\\nTo create agents:');\n console.log(' claude-flow agent spawn researcher --name \"ResearchBot\"');\n console.log(' claude-flow agent spawn coder --name \"CodeBot\"');\n console.log(' claude-flow agent spawn analyst --name \"DataBot\"');\n }\n}\n\nasync function manageHierarchy(subArgs, flags) {\n const hierarchyCmd = subArgs[1];\n\n switch (hierarchyCmd) {\n case 'create':\n const hierarchyType = subArgs[2] || 'basic';\n printSuccess(`Creating ${hierarchyType} agent hierarchy`);\n console.log('šļø Hierarchy structure would include:');\n console.log(' - Coordinator Agent (manages workflow)');\n console.log(' - Specialist Agents (domain-specific tasks)');\n console.log(' - Worker Agents (execution tasks)');\n break;\n\n case 'show':\n printSuccess('Current agent hierarchy:');\n console.log('š No hierarchy configured (orchestrator not running)');\n break;\n\n default:\n console.log('Hierarchy commands: create, show');\n console.log('Examples:');\n console.log(' claude-flow agent hierarchy create enterprise');\n console.log(' claude-flow agent hierarchy show');\n }\n}\n\nasync function manageNetwork(subArgs, flags) {\n const networkCmd = subArgs[1];\n\n switch (networkCmd) {\n case 'topology':\n printSuccess('Agent network topology:');\n console.log('š Network visualization would show agent connections');\n break;\n\n case 'metrics':\n printSuccess('Network performance metrics:');\n console.log('š Communication latency, throughput, reliability stats');\n break;\n\n default:\n console.log('Network commands: topology, metrics');\n }\n}\n\nasync function manageEcosystem(subArgs, flags) {\n const ecosystemCmd = subArgs[1];\n\n switch (ecosystemCmd) {\n case 'status':\n printSuccess('Agent ecosystem status:');\n console.log('š± Ecosystem health: Not running');\n console.log(' Active Agents: 0');\n console.log(' Resource Usage: 0%');\n console.log(' Task Queue: Empty');\n break;\n\n case 'optimize':\n printSuccess('Optimizing agent ecosystem...');\n console.log('ā” Optimization would include:');\n console.log(' - Load balancing across agents');\n console.log(' - Resource allocation optimization');\n console.log(' - Communication path optimization');\n break;\n\n default:\n console.log('Ecosystem commands: status, optimize');\n }\n}\n\nasync function provisionAgent(subArgs, flags) {\n const provision = subArgs[1];\n\n if (!provision) {\n printError('Usage: agent provision <count>');\n return;\n }\n\n const count = parseInt(provision);\n if (isNaN(count) || count < 1) {\n printError('Count must be a positive number');\n return;\n }\n\n printSuccess(`Provisioning ${count} agents...`);\n console.log('š Auto-provisioning would create:');\n for (let i = 1; i <= count; i++) {\n console.log(` Agent ${i}: Type=general, Status=provisioning`);\n }\n}\n\nasync function terminateAgent(subArgs, flags) {\n const agentId = subArgs[1];\n\n if (!agentId) {\n printError('Usage: agent terminate <agent-id>');\n return;\n }\n\n printSuccess(`Terminating agent: ${agentId}`);\n console.log('š Agent would be gracefully shut down');\n}\n\nasync function showAgentInfo(subArgs, flags) {\n const agentId = subArgs[1];\n\n if (!agentId) {\n printError('Usage: agent info <agent-id>');\n return;\n }\n\n printSuccess(`Agent information: ${agentId}`);\n console.log('š Agent details would include:');\n console.log(' Status, capabilities, current tasks, performance metrics');\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\nfunction showAgentHelp() {\n console.log('Agent commands:');\n console.log(' spawn <type> [--name <name>] Create new agent');\n console.log(' list [--verbose] List active agents');\n console.log(' terminate <id> Stop specific agent');\n console.log(' info <id> Show agent details');\n console.log(' hierarchy <create|show> Manage agent hierarchies');\n console.log(' network <topology|metrics> Agent network operations');\n console.log(' ecosystem <status|optimize> Ecosystem management');\n console.log(' provision <count> Auto-provision agents');\n console.log();\n console.log('Agent Types:');\n console.log(' researcher Research and information gathering');\n console.log(' coder Code development and analysis');\n console.log(' analyst Data analysis and insights');\n console.log(' coordinator Task coordination and management');\n console.log(' general Multi-purpose agent');\n console.log();\n console.log('Examples:');\n console.log(' claude-flow agent spawn researcher --name \"DataBot\"');\n console.log(' claude-flow agent list --verbose');\n console.log(' claude-flow agent hierarchy create enterprise');\n console.log(' claude-flow agent ecosystem status');\n}\n"],"names":["printSuccess","printError","onAgentSpawn","agentCommand","subArgs","flags","agentCmd","spawnAgent","listAgents","manageHierarchy","manageNetwork","manageEcosystem","provisionAgent","terminateAgent","showAgentInfo","showAgentHelp","agentType","agentName","getFlag","name","Date","now","agentId","agent","id","type","status","activeTasks","lastActivity","capabilities","getAgentCapabilities","createdAt","promises","fs","path","agentsDir","mkdir","recursive","agentFile","join","writeFile","JSON","stringify","perfFile","perfData","parse","readFile","totalAgents","activeAgents","e","startTime","totalTasks","successfulTasks","failedTasks","neuralEvents","console","log","researcher","coder","tester","analyst","coordinator","general","agents","agentFiles","readdir","file","endsWith","content","push","length","forEach","statusEmoji","toLocaleString","hierarchyCmd","hierarchyType","networkCmd","ecosystemCmd","provision","count","parseInt","isNaN","i","args","flagName","index","indexOf"],"mappings":"AACA,SAASA,YAAY,EAAEC,UAAU,QAAsB,cAAc;AACrE,SAASC,YAAY,QAAuB,yBAAyB;AAErE,OAAO,eAAeC,aAAaC,OAAO,EAAEC,KAAK;IAC/C,MAAMC,WAAWF,OAAO,CAAC,EAAE;IAE3B,OAAQE;QACN,KAAK;YACH,MAAMC,WAAWH,SAASC;YAC1B;QAEF,KAAK;YACH,MAAMG,WAAWJ,SAASC;YAC1B;QAEF,KAAK;YACH,MAAMI,gBAAgBL,SAASC;YAC/B;QAEF,KAAK;YACH,MAAMK,cAAcN,SAASC;YAC7B;QAEF,KAAK;YACH,MAAMM,gBAAgBP,SAASC;YAC/B;QAEF,KAAK;YACH,MAAMO,eAAeR,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMQ,eAAeT,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMS,cAAcV,SAASC;YAC7B;QAEF;YACEU;IACJ;AAC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C,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/agent.js"],"sourcesContent":["// agent.js - Agent management commands\nimport { printSuccess, printError, printWarning } from '../utils.js';\nimport { onAgentSpawn, onAgentAction } from './performance-hooks.js';\nimport { exec } from 'child_process';\nimport { promisify } from 'util';\n\nconst execAsync = promisify(exec);\n\nexport async function agentCommand(subArgs, flags) {\n const agentCmd = subArgs[0];\n\n // Handle --help flag explicitly to show full help\n if (flags.help || flags.h || agentCmd === '--help' || agentCmd === '-h') {\n showAgentHelp();\n return;\n }\n\n switch (agentCmd) {\n case 'run':\n case 'execute':\n await executeAgentTask(subArgs, flags);\n break;\n\n case 'spawn':\n await spawnAgent(subArgs, flags);\n break;\n\n case 'list':\n await listAgents(subArgs, flags);\n break;\n\n case 'agents':\n await listAgenticFlowAgents(subArgs, flags);\n break;\n\n case 'create':\n await createAgent(subArgs, flags);\n break;\n\n case 'info':\n await getAgentInfo(subArgs, flags);\n break;\n\n case 'conflicts':\n await checkAgentConflicts(subArgs, flags);\n break;\n\n case 'memory':\n await memoryCommand(subArgs, flags);\n break;\n\n case 'config':\n case 'configure':\n await configAgenticFlow(subArgs, flags);\n break;\n\n case 'mcp':\n case 'mcp-server':\n await mcpAgenticFlow(subArgs, flags);\n break;\n\n case 'hierarchy':\n await manageHierarchy(subArgs, flags);\n break;\n\n case 'network':\n await manageNetwork(subArgs, flags);\n break;\n\n case 'ecosystem':\n await manageEcosystem(subArgs, flags);\n break;\n\n case 'provision':\n await provisionAgent(subArgs, flags);\n break;\n\n case 'terminate':\n await terminateAgent(subArgs, flags);\n break;\n\n case 'booster':\n const { agentBoosterCommand } = await import('./agent-booster.js');\n await agentBoosterCommand(subArgs, flags);\n break;\n\n default:\n showAgentHelp();\n }\n}\n\nasync function executeAgentTask(subArgs, flags) {\n const agentType = subArgs[1];\n const task = subArgs[2];\n\n if (!agentType || !task) {\n printError('Usage: agent run <agent-type> \"<task>\" [--provider <provider>] [--model <model>]');\n console.log('\\nExamples:');\n console.log(' claude-flow agent run coder \"Create a REST API\"');\n console.log(' claude-flow agent run researcher \"Research AI trends\" --provider openrouter');\n console.log(' claude-flow agent run reviewer \"Review code for security\" --provider onnx');\n return;\n }\n\n // Check for memory flags and .env configuration\n if (flags.enableMemory || flags.memory) {\n const { checkEnvConfig, showEnvSetupInstructions } = await import('./env-template.js');\n const envCheck = await checkEnvConfig(process.cwd());\n\n if (!envCheck.exists) {\n printWarning('ā ļø ReasoningBank memory requires .env configuration');\n showEnvSetupInstructions();\n console.log('ā Cannot use --enable-memory without .env file\\n');\n process.exit(1);\n }\n\n if (!envCheck.hasApiKeys) {\n printWarning('ā ļø No API keys found in .env file');\n console.log('\\nā ļø ReasoningBank will fall back to heuristic mode (regex matching)');\n console.log(' Without API keys, memory will NOT learn from experience!\\n');\n showEnvSetupInstructions();\n console.log('ā Add API keys to .env to enable actual learning\\n');\n process.exit(1);\n }\n\n // Show which keys are configured\n console.log('ā
API keys configured:');\n if (envCheck.keys.anthropic) console.log(' ⢠Anthropic (Claude)');\n if (envCheck.keys.openrouter) console.log(' ⢠OpenRouter (cost optimization available)');\n if (envCheck.keys.gemini) console.log(' ⢠Gemini (free tier available)');\n console.log('');\n }\n\n printSuccess(`š Executing ${agentType} agent with agentic-flow...`);\n console.log(`Task: ${task}`);\n\n const provider = flags.provider || 'anthropic';\n if (flags.provider) {\n console.log(`Provider: ${provider}`);\n }\n\n try {\n // Build command for agentic-flow\n const cmd = buildAgenticFlowCommand(agentType, task, flags);\n console.log('\\nā³ Running agent... (this may take a moment)\\n');\n\n // Execute agentic-flow\n const { stdout, stderr } = await execAsync(cmd, {\n timeout: flags.timeout || 300000,\n maxBuffer: 10 * 1024 * 1024,\n });\n\n if (stdout) {\n console.log(stdout);\n }\n\n if (stderr && flags.verbose) {\n console.warn('\\nWarnings:', stderr);\n }\n\n printSuccess('ā
Agent task completed successfully!');\n } catch (error) {\n printError('ā Agent execution failed');\n console.error(error.message);\n if (error.stderr) {\n console.error('Error details:', error.stderr);\n }\n process.exit(1);\n }\n}\n\nfunction buildAgenticFlowCommand(agent, task, flags) {\n const parts = ['npx', 'agentic-flow'];\n\n // Agentic-flow uses --agent flag directly (no 'execute' subcommand)\n parts.push('--agent', agent);\n parts.push('--task', `\"${task.replace(/\"/g, '\\\\\"')}\"`);\n\n if (flags.provider) {\n parts.push('--provider', flags.provider);\n }\n\n if (flags.model) {\n parts.push('--model', flags.model);\n }\n\n if (flags.temperature) {\n parts.push('--temperature', flags.temperature);\n }\n\n if (flags.maxTokens) {\n parts.push('--max-tokens', flags.maxTokens);\n }\n\n if (flags.format) {\n parts.push('--output-format', flags.format);\n }\n\n if (flags.stream) {\n parts.push('--stream');\n }\n\n if (flags.verbose) {\n parts.push('--verbose');\n }\n\n // ReasoningBank memory options (NEW in v2.6.0)\n if (flags.enableMemory || flags.memory) {\n parts.push('--enable-memory');\n }\n\n if (flags.memoryDb || flags.memoryDatabase) {\n parts.push('--memory-db', flags.memoryDb || flags.memoryDatabase);\n }\n\n if (flags.memoryK) {\n parts.push('--memory-k', flags.memoryK);\n }\n\n if (flags.memoryDomain) {\n parts.push('--memory-domain', flags.memoryDomain);\n }\n\n if (flags.memoryLearning === false) {\n parts.push('--no-memory-learning');\n }\n\n if (flags.memoryMinConfidence) {\n parts.push('--memory-min-confidence', flags.memoryMinConfidence);\n }\n\n if (flags.memoryTaskId) {\n parts.push('--memory-task-id', flags.memoryTaskId);\n }\n\n // Model optimization options (NEW in v2.6.0 - agentic-flow v1.5.0+)\n if (flags.optimize) {\n parts.push('--optimize');\n }\n\n if (flags.priority) {\n parts.push('--priority', flags.priority);\n }\n\n if (flags.maxCost) {\n parts.push('--max-cost', flags.maxCost);\n }\n\n // Additional execution options (NEW in v2.6.0)\n if (flags.retry) {\n parts.push('--retry');\n }\n\n if (flags.agentsDir) {\n parts.push('--agents-dir', flags.agentsDir);\n }\n\n if (flags.timeout) {\n parts.push('--timeout', flags.timeout);\n }\n\n // API key overrides (NEW in v2.6.0)\n if (flags.anthropicKey) {\n parts.push('--anthropic-key', flags.anthropicKey);\n }\n\n if (flags.openrouterKey) {\n parts.push('--openrouter-key', flags.openrouterKey);\n }\n\n if (flags.geminiKey) {\n parts.push('--gemini-key', flags.geminiKey);\n }\n\n return parts.join(' ');\n}\n\nasync function listAgenticFlowAgents(subArgs, flags) {\n printSuccess('š Loading available agentic-flow agents...');\n\n try {\n // Agentic-flow uses 'agent list' command\n const { stdout } = await execAsync('npx agentic-flow agent list', {\n timeout: 30000,\n });\n\n console.log('\\n66+ Available Agents:\\n');\n console.log(stdout);\n console.log('\\nUsage:');\n console.log(' claude-flow agent run <agent-type> \"<task>\"');\n console.log('\\nExamples:');\n console.log(' claude-flow agent run coder \"Build a REST API with authentication\"');\n console.log(' claude-flow agent run security-auditor \"Review this code for vulnerabilities\"');\n console.log(' claude-flow agent run full-stack-developer \"Create a Next.js app\"');\n } catch (error) {\n printError('Failed to load agentic-flow agents');\n console.error('Make sure agentic-flow is installed: npm install -g agentic-flow');\n console.error(error.message);\n }\n}\n\nasync function createAgent(subArgs, flags) {\n printSuccess('š ļø Creating custom agent with agentic-flow...');\n\n try {\n // Build command for agentic-flow agent create\n let cmd = 'npx agentic-flow agent create';\n\n if (flags.name) {\n cmd += ` --name \"${flags.name}\"`;\n }\n\n if (flags.description) {\n cmd += ` --description \"${flags.description}\"`;\n }\n\n if (flags.category) {\n cmd += ` --category \"${flags.category}\"`;\n }\n\n if (flags.prompt) {\n cmd += ` --prompt \"${flags.prompt}\"`;\n }\n\n if (flags.tools) {\n cmd += ` --tools \"${flags.tools}\"`;\n }\n\n const { stdout, stderr } = await execAsync(cmd, {\n timeout: 60000,\n maxBuffer: 10 * 1024 * 1024,\n });\n\n if (stdout) {\n console.log(stdout);\n }\n\n printSuccess('ā
Agent created successfully!');\n console.log('\\nNext steps:');\n console.log(' 1. Run your agent: claude-flow agent run <agent-name> \"<task>\"');\n console.log(' 2. View agent info: claude-flow agent info <agent-name>');\n console.log(' 3. Check for conflicts: claude-flow agent conflicts');\n } catch (error) {\n printError('ā Failed to create agent');\n console.error(error.message);\n if (error.stderr) {\n console.error('Details:', error.stderr);\n }\n process.exit(1);\n }\n}\n\nasync function getAgentInfo(subArgs, flags) {\n const agentName = subArgs[1];\n\n if (!agentName) {\n printError('Usage: agent info <agent-name>');\n console.log('\\nExample:');\n console.log(' claude-flow agent info coder');\n console.log(' claude-flow agent info security-auditor');\n return;\n }\n\n printSuccess(`š Getting information for agent: ${agentName}`);\n\n try {\n const { stdout } = await execAsync(`npx agentic-flow agent info ${agentName}`, {\n timeout: 30000,\n });\n\n console.log(stdout);\n } catch (error) {\n printError(`ā Failed to get agent info for: ${agentName}`);\n console.error(error.message);\n console.log('\\nTip: List all agents with: claude-flow agent agents');\n process.exit(1);\n }\n}\n\nasync function checkAgentConflicts(subArgs, flags) {\n printSuccess('š Checking for agent conflicts between package and local agents...');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow agent conflicts', {\n timeout: 30000,\n });\n\n console.log(stdout);\n\n if (stdout.includes('No conflicts found')) {\n printSuccess('ā
No conflicts detected!');\n } else {\n printWarning('ā ļø Conflicts found! Local agents will override package agents with the same path.');\n }\n } catch (error) {\n printError('ā Failed to check agent conflicts');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function memoryCommand(subArgs, flags) {\n const memoryCmd = subArgs[1];\n\n switch (memoryCmd) {\n case 'init':\n case 'initialize':\n await initializeMemory(subArgs, flags);\n break;\n\n case 'status':\n case 'info':\n await getMemoryStatus(subArgs, flags);\n break;\n\n case 'consolidate':\n case 'prune':\n await consolidateMemory(subArgs, flags);\n break;\n\n case 'list':\n case 'ls':\n await listMemories(subArgs, flags);\n break;\n\n case 'demo':\n await runMemoryDemo(subArgs, flags);\n break;\n\n case 'test':\n await runMemoryTest(subArgs, flags);\n break;\n\n case 'benchmark':\n await runMemoryBenchmark(subArgs, flags);\n break;\n\n default:\n showMemoryHelp();\n }\n}\n\nasync function initializeMemory(subArgs, flags) {\n const dbPath = flags.db || flags.database || '.swarm/memory.db';\n\n printSuccess('š§ Initializing ReasoningBank memory system...');\n console.log(`Database: ${dbPath}`);\n\n try {\n const { stdout, stderr } = await execAsync('npx agentic-flow reasoningbank init', {\n timeout: 30000,\n });\n\n if (stdout) {\n console.log(stdout);\n }\n\n printSuccess('ā
ReasoningBank initialized successfully!');\n console.log('\\nNext steps:');\n console.log(' 1. Run agents with --enable-memory flag');\n console.log(' 2. Check status: claude-flow agent memory status');\n console.log(' 3. View demo: claude-flow agent memory demo');\n } catch (error) {\n printError('ā Failed to initialize ReasoningBank');\n console.error(error.message);\n if (error.stderr) {\n console.error('Details:', error.stderr);\n }\n process.exit(1);\n }\n}\n\nasync function getMemoryStatus(subArgs, flags) {\n printSuccess('š§ ReasoningBank Status:');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow reasoningbank status', {\n timeout: 30000,\n });\n\n console.log(stdout);\n } catch (error) {\n printError('ā Failed to get memory status');\n console.error(error.message);\n console.log('\\nTip: Initialize first with: claude-flow agent memory init');\n process.exit(1);\n }\n}\n\nasync function consolidateMemory(subArgs, flags) {\n printSuccess('š§ Consolidating ReasoningBank memories...');\n console.log('This will deduplicate and prune old/low-quality memories');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow reasoningbank consolidate', {\n timeout: 60000,\n });\n\n console.log(stdout);\n printSuccess('ā
Memory consolidation complete!');\n } catch (error) {\n printError('ā Consolidation failed');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function listMemories(subArgs, flags) {\n const domain = flags.domain;\n const limit = flags.limit || 10;\n\n printSuccess(`š§ Listing ReasoningBank memories (limit: ${limit})`);\n if (domain) {\n console.log(`Domain filter: ${domain}`);\n }\n\n try {\n let cmd = 'npx agentic-flow reasoningbank list';\n if (domain) {\n cmd += ` --domain ${domain}`;\n }\n cmd += ` --limit ${limit}`;\n\n const { stdout } = await execAsync(cmd, {\n timeout: 30000,\n });\n\n console.log(stdout);\n } catch (error) {\n printError('ā Failed to list memories');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function runMemoryDemo(subArgs, flags) {\n printSuccess('šÆ Running ReasoningBank demo...');\n console.log('This will show how memory improves task success over time\\n');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow reasoningbank demo', {\n timeout: 120000,\n });\n\n console.log(stdout);\n printSuccess('ā
Demo complete!');\n } catch (error) {\n printError('ā Demo failed');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function runMemoryTest(subArgs, flags) {\n printSuccess('š§Ŗ Running ReasoningBank integration tests...');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow reasoningbank test', {\n timeout: 120000,\n });\n\n console.log(stdout);\n printSuccess('ā
Tests complete!');\n } catch (error) {\n printError('ā Tests failed');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function runMemoryBenchmark(subArgs, flags) {\n printSuccess('ā” Running ReasoningBank performance benchmarks...');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow reasoningbank benchmark', {\n timeout: 120000,\n });\n\n console.log(stdout);\n printSuccess('ā
Benchmarks complete!');\n } catch (error) {\n printError('ā Benchmark failed');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nfunction showMemoryHelp() {\n console.log('Memory (ReasoningBank) commands:');\n console.log(' init Initialize ReasoningBank database');\n console.log(' status Show memory system status');\n console.log(' consolidate Deduplicate and prune memories');\n console.log(' list [--domain <domain>] List stored memories');\n console.log(' demo Run interactive demo');\n console.log(' test Run integration tests');\n console.log(' benchmark Run performance benchmarks');\n console.log();\n console.log('Options:');\n console.log(' --db, --database <path> Database path [default: .swarm/memory.db]');\n console.log(' --domain <domain> Filter by domain');\n console.log(' --limit <n> Limit results [default: 10]');\n console.log();\n console.log('Examples:');\n console.log(' claude-flow agent memory init');\n console.log(' claude-flow agent memory status');\n console.log(' claude-flow agent memory list --domain web --limit 5');\n console.log(' claude-flow agent memory consolidate');\n console.log(' claude-flow agent memory demo');\n}\n\n// Configuration Management for agentic-flow\nasync function configAgenticFlow(subArgs, flags) {\n const configCmd = subArgs[1];\n\n switch (configCmd) {\n case 'set':\n await agenticConfigSet(subArgs, flags);\n break;\n case 'get':\n await agenticConfigGet(subArgs, flags);\n break;\n case 'list':\n await agenticConfigList(subArgs, flags);\n break;\n case 'delete':\n case 'remove':\n case 'rm':\n await agenticConfigDelete(subArgs, flags);\n break;\n case 'reset':\n await agenticConfigReset(subArgs, flags);\n break;\n case undefined:\n case 'wizard':\n case 'interactive':\n await agenticConfigWizard(subArgs, flags);\n break;\n default:\n showAgenticConfigHelp();\n }\n}\n\nasync function agenticConfigSet(subArgs, flags) {\n const key = subArgs[2];\n const value = subArgs[3];\n\n if (!key || !value) {\n printError('Usage: agent config set <key> <value>');\n console.log('\\nExample:');\n console.log(' claude-flow agent config set ANTHROPIC_API_KEY sk-ant-xxx');\n console.log(' claude-flow agent config set DEFAULT_MODEL claude-3-5-sonnet-20241022');\n return;\n }\n\n printSuccess(`š§ Setting agentic-flow configuration: ${key}`);\n\n try {\n const { stdout } = await execAsync(`npx agentic-flow config set ${key} \"${value}\"`, {\n timeout: 30000,\n });\n console.log(stdout);\n printSuccess('ā
Configuration set successfully!');\n } catch (error) {\n printError(`ā Failed to set configuration: ${key}`);\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticConfigGet(subArgs, flags) {\n const key = subArgs[2];\n\n if (!key) {\n printError('Usage: agent config get <key>');\n console.log('\\nExample:');\n console.log(' claude-flow agent config get ANTHROPIC_API_KEY');\n return;\n }\n\n try {\n const { stdout } = await execAsync(`npx agentic-flow config get ${key}`, {\n timeout: 30000,\n });\n console.log(stdout);\n } catch (error) {\n printError(`ā Failed to get configuration: ${key}`);\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticConfigList(subArgs, flags) {\n printSuccess('š Listing agentic-flow configurations...');\n\n try {\n let cmd = 'npx agentic-flow config list';\n if (flags.showSecrets) {\n cmd += ' --show-secrets';\n }\n\n const { stdout } = await execAsync(cmd, { timeout: 30000 });\n console.log(stdout);\n\n if (!flags.showSecrets) {\n console.log('\\nš” Tip: Use --show-secrets to reveal sensitive values');\n }\n } catch (error) {\n printError('ā Failed to list configurations');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticConfigDelete(subArgs, flags) {\n const key = subArgs[2];\n\n if (!key) {\n printError('Usage: agent config delete <key>');\n return;\n }\n\n printWarning(`ā ļø Deleting configuration: ${key}`);\n\n try {\n const { stdout } = await execAsync(`npx agentic-flow config delete ${key}`, {\n timeout: 30000,\n });\n console.log(stdout);\n printSuccess('ā
Configuration deleted!');\n } catch (error) {\n printError(`ā Failed to delete configuration: ${key}`);\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticConfigReset(subArgs, flags) {\n if (!flags.force) {\n printWarning('ā ļø WARNING: This will reset ALL agentic-flow configurations!');\n console.log('\\nUse --force to confirm: claude-flow agent config reset --force');\n return;\n }\n\n printWarning('š Resetting agentic-flow configurations...');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow config reset --force', {\n timeout: 30000,\n });\n console.log(stdout);\n printSuccess('ā
Configurations reset!');\n } catch (error) {\n printError('ā Failed to reset configurations');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticConfigWizard(subArgs, flags) {\n printSuccess('š§ Starting agentic-flow configuration wizard...');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow config wizard', {\n timeout: 300000,\n });\n console.log(stdout);\n printSuccess('ā
Configuration wizard completed!');\n } catch (error) {\n printError('ā Configuration wizard failed');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nfunction showAgenticConfigHelp() {\n console.log('Agentic-flow configuration commands:');\n console.log(' set <key> <value> Set configuration value');\n console.log(' get <key> Get configuration value');\n console.log(' list List all configurations');\n console.log(' delete <key> Delete configuration value');\n console.log(' reset --force Reset to defaults');\n console.log(' wizard Run interactive setup wizard');\n console.log();\n console.log('Examples:');\n console.log(' claude-flow agent config wizard');\n console.log(' claude-flow agent config set ANTHROPIC_API_KEY sk-ant-xxx');\n console.log(' claude-flow agent config list --show-secrets');\n}\n\n// MCP Server Management for agentic-flow\nasync function mcpAgenticFlow(subArgs, flags) {\n const mcpCmd = subArgs[1];\n\n switch (mcpCmd) {\n case 'start':\n await agenticMcpStart(subArgs, flags);\n break;\n case 'stop':\n await agenticMcpStop(subArgs, flags);\n break;\n case 'status':\n await agenticMcpStatus(subArgs, flags);\n break;\n case 'list':\n case 'ls':\n await agenticMcpList(subArgs, flags);\n break;\n case 'logs':\n await agenticMcpLogs(subArgs, flags);\n break;\n case 'restart':\n await agenticMcpRestart(subArgs, flags);\n break;\n default:\n showAgenticMcpHelp();\n }\n}\n\nasync function agenticMcpStart(subArgs, flags) {\n printSuccess('š Starting agentic-flow MCP server...');\n\n try {\n let cmd = 'npx agentic-flow mcp start';\n if (flags.port) cmd += ` --port ${flags.port}`;\n if (flags.host) cmd += ` --host ${flags.host}`;\n if (flags.daemon || flags.background) cmd += ' --daemon';\n\n const { stdout } = await execAsync(cmd, { timeout: 60000 });\n console.log(stdout);\n printSuccess('ā
MCP server started!');\n } catch (error) {\n printError('ā Failed to start MCP server');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticMcpStop(subArgs, flags) {\n printWarning('š Stopping agentic-flow MCP server...');\n\n try {\n const { stdout } = await execAsync('npx agentic-flow mcp stop', { timeout: 30000 });\n console.log(stdout);\n printSuccess('ā
MCP server stopped!');\n } catch (error) {\n printError('ā Failed to stop MCP server');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticMcpStatus(subArgs, flags) {\n printSuccess('š Getting agentic-flow MCP server status...');\n\n try {\n let cmd = 'npx agentic-flow mcp status';\n if (flags.detailed || flags.verbose) cmd += ' --detailed';\n\n const { stdout } = await execAsync(cmd, { timeout: 30000 });\n console.log(stdout);\n } catch (error) {\n printError('ā Failed to get MCP status');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticMcpList(subArgs, flags) {\n printSuccess('š Listing agentic-flow MCP tools...');\n\n try {\n let cmd = 'npx agentic-flow mcp list';\n if (flags.server) cmd += ` --server ${flags.server}`;\n if (flags.category) cmd += ` --category ${flags.category}`;\n if (flags.detailed || flags.verbose) cmd += ' --detailed';\n\n const { stdout } = await execAsync(cmd, { timeout: 30000 });\n console.log(stdout);\n } catch (error) {\n printError('ā Failed to list MCP tools');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticMcpLogs(subArgs, flags) {\n printSuccess('š Getting agentic-flow MCP logs...');\n\n try {\n let cmd = 'npx agentic-flow mcp logs';\n if (flags.lines) cmd += ` --lines ${flags.lines}`;\n if (flags.follow || flags.f) cmd += ' --follow';\n if (flags.error) cmd += ' --error';\n\n const { stdout } = await execAsync(cmd, {\n timeout: flags.follow ? 0 : 30000,\n maxBuffer: 10 * 1024 * 1024\n });\n console.log(stdout);\n } catch (error) {\n printError('ā Failed to get MCP logs');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nasync function agenticMcpRestart(subArgs, flags) {\n printWarning('š Restarting agentic-flow MCP server...');\n\n try {\n await agenticMcpStop(subArgs, { ...flags, quiet: true });\n await new Promise((resolve) => setTimeout(resolve, 2000));\n await agenticMcpStart(subArgs, flags);\n printSuccess('ā
MCP server restarted!');\n } catch (error) {\n printError('ā Failed to restart MCP server');\n console.error(error.message);\n process.exit(1);\n }\n}\n\nfunction showAgenticMcpHelp() {\n console.log('Agentic-flow MCP server commands:');\n console.log(' start [--port <port>] Start MCP server');\n console.log(' stop Stop MCP server');\n console.log(' restart Restart MCP server');\n console.log(' status [--detailed] Get server status');\n console.log(' list [--server <name>] List MCP tools');\n console.log(' logs [--lines <n>] [--follow] View server logs');\n console.log();\n console.log('Options:');\n console.log(' --port <number> Server port (default: 3000)');\n console.log(' --host <string> Server host (default: localhost)');\n console.log(' --daemon, --background Run in background');\n console.log(' --server <name> Filter by server name');\n console.log(' --category <type> Filter by tool category');\n console.log(' --detailed, --verbose Detailed output');\n console.log();\n console.log('Examples:');\n console.log(' claude-flow agent mcp start --daemon');\n console.log(' claude-flow agent mcp status --detailed');\n console.log(' claude-flow agent mcp list --server agent-booster');\n console.log(' claude-flow agent mcp logs --lines 50 --follow');\n}\n\nasync function spawnAgent(subArgs, flags) {\n const agentType = subArgs[1] || 'general';\n const agentName = getFlag(subArgs, '--name') || flags.name || `agent-${Date.now()}`;\n const agentId = `${agentType}-${Date.now()}`;\n\n // Create the agent object\n const agent = {\n id: agentId,\n name: agentName,\n type: agentType,\n status: 'active',\n activeTasks: 0,\n lastActivity: Date.now(),\n capabilities: getAgentCapabilities(agentType),\n createdAt: Date.now()\n };\n\n // Store agent in session/agents directory\n const { promises: fs } = await import('fs');\n const path = await import('path');\n \n // Ensure agents directory exists\n const agentsDir = '.claude-flow/agents';\n await fs.mkdir(agentsDir, { recursive: true });\n \n // Save agent data\n const agentFile = path.join(agentsDir, `${agentId}.json`);\n await fs.writeFile(agentFile, JSON.stringify(agent, null, 2));\n \n // Update performance metrics\n const perfFile = '.claude-flow/metrics/performance.json';\n try {\n const perfData = JSON.parse(await fs.readFile(perfFile, 'utf8'));\n perfData.totalAgents = (perfData.totalAgents || 0) + 1;\n perfData.activeAgents = (perfData.activeAgents || 0) + 1;\n await fs.writeFile(perfFile, JSON.stringify(perfData, null, 2));\n } catch (e) {\n // Create new performance file if doesn't exist\n await fs.writeFile(perfFile, JSON.stringify({\n startTime: Date.now(),\n totalTasks: 0,\n successfulTasks: 0,\n failedTasks: 0,\n totalAgents: 1,\n activeAgents: 1,\n neuralEvents: 0\n }, null, 2));\n }\n\n printSuccess(`ā
Spawned ${agentType} agent: ${agentName}`);\n console.log('š¤ Agent successfully created:');\n console.log(` ID: ${agentId}`);\n console.log(` Type: ${agentType}`);\n console.log(` Name: ${agentName}`);\n console.log(` Capabilities: ${agent.capabilities.join(', ')}`);\n console.log(` Status: ${agent.status}`);\n console.log(` Location: ${agentFile}`);\n \n // Track agent spawn for performance metrics\n await onAgentSpawn(agentId, agentType, { name: agentName });\n}\n\nfunction getAgentCapabilities(type) {\n const capabilities = {\n researcher: ['Research', 'Analysis', 'Information Gathering', 'Documentation'],\n coder: ['Code Generation', 'Implementation', 'Refactoring', 'Debugging'],\n tester: ['Testing', 'Validation', 'Quality Assurance', 'Performance Testing'],\n analyst: ['Data Analysis', 'Pattern Recognition', 'Reporting', 'Optimization'],\n coordinator: ['Task Management', 'Workflow Orchestration', 'Resource Allocation'],\n general: ['Research', 'Analysis', 'Code Generation']\n };\n return capabilities[type] || capabilities.general;\n}\n\nasync function listAgents(subArgs, flags) {\n const { promises: fs } = await import('fs');\n const path = await import('path');\n \n const agentsDir = '.claude-flow/agents';\n const agents = [];\n \n try {\n const agentFiles = await fs.readdir(agentsDir);\n for (const file of agentFiles) {\n if (file.endsWith('.json')) {\n try {\n const content = await fs.readFile(path.join(agentsDir, file), 'utf8');\n const agent = JSON.parse(content);\n agents.push(agent);\n } catch {\n // Skip invalid agent files\n }\n }\n }\n } catch {\n // Agents directory doesn't exist yet\n }\n \n if (agents.length > 0) {\n printSuccess(`Active agents (${agents.length}):`);\n agents.forEach(agent => {\n const statusEmoji = agent.status === 'active' ? 'š¢' : 'š”';\n console.log(`${statusEmoji} ${agent.name} (${agent.type})`);\n console.log(` ID: ${agent.id}`);\n console.log(` Status: ${agent.status}`);\n console.log(` Tasks: ${agent.activeTasks}`);\n console.log(` Created: ${new Date(agent.createdAt).toLocaleString()}`);\n console.log('');\n });\n } else {\n console.log('š No agents currently active');\n console.log('\\nTo create agents:');\n console.log(' claude-flow agent spawn researcher --name \"ResearchBot\"');\n console.log(' claude-flow agent spawn coder --name \"CodeBot\"');\n console.log(' claude-flow agent spawn analyst --name \"DataBot\"');\n }\n}\n\nasync function manageHierarchy(subArgs, flags) {\n const hierarchyCmd = subArgs[1];\n\n switch (hierarchyCmd) {\n case 'create':\n const hierarchyType = subArgs[2] || 'basic';\n printSuccess(`Creating ${hierarchyType} agent hierarchy`);\n console.log('šļø Hierarchy structure would include:');\n console.log(' - Coordinator Agent (manages workflow)');\n console.log(' - Specialist Agents (domain-specific tasks)');\n console.log(' - Worker Agents (execution tasks)');\n break;\n\n case 'show':\n printSuccess('Current agent hierarchy:');\n console.log('š No hierarchy configured (orchestrator not running)');\n break;\n\n default:\n console.log('Hierarchy commands: create, show');\n console.log('Examples:');\n console.log(' claude-flow agent hierarchy create enterprise');\n console.log(' claude-flow agent hierarchy show');\n }\n}\n\nasync function manageNetwork(subArgs, flags) {\n const networkCmd = subArgs[1];\n\n switch (networkCmd) {\n case 'topology':\n printSuccess('Agent network topology:');\n console.log('š Network visualization would show agent connections');\n break;\n\n case 'metrics':\n printSuccess('Network performance metrics:');\n console.log('š Communication latency, throughput, reliability stats');\n break;\n\n default:\n console.log('Network commands: topology, metrics');\n }\n}\n\nasync function manageEcosystem(subArgs, flags) {\n const ecosystemCmd = subArgs[1];\n\n switch (ecosystemCmd) {\n case 'status':\n printSuccess('Agent ecosystem status:');\n console.log('š± Ecosystem health: Not running');\n console.log(' Active Agents: 0');\n console.log(' Resource Usage: 0%');\n console.log(' Task Queue: Empty');\n break;\n\n case 'optimize':\n printSuccess('Optimizing agent ecosystem...');\n console.log('ā” Optimization would include:');\n console.log(' - Load balancing across agents');\n console.log(' - Resource allocation optimization');\n console.log(' - Communication path optimization');\n break;\n\n default:\n console.log('Ecosystem commands: status, optimize');\n }\n}\n\nasync function provisionAgent(subArgs, flags) {\n const provision = subArgs[1];\n\n if (!provision) {\n printError('Usage: agent provision <count>');\n return;\n }\n\n const count = parseInt(provision);\n if (isNaN(count) || count < 1) {\n printError('Count must be a positive number');\n return;\n }\n\n printSuccess(`Provisioning ${count} agents...`);\n console.log('š Auto-provisioning would create:');\n for (let i = 1; i <= count; i++) {\n console.log(` Agent ${i}: Type=general, Status=provisioning`);\n }\n}\n\nasync function terminateAgent(subArgs, flags) {\n const agentId = subArgs[1];\n\n if (!agentId) {\n printError('Usage: agent terminate <agent-id>');\n return;\n }\n\n printSuccess(`Terminating agent: ${agentId}`);\n console.log('š Agent would be gracefully shut down');\n}\n\nasync function showAgentInfo(subArgs, flags) {\n const agentId = subArgs[1];\n\n if (!agentId) {\n printError('Usage: agent info <agent-id>');\n return;\n }\n\n printSuccess(`Agent information: ${agentId}`);\n console.log('š Agent details would include:');\n console.log(' Status, capabilities, current tasks, performance metrics');\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\nfunction showAgentHelp() {\n console.log('Agent commands:');\n console.log('\\nš Agentic-Flow Integration (NEW in v2.6.0):');\n console.log(' run <agent> \"<task>\" [options] Execute agent with multi-provider support');\n console.log(' agents List all 66+ agentic-flow agents');\n console.log(' create --name <name> [options] Create custom agent');\n console.log(' info <agent-name> Show detailed agent information');\n console.log(' conflicts Check for agent conflicts');\n console.log('\\nš§ ReasoningBank Memory (NEW in v2.6.0):');\n console.log(' memory init Initialize memory system');\n console.log(' memory status Show memory statistics');\n console.log(' memory consolidate Prune and deduplicate memories');\n console.log(' memory list [--domain <d>] List stored memories');\n console.log(' memory demo Run interactive demo');\n console.log(' memory test Run integration tests');\n console.log(' memory benchmark Run performance benchmarks');\n console.log('\\nš§ Configuration Management (NEW in v2.6.0):');\n console.log(' config wizard Run interactive setup wizard');\n console.log(' config set <key> <value> Set configuration value');\n console.log(' config get <key> Get configuration value');\n console.log(' config list [--show-secrets] List all configurations');\n console.log(' config delete <key> Delete configuration value');\n console.log(' config reset --force Reset to defaults');\n console.log('\\nš MCP Server Management (NEW in v2.6.0):');\n console.log(' mcp start [--port <port>] Start MCP server');\n console.log(' mcp stop Stop MCP server');\n console.log(' mcp restart Restart MCP server');\n console.log(' mcp status [--detailed] Get server status');\n console.log(' mcp list [--server <name>] List MCP tools');\n console.log(' mcp logs [--lines <n>] [-f] View server logs');\n console.log('\\nš Agent Booster - Ultra-Fast Code Editing (NEW in v2.6.0):');\n console.log(' booster edit <file> \"<instr>\" Edit file (352x faster, $0)');\n console.log(' booster batch <pattern> \"<i>\" Batch edit files');\n console.log(' booster parse-markdown <file> Parse markdown edits');\n console.log(' booster benchmark [options] Run performance tests');\n console.log(' booster help Show Agent Booster help');\n console.log('\\nš¤ Internal Agent Management:');\n console.log(' spawn <type> [--name <name>] Create internal agent');\n console.log(' list [--verbose] List active internal agents');\n console.log(' terminate <id> Stop specific agent');\n console.log(' hierarchy <create|show> Manage agent hierarchies');\n console.log(' network <topology|metrics> Agent network operations');\n console.log(' ecosystem <status|optimize> Ecosystem management');\n console.log(' provision <count> Auto-provision agents');\n console.log();\n console.log('Execution Options (for run command):');\n console.log(' --provider <provider> Provider: anthropic, openrouter, onnx, gemini');\n console.log(' --model <model> Specific model to use');\n console.log(' --temperature <temp> Temperature (0.0-1.0)');\n console.log(' --max-tokens <tokens> Maximum tokens');\n console.log(' --format <format> Output format: text, json, markdown');\n console.log(' --stream Enable streaming');\n console.log(' --verbose Verbose output');\n console.log();\n console.log('Model Optimization Options (NEW in v2.6.0):');\n console.log(' --optimize Auto-select optimal model (85-98% savings)');\n console.log(' --priority <priority> Priority: quality, cost, speed, privacy, balanced');\n console.log(' --max-cost <dollars> Maximum cost per task in dollars');\n console.log();\n console.log('Advanced Execution Options (NEW in v2.6.0):');\n console.log(' --retry Auto-retry on transient errors');\n console.log(' --agents-dir <path> Custom agents directory');\n console.log(' --timeout <ms> Execution timeout in milliseconds');\n console.log(' --anthropic-key <key> Override Anthropic API key');\n console.log(' --openrouter-key <key> Override OpenRouter API key');\n console.log(' --gemini-key <key> Override Gemini API key');\n console.log();\n console.log('Memory Options (NEW - for run command):');\n console.log(' --enable-memory Enable ReasoningBank learning');\n console.log(' ā ļø REQUIRES .env with API keys');\n console.log(' Run: claude-flow init --env');\n console.log(' --memory-db <path> Memory database path [default: .swarm/memory.db]');\n console.log(' --memory-k <n> Top-k memories to retrieve [default: 3]');\n console.log(' --memory-domain <domain> Domain filter for memories');\n console.log(' --no-memory-learning Disable post-task learning');\n console.log(' --memory-min-confidence <n> Min confidence threshold [default: 0.5]');\n console.log(' --memory-task-id <id> Custom task ID for tracking');\n console.log();\n console.log('Examples:');\n console.log('\\n # Execute with agentic-flow (multi-provider)');\n console.log(' claude-flow agent run coder \"Build REST API with authentication\"');\n console.log(' claude-flow agent run researcher \"Research React 19 features\" --provider openrouter');\n console.log(' claude-flow agent run security-auditor \"Audit code\" --provider onnx');\n console.log(' claude-flow agent agents # List all available agents');\n console.log('\\n # Model optimization (85-98% cost savings)');\n console.log(' claude-flow agent run coder \"Build API\" --optimize');\n console.log(' claude-flow agent run coder \"Fix bug\" --optimize --priority cost');\n console.log(' claude-flow agent run coder \"Critical fix\" --optimize --priority quality --max-cost 0.50');\n console.log('\\n # Execute with ReasoningBank memory (learns from experience)');\n console.log(' claude-flow agent run coder \"Build API\" --enable-memory');\n console.log(' claude-flow agent run coder \"Add auth\" --enable-memory --memory-domain api');\n console.log(' claude-flow agent run coder \"Fix bug\" --enable-memory --memory-k 5');\n console.log('\\n # Memory management');\n console.log(' claude-flow agent memory init');\n console.log(' claude-flow agent memory status');\n console.log(' claude-flow agent memory list --domain api --limit 10');\n console.log(' claude-flow agent memory consolidate');\n console.log(' claude-flow agent memory demo # See 70% ā 88% success improvement');\n console.log('\\n # Configuration management');\n console.log(' claude-flow agent config wizard # Interactive setup');\n console.log(' claude-flow agent config set ANTHROPIC_API_KEY sk-ant-xxx');\n console.log(' claude-flow agent config list --show-secrets');\n console.log(' claude-flow agent config get DEFAULT_MODEL');\n console.log('\\n # MCP server management');\n console.log(' claude-flow agent mcp start --daemon');\n console.log(' claude-flow agent mcp status --detailed');\n console.log(' claude-flow agent mcp list --server agent-booster');\n console.log(' claude-flow agent mcp logs --follow');\n console.log('\\n # Internal agent management');\n console.log(' claude-flow agent spawn researcher --name \"DataBot\"');\n console.log(' claude-flow agent list --verbose');\n console.log(' claude-flow agent hierarchy create enterprise');\n}\n"],"names":["printSuccess","printError","printWarning","onAgentSpawn","exec","promisify","execAsync","agentCommand","subArgs","flags","agentCmd","help","h","showAgentHelp","executeAgentTask","spawnAgent","listAgents","listAgenticFlowAgents","createAgent","getAgentInfo","checkAgentConflicts","memoryCommand","configAgenticFlow","mcpAgenticFlow","manageHierarchy","manageNetwork","manageEcosystem","provisionAgent","terminateAgent","agentBoosterCommand","agentType","task","console","log","enableMemory","memory","checkEnvConfig","showEnvSetupInstructions","envCheck","process","cwd","exists","exit","hasApiKeys","keys","anthropic","openrouter","gemini","provider","cmd","buildAgenticFlowCommand","stdout","stderr","timeout","maxBuffer","verbose","warn","error","message","agent","parts","push","replace","model","temperature","maxTokens","format","stream","memoryDb","memoryDatabase","memoryK","memoryDomain","memoryLearning","memoryMinConfidence","memoryTaskId","optimize","priority","maxCost","retry","agentsDir","anthropicKey","openrouterKey","geminiKey","join","name","description","category","prompt","tools","agentName","includes","memoryCmd","initializeMemory","getMemoryStatus","consolidateMemory","listMemories","runMemoryDemo","runMemoryTest","runMemoryBenchmark","showMemoryHelp","dbPath","db","database","domain","limit","configCmd","agenticConfigSet","agenticConfigGet","agenticConfigList","agenticConfigDelete","agenticConfigReset","undefined","agenticConfigWizard","showAgenticConfigHelp","key","value","showSecrets","force","mcpCmd","agenticMcpStart","agenticMcpStop","agenticMcpStatus","agenticMcpList","agenticMcpLogs","agenticMcpRestart","showAgenticMcpHelp","port","host","daemon","background","detailed","server","lines","follow","f","quiet","Promise","resolve","setTimeout","getFlag","Date","now","agentId","id","type","status","activeTasks","lastActivity","capabilities","getAgentCapabilities","createdAt","promises","fs","path","mkdir","recursive","agentFile","writeFile","JSON","stringify","perfFile","perfData","parse","readFile","totalAgents","activeAgents","e","startTime","totalTasks","successfulTasks","failedTasks","neuralEvents","researcher","coder","tester","analyst","coordinator","general","agents","agentFiles","readdir","file","endsWith","content","length","forEach","statusEmoji","toLocaleString","hierarchyCmd","hierarchyType","networkCmd","ecosystemCmd","provision","count","parseInt","isNaN","i","showAgentInfo","args","flagName","index","indexOf"],"mappings":"AACA,SAASA,YAAY,EAAEC,UAAU,EAAEC,YAAY,QAAQ,cAAc;AACrE,SAASC,YAAY,QAAuB,yBAAyB;AACrE,SAASC,IAAI,QAAQ,gBAAgB;AACrC,SAASC,SAAS,QAAQ,OAAO;AAEjC,MAAMC,YAAYD,UAAUD;AAE5B,OAAO,eAAeG,aAAaC,OAAO,EAAEC,KAAK;IAC/C,MAAMC,WAAWF,OAAO,CAAC,EAAE;IAG3B,IAAIC,MAAME,IAAI,IAAIF,MAAMG,CAAC,IAAIF,aAAa,YAAYA,aAAa,MAAM;QACvEG;QACA;IACF;IAEA,OAAQH;QACN,KAAK;QACL,KAAK;YACH,MAAMI,iBAAiBN,SAASC;YAChC;QAEF,KAAK;YACH,MAAMM,WAAWP,SAASC;YAC1B;QAEF,KAAK;YACH,MAAMO,WAAWR,SAASC;YAC1B;QAEF,KAAK;YACH,MAAMQ,sBAAsBT,SAASC;YACrC;QAEF,KAAK;YACH,MAAMS,YAAYV,SAASC;YAC3B;QAEF,KAAK;YACH,MAAMU,aAAaX,SAASC;YAC5B;QAEF,KAAK;YACH,MAAMW,oBAAoBZ,SAASC;YACnC;QAEF,KAAK;YACH,MAAMY,cAAcb,SAASC;YAC7B;QAEF,KAAK;QACL,KAAK;YACH,MAAMa,kBAAkBd,SAASC;YACjC;QAEF,KAAK;QACL,KAAK;YACH,MAAMc,eAAef,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMe,gBAAgBhB,SAASC;YAC/B;QAEF,KAAK;YACH,MAAMgB,cAAcjB,SAASC;YAC7B;QAEF,KAAK;YACH,MAAMiB,gBAAgBlB,SAASC;YAC/B;QAEF,KAAK;YACH,MAAMkB,eAAenB,SAASC;YAC9B;QAEF,KAAK;YACH,MAAMmB,eAAepB,SAASC;YAC9B;QAEF,KAAK;YACH,MAAM,EAAEoB,mBAAmB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D,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,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,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;AACd"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { printSuccess, printError, printWarning } from '../utils.js';
|
|
2
|
+
import { existsSync } from 'fs';
|
|
3
|
+
import { promises as fs } from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
export async function generateEnvTemplate(workingDir = process.cwd(), force = false) {
|
|
6
|
+
const envPath = path.join(workingDir, '.env');
|
|
7
|
+
if (existsSync(envPath) && !force) {
|
|
8
|
+
printWarning('ā ļø .env file already exists');
|
|
9
|
+
console.log('Use --force to overwrite existing .env file');
|
|
10
|
+
return {
|
|
11
|
+
exists: true,
|
|
12
|
+
created: false
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const template = `# Agentic Flow Configuration
|
|
16
|
+
# Generated by claude-flow init --env
|
|
17
|
+
# Created: ${new Date().toISOString()}
|
|
18
|
+
|
|
19
|
+
# ============================================
|
|
20
|
+
# REQUIRED FOR REASONINGBANK MEMORY
|
|
21
|
+
# ============================================
|
|
22
|
+
# Without these, ReasoningBank will fall back to heuristic mode (regex matching)
|
|
23
|
+
# For actual learning and memory consolidation, you MUST provide API keys
|
|
24
|
+
|
|
25
|
+
# Anthropic API key for Claude models (sk-ant-...)
|
|
26
|
+
# Get your key: https://console.anthropic.com/settings/keys
|
|
27
|
+
ANTHROPIC_API_KEY=
|
|
28
|
+
|
|
29
|
+
# OpenRouter API key for alternative models (sk-or-v1-...)
|
|
30
|
+
# Get your key: https://openrouter.ai/keys
|
|
31
|
+
# Enables 99% cost savings with DeepSeek R1 for judge/distill
|
|
32
|
+
OPENROUTER_API_KEY=
|
|
33
|
+
|
|
34
|
+
# Google Gemini API key (optional, for free tier)
|
|
35
|
+
# Get your key: https://aistudio.google.com/app/apikey
|
|
36
|
+
GOOGLE_GEMINI_API_KEY=
|
|
37
|
+
|
|
38
|
+
# ============================================
|
|
39
|
+
# MODEL CONFIGURATION
|
|
40
|
+
# ============================================
|
|
41
|
+
# Default model for completions (Claude 3.5 Sonnet v2 - latest)
|
|
42
|
+
COMPLETION_MODEL=claude-3-5-sonnet-20241022
|
|
43
|
+
|
|
44
|
+
# Default provider (anthropic, openrouter, onnx, gemini)
|
|
45
|
+
PROVIDER=anthropic
|
|
46
|
+
|
|
47
|
+
# ============================================
|
|
48
|
+
# ADVANCED: REASONINGBANK COST OPTIMIZATION
|
|
49
|
+
# ============================================
|
|
50
|
+
# To use cheap models for memory operations (46% savings):
|
|
51
|
+
# 1. Set OPENROUTER_API_KEY above
|
|
52
|
+
# 2. Create .swarm/reasoningbank.yaml with:
|
|
53
|
+
#
|
|
54
|
+
# reasoningbank:
|
|
55
|
+
# judge:
|
|
56
|
+
# model: "deepseek/deepseek-r1"
|
|
57
|
+
# max_tokens: 512
|
|
58
|
+
# temperature: 0
|
|
59
|
+
# distill:
|
|
60
|
+
# model: "deepseek/deepseek-r1"
|
|
61
|
+
# max_tokens: 2048
|
|
62
|
+
# temperature: 0.3
|
|
63
|
+
# embeddings:
|
|
64
|
+
# provider: "openrouter"
|
|
65
|
+
# model: "deepseek/deepseek-r1"
|
|
66
|
+
# dimensions: 1024
|
|
67
|
+
#
|
|
68
|
+
# This keeps Claude for main work but uses DeepSeek for memory (99% cheaper)
|
|
69
|
+
# Result: $0.37 ā $0.20 per task with memory (46% savings!)
|
|
70
|
+
|
|
71
|
+
# ============================================
|
|
72
|
+
# OPTIONAL API KEYS
|
|
73
|
+
# ============================================
|
|
74
|
+
# Perplexity API key (for GOAP search integration)
|
|
75
|
+
PERPLEXITY_API_KEY=
|
|
76
|
+
|
|
77
|
+
# Hugging Face API key (for ONNX models)
|
|
78
|
+
HUGGINGFACE_API_KEY=
|
|
79
|
+
|
|
80
|
+
# E2B API keys (for Flow Nexus sandbox deployment)
|
|
81
|
+
E2B_API_KEY=
|
|
82
|
+
E2B_ACCESS_TOKEN=
|
|
83
|
+
|
|
84
|
+
# Supabase configuration (for Flow Nexus cloud features)
|
|
85
|
+
SUPABASE_URL=
|
|
86
|
+
SUPABASE_ANON_KEY=
|
|
87
|
+
SUPABASE_ACCESS_TOKEN=
|
|
88
|
+
SUPABASE_PROJECT_ID=
|
|
89
|
+
|
|
90
|
+
# ============================================
|
|
91
|
+
# WHAT HAPPENS WITHOUT .env?
|
|
92
|
+
# ============================================
|
|
93
|
+
# Without this file:
|
|
94
|
+
# 1. No automatic environment variable loading
|
|
95
|
+
# 2. ReasoningBank falls back to heuristic judgment (regex-based)
|
|
96
|
+
# 3. No actual learning or memory consolidation
|
|
97
|
+
# 4. Demo will appear to work but uses pattern matching only
|
|
98
|
+
#
|
|
99
|
+
# You can still work without .env by:
|
|
100
|
+
# - Manually exporting environment variables
|
|
101
|
+
# - Or passing inline with commands
|
|
102
|
+
#
|
|
103
|
+
# But using .env is recommended for convenience and security.
|
|
104
|
+
|
|
105
|
+
# ============================================
|
|
106
|
+
# SECURITY NOTES
|
|
107
|
+
# ============================================
|
|
108
|
+
# 1. NEVER commit this file to git (it's in .gitignore)
|
|
109
|
+
# 2. Use different keys for dev/staging/production
|
|
110
|
+
# 3. Rotate keys regularly
|
|
111
|
+
# 4. Use key-specific permissions when possible
|
|
112
|
+
`;
|
|
113
|
+
try {
|
|
114
|
+
await fs.writeFile(envPath, template, 'utf8');
|
|
115
|
+
printSuccess('ā
Created .env template file');
|
|
116
|
+
return {
|
|
117
|
+
exists: false,
|
|
118
|
+
created: true,
|
|
119
|
+
path: envPath
|
|
120
|
+
};
|
|
121
|
+
} catch (error) {
|
|
122
|
+
printError(`ā Failed to create .env template: ${error.message}`);
|
|
123
|
+
return {
|
|
124
|
+
exists: false,
|
|
125
|
+
created: false,
|
|
126
|
+
error: error.message
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export async function checkEnvConfig(workingDir = process.cwd()) {
|
|
131
|
+
const envPath = path.join(workingDir, '.env');
|
|
132
|
+
if (!existsSync(envPath)) {
|
|
133
|
+
return {
|
|
134
|
+
exists: false,
|
|
135
|
+
hasApiKeys: false,
|
|
136
|
+
message: '.env file not found'
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
const envContent = await fs.readFile(envPath, 'utf8');
|
|
141
|
+
const hasAnthropicKey = /^ANTHROPIC_API_KEY=[^\s]+$/m.test(envContent);
|
|
142
|
+
const hasOpenRouterKey = /^OPENROUTER_API_KEY=[^\s]+$/m.test(envContent);
|
|
143
|
+
const hasGeminiKey = /^GOOGLE_GEMINI_API_KEY=[^\s]+$/m.test(envContent);
|
|
144
|
+
return {
|
|
145
|
+
exists: true,
|
|
146
|
+
hasApiKeys: hasAnthropicKey || hasOpenRouterKey || hasGeminiKey,
|
|
147
|
+
keys: {
|
|
148
|
+
anthropic: hasAnthropicKey,
|
|
149
|
+
openrouter: hasOpenRouterKey,
|
|
150
|
+
gemini: hasGeminiKey
|
|
151
|
+
},
|
|
152
|
+
message: 'Configuration found'
|
|
153
|
+
};
|
|
154
|
+
} catch (error) {
|
|
155
|
+
return {
|
|
156
|
+
exists: true,
|
|
157
|
+
hasApiKeys: false,
|
|
158
|
+
message: `Error reading .env: ${error.message}`
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export function showEnvSetupInstructions() {
|
|
163
|
+
console.log('\nš Setting up .env for ReasoningBank capabilities:\n');
|
|
164
|
+
console.log('1. Create .env file:');
|
|
165
|
+
console.log(' claude-flow init --env\n');
|
|
166
|
+
console.log('2. Add your API keys to .env:');
|
|
167
|
+
console.log(' ANTHROPIC_API_KEY=sk-ant-...');
|
|
168
|
+
console.log(' OPENROUTER_API_KEY=sk-or-v1-... # Optional: 99% cost savings\n');
|
|
169
|
+
console.log('3. Get API keys:');
|
|
170
|
+
console.log(' ⢠Anthropic: https://console.anthropic.com/settings/keys');
|
|
171
|
+
console.log(' ⢠OpenRouter: https://openrouter.ai/keys (for cost optimization)\n');
|
|
172
|
+
console.log('š” Without API keys:');
|
|
173
|
+
console.log(' ⢠ReasoningBank falls back to regex pattern matching (no learning)');
|
|
174
|
+
console.log(' ⢠Memory operations will appear to work but won\'t actually learn\n');
|
|
175
|
+
console.log('š° Cost optimization:');
|
|
176
|
+
console.log(' ⢠Use OpenRouter + DeepSeek R1 for judge/distill (99% cheaper)');
|
|
177
|
+
console.log(' ⢠See: docs/REASONINGBANK-COST-OPTIMIZATION.md\n');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
//# sourceMappingURL=env-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/simple-commands/env-template.js"],"sourcesContent":["// env-template.js - Environment template generator\nimport { printSuccess, printError, printWarning } from '../utils.js';\nimport { existsSync } from 'fs';\nimport { promises as fs } from 'fs';\nimport path from 'path';\n\n/**\n * Generate .env template with configuration instructions\n */\nexport async function generateEnvTemplate(workingDir = process.cwd(), force = false) {\n const envPath = path.join(workingDir, '.env');\n\n // Check if .env already exists\n if (existsSync(envPath) && !force) {\n printWarning('ā ļø .env file already exists');\n console.log('Use --force to overwrite existing .env file');\n return { exists: true, created: false };\n }\n\n const template = `# Agentic Flow Configuration\n# Generated by claude-flow init --env\n# Created: ${new Date().toISOString()}\n\n# ============================================\n# REQUIRED FOR REASONINGBANK MEMORY\n# ============================================\n# Without these, ReasoningBank will fall back to heuristic mode (regex matching)\n# For actual learning and memory consolidation, you MUST provide API keys\n\n# Anthropic API key for Claude models (sk-ant-...)\n# Get your key: https://console.anthropic.com/settings/keys\nANTHROPIC_API_KEY=\n\n# OpenRouter API key for alternative models (sk-or-v1-...)\n# Get your key: https://openrouter.ai/keys\n# Enables 99% cost savings with DeepSeek R1 for judge/distill\nOPENROUTER_API_KEY=\n\n# Google Gemini API key (optional, for free tier)\n# Get your key: https://aistudio.google.com/app/apikey\nGOOGLE_GEMINI_API_KEY=\n\n# ============================================\n# MODEL CONFIGURATION\n# ============================================\n# Default model for completions (Claude 3.5 Sonnet v2 - latest)\nCOMPLETION_MODEL=claude-3-5-sonnet-20241022\n\n# Default provider (anthropic, openrouter, onnx, gemini)\nPROVIDER=anthropic\n\n# ============================================\n# ADVANCED: REASONINGBANK COST OPTIMIZATION\n# ============================================\n# To use cheap models for memory operations (46% savings):\n# 1. Set OPENROUTER_API_KEY above\n# 2. Create .swarm/reasoningbank.yaml with:\n#\n# reasoningbank:\n# judge:\n# model: \"deepseek/deepseek-r1\"\n# max_tokens: 512\n# temperature: 0\n# distill:\n# model: \"deepseek/deepseek-r1\"\n# max_tokens: 2048\n# temperature: 0.3\n# embeddings:\n# provider: \"openrouter\"\n# model: \"deepseek/deepseek-r1\"\n# dimensions: 1024\n#\n# This keeps Claude for main work but uses DeepSeek for memory (99% cheaper)\n# Result: $0.37 ā $0.20 per task with memory (46% savings!)\n\n# ============================================\n# OPTIONAL API KEYS\n# ============================================\n# Perplexity API key (for GOAP search integration)\nPERPLEXITY_API_KEY=\n\n# Hugging Face API key (for ONNX models)\nHUGGINGFACE_API_KEY=\n\n# E2B API keys (for Flow Nexus sandbox deployment)\nE2B_API_KEY=\nE2B_ACCESS_TOKEN=\n\n# Supabase configuration (for Flow Nexus cloud features)\nSUPABASE_URL=\nSUPABASE_ANON_KEY=\nSUPABASE_ACCESS_TOKEN=\nSUPABASE_PROJECT_ID=\n\n# ============================================\n# WHAT HAPPENS WITHOUT .env?\n# ============================================\n# Without this file:\n# 1. No automatic environment variable loading\n# 2. ReasoningBank falls back to heuristic judgment (regex-based)\n# 3. No actual learning or memory consolidation\n# 4. Demo will appear to work but uses pattern matching only\n#\n# You can still work without .env by:\n# - Manually exporting environment variables\n# - Or passing inline with commands\n#\n# But using .env is recommended for convenience and security.\n\n# ============================================\n# SECURITY NOTES\n# ============================================\n# 1. NEVER commit this file to git (it's in .gitignore)\n# 2. Use different keys for dev/staging/production\n# 3. Rotate keys regularly\n# 4. Use key-specific permissions when possible\n`;\n\n // Write template\n try {\n await fs.writeFile(envPath, template, 'utf8');\n printSuccess('ā
Created .env template file');\n return { exists: false, created: true, path: envPath };\n } catch (error) {\n printError(`ā Failed to create .env template: ${error.message}`);\n return { exists: false, created: false, error: error.message };\n }\n}\n\n/**\n * Check if .env exists and has required keys\n */\nexport async function checkEnvConfig(workingDir = process.cwd()) {\n const envPath = path.join(workingDir, '.env');\n\n if (!existsSync(envPath)) {\n return {\n exists: false,\n hasApiKeys: false,\n message: '.env file not found'\n };\n }\n\n try {\n const envContent = await fs.readFile(envPath, 'utf8');\n\n // Check for API keys (not commented out and not empty)\n const hasAnthropicKey = /^ANTHROPIC_API_KEY=[^\\s]+$/m.test(envContent);\n const hasOpenRouterKey = /^OPENROUTER_API_KEY=[^\\s]+$/m.test(envContent);\n const hasGeminiKey = /^GOOGLE_GEMINI_API_KEY=[^\\s]+$/m.test(envContent);\n\n return {\n exists: true,\n hasApiKeys: hasAnthropicKey || hasOpenRouterKey || hasGeminiKey,\n keys: {\n anthropic: hasAnthropicKey,\n openrouter: hasOpenRouterKey,\n gemini: hasGeminiKey\n },\n message: 'Configuration found'\n };\n } catch (error) {\n return {\n exists: true,\n hasApiKeys: false,\n message: `Error reading .env: ${error.message}`\n };\n }\n}\n\n/**\n * Show .env setup instructions\n */\nexport function showEnvSetupInstructions() {\n console.log('\\nš Setting up .env for ReasoningBank capabilities:\\n');\n console.log('1. Create .env file:');\n console.log(' claude-flow init --env\\n');\n console.log('2. Add your API keys to .env:');\n console.log(' ANTHROPIC_API_KEY=sk-ant-...');\n console.log(' OPENROUTER_API_KEY=sk-or-v1-... # Optional: 99% cost savings\\n');\n console.log('3. Get API keys:');\n console.log(' ⢠Anthropic: https://console.anthropic.com/settings/keys');\n console.log(' ⢠OpenRouter: https://openrouter.ai/keys (for cost optimization)\\n');\n console.log('š” Without API keys:');\n console.log(' ⢠ReasoningBank falls back to regex pattern matching (no learning)');\n console.log(' ⢠Memory operations will appear to work but won\\'t actually learn\\n');\n console.log('š° Cost optimization:');\n console.log(' ⢠Use OpenRouter + DeepSeek R1 for judge/distill (99% cheaper)');\n console.log(' ⢠See: docs/REASONINGBANK-COST-OPTIMIZATION.md\\n');\n}\n"],"names":["printSuccess","printError","printWarning","existsSync","promises","fs","path","generateEnvTemplate","workingDir","process","cwd","force","envPath","join","console","log","exists","created","template","Date","toISOString","writeFile","error","message","checkEnvConfig","hasApiKeys","envContent","readFile","hasAnthropicKey","test","hasOpenRouterKey","hasGeminiKey","keys","anthropic","openrouter","gemini","showEnvSetupInstructions"],"mappings":"AACA,SAASA,YAAY,EAAEC,UAAU,EAAEC,YAAY,QAAQ,cAAc;AACrE,SAASC,UAAU,QAAQ,KAAK;AAChC,SAASC,YAAYC,EAAE,QAAQ,KAAK;AACpC,OAAOC,UAAU,OAAO;AAKxB,OAAO,eAAeC,oBAAoBC,aAAaC,QAAQC,GAAG,EAAE,EAAEC,QAAQ,KAAK;IACjF,MAAMC,UAAUN,KAAKO,IAAI,CAACL,YAAY;IAGtC,IAAIL,WAAWS,YAAY,CAACD,OAAO;QACjCT,aAAa;QACbY,QAAQC,GAAG,CAAC;QACZ,OAAO;YAAEC,QAAQ;YAAMC,SAAS;QAAM;IACxC;IAEA,MAAMC,WAAW,CAAC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AG,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,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd"}
|
|
@@ -12,6 +12,19 @@ export function showInitHelp() {
|
|
|
12
12
|
console.log(' --dry-run, -d Preview what would be created without making changes');
|
|
13
13
|
console.log(' --help, -h Show this help message');
|
|
14
14
|
console.log();
|
|
15
|
+
console.log('Environment Configuration:');
|
|
16
|
+
console.log(' --env Generate .env template for API keys');
|
|
17
|
+
console.log(' ⢠Required for ReasoningBank memory');
|
|
18
|
+
console.log(' ⢠Includes setup instructions');
|
|
19
|
+
console.log(' ⢠Cost optimization guide');
|
|
20
|
+
console.log();
|
|
21
|
+
console.log('Specialized Agent Setup:');
|
|
22
|
+
console.log(' --agent reasoning Setup ReasoningBank agents with closed-loop learning');
|
|
23
|
+
console.log(' Includes goal-planner and sublinear-goal-planner agents');
|
|
24
|
+
console.log(' ⢠+26% success rate (70% ā 88%)');
|
|
25
|
+
console.log(' ⢠-25% token usage (cost savings)');
|
|
26
|
+
console.log(' ⢠3.2x learning velocity (faster improvement)');
|
|
27
|
+
console.log();
|
|
15
28
|
console.log('Alternative Initialization Modes:');
|
|
16
29
|
console.log(' --basic Use basic initialization (pre-v2.0.0 behavior)');
|
|
17
30
|
console.log(' --sparc, -s Initialize with SPARC development environment');
|
|
@@ -42,6 +55,10 @@ export function showInitHelp() {
|
|
|
42
55
|
console.log(' --validate --skip-mode-test Skip SPARC mode testing');
|
|
43
56
|
console.log();
|
|
44
57
|
console.log('Examples:');
|
|
58
|
+
console.log('š ENVIRONMENT SETUP:');
|
|
59
|
+
console.log(' claude-flow init --env # Generate .env template');
|
|
60
|
+
console.log(' claude-flow init --env --force # Overwrite existing .env');
|
|
61
|
+
console.log();
|
|
45
62
|
console.log('š CLAUDE FLOW v2.0.0 (DEFAULT):');
|
|
46
63
|
console.log(' claude-flow init # ā DEFAULT: Full Claude Flow v2.0.0 setup');
|
|
47
64
|
console.log(' claude-flow init --force # Overwrite existing configuration');
|
|
@@ -56,6 +73,12 @@ export function showInitHelp() {
|
|
|
56
73
|
console.log(' claude-flow init --dry-run --sparc # Preview initialization');
|
|
57
74
|
console.log(' claude-flow init --minimal # Minimal setup');
|
|
58
75
|
console.log();
|
|
76
|
+
console.log('š§ REASONING AGENTS WITH REASONINGBANK:');
|
|
77
|
+
console.log(' claude-flow init --agent reasoning # Setup ReasoningBank agents');
|
|
78
|
+
console.log(' claude-flow init --agent reasoning --force # Overwrite existing setup');
|
|
79
|
+
console.log(' # Note: Requires .env with API keys for actual learning');
|
|
80
|
+
console.log(' # Use: npx agentic-flow --agent goal-planner --task "your task"');
|
|
81
|
+
console.log();
|
|
59
82
|
console.log('š VERIFICATION & PAIR PROGRAMMING:');
|
|
60
83
|
console.log(' claude-flow init --verify # Truth Verification System setup');
|
|
61
84
|
console.log(' claude-flow init --pair # Pair Programming mode setup');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/cli/simple-commands/init/help.js"],"sourcesContent":["// help.js - Help text for init command\n\nexport function showInitHelp() {\n console.log('Initialize Claude Code integration files with Claude Flow v2.0.0');\n console.log();\n console.log('Usage: claude-flow init [options]');\n console.log();\n console.log('š DEFAULT BEHAVIOR:');\n console.log(' claude-flow init Initialize with Claude Flow v2.0.0 enhanced features');\n console.log(' Creates CLAUDE.md & .claude/commands for MCP integration');\n console.log();\n console.log('Standard Options:');\n console.log(' --force, -f Overwrite existing files (also updates .gitignore)');\n console.log(' --dry-run, -d Preview what would be created without making changes');\n console.log(' --help, -h Show this help message');\n console.log();\n console.log('Alternative Initialization Modes:');\n console.log(' --basic Use basic initialization (pre-v2.0.0 behavior)');\n console.log(' --sparc, -s Initialize with SPARC development environment');\n console.log(' --minimal, -m Create minimal configuration files');\n console.log(' --modes <list> Initialize only specific SPARC modes (comma-separated)');\n console.log(' --skip-mcp Skip automatic MCP server setup in Claude Code');\n console.log(' --monitoring Enable token usage tracking and telemetry setup');\n console.log();\n console.log('Verification & Pair Programming:');\n console.log(' --verify Initialize with Truth Verification System enabled');\n console.log(' --pair Initialize with Pair Programming mode enabled');\n console.log(' (These options create verification-focused CLAUDE.md)');\n console.log();\n console.log('Advanced Options:');\n console.log(' --enhanced, --safe Enhanced initialization with validation and rollback');\n console.log(' --validate Run validation checks only');\n console.log(' --validate-only Validate without initializing');\n console.log(' --rollback Rollback previous initialization');\n console.log(' --list-backups List available backups and rollback points');\n console.log();\n console.log('Validation & Rollback Options:');\n console.log(' --skip-pre-validation Skip pre-initialization checks');\n console.log(' --skip-backup Skip backup creation');\n console.log(' --rollback --full Perform full system rollback');\n console.log(' --rollback --partial --phase <name> Rollback specific phase');\n console.log(' --validate --skip-pre-init Skip pre-init validation');\n console.log(' --validate --skip-config Skip configuration validation');\n console.log(' --validate --skip-mode-test Skip SPARC mode testing');\n console.log();\n console.log('Examples:');\n console.log('š CLAUDE FLOW v2.0.0 (DEFAULT):');\n console.log(' claude-flow init # ā DEFAULT: Full Claude Flow v2.0.0 setup');\n console.log(' claude-flow init --force # Overwrite existing configuration');\n console.log(' claude-flow init --dry-run # Preview what will be created');\n console.log(' claude-flow init --monitoring # Initialize with token tracking enabled');\n console.log();\n console.log('š STANDARD INITIALIZATION:');\n console.log(' npx claude-flow@latest init --sparc --force # ā RECOMMENDED: Optimized setup');\n console.log(' npx claude-flow@latest init --sparc # Standard SPARC setup');\n console.log(\n ' claude-flow init --sparc --force # Optimized setup (existing project)',\n );\n console.log(' claude-flow init --sparc --modes architect,tdd,code # Selective initialization');\n console.log(' claude-flow init --dry-run --sparc # Preview initialization');\n console.log(' claude-flow init --minimal # Minimal setup');\n console.log();\n console.log('š VERIFICATION & PAIR PROGRAMMING:');\n console.log(' claude-flow init --verify # Truth Verification System setup');\n console.log(' claude-flow init --pair # Pair Programming mode setup');\n console.log(' claude-flow init --verify --pair # Both verification and pairing');\n console.log(' npx claude-flow@alpha init --verify --pair # Complete verification setup');\n console.log();\n console.log('š VALIDATION & ROLLBACK:');\n console.log(' claude-flow init --validate # Validate existing setup');\n console.log(' claude-flow init --rollback --full # Full system rollback');\n console.log(' claude-flow init --rollback --partial --phase sparc-init # Rollback SPARC only');\n console.log(' claude-flow init --list-backups # Show available backups');\n console.log();\n console.log('What gets created:');\n console.log(' ⢠.claude/settings.json - Claude Code configuration with hooks');\n console.log(' ⢠.claude/settings.local.json - Pre-approved MCP permissions (no prompts!)');\n console.log(' ⢠.mcp.json - Project-scoped MCP server configuration');\n console.log(' ⢠claude-flow.config.json - Claude Flow features and performance settings');\n console.log(' ⢠.claude/commands/ directory with 20+ Claude Code slash commands');\n console.log(' ⢠CLAUDE.md with project instructions (v2.0.0 enhanced by default)');\n console.log(' ⢠memory/ directory for persistent context storage');\n console.log(' ⢠coordination/ directory for agent orchestration');\n console.log(' ⢠./claude-flow local executable wrapper');\n console.log(' ⢠.gitignore entries for Claude Flow generated files');\n console.log(' ⢠Automatic MCP server setup if Claude Code CLI is installed');\n console.log(' ⢠Pre-configured for TDD, architecture, and code generation');\n console.log();\n console.log('Claude Code Slash Commands Created:');\n console.log(' ⢠/sparc - Execute SPARC methodology workflows');\n console.log(' ⢠/sparc-<mode> - Run specific SPARC modes (17+ modes)');\n console.log(' ⢠/claude-flow-help - Show all claude-flow commands');\n console.log(' ⢠/claude-flow-memory - Interact with memory system');\n console.log(' ⢠/claude-flow-swarm - Coordinate multi-agent swarms');\n console.log();\n console.log('Available SPARC modes:');\n console.log(' ⢠architect - System design and architecture');\n console.log(' ⢠code - Clean, modular implementation');\n console.log(' ⢠tdd - Test-driven development');\n console.log(' ⢠debug - Advanced debugging and optimization');\n console.log(' ⢠security-review - Security analysis and hardening');\n console.log(' ⢠docs-writer - Documentation creation');\n console.log(' ⢠integration - System integration');\n console.log(' ⢠swarm - Multi-agent coordination');\n console.log(' ⢠spec-pseudocode - Requirements and specifications');\n console.log(' ⢠devops - Deployment and infrastructure');\n console.log(' ⢠And 7+ more specialized modes...');\n console.log();\n console.log('Learn more: https://github.com/ruvnet/claude-code-flow');\n}\n"],"names":["showInitHelp","console","log"],"mappings":"AAEA,OAAO,SAASA;IACdC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG;IACXD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG;IACXD,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;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;IACXD,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;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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QC,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,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG;IACXD,QAAQC,GAAG,CAAC;AACd"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/cli/simple-commands/init/help.js"],"sourcesContent":["// help.js - Help text for init command\n\nexport function showInitHelp() {\n console.log('Initialize Claude Code integration files with Claude Flow v2.0.0');\n console.log();\n console.log('Usage: claude-flow init [options]');\n console.log();\n console.log('š DEFAULT BEHAVIOR:');\n console.log(' claude-flow init Initialize with Claude Flow v2.0.0 enhanced features');\n console.log(' Creates CLAUDE.md & .claude/commands for MCP integration');\n console.log();\n console.log('Standard Options:');\n console.log(' --force, -f Overwrite existing files (also updates .gitignore)');\n console.log(' --dry-run, -d Preview what would be created without making changes');\n console.log(' --help, -h Show this help message');\n console.log();\n console.log('Environment Configuration:');\n console.log(' --env Generate .env template for API keys');\n console.log(' ⢠Required for ReasoningBank memory');\n console.log(' ⢠Includes setup instructions');\n console.log(' ⢠Cost optimization guide');\n console.log();\n console.log('Specialized Agent Setup:');\n console.log(' --agent reasoning Setup ReasoningBank agents with closed-loop learning');\n console.log(' Includes goal-planner and sublinear-goal-planner agents');\n console.log(' ⢠+26% success rate (70% ā 88%)');\n console.log(' ⢠-25% token usage (cost savings)');\n console.log(' ⢠3.2x learning velocity (faster improvement)');\n console.log();\n console.log('Alternative Initialization Modes:');\n console.log(' --basic Use basic initialization (pre-v2.0.0 behavior)');\n console.log(' --sparc, -s Initialize with SPARC development environment');\n console.log(' --minimal, -m Create minimal configuration files');\n console.log(' --modes <list> Initialize only specific SPARC modes (comma-separated)');\n console.log(' --skip-mcp Skip automatic MCP server setup in Claude Code');\n console.log(' --monitoring Enable token usage tracking and telemetry setup');\n console.log();\n console.log('Verification & Pair Programming:');\n console.log(' --verify Initialize with Truth Verification System enabled');\n console.log(' --pair Initialize with Pair Programming mode enabled');\n console.log(' (These options create verification-focused CLAUDE.md)');\n console.log();\n console.log('Advanced Options:');\n console.log(' --enhanced, --safe Enhanced initialization with validation and rollback');\n console.log(' --validate Run validation checks only');\n console.log(' --validate-only Validate without initializing');\n console.log(' --rollback Rollback previous initialization');\n console.log(' --list-backups List available backups and rollback points');\n console.log();\n console.log('Validation & Rollback Options:');\n console.log(' --skip-pre-validation Skip pre-initialization checks');\n console.log(' --skip-backup Skip backup creation');\n console.log(' --rollback --full Perform full system rollback');\n console.log(' --rollback --partial --phase <name> Rollback specific phase');\n console.log(' --validate --skip-pre-init Skip pre-init validation');\n console.log(' --validate --skip-config Skip configuration validation');\n console.log(' --validate --skip-mode-test Skip SPARC mode testing');\n console.log();\n console.log('Examples:');\n console.log('š ENVIRONMENT SETUP:');\n console.log(' claude-flow init --env # Generate .env template');\n console.log(' claude-flow init --env --force # Overwrite existing .env');\n console.log();\n console.log('š CLAUDE FLOW v2.0.0 (DEFAULT):');\n console.log(' claude-flow init # ā DEFAULT: Full Claude Flow v2.0.0 setup');\n console.log(' claude-flow init --force # Overwrite existing configuration');\n console.log(' claude-flow init --dry-run # Preview what will be created');\n console.log(' claude-flow init --monitoring # Initialize with token tracking enabled');\n console.log();\n console.log('š STANDARD INITIALIZATION:');\n console.log(' npx claude-flow@latest init --sparc --force # ā RECOMMENDED: Optimized setup');\n console.log(' npx claude-flow@latest init --sparc # Standard SPARC setup');\n console.log(\n ' claude-flow init --sparc --force # Optimized setup (existing project)',\n );\n console.log(' claude-flow init --sparc --modes architect,tdd,code # Selective initialization');\n console.log(' claude-flow init --dry-run --sparc # Preview initialization');\n console.log(' claude-flow init --minimal # Minimal setup');\n console.log();\n console.log('š§ REASONING AGENTS WITH REASONINGBANK:');\n console.log(' claude-flow init --agent reasoning # Setup ReasoningBank agents');\n console.log(' claude-flow init --agent reasoning --force # Overwrite existing setup');\n console.log(' # Note: Requires .env with API keys for actual learning');\n console.log(' # Use: npx agentic-flow --agent goal-planner --task \"your task\"');\n console.log();\n console.log('š VERIFICATION & PAIR PROGRAMMING:');\n console.log(' claude-flow init --verify # Truth Verification System setup');\n console.log(' claude-flow init --pair # Pair Programming mode setup');\n console.log(' claude-flow init --verify --pair # Both verification and pairing');\n console.log(' npx claude-flow@alpha init --verify --pair # Complete verification setup');\n console.log();\n console.log('š VALIDATION & ROLLBACK:');\n console.log(' claude-flow init --validate # Validate existing setup');\n console.log(' claude-flow init --rollback --full # Full system rollback');\n console.log(' claude-flow init --rollback --partial --phase sparc-init # Rollback SPARC only');\n console.log(' claude-flow init --list-backups # Show available backups');\n console.log();\n console.log('What gets created:');\n console.log(' ⢠.claude/settings.json - Claude Code configuration with hooks');\n console.log(' ⢠.claude/settings.local.json - Pre-approved MCP permissions (no prompts!)');\n console.log(' ⢠.mcp.json - Project-scoped MCP server configuration');\n console.log(' ⢠claude-flow.config.json - Claude Flow features and performance settings');\n console.log(' ⢠.claude/commands/ directory with 20+ Claude Code slash commands');\n console.log(' ⢠CLAUDE.md with project instructions (v2.0.0 enhanced by default)');\n console.log(' ⢠memory/ directory for persistent context storage');\n console.log(' ⢠coordination/ directory for agent orchestration');\n console.log(' ⢠./claude-flow local executable wrapper');\n console.log(' ⢠.gitignore entries for Claude Flow generated files');\n console.log(' ⢠Automatic MCP server setup if Claude Code CLI is installed');\n console.log(' ⢠Pre-configured for TDD, architecture, and code generation');\n console.log();\n console.log('Claude Code Slash Commands Created:');\n console.log(' ⢠/sparc - Execute SPARC methodology workflows');\n console.log(' ⢠/sparc-<mode> - Run specific SPARC modes (17+ modes)');\n console.log(' ⢠/claude-flow-help - Show all claude-flow commands');\n console.log(' ⢠/claude-flow-memory - Interact with memory system');\n console.log(' ⢠/claude-flow-swarm - Coordinate multi-agent swarms');\n console.log();\n console.log('Available SPARC modes:');\n console.log(' ⢠architect - System design and architecture');\n console.log(' ⢠code - Clean, modular implementation');\n console.log(' ⢠tdd - Test-driven development');\n console.log(' ⢠debug - Advanced debugging and optimization');\n console.log(' ⢠security-review - Security analysis and hardening');\n console.log(' ⢠docs-writer - Documentation creation');\n console.log(' ⢠integration - System integration');\n console.log(' ⢠swarm - Multi-agent coordination');\n console.log(' ⢠spec-pseudocode - Requirements and specifications');\n console.log(' ⢠devops - Deployment and infrastructure');\n console.log(' ⢠And 7+ more specialized modes...');\n console.log();\n console.log('Learn more: https://github.com/ruvnet/claude-code-flow');\n}\n"],"names":["showInitHelp","console","log"],"mappings":"AAEA,OAAO,SAASA;IACdC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG;IACXD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG;IACXD,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;IACXD,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;IACXD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZ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AAC;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;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,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;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,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG;IACXD,QAAQC,GAAG,CAAC;AACd"}
|
|
@@ -304,6 +304,25 @@ export async function initCommand(subArgs, flags) {
|
|
|
304
304
|
showInitHelp();
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
+
if (flags.env || subArgs.includes('--env')) {
|
|
308
|
+
const { generateEnvTemplate } = await import('../env-template.js');
|
|
309
|
+
const workingDir = process.env.PWD || process.cwd();
|
|
310
|
+
const force = flags.force || flags.f;
|
|
311
|
+
console.log('š Generating .env template file...\n');
|
|
312
|
+
const result = await generateEnvTemplate(workingDir, force);
|
|
313
|
+
if (result.created) {
|
|
314
|
+
console.log('\nš Next steps:');
|
|
315
|
+
console.log('1. Open .env file and add your API keys');
|
|
316
|
+
console.log('2. Get keys from:');
|
|
317
|
+
console.log(' ⢠Anthropic: https://console.anthropic.com/settings/keys');
|
|
318
|
+
console.log(' ⢠OpenRouter: https://openrouter.ai/keys');
|
|
319
|
+
console.log('3. Enable memory: claude-flow agent run coder "task" --enable-memory\n');
|
|
320
|
+
console.log('š” See docs/REASONINGBANK-COST-OPTIMIZATION.md for cost savings tips');
|
|
321
|
+
} else if (result.exists) {
|
|
322
|
+
console.log('š” To overwrite: claude-flow init --env --force');
|
|
323
|
+
}
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
307
326
|
const hasVerificationFlags = subArgs.includes('--verify') || subArgs.includes('--pair') || flags.verify || flags.pair;
|
|
308
327
|
if (flags['flow-nexus']) {
|
|
309
328
|
return await flowNexusMinimalInit(flags, subArgs);
|
|
@@ -1034,6 +1053,8 @@ async function enhancedClaudeFlowInit(flags, subArgs = []) {
|
|
|
1034
1053
|
const force = flags.force || flags.f;
|
|
1035
1054
|
const dryRun1 = flags.dryRun || flags['dry-run'] || flags.d;
|
|
1036
1055
|
const initSparc = flags.roo || subArgs && subArgs.includes('--roo');
|
|
1056
|
+
const agentType = flags.agent || subArgs && subArgs.find((arg)=>arg.startsWith('--agent='))?.split('=')[1];
|
|
1057
|
+
const initReasoning = agentType === 'reasoning' || subArgs && subArgs.includes('--agent') && subArgs.includes('reasoning');
|
|
1037
1058
|
const args = subArgs || [];
|
|
1038
1059
|
const options = flags || {};
|
|
1039
1060
|
const fs = await import('fs/promises');
|
|
@@ -1377,8 +1398,50 @@ ${commands.map((cmd)=>`- [${cmd}](./${cmd}.md)`).join('\n')}
|
|
|
1377
1398
|
} else {
|
|
1378
1399
|
console.log('ā ļø Agent system setup failed:', agentResult.error);
|
|
1379
1400
|
}
|
|
1401
|
+
if (initReasoning) {
|
|
1402
|
+
console.log('\nš§ Setting up reasoning agents with ReasoningBank integration...');
|
|
1403
|
+
try {
|
|
1404
|
+
const reasoningAgentsDir = `${workingDir}/.claude/agents/reasoning`;
|
|
1405
|
+
await fs.mkdir(reasoningAgentsDir, {
|
|
1406
|
+
recursive: true
|
|
1407
|
+
});
|
|
1408
|
+
const path1 = await import('path');
|
|
1409
|
+
const { fileURLToPath } = await import('url');
|
|
1410
|
+
const { dirname, join } = path1.default;
|
|
1411
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
1412
|
+
const __dirname1 = dirname(__filename);
|
|
1413
|
+
const sourceReasoningDir = join(__dirname1, '../../../../.claude/agents/reasoning');
|
|
1414
|
+
try {
|
|
1415
|
+
const reasoningFiles = await fs.readdir(sourceReasoningDir);
|
|
1416
|
+
let copiedReasoningAgents = 0;
|
|
1417
|
+
for (const file of reasoningFiles){
|
|
1418
|
+
if (file.endsWith('.md')) {
|
|
1419
|
+
const sourcePath = join(sourceReasoningDir, file);
|
|
1420
|
+
const destPath = join(reasoningAgentsDir, file);
|
|
1421
|
+
const content = await fs.readFile(sourcePath, 'utf8');
|
|
1422
|
+
await fs.writeFile(destPath, content);
|
|
1423
|
+
copiedReasoningAgents++;
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
printSuccess(`ā Copied ${copiedReasoningAgents} reasoning agent files`);
|
|
1427
|
+
console.log(' š Reasoning agents available:');
|
|
1428
|
+
console.log(' ⢠goal-planner - Goal-Oriented Action Planning specialist');
|
|
1429
|
+
console.log(' ⢠sublinear-goal-planner - Sub-linear complexity goal planning');
|
|
1430
|
+
console.log(' š” Use: npx agentic-flow --agent goal-planner --task "your task"');
|
|
1431
|
+
console.log(' š Documentation: .claude/agents/reasoning/README.md');
|
|
1432
|
+
} catch (err) {
|
|
1433
|
+
console.log(` ā ļø Could not copy reasoning agents: ${err.message}`);
|
|
1434
|
+
console.log(' Reasoning agents may not be available yet');
|
|
1435
|
+
}
|
|
1436
|
+
} catch (err) {
|
|
1437
|
+
console.log(` ā ļø Reasoning agent setup failed: ${err.message}`);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1380
1440
|
} else {
|
|
1381
1441
|
console.log(' [DRY RUN] Would create agent system with 64 specialized agents');
|
|
1442
|
+
if (initReasoning) {
|
|
1443
|
+
console.log(' [DRY RUN] Would also setup reasoning agents with ReasoningBank integration');
|
|
1444
|
+
}
|
|
1382
1445
|
}
|
|
1383
1446
|
const enableMonitoring = flags.monitoring || flags['enable-monitoring'];
|
|
1384
1447
|
if (enableMonitoring && !dryRun1) {
|