@blockrun/clawrouter 0.11.7 → 0.11.8
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 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/reinstall.sh +47 -40
package/dist/index.js
CHANGED
|
@@ -6778,14 +6778,23 @@ function injectModelsConfig(logger) {
|
|
|
6778
6778
|
logger.info("Set default model to blockrun/auto (first install)");
|
|
6779
6779
|
needsWrite = true;
|
|
6780
6780
|
}
|
|
6781
|
-
if (defaults.models
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6781
|
+
if (!defaults.models || typeof defaults.models !== "object" || Array.isArray(defaults.models)) {
|
|
6782
|
+
defaults.models = {};
|
|
6783
|
+
needsWrite = true;
|
|
6784
|
+
}
|
|
6785
|
+
const allowlist = defaults.models;
|
|
6786
|
+
let addedCount = 0;
|
|
6787
|
+
for (const m of OPENCLAW_MODELS) {
|
|
6788
|
+
const key = `blockrun/${m.id}`;
|
|
6789
|
+
if (!allowlist[key]) {
|
|
6790
|
+
allowlist[key] = {};
|
|
6791
|
+
addedCount++;
|
|
6787
6792
|
}
|
|
6788
6793
|
}
|
|
6794
|
+
if (addedCount > 0) {
|
|
6795
|
+
needsWrite = true;
|
|
6796
|
+
logger.info(`Added ${addedCount} models to allowlist (${OPENCLAW_MODELS.length} total)`);
|
|
6797
|
+
}
|
|
6789
6798
|
if (needsWrite) {
|
|
6790
6799
|
try {
|
|
6791
6800
|
const tmpPath = `${configPath}.tmp.${process.pid}`;
|