agentic-flow 1.0.0 → 1.0.1
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 +25 -4
- package/dist/mcp/standalone-stdio.js +83 -0
- package/package.json +1 -1
package/dist/cli-proxy.js
CHANGED
|
@@ -9,7 +9,13 @@ import { logger } from "./utils/logger.js";
|
|
|
9
9
|
import { parseArgs } from "./utils/cli.js";
|
|
10
10
|
import { getAgent, listAgents } from "./utils/agentLoader.js";
|
|
11
11
|
import { claudeAgent } from "./agents/claudeAgent.js";
|
|
12
|
-
import {
|
|
12
|
+
import { readFileSync } from 'fs';
|
|
13
|
+
import { resolve, dirname } from 'path';
|
|
14
|
+
import { fileURLToPath } from 'url';
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
const packageJson = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf-8'));
|
|
18
|
+
const VERSION = packageJson.version;
|
|
13
19
|
class AgenticFlowCLI {
|
|
14
20
|
proxyServer = null;
|
|
15
21
|
proxyPort = 3000;
|
|
@@ -24,8 +30,23 @@ class AgenticFlowCLI {
|
|
|
24
30
|
process.exit(0);
|
|
25
31
|
}
|
|
26
32
|
if (options.mode === 'mcp') {
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
// Run standalone MCP server directly
|
|
34
|
+
const { spawn } = await import('child_process');
|
|
35
|
+
const { resolve, dirname } = await import('path');
|
|
36
|
+
const { fileURLToPath } = await import('url');
|
|
37
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
38
|
+
const __dirname = dirname(__filename);
|
|
39
|
+
const serverPath = resolve(__dirname, './mcp/standalone-stdio.js');
|
|
40
|
+
const proc = spawn('node', [serverPath], {
|
|
41
|
+
stdio: 'inherit'
|
|
42
|
+
});
|
|
43
|
+
proc.on('exit', (code) => {
|
|
44
|
+
process.exit(code || 0);
|
|
45
|
+
});
|
|
46
|
+
// Handle termination signals
|
|
47
|
+
process.on('SIGINT', () => proc.kill('SIGINT'));
|
|
48
|
+
process.on('SIGTERM', () => proc.kill('SIGTERM'));
|
|
49
|
+
return;
|
|
29
50
|
}
|
|
30
51
|
// Determine if we should use OpenRouter
|
|
31
52
|
const useOpenRouter = this.shouldUseOpenRouter(options);
|
|
@@ -179,7 +200,7 @@ class AgenticFlowCLI {
|
|
|
179
200
|
}
|
|
180
201
|
printHelp() {
|
|
181
202
|
console.log(`
|
|
182
|
-
🤖 Agentic Flow - AI Agent Orchestration with OpenRouter Support
|
|
203
|
+
🤖 Agentic Flow v${VERSION} - AI Agent Orchestration with OpenRouter Support
|
|
183
204
|
|
|
184
205
|
USAGE:
|
|
185
206
|
npx agentic-flow [COMMAND] [OPTIONS]
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Standalone agentic-flow MCP server - runs directly via stdio without spawning subprocesses
|
|
3
|
+
import { FastMCP } from 'fastmcp';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { execSync } from 'child_process';
|
|
6
|
+
import { resolve, dirname } from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
|
|
12
|
+
console.error('🚀 Starting Agentic-Flow MCP Server (stdio)...');
|
|
13
|
+
console.error('📦 Local agentic-flow tools available');
|
|
14
|
+
|
|
15
|
+
const server = new FastMCP({
|
|
16
|
+
name: 'agentic-flow',
|
|
17
|
+
version: '1.0.0'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// Tool: Run agentic-flow agent
|
|
21
|
+
server.addTool({
|
|
22
|
+
name: 'agentic_flow_agent',
|
|
23
|
+
description: 'Execute an agentic-flow agent with a specific task',
|
|
24
|
+
parameters: z.object({
|
|
25
|
+
agent: z.string().describe('Agent type (coder, researcher, etc.)'),
|
|
26
|
+
task: z.string().describe('Task description for the agent'),
|
|
27
|
+
stream: z.boolean().optional().default(false).describe('Enable streaming output')
|
|
28
|
+
}),
|
|
29
|
+
execute: async ({ agent, task, stream }) => {
|
|
30
|
+
try {
|
|
31
|
+
const cliPath = resolve(__dirname, '../../cli-proxy.js');
|
|
32
|
+
const cmd = `node "${cliPath}" --agent "${agent}" --task "${task}"${stream ? ' --stream' : ''}`;
|
|
33
|
+
const result = execSync(cmd, {
|
|
34
|
+
encoding: 'utf-8',
|
|
35
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
36
|
+
cwd: resolve(__dirname, '../..')
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return JSON.stringify({
|
|
40
|
+
success: true,
|
|
41
|
+
agent,
|
|
42
|
+
task,
|
|
43
|
+
output: result.trim()
|
|
44
|
+
}, null, 2);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
throw new Error(`Failed to execute agent: ${error.message}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Tool: List available agents
|
|
52
|
+
server.addTool({
|
|
53
|
+
name: 'agentic_flow_list_agents',
|
|
54
|
+
description: 'List all available agentic-flow agents',
|
|
55
|
+
parameters: z.object({}),
|
|
56
|
+
execute: async () => {
|
|
57
|
+
try {
|
|
58
|
+
const cliPath = resolve(__dirname, '../../cli-proxy.js');
|
|
59
|
+
const cmd = `node "${cliPath}" --mode list`;
|
|
60
|
+
const result = execSync(cmd, {
|
|
61
|
+
encoding: 'utf-8',
|
|
62
|
+
cwd: resolve(__dirname, '../..')
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
return JSON.stringify({
|
|
66
|
+
success: true,
|
|
67
|
+
agents: result.trim()
|
|
68
|
+
}, null, 2);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
throw new Error(`Failed to list agents: ${error.message}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
console.error('✅ Registered 2 tools: agentic_flow_agent, agentic_flow_list_agents');
|
|
76
|
+
console.error('🔌 Starting stdio transport...');
|
|
77
|
+
|
|
78
|
+
server.start({ transportType: 'stdio' }).then(() => {
|
|
79
|
+
console.error('✅ Agentic-Flow MCP server running on stdio');
|
|
80
|
+
}).catch((error) => {
|
|
81
|
+
console.error('❌ Failed to start server:', error);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-flow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
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",
|