openzoo 0.43.9 → 0.44.0
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/namespace.js +22 -24
- package/package.json +1 -1
package/lib/namespace.js
CHANGED
|
@@ -15,26 +15,30 @@ import { loadOrCreateWallet } from './wallet.js';
|
|
|
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
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* ALWAYS ON. There is no flag.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* stale cached build), so a corpus bound by a
|
|
24
|
-
* invisible to a chat sent through an older proxy —
|
|
25
|
-
*
|
|
26
|
-
* whole body at full price. MEASURED twice in one session
|
|
20
|
+
* It used to be opt-in and off, because a header the client merely ASSERTED
|
|
21
|
+
* was the wrong mechanism: the surfaces disagree in practice (the MCP server,
|
|
22
|
+
* the CLI and the proxy are separate processes upgraded at different times,
|
|
23
|
+
* and npx happily serves a stale cached build), so a corpus bound by a
|
|
24
|
+
* namespaced `zoo_bind` went invisible to a chat sent through an older proxy —
|
|
25
|
+
* the context vanished, spill binds 400'd, and the gateway fell open and
|
|
26
|
+
* forwarded the whole body at full price. MEASURED twice in one session.
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
28
|
+
* That objection was about an UNVERIFIED claim and no longer holds: the value
|
|
29
|
+
* is signed (see signNamespace) and the gateway REQUIRES the signature,
|
|
30
|
+
* deriving the tenant from the proven signer. A flag was worse than useless
|
|
31
|
+
* here — off meant every caller shared one tenant, where a context is
|
|
32
|
+
* protected only by its id being unguessable and anyone may write into the
|
|
33
|
+
* same space, and a flag that is sometimes off is exactly the version skew
|
|
34
|
+
* that made contexts vanish. One behaviour, every surface, always.
|
|
35
|
+
*
|
|
36
|
+
* BREAKING: corpora bound before this lived in the shared tenant and are not
|
|
37
|
+
* reachable from a signed request. Re-bind them.
|
|
33
38
|
*/
|
|
34
39
|
let cached = null;
|
|
35
40
|
|
|
36
41
|
export function namespaceHeaderValue() {
|
|
37
|
-
if (process.env.OPENZOO_NAMESPACE !== '1') return '';
|
|
38
42
|
if (cached) return cached;
|
|
39
43
|
try {
|
|
40
44
|
const w = loadOrCreateWallet();
|
|
@@ -86,16 +90,10 @@ function signNamespace(namespace) {
|
|
|
86
90
|
export function withNamespace(headers = {}) {
|
|
87
91
|
const ns = namespaceHeaderValue();
|
|
88
92
|
if (!ns) return headers;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// Unsigned still works while the gateway is in soft launch. Sending the
|
|
94
|
-
// bare namespace is strictly better than sending nothing: it keeps the
|
|
95
|
-
// caller in their existing tenant instead of silently relocating every
|
|
96
|
-
// bound corpus to the shared one.
|
|
97
|
-
}
|
|
98
|
-
return { ...headers, 'x-openzoo-namespace': ns, ...proof };
|
|
93
|
+
// No unsigned fallback. The gateway REQUIRES the signature, so a bare
|
|
94
|
+
// namespace buys nothing — it would just be silently demoted to the shared
|
|
95
|
+
// tenant, which looks like "my corpus vanished" instead of a clear failure.
|
|
96
|
+
return { ...headers, 'x-openzoo-namespace': ns, ...signNamespace(ns) };
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
// Bitcoin-alphabet base58, matching what the gateway's bs58 decode expects.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
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",
|