agentic-flow 1.0.1 → 1.0.3

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
@@ -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();
@@ -1,7 +1,13 @@
1
1
  // Agent loader for .claude/agents integration
2
- import { readFileSync, readdirSync, statSync } from 'fs';
3
- import { join, extname } from 'path';
2
+ import { readFileSync, readdirSync, statSync, existsSync } from 'fs';
3
+ import { join, extname, dirname } from 'path';
4
+ import { fileURLToPath } from 'url';
4
5
  import { logger } from './logger.js';
6
+ // Get the package root directory
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+ const packageRoot = join(__dirname, '../..');
10
+ const defaultAgentsDir = join(packageRoot, '.claude/agents');
5
11
  /**
6
12
  * Parse agent markdown file with frontmatter
7
13
  */
@@ -75,10 +81,14 @@ function findAgentFiles(dir) {
75
81
  /**
76
82
  * Load all agents from .claude/agents directory
77
83
  */
78
- export function loadAgents(agentsDir = process.env.AGENTS_DIR || '/app/.claude/agents') {
84
+ export function loadAgents(agentsDir) {
79
85
  const agents = new Map();
80
- logger.info('Loading agents from directory', { agentsDir });
81
- const agentFiles = findAgentFiles(agentsDir);
86
+ // Priority: explicit parameter > env var > package default > current working directory
87
+ const targetDir = agentsDir
88
+ || process.env.AGENTS_DIR
89
+ || (existsSync(defaultAgentsDir) ? defaultAgentsDir : join(process.cwd(), '.claude/agents'));
90
+ logger.info('Loading agents from directory', { agentsDir: targetDir });
91
+ const agentFiles = findAgentFiles(targetDir);
82
92
  logger.debug('Found agent files', { count: agentFiles.length });
83
93
  for (const filePath of agentFiles) {
84
94
  const agent = parseAgentFile(filePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-flow",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
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",
@@ -110,9 +110,6 @@
110
110
  "dependencies": {
111
111
  "@anthropic-ai/claude-agent-sdk": "^0.1.5",
112
112
  "@anthropic-ai/sdk": "^0.65.0",
113
- "@huggingface/hub": "^2.6.10",
114
- "@huggingface/inference": "^4.11.0",
115
- "@xenova/transformers": "^2.17.2",
116
113
  "agentic-payments": "^0.1.3",
117
114
  "axios": "^1.12.2",
118
115
  "claude-flow": "^2.0.0",
@@ -120,10 +117,15 @@
120
117
  "express": "^5.1.0",
121
118
  "fastmcp": "^3.19.0",
122
119
  "http-proxy-middleware": "^3.0.5",
123
- "onnxruntime-node": "^1.23.0",
124
120
  "tiktoken": "^1.0.22",
125
121
  "zod": "^3.25.76"
126
122
  },
123
+ "optionalDependencies": {
124
+ "@huggingface/hub": "^2.6.10",
125
+ "@huggingface/inference": "^4.11.0",
126
+ "@xenova/transformers": "^2.17.2",
127
+ "onnxruntime-node": "^1.23.0"
128
+ },
127
129
  "devDependencies": {
128
130
  "@types/express": "^5.0.3",
129
131
  "@types/node": "^20.19.19",