openzoo 0.33.3 → 0.33.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.
Files changed (2) hide show
  1. package/lib/launch.js +7 -3
  2. package/package.json +1 -1
package/lib/launch.js CHANGED
@@ -93,12 +93,16 @@ export async function launchClaude(argv) {
93
93
  try {
94
94
  const scriptPath = path.join(os.homedir(), '.openzoo', 'statusline.sh');
95
95
  fs.mkdirSync(path.dirname(scriptPath), { recursive: true });
96
+ // node JSON.parse, not awk — /v1/info is pretty-printed (space after the
97
+ // colon) and a fixed-offset awk regex silently read 0. This is robust.
96
98
  fs.writeFileSync(scriptPath,
97
99
  '#!/bin/sh\n'
98
100
  + `curl -s --max-time 1 ${base}/info 2>/dev/null | `
99
- + 'awk \'{ if (match($0,/"spendUsd":[0-9.eE-]+/)) { s=substr($0,RSTART+11,RLENGTH-11) } '
100
- + 'if (match($0,/"paidCalls":[0-9]+/)) { c=substr($0,RSTART+12,RLENGTH-12) } } '
101
- + 'END { printf "\\033[38;5;208m●\\033[0m openzoo $%.4f %s call%s · x402", s+0, c+0, (c==1?"":"s") }\'\n');
101
+ + `${JSON.stringify(process.execPath)} -e `
102
+ + '\'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{'
103
+ + 'try{const j=JSON.parse(s);'
104
+ + '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")+" \\u00b7 x402")}'
105
+ + 'catch{process.stdout.write("\\x1b[38;5;208m\\u25cf\\x1b[0m openzoo \\u00b7 x402")}})\'\n');
102
106
  fs.chmodSync(scriptPath, 0o755);
103
107
  const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
104
108
  let settings = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.33.3",
3
+ "version": "0.33.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",