@alexeiled/claude-router 1.4.1 → 1.5.1
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/.claude-plugin/plugin.json +9 -3
- package/CHANGELOG.md +25 -0
- package/README.md +21 -7
- package/docs/architecture.md +10 -9
- package/docs/configuration.md +18 -6
- package/docs/native-router.md +17 -17
- package/docs/router-band.svg +67 -50
- package/docs/router-pane-classifier.svg +46 -22
- package/docs/router-pane-now.svg +18 -6
- package/docs/router-pane-routing.svg +20 -7
- package/docs/user-guide.md +62 -44
- package/hooks/native-router.mjs +20 -10
- package/lib/band.mjs +40 -18
- package/lib/classifier-apis.mjs +151 -0
- package/lib/classifier-client.mjs +4 -5
- package/lib/classifier-contract.mjs +11 -45
- package/lib/config.mjs +56 -22
- package/lib/display.mjs +19 -8
- package/lib/panel.mjs +14 -12
- package/package.json +2 -2
package/lib/panel.mjs
CHANGED
|
@@ -27,7 +27,7 @@ const TABS = [
|
|
|
27
27
|
['usage', '4', 'Usage'],
|
|
28
28
|
];
|
|
29
29
|
const TUNING_CHOICES = {
|
|
30
|
-
timeoutMs: [500, 1000, 1500, 3000],
|
|
30
|
+
timeoutMs: [500, 1000, 1500, 3000, 5000],
|
|
31
31
|
downgradeVotes: [1, 2, 3],
|
|
32
32
|
horizon: [1, 3, 5, 10],
|
|
33
33
|
cashCapUsd: [0.5, 1, 2, 5],
|
|
@@ -108,7 +108,7 @@ export function renderPanel(
|
|
|
108
108
|
function header(ui, config, view, tab, actions) {
|
|
109
109
|
const auto = view.mode === 'auto';
|
|
110
110
|
const label = classifierLabel(config);
|
|
111
|
-
const error = view.error ?? missingCredentials(view, config.classifier);
|
|
111
|
+
const error = view.error ?? missingCredentials(config, view, config.classifier);
|
|
112
112
|
const status =
|
|
113
113
|
view.phase === 'unavailable'
|
|
114
114
|
? ui.text('Routing unavailable', { color: 'yellow' })
|
|
@@ -118,26 +118,26 @@ function header(ui, config, view, tab, actions) {
|
|
|
118
118
|
color: 'green',
|
|
119
119
|
});
|
|
120
120
|
return [
|
|
121
|
-
ui.line(ui.head(`
|
|
121
|
+
ui.line(ui.head(`ROUTING · ${auto ? 'on' : 'off'}`), ' ', status),
|
|
122
122
|
view.phase === 'unavailable' && view.error ? ui.text(view.error, { color: 'yellow' }) : null,
|
|
123
123
|
...(view.error === GATEWAY_SETTINGS ? GATEWAY_CLEANUP.map((line) => ui.text(line, { color: 'yellow' })) : []),
|
|
124
124
|
ui.line(
|
|
125
125
|
ui.Button({
|
|
126
126
|
key: 'auto',
|
|
127
|
-
label: '
|
|
128
|
-
hotkey: '
|
|
127
|
+
label: 'Routing on',
|
|
128
|
+
hotkey: 'o',
|
|
129
129
|
variant: auto ? 'primary' : 'secondary',
|
|
130
130
|
onPress: () => actions.mode('auto'),
|
|
131
131
|
}),
|
|
132
132
|
' ',
|
|
133
133
|
ui.Button({
|
|
134
134
|
key: 'manual',
|
|
135
|
-
label: '
|
|
136
|
-
hotkey: '
|
|
135
|
+
label: 'Routing off',
|
|
136
|
+
hotkey: 'f',
|
|
137
137
|
variant: auto ? 'secondary' : 'primary',
|
|
138
138
|
onPress: () => actions.mode('manual'),
|
|
139
139
|
}),
|
|
140
|
-
ui.dim('
|
|
140
|
+
ui.dim(' Routing off keeps the /model choice'),
|
|
141
141
|
),
|
|
142
142
|
ui.line(
|
|
143
143
|
...TABS.flatMap(([id, hotkey, label]) => [
|
|
@@ -161,7 +161,7 @@ function nowTab(ui, config, view, usage, actions) {
|
|
|
161
161
|
const auto = view.mode === 'auto';
|
|
162
162
|
const current = view.selectedModel ?? view.nativeModel;
|
|
163
163
|
const label = classifierLabel(config);
|
|
164
|
-
const missing = missingCredentials(view, config.classifier);
|
|
164
|
+
const missing = missingCredentials(config, view, config.classifier);
|
|
165
165
|
const served = view.actualModel && current && !isSameModel(current, view.actualModel);
|
|
166
166
|
const out = [
|
|
167
167
|
ui.line('Now ', view.tier ? ui.tier(view.tier, `▌${view.tier} `) : null, routeLabel(current, view.effort)),
|
|
@@ -214,7 +214,9 @@ function nowTab(ui, config, view, usage, actions) {
|
|
|
214
214
|
),
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
out.push(
|
|
217
|
+
out.push(
|
|
218
|
+
ui.dim(auto ? ' Pins serve the next turn only.' : ' Pins need routing on. Routing off keeps the /model choice.'),
|
|
219
|
+
);
|
|
218
220
|
out.push(ui.text(' '), ...replies(ui, view));
|
|
219
221
|
out.push(
|
|
220
222
|
ui.text(' '),
|
|
@@ -233,7 +235,7 @@ function nowTab(ui, config, view, usage, actions) {
|
|
|
233
235
|
return out;
|
|
234
236
|
}
|
|
235
237
|
|
|
236
|
-
// One cell per reply, colored by the tier that served it; a dot where routing did not choose (
|
|
238
|
+
// One cell per reply, colored by the tier that served it; a dot where routing did not choose (routing off, fallback).
|
|
237
239
|
function replies(ui, view) {
|
|
238
240
|
const tiers = view.tiers ?? [];
|
|
239
241
|
if (!tiers.length) return [ui.head('REPLIES'), ui.dim(' no replies yet')];
|
|
@@ -396,7 +398,7 @@ function classifierTab(ui, config, view, _usage, actions) {
|
|
|
396
398
|
const health = view.health ?? { failures: 0, pausedUntil: 0 };
|
|
397
399
|
const rows = Object.entries(config.classifiers).map(([id, entry]) => {
|
|
398
400
|
const isActive = id === config.classifier;
|
|
399
|
-
const missing = missingCredentials(view, id);
|
|
401
|
+
const missing = missingCredentials(config, view, id);
|
|
400
402
|
return ui.line(
|
|
401
403
|
ui.Button({
|
|
402
404
|
key: `classifier-${id}`,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexeiled/claude-router",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Native Claude Code Mod: model and effort routing for the main conversation, advised by Jev, Clef
|
|
3
|
+
"version": "1.5.1",
|
|
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",
|
|
7
7
|
"repository": {
|