@alexeiled/claude-router 1.9.0 → 1.10.0

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/lib/view.mjs CHANGED
@@ -54,6 +54,8 @@ export function initialView(model) {
54
54
  routeDraft: null,
55
55
  lastWrite: null,
56
56
  tab: 'now',
57
+ routeCell: null,
58
+ usageDetail: false,
57
59
  help: false,
58
60
  notice: null,
59
61
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexeiled/claude-router",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Native Claude Code Mod: model and effort routing for the main conversation, advised by Jev, Clef, Clef Flash, OpenAI or Ollama.",
5
5
  "license": "MIT",
6
6
  "author": "Alexei Ledenev",
package/types/index.d.ts CHANGED
@@ -220,7 +220,11 @@ declare module 'claude-code' {
220
220
  routeDraft?: (RouterRoutes & { base: RouterRoutes }) | null;
221
221
  // The last pane write to router.json: each leaf it changed with the value the file had before, none if absent.
222
222
  lastWrite?: { label: string; leaves: { path: string[]; value?: unknown }[] } | null;
223
- tab?: 'now' | 'routing' | 'classifier' | 'usage';
223
+ tab?: 'now' | 'routes' | 'policy' | 'classifier' | 'usage';
224
+ // The Routes grid cell whose editor is open: '<activity>.<tier>', or 'tier.<tier>' for a tier's own route.
225
+ routeCell?: string | null;
226
+ // Whether the Usage tab shows Claude's readings in detail, with the estimates.
227
+ usageDetail?: boolean;
224
228
  help?: boolean;
225
229
  bandDetail?: boolean;
226
230
  notice?: string | null;
@@ -1,150 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 828 1104" role="img" aria-labelledby="title desc">
2
- <title id="title">Router pane, Routing tab</title>
3
- <desc id="desc">Model and effort per tier with prices and windows, the baseline tier, how the policy prices each step up, the activity matrix and overrides, the policy controls, and the unsaved router.json changes with Save and Discard.</desc>
4
- <style>
5
- text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
6
- .cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
7
- </style>
8
- <rect width="828" height="1104" rx="8" fill="#1c1c1c"/>
9
- <rect x="10" y="10" width="808" height="1084" rx="6" fill="none" stroke="#3f5f8f"/>
10
- <text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTING</text>
11
- <rect x="94.2" y="20" width="62.4" height="18" rx="4" fill="#87afff"/>
12
- <text x="94.2" y="34" fill="#0d1016" font-weight="700" xml:space="preserve">[ ◉ on ]</text>
13
- <rect x="164.4" y="20" width="70.2" height="18" rx="4" fill="#2e3340"/>
14
- <text x="164.4" y="34" fill="#d0d0d0" xml:space="preserve">[ ○ off ]</text>
15
- <text x="234.6" y="34" fill="#7c7c7c" xml:space="preserve"> off keeps the /model choice</text>
16
- <text x="24.0" y="53" fill="#87d787" xml:space="preserve">Jev ready · 347 ms</text>
17
- <rect x="24.0" y="58" width="54.6" height="18" rx="4" fill="#2e3340"/>
18
- <text x="24.0" y="72" fill="#d0d0d0" xml:space="preserve">[ Now ]</text>
19
- <rect x="86.4" y="58" width="101.4" height="18" rx="4" fill="#87afff"/>
20
- <text x="86.4" y="72" fill="#0d1016" font-weight="700" xml:space="preserve">[ Routing ● ]</text>
21
- <rect x="195.6" y="58" width="109.2" height="18" rx="4" fill="#2e3340"/>
22
- <text x="195.6" y="72" fill="#d0d0d0" xml:space="preserve">[ Classifier ]</text>
23
- <rect x="312.6" y="58" width="70.2" height="18" rx="4" fill="#2e3340"/>
24
- <text x="312.6" y="72" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
25
- <rect x="390.6" y="58" width="39.0" height="18" rx="4" fill="#2e3340"/>
26
- <text x="390.6" y="72" fill="#d0d0d0" xml:space="preserve">[ ? ]</text>
27
- <text x="24.0" y="110" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTES</text>
28
- <text x="70.8" y="110" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
29
- <text x="24.0" y="129" fill="#7c7c7c" xml:space="preserve">tier model effort $/M in · out window</text>
30
- <text x="24.0" y="148" fill="#e0708a" font-weight="700" xml:space="preserve">high</text>
31
- <text x="86.4" y="148" fill="#d0d0d0" xml:space="preserve">Opus 5.5 ▾</text>
32
- <text x="195.6" y="148" fill="#d0d0d0" xml:space="preserve">xhigh ▾</text>
33
- <text x="304.8" y="148" fill="#d0d0d0" xml:space="preserve">4 · 20</text>
34
- <text x="414.0" y="148" fill="#d0d0d0" xml:space="preserve">1M</text>
35
- <text x="24.0" y="167" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
36
- <text x="86.4" y="167" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
37
- <text x="195.6" y="167" fill="#d0d0d0" xml:space="preserve">xhigh ▾</text>
38
- <text x="289.2" y="167" fill="#d7af5f" xml:space="preserve">●</text>
39
- <text x="304.8" y="167" fill="#d0d0d0" xml:space="preserve">2 · 10</text>
40
- <text x="414.0" y="167" fill="#d0d0d0" xml:space="preserve">1M</text>
41
- <text x="24.0" y="186" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
42
- <text x="86.4" y="186" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 ▾</text>
43
- <text x="195.6" y="186" fill="#d0d0d0" xml:space="preserve">high ▾</text>
44
- <text x="304.8" y="186" fill="#d0d0d0" xml:space="preserve">0.1 · 0.5</text>
45
- <text x="414.0" y="186" fill="#d0d0d0" xml:space="preserve">1M</text>
46
- <text x="24.0" y="205" fill="#5fd7af" font-weight="700" xml:space="preserve">micro</text>
47
- <text x="86.4" y="205" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 ▾</text>
48
- <text x="195.6" y="205" fill="#d0d0d0" xml:space="preserve">medium ▾</text>
49
- <text x="304.8" y="205" fill="#d0d0d0" xml:space="preserve">0.1 · 0.5</text>
50
- <text x="414.0" y="205" fill="#d0d0d0" xml:space="preserve">1M</text>
51
- <text x="24.0" y="224" fill="#d0d0d0" xml:space="preserve">Baseline tier: low ▾</text>
52
- <text x="304.8" y="224" fill="#7c7c7c" xml:space="preserve">start here, fall back here</text>
53
- <text x="24.0" y="262" fill="#5fafd7" font-weight="700" xml:space="preserve">SWITCH COST · from these routes</text>
54
- <text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">· </text>
55
- <text x="39.6" y="281" fill="#d0d0d0" xml:space="preserve">medium → high </text>
56
- <text x="164.4" y="281" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
57
- <text x="24.0" y="300" fill="#7c7c7c" xml:space="preserve">· </text>
58
- <text x="39.6" y="300" fill="#d0d0d0" xml:space="preserve">low → medium </text>
59
- <text x="164.4" y="300" fill="#d0d0d0" xml:space="preserve">model change: priced as a cold cache write</text>
60
- <text x="24.0" y="319" fill="#7c7c7c" xml:space="preserve">· </text>
61
- <text x="39.6" y="319" fill="#d0d0d0" xml:space="preserve">micro → low </text>
62
- <text x="164.4" y="319" fill="#d0d0d0" xml:space="preserve">same model, new effort: keeps its cache</text>
63
- <rect x="24.0" y="324" width="218.4" height="18" rx="4" fill="#2e3340"/>
64
- <text x="24.0" y="338" fill="#d0d0d0" xml:space="preserve">[ Reset routes to defaults ]</text>
65
- <text x="24.0" y="357" fill="#7c7c7c" xml:space="preserve">A new model ID needs router.json → models: price, window, efforts.</text>
66
- <text x="24.0" y="395" fill="#5fafd7" font-weight="700" xml:space="preserve">ACTIVITIES</text>
67
- <text x="102.0" y="395" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
68
- <text x="24.0" y="414" fill="#d0d0d0" xml:space="preserve">Activity routing: on ▾</text>
69
- <text x="242.4" y="414" fill="#7c7c7c" xml:space="preserve">an override runs when the activity has one</text>
70
- <text x="273.6" y="433" fill="#7c7c7c" xml:space="preserve">micro low medium high </text>
71
- <text x="24.0" y="452" fill="#d0d0d0" xml:space="preserve"> base H·med H·high S·xh O·xh </text>
72
- <text x="24.0" y="471" fill="#d0d0d0" xml:space="preserve"> code · S·high · O·max </text>
73
- <text x="24.0" y="490" fill="#d0d0d0" xml:space="preserve"> debug plan review · S·high · · </text>
74
- <text x="24.0" y="509" fill="#d0d0d0" xml:space="preserve"> explore docs · · · · </text>
75
- <text x="24.0" y="528" fill="#d0d0d0" xml:space="preserve"> ops · · H·high · </text>
76
- <text x="24.0" y="547" fill="#7c7c7c" xml:space="preserve"> 6 distinct routes · 3 caches</text>
77
- <text x="24.0" y="585" fill="#5fafd7" font-weight="700" xml:space="preserve">OVERRIDES</text>
78
- <text x="94.2" y="585" fill="#7c7c7c" xml:space="preserve"> · in use</text>
79
- <text x="24.0" y="604" fill="#d0d0d0" xml:space="preserve">code</text>
80
- <text x="102.0" y="604" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
81
- <text x="164.4" y="604" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
82
- <text x="273.6" y="604" fill="#d0d0d0" xml:space="preserve">high ▾</text>
83
- <rect x="382.8" y="590" width="78.0" height="18" rx="4" fill="#2e3340"/>
84
- <text x="382.8" y="604" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
85
- <text x="24.0" y="623" fill="#d0d0d0" xml:space="preserve">code</text>
86
- <text x="102.0" y="623" fill="#e0708a" font-weight="700" xml:space="preserve">high</text>
87
- <text x="164.4" y="623" fill="#d0d0d0" xml:space="preserve">Opus 5.5 ▾</text>
88
- <text x="273.6" y="623" fill="#d0d0d0" xml:space="preserve">max ▾</text>
89
- <text x="367.2" y="623" fill="#d7af5f" xml:space="preserve">●</text>
90
- <rect x="382.8" y="609" width="78.0" height="18" rx="4" fill="#2e3340"/>
91
- <text x="382.8" y="623" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
92
- <text x="24.0" y="642" fill="#d0d0d0" xml:space="preserve">debug</text>
93
- <text x="102.0" y="642" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
94
- <text x="164.4" y="642" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
95
- <text x="273.6" y="642" fill="#d0d0d0" xml:space="preserve">high ▾</text>
96
- <rect x="382.8" y="628" width="78.0" height="18" rx="4" fill="#2e3340"/>
97
- <text x="382.8" y="642" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
98
- <text x="24.0" y="661" fill="#d0d0d0" xml:space="preserve">plan</text>
99
- <text x="102.0" y="661" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
100
- <text x="164.4" y="661" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
101
- <text x="273.6" y="661" fill="#d0d0d0" xml:space="preserve">high ▾</text>
102
- <rect x="382.8" y="647" width="78.0" height="18" rx="4" fill="#2e3340"/>
103
- <text x="382.8" y="661" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
104
- <text x="24.0" y="680" fill="#d0d0d0" xml:space="preserve">review</text>
105
- <text x="102.0" y="680" fill="#5f9fe0" font-weight="700" xml:space="preserve">low</text>
106
- <text x="164.4" y="680" fill="#d0d0d0" xml:space="preserve">Sonnet 5.5 ▾</text>
107
- <text x="273.6" y="680" fill="#d0d0d0" xml:space="preserve">high ▾</text>
108
- <rect x="382.8" y="666" width="78.0" height="18" rx="4" fill="#2e3340"/>
109
- <text x="382.8" y="680" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
110
- <text x="24.0" y="699" fill="#d0d0d0" xml:space="preserve">ops</text>
111
- <text x="102.0" y="699" fill="#d7af5f" font-weight="700" xml:space="preserve">medium</text>
112
- <text x="164.4" y="699" fill="#d0d0d0" xml:space="preserve">Haiku 5.5 ▾</text>
113
- <text x="273.6" y="699" fill="#d0d0d0" xml:space="preserve">high ▾</text>
114
- <rect x="382.8" y="685" width="78.0" height="18" rx="4" fill="#2e3340"/>
115
- <text x="382.8" y="699" fill="#d0d0d0" xml:space="preserve">[ remove ]</text>
116
- <text x="24.0" y="718" fill="#d0d0d0" xml:space="preserve">add an override… ▾</text>
117
- <text x="24.0" y="756" fill="#5fafd7" font-weight="700" xml:space="preserve">POLICY</text>
118
- <text x="70.8" y="756" fill="#7c7c7c" xml:space="preserve"> · applies next turn · edit, then Save</text>
119
- <text x="24.0" y="775" fill="#d0d0d0" xml:space="preserve">Votes to go down</text>
120
- <text x="180.0" y="775" fill="#d0d0d0" xml:space="preserve">2 ▾</text>
121
- <text x="289.2" y="775" fill="#7c7c7c" xml:space="preserve">agreeing turns before cheaper</text>
122
- <text x="24.0" y="794" fill="#d0d0d0" xml:space="preserve">Payback horizon</text>
123
- <text x="180.0" y="794" fill="#d0d0d0" xml:space="preserve">5 turns ▾</text>
124
- <text x="289.2" y="794" fill="#7c7c7c" xml:space="preserve">a switch repays its cache</text>
125
- <text x="24.0" y="813" fill="#d0d0d0" xml:space="preserve">Credits cap</text>
126
- <text x="180.0" y="813" fill="#d0d0d0" xml:space="preserve">$2.00 ▾</text>
127
- <text x="289.2" y="813" fill="#7c7c7c" xml:space="preserve">max cold write on credits</text>
128
- <text x="24.0" y="832" fill="#d0d0d0" xml:space="preserve">Activity threshold</text>
129
- <text x="180.0" y="832" fill="#d0d0d0" xml:space="preserve">60% ▾</text>
130
- <text x="289.2" y="832" fill="#7c7c7c" xml:space="preserve">a weaker reading keeps the running activity or uses the base route</text>
131
- <rect x="24.0" y="837" width="218.4" height="18" rx="4" fill="#2e3340"/>
132
- <text x="24.0" y="851" fill="#d0d0d0" xml:space="preserve">[ Reset policy to defaults ]</text>
133
- <text x="24.0" y="889" fill="#5fafd7" font-weight="700" xml:space="preserve">CONFIG</text>
134
- <text x="24.0" y="908" fill="#d0d0d0" xml:space="preserve">File ~/.claude/router.json </text>
135
- <rect x="273.6" y="894" width="62.4" height="18" rx="4" fill="#2e3340"/>
136
- <text x="273.6" y="908" fill="#d0d0d0" xml:space="preserve">[ copy ]</text>
137
- <text x="24.0" y="927" fill="#7c7c7c" xml:space="preserve">Subagents: on. Agents that pin no model get one at spawn, kept for every step.</text>
138
- <text x="24.0" y="965" fill="#7c7c7c" xml:space="preserve">router.json changes:</text>
139
- <text x="24.0" y="984" fill="#e06c6c" xml:space="preserve">- routes.medium Opus 5.5 · medium</text>
140
- <text x="24.0" y="1003" fill="#87d787" xml:space="preserve">+ routes.medium Sonnet 5.5 · xhigh</text>
141
- <text x="24.0" y="1022" fill="#e06c6c" xml:space="preserve">- activities.code.high no override</text>
142
- <text x="24.0" y="1041" fill="#87d787" xml:space="preserve">+ activities.code.high Opus 5.5 · max</text>
143
- <text x="24.0" y="1060" fill="#d7af5f" xml:space="preserve">● 2 unsaved routing changes </text>
144
- <rect x="250.2" y="1046" width="62.4" height="18" rx="4" fill="#87afff"/>
145
- <text x="250.2" y="1060" fill="#0d1016" font-weight="700" xml:space="preserve">[ Save ]</text>
146
- <rect x="320.4" y="1046" width="85.8" height="18" rx="4" fill="#2e3340"/>
147
- <text x="320.4" y="1060" fill="#d0d0d0" xml:space="preserve">[ Discard ]</text>
148
- <rect x="24.0" y="1065" width="70.2" height="18" rx="4" fill="#2e3340"/>
149
- <text x="24.0" y="1079" fill="#d0d0d0" xml:space="preserve">[ Close ]</text>
150
- </svg>