@weave-os/router 0.2.14
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/LICENSE +90 -0
- package/README.md +172 -0
- package/bin.js +68 -0
- package/cc-statusline.sh +951 -0
- package/codex-skills/disable-routing/SKILL.md +22 -0
- package/codex-skills/fm/SKILL.md +15 -0
- package/codex-skills/fm/scripts/emit.sh +8 -0
- package/codex-skills/force-model/SKILL.md +15 -0
- 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 +15 -0
- 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 +14 -0
- package/codex-skills/unforce-model/scripts/emit.sh +4 -0
- package/codex-status.sh +378 -0
- package/commands/beta.md +5 -0
- package/commands/fm.md +6 -0
- package/commands/force-model.md +6 -0
- package/commands/models.md +46 -0
- package/commands/rf.md +6 -0
- package/commands/router-feedback.md +6 -0
- package/commands/router-models.md +46 -0
- package/commands/router-off.md +10 -0
- package/commands/router-on.md +10 -0
- package/commands/router-session.md +15 -0
- package/commands/router-status.md +10 -0
- package/commands/ufm.md +5 -0
- package/commands/unforce-model.md +5 -0
- package/directives.tsv +13 -0
- package/install.sh +5092 -0
- package/opencode-weave/README.md +78 -0
- package/opencode-weave/package.json +18 -0
- package/opencode-weave/src/index.ts +655 -0
- package/package.json +79 -0
- package/pi-router/README.md +123 -0
- package/pi-router/package.json +25 -0
- package/pi-router/skills/install-lsps/SKILL.md +75 -0
- package/pi-router/skills/lsp-guide/SKILL.md +63 -0
- package/pi-router/src/beta.ts +21 -0
- package/pi-router/src/compaction.ts +188 -0
- package/pi-router/src/config.ts +293 -0
- package/pi-router/src/context-window.ts +12 -0
- package/pi-router/src/dispatch.ts +377 -0
- package/pi-router/src/force-model.ts +126 -0
- package/pi-router/src/index.ts +62 -0
- package/pi-router/src/lsp-broker.ts +255 -0
- package/pi-router/src/lsp-client.ts +435 -0
- package/pi-router/src/lsp-format.ts +230 -0
- package/pi-router/src/lsp-install.ts +215 -0
- package/pi-router/src/lsp-protocol.ts +128 -0
- package/pi-router/src/lsp-servers.ts +361 -0
- package/pi-router/src/lsp.ts +529 -0
- package/pi-router/src/metadata.ts +32 -0
- package/pi-router/src/pricing.generated.ts +91 -0
- package/pi-router/src/provider.ts +64 -0
- package/pi-router/src/routed-model.ts +182 -0
- package/pi-router/src/safety.ts +66 -0
- package/pi-router/src/savings.ts +191 -0
- package/pi-router/src/ui.ts +91 -0
- package/pi-router/src/wooly.ts +408 -0
- package/registry.sh +102 -0
- package/uninstall.sh +788 -0
package/commands/beta.md
ADDED
package/commands/fm.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Alias for /router-models — list the models the Weave Router may route to, and turn them on or off.
|
|
3
|
+
argument-hint: [model or provider to enable/disable]
|
|
4
|
+
allowed-tools: Bash(npx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Show me which models this installation lets the Weave Router pick from, and
|
|
8
|
+
change that selection when I ask. This is the same list — and the same stored
|
|
9
|
+
setting — as the checkboxes on the router dashboard's settings page.
|
|
10
|
+
|
|
11
|
+
Start by running:
|
|
12
|
+
|
|
13
|
+
`npx @weave-os/router models --claude{{SCOPE}}`
|
|
14
|
+
|
|
15
|
+
That prints every deployed model grouped by provider, with `[x]` for models the
|
|
16
|
+
router may pick and `[ ]` for models it may not. Present it back to me as a
|
|
17
|
+
compact checklist in that same `[x]` / `[ ]` form, keeping the provider
|
|
18
|
+
grouping and the exact model ids — I select models by id.
|
|
19
|
+
|
|
20
|
+
Then:
|
|
21
|
+
|
|
22
|
+
- If I named models or providers in `$ARGUMENTS`, work out whether I want them
|
|
23
|
+
on or off from how I phrased it, and apply it with
|
|
24
|
+
`npx @weave-os/router models enable <id>... --claude{{SCOPE}}` or
|
|
25
|
+
`npx @weave-os/router models disable <id>... --claude{{SCOPE}}` (add
|
|
26
|
+
`providers` before `enable`/`disable` to switch a whole provider). Several
|
|
27
|
+
ids can go in one call. Then re-run the list and show me the result.
|
|
28
|
+
- If I named nothing, stop after the list and ask which ones I want to change.
|
|
29
|
+
Don't change anything I didn't ask for.
|
|
30
|
+
|
|
31
|
+
Other things I might ask for:
|
|
32
|
+
|
|
33
|
+
- Rank models by preference:
|
|
34
|
+
`npx @weave-os/router models prefer <id> <id>... --claude{{SCOPE}}` (order
|
|
35
|
+
matters), or `npx @weave-os/router models prefer clear --claude{{SCOPE}}` to
|
|
36
|
+
drop the ranking.
|
|
37
|
+
- Providers only: `npx @weave-os/router models providers --claude{{SCOPE}}`.
|
|
38
|
+
|
|
39
|
+
If the command reports that this router doesn't expose model selection, that's
|
|
40
|
+
a Weave-hosted router: model selection belongs to the whole organization there,
|
|
41
|
+
so tell me to change it at https://router.workweave.ai/dashboard/settings —
|
|
42
|
+
don't try to work around it. Its listing carries no on/off state, so present it
|
|
43
|
+
as a plain list; don't infer which models are enabled.
|
|
44
|
+
|
|
45
|
+
Disabling a model takes effect on the router's next routing decision; no
|
|
46
|
+
restart is needed.
|
package/commands/rf.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: List the models the Weave Router may route to, and turn them on or off.
|
|
3
|
+
argument-hint: [model or provider to enable/disable]
|
|
4
|
+
allowed-tools: Bash(npx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Show me which models this installation lets the Weave Router pick from, and
|
|
8
|
+
change that selection when I ask. This is the same list — and the same stored
|
|
9
|
+
setting — as the checkboxes on the router dashboard's settings page.
|
|
10
|
+
|
|
11
|
+
Start by running:
|
|
12
|
+
|
|
13
|
+
`npx @weave-os/router models --claude{{SCOPE}}`
|
|
14
|
+
|
|
15
|
+
That prints every deployed model grouped by provider, with `[x]` for models the
|
|
16
|
+
router may pick and `[ ]` for models it may not. Present it back to me as a
|
|
17
|
+
compact checklist in that same `[x]` / `[ ]` form, keeping the provider
|
|
18
|
+
grouping and the exact model ids — I select models by id.
|
|
19
|
+
|
|
20
|
+
Then:
|
|
21
|
+
|
|
22
|
+
- If I named models or providers in `$ARGUMENTS`, work out whether I want them
|
|
23
|
+
on or off from how I phrased it, and apply it with
|
|
24
|
+
`npx @weave-os/router models enable <id>... --claude{{SCOPE}}` or
|
|
25
|
+
`npx @weave-os/router models disable <id>... --claude{{SCOPE}}` (add
|
|
26
|
+
`providers` before `enable`/`disable` to switch a whole provider). Several
|
|
27
|
+
ids can go in one call. Then re-run the list and show me the result.
|
|
28
|
+
- If I named nothing, stop after the list and ask which ones I want to change.
|
|
29
|
+
Don't change anything I didn't ask for.
|
|
30
|
+
|
|
31
|
+
Other things I might ask for:
|
|
32
|
+
|
|
33
|
+
- Rank models by preference:
|
|
34
|
+
`npx @weave-os/router models prefer <id> <id>... --claude{{SCOPE}}` (order
|
|
35
|
+
matters), or `npx @weave-os/router models prefer clear --claude{{SCOPE}}` to
|
|
36
|
+
drop the ranking.
|
|
37
|
+
- Providers only: `npx @weave-os/router models providers --claude{{SCOPE}}`.
|
|
38
|
+
|
|
39
|
+
If the command reports that this router doesn't expose model selection, that's
|
|
40
|
+
a Weave-hosted router: model selection belongs to the whole organization there,
|
|
41
|
+
so tell me to change it at https://router.workweave.ai/dashboard/settings —
|
|
42
|
+
don't try to work around it. Its listing carries no on/off state, so present it
|
|
43
|
+
as a plain list; don't infer which models are enabled.
|
|
44
|
+
|
|
45
|
+
Disabling a model takes effect on the router's next routing decision; no
|
|
46
|
+
restart is needed.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Route Claude Code directly to Anthropic again (turn the Weave Router off).
|
|
3
|
+
allowed-tools: Bash(npx:*)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Turn the Weave Router **off** for Claude Code by running:
|
|
7
|
+
|
|
8
|
+
`npx @weave-os/router off --claude{{SCOPE}}`
|
|
9
|
+
|
|
10
|
+
Then tell me to fully quit and reopen Claude Code — it only reads the router setting at startup, so the change won't apply to the current session until it restarts.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Route Claude Code through the Weave Router again (turn it back on).
|
|
3
|
+
allowed-tools: Bash(npx:*)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Turn the Weave Router **on** for Claude Code by running:
|
|
7
|
+
|
|
8
|
+
`npx @weave-os/router on --claude{{SCOPE}}`
|
|
9
|
+
|
|
10
|
+
Then tell me to fully quit and reopen Claude Code so the change takes effect — it only reads the router setting at startup.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Print the session id that correlates this session in router telemetry and logs.
|
|
3
|
+
allowed-tools: Bash(echo:*)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Print the session id used by the Weave Router to correlate this session's
|
|
7
|
+
telemetry, logs, and feedback submissions. Also works as a transcript
|
|
8
|
+
filename key for manual lookups in the router dashboard.
|
|
9
|
+
|
|
10
|
+
The router carries this id as `X-Claude-Code-Session-Id` on every request and
|
|
11
|
+
stores it in `model_router_users.SessionID` for analytics joins.
|
|
12
|
+
|
|
13
|
+
Run `echo "$CLAUDE_CODE_SESSION_ID"`.
|
|
14
|
+
|
|
15
|
+
Then tell me the session id in one line, formatted as inline code so I can copy it.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show whether Claude Code is routing through the Weave Router or directly to Anthropic.
|
|
3
|
+
allowed-tools: Bash(npx:*)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Report whether Claude Code is using the Weave Router by running:
|
|
7
|
+
|
|
8
|
+
`npx @weave-os/router status --claude{{SCOPE}}`
|
|
9
|
+
|
|
10
|
+
Then summarize the result for me in one line.
|
package/commands/ufm.md
ADDED
package/directives.tsv
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Weave Router directive registry
|
|
2
|
+
# canonical|aliases|capability|claude|codex|opencode|pi|cursor|adapter
|
|
3
|
+
# aliases are comma-separated; client columns are yes/no. adapter is the native asset kind.
|
|
4
|
+
force-model|fm|prompt|yes|yes|yes|yes|manual|command,skill
|
|
5
|
+
unforce-model|ufm|prompt|yes|yes|yes|yes|manual|command,skill
|
|
6
|
+
router-feedback|rf|prompt|yes|yes|yes|no|manual|command,skill
|
|
7
|
+
router-off||local-toggle|yes|yes|no|no|manual|command,skill
|
|
8
|
+
router-on||local-toggle|yes|yes|no|no|manual|command,skill
|
|
9
|
+
router-status||local-toggle|yes|yes|no|no|manual|command,skill
|
|
10
|
+
router-session||prompt|yes|no|no|no|manual|command
|
|
11
|
+
router-models|models|local-toggle|yes|yes|no|no|manual|command,skill
|
|
12
|
+
disable-routing||local-toggle|no|yes|no|no|manual|skill
|
|
13
|
+
beta||prompt|yes|no|no|yes|manual|command
|