@blockrun/clawrouter 0.10.21 → 0.10.22

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/update.sh +27 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/clawrouter",
3
- "version": "0.10.21",
3
+ "version": "0.10.22",
4
4
  "description": "Smart LLM router — save 92% on inference costs. 41+ models, one wallet, x402 micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/scripts/update.sh CHANGED
@@ -69,6 +69,33 @@ kill_port_processes 8402
69
69
  echo "→ Removing old plugin files..."
70
70
  rm -rf ~/.openclaw/extensions/clawrouter
71
71
 
72
+ # ── Step 3b: Clean stale plugin entry from config ─────────────
73
+ # After deleting plugin files, openclaw's config validator rejects
74
+ # the orphaned plugins.entries.clawrouter reference. Remove it so
75
+ # the fresh install in Step 4 can proceed.
76
+ echo "→ Cleaning config..."
77
+ node -e "
78
+ const fs = require('fs');
79
+ const path = require('path');
80
+ const configPath = path.join(require('os').homedir(), '.openclaw', 'openclaw.json');
81
+ if (!fs.existsSync(configPath)) process.exit(0);
82
+ try {
83
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
84
+ const entries = config?.plugins?.entries;
85
+ if (entries && entries.clawrouter) {
86
+ delete entries.clawrouter;
87
+ const tmp = configPath + '.tmp.' + process.pid;
88
+ fs.writeFileSync(tmp, JSON.stringify(config, null, 2));
89
+ fs.renameSync(tmp, configPath);
90
+ console.log(' Removed stale plugin entry');
91
+ } else {
92
+ console.log(' Config clean');
93
+ }
94
+ } catch (err) {
95
+ console.log(' Skipped: ' + err.message);
96
+ }
97
+ "
98
+
72
99
  # ── Step 4: Install latest version ─────────────────────────────
73
100
  echo "→ Installing latest ClawRouter..."
74
101
  openclaw plugins install @blockrun/clawrouter