openzoo 0.12.2 → 0.12.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/lib/bindpath.js +12 -3
- package/lib/namespace.js +17 -0
- package/package.json +1 -1
package/lib/bindpath.js
CHANGED
|
@@ -25,9 +25,18 @@ import { config } from './config.js';
|
|
|
25
25
|
import { corpusHash, rememberContext, lookupContext } from './contexts.js';
|
|
26
26
|
import { withNamespace } from './namespace.js';
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Bodies over this go in their own part.
|
|
30
|
+
*
|
|
31
|
+
* Sized by TIME, not just by the transport ceiling. Each append re-indexes a
|
|
32
|
+
* larger context, so parts get progressively slower — MEASURED binding a 23MB
|
|
33
|
+
* Rust tree, 4MB parts ran 25s → 30s → 65s. A minutes-long bind is also a
|
|
34
|
+
* minutes-long window in which any gateway restart destroys all the work done
|
|
35
|
+
* so far (a deploy mid-bind cost exactly that, five good parts thrown away).
|
|
36
|
+
* Smaller parts cost more round trips, finish sooner, and lose less when
|
|
37
|
+
* something upstream cycles.
|
|
38
|
+
*/
|
|
39
|
+
export const MAX_PART_BYTES = Number(process.env.OPENZOO_BIND_PART_BYTES || 2_000_000);
|
|
31
40
|
|
|
32
41
|
/** Text-ish files worth binding. Anything else is skipped rather than
|
|
33
42
|
* silently binding a binary as mojibake. */
|
package/lib/namespace.js
CHANGED
|
@@ -14,10 +14,27 @@ import { loadOrCreateWallet } from './wallet.js';
|
|
|
14
14
|
* Derived from the PUBLIC key, never the secret: it must be stable across
|
|
15
15
|
* restarts and reveal nothing. It is hashed again server-side, so the value on
|
|
16
16
|
* the wire is not the address either.
|
|
17
|
+
*
|
|
18
|
+
* OPT-IN (OPENZOO_NAMESPACE=1), and off by default, deliberately.
|
|
19
|
+
*
|
|
20
|
+
* Isolation is only sound if EVERY surface agrees on the namespace. In
|
|
21
|
+
* practice they do not: the MCP server, the CLI and the proxy are separate
|
|
22
|
+
* processes that a user upgrades at different times (npx happily serves a
|
|
23
|
+
* stale cached build), so a corpus bound by a namespaced `zoo_bind` became
|
|
24
|
+
* invisible to a chat sent through an older proxy — the context vanished,
|
|
25
|
+
* every spill bind returned 400, and the gateway fell open and forwarded the
|
|
26
|
+
* whole body at full price. MEASURED twice in one session, in both directions.
|
|
27
|
+
*
|
|
28
|
+
* A header the client controls was the wrong mechanism: real isolation should
|
|
29
|
+
* key off the settling payer, which the gateway already knows and cannot get
|
|
30
|
+
* out of sync. Until that exists, defaulting off restores the behaviour that
|
|
31
|
+
* always worked, and the gateway's fallback keeps namespaced contexts
|
|
32
|
+
* reachable for anyone who opts in.
|
|
17
33
|
*/
|
|
18
34
|
let cached = null;
|
|
19
35
|
|
|
20
36
|
export function namespaceHeaderValue() {
|
|
37
|
+
if (process.env.OPENZOO_NAMESPACE !== '1') return '';
|
|
21
38
|
if (cached) return cached;
|
|
22
39
|
try {
|
|
23
40
|
const w = loadOrCreateWallet();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.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",
|