openzoo 0.32.0 → 0.32.2
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/hosts.js +19 -3
- package/package.json +1 -1
package/lib/hosts.js
CHANGED
|
@@ -36,7 +36,18 @@ const BACKUP = `${HOSTS}.openzoo-backup`;
|
|
|
36
36
|
const MARK = '# openzoo: force the editor onto the local proxy';
|
|
37
37
|
|
|
38
38
|
/** Hosts the editor uses for model sync + its own inference proxy. */
|
|
39
|
-
export const BACKEND_HOSTS = [
|
|
39
|
+
export const BACKEND_HOSTS = [
|
|
40
|
+
'api2.cursor.sh',
|
|
41
|
+
// Chat inference (StreamUnifiedChat) hosts — EVERY region x privacy variant,
|
|
42
|
+
// because /etc/hosts cannot wildcard *.api5.cursor.sh and Auto picks one per
|
|
43
|
+
// the account's region + privacy mode. Missing any = the chat escapes to
|
|
44
|
+
// Cursor's servers and never reaches us (observed: only api2 blocked -> no
|
|
45
|
+
// cursor-backend lines on chat).
|
|
46
|
+
'agent.api5.cursor.sh', 'agentn.api5.cursor.sh',
|
|
47
|
+
'agent-gcpp-uswest.api5.cursor.sh', 'agentn-gcpp-uswest.api5.cursor.sh',
|
|
48
|
+
'agent-gcpp-eucentral.api5.cursor.sh', 'agentn-gcpp-eucentral.api5.cursor.sh',
|
|
49
|
+
'agent-gcpp-apsoutheast.api5.cursor.sh', 'agentn-gcpp-apsoutheast.api5.cursor.sh',
|
|
50
|
+
]
|
|
40
51
|
|
|
41
52
|
export function isBlocked() {
|
|
42
53
|
try {
|
|
@@ -67,8 +78,13 @@ function flushDnsCmd() {
|
|
|
67
78
|
}
|
|
68
79
|
|
|
69
80
|
export function blockBackend() {
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
// Add only the hosts NOT already present, so a prior api2-only block still gets
|
|
82
|
+
// the agent/chat hosts appended (early-returning on isBlocked left them out).
|
|
83
|
+
let current = '';
|
|
84
|
+
try { current = fs.readFileSync(HOSTS, 'utf8'); } catch { /* new */ }
|
|
85
|
+
const missing = BACKEND_HOSTS.filter((h) => !new RegExp(`^\\s*127\\.0\\.0\\.1\\s+${h.replace(/\./g, '\\.')}\\b`, 'm').test(current));
|
|
86
|
+
if (!missing.length) return { already: true };
|
|
87
|
+
const entries = missing.map((h) => `127.0.0.1 ${h}`).join('\\n');
|
|
72
88
|
console.log('');
|
|
73
89
|
console.log('blocking the editor\'s backend so it cannot re-sync over your model list.');
|
|
74
90
|
console.log(` hosts : ${BACKEND_HOSTS.join(', ')} -> 127.0.0.1`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.2",
|
|
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",
|