openzoo 0.13.2 → 0.13.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.
- package/lib/anthropic.js +8 -1
- package/lib/proxy.js +7 -0
- package/package.json +1 -1
package/lib/anthropic.js
CHANGED
|
@@ -144,7 +144,14 @@ export function openAIToAnthropic(data, requestedModel) {
|
|
|
144
144
|
* dead and RETRIES, and every retry is another payment.
|
|
145
145
|
*/
|
|
146
146
|
export function writeAnthropicSse(res, message, upstream) {
|
|
147
|
-
|
|
147
|
+
// x-accel-buffering: no keeps the cloudflare tunnel / nginx from buffering
|
|
148
|
+
// the stream and merging the tool_use frames a client parses incrementally.
|
|
149
|
+
const headers = {
|
|
150
|
+
'content-type': 'text/event-stream; charset=utf-8',
|
|
151
|
+
'cache-control': 'no-cache',
|
|
152
|
+
'x-accel-buffering': 'no',
|
|
153
|
+
connection: 'keep-alive',
|
|
154
|
+
};
|
|
148
155
|
const settle = upstream?.headers?.get?.('x-payment-response');
|
|
149
156
|
if (settle) headers['x-payment-response'] = settle;
|
|
150
157
|
res.writeHead(200, headers);
|
package/lib/proxy.js
CHANGED
|
@@ -135,6 +135,13 @@ function serveAsSse(res, data, upstream) {
|
|
|
135
135
|
const headers = {
|
|
136
136
|
'content-type': 'text/event-stream; charset=utf-8',
|
|
137
137
|
'cache-control': 'no-cache',
|
|
138
|
+
// Tell any proxy in front of us (cloudflare quick tunnel, nginx) NOT to
|
|
139
|
+
// buffer the stream. Without this the tunnel accumulates the whole SSE
|
|
140
|
+
// body and releases it at once, which reorders/merges the tool_call frames
|
|
141
|
+
// an agent parses incrementally — observed as "provider-side tool-call
|
|
142
|
+
// protocol error" over the tunnel while localhost (no proxy) is fine.
|
|
143
|
+
'x-accel-buffering': 'no',
|
|
144
|
+
connection: 'keep-alive',
|
|
138
145
|
};
|
|
139
146
|
const settle = upstream?.headers?.get?.('x-payment-response');
|
|
140
147
|
if (settle) headers['x-payment-response'] = settle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.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",
|