@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/dist/index.js
CHANGED
|
@@ -6778,14 +6778,48 @@ function injectModelsConfig(logger) {
|
|
|
6778
6778
|
logger.info("Set default model to blockrun/auto (first install)");
|
|
6779
6779
|
needsWrite = true;
|
|
6780
6780
|
}
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6781
|
+
const TOP_MODELS = [
|
|
6782
|
+
"auto",
|
|
6783
|
+
"free",
|
|
6784
|
+
"eco",
|
|
6785
|
+
"premium",
|
|
6786
|
+
"anthropic/claude-sonnet-4.6",
|
|
6787
|
+
"anthropic/claude-opus-4.6",
|
|
6788
|
+
"anthropic/claude-haiku-4.5",
|
|
6789
|
+
"openai/gpt-5.2",
|
|
6790
|
+
"openai/gpt-4o",
|
|
6791
|
+
"openai/o3",
|
|
6792
|
+
"google/gemini-2.5-pro",
|
|
6793
|
+
"google/gemini-2.5-flash",
|
|
6794
|
+
"deepseek/deepseek-chat",
|
|
6795
|
+
"moonshot/kimi-k2.5",
|
|
6796
|
+
"xai/grok-3",
|
|
6797
|
+
"minimax/minimax-m2.5"
|
|
6798
|
+
];
|
|
6799
|
+
if (!defaults.models || typeof defaults.models !== "object" || Array.isArray(defaults.models)) {
|
|
6800
|
+
defaults.models = {};
|
|
6801
|
+
needsWrite = true;
|
|
6802
|
+
}
|
|
6803
|
+
const allowlist = defaults.models;
|
|
6804
|
+
const topSet = new Set(TOP_MODELS.map((id) => `blockrun/${id}`));
|
|
6805
|
+
for (const key of Object.keys(allowlist)) {
|
|
6806
|
+
if (key.startsWith("blockrun/") && !topSet.has(key)) {
|
|
6807
|
+
delete allowlist[key];
|
|
6785
6808
|
needsWrite = true;
|
|
6786
|
-
logger.info("Removed blockrun-only allowlist (was hiding other models)");
|
|
6787
6809
|
}
|
|
6788
6810
|
}
|
|
6811
|
+
let addedCount = 0;
|
|
6812
|
+
for (const id of TOP_MODELS) {
|
|
6813
|
+
const key = `blockrun/${id}`;
|
|
6814
|
+
if (!allowlist[key]) {
|
|
6815
|
+
allowlist[key] = {};
|
|
6816
|
+
addedCount++;
|
|
6817
|
+
}
|
|
6818
|
+
}
|
|
6819
|
+
if (addedCount > 0) {
|
|
6820
|
+
needsWrite = true;
|
|
6821
|
+
logger.info(`Added ${addedCount} models to allowlist (${TOP_MODELS.length} total)`);
|
|
6822
|
+
}
|
|
6789
6823
|
if (needsWrite) {
|
|
6790
6824
|
try {
|
|
6791
6825
|
const tmpPath = `${configPath}.tmp.${process.pid}`;
|