openzoo 0.38.3 → 0.38.4

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/grokbot.js +15 -2
  2. package/package.json +1 -1
package/lib/grokbot.js CHANGED
@@ -15,7 +15,7 @@
15
15
  // payment. Pointing base_url at the gateway makes every request fail
16
16
  // "payment required".
17
17
 
18
- import { spawn } from 'node:child_process';
18
+ import { spawn, execSync } from 'node:child_process';
19
19
  import { existsSync, readFileSync, writeFileSync, copyFileSync, mkdirSync } from 'node:fs';
20
20
  import { homedir } from 'node:os';
21
21
  import { join } from 'node:path';
@@ -162,12 +162,25 @@ export async function setupGrokBot(argv = []) {
162
162
  const { startCursorBackend } = await import('./cursorbackend.js');
163
163
  const port = 8443;
164
164
  process.env.OPENZOO_BYOK = '1';
165
+ // LOUD BY DEFAULT. The previous run failed silently — "listening" and then
166
+ // nothing — and silence looked identical to success. Every arriving method
167
+ // is printed so "did it connect at all" is answerable at a glance.
165
168
  startCursorBackend({ port, log: (m) => console.error(` backend: ${m}`) });
166
169
  console.error('openzoo: BYOK probe — impersonating api2.cursor.sh on :' + port);
167
170
  console.error(' scoped to this launch only (no /etc/hosts, no sudo)');
168
171
  console.error(' WATCH: if StreamChat starts arriving at the proxy, inference moved.');
169
172
  console.error(' If only a BYOK settings pane appears, it is xAI-key-only and buys nothing.');
170
- spawn('open', ['-a', APP, '--args',
173
+ // QUIT FIRST — `open -a X --args` is a NO-OP ON A RUNNING APP.
174
+ // macOS just activates the existing instance and drops the args, so the
175
+ // resolver rule never applies and the app keeps talking to the real
176
+ // api2.cursor.sh. MEASURED: the backend logged "listening" and then zero
177
+ // requests, while the app carried on answering normally.
178
+ try {
179
+ execSync('osascript -e \'tell application "Grok Bot" to quit\'', { stdio: 'ignore' });
180
+ } catch { /* not running is fine */ }
181
+ // give it a moment to actually exit before relaunching
182
+ await new Promise((r) => setTimeout(r, 2500));
183
+ spawn('open', ['-n', '-a', APP, '--args',
171
184
  '--ignore-certificate-errors',
172
185
  `--host-resolver-rules=MAP api2.cursor.sh 127.0.0.1:${port}`,
173
186
  ], { stdio: 'ignore', detached: true }).unref();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.38.3",
3
+ "version": "0.38.4",
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",