@alexeiled/claude-router 0.6.1 → 0.7.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 +1 -1
- package/CHANGELOG.md +102 -0
- package/README.md +94 -78
- package/docs/architecture.md +416 -291
- package/docs/configuration.md +153 -162
- package/docs/evaluation.md +83 -0
- package/docs/tier-share.svg +73 -44
- package/docs/user-guide.md +176 -114
- package/lib/config.mjs +100 -13
- package/lib/facts.mjs +35 -6
- package/lib/gateway.mjs +33 -30
- package/lib/jev.mjs +7 -4
- package/lib/policy.mjs +7 -2
- package/lib/rewrite.mjs +93 -3
- package/lib/router.mjs +41 -8
- package/lib/runtime.mjs +72 -7
- package/lib/status.mjs +2 -1
- package/lib/store.mjs +2 -1
- package/package.json +3 -2
- package/scripts/ensure-gateway.mjs +34 -8
- package/scripts/gateway.mjs +12 -2
- package/scripts/status.mjs +16 -3
- package/scripts/statusline.mjs +6 -2
package/scripts/statusline.mjs
CHANGED
|
@@ -10,13 +10,17 @@ import { fetchStatus, ROUTER_DISPLAY_NAME, statusSegment } from '../lib/status.m
|
|
|
10
10
|
|
|
11
11
|
const input = await text(process.stdin);
|
|
12
12
|
const [command, ...args] = process.argv.slice(2);
|
|
13
|
-
|
|
13
|
+
// A broken router.json must not break the status line: skip the router segment, still run a wrapped command.
|
|
14
|
+
let config = null;
|
|
15
|
+
try {
|
|
16
|
+
({ config } = loadRuntime(process.env));
|
|
17
|
+
} catch {}
|
|
14
18
|
let payload = {};
|
|
15
19
|
try {
|
|
16
20
|
payload = JSON.parse(input);
|
|
17
21
|
} catch {}
|
|
18
22
|
|
|
19
|
-
const names = [config.gateway.alias, LEGACY_ALIAS, ROUTER_DISPLAY_NAME];
|
|
23
|
+
const names = config ? [config.gateway.alias, LEGACY_ALIAS, ROUTER_DISPLAY_NAME] : [];
|
|
20
24
|
// `jev-router[1m]`: the suffix only tells Claude Code the window size.
|
|
21
25
|
const routed = [payload.model?.id, payload.model?.display_name].some((name) =>
|
|
22
26
|
names.includes(name?.replace(/\[1m\]$/, '')),
|