@blockrun/clawrouter 0.8.19 → 0.8.20

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/README.md CHANGED
@@ -21,10 +21,10 @@ One wallet, 30+ models, zero API keys.
21
21
  ---
22
22
 
23
23
  ```
24
- "What is 2+2?" → DeepSeek $0.27/M saved 99%
25
- "Summarize this article" → GPT-4o-mini $0.60/M saved 99%
26
- "Build a React component" → Claude Sonnet $15.00/M best balance
27
- "Prove this theorem" → DeepSeek-R $0.42/M reasoning
24
+ "What is 2+2?" → NVIDIA Kimi $0.001/M saved ~100%
25
+ "Summarize this article" → Grok Code Fast $1.50/M saved 94%
26
+ "Build a React component" → Gemini 2.5 Pro $10.00/M best balance
27
+ "Prove this theorem" → Grok 4.1 Fast $0.50/M reasoning
28
28
  "Run 50 parallel searches"→ Kimi K2.5 $2.40/M agentic swarm
29
29
  ```
30
30
 
@@ -112,18 +112,18 @@ Request → Weighted Scorer (15 dimensions)
112
112
  └── Low confidence → Default to MEDIUM tier → Done
113
113
  ```
114
114
 
115
- No external classifier calls. Ambiguous queries default to the MEDIUM tier (DeepSeek/GPT-4o-mini) — fast, cheap, and good enough for most tasks.
115
+ No external classifier calls. Ambiguous queries default to the MEDIUM tier (Grok Code Fast) — fast, cheap, and good enough for most tasks.
116
116
 
117
117
  **Deep dive:** [15-dimension scoring weights](docs/configuration.md#scoring-weights) | [Architecture](docs/architecture.md)
118
118
 
119
119
  ### Tier → Model Mapping
120
120
 
121
- | Tier | Primary Model | Cost/M | Savings vs Opus |
122
- | --------- | --------------------- | ------ | --------------- |
123
- | SIMPLE | gemini-2.5-flash | $0.60 | **99.2%** |
124
- | MEDIUM | grok-code-fast-1 | $1.50 | **98.0%** |
125
- | COMPLEX | gemini-2.5-pro | $10.00 | **86.7%** |
126
- | REASONING | grok-4-fast-reasoning | $0.50 | **99.3%** |
121
+ | Tier | Primary Model | Cost/M | Savings vs Opus |
122
+ | --------- | --------------------- | ------- | --------------- |
123
+ | SIMPLE | nvidia/kimi-k2.5 | $0.001 | **~100%** |
124
+ | MEDIUM | grok-code-fast-1 | $1.50 | **94.0%** |
125
+ | COMPLEX | gemini-2.5-pro | $10.00 | **60.0%** |
126
+ | REASONING | grok-4-1-fast-reasoning | $0.50 | **98.0%** |
127
127
 
128
128
  Special rule: 2+ reasoning markers → REASONING at 0.97 confidence.
129
129
 
@@ -144,13 +144,13 @@ ClawRouter v0.5+ includes intelligent features that work automatically:
144
144
 
145
145
  | Tier | % of Traffic | Cost/M |
146
146
  | ------------------- | ------------ | ----------- |
147
- | SIMPLE | ~45% | $0.27 |
148
- | MEDIUM | ~35% | $0.60 |
149
- | COMPLEX | ~15% | $15.00 |
150
- | REASONING | ~5% | $10.00 |
151
- | **Blended average** | | **$3.17/M** |
147
+ | SIMPLE | ~45% | $0.001 |
148
+ | MEDIUM | ~35% | $1.50 |
149
+ | COMPLEX | ~15% | $10.00 |
150
+ | REASONING | ~5% | $0.50 |
151
+ | **Blended average** | | **$2.05/M** |
152
152
 
153
- Compared to **$75/M** for Claude Opus = **96% savings** on a typical workload.
153
+ Compared to **$25/M** for Claude Opus = **92% savings** on a typical workload.
154
154
 
155
155
  ---
156
156
 
package/dist/cli.js CHANGED
@@ -2312,8 +2312,28 @@ function transformPaymentError(errorBody) {
2312
2312
  });
2313
2313
  }
2314
2314
  }
2315
+ if (innerJson.invalidReason === "invalid_payload") {
2316
+ return JSON.stringify({
2317
+ error: {
2318
+ message: "Payment signature invalid. This may be a temporary issue.",
2319
+ type: "invalid_payload",
2320
+ help: "Try again. If this persists, reinstall ClawRouter: curl -fsSL https://blockrun.ai/ClawRouter-update | bash"
2321
+ }
2322
+ });
2323
+ }
2315
2324
  }
2316
2325
  }
2326
+ if (parsed.error === "Settlement failed" || parsed.details?.includes("Settlement failed")) {
2327
+ const details = parsed.details || "";
2328
+ const gasError = details.includes("unable to estimate gas");
2329
+ return JSON.stringify({
2330
+ error: {
2331
+ message: gasError ? "Payment failed: network congestion or gas issue. Try again." : "Payment settlement failed. Try again in a moment.",
2332
+ type: "settlement_failed",
2333
+ help: "This is usually temporary. If it persists, try: /model free"
2334
+ }
2335
+ });
2336
+ }
2317
2337
  } catch {
2318
2338
  }
2319
2339
  return errorBody;