openzoo 0.48.29 → 0.48.30

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/launch.js CHANGED
@@ -173,7 +173,14 @@ export async function launchClaude(argv) {
173
173
  // "how can I easily see what credit i'm left" — asked by a user who
174
174
  // could not tell whether x402 had charged them at all.
175
175
  + 'const cr=(j.creditUsd==null)?"":(" \\u00b7 $"+Number(j.creditUsd).toFixed(2)+" credit");'
176
- + 'process.stdout.write("\\x1b[38;5;208m\\u25cf\\x1b[0m openzoo $"+(Number(j.spendUsd)||0).toFixed(4)+" "+(j.paidCalls||0)+" call"+((j.paidCalls||0)===1?"":"s")+spill+cr+" \\u00b7 x402")}'
176
+ // The headline: what the same calls would have cost on OpenRouter.
177
+ // ALWAYS shown, 4dp, even at 1.0000. Hiding it when there is no saving
178
+ // reads as "no data"; printing 1.0000x says "measured, and it is level"
179
+ // — which is the difference between an omission and a fact.
180
+ + 'const sx=Number(j.savingX);const sv=Number(j.savedUsd)||0;'
181
+ + 'const col=(sx>1)?"\\x1b[32m":"\\x1b[90m";'
182
+ + 'const save=(sx==null||!isFinite(sx))?"":(" \\u00b7 "+col+sx.toFixed(4)+"x vs direct"+(sv>0?(" ($"+sv.toFixed(4)+" saved)"):"")+"\\x1b[0m");'
183
+ + 'process.stdout.write("\\x1b[38;5;208m\\u25cf\\x1b[0m openzoo $"+(Number(j.spendUsd)||0).toFixed(4)+" "+(j.paidCalls||0)+" call"+((j.paidCalls||0)===1?"":"s")+save+spill+cr+" \\u00b7 x402")}'
177
184
  + 'catch{process.stdout.write("\\x1b[38;5;208m\\u25cf\\x1b[0m openzoo \\u00b7 x402")}})\'\n');
178
185
  fs.chmodSync(scriptPath, 0o755);
179
186
  const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
package/lib/proxy.js CHANGED
@@ -577,6 +577,14 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
577
577
  },
578
578
  spendUsd: sessionSpent,
579
579
  creditUsd,
580
+ // WHAT THE SAME CALLS WOULD HAVE COST DIRECT. Spend on its own is a
581
+ // bill; spend beside the counterfactual is the product. The receipt
582
+ // already carries directUsd per call — it simply never reached the
583
+ // status line, so the one number that justifies the tool was the one
584
+ // the user could not see.
585
+ directUsd: sessionDirect,
586
+ savedUsd: Math.max(0, sessionDirect - sessionSpent),
587
+ savingX: sessionSpent > 0 ? Number((sessionDirect / sessionSpent).toFixed(4)) : null,
580
588
  paidCalls,
581
589
  mcp: `${self.replace(/\/v1$/, '')}/mcp`,
582
590
  upstream: config.apiBase,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.48.29",
3
+ "version": "0.48.30",
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",