@the-agenticflow/openflows 0.1.8 → 0.1.10
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/.env.example +10 -8
- package/bin/openflows.js +15 -11
- package/package.json +1 -1
- package/scripts/install.js +7 -1
package/.env.example
CHANGED
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
# Quick Start Options:
|
|
5
5
|
# ===================
|
|
6
6
|
#
|
|
7
|
-
# Option 1:
|
|
8
|
-
#
|
|
9
|
-
# Get your key from: https://fireworks.ai
|
|
10
|
-
FIREWORKS_API_KEY=your-fireworks-api-key
|
|
11
|
-
|
|
12
|
-
# Option 2: Anthropic Direct
|
|
13
|
-
# --------------------------
|
|
7
|
+
# Option 1: Anthropic Direct (Recommended - no proxy needed)
|
|
8
|
+
# ---------------------------------------------------------
|
|
14
9
|
# Get your key from: https://console.anthropic.com
|
|
15
|
-
|
|
10
|
+
ANTHROPIC_API_KEY=your-anthropic-api-key
|
|
11
|
+
|
|
12
|
+
# Option 2: Fireworks AI (proxy auto-starts for Claude CLI agents)
|
|
13
|
+
# ----------------------------------------------------------------
|
|
14
|
+
# Get your key from: https://fireworks.ai
|
|
15
|
+
# FIREWORKS_API_KEY=your-fireworks-api-key
|
|
16
|
+
# NOTE: Fireworks doesn't have a native Anthropic endpoint,
|
|
17
|
+
# so the proxy auto-starts to translate Anthropic→OpenAI for Claude CLI
|
|
16
18
|
|
|
17
19
|
# Option 3: Custom Gateway (requires built-in proxy)
|
|
18
20
|
# --------------------------------------------------
|
package/bin/openflows.js
CHANGED
|
@@ -40,23 +40,23 @@ function isPortInUse(port) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// Check if user needs proxy (
|
|
43
|
+
// Check if user needs proxy (for LLM API translation if needed)
|
|
44
44
|
function needsProxy() {
|
|
45
45
|
// If user explicitly set PROXY_URL, respect it
|
|
46
46
|
if (process.env.PROXY_URL) {
|
|
47
47
|
return { needed: false, reason: 'PROXY_URL already set' };
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
// If user has Fireworks API key, they can use it directly
|
|
51
|
-
if (process.env.FIREWORKS_API_KEY) {
|
|
52
|
-
return { needed: false, reason: 'Fireworks direct mode' };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
50
|
// If user has Anthropic API key, they can use it directly
|
|
56
51
|
if (process.env.ANTHROPIC_API_KEY) {
|
|
57
52
|
return { needed: false, reason: 'Anthropic direct mode' };
|
|
58
53
|
}
|
|
59
54
|
|
|
55
|
+
// Fireworks users need proxy for Claude CLI agents (no native Anthropic endpoint)
|
|
56
|
+
if (process.env.FIREWORKS_API_KEY) {
|
|
57
|
+
return { needed: true, reason: 'Fireworks requires proxy for Claude CLI compatibility' };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
60
|
// If user has Gateway config but no direct keys, they need proxy
|
|
61
61
|
if (process.env.GATEWAY_URL || process.env.GATEWAY_API_KEY) {
|
|
62
62
|
return { needed: true, reason: 'Gateway configured, no direct keys' };
|
|
@@ -70,7 +70,7 @@ function needsProxy() {
|
|
|
70
70
|
async function startProxy() {
|
|
71
71
|
console.log('[openflows] Starting built-in API proxy...');
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
let proxyBinary = path.join(__dirname, '..', 'bin', 'anthropic-proxy-bin');
|
|
74
74
|
|
|
75
75
|
// Check if proxy binary exists
|
|
76
76
|
if (!fs.existsSync(proxyBinary)) {
|
|
@@ -80,6 +80,7 @@ async function startProxy() {
|
|
|
80
80
|
console.log('[openflows] No built-in proxy found, skipping proxy startup');
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
83
|
+
proxyBinary = altProxy;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
const proxy = spawn(proxyBinary, [], {
|
|
@@ -175,15 +176,18 @@ Commands:
|
|
|
175
176
|
openflows-dashboard Live monitoring TUI
|
|
176
177
|
openflows-doctor Diagnostic checks
|
|
177
178
|
|
|
178
|
-
Environment Variables:
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
Environment Variables:
|
|
180
|
+
ANTHROPIC_API_KEY Use Anthropic directly (no proxy needed)
|
|
181
|
+
FIREWORKS_API_KEY Use Fireworks AI (proxy auto-starts for Claude CLI)
|
|
181
182
|
GATEWAY_URL Custom gateway URL (requires proxy)
|
|
182
183
|
GATEWAY_API_KEY Custom gateway API key
|
|
183
184
|
PROXY_PORT Port for built-in proxy (default: 8765)
|
|
184
185
|
|
|
185
186
|
Examples:
|
|
186
|
-
# Quick start with
|
|
187
|
+
# Quick start with Anthropic (no proxy needed)
|
|
188
|
+
ANTHROPIC_API_KEY=your-key openflows
|
|
189
|
+
|
|
190
|
+
# Use Fireworks (proxy auto-starts for Claude CLI agents)
|
|
187
191
|
FIREWORKS_API_KEY=your-key openflows
|
|
188
192
|
|
|
189
193
|
# Use custom gateway (proxy auto-starts)
|
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -292,7 +292,7 @@ async function main() {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
// Rename binaries to match expected names
|
|
295
|
-
const binaries = ['agentflow', 'agentflow-setup', 'agentflow-dashboard', 'agentflow-doctor'];
|
|
295
|
+
const binaries = ['agentflow', 'agentflow-setup', 'agentflow-dashboard', 'agentflow-doctor', 'anthropic-proxy'];
|
|
296
296
|
for (const bin of binaries) {
|
|
297
297
|
const src = path.join(BIN_DIR, bin);
|
|
298
298
|
const dst = path.join(BIN_DIR, `${bin}-bin`);
|
|
@@ -301,6 +301,12 @@ async function main() {
|
|
|
301
301
|
fs.chmodSync(dst, 0o755);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
+
|
|
305
|
+
// Also ensure anthropic-proxy is executable even if not renamed
|
|
306
|
+
const proxyBin = path.join(BIN_DIR, 'anthropic-proxy');
|
|
307
|
+
if (fs.existsSync(proxyBin)) {
|
|
308
|
+
fs.chmodSync(proxyBin, 0o755);
|
|
309
|
+
}
|
|
304
310
|
|
|
305
311
|
if (fs.existsSync(tmpFile)) {
|
|
306
312
|
fs.unlinkSync(tmpFile);
|