@weave-os/router 0.2.30 → 0.2.31
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/bin.js +1 -1
- package/codex-skills/router-models/SKILL.md +1 -1
- package/commands/models.md +1 -1
- package/commands/router-models.md +1 -1
- package/install.sh +8 -5
- package/package.json +1 -1
- package/pi-router/README.md +1 -1
- package/pi-router/package.json +2 -1
- package/uninstall.sh +5 -3
- package/windows.js +5 -4
package/bin.js
CHANGED
|
@@ -11,7 +11,7 @@ const packageName = JSON.parse(
|
|
|
11
11
|
readFileSync(path.join(__dirname, "package.json"), "utf8"),
|
|
12
12
|
).name;
|
|
13
13
|
|
|
14
|
-
const defaultEntrypointURL = "https://router.
|
|
14
|
+
const defaultEntrypointURL = "https://router.weaveos.com/start";
|
|
15
15
|
|
|
16
16
|
if (packageName === "@weave-os/router" && args.length === 0) {
|
|
17
17
|
openDefaultEntrypoint(defaultEntrypointURL);
|
|
@@ -43,7 +43,7 @@ Other things they might ask for:
|
|
|
43
43
|
|
|
44
44
|
If the command reports that this router doesn't expose model selection, that's a
|
|
45
45
|
Weave-hosted router: model selection belongs to the whole organization there, so
|
|
46
|
-
tell the user to change it at https://router.
|
|
46
|
+
tell the user to change it at https://router.weaveos.com/models —
|
|
47
47
|
don't try to work around it. Its listing carries no on/off state, so present it
|
|
48
48
|
as a plain list; don't infer which models are enabled.
|
|
49
49
|
|
package/commands/models.md
CHANGED
|
@@ -38,7 +38,7 @@ Other things I might ask for:
|
|
|
38
38
|
|
|
39
39
|
If the command reports that this router doesn't expose model selection, that's
|
|
40
40
|
a Weave-hosted router: model selection belongs to the whole organization there,
|
|
41
|
-
so tell me to change it at https://router.
|
|
41
|
+
so tell me to change it at https://router.weaveos.com/models —
|
|
42
42
|
don't try to work around it. Its listing carries no on/off state, so present it
|
|
43
43
|
as a plain list; don't infer which models are enabled.
|
|
44
44
|
|
|
@@ -38,7 +38,7 @@ Other things I might ask for:
|
|
|
38
38
|
|
|
39
39
|
If the command reports that this router doesn't expose model selection, that's
|
|
40
40
|
a Weave-hosted router: model selection belongs to the whole organization there,
|
|
41
|
-
so tell me to change it at https://router.
|
|
41
|
+
so tell me to change it at https://router.weaveos.com/models —
|
|
42
42
|
don't try to work around it. Its listing carries no on/off state, so present it
|
|
43
43
|
as a plain list; don't infer which models are enabled.
|
|
44
44
|
|
package/install.sh
CHANGED
|
@@ -111,7 +111,9 @@ export PATH="$PATH:$HOME/.weave/bin"
|
|
|
111
111
|
# ---------- defaults ----------
|
|
112
112
|
|
|
113
113
|
# The public hosted Weave Router URL. Override with --base-url for self-hosted.
|
|
114
|
-
HOSTED_BASE_URL="https://router.
|
|
114
|
+
HOSTED_BASE_URL="https://router.weaveos.com"
|
|
115
|
+
# Pre-rebrand hosted endpoint; still vouched for in settings written by older installs.
|
|
116
|
+
LEGACY_HOSTED_BASE_URL="https://router.workweave.ai"
|
|
115
117
|
DEFAULT_BASE_URL="${WEAVE_ROUTER_URL:-$HOSTED_BASE_URL}"
|
|
116
118
|
# npm package name is supplied by the Node wrapper; direct shell installs keep
|
|
117
119
|
# the current package name; WEAVE_ROUTER_NPM_PACKAGE remains an escape hatch for
|
|
@@ -2884,6 +2886,7 @@ models_endpoint_is_trusted() {
|
|
|
2884
2886
|
normalized_url="$(strip_trailing_slashes "$url")"
|
|
2885
2887
|
[ "$base_url_explicit" = "true" ] && return 0
|
|
2886
2888
|
[ "$normalized_url" = "$(strip_trailing_slashes "$HOSTED_BASE_URL")" ] && return 0
|
|
2889
|
+
[ "$normalized_url" = "$(strip_trailing_slashes "$LEGACY_HOSTED_BASE_URL")" ] && return 0
|
|
2887
2890
|
[ -n "$base_src" ] && [ "$base_src" = "$key_src" ] && return 0
|
|
2888
2891
|
# Project-scoped self-hosted installs intentionally split the endpoint and
|
|
2889
2892
|
# key. The installer writes a gitignored marker beside the key; require that
|
|
@@ -3457,7 +3460,7 @@ toggle_copilot() {
|
|
|
3457
3460
|
# Public, unauthed catalog of everything the router can route to. Mounted in
|
|
3458
3461
|
# both deployment modes, so it is the one listing that always works.
|
|
3459
3462
|
MODELS_CATALOG_PATH="/v1/router/models"
|
|
3460
|
-
MODELS_DASHBOARD_URL="https://router.
|
|
3463
|
+
MODELS_DASHBOARD_URL="https://router.weaveos.com/models"
|
|
3461
3464
|
|
|
3462
3465
|
# Set by models_api on every call.
|
|
3463
3466
|
models_http_status=""
|
|
@@ -7534,7 +7537,7 @@ write_claude_settings() {
|
|
|
7534
7537
|
env: { ANTHROPIC_BASE_URL: $url, ENABLE_TOOL_SEARCH: "true" }
|
|
7535
7538
|
} + (if $attribution == "true" then {attribution: {
|
|
7536
7539
|
commit: "Co-Authored-By: Weave Router <router@weaveos.com>",
|
|
7537
|
-
pr: "🤖 Generated with [Weave Router](https://router.
|
|
7540
|
+
pr: "🤖 Generated with [Weave Router](https://router.weaveos.com)"
|
|
7538
7541
|
}} else {} end) + (if $statusline_install == "true" then {statusLine: { type: "command", command: $sl },
|
|
7539
7542
|
hooks: {UserPromptSubmit: [{hooks: [{type: "command", command: ("[ ! -x \"" + $sl + "\" ] || \"" + $sl + "\" --prompt-hook" + $prompt_hook_scope)}]}]}} else {} end)' >"$tmp_patch"
|
|
7540
7543
|
else
|
|
@@ -7542,7 +7545,7 @@ write_claude_settings() {
|
|
|
7542
7545
|
env: { ANTHROPIC_BASE_URL: $url, ANTHROPIC_CUSTOM_HEADERS: $header, ENABLE_TOOL_SEARCH: "true" }
|
|
7543
7546
|
} + (if $attribution == "true" then {attribution: {
|
|
7544
7547
|
commit: "Co-Authored-By: Weave Router <router@weaveos.com>",
|
|
7545
|
-
pr: "🤖 Generated with [Weave Router](https://router.
|
|
7548
|
+
pr: "🤖 Generated with [Weave Router](https://router.weaveos.com)"
|
|
7546
7549
|
}} else {} end) + (if $statusline_install == "true" then {statusLine: { type: "command", command: $sl },
|
|
7547
7550
|
hooks: {UserPromptSubmit: [{hooks: [{type: "command", command: ("[ ! -x \"" + $sl + "\" ] || \"" + $sl + "\" --prompt-hook" + $prompt_hook_scope)}]}]}} else {} end)' >"$tmp_patch"
|
|
7548
7551
|
fi
|
|
@@ -7573,7 +7576,7 @@ write_claude_settings() {
|
|
|
7573
7576
|
then .attribution = $b.attribution
|
|
7574
7577
|
elif ($b.attribution | not) and $ours then
|
|
7575
7578
|
.attribution |= (del(.commit)
|
|
7576
|
-
| if .pr == "🤖 Generated with [Weave Router](https://router.workweave.ai)" then del(.pr) else . end)
|
|
7579
|
+
| if (.pr == "🤖 Generated with [Weave Router](https://router.weaveos.com)" or .pr == "🤖 Generated with [Weave Router](https://router.workweave.ai)") then del(.pr) else . end)
|
|
7577
7580
|
| (if (.attribution | length) == 0 then del(.attribution) else . end)
|
|
7578
7581
|
else . end)
|
|
7579
7582
|
' "$settings_file" "$tmp_patch")"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weave-os/router",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.31",
|
|
4
4
|
"description": "One-command installer that points Claude Code, Codex, opencode, or pi at the Weave Router. For pi it also ships the routing extension, loaded via pi.extensions.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"weave-router": "bin.js",
|
package/pi-router/README.md
CHANGED
|
@@ -19,7 +19,7 @@ That writes `~/.pi/agent/models.json` (the `weave` provider), adds
|
|
|
19
19
|
the key in `~/.pi/agent/.weave_router_key`. pi auto-installs `@weave-os/router`
|
|
20
20
|
from npm on next start and loads this extension via its `pi.extensions` field.
|
|
21
21
|
Plain `pi` then connects to the installed endpoint, normally
|
|
22
|
-
`https://router.
|
|
22
|
+
`https://router.weaveos.com`; it does not start a local Python proxy.
|
|
23
23
|
|
|
24
24
|
## What it does
|
|
25
25
|
|
package/pi-router/package.json
CHANGED
package/uninstall.sh
CHANGED
|
@@ -358,7 +358,8 @@ fi
|
|
|
358
358
|
# install, and never supplies a key; a checkout-supplied endpoint never
|
|
359
359
|
# receives one (same gates as install.sh's key_source_is_own and
|
|
360
360
|
# models_endpoint_is_trusted).
|
|
361
|
-
HOSTED_BASE_URL="https://router.
|
|
361
|
+
HOSTED_BASE_URL="https://router.weaveos.com"
|
|
362
|
+
LEGACY_HOSTED_BASE_URL="https://router.workweave.ai"
|
|
362
363
|
ROUTER_KEY_HEADER="X-Weave-Router-Key"
|
|
363
364
|
|
|
364
365
|
uninstall_json_get() {
|
|
@@ -439,7 +440,7 @@ report_claude_uninstall_event() {
|
|
|
439
440
|
done
|
|
440
441
|
[ -n "$key" ] || return 0
|
|
441
442
|
local trusted="false"
|
|
442
|
-
if [ "$endpoint" = "${HOSTED_BASE_URL%/}" ] || [ "$base_src" = "$key_src" ]; then
|
|
443
|
+
if [ "$endpoint" = "${HOSTED_BASE_URL%/}" ] || [ "$endpoint" = "${LEGACY_HOSTED_BASE_URL%/}" ] || [ "$base_src" = "$key_src" ]; then
|
|
443
444
|
trusted="true"
|
|
444
445
|
elif [ -n "$local_settings_file" ] && [ -f "$local_settings_file" ] && [ ! -L "$local_settings_file" ]; then
|
|
445
446
|
marked="$(uninstall_json_get "$local_settings_file" '.env.WEAVE_ROUTER_BASE_URL')"
|
|
@@ -1350,7 +1351,8 @@ if [ -f "$settings_file" ]; then
|
|
|
1350
1351
|
| (if ((.attribution.commit == "Co-Authored-By: Weave Router <router@weaveos.com>"
|
|
1351
1352
|
or .attribution.commit == "Co-Authored-By: Weave Router <router@workweave.ai>"
|
|
1352
1353
|
or .attribution.commit == "Co-Authored-By: Weave Router <noreply@workweave.ai>")
|
|
1353
|
-
and .attribution.pr == "🤖 Generated with [Weave Router](https://router.
|
|
1354
|
+
and (.attribution.pr == "🤖 Generated with [Weave Router](https://router.weaveos.com)"
|
|
1355
|
+
or .attribution.pr == "🤖 Generated with [Weave Router](https://router.workweave.ai)"))
|
|
1354
1356
|
then del(.attribution) else . end)
|
|
1355
1357
|
' "$settings_file")"
|
|
1356
1358
|
printf '%s\n' "$cleaned" >"$settings_file"
|
package/windows.js
CHANGED
|
@@ -11,12 +11,13 @@ const { stdin, stdout } = require("node:process");
|
|
|
11
11
|
const TOML = require("smol-toml");
|
|
12
12
|
const git = require("isomorphic-git");
|
|
13
13
|
|
|
14
|
-
const defaultBaseUrl = process.env.WEAVE_ROUTER_URL || "https://router.
|
|
14
|
+
const defaultBaseUrl = process.env.WEAVE_ROUTER_URL || "https://router.weaveos.com";
|
|
15
15
|
const packageName = process.env.WEAVE_ROUTER_NPM_PACKAGE || "@weave-os/router";
|
|
16
16
|
const claudeAttribution = {
|
|
17
17
|
commit: "Co-Authored-By: Weave Router <router@weaveos.com>",
|
|
18
|
-
pr: "🤖 Generated with [Weave Router](https://router.
|
|
18
|
+
pr: "🤖 Generated with [Weave Router](https://router.weaveos.com)",
|
|
19
19
|
};
|
|
20
|
+
const legacyAttributionPR = "🤖 Generated with [Weave Router](https://router.workweave.ai)";
|
|
20
21
|
|
|
21
22
|
let patchToml;
|
|
22
23
|
|
|
@@ -250,7 +251,7 @@ function installClaude(paths, baseUrl, key, email, attribution) {
|
|
|
250
251
|
settings.attribution = { ...claudeAttribution, ...settings.attribution, commit: claudeAttribution.commit };
|
|
251
252
|
} else if (!attribution && ownsAttribution) {
|
|
252
253
|
delete settings.attribution.commit;
|
|
253
|
-
if (settings.attribution.pr
|
|
254
|
+
if ([claudeAttribution.pr, legacyAttributionPR].includes(settings.attribution.pr)) delete settings.attribution.pr;
|
|
254
255
|
if (!Object.keys(settings.attribution).length) delete settings.attribution;
|
|
255
256
|
}
|
|
256
257
|
writeJson(paths.config, settings);
|
|
@@ -441,7 +442,7 @@ function uninstall(paths, target) {
|
|
|
441
442
|
}
|
|
442
443
|
|
|
443
444
|
function restoreField(record, field, savedValue, installedValue) {
|
|
444
|
-
if (!record || record[field] !== installedValue) return;
|
|
445
|
+
if (!record || (record[field] !== installedValue && !(field === "pr" && record[field] === legacyAttributionPR))) return;
|
|
445
446
|
if (savedValue?.exists) record[field] = savedValue.value;
|
|
446
447
|
else delete record[field];
|
|
447
448
|
}
|