openzoo 0.35.3 โ 0.36.1
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/gui.html +15 -2
- package/lib/proxy.js +10 -0
- package/package.json +1 -1
package/lib/gui.html
CHANGED
|
@@ -172,10 +172,23 @@ async function send() {
|
|
|
172
172
|
if (state.ctx) headers["x-hrr-context"] = state.ctx;
|
|
173
173
|
const r = await fetch("/v1/chat/completions", {
|
|
174
174
|
method: "POST", headers,
|
|
175
|
-
|
|
175
|
+
// reasoning models bill their thinking inside max_tokens โ 2048 bought
|
|
176
|
+
// a whole essay of invisible reasoning and zero visible words (measured
|
|
177
|
+
// live: deepseek, finish_reason "length", empty content, $0.0172)
|
|
178
|
+
body: JSON.stringify({
|
|
179
|
+
model: $("model").value,
|
|
180
|
+
messages: state.messages,
|
|
181
|
+
max_tokens: /deepseek|grok|thinking|fable|sonnet-5|-r1|reason/i.test($("model").value) ? 16384 : 4096,
|
|
182
|
+
}),
|
|
176
183
|
});
|
|
177
184
|
const d = await r.json();
|
|
178
|
-
const
|
|
185
|
+
const ch = d.choices?.[0];
|
|
186
|
+
let content = ch?.message?.content || "";
|
|
187
|
+
if (!content && ch?.finish_reason === "length") {
|
|
188
|
+
content = "๐ฆฅ the animal thought so hard it ran out of room before saying anything. try again โ the cage just got bigger.";
|
|
189
|
+
} else if (!content) {
|
|
190
|
+
content = d.error?.message || "๐ฆ the zoo returned something unusual: " + JSON.stringify(d).slice(0, 200);
|
|
191
|
+
}
|
|
179
192
|
thinking.textContent = content;
|
|
180
193
|
state.messages.push({ role: "assistant", content });
|
|
181
194
|
const x = d.x402 || {};
|
package/lib/proxy.js
CHANGED
|
@@ -731,6 +731,16 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
|
|
|
731
731
|
);
|
|
732
732
|
console.log(`openzoo v${version} -> ${config.apiBase}`);
|
|
733
733
|
console.log(`listening on http://localhost:${config.port}/v1`);
|
|
734
|
+
// LAND THEM IN THE APP. `npx openzoo` in a human terminal opens the chat
|
|
735
|
+
// GUI โ a stranger's first 8 seconds should be a working chat, not a URL
|
|
736
|
+
// to notice. Never in CI/agents (no TTY), never twice, opt out with
|
|
737
|
+
// OPENZOO_NO_OPEN=1.
|
|
738
|
+
if (process.stdout.isTTY && !process.env.OPENZOO_NO_OPEN) {
|
|
739
|
+
const opener = process.platform === 'darwin' ? 'open'
|
|
740
|
+
: process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
741
|
+
import('node:child_process').then(({ exec }) =>
|
|
742
|
+
exec(`${opener} http://localhost:${config.port}/`, () => {}));
|
|
743
|
+
}
|
|
734
744
|
console.log('');
|
|
735
745
|
if (client.walletCreated) console.log(`new burner wallet created at ${client.walletPath} (chmod 600)`);
|
|
736
746
|
console.log(`wallet (fund me) ยท solana: ${client.address}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.1",
|
|
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",
|