@blockrun/clawrouter 0.10.6 → 0.10.7
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 +29 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.js +42 -5
- package/dist/index.js.map +1 -1
- package/package.json +22 -22
- package/scripts/reinstall.sh +44 -0
- package/scripts/update.sh +168 -0
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var init_registry = __esm({
|
|
|
21
21
|
id: "x_users_lookup",
|
|
22
22
|
name: "Twitter/X User Lookup",
|
|
23
23
|
partner: "AttentionVC",
|
|
24
|
-
description: "
|
|
24
|
+
description: "ALWAYS use this tool to look up real-time Twitter/X user profiles. Call this when the user asks about any Twitter/X account, username, handle, follower count, verification status, bio, or profile. Do NOT answer Twitter/X user questions from memory \u2014 always fetch live data with this tool. Returns: follower count, verification badge, bio, location, join date. Accepts up to 100 usernames per request (without @ prefix).",
|
|
25
25
|
proxyPath: "/x/users/lookup",
|
|
26
26
|
method: "POST",
|
|
27
27
|
params: [
|
|
@@ -1217,7 +1217,7 @@ function calibrateConfidence(distance, steepness) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
|
|
1219
1219
|
// src/router/selector.ts
|
|
1220
|
-
var BASELINE_MODEL_ID = "anthropic/claude-opus-4
|
|
1220
|
+
var BASELINE_MODEL_ID = "anthropic/claude-opus-4.6";
|
|
1221
1221
|
function selectModel(tier, confidence, method, reasoning, tierConfigs, modelPricing, estimatedInputTokens, maxOutputTokens, routingProfile) {
|
|
1222
1222
|
const tierConfig = tierConfigs[tier];
|
|
1223
1223
|
const model = tierConfig.primary;
|
|
@@ -5954,12 +5954,24 @@ async function loadSavedWallet() {
|
|
|
5954
5954
|
console.log(`[ClawRouter] \u2713 Loaded existing wallet from ${WALLET_FILE}`);
|
|
5955
5955
|
return key;
|
|
5956
5956
|
}
|
|
5957
|
-
console.
|
|
5957
|
+
console.error(`[ClawRouter] \u2717 CRITICAL: Wallet file exists but has invalid format!`);
|
|
5958
|
+
console.error(`[ClawRouter] File: ${WALLET_FILE}`);
|
|
5959
|
+
console.error(`[ClawRouter] Expected: 0x followed by 64 hex characters (66 chars total)`);
|
|
5960
|
+
console.error(`[ClawRouter] To fix: restore your backup key or set BLOCKRUN_WALLET_KEY env var`);
|
|
5961
|
+
throw new Error(
|
|
5962
|
+
`Wallet file at ${WALLET_FILE} is corrupted or has wrong format. Refusing to auto-generate new wallet to protect existing funds. Restore your backup key or set BLOCKRUN_WALLET_KEY environment variable.`
|
|
5963
|
+
);
|
|
5958
5964
|
} catch (err) {
|
|
5959
5965
|
if (err.code !== "ENOENT") {
|
|
5966
|
+
if (err instanceof Error && err.message.includes("Refusing to auto-generate")) {
|
|
5967
|
+
throw err;
|
|
5968
|
+
}
|
|
5960
5969
|
console.error(
|
|
5961
5970
|
`[ClawRouter] \u2717 Failed to read wallet file: ${err instanceof Error ? err.message : String(err)}`
|
|
5962
5971
|
);
|
|
5972
|
+
throw new Error(
|
|
5973
|
+
`Cannot read wallet file at ${WALLET_FILE}: ${err instanceof Error ? err.message : String(err)}. Refusing to auto-generate new wallet to protect existing funds. Fix file permissions or set BLOCKRUN_WALLET_KEY environment variable.`
|
|
5974
|
+
);
|
|
5963
5975
|
}
|
|
5964
5976
|
}
|
|
5965
5977
|
return void 0;
|
|
@@ -5980,6 +5992,20 @@ async function generateAndSaveWallet() {
|
|
|
5980
5992
|
`Failed to verify wallet file after creation: ${err instanceof Error ? err.message : String(err)}`
|
|
5981
5993
|
);
|
|
5982
5994
|
}
|
|
5995
|
+
console.log(`[ClawRouter]`);
|
|
5996
|
+
console.log(`[ClawRouter] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
5997
|
+
console.log(`[ClawRouter] NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW`);
|
|
5998
|
+
console.log(`[ClawRouter] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
5999
|
+
console.log(`[ClawRouter] Address : ${account.address}`);
|
|
6000
|
+
console.log(`[ClawRouter] Key file: ${WALLET_FILE}`);
|
|
6001
|
+
console.log(`[ClawRouter]`);
|
|
6002
|
+
console.log(`[ClawRouter] To back up, run in OpenClaw:`);
|
|
6003
|
+
console.log(`[ClawRouter] /wallet export`);
|
|
6004
|
+
console.log(`[ClawRouter]`);
|
|
6005
|
+
console.log(`[ClawRouter] To restore on another machine:`);
|
|
6006
|
+
console.log(`[ClawRouter] export BLOCKRUN_WALLET_KEY=<your_key>`);
|
|
6007
|
+
console.log(`[ClawRouter] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
6008
|
+
console.log(`[ClawRouter]`);
|
|
5983
6009
|
return { key, address: account.address };
|
|
5984
6010
|
}
|
|
5985
6011
|
async function resolveOrGenerateWalletKey() {
|
|
@@ -6331,7 +6357,12 @@ var activeProxyHandle = null;
|
|
|
6331
6357
|
async function startProxyInBackground(api) {
|
|
6332
6358
|
const { key: walletKey, address, source } = await resolveOrGenerateWalletKey();
|
|
6333
6359
|
if (source === "generated") {
|
|
6334
|
-
api.logger.
|
|
6360
|
+
api.logger.warn(`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
6361
|
+
api.logger.warn(` NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW!`);
|
|
6362
|
+
api.logger.warn(` Address : ${address}`);
|
|
6363
|
+
api.logger.warn(` Run /wallet export to get your private key`);
|
|
6364
|
+
api.logger.warn(` Losing this key = losing your USDC funds`);
|
|
6365
|
+
api.logger.warn(`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
6335
6366
|
} else if (source === "saved") {
|
|
6336
6367
|
api.logger.info(`Using saved wallet: ${address}`);
|
|
6337
6368
|
} else {
|
|
@@ -6541,6 +6572,7 @@ var plugin = {
|
|
|
6541
6572
|
lines.push(` ${svc.description}`);
|
|
6542
6573
|
lines.push(` Tool: \`${`blockrun_${svc.id}`}\``);
|
|
6543
6574
|
lines.push(` Pricing: ${svc.pricing.perUnit} per ${svc.pricing.unit} (min ${svc.pricing.minimum}, max ${svc.pricing.maximum})`);
|
|
6575
|
+
lines.push(` **How to use:** Ask "Look up Twitter user @elonmusk" or "Get info on these X accounts: @naval, @balajis"`);
|
|
6544
6576
|
lines.push("");
|
|
6545
6577
|
}
|
|
6546
6578
|
return { text: lines.join("\n") };
|
|
@@ -6586,7 +6618,12 @@ var plugin = {
|
|
|
6586
6618
|
if (!isGatewayMode()) {
|
|
6587
6619
|
resolveOrGenerateWalletKey().then(({ address, source }) => {
|
|
6588
6620
|
if (source === "generated") {
|
|
6589
|
-
api.logger.
|
|
6621
|
+
api.logger.warn(`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
6622
|
+
api.logger.warn(` NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW!`);
|
|
6623
|
+
api.logger.warn(` Address : ${address}`);
|
|
6624
|
+
api.logger.warn(` Run /wallet export to get your private key`);
|
|
6625
|
+
api.logger.warn(` Losing this key = losing your USDC funds`);
|
|
6626
|
+
api.logger.warn(`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
6590
6627
|
} else if (source === "saved") {
|
|
6591
6628
|
api.logger.info(`Using saved wallet: ${address}`);
|
|
6592
6629
|
} else {
|