@workweave/router 0.2.11 → 0.2.12
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/README.md +25 -11
- package/cc-statusline.sh +95 -16
- package/codex-skills/fm/SKILL.md +15 -0
- package/codex-skills/fm/scripts/emit.sh +8 -0
- package/codex-skills/force-model/SKILL.md +8 -7
- package/codex-skills/force-model/scripts/emit.sh +9 -0
- package/codex-skills/rf/SKILL.md +15 -0
- package/codex-skills/rf/scripts/emit.sh +7 -0
- package/codex-skills/router-feedback/SKILL.md +8 -7
- package/codex-skills/router-feedback/scripts/emit.sh +9 -0
- package/codex-skills/router-models/SKILL.md +51 -0
- package/codex-skills/router-off/SKILL.md +22 -0
- package/codex-skills/router-on/SKILL.md +22 -0
- package/codex-skills/router-status/SKILL.md +19 -0
- package/codex-skills/ufm/SKILL.md +14 -0
- package/codex-skills/ufm/scripts/emit.sh +3 -0
- package/codex-skills/unforce-model/SKILL.md +6 -6
- package/codex-skills/unforce-model/scripts/emit.sh +4 -0
- package/codex-status.sh +312 -0
- package/commands/beta.md +5 -0
- package/directives.tsv +5 -4
- package/install.sh +882 -254
- package/package.json +2 -1
- package/pi-router/README.md +3 -0
- package/pi-router/src/beta.ts +21 -0
- package/pi-router/src/index.ts +2 -0
- package/pi-router/src/pricing.generated.ts +77 -75
- package/pi-router/src/savings.ts +1 -1
- package/registry.sh +2 -0
- package/uninstall.sh +41 -5
package/README.md
CHANGED
|
@@ -15,11 +15,13 @@ npx @workweave/router --non-interactive # reads $WEAVE_ROUTER_KEY, no prompt
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Re-running the installer to pick up changes reuses the key already on disk, so
|
|
18
|
-
you paste it once and never again
|
|
19
|
-
(safe for cron; errors instead of
|
|
18
|
+
you paste it once and never again — for every client, not just Claude Code.
|
|
19
|
+
`update` is the never-prompting form of that (safe for cron; errors instead of
|
|
20
|
+
asking when no key can be found):
|
|
20
21
|
|
|
21
22
|
```bash
|
|
22
23
|
npx @workweave/router --claude # reuses the installed key
|
|
24
|
+
npx @workweave/router --codex # same for Codex, opencode, and pi
|
|
23
25
|
npx @workweave/router --claude --rotate-key # ignore it and prompt for a new one
|
|
24
26
|
npx @workweave/router update --claude # non-interactive refresh in place
|
|
25
27
|
```
|
|
@@ -27,8 +29,11 @@ npx @workweave/router update --claude # non-interactive refresh in place
|
|
|
27
29
|
For Claude Code the installed statusline and `/force-model`, `/router-*` slash
|
|
28
30
|
commands also refresh themselves in the background about once a week (never
|
|
29
31
|
overwriting a wrapper you edited). Opt out with `WEAVE_STATUSLINE_UPDATE=0`, or
|
|
30
|
-
just the commands with `WEAVE_COMMANDS_UPDATE=0`. Codex
|
|
31
|
-
|
|
32
|
+
just the commands with `WEAVE_COMMANDS_UPDATE=0`. Codex installs native `$` skills
|
|
33
|
+
plus managed `SessionStart`/`Stop` hooks: the latest routed model is reflected in
|
|
34
|
+
the terminal title and a compact `Weave Router · …` status message is shown when
|
|
35
|
+
the router reports a new route. Existing Codex hooks are preserved. OpenCode and pi
|
|
36
|
+
have their own target-specific integrations.
|
|
32
37
|
|
|
33
38
|
Version-pin for reproducible setups:
|
|
34
39
|
|
|
@@ -48,7 +53,9 @@ npx @workweave/router status --codex # is Codex on the router or direct?
|
|
|
48
53
|
Claude Code reads its router setting at launch, so quit and reopen it after an
|
|
49
54
|
on/off. Codex and opencode pick it up on their next run. Inside Claude Code the
|
|
50
55
|
slash commands `/router-off`, `/router-on`, and `/router-status` do the same.
|
|
51
|
-
Codex installs
|
|
56
|
+
Codex installs `$router-status`, `$router-off`, `$router-on`, and
|
|
57
|
+
`$router-models` skills that call the same CLI verbs, plus a
|
|
58
|
+
`$disable-routing` skill that switches its next session back
|
|
52
59
|
to the normal provider; Codex does not support third-party `/disable-routing`
|
|
53
60
|
slash commands. The shell equivalent is `npx @workweave/router disable-routing`.
|
|
54
61
|
Cursor has no config file we own — toggle its base URL override in **Settings →
|
|
@@ -58,6 +65,7 @@ Pick which models the router is allowed to route to:
|
|
|
58
65
|
|
|
59
66
|
```bash
|
|
60
67
|
npx @workweave/router models --claude # list every model, with its on/off state
|
|
68
|
+
npx @workweave/router models --codex # same, for a Codex install
|
|
61
69
|
npx @workweave/router models disable gpt-5.6 --claude # take one out of rotation
|
|
62
70
|
npx @workweave/router models enable gpt-5.6 --claude # put it back
|
|
63
71
|
```
|
|
@@ -102,10 +110,17 @@ Four install targets:
|
|
|
102
110
|
The block lives between begin/end markers
|
|
103
111
|
so re-running the installer rewrites it cleanly and `--uninstall --codex`
|
|
104
112
|
removes it without touching the rest of your config. Codex does not load
|
|
105
|
-
third-party slash-command files;
|
|
106
|
-
|
|
107
|
-
`$
|
|
108
|
-
|
|
113
|
+
third-party slash-command files; the installer provides native skills
|
|
114
|
+
`$force-model` (`$fm`), `$unforce-model` (`$ufm`), and `$router-feedback`
|
|
115
|
+
(`$rf`), each of which execs a local `scripts/emit.sh` that prints the same
|
|
116
|
+
leading-space directive Claude Code uses (for example,
|
|
117
|
+
` /force-model gpt-5.6-terra`) — you can also type that form directly. It
|
|
118
|
+
also installs `$router-status`, `$router-off`, `$router-on`, and
|
|
119
|
+
`$router-models`, which call this installer's own verbs, plus a
|
|
120
|
+
`$disable-routing` skill that returns the next Codex session to the default
|
|
121
|
+
provider without logging out or deleting the router configuration. The
|
|
122
|
+
managed lifecycle hooks also keep the latest routed model in the terminal
|
|
123
|
+
title and emit a compact status message when the router reports a new route.
|
|
109
124
|
- **opencode** (`--opencode`) — merges a `provider.weave` entry (backed by
|
|
110
125
|
opencode's built-in `@ai-sdk/anthropic` provider) into
|
|
111
126
|
`~/.config/opencode/opencode.json` (or `<repo>/opencode.json` with
|
|
@@ -127,8 +142,7 @@ for the full reference.
|
|
|
127
142
|
|
|
128
143
|
- Node ≥ 18 (ships with `npx`)
|
|
129
144
|
- `bash` on PATH (macOS / Linux native; Windows needs Git Bash or WSL)
|
|
130
|
-
- `jq` on PATH — used by the Claude Code status line and the opencode/pi JSON
|
|
131
|
-
merges. Not required for the Codex path.
|
|
145
|
+
- `jq` on PATH — used by the Claude Code status line, the Codex lifecycle helper, and the opencode/pi JSON merges.
|
|
132
146
|
|
|
133
147
|
## Why npx
|
|
134
148
|
|
package/cc-statusline.sh
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
# Renders:
|
|
17
17
|
# WEAVE ROUTER — claude-sonnet-4-5 ← claude-opus-4-7 · saved $1.23 · 12.4k in / 3.1k out / 45.2k cached
|
|
18
18
|
#
|
|
19
|
-
# Pricing source of truth: router/
|
|
20
|
-
#
|
|
21
|
-
#
|
|
19
|
+
# Pricing source of truth: internal/router/catalog. Input/output prices and
|
|
20
|
+
# cache-read multipliers are generated by cmd/genprices. Cache creation remains
|
|
21
|
+
# at 1.25× input pending TTL-aware pricing.
|
|
22
22
|
|
|
23
23
|
set -euo pipefail
|
|
24
24
|
|
|
@@ -530,6 +530,7 @@ prices='{
|
|
|
530
530
|
"z-ai/glm-5": 0.001,
|
|
531
531
|
"z-ai/glm-5.1": 0.0014,
|
|
532
532
|
"z-ai/glm-5.2": 0.0014,
|
|
533
|
+
"z-ai/glm-5.3": 0.0014,
|
|
533
534
|
"z-ai/glm-5.3-flash": 0.00015
|
|
534
535
|
},
|
|
535
536
|
"output": {
|
|
@@ -606,7 +607,85 @@ prices='{
|
|
|
606
607
|
"z-ai/glm-5": 0.0032,
|
|
607
608
|
"z-ai/glm-5.1": 0.0044,
|
|
608
609
|
"z-ai/glm-5.2": 0.0044,
|
|
610
|
+
"z-ai/glm-5.3": 0.0044,
|
|
609
611
|
"z-ai/glm-5.3-flash": 0.0005
|
|
612
|
+
},
|
|
613
|
+
"cache_read": {
|
|
614
|
+
"claude-fable-5": 0.1,
|
|
615
|
+
"claude-haiku-4-5": 0.1,
|
|
616
|
+
"claude-opus-4-0": 0.1,
|
|
617
|
+
"claude-opus-4-1": 0.1,
|
|
618
|
+
"claude-opus-4-5": 0.1,
|
|
619
|
+
"claude-opus-4-6": 0.1,
|
|
620
|
+
"claude-opus-4-7": 0.1,
|
|
621
|
+
"claude-opus-4-8": 0.1,
|
|
622
|
+
"claude-opus-5": 0.1,
|
|
623
|
+
"claude-sonnet-4-5": 0.1,
|
|
624
|
+
"claude-sonnet-4-6": 0.1,
|
|
625
|
+
"claude-sonnet-5": 0.1,
|
|
626
|
+
"deepseek/deepseek-v4-flash": 0.2,
|
|
627
|
+
"deepseek/deepseek-v4-pro": 0.11494252873563218,
|
|
628
|
+
"deepseek/deepseek-v4-pro-0813": 0.11494252873563218,
|
|
629
|
+
"gemini-2.0-flash": 0.25,
|
|
630
|
+
"gemini-2.0-flash-lite": 0.25,
|
|
631
|
+
"gemini-2.5-flash": 0.1,
|
|
632
|
+
"gemini-2.5-flash-lite": 0.1,
|
|
633
|
+
"gemini-2.5-pro": 0.1,
|
|
634
|
+
"gemini-3-flash-preview": 0.1,
|
|
635
|
+
"gemini-3-pro-preview": 0.1,
|
|
636
|
+
"gemini-3.1-flash-lite-preview": 0.1,
|
|
637
|
+
"gemini-3.1-pro-preview": 0.1,
|
|
638
|
+
"gemini-3.5-flash": 0.1,
|
|
639
|
+
"gemini-3.5-flash-lite": 0.1,
|
|
640
|
+
"gemini-3.6-flash": 0.1,
|
|
641
|
+
"gemini-3.7-flash": 0.1,
|
|
642
|
+
"google/gemma-4-26b-a4b-it": 0.1,
|
|
643
|
+
"gpt-4.1": 0.25,
|
|
644
|
+
"gpt-4.1-mini": 0.25,
|
|
645
|
+
"gpt-4.1-nano": 0.25,
|
|
646
|
+
"gpt-4o": 0.5,
|
|
647
|
+
"gpt-4o-mini": 0.5,
|
|
648
|
+
"gpt-5": 0.1,
|
|
649
|
+
"gpt-5-chat": 0.1,
|
|
650
|
+
"gpt-5-mini": 0.1,
|
|
651
|
+
"gpt-5-nano": 0.1,
|
|
652
|
+
"gpt-5.4": 0.1,
|
|
653
|
+
"gpt-5.4-mini": 0.1,
|
|
654
|
+
"gpt-5.4-nano": 0.1,
|
|
655
|
+
"gpt-5.4-pro": 1,
|
|
656
|
+
"gpt-5.5": 0.1,
|
|
657
|
+
"gpt-5.5-mini": 0.1,
|
|
658
|
+
"gpt-5.5-nano": 0.1,
|
|
659
|
+
"gpt-5.5-pro": 1,
|
|
660
|
+
"gpt-5.6-luna": 0.1,
|
|
661
|
+
"gpt-5.6-luna-pro": 0.1,
|
|
662
|
+
"gpt-5.6-sol": 0.1,
|
|
663
|
+
"gpt-5.6-sol-pro": 0.1,
|
|
664
|
+
"gpt-5.6-terra": 0.1,
|
|
665
|
+
"grok-4.5": 0.25,
|
|
666
|
+
"grok-4.6": 0.25,
|
|
667
|
+
"minimax/minimax-m2.7": 0.2,
|
|
668
|
+
"minimax/minimax-m3": 0.2,
|
|
669
|
+
"mistralai/mistral-small-2603": 0.1,
|
|
670
|
+
"moonshotai/kimi-k2.5": 0.5,
|
|
671
|
+
"moonshotai/kimi-k2.6": 0.1684,
|
|
672
|
+
"moonshotai/kimi-k2.7": 0.2,
|
|
673
|
+
"moonshotai/kimi-k3": 0.1,
|
|
674
|
+
"qwen/qwen3-235b-a22b-2507": 0.5,
|
|
675
|
+
"qwen/qwen3-30b-a3b-instruct-2507": 0.1684,
|
|
676
|
+
"qwen/qwen3-coder": 0.1684,
|
|
677
|
+
"qwen/qwen3-coder-next": 0.5,
|
|
678
|
+
"qwen/qwen3-next-80b-a3b-instruct": 0.5,
|
|
679
|
+
"qwen/qwen3.5-flash-02-23": 0.1,
|
|
680
|
+
"qwen/qwen3.6-35b-a3b": 0.1,
|
|
681
|
+
"qwen/qwen3.7-plus": 0.2,
|
|
682
|
+
"qwen/qwen3.8-max": 0.125,
|
|
683
|
+
"xiaomi/mimo-v2.5-pro": 0.1,
|
|
684
|
+
"z-ai/glm-5": 0.2,
|
|
685
|
+
"z-ai/glm-5.1": 0.18571428571428572,
|
|
686
|
+
"z-ai/glm-5.2": 0.18571428571428572,
|
|
687
|
+
"z-ai/glm-5.3": 0.18571428571428572,
|
|
688
|
+
"z-ai/glm-5.3-flash": 0.2
|
|
610
689
|
}
|
|
611
690
|
}'
|
|
612
691
|
# END_GENERATED_PRICES
|
|
@@ -691,12 +770,9 @@ if [[ -n "$transcript_path" && -f "$transcript_path" ]]; then
|
|
|
691
770
|
# Compute a session running total: savings across every assistant turn
|
|
692
771
|
# whose marker reports a requested ≠ routed swap, plus cumulative token
|
|
693
772
|
# counts across every assistant turn (rerouted or not — total work the
|
|
694
|
-
# session has done). cache_creation is priced at 1.25× input
|
|
695
|
-
#
|
|
696
|
-
#
|
|
697
|
-
# in the savings comparison: both costs apply the same 0.1× weight to
|
|
698
|
-
# cache_read_input_tokens, so the delta reflects the model-price
|
|
699
|
-
# difference on the cached portion as well.
|
|
773
|
+
# session has done). cache_creation is priced at 1.25× input; cache_read
|
|
774
|
+
# uses each model's generated catalog multiplier. Both are no-ops when the
|
|
775
|
+
# provider does not return those fields.
|
|
700
776
|
#
|
|
701
777
|
# The marker regex tolerates the optional "(<provider>)" segment and a
|
|
702
778
|
# `[1m]` / `-YYYYMMDD` suffix on either model name so transcripts written
|
|
@@ -729,14 +805,17 @@ if [[ -n "$transcript_path" && -f "$transcript_path" ]]; then
|
|
|
729
805
|
} as $t |
|
|
730
806
|
(if $requested == "" or $requested == $rm then 0
|
|
731
807
|
else
|
|
732
|
-
($p.input[$rm] // null)
|
|
733
|
-
($p.
|
|
734
|
-
|
|
808
|
+
($p.input[$rm] // null) as $rin | ($p.output[$rm] // null) as $rout |
|
|
809
|
+
($p.cache_read[$rm] // null) as $rcr |
|
|
810
|
+
($p.input[$requested] // null) as $sin | ($p.output[$requested] // null) as $sout |
|
|
811
|
+
($p.cache_read[$requested] // null) as $scr |
|
|
812
|
+
if ($rin == null or $rout == null or $rcr == null or $sin == null or $sout == null or $scr == null) then 0
|
|
735
813
|
else
|
|
736
|
-
(($t.in + 1.25 * $t.cwrt +
|
|
737
|
-
($t.
|
|
738
|
-
($
|
|
739
|
-
($
|
|
814
|
+
(($t.in + 1.25 * $t.cwrt + $rcr * $t.crd) / 1000) as $routed_input_units |
|
|
815
|
+
(($t.in + 1.25 * $t.cwrt + $scr * $t.crd) / 1000) as $requested_input_units |
|
|
816
|
+
($t.out / 1000) as $output_units |
|
|
817
|
+
($routed_input_units * $rin + $output_units * $rout) as $routed_cost |
|
|
818
|
+
($requested_input_units * $sin + $output_units * $sout) as $requested_cost |
|
|
740
819
|
($requested_cost - $routed_cost)
|
|
741
820
|
end
|
|
742
821
|
end) as $savings |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fm
|
|
3
|
+
description: "Alias for force-model — pin this Codex session to a specific model through the Weave Router."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- weave-router managed fm skill -->
|
|
7
|
+
|
|
8
|
+
When the user invokes `$fm <model-id>`, run this skill's `scripts/emit.sh` using the
|
|
9
|
+
absolute path shown in this skill's `<path>` (its directory + `/scripts/emit.sh`).
|
|
10
|
+
Pass the model id as arguments, quoted as a single argument list.
|
|
11
|
+
Do not send a user message and do not type a Codex slash command.
|
|
12
|
+
|
|
13
|
+
The script prints a leading-space `/force-model` line. The Weave Router reads that
|
|
14
|
+
exec output, pins the session, and continues this turn — so run the script once and
|
|
15
|
+
do not repeat its output as your answer. Then report the router's response.
|
|
@@ -5,10 +5,11 @@ description: "Pin this Codex session to a specific model through the Weave Route
|
|
|
5
5
|
|
|
6
6
|
<!-- weave-router managed force-model skill -->
|
|
7
7
|
|
|
8
|
-
When the user invokes `$force-model <model-id>` (or
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
When the user invokes `$force-model <model-id>` (or `$fm`), run this skill's `scripts/emit.sh` using the
|
|
9
|
+
absolute path shown in this skill's `<path>` (its directory + `/scripts/emit.sh`).
|
|
10
|
+
Pass the model id as arguments, quoted as a single argument list.
|
|
11
|
+
Do not send a user message and do not type a Codex slash command.
|
|
12
|
+
|
|
13
|
+
The script prints a leading-space `/force-model` line. The Weave Router reads that
|
|
14
|
+
exec output, pins the session, and continues this turn — so run the script once and
|
|
15
|
+
do not repeat its output as your answer. Then report the router's response.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Print a leading-space /force-model directive. Codex runs this via exec;
|
|
3
|
+
# the Weave Router intercepts the tool output and pins the session.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
if [ "$#" -eq 0 ] || [ -z "${1:-}" ]; then
|
|
6
|
+
echo "usage: emit.sh <model-id>" >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
9
|
+
printf ' /force-model %s\n' "$*"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rf
|
|
3
|
+
description: "Alias for router-feedback — submit feedback about a Weave Router decision or model performance."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- weave-router managed rf skill -->
|
|
7
|
+
|
|
8
|
+
When the user invokes `$rf <feedback>`, run this skill's `scripts/emit.sh` using the
|
|
9
|
+
absolute path shown in this skill's `<path>` (its directory + `/scripts/emit.sh`).
|
|
10
|
+
Pass the feedback text as arguments, quoted as a single argument list.
|
|
11
|
+
Do not send a user message and do not type a Codex slash command.
|
|
12
|
+
|
|
13
|
+
The script prints a leading-space `/router-feedback` line. The Weave Router reads that
|
|
14
|
+
exec output, records the feedback, and continues this turn — so run the script once and
|
|
15
|
+
do not repeat its output as your answer. Then report the router's response.
|
|
@@ -5,10 +5,11 @@ description: "Submit feedback about a Weave Router decision or model performance
|
|
|
5
5
|
|
|
6
6
|
<!-- weave-router managed router-feedback skill -->
|
|
7
7
|
|
|
8
|
-
When the user invokes `$router-feedback <feedback>` (or
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
When the user invokes `$router-feedback <feedback>` (or `$rf`), run this skill's `scripts/emit.sh` using the
|
|
9
|
+
absolute path shown in this skill's `<path>` (its directory + `/scripts/emit.sh`).
|
|
10
|
+
Pass the feedback text as arguments, quoted as a single argument list.
|
|
11
|
+
Do not send a user message and do not type a Codex slash command.
|
|
12
|
+
|
|
13
|
+
The script prints a leading-space `/router-feedback` line. The Weave Router reads that
|
|
14
|
+
exec output, records the feedback, and continues this turn — so run the script once and
|
|
15
|
+
do not repeat its output as your answer. Then report the router's response.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Print a leading-space /router-feedback directive. Codex runs this via exec;
|
|
3
|
+
# the Weave Router intercepts the tool output and records the feedback.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
if [ "$#" -eq 0 ] || [ -z "${1:-}" ]; then
|
|
6
|
+
echo "usage: emit.sh <feedback>" >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
9
|
+
printf ' /router-feedback %s\n' "$*"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: router-models
|
|
3
|
+
description: "List the models the Weave Router may route to, and turn them on or off."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- weave-router managed router-models skill -->
|
|
7
|
+
|
|
8
|
+
# Weave Router model selection
|
|
9
|
+
|
|
10
|
+
When the user invokes `$router-models`, show which models this
|
|
11
|
+
installation lets the router pick from, and change that selection when asked.
|
|
12
|
+
This is the same list — and the same stored setting — as the checkboxes on the
|
|
13
|
+
router dashboard's settings page.
|
|
14
|
+
|
|
15
|
+
Start by running:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx --package @workweave/router -y -- weave-router models --codex{{SCOPE}}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
That prints every deployed model grouped by provider, with `[x]` for models the
|
|
22
|
+
router may pick and `[ ]` for models it may not. Present it back as a compact
|
|
23
|
+
checklist in that same `[x]` / `[ ]` form, keeping the provider grouping and the
|
|
24
|
+
exact model ids — the user selects models by id.
|
|
25
|
+
|
|
26
|
+
Then:
|
|
27
|
+
|
|
28
|
+
- If the user named models or providers, work out whether they want them on or
|
|
29
|
+
off from how they phrased it, and apply it with
|
|
30
|
+
`weave-router models enable <id>... --codex{{SCOPE}}` or
|
|
31
|
+
`weave-router models disable <id>... --codex{{SCOPE}}` (add `providers` before
|
|
32
|
+
`enable`/`disable` to switch a whole provider). Several ids can go in one
|
|
33
|
+
call. Then re-run the list and show the result.
|
|
34
|
+
- If they named nothing, stop after the list and ask which ones to change.
|
|
35
|
+
Never change anything they did not ask for.
|
|
36
|
+
|
|
37
|
+
Other things they might ask for:
|
|
38
|
+
|
|
39
|
+
- Rank models by preference:
|
|
40
|
+
`weave-router models prefer <id> <id>... --codex{{SCOPE}}` (order matters), or
|
|
41
|
+
`weave-router models prefer clear --codex{{SCOPE}}` to drop the ranking.
|
|
42
|
+
- Providers only: `weave-router models providers --codex{{SCOPE}}`.
|
|
43
|
+
|
|
44
|
+
If the command reports that this router doesn't expose model selection, that's a
|
|
45
|
+
Weave-hosted router: model selection belongs to the whole organization there, so
|
|
46
|
+
tell the user to change it at https://router.workweave.ai/dashboard/settings —
|
|
47
|
+
don't try to work around it. Its listing carries no on/off state, so present it
|
|
48
|
+
as a plain list; don't infer which models are enabled.
|
|
49
|
+
|
|
50
|
+
Disabling a model takes effect on the router's next routing decision; no restart
|
|
51
|
+
is needed.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: router-off
|
|
3
|
+
description: "Route Codex to its default provider again (turn the Weave Router off)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- weave-router managed router-off skill -->
|
|
7
|
+
|
|
8
|
+
# Turn Weave routing off
|
|
9
|
+
|
|
10
|
+
When the user invokes `$router-off`, switch this Codex installation off the
|
|
11
|
+
Weave Router without logging out or deleting its router configuration.
|
|
12
|
+
|
|
13
|
+
Run exactly:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx --package @workweave/router -y -- weave-router off --codex{{SCOPE}}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then report the result and tell the user the change takes effect on their next
|
|
20
|
+
`codex` launch — Codex reads its provider config at startup, so the current
|
|
21
|
+
session keeps routing as it already was. It can be reversed with
|
|
22
|
+
`$router-on`. Do not uninstall the router or alter any other Codex settings.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: router-on
|
|
3
|
+
description: "Route Codex through the Weave Router again (turn it back on)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- weave-router managed router-on skill -->
|
|
7
|
+
|
|
8
|
+
# Turn Weave routing on
|
|
9
|
+
|
|
10
|
+
When the user invokes `$router-on`, switch this Codex installation back onto
|
|
11
|
+
the Weave Router using the managed configuration already on disk.
|
|
12
|
+
|
|
13
|
+
Run exactly:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx --package @workweave/router -y -- weave-router on --codex{{SCOPE}}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then report the result and tell the user the change takes effect on their next
|
|
20
|
+
`codex` launch — Codex reads its provider config at startup, so the current
|
|
21
|
+
session keeps routing as it already was. Do not re-run the installer or alter
|
|
22
|
+
any other Codex settings.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: router-status
|
|
3
|
+
description: "Show whether Codex is routing through the Weave Router or using its default provider."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- weave-router managed router-status skill -->
|
|
7
|
+
|
|
8
|
+
# Weave Router status
|
|
9
|
+
|
|
10
|
+
When the user invokes `$router-status`, report whether this Codex installation
|
|
11
|
+
routes through the Weave Router.
|
|
12
|
+
|
|
13
|
+
Run exactly:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx --package @workweave/router -y -- weave-router status --codex{{SCOPE}}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then summarize the result in one line. Do not change any configuration.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ufm
|
|
3
|
+
description: "Alias for unforce-model — clear the active Weave Router model pin."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- weave-router managed ufm skill -->
|
|
7
|
+
|
|
8
|
+
When the user invokes `$ufm`, run this skill's `scripts/emit.sh` using the
|
|
9
|
+
absolute path shown in this skill's `<path>` (its directory + `/scripts/emit.sh`).
|
|
10
|
+
Do not send a user message and do not type a Codex slash command.
|
|
11
|
+
|
|
12
|
+
The script prints a leading-space `/unforce-model` line. The Weave Router reads that
|
|
13
|
+
exec output, clears the pin, and continues this turn — so run the script once and
|
|
14
|
+
do not repeat its output as your answer. Then report the router's response.
|
|
@@ -5,10 +5,10 @@ description: "Clear the active Weave Router model pin for this Codex session."
|
|
|
5
5
|
|
|
6
6
|
<!-- weave-router managed unforce-model skill -->
|
|
7
7
|
|
|
8
|
-
When the user invokes `$unforce-model` (or
|
|
8
|
+
When the user invokes `$unforce-model` (or `$ufm`), run this skill's `scripts/emit.sh` using the
|
|
9
|
+
absolute path shown in this skill's `<path>` (its directory + `/scripts/emit.sh`).
|
|
10
|
+
Do not send a user message and do not type a Codex slash command.
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Report the router's response after it returns.
|
|
12
|
+
The script prints a leading-space `/unforce-model` line. The Weave Router reads that
|
|
13
|
+
exec output, clears the pin, and continues this turn — so run the script once and
|
|
14
|
+
do not repeat its output as your answer. Then report the router's response.
|