claudish 5.11.0 → 5.12.0
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 +28 -38
- package/package.json +1 -1
- package/recommended-models.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31183,11 +31183,12 @@ async function printAllModels(jsonOutput, forceUpdate) {
|
|
|
31183
31183
|
console.log("Top models: claudish --top-models");
|
|
31184
31184
|
}
|
|
31185
31185
|
function isCacheStale() {
|
|
31186
|
-
|
|
31186
|
+
const cachePath = existsSync12(CACHED_MODELS_PATH) ? CACHED_MODELS_PATH : BUNDLED_MODELS_PATH;
|
|
31187
|
+
if (!existsSync12(cachePath)) {
|
|
31187
31188
|
return true;
|
|
31188
31189
|
}
|
|
31189
31190
|
try {
|
|
31190
|
-
const jsonContent = readFileSync10(
|
|
31191
|
+
const jsonContent = readFileSync10(cachePath, "utf-8");
|
|
31191
31192
|
const data = JSON.parse(jsonContent);
|
|
31192
31193
|
if (!data.lastUpdated) {
|
|
31193
31194
|
return true;
|
|
@@ -31203,42 +31204,24 @@ function isCacheStale() {
|
|
|
31203
31204
|
async function updateModelsFromOpenRouter() {
|
|
31204
31205
|
console.error("\uD83D\uDD04 Updating model recommendations from OpenRouter...");
|
|
31205
31206
|
try {
|
|
31206
|
-
const
|
|
31207
|
-
"x-ai/grok-code-fast-1",
|
|
31208
|
-
"minimax/minimax-m2.1",
|
|
31209
|
-
"z-ai/glm-4.7",
|
|
31210
|
-
"google/gemini-3-pro-preview",
|
|
31211
|
-
"openai/gpt-5.3",
|
|
31212
|
-
"moonshotai/kimi-k2-thinking",
|
|
31213
|
-
"deepseek/deepseek-v3.2",
|
|
31214
|
-
"qwen/qwen3-vl-235b-a22b-thinking",
|
|
31215
|
-
"anthropic/claude-sonnet-4.5",
|
|
31216
|
-
"anthropic/claude-sonnet-4",
|
|
31217
|
-
"anthropic/claude-haiku-4.5"
|
|
31218
|
-
];
|
|
31219
|
-
const apiResponse = await fetch("https://openrouter.ai/api/v1/models");
|
|
31207
|
+
const apiResponse = await fetch("https://openrouter.ai/api/v1/models?category=programming&order=top-weekly");
|
|
31220
31208
|
if (!apiResponse.ok) {
|
|
31221
31209
|
throw new Error(`OpenRouter API returned ${apiResponse.status}`);
|
|
31222
31210
|
}
|
|
31223
31211
|
const openrouterData = await apiResponse.json();
|
|
31224
|
-
const
|
|
31225
|
-
const modelMap = new Map;
|
|
31226
|
-
for (const model of allModels) {
|
|
31227
|
-
modelMap.set(model.id, model);
|
|
31228
|
-
}
|
|
31212
|
+
const topModels = openrouterData.data;
|
|
31229
31213
|
const recommendations = [];
|
|
31230
31214
|
const providers = new Set;
|
|
31231
|
-
for (const
|
|
31215
|
+
for (const model of topModels) {
|
|
31216
|
+
const modelId = model.id;
|
|
31232
31217
|
const provider = modelId.split("/")[0];
|
|
31233
31218
|
if (provider === "anthropic") {
|
|
31234
31219
|
continue;
|
|
31235
31220
|
}
|
|
31236
|
-
if (
|
|
31221
|
+
if (provider === "openrouter") {
|
|
31237
31222
|
continue;
|
|
31238
31223
|
}
|
|
31239
|
-
|
|
31240
|
-
if (!model) {
|
|
31241
|
-
console.error(`⚠️ Model ${modelId} not found in OpenRouter API - skipping`);
|
|
31224
|
+
if (providers.has(provider)) {
|
|
31242
31225
|
continue;
|
|
31243
31226
|
}
|
|
31244
31227
|
const name = model.name || modelId;
|
|
@@ -31258,8 +31241,10 @@ async function updateModelsFromOpenRouter() {
|
|
|
31258
31241
|
} else if (lowerDesc.includes("reason")) {
|
|
31259
31242
|
category = "reasoning";
|
|
31260
31243
|
}
|
|
31244
|
+
const bareId = modelId.split("/").pop().replace(/:free$/, "");
|
|
31261
31245
|
recommendations.push({
|
|
31262
|
-
id:
|
|
31246
|
+
id: bareId,
|
|
31247
|
+
openrouterId: modelId,
|
|
31263
31248
|
name,
|
|
31264
31249
|
description,
|
|
31265
31250
|
provider: provider.charAt(0).toUpperCase() + provider.slice(1),
|
|
@@ -31281,10 +31266,11 @@ async function updateModelsFromOpenRouter() {
|
|
|
31281
31266
|
});
|
|
31282
31267
|
providers.add(provider);
|
|
31283
31268
|
}
|
|
31284
|
-
let version2 = "1.
|
|
31285
|
-
|
|
31269
|
+
let version2 = "1.2.0";
|
|
31270
|
+
const existingPath = existsSync12(CACHED_MODELS_PATH) ? CACHED_MODELS_PATH : BUNDLED_MODELS_PATH;
|
|
31271
|
+
if (existsSync12(existingPath)) {
|
|
31286
31272
|
try {
|
|
31287
|
-
const existing = JSON.parse(readFileSync10(
|
|
31273
|
+
const existing = JSON.parse(readFileSync10(existingPath, "utf-8"));
|
|
31288
31274
|
version2 = existing.version || version2;
|
|
31289
31275
|
} catch {}
|
|
31290
31276
|
}
|
|
@@ -31294,7 +31280,8 @@ async function updateModelsFromOpenRouter() {
|
|
|
31294
31280
|
source: "https://openrouter.ai/models?categories=programming&fmt=cards&order=top-weekly",
|
|
31295
31281
|
models: recommendations
|
|
31296
31282
|
};
|
|
31297
|
-
|
|
31283
|
+
mkdirSync5(CLAUDISH_CACHE_DIR2, { recursive: true });
|
|
31284
|
+
writeFileSync5(CACHED_MODELS_PATH, JSON.stringify(updatedData, null, 2), "utf-8");
|
|
31298
31285
|
console.error(`✅ Updated ${recommendations.length} models (last updated: ${updatedData.lastUpdated})`);
|
|
31299
31286
|
} catch (error46) {
|
|
31300
31287
|
console.error(`❌ Failed to update models: ${error46 instanceof Error ? error46.message : String(error46)}`);
|
|
@@ -31312,7 +31299,8 @@ async function checkAndUpdateModelsCache(forceUpdate = false) {
|
|
|
31312
31299
|
await updateModelsFromOpenRouter();
|
|
31313
31300
|
} else {
|
|
31314
31301
|
try {
|
|
31315
|
-
const
|
|
31302
|
+
const cachePath = existsSync12(CACHED_MODELS_PATH) ? CACHED_MODELS_PATH : BUNDLED_MODELS_PATH;
|
|
31303
|
+
const data = JSON.parse(readFileSync10(cachePath, "utf-8"));
|
|
31316
31304
|
console.error(`✓ Using cached models (last updated: ${data.lastUpdated})`);
|
|
31317
31305
|
} catch {}
|
|
31318
31306
|
}
|
|
@@ -31718,8 +31706,9 @@ function printAvailableModels() {
|
|
|
31718
31706
|
let lastUpdated = "unknown";
|
|
31719
31707
|
let models = [];
|
|
31720
31708
|
try {
|
|
31721
|
-
|
|
31722
|
-
|
|
31709
|
+
const cachePath = existsSync12(CACHED_MODELS_PATH) ? CACHED_MODELS_PATH : BUNDLED_MODELS_PATH;
|
|
31710
|
+
if (existsSync12(cachePath)) {
|
|
31711
|
+
const data = JSON.parse(readFileSync10(cachePath, "utf-8"));
|
|
31723
31712
|
lastUpdated = data.lastUpdated || "unknown";
|
|
31724
31713
|
models = data.models || [];
|
|
31725
31714
|
}
|
|
@@ -31768,7 +31757,7 @@ Force update: claudish --list-models --force-update
|
|
|
31768
31757
|
`);
|
|
31769
31758
|
}
|
|
31770
31759
|
function printAvailableModelsJSON() {
|
|
31771
|
-
const jsonPath =
|
|
31760
|
+
const jsonPath = existsSync12(CACHED_MODELS_PATH) ? CACHED_MODELS_PATH : BUNDLED_MODELS_PATH;
|
|
31772
31761
|
try {
|
|
31773
31762
|
const jsonContent = readFileSync10(jsonPath, "utf-8");
|
|
31774
31763
|
const data = JSON.parse(jsonContent);
|
|
@@ -31855,7 +31844,7 @@ async function fetchGLMCodingModels() {
|
|
|
31855
31844
|
return [];
|
|
31856
31845
|
}
|
|
31857
31846
|
}
|
|
31858
|
-
var __filename4, __dirname4, VERSION = "5.
|
|
31847
|
+
var __filename4, __dirname4, VERSION = "5.12.0", CACHE_MAX_AGE_DAYS2 = 2, CLAUDISH_CACHE_DIR2, BUNDLED_MODELS_PATH, CACHED_MODELS_PATH, ALL_MODELS_JSON_PATH;
|
|
31859
31848
|
var init_cli = __esm(() => {
|
|
31860
31849
|
init_config();
|
|
31861
31850
|
init_model_loader();
|
|
@@ -31867,8 +31856,9 @@ var init_cli = __esm(() => {
|
|
|
31867
31856
|
const packageJson = JSON.parse(readFileSync10(join12(__dirname4, "../package.json"), "utf-8"));
|
|
31868
31857
|
VERSION = packageJson.version;
|
|
31869
31858
|
} catch {}
|
|
31870
|
-
MODELS_JSON_PATH = join12(__dirname4, "../recommended-models.json");
|
|
31871
31859
|
CLAUDISH_CACHE_DIR2 = join12(homedir11(), ".claudish");
|
|
31860
|
+
BUNDLED_MODELS_PATH = join12(__dirname4, "../recommended-models.json");
|
|
31861
|
+
CACHED_MODELS_PATH = join12(CLAUDISH_CACHE_DIR2, "recommended-models.json");
|
|
31872
31862
|
ALL_MODELS_JSON_PATH = join12(CLAUDISH_CACHE_DIR2, "all-models.json");
|
|
31873
31863
|
});
|
|
31874
31864
|
|
|
@@ -126351,7 +126341,7 @@ function isRetryableError(status, errorBody) {
|
|
|
126351
126341
|
}
|
|
126352
126342
|
}
|
|
126353
126343
|
if (status === 400) {
|
|
126354
|
-
if (lower.includes("model not found") || lower.includes("not registered") || lower.includes("does not exist") || lower.includes("unknown model") || lower.includes("unsupported model")) {
|
|
126344
|
+
if (lower.includes("model not found") || lower.includes("not registered") || lower.includes("does not exist") || lower.includes("unknown model") || lower.includes("unsupported model") || lower.includes("no healthy deployment")) {
|
|
126355
126345
|
return true;
|
|
126356
126346
|
}
|
|
126357
126347
|
}
|
package/package.json
CHANGED