openzoo 0.32.2 → 0.32.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.
Files changed (2) hide show
  1. package/lib/proxy.js +20 -2
  2. package/package.json +1 -1
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
- const say = (...a) => console.log(...a);
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.32.2",
3
+ "version": "0.32.3",
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",