@blockrun/clawrouter 0.11.7 → 0.11.9

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.7",
3
+ "version": "0.11.9",
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,8 +203,8 @@ if [ ! -f "$DIST_PATH" ]; then
203
203
  fi
204
204
  echo " ✓ dist/index.js verified"
205
205
 
206
- # 6.2. Refresh blockrun model catalog from installed package
207
- echo "→ Refreshing BlockRun models catalog..."
206
+ # 6.2. Populate model allowlist so top BlockRun models appear in /model picker
207
+ echo "→ Populating model allowlist..."
208
208
  node -e "
209
209
  const os = require('os');
210
210
  const fs = require('fs');
@@ -220,59 +220,63 @@ try {
220
220
  const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
221
221
  let changed = false;
222
222
 
223
- // Ensure provider exists
223
+ // Ensure provider exists with apiKey
224
224
  if (!config.models) config.models = {};
225
225
  if (!config.models.providers) config.models.providers = {};
226
226
  if (!config.models.providers.blockrun) {
227
227
  config.models.providers.blockrun = { api: 'openai-completions', models: [] };
228
228
  changed = true;
229
229
  }
230
-
231
- const blockrun = config.models.providers.blockrun;
232
- if (!blockrun.apiKey) {
233
- blockrun.apiKey = 'x402-proxy-handles-auth';
234
- changed = true;
235
- }
236
- if (!Array.isArray(blockrun.models)) {
237
- blockrun.models = [];
230
+ if (!config.models.providers.blockrun.apiKey) {
231
+ config.models.providers.blockrun.apiKey = 'x402-proxy-handles-auth';
238
232
  changed = true;
239
233
  }
240
234
 
241
- // Ensure minimax model exists in provider catalog
242
- const hasMiniMaxModel = blockrun.models.some(m => m && m.id === 'minimax/minimax-m2.5');
243
- if (!hasMiniMaxModel) {
244
- blockrun.models.push({
245
- id: 'minimax/minimax-m2.5',
246
- name: 'MiniMax M2.5',
247
- api: 'openai-completions',
248
- reasoning: true,
249
- input: ['text'],
250
- cost: { input: 0.3, output: 1.2, cacheRead: 0, cacheWrite: 0 },
251
- contextWindow: 204800,
252
- maxTokens: 16384
253
- });
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-2.5-pro', 'google/gemini-2.5-flash',
241
+ 'deepseek/deepseek-chat', 'moonshot/kimi-k2.5',
242
+ 'xai/grok-3', 'minimax/minimax-m2.5'
243
+ ];
244
+
245
+ if (!config.agents) config.agents = {};
246
+ if (!config.agents.defaults) config.agents.defaults = {};
247
+ if (!config.agents.defaults.models || typeof config.agents.defaults.models !== 'object') {
248
+ config.agents.defaults.models = {};
254
249
  changed = true;
255
- console.log(' Added minimax model to blockrun provider catalog');
256
250
  }
257
251
 
258
- // Clean up broken allowlist: if it only has blockrun/ entries, delete it entirely
259
- // (previous versions accidentally created an allowlist that hid all non-blockrun models)
260
- if (config.agents?.defaults?.models && typeof config.agents.defaults.models === 'object') {
261
- const keys = Object.keys(config.agents.defaults.models);
262
- if (keys.length > 0 && keys.every(k => k.startsWith('blockrun/'))) {
263
- delete config.agents.defaults.models;
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];
264
258
  changed = true;
265
- console.log(' Removed blockrun-only allowlist (was hiding other models)');
266
259
  }
267
260
  }
268
-
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
+ } else {
273
+ console.log(' Allowlist already up to date');
274
+ }
269
275
  if (changed) {
270
276
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
271
- } else {
272
- console.log(' blockrun minimax config already up to date');
273
277
  }
274
278
  } catch (err) {
275
- console.log(' Could not update minimax config:', err.message);
279
+ console.log(' Could not update config:', err.message);
276
280
  }
277
281
  "
278
282
 
@@ -344,6 +348,12 @@ echo " /model codex → openai/gpt-5.2-codex"
344
348
  echo " /model deepseek → deepseek/deepseek-chat"
345
349
  echo " /model minimax → minimax/minimax-m2.5"
346
350
  echo " /model free → gpt-oss-120b (FREE)"
351
+ echo ""
352
+ echo "Image generation:"
353
+ echo " /imagegen <prompt> # default: nano-banana"
354
+ echo " /imagegen --model dall-e-3 <prompt> # DALL-E 3"
355
+ echo " /imagegen --model gpt-image <prompt> # GPT Image 1"
356
+ echo ""
347
357
  echo "CLI commands:"
348
358
  echo " npx @blockrun/clawrouter report # daily usage report"
349
359
  echo " npx @blockrun/clawrouter report weekly # weekly report"