@opencompress/openclaw 3.0.9 → 3.0.10

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/dist/index.js +21 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
6
6
  });
7
7
 
8
8
  // src/config.ts
9
- var VERSION = "3.0.9";
9
+ var VERSION = "3.0.10";
10
10
  var PROXY_PORT = 8401;
11
11
  var PROXY_HOST = "127.0.0.1";
12
12
  var OCC_API = "https://www.opencompress.ai/api";
@@ -645,24 +645,27 @@ var plugin = {
645
645
  const s = await res.json();
646
646
  const balance = Number(s.balanceUsd || s.balance || 0);
647
647
  const calls = s.monthlyApiCalls ?? s.totalCalls ?? 0;
648
- const tokensSaved = Number(s.totalOriginalTokens || 0) - Number(s.totalCompressedTokens || 0);
649
- const totalCharged = Number(s.month?.totalCharged || 0);
650
648
  const totalSaved = Number(s.month?.costSaved || s.totalSavings || 0);
651
- return {
652
- text: [
653
- "```",
654
- "OpenCompress Stats",
655
- "==================",
656
- `Balance: $${balance.toFixed(4)}`,
657
- `API calls: ${calls}`,
658
- `Tokens saved: ${tokensSaved.toLocaleString()}`,
659
- `Money saved: $${totalSaved.toFixed(4)}`,
660
- `Total charged: $${totalCharged.toFixed(4)}`,
661
- "```",
662
- "",
663
- balance < 0.5 ? `Low balance. Link your account for $10 bonus: https://www.opencompress.ai/dashboard?link=${encodeURIComponent(key)}` : "Dashboard: https://www.opencompress.ai/dashboard"
664
- ].join("\n")
665
- };
649
+ const crypto = __require("crypto");
650
+ const linkToken = crypto.createHash("sha256").update(key).digest("hex").slice(0, 16);
651
+ const dashboardUrl = `https://www.opencompress.ai/dashboard?link=${linkToken}`;
652
+ const isLinked = !!(s.email || s.accountLinked);
653
+ const lines = [
654
+ "```",
655
+ "OpenCompress",
656
+ "============",
657
+ `Balance: $${balance.toFixed(4)}`,
658
+ `Saved: $${totalSaved.toFixed(4)}`,
659
+ `API calls: ${calls}`,
660
+ "```",
661
+ ""
662
+ ];
663
+ if (isLinked) {
664
+ lines.push(`View details: ${dashboardUrl}`);
665
+ } else {
666
+ lines.push(`Sign up and claim $10 extra free credit: ${dashboardUrl}`);
667
+ }
668
+ return { text: lines.join("\n") };
666
669
  } catch (err) {
667
670
  return { text: `Error: ${err instanceof Error ? err.message : String(err)}` };
668
671
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencompress/openclaw",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "OpenCompress for OpenClaw — save tokens and sharpen quality on any LLM",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",