zcf 3.4.3 → 3.5.1

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 (56) hide show
  1. package/README.md +8 -1
  2. package/dist/chunks/api-providers.mjs +1 -1
  3. package/dist/chunks/claude-code-config-manager.mjs +7 -7
  4. package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
  5. package/dist/chunks/codex-config-switch.mjs +4 -4
  6. package/dist/chunks/codex-provider-manager.mjs +28 -41
  7. package/dist/chunks/codex-uninstaller.mjs +1 -1
  8. package/dist/chunks/commands.mjs +1 -1
  9. package/dist/chunks/features.mjs +20 -28
  10. package/dist/chunks/simple-config.mjs +351 -263
  11. package/dist/cli.mjs +3 -3
  12. package/dist/i18n/locales/en/codex.json +1 -1
  13. package/dist/i18n/locales/en/configuration.json +3 -2
  14. package/dist/i18n/locales/en/menu.json +1 -1
  15. package/dist/i18n/locales/zh-CN/codex.json +1 -1
  16. package/dist/i18n/locales/zh-CN/configuration.json +3 -2
  17. package/dist/i18n/locales/zh-CN/menu.json +1 -1
  18. package/dist/index.mjs +1 -1
  19. package/package.json +2 -2
  20. package/templates/CLAUDE.md +39 -11
  21. package/templates/{codex/en/workflow/sixStep/prompts → common/workflow/sixStep/en}/workflow.md +25 -4
  22. package/templates/{codex/zh-CN/workflow/sixStep/prompts → common/workflow/sixStep/zh-CN}/workflow.md +25 -4
  23. package/templates/claude-code/en/workflow/sixStep/commands/workflow.md +0 -230
  24. package/templates/claude-code/zh-CN/workflow/sixStep/commands/workflow.md +0 -194
  25. package/templates/codex/en/system-prompt/engineer-professional.md +0 -88
  26. package/templates/codex/en/system-prompt/laowang-engineer.md +0 -127
  27. package/templates/codex/en/system-prompt/nekomata-engineer.md +0 -120
  28. package/templates/codex/en/system-prompt/ojousama-engineer.md +0 -121
  29. package/templates/codex/en/workflow/git/prompts/git-cleanBranches.md +0 -102
  30. package/templates/codex/en/workflow/git/prompts/git-commit.md +0 -205
  31. package/templates/codex/en/workflow/git/prompts/git-rollback.md +0 -90
  32. package/templates/codex/en/workflow/git/prompts/git-worktree.md +0 -276
  33. package/templates/codex/zh-CN/system-prompt/engineer-professional.md +0 -89
  34. package/templates/codex/zh-CN/system-prompt/laowang-engineer.md +0 -127
  35. package/templates/codex/zh-CN/system-prompt/nekomata-engineer.md +0 -120
  36. package/templates/codex/zh-CN/system-prompt/ojousama-engineer.md +0 -121
  37. package/templates/codex/zh-CN/workflow/git/prompts/git-cleanBranches.md +0 -102
  38. package/templates/codex/zh-CN/workflow/git/prompts/git-commit.md +0 -205
  39. package/templates/codex/zh-CN/workflow/git/prompts/git-rollback.md +0 -90
  40. package/templates/codex/zh-CN/workflow/git/prompts/git-worktree.md +0 -276
  41. /package/templates/{claude-code/en/output-styles → common/output-styles/en}/engineer-professional.md +0 -0
  42. /package/templates/{claude-code/en/output-styles → common/output-styles/en}/laowang-engineer.md +0 -0
  43. /package/templates/{claude-code/en/output-styles → common/output-styles/en}/nekomata-engineer.md +0 -0
  44. /package/templates/{claude-code/en/output-styles → common/output-styles/en}/ojousama-engineer.md +0 -0
  45. /package/templates/{claude-code/zh-CN/output-styles → common/output-styles/zh-CN}/engineer-professional.md +0 -0
  46. /package/templates/{claude-code/zh-CN/output-styles → common/output-styles/zh-CN}/laowang-engineer.md +0 -0
  47. /package/templates/{claude-code/zh-CN/output-styles → common/output-styles/zh-CN}/nekomata-engineer.md +0 -0
  48. /package/templates/{claude-code/zh-CN/output-styles → common/output-styles/zh-CN}/ojousama-engineer.md +0 -0
  49. /package/templates/{claude-code/en/workflow/git/commands → common/workflow/git/en}/git-cleanBranches.md +0 -0
  50. /package/templates/{claude-code/en/workflow/git/commands → common/workflow/git/en}/git-commit.md +0 -0
  51. /package/templates/{claude-code/en/workflow/git/commands → common/workflow/git/en}/git-rollback.md +0 -0
  52. /package/templates/{claude-code/en/workflow/git/commands → common/workflow/git/en}/git-worktree.md +0 -0
  53. /package/templates/{claude-code/zh-CN/workflow/git/commands → common/workflow/git/zh-CN}/git-cleanBranches.md +0 -0
  54. /package/templates/{claude-code/zh-CN/workflow/git/commands → common/workflow/git/zh-CN}/git-commit.md +0 -0
  55. /package/templates/{claude-code/zh-CN/workflow/git/commands → common/workflow/git/zh-CN}/git-rollback.md +0 -0
  56. /package/templates/{claude-code/zh-CN/workflow/git/commands → common/workflow/git/zh-CN}/git-worktree.md +0 -0
package/README.md CHANGED
@@ -31,7 +31,7 @@
31
31
 
32
32
  [![GLM](./src/assets/GLM-en.png)](https://z.ai/subscribe?ic=8JVLJQFSKB)
33
33
  This project is sponsored by Z.ai, supporting us with their GLM CODING PLAN.
34
- GLM CODING PLAN is a subscription service designed for AI coding, starting at just $3/month. It provides access to their flagship GLM-4.6 model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences.
34
+ GLM CODING PLAN is a subscription service designed for AI coding, starting at just $3/month. It provides access to their flagship GLM-4.7 model across 10+ popular AI coding tools (Claude Code, Cline, Roo Code, etc.), offering developers top-tier, fast, and stable coding experiences.
35
35
  Get 10% OFF GLM CODING PLAN:https://z.ai/subscribe?ic=8JVLJQFSKB
36
36
 
37
37
  ---
@@ -102,9 +102,16 @@ If you find this project helpful, please consider sponsoring its development. Yo
102
102
  ### Our Sponsors
103
103
 
104
104
  A huge thank you to all our sponsors for their generous support!
105
+
106
+ 【Corporate Sponsors】
107
+
105
108
  - [302.AI](https://share.302.ai/gAT9VG) (first corporate sponsorship 🤠)
106
109
  - [GLM](https://z.ai/subscribe?ic=8JVLJQFSKB) (first AI model sponsorship 🤖)
107
110
  - [PackyCode](https://www.packyapi.com/register?aff=zcf) (first API proxy service sponsor 🧝🏻‍♀️)
111
+ - [UUCode](https://www.uucode.org/auth?ref=JQ2DJ1T8) (sponsored $100 proxy credits 💰)
112
+
113
+ 【Individual Sponsors】
114
+
108
115
  - Tc (first sponsor)
109
116
  - Argolinhas (first ko-fi sponsor ٩(•̤̀ᵕ•̤́๑))
110
117
  - r\*r (first anonymous sponsor 🤣)
@@ -38,7 +38,7 @@ const API_PROVIDER_PRESETS = [
38
38
  codex: {
39
39
  baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
40
40
  wireApi: "chat",
41
- defaultModel: "GLM-4.6"
41
+ defaultModel: "GLM-4.7"
42
42
  },
43
43
  description: "GLM (\u667A\u8C31AI)"
44
44
  },
@@ -13,7 +13,7 @@ import 'inquirer-toggle';
13
13
  import 'ora';
14
14
  import 'tinyexec';
15
15
  import 'semver';
16
- import 'smol-toml';
16
+ import '@rainbowatcher/toml-edit-js';
17
17
  import 'node:fs/promises';
18
18
  import 'i18next';
19
19
  import 'i18next-fs-backend';
@@ -183,15 +183,15 @@ class ClaudeCodeConfigManager {
183
183
  * Apply profile settings to Claude Code runtime
184
184
  */
185
185
  static async applyProfileSettings(profile) {
186
- const { ensureI18nInitialized, i18n } = await import('./simple-config.mjs').then(function (n) { return n.bg; });
186
+ const { ensureI18nInitialized, i18n } = await import('./simple-config.mjs').then(function (n) { return n.bf; });
187
187
  ensureI18nInitialized();
188
188
  try {
189
189
  if (!profile) {
190
- const { switchToOfficialLogin } = await import('./simple-config.mjs').then(function (n) { return n.bk; });
190
+ const { switchToOfficialLogin } = await import('./simple-config.mjs').then(function (n) { return n.bj; });
191
191
  switchToOfficialLogin();
192
192
  return;
193
193
  }
194
- const { readJsonConfig: readJsonConfig2, writeJsonConfig } = await import('./simple-config.mjs').then(function (n) { return n.bi; });
194
+ const { readJsonConfig: readJsonConfig2, writeJsonConfig } = await import('./simple-config.mjs').then(function (n) { return n.bh; });
195
195
  const settings = readJsonConfig2(SETTINGS_FILE) || {};
196
196
  if (!settings.env)
197
197
  settings.env = {};
@@ -204,7 +204,7 @@ class ClaudeCodeConfigManager {
204
204
  settings.env.ANTHROPIC_AUTH_TOKEN = profile.apiKey;
205
205
  delete settings.env.ANTHROPIC_API_KEY;
206
206
  } else if (profile.authType === "ccr_proxy") {
207
- const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bl; });
207
+ const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bk; });
208
208
  const ccrConfig = readCcrConfig();
209
209
  if (!ccrConfig) {
210
210
  throw new Error(i18n.t("ccr:ccrNotConfigured") || "CCR proxy configuration not found");
@@ -239,7 +239,7 @@ class ClaudeCodeConfigManager {
239
239
  clearModelEnv(settings.env);
240
240
  }
241
241
  writeJsonConfig(SETTINGS_FILE, settings);
242
- const { setPrimaryApiKey, addCompletedOnboarding } = await import('./simple-config.mjs').then(function (n) { return n.bj; });
242
+ const { setPrimaryApiKey, addCompletedOnboarding } = await import('./simple-config.mjs').then(function (n) { return n.bi; });
243
243
  setPrimaryApiKey();
244
244
  addCompletedOnboarding();
245
245
  if (shouldRestartCcr) {
@@ -600,7 +600,7 @@ class ClaudeCodeConfigManager {
600
600
  */
601
601
  static async syncCcrProfile() {
602
602
  try {
603
- const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bl; });
603
+ const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bk; });
604
604
  const ccrConfig = readCcrConfig();
605
605
  if (!ccrConfig) {
606
606
  await this.ensureCcrProfileExists(ccrConfig);
@@ -14,7 +14,7 @@ import 'inquirer-toggle';
14
14
  import 'ora';
15
15
  import 'tinyexec';
16
16
  import 'semver';
17
- import 'smol-toml';
17
+ import '@rainbowatcher/toml-edit-js';
18
18
  import 'node:fs/promises';
19
19
  import 'i18next';
20
20
  import 'i18next-fs-backend';
@@ -14,7 +14,7 @@ import 'inquirer-toggle';
14
14
  import 'ora';
15
15
  import 'tinyexec';
16
16
  import 'semver';
17
- import 'smol-toml';
17
+ import '@rainbowatcher/toml-edit-js';
18
18
  import 'node:fs/promises';
19
19
  import 'i18next';
20
20
  import 'i18next-fs-backend';
@@ -152,7 +152,7 @@ async function handleAddProvider() {
152
152
  wireApi: selectedProvider === "custom" ? answers.wireApi : prefilledWireApi,
153
153
  tempEnvKey: `${providerId.toUpperCase().replace(/-/g, "_")}_API_KEY`,
154
154
  requiresOpenaiAuth: true,
155
- model: prefilledModel || "gpt-5-codex"
155
+ model: prefilledModel || "gpt-5.2"
156
156
  // Use provider's default model or fallback
157
157
  };
158
158
  const result = await addProviderToExisting(provider, answers.apiKey.trim(), true);
@@ -244,7 +244,7 @@ async function handleEditProvider(providers) {
244
244
  type: "input",
245
245
  name: "model",
246
246
  message: i18n.t("codex:providerModelPrompt"),
247
- default: provider.model || "gpt-5-codex",
247
+ default: provider.model || "gpt-5.2",
248
248
  validate: (input) => !!input.trim() || i18n.t("codex:providerModelRequired")
249
249
  }
250
250
  ]);
@@ -336,7 +336,7 @@ ${i18n.t("codex:copyingProvider", { name: provider.name })}`));
336
336
  type: "input",
337
337
  name: "model",
338
338
  message: i18n.t("codex:providerModelPrompt"),
339
- default: provider.model || "gpt-5-codex",
339
+ default: provider.model || "gpt-5.2",
340
340
  validate: (input) => !!input.trim() || i18n.t("codex:providerModelRequired")
341
341
  }
342
342
  ]);
@@ -1,4 +1,4 @@
1
- import { ak as ensureI18nInitialized, ay as readCodexConfig, al as i18n, az as backupCodexComplete, aA as writeCodexConfig, aB as writeAuthFile } from './simple-config.mjs';
1
+ import { ak as ensureI18nInitialized, ay as readCodexConfig, al as i18n, az as backupCodexComplete, aA as writeAuthFile } from './simple-config.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:process';
4
4
  import 'ansis';
@@ -13,7 +13,7 @@ import 'inquirer-toggle';
13
13
  import 'ora';
14
14
  import 'tinyexec';
15
15
  import 'semver';
16
- import 'smol-toml';
16
+ import '@rainbowatcher/toml-edit-js';
17
17
  import 'node:fs/promises';
18
18
  import 'i18next';
19
19
  import 'i18next-fs-backend';
@@ -29,31 +29,6 @@ async function addProviderToExisting(provider, apiKey, allowOverwrite = false) {
29
29
  error: i18n.t("codex:providerManager.providerExists", { id: provider.id })
30
30
  };
31
31
  }
32
- let updatedConfig;
33
- if (!existingConfig) {
34
- updatedConfig = {
35
- model: provider.model || null,
36
- modelProvider: provider.id,
37
- providers: [provider],
38
- mcpServices: [],
39
- managed: true,
40
- otherConfig: []
41
- };
42
- } else if (existingProviderIndex !== -1) {
43
- const updatedProviders = [...existingConfig.providers];
44
- updatedProviders[existingProviderIndex] = provider;
45
- updatedConfig = {
46
- ...existingConfig,
47
- providers: updatedProviders,
48
- modelProvider: existingConfig.modelProvider || provider.id
49
- };
50
- } else {
51
- updatedConfig = {
52
- ...existingConfig,
53
- providers: [...existingConfig.providers, provider],
54
- modelProvider: existingConfig.modelProvider || provider.id
55
- };
56
- }
57
32
  let backupPath;
58
33
  if (existingConfig) {
59
34
  const backup = backupCodexComplete();
@@ -65,7 +40,20 @@ async function addProviderToExisting(provider, apiKey, allowOverwrite = false) {
65
40
  }
66
41
  backupPath = backup || void 0;
67
42
  }
68
- writeCodexConfig(updatedConfig);
43
+ const { updateCodexApiFields, upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.bm; });
44
+ if (!existingConfig) {
45
+ updateCodexApiFields({
46
+ model: provider.model,
47
+ modelProvider: provider.id,
48
+ modelProviderCommented: false
49
+ });
50
+ } else if (!existingConfig.modelProvider) {
51
+ updateCodexApiFields({
52
+ modelProvider: provider.id,
53
+ modelProviderCommented: false
54
+ });
55
+ }
56
+ upsertCodexProvider(provider.id, provider);
69
57
  const authEntries = {};
70
58
  authEntries[provider.tempEnvKey] = apiKey;
71
59
  writeAuthFile(authEntries);
@@ -112,13 +100,8 @@ async function editExistingProvider(providerId, updates) {
112
100
  ...updates.wireApi && { wireApi: updates.wireApi },
113
101
  ...updates.model && { model: updates.model }
114
102
  };
115
- const updatedProviders = [...existingConfig.providers];
116
- updatedProviders[providerIndex] = updatedProvider;
117
- const updatedConfig = {
118
- ...existingConfig,
119
- providers: updatedProviders
120
- };
121
- writeCodexConfig(updatedConfig);
103
+ const { upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.bm; });
104
+ upsertCodexProvider(providerId, updatedProvider);
122
105
  if (updates.apiKey) {
123
106
  const authEntries = {};
124
107
  authEntries[updatedProvider.tempEnvKey] = updates.apiKey;
@@ -183,12 +166,16 @@ async function deleteProviders(providerIds) {
183
166
  if (providerIds.includes(existingConfig.modelProvider || "")) {
184
167
  newDefaultProvider = remainingProviders[0].id;
185
168
  }
186
- const updatedConfig = {
187
- ...existingConfig,
188
- modelProvider: newDefaultProvider,
189
- providers: remainingProviders
190
- };
191
- writeCodexConfig(updatedConfig);
169
+ const { deleteCodexProvider, updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.bm; });
170
+ if (newDefaultProvider !== existingConfig.modelProvider) {
171
+ updateCodexApiFields({
172
+ modelProvider: newDefaultProvider,
173
+ modelProviderCommented: false
174
+ });
175
+ }
176
+ for (const providerId of providerIds) {
177
+ deleteCodexProvider(providerId);
178
+ }
192
179
  const result = {
193
180
  success: true,
194
181
  backupPath,
@@ -15,7 +15,7 @@ import 'inquirer-toggle';
15
15
  import 'ora';
16
16
  import 'tinyexec';
17
17
  import 'semver';
18
- import 'smol-toml';
18
+ import '@rainbowatcher/toml-edit-js';
19
19
  import 'node:fs/promises';
20
20
  import 'i18next';
21
21
  import 'i18next-fs-backend';
@@ -13,7 +13,7 @@ import 'inquirer-toggle';
13
13
  import 'ora';
14
14
  import 'tinyexec';
15
15
  import 'semver';
16
- import 'smol-toml';
16
+ import '@rainbowatcher/toml-edit-js';
17
17
  import 'node:fs/promises';
18
18
  import 'i18next';
19
19
  import 'i18next-fs-backend';
@@ -1,6 +1,6 @@
1
1
  import ansis from 'ansis';
2
2
  import inquirer from 'inquirer';
3
- import { al as i18n, ak as ensureI18nInitialized, x as SUPPORTED_LANGS, am as addNumbersToChoices, y as LANG_LABELS, aC as updateZcfConfig, aD as changeLanguage, aE as readZcfConfig, ao as promptBoolean, o as openSettingsJson, d as importRecommendedPermissions, b as importRecommendedEnv, a1 as applyAiLanguageDirective, aF as configureOutputStyle, $ as getExistingModelConfig, X as updateCustomModel, Y as updateDefaultModel, aG as isWindows, F as readMcpConfig, K as fixWindowsMcpConfig, G as writeMcpConfig, aH as selectMcpServices, H as backupMcpConfig, aI as getMcpServices, J as buildMcpServerConfig, I as mergeMcpServers, aJ as isCcrInstalled, aK as installCcr, aL as setupCcrConfiguration, a0 as getExistingApiConfig, a3 as promptApiConfigurationAction, aM as modifyApiConfigPartially, an as validateApiKey, V as configureApi, aN as formatApiKeyDisplay, a2 as switchToOfficialLogin } from './simple-config.mjs';
3
+ import { al as i18n, ak as ensureI18nInitialized, x as SUPPORTED_LANGS, am as addNumbersToChoices, y as LANG_LABELS, aB as updateZcfConfig, aC as changeLanguage, aD as readZcfConfig, ao as promptBoolean, o as openSettingsJson, d as importRecommendedPermissions, b as importRecommendedEnv, a1 as applyAiLanguageDirective, aE as configureOutputStyle, $ as getExistingModelConfig, X as updateCustomModel, Y as updateDefaultModel, aF as isWindows, F as readMcpConfig, K as fixWindowsMcpConfig, G as writeMcpConfig, aG as selectMcpServices, H as backupMcpConfig, aH as getMcpServices, J as buildMcpServerConfig, I as mergeMcpServers, aI as isCcrInstalled, aJ as installCcr, aK as setupCcrConfiguration, a0 as getExistingApiConfig, a3 as promptApiConfigurationAction, aL as modifyApiConfigPartially, an as validateApiKey, V as configureApi, aM as formatApiKeyDisplay, a2 as switchToOfficialLogin } from './simple-config.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:process';
6
6
  import 'node:child_process';
@@ -13,7 +13,7 @@ import 'inquirer-toggle';
13
13
  import 'ora';
14
14
  import 'tinyexec';
15
15
  import 'semver';
16
- import 'smol-toml';
16
+ import '@rainbowatcher/toml-edit-js';
17
17
  import 'node:fs/promises';
18
18
  import 'i18next';
19
19
  import 'i18next-fs-backend';
@@ -351,7 +351,7 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
351
351
  return;
352
352
  }
353
353
  }
354
- const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bm; });
354
+ const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bl; });
355
355
  const aiOutputLang = await selectAiOutputLanguage();
356
356
  applyAiLanguageDirective(aiOutputLang);
357
357
  updateZcfConfig({ aiOutputLang });
@@ -390,7 +390,7 @@ async function configureCodexDefaultModelFeature() {
390
390
  if (currentModel) {
391
391
  console.log(`
392
392
  ${ansis.blue(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing model configuration"}`)}`);
393
- const modelDisplay = currentModel === "gpt-5-codex" ? "GPT-5-Codex" : currentModel === "gpt-5" ? "GPT-5" : currentModel.charAt(0).toUpperCase() + currentModel.slice(1);
393
+ const modelDisplay = currentModel === "gpt-5.2" ? "GPT-5.2" : currentModel === "gpt-5.1-codex-max" ? "GPT-5.1-Codex-Max" : currentModel === "gpt-5.1-codex-mini" ? "GPT-5.1-Codex-Mini" : currentModel.charAt(0).toUpperCase() + currentModel.slice(1);
394
394
  console.log(ansis.gray(` ${i18n.t("configuration:currentModel") || "Current model"}: ${modelDisplay}
395
395
  `));
396
396
  const modify = await promptBoolean({
@@ -408,20 +408,24 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingModelConfig") || "Existing
408
408
  message: i18n.t("configuration:selectDefaultModel") || "Select default model",
409
409
  choices: addNumbersToChoices([
410
410
  {
411
- name: i18n.t("configuration:codexModelOptions.gpt5"),
412
- value: "gpt-5"
411
+ name: i18n.t("configuration:codexModelOptions.gpt51CodexMax"),
412
+ value: "gpt-5.1-codex-max"
413
413
  },
414
414
  {
415
- name: i18n.t("configuration:codexModelOptions.gpt5Codex"),
416
- value: "gpt-5-codex"
415
+ name: i18n.t("configuration:codexModelOptions.gpt51CodexMini"),
416
+ value: "gpt-5.1-codex-mini"
417
+ },
418
+ {
419
+ name: i18n.t("configuration:codexModelOptions.gpt52"),
420
+ value: "gpt-5.2"
417
421
  },
418
422
  {
419
423
  name: i18n.t("configuration:codexModelOptions.custom"),
420
424
  value: "custom"
421
425
  }
422
426
  ]),
423
- default: currentModel ? ["gpt-5", "gpt-5-codex", "custom"].indexOf(currentModel) : 1
424
- // Default to gpt-5-codex
427
+ default: currentModel ? ["gpt-5.1-codex-max", "gpt-5.1-codex-mini", "gpt-5.2", "custom"].indexOf(currentModel) : 2
428
+ // Default to gpt-5.2
425
429
  });
426
430
  if (!model) {
427
431
  await handleCancellation();
@@ -485,7 +489,7 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
485
489
  return;
486
490
  }
487
491
  }
488
- const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bm; });
492
+ const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bl; });
489
493
  const aiOutputLang = await selectAiOutputLanguage();
490
494
  await updateCodexLanguageDirective(aiOutputLang);
491
495
  updateZcfConfig({ aiOutputLang });
@@ -500,28 +504,16 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
500
504
  }
501
505
  }
502
506
  async function updateCodexModelProvider(modelProvider) {
503
- const { readCodexConfig, writeCodexConfig, backupCodexConfig, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bn; });
507
+ const { backupCodexConfig, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bn; });
508
+ const { updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.bm; });
504
509
  const backupPath = backupCodexConfig();
505
510
  if (backupPath) {
506
511
  console.log(ansis.gray(getBackupMessage(backupPath)));
507
512
  }
508
- const existingConfig = readCodexConfig();
509
- const updatedConfig = {
510
- ...existingConfig,
511
- model: modelProvider,
512
- // Set the model field
513
- modelProvider: existingConfig?.modelProvider || null,
514
- // Preserve existing API provider
515
- providers: existingConfig?.providers || [],
516
- mcpServices: existingConfig?.mcpServices || [],
517
- managed: true,
518
- otherConfig: existingConfig?.otherConfig || [],
519
- modelProviderCommented: existingConfig?.modelProviderCommented
520
- };
521
- writeCodexConfig(updatedConfig);
513
+ updateCodexApiFields({ model: modelProvider });
522
514
  }
523
515
  async function ensureLanguageDirectiveInAgents(aiOutputLang) {
524
- const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.bh; });
516
+ const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.bg; });
525
517
  const { homedir } = await import('node:os');
526
518
  const { join } = await import('pathe');
527
519
  const CODEX_AGENTS_FILE = join(homedir(), ".codex", "AGENTS.md");
@@ -556,7 +548,7 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
556
548
  }
557
549
  }
558
550
  async function updateCodexLanguageDirective(aiOutputLang) {
559
- const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.bh; });
551
+ const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.bg; });
560
552
  const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bn; });
561
553
  const { homedir } = await import('node:os');
562
554
  const { join } = await import('pathe');