openzoo 0.18.6 → 0.18.8
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/lib/proxy.js +24 -1
- package/lib/setup.js +28 -2
- package/package.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -363,7 +363,30 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
|
|
|
363
363
|
|
|
364
364
|
if (viaTunnel) {
|
|
365
365
|
const got = (req.headers.authorization || '').replace(/^Bearer\s+/i, '').trim();
|
|
366
|
-
|
|
366
|
+
// TRUST ON FIRST USE, so a stale key still works without weakening the
|
|
367
|
+
// tunnel to "any key forever".
|
|
368
|
+
//
|
|
369
|
+
// Tunnel tokens are minted per session, so a client holding a key from an
|
|
370
|
+
// earlier run silently failed — and the only fixes were re-pasting by
|
|
371
|
+
// hand or writing into the editor's OS-encrypted credential store, which
|
|
372
|
+
// would mean prompting for keychain access to install a value the user
|
|
373
|
+
// never chose. Instead: the printed token always works, and the FIRST
|
|
374
|
+
// other key to present itself claims the tunnel for the rest of the
|
|
375
|
+
// session. Your editor (which reaches the URL first, from this machine)
|
|
376
|
+
// adopts it; anyone who finds the URL afterwards is refused because the
|
|
377
|
+
// slot is taken. The URL is unguessable and ephemeral, the spend ceiling
|
|
378
|
+
// still applies, and OPENZOO_TUNNEL_STRICT=1 restores exact-match only.
|
|
379
|
+
const strict = process.env.OPENZOO_TUNNEL_STRICT === '1';
|
|
380
|
+
let authed = got === tunnelGate.token;
|
|
381
|
+
if (!authed && !strict && got.length >= 8) {
|
|
382
|
+
if (!tunnelGate.adopted) {
|
|
383
|
+
tunnelGate.adopted = got;
|
|
384
|
+
log(`public url: adopted the caller's key (first-use) — later keys must match it`);
|
|
385
|
+
authed = true;
|
|
386
|
+
} else {
|
|
387
|
+
authed = got === tunnelGate.adopted;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
367
390
|
const p = (req.url || '').split('?')[0];
|
|
368
391
|
// DISCOVERY IS FREE. An agent probing this URL cold should be able to
|
|
369
392
|
// work out what it is and what to ask its operator for — a bare 401 on
|
package/lib/setup.js
CHANGED
|
@@ -22,7 +22,29 @@ 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
|
+
]);
|
|
26
48
|
|
|
27
49
|
/**
|
|
28
50
|
* An ISOLATED editor profile we own.
|
|
@@ -208,7 +230,11 @@ export async function setupEditor(which, target) {
|
|
|
208
230
|
|
|
209
231
|
// 3. LAUNCH with that env. Editor resolved platform-agnostically; Cursor
|
|
210
232
|
// wins when both are installed.
|
|
211
|
-
|
|
233
|
+
// Open the directory you ran this from, or the one you named. The earlier
|
|
234
|
+
// "helpfully" substitute a ~/openzoo folder when run from $HOME was worse
|
|
235
|
+
// than the problem it dodged: it silently opened the wrong project.
|
|
236
|
+
const cwd = target && !target.startsWith('-') ? target : process.cwd();
|
|
237
|
+
|
|
212
238
|
const picked = pickEditor(which);
|
|
213
239
|
if (!picked) {
|
|
214
240
|
console.error('no editor found — install Cursor or VS Code, or put `cursor`/`code` on PATH');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.8",
|
|
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",
|