@blockrun/clawrouter 0.11.10 → 0.11.12
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/README.md +1 -1
- package/dist/cli.js +13 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/update.sh +33 -23
package/package.json
CHANGED
package/scripts/update.sh
CHANGED
|
@@ -166,8 +166,8 @@ if (!store.profiles[profileKey]) {
|
|
|
166
166
|
echo "→ Cleaning models cache..."
|
|
167
167
|
rm -f ~/.openclaw/agents/*/agent/models.json 2>/dev/null || true
|
|
168
168
|
|
|
169
|
-
# ── Step 8:
|
|
170
|
-
echo "→
|
|
169
|
+
# ── Step 8: Populate model allowlist with top 16 models ────────
|
|
170
|
+
echo "→ Populating model allowlist..."
|
|
171
171
|
node -e "
|
|
172
172
|
const os = require('os');
|
|
173
173
|
const fs = require('fs');
|
|
@@ -181,27 +181,38 @@ if (!fs.existsSync(configPath)) {
|
|
|
181
181
|
|
|
182
182
|
try {
|
|
183
183
|
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
184
|
-
const allowlist = config?.agents?.defaults?.models;
|
|
185
|
-
if (!allowlist || typeof allowlist !== 'object') {
|
|
186
|
-
console.log(' No allowlist found, skipping');
|
|
187
|
-
process.exit(0);
|
|
188
|
-
}
|
|
189
184
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
185
|
+
// Top 16 models for the /model picker
|
|
186
|
+
const TOP_MODELS = [
|
|
187
|
+
'auto', 'free', 'eco', 'premium',
|
|
188
|
+
'anthropic/claude-sonnet-4.6', 'anthropic/claude-opus-4.6', 'anthropic/claude-haiku-4.5',
|
|
189
|
+
'openai/gpt-5.2', 'openai/gpt-4o', 'openai/o3',
|
|
190
|
+
'google/gemini-3.1-pro', 'google/gemini-3-flash-preview',
|
|
191
|
+
'deepseek/deepseek-chat', 'moonshot/kimi-k2.5',
|
|
192
|
+
'xai/grok-3', 'minimax/minimax-m2.5'
|
|
193
|
+
];
|
|
194
|
+
|
|
195
|
+
if (!config.agents) config.agents = {};
|
|
196
|
+
if (!config.agents.defaults) config.agents.defaults = {};
|
|
197
|
+
if (!config.agents.defaults.models || typeof config.agents.defaults.models !== 'object') {
|
|
198
|
+
config.agents.defaults.models = {};
|
|
194
199
|
}
|
|
195
200
|
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
201
|
+
const allowlist = config.agents.defaults.models;
|
|
202
|
+
// Clean out old blockrun entries not in TOP_MODELS
|
|
203
|
+
const topSet = new Set(TOP_MODELS.map(id => 'blockrun/' + id));
|
|
204
|
+
for (const key of Object.keys(allowlist)) {
|
|
205
|
+
if (key.startsWith('blockrun/') && !topSet.has(key)) {
|
|
206
|
+
delete allowlist[key];
|
|
207
|
+
}
|
|
200
208
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
209
|
+
let added = 0;
|
|
210
|
+
for (const id of TOP_MODELS) {
|
|
211
|
+
const key = 'blockrun/' + id;
|
|
212
|
+
if (!allowlist[key]) {
|
|
213
|
+
allowlist[key] = {};
|
|
214
|
+
added++;
|
|
215
|
+
}
|
|
205
216
|
}
|
|
206
217
|
|
|
207
218
|
// Atomic write
|
|
@@ -209,11 +220,10 @@ try {
|
|
|
209
220
|
fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
|
|
210
221
|
fs.renameSync(tmpPath, configPath);
|
|
211
222
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
console.log(' Cleared blockrun-only allowlist (all providers now visible)');
|
|
223
|
+
if (added > 0) {
|
|
224
|
+
console.log(' Added ' + added + ' models to allowlist (' + TOP_MODELS.length + ' total)');
|
|
215
225
|
} else {
|
|
216
|
-
console.log('
|
|
226
|
+
console.log(' Allowlist already up to date');
|
|
217
227
|
}
|
|
218
228
|
} catch (err) {
|
|
219
229
|
console.log(' Migration skipped: ' + err.message);
|