@weave-os/router 0.2.19 → 0.2.21

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 CHANGED
@@ -20,6 +20,7 @@ npx @weave-os/router --pi # skip the picker, target pi + Loom U
20
20
  npx @weave-os/router --scope project # per-repo install, commit settings.json (or .codex/ / opencode.json)
21
21
  npx @weave-os/router --local # self-hosted via docker-compose (localhost:8080)
22
22
  npx @weave-os/router --base-url https://router.acme.internal
23
+ npx @weave-os/router --email you@example.com # set identity without prompting
23
24
  npx @weave-os/router --non-interactive # reads $WEAVE_ROUTER_KEY, no prompts (defaults to claude)
24
25
  ```
25
26
 
@@ -33,8 +34,16 @@ npx @weave-os/router --claude # reuses the installed key
33
34
  npx @weave-os/router --codex # same for Codex, opencode, and pi
34
35
  npx @weave-os/router --claude --rotate-key # ignore it and prompt for a new one
35
36
  npx @weave-os/router update --claude # non-interactive refresh in place
37
+ npx @weave-os/router update --claude --context-window 1m # opt into Claude's 1M local context
36
38
  ```
37
39
 
40
+ Claude Code normally keeps a 200k local context budget when using a custom
41
+ router endpoint. The explicit `--context-window 1m` option selects the
42
+ supported `[1m]` model variant, preserves automatic compaction, and records
43
+ the prior model so `off` or uninstall can restore it. It is opt-in: longer
44
+ histories can increase token usage and cost, and the upstream provider still
45
+ needs to support the requested context size.
46
+
38
47
  For Claude Code the installed statusline and `/force-model`, `/router-*` slash
39
48
  commands also refresh themselves in the background about once a week (never
40
49
  overwriting a wrapper you edited). Opt out with `WEAVE_STATUSLINE_UPDATE=0`, or
@@ -118,25 +127,24 @@ Four install targets:
118
127
  every other selected model uses its WorkWeave deployment or BYOK credential.
119
128
  The block lives between begin/end markers
120
129
  so re-running the installer rewrites it cleanly and `--uninstall --codex`
121
- removes it without touching the rest of your config. Codex does not load
122
- third-party slash-command files; the installer provides native skills
123
- `$force-model` (`$fm`), `$unforce-model` (`$ufm`), and `$router-feedback`
124
- (`$rf`), each of which execs a local `scripts/emit.sh` that prints the same
125
- leading-space directive Claude Code uses (for example,
126
- ` /force-model gpt-5.6-terra`) — you can also type that form directly. It
127
- also installs `$router-status`, `$router-off`, `$router-on`, and
128
- `$router-models`, which call this installer's own verbs, plus a
129
- `$disable-routing` skill that returns the next Codex session to the default
130
- provider without logging out or deleting the router configuration. The
131
- managed lifecycle hooks also keep the latest routed model in the terminal
132
- title and emit a compact status message when the router reports a new route.
133
- - **opencode** (`--opencode`) — merges a `provider.weave` entry (backed by
134
- opencode's built-in `@ai-sdk/anthropic` provider) into
130
+ removes it without touching the rest of your config. Codex does not load
131
+ third-party slash-command files; the installer provides native skills
132
+ `$force-model` (`$fm`), `$unforce-model` (`$ufm`), and `$router-feedback`
133
+ (`$rf`), whose invocations are handled by the router directly. It also
134
+ installs `$router-status`, `$router-off`, `$router-on`, and `$router-models`,
135
+ which call this installer's own verbs, plus a `$disable-routing` skill that
136
+ returns the next Codex session to the default provider without logging out
137
+ or deleting the router configuration. The managed lifecycle hooks also keep
138
+ the latest routed model in the terminal title and emit a compact status
139
+ message when the router reports a new route.
140
+ - **opencode** (`--opencode`) — merges a Responses-format `provider.weave`
141
+ entry backed by `@ai-sdk/openai` into
135
142
  `~/.config/opencode/opencode.json` (or `<repo>/opencode.json` with
136
- `--scope project`). The router speaks the Anthropic Messages API
137
- natively, so opencode talks to it unmodified. Re-install rewrites only
138
- the managed `provider.weave` block; `--uninstall --opencode` strips it
139
- and leaves your other providers and settings alone.
143
+ `--scope project`). Installation activates `weave/auto` and parks any prior
144
+ default model so `off` and uninstall can restore it exactly. The bundled
145
+ plugin can attach ChatGPT and Claude plan credentials to the matching routed
146
+ turns. Re-install rewrites only the managed provider; unrelated providers,
147
+ MCP servers, agents, and plugins stay untouched.
140
148
  - **pi** (`--pi`) — registers the `weave` provider and installs this package as
141
149
  a pi extension. Stock pi then gets the Loom startup header, Wooly's animated
142
150
  mascot, the persistent actual-route display, cumulative session savings,
package/cc-statusline.sh CHANGED
@@ -281,8 +281,13 @@ weave_sync_commands() {
281
281
  installed_body="$(sed '/^<!-- weave-router managed command: .* -->$/d' "$installed" 2>/dev/null)" || installed_body=""
282
282
  if [ "$prev_body" = "$installed_body" ] && [ "$new_body" != "$installed_body" ]; then
283
283
  tmp="$installed.tmp.$$"
284
- if printf '%s\n<!-- weave-router managed command: %s -->' "$new_body" "$name" >"$tmp" 2>/dev/null; then
284
+ if printf '%s\n' "$new_body" >"$tmp" 2>/dev/null; then
285
285
  mv "$tmp" "$installed" 2>/dev/null || rm -f "$tmp"
286
+ ownership_file="$installed.weave-router"
287
+ if [ ! -L "$ownership_file" ]; then
288
+ printf 'weave-router managed command: %s\n%s\n' "$name" "$new_body" \
289
+ >"$ownership_file" 2>/dev/null || true
290
+ fi
286
291
  else
287
292
  rm -f "$tmp"
288
293
  fi