openzoo 0.14.0 → 0.14.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/setup.js +28 -1
  2. package/package.json +1 -1
package/lib/setup.js CHANGED
@@ -13,6 +13,7 @@
13
13
  import fs from 'node:fs';
14
14
  import os from 'node:os';
15
15
  import path from 'node:path';
16
+ import { spawn } from 'node:child_process';
16
17
  import { config } from './config.js';
17
18
 
18
19
  const CURSOR_MCP = path.join(os.homedir(), '.cursor', 'mcp.json');
@@ -55,5 +56,31 @@ export function setupEditor(which = 'cursor') {
55
56
  console.log(' Turn OFF the built-in models (Composer/GPT/Cursor-Grok) while the');
56
57
  console.log(' override is on — those only resolve against Cursor\'s own backend.');
57
58
  console.log('');
58
- console.log(`3. Make sure the proxy is running: npx openzoo (${base})`);
59
+ console.log(`3. Proxy: ${base} (start with: npx openzoo)`);
60
+ console.log('');
61
+
62
+ // OPEN THE EDITOR. The whole point of `openzoo cursor` is to end up IN the
63
+ // editor — printing instructions and exiting made the user do the launching
64
+ // themselves. Env vars are set for the child so any terminal the editor
65
+ // spawns inherits the zoo, and `open -a` is used on macOS because Cursor is
66
+ // a GUI .app, not a binary on PATH.
67
+ const env = {
68
+ ...process.env,
69
+ OPENAI_BASE_URL: base,
70
+ OPENAI_API_KEY: process.env.OPENAI_API_KEY || 'sk-openzoo',
71
+ ANTHROPIC_BASE_URL: base,
72
+ ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY || 'sk-openzoo',
73
+ };
74
+ const app = which === 'vscode' ? 'Visual Studio Code' : 'Cursor';
75
+ const cwd = process.argv[3] && !process.argv[3].startsWith('-') ? process.argv[3] : '.';
76
+ console.log(`opening ${app}...`);
77
+ const child = process.platform === 'darwin'
78
+ ? spawn('open', ['-a', app, cwd], { stdio: 'inherit', env })
79
+ : spawn(which === 'vscode' ? 'code' : 'cursor', [cwd], { stdio: 'inherit', env, detached: true });
80
+ child.on('error', (e) => {
81
+ console.error(`could not open ${app}: ${e.message}`);
82
+ console.error(process.platform === 'darwin'
83
+ ? `try: open -a "${app}" .`
84
+ : `is the \`${which === 'vscode' ? 'code' : 'cursor'}\` command on PATH? (editor: Shell Command: Install '${which === 'vscode' ? 'code' : 'cursor'}' command)`);
85
+ });
59
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.14.0",
3
+ "version": "0.14.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",