openzoo 0.18.8 → 0.18.10
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 +6 -0
- package/lib/setup.js +29 -31
- package/package.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -285,6 +285,7 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
|
|
|
285
285
|
// origin, not off whether the URL exists yet, so there is no startup window
|
|
286
286
|
// where public traffic slips through ungated.
|
|
287
287
|
let tunnelGate = null;
|
|
288
|
+
let tunnelError = null;
|
|
288
289
|
|
|
289
290
|
const server = http.createServer(async (req, res) => {
|
|
290
291
|
// MCP on the SAME port as the proxy. One `npx openzoo` gives a harness
|
|
@@ -746,6 +747,10 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
|
|
|
746
747
|
log(` (key REQUIRED on the public URL — it spends this wallet; ${Number.isFinite(cap) ? `capped at $${cap.toFixed(2)}/session` : 'NO session cap — OPENZOO_TUNNEL_MAX_USD adds one'},`);
|
|
747
748
|
log(' OPENZOO_NO_TUNNEL=1 for localhost-only)');
|
|
748
749
|
} catch (err) {
|
|
750
|
+
// Record it: a caller polling for publicUrl (openzoo cursor) would
|
|
751
|
+
// otherwise spin the full timeout on a tunnel that already died, with
|
|
752
|
+
// silent:true swallowing this very message.
|
|
753
|
+
tunnelError = err.message;
|
|
749
754
|
log(`public URL unavailable (${err.message}) — localhost still works; OPENZOO_NO_TUNNEL=1 hides this line`);
|
|
750
755
|
}
|
|
751
756
|
})();
|
|
@@ -760,5 +765,6 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
|
|
|
760
765
|
spent: () => sessionSpent,
|
|
761
766
|
get publicUrl() { return tunnelGate?.publicUrl ?? null; },
|
|
762
767
|
get tunnelToken() { return tunnelGate?.token ?? null; },
|
|
768
|
+
get tunnelError() { return tunnelError; },
|
|
763
769
|
};
|
|
764
770
|
}
|
package/lib/setup.js
CHANGED
|
@@ -23,42 +23,33 @@ 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
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* Models offered in the editor's picker — named the way the EDITOR names them.
|
|
27
|
+
*
|
|
28
|
+
* Vendor-prefixed ids (anthropic/claude-opus-5) are foreign to Cursor's picker;
|
|
29
|
+
* its own catalog uses bare names (claude-opus-5, grok-4.6, glm-5.2). Matching
|
|
30
|
+
* that naming means the entries look native and the proxy still resolves them:
|
|
31
|
+
* lib/models.js maps each to a real catalog id (claude-opus-5 ->
|
|
32
|
+
* anthropic/claude-opus-5-fast, grok-4.6 -> x-ai/grok-4.6, composer-2.5 ->
|
|
33
|
+
* qwen/qwen-2.5-coder-32b-instruct), all verified against the live catalog.
|
|
34
|
+
* Override with OPENZOO_MODELS.
|
|
31
35
|
*/
|
|
32
36
|
const DEFAULT_MODELS = (process.env.OPENZOO_MODELS
|
|
33
37
|
? process.env.OPENZOO_MODELS.split(',').map((m) => m.trim()).filter(Boolean)
|
|
34
38
|
: [
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
39
|
+
'claude-opus-5', // default
|
|
40
|
+
'claude-sonnet-5',
|
|
41
|
+
'gpt-5.6-sol',
|
|
42
|
+
'gpt-5.6-luna',
|
|
43
|
+
'grok-4.6',
|
|
44
|
+
'glm-5.2',
|
|
45
|
+
'gemini-3.1-pro',
|
|
46
|
+
'kimi-k3',
|
|
47
|
+
'gpt-5.3-codex',
|
|
48
|
+
'claude-haiku-4-5',
|
|
49
|
+
'composer-2.5',
|
|
50
|
+
'deepseek/deepseek-v4-pro-0813', // no Cursor equivalent; cheapest output
|
|
47
51
|
]);
|
|
48
52
|
|
|
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');
|
|
61
|
-
|
|
62
53
|
const MCP_FILES = {
|
|
63
54
|
cursor: path.join(os.homedir(), '.cursor', 'mcp.json'),
|
|
64
55
|
vscode: path.join(os.homedir(), '.vscode', 'mcp.json'),
|
|
@@ -165,13 +156,20 @@ export async function setupEditor(which, target) {
|
|
|
165
156
|
// routinely takes 30-45s; a 10s wait meant the tunnel line simply never
|
|
166
157
|
// printed and the user never learned the public URL existed.
|
|
167
158
|
process.stdout.write('waiting for tunnel');
|
|
159
|
+
let tunnelErr = null;
|
|
168
160
|
for (let i = 0; i < 120 && !publicUrl; i++) {
|
|
169
161
|
await new Promise((r) => setTimeout(r, 500));
|
|
170
162
|
publicUrl = started?.publicUrl ?? null;
|
|
171
163
|
tunnelKey = started?.tunnelToken ?? null;
|
|
164
|
+
// Bail the moment it FAILS. Polling to the full timeout on a dead tunnel
|
|
165
|
+
// just looks like a hang — and silent:true hides the proxy's own error.
|
|
166
|
+
tunnelErr = started?.tunnelError ?? null;
|
|
167
|
+
if (tunnelErr) break;
|
|
172
168
|
if (i % 4 === 3) process.stdout.write('.');
|
|
173
169
|
}
|
|
174
|
-
process.stdout.write(
|
|
170
|
+
if (publicUrl) process.stdout.write(' ok\n');
|
|
171
|
+
else if (tunnelErr) process.stdout.write(` failed: ${tunnelErr}\n (localhost still works; OPENZOO_NO_TUNNEL=1 skips this)\n`);
|
|
172
|
+
else process.stdout.write(' timed out — carrying on; it will print here if it comes up later\n');
|
|
175
173
|
} else {
|
|
176
174
|
console.log(`proxy already running on ${base}`);
|
|
177
175
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.10",
|
|
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",
|