@blockrun/clawrouter 0.11.8 → 0.11.10

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.11.8",
3
+ "version": "0.11.10",
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",
@@ -203,7 +203,7 @@ if [ ! -f "$DIST_PATH" ]; then
203
203
  fi
204
204
  echo " ✓ dist/index.js verified"
205
205
 
206
- # 6.2. Populate model allowlist so all BlockRun models appear in /model picker
206
+ # 6.2. Populate model allowlist so top BlockRun models appear in /model picker
207
207
  echo "→ Populating model allowlist..."
208
208
  node -e "
209
209
  const os = require('os');
@@ -232,10 +232,16 @@ try {
232
232
  changed = true;
233
233
  }
234
234
 
235
- // Populate allowlist with all BlockRun models
236
- // OpenClaw uses agents.defaults.models as a whitelist for the /model picker.
237
- // index.ts will also do this on gateway start, but we pre-populate here so
238
- // users see models immediately after install.
235
+ // Top 16 models for the /model picker
236
+ const TOP_MODELS = [
237
+ 'auto', 'free', 'eco', 'premium',
238
+ 'anthropic/claude-sonnet-4.6', 'anthropic/claude-opus-4.6', 'anthropic/claude-haiku-4.5',
239
+ 'openai/gpt-5.2', 'openai/gpt-4o', 'openai/o3',
240
+ 'google/gemini-3.1-pro', 'google/gemini-3-flash-preview',
241
+ 'deepseek/deepseek-chat', 'moonshot/kimi-k2.5',
242
+ 'xai/grok-3', 'minimax/minimax-m2.5'
243
+ ];
244
+
239
245
  if (!config.agents) config.agents = {};
240
246
  if (!config.agents.defaults) config.agents.defaults = {};
241
247
  if (!config.agents.defaults.models || typeof config.agents.defaults.models !== 'object') {
@@ -243,34 +249,31 @@ try {
243
249
  changed = true;
244
250
  }
245
251
 
246
- // Load model IDs from installed package
247
- const distPath = path.join(os.homedir(), '.openclaw', 'extensions', 'clawrouter', 'dist', 'index.js');
248
- if (fs.existsSync(distPath)) {
249
- import('file://' + distPath).then(({ OPENCLAW_MODELS }) => {
250
- const allowlist = config.agents.defaults.models;
251
- let added = 0;
252
- for (const m of OPENCLAW_MODELS) {
253
- const key = 'blockrun/' + m.id;
254
- if (!allowlist[key]) {
255
- allowlist[key] = {};
256
- added++;
257
- }
258
- }
259
- if (added > 0) {
260
- changed = true;
261
- console.log(' Added ' + added + ' models to allowlist (' + OPENCLAW_MODELS.length + ' total)');
262
- } else {
263
- console.log(' Allowlist already up to date');
264
- }
265
- if (changed) {
266
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
267
- }
268
- }).catch(err => {
269
- console.log(' Could not load models from package:', err.message);
270
- console.log(' Allowlist will be populated on gateway start');
271
- });
252
+ const allowlist = config.agents.defaults.models;
253
+ // Clean out old blockrun entries not in TOP_MODELS
254
+ const topSet = new Set(TOP_MODELS.map(id => 'blockrun/' + id));
255
+ for (const key of Object.keys(allowlist)) {
256
+ if (key.startsWith('blockrun/') && !topSet.has(key)) {
257
+ delete allowlist[key];
258
+ changed = true;
259
+ }
260
+ }
261
+ let added = 0;
262
+ for (const id of TOP_MODELS) {
263
+ const key = 'blockrun/' + id;
264
+ if (!allowlist[key]) {
265
+ allowlist[key] = {};
266
+ added++;
267
+ }
268
+ }
269
+ if (added > 0) {
270
+ changed = true;
271
+ console.log(' Added ' + added + ' models to allowlist (' + TOP_MODELS.length + ' total)');
272
272
  } else {
273
- console.log(' dist/index.js not found, allowlist will be populated on gateway start');
273
+ console.log(' Allowlist already up to date');
274
+ }
275
+ if (changed) {
276
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
274
277
  }
275
278
  } catch (err) {
276
279
  console.log(' Could not update config:', err.message);