@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/dist/index.js +39 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/reinstall.sh +46 -36
package/package.json
CHANGED
package/scripts/reinstall.sh
CHANGED
|
@@ -203,8 +203,8 @@ if [ ! -f "$DIST_PATH" ]; then
|
|
|
203
203
|
fi
|
|
204
204
|
echo " ✓ dist/index.js verified"
|
|
205
205
|
|
|
206
|
-
# 6.2.
|
|
207
|
-
echo "→
|
|
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
|
-
|
|
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
|
-
//
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
-
|
|
259
|
-
//
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
if (
|
|
263
|
-
delete
|
|
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
|
|
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"
|