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.
Files changed (2) hide show
  1. package/dist/index.js +27 -9
  2. 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 availableProviders = [...new Set(models.map((m) => m.source).filter(Boolean))];
31713
- const providerHints = availableProviders.map((src) => {
31714
- const aliases = Object.entries(PROVIDER_FILTER_ALIASES).filter(([, v]) => v === src).map(([k]) => k).sort((a, b) => a.length - b.length);
31715
- return aliases[0] ? `@${aliases[0]}` : null;
31716
- }).filter(Boolean).join(" ");
31717
- const promptMessage = message || (freeOnly ? "Select a FREE model:" : `Select a model (type to search, ${providerHints} to filter):`);
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 models.slice(0, 30).map((m) => ({
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 = models;
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.4", CACHE_MAX_AGE_DAYS3 = 2, MODELS_JSON_PATH, CLAUDISH_CACHE_DIR3, ALL_MODELS_JSON_PATH2;
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudish",
3
- "version": "4.6.4",
3
+ "version": "4.6.5",
4
4
  "description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",