@blockrun/clawrouter 0.12.67 → 0.12.69

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
@@ -24423,6 +24423,23 @@ var init_solana_balance = __esm({
24423
24423
  getWalletAddress() {
24424
24424
  return this.walletAddress;
24425
24425
  }
24426
+ /**
24427
+ * Check native SOL balance (in lamports). Useful for detecting users who
24428
+ * funded with SOL instead of USDC.
24429
+ */
24430
+ async checkSolBalance() {
24431
+ const controller = new AbortController();
24432
+ const timer = setTimeout(() => controller.abort(), BALANCE_TIMEOUT_MS);
24433
+ try {
24434
+ const owner = address(this.walletAddress);
24435
+ const response = await this.rpc.getBalance(owner).send({ abortSignal: controller.signal });
24436
+ return BigInt(response.value);
24437
+ } catch {
24438
+ return 0n;
24439
+ } finally {
24440
+ clearTimeout(timer);
24441
+ }
24442
+ }
24426
24443
  async fetchBalance() {
24427
24444
  const owner = address(this.walletAddress);
24428
24445
  const mint = address(SOLANA_USDC_MINT);
@@ -40189,8 +40206,12 @@ var DEFAULT_ROUTING_CONFIG = {
40189
40206
  // 1,431ms, IQ 32, 41% retention
40190
40207
  "moonshot/kimi-k2.5",
40191
40208
  // 1,646ms, IQ 47, strong quality
40209
+ "google/gemini-3.1-flash-lite",
40210
+ // $0.25/$1.50, 1M context — newest flash-lite
40192
40211
  "google/gemini-2.5-flash-lite",
40193
- // 1,353ms, 1M context, ultra cheap ($0.10/$0.40)
40212
+ // 1,353ms, $0.10/$0.40
40213
+ "openai/gpt-5.4-nano",
40214
+ // $0.20/$1.25, 1M context
40194
40215
  "xai/grok-4-fast-non-reasoning",
40195
40216
  // 1,143ms, $0.20/$0.50 — fast fallback
40196
40217
  "nvidia/gpt-oss-120b"
@@ -40207,8 +40228,10 @@ var DEFAULT_ROUTING_CONFIG = {
40207
40228
  // 1,431ms, IQ 32, 41% retention
40208
40229
  "google/gemini-2.5-flash",
40209
40230
  // 1,238ms, 60% retention
40231
+ "google/gemini-3.1-flash-lite",
40232
+ // $0.25/$1.50, 1M context
40210
40233
  "google/gemini-2.5-flash-lite",
40211
- // 1,353ms, 1M context ($0.10/$0.40)
40234
+ // 1,353ms, $0.10/$0.40
40212
40235
  "xai/grok-4-1-fast-non-reasoning",
40213
40236
  // 1,244ms, fast fallback
40214
40237
  "xai/grok-3-mini"
@@ -40258,28 +40281,33 @@ var DEFAULT_ROUTING_CONFIG = {
40258
40281
  primary: "nvidia/gpt-oss-120b",
40259
40282
  // 1,252ms, FREE! $0.00/$0.00
40260
40283
  fallback: [
40284
+ "google/gemini-3.1-flash-lite",
40285
+ // $0.25/$1.50 — newest flash-lite
40286
+ "openai/gpt-5.4-nano",
40287
+ // $0.20/$1.25 — fast nano
40261
40288
  "google/gemini-2.5-flash-lite",
40262
40289
  // 1,353ms, $0.10/$0.40
40263
- "xai/grok-4-fast-non-reasoning",
40290
+ "xai/grok-4-fast-non-reasoning"
40264
40291
  // 1,143ms, $0.20/$0.50
40265
- "google/gemini-2.5-flash"
40266
- // 1,238ms
40267
40292
  ]
40268
40293
  },
40269
40294
  MEDIUM: {
40270
- primary: "google/gemini-2.5-flash-lite",
40271
- // 1,353ms, $0.10/$0.40 - cheapest capable with 1M context
40295
+ primary: "google/gemini-3.1-flash-lite",
40296
+ // $0.25/$1.50 1M context, newest flash-lite
40272
40297
  fallback: [
40298
+ "openai/gpt-5.4-nano",
40299
+ // $0.20/$1.25, 1M context
40300
+ "google/gemini-2.5-flash-lite",
40301
+ // 1,353ms, $0.10/$0.40
40273
40302
  "xai/grok-4-fast-non-reasoning",
40274
40303
  "google/gemini-2.5-flash",
40275
- "deepseek/deepseek-chat",
40276
40304
  "nvidia/gpt-oss-120b"
40277
40305
  ]
40278
40306
  },
40279
40307
  COMPLEX: {
40280
- primary: "google/gemini-2.5-flash-lite",
40281
- // 1,353ms, $0.10/$0.40 - 1M context handles complexity
40282
- fallback: ["xai/grok-4-0709", "google/gemini-2.5-flash", "deepseek/deepseek-chat"]
40308
+ primary: "google/gemini-3.1-flash-lite",
40309
+ // $0.25/$1.50 1M context handles complexity
40310
+ fallback: ["google/gemini-2.5-flash-lite", "xai/grok-4-0709", "google/gemini-2.5-flash", "deepseek/deepseek-chat"]
40283
40311
  },
40284
40312
  REASONING: {
40285
40313
  primary: "xai/grok-4-1-fast-reasoning",
@@ -40444,6 +40472,9 @@ var MODEL_ALIASES = {
40444
40472
  gpt5: "openai/gpt-5.4",
40445
40473
  "gpt-5.4": "openai/gpt-5.4",
40446
40474
  "gpt-5.4-pro": "openai/gpt-5.4-pro",
40475
+ "gpt-5.4-nano": "openai/gpt-5.4-nano",
40476
+ nano: "openai/gpt-5.4-nano",
40477
+ "gpt-5-nano": "openai/gpt-5.4-nano",
40447
40478
  codex: "openai/gpt-5.3-codex",
40448
40479
  mini: "openai/gpt-4o-mini",
40449
40480
  o1: "openai/o1",
@@ -40461,6 +40492,7 @@ var MODEL_ALIASES = {
40461
40492
  flash: "google/gemini-2.5-flash",
40462
40493
  "gemini-3.1-pro-preview": "google/gemini-3.1-pro",
40463
40494
  "google/gemini-3.1-pro-preview": "google/gemini-3.1-pro",
40495
+ "gemini-3.1-flash-lite": "google/gemini-3.1-flash-lite",
40464
40496
  // xAI
40465
40497
  grok: "xai/grok-3",
40466
40498
  "grok-fast": "xai/grok-4-fast-reasoning",
@@ -40576,7 +40608,9 @@ var BLOCKRUN_MODELS = [
40576
40608
  outputPrice: 0.4,
40577
40609
  contextWindow: 128e3,
40578
40610
  maxOutput: 32768,
40579
- toolCalling: true
40611
+ toolCalling: true,
40612
+ deprecated: true,
40613
+ fallbackModel: "openai/gpt-5.4-nano"
40580
40614
  },
40581
40615
  {
40582
40616
  id: "openai/gpt-5.2-pro",
@@ -40614,6 +40648,16 @@ var BLOCKRUN_MODELS = [
40614
40648
  reasoning: true,
40615
40649
  toolCalling: true
40616
40650
  },
40651
+ {
40652
+ id: "openai/gpt-5.4-nano",
40653
+ name: "GPT-5.4 Nano",
40654
+ version: "5.4",
40655
+ inputPrice: 0.2,
40656
+ outputPrice: 1.25,
40657
+ contextWindow: 105e4,
40658
+ maxOutput: 32768,
40659
+ toolCalling: true
40660
+ },
40617
40661
  // OpenAI GPT-5.3 Family
40618
40662
  {
40619
40663
  id: "openai/gpt-5.3",
@@ -40858,6 +40902,16 @@ var BLOCKRUN_MODELS = [
40858
40902
  maxOutput: 65536,
40859
40903
  toolCalling: true
40860
40904
  },
40905
+ {
40906
+ id: "google/gemini-3.1-flash-lite",
40907
+ name: "Gemini 3.1 Flash Lite",
40908
+ version: "3.1",
40909
+ inputPrice: 0.25,
40910
+ outputPrice: 1.5,
40911
+ contextWindow: 1e6,
40912
+ maxOutput: 8192,
40913
+ toolCalling: true
40914
+ },
40861
40915
  // DeepSeek
40862
40916
  {
40863
40917
  id: "deepseek/deepseek-chat",