openzoo 0.9.3 → 0.9.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/proxy.js +21 -0
- package/package.json +1 -1
package/lib/proxy.js
CHANGED
|
@@ -118,6 +118,27 @@ function serveAsSse(res, data, upstream) {
|
|
|
118
118
|
if (c.message?.content) {
|
|
119
119
|
ev({ ...base, choices: [{ index: c.index ?? 0, delta: { content: c.message.content }, finish_reason: null }] });
|
|
120
120
|
}
|
|
121
|
+
// Agent mode lives or dies here: a finish_reason of "tool_calls" with the
|
|
122
|
+
// calls themselves dropped strands the harness mid-turn (observed: Cursor
|
|
123
|
+
// agent hangs). Streaming spec: tool_calls ride the delta with an index,
|
|
124
|
+
// arguments as a string chunk — one full chunk per call is valid SSE.
|
|
125
|
+
if (Array.isArray(c.message?.tool_calls) && c.message.tool_calls.length) {
|
|
126
|
+
ev({
|
|
127
|
+
...base,
|
|
128
|
+
choices: [{
|
|
129
|
+
index: c.index ?? 0,
|
|
130
|
+
delta: {
|
|
131
|
+
tool_calls: c.message.tool_calls.map((t, i) => ({
|
|
132
|
+
index: i,
|
|
133
|
+
id: t.id,
|
|
134
|
+
type: t.type || 'function',
|
|
135
|
+
function: { name: t.function?.name, arguments: t.function?.arguments ?? '' },
|
|
136
|
+
})),
|
|
137
|
+
},
|
|
138
|
+
finish_reason: null,
|
|
139
|
+
}],
|
|
140
|
+
});
|
|
141
|
+
}
|
|
121
142
|
ev({ ...base, choices: [{ index: c.index ?? 0, delta: {}, finish_reason: c.finish_reason ?? 'stop' }], ...(data.usage ? { usage: data.usage } : {}) });
|
|
122
143
|
}
|
|
123
144
|
res.write('data: [DONE]\n\n');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.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",
|