agentic-flow 1.0.2 → 1.0.4

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/dist/cli-proxy.js CHANGED
@@ -8,7 +8,7 @@ import { AnthropicToOpenRouterProxy } from "./proxy/anthropic-to-openrouter.js";
8
8
  import { logger } from "./utils/logger.js";
9
9
  import { parseArgs } from "./utils/cli.js";
10
10
  import { getAgent, listAgents } from "./utils/agentLoader.js";
11
- import { claudeAgent } from "./agents/claudeAgent.js";
11
+ import { directApiAgent } from "./agents/directApiAgent.js";
12
12
  import { readFileSync } from 'fs';
13
13
  import { resolve, dirname } from 'path';
14
14
  import { fileURLToPath } from 'url';
@@ -130,6 +130,26 @@ class AgenticFlowCLI {
130
130
  this.printHelp();
131
131
  process.exit(1);
132
132
  }
133
+ // Check for API key (unless using ONNX)
134
+ const isOnnx = options.provider === 'onnx' || process.env.USE_ONNX === 'true' || process.env.PROVIDER === 'onnx';
135
+ if (!isOnnx && !useOpenRouter && !process.env.ANTHROPIC_API_KEY) {
136
+ console.error('\n❌ Error: ANTHROPIC_API_KEY is required\n');
137
+ console.error('Please set your API key:');
138
+ console.error(' export ANTHROPIC_API_KEY=sk-ant-xxxxx\n');
139
+ console.error('Or use alternative providers:');
140
+ console.error(' --provider openrouter (requires OPENROUTER_API_KEY)');
141
+ console.error(' --provider onnx (free local inference)\n');
142
+ process.exit(1);
143
+ }
144
+ if (!isOnnx && useOpenRouter && !process.env.OPENROUTER_API_KEY) {
145
+ console.error('\n❌ Error: OPENROUTER_API_KEY is required for OpenRouter\n');
146
+ console.error('Please set your API key:');
147
+ console.error(' export OPENROUTER_API_KEY=sk-or-v1-xxxxx\n');
148
+ console.error('Or use alternative providers:');
149
+ console.error(' --provider anthropic (requires ANTHROPIC_API_KEY)');
150
+ console.error(' --provider onnx (free local inference)\n');
151
+ process.exit(1);
152
+ }
133
153
  const agent = getAgent(agentName);
134
154
  if (!agent) {
135
155
  const available = listAgents();
@@ -161,8 +181,8 @@ class AgenticFlowCLI {
161
181
  }
162
182
  console.log('⏳ Running...\n');
163
183
  const streamHandler = options.stream ? (chunk) => process.stdout.write(chunk) : undefined;
164
- const modelOverride = useOpenRouter ? (options.model || process.env.COMPLETION_MODEL) : undefined;
165
- const result = await claudeAgent(agent, task, streamHandler, modelOverride);
184
+ // Use directApiAgent (works without Claude Code installed) instead of claudeAgent (requires Claude Code)
185
+ const result = await directApiAgent(agent, task, streamHandler);
166
186
  if (!options.stream) {
167
187
  console.log('\n✅ Completed!\n');
168
188
  console.log('═══════════════════════════════════════\n');
@@ -5,18 +5,26 @@ import { z } from 'zod';
5
5
  import { execSync } from 'child_process';
6
6
  import { resolve, dirname } from 'path';
7
7
  import { fileURLToPath } from 'url';
8
-
9
8
  const __filename = fileURLToPath(import.meta.url);
10
9
  const __dirname = dirname(__filename);
11
-
10
+ // Suppress FastMCP internal warnings for cleaner output
11
+ const originalConsoleWarn = console.warn;
12
+ console.warn = (...args) => {
13
+ const message = args.join(' ');
14
+ // Filter out FastMCP client capability warnings
15
+ if (message.includes('could not infer client capabilities')) {
16
+ // Replace with friendly status message
17
+ console.error('⏳ Waiting for MCP client connection...');
18
+ return;
19
+ }
20
+ originalConsoleWarn.apply(console, args);
21
+ };
12
22
  console.error('🚀 Starting Agentic-Flow MCP Server (stdio)...');
13
23
  console.error('📦 Local agentic-flow tools available');
14
-
15
24
  const server = new FastMCP({
16
25
  name: 'agentic-flow',
17
- version: '1.0.0'
26
+ version: '1.0.3'
18
27
  });
19
-
20
28
  // Tool: Run agentic-flow agent
21
29
  server.addTool({
22
30
  name: 'agentic_flow_agent',
@@ -35,19 +43,18 @@ server.addTool({
35
43
  maxBuffer: 10 * 1024 * 1024,
36
44
  cwd: resolve(__dirname, '../..')
37
45
  });
38
-
39
46
  return JSON.stringify({
40
47
  success: true,
41
48
  agent,
42
49
  task,
43
50
  output: result.trim()
44
51
  }, null, 2);
45
- } catch (error) {
52
+ }
53
+ catch (error) {
46
54
  throw new Error(`Failed to execute agent: ${error.message}`);
47
55
  }
48
56
  }
49
57
  });
50
-
51
58
  // Tool: List available agents
52
59
  server.addTool({
53
60
  name: 'agentic_flow_list_agents',
@@ -61,22 +68,21 @@ server.addTool({
61
68
  encoding: 'utf-8',
62
69
  cwd: resolve(__dirname, '../..')
63
70
  });
64
-
65
71
  return JSON.stringify({
66
72
  success: true,
67
73
  agents: result.trim()
68
74
  }, null, 2);
69
- } catch (error) {
75
+ }
76
+ catch (error) {
70
77
  throw new Error(`Failed to list agents: ${error.message}`);
71
78
  }
72
79
  }
73
80
  });
74
-
75
81
  console.error('✅ Registered 2 tools: agentic_flow_agent, agentic_flow_list_agents');
76
82
  console.error('🔌 Starting stdio transport...');
77
-
78
83
  server.start({ transportType: 'stdio' }).then(() => {
79
84
  console.error('✅ Agentic-Flow MCP server running on stdio');
85
+ console.error('💡 Ready for MCP client connections (e.g., Claude Desktop)');
80
86
  }).catch((error) => {
81
87
  console.error('❌ Failed to start server:', error);
82
88
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-flow",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Production-ready AI agent orchestration platform with 66 specialized agents, 111 MCP tools, and autonomous multi-agent swarms. Built by @ruvnet with Claude Agent SDK, neural networks, memory persistence, GitHub integration, and distributed consensus protocols.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",