@blockrun/clawrouter 0.12.5 → 0.12.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 CHANGED
@@ -1449,8 +1449,8 @@ var DEFAULT_ROUTING_CONFIG = {
1449
1449
  "google/gemini-2.5-pro",
1450
1450
  "deepseek/deepseek-chat",
1451
1451
  "xai/grok-4-0709",
1452
- "openai/gpt-5.2",
1453
- // Newer and cheaper input than gpt-4o
1452
+ "openai/gpt-5.4",
1453
+ // Newest flagship, same price as 4o
1454
1454
  "openai/gpt-4o",
1455
1455
  "anthropic/claude-sonnet-4.6"
1456
1456
  ]
@@ -1516,6 +1516,8 @@ var DEFAULT_ROUTING_CONFIG = {
1516
1516
  primary: "anthropic/claude-opus-4.6",
1517
1517
  // Best quality for complex tasks
1518
1518
  fallback: [
1519
+ "openai/gpt-5.4",
1520
+ // Newest flagship
1519
1521
  "openai/gpt-5.2-codex",
1520
1522
  "anthropic/claude-opus-4.6",
1521
1523
  "anthropic/claude-sonnet-4.6",
@@ -1563,7 +1565,8 @@ var DEFAULT_ROUTING_CONFIG = {
1563
1565
  fallback: [
1564
1566
  "anthropic/claude-opus-4.6",
1565
1567
  // Latest Opus - best agentic
1566
- "openai/gpt-5.2",
1568
+ "openai/gpt-5.4",
1569
+ // Newest flagship
1567
1570
  "google/gemini-3.1-pro",
1568
1571
  // Newest Gemini
1569
1572
  "google/gemini-3-pro-preview",
@@ -1692,7 +1695,9 @@ var MODEL_ALIASES = {
1692
1695
  // OpenAI
1693
1696
  gpt: "openai/gpt-4o",
1694
1697
  gpt4: "openai/gpt-4o",
1695
- gpt5: "openai/gpt-5.2",
1698
+ gpt5: "openai/gpt-5.4",
1699
+ "gpt-5.4": "openai/gpt-5.4",
1700
+ "gpt-5.4-pro": "openai/gpt-5.4-pro",
1696
1701
  codex: "openai/gpt-5.2-codex",
1697
1702
  mini: "openai/gpt-4o-mini",
1698
1703
  o1: "openai/o1",
@@ -1816,6 +1821,31 @@ var BLOCKRUN_MODELS = [
1816
1821
  reasoning: true,
1817
1822
  toolCalling: true
1818
1823
  },
1824
+ // GPT-5.4 — newest flagship, same input price as 4o but much more capable
1825
+ {
1826
+ id: "openai/gpt-5.4",
1827
+ name: "GPT-5.4",
1828
+ version: "5.4",
1829
+ inputPrice: 2.5,
1830
+ outputPrice: 15,
1831
+ contextWindow: 4e5,
1832
+ maxOutput: 128e3,
1833
+ reasoning: true,
1834
+ vision: true,
1835
+ agentic: true,
1836
+ toolCalling: true
1837
+ },
1838
+ {
1839
+ id: "openai/gpt-5.4-pro",
1840
+ name: "GPT-5.4 Pro",
1841
+ version: "5.4",
1842
+ inputPrice: 30,
1843
+ outputPrice: 180,
1844
+ contextWindow: 4e5,
1845
+ maxOutput: 128e3,
1846
+ reasoning: true,
1847
+ toolCalling: true
1848
+ },
1819
1849
  // OpenAI Codex Family
1820
1850
  {
1821
1851
  id: "openai/gpt-5.2-codex",
@@ -3520,12 +3550,7 @@ var sha5122 = sha512;
3520
3550
  // src/wallet.ts
3521
3551
  import { privateKeyToAccount } from "viem/accounts";
3522
3552
  var ETH_DERIVATION_PATH = "m/44'/60'/0'/0/0";
3523
- var SOLANA_HARDENED_INDICES = [
3524
- 44 + 2147483648,
3525
- 501 + 2147483648,
3526
- 0 + 2147483648,
3527
- 0 + 2147483648
3528
- ];
3553
+ var SOLANA_HARDENED_INDICES = [44 + 2147483648, 501 + 2147483648, 0 + 2147483648, 0 + 2147483648];
3529
3554
  function generateWalletMnemonic() {
3530
3555
  return generateMnemonic(english, 256);
3531
3556
  }
@@ -3572,6 +3597,11 @@ function deriveAllKeys(mnemonic) {
3572
3597
  const solanaPrivateKeyBytes = deriveSolanaKeyBytes(mnemonic);
3573
3598
  return { mnemonic, evmPrivateKey, evmAddress, solanaPrivateKeyBytes };
3574
3599
  }
3600
+ async function getSolanaAddress(privateKeyBytes) {
3601
+ const { createKeyPairSignerFromPrivateKeyBytes } = await import("@solana/kit");
3602
+ const signer = await createKeyPairSignerFromPrivateKeyBytes(privateKeyBytes);
3603
+ return signer.address;
3604
+ }
3575
3605
 
3576
3606
  // src/auth.ts
3577
3607
  var WALLET_DIR = join4(homedir3(), ".openclaw", "blockrun");
@@ -3649,13 +3679,21 @@ async function generateAndSaveWallet() {
3649
3679
  { cause: err }
3650
3680
  );
3651
3681
  }
3682
+ let solanaAddress;
3683
+ try {
3684
+ solanaAddress = await getSolanaAddress(derived.solanaPrivateKeyBytes);
3685
+ } catch {
3686
+ }
3652
3687
  console.log(`[ClawRouter]`);
3653
3688
  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`);
3654
3689
  console.log(`[ClawRouter] NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW`);
3655
3690
  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`);
3656
- console.log(`[ClawRouter] EVM Address : ${derived.evmAddress}`);
3657
- console.log(`[ClawRouter] Key file : ${WALLET_FILE}`);
3658
- console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
3691
+ console.log(`[ClawRouter] EVM Address : ${derived.evmAddress}`);
3692
+ if (solanaAddress) {
3693
+ console.log(`[ClawRouter] Solana Address : ${solanaAddress}`);
3694
+ }
3695
+ console.log(`[ClawRouter] Key file : ${WALLET_FILE}`);
3696
+ console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
3659
3697
  console.log(`[ClawRouter]`);
3660
3698
  console.log(`[ClawRouter] Both EVM (Base) and Solana wallets are ready.`);
3661
3699
  console.log(`[ClawRouter] To back up, run in OpenClaw:`);
@@ -6600,13 +6638,24 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
6600
6638
  `[ClawRouter] Context filter (~${estimatedTotalTokens} tokens): excluded ${contextExcluded.join(", ")}`
6601
6639
  );
6602
6640
  }
6603
- const toolFiltered = filterByToolCalling(contextFiltered, hasTools, supportsToolCalling);
6641
+ let toolFiltered = filterByToolCalling(contextFiltered, hasTools, supportsToolCalling);
6604
6642
  const toolExcluded = contextFiltered.filter((m) => !toolFiltered.includes(m));
6605
6643
  if (toolExcluded.length > 0) {
6606
6644
  console.log(
6607
6645
  `[ClawRouter] Tool-calling filter: excluded ${toolExcluded.join(", ")} (no structured function call support)`
6608
6646
  );
6609
6647
  }
6648
+ const TOOL_NONCOMPLIANT_MODELS = ["google/gemini-2.5-flash-lite"];
6649
+ if (hasTools && toolFiltered.length > 1) {
6650
+ const compliant = toolFiltered.filter((m) => !TOOL_NONCOMPLIANT_MODELS.includes(m));
6651
+ if (compliant.length > 0 && compliant.length < toolFiltered.length) {
6652
+ const dropped = toolFiltered.filter((m) => TOOL_NONCOMPLIANT_MODELS.includes(m));
6653
+ console.log(
6654
+ `[ClawRouter] Tool-compliance filter: excluded ${dropped.join(", ")} (unreliable tool schema handling)`
6655
+ );
6656
+ toolFiltered = compliant;
6657
+ }
6658
+ }
6610
6659
  const visionFiltered = filterByVision(toolFiltered, hasVision, supportsVision);
6611
6660
  const visionExcluded = toolFiltered.filter((m) => !visionFiltered.includes(m));
6612
6661
  if (visionExcluded.length > 0) {
@@ -7089,18 +7138,26 @@ function collectSystemInfo() {
7089
7138
  }
7090
7139
  async function collectWalletInfo() {
7091
7140
  try {
7092
- const { key, address, source } = await resolveOrGenerateWalletKey();
7141
+ const { key, address, source, solanaPrivateKeyBytes } = await resolveOrGenerateWalletKey();
7093
7142
  if (!key || !address) {
7094
7143
  return {
7095
7144
  exists: false,
7096
7145
  valid: false,
7097
7146
  address: null,
7147
+ solanaAddress: null,
7098
7148
  balance: null,
7099
7149
  isLow: false,
7100
7150
  isEmpty: true,
7101
7151
  source: null
7102
7152
  };
7103
7153
  }
7154
+ let solanaAddress = null;
7155
+ if (solanaPrivateKeyBytes) {
7156
+ try {
7157
+ solanaAddress = await getSolanaAddress(solanaPrivateKeyBytes);
7158
+ } catch {
7159
+ }
7160
+ }
7104
7161
  const monitor = new BalanceMonitor(address);
7105
7162
  try {
7106
7163
  const balanceInfo = await monitor.checkBalance();
@@ -7108,6 +7165,7 @@ async function collectWalletInfo() {
7108
7165
  exists: true,
7109
7166
  valid: true,
7110
7167
  address,
7168
+ solanaAddress,
7111
7169
  balance: balanceInfo.balanceUSD,
7112
7170
  isLow: balanceInfo.isLow,
7113
7171
  isEmpty: balanceInfo.isEmpty,
@@ -7118,6 +7176,7 @@ async function collectWalletInfo() {
7118
7176
  exists: true,
7119
7177
  valid: true,
7120
7178
  address,
7179
+ solanaAddress,
7121
7180
  balance: null,
7122
7181
  isLow: false,
7123
7182
  isEmpty: false,
@@ -7129,6 +7188,7 @@ async function collectWalletInfo() {
7129
7188
  exists: false,
7130
7189
  valid: false,
7131
7190
  address: null,
7191
+ solanaAddress: null,
7132
7192
  balance: null,
7133
7193
  isLow: false,
7134
7194
  isEmpty: true,
@@ -7210,7 +7270,10 @@ function printDiagnostics(result) {
7210
7270
  console.log("\nWallet");
7211
7271
  if (result.wallet.exists && result.wallet.valid) {
7212
7272
  console.log(` ${green(`Key: ${WALLET_FILE} (${result.wallet.source})`)}`);
7213
- console.log(` ${green(`Address: ${result.wallet.address}`)}`);
7273
+ console.log(` ${green(`EVM Address: ${result.wallet.address}`)}`);
7274
+ if (result.wallet.solanaAddress) {
7275
+ console.log(` ${green(`Solana Address: ${result.wallet.solanaAddress}`)}`);
7276
+ }
7214
7277
  if (result.wallet.isEmpty) {
7215
7278
  console.log(` ${red(`Balance: $0.00 - NEED TO FUND!`)}`);
7216
7279
  } else if (result.wallet.isLow) {
@@ -7265,7 +7328,10 @@ var DOCTOR_MODELS = {
7265
7328
  async function analyzeWithAI(diagnostics, userQuestion, model = "sonnet") {
7266
7329
  if (diagnostics.wallet.isEmpty) {
7267
7330
  console.log("\n\u{1F4B3} Wallet is empty - cannot call AI for analysis.");
7268
- console.log(` Fund your wallet with USDC on Base: ${diagnostics.wallet.address}`);
7331
+ console.log(` Fund your EVM wallet with USDC on Base: ${diagnostics.wallet.address}`);
7332
+ if (diagnostics.wallet.solanaAddress) {
7333
+ console.log(` Fund your Solana wallet with USDC: ${diagnostics.wallet.solanaAddress}`);
7334
+ }
7269
7335
  console.log(" Get USDC: https://www.coinbase.com/price/usd-coin");
7270
7336
  console.log(" Bridge to Base: https://bridge.base.org\n");
7271
7337
  return;
@@ -7557,6 +7623,13 @@ ClawRouter Partner APIs (v${VERSION})
7557
7623
  } else {
7558
7624
  console.log(`[ClawRouter] Using wallet from BLOCKRUN_WALLET_KEY: ${wallet.address}`);
7559
7625
  }
7626
+ if (wallet.solanaPrivateKeyBytes) {
7627
+ try {
7628
+ const solAddr = await getSolanaAddress(wallet.solanaPrivateKeyBytes);
7629
+ console.log(`[ClawRouter] Solana address: ${solAddr}`);
7630
+ } catch {
7631
+ }
7632
+ }
7560
7633
  const proxy = await startProxy({
7561
7634
  wallet,
7562
7635
  port: args.port,