@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/cli.js +11 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2877,12 +2877,14 @@ var BalanceMonitor = class {
|
|
|
2877
2877
|
*/
|
|
2878
2878
|
async checkBalance() {
|
|
2879
2879
|
const now = Date.now();
|
|
2880
|
-
if (this.cachedBalance !== null && now - this.cachedAt < CACHE_TTL_MS) {
|
|
2880
|
+
if (this.cachedBalance !== null && this.cachedBalance > 0n && now - this.cachedAt < CACHE_TTL_MS) {
|
|
2881
2881
|
return this.buildInfo(this.cachedBalance);
|
|
2882
2882
|
}
|
|
2883
2883
|
const balance = await this.fetchBalance();
|
|
2884
|
-
|
|
2885
|
-
|
|
2884
|
+
if (balance > 0n) {
|
|
2885
|
+
this.cachedBalance = balance;
|
|
2886
|
+
this.cachedAt = now;
|
|
2887
|
+
}
|
|
2886
2888
|
return this.buildInfo(balance);
|
|
2887
2889
|
}
|
|
2888
2890
|
/**
|
|
@@ -2985,12 +2987,14 @@ var SolanaBalanceMonitor = class {
|
|
|
2985
2987
|
}
|
|
2986
2988
|
async checkBalance() {
|
|
2987
2989
|
const now = Date.now();
|
|
2988
|
-
if (this.cachedBalance !== null && now - this.cachedAt < CACHE_TTL_MS2) {
|
|
2990
|
+
if (this.cachedBalance !== null && this.cachedBalance > 0n && now - this.cachedAt < CACHE_TTL_MS2) {
|
|
2989
2991
|
return this.buildInfo(this.cachedBalance);
|
|
2990
2992
|
}
|
|
2991
2993
|
const balance = await this.fetchBalance();
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
+
if (balance > 0n) {
|
|
2995
|
+
this.cachedBalance = balance;
|
|
2996
|
+
this.cachedAt = now;
|
|
2997
|
+
}
|
|
2994
2998
|
return this.buildInfo(balance);
|
|
2995
2999
|
}
|
|
2996
3000
|
deductEstimated(amountMicros) {
|
|
@@ -4807,7 +4811,6 @@ function hashRequestContent(lastUserContent, toolCallNames) {
|
|
|
4807
4811
|
|
|
4808
4812
|
// src/updater.ts
|
|
4809
4813
|
var NPM_REGISTRY = "https://registry.npmjs.org/@blockrun/clawrouter/latest";
|
|
4810
|
-
var UPDATE_URL = "https://blockrun.ai/ClawRouter-update";
|
|
4811
4814
|
var CHECK_TIMEOUT_MS = 5e3;
|
|
4812
4815
|
function compareSemver(a, b) {
|
|
4813
4816
|
const pa = a.split(".").map(Number);
|
|
@@ -4834,7 +4837,7 @@ async function checkForUpdates() {
|
|
|
4834
4837
|
if (compareSemver(latest, VERSION) > 0) {
|
|
4835
4838
|
console.log("");
|
|
4836
4839
|
console.log(`\x1B[33m\u2B06\uFE0F ClawRouter ${latest} available (you have ${VERSION})\x1B[0m`);
|
|
4837
|
-
console.log(` Run: \x1B[
|
|
4840
|
+
console.log(` Run: \x1B[36mnpx @blockrun/clawrouter@latest\x1B[0m`);
|
|
4838
4841
|
console.log("");
|
|
4839
4842
|
}
|
|
4840
4843
|
} catch {
|