openzoo 0.20.3 → 0.20.4
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 +11 -0
- package/lib/hosts.js +3 -2
- package/lib/setup.js +13 -0
- package/package.json +1 -1
package/bin/openzoo.js
CHANGED
|
@@ -12,11 +12,16 @@ usage:
|
|
|
12
12
|
a missing dir is created)
|
|
13
13
|
--profile use an isolated editor profile the
|
|
14
14
|
vendor account cannot re-sync over
|
|
15
|
+
(also points cursor's own backend at 127.0.0.1 in
|
|
16
|
+
the hosts file so it cannot re-sync over your model
|
|
17
|
+
list or route inference around the proxy — asks for
|
|
18
|
+
your password; --no-block skips it)
|
|
15
19
|
npx openzoo vscode [path] same, for VS Code
|
|
16
20
|
npx openzoo editor [path] whichever is installed (Cursor wins if both)
|
|
17
21
|
npx openzoo launch <cmd> [args] launch a TERMINAL Messages API client
|
|
18
22
|
(claude, aider...) already pointed at the zoo
|
|
19
23
|
npx openzoo mcp stdio MCP server (tools: zoo_ask, zoo_bind, zoo_models, zoo_wallet, zoo_contexts)
|
|
24
|
+
npx openzoo unblock restore the editor's own backend in the hosts file
|
|
20
25
|
npx openzoo tunnel public-url-only mode (everything key-gated, no keyless localhost)
|
|
21
26
|
npx openzoo demo ~1M-token needle demo: direct refuses, the zoo answers
|
|
22
27
|
(run it twice — the second run reuses the bound corpus and is near-free)
|
|
@@ -70,6 +75,12 @@ async function main() {
|
|
|
70
75
|
await (await import('../lib/launch.js')).launchHarness(harness, hargs);
|
|
71
76
|
break;
|
|
72
77
|
}
|
|
78
|
+
case 'unblock': {
|
|
79
|
+
const { unblockBackend, isBlocked } = await import('../lib/hosts.js');
|
|
80
|
+
const r = unblockBackend();
|
|
81
|
+
console.log(r.already ? 'not blocked — nothing to undo' : (isBlocked() ? 'still blocked (sudo declined?)' : 'restored: the editor can reach its own backend again'));
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
73
84
|
case 'tunnel':
|
|
74
85
|
await (await import('../lib/tunnel.js')).runTunnel();
|
|
75
86
|
break;
|
package/lib/hosts.js
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* COLLATERAL, STATED PLAINLY: that host also carries auth and usage reporting.
|
|
15
15
|
* The editor may report being signed out or degraded. This is a system-wide
|
|
16
|
-
* change
|
|
17
|
-
*
|
|
16
|
+
* change needing a password, so it always backs up the hosts file first and
|
|
17
|
+
* `npx openzoo unblock` restores it. `--no-block` skips it entirely.
|
|
18
18
|
*/
|
|
19
19
|
import fs from 'node:fs';
|
|
20
20
|
import { execFileSync, spawnSync } from 'node:child_process';
|
|
@@ -73,6 +73,7 @@ export function blockBackend() {
|
|
|
73
73
|
console.log(` backup : ${BACKUP}`);
|
|
74
74
|
console.log(' NOTE : that host also carries the editor\'s auth/usage — it may report');
|
|
75
75
|
console.log(' being signed out. Undo any time with: npx openzoo unblock');
|
|
76
|
+
console.log(' skip this next time with: --no-block');
|
|
76
77
|
console.log(' sudo will ask for your password now.');
|
|
77
78
|
if (WIN) {
|
|
78
79
|
console.log(' windows: run this in an ADMINISTRATOR PowerShell, then relaunch:');
|
package/lib/setup.js
CHANGED
|
@@ -246,6 +246,19 @@ export async function setupEditor(which, target) {
|
|
|
246
246
|
console.log(' verify: send one message, watch for "paid $0.0… · rail solana · tx …" here.');
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
// 2b. THE BACKEND BLOCK. Pinning the database is not sufficient on its own:
|
|
250
|
+
// the editor re-syncs its model list from its own backend into MEMORY on
|
|
251
|
+
// window focus and repaints the picker empty, and that same host is the
|
|
252
|
+
// route its own inference takes. Blackholing it in the hosts file is what
|
|
253
|
+
// leaves the configured base URL as the only way out. System-wide and
|
|
254
|
+
// needs a password, so it is opt-in and reversible.
|
|
255
|
+
if (target0 === 'cursor' && !process.argv.includes('--no-block')) {
|
|
256
|
+
const { blockBackend, isBlocked } = await import('./hosts.js');
|
|
257
|
+
const r = blockBackend();
|
|
258
|
+
if (r.already) console.log('backend: already blocked (npx openzoo unblock to restore)');
|
|
259
|
+
else console.log(`backend: ${isBlocked() ? 'blocked -> 127.0.0.1' : 'NOT blocked — the editor will re-sync over your model list'}`);
|
|
260
|
+
}
|
|
261
|
+
|
|
249
262
|
// 3. LAUNCH with that env. Editor resolved platform-agnostically; Cursor
|
|
250
263
|
// wins when both are installed.
|
|
251
264
|
// Open the directory you ran this from, or the one you named. The earlier
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.4",
|
|
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",
|