openzoo 0.32.2 → 0.33.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/bin/openzoo.js +1 -1
- package/lib/launch.js +6 -2
- package/lib/proxy.js +20 -2
- package/lib/setup.js +12 -1
- package/package.json +1 -1
package/bin/openzoo.js
CHANGED
|
@@ -19,7 +19,7 @@ usage:
|
|
|
19
19
|
only "Auto". Undo: npx openzoo unblock
|
|
20
20
|
npx openzoo vscode [path] same, for VS Code
|
|
21
21
|
npx openzoo editor [path] whichever is installed (Cursor wins if both)
|
|
22
|
-
npx openzoo claude [dir]
|
|
22
|
+
npx openzoo claude [dir] Claude Code CLI on the zoo (x402 per turn); --desktop for the app
|
|
23
23
|
by default, --terminal for the Claude Code CLI
|
|
24
24
|
npx openzoo launch <cmd> [args] launch a TERMINAL Messages API client
|
|
25
25
|
(claude, aider...) already pointed at the zoo
|
package/lib/launch.js
CHANGED
|
@@ -65,8 +65,12 @@ export async function launchClaude(argv) {
|
|
|
65
65
|
}
|
|
66
66
|
if (!up) { console.error(`openzoo: proxy did not come up on ${base}`); process.exit(1); }
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
// TERMINAL (Claude Code CLI) IS THE DEFAULT — it is the guaranteed-x402 path
|
|
69
|
+
// and honours ANTHROPIC_BASE_URL. --desktop explicitly opens the desktop app
|
|
70
|
+
// (which is OAuth/subscription-bound and may ignore our endpoint).
|
|
71
|
+
const wantDesktop = argv.includes('--desktop');
|
|
72
|
+
const terminal = !wantDesktop;
|
|
73
|
+
const rest = argv.filter((a) => !['--terminal', '-t', '--desktop'].includes(a));
|
|
70
74
|
const env = {
|
|
71
75
|
...process.env,
|
|
72
76
|
ANTHROPIC_BASE_URL: base,
|
package/lib/proxy.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
1
|
+
import { readFileSync, appendFileSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
2
4
|
import http from 'node:http';
|
|
3
5
|
import crypto from 'node:crypto';
|
|
4
6
|
import { Readable } from 'node:stream';
|
|
@@ -273,7 +275,23 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
|
|
|
273
275
|
// terminal sat blank and there was no way to tell a working setup from an editor
|
|
274
276
|
// quietly answering from its own backend. Traffic and receipts are the whole
|
|
275
277
|
// point of watching this window; they are never silenced.
|
|
276
|
-
|
|
278
|
+
// ALWAYS-ON, BUT NEVER INTO A HARNESS'S TERMINAL. `silent` means another
|
|
279
|
+
// process (openzoo claude, the editor launcher) owns stdio — printing request
|
|
280
|
+
// lines / payment receipts there corrupts that program's output (observed: the
|
|
281
|
+
// Solana receipt leaking into the Claude Code CLI). When silent, route this
|
|
282
|
+
// channel to a log file instead; only print to the console when we own it.
|
|
283
|
+
let sayFile = null;
|
|
284
|
+
if (silent) {
|
|
285
|
+
try {
|
|
286
|
+
sayFile = path.join(os.homedir(), '.openzoo', 'proxy.log');
|
|
287
|
+
mkdirSync(path.dirname(sayFile), { recursive: true });
|
|
288
|
+
} catch { sayFile = null; }
|
|
289
|
+
}
|
|
290
|
+
const say = (...a) => {
|
|
291
|
+
const line = a.join(' ');
|
|
292
|
+
if (sayFile) { try { appendFileSync(sayFile, line + '\n'); return; } catch { /* fall through */ } }
|
|
293
|
+
console.log(line);
|
|
294
|
+
};
|
|
277
295
|
let sessionSpent = 0;
|
|
278
296
|
let tunnelSpent = 0;
|
|
279
297
|
// Live balance refresh state — the real implementation is assigned in the
|
package/lib/setup.js
CHANGED
|
@@ -556,7 +556,18 @@ export async function setupEditor(which, target) {
|
|
|
556
556
|
const args = [cwd];
|
|
557
557
|
// Trust our self-signed impersonation cert without any CA install — this flag
|
|
558
558
|
// is the entire reason no trust prompt is needed. Only added under --takeover.
|
|
559
|
-
if (doTakeover)
|
|
559
|
+
if (doTakeover) {
|
|
560
|
+
// DEFEAT DNS-OVER-HTTPS. /etc/hosts is ignored by Chromium's Secure DNS, so
|
|
561
|
+
// the agent chat connection (network-service, DoH) escaped even with every
|
|
562
|
+
// host blocked — measured: 0 backend lines on chat while api2 (renderer
|
|
563
|
+
// fetch, OS resolver) hit us fine. --host-resolver-rules overrides Chromium's
|
|
564
|
+
// resolver directly, DoH included, and takes a WILDCARD so every region /
|
|
565
|
+
// privacy variant of *.api5.cursor.sh maps to us without enumerating them.
|
|
566
|
+
args.unshift(
|
|
567
|
+
'--ignore-certificate-errors',
|
|
568
|
+
'--host-resolver-rules=MAP api2.cursor.sh 127.0.0.1,MAP *.api5.cursor.sh 127.0.0.1',
|
|
569
|
+
);
|
|
570
|
+
}
|
|
560
571
|
if (useProfile) {
|
|
561
572
|
fs.mkdirSync(PROFILE_DIR, { recursive: true });
|
|
562
573
|
args.unshift(`--user-data-dir=${PROFILE_DIR}`, `--extensions-dir=${path.join(PROFILE_DIR, 'extensions')}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|