openzoo 0.39.1 → 0.39.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/lib/boxes.js CHANGED
@@ -196,6 +196,8 @@ export async function spawnBox({ name = 'bot', days = 1, vcpu = 2, walletJson, p
196
196
  OPENZOO_BOX: '1',
197
197
  OPENZOO_EXPIRES_UNIX: String(unix),
198
198
  OPENZOO_NO_TUNNEL: '1', // the runpod proxy already fronts it
199
+ OPENZOO_BIND: '0.0.0.0', // else the runpod proxy can't reach :8402
200
+ OPENZOO_TUNNEL_TOKEN: `oz-${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`,
199
201
  ...(walletJson ? { OPENZOO_WALLET_JSON: walletJson } : {}),
200
202
  ...(pubkey ? { OPENZOO_WALLET_PUBKEY: pubkey } : {}),
201
203
  OZ_PODAGENT_B64: podAgentB64(),
@@ -469,6 +469,17 @@ export function startCursorBackend({ port = 8443, models, log = () => {} } = {})
469
469
  return;
470
470
  }
471
471
  log(`cursor-backend: #${conns} ${req.method} ${full} ct=${ct} body=${body.length}b`);
472
+ // HIJACK EnsureSandBox FIRST — before passthrough, or passthrough eats it.
473
+ // MEASURED: with OPENZOO_PASSTHRU=1 set, EnsureSandBox went `-> REAL
474
+ // anthropic (200, 707b)` every time and the app got a real cursorvm pod,
475
+ // never our box. This method (and ONLY this one) must be answered locally
476
+ // with OUR box so Grok Bot's UI wires to our sandbox; everything else
477
+ // still passes through so the app loads normally.
478
+ if (/GrokBotService\/EnsureSandBox/.test(full) && process.env.OZ_HIJACK_POD) {
479
+ respond(req, res, method, models); // encodeForMethod('EnsureSandBox') reads OZ_HIJACK_POD
480
+ log(`cursor-backend: -> HIJACKED EnsureSandBox -> our box`);
481
+ return;
482
+ }
472
483
  // CAPTURE the chat inference request so its schema can be decoded from
473
484
  // REAL bytes (Auto's StreamUnifiedChat). Written once; inspect then build.
474
485
  if (/StreamUnifiedChat/.test(full)) {
package/lib/proxy.js CHANGED
@@ -715,9 +715,17 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
715
715
  }
716
716
  });
717
717
 
718
+ // BIND HOST. Default 127.0.0.1 — the keyless localhost path must never be
719
+ // world-reachable on an ordinary machine. A RunPod box is the exception: its
720
+ // HTTP proxy reaches the container over the pod network, so a localhost bind
721
+ // shows "Initializing…" forever (MEASURED: podagent's 0.0.0.0 ports went
722
+ // Ready, the 127.0.0.1 proxy never did). The box sets OPENZOO_BIND=0.0.0.0
723
+ // AND a tunnel token, so the RunPod-fronted port stays gated exactly like the
724
+ // public tunnel path.
725
+ const bindHost = process.env.OPENZOO_BIND || '127.0.0.1';
718
726
  await new Promise((resolve, reject) => {
719
727
  server.on('error', reject);
720
- server.listen(config.port, '127.0.0.1', resolve);
728
+ server.listen(config.port, bindHost, resolve);
721
729
  });
722
730
 
723
731
  if (!silent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.39.1",
3
+ "version": "0.39.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",