@blockrun/clawrouter 0.10.11 → 0.10.13
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 +2 -2
- package/dist/cli.js +23 -21
- package/dist/cli.js.map +1 -1
- package/dist/index.js +129 -165
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ One wallet, 41+ models, zero API keys.
|
|
|
10
10
|
|
|
11
11
|
<img src="https://img.shields.io/badge/🚀_92%25_Cost_Savings-success?style=for-the-badge" alt="92% savings">
|
|
12
12
|
<img src="https://img.shields.io/badge/🔑_Zero_API_Keys-blue?style=for-the-badge" alt="No API keys">
|
|
13
|
-
<img src="https://img.shields.io/badge/🤖_41+_Models-purple?style=for-the-badge" alt="
|
|
13
|
+
<img src="https://img.shields.io/badge/🤖_41+_Models-purple?style=for-the-badge" alt="41+ models">
|
|
14
14
|
<img src="https://img.shields.io/badge/💰_Non--Custodial-orange?style=for-the-badge" alt="Non-custodial">
|
|
15
15
|
<img src="https://img.shields.io/badge/⚡_<1ms_Routing-yellow?style=for-the-badge" alt="Fast routing">
|
|
16
16
|
|
|
@@ -120,7 +120,7 @@ Request → Weighted Scorer (15 dimensions) → Tier → Cheapest Model → Resp
|
|
|
120
120
|
| claude-sonnet-4.6 | $3.00 | $15.00 | 200K | \* |
|
|
121
121
|
| claude-haiku-4.5 | $1.00 | $5.00 | 200K | |
|
|
122
122
|
| **Google** | | | | |
|
|
123
|
-
| gemini-3.1-pro
|
|
123
|
+
| gemini-3.1-pro | $2.00 | $12.00 | 1M | \* |
|
|
124
124
|
| gemini-3-pro-preview | $2.00 | $12.00 | 1M | \* |
|
|
125
125
|
| gemini-3-flash-preview | $0.50 | $3.00 | 1M | |
|
|
126
126
|
| gemini-2.5-pro | $1.25 | $10.00 | 1M | \* |
|
package/dist/cli.js
CHANGED
|
@@ -356,20 +356,18 @@ function scoreAgenticTask(text, keywords) {
|
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
359
|
-
const text = `${systemPrompt ?? ""} ${prompt}`.toLowerCase();
|
|
360
359
|
const userText = prompt.toLowerCase();
|
|
361
360
|
const dimensions = [
|
|
362
|
-
//
|
|
361
|
+
// Token count uses total estimated tokens (system + user) — context size matters for model selection
|
|
363
362
|
scoreTokenCount(estimatedTokens, config.tokenCountThresholds),
|
|
364
363
|
scoreKeywordMatch(
|
|
365
|
-
|
|
364
|
+
userText,
|
|
366
365
|
config.codeKeywords,
|
|
367
366
|
"codePresence",
|
|
368
367
|
"code",
|
|
369
368
|
{ low: 1, high: 2 },
|
|
370
369
|
{ none: 0, low: 0.5, high: 1 }
|
|
371
370
|
),
|
|
372
|
-
// Reasoning markers use USER prompt only — system prompt "step by step" shouldn't trigger reasoning
|
|
373
371
|
scoreKeywordMatch(
|
|
374
372
|
userText,
|
|
375
373
|
config.reasoningKeywords,
|
|
@@ -379,7 +377,7 @@ function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
|
379
377
|
{ none: 0, low: 0.7, high: 1 }
|
|
380
378
|
),
|
|
381
379
|
scoreKeywordMatch(
|
|
382
|
-
|
|
380
|
+
userText,
|
|
383
381
|
config.technicalKeywords,
|
|
384
382
|
"technicalTerms",
|
|
385
383
|
"technical",
|
|
@@ -387,7 +385,7 @@ function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
|
387
385
|
{ none: 0, low: 0.5, high: 1 }
|
|
388
386
|
),
|
|
389
387
|
scoreKeywordMatch(
|
|
390
|
-
|
|
388
|
+
userText,
|
|
391
389
|
config.creativeKeywords,
|
|
392
390
|
"creativeMarkers",
|
|
393
391
|
"creative",
|
|
@@ -395,18 +393,18 @@ function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
|
395
393
|
{ none: 0, low: 0.5, high: 0.7 }
|
|
396
394
|
),
|
|
397
395
|
scoreKeywordMatch(
|
|
398
|
-
|
|
396
|
+
userText,
|
|
399
397
|
config.simpleKeywords,
|
|
400
398
|
"simpleIndicators",
|
|
401
399
|
"simple",
|
|
402
400
|
{ low: 1, high: 2 },
|
|
403
401
|
{ none: 0, low: -1, high: -1 }
|
|
404
402
|
),
|
|
405
|
-
scoreMultiStep(
|
|
403
|
+
scoreMultiStep(userText),
|
|
406
404
|
scoreQuestionComplexity(prompt),
|
|
407
405
|
// 6 new dimensions
|
|
408
406
|
scoreKeywordMatch(
|
|
409
|
-
|
|
407
|
+
userText,
|
|
410
408
|
config.imperativeVerbs,
|
|
411
409
|
"imperativeVerbs",
|
|
412
410
|
"imperative",
|
|
@@ -414,7 +412,7 @@ function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
|
414
412
|
{ none: 0, low: 0.3, high: 0.5 }
|
|
415
413
|
),
|
|
416
414
|
scoreKeywordMatch(
|
|
417
|
-
|
|
415
|
+
userText,
|
|
418
416
|
config.constraintIndicators,
|
|
419
417
|
"constraintCount",
|
|
420
418
|
"constraints",
|
|
@@ -422,7 +420,7 @@ function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
|
422
420
|
{ none: 0, low: 0.3, high: 0.7 }
|
|
423
421
|
),
|
|
424
422
|
scoreKeywordMatch(
|
|
425
|
-
|
|
423
|
+
userText,
|
|
426
424
|
config.outputFormatKeywords,
|
|
427
425
|
"outputFormat",
|
|
428
426
|
"format",
|
|
@@ -430,7 +428,7 @@ function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
|
430
428
|
{ none: 0, low: 0.4, high: 0.7 }
|
|
431
429
|
),
|
|
432
430
|
scoreKeywordMatch(
|
|
433
|
-
|
|
431
|
+
userText,
|
|
434
432
|
config.referenceKeywords,
|
|
435
433
|
"referenceComplexity",
|
|
436
434
|
"references",
|
|
@@ -438,7 +436,7 @@ function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
|
438
436
|
{ none: 0, low: 0.3, high: 0.5 }
|
|
439
437
|
),
|
|
440
438
|
scoreKeywordMatch(
|
|
441
|
-
|
|
439
|
+
userText,
|
|
442
440
|
config.negationKeywords,
|
|
443
441
|
"negationComplexity",
|
|
444
442
|
"negation",
|
|
@@ -446,7 +444,7 @@ function classifyByRules(prompt, systemPrompt, estimatedTokens, config) {
|
|
|
446
444
|
{ none: 0, low: 0.3, high: 0.5 }
|
|
447
445
|
),
|
|
448
446
|
scoreKeywordMatch(
|
|
449
|
-
|
|
447
|
+
userText,
|
|
450
448
|
config.domainSpecificKeywords,
|
|
451
449
|
"domainSpecificity",
|
|
452
450
|
"domain-specific",
|
|
@@ -1626,7 +1624,7 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
1626
1624
|
]
|
|
1627
1625
|
},
|
|
1628
1626
|
COMPLEX: {
|
|
1629
|
-
primary: "google/gemini-3.1-pro
|
|
1627
|
+
primary: "google/gemini-3.1-pro",
|
|
1630
1628
|
// Newest Gemini 3.1 - upgraded from 3.0
|
|
1631
1629
|
fallback: [
|
|
1632
1630
|
"google/gemini-2.5-flash-lite",
|
|
@@ -1706,7 +1704,7 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
1706
1704
|
"openai/gpt-5.2-codex",
|
|
1707
1705
|
"anthropic/claude-opus-4.6",
|
|
1708
1706
|
"anthropic/claude-sonnet-4.6",
|
|
1709
|
-
"google/gemini-3.1-pro
|
|
1707
|
+
"google/gemini-3.1-pro",
|
|
1710
1708
|
// Newest Gemini
|
|
1711
1709
|
"google/gemini-3-pro-preview",
|
|
1712
1710
|
"moonshot/kimi-k2.5"
|
|
@@ -1747,7 +1745,7 @@ var DEFAULT_ROUTING_CONFIG = {
|
|
|
1747
1745
|
"anthropic/claude-opus-4.6",
|
|
1748
1746
|
// Latest Opus - best agentic
|
|
1749
1747
|
"openai/gpt-5.2",
|
|
1750
|
-
"google/gemini-3.1-pro
|
|
1748
|
+
"google/gemini-3.1-pro",
|
|
1751
1749
|
// Newest Gemini
|
|
1752
1750
|
"google/gemini-3-pro-preview",
|
|
1753
1751
|
"xai/grok-4-0709"
|
|
@@ -2139,8 +2137,8 @@ var BLOCKRUN_MODELS = [
|
|
|
2139
2137
|
},
|
|
2140
2138
|
// Google
|
|
2141
2139
|
{
|
|
2142
|
-
id: "google/gemini-3.1-pro
|
|
2143
|
-
name: "Gemini 3.1 Pro
|
|
2140
|
+
id: "google/gemini-3.1-pro",
|
|
2141
|
+
name: "Gemini 3.1 Pro",
|
|
2144
2142
|
version: "3.1",
|
|
2145
2143
|
inputPrice: 2,
|
|
2146
2144
|
outputPrice: 12,
|
|
@@ -5720,7 +5718,9 @@ async function loadSavedWallet() {
|
|
|
5720
5718
|
console.error(`[ClawRouter] \u2717 CRITICAL: Wallet file exists but has invalid format!`);
|
|
5721
5719
|
console.error(`[ClawRouter] File: ${WALLET_FILE}`);
|
|
5722
5720
|
console.error(`[ClawRouter] Expected: 0x followed by 64 hex characters (66 chars total)`);
|
|
5723
|
-
console.error(
|
|
5721
|
+
console.error(
|
|
5722
|
+
`[ClawRouter] To fix: restore your backup key or set BLOCKRUN_WALLET_KEY env var`
|
|
5723
|
+
);
|
|
5724
5724
|
throw new Error(
|
|
5725
5725
|
`Wallet file at ${WALLET_FILE} is corrupted or has wrong format. Refusing to auto-generate new wallet to protect existing funds. Restore your backup key or set BLOCKRUN_WALLET_KEY environment variable.`
|
|
5726
5726
|
);
|
|
@@ -6227,7 +6227,9 @@ ClawRouter Partner APIs (v${VERSION})
|
|
|
6227
6227
|
console.log(` ${svc.description}`);
|
|
6228
6228
|
console.log(` Tool: blockrun_${svc.id}`);
|
|
6229
6229
|
console.log(` Method: ${svc.method} /v1${svc.proxyPath}`);
|
|
6230
|
-
console.log(
|
|
6230
|
+
console.log(
|
|
6231
|
+
` Pricing: ${svc.pricing.perUnit} per ${svc.pricing.unit} (min ${svc.pricing.minimum}, max ${svc.pricing.maximum})`
|
|
6232
|
+
);
|
|
6231
6233
|
console.log();
|
|
6232
6234
|
}
|
|
6233
6235
|
if (args.partnersTest) {
|