@blockrun/clawrouter 0.9.30 → 0.9.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/clawrouter",
3
- "version": "0.9.30",
3
+ "version": "0.9.32",
4
4
  "description": "Smart LLM router — save 78% on inference costs. 30+ models, one wallet, x402 micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -3,6 +3,28 @@ set -e
3
3
 
4
4
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
5
 
6
+ kill_port_processes() {
7
+ local port="$1"
8
+ local pids=""
9
+
10
+ if command -v lsof >/dev/null 2>&1; then
11
+ pids="$(lsof -ti :"$port" 2>/dev/null || true)"
12
+ elif command -v fuser >/dev/null 2>&1; then
13
+ pids="$(fuser "$port"/tcp 2>/dev/null || true)"
14
+ elif command -v ss >/dev/null 2>&1; then
15
+ pids="$(ss -lptn "sport = :$port" 2>/dev/null | sed -n 's/.*pid=\([0-9]\+\).*/\1/p' | sort -u)"
16
+ elif command -v netstat >/dev/null 2>&1; then
17
+ pids="$(netstat -nlpt 2>/dev/null | awk -v p=":$port" '$4 ~ p"$" {split($7,a,"/"); if (a[1] ~ /^[0-9]+$/) print a[1]}' | sort -u)"
18
+ else
19
+ echo " Warning: could not find lsof/fuser/ss/netstat; skipping proxy stop"
20
+ return 0
21
+ fi
22
+
23
+ if [ -n "$pids" ]; then
24
+ echo "$pids" | xargs kill -9 2>/dev/null || true
25
+ fi
26
+ }
27
+
6
28
  echo "🦞 ClawRouter Reinstall"
7
29
  echo ""
8
30
 
@@ -58,7 +80,7 @@ console.log(' Config cleaned');
58
80
 
59
81
  # 3. Kill old proxy
60
82
  echo "→ Stopping old proxy..."
61
- lsof -ti :8402 | xargs kill -9 2>/dev/null || true
83
+ kill_port_processes 8402
62
84
 
63
85
  # 3.1. Remove stale models.json so it gets regenerated with apiKey
64
86
  echo "→ Cleaning models cache..."
@@ -275,8 +297,8 @@ echo ""
275
297
  echo "Run: openclaw gateway restart"
276
298
  echo ""
277
299
  echo "Model aliases available:"
278
- echo " /model sonnet4.6 anthropic/claude-sonnet-4-6"
279
- echo " /model opus4.6 anthropic/claude-opus-4-6"
300
+ echo " /model sonnet → claude-sonnet-4"
301
+ echo " /model opus → claude-opus-4"
280
302
  echo " /model codex → openai/gpt-5.2-codex"
281
303
  echo " /model deepseek → deepseek/deepseek-chat"
282
304
  echo " /model minimax → minimax/minimax-m2.5"
@@ -1,12 +1,34 @@
1
1
  #!/bin/bash
2
2
  set -e
3
3
 
4
+ kill_port_processes() {
5
+ local port="$1"
6
+ local pids=""
7
+
8
+ if command -v lsof >/dev/null 2>&1; then
9
+ pids="$(lsof -ti :"$port" 2>/dev/null || true)"
10
+ elif command -v fuser >/dev/null 2>&1; then
11
+ pids="$(fuser "$port"/tcp 2>/dev/null || true)"
12
+ elif command -v ss >/dev/null 2>&1; then
13
+ pids="$(ss -lptn "sport = :$port" 2>/dev/null | sed -n 's/.*pid=\([0-9]\+\).*/\1/p' | sort -u)"
14
+ elif command -v netstat >/dev/null 2>&1; then
15
+ pids="$(netstat -nlpt 2>/dev/null | awk -v p=":$port" '$4 ~ p"$" {split($7,a,"/"); if (a[1] ~ /^[0-9]+$/) print a[1]}' | sort -u)"
16
+ else
17
+ echo " Warning: could not find lsof/fuser/ss/netstat; skipping proxy stop"
18
+ return 0
19
+ fi
20
+
21
+ if [ -n "$pids" ]; then
22
+ echo "$pids" | xargs kill -9 2>/dev/null || true
23
+ fi
24
+ }
25
+
4
26
  echo "🦞 ClawRouter Uninstall"
5
27
  echo ""
6
28
 
7
29
  # 1. Stop proxy
8
30
  echo "→ Stopping proxy..."
9
- lsof -ti :8402 | xargs kill -9 2>/dev/null || true
31
+ kill_port_processes 8402
10
32
 
11
33
  # 2. Remove plugin files
12
34
  echo "→ Removing plugin files..."