@iola_adm/iola-cli 0.2.22 → 0.2.24

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/package.json +1 -1
  2. package/src/cli.js +25 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iola_adm/iola-cli",
3
- "version": "0.2.22",
3
+ "version": "0.2.24",
4
4
  "description": "CLI и AI-агент городского округа Йошкар-Ола.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/adm-iola/iola-cli#readme",
package/src/cli.js CHANGED
@@ -527,10 +527,7 @@ const SLASH_COMMANDS = [
527
527
  { command: "/search лицей --limit 3", description: "поиск" },
528
528
  { command: "/mcp-info", description: "публичный MCP" },
529
529
  { command: "/profiles", description: "AI-профили" },
530
- { command: "/model", description: "переключить AI: local/API/Codex" },
531
- { command: "/model codex", description: "выбрать модель Codex" },
532
- { command: "/model api", description: "выбрать API-модель" },
533
- { command: "/models openrouter --search qwen", description: "модели" },
530
+ { command: "/model", description: "выбрать AI-подключение и модель" },
534
531
  { command: "/ai doctor", description: "AI diagnostics" },
535
532
  { command: "/ai setup ollama", description: "настройка Ollama" },
536
533
  { command: "/use codex", description: "выбрать Codex CLI" },
@@ -6434,12 +6431,33 @@ async function listAiModels(provider) {
6434
6431
  ];
6435
6432
  }
6436
6433
 
6434
+ return listCodexModels();
6435
+ }
6436
+
6437
+ async function listCodexModels() {
6437
6438
  const version = await getCommandVersion("codex", ["--version"]);
6439
+ const cacheFile = path.join(os.homedir(), ".codex", "models_cache.json");
6440
+ try {
6441
+ const cache = JSON.parse(await readFile(cacheFile, "utf8"));
6442
+ const models = (cache.models || [])
6443
+ .filter((model) => model?.slug && (model.visibility === "list" || model.visibility === undefined))
6444
+ .sort((left, right) => Number(right.priority || 0) - Number(left.priority || 0))
6445
+ .map((model) => ({
6446
+ id: model.slug,
6447
+ provider: "codex",
6448
+ note: `${model.display_name || model.slug} - ${version}`,
6449
+ priority: Number(model.priority || 0),
6450
+ contextWindow: model.context_window || model.max_context_window || null,
6451
+ }));
6452
+ if (models.length > 0) return models;
6453
+ } catch {
6454
+ // Fallback below covers fresh installs before Codex creates models_cache.json.
6455
+ }
6438
6456
  return [
6439
6457
  { id: "gpt-5.5", provider: "codex", note: version },
6440
- { id: "gpt-5", provider: "codex", note: version },
6441
- { id: "gpt-5-codex", provider: "codex", note: version },
6442
- { id: "gpt-5-mini", provider: "codex", note: version },
6458
+ { id: "gpt-5.4", provider: "codex", note: version },
6459
+ { id: "gpt-5.4-mini", provider: "codex", note: version },
6460
+ { id: "gpt-5.3-codex-spark", provider: "codex", note: version },
6443
6461
  ];
6444
6462
  }
6445
6463