@workweave/router 0.2.6 → 0.2.8
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 +29 -9
- package/cc-statusline.sh +68 -6
- package/codex-skills/disable-routing/SKILL.md +22 -0
- package/install.sh +224 -27
- package/package.json +2 -1
- package/pi-router/README.md +30 -9
- package/pi-router/src/compaction.ts +144 -20
- package/pi-router/src/config.ts +5 -2
- package/pi-router/src/force-model.ts +126 -0
- package/pi-router/src/index.ts +6 -4
- package/pi-router/src/pricing.generated.ts +81 -0
- package/pi-router/src/routed-model.ts +151 -17
- 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/uninstall.sh +25 -0
package/uninstall.sh
CHANGED
|
@@ -30,6 +30,7 @@ install_dir=""
|
|
|
30
30
|
target="claude"
|
|
31
31
|
|
|
32
32
|
err() { printf "\033[31merror:\033[0m %s\n" "$*" >&2; }
|
|
33
|
+
warn() { printf "\033[33mwarning:\033[0m %s\n" "$*" >&2; }
|
|
33
34
|
info() { printf "\033[36m==>\033[0m %s\n" "$*"; }
|
|
34
35
|
ok() { printf "\033[32m✓\033[0m %s\n" "$*"; }
|
|
35
36
|
|
|
@@ -91,6 +92,7 @@ fi
|
|
|
91
92
|
# Markers must stay in sync with install.sh. Keep verbatim.
|
|
92
93
|
WEAVE_CODEX_BEGIN_MARKER="# >>> weave-router managed (do not edit between markers) >>>"
|
|
93
94
|
WEAVE_CODEX_END_MARKER="# <<< weave-router managed <<<"
|
|
95
|
+
WEAVE_CODEX_SKILL_MARKER="<!-- weave-router managed disable-routing skill -->"
|
|
94
96
|
|
|
95
97
|
# strip_codex_block rewrites config.toml without the managed block and any
|
|
96
98
|
# top-level `model_provider = "weave"` that lived outside the markers (which
|
|
@@ -436,6 +438,26 @@ if [ "$target" = "codex" ]; then
|
|
|
436
438
|
rmdir "$codex_prompts_dir" 2>/dev/null || true
|
|
437
439
|
fi
|
|
438
440
|
|
|
441
|
+
# The installer-owned skill switches Codex back to its normal provider. It
|
|
442
|
+
# is separate from config.toml, so remove it when removing the router too.
|
|
443
|
+
# A same-named skill without our marker belongs to the user and is preserved.
|
|
444
|
+
codex_skill_dir="$codex_dir/skills/disable-routing"
|
|
445
|
+
codex_skill_file="$codex_skill_dir/SKILL.md"
|
|
446
|
+
if [ -d "$codex_skill_dir" ]; then
|
|
447
|
+
refuse_if_symlink "$codex_skill_dir"
|
|
448
|
+
if [ -f "$codex_skill_file" ]; then
|
|
449
|
+
refuse_if_symlink "$codex_skill_file"
|
|
450
|
+
if grep -Fq "$WEAVE_CODEX_SKILL_MARKER" "$codex_skill_file"; then
|
|
451
|
+
rm -f "$codex_skill_file"
|
|
452
|
+
ok "Removed $codex_skill_file"
|
|
453
|
+
else
|
|
454
|
+
warn "Leaving user-owned Codex skill at $codex_skill_file untouched."
|
|
455
|
+
fi
|
|
456
|
+
fi
|
|
457
|
+
rmdir "$codex_skill_dir" 2>/dev/null || true
|
|
458
|
+
rmdir "$codex_dir/skills" 2>/dev/null || true
|
|
459
|
+
fi
|
|
460
|
+
|
|
439
461
|
if [ -n "$install_dir" ]; then
|
|
440
462
|
ok "Weave Router uninstalled from $install_dir (Codex)."
|
|
441
463
|
else
|
|
@@ -523,6 +545,9 @@ if [ -f "$settings_file" ]; then
|
|
|
523
545
|
then del(.statusLine) else . end)
|
|
524
546
|
| (if (.apiKeyHelper // "" | tostring | endswith("weave-key.sh"))
|
|
525
547
|
then del(.apiKeyHelper) else . end)
|
|
548
|
+
| (if (.attribution.commit == "Co-Authored-By: Weave Router <noreply@workweave.ai>"
|
|
549
|
+
and .attribution.pr == "🤖 Generated with [Weave Router](https://router.workweave.ai)")
|
|
550
|
+
then del(.attribution) else . end)
|
|
526
551
|
' "$settings_file")"
|
|
527
552
|
printf '%s\n' "$cleaned" >"$settings_file"
|
|
528
553
|
ok "Cleaned $settings_file"
|