ccjk 12.0.13 → 12.1.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.
@@ -0,0 +1,152 @@
1
+ import a from './index2.mjs';
2
+ import { i as inquirer } from './index3.mjs';
3
+ import { i18n } from './index5.mjs';
4
+ import { n as normalizeMenuInput } from './menu.mjs';
5
+ import '../shared/ccjk.BAGoDD49.mjs';
6
+ import 'node:readline';
7
+ import 'stream';
8
+ import 'node:tty';
9
+ import 'node:process';
10
+ import 'node:async_hooks';
11
+ import '../shared/ccjk.Cjgrln_h.mjs';
12
+ import 'node:util';
13
+ import 'tty';
14
+ import 'fs';
15
+ import 'child_process';
16
+ import 'node:path';
17
+ import 'node:os';
18
+ import 'node:crypto';
19
+ import 'buffer';
20
+ import 'string_decoder';
21
+ import 'node:fs';
22
+ import 'node:url';
23
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
24
+ import './codex.mjs';
25
+ import '../shared/ccjk.RyizuzOI.mjs';
26
+ import './index7.mjs';
27
+ import '../shared/ccjk.DeWpAShp.mjs';
28
+ import '../shared/ccjk.CxpGa6MC.mjs';
29
+ import '../shared/ccjk.BBtCGd_g.mjs';
30
+ import './main.mjs';
31
+ import 'module';
32
+ import 'node:child_process';
33
+ import 'node:stream';
34
+ import './constants.mjs';
35
+ import './ccjk-config.mjs';
36
+ import './index6.mjs';
37
+ import './fs-operations.mjs';
38
+ import 'node:fs/promises';
39
+ import './json-config.mjs';
40
+ import './config.mjs';
41
+ import './claude-config.mjs';
42
+ import './platform.mjs';
43
+ import '../shared/ccjk.DXRAZcix.mjs';
44
+ import '../shared/ccjk.BFQ7yr5S.mjs';
45
+ import './prompts.mjs';
46
+ import '../shared/ccjk.gDEDGD_t.mjs';
47
+ import '../shared/ccjk.BWFpnOr3.mjs';
48
+ import './banner.mjs';
49
+ import '../shared/ccjk.Cjj8SVrn.mjs';
50
+ import './smart-defaults.mjs';
51
+ import '../shared/ccjk.BrPUmTqm.mjs';
52
+ import '../shared/ccjk.BIxuVL3_.mjs';
53
+ import './features.mjs';
54
+ import './config2.mjs';
55
+ import './init.mjs';
56
+ import '../shared/ccjk.Dx-O9dWz.mjs';
57
+ import './auto-updater.mjs';
58
+ import './version-checker.mjs';
59
+ import './installer.mjs';
60
+ import '../shared/ccjk._dESH4Rk.mjs';
61
+ import './simple-config.mjs';
62
+ import './commands.mjs';
63
+ import './ccjk-agents.mjs';
64
+ import '../shared/ccjk.UIvifqNE.mjs';
65
+ import '../shared/ccjk.DS7UESmF.mjs';
66
+ import './index8.mjs';
67
+ import 'tinyglobby';
68
+ import '../shared/ccjk.CfKKcvWy.mjs';
69
+ import '../shared/ccjk.C2jHOZVP.mjs';
70
+ import './ccjk-skills.mjs';
71
+ import '../shared/ccjk.DsYaCCx4.mjs';
72
+ import './check-updates.mjs';
73
+ import './doctor.mjs';
74
+ import './api-providers.mjs';
75
+ import '../shared/ccjk.SPoXMvZD.mjs';
76
+ import '../shared/ccjk.J8YiPsOw.mjs';
77
+ import './uninstall.mjs';
78
+ import '../shared/ccjk.CvChMYvB.mjs';
79
+ import 'globby';
80
+ import './update.mjs';
81
+ import '../shared/ccjk.waa2ikKJ.mjs';
82
+
83
+ function renderMenuHeader(context, isZh) {
84
+ const title = context.breadcrumb.join(i18n.t("menu:menu.breadcrumb.separator"));
85
+ const width = 63;
86
+ const padding = Math.max(0, Math.floor((width - title.length) / 2));
87
+ console.log("");
88
+ console.log(a.green("\u2554" + "\u2550".repeat(width) + "\u2557"));
89
+ console.log(a.green("\u2551") + " ".repeat(padding) + a.bold(title) + " ".repeat(width - padding - title.length) + a.green("\u2551"));
90
+ console.log(a.green("\u255A" + "\u2550".repeat(width) + "\u255D"));
91
+ console.log("");
92
+ }
93
+ function renderSection(title, items) {
94
+ console.log(a.bold(title));
95
+ for (const item of items) {
96
+ console.log(` ${a.green(item.key + ".")} ${item.name} ${a.dim("- " + item.desc)}`);
97
+ }
98
+ console.log("");
99
+ }
100
+ function renderFooter(showBack, isZh) {
101
+ console.log(a.dim("\u2500".repeat(63)));
102
+ const actions = [];
103
+ actions.push(`${a.green("L")}. ${i18n.t("menu:menu.globalActions.language.name")}`);
104
+ actions.push(`${a.green("H")}. ${i18n.t("menu:menu.globalActions.help.name")}`);
105
+ actions.push(`${a.green("Q")}. ${i18n.t("menu:menu.globalActions.quit.name")}`);
106
+ console.log(` ${actions.join(" ")}`);
107
+ console.log("");
108
+ }
109
+ async function showHierarchicalMainMenu() {
110
+ i18n.language === "zh-CN";
111
+ const context = {
112
+ breadcrumb: [i18n.t("menu:menu.breadcrumb.main")]
113
+ };
114
+ renderMenuHeader(context);
115
+ renderSection(
116
+ i18n.t("menu:menu.menuSections.quickStart"),
117
+ [
118
+ { key: "1", name: i18n.t("menu:menu.quickStart.items.quickSetup.name"), desc: i18n.t("menu:menu.quickStart.items.quickSetup.description") },
119
+ { key: "2", name: i18n.t("menu:menu.quickStart.items.doctor.name"), desc: i18n.t("menu:menu.quickStart.items.doctor.description") },
120
+ { key: "3", name: i18n.t("menu:menu.quickStart.items.update.name"), desc: i18n.t("menu:menu.quickStart.items.update.description") },
121
+ { key: "4", name: i18n.t("menu:menu.quickStart.items.importWorkflow.name"), desc: i18n.t("menu:menu.quickStart.items.importWorkflow.description") }
122
+ ]
123
+ );
124
+ renderSection(
125
+ i18n.t("menu:menu.menuSections.configCenter"),
126
+ [
127
+ { key: "5", name: i18n.t("menu:menu.configCenter.api"), desc: i18n.t("menu:menu.configCenter.apiDesc") },
128
+ { key: "6", name: i18n.t("menu:menu.configCenter.mcp"), desc: i18n.t("menu:menu.configCenter.mcpDesc") }
129
+ ]
130
+ );
131
+ renderSection(
132
+ i18n.t("menu:menu.menuSections.extensions"),
133
+ [
134
+ { key: "7", name: i18n.t("menu:menu.extensions.items.skills.name"), desc: i18n.t("menu:menu.extensions.items.skills.description") },
135
+ { key: "8", name: i18n.t("menu:menu.extensions.items.agents.name"), desc: i18n.t("menu:menu.extensions.items.agents.description") }
136
+ ]
137
+ );
138
+ renderFooter();
139
+ const { choice } = await inquirer.prompt({
140
+ type: "input",
141
+ name: "choice",
142
+ message: i18n.t("menu:menu.prompt.main") + " (1-8, L, H, Q):",
143
+ validate: (value) => {
144
+ const normalized = normalizeMenuInput(value);
145
+ const valid = ["1", "2", "3", "4", "5", "6", "7", "8", "l", "h", "q"];
146
+ return valid.includes(normalized) || i18n.t("menu:menu.prompt.invalid");
147
+ }
148
+ });
149
+ return normalizeMenuInput(choice);
150
+ }
151
+
152
+ export { showHierarchicalMainMenu };
@@ -10,7 +10,7 @@ import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
10
10
  import { r as readMcpConfig } from './claude-config.mjs';
11
11
  import { r as resolveCodeType } from '../shared/ccjk.Cjj8SVrn.mjs';
12
12
  import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.BIxuVL3_.mjs';
13
- import { changeScriptLanguageFeature, mcpManagerFeature, configureMergedPermissionsFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureMcpFeature, configureApiFeature } from './features.mjs';
13
+ import { changeScriptLanguageFeature, configureMcpFeature, configureApiFeature, mcpManagerFeature, configureMergedPermissionsFeature, configureAiMemoryFeature, configureDefaultModelFeature } from './features.mjs';
14
14
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
15
15
  import { p as promptBoolean } from '../shared/ccjk.BWFpnOr3.mjs';
16
16
  import { homedir } from 'node:os';
@@ -371,6 +371,77 @@ async function showContextValueSummary(isZh) {
371
371
  } catch {
372
372
  }
373
373
  }
374
+ function isHierarchicalMenuEnabled() {
375
+ return process__default.env.CCJK_HIERARCHICAL_MENU === "1" || process__default.env.CCJK_HIERARCHICAL_MENU === "true";
376
+ }
377
+ async function handleHierarchicalMenu() {
378
+ const { showHierarchicalMainMenu } = await import('./menu-hierarchical.mjs');
379
+ const choice = await showHierarchicalMainMenu();
380
+ const isZh = i18n.language === "zh-CN";
381
+ switch (choice) {
382
+ case "l":
383
+ await changeScriptLanguageFeature();
384
+ return "switch";
385
+ case "h":
386
+ showHelpDocumentation(isZh);
387
+ return void 0;
388
+ case "q":
389
+ console.log(a.green(isZh ? "\u{1F44B} \u611F\u8C22\u4F7F\u7528 CCJK\uFF01\u518D\u89C1\uFF01" : "\u{1F44B} Thanks for using CCJK! Goodbye!"));
390
+ return "exit";
391
+ }
392
+ switch (choice) {
393
+ case "1": {
394
+ await init({ skipBanner: true, codeType: "claude-code" });
395
+ const offerGen = await promptBoolean({
396
+ message: isZh ? "\u662F\u5426\u8FD0\u884C\u667A\u80FD Agent/Skill \u751F\u6210\uFF1F\uFF08\u63A8\u8350\uFF09" : "Run smart agent/skill generation? (recommended)",
397
+ defaultValue: true
398
+ });
399
+ if (offerGen) {
400
+ const { smartGenerateAndInstall } = await import('./index10.mjs');
401
+ await smartGenerateAndInstall();
402
+ }
403
+ break;
404
+ }
405
+ case "2": {
406
+ await doctor({});
407
+ break;
408
+ }
409
+ case "3": {
410
+ await checkUpdates({});
411
+ break;
412
+ }
413
+ case "4": {
414
+ await update({ skipBanner: true });
415
+ break;
416
+ }
417
+ case "5": {
418
+ await configureApiFeature();
419
+ break;
420
+ }
421
+ case "6": {
422
+ await configureMcpFeature();
423
+ break;
424
+ }
425
+ case "7": {
426
+ await ccjkSkills({});
427
+ break;
428
+ }
429
+ case "8": {
430
+ await ccjkAgents({});
431
+ break;
432
+ }
433
+ }
434
+ printSeparator();
435
+ const shouldContinue = await promptBoolean({
436
+ message: i18n.t("common:returnToMenu"),
437
+ defaultValue: true
438
+ });
439
+ if (!shouldContinue) {
440
+ console.log(a.green(isZh ? "\u{1F44B} \u518D\u89C1\uFF01" : "\u{1F44B} Goodbye!"));
441
+ return "exit";
442
+ }
443
+ return void 0;
444
+ }
374
445
  async function showSimplifiedMenu() {
375
446
  const lang = i18n.language;
376
447
  const isZh = lang === "zh-CN";
@@ -639,7 +710,7 @@ async function showMainMenu(options = {}) {
639
710
  while (!exitMenu) {
640
711
  const codeTool = getCurrentCodeTool();
641
712
  displayBannerWithInfo(CODE_TOOL_BANNERS[codeTool] || "CCJK");
642
- const result = await showSimplifiedMenu();
713
+ const result = isHierarchicalMenuEnabled() ? await handleHierarchicalMenu() : await showSimplifiedMenu();
643
714
  if (result === "exit") {
644
715
  exitMenu = true;
645
716
  } else if (result === "switch") {
@@ -660,4 +731,4 @@ const menu = {
660
731
  showMainMenu: showMainMenu
661
732
  };
662
733
 
663
- export { showMainMenu as a, menu as m, showCcrMenu as s };
734
+ export { showMainMenu as a, menu as m, normalizeMenuInput as n, showCcrMenu as s };
@@ -1,3 +1,3 @@
1
- const version = "12.0.12";
1
+ const version = "12.1.0";
2
2
 
3
3
  export { version };
@@ -67,13 +67,25 @@
67
67
  },
68
68
  "menu": {
69
69
  "title": "CCJK Main Menu",
70
+ "breadcrumb": {
71
+ "main": "Main Menu",
72
+ "separator": " > "
73
+ },
74
+ "navigation": {
75
+ "back": "← Back to Main Menu",
76
+ "backShort": "Back",
77
+ "quit": "Quit"
78
+ },
79
+ "prompt": {
80
+ "main": "Enter your choice",
81
+ "invalid": "Invalid option, please try again",
82
+ "outOfRange": "Option out of range"
83
+ },
70
84
  "menuSections": {
71
- "quickStart": "🚀 Core Features",
72
- "configCenter": "⚙️ Configuration Center",
85
+ "quickStart": "🚀 Quick Start",
86
+ "configCenter": "⚙️ Config Center",
73
87
  "extensions": "🔌 Extensions",
74
- "smartFeatures": " Smart Features",
75
- "cloudServices": "☁️ Cloud Services",
76
- "systemSettings": "🛠️ System Settings"
88
+ "system": "🛠️ System"
77
89
  },
78
90
  "configCenter": {
79
91
  "api": "API Configuration",
@@ -95,49 +107,90 @@
95
107
  "title": "🚀 Quick Start",
96
108
  "items": {
97
109
  "quickSetup": {
98
- "name": "1. ⚡ Quick Setup",
99
- "description": "Auto-configure everything (API Key required)"
110
+ "name": "⚡ Quick Setup",
111
+ "description": "Auto-configure everything"
100
112
  },
101
113
  "doctor": {
102
- "name": "2. 🔧 Diagnostics",
103
- "description": "Diagnose issues and auto-fix"
114
+ "name": "🔧 Health Check",
115
+ "description": "Diagnose and fix issues"
104
116
  },
105
117
  "update": {
106
- "name": "3. 🔄 Update All",
107
- "description": "Update all components to latest version"
118
+ "name": "🔄 Check Updates",
119
+ "description": "Update all components"
120
+ },
121
+ "importWorkflow": {
122
+ "name": "📦 Import Workflows",
123
+ "description": "Import workflow templates"
108
124
  }
109
125
  }
110
126
  },
111
- "advanced": {
112
- "title": "📦 Advanced",
127
+ "extensions": {
128
+ "title": "🔌 Extensions",
113
129
  "items": {
114
130
  "skills": {
115
- "name": "4. 📚 Skills Manager",
116
- "description": "Install/update/remove workflow skills"
131
+ "name": "📚 Skills Manager",
132
+ "description": "Manage workflow skills"
117
133
  },
118
- "mcp": {
119
- "name": "5. 🔌 MCP Manager",
120
- "description": "Configure Model Context Protocol services"
134
+ "mcpManager": {
135
+ "name": "🔌 MCP Manager",
136
+ "description": "Manage MCP services"
121
137
  },
122
138
  "agents": {
123
- "name": "6. 🤖 Agents Manager",
124
- "description": "Create/manage AI agents"
139
+ "name": "🤖 Agents Manager",
140
+ "description": "Manage AI agents"
141
+ },
142
+ "persistence": {
143
+ "name": "💾 Persistence Manager",
144
+ "description": "Manage context storage"
145
+ },
146
+ "ccr": {
147
+ "name": "🌐 CCR Proxy",
148
+ "description": "Configure CCR router"
149
+ },
150
+ "smartGen": {
151
+ "name": "🎯 Smart Generate",
152
+ "description": "Generate agents/skills"
153
+ },
154
+ "remoteControl": {
155
+ "name": "📱 Remote Control",
156
+ "description": "Web/Telegram control"
125
157
  }
126
158
  }
127
159
  },
128
160
  "system": {
129
- "title": "⚙️ System",
161
+ "title": "🛠️ System",
130
162
  "items": {
131
- "language": {
132
- "name": "7. 🌍 Language",
133
- "description": "Switch interface language"
163
+ "switchTool": {
164
+ "name": "🔄 Switch Code Tool",
165
+ "description": "Switch Claude Code/Codex"
166
+ },
167
+ "uninstall": {
168
+ "name": "🗑️ Uninstall CCJK",
169
+ "description": "Uninstall and cleanup"
134
170
  },
135
- "help": {
136
- "name": "8. Help",
137
- "description": "View user guide"
171
+ "clearCache": {
172
+ "name": "🧹 Clear Cache",
173
+ "description": "Clear temporary files"
138
174
  }
139
175
  }
140
176
  },
177
+ "globalActions": {
178
+ "language": {
179
+ "key": "L",
180
+ "name": "🌍 Language",
181
+ "description": "Switch interface language"
182
+ },
183
+ "help": {
184
+ "key": "H",
185
+ "name": "❓ Help",
186
+ "description": "View user guide"
187
+ },
188
+ "quit": {
189
+ "key": "Q",
190
+ "name": "🚪 Quit",
191
+ "description": "Exit program"
192
+ }
193
+ },
141
194
  "exit": "0. 🚪 Exit"
142
195
  }
143
196
  }
@@ -67,13 +67,25 @@
67
67
  },
68
68
  "menu": {
69
69
  "title": "CCJK 主菜单",
70
+ "breadcrumb": {
71
+ "main": "主菜单",
72
+ "separator": " > "
73
+ },
74
+ "navigation": {
75
+ "back": "← 返回主菜单",
76
+ "backShort": "返回",
77
+ "quit": "退出"
78
+ },
79
+ "prompt": {
80
+ "main": "请输入选项",
81
+ "invalid": "无效选项,请重新输入",
82
+ "outOfRange": "选项超出范围"
83
+ },
70
84
  "menuSections": {
71
- "quickStart": "🚀 核心功能",
85
+ "quickStart": "🚀 快速开始",
72
86
  "configCenter": "⚙️ 配置中心",
73
87
  "extensions": "🔌 扩展工具",
74
- "smartFeatures": " 智能功能",
75
- "cloudServices": "☁️ 云服务",
76
- "systemSettings": "🛠️ 系统设置"
88
+ "system": "🛠️ 系统管理"
77
89
  },
78
90
  "configCenter": {
79
91
  "api": "API 配置",
@@ -95,49 +107,90 @@
95
107
  "title": "🚀 快速开始",
96
108
  "items": {
97
109
  "quickSetup": {
98
- "name": "1. ⚡ 一键配置",
99
- "description": "自动完成所有配置(仅需 API Key)"
110
+ "name": "⚡ 一键配置",
111
+ "description": "自动完成所有配置"
100
112
  },
101
113
  "doctor": {
102
- "name": "2. 🔧 一键体检",
103
- "description": "诊断问题并自动修复"
114
+ "name": "🔧 健康体检",
115
+ "description": "诊断并修复问题"
104
116
  },
105
117
  "update": {
106
- "name": "3. 🔄 一键更新",
107
- "description": "更新所有组件到最新版本"
118
+ "name": "🔄 检查更新",
119
+ "description": "更新所有组件"
120
+ },
121
+ "importWorkflow": {
122
+ "name": "📦 导入工作流",
123
+ "description": "导入工作流模板"
108
124
  }
109
125
  }
110
126
  },
111
- "advanced": {
112
- "title": "📦 高级功能",
127
+ "extensions": {
128
+ "title": "🔌 扩展工具",
113
129
  "items": {
114
130
  "skills": {
115
- "name": "4. 📚 Skills 管理",
116
- "description": "安装/更新/删除工作流技能"
131
+ "name": "📚 Skills 管理",
132
+ "description": "管理工作流技能"
117
133
  },
118
- "mcp": {
119
- "name": "5. 🔌 MCP 管理",
120
- "description": "配置 Model Context Protocol 服务"
134
+ "mcpManager": {
135
+ "name": "🔌 MCP 管理",
136
+ "description": "管理 MCP 服务"
121
137
  },
122
138
  "agents": {
123
- "name": "6. 🤖 Agents 管理",
124
- "description": "创建/管理 AI 智能体"
139
+ "name": "🤖 Agents 管理",
140
+ "description": "管理 AI 智能体"
141
+ },
142
+ "persistence": {
143
+ "name": "💾 持久化管理",
144
+ "description": "管理上下文存储"
145
+ },
146
+ "ccr": {
147
+ "name": "🌐 CCR 代理",
148
+ "description": "配置 CCR 路由"
149
+ },
150
+ "smartGen": {
151
+ "name": "🎯 智能生成",
152
+ "description": "生成 agents/skills"
153
+ },
154
+ "remoteControl": {
155
+ "name": "📱 远程控制",
156
+ "description": "Web/Telegram 控制"
125
157
  }
126
158
  }
127
159
  },
128
160
  "system": {
129
- "title": "⚙️ 系统设置",
161
+ "title": "🛠️ 系统管理",
130
162
  "items": {
131
- "language": {
132
- "name": "7. 🌍 语言设置",
133
- "description": "切换界面语言"
163
+ "switchTool": {
164
+ "name": "🔄 切换代码工具",
165
+ "description": "切换 Claude Code/Codex"
166
+ },
167
+ "uninstall": {
168
+ "name": "🗑️ 卸载 CCJK",
169
+ "description": "卸载及清理配置"
134
170
  },
135
- "help": {
136
- "name": "8. ❓ 帮助文档",
137
- "description": "查看使用指南"
171
+ "clearCache": {
172
+ "name": "🧹 清理缓存",
173
+ "description": "清理临时文件"
138
174
  }
139
175
  }
140
176
  },
177
+ "globalActions": {
178
+ "language": {
179
+ "key": "L",
180
+ "name": "🌍 切换语言",
181
+ "description": "切换界面语言"
182
+ },
183
+ "help": {
184
+ "key": "H",
185
+ "name": "❓ 帮助文档",
186
+ "description": "查看使用指南"
187
+ },
188
+ "quit": {
189
+ "key": "Q",
190
+ "name": "🚪 退出",
191
+ "description": "退出程序"
192
+ }
193
+ },
141
194
  "exit": "0. 🚪 退出"
142
195
  }
143
196
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "12.0.13",
4
+ "version": "12.1.0",
5
5
  "packageManager": "pnpm@10.17.1",
6
6
  "description": "CLI toolkit for Claude Code and Codex setup. Simplifies MCP service installation, API configuration, workflow management, and multi-provider support with guided interactive setup.",
7
7
  "author": {
@@ -88,7 +88,7 @@
88
88
  "typecheck": "tsc --noEmit",
89
89
  "release:verify": "node scripts/release-verify.mjs",
90
90
  "release:verify:full": "node scripts/release-verify.mjs --with-tests",
91
- "prepublishOnly": "node scripts/validate-prepublish.mjs && pnpm contract:check && pnpm build && pnpm test:run",
91
+ "prepublishOnly": "node scripts/validate-prepublish.mjs && pnpm contract:check && pnpm build",
92
92
  "lint": "eslint",
93
93
  "lint:fix": "eslint --fix",
94
94
  "test": "vitest",