claudish 4.6.4 → 4.6.5
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 +27 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31709,25 +31709,43 @@ async function selectModel(options = {}) {
|
|
|
31709
31709
|
}
|
|
31710
31710
|
}
|
|
31711
31711
|
}
|
|
31712
|
-
const
|
|
31713
|
-
const
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31717
|
-
|
|
31712
|
+
const providerCounts = new Map;
|
|
31713
|
+
for (const m of models) {
|
|
31714
|
+
if (m.source) {
|
|
31715
|
+
providerCounts.set(m.source, (providerCounts.get(m.source) || 0) + 1);
|
|
31716
|
+
}
|
|
31717
|
+
}
|
|
31718
|
+
let filteredModels = models;
|
|
31719
|
+
if (!freeOnly && !message && providerCounts.size > 1) {
|
|
31720
|
+
const providerChoices = [
|
|
31721
|
+
{ name: `All providers (${models.length} models)`, value: "__all__" },
|
|
31722
|
+
...Array.from(providerCounts.entries()).sort((a, b) => b[1] - a[1]).map(([source, count]) => ({
|
|
31723
|
+
name: `${source} (${count})`,
|
|
31724
|
+
value: source
|
|
31725
|
+
}))
|
|
31726
|
+
];
|
|
31727
|
+
const selectedProvider = await dist_default5({
|
|
31728
|
+
message: "Filter by provider:",
|
|
31729
|
+
choices: providerChoices
|
|
31730
|
+
});
|
|
31731
|
+
if (selectedProvider !== "__all__") {
|
|
31732
|
+
filteredModels = models.filter((m) => m.source === selectedProvider);
|
|
31733
|
+
}
|
|
31734
|
+
}
|
|
31735
|
+
const promptMessage = message || (freeOnly ? "Select a FREE model:" : "Select a model (type to search):");
|
|
31718
31736
|
const selected = await dist_default4({
|
|
31719
31737
|
message: promptMessage,
|
|
31720
31738
|
pageSize: 20,
|
|
31721
31739
|
source: async (term) => {
|
|
31722
31740
|
if (!term) {
|
|
31723
|
-
return
|
|
31741
|
+
return filteredModels.slice(0, 30).map((m) => ({
|
|
31724
31742
|
name: formatModelChoice(m, true),
|
|
31725
31743
|
value: m.id,
|
|
31726
31744
|
description: m.description?.slice(0, 80)
|
|
31727
31745
|
}));
|
|
31728
31746
|
}
|
|
31729
31747
|
const { provider: filterProvider, searchTerm } = parseProviderFilter(term);
|
|
31730
|
-
let pool =
|
|
31748
|
+
let pool = filteredModels;
|
|
31731
31749
|
if (filterProvider) {
|
|
31732
31750
|
pool = models.filter((m) => m.source === filterProvider);
|
|
31733
31751
|
}
|
|
@@ -34856,7 +34874,7 @@ async function fetchGLMCodingModels2() {
|
|
|
34856
34874
|
return [];
|
|
34857
34875
|
}
|
|
34858
34876
|
}
|
|
34859
|
-
var __filename5, __dirname5, VERSION = "4.6.
|
|
34877
|
+
var __filename5, __dirname5, VERSION = "4.6.5", CACHE_MAX_AGE_DAYS3 = 2, MODELS_JSON_PATH, CLAUDISH_CACHE_DIR3, ALL_MODELS_JSON_PATH2;
|
|
34860
34878
|
var init_cli = __esm(() => {
|
|
34861
34879
|
init_config();
|
|
34862
34880
|
init_model_loader();
|