openzoo 0.12.2 → 0.12.3

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.
Files changed (2) hide show
  1. package/lib/namespace.js +17 -0
  2. package/package.json +1 -1
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.2",
3
+ "version": "0.12.3",
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",