@workweave/router 0.2.5 → 0.2.7
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 +28 -8
- package/cc-statusline.sh +76 -2
- package/commands/router-session.md +15 -0
- package/install.sh +148 -40
- package/opencode-weave/README.md +3 -3
- package/package.json +3 -2
- package/pi-router/README.md +23 -6
- package/pi-router/src/config.ts +2 -0
- package/pi-router/src/force-model.ts +126 -0
- package/pi-router/src/index.ts +3 -1
- package/pi-router/src/pricing.generated.ts +79 -0
- package/pi-router/src/routed-model.ts +151 -17
- package/pi-router/src/savings.ts +191 -0
- package/pi-router/src/ui.ts +80 -0
- package/pi-router/src/wooly.ts +408 -0
- package/uninstall.sh +39 -1
package/uninstall.sh
CHANGED
|
@@ -213,6 +213,41 @@ if [ "$target" = "opencode" ]; then
|
|
|
213
213
|
ok "Removed $opencode_parked"
|
|
214
214
|
fi
|
|
215
215
|
|
|
216
|
+
# Remove slash command wrapper files this installer owns. Install mirrors
|
|
217
|
+
# this split: project scope uses <repo>/.opencode/commands/, while user
|
|
218
|
+
# scope—including a user-style --dir install—uses the global XDG commands
|
|
219
|
+
# directory so opencode discovers the wrappers from any working directory.
|
|
220
|
+
remove_opencode_command_dir() {
|
|
221
|
+
local opencode_cmds_dir="$1" cmd cmd_file
|
|
222
|
+
if [ -d "$opencode_cmds_dir" ]; then
|
|
223
|
+
refuse_if_symlink "$opencode_cmds_dir"
|
|
224
|
+
for cmd in force-model unforce-model router-feedback fm ufm rf; do
|
|
225
|
+
cmd_file="$opencode_cmds_dir/$cmd.md"
|
|
226
|
+
if [ -f "$cmd_file" ]; then
|
|
227
|
+
refuse_if_symlink "$cmd_file"
|
|
228
|
+
rm -f "$cmd_file"
|
|
229
|
+
ok "Removed $cmd_file"
|
|
230
|
+
fi
|
|
231
|
+
done
|
|
232
|
+
rmdir "$opencode_cmds_dir" 2>/dev/null || true
|
|
233
|
+
fi
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if [ "$scope" = "project" ]; then
|
|
237
|
+
opencode_commands_dir="$opencode_dir/.opencode/commands"
|
|
238
|
+
else
|
|
239
|
+
opencode_commands_dir="${XDG_CONFIG_HOME:-$HOME/.config}/opencode/commands"
|
|
240
|
+
fi
|
|
241
|
+
remove_opencode_command_dir "$opencode_commands_dir"
|
|
242
|
+
|
|
243
|
+
# Also clean the two paths used by earlier installer revisions, but avoid
|
|
244
|
+
# visiting the canonical path twice. This keeps uninstall idempotent for
|
|
245
|
+
# existing project and --dir installations.
|
|
246
|
+
for legacy_dir in "$opencode_dir/commands" "$opencode_dir/.opencode/commands"; do
|
|
247
|
+
[ "$legacy_dir" = "$opencode_commands_dir" ] && continue
|
|
248
|
+
remove_opencode_command_dir "$legacy_dir"
|
|
249
|
+
done
|
|
250
|
+
|
|
216
251
|
if [ -n "$install_dir" ]; then
|
|
217
252
|
ok "Weave Router uninstalled from $install_dir (opencode)."
|
|
218
253
|
else
|
|
@@ -488,6 +523,9 @@ if [ -f "$settings_file" ]; then
|
|
|
488
523
|
then del(.statusLine) else . end)
|
|
489
524
|
| (if (.apiKeyHelper // "" | tostring | endswith("weave-key.sh"))
|
|
490
525
|
then del(.apiKeyHelper) else . end)
|
|
526
|
+
| (if (.attribution.commit == "Co-Authored-By: Weave Router <noreply@workweave.ai>"
|
|
527
|
+
and .attribution.pr == "🤖 Generated with [Weave Router](https://router.workweave.ai)")
|
|
528
|
+
then del(.attribution) else . end)
|
|
491
529
|
' "$settings_file")"
|
|
492
530
|
printf '%s\n' "$cleaned" >"$settings_file"
|
|
493
531
|
ok "Cleaned $settings_file"
|
|
@@ -531,7 +569,7 @@ done
|
|
|
531
569
|
commands_dir="$(dirname "$settings_file")/commands"
|
|
532
570
|
if [ -d "$commands_dir" ]; then
|
|
533
571
|
refuse_if_symlink "$commands_dir"
|
|
534
|
-
for cmd in force-model unforce-model router-feedback fm ufm rf router-off router-on router-status; do
|
|
572
|
+
for cmd in force-model unforce-model router-feedback fm ufm rf router-off router-on router-status router-session; do
|
|
535
573
|
cmd_file="$commands_dir/$cmd.md"
|
|
536
574
|
if [ -f "$cmd_file" ]; then
|
|
537
575
|
refuse_if_symlink "$cmd_file"
|