claude-flow-novice 2.14.31 → 2.14.32
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/cfn-data/cfn-loop.db +0 -0
- package/.claude/commands/CFN_LOOP_TASK_MODE.md +1 -1
- package/.claude/skills/cfn-agent-discovery/agents-registry.json +10 -9
- package/.claude/skills/cfn-docker-agent-spawning/SKILL.md +394 -0
- package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +521 -0
- package/.claude/skills/cfn-docker-loop-orchestration/SKILL.md +449 -0
- package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +787 -0
- package/.claude/skills/cfn-docker-redis-coordination/SKILL.md +435 -0
- package/.claude/skills/cfn-docker-redis-coordination/coordinate.sh +635 -0
- package/.claude/skills/cfn-docker-skill-mcp-selection/SKILL.md +289 -0
- package/.claude/skills/cfn-docker-skill-mcp-selection/skill-mcp-selector.js +472 -0
- package/.claude/skills/cfn-loop-validation/config.json +2 -2
- package/README.md +95 -0
- package/claude-assets/agents/README-AGENT_LIFECYCLE.md +10 -37
- package/claude-assets/agents/README-VALIDATION.md +8 -0
- package/claude-assets/agents/cfn-dev-team/README.md +8 -0
- package/claude-assets/agents/cfn-dev-team/coordinators/README.md +9 -1
- package/claude-assets/agents/cfn-dev-team/developers/README.md +9 -1
- package/claude-assets/agents/cfn-dev-team/documentation/README-VALIDATION.md +8 -0
- package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md +10 -0
- package/claude-assets/agents/cfn-dev-team/reviewers/README.md +9 -1
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/quality-metrics.md +10 -0
- package/claude-assets/agents/cfn-dev-team/test-agent.md +10 -0
- package/claude-assets/agents/cfn-dev-team/testers/README.md +9 -1
- package/claude-assets/agents/csuite/cto-agent.md +10 -0
- package/claude-assets/agents/custom/cfn-system-expert.md +128 -1
- package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +5 -1
- package/claude-assets/agents/docker-team/csuite/c-suite-template.md +5 -1
- package/claude-assets/agents/docker-team/infrastructure/team-coordinator-template.md +5 -1
- package/claude-assets/agents/marketing_hybrid/cost_tracker.md +10 -0
- package/claude-assets/agents/marketing_hybrid/docker_deployer.md +10 -0
- package/claude-assets/agents/marketing_hybrid/zai_worker_spawner.md +10 -0
- package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +1 -1
- package/claude-assets/hooks/cfn-post-execution/memory-cleanup.sh +20 -0
- package/claude-assets/hooks/cfn-pre-execution/memory-check.sh +20 -0
- package/claude-assets/skills/cfn-agent-discovery/agents-registry.json +10 -9
- package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +70 -10
- package/claude-assets/skills/cfn-loop-validation/config.json +2 -2
- package/claude-assets/skills/cfn-memory-management/SKILL.md +271 -0
- package/claude-assets/skills/cfn-memory-management/check-memory.sh +160 -0
- package/claude-assets/skills/cfn-memory-management/cleanup-memory.sh +197 -0
- package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +2 -2
- package/dist/cli/agent-command.js +44 -2
- package/dist/cli/agent-command.js.map +1 -1
- package/dist/cli/config-manager.js +91 -109
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/cli/index.js +29 -2
- package/dist/cli/index.js.map +1 -1
- package/package.json +10 -2
- package/scripts/memory-leak-prevention.sh +306 -0
|
@@ -26,6 +26,9 @@ Options:
|
|
|
26
26
|
--mode <mode> Execution mode (cli, api, hybrid)
|
|
27
27
|
--priority <n> Task priority (1-10)
|
|
28
28
|
--parent-task-id <id> Parent task identifier
|
|
29
|
+
--memory-limit <mb> Set memory limit in MB (default: 8192)
|
|
30
|
+
--enable-profiling Enable heap profiling for debugging
|
|
31
|
+
--debug Enable debug mode with profiling
|
|
29
32
|
--list List all available agents
|
|
30
33
|
--help Show this help message
|
|
31
34
|
|
|
@@ -33,15 +36,32 @@ Examples:
|
|
|
33
36
|
# Simple agent spawn
|
|
34
37
|
npx claude-flow-novice agent coder --context "Implement JWT auth"
|
|
35
38
|
|
|
36
|
-
# CFN Loop agent
|
|
39
|
+
# CFN Loop agent with memory limits
|
|
37
40
|
npx claude-flow-novice agent rust-enterprise-developer \\
|
|
38
41
|
--task-id task-123 \\
|
|
39
42
|
--iteration 1 \\
|
|
40
|
-
--mode standard
|
|
43
|
+
--mode standard \\
|
|
44
|
+
--memory-limit 4096
|
|
45
|
+
|
|
46
|
+
# Debug mode with profiling
|
|
47
|
+
npx claude-flow-novice agent tester \\
|
|
48
|
+
--context "Test authentication system" \\
|
|
49
|
+
--debug \\
|
|
50
|
+
--enable-profiling
|
|
41
51
|
|
|
42
52
|
# List available agents
|
|
43
53
|
npx claude-flow-novice agent --list
|
|
44
54
|
|
|
55
|
+
Memory Management:
|
|
56
|
+
Claude automatically applies memory limits to prevent leaks:
|
|
57
|
+
- Default limit: 8GB (reduced from 16GB)
|
|
58
|
+
- Use --memory-limit to set custom limits
|
|
59
|
+
- Use --debug to enable profiling and monitoring
|
|
60
|
+
- Memory profiles saved to /tmp/claude-memory-profiles/
|
|
61
|
+
|
|
62
|
+
For advanced memory management:
|
|
63
|
+
./scripts/memory-leak-prevention.sh --help
|
|
64
|
+
|
|
45
65
|
Available Agents:
|
|
46
66
|
Agents are defined in .claude/agents/ directory:
|
|
47
67
|
- core-agents/ Production-ready core agents
|
|
@@ -101,7 +121,29 @@ Documentation:
|
|
|
101
121
|
return;
|
|
102
122
|
}
|
|
103
123
|
try {
|
|
124
|
+
// Apply memory management options
|
|
125
|
+
if (options.memoryLimit) {
|
|
126
|
+
console.log(`[agent-command] Setting memory limit: ${options.memoryLimit}MB`);
|
|
127
|
+
const currentOptions = process.env.NODE_OPTIONS || '';
|
|
128
|
+
const newOptions = currentOptions.replace(/--max-old-space-size=\d+/, `--max-old-space-size=${options.memoryLimit}`);
|
|
129
|
+
process.env.NODE_OPTIONS = newOptions || `--max-old-space-size=${options.memoryLimit}`;
|
|
130
|
+
}
|
|
131
|
+
if (options.enableProfiling || options.debug) {
|
|
132
|
+
console.log(`[agent-command] Enabling memory profiling`);
|
|
133
|
+
if (!process.env.NODE_OPTIONS.includes('heap-prof')) {
|
|
134
|
+
process.env.NODE_OPTIONS += ' --heap-prof';
|
|
135
|
+
}
|
|
136
|
+
if (!process.env.NODE_OPTIONS.includes('inspect') && options.debug) {
|
|
137
|
+
process.env.NODE_OPTIONS += ' --inspect=0.0.0.0:9229';
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (options.debug) {
|
|
141
|
+
console.log(`[agent-command] Debug mode enabled`);
|
|
142
|
+
process.env.CLAUDE_DEBUG = 'true';
|
|
143
|
+
process.env.CLAUDE_MEMORY_MONITORING = 'true';
|
|
144
|
+
}
|
|
104
145
|
console.log(`[agent-command] Spawning agent: ${agentType}`);
|
|
146
|
+
console.log(`[agent-command] Memory settings: ${process.env.NODE_OPTIONS}`);
|
|
105
147
|
console.log('');
|
|
106
148
|
// Step 1: Parse agent definition
|
|
107
149
|
console.log('[1/3] Parsing agent definition...');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/agent-command.ts"],"sourcesContent":["/**\r\n * Agent Command Handler\r\n *\r\n * Handles `npx claude-flow-novice agent <type> [options]` commands.\r\n * Orchestrates agent definition parsing, prompt building, and execution.\r\n */\r\n\r\nimport { parseAgentDefinition, listAgentDefinitions } from './agent-definition-parser.js';\r\nimport { buildAgentPrompt, TaskContext } from './agent-prompt-builder.js';\r\nimport { executeAgent } from './agent-executor.js';\r\n\r\nexport interface AgentCommandOptions {\r\n taskId?: string;\r\n iteration?: number;\r\n context?: string;\r\n mode?: string;\r\n priority?: number;\r\n parentTaskId?: string;\r\n agentId?: string;\r\n list?: boolean;\r\n help?: boolean;\r\n}\r\n\r\n/**\r\n * Display agent command help\r\n */\r\nexport function displayAgentHelp(): void {\r\n console.log(`\r\nClaude Flow Novice - Agent Spawning\r\n\r\nUsage:\r\n npx claude-flow-novice agent <type> [options]\r\n\r\nArguments:\r\n <type> Agent type (e.g., rust-enterprise-developer, coder, reviewer)\r\n\r\nOptions:\r\n --task-id <id> Task identifier for CFN Loop coordination\r\n --iteration <n> Iteration number (default: 1)\r\n --agent-id <id> Explicit agent ID (overrides auto-generated ID)\r\n --context <text> Task context/description\r\n --mode <mode> Execution mode (cli, api, hybrid)\r\n --priority <n> Task priority (1-10)\r\n --parent-task-id <id> Parent task identifier\r\n --list List all available agents\r\n --help Show this help message\r\n\r\nExamples:\r\n # Simple agent spawn\r\n npx claude-flow-novice agent coder --context \"Implement JWT auth\"\r\n\r\n # CFN Loop agent\r\n npx claude-flow-novice agent rust-enterprise-developer \\\\\r\n --task-id task-123 \\\\\r\n --iteration 1 \\\\\r\n --mode standard\r\n\r\n # List available agents\r\n npx claude-flow-novice agent --list\r\n\r\nAvailable Agents:\r\n Agents are defined in .claude/agents/ directory:\r\n - core-agents/ Production-ready core agents\r\n - specialized/ Domain-specific specialists\r\n - development/ Development-focused agents\r\n - security/ Security-focused agents\r\n - custom/ Your custom agents\r\n\r\nDocumentation:\r\n See .claude/agents/CLAUDE.md for agent creation guide\r\n`);\r\n}\r\n\r\n/**\r\n * List all available agent definitions\r\n */\r\nexport async function listAgents(): Promise<void> {\r\n console.log('Searching for agent definitions...\\n');\r\n\r\n const agents = await listAgentDefinitions();\r\n\r\n if (agents.length === 0) {\r\n console.log('No agent definitions found in .claude/agents/');\r\n console.log('\\nTo create agents, see: .claude/agents/CLAUDE.md');\r\n return;\r\n }\r\n\r\n console.log(`Found ${agents.length} agent(s):\\n`);\r\n\r\n // Group by category\r\n const grouped: Record<string, string[]> = {};\r\n\r\n for (const agent of agents) {\r\n const parts = agent.split('/');\r\n const category = parts.length > 1 ? parts[0] : 'root';\r\n const name = parts.length > 1 ? parts.slice(1).join('/') : parts[0];\r\n\r\n if (!grouped[category]) {\r\n grouped[category] = [];\r\n }\r\n grouped[category].push(name);\r\n }\r\n\r\n // Display grouped agents\r\n for (const [category, names] of Object.entries(grouped).sort()) {\r\n console.log(`${category}/`);\r\n for (const name of names.sort()) {\r\n console.log(` - ${name}`);\r\n }\r\n console.log('');\r\n }\r\n\r\n console.log('Usage:');\r\n console.log(' npx claude-flow-novice agent <name> [options]');\r\n}\r\n\r\n/**\r\n * Execute agent command\r\n */\r\nexport async function agentCommand(\r\n agentType: string | undefined,\r\n options: AgentCommandOptions\r\n): Promise<void> {\r\n // Handle --list flag\r\n if (options.list) {\r\n await listAgents();\r\n return;\r\n }\r\n\r\n // Handle --help flag\r\n if (options.help || !agentType) {\r\n displayAgentHelp();\r\n return;\r\n }\r\n\r\n try {\r\n console.log(`[agent-command] Spawning agent: ${agentType}`);\r\n console.log('');\r\n\r\n // Step 1: Parse agent definition\r\n console.log('[1/3] Parsing agent definition...');\r\n const definition = await parseAgentDefinition(agentType);\r\n console.log(` ✓ Found: ${definition.name}`);\r\n console.log(` ✓ Type: ${definition.type || 'specialist'}`);\r\n console.log(` ✓ Model: ${definition.model}`);\r\n console.log(` ✓ Tools: ${definition.tools.join(', ')}`);\r\n console.log('');\r\n\r\n // Step 2: Build agent prompt\r\n console.log('[2/3] Building agent prompt...');\r\n const taskContext: TaskContext = {\r\n taskId: options.taskId,\r\n iteration: options.iteration,\r\n agentId: options.agentId,\r\n context: options.context,\r\n mode: options.mode,\r\n priority: options.priority,\r\n parentTaskId: options.parentTaskId,\r\n };\r\n\r\n const prompt = await buildAgentPrompt(definition, taskContext);\r\n console.log(` ✓ Prompt size: ${prompt.length} characters`);\r\n console.log(` ✓ CFN Loop protocol: ${prompt.includes('CFN Loop Redis Completion Protocol') ? 'included' : 'not applicable'}`);\r\n console.log(` ✓ Iteration history: ${prompt.includes('## Iteration History') ? 'included' : 'not applicable'}`);\r\n console.log('');\r\n\r\n // Step 3: Execute agent\r\n console.log('[3/3] Executing agent...');\r\n const result = await executeAgent(definition, prompt, taskContext);\r\n\r\n console.log('');\r\n console.log('=== Execution Result ===');\r\n console.log(`Agent ID: ${result.agentId}`);\r\n console.log(`Status: ${result.success ? '✓ Success' : '✗ Failed'}`);\r\n console.log(`Exit Code: ${result.exitCode}`);\r\n\r\n if (result.error) {\r\n console.error(`Error: ${result.error}`);\r\n process.exit(1);\r\n }\r\n\r\n if (result.output) {\r\n console.log('\\nOutput:');\r\n console.log(result.output);\r\n }\r\n\r\n process.exit(result.exitCode);\r\n } catch (error) {\r\n console.error('\\n[agent-command] Error:', error instanceof Error ? error.message : String(error));\r\n process.exit(1);\r\n }\r\n}\r\n"],"names":["parseAgentDefinition","listAgentDefinitions","buildAgentPrompt","executeAgent","displayAgentHelp","console","log","listAgents","agents","length","grouped","agent","parts","split","category","name","slice","join","push","names","Object","entries","sort","agentCommand","agentType","options","list","help","definition","type","model","tools","taskContext","taskId","iteration","agentId","context","mode","priority","parentTaskId","prompt","includes","result","success","exitCode","error","process","exit","output","Error","message","String"],"mappings":"AAAA;;;;;CAKC,GAED,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,+BAA+B;AAC1F,SAASC,gBAAgB,QAAqB,4BAA4B;AAC1E,SAASC,YAAY,QAAQ,sBAAsB;AAcnD;;CAEC,GACD,OAAO,SAASC;IACdC,QAAQC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2Cf,CAAC;AACD;AAEA;;CAEC,GACD,OAAO,eAAeC;IACpBF,QAAQC,GAAG,CAAC;IAEZ,MAAME,SAAS,MAAMP;IAErB,IAAIO,OAAOC,MAAM,KAAK,GAAG;QACvBJ,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC;QACZ;IACF;IAEAD,QAAQC,GAAG,CAAC,CAAC,MAAM,EAAEE,OAAOC,MAAM,CAAC,YAAY,CAAC;IAEhD,oBAAoB;IACpB,MAAMC,UAAoC,CAAC;IAE3C,KAAK,MAAMC,SAASH,OAAQ;QAC1B,MAAMI,QAAQD,MAAME,KAAK,CAAC;QAC1B,MAAMC,WAAWF,MAAMH,MAAM,GAAG,IAAIG,KAAK,CAAC,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;YACjB3C,QAAQC,GAAG,CAAC;YACZD,QAAQC,GAAG,CAACoC,OAAOM,MAAM;QAC3B;QAEAF,QAAQC,IAAI,CAACL,OAAOE,QAAQ;IAC9B,EAAE,OAAOC,OAAO;QACdxC,QAAQwC,KAAK,CAAC,4BAA4BA,iBAAiBI,QAAQJ,MAAMK,OAAO,GAAGC,OAAON;QAC1FC,QAAQC,IAAI,CAAC;IACf;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/agent-command.ts"],"sourcesContent":["/**\r\n * Agent Command Handler\r\n *\r\n * Handles `npx claude-flow-novice agent <type> [options]` commands.\r\n * Orchestrates agent definition parsing, prompt building, and execution.\r\n */\r\n\r\nimport { parseAgentDefinition, listAgentDefinitions } from './agent-definition-parser.js';\r\nimport { buildAgentPrompt, TaskContext } from './agent-prompt-builder.js';\r\nimport { executeAgent } from './agent-executor.js';\r\n\r\nexport interface AgentCommandOptions {\r\n taskId?: string;\r\n iteration?: number;\r\n context?: string;\r\n mode?: string;\r\n priority?: number;\r\n parentTaskId?: string;\r\n agentId?: string;\r\n list?: boolean;\r\n help?: boolean;\r\n memoryLimit?: number;\r\n enableProfiling?: boolean;\r\n debug?: boolean;\r\n}\r\n\r\n/**\r\n * Display agent command help\r\n */\r\nexport function displayAgentHelp(): void {\r\n console.log(`\r\nClaude Flow Novice - Agent Spawning\r\n\r\nUsage:\r\n npx claude-flow-novice agent <type> [options]\r\n\r\nArguments:\r\n <type> Agent type (e.g., rust-enterprise-developer, coder, reviewer)\r\n\r\nOptions:\r\n --task-id <id> Task identifier for CFN Loop coordination\r\n --iteration <n> Iteration number (default: 1)\r\n --agent-id <id> Explicit agent ID (overrides auto-generated ID)\r\n --context <text> Task context/description\r\n --mode <mode> Execution mode (cli, api, hybrid)\r\n --priority <n> Task priority (1-10)\r\n --parent-task-id <id> Parent task identifier\r\n --memory-limit <mb> Set memory limit in MB (default: 8192)\r\n --enable-profiling Enable heap profiling for debugging\r\n --debug Enable debug mode with profiling\r\n --list List all available agents\r\n --help Show this help message\r\n\r\nExamples:\r\n # Simple agent spawn\r\n npx claude-flow-novice agent coder --context \"Implement JWT auth\"\r\n\r\n # CFN Loop agent with memory limits\r\n npx claude-flow-novice agent rust-enterprise-developer \\\\\r\n --task-id task-123 \\\\\r\n --iteration 1 \\\\\r\n --mode standard \\\\\r\n --memory-limit 4096\r\n\r\n # Debug mode with profiling\r\n npx claude-flow-novice agent tester \\\\\r\n --context \"Test authentication system\" \\\\\r\n --debug \\\\\r\n --enable-profiling\r\n\r\n # List available agents\r\n npx claude-flow-novice agent --list\r\n\r\nMemory Management:\r\n Claude automatically applies memory limits to prevent leaks:\r\n - Default limit: 8GB (reduced from 16GB)\r\n - Use --memory-limit to set custom limits\r\n - Use --debug to enable profiling and monitoring\r\n - Memory profiles saved to /tmp/claude-memory-profiles/\r\n\r\n For advanced memory management:\r\n ./scripts/memory-leak-prevention.sh --help\r\n\r\nAvailable Agents:\r\n Agents are defined in .claude/agents/ directory:\r\n - core-agents/ Production-ready core agents\r\n - specialized/ Domain-specific specialists\r\n - development/ Development-focused agents\r\n - security/ Security-focused agents\r\n - custom/ Your custom agents\r\n\r\nDocumentation:\r\n See .claude/agents/CLAUDE.md for agent creation guide\r\n`);\r\n}\r\n\r\n/**\r\n * List all available agent definitions\r\n */\r\nexport async function listAgents(): Promise<void> {\r\n console.log('Searching for agent definitions...\\n');\r\n\r\n const agents = await listAgentDefinitions();\r\n\r\n if (agents.length === 0) {\r\n console.log('No agent definitions found in .claude/agents/');\r\n console.log('\\nTo create agents, see: .claude/agents/CLAUDE.md');\r\n return;\r\n }\r\n\r\n console.log(`Found ${agents.length} agent(s):\\n`);\r\n\r\n // Group by category\r\n const grouped: Record<string, string[]> = {};\r\n\r\n for (const agent of agents) {\r\n const parts = agent.split('/');\r\n const category = parts.length > 1 ? parts[0] : 'root';\r\n const name = parts.length > 1 ? parts.slice(1).join('/') : parts[0];\r\n\r\n if (!grouped[category]) {\r\n grouped[category] = [];\r\n }\r\n grouped[category].push(name);\r\n }\r\n\r\n // Display grouped agents\r\n for (const [category, names] of Object.entries(grouped).sort()) {\r\n console.log(`${category}/`);\r\n for (const name of names.sort()) {\r\n console.log(` - ${name}`);\r\n }\r\n console.log('');\r\n }\r\n\r\n console.log('Usage:');\r\n console.log(' npx claude-flow-novice agent <name> [options]');\r\n}\r\n\r\n/**\r\n * Execute agent command\r\n */\r\nexport async function agentCommand(\r\n agentType: string | undefined,\r\n options: AgentCommandOptions\r\n): Promise<void> {\r\n // Handle --list flag\r\n if (options.list) {\r\n await listAgents();\r\n return;\r\n }\r\n\r\n // Handle --help flag\r\n if (options.help || !agentType) {\r\n displayAgentHelp();\r\n return;\r\n }\r\n\r\n try {\r\n // Apply memory management options\r\n if (options.memoryLimit) {\r\n console.log(`[agent-command] Setting memory limit: ${options.memoryLimit}MB`);\r\n const currentOptions = process.env.NODE_OPTIONS || '';\r\n const newOptions = currentOptions.replace(/--max-old-space-size=\\d+/, `--max-old-space-size=${options.memoryLimit}`);\r\n process.env.NODE_OPTIONS = newOptions || `--max-old-space-size=${options.memoryLimit}`;\r\n }\r\n\r\n if (options.enableProfiling || options.debug) {\r\n console.log(`[agent-command] Enabling memory profiling`);\r\n if (!process.env.NODE_OPTIONS.includes('heap-prof')) {\r\n process.env.NODE_OPTIONS += ' --heap-prof';\r\n }\r\n if (!process.env.NODE_OPTIONS.includes('inspect') && options.debug) {\r\n process.env.NODE_OPTIONS += ' --inspect=0.0.0.0:9229';\r\n }\r\n }\r\n\r\n if (options.debug) {\r\n console.log(`[agent-command] Debug mode enabled`);\r\n process.env.CLAUDE_DEBUG = 'true';\r\n process.env.CLAUDE_MEMORY_MONITORING = 'true';\r\n }\r\n\r\n console.log(`[agent-command] Spawning agent: ${agentType}`);\r\n console.log(`[agent-command] Memory settings: ${process.env.NODE_OPTIONS}`);\r\n console.log('');\r\n\r\n // Step 1: Parse agent definition\r\n console.log('[1/3] Parsing agent definition...');\r\n const definition = await parseAgentDefinition(agentType);\r\n console.log(` ✓ Found: ${definition.name}`);\r\n console.log(` ✓ Type: ${definition.type || 'specialist'}`);\r\n console.log(` ✓ Model: ${definition.model}`);\r\n console.log(` ✓ Tools: ${definition.tools.join(', ')}`);\r\n console.log('');\r\n\r\n // Step 2: Build agent prompt\r\n console.log('[2/3] Building agent prompt...');\r\n const taskContext: TaskContext = {\r\n taskId: options.taskId,\r\n iteration: options.iteration,\r\n agentId: options.agentId,\r\n context: options.context,\r\n mode: options.mode,\r\n priority: options.priority,\r\n parentTaskId: options.parentTaskId,\r\n };\r\n\r\n const prompt = await buildAgentPrompt(definition, taskContext);\r\n console.log(` ✓ Prompt size: ${prompt.length} characters`);\r\n console.log(` ✓ CFN Loop protocol: ${prompt.includes('CFN Loop Redis Completion Protocol') ? 'included' : 'not applicable'}`);\r\n console.log(` ✓ Iteration history: ${prompt.includes('## Iteration History') ? 'included' : 'not applicable'}`);\r\n console.log('');\r\n\r\n // Step 3: Execute agent\r\n console.log('[3/3] Executing agent...');\r\n const result = await executeAgent(definition, prompt, taskContext);\r\n\r\n console.log('');\r\n console.log('=== Execution Result ===');\r\n console.log(`Agent ID: ${result.agentId}`);\r\n console.log(`Status: ${result.success ? '✓ Success' : '✗ Failed'}`);\r\n console.log(`Exit Code: ${result.exitCode}`);\r\n\r\n if (result.error) {\r\n console.error(`Error: ${result.error}`);\r\n process.exit(1);\r\n }\r\n\r\n if (result.output) {\r\n console.log('\\nOutput:');\r\n console.log(result.output);\r\n }\r\n\r\n process.exit(result.exitCode);\r\n } catch (error) {\r\n console.error('\\n[agent-command] Error:', error instanceof Error ? error.message : String(error));\r\n process.exit(1);\r\n }\r\n}\r\n"],"names":["parseAgentDefinition","listAgentDefinitions","buildAgentPrompt","executeAgent","displayAgentHelp","console","log","listAgents","agents","length","grouped","agent","parts","split","category","name","slice","join","push","names","Object","entries","sort","agentCommand","agentType","options","list","help","memoryLimit","currentOptions","process","env","NODE_OPTIONS","newOptions","replace","enableProfiling","debug","includes","CLAUDE_DEBUG","CLAUDE_MEMORY_MONITORING","definition","type","model","tools","taskContext","taskId","iteration","agentId","context","mode","priority","parentTaskId","prompt","result","success","exitCode","error","exit","output","Error","message","String"],"mappings":"AAAA;;;;;CAKC,GAED,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,+BAA+B;AAC1F,SAASC,gBAAgB,QAAqB,4BAA4B;AAC1E,SAASC,YAAY,QAAQ,sBAAsB;AAiBnD;;CAEC,GACD,OAAO,SAASC;IACdC,QAAQC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Df,CAAC;AACD;AAEA;;CAEC,GACD,OAAO,eAAeC;IACpBF,QAAQC,GAAG,CAAC;IAEZ,MAAME,SAAS,MAAMP;IAErB,IAAIO,OAAOC,MAAM,KAAK,GAAG;QACvBJ,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC;QACZ;IACF;IAEAD,QAAQC,GAAG,CAAC,CAAC,MAAM,EAAEE,OAAOC,MAAM,CAAC,YAAY,CAAC;IAEhD,oBAAoB;IACpB,MAAMC,UAAoC,CAAC;IAE3C,KAAK,MAAMC,SAASH,OAAQ;QAC1B,MAAMI,QAAQD,MAAME,KAAK,CAAC;QAC1B,MAAMC,WAAWF,MAAMH,MAAM,GAAG,IAAIG,KAAK,CAAC,EAAE,GAAG;QAC/C,MAAMG,OAAOH,MAAMH,MAAM,GAAG,IAAIG,MAAMI,KAAK,CAAC,GAAGC,IAAI,CAAC,OAAOL,KAAK,CAAC,EAAE;QAEnE,IAAI,CAACF,OAAO,CAACI,SAAS,EAAE;YACtBJ,OAAO,CAACI,SAAS,GAAG,EAAE;QACxB;QACAJ,OAAO,CAACI,SAAS,CAACI,IAAI,CAACH;IACzB;IAEA,yBAAyB;IACzB,KAAK,MAAM,CAACD,UAAUK,MAAM,IAAIC,OAAOC,OAAO,CAACX,SAASY,IAAI,GAAI;QAC9DjB,QAAQC,GA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C,CAAC,uBAAuB,EAAE8C,OAAOf,QAAQ,CAAC,0BAA0B,aAAa,kBAAkB;QAC/GhC,QAAQC,GAAG,CAAC;QAEZ,wBAAwB;QACxBD,QAAQC,GAAG,CAAC;QACZ,MAAM+C,SAAS,MAAMlD,aAAaqC,YAAYY,QAAQR;QAEtDvC,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC,CAAC,UAAU,EAAE+C,OAAON,OAAO,EAAE;QACzC1C,QAAQC,GAAG,CAAC,CAAC,QAAQ,EAAE+C,OAAOC,OAAO,GAAG,cAAc,YAAY;QAClEjD,QAAQC,GAAG,CAAC,CAAC,WAAW,EAAE+C,OAAOE,QAAQ,EAAE;QAE3C,IAAIF,OAAOG,KAAK,EAAE;YAChBnD,QAAQmD,KAAK,CAAC,CAAC,OAAO,EAAEH,OAAOG,KAAK,EAAE;YACtC1B,QAAQ2B,IAAI,CAAC;QACf;QAEA,IAAIJ,OAAOK,MAAM,EAAE;YACjBrD,QAAQC,GAAG,CAAC;YACZD,QAAQC,GAAG,CAAC+C,OAAOK,MAAM;QAC3B;QAEA5B,QAAQ2B,IAAI,CAACJ,OAAOE,QAAQ;IAC9B,EAAE,OAAOC,OAAO;QACdnD,QAAQmD,KAAK,CAAC,4BAA4BA,iBAAiBG,QAAQH,MAAMI,OAAO,GAAGC,OAAOL;QAC1F1B,QAAQ2B,IAAI,CAAC;IACf;AACF"}
|
|
@@ -1,118 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as fs from "fs/promises";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import Ajv from "ajv";
|
|
4
|
+
import * as lodash from "lodash";
|
|
5
|
+
let ConfigManager = class ConfigManager {
|
|
6
|
+
static _instance = null;
|
|
7
|
+
configPath;
|
|
8
|
+
schemaPath;
|
|
9
|
+
ajv;
|
|
10
|
+
constructor(){
|
|
11
|
+
this.configPath = path.join(process.env.HOME || "", ".claude-flow-config.json");
|
|
12
|
+
this.schemaPath = path.join(__dirname, "../../.claude/skills/config-management/config.json");
|
|
13
|
+
this.ajv = new Ajv();
|
|
7
14
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
step(generator.next(value));
|
|
12
|
-
} catch (e) {
|
|
13
|
-
reject(e);
|
|
14
|
-
}
|
|
15
|
+
static getInstance() {
|
|
16
|
+
if (!ConfigManager._instance) {
|
|
17
|
+
ConfigManager._instance = new ConfigManager();
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
return ConfigManager._instance;
|
|
20
|
+
}
|
|
21
|
+
async readConfig() {
|
|
22
|
+
try {
|
|
23
|
+
const configContent = await fs.readFile(this.configPath, "utf-8");
|
|
24
|
+
return JSON.parse(configContent);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
// If config doesn't exist, create from schema
|
|
27
|
+
return this.resetToDefaults();
|
|
22
28
|
}
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
}
|
|
30
|
+
async writeConfig(config) {
|
|
31
|
+
const schemaContent = await fs.readFile(this.schemaPath, "utf-8");
|
|
32
|
+
const schema = JSON.parse(schemaContent);
|
|
33
|
+
const validate = this.ajv.compile(schema);
|
|
34
|
+
if (!validate(config)) {
|
|
35
|
+
throw new Error("Invalid configuration: " + this.ajv.errorsText(validate.errors));
|
|
25
36
|
}
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
var __generator = this && this.__generator || function(thisArg, body) {
|
|
30
|
-
var _ = {
|
|
31
|
-
label: 0,
|
|
32
|
-
sent: function() {
|
|
33
|
-
if (t[0] & 1) throw t[1];
|
|
34
|
-
return t[1];
|
|
35
|
-
},
|
|
36
|
-
trys: [],
|
|
37
|
-
ops: []
|
|
38
|
-
}, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
39
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
40
|
-
return this;
|
|
41
|
-
}), g;
|
|
42
|
-
function verb(n) {
|
|
43
|
-
return function(v) {
|
|
44
|
-
return step([
|
|
45
|
-
n,
|
|
46
|
-
v
|
|
47
|
-
]);
|
|
48
|
-
};
|
|
37
|
+
await fs.writeFile(this.configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
49
38
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
];
|
|
58
|
-
switch(op[0]){
|
|
59
|
-
case 0:
|
|
60
|
-
case 1:
|
|
61
|
-
t = op;
|
|
62
|
-
break;
|
|
63
|
-
case 4:
|
|
64
|
-
_.label++;
|
|
65
|
-
return {
|
|
66
|
-
value: op[1],
|
|
67
|
-
done: false
|
|
68
|
-
};
|
|
69
|
-
case 5:
|
|
70
|
-
_.label++;
|
|
71
|
-
y = op[1];
|
|
72
|
-
op = [
|
|
73
|
-
0
|
|
74
|
-
];
|
|
75
|
-
continue;
|
|
76
|
-
case 7:
|
|
77
|
-
op = _.ops.pop();
|
|
78
|
-
_.trys.pop();
|
|
79
|
-
continue;
|
|
80
|
-
default:
|
|
81
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
82
|
-
_ = 0;
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
86
|
-
_.label = op[1];
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
90
|
-
_.label = t[1];
|
|
91
|
-
t = op;
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
if (t && _.label < t[2]) {
|
|
95
|
-
_.label = t[2];
|
|
96
|
-
_.ops.push(op);
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
if (t[2]) _.ops.pop();
|
|
100
|
-
_.trys.pop();
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
op = body.call(thisArg, _);
|
|
104
|
-
} catch (e) {
|
|
105
|
-
op = [
|
|
106
|
-
6,
|
|
107
|
-
e
|
|
108
|
-
];
|
|
109
|
-
y = 0;
|
|
110
|
-
} finally{
|
|
111
|
-
f = t = 0;
|
|
39
|
+
async getValue(keyPath) {
|
|
40
|
+
const config = await this.readConfig();
|
|
41
|
+
const value = lodash.get(config, keyPath);
|
|
42
|
+
if (value === undefined) {
|
|
43
|
+
// Check if it's a custom key path not in the schema
|
|
44
|
+
const customConfig = await this.readCustomConfig();
|
|
45
|
+
return lodash.get(customConfig, keyPath);
|
|
112
46
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
async readCustomConfig() {
|
|
50
|
+
try {
|
|
51
|
+
const customConfigPath = path.join(process.env.HOME || "", ".claude-flow-custom-config.json");
|
|
52
|
+
const customConfigContent = await fs.readFile(customConfigPath, "utf-8");
|
|
53
|
+
return JSON.parse(customConfigContent);
|
|
54
|
+
} catch (error) {
|
|
55
|
+
// If custom config doesn't exist or can't be read, return empty object
|
|
56
|
+
return {};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async set(key, value) {
|
|
60
|
+
const config = await this.readConfig();
|
|
61
|
+
// Type assertion to handle full object
|
|
62
|
+
if (typeof value === "object" && value !== null) {
|
|
63
|
+
config[key] = value;
|
|
64
|
+
} else {
|
|
65
|
+
throw new Error("Invalid configuration value");
|
|
66
|
+
}
|
|
67
|
+
await this.writeConfig(config);
|
|
68
|
+
}
|
|
69
|
+
async getAll() {
|
|
70
|
+
return this.readConfig();
|
|
71
|
+
}
|
|
72
|
+
async resetToDefaults() {
|
|
73
|
+
const schemaContent = await fs.readFile(this.schemaPath, "utf-8");
|
|
74
|
+
const schema = JSON.parse(schemaContent);
|
|
75
|
+
// Extract default values from the schema
|
|
76
|
+
const defaultConfig = {
|
|
77
|
+
redis: {
|
|
78
|
+
host: schema.properties.redis.properties.host.default,
|
|
79
|
+
port: schema.properties.redis.properties.port.default
|
|
80
|
+
},
|
|
81
|
+
agent: {
|
|
82
|
+
default_strategy: schema.properties.agent.properties.default_strategy.default,
|
|
83
|
+
max_concurrent_agents: schema.properties.agent.properties.max_concurrent_agents.default,
|
|
84
|
+
log_level: schema.properties.agent.properties.log_level.default
|
|
85
|
+
},
|
|
86
|
+
security: {
|
|
87
|
+
enabled: schema.properties.security.properties.enabled.default,
|
|
88
|
+
max_retry_attempts: schema.properties.security.properties.max_retry_attempts.default
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
await this.writeConfig(defaultConfig);
|
|
92
|
+
return defaultConfig;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
export default ConfigManager;
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=config-manager.js.mapop[1] : void 0,
|
|
116
98
|
done: true
|
|
117
99
|
};
|
|
118
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/config-manager.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fs = require(\"fs/promises\");\nvar path = require(\"path\");\nvar ajv_1 = require(\"ajv\");\nvar get_1 = require(\"lodash/get\");\nvar ConfigManager = /** @class */ (function () {\n function ConfigManager() {\n this.configPath = path.join(process.env.HOME || \"\", \".claude-flow-config.json\");\n this.schemaPath = path.join(__dirname, \"../../.claude/skills/config-management/config.json\");\n this.ajv = new ajv_1.default();\n }\n ConfigManager.getInstance = function () {\n if (!ConfigManager.instance) {\n ConfigManager.instance = new ConfigManager();\n }\n return ConfigManager.instance;\n };\n ConfigManager.prototype.readConfig = function () {\n return __awaiter(this, void 0, void 0, function () {\n var configContent, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, fs.readFile(this.configPath, \"utf-8\")];\n case 1:\n configContent = _a.sent();\n return [2 /*return*/, JSON.parse(configContent)];\n case 2:\n error_1 = _a.sent();\n // If config doesn't exist, create from schema\n return [2 /*return*/, this.resetToDefaults()];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.writeConfig = function (config) {\n return __awaiter(this, void 0, void 0, function () {\n var schemaContent, schema, validate;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fs.readFile(this.schemaPath, \"utf-8\")];\n case 1:\n schemaContent = _a.sent();\n schema = JSON.parse(schemaContent);\n validate = this.ajv.compile(schema);\n if (!validate(config)) {\n throw new Error(\"Invalid configuration: \" + this.ajv.errorsText(validate.errors));\n }\n return [4 /*yield*/, fs.writeFile(this.configPath, JSON.stringify(config, null, 2), \"utf-8\")];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.getValue = function (keyPath) {\n return __awaiter(this, void 0, void 0, function () {\n var config, value, customConfig;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.readConfig()];\n case 1:\n config = _a.sent();\n value = (0, get_1.default)(config, keyPath);\n if (!(value === undefined)) return [3 /*break*/, 3];\n return [4 /*yield*/, this.readCustomConfig()];\n case 2:\n customConfig = _a.sent();\n return [2 /*return*/, (0, get_1.default)(customConfig, keyPath)];\n case 3: return [2 /*return*/, value];\n }\n });\n });\n };\n ConfigManager.prototype.readCustomConfig = function () {\n return __awaiter(this, void 0, void 0, function () {\n var customConfigPath, customConfigContent, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n customConfigPath = path.join(process.env.HOME || \"\", \".claude-flow-custom-config.json\");\n return [4 /*yield*/, fs.readFile(customConfigPath, \"utf-8\")];\n case 1:\n customConfigContent = _a.sent();\n return [2 /*return*/, JSON.parse(customConfigContent)];\n case 2:\n error_2 = _a.sent();\n // If custom config doesn't exist or can't be read, return empty object\n return [2 /*return*/, {}];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.set = function (key, value) {\n return __awaiter(this, void 0, void 0, function () {\n var config;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.readConfig()];\n case 1:\n config = _a.sent();\n // Type assertion to handle both full object and nested key\n if (typeof value === \"object\" && value !== null) {\n config[key] = value;\n }\n else {\n throw new Error(\"Invalid configuration value\");\n }\n return [4 /*yield*/, this.writeConfig(config)];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.getAll = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.readConfig()];\n });\n });\n };\n ConfigManager.prototype.resetToDefaults = function () {\n return __awaiter(this, void 0, void 0, function () {\n var schemaContent, schema, defaultConfig;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fs.readFile(this.schemaPath, \"utf-8\")];\n case 1:\n schemaContent = _a.sent();\n schema = JSON.parse(schemaContent);\n defaultConfig = {\n redis: {\n host: schema.properties.redis.properties.host.default,\n port: schema.properties.redis.properties.port.default,\n },\n agent: {\n default_strategy: schema.properties.agent.properties.default_strategy.default,\n max_concurrent_agents: schema.properties.agent.properties.max_concurrent_agents.default,\n log_level: schema.properties.agent.properties.log_level.default,\n },\n security: {\n enabled: schema.properties.security.properties.enabled.default,\n max_retry_attempts: schema.properties.security.properties.max_retry_attempts.default,\n },\n };\n return [4 /*yield*/, this.writeConfig(defaultConfig)];\n case 2:\n _a.sent();\n return [2 /*return*/, defaultConfig];\n }\n });\n });\n };\n return ConfigManager;\n}());\nexports.default = ConfigManager;\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","Object","create","Iterator","prototype","verb","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","defineProperty","exports","fs","require","path","ajv_1","get_1","ConfigManager","configPath","join","process","env","HOME","schemaPath","__dirname","ajv","default","getInstance","instance","readConfig","configContent","error_1","_a","readFile","JSON","parse","resetToDefaults","writeConfig","config","schemaContent","schema","validate","compile","Error","errorsText","errors","writeFile","stringify","getValue","keyPath","customConfig","undefined","readCustomConfig","customConfigPath","customConfigContent","error_2","set","key","getAll","defaultConfig","redis","host","properties","port","agent","default_strategy","max_concurrent_agents","log_level","security","enabled","max_retry_attempts"],"mappings":"AAAA;AACA,IAAIA,YAAY,AAAC,IAAI,IAAI,IAAI,CAACA,SAAS,IAAK,SAAUC,OAAO,EAAEC,UAAU,EAAEC,CAAC,EAAEC,SAAS;IACnF,SAASC,MAAMC,KAAK;QAAI,OAAOA,iBAAiBH,IAAIG,QAAQ,IAAIH,EAAE,SAAUI,OAAO;YAAIA,QAAQD;QAAQ;IAAI;IAC3G,OAAO,IAAKH,CAAAA,KAAMA,CAAAA,IAAIK,OAAM,CAAC,EAAG,SAAUD,OAAO,EAAEE,MAAM;QACrD,SAASC,UAAUJ,KAAK;YAAI,IAAI;gBAAEK,KAAKP,UAAUQ,IAAI,CAACN;YAAS,EAAE,OAAOO,GAAG;gBAAEJ,OAAOI;YAAI;QAAE;QAC1F,SAASC,SAASR,KAAK;YAAI,IAAI;gBAAEK,KAAKP,SAAS,CAAC,QAAQ,CAACE;YAAS,EAAE,OAAOO,GAAG;gBAAEJ,OAAOI;YAAI;QAAE;QAC7F,SAASF,KAAKI,MAAM;YAAIA,OAAOC,IAAI,GAAGT,QAAQQ,OAAOT,KAAK,IAAID,MAAMU,OAAOT,KAAK,EA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;gCACNC,SAAS7B,OAAOsB,UAAU,CAACM,QAAQ,CAACN,UAAU,CAACO,OAAO,CAAC3C,OAAO;gCAC9D4C,oBAAoB9B,OAAOsB,UAAU,CAACM,QAAQ,CAACN,UAAU,CAACQ,kBAAkB,CAAC5C,OAAO;4BACxF;wBACJ;wBACA,OAAO;4BAAC,EAAE,OAAO;4BAAI,IAAI,CAACW,WAAW,CAACsB;yBAAe;oBACzD,KAAK;wBACD3B,GAAG5C,IAAI;wBACP,OAAO;4BAAC,EAAE,QAAQ;4BAAIuE;yBAAc;gBAC5C;YACJ;QACJ;IACJ;IACA,OAAO1C;AACX;AACAN,QAAQe,OAAO,GAAGT"}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/config-manager.ts"],"sourcesContent":["import * as fs from \"fs/promises\";\nimport * as path from \"path\";\nimport Ajv from \"ajv\";\nimport * as lodash from \"lodash\";\n\ninterface ConfigSchema {\n redis: {\n host: string;\n port: number;\n password?: string;\n };\n agent: {\n default_strategy: string;\n max_concurrent_agents: number;\n log_level: \"debug\" | \"info\" | \"warn\" | \"error\";\n };\n security: {\n enabled: boolean;\n max_retry_attempts: number;\n };\n}\n\nclass ConfigManager {\n private static _instance: ConfigManager | null = null;\n private configPath: string;\n private schemaPath: string;\n private ajv: Ajv;\n\n private constructor() {\n this.configPath = path.join(\n process.env.HOME || \"\",\n \".claude-flow-config.json\",\n );\n this.schemaPath = path.join(\n __dirname,\n \"../../.claude/skills/config-management/config.json\",\n );\n this.ajv = new Ajv();\n }\n\n public static getInstance(): ConfigManager {\n if (!ConfigManager._instance) {\n ConfigManager._instance = new ConfigManager();\n }\n return ConfigManager._instance;\n }\n\n private async readConfig(): Promise<ConfigSchema> {\n try {\n const configContent = await fs.readFile(this.configPath, \"utf-8\");\n return JSON.parse(configContent) as ConfigSchema;\n } catch (error) {\n // If config doesn't exist, create from schema\n return this.resetToDefaults();\n }\n }\n\n private async writeConfig(config: ConfigSchema): Promise<void> {\n const schemaContent = await fs.readFile(this.schemaPath, \"utf-8\");\n const schema = JSON.parse(schemaContent);\n\n const validate = this.ajv.compile(schema);\n if (!validate(config)) {\n throw new Error(\n \"Invalid configuration: \" + this.ajv.errorsText(validate.errors),\n );\n }\n\n await fs.writeFile(\n this.configPath,\n JSON.stringify(config, null, 2),\n \"utf-8\",\n );\n }\n\n public async getValue(keyPath: string): Promise<any> {\n const config = await this.readConfig();\n const value = lodash.get(config, keyPath);\n\n if (value === undefined) {\n // Check if it's a custom key path not in the schema\n const customConfig = await this.readCustomConfig();\n return lodash.get(customConfig, keyPath);\n }\n\n return value;\n }\n\n private async readCustomConfig(): Promise<Record<string, any>> {\n try {\n const customConfigPath = path.join(\n process.env.HOME || \"\",\n \".claude-flow-custom-config.json\",\n );\n const customConfigContent = await fs.readFile(customConfigPath, \"utf-8\");\n return JSON.parse(customConfigContent);\n } catch (error) {\n // If custom config doesn't exist or can't be read, return empty object\n return {};\n }\n }\n\n public async set(key: keyof ConfigSchema, value: ConfigSchema[keyof ConfigSchema]): Promise<void> {\n const config = await this.readConfig();\n\n // Type assertion to handle full object\n if (typeof value === \"object\" && value !== null) {\n config[key] = value;\n } else {\n throw new Error(\"Invalid configuration value\");\n }\n\n await this.writeConfig(config);\n }\n\n public async getAll(): Promise<ConfigSchema> {\n return this.readConfig();\n }\n\n public async resetToDefaults(): Promise<ConfigSchema> {\n const schemaContent = await fs.readFile(this.schemaPath, \"utf-8\");\n const schema = JSON.parse(schemaContent);\n\n // Extract default values from the schema\n const defaultConfig: ConfigSchema = {\n redis: {\n host: schema.properties.redis.properties.host.default,\n port: schema.properties.redis.properties.port.default,\n },\n agent: {\n default_strategy:\n schema.properties.agent.properties.default_strategy.default,\n max_concurrent_agents:\n schema.properties.agent.properties.max_concurrent_agents.default,\n log_level: schema.properties.agent.properties.log_level.default,\n },\n security: {\n enabled: schema.properties.security.properties.enabled.default,\n max_retry_attempts:\n schema.properties.security.properties.max_retry_attempts.default,\n },\n };\n\n await this.writeConfig(defaultConfig);\n return defaultConfig;\n }\n}\n\nexport default ConfigManager;"],"names":["fs","path","Ajv","lodash","ConfigManager","_instance","configPath","schemaPath","ajv","join","process","env","HOME","__dirname","getInstance","readConfig","configContent","readFile","JSON","parse","error","resetToDefaults","writeConfig","config","schemaContent","schema","validate","compile","Error","errorsText","errors","writeFile","stringify","getValue","keyPath","value","get","undefined","customConfig","readCustomConfig","customConfigPath","customConfigContent","set","key","getAll","defaultConfig","redis","host","properties","default","port","agent","default_strategy","max_concurrent_agents","log_level","security","enabled","max_retry_attempts"],"mappings":"AAAA,YAAYA,QAAQ,cAAc;AAClC,YAAYC,UAAU,OAAO;AAC7B,OAAOC,SAAS,MAAM;AACtB,YAAYC,YAAY,SAAS;AAmBjC,IAAA,AAAMC,gBAAN,MAAMA;IACJ,OAAeC,YAAkC,KAAK;IAC9CC,WAAmB;IACnBC,WAAmB;IACnBC,IAAS;IAEjB,aAAsB;QACpB,IAAI,CAACF,UAAU,GAAGL,KAAKQ,IAAI,CACzBC,QAAQC,GAAG,CAACC,IAAI,IAAI,IACpB;QAEF,IAAI,CAACL,UAAU,GAAGN,KAAKQ,IAAI,CACzBI,WACA;QAEF,IAAI,CAACL,GAAG,GAAG,IAAIN;IACjB;IAEA,OAAcY,cAA6B;QACzC,IAAI,CAACV,cAAcC,SAAS,EAAE;YAC5BD,cAAcC,SAAS,GAAG,IAAID;QAChC;QACA,OAAOA,cAAcC,SAAS;IAChC;IAEA,MAAcU,aAAoC;QAChD,IAAI;YACF,MAAMC,gBAAgB,MAAMhB,GAAGiB,QAAQ,CAAC,IAAI,CAACX,UAAU,EAAE;YACzD,OAAOY,KAAKC,KAAK,CAACH;QACpB,EAAE,OAAOI,OAAO;YACd,8CAA8C;YAC9C,OAAO,IAAI,CAACC,eAAe;QAC7B;IACF;IAEA,MAAcC,YAAYC,MAAoB,EAAiB;QAC7D,MAAMC,gBAAgB,MAAMxB,GAAGiB,QAAQ,CAAC,IAAI,CAACV,UAAU,EAAE;QACzD,MAAMkB,SAASP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MAAMG,gBAAgB,MAAMxB,GAAGiB,QAAQ,CAAC,IAAI,CAACV,UAAU,EAAE;QACzD,MAAMkB,SAASP,KAAKC,KAAK,CAACK;QAE1B,yCAAyC;QACzC,MAAMqB,gBAA8B;YAClCC,OAAO;gBACLC,MAAMtB,OAAOuB,UAAU,CAACF,KAAK,CAACE,UAAU,CAACD,IAAI,CAACE,OAAO;gBACrDC,MAAMzB,OAAOuB,UAAU,CAACF,KAAK,CAACE,UAAU,CAACE,IAAI,CAACD,OAAO;YACvD;YACAE,OAAO;gBACLC,kBACE3B,OAAOuB,UAAU,CAACG,KAAK,CAACH,UAAU,CAACI,gBAAgB,CAACH,OAAO;gBAC7DI,uBACE5B,OAAOuB,UAAU,CAACG,KAAK,CAACH,UAAU,CAACK,qBAAqB,CAACJ,OAAO;gBAClEK,WAAW7B,OAAOuB,UAAU,CAACG,KAAK,CAACH,UAAU,CAACM,SAAS,CAACL,OAAO;YACjE;YACAM,UAAU;gBACRC,SAAS/B,OAAOuB,UAAU,CAACO,QAAQ,CAACP,UAAU,CAACQ,OAAO,CAACP,OAAO;gBAC9DQ,oBACEhC,OAAOuB,UAAU,CAACO,QAAQ,CAACP,UAAU,CAACS,kBAAkB,CAACR,OAAO;YACpE;QACF;QAEA,MAAM,IAAI,CAAC3B,WAAW,CAACuB;QACvB,OAAOA;IACT;AACF;AAEA,eAAezC,cAAc"} config = _a.sent();\n // Type assertion to handle both full object and nested key\n if (typeof value === \"object\" && value !== null) {\n config[key] = value;\n }\n else {\n throw new Error(\"Invalid configuration value\");\n }\n return [4 /*yield*/, this.writeConfig(config)];\n case 2:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n ConfigManager.prototype.getAll = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.readConfig()];\n });\n });\n };\n ConfigManager.prototype.resetToDefaults = function () {\n return __awaiter(this, void 0, void 0, function () {\n var schemaContent, schema, defaultConfig;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fs.readFile(this.schemaPath, \"utf-8\")];\n case 1:\n schemaContent = _a.sent();\n schema = JSON.parse(schemaContent);\n defaultConfig = {\n redis: {\n host: schema.properties.redis.properties.host.default,\n port: schema.properties.redis.properties.port.default,\n },\n agent: {\n default_strategy: schema.properties.agent.properties.default_strategy.default,\n max_concurrent_agents: schema.properties.agent.properties.max_concurrent_agents.default,\n log_level: schema.properties.agent.properties.log_level.default,\n },\n security: {\n enabled: schema.properties.security.properties.enabled.default,\n max_retry_attempts: schema.properties.security.properties.max_retry_attempts.default,\n },\n };\n return [4 /*yield*/, this.writeConfig(defaultConfig)];\n case 2:\n _a.sent();\n return [2 /*return*/, defaultConfig];\n }\n });\n });\n };\n return ConfigManager;\n}());\nexports.default = ConfigManager;\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","Object","create","Iterator","prototype","verb","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","defineProperty","exports","fs","require","path","ajv_1","get_1","ConfigManager","configPath","join","process","env","HOME","schemaPath","__dirname","ajv","default","getInstance","instance","readConfig","configContent","error_1","_a","readFile","JSON","parse","resetToDefaults","writeConfig","config","schemaContent","schema","validate","compile","Error","errorsText","errors","writeFile","stringify","getValue","keyPath","customConfig","undefined","readCustomConfig","customConfigPath","customConfigContent","error_2","set","key","getAll","defaultConfig","redis","host","properties","port","agent","default_strategy","max_concurrent_agents","log_level","security","enabled","max_retry_attempts"],"mappings":"AAAA;AACA,IAAIA,YAAY,AAAC,IAAI,IAAI,IAAI,CAACA,SAAS,IAAK,SAAUC,OAAO,EAAEC,UAAU,EAAEC,CAAC,EAAEC,SAAS;IACnF,SAASC,MAAMC,KAAK;QAAI,OAAOA,iBAAiBH,IAAIG,QAAQ,IAAIH,EAAE,SAAUI,OAAO;YAAIA,QAAQD;QAAQ;IAAI;I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;gCACHC,MAAMrB,OAAOsB,UAAU,CAACF,KAAK,CAACE,UAAU,CAACD,IAAI,CAACnC,OAAO;gCACrDqC,MAAMvB,OAAOsB,UAAU,CAACF,KAAK,CAACE,UAAU,CAACC,IAAI,CAACrC,OAAO;4BACzD;4BACAsC,OAAO;gCACHC,kBAAkBzB,OAAOsB,UAAU,CAACE,KAAK,CAACF,UAAU,CAACG,gBAAgB,CAACvC,OAAO;gCAC7EwC,uBAAuB1B,OAAOsB,UAAU,CAACE,KAAK,CAACF,UAAU,CAACI,qBAAqB,CAACxC,OAAO;gCACvFyC,WAAW3B,OAAOsB,UAAU,CAACE,KAAK,CAACF,UAAU,CAACK,SAAS,CAACzC,OAAO;4BACnE;4BACA0C,UAAU;gCACNC,SAAS7B,OAAOsB,UAAU,CAACM,QAAQ,CAACN,UAAU,CAACO,OAAO,CAAC3C,OAAO;gCAC9D4C,oBAAoB9B,OAAOsB,UAAU,CAACM,QAAQ,CAACN,UAAU,CAACQ,kBAAkB,CAAC5C,OAAO;4BACxF;wBACJ;wBACA,OAAO;4BAAC,EAAE,OAAO;4BAAI,IAAI,CAACW,WAAW,CAACsB;yBAAe;oBACzD,KAAK;wBACD3B,GAAG5C,IAAI;wBACP,OAAO;4BAAC,EAAE,QAAQ;4BAAIuE;yBAAc;gBAC5C;YACJ;QACJ;IACJ;IACA,OAAO1C;AACX;AACAN,QAAQe,OAAO,GAAGT"}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* CLI Entry Point - v2.
|
|
3
|
+
* CLI Entry Point - v2.1
|
|
4
4
|
*
|
|
5
|
-
* Handles agent spawning commands:
|
|
5
|
+
* Handles agent spawning commands with memory management:
|
|
6
6
|
* npx claude-flow-novice agent <type> [options]
|
|
7
7
|
*/ // Load environment variables from .env file
|
|
8
8
|
import 'dotenv/config';
|
|
9
|
+
// Apply safe memory defaults if not configured
|
|
10
|
+
if (!process.env.NODE_OPTIONS) {
|
|
11
|
+
// Set conservative 8GB limit (reduced from default 16GB)
|
|
12
|
+
process.env.NODE_OPTIONS = '--max-old-space-size=8192';
|
|
13
|
+
} else if (!process.env.NODE_OPTIONS.includes('max-old-space-size')) {
|
|
14
|
+
// Append memory limit to existing NODE_OPTIONS
|
|
15
|
+
process.env.NODE_OPTIONS += ' --max-old-space-size=8192';
|
|
16
|
+
}
|
|
17
|
+
// Enable memory profiling in development/debug mode
|
|
18
|
+
if (process.env.NODE_ENV === 'development' || process.env.CLAUDE_DEBUG) {
|
|
19
|
+
if (!process.env.NODE_OPTIONS.includes('inspect')) {
|
|
20
|
+
process.env.NODE_OPTIONS += ' --inspect=0.0.0.0:9229';
|
|
21
|
+
}
|
|
22
|
+
if (!process.env.NODE_OPTIONS.includes('heap-prof')) {
|
|
23
|
+
process.env.NODE_OPTIONS += ' --heap-prof';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
9
26
|
import { VERSION } from '../core/index.js';
|
|
10
27
|
import { agentCommand } from './agent-command.js';
|
|
11
28
|
/**
|
|
@@ -54,6 +71,16 @@ import { agentCommand } from './agent-command.js';
|
|
|
54
71
|
case '-h':
|
|
55
72
|
options.help = true;
|
|
56
73
|
break;
|
|
74
|
+
case '--memory-limit':
|
|
75
|
+
options.memoryLimit = parseInt(value, 10);
|
|
76
|
+
i++;
|
|
77
|
+
break;
|
|
78
|
+
case '--enable-profiling':
|
|
79
|
+
options.enableProfiling = true;
|
|
80
|
+
break;
|
|
81
|
+
case '--debug':
|
|
82
|
+
options.debug = true;
|
|
83
|
+
break;
|
|
57
84
|
}
|
|
58
85
|
}
|
|
59
86
|
return {
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\r\n/**\r\n * CLI Entry Point - v2.
|
|
1
|
+
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\r\n/**\r\n * CLI Entry Point - v2.1\r\n *\r\n * Handles agent spawning commands with memory management:\r\n * npx claude-flow-novice agent <type> [options]\r\n */\r\n\r\n// Load environment variables from .env file\r\nimport 'dotenv/config';\r\n\r\n// Apply safe memory defaults if not configured\r\nif (!process.env.NODE_OPTIONS) {\r\n // Set conservative 8GB limit (reduced from default 16GB)\r\n process.env.NODE_OPTIONS = '--max-old-space-size=8192';\r\n} else if (!process.env.NODE_OPTIONS.includes('max-old-space-size')) {\r\n // Append memory limit to existing NODE_OPTIONS\r\n process.env.NODE_OPTIONS += ' --max-old-space-size=8192';\r\n}\r\n\r\n// Enable memory profiling in development/debug mode\r\nif (process.env.NODE_ENV === 'development' || process.env.CLAUDE_DEBUG) {\r\n if (!process.env.NODE_OPTIONS.includes('inspect')) {\r\n process.env.NODE_OPTIONS += ' --inspect=0.0.0.0:9229';\r\n }\r\n if (!process.env.NODE_OPTIONS.includes('heap-prof')) {\r\n process.env.NODE_OPTIONS += ' --heap-prof';\r\n }\r\n}\r\n\r\nimport { VERSION } from '../core/index.js';\r\nimport { agentCommand, AgentCommandOptions } from './agent-command.js';\r\n\r\n/**\r\n * Parse command line arguments\r\n */\r\nfunction parseArgs(args: string[]): { command: string; agentType?: string; options: AgentCommandOptions } {\r\n const command = args[0] || 'help';\r\n const agentType = args[1] && !args[1].startsWith('--') ? args[1] : undefined;\r\n const options: AgentCommandOptions = {};\r\n\r\n // Parse options\r\n for (let i = agentType ? 2 : 1; i < args.length; i++) {\r\n const arg = args[i];\r\n const value = args[i + 1];\r\n\r\n switch (arg) {\r\n case '--task-id':\r\n options.taskId = value;\r\n i++;\r\n break;\r\n case '--iteration':\r\n options.iteration = parseInt(value, 10);\r\n i++;\r\n break;\r\n case '--agent-id':\r\n options.agentId = value;\r\n i++;\r\n break;\r\n case '--context':\r\n options.context = value;\r\n i++;\r\n break;\r\n case '--mode':\r\n options.mode = value;\r\n i++;\r\n break;\r\n case '--priority':\r\n options.priority = parseInt(value, 10);\r\n i++;\r\n break;\r\n case '--parent-task-id':\r\n options.parentTaskId = value;\r\n i++;\r\n break;\r\n case '--list':\r\n options.list = true;\r\n break;\r\n case '--help':\r\n case '-h':\r\n options.help = true;\r\n break;\r\n case '--memory-limit':\r\n options.memoryLimit = parseInt(value, 10);\r\n i++;\r\n break;\r\n case '--enable-profiling':\r\n options.enableProfiling = true;\r\n break;\r\n case '--debug':\r\n options.debug = true;\r\n break;\r\n }\r\n }\r\n\r\n return { command, agentType, options };\r\n}\r\n\r\n/**\r\n * Display main CLI help\r\n */\r\nfunction displayHelp(): void {\r\n console.log(`\r\nClaude Flow Novice CLI v${VERSION}\r\n\r\nUsage:\r\n npx claude-flow-novice <command> [options]\r\n\r\nCommands:\r\n agent <type> [options] Spawn an agent for task execution\r\n --version Show version number\r\n --help Show this help message\r\n\r\nExamples:\r\n # Spawn an agent\r\n npx claude-flow-novice agent coder --context \"Implement feature\"\r\n\r\n # List available agents\r\n npx claude-flow-novice agent --list\r\n\r\n # Show version\r\n npx claude-flow-novice --version\r\n\r\nFor more information:\r\n https://github.com/yourusername/claude-flow-novice\r\n`);\r\n}\r\n\r\n/**\r\n * Main CLI entry point\r\n */\r\nasync function main() {\r\n const args = process.argv.slice(2);\r\n\r\n // Handle version flag\r\n if (args.includes('--version') || args.includes('-v')) {\r\n console.log(`Claude Flow Novice v${VERSION}`);\r\n return;\r\n }\r\n\r\n // Handle help flag\r\n if (args.length === 0 || args.includes('--help') || args.includes('-h')) {\r\n displayHelp();\r\n return;\r\n }\r\n\r\n const { command, agentType, options } = parseArgs(args);\r\n\r\n switch (command) {\r\n case 'agent':\r\n await agentCommand(agentType, options);\r\n break;\r\n\r\n default:\r\n console.error(`Unknown command: ${command}`);\r\n console.log('Run with --help for usage information');\r\n process.exit(1);\r\n }\r\n}\r\n\r\n// Run CLI\r\nmain().catch((error) => {\r\n console.error('[claude-flow-novice] Fatal error:', error);\r\n process.exit(1);\r\n});\r\n"],"names":["process","env","NODE_OPTIONS","includes","NODE_ENV","CLAUDE_DEBUG","VERSION","agentCommand","parseArgs","args","command","agentType","startsWith","undefined","options","i","length","arg","value","taskId","iteration","parseInt","agentId","context","mode","priority","parentTaskId","list","help","memoryLimit","enableProfiling","debug","displayHelp","console","log","main","argv","slice","error","exit","catch"],"mappings":";AACA;;;;;CAKC,GAED,4CAA4C;AAC5C,OAAO,gBAAgB;AAEvB,+CAA+C;AAC/C,IAAI,CAACA,QAAQC,GAAG,CAACC,YAAY,EAAE;IAC7B,yDAAyD;IACzDF,QAAQC,GAAG,CAACC,YAAY,GAAG;AAC7B,OAAO,IAAI,CAACF,QAAQC,GAAG,CAACC,YAAY,CAACC,QAAQ,CAAC,uBAAuB;IACnE,+CAA+C;IAC/CH,QAAQC,GAAG,CAACC,YAAY,IAAI;AAC9B;AAEA,oDAAoD;AACpD,IAAIF,QAAQC,GAAG,CAACG,QAAQ,KAAK,iBAAiBJ,QAAQC,GAAG,CAACI,YAAY,EAAE;IACtE,IAAI,CAACL,QAAQC,GAAG,CAACC,YAAY,CAACC,QAAQ,CAAC,YAAY;QACjDH,QAAQC,GAAG,CAACC,YAAY,IAAI;IAC9B;IACA,IAAI,CAACF,QAAQC,GAAG,CAACC,YAAY,CAACC,QAAQ,CAAC,cAAc;QACnDH,QAAQC,GAAG,CAACC,YAAY,IAAI;IAC9B;AACF;AAEA,SAASI,OAAO,QAAQ,mBAAmB;AAC3C,SAASC,YAAY,QAA6B,qBAAqB;AAEvE;;CAEC,GACD,SAASC,UAAUC,IAAc;IAC/B,MAAMC,UAAUD,IAAI,CAAC,EAAE,IAAI;IAC3B,MAAME,YAAYF,IAAI,CAAC,EAAE,IAAI,CAACA,IAAI,CAAC,EAAE,CAACG,UAAU,CAAC,QAAQH,IAAI,CAAC,EAAE,GAAGI;IACnE,MAAMC,UAA+B,CAAC;IAEtC,gBAAgB;IAChB,IAAK,IAAIC,IAAIJ,YAAY,IAAI,GAAGI,IAAIN,KAAKO,MAAM,EAAED,IAAK;Q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CAAC,aAAaM,KAAKN,QAAQ,CAAC,OAAO;QACvE6B;QACA;IACF;IAEA,MAAM,EAAEtB,OAAO,EAAEC,SAAS,EAAEG,OAAO,EAAE,GAAGN,UAAUC;IAElD,OAAQC;QACN,KAAK;YACH,MAAMH,aAAaI,WAAWG;YAC9B;QAEF;YACEmB,QAAQK,KAAK,CAAC,CAAC,iBAAiB,EAAE5B,SAAS;YAC3CuB,QAAQC,GAAG,CAAC;YACZlC,QAAQuC,IAAI,CAAC;IACjB;AACF;AAEA,UAAU;AACVJ,OAAOK,KAAK,CAAC,CAACF;IACZL,QAAQK,KAAK,CAAC,qCAAqCA;IACnDtC,QAAQuC,IAAI,CAAC;AACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow-novice",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.32",
|
|
4
4
|
"description": "AI agent orchestration framework with namespace-isolated skills, agents, and CFN Loop validation. Safe installation with ~0.01% collision risk.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
".claude/skills/cfn-agent-output-processing/",
|
|
25
25
|
".claude/skills/cfn-agent-selector/",
|
|
26
26
|
".claude/skills/cfn-agent-spawning/",
|
|
27
|
+
".claude/skills/cfn-docker-agent-spawning/",
|
|
28
|
+
".claude/skills/cfn-docker-loop-orchestration/",
|
|
29
|
+
".claude/skills/cfn-docker-redis-coordination/",
|
|
30
|
+
".claude/skills/cfn-docker-skill-mcp-selection/",
|
|
27
31
|
".claude/skills/cfn-analytics/",
|
|
28
32
|
".claude/skills/cfn-backlog-management/",
|
|
29
33
|
".claude/skills/cfn-changelog-management/",
|
|
@@ -70,7 +74,11 @@
|
|
|
70
74
|
"automation",
|
|
71
75
|
"cli",
|
|
72
76
|
"consensus",
|
|
73
|
-
"validation"
|
|
77
|
+
"validation",
|
|
78
|
+
"docker",
|
|
79
|
+
"containers",
|
|
80
|
+
"memory-leaks",
|
|
81
|
+
"concurrent-execution"
|
|
74
82
|
],
|
|
75
83
|
"author": "Claude Flow Novice Team",
|
|
76
84
|
"license": "MIT",
|