@blockrun/clawrouter 0.10.19 → 0.10.21

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.10.19",
3
+ "version": "0.10.21",
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
@@ -139,6 +139,60 @@ if (!store.profiles[profileKey]) {
139
139
  echo "→ Cleaning models cache..."
140
140
  rm -f ~/.openclaw/agents/*/agent/models.json 2>/dev/null || true
141
141
 
142
+ # ── Step 8: Migrate allowlist (remove blockrun-only filter) ────
143
+ echo "→ Migrating model allowlist..."
144
+ node -e "
145
+ const os = require('os');
146
+ const fs = require('fs');
147
+ const path = require('path');
148
+ const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
149
+
150
+ if (!fs.existsSync(configPath)) {
151
+ console.log(' No config file found, skipping');
152
+ process.exit(0);
153
+ }
154
+
155
+ try {
156
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
157
+ const allowlist = config?.agents?.defaults?.models;
158
+ if (!allowlist || typeof allowlist !== 'object') {
159
+ console.log(' No allowlist found, skipping');
160
+ process.exit(0);
161
+ }
162
+
163
+ const keys = Object.keys(allowlist);
164
+ if (keys.length === 0) {
165
+ console.log(' Allowlist already empty (allow all)');
166
+ process.exit(0);
167
+ }
168
+
169
+ const blockrunKeys = keys.filter(k => k.startsWith('blockrun/'));
170
+ if (blockrunKeys.length === 0) {
171
+ console.log(' No blockrun entries in allowlist, skipping');
172
+ process.exit(0);
173
+ }
174
+
175
+ // Remove blockrun entries
176
+ for (const k of blockrunKeys) {
177
+ delete allowlist[k];
178
+ }
179
+
180
+ // Atomic write
181
+ const tmpPath = configPath + '.tmp.' + process.pid;
182
+ fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
183
+ fs.renameSync(tmpPath, configPath);
184
+
185
+ const remaining = Object.keys(allowlist).length;
186
+ if (remaining === 0) {
187
+ console.log(' Cleared blockrun-only allowlist (all providers now visible)');
188
+ } else {
189
+ console.log(' Removed ' + blockrunKeys.length + ' blockrun entries (' + remaining + ' user entries kept)');
190
+ }
191
+ } catch (err) {
192
+ console.log(' Migration skipped: ' + err.message);
193
+ }
194
+ "
195
+
142
196
  # ── Summary ─────────────────────────────────────────────────────
143
197
  echo ""
144
198
  echo "✓ ClawRouter updated successfully!"