@blockrun/clawrouter 0.12.4 → 0.12.6

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 CHANGED
@@ -1607,9 +1607,10 @@ function route(prompt, systemPrompt, maxOutputTokens, options) {
1607
1607
  const agenticScore = ruleResult.agenticScore ?? 0;
1608
1608
  const isAutoAgentic = agenticScore >= 0.5;
1609
1609
  const isExplicitAgentic = config.overrides.agenticMode ?? false;
1610
- const useAgenticTiers = (isAutoAgentic || isExplicitAgentic) && config.agenticTiers != null;
1610
+ const hasToolsInRequest = options.hasTools ?? false;
1611
+ const useAgenticTiers = (hasToolsInRequest || isAutoAgentic || isExplicitAgentic) && config.agenticTiers != null;
1611
1612
  tierConfigs = useAgenticTiers ? config.agenticTiers : config.tiers;
1612
- profileSuffix = useAgenticTiers ? " | agentic" : "";
1613
+ profileSuffix = useAgenticTiers ? ` | agentic${hasToolsInRequest ? " (tools)" : ""}` : "";
1613
1614
  }
1614
1615
  const agenticScoreValue = ruleResult.agenticScore;
1615
1616
  if (estimatedTokens > config.overrides.maxTokensForceComplex) {
@@ -3571,6 +3572,11 @@ function deriveAllKeys(mnemonic) {
3571
3572
  const solanaPrivateKeyBytes = deriveSolanaKeyBytes(mnemonic);
3572
3573
  return { mnemonic, evmPrivateKey, evmAddress, solanaPrivateKeyBytes };
3573
3574
  }
3575
+ async function getSolanaAddress(privateKeyBytes) {
3576
+ const { createKeyPairSignerFromPrivateKeyBytes } = await import("@solana/kit");
3577
+ const signer = await createKeyPairSignerFromPrivateKeyBytes(privateKeyBytes);
3578
+ return signer.address;
3579
+ }
3574
3580
 
3575
3581
  // src/auth.ts
3576
3582
  var WALLET_DIR = join4(homedir3(), ".openclaw", "blockrun");
@@ -3648,13 +3654,21 @@ async function generateAndSaveWallet() {
3648
3654
  { cause: err }
3649
3655
  );
3650
3656
  }
3657
+ let solanaAddress;
3658
+ try {
3659
+ solanaAddress = await getSolanaAddress(derived.solanaPrivateKeyBytes);
3660
+ } catch {
3661
+ }
3651
3662
  console.log(`[ClawRouter]`);
3652
3663
  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`);
3653
3664
  console.log(`[ClawRouter] NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW`);
3654
3665
  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`);
3655
- console.log(`[ClawRouter] EVM Address : ${derived.evmAddress}`);
3656
- console.log(`[ClawRouter] Key file : ${WALLET_FILE}`);
3657
- console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
3666
+ console.log(`[ClawRouter] EVM Address : ${derived.evmAddress}`);
3667
+ if (solanaAddress) {
3668
+ console.log(`[ClawRouter] Solana Address : ${solanaAddress}`);
3669
+ }
3670
+ console.log(`[ClawRouter] Key file : ${WALLET_FILE}`);
3671
+ console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
3658
3672
  console.log(`[ClawRouter]`);
3659
3673
  console.log(`[ClawRouter] Both EVM (Base) and Solana wallets are ready.`);
3660
3674
  console.log(`[ClawRouter] To back up, run in OpenClaw:`);
@@ -6293,7 +6307,7 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
6293
6307
  const tools = parsed.tools;
6294
6308
  hasTools = Array.isArray(tools) && tools.length > 0;
6295
6309
  if (hasTools && tools) {
6296
- console.log(`[ClawRouter] Tools detected (${tools.length}), agentic mode via keywords`);
6310
+ console.log(`[ClawRouter] Tools detected (${tools.length}), forcing agentic tiers`);
6297
6311
  }
6298
6312
  hasVision = parsedMessages.some((m) => {
6299
6313
  if (Array.isArray(m.content)) {
@@ -6306,7 +6320,8 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
6306
6320
  }
6307
6321
  routingDecision = route(prompt, systemPrompt, maxTokens, {
6308
6322
  ...routerOpts,
6309
- routingProfile: routingProfile ?? void 0
6323
+ routingProfile: routingProfile ?? void 0,
6324
+ hasTools
6310
6325
  });
6311
6326
  if (existingSession) {
6312
6327
  const tierRank = {
@@ -7087,18 +7102,26 @@ function collectSystemInfo() {
7087
7102
  }
7088
7103
  async function collectWalletInfo() {
7089
7104
  try {
7090
- const { key, address, source } = await resolveOrGenerateWalletKey();
7105
+ const { key, address, source, solanaPrivateKeyBytes } = await resolveOrGenerateWalletKey();
7091
7106
  if (!key || !address) {
7092
7107
  return {
7093
7108
  exists: false,
7094
7109
  valid: false,
7095
7110
  address: null,
7111
+ solanaAddress: null,
7096
7112
  balance: null,
7097
7113
  isLow: false,
7098
7114
  isEmpty: true,
7099
7115
  source: null
7100
7116
  };
7101
7117
  }
7118
+ let solanaAddress = null;
7119
+ if (solanaPrivateKeyBytes) {
7120
+ try {
7121
+ solanaAddress = await getSolanaAddress(solanaPrivateKeyBytes);
7122
+ } catch {
7123
+ }
7124
+ }
7102
7125
  const monitor = new BalanceMonitor(address);
7103
7126
  try {
7104
7127
  const balanceInfo = await monitor.checkBalance();
@@ -7106,6 +7129,7 @@ async function collectWalletInfo() {
7106
7129
  exists: true,
7107
7130
  valid: true,
7108
7131
  address,
7132
+ solanaAddress,
7109
7133
  balance: balanceInfo.balanceUSD,
7110
7134
  isLow: balanceInfo.isLow,
7111
7135
  isEmpty: balanceInfo.isEmpty,
@@ -7116,6 +7140,7 @@ async function collectWalletInfo() {
7116
7140
  exists: true,
7117
7141
  valid: true,
7118
7142
  address,
7143
+ solanaAddress,
7119
7144
  balance: null,
7120
7145
  isLow: false,
7121
7146
  isEmpty: false,
@@ -7127,6 +7152,7 @@ async function collectWalletInfo() {
7127
7152
  exists: false,
7128
7153
  valid: false,
7129
7154
  address: null,
7155
+ solanaAddress: null,
7130
7156
  balance: null,
7131
7157
  isLow: false,
7132
7158
  isEmpty: true,
@@ -7208,7 +7234,10 @@ function printDiagnostics(result) {
7208
7234
  console.log("\nWallet");
7209
7235
  if (result.wallet.exists && result.wallet.valid) {
7210
7236
  console.log(` ${green(`Key: ${WALLET_FILE} (${result.wallet.source})`)}`);
7211
- console.log(` ${green(`Address: ${result.wallet.address}`)}`);
7237
+ console.log(` ${green(`EVM Address: ${result.wallet.address}`)}`);
7238
+ if (result.wallet.solanaAddress) {
7239
+ console.log(` ${green(`Solana Address: ${result.wallet.solanaAddress}`)}`);
7240
+ }
7212
7241
  if (result.wallet.isEmpty) {
7213
7242
  console.log(` ${red(`Balance: $0.00 - NEED TO FUND!`)}`);
7214
7243
  } else if (result.wallet.isLow) {
@@ -7263,7 +7292,10 @@ var DOCTOR_MODELS = {
7263
7292
  async function analyzeWithAI(diagnostics, userQuestion, model = "sonnet") {
7264
7293
  if (diagnostics.wallet.isEmpty) {
7265
7294
  console.log("\n\u{1F4B3} Wallet is empty - cannot call AI for analysis.");
7266
- console.log(` Fund your wallet with USDC on Base: ${diagnostics.wallet.address}`);
7295
+ console.log(` Fund your EVM wallet with USDC on Base: ${diagnostics.wallet.address}`);
7296
+ if (diagnostics.wallet.solanaAddress) {
7297
+ console.log(` Fund your Solana wallet with USDC: ${diagnostics.wallet.solanaAddress}`);
7298
+ }
7267
7299
  console.log(" Get USDC: https://www.coinbase.com/price/usd-coin");
7268
7300
  console.log(" Bridge to Base: https://bridge.base.org\n");
7269
7301
  return;
@@ -7555,6 +7587,13 @@ ClawRouter Partner APIs (v${VERSION})
7555
7587
  } else {
7556
7588
  console.log(`[ClawRouter] Using wallet from BLOCKRUN_WALLET_KEY: ${wallet.address}`);
7557
7589
  }
7590
+ if (wallet.solanaPrivateKeyBytes) {
7591
+ try {
7592
+ const solAddr = await getSolanaAddress(wallet.solanaPrivateKeyBytes);
7593
+ console.log(`[ClawRouter] Solana address: ${solAddr}`);
7594
+ } catch {
7595
+ }
7596
+ }
7558
7597
  const proxy = await startProxy({
7559
7598
  wallet,
7560
7599
  port: args.port,