@alexeiled/claude-router 1.3.1 → 1.3.2
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 +1 -1
- package/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/docs/architecture.md +15 -11
- package/docs/evaluation.md +1 -1
- package/hooks/native-router.mjs +423 -519
- package/lib/{native-band.mjs → band.mjs} +22 -28
- package/lib/{native-jev.mjs → classifier-client.mjs} +8 -8
- package/lib/{jev-contract.mjs → classifier-contract.mjs} +2 -2
- package/lib/config-file.mjs +62 -0
- package/lib/config.mjs +11 -0
- package/lib/{native-cost.mjs → cost.mjs} +6 -6
- package/lib/{native-display.mjs → display.mjs} +42 -14
- package/lib/{native-panel.mjs → panel.mjs} +15 -23
- package/lib/policy.mjs +6 -6
- package/lib/{native-router.mjs → route.mjs} +30 -31
- package/lib/view.mjs +71 -0
- package/package.json +6 -4
- /package/lib/{facts-pure.mjs → facts.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "router",
|
|
3
3
|
"displayName": "Router",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"description": "Model and effort routing for the main conversation, advised by a prompt classifier (Jev, Clef or Clef Flash). Preserves subagent model choices.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Alexei Ledenev",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.2 (2026-10-08)
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- The band and the pane's **Served** row now call a reply a fallback by the same rule routing uses: the requested model, or its one mapped dated snapshot (Haiku 4.5). Before, they accepted any dated suffix of the requested model, so a reply that routing treated as an engine substitution could show no **fallback**.
|
|
8
|
+
- Pressing **?** in the pane or **2 rows** on the band twice before the next redraw now toggles twice. The second press used to repeat the first.
|
|
9
|
+
|
|
10
|
+
### Internal
|
|
11
|
+
|
|
12
|
+
- Module names drop the historical `native-` and `jev` prefixes: `lib/classifier-contract.mjs`, `classifier-client.mjs` (class `ClassifierClient`), `route.mjs`, `cost.mjs`, `panel.mjs`, `band.mjs`, `display.mjs` and `facts.mjs`. The hook entry stays `hooks/native-router.mjs`; option names, state keys and the pane id are unchanged.
|
|
13
|
+
- Pure logic moved out of the hooks module into `lib/config-file.mjs` and `lib/view.mjs`, with tests. The hook tests are split by area, and lint is stricter, with complexity limits.
|
|
14
|
+
- `npm run typecheck` runs `tsc` on `lib/` in CI and in the pre-push hook. TypeScript is a dev dependency for this check only.
|
|
15
|
+
|
|
3
16
|
## 1.3.1 (2026-10-08)
|
|
4
17
|
|
|
5
18
|
### Changed
|
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ Run `/router` to open the pane: route status, per-tier controls, tuning, and usa
|
|
|
77
77
|
Before a push, run the same checks as CI. `npm run validate` and `npm run test:plugin` need the `claude` CLI: they load the Mod in the Claude Code engine, which refuses some faults that lint and unit tests miss.
|
|
78
78
|
|
|
79
79
|
```sh
|
|
80
|
-
npm run check && npm test && npm run validate && npm run test:plugin
|
|
80
|
+
npm run check && npm run typecheck && npm test && npm run validate && npm run test:plugin
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
## Documentation
|
package/docs/architecture.md
CHANGED
|
@@ -38,17 +38,21 @@ Claude Code builds each request for the model the Mod selects, so no request rew
|
|
|
38
38
|
|
|
39
39
|
## Responsibilities
|
|
40
40
|
|
|
41
|
-
| Component
|
|
42
|
-
|
|
|
43
|
-
| [Native hooks](../hooks/native-router.mjs)
|
|
44
|
-
| [
|
|
45
|
-
| [
|
|
46
|
-
| [Router controller](../lib/
|
|
47
|
-
| [Policy](../lib/policy.mjs)
|
|
48
|
-
| [
|
|
49
|
-
| [
|
|
50
|
-
| [
|
|
51
|
-
|
|
|
41
|
+
| Component | Responsibility |
|
|
42
|
+
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| [Native hooks](../hooks/native-router.mjs) | Turn identity, controls, lifecycle, per-step rewrites, response observation, pane actions, and every host call. |
|
|
44
|
+
| [Classifier contract](../lib/classifier-contract.mjs) | Classifier request payload, credentials and endpoint filling, answer validation, and retry rules. |
|
|
45
|
+
| [Classifier client](../lib/classifier-client.mjs) | Classifier HTTP, deadline, in-flight admission, and circuit breaker. |
|
|
46
|
+
| [Router controller](../lib/route.mjs) | Context fit, model identity, engine fallback, cache observations, and one-turn pins. |
|
|
47
|
+
| [Policy](../lib/policy.mjs) | Tier votes, escalation, and switching gates. |
|
|
48
|
+
| [Costs](../lib/cost.mjs) | Cache uncertainty bounds and switching estimates. |
|
|
49
|
+
| [Router view](../lib/view.mjs) | The view's initial shape and the usage readings each reply adds to it. |
|
|
50
|
+
| [Config file](../lib/config-file.mjs) | Pane writes to `router.json`: the validated rewrite and what Undo restores. |
|
|
51
|
+
| [Panel](../lib/panel.mjs) | Tabbed pane: route status, tier pins, the route editor, tuning, and usage. |
|
|
52
|
+
| [Router band](../lib/band.mjs) | Status band segments fitted to the band's width, and route-change toasts. |
|
|
53
|
+
| Claude Code | API requests, tools, authentication, stream output, and usage ledger. |
|
|
54
|
+
|
|
55
|
+
Every function that takes the engine interface `$` lives in the hooks module: the engine does not follow `$` across an import, so the modules in `lib/` stay pure.
|
|
52
56
|
|
|
53
57
|
Node.js is not part of routing. It is used for development, the optional configuration migration, and the classifier probe.
|
|
54
58
|
|
package/docs/evaluation.md
CHANGED
|
@@ -47,7 +47,7 @@ Run this command with the Team `decisions.jsonl` log available in its usual Clau
|
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
node experiments/mod-router/scripts/trace-eval.mjs
|
|
50
|
-
node --test
|
|
50
|
+
node --test experiments/mod-router/scripts/trace-eval.test.mjs
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
The script writes aggregate counts, reason histograms, route transitions, and shadow estimates. It excludes prompts, session identifiers, agent names, error text, headers, keys, and filesystem paths from the result. It reads the local profile log and writes the JSON result file.
|