openzoo 0.18.5 → 0.18.7
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/bin/openzoo.js +2 -0
- package/lib/setup.js +79 -4
- package/package.json +1 -1
package/bin/openzoo.js
CHANGED
|
@@ -8,6 +8,8 @@ usage:
|
|
|
8
8
|
public HTTPS url for cloud IDEs (key required, printed at start)
|
|
9
9
|
npx openzoo cursor [path] start proxy+tunnel, write MCP config, and LAUNCH
|
|
10
10
|
Cursor already pointed at the zoo (env inherited)
|
|
11
|
+
--profile use an isolated editor profile the
|
|
12
|
+
vendor account cannot re-sync over
|
|
11
13
|
npx openzoo vscode [path] same, for VS Code
|
|
12
14
|
npx openzoo editor [path] whichever is installed (Cursor wins if both)
|
|
13
15
|
npx openzoo launch <cmd> [args] launch a TERMINAL Messages API client
|
package/lib/setup.js
CHANGED
|
@@ -22,7 +22,42 @@ import { spawn } from 'node:child_process';
|
|
|
22
22
|
import { config } from './config.js';
|
|
23
23
|
import { writeEditorProviderConfig, editorRunning, quitEditor, pinEditorProviderConfig } from './cursorcfg.js';
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Models offered in the editor's picker. All verified present in the live
|
|
27
|
+
* catalog; the first is the default selection. A spread across vendors and
|
|
28
|
+
* price tiers on purpose — the picker is where someone chooses cost, and one
|
|
29
|
+
* flagship plus one cheap model is not a choice.
|
|
30
|
+
* Override with OPENZOO_MODELS (comma-separated).
|
|
31
|
+
*/
|
|
32
|
+
const DEFAULT_MODELS = (process.env.OPENZOO_MODELS
|
|
33
|
+
? process.env.OPENZOO_MODELS.split(',').map((m) => m.trim()).filter(Boolean)
|
|
34
|
+
: [
|
|
35
|
+
'anthropic/claude-opus-5', // default — strongest reasoning
|
|
36
|
+
'anthropic/claude-sonnet-4',
|
|
37
|
+
'openai/gpt-5.6-sol-pro', // flagship, ~$90/M out
|
|
38
|
+
'openai/gpt-5.6-luna',
|
|
39
|
+
'x-ai/grok-4.6',
|
|
40
|
+
'z-ai/glm-5.2',
|
|
41
|
+
'google/gemini-3.1-pro-preview-customtools',
|
|
42
|
+
'deepseek/deepseek-v4-pro-0813', // ~34x cheaper output than the flagship
|
|
43
|
+
'qwen/qwen3.8-2.4t-a95b',
|
|
44
|
+
'moonshotai/kimi-k2-0905',
|
|
45
|
+
'meta-llama/llama-4-maverick',
|
|
46
|
+
'bytedance-seed/seed-2.0-code', // code specialist
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* An ISOLATED editor profile we own.
|
|
51
|
+
*
|
|
52
|
+
* The editor's normal profile syncs provider settings from the vendor account
|
|
53
|
+
* and overwrites local state on launch — measured repeatedly. `--user-data-dir`
|
|
54
|
+
* gives it a profile directory we control, so our settings are the only ones
|
|
55
|
+
* there and nothing upstream reclaims them. Opt in with OPENZOO_PROFILE=1 (or
|
|
56
|
+
* --profile) because a fresh profile means signing in again and re-adding
|
|
57
|
+
* extensions; that is a real cost, not a detail to spring on someone.
|
|
58
|
+
*/
|
|
59
|
+
const PROFILE_DIR = process.env.OPENZOO_PROFILE_DIR
|
|
60
|
+
|| path.join(os.homedir(), '.openzoo', 'editor-profile');
|
|
26
61
|
|
|
27
62
|
const MCP_FILES = {
|
|
28
63
|
cursor: path.join(os.homedir(), '.cursor', 'mcp.json'),
|
|
@@ -195,15 +230,55 @@ export async function setupEditor(which, target) {
|
|
|
195
230
|
|
|
196
231
|
// 3. LAUNCH with that env. Editor resolved platform-agnostically; Cursor
|
|
197
232
|
// wins when both are installed.
|
|
198
|
-
|
|
233
|
+
// WORKSPACE, NOT WHEREVER YOU RAN THIS. Launching with '.' opens the current
|
|
234
|
+
// directory as the workspace — and running from $HOME makes the editor treat
|
|
235
|
+
// ~/.cursor as WORKSPACE config, where a stray rules/mcp file fights the
|
|
236
|
+
// global settings we just wrote. A dedicated folder has no local config to
|
|
237
|
+
// collide with. Pass a path explicitly to override.
|
|
238
|
+
let cwd = target && !target.startsWith('-') ? target : null;
|
|
239
|
+
if (!cwd) {
|
|
240
|
+
const home = os.homedir();
|
|
241
|
+
const here = process.cwd();
|
|
242
|
+
if (here === home) {
|
|
243
|
+
cwd = path.join(home, 'openzoo');
|
|
244
|
+
fs.mkdirSync(cwd, { recursive: true });
|
|
245
|
+
const readme = path.join(cwd, 'README.md');
|
|
246
|
+
if (!fs.existsSync(readme)) {
|
|
247
|
+
fs.writeFileSync(readme, [
|
|
248
|
+
'# openzoo workspace',
|
|
249
|
+
'',
|
|
250
|
+
'Opened by `npx openzoo cursor` because launching from your home directory',
|
|
251
|
+
'makes the editor read `~/.cursor` as WORKSPACE config, which collides with',
|
|
252
|
+
'the global provider settings openzoo writes.',
|
|
253
|
+
'',
|
|
254
|
+
'Every model call from this window is paid per-request over x402 from the',
|
|
255
|
+
'local burner wallet. Pick a model with a vendor prefix (e.g.',
|
|
256
|
+
'`anthropic/claude-opus-5`) — built-in models bypass the proxy.',
|
|
257
|
+
'',
|
|
258
|
+
'Run `npx openzoo cursor /path/to/your/project` to use a different folder.',
|
|
259
|
+
].join('\n'));
|
|
260
|
+
}
|
|
261
|
+
console.log(`workspace: ${cwd} (home dir would collide with ~/.cursor)`);
|
|
262
|
+
} else {
|
|
263
|
+
cwd = here;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
199
266
|
const picked = pickEditor(which);
|
|
200
267
|
if (!picked) {
|
|
201
268
|
console.error('no editor found — install Cursor or VS Code, or put `cursor`/`code` on PATH');
|
|
202
269
|
console.error(`(config is written either way: ${mcpFile})`);
|
|
203
270
|
return;
|
|
204
271
|
}
|
|
205
|
-
|
|
206
|
-
const
|
|
272
|
+
const useProfile = process.env.OPENZOO_PROFILE === '1' || process.argv.includes('--profile');
|
|
273
|
+
const args = [cwd];
|
|
274
|
+
if (useProfile) {
|
|
275
|
+
fs.mkdirSync(PROFILE_DIR, { recursive: true });
|
|
276
|
+
args.unshift(`--user-data-dir=${PROFILE_DIR}`, `--extensions-dir=${path.join(PROFILE_DIR, 'extensions')}`);
|
|
277
|
+
console.log(`profile: ${PROFILE_DIR} (isolated — vendor account sync cannot reclaim these settings)`);
|
|
278
|
+
console.log(' first run in this profile asks you to sign in; extensions are separate.');
|
|
279
|
+
}
|
|
280
|
+
console.log(`launching ${picked.which}${useProfile ? ' (isolated profile)' : ''}...`);
|
|
281
|
+
const child = spawn(picked.cmd, args, { stdio: 'ignore', env, detached: true });
|
|
207
282
|
child.on('error', (e) => {
|
|
208
283
|
console.error(`could not launch ${picked.which}: ${e.message}`);
|
|
209
284
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.7",
|
|
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",
|