@blockrun/clawrouter 0.12.6 → 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/index.js CHANGED
@@ -723,12 +723,7 @@ var init_wallet = __esm({
723
723
  init_hmac();
724
724
  init_sha512();
725
725
  ETH_DERIVATION_PATH = "m/44'/60'/0'/0/0";
726
- SOLANA_HARDENED_INDICES = [
727
- 44 + 2147483648,
728
- 501 + 2147483648,
729
- 0 + 2147483648,
730
- 0 + 2147483648
731
- ];
726
+ SOLANA_HARDENED_INDICES = [44 + 2147483648, 501 + 2147483648, 0 + 2147483648, 0 + 2147483648];
732
727
  }
733
728
  });
734
729
 
@@ -852,11 +847,7 @@ async function sweepSolanaWallet(oldKeyBytes, newKeyBytes, rpcUrl) {
852
847
  let usdcBalance = 0n;
853
848
  const oldTokenAccounts = [];
854
849
  try {
855
- const response = await rpc.getTokenAccountsByOwner(
856
- solAddress2(oldAddress),
857
- { mint },
858
- { encoding: "jsonParsed" }
859
- ).send();
850
+ const response = await rpc.getTokenAccountsByOwner(solAddress2(oldAddress), { mint }, { encoding: "jsonParsed" }).send();
860
851
  if (response.value.length > 0) {
861
852
  for (const account of response.value) {
862
853
  const parsed = account.account.data;
@@ -920,10 +911,7 @@ async function sweepSolanaWallet(oldKeyBytes, newKeyBytes, rpcUrl) {
920
911
  (msg) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, msg),
921
912
  (msg) => appendTransactionMessageInstructions([createAtaIx, ...transferIxs], msg)
922
913
  );
923
- const txMessageWithSigners = addSignersToTransactionMessage(
924
- [newSigner, oldSigner],
925
- txMessage
926
- );
914
+ const txMessageWithSigners = addSignersToTransactionMessage([newSigner, oldSigner], txMessage);
927
915
  const signedTx = await signTransactionMessageWithSigners(txMessageWithSigners);
928
916
  const txSignature = getSignatureFromTransaction(signedTx);
929
917
  const wsUrl = url.replace("https://", "wss://").replace("http://", "ws://");
@@ -989,7 +977,9 @@ var MODEL_ALIASES = {
989
977
  // OpenAI
990
978
  gpt: "openai/gpt-4o",
991
979
  gpt4: "openai/gpt-4o",
992
- gpt5: "openai/gpt-5.2",
980
+ gpt5: "openai/gpt-5.4",
981
+ "gpt-5.4": "openai/gpt-5.4",
982
+ "gpt-5.4-pro": "openai/gpt-5.4-pro",
993
983
  codex: "openai/gpt-5.2-codex",
994
984
  mini: "openai/gpt-4o-mini",
995
985
  o1: "openai/o1",
@@ -1113,6 +1103,31 @@ var BLOCKRUN_MODELS = [
1113
1103
  reasoning: true,
1114
1104
  toolCalling: true
1115
1105
  },
1106
+ // GPT-5.4 — newest flagship, same input price as 4o but much more capable
1107
+ {
1108
+ id: "openai/gpt-5.4",
1109
+ name: "GPT-5.4",
1110
+ version: "5.4",
1111
+ inputPrice: 2.5,
1112
+ outputPrice: 15,
1113
+ contextWindow: 4e5,
1114
+ maxOutput: 128e3,
1115
+ reasoning: true,
1116
+ vision: true,
1117
+ agentic: true,
1118
+ toolCalling: true
1119
+ },
1120
+ {
1121
+ id: "openai/gpt-5.4-pro",
1122
+ name: "GPT-5.4 Pro",
1123
+ version: "5.4",
1124
+ inputPrice: 30,
1125
+ outputPrice: 180,
1126
+ contextWindow: 4e5,
1127
+ maxOutput: 128e3,
1128
+ reasoning: true,
1129
+ toolCalling: true
1130
+ },
1116
1131
  // OpenAI Codex Family
1117
1132
  {
1118
1133
  id: "openai/gpt-5.2-codex",
@@ -3052,8 +3067,8 @@ var DEFAULT_ROUTING_CONFIG = {
3052
3067
  "google/gemini-2.5-pro",
3053
3068
  "deepseek/deepseek-chat",
3054
3069
  "xai/grok-4-0709",
3055
- "openai/gpt-5.2",
3056
- // Newer and cheaper input than gpt-4o
3070
+ "openai/gpt-5.4",
3071
+ // Newest flagship, same price as 4o
3057
3072
  "openai/gpt-4o",
3058
3073
  "anthropic/claude-sonnet-4.6"
3059
3074
  ]
@@ -3119,6 +3134,8 @@ var DEFAULT_ROUTING_CONFIG = {
3119
3134
  primary: "anthropic/claude-opus-4.6",
3120
3135
  // Best quality for complex tasks
3121
3136
  fallback: [
3137
+ "openai/gpt-5.4",
3138
+ // Newest flagship
3122
3139
  "openai/gpt-5.2-codex",
3123
3140
  "anthropic/claude-opus-4.6",
3124
3141
  "anthropic/claude-sonnet-4.6",
@@ -3166,7 +3183,8 @@ var DEFAULT_ROUTING_CONFIG = {
3166
3183
  fallback: [
3167
3184
  "anthropic/claude-opus-4.6",
3168
3185
  // Latest Opus - best agentic
3169
- "openai/gpt-5.2",
3186
+ "openai/gpt-5.4",
3187
+ // Newest flagship
3170
3188
  "google/gemini-3.1-pro",
3171
3189
  // Newest Gemini
3172
3190
  "google/gemini-3-pro-preview",
@@ -7104,13 +7122,24 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
7104
7122
  `[ClawRouter] Context filter (~${estimatedTotalTokens} tokens): excluded ${contextExcluded.join(", ")}`
7105
7123
  );
7106
7124
  }
7107
- const toolFiltered = filterByToolCalling(contextFiltered, hasTools, supportsToolCalling);
7125
+ let toolFiltered = filterByToolCalling(contextFiltered, hasTools, supportsToolCalling);
7108
7126
  const toolExcluded = contextFiltered.filter((m) => !toolFiltered.includes(m));
7109
7127
  if (toolExcluded.length > 0) {
7110
7128
  console.log(
7111
7129
  `[ClawRouter] Tool-calling filter: excluded ${toolExcluded.join(", ")} (no structured function call support)`
7112
7130
  );
7113
7131
  }
7132
+ const TOOL_NONCOMPLIANT_MODELS = ["google/gemini-2.5-flash-lite"];
7133
+ if (hasTools && toolFiltered.length > 1) {
7134
+ const compliant = toolFiltered.filter((m) => !TOOL_NONCOMPLIANT_MODELS.includes(m));
7135
+ if (compliant.length > 0 && compliant.length < toolFiltered.length) {
7136
+ const dropped = toolFiltered.filter((m) => TOOL_NONCOMPLIANT_MODELS.includes(m));
7137
+ console.log(
7138
+ `[ClawRouter] Tool-compliance filter: excluded ${dropped.join(", ")} (unreliable tool schema handling)`
7139
+ );
7140
+ toolFiltered = compliant;
7141
+ }
7142
+ }
7114
7143
  const visionFiltered = filterByVision(toolFiltered, hasVision, supportsVision);
7115
7144
  const visionExcluded = toolFiltered.filter((m) => !visionFiltered.includes(m));
7116
7145
  if (visionExcluded.length > 0) {