agentic-flow 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -12
- package/dist/agents/claudeAgent.js +96 -67
- package/dist/cli/claude-code-wrapper.js +23 -1
- package/dist/cli-proxy.js +71 -5
- package/dist/mcp/standalone-stdio.js +251 -2
- package/dist/proxy/anthropic-to-requesty.js +707 -0
- package/dist/utils/cli.js +6 -0
- package/dist/utils/modelCapabilities.js +22 -0
- package/docs/plans/agent-booster/00-INDEX.md +230 -0
- package/docs/plans/agent-booster/00-OVERVIEW.md +454 -0
- package/docs/plans/agent-booster/01-ARCHITECTURE.md +699 -0
- package/docs/plans/agent-booster/02-INTEGRATION.md +771 -0
- package/docs/plans/agent-booster/03-BENCHMARKS.md +616 -0
- package/docs/plans/agent-booster/04-NPM-SDK.md +673 -0
- package/docs/plans/agent-booster/GITHUB-ISSUE.md +523 -0
- package/docs/plans/agent-booster/README.md +576 -0
- package/docs/plans/requesty/00-overview.md +176 -0
- package/docs/plans/requesty/01-api-research.md +573 -0
- package/docs/plans/requesty/02-architecture.md +1076 -0
- package/docs/plans/requesty/03-implementation-phases.md +1129 -0
- package/docs/plans/requesty/04-testing-strategy.md +905 -0
- package/docs/plans/requesty/05-migration-guide.md +576 -0
- package/docs/plans/requesty/README.md +290 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://github.com/ruvnet/)
|
|
8
8
|
|
|
9
|
-
**Production-ready AI agent orchestration with 66+ specialized agents,
|
|
9
|
+
**Production-ready AI agent orchestration with 66+ specialized agents, 216 MCP tools, Agent Booster (152x faster edits), and multi-model routing (Anthropic, OpenRouter, Gemini, ONNX).**
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -24,9 +24,10 @@ Define routing rules through flexible policy modes: Strict mode keeps sensitive
|
|
|
24
24
|
|
|
25
25
|
**Key Capabilities:**
|
|
26
26
|
- ✅ **Claude Code Mode** - Run Claude Code with OpenRouter/Gemini/ONNX (85-99% savings)
|
|
27
|
+
- ✅ **Agent Booster** - 152x faster code edits with WASM (12ms vs 13s, $0 cost)
|
|
27
28
|
- ✅ **66 Specialized Agents** - Pre-built experts for coding, research, review, testing, DevOps
|
|
28
|
-
- ✅ **
|
|
29
|
-
- ✅ **Multi-Model Router** - Anthropic, OpenRouter (
|
|
29
|
+
- ✅ **216 MCP Tools** - Agent Booster (3), Memory, GitHub, neural networks, sandboxes, workflows, payments
|
|
30
|
+
- ✅ **Multi-Model Router** - Anthropic, OpenRouter (300+ models), Gemini, ONNX (free local)
|
|
30
31
|
- ✅ **Cost Optimization** - DeepSeek at $0.14/M tokens vs Claude at $15/M (99% savings)
|
|
31
32
|
|
|
32
33
|
**Built On:**
|
|
@@ -56,6 +57,10 @@ npx agentic-flow --agent coder --task "Build a REST API with authentication"
|
|
|
56
57
|
export OPENROUTER_API_KEY=sk-or-v1-...
|
|
57
58
|
npx agentic-flow --agent coder --task "Build REST API" --model "meta-llama/llama-3.1-8b-instruct"
|
|
58
59
|
|
|
60
|
+
# Run with (300+ models, 95% cost savings)
|
|
61
|
+
export REQUESTY_API_KEY=sk-...
|
|
62
|
+
npx agentic-flow --agent coder --task "Build REST API" --provider requesty
|
|
63
|
+
|
|
59
64
|
# Run with Gemini (free tier)
|
|
60
65
|
export GOOGLE_GEMINI_API_KEY=AIza...
|
|
61
66
|
npx agentic-flow --agent coder --task "Build REST API" --provider gemini
|
|
@@ -81,7 +86,7 @@ npx agentic-flow --list
|
|
|
81
86
|
Access 213 MCP tools for memory, swarms, GitHub, neural networks, and cloud sandboxes:
|
|
82
87
|
|
|
83
88
|
```bash
|
|
84
|
-
# Start all MCP servers (
|
|
89
|
+
# Start all MCP servers (216 tools) - stdio transport
|
|
85
90
|
npx agentic-flow mcp start
|
|
86
91
|
|
|
87
92
|
# List all available tools
|
|
@@ -120,23 +125,30 @@ npm run mcp:stdio
|
|
|
120
125
|
|
|
121
126
|
---
|
|
122
127
|
|
|
123
|
-
### Option 3: Claude Code Mode (v1.
|
|
128
|
+
### Option 3: Claude Code Mode with Agent Booster (v1.3.1+)
|
|
124
129
|
|
|
125
|
-
**Run Claude Code with alternative AI providers
|
|
130
|
+
**Run Claude Code with alternative AI providers + 152x faster code edits!**
|
|
126
131
|
|
|
127
|
-
Automatically spawns Claude Code with proxy configuration
|
|
132
|
+
Automatically spawns Claude Code with proxy configuration and Agent Booster MCP tools:
|
|
128
133
|
|
|
129
134
|
```bash
|
|
135
|
+
# With Agent Booster (152x faster code edits, $0 cost)
|
|
136
|
+
npx agentic-flow claude-code --provider openrouter --agent-booster
|
|
137
|
+
npx agentic-flow claude-code --provider gemini --agent-booster
|
|
138
|
+
|
|
130
139
|
# Interactive mode - Opens Claude Code UI with proxy
|
|
131
140
|
npx agentic-flow claude-code --provider openrouter
|
|
141
|
+
npx agentic-flow claude-code --provider requesty
|
|
132
142
|
npx agentic-flow claude-code --provider gemini
|
|
133
143
|
|
|
134
144
|
# Non-interactive mode - Execute task and exit
|
|
135
145
|
npx agentic-flow claude-code --provider openrouter "Write a Python hello world function"
|
|
146
|
+
npx agentic-flow claude-code --provider requesty "Write a Python hello world function"
|
|
136
147
|
npx agentic-flow claude-code --provider openrouter --model "deepseek/deepseek-chat" "Create REST API"
|
|
137
148
|
|
|
138
149
|
# Use specific models
|
|
139
150
|
npx agentic-flow claude-code --provider openrouter --model "mistralai/mistral-small"
|
|
151
|
+
npx agentic-flow claude-code --provider requesty --model "openai/gpt-4o-mini"
|
|
140
152
|
npx agentic-flow claude-code --provider gemini --model "gemini-2.0-flash-exp"
|
|
141
153
|
|
|
142
154
|
# Local ONNX models (100% free, privacy-focused)
|
|
@@ -148,6 +160,8 @@ npx agentic-flow claude-code --provider onnx "Analyze this codebase"
|
|
|
148
160
|
| Provider | Model | Cost/M Tokens | Context | Best For |
|
|
149
161
|
|----------|-------|---------------|---------|----------|
|
|
150
162
|
| OpenRouter | `deepseek/deepseek-chat` (default) | $0.14 | 128k | General tasks, best value |
|
|
163
|
+
| | `deepseek/deepseek-chat` | $0.14 | 128k | 300+ models, unified API |
|
|
164
|
+
| | `openai/gpt-4o-mini` | $0.15 | 128k | OpenAI models via |
|
|
151
165
|
| OpenRouter | `anthropic/claude-3.5-sonnet` | $3.00 | 200k | Highest quality, complex reasoning |
|
|
152
166
|
| OpenRouter | `google/gemini-2.0-flash-exp:free` | FREE | 1M | Development, testing (rate limited) |
|
|
153
167
|
| Gemini | `gemini-2.0-flash-exp` | FREE | 1M | Fast responses, rate limited |
|
|
@@ -155,13 +169,24 @@ npx agentic-flow claude-code --provider onnx "Analyze this codebase"
|
|
|
155
169
|
|
|
156
170
|
⚠️ **Note:** Claude Code sends 35k+ tokens in tool definitions. Models with <128k context (like Mistral Small at 32k) will fail with "context length exceeded" errors.
|
|
157
171
|
|
|
172
|
+
**Agent Booster Performance:**
|
|
173
|
+
|
|
174
|
+
| Metric | Standard LLM | Agent Booster (WASM) | Improvement |
|
|
175
|
+
|--------|-------------|---------------------|-------------|
|
|
176
|
+
| **Latency** | 13,000ms (13s) | 85ms | **152x faster** |
|
|
177
|
+
| **Cost** | $0.001/edit | $0.000 | **100% savings** |
|
|
178
|
+
| **Quality** | 100% | 100% | Comparable |
|
|
179
|
+
|
|
180
|
+
Agent Booster uses Rust/WASM for ultra-fast code editing (152x faster than LLMs, zero cost). Enabled by default with `--agent-booster` flag.
|
|
181
|
+
|
|
158
182
|
**How it works:**
|
|
159
183
|
1. ✅ Auto-starts proxy server in background (OpenRouter/Gemini/ONNX)
|
|
160
184
|
2. ✅ Sets `ANTHROPIC_BASE_URL` to proxy endpoint
|
|
161
185
|
3. ✅ Configures provider-specific API keys transparently
|
|
162
|
-
4. ✅
|
|
163
|
-
5. ✅
|
|
164
|
-
6. ✅
|
|
186
|
+
4. ✅ Loads Agent Booster MCP tools (3 tools for ultra-fast edits)
|
|
187
|
+
5. ✅ Spawns Claude Code with environment configured
|
|
188
|
+
6. ✅ All Claude SDK features work (tools, memory, MCP, etc.)
|
|
189
|
+
7. ✅ Automatic cleanup on exit
|
|
165
190
|
|
|
166
191
|
**Environment Setup:**
|
|
167
192
|
|
|
@@ -169,6 +194,9 @@ npx agentic-flow claude-code --provider onnx "Analyze this codebase"
|
|
|
169
194
|
# OpenRouter (100+ models at 85-99% savings)
|
|
170
195
|
export OPENROUTER_API_KEY=sk-or-v1-...
|
|
171
196
|
|
|
197
|
+
# (300+ models, unified access)
|
|
198
|
+
export REQUESTY_API_KEY=sk-...
|
|
199
|
+
|
|
172
200
|
# Gemini (FREE tier available)
|
|
173
201
|
export GOOGLE_GEMINI_API_KEY=AIza...
|
|
174
202
|
|
|
@@ -199,7 +227,7 @@ npx agentic-flow proxy --provider openrouter --model "openai/gpt-4o-mini"
|
|
|
199
227
|
```
|
|
200
228
|
|
|
201
229
|
**Features:**
|
|
202
|
-
- ✅ MCP tools work through proxy (all
|
|
230
|
+
- ✅ MCP tools work through proxy (all 216 tools)
|
|
203
231
|
- ✅ Compatible with Claude Code official CLI
|
|
204
232
|
- ✅ Context-aware instruction injection (v1.1.13)
|
|
205
233
|
- ✅ Model-specific max_tokens optimization
|
|
@@ -381,7 +409,7 @@ MCP (Model Context Protocol) tools extend agent capabilities beyond text generat
|
|
|
381
409
|
|
|
382
410
|
**stdio Transport (default for Claude Desktop):**
|
|
383
411
|
```bash
|
|
384
|
-
# Start all
|
|
412
|
+
# Start all 216 tools (4 servers)
|
|
385
413
|
npx agentic-flow mcp start
|
|
386
414
|
|
|
387
415
|
# Start specific server
|
|
@@ -1014,11 +1042,58 @@ export HEALTH_PORT=8080 # Health check port
|
|
|
1014
1042
|
# .env file (auto-loaded)
|
|
1015
1043
|
ANTHROPIC_API_KEY=sk-ant-...
|
|
1016
1044
|
OPENROUTER_API_KEY=sk-or-v1-...
|
|
1045
|
+
REQUESTY_API_KEY=sk-...
|
|
1017
1046
|
GOOGLE_GEMINI_API_KEY=AIza...
|
|
1018
1047
|
ENABLE_CLAUDE_FLOW_SDK=true
|
|
1019
1048
|
COMPLETION_MODEL=deepseek/deepseek-chat-v3.1
|
|
1020
1049
|
```
|
|
1021
1050
|
|
|
1051
|
+
** Configuration (v1.3.1+)** ⚠️
|
|
1052
|
+
|
|
1053
|
+
.ai provides unified access to 300+ AI models including OpenAI (GPT-4o, GPT-4o-mini), Anthropic, DeepSeek, Meta, Mistral, and more through a single API key.
|
|
1054
|
+
|
|
1055
|
+
⚠️ **Current Status**: provider has integration challenges with Claude SDK agent initialization. **We recommend using OpenRouter instead** for agent-based tasks.
|
|
1056
|
+
|
|
1057
|
+
**What Works:**
|
|
1058
|
+
- ✅ Simple API calls without agents
|
|
1059
|
+
- ✅ Basic arithmetic and simple tasks
|
|
1060
|
+
- ✅ Direct API integration via curl/fetch
|
|
1061
|
+
|
|
1062
|
+
**Known Limitations:**
|
|
1063
|
+
- ❌ Hangs during Claude SDK agent initialization with MCP tools
|
|
1064
|
+
- ❌ Cannot handle full agent execution (coder, reviewer, etc.)
|
|
1065
|
+
- ⚠️ Tool limit reduced to 10 maximum (vs 213 available)
|
|
1066
|
+
|
|
1067
|
+
**Recommended Alternative:**
|
|
1068
|
+
Use **OpenRouter** for identical cost savings and full agent support:
|
|
1069
|
+
```bash
|
|
1070
|
+
# OpenRouter works perfectly with all agents and tools
|
|
1071
|
+
export OPENROUTER_API_KEY=sk-or-v1-...
|
|
1072
|
+
npx agentic-flow --agent coder --task "your task" --provider openrouter
|
|
1073
|
+
npx agentic-flow --agent coder --task "your task" --model "deepseek/deepseek-chat"
|
|
1074
|
+
```
|
|
1075
|
+
|
|
1076
|
+
**If you still want to try :**
|
|
1077
|
+
```bash
|
|
1078
|
+
# Get your API key from https://requesty.ai
|
|
1079
|
+
export REQUESTY_API_KEY=sk-...
|
|
1080
|
+
|
|
1081
|
+
# Simple tasks only (no agent mode recommended)
|
|
1082
|
+
# Use OpenRouter for agent-based work instead
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
**Technical Details:**
|
|
1086
|
+
- Schema sanitization for array properties
|
|
1087
|
+
- 60-second timeout protection
|
|
1088
|
+
- Tool limiting (10 max) to prevent overload
|
|
1089
|
+
- OpenAI-compatible API format
|
|
1090
|
+
- Automatic max_tokens optimization (capped at 8192)
|
|
1091
|
+
|
|
1092
|
+
**Supported Models (when working):**
|
|
1093
|
+
- `deepseek/deepseek-chat` - $0.14/M tokens, 128k context
|
|
1094
|
+
- `openai/gpt-4o-mini` - $0.15/M tokens, 128k context
|
|
1095
|
+
- 300+ other models available
|
|
1096
|
+
|
|
1022
1097
|
---
|
|
1023
1098
|
|
|
1024
1099
|
## 📚 Complete Agent List
|
|
@@ -8,6 +8,9 @@ function getCurrentProvider() {
|
|
|
8
8
|
if (process.env.PROVIDER === 'gemini' || process.env.USE_GEMINI === 'true') {
|
|
9
9
|
return 'gemini';
|
|
10
10
|
}
|
|
11
|
+
if (process.env.PROVIDER === 'requesty' || process.env.USE_REQUESTY === 'true') {
|
|
12
|
+
return 'requesty';
|
|
13
|
+
}
|
|
11
14
|
if (process.env.PROVIDER === 'openrouter' || process.env.USE_OPENROUTER === 'true') {
|
|
12
15
|
return 'openrouter';
|
|
13
16
|
}
|
|
@@ -24,6 +27,12 @@ function getModelForProvider(provider) {
|
|
|
24
27
|
apiKey: process.env.GOOGLE_GEMINI_API_KEY || process.env.ANTHROPIC_API_KEY || '',
|
|
25
28
|
baseURL: process.env.PROXY_URL || undefined
|
|
26
29
|
};
|
|
30
|
+
case 'requesty':
|
|
31
|
+
return {
|
|
32
|
+
model: process.env.COMPLETION_MODEL || 'deepseek/deepseek-chat',
|
|
33
|
+
apiKey: process.env.REQUESTY_API_KEY || process.env.ANTHROPIC_API_KEY || '',
|
|
34
|
+
baseURL: process.env.PROXY_URL || undefined
|
|
35
|
+
};
|
|
27
36
|
case 'openrouter':
|
|
28
37
|
return {
|
|
29
38
|
model: process.env.COMPLETION_MODEL || 'deepseek/deepseek-chat',
|
|
@@ -75,6 +84,15 @@ export async function claudeAgent(agent, input, onStream, modelOverride) {
|
|
|
75
84
|
model: finalModel
|
|
76
85
|
});
|
|
77
86
|
}
|
|
87
|
+
else if (provider === 'requesty' && process.env.REQUESTY_API_KEY) {
|
|
88
|
+
// Use ANTHROPIC_BASE_URL if already set by CLI (proxy mode)
|
|
89
|
+
envOverrides.ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || 'proxy-key';
|
|
90
|
+
envOverrides.ANTHROPIC_BASE_URL = process.env.ANTHROPIC_BASE_URL || process.env.REQUESTY_PROXY_URL || 'http://localhost:3000';
|
|
91
|
+
logger.info('Using Requesty proxy', {
|
|
92
|
+
proxyUrl: envOverrides.ANTHROPIC_BASE_URL,
|
|
93
|
+
model: finalModel
|
|
94
|
+
});
|
|
95
|
+
}
|
|
78
96
|
else if (provider === 'openrouter' && process.env.OPENROUTER_API_KEY) {
|
|
79
97
|
// Use ANTHROPIC_BASE_URL if already set by CLI (proxy mode)
|
|
80
98
|
envOverrides.ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || 'proxy-key';
|
|
@@ -103,77 +121,88 @@ export async function claudeAgent(agent, input, onStream, modelOverride) {
|
|
|
103
121
|
try {
|
|
104
122
|
// MCP server setup - enable in-SDK server and optional external servers
|
|
105
123
|
const mcpServers = {};
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
mcpServers
|
|
114
|
-
type: 'stdio',
|
|
115
|
-
command: 'npx',
|
|
116
|
-
args: ['claude-flow@alpha', 'mcp', 'start'],
|
|
117
|
-
env: {
|
|
118
|
-
...process.env,
|
|
119
|
-
MCP_AUTO_START: 'true',
|
|
120
|
-
PROVIDER: provider
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
if (process.env.ENABLE_FLOW_NEXUS_MCP !== 'false') {
|
|
125
|
-
mcpServers['flow-nexus'] = {
|
|
126
|
-
type: 'stdio',
|
|
127
|
-
command: 'npx',
|
|
128
|
-
args: ['flow-nexus@latest', 'mcp', 'start'],
|
|
129
|
-
env: {
|
|
130
|
-
...process.env,
|
|
131
|
-
FLOW_NEXUS_AUTO_START: 'true'
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
if (process.env.ENABLE_AGENTIC_PAYMENTS_MCP !== 'false') {
|
|
136
|
-
mcpServers['agentic-payments'] = {
|
|
137
|
-
type: 'stdio',
|
|
138
|
-
command: 'npx',
|
|
139
|
-
args: ['-y', 'agentic-payments', 'mcp'],
|
|
140
|
-
env: {
|
|
141
|
-
...process.env,
|
|
142
|
-
AGENTIC_PAYMENTS_AUTO_START: 'true'
|
|
143
|
-
}
|
|
144
|
-
};
|
|
124
|
+
// CRITICAL FIX: Disable all MCP servers for Requesty provider
|
|
125
|
+
// The Claude SDK hangs when trying to initialize MCP servers with Requesty
|
|
126
|
+
// This is a fundamental incompatibility - SDK initialization fails before API call
|
|
127
|
+
if (provider === 'requesty') {
|
|
128
|
+
logger.info('⚠️ Requesty provider detected - disabling all MCP servers to prevent hang');
|
|
129
|
+
console.log('⚠️ Requesty: MCP tools disabled (SDK incompatibility)');
|
|
130
|
+
// Skip all MCP server initialization for Requesty
|
|
131
|
+
// Continue with empty mcpServers object
|
|
145
132
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
133
|
+
else {
|
|
134
|
+
// Enable in-SDK MCP server for custom tools (enabled by default)
|
|
135
|
+
if (process.env.ENABLE_CLAUDE_FLOW_SDK !== 'false') {
|
|
136
|
+
mcpServers['claude-flow-sdk'] = claudeFlowSdkServer;
|
|
137
|
+
}
|
|
138
|
+
// External MCP servers (enabled by default for full 213-tool access)
|
|
139
|
+
// Disable by setting ENABLE_CLAUDE_FLOW_MCP=false
|
|
140
|
+
if (process.env.ENABLE_CLAUDE_FLOW_MCP !== 'false') {
|
|
141
|
+
mcpServers['claude-flow'] = {
|
|
142
|
+
type: 'stdio',
|
|
143
|
+
command: 'npx',
|
|
144
|
+
args: ['claude-flow@alpha', 'mcp', 'start'],
|
|
145
|
+
env: {
|
|
146
|
+
...process.env,
|
|
147
|
+
MCP_AUTO_START: 'true',
|
|
148
|
+
PROVIDER: provider
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (process.env.ENABLE_FLOW_NEXUS_MCP !== 'false') {
|
|
153
|
+
mcpServers['flow-nexus'] = {
|
|
154
|
+
type: 'stdio',
|
|
155
|
+
command: 'npx',
|
|
156
|
+
args: ['flow-nexus@latest', 'mcp', 'start'],
|
|
157
|
+
env: {
|
|
158
|
+
...process.env,
|
|
159
|
+
FLOW_NEXUS_AUTO_START: 'true'
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
if (process.env.ENABLE_AGENTIC_PAYMENTS_MCP !== 'false') {
|
|
164
|
+
mcpServers['agentic-payments'] = {
|
|
165
|
+
type: 'stdio',
|
|
166
|
+
command: 'npx',
|
|
167
|
+
args: ['-y', 'agentic-payments', 'mcp'],
|
|
168
|
+
env: {
|
|
169
|
+
...process.env,
|
|
170
|
+
AGENTIC_PAYMENTS_AUTO_START: 'true'
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
// Load MCP servers from user config file (~/.agentic-flow/mcp-config.json)
|
|
175
|
+
try {
|
|
176
|
+
const fs = await import('fs');
|
|
177
|
+
const path = await import('path');
|
|
178
|
+
const os = await import('os');
|
|
179
|
+
const configPath = path.join(os.homedir(), '.agentic-flow', 'mcp-config.json');
|
|
180
|
+
if (fs.existsSync(configPath)) {
|
|
181
|
+
const configContent = fs.readFileSync(configPath, 'utf-8');
|
|
182
|
+
const config = JSON.parse(configContent);
|
|
183
|
+
// Add enabled user-configured servers
|
|
184
|
+
for (const [name, server] of Object.entries(config.servers || {})) {
|
|
185
|
+
const serverConfig = server;
|
|
186
|
+
if (serverConfig.enabled) {
|
|
187
|
+
mcpServers[name] = {
|
|
188
|
+
type: 'stdio',
|
|
189
|
+
command: serverConfig.command,
|
|
190
|
+
args: serverConfig.args || [],
|
|
191
|
+
env: {
|
|
192
|
+
...process.env,
|
|
193
|
+
...serverConfig.env
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
console.log(`[agentic-flow] Loaded MCP server: ${name}`);
|
|
197
|
+
}
|
|
169
198
|
}
|
|
170
199
|
}
|
|
171
200
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
// Silently fail if config doesn't exist or can't be read
|
|
203
|
+
console.log('[agentic-flow] No user MCP config found (this is normal)');
|
|
204
|
+
}
|
|
205
|
+
} // End of provider !== 'requesty' check
|
|
177
206
|
const queryOptions = {
|
|
178
207
|
systemPrompt: agent.systemPrompt,
|
|
179
208
|
model: finalModel, // Claude Agent SDK handles model selection
|
|
@@ -43,6 +43,15 @@ function getProxyConfig(provider, customPort) {
|
|
|
43
43
|
apiKey: process.env.OPENROUTER_API_KEY || '',
|
|
44
44
|
requiresProxy: true
|
|
45
45
|
};
|
|
46
|
+
case 'requesty':
|
|
47
|
+
return {
|
|
48
|
+
provider: 'requesty',
|
|
49
|
+
port,
|
|
50
|
+
baseUrl,
|
|
51
|
+
model: process.env.COMPLETION_MODEL || 'deepseek/deepseek-chat',
|
|
52
|
+
apiKey: process.env.REQUESTY_API_KEY || '',
|
|
53
|
+
requiresProxy: true
|
|
54
|
+
};
|
|
46
55
|
case 'gemini':
|
|
47
56
|
return {
|
|
48
57
|
provider: 'gemini',
|
|
@@ -203,6 +212,9 @@ Examples:
|
|
|
203
212
|
$ agentic-flow claude-code --provider gemini # Uses Gemini 2.0 Flash
|
|
204
213
|
$ agentic-flow claude-code --provider onnx # Uses local ONNX models (free)
|
|
205
214
|
|
|
215
|
+
# With Agent Booster for 57x faster code edits
|
|
216
|
+
$ agentic-flow claude-code --provider openrouter --agent-booster
|
|
217
|
+
|
|
206
218
|
Recommended Models:
|
|
207
219
|
OpenRouter:
|
|
208
220
|
mistralai/mistral-small-3.1-24b-instruct (default, $0.02/M, 128k context, optimized for tools)
|
|
@@ -224,6 +236,7 @@ Documentation:
|
|
|
224
236
|
.option('--provider <provider>', 'AI provider (anthropic, openrouter, gemini, onnx)', 'anthropic')
|
|
225
237
|
.option('--port <port>', 'Proxy server port', '3000')
|
|
226
238
|
.option('--model <model>', 'Specific model to use (e.g., mistralai/mistral-small-3.1-24b-instruct)')
|
|
239
|
+
.option('--agent-booster', 'Enable Agent Booster MCP tools for 57x faster code edits (default: true)', true)
|
|
227
240
|
.option('--keep-proxy', 'Keep proxy running after Claude Code exits')
|
|
228
241
|
.option('--no-auto-start', 'Skip proxy startup (use existing proxy)')
|
|
229
242
|
.allowUnknownOption(true)
|
|
@@ -247,7 +260,7 @@ Documentation:
|
|
|
247
260
|
process.exit(1);
|
|
248
261
|
}
|
|
249
262
|
// Get Claude Code arguments (filter out wrapper-specific flags only)
|
|
250
|
-
const wrapperFlags = new Set(['--provider', '--port', '--model', '--keep-proxy', '--no-auto-start']);
|
|
263
|
+
const wrapperFlags = new Set(['--provider', '--port', '--model', '--agent-booster', '--keep-proxy', '--no-auto-start']);
|
|
251
264
|
const wrapperValues = new Set([options.provider, options.port, options.model]);
|
|
252
265
|
const claudeArgs = [];
|
|
253
266
|
let skipNext = false;
|
|
@@ -283,6 +296,15 @@ Documentation:
|
|
|
283
296
|
}
|
|
284
297
|
let proxyServer = null;
|
|
285
298
|
try {
|
|
299
|
+
// Info about Agent Booster MCP tools if enabled
|
|
300
|
+
if (options.agentBooster) {
|
|
301
|
+
logger.info('');
|
|
302
|
+
logger.info('⚡ Agent Booster enabled (57x faster code edits)');
|
|
303
|
+
logger.info(' Available tools: agent_booster_edit_file, agent_booster_batch_edit, agent_booster_parse_markdown');
|
|
304
|
+
logger.info(' Configure MCP: Add "agentic-flow" to Claude Desktop config');
|
|
305
|
+
logger.info(' Learn more: examples/mcp-integration.md');
|
|
306
|
+
logger.info('');
|
|
307
|
+
}
|
|
286
308
|
// Start proxy if needed and auto-start is enabled
|
|
287
309
|
if (options.autoStart) {
|
|
288
310
|
proxyServer = await startProxyServer(config);
|
package/dist/cli-proxy.js
CHANGED
|
@@ -25,6 +25,7 @@ function loadEnvRecursive(startPath = process.cwd()) {
|
|
|
25
25
|
}
|
|
26
26
|
loadEnvRecursive();
|
|
27
27
|
import { AnthropicToOpenRouterProxy } from "./proxy/anthropic-to-openrouter.js";
|
|
28
|
+
import { AnthropicToRequestyProxy } from "./proxy/anthropic-to-requesty.js";
|
|
28
29
|
import { logger } from "./utils/logger.js";
|
|
29
30
|
import { parseArgs } from "./utils/cli.js";
|
|
30
31
|
import { getAgent, listAgents } from "./utils/agentLoader.js";
|
|
@@ -154,6 +155,8 @@ class AgenticFlowCLI {
|
|
|
154
155
|
const useONNX = this.shouldUseONNX(options);
|
|
155
156
|
const useOpenRouter = this.shouldUseOpenRouter(options);
|
|
156
157
|
const useGemini = this.shouldUseGemini(options);
|
|
158
|
+
// Requesty temporarily disabled - keep proxy files for future use
|
|
159
|
+
const useRequesty = false; // this.shouldUseRequesty(options);
|
|
157
160
|
// Debug output for provider selection
|
|
158
161
|
if (options.verbose || process.env.VERBOSE === 'true') {
|
|
159
162
|
console.log('\n🔍 Provider Selection Debug:');
|
|
@@ -162,16 +165,22 @@ class AgenticFlowCLI {
|
|
|
162
165
|
console.log(` Use ONNX: ${useONNX}`);
|
|
163
166
|
console.log(` Use OpenRouter: ${useOpenRouter}`);
|
|
164
167
|
console.log(` Use Gemini: ${useGemini}`);
|
|
168
|
+
console.log(` Use Requesty: ${useRequesty}`);
|
|
165
169
|
console.log(` OPENROUTER_API_KEY: ${process.env.OPENROUTER_API_KEY ? '✓ set' : '✗ not set'}`);
|
|
166
170
|
console.log(` GOOGLE_GEMINI_API_KEY: ${process.env.GOOGLE_GEMINI_API_KEY ? '✓ set' : '✗ not set'}`);
|
|
171
|
+
console.log(` REQUESTY_API_KEY: ${process.env.REQUESTY_API_KEY ? '✓ set' : '✗ not set'}`);
|
|
167
172
|
console.log(` ANTHROPIC_API_KEY: ${process.env.ANTHROPIC_API_KEY ? '✓ set' : '✗ not set'}\n`);
|
|
168
173
|
}
|
|
169
174
|
try {
|
|
170
|
-
// Start proxy if needed (ONNX, OpenRouter, or
|
|
175
|
+
// Start proxy if needed (ONNX, OpenRouter, Gemini, or Requesty)
|
|
171
176
|
if (useONNX) {
|
|
172
177
|
console.log('🚀 Initializing ONNX local inference proxy...');
|
|
173
178
|
await this.startONNXProxy(options.model);
|
|
174
179
|
}
|
|
180
|
+
else if (useRequesty) {
|
|
181
|
+
console.log('🚀 Initializing Requesty proxy...');
|
|
182
|
+
await this.startRequestyProxy(options.model);
|
|
183
|
+
}
|
|
175
184
|
else if (useOpenRouter) {
|
|
176
185
|
console.log('🚀 Initializing OpenRouter proxy...');
|
|
177
186
|
await this.startOpenRouterProxy(options.model);
|
|
@@ -184,7 +193,7 @@ class AgenticFlowCLI {
|
|
|
184
193
|
console.log('🚀 Using direct Anthropic API...\n');
|
|
185
194
|
}
|
|
186
195
|
// Run agent
|
|
187
|
-
await this.runAgent(options, useOpenRouter, useGemini, useONNX);
|
|
196
|
+
await this.runAgent(options, useOpenRouter, useGemini, useONNX, useRequesty);
|
|
188
197
|
logger.info('Execution completed successfully');
|
|
189
198
|
process.exit(0);
|
|
190
199
|
}
|
|
@@ -227,14 +236,30 @@ class AgenticFlowCLI {
|
|
|
227
236
|
}
|
|
228
237
|
return false;
|
|
229
238
|
}
|
|
239
|
+
shouldUseRequesty(options) {
|
|
240
|
+
// Use Requesty if:
|
|
241
|
+
// 1. Provider is explicitly set to requesty
|
|
242
|
+
// 2. PROVIDER env var is set to requesty
|
|
243
|
+
// 3. USE_REQUESTY env var is set
|
|
244
|
+
if (options.provider === 'requesty' || process.env.PROVIDER === 'requesty') {
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
if (process.env.USE_REQUESTY === 'true') {
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
230
252
|
shouldUseOpenRouter(options) {
|
|
231
|
-
// Don't use OpenRouter if ONNX or
|
|
253
|
+
// Don't use OpenRouter if ONNX, Gemini, or Requesty is explicitly requested
|
|
232
254
|
if (options.provider === 'onnx' || process.env.USE_ONNX === 'true' || process.env.PROVIDER === 'onnx') {
|
|
233
255
|
return false;
|
|
234
256
|
}
|
|
235
257
|
if (options.provider === 'gemini' || process.env.PROVIDER === 'gemini') {
|
|
236
258
|
return false;
|
|
237
259
|
}
|
|
260
|
+
if (options.provider === 'requesty' || process.env.PROVIDER === 'requesty') {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
238
263
|
// Use OpenRouter if:
|
|
239
264
|
// 1. Provider is explicitly set to openrouter
|
|
240
265
|
// 2. Model parameter contains "/" (e.g., "meta-llama/llama-3.1-8b-instruct")
|
|
@@ -326,6 +351,46 @@ class AgenticFlowCLI {
|
|
|
326
351
|
// Wait for proxy to be ready
|
|
327
352
|
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
328
353
|
}
|
|
354
|
+
async startRequestyProxy(modelOverride) {
|
|
355
|
+
const requestyKey = process.env.REQUESTY_API_KEY;
|
|
356
|
+
if (!requestyKey) {
|
|
357
|
+
console.error('❌ Error: REQUESTY_API_KEY required for Requesty models');
|
|
358
|
+
console.error('Set it in .env or export REQUESTY_API_KEY=sk-xxxxx');
|
|
359
|
+
process.exit(1);
|
|
360
|
+
}
|
|
361
|
+
logger.info('Starting integrated Requesty proxy');
|
|
362
|
+
const defaultModel = modelOverride ||
|
|
363
|
+
process.env.COMPLETION_MODEL ||
|
|
364
|
+
process.env.REASONING_MODEL ||
|
|
365
|
+
'deepseek/deepseek-chat';
|
|
366
|
+
const capabilities = detectModelCapabilities(defaultModel);
|
|
367
|
+
const proxy = new AnthropicToRequestyProxy({
|
|
368
|
+
requestyApiKey: requestyKey,
|
|
369
|
+
requestyBaseUrl: process.env.REQUESTY_BASE_URL,
|
|
370
|
+
defaultModel,
|
|
371
|
+
capabilities: capabilities
|
|
372
|
+
});
|
|
373
|
+
// Start proxy in background
|
|
374
|
+
proxy.start(this.proxyPort);
|
|
375
|
+
this.proxyServer = proxy;
|
|
376
|
+
// Set ANTHROPIC_BASE_URL to proxy
|
|
377
|
+
process.env.ANTHROPIC_BASE_URL = `http://localhost:${this.proxyPort}`;
|
|
378
|
+
// Set dummy ANTHROPIC_API_KEY for proxy (actual auth uses REQUESTY_API_KEY)
|
|
379
|
+
if (!process.env.ANTHROPIC_API_KEY) {
|
|
380
|
+
process.env.ANTHROPIC_API_KEY = 'sk-ant-proxy-dummy-key';
|
|
381
|
+
}
|
|
382
|
+
console.log(`🔗 Proxy Mode: Requesty`);
|
|
383
|
+
console.log(`🔧 Proxy URL: http://localhost:${this.proxyPort}`);
|
|
384
|
+
console.log(`🤖 Default Model: ${defaultModel}`);
|
|
385
|
+
if (capabilities.requiresEmulation) {
|
|
386
|
+
console.log(`\n⚙️ Detected: Model lacks native tool support`);
|
|
387
|
+
console.log(`🔧 Using ${capabilities.emulationStrategy.toUpperCase()} emulation pattern`);
|
|
388
|
+
console.log(`📊 Expected reliability: ${capabilities.emulationStrategy === 'react' ? '70-85%' : '50-70%'}`);
|
|
389
|
+
}
|
|
390
|
+
console.log('');
|
|
391
|
+
// Wait for proxy to be ready
|
|
392
|
+
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
393
|
+
}
|
|
329
394
|
async startONNXProxy(modelOverride) {
|
|
330
395
|
logger.info('Starting integrated ONNX local inference proxy');
|
|
331
396
|
console.log('🔧 Provider: ONNX Local (Phi-4-mini)');
|
|
@@ -494,7 +559,7 @@ EXAMPLES:
|
|
|
494
559
|
claude
|
|
495
560
|
`);
|
|
496
561
|
}
|
|
497
|
-
async runAgent(options, useOpenRouter, useGemini, useONNX = false) {
|
|
562
|
+
async runAgent(options, useOpenRouter, useGemini, useONNX = false, useRequesty = false) {
|
|
498
563
|
const agentName = options.agent || process.env.AGENT || '';
|
|
499
564
|
const task = options.task || process.env.TASK || '';
|
|
500
565
|
if (!agentName) {
|
|
@@ -513,7 +578,7 @@ EXAMPLES:
|
|
|
513
578
|
}
|
|
514
579
|
// Check for API key (unless using ONNX)
|
|
515
580
|
const isOnnx = options.provider === 'onnx' || process.env.USE_ONNX === 'true' || process.env.PROVIDER === 'onnx';
|
|
516
|
-
if (!isOnnx && !useOpenRouter && !useGemini && !process.env.ANTHROPIC_API_KEY) {
|
|
581
|
+
if (!isOnnx && !useOpenRouter && !useGemini && !useRequesty && !process.env.ANTHROPIC_API_KEY) {
|
|
517
582
|
console.error('\n❌ Error: ANTHROPIC_API_KEY is required\n');
|
|
518
583
|
console.error('Please set your API key:');
|
|
519
584
|
console.error(' export ANTHROPIC_API_KEY=sk-ant-xxxxx\n');
|
|
@@ -722,6 +787,7 @@ EXAMPLES:
|
|
|
722
787
|
# Agent Execution
|
|
723
788
|
npx agentic-flow --list # List all 150+ agents
|
|
724
789
|
npx agentic-flow --agent coder --task "Create Python hello world"
|
|
790
|
+
npx agentic-flow --agent coder --task "Create REST API" --provider openrouter
|
|
725
791
|
npx agentic-flow --agent coder --task "Create REST API" --model "meta-llama/llama-3.1-8b-instruct"
|
|
726
792
|
npx agentic-flow --agent coder --task "Create code" --provider onnx
|
|
727
793
|
|