@blockrun/clawrouter 0.9.29 → 0.9.31

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
@@ -1,26 +1,26 @@
1
1
  // src/models.ts
2
2
  var MODEL_ALIASES = {
3
- // Claude - short names (use dashes in version, not dots - Anthropic API format)
4
- claude: "anthropic/claude-sonnet-4-6",
5
- sonnet: "anthropic/claude-sonnet-4-6",
6
- opus: "anthropic/claude-opus-4-6",
7
- "opus-46": "anthropic/claude-opus-4-6",
8
- "opus-45": "anthropic/claude-opus-4-5",
9
- haiku: "anthropic/claude-haiku-4-5",
3
+ // Claude - short names (backend uses bare model names without anthropic/ prefix)
4
+ claude: "claude-sonnet-4",
5
+ sonnet: "claude-sonnet-4",
6
+ opus: "claude-opus-4",
7
+ "opus-4": "claude-opus-4",
8
+ haiku: "claude-haiku-4.5",
10
9
  // Claude - provider/shortname patterns (common in agent frameworks)
11
- "anthropic/sonnet": "anthropic/claude-sonnet-4-6",
12
- "anthropic/opus": "anthropic/claude-opus-4-6",
13
- "anthropic/haiku": "anthropic/claude-haiku-4-5",
14
- "anthropic/claude": "anthropic/claude-sonnet-4-6",
15
- // Backward compatibility - old dot notation still works
16
- "anthropic/claude-sonnet-4.6": "anthropic/claude-sonnet-4-6",
17
- "anthropic/claude-opus-4.6": "anthropic/claude-opus-4-6",
18
- "anthropic/claude-opus-4.5": "anthropic/claude-opus-4-5",
19
- "anthropic/claude-haiku-4.5": "anthropic/claude-haiku-4-5",
20
- // Base model names without version -> route to latest
21
- "anthropic/claude-sonnet-4": "anthropic/claude-sonnet-4-6",
22
- "anthropic/claude-opus-4": "anthropic/claude-opus-4-6",
23
- "anthropic/claude-haiku-4": "anthropic/claude-haiku-4-5",
10
+ "anthropic/sonnet": "claude-sonnet-4",
11
+ "anthropic/opus": "claude-opus-4",
12
+ "anthropic/haiku": "claude-haiku-4.5",
13
+ "anthropic/claude": "claude-sonnet-4",
14
+ // Backward compatibility - various formats all route to backend names
15
+ "anthropic/claude-sonnet-4": "claude-sonnet-4",
16
+ "anthropic/claude-sonnet-4-6": "claude-sonnet-4",
17
+ "anthropic/claude-sonnet-4.6": "claude-sonnet-4",
18
+ "anthropic/claude-opus-4": "claude-opus-4",
19
+ "anthropic/claude-opus-4-6": "claude-opus-4",
20
+ "anthropic/claude-opus-4.6": "claude-opus-4",
21
+ "anthropic/claude-haiku-4": "claude-haiku-4.5",
22
+ "anthropic/claude-haiku-4-5": "claude-haiku-4.5",
23
+ "anthropic/claude-haiku-4.5": "claude-haiku-4.5",
24
24
  // OpenAI
25
25
  gpt: "openai/gpt-4o",
26
26
  gpt4: "openai/gpt-4o",
@@ -44,7 +44,10 @@ var MODEL_ALIASES = {
44
44
  nvidia: "nvidia/gpt-oss-120b",
45
45
  "gpt-120b": "nvidia/gpt-oss-120b",
46
46
  // MiniMax
47
- minimax: "minimax/minimax-m2.5"
47
+ minimax: "minimax/minimax-m2.5",
48
+ // Routing profile aliases (common variations)
49
+ "auto-router": "auto",
50
+ router: "auto"
48
51
  // Note: auto, free, eco, premium are virtual routing profiles registered in BLOCKRUN_MODELS
49
52
  // They don't need aliases since they're already top-level model IDs
50
53
  };
@@ -208,8 +211,9 @@ var BLOCKRUN_MODELS = [
208
211
  reasoning: true
209
212
  },
210
213
  // Anthropic - all Claude models excel at agentic workflows
214
+ // Backend uses bare model names (claude-sonnet-4, not anthropic/claude-sonnet-4-6)
211
215
  {
212
- id: "anthropic/claude-haiku-4-5",
216
+ id: "claude-haiku-4.5",
213
217
  name: "Claude Haiku 4.5",
214
218
  inputPrice: 1,
215
219
  outputPrice: 5,
@@ -218,8 +222,8 @@ var BLOCKRUN_MODELS = [
218
222
  agentic: true
219
223
  },
220
224
  {
221
- id: "anthropic/claude-sonnet-4-6",
222
- name: "Claude Sonnet 4.6",
225
+ id: "claude-sonnet-4",
226
+ name: "Claude Sonnet 4",
223
227
  inputPrice: 3,
224
228
  outputPrice: 15,
225
229
  contextWindow: 2e5,
@@ -228,7 +232,7 @@ var BLOCKRUN_MODELS = [
228
232
  agentic: true
229
233
  },
230
234
  {
231
- id: "anthropic/claude-opus-4",
235
+ id: "claude-opus-4",
232
236
  name: "Claude Opus 4",
233
237
  inputPrice: 15,
234
238
  outputPrice: 75,
@@ -237,27 +241,6 @@ var BLOCKRUN_MODELS = [
237
241
  reasoning: true,
238
242
  agentic: true
239
243
  },
240
- {
241
- id: "anthropic/claude-opus-4-5",
242
- name: "Claude Opus 4.5",
243
- inputPrice: 5,
244
- outputPrice: 25,
245
- contextWindow: 2e5,
246
- maxOutput: 32e3,
247
- reasoning: true,
248
- agentic: true
249
- },
250
- {
251
- id: "anthropic/claude-opus-4-6",
252
- name: "Claude Opus 4.6",
253
- inputPrice: 5,
254
- outputPrice: 25,
255
- contextWindow: 2e5,
256
- maxOutput: 64e3,
257
- reasoning: true,
258
- vision: true,
259
- agentic: true
260
- },
261
244
  // Google
262
245
  {
263
246
  id: "google/gemini-3-pro-preview",
@@ -1735,7 +1718,7 @@ var DEFAULT_ROUTING_CONFIG = {
1735
1718
  "openai/gpt-5.2",
1736
1719
  // Newer and cheaper input than gpt-4o
1737
1720
  "openai/gpt-4o",
1738
- "anthropic/claude-sonnet-4-6"
1721
+ "claude-sonnet-4"
1739
1722
  ]
1740
1723
  },
1741
1724
  REASONING: {
@@ -1798,7 +1781,7 @@ var DEFAULT_ROUTING_CONFIG = {
1798
1781
  SIMPLE: {
1799
1782
  primary: "moonshot/kimi-k2.5",
1800
1783
  // $0.50/$2.40 - good for simple coding
1801
- fallback: ["anthropic/claude-haiku-4-5", "google/gemini-2.5-flash", "xai/grok-code-fast-1"]
1784
+ fallback: ["claude-haiku-4.5", "google/gemini-2.5-flash", "xai/grok-code-fast-1"]
1802
1785
  },
1803
1786
  MEDIUM: {
1804
1787
  primary: "openai/gpt-5.2-codex",
@@ -1807,26 +1790,26 @@ var DEFAULT_ROUTING_CONFIG = {
1807
1790
  "moonshot/kimi-k2.5",
1808
1791
  "google/gemini-2.5-pro",
1809
1792
  "xai/grok-4-0709",
1810
- "anthropic/claude-sonnet-4-6"
1793
+ "claude-sonnet-4"
1811
1794
  ]
1812
1795
  },
1813
1796
  COMPLEX: {
1814
- primary: "anthropic/claude-opus-4-6",
1797
+ primary: "claude-opus-4",
1815
1798
  // Best quality for complex tasks
1816
1799
  fallback: [
1817
1800
  "openai/gpt-5.2-codex",
1818
- "anthropic/claude-opus-4-5",
1819
- "anthropic/claude-sonnet-4-6",
1801
+ "claude-opus-4",
1802
+ "claude-sonnet-4",
1820
1803
  "google/gemini-3-pro-preview",
1821
1804
  "moonshot/kimi-k2.5"
1822
1805
  ]
1823
1806
  },
1824
1807
  REASONING: {
1825
- primary: "anthropic/claude-sonnet-4-6",
1808
+ primary: "claude-sonnet-4",
1826
1809
  // $3/$15 - best for reasoning/instructions
1827
1810
  fallback: [
1828
- "anthropic/claude-opus-4-6",
1829
- "anthropic/claude-opus-4-5",
1811
+ "claude-opus-4",
1812
+ "claude-opus-4",
1830
1813
  "openai/o4-mini",
1831
1814
  // Newer and cheaper than o3 ($1.10 vs $2.00)
1832
1815
  "openai/o3",
@@ -1842,7 +1825,7 @@ var DEFAULT_ROUTING_CONFIG = {
1842
1825
  fallback: [
1843
1826
  "minimax/minimax-m2.5",
1844
1827
  // $0.30/$1.20 - agentic capable, cheaper than kimi
1845
- "anthropic/claude-haiku-4-5",
1828
+ "claude-haiku-4.5",
1846
1829
  "xai/grok-4-1-fast-non-reasoning",
1847
1830
  "openai/gpt-4o-mini"
1848
1831
  ]
@@ -1854,14 +1837,14 @@ var DEFAULT_ROUTING_CONFIG = {
1854
1837
  "minimax/minimax-m2.5",
1855
1838
  // $0.30/$1.20 - agentic capable
1856
1839
  "moonshot/kimi-k2.5",
1857
- "anthropic/claude-haiku-4-5",
1858
- "anthropic/claude-sonnet-4-6"
1840
+ "claude-haiku-4.5",
1841
+ "claude-sonnet-4"
1859
1842
  ]
1860
1843
  },
1861
1844
  COMPLEX: {
1862
- primary: "anthropic/claude-sonnet-4-6",
1845
+ primary: "claude-sonnet-4",
1863
1846
  fallback: [
1864
- "anthropic/claude-opus-4-6",
1847
+ "claude-opus-4",
1865
1848
  // Latest Opus - best agentic
1866
1849
  "minimax/minimax-m2.5",
1867
1850
  // $0.30/$1.20 - cheap agentic fallback
@@ -1871,10 +1854,10 @@ var DEFAULT_ROUTING_CONFIG = {
1871
1854
  ]
1872
1855
  },
1873
1856
  REASONING: {
1874
- primary: "anthropic/claude-sonnet-4-6",
1857
+ primary: "claude-sonnet-4",
1875
1858
  // Strong tool use + reasoning for agentic tasks
1876
1859
  fallback: [
1877
- "anthropic/claude-opus-4-6",
1860
+ "claude-opus-4",
1878
1861
  "minimax/minimax-m2.5",
1879
1862
  // $0.30/$1.20 - reasoning + agentic
1880
1863
  "xai/grok-4-1-fast-reasoning",
@@ -5485,8 +5468,8 @@ function injectModelsConfig(logger) {
5485
5468
  { id: "eco", alias: "eco" },
5486
5469
  { id: "premium", alias: "premium" },
5487
5470
  { id: "free", alias: "free" },
5488
- { id: "sonnet", alias: "sonnet4.6" },
5489
- { id: "opus", alias: "opus4.6" },
5471
+ { id: "sonnet", alias: "sonnet" },
5472
+ { id: "opus", alias: "opus" },
5490
5473
  { id: "haiku", alias: "haiku" },
5491
5474
  { id: "gpt5", alias: "gpt5" },
5492
5475
  { id: "codex", alias: "codex" },