openzoo 0.50.60 → 0.50.61
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/cursorbackend.js +2 -0
- package/lib/openzoobotReceipt.js +41 -0
- package/package.json +1 -1
package/lib/cursorbackend.js
CHANGED
|
@@ -2718,6 +2718,8 @@ async function zooComplete(prompt, log, agentId, parsed = {}, opts = {}) {
|
|
|
2718
2718
|
} catch (e) {
|
|
2719
2719
|
lastErr = e;
|
|
2720
2720
|
log(`cursor-backend: zoo POST attempt=${attempt} ${e.message}`);
|
|
2721
|
+
// A superseded turn must not spend four more retries on a dead signal.
|
|
2722
|
+
if (opts.signal?.aborted || isSupersededError(e)) throw e;
|
|
2721
2723
|
if (attempt === tries) throw e;
|
|
2722
2724
|
const abortish = /abort|timeout/i.test(String(e?.name || '') + String(e?.message || ''));
|
|
2723
2725
|
await new Promise((ok) => setTimeout(ok, (abortish ? 2000 : 800) * attempt));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @openzoobot public receipt. X collapses single newlines into one
|
|
3
|
+
* paragraph; join with a blank line so PAID / WOULDA / tx stay stacked.
|
|
4
|
+
* `(this call) openzoo.fun` stays on the PAID line — never split.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const HARD = '\n\n';
|
|
8
|
+
|
|
9
|
+
export function receiptLines({
|
|
10
|
+
paid = '0.004',
|
|
11
|
+
woulda = '0.03',
|
|
12
|
+
wouldaLabel = 'grok.com / xAI API',
|
|
13
|
+
tx = '',
|
|
14
|
+
model = 'grok-4.6 @ openzoo',
|
|
15
|
+
} = {}) {
|
|
16
|
+
const paidStr = String(paid).replace(/^\$/, '');
|
|
17
|
+
const wouldaStr = String(woulda).replace(/^\$/, '');
|
|
18
|
+
const lines = [
|
|
19
|
+
model,
|
|
20
|
+
`**PAID** $${paidStr} x402 (this call) openzoo.fun`,
|
|
21
|
+
`**WOULDA** $${wouldaStr} ${wouldaLabel}`,
|
|
22
|
+
];
|
|
23
|
+
if (tx) lines.push(`tx ${tx}`);
|
|
24
|
+
return lines;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function receiptFooter(opts = {}) {
|
|
28
|
+
return receiptLines(opts).join(HARD);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Same body without markdown, for the X compose box. */
|
|
32
|
+
export function xTweetReceipt(opts = {}) {
|
|
33
|
+
return receiptLines(opts)
|
|
34
|
+
.map((line) => line.replace(/\*\*/g, ''))
|
|
35
|
+
.join(HARD);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** What X does when it eats extra blank lines but keeps single \n. */
|
|
39
|
+
export function afterXCollapse(text) {
|
|
40
|
+
return String(text).replace(/\n{2,}/g, '\n').trim();
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.61",
|
|
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",
|