@weave-os/router 0.2.26 → 0.2.28
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/cc-statusline.sh +3 -0
- package/install.sh +34 -31
- package/package.json +1 -1
- package/pi-router/src/pricing.generated.ts +2 -1
package/cc-statusline.sh
CHANGED
|
@@ -480,6 +480,7 @@ prices='{
|
|
|
480
480
|
"claude-sonnet-4-5": 0.003,
|
|
481
481
|
"claude-sonnet-4-6": 0.003,
|
|
482
482
|
"claude-sonnet-5": 0.003,
|
|
483
|
+
"claude-sonnet-5-5": 0.002,
|
|
483
484
|
"deepseek/deepseek-v4-flash": 0.0001134,
|
|
484
485
|
"deepseek/deepseek-v4-pro": 0.00174,
|
|
485
486
|
"deepseek/deepseek-v4-pro-0813": 0.00174,
|
|
@@ -569,6 +570,7 @@ prices='{
|
|
|
569
570
|
"claude-sonnet-4-5": 0.015,
|
|
570
571
|
"claude-sonnet-4-6": 0.015,
|
|
571
572
|
"claude-sonnet-5": 0.015,
|
|
573
|
+
"claude-sonnet-5-5": 0.01,
|
|
572
574
|
"deepseek/deepseek-v4-flash": 0.0002791,
|
|
573
575
|
"deepseek/deepseek-v4-pro": 0.00348,
|
|
574
576
|
"deepseek/deepseek-v4-pro-0813": 0.00348,
|
|
@@ -658,6 +660,7 @@ prices='{
|
|
|
658
660
|
"claude-sonnet-4-5": 0.1,
|
|
659
661
|
"claude-sonnet-4-6": 0.1,
|
|
660
662
|
"claude-sonnet-5": 0.1,
|
|
663
|
+
"claude-sonnet-5-5": 0.1,
|
|
661
664
|
"deepseek/deepseek-v4-flash": 0.2,
|
|
662
665
|
"deepseek/deepseek-v4-pro": 0.0862,
|
|
663
666
|
"deepseek/deepseek-v4-pro-0813": 0.0862,
|
package/install.sh
CHANGED
|
@@ -1055,8 +1055,9 @@ write_opencode_config() {
|
|
|
1055
1055
|
# imply a choice that the router intentionally does not honor. Whichever
|
|
1056
1056
|
# model serves a turn uses its matching subscription when one is connected.
|
|
1057
1057
|
# OpenCode interprets omitted custom-model limits as zero, which disables its
|
|
1058
|
-
# overflow compaction.
|
|
1059
|
-
#
|
|
1058
|
+
# overflow compaction. 500K matches the smallest Auto-roster window
|
|
1059
|
+
# (grok-4.6); the old 128K cap left ~96K for input and compacted too early.
|
|
1060
|
+
# The router still filters per-turn overflow candidates.
|
|
1060
1061
|
#
|
|
1061
1062
|
# npm is @ai-sdk/openai and baseURL KEEPS its /v1 here: opencode's
|
|
1062
1063
|
# @ai-sdk/openai provider appends /responses, yielding the router's
|
|
@@ -1079,7 +1080,7 @@ write_opencode_config() {
|
|
|
1079
1080
|
reasoning: true,
|
|
1080
1081
|
attachment: true,
|
|
1081
1082
|
modalities: { input: ["text", "image", "pdf"], output: ["text"] },
|
|
1082
|
-
limit: { context:
|
|
1083
|
+
limit: { context: 500000, output: 32000 }
|
|
1083
1084
|
}
|
|
1084
1085
|
}
|
|
1085
1086
|
}
|
|
@@ -1228,6 +1229,7 @@ write_pi_models_config() {
|
|
|
1228
1229
|
{ id: "claude-fable-5", name: "Claude Fable 5 (via Weave Router)", reasoning: true, input: ["text","image"], contextWindow: 1000000, maxTokens: 128000 },
|
|
1229
1230
|
{ id: "claude-opus-5-5", name: "Claude Opus 5.5 (via Weave Router)", reasoning: true, input: ["text","image"], contextWindow: 1000000, maxTokens: 128000 },
|
|
1230
1231
|
{ id: "claude-opus-5", name: "Claude Opus 5 (via Weave Router)", reasoning: true, input: ["text","image"], contextWindow: 1000000, maxTokens: 128000 },
|
|
1232
|
+
{ id: "claude-sonnet-5-5", name: "Claude Sonnet 5.5 (via Weave Router)", reasoning: true, input: ["text","image"], contextWindow: 1000000, maxTokens: 128000 },
|
|
1231
1233
|
{ id: "claude-opus-4-7", name: "Claude Opus 4.7 (via Weave Router)", reasoning: true, input: ["text","image"], contextWindow: 1000000, maxTokens: 64000 },
|
|
1232
1234
|
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6 (via Weave Router)", reasoning: true, input: ["text","image"], contextWindow: 1000000, maxTokens: 64000 },
|
|
1233
1235
|
{ id: "claude-haiku-4-5", name: "Claude Haiku 4.5 (via Weave Router)", reasoning: true, input: ["text","image"], contextWindow: 200000, maxTokens: 32000 },
|
|
@@ -2616,7 +2618,7 @@ prepare_claude_context_window() {
|
|
|
2616
2618
|
model="${model:-sonnet}"
|
|
2617
2619
|
case "$model" in
|
|
2618
2620
|
*'[1m]') context_window=""; return 0 ;;
|
|
2619
|
-
sonnet|opus|fable|claude-sonnet-4-6|claude-sonnet-5|claude-opus-4-6|claude-opus-4-7|claude-opus-4-8|claude-opus-5|claude-opus-5-5|claude-fable-5|claude-fable-5-1) ;;
|
|
2621
|
+
sonnet|opus|fable|claude-sonnet-4-6|claude-sonnet-5|claude-sonnet-5-5|claude-opus-4-6|claude-opus-4-7|claude-opus-4-8|claude-opus-5|claude-opus-5-5|claude-fable-5|claude-fable-5-1) ;;
|
|
2620
2622
|
*) err "Cannot assert 1M support for '$model'. Select a supported Sonnet/Opus/Fable model first; leaving it unchanged."; return 1 ;;
|
|
2621
2623
|
esac
|
|
2622
2624
|
context_managed_model="${model}[1m]"
|
|
@@ -2681,33 +2683,29 @@ toggle_claude() {
|
|
|
2681
2683
|
case "$mode" in
|
|
2682
2684
|
status)
|
|
2683
2685
|
local on_hint="on --claude"
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
# settings.local.json carries the key header. A fresh clone (shared
|
|
2694
|
-
# settings.json, no personal local file) has the URL but no key.
|
|
2695
|
-
if claude_key_present "$local_settings_file"; then
|
|
2696
|
-
ok "Claude Code (project): ${C_BOLD}on${C_RESET} — routing through $committed_base."
|
|
2697
|
-
else
|
|
2698
|
-
warn "Claude Code (project): router URL is set but your personal router key is missing (no settings.local.json) — requests won't authenticate. Run the installer to add your key."
|
|
2699
|
-
fi
|
|
2700
|
-
else
|
|
2701
|
-
info "Claude Code (project): not configured for the router. Run the installer first."
|
|
2686
|
+
local effective_base="$committed_base" key_settings_file="$settings_file" status_label="Claude Code"
|
|
2687
|
+
[ "$scope" = "project" ] && on_hint="on --claude --scope project"
|
|
2688
|
+
if [ "$scope" = "project" ]; then
|
|
2689
|
+
status_label="Claude Code (project)"
|
|
2690
|
+
if [ -f "$local_settings_file" ] && jq -e '.env | has("ANTHROPIC_BASE_URL")' "$local_settings_file" >/dev/null 2>&1; then
|
|
2691
|
+
effective_base="$(json_get "$local_settings_file" '.env.ANTHROPIC_BASE_URL')"
|
|
2692
|
+
fi
|
|
2693
|
+
if [ -f "$local_settings_file" ] && jq -e '.env | has("ANTHROPIC_CUSTOM_HEADERS")' "$local_settings_file" >/dev/null 2>&1; then
|
|
2694
|
+
key_settings_file="$local_settings_file"
|
|
2702
2695
|
fi
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2696
|
+
fi
|
|
2697
|
+
if router_shaped_url "$effective_base"; then
|
|
2698
|
+
if claude_key_present "$key_settings_file"; then
|
|
2699
|
+
ok "$status_label: ${C_BOLD}on${C_RESET} in saved settings — endpoint $effective_base."
|
|
2706
2700
|
else
|
|
2707
|
-
warn "
|
|
2701
|
+
warn "$status_label: router key header is missing from active settings — Weave-key authentication is not configured; other authentication methods are not checked."
|
|
2708
2702
|
fi
|
|
2703
|
+
elif [ "$parked_present" = "true" ]; then
|
|
2704
|
+
ok "Claude Code: ${C_BOLD}off${C_RESET} in saved settings — direct to Anthropic. Run '$on_hint' to re-enable."
|
|
2705
|
+
elif [ -n "$effective_base" ]; then
|
|
2706
|
+
ok "$status_label: ${C_BOLD}off${C_RESET} in saved settings — direct to Anthropic. Run '$on_hint' to re-enable."
|
|
2709
2707
|
else
|
|
2710
|
-
info "
|
|
2708
|
+
info "$status_label: not configured for the router in this scope."
|
|
2711
2709
|
fi
|
|
2712
2710
|
;;
|
|
2713
2711
|
off)
|
|
@@ -3565,7 +3563,7 @@ run_login() {
|
|
|
3565
3563
|
}
|
|
3566
3564
|
|
|
3567
3565
|
run_router_status() {
|
|
3568
|
-
local saved_target
|
|
3566
|
+
local saved_target codex_endpoint redacted_key
|
|
3569
3567
|
saved_target="$target"
|
|
3570
3568
|
settings_dir="$settings_base/.claude"
|
|
3571
3569
|
settings_file="$settings_dir/settings.json"
|
|
@@ -3575,7 +3573,6 @@ run_router_status() {
|
|
|
3575
3573
|
local_settings_file=""
|
|
3576
3574
|
fi
|
|
3577
3575
|
codex_config_file="$settings_base/.codex/config.toml"
|
|
3578
|
-
target="claude"; claude_endpoint="$(resolve_installed_endpoint)"
|
|
3579
3576
|
target="codex"; codex_endpoint="$(resolve_installed_endpoint)"
|
|
3580
3577
|
target="$saved_target"
|
|
3581
3578
|
if [ "${#api_key}" -gt 8 ]; then
|
|
@@ -3585,11 +3582,14 @@ run_router_status() {
|
|
|
3585
3582
|
fi
|
|
3586
3583
|
printf 'Router: %s\nIdentity: %s\n' "$base_url" "$redacted_key"
|
|
3587
3584
|
if models_api GET "/validate"; then
|
|
3588
|
-
printf 'Connectivity: connected\n'
|
|
3585
|
+
printf 'Connectivity: connected (API key accepted; inference not verified)\n'
|
|
3589
3586
|
else
|
|
3590
3587
|
printf 'Connectivity: unavailable (HTTP %s)\n' "${models_http_status:-network error}"
|
|
3591
3588
|
fi
|
|
3592
|
-
printf 'Claude Code: %s
|
|
3589
|
+
printf 'Claude Code settings: %s (scope: %s)\n' "$settings_dir" "$scope"
|
|
3590
|
+
# Administrative lookup includes parked credentials; routing status must not.
|
|
3591
|
+
toggle_claude
|
|
3592
|
+
printf 'Status describes this scope only, not a running session; other scopes or runtime overrides may differ. Restart Claude Code after on/off changes.\n'
|
|
3593
3593
|
printf 'Codex: %s\n' "$(if [ "${codex_endpoint%/}" = "${base_url%/}" ]; then printf 'points at Router'; elif [ -n "$codex_endpoint" ]; then printf 'different endpoint (%s)' "$codex_endpoint"; else printf 'not configured'; fi)"
|
|
3594
3594
|
if models_api GET "/v1/subscriptions/accounts"; then
|
|
3595
3595
|
printf 'Subscription accounts:\n'
|
|
@@ -5663,6 +5663,7 @@ prices='{
|
|
|
5663
5663
|
"claude-sonnet-4-5": 0.003,
|
|
5664
5664
|
"claude-sonnet-4-6": 0.003,
|
|
5665
5665
|
"claude-sonnet-5": 0.003,
|
|
5666
|
+
"claude-sonnet-5-5": 0.002,
|
|
5666
5667
|
"deepseek/deepseek-v4-flash": 0.0001134,
|
|
5667
5668
|
"deepseek/deepseek-v4-pro": 0.00174,
|
|
5668
5669
|
"deepseek/deepseek-v4-pro-0813": 0.00174,
|
|
@@ -5752,6 +5753,7 @@ prices='{
|
|
|
5752
5753
|
"claude-sonnet-4-5": 0.015,
|
|
5753
5754
|
"claude-sonnet-4-6": 0.015,
|
|
5754
5755
|
"claude-sonnet-5": 0.015,
|
|
5756
|
+
"claude-sonnet-5-5": 0.01,
|
|
5755
5757
|
"deepseek/deepseek-v4-flash": 0.0002791,
|
|
5756
5758
|
"deepseek/deepseek-v4-pro": 0.00348,
|
|
5757
5759
|
"deepseek/deepseek-v4-pro-0813": 0.00348,
|
|
@@ -5841,6 +5843,7 @@ prices='{
|
|
|
5841
5843
|
"claude-sonnet-4-5": 0.1,
|
|
5842
5844
|
"claude-sonnet-4-6": 0.1,
|
|
5843
5845
|
"claude-sonnet-5": 0.1,
|
|
5846
|
+
"claude-sonnet-5-5": 0.1,
|
|
5844
5847
|
"deepseek/deepseek-v4-flash": 0.2,
|
|
5845
5848
|
"deepseek/deepseek-v4-pro": 0.0862,
|
|
5846
5849
|
"deepseek/deepseek-v4-pro-0813": 0.0862,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weave-os/router",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.28",
|
|
4
4
|
"description": "One-command installer that points Claude Code, Codex, opencode, or pi at the Weave Router. For pi it also ships the routing extension, loaded via pi.extensions.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"weave-router": "bin.js",
|
|
@@ -7,7 +7,7 @@ export interface ModelPricing {
|
|
|
7
7
|
cacheReadMultiplier: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const PRICING_VERSION = "catalog-sha256:
|
|
10
|
+
export const PRICING_VERSION = "catalog-sha256:94da2566a9190f8b";
|
|
11
11
|
|
|
12
12
|
export const MODEL_PRICING: Readonly<Record<string, ModelPricing>> = Object.freeze({
|
|
13
13
|
"claude-fable-5": { inputUsdPerMillion: 10, outputUsdPerMillion: 50, cacheReadMultiplier: 0.1 },
|
|
@@ -24,6 +24,7 @@ export const MODEL_PRICING: Readonly<Record<string, ModelPricing>> = Object.free
|
|
|
24
24
|
"claude-sonnet-4-5": { inputUsdPerMillion: 3, outputUsdPerMillion: 15, cacheReadMultiplier: 0.1 },
|
|
25
25
|
"claude-sonnet-4-6": { inputUsdPerMillion: 3, outputUsdPerMillion: 15, cacheReadMultiplier: 0.1 },
|
|
26
26
|
"claude-sonnet-5": { inputUsdPerMillion: 3, outputUsdPerMillion: 15, cacheReadMultiplier: 0.1 },
|
|
27
|
+
"claude-sonnet-5-5": { inputUsdPerMillion: 2, outputUsdPerMillion: 10, cacheReadMultiplier: 0.1 },
|
|
27
28
|
"deepseek/deepseek-v4-flash": { inputUsdPerMillion: 0.1134, outputUsdPerMillion: 0.2791, cacheReadMultiplier: 0.2 },
|
|
28
29
|
"deepseek/deepseek-v4-pro": { inputUsdPerMillion: 1.74, outputUsdPerMillion: 3.48, cacheReadMultiplier: 0.0862 },
|
|
29
30
|
"deepseek/deepseek-v4-pro-0813": { inputUsdPerMillion: 1.74, outputUsdPerMillion: 3.48, cacheReadMultiplier: 0.0862 },
|