openzoo 0.34.0 → 0.34.1

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/launch.js +11 -4
  2. package/package.json +1 -1
package/lib/launch.js CHANGED
@@ -180,11 +180,18 @@ export async function launchClaude(argv) {
180
180
  }
181
181
 
182
182
  if (process.platform === 'darwin') {
183
- // Quit a running instance so the fresh one is not killed by the single-
184
- // instance lock, and so it re-resolves api.anthropic.com to us on launch.
183
+ // Quit a running instance and WAIT until it is actually gone. A fixed 800ms
184
+ // wait raced the single-instance lock Claude was still releasing its file
185
+ // locks (LOCK errors), so the fresh spawn saw a live instance and exited
186
+ // immediately ("didn't launch at all"). Poll pgrep until clear, up to ~6s.
185
187
  try { spawnSync('osascript', ['-e', 'tell application "Claude" to quit'], { stdio: 'ignore', timeout: 4000 }); } catch { /* not running */ }
186
- try { spawnSync('pkill', ['-x', 'Claude'], { stdio: 'ignore' }); } catch { /* already gone */ }
187
- await new Promise((r) => setTimeout(r, 800));
188
+ for (let i = 0; i < 24; i++) {
189
+ const r = spawnSync('pgrep', ['-x', 'Claude'], { encoding: 'utf8' });
190
+ if (!r.stdout || !r.stdout.trim()) break; // gone
191
+ if (i === 8) { try { spawnSync('pkill', ['-9', '-x', 'Claude'], { stdio: 'ignore' }); } catch { /* */ } }
192
+ await new Promise((res) => setTimeout(res, 250));
193
+ }
194
+ await new Promise((r) => setTimeout(r, 400)); // let the lock file release
188
195
  }
189
196
  // Chromium flags: accept the self-signed cert, and MAP the Anthropic hosts to
190
197
  // us at the resolver level (defeats DoH, which ignores /etc/hosts).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
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",