@blockrun/clawrouter 0.12.69 → 0.12.70

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
@@ -44822,7 +44822,12 @@ var DEFAULT_ROUTING_CONFIG = {
44822
44822
  COMPLEX: {
44823
44823
  primary: "google/gemini-3.1-flash-lite",
44824
44824
  // $0.25/$1.50 — 1M context handles complexity
44825
- fallback: ["google/gemini-2.5-flash-lite", "xai/grok-4-0709", "google/gemini-2.5-flash", "deepseek/deepseek-chat"]
44825
+ fallback: [
44826
+ "google/gemini-2.5-flash-lite",
44827
+ "xai/grok-4-0709",
44828
+ "google/gemini-2.5-flash",
44829
+ "deepseek/deepseek-chat"
44830
+ ]
44826
44831
  },
44827
44832
  REASONING: {
44828
44833
  primary: "xai/grok-4-1-fast-reasoning",
@@ -47774,11 +47779,20 @@ function estimateAmount(modelId, bodyLength, maxTokens) {
47774
47779
  return amountMicros.toString();
47775
47780
  }
47776
47781
  var IMAGE_PRICING = {
47777
- "openai/dall-e-3": { default: 0.04, sizes: { "1024x1024": 0.04, "1792x1024": 0.08, "1024x1792": 0.08 } },
47778
- "openai/gpt-image-1": { default: 0.02, sizes: { "1024x1024": 0.02, "1536x1024": 0.04, "1024x1536": 0.04 } },
47782
+ "openai/dall-e-3": {
47783
+ default: 0.04,
47784
+ sizes: { "1024x1024": 0.04, "1792x1024": 0.08, "1024x1792": 0.08 }
47785
+ },
47786
+ "openai/gpt-image-1": {
47787
+ default: 0.02,
47788
+ sizes: { "1024x1024": 0.02, "1536x1024": 0.04, "1024x1536": 0.04 }
47789
+ },
47779
47790
  "black-forest/flux-1.1-pro": { default: 0.04 },
47780
47791
  "google/nano-banana": { default: 0.05 },
47781
- "google/nano-banana-pro": { default: 0.1, sizes: { "1024x1024": 0.1, "2048x2048": 0.1, "4096x4096": 0.15 } }
47792
+ "google/nano-banana-pro": {
47793
+ default: 0.1,
47794
+ sizes: { "1024x1024": 0.1, "2048x2048": 0.1, "4096x4096": 0.15 }
47795
+ }
47782
47796
  };
47783
47797
  function estimateImageCost(model, size5, n = 1) {
47784
47798
  const pricing = IMAGE_PRICING[model];
@@ -48334,7 +48348,13 @@ async function startProxy(options) {
48334
48348
  }
48335
48349
  if (req.url?.match(/^\/v1\/(?:x|partner)\//)) {
48336
48350
  try {
48337
- await proxyPartnerRequest(req, res, apiBase, payFetch, () => paymentStore.getStore()?.amountUsd ?? 0);
48351
+ await proxyPartnerRequest(
48352
+ req,
48353
+ res,
48354
+ apiBase,
48355
+ payFetch,
48356
+ () => paymentStore.getStore()?.amountUsd ?? 0
48357
+ );
48338
48358
  } catch (err) {
48339
48359
  const error = err instanceof Error ? err : new Error(String(err));
48340
48360
  options.onError?.(error);
@@ -50823,8 +50843,9 @@ function injectModelsConfig(logger) {
50823
50843
  needsWrite = true;
50824
50844
  }
50825
50845
  const defaults = agents.defaults;
50826
- if (!defaults.model) {
50827
- defaults.model = {};
50846
+ if (!defaults.model || typeof defaults.model !== "object" || Array.isArray(defaults.model)) {
50847
+ const prev = typeof defaults.model === "string" ? defaults.model : void 0;
50848
+ defaults.model = prev ? { primary: prev } : {};
50828
50849
  needsWrite = true;
50829
50850
  }
50830
50851
  const model = defaults.model;
@@ -51033,9 +51054,7 @@ async function startProxyInBackground(api) {
51033
51054
  }
51034
51055
  if (currentChain === "solana" && (balance.isEmpty || balance.isLow)) {
51035
51056
  try {
51036
- const { SolanaBalanceMonitor: SolanaBalanceMonitor2 } = await Promise.resolve().then(() => (init_solana_balance(), solana_balance_exports));
51037
- const monitor = proxy.balanceMonitor;
51038
- const solLamports = await monitor.checkSolBalance();
51057
+ const solLamports = await proxy.balanceMonitor.checkSolBalance();
51039
51058
  if (solLamports > 10000000n) {
51040
51059
  const sol = Number(solLamports) / 1e9;
51041
51060
  api.logger.info(