openzoo 0.18.10 → 0.18.11

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/setup.js +20 -17
  2. package/package.json +1 -1
package/lib/setup.js CHANGED
@@ -152,24 +152,27 @@ export async function setupEditor(which, target) {
152
152
  const started = await startProxy({ silent: true, autoTunnel: true });
153
153
  publicUrl = started?.publicUrl ?? null;
154
154
  tunnelKey = started?.tunnelToken ?? null;
155
- // Wait for cloudflared to publish the URL. It downloads on first run and
156
- // routinely takes 30-45s; a 10s wait meant the tunnel line simply never
157
- // printed and the user never learned the public URL existed.
158
- process.stdout.write('waiting for tunnel');
159
- let tunnelErr = null;
160
- for (let i = 0; i < 120 && !publicUrl; i++) {
161
- await new Promise((r) => setTimeout(r, 500));
162
- publicUrl = started?.publicUrl ?? null;
163
- tunnelKey = started?.tunnelToken ?? null;
164
- // Bail the moment it FAILS. Polling to the full timeout on a dead tunnel
165
- // just looks like a hang — and silent:true hides the proxy's own error.
166
- tunnelErr = started?.tunnelError ?? null;
167
- if (tunnelErr) break;
168
- if (i % 4 === 3) process.stdout.write('.');
155
+ // DO NOT BLOCK ON THE TUNNEL. Everything below (settings, MCP, launching
156
+ // the editor) is local and works without it; only a CLOUD-run harness needs
157
+ // the public URL. Waiting inline meant a slow or failing cloudflared left
158
+ // the user staring at "waiting for tunnel.." while nothing else happened —
159
+ // and if it never came up, the editor never launched at all. Announce it
160
+ // when it arrives instead.
161
+ if (!publicUrl) {
162
+ const started0 = started;
163
+ (async () => {
164
+ for (let i = 0; i < 240; i++) { // up to 2 min, in the background
165
+ await new Promise((r) => setTimeout(r, 500));
166
+ if (started0?.publicUrl) {
167
+ console.log('');
168
+ console.log(`tunnel: ${started0.publicUrl}/v1 api_key ${started0.tunnelToken}`);
169
+ console.log(' (for a cloud-run harness — it cannot reach localhost)');
170
+ return;
171
+ }
172
+ }
173
+ console.log('tunnel: still not up — localhost is unaffected; OPENZOO_NO_TUNNEL=1 to skip it');
174
+ })();
169
175
  }
170
- if (publicUrl) process.stdout.write(' ok\n');
171
- else if (tunnelErr) process.stdout.write(` failed: ${tunnelErr}\n (localhost still works; OPENZOO_NO_TUNNEL=1 skips this)\n`);
172
- else process.stdout.write(' timed out — carrying on; it will print here if it comes up later\n');
173
176
  } else {
174
177
  console.log(`proxy already running on ${base}`);
175
178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.18.10",
3
+ "version": "0.18.11",
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",