@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.
Files changed (69) hide show
  1. package/LICENSE +90 -0
  2. package/README.md +172 -0
  3. package/bin.js +68 -0
  4. package/cc-statusline.sh +951 -0
  5. package/codex-skills/disable-routing/SKILL.md +22 -0
  6. package/codex-skills/fm/SKILL.md +15 -0
  7. package/codex-skills/fm/scripts/emit.sh +8 -0
  8. package/codex-skills/force-model/SKILL.md +15 -0
  9. package/codex-skills/force-model/scripts/emit.sh +9 -0
  10. package/codex-skills/rf/SKILL.md +15 -0
  11. package/codex-skills/rf/scripts/emit.sh +7 -0
  12. package/codex-skills/router-feedback/SKILL.md +15 -0
  13. package/codex-skills/router-feedback/scripts/emit.sh +9 -0
  14. package/codex-skills/router-models/SKILL.md +51 -0
  15. package/codex-skills/router-off/SKILL.md +22 -0
  16. package/codex-skills/router-on/SKILL.md +22 -0
  17. package/codex-skills/router-status/SKILL.md +19 -0
  18. package/codex-skills/ufm/SKILL.md +14 -0
  19. package/codex-skills/ufm/scripts/emit.sh +3 -0
  20. package/codex-skills/unforce-model/SKILL.md +14 -0
  21. package/codex-skills/unforce-model/scripts/emit.sh +4 -0
  22. package/codex-status.sh +378 -0
  23. package/commands/beta.md +5 -0
  24. package/commands/fm.md +6 -0
  25. package/commands/force-model.md +6 -0
  26. package/commands/models.md +46 -0
  27. package/commands/rf.md +6 -0
  28. package/commands/router-feedback.md +6 -0
  29. package/commands/router-models.md +46 -0
  30. package/commands/router-off.md +10 -0
  31. package/commands/router-on.md +10 -0
  32. package/commands/router-session.md +15 -0
  33. package/commands/router-status.md +10 -0
  34. package/commands/ufm.md +5 -0
  35. package/commands/unforce-model.md +5 -0
  36. package/directives.tsv +13 -0
  37. package/install.sh +5092 -0
  38. package/opencode-weave/README.md +78 -0
  39. package/opencode-weave/package.json +18 -0
  40. package/opencode-weave/src/index.ts +655 -0
  41. package/package.json +79 -0
  42. package/pi-router/README.md +123 -0
  43. package/pi-router/package.json +25 -0
  44. package/pi-router/skills/install-lsps/SKILL.md +75 -0
  45. package/pi-router/skills/lsp-guide/SKILL.md +63 -0
  46. package/pi-router/src/beta.ts +21 -0
  47. package/pi-router/src/compaction.ts +188 -0
  48. package/pi-router/src/config.ts +293 -0
  49. package/pi-router/src/context-window.ts +12 -0
  50. package/pi-router/src/dispatch.ts +377 -0
  51. package/pi-router/src/force-model.ts +126 -0
  52. package/pi-router/src/index.ts +62 -0
  53. package/pi-router/src/lsp-broker.ts +255 -0
  54. package/pi-router/src/lsp-client.ts +435 -0
  55. package/pi-router/src/lsp-format.ts +230 -0
  56. package/pi-router/src/lsp-install.ts +215 -0
  57. package/pi-router/src/lsp-protocol.ts +128 -0
  58. package/pi-router/src/lsp-servers.ts +361 -0
  59. package/pi-router/src/lsp.ts +529 -0
  60. package/pi-router/src/metadata.ts +32 -0
  61. package/pi-router/src/pricing.generated.ts +91 -0
  62. package/pi-router/src/provider.ts +64 -0
  63. package/pi-router/src/routed-model.ts +182 -0
  64. package/pi-router/src/safety.ts +66 -0
  65. package/pi-router/src/savings.ts +191 -0
  66. package/pi-router/src/ui.ts +91 -0
  67. package/pi-router/src/wooly.ts +408 -0
  68. package/registry.sh +102 -0
  69. package/uninstall.sh +788 -0
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Toggle beta HMM routing for this session.
3
+ ---
4
+
5
+ /beta $ARGUMENTS
package/commands/fm.md ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ description: Alias for /force-model — pin this session to a specific model via the Weave Router.
3
+ argument-hint: <model-id>
4
+ ---
5
+
6
+ /force-model $ARGUMENTS
@@ -0,0 +1,6 @@
1
+ ---
2
+ description: Pin this session to a specific model via the Weave Router.
3
+ argument-hint: <model-id>
4
+ ---
5
+
6
+ /force-model $ARGUMENTS
@@ -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,6 @@
1
+ ---
2
+ description: Alias for /router-feedback — submit feedback about router decision or model performance.
3
+ argument-hint: <feedback-text>
4
+ ---
5
+
6
+ /router-feedback $ARGUMENTS
@@ -0,0 +1,6 @@
1
+ ---
2
+ description: Submit feedback about router decision or model performance.
3
+ argument-hint: <feedback-text>
4
+ ---
5
+
6
+ /router-feedback $ARGUMENTS
@@ -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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Alias for /unforce-model — clear an active /force-model pin and resume automatic routing.
3
+ ---
4
+
5
+ /unforce-model
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Clear an active /force-model pin and resume automatic routing.
3
+ ---
4
+
5
+ /unforce-model
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