agentic-flow 1.1.8 → 1.1.9
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 +54 -3
- package/dist/utils/math.js +13 -0
- package/docs/.claude-flow/metrics/performance.json +1 -1
- package/docs/.claude-flow/metrics/task-metrics.json +3 -3
- package/package.json +1 -1
- /package/docs/{ONNX_CLI_USAGE.md → guides/ONNX_CLI_USAGE.md} +0 -0
- /package/docs/{ONNX_ENV_VARS.md → guides/ONNX_ENV_VARS.md} +0 -0
- /package/docs/{ONNX_INTEGRATION.md → guides/ONNX_INTEGRATION.md} +0 -0
- /package/docs/{ONNX_OPTIMIZATION_GUIDE.md → guides/ONNX_OPTIMIZATION_GUIDE.md} +0 -0
- /package/docs/{ONNX_OPTIMIZATION_SUMMARY.md → guides/ONNX_OPTIMIZATION_SUMMARY.md} +0 -0
- /package/docs/{ONNX_VS_CLAUDE_QUALITY.md → guides/ONNX_VS_CLAUDE_QUALITY.md} +0 -0
- /package/docs/{OPENROUTER_DEPLOYMENT.md → guides/OPENROUTER_DEPLOYMENT.md} +0 -0
- /package/docs/{OPTIMIZATION_SUMMARY.md → guides/OPTIMIZATION_SUMMARY.md} +0 -0
- /package/docs/{PROVIDER_INSTRUCTION_OPTIMIZATION.md → guides/PROVIDER_INSTRUCTION_OPTIMIZATION.md} +0 -0
- /package/docs/{TOOL_INSTRUCTION_ENHANCEMENT.md → guides/TOOL_INSTRUCTION_ENHANCEMENT.md} +0 -0
- /package/docs/{TOP20_MODELS_MATRIX.md → router/TOP20_MODELS_MATRIX.md} +0 -0
- /package/docs/{COMPLETE_VALIDATION_SUMMARY.md → validation/COMPLETE_VALIDATION_SUMMARY.md} +0 -0
- /package/docs/{FINAL_SDK_VALIDATION.md → validation/FINAL_SDK_VALIDATION.md} +0 -0
- /package/docs/{MCP_INTEGRATION_SUCCESS.md → validation/MCP_INTEGRATION_SUCCESS.md} +0 -0
- /package/docs/{SDK_INTEGRATION_COMPLETE.md → validation/SDK_INTEGRATION_COMPLETE.md} +0 -0
- /package/docs/{VALIDATION_COMPLETE.md → validation/VALIDATION_COMPLETE.md} +0 -0
- /package/docs/{VALIDATION_SUMMARY.md → validation/VALIDATION_SUMMARY.md} +0 -0
package/dist/cli-proxy.js
CHANGED
|
@@ -106,10 +106,29 @@ class AgenticFlowCLI {
|
|
|
106
106
|
// Determine which provider to use
|
|
107
107
|
const useOpenRouter = this.shouldUseOpenRouter(options);
|
|
108
108
|
const useGemini = this.shouldUseGemini(options);
|
|
109
|
+
// Debug output for provider selection
|
|
110
|
+
if (options.verbose || process.env.VERBOSE === 'true') {
|
|
111
|
+
console.log('\n🔍 Provider Selection Debug:');
|
|
112
|
+
console.log(` Provider flag: ${options.provider || 'not set'}`);
|
|
113
|
+
console.log(` Model: ${options.model || 'default'}`);
|
|
114
|
+
console.log(` Use OpenRouter: ${useOpenRouter}`);
|
|
115
|
+
console.log(` Use Gemini: ${useGemini}`);
|
|
116
|
+
console.log(` OPENROUTER_API_KEY: ${process.env.OPENROUTER_API_KEY ? '✓ set' : '✗ not set'}`);
|
|
117
|
+
console.log(` GOOGLE_GEMINI_API_KEY: ${process.env.GOOGLE_GEMINI_API_KEY ? '✓ set' : '✗ not set'}`);
|
|
118
|
+
console.log(` ANTHROPIC_API_KEY: ${process.env.ANTHROPIC_API_KEY ? '✓ set' : '✗ not set'}\n`);
|
|
119
|
+
}
|
|
109
120
|
try {
|
|
110
|
-
// Start proxy if needed (OpenRouter
|
|
121
|
+
// Start proxy if needed (OpenRouter or Gemini)
|
|
111
122
|
if (useOpenRouter) {
|
|
112
|
-
|
|
123
|
+
console.log('🚀 Initializing OpenRouter proxy...');
|
|
124
|
+
await this.startOpenRouterProxy(options.model);
|
|
125
|
+
}
|
|
126
|
+
else if (useGemini) {
|
|
127
|
+
console.log('🚀 Initializing Gemini proxy...');
|
|
128
|
+
await this.startGeminiProxy(options.model);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
console.log('🚀 Using direct Anthropic API...\n');
|
|
113
132
|
}
|
|
114
133
|
// Run agent
|
|
115
134
|
await this.runAgent(options, useOpenRouter, useGemini);
|
|
@@ -169,7 +188,7 @@ class AgenticFlowCLI {
|
|
|
169
188
|
}
|
|
170
189
|
return false;
|
|
171
190
|
}
|
|
172
|
-
async
|
|
191
|
+
async startOpenRouterProxy(modelOverride) {
|
|
173
192
|
const openrouterKey = process.env.OPENROUTER_API_KEY;
|
|
174
193
|
if (!openrouterKey) {
|
|
175
194
|
console.error('❌ Error: OPENROUTER_API_KEY required for OpenRouter models');
|
|
@@ -201,6 +220,38 @@ class AgenticFlowCLI {
|
|
|
201
220
|
// Wait for proxy to be ready
|
|
202
221
|
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
203
222
|
}
|
|
223
|
+
async startGeminiProxy(modelOverride) {
|
|
224
|
+
const geminiKey = process.env.GOOGLE_GEMINI_API_KEY;
|
|
225
|
+
if (!geminiKey) {
|
|
226
|
+
console.error('❌ Error: GOOGLE_GEMINI_API_KEY required for Gemini models');
|
|
227
|
+
console.error('Set it in .env or export GOOGLE_GEMINI_API_KEY=xxxxx');
|
|
228
|
+
process.exit(1);
|
|
229
|
+
}
|
|
230
|
+
logger.info('Starting integrated Gemini proxy');
|
|
231
|
+
const defaultModel = modelOverride ||
|
|
232
|
+
process.env.COMPLETION_MODEL ||
|
|
233
|
+
'gemini-2.0-flash-exp';
|
|
234
|
+
// Import Gemini proxy
|
|
235
|
+
const { AnthropicToGeminiProxy } = await import('./proxy/anthropic-to-gemini.js');
|
|
236
|
+
const proxy = new AnthropicToGeminiProxy({
|
|
237
|
+
geminiApiKey: geminiKey,
|
|
238
|
+
defaultModel
|
|
239
|
+
});
|
|
240
|
+
// Start proxy in background
|
|
241
|
+
proxy.start(this.proxyPort);
|
|
242
|
+
this.proxyServer = proxy;
|
|
243
|
+
// Set ANTHROPIC_BASE_URL to proxy
|
|
244
|
+
process.env.ANTHROPIC_BASE_URL = `http://localhost:${this.proxyPort}`;
|
|
245
|
+
// Set dummy ANTHROPIC_API_KEY for proxy (actual auth uses GOOGLE_GEMINI_API_KEY)
|
|
246
|
+
if (!process.env.ANTHROPIC_API_KEY) {
|
|
247
|
+
process.env.ANTHROPIC_API_KEY = 'sk-ant-proxy-dummy-key';
|
|
248
|
+
}
|
|
249
|
+
console.log(`🔗 Proxy Mode: Google Gemini`);
|
|
250
|
+
console.log(`🔧 Proxy URL: http://localhost:${this.proxyPort}`);
|
|
251
|
+
console.log(`🤖 Default Model: ${defaultModel}\n`);
|
|
252
|
+
// Wait for proxy to be ready
|
|
253
|
+
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
254
|
+
}
|
|
204
255
|
async runAgent(options, useOpenRouter, useGemini) {
|
|
205
256
|
const agentName = options.agent || process.env.AGENT || '';
|
|
206
257
|
const task = options.task || process.env.TASK || '';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple math utility functions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Adds 2 and 2 together
|
|
6
|
+
* @returns The sum of 2 + 2
|
|
7
|
+
* @example
|
|
8
|
+
* const result = addTwoPlusTwo();
|
|
9
|
+
* console.log(result); // Output: 4
|
|
10
|
+
*/
|
|
11
|
+
export const addTwoPlusTwo = () => {
|
|
12
|
+
return 2 + 2;
|
|
13
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"id": "cmd-hooks-
|
|
3
|
+
"id": "cmd-hooks-1759642767270",
|
|
4
4
|
"type": "hooks",
|
|
5
5
|
"success": true,
|
|
6
|
-
"duration":
|
|
7
|
-
"timestamp":
|
|
6
|
+
"duration": 7.410388000000012,
|
|
7
|
+
"timestamp": 1759642767278,
|
|
8
8
|
"metadata": {}
|
|
9
9
|
}
|
|
10
10
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-flow",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
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",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/docs/{PROVIDER_INSTRUCTION_OPTIMIZATION.md → guides/PROVIDER_INSTRUCTION_OPTIMIZATION.md}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|