@blockrun/clawrouter 0.5.4 → 0.5.6
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 +15 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3262,6 +3262,11 @@ function injectModelsConfig(logger) {
|
|
|
3262
3262
|
config.models.providers.blockrun.apiKey = "x402-proxy-handles-auth";
|
|
3263
3263
|
needsWrite = true;
|
|
3264
3264
|
}
|
|
3265
|
+
const currentModels = config.models.providers.blockrun.models;
|
|
3266
|
+
if (!currentModels || currentModels.length !== OPENCLAW_MODELS.length) {
|
|
3267
|
+
config.models.providers.blockrun.models = OPENCLAW_MODELS;
|
|
3268
|
+
needsWrite = true;
|
|
3269
|
+
}
|
|
3265
3270
|
}
|
|
3266
3271
|
if (!config.agents) config.agents = {};
|
|
3267
3272
|
if (!config.agents.defaults) config.agents.defaults = {};
|
|
@@ -3270,6 +3275,16 @@ function injectModelsConfig(logger) {
|
|
|
3270
3275
|
config.agents.defaults.model.primary = "blockrun/auto";
|
|
3271
3276
|
needsWrite = true;
|
|
3272
3277
|
}
|
|
3278
|
+
if (config.agents.defaults.models && typeof config.agents.defaults.models === "object") {
|
|
3279
|
+
const allowlist = config.agents.defaults.models;
|
|
3280
|
+
const blockrunModelsToAllow = ["blockrun/auto", "blockrun/free", "blockrun/gpt-120b"];
|
|
3281
|
+
for (const model of blockrunModelsToAllow) {
|
|
3282
|
+
if (!allowlist[model]) {
|
|
3283
|
+
allowlist[model] = { alias: model.split("/")[1] };
|
|
3284
|
+
needsWrite = true;
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3273
3288
|
if (needsWrite) {
|
|
3274
3289
|
writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
3275
3290
|
logger.info("Set default model to blockrun/auto (smart routing enabled)");
|