@i14ks/ccv 0.29.0 → 0.31.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.
Files changed (27) hide show
  1. package/README.md +46 -16
  2. package/bundle/ccv.mjs +178 -34
  3. package/package.json +1 -1
  4. package/web/assets/{codemirror-CDWDRYM6.js → codemirror-BdWXIyBE.js} +1 -1
  5. package/web/assets/{index-DikEtRL5.js → index-At4SIHW8.js} +1 -1
  6. package/web/assets/{index-Dru7wmxV.js → index-B2LO0l57.js} +1 -1
  7. package/web/assets/{index-iahStfDc.js → index-BPJrlUj_.js} +1 -1
  8. package/web/assets/{index-QKzVwILH.js → index-BUQkCY8p.js} +1 -1
  9. package/web/assets/{index-BnBusVyC.js → index-BVZbJUdX.js} +1 -1
  10. package/web/assets/{index-C01LPRKQ.js → index-BaGoVOX2.js} +1 -1
  11. package/web/assets/{index-DgD9cb9g.js → index-BdM-YzrJ.js} +1 -1
  12. package/web/assets/{index-B_iQhvb3.js → index-BrHQ2TSw.js} +1 -1
  13. package/web/assets/{index-DP031YpP.js → index-BysIpqtT.js} +1 -1
  14. package/web/assets/{index-D6qzdOs0.js → index-C5zvd-WO.js} +1 -1
  15. package/web/assets/{index-Cy2389er.css → index-CHPLX3RU.css} +1 -1
  16. package/web/assets/{index-DlcxNT3u.js → index-CZ1qVXcb.js} +1 -1
  17. package/web/assets/{index-ChI_MBJ6.js → index-Ca8CvnGG.js} +1 -1
  18. package/web/assets/{index-BUfKKp57.js → index-CaiMt4h0.js} +1 -1
  19. package/web/assets/{index-CwNolSfU.js → index-CfeCkS4B.js} +1 -1
  20. package/web/assets/{index-BRmKWLDC.js → index-CtJMqb_5.js} +1 -1
  21. package/web/assets/{index-Ca9uYBli.js → index-CyKzgfHd.js} +1 -1
  22. package/web/assets/{index-qjyqA6zd.js → index-D6yXt8v4.js} +1 -1
  23. package/web/assets/index-Dm1yPdNn.js +143 -0
  24. package/web/assets/{index-hRb8ersw.js → index-LJAvSv-o.js} +1 -1
  25. package/web/assets/{index-CbA_-czu.js → index-ZxlYmRHu.js} +1 -1
  26. package/web/index.html +2 -2
  27. package/web/assets/index-BFpQjWPN.js +0 -143
package/README.md CHANGED
@@ -64,22 +64,52 @@ Codex использует свои `AGENTS.md`, навыки, MCP и `~/.codex/
64
64
 
65
65
  ## Проекты и разговоры
66
66
 
67
- В боковом меню доступны обзор всех проектов и общие входящие: вопросы,
68
- разрешения, ошибки и результаты. `Ctrl+K` / `Cmd+K` ищет проекты, сессии
69
- и действия. Над разговором можно раскрыть последнюю задачу, действия и ответ.
70
-
71
- Вкладка «Все» содержит проекты. Откройте проект, чтобы перейти в его dashboard
72
- с сессиями, папками и архивом. «Закреплённые» и «Запущенные» показывают сессии
73
- всех проектов. Нажатие на имя проекта в шапке разговора возвращает в dashboard;
74
- выбранный dashboard сохраняется при перезагрузке страницы.
75
-
76
- «Ветки задачи» связывают разговоры в этапы и позволяют создать следующий
77
- этап с подготовленным черновиком. Связи сохраняются на хосте и доступны с
78
- других устройств. «Два разговора» открывает вторую независимую сессию со
79
- своим черновиком и файлами контекста; на телефоне разговоры переключаются.
80
- На широком экране разделитель между разговорами можно перетаскивать или
81
- двигать стрелками с клавиатуры. Ширина сохраняется, двойной щелчок возвращает
82
- её к исходному значению.
67
+ Рабочее пространство занимает весь экран. Сверху — разделы «Проекты»,
68
+ «Сессии» и «Закрепы», фильтры по CLI и проекту, входящие и настройки.
69
+ Постоянной левой панели нет. В проект можно зайти, чтобы увидеть его сессии;
70
+ папки, ручной порядок и архив доступны через управление проектом.
71
+
72
+ `Ctrl+P` / `Cmd+P` открывает поиск проектов, сессий и действий и перехватывает
73
+ печать браузера. Стрелки выбирают результат, Enter открывает его,
74
+ Esc закрывает поиск. Фильтр CLI действует и в поиске.
75
+
76
+ В разделе «Сессии» переключайтесь между всеми неархивными разговорами
77
+ и запущенными CLI. Цвет и подпись показывают состояние: готовность, работу,
78
+ ожидание ответа, восстановление связи, ошибку или сохранённый разговор.
79
+
80
+ Все открытые сессии равноправны: у каждой свои модель, усилие, права,
81
+ контекст, история, инструменты и черновик. Обычное открытие добавляет вкладку,
82
+ «Открыть в параллельном просмотре» создаёт соседнюю панель.
83
+
84
+ Перетаскивайте вкладку в центр панели для объединения или к её краю для
85
+ стыковки слева, справа, сверху или снизу. Разделители меняют пропорции панелей;
86
+ двойной клик на разделителе возвращает равные размеры. Панель можно открепить,
87
+ двигать за ручку слева от вкладок, менять размер за нижний правый угол и
88
+ развернуть. Доступны колонки, строки, сетка, плавающие окна и сохранение
89
+ собственных раскладок. На небольшом экране переключайте видимую сессию
90
+ в списке рабочей области.
91
+
92
+ Раскладка и черновики сохраняются после перезагрузки. Закрытие вкладки
93
+ не останавливает CLI; для остановки есть отдельная кнопка в сессии.
94
+ Повторный клик на текущий раздел сворачивает список, освобождая место для
95
+ разговоров. Фильтр CLI скрывает чужие панели, сохраняя их работу и черновики.
96
+
97
+ В настройках можно выбрать модель по умолчанию отдельно для Claude Code,
98
+ Codex и Antigravity. Введите ID модели или выберите из каталога открытых
99
+ сессий этого CLI; пустое поле оставляет выбор самому CLI. Настройки применяются
100
+ к новым разговорам, продолженные и ответвлённые сохраняют выбранную модель.
101
+ Для этой настройки нужен обновлённый хост ccv на компьютере.
102
+
103
+ Входящие собирают вопросы, разрешения и результаты. «Вернуться в контекст»
104
+ раскрывает последнюю задачу, действия и ответ без обращения к модели.
105
+ «Ветки задачи» связывают разговоры в этапы и создают следующий этап с
106
+ подготовленным черновиком; связи сохраняются на хосте.
107
+
108
+ В разговоре Codex наберите `/`, чтобы увидеть доступные команды, включая
109
+ `/model`, `/permissions`, `/review`, `/compact`, `/login`, `/fork` и навыки,
110
+ полученные от установленного CLI через `skills/list`. Отключённые навыки
111
+ не предлагаются. `/skills` обновляет их каталог; вызов навыка передаёт его
112
+ имя и путь в app-server.
83
113
 
84
114
  ## Условия
85
115
 
package/bundle/ccv.mjs CHANGED
@@ -4349,18 +4349,56 @@ function describe2(error) {
4349
4349
  // ../host/dist/codex-session.js
4350
4350
  import { EventEmitter as EventEmitter5 } from "node:events";
4351
4351
  import { randomUUID as randomUUID3 } from "node:crypto";
4352
+ import { execFile as execFile5 } from "node:child_process";
4353
+ import { promisify } from "node:util";
4354
+
4355
+ // ../host/dist/codex-commands.js
4356
+ var CODEX_COMMANDS = [
4357
+ ["help", "\u0412\u0441\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u044B Codex", ""],
4358
+ ["model", "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u043C\u043E\u0434\u0435\u043B\u0438 \u0438 \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043C\u043E\u0434\u0435\u043B\u0438", "<model>"],
4359
+ ["effort", "\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u044F: low, medium, high, xhigh", "<level>"],
4360
+ ["permissions", "\u0420\u0435\u0436\u0438\u043C \u0434\u043E\u0441\u0442\u0443\u043F\u0430: default, acceptEdits, plan, bypassPermissions", "<mode>"],
4361
+ ["plan", "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0438\u043B\u0438 \u0432\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0440\u0435\u0436\u0438\u043C \u043F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F", ""],
4362
+ ["status", "\u0410\u043A\u043A\u0430\u0443\u043D\u0442 \u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 Codex", ""],
4363
+ ["login", "\u0412\u043E\u0439\u0442\u0438 \u0432 ChatGPT \u043F\u043E \u043A\u043E\u0434\u0443", ""],
4364
+ ["logout", "\u0412\u044B\u0439\u0442\u0438 \u0438\u0437 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430 Codex", ""],
4365
+ ["compact", "\u0421\u0436\u0430\u0442\u044C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430", ""],
4366
+ ["review", "\u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432 \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u0434\u0435\u0440\u0435\u0432\u0435", ""],
4367
+ ["diff", "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F Git", ""],
4368
+ ["rename", "\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440", "<title>"],
4369
+ ["mcp", "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u044B\u0435 MCP-\u0441\u0435\u0440\u0432\u0435\u0440\u044B", ""],
4370
+ ["skills", "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043F\u0438\u0441\u043E\u043A \u043D\u0430\u0432\u044B\u043A\u043E\u0432 \u0438 \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0438 \u043A\u043E\u043C\u0430\u043D\u0434", ""],
4371
+ ["init", "\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0438\u043D\u0441\u0442\u0440\u0443\u043A\u0446\u0438\u0438 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 AGENTS.md", ""],
4372
+ ["new", "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440", ""],
4373
+ ["clear", "\u041D\u0430\u0447\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0441 \u0447\u0438\u0441\u0442\u044B\u043C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u043E\u043C", ""],
4374
+ ["resume", "\u041D\u0430\u0439\u0442\u0438 \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0451\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440", ""],
4375
+ ["fork", "\u041E\u0442\u0432\u0435\u0442\u0432\u0438\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u043D\u043E\u0432\u0443\u044E \u043A\u0430\u0440\u0442\u043E\u0447\u043A\u0443", ""],
4376
+ ["stop", "\u041F\u0440\u0435\u0440\u0432\u0430\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u0445\u043E\u0434", ""],
4377
+ ["exit", "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E Codex", ""]
4378
+ ].map(([name, description, argumentHint]) => ({ name, description, argumentHint, aliases: name === "permissions" ? ["approvals"] : name === "exit" ? ["quit"] : [] }));
4379
+ function isCodexModelPrompt(text) {
4380
+ if (!text.startsWith("/"))
4381
+ return true;
4382
+ const name = text.trim().slice(1).split(/\s+/)[0];
4383
+ return name === "init" || name === "review" || !CODEX_COMMANDS.some((command) => command.name === name || command.aliases.includes(name ?? ""));
4384
+ }
4385
+ function codexSkills(response) {
4386
+ const result = /* @__PURE__ */ new Map();
4387
+ if (!response || typeof response !== "object" || !("data" in response) || !Array.isArray(response.data))
4388
+ return result;
4389
+ for (const group of response.data)
4390
+ for (const skill of Array.isArray(group?.skills) ? group.skills : []) {
4391
+ if (!skill || skill.enabled === false || typeof skill.name !== "string" || typeof skill.path !== "string" || !skill.path || !/^[\w.:-]+$/.test(skill.name))
4392
+ continue;
4393
+ const name = CODEX_COMMANDS.some((c) => c.name === skill.name || c.aliases.includes(skill.name)) ? `skill:${skill.name}` : skill.name;
4394
+ result.set(name, { name: skill.name, path: skill.path, description: skill.interface?.shortDescription ?? skill.description ?? "\u041D\u0430\u0432\u044B\u043A Codex" });
4395
+ }
4396
+ return result;
4397
+ }
4398
+
4399
+ // ../host/dist/codex-session.js
4352
4400
  var TRANSIENT2 = /* @__PURE__ */ new Set(["assistant.delta", "thinking.delta", "state"]);
4353
- var COMMANDS = [
4354
- ["help", "\u041A\u043E\u043C\u0430\u043D\u0434\u044B Codex"],
4355
- ["status", "\u0410\u043A\u043A\u0430\u0443\u043D\u0442 \u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438"],
4356
- ["login", "\u0412\u043E\u0439\u0442\u0438 \u0432 ChatGPT \u043F\u043E \u043A\u043E\u0434\u0443 \u0441 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430"],
4357
- ["model", "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u043C\u043E\u0434\u0435\u043B\u044C"],
4358
- ["effort", "\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u044F"],
4359
- ["compact", "\u0421\u0436\u0430\u0442\u044C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442"],
4360
- ["mcp", "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u044B\u0435 MCP-\u0441\u0435\u0440\u0432\u0435\u0440\u044B"],
4361
- ["skills", "\u041D\u0430\u0432\u044B\u043A\u0438 \u043F\u0440\u043E\u0435\u043A\u0442\u0430"],
4362
- ["fork", "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0432 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E\u0439 \u0432\u0435\u0442\u043A\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430"]
4363
- ];
4401
+ var execFileAsync = promisify(execFile5);
4364
4402
  var CodexSession = class extends EventEmitter5 {
4365
4403
  provider = "codex";
4366
4404
  id;
@@ -4372,6 +4410,7 @@ var CodexSession = class extends EventEmitter5 {
4372
4410
  #store;
4373
4411
  #record;
4374
4412
  #client = null;
4413
+ #skills = /* @__PURE__ */ new Map();
4375
4414
  #closing = Promise.resolve();
4376
4415
  #state = "starting";
4377
4416
  #lastTurn = null;
@@ -4570,19 +4609,34 @@ var CodexSession = class extends EventEmitter5 {
4570
4609
  cwd: this.cwd,
4571
4610
  model: this.#record.model ?? "",
4572
4611
  permissionMode: this.#record.permissionMode,
4573
- slashCommands: COMMANDS.map(([name]) => name),
4574
- commands: COMMANDS.map(([name, description]) => ({ name, description, argumentHint: "", aliases: [] })),
4612
+ slashCommands: CODEX_COMMANDS.map((c) => c.name),
4613
+ commands: CODEX_COMMANDS,
4575
4614
  models,
4576
4615
  tools: ["shell", "apply_patch", "web_search", "mcp"],
4577
4616
  agents: [],
4578
4617
  mcpServers: [],
4579
4618
  flags: ["codex-app-server"]
4580
4619
  };
4620
+ await this.#refreshCommands();
4581
4621
  this.emit("capabilities");
4582
4622
  this.#setState("idle");
4583
4623
  void this.refreshUsage().catch(() => {
4584
4624
  });
4585
4625
  }
4626
+ async #refreshCommands() {
4627
+ const client = this.#client;
4628
+ if (!client)
4629
+ return;
4630
+ const response = await client.request("skills/list", { cwds: [this.cwd], forceReload: true }).catch(() => null);
4631
+ if (client !== this.#client || this.#state === "closed")
4632
+ return;
4633
+ this.#skills = codexSkills(response);
4634
+ if (!this.#capabilities)
4635
+ return;
4636
+ this.#capabilities.commands = [...CODEX_COMMANDS, ...[...this.#skills.entries()].map(([name, skill]) => ({ name, description: skill.description, argumentHint: "<\u0437\u0430\u0434\u0430\u0447\u0430>", aliases: [] }))];
4637
+ this.#capabilities.slashCommands = this.#capabilities.commands.map((c) => c.name);
4638
+ this.emit("capabilities");
4639
+ }
4586
4640
  #effort(value) {
4587
4641
  return ["low", "medium", "high", "xhigh", "max"].includes(String(value)) ? value : null;
4588
4642
  }
@@ -4612,13 +4666,23 @@ var CodexSession = class extends EventEmitter5 {
4612
4666
  const blocked = networkGuard.blockedReason();
4613
4667
  if (blocked)
4614
4668
  throw new Error(blocked);
4669
+ let turnText = text;
4670
+ let skill;
4615
4671
  if (text.startsWith("/") && !images?.length) {
4616
- try {
4617
- await this.#command(text);
4618
- } catch (error) {
4619
- this.#recordEvent({ kind: "error", message: error instanceof Error ? error.message : String(error) });
4672
+ const [name, ...args] = text.trim().slice(1).split(/\s+/);
4673
+ skill = this.#skills.get(name ?? "");
4674
+ if (skill)
4675
+ turnText = `$${skill.name} ${args.join(" ")}`.trim();
4676
+ else if (name === "init")
4677
+ turnText = "Create or update AGENTS.md with concise project-specific instructions based on the repository. Inspect existing instructions first and preserve useful guidance.";
4678
+ else {
4679
+ try {
4680
+ await this.#command(text);
4681
+ } catch (error) {
4682
+ this.#recordEvent({ kind: "error", message: error instanceof Error ? error.message : String(error) });
4683
+ }
4684
+ return;
4620
4685
  }
4621
- return;
4622
4686
  }
4623
4687
  this.#interruptRequested = false;
4624
4688
  this.#recordEvent({ kind: "user.message", text, ...images?.length ? { images } : {} });
@@ -4633,7 +4697,8 @@ var CodexSession = class extends EventEmitter5 {
4633
4697
  const response = await this.#client.request("turn/start", {
4634
4698
  threadId: this.#record.conversationId,
4635
4699
  input: [
4636
- { type: "text", text, text_elements: [] },
4700
+ { type: "text", text: turnText, text_elements: [] },
4701
+ ...skill ? [{ type: "skill", name: skill.name, path: skill.path }] : [],
4637
4702
  ...(images ?? []).map((img) => ({ type: "image", url: `data:${img.mediaType};base64,${img.data}` }))
4638
4703
  ],
4639
4704
  cwd: this.cwd,
@@ -4659,13 +4724,61 @@ var CodexSession = class extends EventEmitter5 {
4659
4724
  case "model":
4660
4725
  if (arg)
4661
4726
  await this.setModel(arg);
4662
- reply = `\u041C\u043E\u0434\u0435\u043B\u044C: ${this.#record.model}`;
4727
+ reply = `\u041C\u043E\u0434\u0435\u043B\u044C: ${this.#record.model}
4728
+ ` + (arg ? "" : (this.#capabilities?.models ?? []).map((m) => `${m.value} \u2014 ${m.displayName}`).join("\n"));
4663
4729
  break;
4664
4730
  case "effort":
4665
4731
  if (arg)
4666
4732
  await this.setEffort(arg);
4667
4733
  reply = `\u0423\u0441\u0438\u043B\u0438\u0435: ${this.#record.effort ?? "\u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E"}`;
4668
4734
  break;
4735
+ case "permissions":
4736
+ case "approvals":
4737
+ if (arg)
4738
+ await this.setPermissionMode(arg);
4739
+ reply = `\u0420\u0435\u0436\u0438\u043C \u0434\u043E\u0441\u0442\u0443\u043F\u0430: ${this.#record.permissionMode}
4740
+ \u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B: default, acceptEdits, plan, dontAsk, bypassPermissions`;
4741
+ break;
4742
+ case "plan":
4743
+ await this.setPermissionMode(this.#record.permissionMode === "plan" ? "default" : "plan");
4744
+ reply = `\u0420\u0435\u0436\u0438\u043C \u0434\u043E\u0441\u0442\u0443\u043F\u0430: ${this.#record.permissionMode}`;
4745
+ break;
4746
+ case "rename":
4747
+ if (!arg)
4748
+ throw new Error("\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435: /rename <title>");
4749
+ this.setTitle(arg);
4750
+ reply = `\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435: ${arg}`;
4751
+ break;
4752
+ case "logout":
4753
+ await this.#client.request("account/logout", {});
4754
+ reply = "\u0412\u044B \u0432\u044B\u0448\u043B\u0438 \u0438\u0437 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430 Codex.";
4755
+ break;
4756
+ case "review": {
4757
+ this.#recordEvent({ kind: "user.message", text });
4758
+ this.#startedAt = Date.now();
4759
+ this.#interruptRequested = false;
4760
+ this.#setState("running");
4761
+ const done = new Promise((resolve) => {
4762
+ this.#turnDone = resolve;
4763
+ });
4764
+ try {
4765
+ const response = await this.#client.request("review/start", { threadId: this.#record.conversationId, delivery: "inline", target: arg ? { type: "custom", instructions: arg } : { type: "uncommittedChanges" } });
4766
+ if (this.#turnDone)
4767
+ this.#turnId = response.turn.id;
4768
+ await done;
4769
+ } catch (error) {
4770
+ this.#turnDone = null;
4771
+ this.#turnId = null;
4772
+ this.#setState("idle");
4773
+ throw error;
4774
+ }
4775
+ return;
4776
+ }
4777
+ case "diff": {
4778
+ const diff = await execFileAsync("git", ["--no-pager", "diff", "--no-ext-diff", "HEAD", "--"], { cwd: this.cwd, windowsHide: true, maxBuffer: 2 * 1024 * 1024 });
4779
+ reply = diff.stdout.trim() || "\u041D\u0435\u0442 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439 \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0435\u043B\u044C\u043D\u043E HEAD.";
4780
+ break;
4781
+ }
4669
4782
  case "compact":
4670
4783
  await this.#client.request("thread/compact/start", { threadId: this.#record.conversationId });
4671
4784
  reply = "Codex \u043D\u0430\u0447\u0430\u043B \u0441\u0436\u0430\u0442\u0438\u0435 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430.";
@@ -4683,10 +4796,14 @@ var CodexSession = class extends EventEmitter5 {
4683
4796
  reply = JSON.stringify(await this.#client.request("mcpServerStatus/list", {}), null, 2);
4684
4797
  break;
4685
4798
  case "skills":
4686
- reply = JSON.stringify(await this.#client.request("skills/list", { cwds: [this.cwd] }), null, 2);
4799
+ await this.#refreshCommands();
4800
+ reply = [...this.#skills.entries()].map(([name2, skill]) => `/${name2} \u2014 ${skill.description}`).join("\n") || "\u0412 \u044D\u0442\u043E\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u0435 \u043D\u0430\u0432\u044B\u043A\u0438 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B.";
4801
+ break;
4802
+ case "help":
4803
+ reply = (this.#capabilities?.commands ?? CODEX_COMMANDS).map((c) => `/${c.name}${c.argumentHint ? " " + c.argumentHint : ""} \u2014 ${c.description}`).join("\n");
4687
4804
  break;
4688
4805
  default:
4689
- reply = COMMANDS.map(([command, description]) => `/${command} \u2014 ${description}`).join("\n");
4806
+ throw new Error(`\u041A\u043E\u043C\u0430\u043D\u0434\u0430 /${name} \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430. \u041D\u0430\u0431\u0435\u0440\u0438\u0442\u0435 /help \u0434\u043B\u044F \u0441\u043F\u0438\u0441\u043A\u0430 \u043A\u043E\u043C\u0430\u043D\u0434.`);
4690
4807
  }
4691
4808
  this.#recordEvent({ kind: "user.message", text });
4692
4809
  this.#recordEvent({ kind: "assistant.text", text: reply, blockId: randomUUID3() });
@@ -4700,6 +4817,10 @@ var CodexSession = class extends EventEmitter5 {
4700
4817
  return;
4701
4818
  }
4702
4819
  switch (message.method) {
4820
+ case "skills/changed":
4821
+ void this.#refreshCommands().catch(() => {
4822
+ });
4823
+ break;
4703
4824
  case "turn/started":
4704
4825
  this.#turnId = p.turn.id;
4705
4826
  this.#setState("running");
@@ -4910,6 +5031,8 @@ var CodexSession = class extends EventEmitter5 {
4910
5031
  this.start();
4911
5032
  }
4912
5033
  async setPermissionMode(mode) {
5034
+ if (!["default", "acceptEdits", "plan", "dontAsk", "bypassPermissions", "auto"].includes(mode))
5035
+ throw new Error(`\u0420\u0435\u0436\u0438\u043C \u0434\u043E\u0441\u0442\u0443\u043F\u0430 Codex \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D: ${mode}`);
4913
5036
  this.#record.permissionMode = mode;
4914
5037
  this.#changed();
4915
5038
  }
@@ -4984,7 +5107,7 @@ var CodexSession = class extends EventEmitter5 {
4984
5107
  throw new Error("\u0420\u0435\u043F\u043B\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430");
4985
5108
  if (target.event.text.startsWith("/"))
4986
5109
  throw new Error("\u0421\u043B\u0443\u0436\u0435\u0431\u043D\u0443\u044E \u043A\u043E\u043C\u0430\u043D\u0434\u0443 \u043D\u0435\u043B\u044C\u0437\u044F \u043E\u0442\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C; \u043E\u0442\u043F\u0440\u0430\u0432\u044C\u0442\u0435 \u0435\u0451 \u0437\u0430\u043D\u043E\u0432\u043E");
4987
- const modelIndex = messages.slice(0, userIndex).filter((entry) => entry.event.kind === "user.message" && !entry.event.text.startsWith("/")).length;
5110
+ const modelIndex = messages.slice(0, userIndex).filter((entry) => entry.event.kind === "user.message" && isCodexModelPrompt(entry.event.text)).length;
4988
5111
  const nativeMessages = [];
4989
5112
  let cursor = null;
4990
5113
  do {
@@ -5229,7 +5352,7 @@ var CodexStore = class extends AntigravityStore {
5229
5352
  };
5230
5353
 
5231
5354
  // ../host/dist/git.js
5232
- import { execFile as execFile5 } from "node:child_process";
5355
+ import { execFile as execFile6 } from "node:child_process";
5233
5356
  import { mkdtemp, readFile as readFile5, rm as rm3, writeFile as writeFile4 } from "node:fs/promises";
5234
5357
  import { tmpdir as tmpdir2 } from "node:os";
5235
5358
  import path11 from "node:path";
@@ -5619,7 +5742,7 @@ var GitRepo = class {
5619
5742
  #run(args, options2 = {}) {
5620
5743
  const token = options2.token ?? "";
5621
5744
  return new Promise((resolve, reject) => {
5622
- const child = execFile5(
5745
+ const child = execFile6(
5623
5746
  "git",
5624
5747
  // core.quotepath=false — иначе кириллические пути приезжают в виде
5625
5748
  // «\320\277\321\200…» и в панели читаются как мусор.
@@ -5829,7 +5952,7 @@ function count(body, mark) {
5829
5952
  }
5830
5953
 
5831
5954
  // ../host/dist/github.js
5832
- import { execFile as execFile6 } from "node:child_process";
5955
+ import { execFile as execFile7 } from "node:child_process";
5833
5956
  import { mkdir as mkdir4, readFile as readFile6, writeFile as writeFile5 } from "node:fs/promises";
5834
5957
  import path12 from "node:path";
5835
5958
  var API = "https://api.github.com";
@@ -6018,7 +6141,7 @@ var GitHubAccount = class {
6018
6141
  };
6019
6142
  function gh(args) {
6020
6143
  return new Promise((resolve, reject) => {
6021
- execFile6("gh", args, { timeout: GH_TIMEOUT_MS, windowsHide: true, encoding: "utf8" }, (error, stdout, stderr) => {
6144
+ execFile7("gh", args, { timeout: GH_TIMEOUT_MS, windowsHide: true, encoding: "utf8" }, (error, stdout, stderr) => {
6022
6145
  if (error)
6023
6146
  return reject(new Error(stderr.trim() || error.message));
6024
6147
  resolve(stdout);
@@ -7426,6 +7549,7 @@ var DEFAULT_APP_SETTINGS = {
7426
7549
  // Модель за пользователя не выбираем: пока он не сказал иначе, сессия
7427
7550
  // поднимается ровно с той, с которой её поднял бы консольный Claude Code.
7428
7551
  startModel: null,
7552
+ startModels: { claude: null, codex: null, antigravity: null },
7429
7553
  // Тот же режим, с которым сессия стартовала до появления этой настройки.
7430
7554
  startPermissionMode: "default",
7431
7555
  // Терминал по умолчанию закрыт — его включают, а не выключают: приложение,
@@ -7448,6 +7572,7 @@ var DEFAULT_APP_SETTINGS = {
7448
7572
  var AppSettingsStore = class {
7449
7573
  #settings = { ...DEFAULT_APP_SETTINGS };
7450
7574
  #storePath;
7575
+ #writing = Promise.resolve();
7451
7576
  constructor(dataDir) {
7452
7577
  this.#storePath = path20.join(dataDir, "app-settings.json");
7453
7578
  }
@@ -7460,7 +7585,7 @@ var AppSettingsStore = class {
7460
7585
  }
7461
7586
  }
7462
7587
  get current() {
7463
- return { ...this.#settings };
7588
+ return { ...this.#settings, startModels: { ...this.#settings.startModels } };
7464
7589
  }
7465
7590
  /**
7466
7591
  * Применить присланное окном.
@@ -7473,8 +7598,13 @@ var AppSettingsStore = class {
7473
7598
  async update(patch) {
7474
7599
  const next = sanitize2(patch, this.#settings);
7475
7600
  this.#settings = next;
7476
- await mkdir11(path20.dirname(this.#storePath), { recursive: true });
7477
- await writeFile12(this.#storePath, JSON.stringify(next, null, 2), "utf8");
7601
+ const writing = this.#writing.then(async () => {
7602
+ await mkdir11(path20.dirname(this.#storePath), { recursive: true });
7603
+ await writeFile12(this.#storePath, JSON.stringify(next, null, 2), "utf8");
7604
+ });
7605
+ this.#writing = writing.catch(() => {
7606
+ });
7607
+ await writing;
7478
7608
  return this.current;
7479
7609
  }
7480
7610
  };
@@ -7506,6 +7636,18 @@ function sanitize2(value, fallback) {
7506
7636
  else if (typeof model === "string")
7507
7637
  result.startModel = model.trim() || null;
7508
7638
  }
7639
+ const models = record.startModels;
7640
+ result.startModels = { ...fallback.startModels };
7641
+ if ("startModel" in record && !(models && typeof models === "object" && "claude" in models))
7642
+ result.startModels.claude = result.startModel;
7643
+ if (models && typeof models === "object" && !Array.isArray(models)) {
7644
+ for (const provider of PROVIDERS) {
7645
+ const model = models[provider];
7646
+ if (model === null || typeof model === "string")
7647
+ result.startModels[provider] = typeof model === "string" ? model.trim() || null : null;
7648
+ }
7649
+ }
7650
+ result.startModel = result.startModels.claude;
7509
7651
  const mode = record.startPermissionMode;
7510
7652
  if (typeof mode === "string" && PERMISSION_MODES.includes(mode)) {
7511
7653
  result.startPermissionMode = mode;
@@ -9157,7 +9299,7 @@ var HostServer = class {
9157
9299
  hostId: this.#hostId,
9158
9300
  hostVersion: this.#options.version,
9159
9301
  platform: process.platform,
9160
- features: ["session-routing", "session-links"]
9302
+ features: ["session-routing", "session-links", "provider-default-models"]
9161
9303
  });
9162
9304
  this.#send(socket, { type: "workspace.list", ...this.#workspaceLists() });
9163
9305
  this.#sendFolders(socket);
@@ -10436,6 +10578,8 @@ var HostServer = class {
10436
10578
  throw new Error("\u0420\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 \u044D\u0442\u043E\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u0435");
10437
10579
  }
10438
10580
  const provider = frame.provider ?? "claude";
10581
+ const defaultModel = this.#settings.current.startModels[provider];
10582
+ const startModel = frame.model ?? (!frame.resume ? defaultModel ?? void 0 : void 0);
10439
10583
  if (!frame.resume && !this.#settings.current.enabledProviders.includes(provider)) {
10440
10584
  throw new Error(`${provider === "codex" ? "Codex" : provider === "antigravity" ? "Antigravity" : "Claude"} \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445`);
10441
10585
  }
@@ -10461,7 +10605,7 @@ var HostServer = class {
10461
10605
  ...codexRecord ? { record: codexRecord } : {},
10462
10606
  fork: frame.fork,
10463
10607
  permissionMode: frame.permissionMode ?? codexRecord?.permissionMode ?? "default",
10464
- ...frame.model ? { model: frame.model } : {},
10608
+ ...startModel ? { model: startModel } : {},
10465
10609
  defaultTitle: workspace.name,
10466
10610
  writableRoots: () => this.#writableRoots(workspace.path)
10467
10611
  });
@@ -10482,7 +10626,7 @@ var HostServer = class {
10482
10626
  store: this.#antigravity,
10483
10627
  ...agyRecord ? { record: agyRecord } : {},
10484
10628
  ...frame.permissionMode ? { permissionMode: frame.permissionMode } : {},
10485
- ...frame.model ? { model: frame.model } : {},
10629
+ ...startModel ? { model: startModel } : {},
10486
10630
  defaultTitle: workspace.name
10487
10631
  });
10488
10632
  this.#wire(session2);
@@ -10503,7 +10647,7 @@ var HostServer = class {
10503
10647
  resume: frame.resume,
10504
10648
  fork: frame.fork,
10505
10649
  permissionMode: frame.permissionMode ?? startDefaults.startPermissionMode,
10506
- model: frame.model ?? startDefaults.startModel ?? void 0,
10650
+ model: startModel,
10507
10651
  ...resumedTitle ? { title: resumedTitle } : {},
10508
10652
  // Имя проекта вместо «Без названия»: свежую сессию в списке уже надо
10509
10653
  // как-то называть, а сказать о ней пока нечего, кроме того, где она.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i14ks/ccv",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Эфир — единое пространство для AI: проекты, сессии Claude Code, Codex и Antigravity, файлы и терминал.",
6
6
  "homepage": "https://claudevisual.com",
@@ -1 +1 @@
1
- import{s as r,H as a}from"./index-CbA_-czu.js";import{E as e}from"./index-891wE-Rj.js";import{t as o}from"./index-BFpQjWPN.js";import"./index-BHot-lnj.js";const m=e.theme({"&":{height:"100%",color:"var(--text)",backgroundColor:"var(--bg)",fontSize:"13px"},".cm-scroller":{fontFamily:"var(--mono)",lineHeight:"1.6"},".cm-content":{caretColor:"var(--accent)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--accent)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--cm-selection)"},".cm-gutters":{backgroundColor:"var(--bg)",color:"var(--muted)",borderRight:"1px solid var(--border-soft)"},".cm-activeLineGutter":{backgroundColor:"var(--surface-2)",color:"var(--text-2)"},".cm-activeLine":{backgroundColor:"var(--cm-active)"},".cm-selectionMatch":{backgroundColor:"var(--cm-match)"},"&.cm-focused .cm-matchingBracket":{backgroundColor:"var(--cm-match)",outline:"1px solid var(--accent-line)"},".cm-foldPlaceholder":{backgroundColor:"var(--surface-2)",border:"1px solid var(--border)",color:"var(--muted)"},".cm-panels":{backgroundColor:"var(--surface)",color:"var(--text)",border:"1px solid var(--border)"},".cm-panels input, .cm-panels button, .cm-panels select":{fontFamily:"var(--sans)",fontSize:"12px",background:"var(--surface-2)",color:"var(--text)",border:"1px solid var(--border)",borderRadius:"6px",padding:"3px 6px"},".cm-searchMatch":{backgroundColor:"var(--cm-match)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--accent-soft)"},".cm-tooltip":{background:"var(--surface)",border:"1px solid var(--border)",borderRadius:"8px",boxShadow:"var(--shadow-md)",color:"var(--text)"},".cm-tooltip-autocomplete ul li[aria-selected]":{background:"var(--surface-2)",color:"var(--text)"}}),i=r(a.define([{tag:[o.keyword,o.modifier,o.controlKeyword,o.moduleKeyword],color:"var(--cm-key)"},{tag:[o.name,o.deleted,o.character,o.macroName],color:"var(--text)"},{tag:[o.propertyName],color:"var(--cm-prop)"},{tag:[o.function(o.variableName),o.labelName],color:"var(--cm-fn)"},{tag:[o.color,o.constant(o.name),o.standard(o.name),o.bool],color:"var(--cm-const)"},{tag:[o.definition(o.name),o.separator],color:"var(--text)"},{tag:[o.typeName,o.className,o.changed,o.annotation,o.self,o.namespace],color:"var(--cm-type)"},{tag:[o.number,o.integer,o.float],color:"var(--cm-num)"},{tag:[o.string,o.special(o.string),o.regexp],color:"var(--cm-str)"},{tag:[o.operator,o.operatorKeyword,o.escape],color:"var(--cm-op)"},{tag:[o.meta,o.comment],color:"var(--cm-comment)",fontStyle:"italic"},{tag:o.strong,fontWeight:"650"},{tag:o.emphasis,fontStyle:"italic"},{tag:o.strikethrough,textDecoration:"line-through"},{tag:o.link,color:"var(--cm-str)",textDecoration:"underline"},{tag:o.heading,fontWeight:"650",color:"var(--cm-key)"},{tag:o.invalid,color:"var(--danger)"}]));export{i as editorHighlight,m as editorTheme};
1
+ import{s as r,H as a}from"./index-ZxlYmRHu.js";import{E as e}from"./index-891wE-Rj.js";import{t as o}from"./index-Dm1yPdNn.js";import"./index-BHot-lnj.js";const m=e.theme({"&":{height:"100%",color:"var(--text)",backgroundColor:"var(--bg)",fontSize:"13px"},".cm-scroller":{fontFamily:"var(--mono)",lineHeight:"1.6"},".cm-content":{caretColor:"var(--accent)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--accent)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--cm-selection)"},".cm-gutters":{backgroundColor:"var(--bg)",color:"var(--muted)",borderRight:"1px solid var(--border-soft)"},".cm-activeLineGutter":{backgroundColor:"var(--surface-2)",color:"var(--text-2)"},".cm-activeLine":{backgroundColor:"var(--cm-active)"},".cm-selectionMatch":{backgroundColor:"var(--cm-match)"},"&.cm-focused .cm-matchingBracket":{backgroundColor:"var(--cm-match)",outline:"1px solid var(--accent-line)"},".cm-foldPlaceholder":{backgroundColor:"var(--surface-2)",border:"1px solid var(--border)",color:"var(--muted)"},".cm-panels":{backgroundColor:"var(--surface)",color:"var(--text)",border:"1px solid var(--border)"},".cm-panels input, .cm-panels button, .cm-panels select":{fontFamily:"var(--sans)",fontSize:"12px",background:"var(--surface-2)",color:"var(--text)",border:"1px solid var(--border)",borderRadius:"6px",padding:"3px 6px"},".cm-searchMatch":{backgroundColor:"var(--cm-match)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--accent-soft)"},".cm-tooltip":{background:"var(--surface)",border:"1px solid var(--border)",borderRadius:"8px",boxShadow:"var(--shadow-md)",color:"var(--text)"},".cm-tooltip-autocomplete ul li[aria-selected]":{background:"var(--surface-2)",color:"var(--text)"}}),i=r(a.define([{tag:[o.keyword,o.modifier,o.controlKeyword,o.moduleKeyword],color:"var(--cm-key)"},{tag:[o.name,o.deleted,o.character,o.macroName],color:"var(--text)"},{tag:[o.propertyName],color:"var(--cm-prop)"},{tag:[o.function(o.variableName),o.labelName],color:"var(--cm-fn)"},{tag:[o.color,o.constant(o.name),o.standard(o.name),o.bool],color:"var(--cm-const)"},{tag:[o.definition(o.name),o.separator],color:"var(--text)"},{tag:[o.typeName,o.className,o.changed,o.annotation,o.self,o.namespace],color:"var(--cm-type)"},{tag:[o.number,o.integer,o.float],color:"var(--cm-num)"},{tag:[o.string,o.special(o.string),o.regexp],color:"var(--cm-str)"},{tag:[o.operator,o.operatorKeyword,o.escape],color:"var(--cm-op)"},{tag:[o.meta,o.comment],color:"var(--cm-comment)",fontStyle:"italic"},{tag:o.strong,fontWeight:"650"},{tag:o.emphasis,fontStyle:"italic"},{tag:o.strikethrough,textDecoration:"line-through"},{tag:o.link,color:"var(--cm-str)",textDecoration:"underline"},{tag:o.heading,fontWeight:"650",color:"var(--cm-key)"},{tag:o.invalid,color:"var(--danger)"}]));export{i as editorHighlight,m as editorTheme};