@blockrun/clawrouter 0.12.18 → 0.12.20

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/dist/index.js CHANGED
@@ -34,12 +34,14 @@ var init_solana_balance = __esm({
34
34
  }
35
35
  async checkBalance() {
36
36
  const now = Date.now();
37
- if (this.cachedBalance !== null && now - this.cachedAt < CACHE_TTL_MS2) {
37
+ if (this.cachedBalance !== null && this.cachedBalance > 0n && now - this.cachedAt < CACHE_TTL_MS2) {
38
38
  return this.buildInfo(this.cachedBalance);
39
39
  }
40
40
  const balance = await this.fetchBalance();
41
- this.cachedBalance = balance;
42
- this.cachedAt = now;
41
+ if (balance > 0n) {
42
+ this.cachedBalance = balance;
43
+ this.cachedAt = now;
44
+ }
43
45
  return this.buildInfo(balance);
44
46
  }
45
47
  deductEstimated(amountMicros) {
@@ -3991,12 +3993,14 @@ var BalanceMonitor = class {
3991
3993
  */
3992
3994
  async checkBalance() {
3993
3995
  const now = Date.now();
3994
- if (this.cachedBalance !== null && now - this.cachedAt < CACHE_TTL_MS) {
3996
+ if (this.cachedBalance !== null && this.cachedBalance > 0n && now - this.cachedAt < CACHE_TTL_MS) {
3995
3997
  return this.buildInfo(this.cachedBalance);
3996
3998
  }
3997
3999
  const balance = await this.fetchBalance();
3998
- this.cachedBalance = balance;
3999
- this.cachedAt = now;
4000
+ if (balance > 0n) {
4001
+ this.cachedBalance = balance;
4002
+ this.cachedAt = now;
4003
+ }
4000
4004
  return this.buildInfo(balance);
4001
4005
  }
4002
4006
  /**
@@ -5254,7 +5258,6 @@ function hashRequestContent(lastUserContent, toolCallNames) {
5254
5258
 
5255
5259
  // src/updater.ts
5256
5260
  var NPM_REGISTRY = "https://registry.npmjs.org/@blockrun/clawrouter/latest";
5257
- var UPDATE_URL = "https://blockrun.ai/ClawRouter-update";
5258
5261
  var CHECK_TIMEOUT_MS = 5e3;
5259
5262
  function compareSemver(a, b) {
5260
5263
  const pa = a.split(".").map(Number);
@@ -5281,7 +5284,7 @@ async function checkForUpdates() {
5281
5284
  if (compareSemver(latest, VERSION) > 0) {
5282
5285
  console.log("");
5283
5286
  console.log(`\x1B[33m\u2B06\uFE0F ClawRouter ${latest} available (you have ${VERSION})\x1B[0m`);
5284
- console.log(` Run: \x1B[36mcurl -fsSL ${UPDATE_URL} | bash\x1B[0m`);
5287
+ console.log(` Run: \x1B[36mnpx @blockrun/clawrouter@latest\x1B[0m`);
5285
5288
  console.log("");
5286
5289
  }
5287
5290
  } catch {