ccjk 13.5.0 → 13.5.2
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/chunks/auto-updater.mjs +26 -18
- package/dist/chunks/codex.mjs +12 -6
- package/dist/chunks/menu.mjs +14 -2
- package/dist/chunks/package.mjs +1 -1
- package/dist/i18n/locales/en/codex.json +17 -0
- package/dist/i18n/locales/en/menu.json +28 -1
- package/dist/i18n/locales/zh-CN/codex.json +17 -0
- package/dist/i18n/locales/zh-CN/menu.json +28 -1
- package/package.json +1 -1
|
@@ -305,16 +305,8 @@ async function checkAndUpdateTools(skipPrompt = false) {
|
|
|
305
305
|
console.warn(a.yellow(`\u26A0 Duplicate installation check failed: ${errorMessage}`));
|
|
306
306
|
}
|
|
307
307
|
const results = [];
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
await checkCcjkVersionAndPrompt(skipPrompt);
|
|
311
|
-
results.push({ tool: "CCJK", success: true });
|
|
312
|
-
} catch (error) {
|
|
313
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
314
|
-
console.error(a.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "CCJK" })}: ${errorMessage}`));
|
|
315
|
-
results.push({ tool: "CCJK", success: false, error: errorMessage });
|
|
316
|
-
}
|
|
317
|
-
console.log();
|
|
308
|
+
let ccjkUpdated = false;
|
|
309
|
+
let ccjkResult = null;
|
|
318
310
|
console.log(a.bold("\u{1F500} CCR"));
|
|
319
311
|
try {
|
|
320
312
|
const success = await updateCcr(false, skipPrompt);
|
|
@@ -342,13 +334,24 @@ async function checkAndUpdateTools(skipPrompt = false) {
|
|
|
342
334
|
console.error(a.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "CCometixLine" })}: ${errorMessage}`));
|
|
343
335
|
results.push({ tool: "CCometixLine", success: false, error: errorMessage });
|
|
344
336
|
}
|
|
337
|
+
console.log();
|
|
338
|
+
console.log(a.bold("\u{1F4E6} CCJK"));
|
|
339
|
+
try {
|
|
340
|
+
const result = await checkCcjkVersionAndPrompt(skipPrompt);
|
|
341
|
+
ccjkUpdated = result.updated;
|
|
342
|
+
ccjkResult = {
|
|
343
|
+
tool: "CCJK",
|
|
344
|
+
success: result.success,
|
|
345
|
+
error: result.error
|
|
346
|
+
};
|
|
347
|
+
} catch (error) {
|
|
348
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
349
|
+
console.error(a.red(`\u274C ${format(i18n.t("updater:updateFailed"), { tool: "CCJK" })}: ${errorMessage}`));
|
|
350
|
+
ccjkResult = { tool: "CCJK", success: false, error: errorMessage };
|
|
351
|
+
}
|
|
345
352
|
console.log(a.bold.cyan(`
|
|
346
353
|
\u{1F4CB} ${i18n.t("updater:updateSummary")}`));
|
|
347
|
-
|
|
348
|
-
for (const result of results) {
|
|
349
|
-
if (result.tool === "CCJK" && result.success) {
|
|
350
|
-
ccjkUpdated = true;
|
|
351
|
-
}
|
|
354
|
+
for (const result of ccjkResult ? [ccjkResult, ...results] : results) {
|
|
352
355
|
if (result.success) {
|
|
353
356
|
console.log(a.green(`\u2714 ${result.tool}: ${i18n.t("updater:success")}`));
|
|
354
357
|
} else {
|
|
@@ -375,7 +378,7 @@ async function checkCcjkVersionAndPrompt(skipPrompt) {
|
|
|
375
378
|
console.log(a.cyan(`${i18n.t("updater:latestVersion")} v${latestVersion}`));
|
|
376
379
|
if (currentVersion === latestVersion) {
|
|
377
380
|
console.log(a.green(`\u2713 ${i18n.t("updater:alreadyLatest")}`));
|
|
378
|
-
return;
|
|
381
|
+
return { success: true, updated: false };
|
|
379
382
|
}
|
|
380
383
|
console.log(a.green(`\u2714 ${i18n.t("updater:updatePrompt")} Yes`));
|
|
381
384
|
console.log(a.dim("Clearing npx cache..."));
|
|
@@ -388,13 +391,18 @@ async function checkCcjkVersionAndPrompt(skipPrompt) {
|
|
|
388
391
|
try {
|
|
389
392
|
await execWithSudoIfNeeded("npm", ["install", "-g", "ccjk@latest", "--force"]);
|
|
390
393
|
updateSpinner.succeed(a.green(`\u2713 CCJK updated to v${latestVersion}`));
|
|
394
|
+
return { success: true, updated: true };
|
|
391
395
|
} catch (error) {
|
|
396
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
392
397
|
updateSpinner.fail(a.red("\u2717 CCJK update failed"));
|
|
393
|
-
console.error(a.red(
|
|
398
|
+
console.error(a.red(errorMessage));
|
|
394
399
|
console.log(a.gray("\nTry manually: npm install -g ccjk@latest"));
|
|
400
|
+
return { success: false, updated: false, error: errorMessage };
|
|
395
401
|
}
|
|
396
402
|
} catch (error) {
|
|
397
|
-
|
|
403
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
404
|
+
console.error(a.red(`${i18n.t("updater:checkFailed")} ${errorMessage}`));
|
|
405
|
+
return { success: false, updated: false, error: errorMessage };
|
|
398
406
|
}
|
|
399
407
|
}
|
|
400
408
|
|
package/dist/chunks/codex.mjs
CHANGED
|
@@ -7,11 +7,11 @@ import ora from './index7.mjs';
|
|
|
7
7
|
import { a as semver } from '../shared/ccjk.CxpGa6MC.mjs';
|
|
8
8
|
import { p as parse } from '../shared/ccjk.BBtCGd_g.mjs';
|
|
9
9
|
import { x as K } from './main.mjs';
|
|
10
|
-
import { CODEX_AUTH_FILE, SUPPORTED_LANGS, CODEX_DIR, CODEX_AGENTS_FILE, CODEX_PROMPTS_DIR,
|
|
10
|
+
import { CODEX_AUTH_FILE, SUPPORTED_LANGS, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_AGENTS_FILE, CODEX_PROMPTS_DIR, AI_OUTPUT_LANGUAGES, ZCF_CONFIG_FILE } from './constants.mjs';
|
|
11
11
|
import { ensureI18nInitialized, i18n, format } from './index5.mjs';
|
|
12
12
|
import { updateZcfConfig, readZcfConfig, readDefaultTomlConfig, updateTomlConfig } from './ccjk-config.mjs';
|
|
13
13
|
import { e as applyAiLanguageDirective } from './config2.mjs';
|
|
14
|
-
import { exists, readFile, ensureDir, writeFileAtomic, writeFile,
|
|
14
|
+
import { exists, readFile, ensureDir, writeFileAtomic, writeFile, copyDir, copyFile } from './fs-operations.mjs';
|
|
15
15
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
16
16
|
import { i as isWindows, m as getMcpCommand, l as getSystemRoot, w as wrapCommandWithSudo, n as normalizeTomlPath } from './platform.mjs';
|
|
17
17
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
@@ -809,10 +809,13 @@ function writeCodexConfig(data) {
|
|
|
809
809
|
ensureDir(CODEX_DIR);
|
|
810
810
|
writeFileAtomic(CODEX_CONFIG_FILE, renderCodexConfig(data));
|
|
811
811
|
}
|
|
812
|
-
function writeAuthFile(newEntries) {
|
|
812
|
+
function writeAuthFile(newEntries, authMode) {
|
|
813
813
|
ensureDir(CODEX_DIR);
|
|
814
814
|
const existing = readJsonConfig(CODEX_AUTH_FILE, { defaultValue: {} }) || {};
|
|
815
815
|
const merged = { ...existing, ...newEntries };
|
|
816
|
+
if (authMode) {
|
|
817
|
+
merged.auth_mode = authMode;
|
|
818
|
+
}
|
|
816
819
|
writeJsonConfig(CODEX_AUTH_FILE, merged, { pretty: true });
|
|
817
820
|
}
|
|
818
821
|
async function isCodexInstalled() {
|
|
@@ -1177,7 +1180,7 @@ async function applyCustomApiConfig(customApiConfig) {
|
|
|
1177
1180
|
otherConfig: existingConfig?.otherConfig || []
|
|
1178
1181
|
};
|
|
1179
1182
|
writeCodexConfig(configData);
|
|
1180
|
-
writeJsonConfig(CODEX_AUTH_FILE, authEntries);
|
|
1183
|
+
writeJsonConfig(CODEX_AUTH_FILE, { ...authEntries, auth_mode: "apikey" });
|
|
1181
1184
|
updateZcfConfig({ codeToolType: "codex" });
|
|
1182
1185
|
console.log(a.green(`\u2714 ${i18n.t("codex:apiConfigured")}`));
|
|
1183
1186
|
}
|
|
@@ -1385,7 +1388,8 @@ async function configureCodexApi(options) {
|
|
|
1385
1388
|
baseUrl: selectedProvider2 === "custom" ? answers.baseUrl : prefilledBaseUrl,
|
|
1386
1389
|
wireApi: selectedProvider2 === "custom" ? answers.wireApi || "responses" : prefilledWireApi,
|
|
1387
1390
|
tempEnvKey,
|
|
1388
|
-
requiresOpenaiAuth:
|
|
1391
|
+
requiresOpenaiAuth: false,
|
|
1392
|
+
// Custom/third-party providers use their own API key, not OpenAI OAuth
|
|
1389
1393
|
model: customModel || prefilledModel || "gpt-5-codex"
|
|
1390
1394
|
// Use custom model, provider's default model, or fallback
|
|
1391
1395
|
};
|
|
@@ -1423,7 +1427,7 @@ async function configureCodexApi(options) {
|
|
|
1423
1427
|
mcpServices: existingConfig?.mcpServices || [],
|
|
1424
1428
|
otherConfig: existingConfig?.otherConfig || []
|
|
1425
1429
|
});
|
|
1426
|
-
writeAuthFile(authEntries);
|
|
1430
|
+
writeAuthFile(authEntries, "apikey");
|
|
1427
1431
|
updateZcfConfig({ codeToolType: "codex" });
|
|
1428
1432
|
console.log(a.green(i18n.t("codex:apiConfigured")));
|
|
1429
1433
|
}
|
|
@@ -1654,6 +1658,7 @@ async function switchToOfficialLogin() {
|
|
|
1654
1658
|
writeCodexConfig(updatedConfig);
|
|
1655
1659
|
const auth = readJsonConfig(CODEX_AUTH_FILE, { defaultValue: {} }) || {};
|
|
1656
1660
|
auth.OPENAI_API_KEY = null;
|
|
1661
|
+
auth.auth_mode = "chatgpt";
|
|
1657
1662
|
writeJsonConfig(CODEX_AUTH_FILE, auth, { pretty: true });
|
|
1658
1663
|
console.log(a.green(i18n.t("codex:officialConfigured")));
|
|
1659
1664
|
return true;
|
|
@@ -1699,6 +1704,7 @@ async function switchToProvider(providerId) {
|
|
|
1699
1704
|
const auth = readJsonConfig(CODEX_AUTH_FILE, { defaultValue: {} }) || {};
|
|
1700
1705
|
const envValue = auth[provider.tempEnvKey] || null;
|
|
1701
1706
|
auth.OPENAI_API_KEY = envValue;
|
|
1707
|
+
auth.auth_mode = "apikey";
|
|
1702
1708
|
writeJsonConfig(CODEX_AUTH_FILE, auth, { pretty: true });
|
|
1703
1709
|
console.log(a.green(i18n.t("codex:providerSwitchSuccess", { provider: providerId })));
|
|
1704
1710
|
return true;
|
package/dist/chunks/menu.mjs
CHANGED
|
@@ -417,7 +417,13 @@ async function handleHierarchicalMenu() {
|
|
|
417
417
|
break;
|
|
418
418
|
}
|
|
419
419
|
case "5": {
|
|
420
|
-
|
|
420
|
+
const currentCodeTool = getCurrentCodeTool();
|
|
421
|
+
if (currentCodeTool === "codex") {
|
|
422
|
+
const { configureCodexApi } = await import('./codex.mjs').then(function (n) { return n.i; });
|
|
423
|
+
await configureCodexApi();
|
|
424
|
+
} else {
|
|
425
|
+
await configureApiFeature();
|
|
426
|
+
}
|
|
421
427
|
break;
|
|
422
428
|
}
|
|
423
429
|
case "6": {
|
|
@@ -515,7 +521,13 @@ async function showSimplifiedMenu() {
|
|
|
515
521
|
break;
|
|
516
522
|
}
|
|
517
523
|
case "3": {
|
|
518
|
-
|
|
524
|
+
const currentCodeTool = getCurrentCodeTool();
|
|
525
|
+
if (currentCodeTool === "codex") {
|
|
526
|
+
const { configureCodexApi } = await import('./codex.mjs').then(function (n) { return n.i; });
|
|
527
|
+
await configureCodexApi();
|
|
528
|
+
} else {
|
|
529
|
+
await configureApiFeature();
|
|
530
|
+
}
|
|
519
531
|
break;
|
|
520
532
|
}
|
|
521
533
|
case "4": {
|
package/dist/chunks/package.mjs
CHANGED
|
@@ -121,6 +121,23 @@
|
|
|
121
121
|
"providerManager.wireApiInvalid": "Wire API must be either \"responses\" or \"chat\"",
|
|
122
122
|
"providerManager.unknownError": "Unknown error",
|
|
123
123
|
"envKeyMigrationComplete": "✔ env_key to temp_env_key migration completed",
|
|
124
|
+
"presetPrompt": "Select a Codex preset bundle",
|
|
125
|
+
"presetApplied": "✔ Codex preset applied: {{preset}}",
|
|
126
|
+
"presetSummary": "Workflows {{workflows}} · MCP {{services}}",
|
|
127
|
+
"presets": {
|
|
128
|
+
"minimal": {
|
|
129
|
+
"name": "Minimal",
|
|
130
|
+
"description": "Lean workflow bundle with search and docs MCP"
|
|
131
|
+
},
|
|
132
|
+
"dev": {
|
|
133
|
+
"name": "Dev",
|
|
134
|
+
"description": "Balanced workflow bundle with search, docs, and repo context"
|
|
135
|
+
},
|
|
136
|
+
"full": {
|
|
137
|
+
"name": "Full",
|
|
138
|
+
"description": "Expanded workflow bundle with deeper repo assistance"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
124
141
|
"errorSwitchingProvider": "Error switching provider: {{error}}",
|
|
125
142
|
"errorSwitchingToOfficialLogin": "Error switching to official login: {{error}}",
|
|
126
143
|
"errorDuringUninstall": "Error during uninstall: {{error}}"
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"changeLanguage": "Change Language / 切换语言",
|
|
44
44
|
"switchCodeTool": "Switch Code Tool",
|
|
45
45
|
"uninstall": "Uninstall CCJK",
|
|
46
|
+
"codexImportWorkflow": "Import Workflows",
|
|
47
|
+
"codexPreset": "Preset Bundle",
|
|
46
48
|
"mcpMarket": "MCP Market",
|
|
47
49
|
"marketplace": "Marketplace",
|
|
48
50
|
"hooksSync": "Hooks Sync",
|
|
@@ -56,6 +58,8 @@
|
|
|
56
58
|
"changeLanguage": "Switch interface language",
|
|
57
59
|
"switchCodeTool": "Switch between different code tools",
|
|
58
60
|
"uninstall": "Uninstall CCJK and related configurations",
|
|
61
|
+
"codexImportWorkflow": "Install Codex prompt workflows and AGENTS templates",
|
|
62
|
+
"codexPreset": "Apply a ready-made Codex capability bundle for workflows and MCP services",
|
|
59
63
|
"mcpMarket": "Browse and install MCP services",
|
|
60
64
|
"marketplace": "Browse and install extension packages",
|
|
61
65
|
"hooksSync": "Sync Git Hooks configuration",
|
|
@@ -65,6 +69,29 @@
|
|
|
65
69
|
"outputStyles": "Configure output styles",
|
|
66
70
|
"doctor": "Run environment health check"
|
|
67
71
|
},
|
|
72
|
+
"toolMode": {
|
|
73
|
+
"claude": {
|
|
74
|
+
"title": "Claude Workspace",
|
|
75
|
+
"summary": "Full CCJK surface with diagnostics, cloud sync, and extensions.",
|
|
76
|
+
"focus": "Workflows, diagnostics, permissions, and cloud-connected tools.",
|
|
77
|
+
"config": "Primary config: ~/.claude/settings.json",
|
|
78
|
+
"menuTitle": "Claude Control Center"
|
|
79
|
+
},
|
|
80
|
+
"codex": {
|
|
81
|
+
"title": "Codex Workspace",
|
|
82
|
+
"summary": "Lean setup focused on provider wiring, prompts, MCP, and memory.",
|
|
83
|
+
"focus": "API provider, MCP services, default model, and AGENTS-based memory.",
|
|
84
|
+
"config": "Primary config: ~/.codex/config.toml",
|
|
85
|
+
"menuTitle": "Codex Control Center"
|
|
86
|
+
},
|
|
87
|
+
"generic": {
|
|
88
|
+
"title": "Tool Workspace",
|
|
89
|
+
"summary": "CCJK adapts the menu to the active coding tool.",
|
|
90
|
+
"focus": "Core setup, configuration, and tool-specific actions.",
|
|
91
|
+
"config": "Using the active tool configuration profile.",
|
|
92
|
+
"menuTitle": "CCJK Control Center"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
68
95
|
"menu": {
|
|
69
96
|
"title": "CCJK Main Menu",
|
|
70
97
|
"breadcrumb": {
|
|
@@ -194,4 +221,4 @@
|
|
|
194
221
|
"exit": "0. 🚪 Exit"
|
|
195
222
|
},
|
|
196
223
|
"memoryManagement": "M. Memory Management"
|
|
197
|
-
}
|
|
224
|
+
}
|
|
@@ -121,6 +121,23 @@
|
|
|
121
121
|
"providerManager.wireApiInvalid": "Wire API 必须是 \"responses\" 或 \"chat\"",
|
|
122
122
|
"providerManager.unknownError": "未知错误",
|
|
123
123
|
"envKeyMigrationComplete": "✔ 已完成 env_key 到 temp_env_key 的迁移",
|
|
124
|
+
"presetPrompt": "选择一个 Codex 预设套装",
|
|
125
|
+
"presetApplied": "✔ 已应用 Codex 预设:{{preset}}",
|
|
126
|
+
"presetSummary": "工作流 {{workflows}} · MCP {{services}}",
|
|
127
|
+
"presets": {
|
|
128
|
+
"minimal": {
|
|
129
|
+
"name": "Minimal",
|
|
130
|
+
"description": "轻量工作流套装,包含搜索与文档 MCP"
|
|
131
|
+
},
|
|
132
|
+
"dev": {
|
|
133
|
+
"name": "Dev",
|
|
134
|
+
"description": "均衡开发工作流套装,包含搜索、文档与仓库上下文能力"
|
|
135
|
+
},
|
|
136
|
+
"full": {
|
|
137
|
+
"name": "Full",
|
|
138
|
+
"description": "增强型工作流套装,提供更完整的仓库辅助能力"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
124
141
|
"errorSwitchingProvider": "切换提供商时出错:{{error}}",
|
|
125
142
|
"errorSwitchingToOfficialLogin": "切换到官方登录时出错:{{error}}",
|
|
126
143
|
"errorDuringUninstall": "卸载过程中出错:{{error}}"
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"changeLanguage": "切换语言 / Change Language",
|
|
44
44
|
"switchCodeTool": "切换代码工具",
|
|
45
45
|
"uninstall": "卸载 CCJK",
|
|
46
|
+
"codexImportWorkflow": "导入工作流",
|
|
47
|
+
"codexPreset": "预设套装",
|
|
46
48
|
"mcpMarket": "MCP 市场",
|
|
47
49
|
"marketplace": "扩展市场",
|
|
48
50
|
"hooksSync": "Hooks 同步",
|
|
@@ -56,6 +58,8 @@
|
|
|
56
58
|
"changeLanguage": "切换界面语言",
|
|
57
59
|
"switchCodeTool": "在不同代码工具之间切换",
|
|
58
60
|
"uninstall": "卸载 CCJK 及相关配置",
|
|
61
|
+
"codexImportWorkflow": "安装 Codex Prompt 工作流与 AGENTS 模板",
|
|
62
|
+
"codexPreset": "一键套用 Codex 能力套装,仅增强工作流与 MCP 服务",
|
|
59
63
|
"mcpMarket": "浏览和安装 MCP 服务",
|
|
60
64
|
"marketplace": "浏览和安装扩展包",
|
|
61
65
|
"hooksSync": "同步 Git Hooks 配置",
|
|
@@ -65,6 +69,29 @@
|
|
|
65
69
|
"outputStyles": "配置输出样式",
|
|
66
70
|
"doctor": "运行环境健康检查"
|
|
67
71
|
},
|
|
72
|
+
"toolMode": {
|
|
73
|
+
"claude": {
|
|
74
|
+
"title": "Claude 工作台",
|
|
75
|
+
"summary": "完整 CCJK 界面,包含诊断、云功能与扩展能力。",
|
|
76
|
+
"focus": "工作流、诊断、权限配置与云端集成功能。",
|
|
77
|
+
"config": "主配置文件:~/.claude/settings.json",
|
|
78
|
+
"menuTitle": "Claude 控制中心"
|
|
79
|
+
},
|
|
80
|
+
"codex": {
|
|
81
|
+
"title": "Codex 工作台",
|
|
82
|
+
"summary": "精简界面,聚焦 Provider 接线、Prompts、MCP 与记忆配置。",
|
|
83
|
+
"focus": "API Provider、MCP 服务、默认模型与 AGENTS 记忆。",
|
|
84
|
+
"config": "主配置文件:~/.codex/config.toml",
|
|
85
|
+
"menuTitle": "Codex 控制中心"
|
|
86
|
+
},
|
|
87
|
+
"generic": {
|
|
88
|
+
"title": "工具工作台",
|
|
89
|
+
"summary": "CCJK 会根据当前代码工具自动调整菜单界面。",
|
|
90
|
+
"focus": "核心初始化、配置管理与工具专属操作。",
|
|
91
|
+
"config": "使用当前激活工具的配置档案。",
|
|
92
|
+
"menuTitle": "CCJK 控制中心"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
68
95
|
"menu": {
|
|
69
96
|
"title": "CCJK 主菜单",
|
|
70
97
|
"breadcrumb": {
|
|
@@ -194,4 +221,4 @@
|
|
|
194
221
|
"exit": "0. 🚪 退出"
|
|
195
222
|
},
|
|
196
223
|
"memoryManagement": "M. Memory 管理"
|
|
197
|
-
}
|
|
224
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccjk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.5.
|
|
4
|
+
"version": "13.5.2",
|
|
5
5
|
"packageManager": "pnpm@10.17.1",
|
|
6
6
|
"description": "Turn Claude Code into a production-ready AI dev environment with one-command setup, persistent memory, MCP automation, cloud sync, and zero-config browser workflows.",
|
|
7
7
|
"author": {
|