ccjk 12.0.7 → 12.0.8

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 (299) hide show
  1. package/package.json +1 -1
  2. package/dist/chunks/agent-teams.mjs +0 -136
  3. package/dist/chunks/agent.mjs +0 -1439
  4. package/dist/chunks/agents.mjs +0 -3778
  5. package/dist/chunks/api-cli.mjs +0 -132
  6. package/dist/chunks/api-providers.mjs +0 -129
  7. package/dist/chunks/api.mjs +0 -112
  8. package/dist/chunks/auto-bootstrap.mjs +0 -358
  9. package/dist/chunks/auto-init.mjs +0 -7584
  10. package/dist/chunks/auto-updater.mjs +0 -410
  11. package/dist/chunks/banner.mjs +0 -188
  12. package/dist/chunks/bash.mjs +0 -187
  13. package/dist/chunks/boost.mjs +0 -397
  14. package/dist/chunks/ccjk-agents.mjs +0 -414
  15. package/dist/chunks/ccjk-all.mjs +0 -1028
  16. package/dist/chunks/ccjk-config.mjs +0 -261
  17. package/dist/chunks/ccjk-hooks.mjs +0 -1074
  18. package/dist/chunks/ccjk-mcp.mjs +0 -761
  19. package/dist/chunks/ccjk-setup.mjs +0 -763
  20. package/dist/chunks/ccjk-skills.mjs +0 -514
  21. package/dist/chunks/ccr.mjs +0 -98
  22. package/dist/chunks/ccu.mjs +0 -40
  23. package/dist/chunks/check-updates.mjs +0 -108
  24. package/dist/chunks/claude-code-config-manager.mjs +0 -750
  25. package/dist/chunks/claude-code-incremental-manager.mjs +0 -623
  26. package/dist/chunks/claude-config.mjs +0 -236
  27. package/dist/chunks/claude-wrapper.mjs +0 -85
  28. package/dist/chunks/cleanup-migration.mjs +0 -20
  29. package/dist/chunks/cli-hook.mjs +0 -2285
  30. package/dist/chunks/cloud-sync.mjs +0 -29
  31. package/dist/chunks/codex-config-switch.mjs +0 -451
  32. package/dist/chunks/codex-provider-manager.mjs +0 -236
  33. package/dist/chunks/codex-uninstaller.mjs +0 -404
  34. package/dist/chunks/codex.mjs +0 -2077
  35. package/dist/chunks/commands.mjs +0 -108
  36. package/dist/chunks/commands2.mjs +0 -413
  37. package/dist/chunks/commit.mjs +0 -138
  38. package/dist/chunks/completion.mjs +0 -515
  39. package/dist/chunks/config-consolidator.mjs +0 -172
  40. package/dist/chunks/config-switch.mjs +0 -317
  41. package/dist/chunks/config.mjs +0 -379
  42. package/dist/chunks/config2.mjs +0 -477
  43. package/dist/chunks/config3.mjs +0 -470
  44. package/dist/chunks/constants.mjs +0 -133
  45. package/dist/chunks/context-loader.mjs +0 -343
  46. package/dist/chunks/context.mjs +0 -372
  47. package/dist/chunks/convoy-manager.mjs +0 -880
  48. package/dist/chunks/dashboard.mjs +0 -476
  49. package/dist/chunks/doctor.mjs +0 -964
  50. package/dist/chunks/evolution.mjs +0 -382
  51. package/dist/chunks/features.mjs +0 -698
  52. package/dist/chunks/fish.mjs +0 -181
  53. package/dist/chunks/fs-operations.mjs +0 -192
  54. package/dist/chunks/health-alerts.mjs +0 -304
  55. package/dist/chunks/health-check.mjs +0 -532
  56. package/dist/chunks/help.mjs +0 -340
  57. package/dist/chunks/hook-installer.mjs +0 -45
  58. package/dist/chunks/index.mjs +0 -24
  59. package/dist/chunks/index10.mjs +0 -1171
  60. package/dist/chunks/index11.mjs +0 -1008
  61. package/dist/chunks/index12.mjs +0 -193
  62. package/dist/chunks/index13.mjs +0 -218
  63. package/dist/chunks/index14.mjs +0 -663
  64. package/dist/chunks/index2.mjs +0 -19
  65. package/dist/chunks/index3.mjs +0 -19092
  66. package/dist/chunks/index4.mjs +0 -8
  67. package/dist/chunks/index5.mjs +0 -7600
  68. package/dist/chunks/index6.mjs +0 -171
  69. package/dist/chunks/index7.mjs +0 -3583
  70. package/dist/chunks/index8.mjs +0 -19
  71. package/dist/chunks/index9.mjs +0 -616
  72. package/dist/chunks/init.mjs +0 -1606
  73. package/dist/chunks/installer.mjs +0 -690
  74. package/dist/chunks/installer2.mjs +0 -179
  75. package/dist/chunks/interview.mjs +0 -2927
  76. package/dist/chunks/json-config.mjs +0 -60
  77. package/dist/chunks/linux.mjs +0 -3863
  78. package/dist/chunks/macos.mjs +0 -69
  79. package/dist/chunks/main.mjs +0 -635
  80. package/dist/chunks/manager.mjs +0 -1048
  81. package/dist/chunks/marketplace.mjs +0 -949
  82. package/dist/chunks/mcp-cli.mjs +0 -204
  83. package/dist/chunks/mcp-performance.mjs +0 -187
  84. package/dist/chunks/mcp.mjs +0 -1231
  85. package/dist/chunks/menu.mjs +0 -652
  86. package/dist/chunks/metrics-display.mjs +0 -153
  87. package/dist/chunks/migrator.mjs +0 -178
  88. package/dist/chunks/monitor.mjs +0 -1856
  89. package/dist/chunks/notification.mjs +0 -1864
  90. package/dist/chunks/onboarding.mjs +0 -385
  91. package/dist/chunks/package.mjs +0 -3
  92. package/dist/chunks/paradigm.mjs +0 -74
  93. package/dist/chunks/permission-manager.mjs +0 -132
  94. package/dist/chunks/permissions.mjs +0 -265
  95. package/dist/chunks/persistence-manager.mjs +0 -794
  96. package/dist/chunks/persistence.mjs +0 -667
  97. package/dist/chunks/platform.mjs +0 -391
  98. package/dist/chunks/plugin.mjs +0 -1936
  99. package/dist/chunks/powershell.mjs +0 -213
  100. package/dist/chunks/prompts.mjs +0 -241
  101. package/dist/chunks/providers.mjs +0 -260
  102. package/dist/chunks/quick-actions.mjs +0 -320
  103. package/dist/chunks/quick-provider.mjs +0 -682
  104. package/dist/chunks/quick-setup.mjs +0 -412
  105. package/dist/chunks/remote.mjs +0 -497
  106. package/dist/chunks/session.mjs +0 -878
  107. package/dist/chunks/sessions.mjs +0 -106
  108. package/dist/chunks/silent-updater.mjs +0 -396
  109. package/dist/chunks/simple-config.mjs +0 -98
  110. package/dist/chunks/skill.mjs +0 -117
  111. package/dist/chunks/skill2.mjs +0 -9003
  112. package/dist/chunks/skills-sync.mjs +0 -6460
  113. package/dist/chunks/skills.mjs +0 -567
  114. package/dist/chunks/slash-commands.mjs +0 -207
  115. package/dist/chunks/smart-defaults.mjs +0 -412
  116. package/dist/chunks/smart-guide.mjs +0 -194
  117. package/dist/chunks/startup.mjs +0 -487
  118. package/dist/chunks/stats.mjs +0 -410
  119. package/dist/chunks/status.mjs +0 -289
  120. package/dist/chunks/team.mjs +0 -63
  121. package/dist/chunks/thinking.mjs +0 -626
  122. package/dist/chunks/trace.mjs +0 -57
  123. package/dist/chunks/uninstall.mjs +0 -849
  124. package/dist/chunks/update.mjs +0 -167
  125. package/dist/chunks/upgrade-manager.mjs +0 -204
  126. package/dist/chunks/version-checker.mjs +0 -881
  127. package/dist/chunks/vim.mjs +0 -903
  128. package/dist/chunks/windows.mjs +0 -14
  129. package/dist/chunks/workflows.mjs +0 -633
  130. package/dist/chunks/wsl.mjs +0 -129
  131. package/dist/chunks/zero-config.mjs +0 -374
  132. package/dist/chunks/zsh.mjs +0 -182
  133. package/dist/cli.d.mts +0 -1
  134. package/dist/cli.d.ts +0 -1
  135. package/dist/cli.mjs +0 -2199
  136. package/dist/i18n/locales/en/agent-teams.json +0 -18
  137. package/dist/i18n/locales/en/agentBrowser.json +0 -79
  138. package/dist/i18n/locales/en/agents.json +0 -135
  139. package/dist/i18n/locales/en/api.json +0 -63
  140. package/dist/i18n/locales/en/ccjk-agents.json +0 -33
  141. package/dist/i18n/locales/en/ccjk-all.json +0 -23
  142. package/dist/i18n/locales/en/ccjk-skills.json +0 -22
  143. package/dist/i18n/locales/en/ccjk.json +0 -276
  144. package/dist/i18n/locales/en/ccr.json +0 -65
  145. package/dist/i18n/locales/en/claude-md.json +0 -73
  146. package/dist/i18n/locales/en/cli.json +0 -152
  147. package/dist/i18n/locales/en/cloud-setup.json +0 -31
  148. package/dist/i18n/locales/en/cloud-sync.json +0 -147
  149. package/dist/i18n/locales/en/cloud.json +0 -40
  150. package/dist/i18n/locales/en/cloudPlugins.json +0 -118
  151. package/dist/i18n/locales/en/codex.json +0 -127
  152. package/dist/i18n/locales/en/cometix.json +0 -29
  153. package/dist/i18n/locales/en/common.json +0 -68
  154. package/dist/i18n/locales/en/config.json +0 -108
  155. package/dist/i18n/locales/en/configuration.json +0 -226
  156. package/dist/i18n/locales/en/context.json +0 -85
  157. package/dist/i18n/locales/en/dashboard.json +0 -78
  158. package/dist/i18n/locales/en/errors.json +0 -26
  159. package/dist/i18n/locales/en/evolution.json +0 -54
  160. package/dist/i18n/locales/en/hooks.json +0 -74
  161. package/dist/i18n/locales/en/hooksSync.json +0 -133
  162. package/dist/i18n/locales/en/installation.json +0 -83
  163. package/dist/i18n/locales/en/interview.json +0 -104
  164. package/dist/i18n/locales/en/language.json +0 -19
  165. package/dist/i18n/locales/en/lsp.json +0 -78
  166. package/dist/i18n/locales/en/marketplace.json +0 -116
  167. package/dist/i18n/locales/en/mcp.json +0 -178
  168. package/dist/i18n/locales/en/memory.json +0 -92
  169. package/dist/i18n/locales/en/menu.json +0 -143
  170. package/dist/i18n/locales/en/multi-config.json +0 -79
  171. package/dist/i18n/locales/en/notification.json +0 -307
  172. package/dist/i18n/locales/en/permissions.json +0 -95
  173. package/dist/i18n/locales/en/persistence.json +0 -127
  174. package/dist/i18n/locales/en/plugins.json +0 -146
  175. package/dist/i18n/locales/en/quick-actions.json +0 -78
  176. package/dist/i18n/locales/en/registry.json +0 -54
  177. package/dist/i18n/locales/en/remote.json +0 -93
  178. package/dist/i18n/locales/en/sandbox.json +0 -44
  179. package/dist/i18n/locales/en/setup.json +0 -44
  180. package/dist/i18n/locales/en/shencha.json +0 -14
  181. package/dist/i18n/locales/en/skills.json +0 -100
  182. package/dist/i18n/locales/en/skillsSync.json +0 -74
  183. package/dist/i18n/locales/en/smartGuide.json +0 -49
  184. package/dist/i18n/locales/en/stats.json +0 -20
  185. package/dist/i18n/locales/en/subagent.json +0 -69
  186. package/dist/i18n/locales/en/superpowers.json +0 -117
  187. package/dist/i18n/locales/en/team.json +0 -7
  188. package/dist/i18n/locales/en/thinking.json +0 -65
  189. package/dist/i18n/locales/en/tools.json +0 -42
  190. package/dist/i18n/locales/en/uninstall.json +0 -56
  191. package/dist/i18n/locales/en/updater.json +0 -29
  192. package/dist/i18n/locales/en/vim.json +0 -169
  193. package/dist/i18n/locales/en/workflow.json +0 -55
  194. package/dist/i18n/locales/en/workspace.json +0 -108
  195. package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
  196. package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -79
  197. package/dist/i18n/locales/zh-CN/agents.json +0 -135
  198. package/dist/i18n/locales/zh-CN/api.json +0 -63
  199. package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
  200. package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
  201. package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
  202. package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
  203. package/dist/i18n/locales/zh-CN/ccr.json +0 -65
  204. package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
  205. package/dist/i18n/locales/zh-CN/cli.json +0 -152
  206. package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
  207. package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
  208. package/dist/i18n/locales/zh-CN/cloud.json +0 -40
  209. package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
  210. package/dist/i18n/locales/zh-CN/codex.json +0 -127
  211. package/dist/i18n/locales/zh-CN/cometix.json +0 -29
  212. package/dist/i18n/locales/zh-CN/common.json +0 -68
  213. package/dist/i18n/locales/zh-CN/config.json +0 -108
  214. package/dist/i18n/locales/zh-CN/configuration.json +0 -224
  215. package/dist/i18n/locales/zh-CN/context.json +0 -85
  216. package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
  217. package/dist/i18n/locales/zh-CN/errors.json +0 -26
  218. package/dist/i18n/locales/zh-CN/evolution.json +0 -54
  219. package/dist/i18n/locales/zh-CN/hooks.json +0 -74
  220. package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
  221. package/dist/i18n/locales/zh-CN/installation.json +0 -83
  222. package/dist/i18n/locales/zh-CN/interview.json +0 -104
  223. package/dist/i18n/locales/zh-CN/language.json +0 -19
  224. package/dist/i18n/locales/zh-CN/lsp.json +0 -78
  225. package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
  226. package/dist/i18n/locales/zh-CN/mcp.json +0 -178
  227. package/dist/i18n/locales/zh-CN/memory.json +0 -92
  228. package/dist/i18n/locales/zh-CN/menu.json +0 -143
  229. package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
  230. package/dist/i18n/locales/zh-CN/notification.json +0 -307
  231. package/dist/i18n/locales/zh-CN/permissions.json +0 -95
  232. package/dist/i18n/locales/zh-CN/persistence.json +0 -127
  233. package/dist/i18n/locales/zh-CN/plugins.json +0 -146
  234. package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
  235. package/dist/i18n/locales/zh-CN/registry.json +0 -54
  236. package/dist/i18n/locales/zh-CN/remote.json +0 -93
  237. package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
  238. package/dist/i18n/locales/zh-CN/setup.json +0 -44
  239. package/dist/i18n/locales/zh-CN/shencha.json +0 -14
  240. package/dist/i18n/locales/zh-CN/skills.json +0 -100
  241. package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
  242. package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
  243. package/dist/i18n/locales/zh-CN/stats.json +0 -20
  244. package/dist/i18n/locales/zh-CN/subagent.json +0 -69
  245. package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
  246. package/dist/i18n/locales/zh-CN/team.json +0 -7
  247. package/dist/i18n/locales/zh-CN/thinking.json +0 -65
  248. package/dist/i18n/locales/zh-CN/tools.json +0 -42
  249. package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
  250. package/dist/i18n/locales/zh-CN/updater.json +0 -29
  251. package/dist/i18n/locales/zh-CN/vim.json +0 -169
  252. package/dist/i18n/locales/zh-CN/workflow.json +0 -55
  253. package/dist/i18n/locales/zh-CN/workspace.json +0 -108
  254. package/dist/index.d.mts +0 -5295
  255. package/dist/index.d.ts +0 -5295
  256. package/dist/index.mjs +0 -4941
  257. package/dist/shared/ccjk.B364Fu0N.mjs +0 -1819
  258. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  259. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  260. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  261. package/dist/shared/ccjk.BFxsJM0k.mjs +0 -599
  262. package/dist/shared/ccjk.BIxuVL3_.mjs +0 -25
  263. package/dist/shared/ccjk.BRZ9ww8S.mjs +0 -142
  264. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  265. package/dist/shared/ccjk.BrPUmTqm.mjs +0 -266
  266. package/dist/shared/ccjk.BtB1e5jm.mjs +0 -171
  267. package/dist/shared/ccjk.BwfbSKN2.mjs +0 -1051
  268. package/dist/shared/ccjk.BxSmJ8B7.mjs +0 -243
  269. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  270. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  271. package/dist/shared/ccjk.CL4Yat0G.mjs +0 -303
  272. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  273. package/dist/shared/ccjk.CePkJq2S.mjs +0 -223
  274. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  275. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  276. package/dist/shared/ccjk.Cjj8SVrn.mjs +0 -54
  277. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  278. package/dist/shared/ccjk.D5MFQT7w.mjs +0 -400
  279. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  280. package/dist/shared/ccjk.D8ZLYSZZ.mjs +0 -299
  281. package/dist/shared/ccjk.DG_o24cZ.mjs +0 -88
  282. package/dist/shared/ccjk.DLLw-h4Y.mjs +0 -460
  283. package/dist/shared/ccjk.DOwtZMk8.mjs +0 -4019
  284. package/dist/shared/ccjk.DS7UESmF.mjs +0 -2451
  285. package/dist/shared/ccjk.DTdjs-qK.mjs +0 -1447
  286. package/dist/shared/ccjk.DXRAZcix.mjs +0 -66
  287. package/dist/shared/ccjk.DsYaCCx4.mjs +0 -317
  288. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  289. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  290. package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
  291. package/dist/shared/ccjk.SPoXMvZD.mjs +0 -1242
  292. package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
  293. package/dist/shared/ccjk.UIvifqNE.mjs +0 -1486
  294. package/dist/shared/ccjk._dESH4Rk.mjs +0 -111
  295. package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
  296. package/dist/shared/ccjk.c-ETfBZ_.mjs +0 -617
  297. package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
  298. package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
  299. package/dist/shared/ccjk.waa2ikKJ.mjs +0 -351
@@ -1,63 +0,0 @@
1
- import { existsSync, mkdirSync, readFileSync } from 'node:fs';
2
- import a from './index2.mjs';
3
- import { i as inquirer } from './index3.mjs';
4
- import { i18n } from './index5.mjs';
5
- import { writeFileAtomic } from './fs-operations.mjs';
6
- import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
7
- import '../shared/ccjk.BAGoDD49.mjs';
8
- import 'node:readline';
9
- import 'stream';
10
- import 'node:tty';
11
- import 'node:process';
12
- import 'node:async_hooks';
13
- import '../shared/ccjk.Cjgrln_h.mjs';
14
- import 'node:util';
15
- import 'tty';
16
- import 'fs';
17
- import 'child_process';
18
- import 'node:path';
19
- import 'node:os';
20
- import 'node:crypto';
21
- import 'buffer';
22
- import 'string_decoder';
23
- import 'node:url';
24
- import 'node:fs/promises';
25
-
26
- const TEAM_DIR = ".ccjk/team";
27
- const CONFIG_FILE = join(TEAM_DIR, "config.json");
28
- async function teamInit() {
29
- if (!existsSync(TEAM_DIR)) {
30
- mkdirSync(TEAM_DIR, { recursive: true });
31
- }
32
- const { name } = await inquirer.prompt({
33
- type: "input",
34
- name: "name",
35
- message: i18n.t("team:enterTeamName"),
36
- default: "my-team"
37
- });
38
- const config = {
39
- name,
40
- members: [],
41
- sharedSettings: {}
42
- };
43
- writeFileAtomic(CONFIG_FILE, JSON.stringify(config, null, 2));
44
- console.log(a.green(`\u2714 ${i18n.t("team:teamInitialized")}: ${name}`));
45
- }
46
- async function teamShare() {
47
- if (!existsSync(CONFIG_FILE)) {
48
- console.log(a.yellow(i18n.t("team:noTeamConfig")));
49
- return;
50
- }
51
- const config = JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
52
- console.log(a.green(i18n.t("team:shareConfig")));
53
- console.log(JSON.stringify(config, null, 2));
54
- }
55
- async function teamSync() {
56
- if (!existsSync(CONFIG_FILE)) {
57
- console.log(a.yellow(i18n.t("team:noTeamConfig")));
58
- return;
59
- }
60
- console.log(a.green(`\u2714 ${i18n.t("team:syncComplete")}`));
61
- }
62
-
63
- export { teamInit, teamShare, teamSync };
@@ -1,626 +0,0 @@
1
- import a from './index2.mjs';
2
- import { i as inquirer } from './index3.mjs';
3
- import { SETTINGS_FILE } from './constants.mjs';
4
- import { i18n } from './index5.mjs';
5
- import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
6
- import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.BIxuVL3_.mjs';
7
- import '../shared/ccjk.BAGoDD49.mjs';
8
- import 'node:readline';
9
- import 'stream';
10
- import 'node:tty';
11
- import 'node:process';
12
- import 'node:async_hooks';
13
- import '../shared/ccjk.Cjgrln_h.mjs';
14
- import 'node:util';
15
- import 'tty';
16
- import 'fs';
17
- import 'child_process';
18
- import 'node:path';
19
- import 'node:os';
20
- import 'node:crypto';
21
- import 'buffer';
22
- import 'string_decoder';
23
- import '../shared/ccjk.bQ7Dh1g4.mjs';
24
- import 'node:fs';
25
- import 'node:url';
26
- import '../shared/ccjk.RyizuzOI.mjs';
27
- import './fs-operations.mjs';
28
- import 'node:fs/promises';
29
-
30
- const DEFAULT_BUDGET_TOKENS = 2e4;
31
- const MIN_BUDGET_TOKENS = 1e3;
32
- const MAX_BUDGET_TOKENS = 2e5;
33
- const THINKING_SUPPORTED_MODELS = [
34
- "claude-3-5-sonnet-20241022",
35
- "claude-3-5-sonnet-20240620",
36
- "claude-3-5-sonnet-20250114",
37
- "claude-3-7-opus-20250219",
38
- // Opus 4.5 - default enabled
39
- "claude-opus-4",
40
- "opus-4"
41
- ];
42
- const DEFAULT_THINKING_CONFIG = {
43
- enabled: true,
44
- budgetTokens: DEFAULT_BUDGET_TOKENS,
45
- inheritForSubAgents: true,
46
- subAgentReduction: 0.5,
47
- // Sub-agents get 50% of parent budget
48
- alwaysUseThinking: false
49
- // Only for complex tasks
50
- };
51
- class ThinkingModeManager {
52
- config;
53
- configPath;
54
- constructor(configPath = SETTINGS_FILE) {
55
- this.configPath = configPath;
56
- this.config = this.loadConfig();
57
- }
58
- /**
59
- * Load thinking mode configuration from settings.json
60
- */
61
- loadConfig() {
62
- const settings = readJsonConfig(this.configPath);
63
- const thinkingConfig = settings?.thinking || {};
64
- return {
65
- enabled: thinkingConfig.enabled ?? DEFAULT_THINKING_CONFIG.enabled,
66
- budgetTokens: thinkingConfig.budgetTokens ?? DEFAULT_THINKING_CONFIG.budgetTokens,
67
- inheritForSubAgents: thinkingConfig.inheritForSubAgents ?? DEFAULT_THINKING_CONFIG.inheritForSubAgents,
68
- subAgentReduction: thinkingConfig.subAgentReduction ?? DEFAULT_THINKING_CONFIG.subAgentReduction,
69
- alwaysUseThinking: thinkingConfig.alwaysUseThinking ?? DEFAULT_THINKING_CONFIG.alwaysUseThinking
70
- };
71
- }
72
- /**
73
- * Save thinking mode configuration to settings.json
74
- */
75
- saveConfig() {
76
- const settings = readJsonConfig(this.configPath) || {};
77
- settings.thinking = this.config;
78
- writeJsonConfig(this.configPath, settings);
79
- }
80
- /**
81
- * Get current thinking mode configuration
82
- */
83
- getConfig() {
84
- return { ...this.config };
85
- }
86
- /**
87
- * Check if thinking mode is enabled
88
- */
89
- isEnabled() {
90
- return this.config.enabled;
91
- }
92
- /**
93
- * Enable or disable thinking mode
94
- */
95
- setEnabled(enabled) {
96
- this.config.enabled = enabled;
97
- this.saveConfig();
98
- }
99
- /**
100
- * Get budget tokens
101
- */
102
- getBudgetTokens() {
103
- return this.config.budgetTokens;
104
- }
105
- /**
106
- * Set budget tokens with validation
107
- */
108
- setBudgetTokens(tokens) {
109
- if (tokens < MIN_BUDGET_TOKENS) {
110
- return {
111
- success: false,
112
- error: `Budget tokens must be at least ${MIN_BUDGET_TOKENS}`
113
- };
114
- }
115
- if (tokens > MAX_BUDGET_TOKENS) {
116
- return {
117
- success: false,
118
- error: `Budget tokens cannot exceed ${MAX_BUDGET_TOKENS}`
119
- };
120
- }
121
- this.config.budgetTokens = tokens;
122
- this.saveConfig();
123
- return { success: true };
124
- }
125
- /**
126
- * Check if sub-agents should inherit thinking mode
127
- */
128
- isInheritForSubAgents() {
129
- return this.config.inheritForSubAgents;
130
- }
131
- /**
132
- * Enable or disable sub-agent inheritance
133
- */
134
- setInheritForSubAgents(inherit) {
135
- this.config.inheritForSubAgents = inherit;
136
- this.saveConfig();
137
- }
138
- /**
139
- * Get sub-agent budget reduction factor
140
- */
141
- getSubAgentReduction() {
142
- return this.config.subAgentReduction;
143
- }
144
- /**
145
- * Set sub-agent budget reduction factor (0.1 - 1.0)
146
- */
147
- setSubAgentReduction(reduction) {
148
- if (reduction < 0.1 || reduction > 1) {
149
- return {
150
- success: false,
151
- error: "Reduction factor must be between 0.1 and 1.0"
152
- };
153
- }
154
- this.config.subAgentReduction = reduction;
155
- this.saveConfig();
156
- return { success: true };
157
- }
158
- /**
159
- * Calculate budget for sub-agent based on reduction factor
160
- */
161
- calculateSubAgentBudget() {
162
- return Math.floor(this.config.budgetTokens * this.config.subAgentReduction);
163
- }
164
- /**
165
- * Check if always using thinking mode (even for simple tasks)
166
- */
167
- isAlwaysUseThinking() {
168
- return this.config.alwaysUseThinking;
169
- }
170
- /**
171
- * Set always use thinking mode
172
- */
173
- setAlwaysUseThinking(always) {
174
- this.config.alwaysUseThinking = always;
175
- this.saveConfig();
176
- }
177
- /**
178
- * Check if thinking mode is supported for the given model
179
- */
180
- isModelSupported(model) {
181
- return THINKING_SUPPORTED_MODELS.some((m) => model.includes(m));
182
- }
183
- /**
184
- * Generate thinking mode flags for Claude Code CLI
185
- */
186
- generateCliFlags() {
187
- if (!this.config.enabled) {
188
- return [];
189
- }
190
- const flags = [];
191
- flags.push(`--thinking-budget-tokens=${this.config.budgetTokens}`);
192
- flags.push("--thinking=true");
193
- return flags;
194
- }
195
- /**
196
- * Get thinking mode status for display
197
- */
198
- getStatus(_enabledOnly = false) {
199
- const isZh = i18n.language === "zh-CN";
200
- return {
201
- enabled: this.config.enabled,
202
- budgetTokens: this.config.budgetTokens,
203
- inheritForSubAgents: this.config.inheritForSubAgents,
204
- subAgentBudget: this.calculateSubAgentBudget(),
205
- alwaysUseThinking: this.config.alwaysUseThinking,
206
- supportedModels: THINKING_SUPPORTED_MODELS,
207
- summary: this.config.enabled ? isZh ? `Thinking Mode \u5DF2\u542F\u7528 (${this.config.budgetTokens} tokens)` : `Thinking Mode enabled (${this.config.budgetTokens} tokens)` : isZh ? "Thinking Mode \u5DF2\u7981\u7528" : "Thinking Mode disabled"
208
- };
209
- }
210
- /**
211
- * Reset to default configuration
212
- */
213
- resetToDefaults() {
214
- this.config = { ...DEFAULT_THINKING_CONFIG };
215
- this.saveConfig();
216
- }
217
- /**
218
- * Merge configuration with existing settings
219
- */
220
- mergeConfig(partial) {
221
- this.config = {
222
- ...this.config,
223
- ...partial
224
- };
225
- this.saveConfig();
226
- }
227
- }
228
- let globalThinkingManager = null;
229
- function getThinkingManager(configPath) {
230
- if (!globalThinkingManager) {
231
- globalThinkingManager = new ThinkingModeManager(configPath);
232
- }
233
- return globalThinkingManager;
234
- }
235
- function shouldUseThinkingMode(taskComplexity, model) {
236
- const manager = getThinkingManager();
237
- if (!manager.isEnabled()) {
238
- return false;
239
- }
240
- if (manager.isAlwaysUseThinking()) {
241
- return true;
242
- }
243
- return taskComplexity === "medium" || taskComplexity === "complex";
244
- }
245
-
246
- async function thinkingStatus(_options = {}) {
247
- const isZh = i18n.language === "zh-CN";
248
- console.log("");
249
- console.log(a.bold.cyan(isZh ? "\u{1F9E0} Thinking Mode Status" : "\u{1F9E0} Thinking Mode Status"));
250
- console.log(a.dim("\u2500".repeat(60)));
251
- const manager = getThinkingManager();
252
- const status = manager.getStatus();
253
- console.log("");
254
- const statusIcon = status.enabled ? a.green("\u25CF") : a.gray("\u25CB");
255
- const statusText = status.enabled ? isZh ? "Enabled" : "Enabled" : isZh ? "Disabled" : "Disabled";
256
- console.log(` ${statusIcon} ${a.bold(isZh ? "Status:" : "Status:")} ${statusText}`);
257
- console.log("");
258
- console.log(` ${a.green("\u{1F4B0}")} ${a.bold(isZh ? "Budget Tokens:" : "Budget Tokens:")} ${a.yellow(status.budgetTokens.toLocaleString())}`);
259
- const inheritIcon = status.inheritForSubAgents ? a.green("\u2713") : a.gray("\u25CB");
260
- console.log(` ${inheritIcon} ${a.bold(isZh ? "Sub-agent Inheritance:" : "Sub-agent Inheritance:")} ${status.inheritForSubAgents ? isZh ? "Enabled" : "Enabled" : isZh ? "Disabled" : "Disabled"}`);
261
- if (status.inheritForSubAgents) {
262
- console.log(` ${a.dim(isZh ? `\u2192 Sub-agents get ${status.subAgentBudget.toLocaleString()} tokens` : `\u2192 Sub-agents get ${status.subAgentBudget.toLocaleString()} tokens`)}`);
263
- }
264
- const alwaysIcon = status.alwaysUseThinking ? a.green("\u2713") : a.gray("\u25CB");
265
- console.log(` ${alwaysIcon} ${a.bold(isZh ? "Always Use Thinking:" : "Always Use Thinking:")} ${status.alwaysUseThinking ? isZh ? "Yes" : "Yes" : isZh ? "No (medium/complex only)" : "No (medium/complex only)"}`);
266
- console.log("");
267
- console.log(a.green(isZh ? "\u{1F4CB} Supported Models:" : "\u{1F4CB} Supported Models:"));
268
- for (const model of status.supportedModels) {
269
- console.log(` ${a.dim("\u2022")} ${model}`);
270
- }
271
- console.log("");
272
- console.log(a.dim(isZh ? '\u{1F4A1} Tip: Use "ccjk thinking enable/disable" to toggle thinking mode' : '\u{1F4A1} Tip: Use "ccjk thinking enable/disable" to toggle thinking mode'));
273
- console.log("");
274
- }
275
- async function thinkingEnable(_options = {}) {
276
- const isZh = i18n.language === "zh-CN";
277
- const manager = getThinkingManager();
278
- if (manager.isEnabled()) {
279
- console.log("");
280
- console.log(a.yellow(isZh ? "\u26A0\uFE0F Thinking Mode is already enabled" : "\u26A0\uFE0F Thinking Mode is already enabled"));
281
- console.log("");
282
- return;
283
- }
284
- manager.setEnabled(true);
285
- console.log("");
286
- console.log(a.green(isZh ? "\u2705 Thinking Mode enabled" : "\u2705 Thinking Mode enabled"));
287
- console.log(a.dim(isZh ? `Budget: ${manager.getBudgetTokens().toLocaleString()} tokens` : `Budget: ${manager.getBudgetTokens().toLocaleString()} tokens`));
288
- console.log("");
289
- }
290
- async function thinkingDisable(_options = {}) {
291
- const isZh = i18n.language === "zh-CN";
292
- const manager = getThinkingManager();
293
- if (!manager.isEnabled()) {
294
- console.log("");
295
- console.log(a.yellow(isZh ? "\u26A0\uFE0F Thinking Mode is already disabled" : "\u26A0\uFE0F Thinking Mode is already disabled"));
296
- console.log("");
297
- return;
298
- }
299
- manager.setEnabled(false);
300
- console.log("");
301
- console.log(a.green(isZh ? "\u2705 Thinking Mode disabled" : "\u2705 Thinking Mode disabled"));
302
- console.log("");
303
- }
304
- async function thinkingToggle(_options = {}) {
305
- const isZh = i18n.language === "zh-CN";
306
- const manager = getThinkingManager();
307
- const newState = !manager.isEnabled();
308
- manager.setEnabled(newState);
309
- console.log("");
310
- console.log(a.green(newState ? isZh ? "\u2705 Thinking Mode enabled" : "\u2705 Thinking Mode enabled" : isZh ? "\u2705 Thinking Mode disabled" : "\u2705 Thinking Mode disabled"));
311
- console.log("");
312
- }
313
- async function thinkingBudget(tokens, _options = {}) {
314
- const isZh = i18n.language === "zh-CN";
315
- const tokenValue = Number.parseInt(tokens, 10);
316
- if (Number.isNaN(tokenValue)) {
317
- console.log("");
318
- console.log(a.red(isZh ? "\u274C Invalid token value" : "\u274C Invalid token value"));
319
- console.log(a.dim(isZh ? `Budget must be a number between ${MIN_BUDGET_TOKENS} and ${MAX_BUDGET_TOKENS}` : `Budget must be a number between ${MIN_BUDGET_TOKENS} and ${MAX_BUDGET_TOKENS}`));
320
- console.log("");
321
- return;
322
- }
323
- const manager = getThinkingManager();
324
- const result = manager.setBudgetTokens(tokenValue);
325
- if (!result.success) {
326
- console.log("");
327
- console.log(a.red(isZh ? "\u274C Failed to set budget" : "\u274C Failed to set budget"));
328
- console.log(a.dim(result.error));
329
- console.log("");
330
- return;
331
- }
332
- console.log("");
333
- console.log(a.green(isZh ? "\u2705 Budget tokens updated" : "\u2705 Budget tokens updated"));
334
- console.log(a.dim(isZh ? `New budget: ${tokenValue.toLocaleString()} tokens` : `New budget: ${tokenValue.toLocaleString()} tokens`));
335
- if (manager.isInheritForSubAgents()) {
336
- console.log(a.dim(isZh ? `Sub-agent budget: ${manager.calculateSubAgentBudget().toLocaleString()} tokens` : `Sub-agent budget: ${manager.calculateSubAgentBudget().toLocaleString()} tokens`));
337
- }
338
- console.log("");
339
- }
340
- async function thinkingInheritance(enabled, _options = {}) {
341
- const isZh = i18n.language === "zh-CN";
342
- const manager = getThinkingManager();
343
- manager.setInheritForSubAgents(enabled);
344
- console.log("");
345
- console.log(a.green(enabled ? isZh ? "\u2705 Sub-agent inheritance enabled" : "\u2705 Sub-agent inheritance enabled" : isZh ? "\u2705 Sub-agent inheritance disabled" : "\u2705 Sub-agent inheritance disabled"));
346
- if (enabled) {
347
- console.log(a.dim(isZh ? `Sub-agents will receive ${manager.calculateSubAgentBudget().toLocaleString()} tokens` : `Sub-agents will receive ${manager.calculateSubAgentBudget().toLocaleString()} tokens`));
348
- }
349
- console.log("");
350
- }
351
- async function thinkingReset(_options = {}) {
352
- const isZh = i18n.language === "zh-CN";
353
- const { confirm } = await inquirer.prompt({
354
- type: "confirm",
355
- name: "confirm",
356
- message: isZh ? "Reset thinking mode to default settings?" : "Reset thinking mode to default settings?",
357
- default: false
358
- });
359
- if (!confirm) {
360
- console.log("");
361
- console.log(a.yellow(isZh ? "Cancelled" : "Cancelled"));
362
- console.log("");
363
- return;
364
- }
365
- const manager = getThinkingManager();
366
- manager.resetToDefaults();
367
- console.log("");
368
- console.log(a.green(isZh ? "\u2705 Thinking mode reset to defaults" : "\u2705 Thinking mode reset to defaults"));
369
- console.log(a.dim(isZh ? `Enabled: ${manager.isEnabled()}` : `Enabled: ${manager.isEnabled()}`));
370
- console.log(a.dim(isZh ? `Budget: ${manager.getBudgetTokens().toLocaleString()} tokens` : `Budget: ${manager.getBudgetTokens().toLocaleString()} tokens`));
371
- console.log("");
372
- }
373
- async function thinkingConfig(options = {}) {
374
- const isZh = i18n.language === "zh-CN";
375
- const manager = getThinkingManager();
376
- const currentConfig = manager.getConfig();
377
- console.log("");
378
- console.log(a.bold.cyan(isZh ? "\u{1F9E0} Thinking Mode Configuration" : "\u{1F9E0} Thinking Mode Configuration"));
379
- console.log(a.dim("\u2500".repeat(60)));
380
- console.log("");
381
- const { action } = await inquirer.prompt({
382
- type: "list",
383
- name: "action",
384
- message: isZh ? "Select configuration option:" : "Select configuration option:",
385
- choices: [
386
- {
387
- name: `${currentConfig.enabled ? a.red("[Disable]") : a.green("[Enable]")} ${isZh ? "Toggle thinking mode" : "Toggle thinking mode"}`,
388
- value: "toggle",
389
- short: isZh ? "Toggle" : "Toggle"
390
- },
391
- {
392
- name: `${isZh ? "Set budget tokens" : "Set budget tokens"} (${currentConfig.budgetTokens.toLocaleString()})`,
393
- value: "budget",
394
- short: isZh ? "Budget" : "Budget"
395
- },
396
- {
397
- name: `${currentConfig.inheritForSubAgents ? a.red("[Disable]") : a.green("[Enable]")} ${isZh ? "Sub-agent inheritance" : "Sub-agent inheritance"}`,
398
- value: "inheritance",
399
- short: isZh ? "Inheritance" : "Inheritance"
400
- },
401
- {
402
- name: `${isZh ? "Sub-agent reduction factor" : "Sub-agent reduction factor"} (${(currentConfig.subAgentReduction * 100).toFixed(0)}%)`,
403
- value: "reduction",
404
- short: isZh ? "Reduction" : "Reduction"
405
- },
406
- {
407
- name: `${currentConfig.alwaysUseThinking ? a.red("[Disable]") : a.green("[Enable]")} ${isZh ? "Always use thinking" : "Always use thinking"}`,
408
- value: "always",
409
- short: isZh ? "Always" : "Always"
410
- },
411
- {
412
- name: isZh ? "Reset to defaults" : "Reset to defaults",
413
- value: "reset",
414
- short: isZh ? "Reset" : "Reset"
415
- },
416
- new inquirer.Separator(),
417
- {
418
- name: isZh ? "Done" : "Done",
419
- value: "done",
420
- short: isZh ? "Done" : "Done"
421
- }
422
- ]
423
- });
424
- if (action === "done") {
425
- await thinkingStatus(options);
426
- return;
427
- }
428
- if (action === "toggle") {
429
- await thinkingToggle(options);
430
- } else if (action === "budget") {
431
- const { tokens } = await inquirer.prompt({
432
- type: "input",
433
- name: "tokens",
434
- message: isZh ? `Enter budget tokens (${MIN_BUDGET_TOKENS} - ${MAX_BUDGET_TOKENS}):` : `Enter budget tokens (${MIN_BUDGET_TOKENS} - ${MAX_BUDGET_TOKENS}):`,
435
- default: currentConfig.budgetTokens.toString(),
436
- validate: (value) => {
437
- const num = Number.parseInt(value, 10);
438
- if (Number.isNaN(num)) {
439
- return isZh ? "Please enter a valid number" : "Please enter a valid number";
440
- }
441
- if (num < MIN_BUDGET_TOKENS || num > MAX_BUDGET_TOKENS) {
442
- return isZh ? `Must be between ${MIN_BUDGET_TOKENS} and ${MAX_BUDGET_TOKENS}` : `Must be between ${MIN_BUDGET_TOKENS} and ${MAX_BUDGET_TOKENS}`;
443
- }
444
- return true;
445
- }
446
- });
447
- await thinkingBudget(tokens, options);
448
- } else if (action === "inheritance") {
449
- const { enabled } = await inquirer.prompt({
450
- type: "confirm",
451
- name: "enabled",
452
- message: isZh ? "Enable sub-agent inheritance?" : "Enable sub-agent inheritance?",
453
- default: currentConfig.inheritForSubAgents
454
- });
455
- await thinkingInheritance(enabled, options);
456
- } else if (action === "reduction") {
457
- const { reduction } = await inquirer.prompt({
458
- type: "input",
459
- name: "reduction",
460
- message: isZh ? "Enter reduction factor (0.1 - 1.0):" : "Enter reduction factor (0.1 - 1.0):",
461
- default: currentConfig.subAgentReduction.toString(),
462
- validate: (value) => {
463
- const num = Number.parseFloat(value);
464
- if (Number.isNaN(num)) {
465
- return isZh ? "Please enter a valid number" : "Please enter a valid number";
466
- }
467
- if (num < 0.1 || num > 1) {
468
- return isZh ? "Must be between 0.1 and 1.0" : "Must be between 0.1 and 1.0";
469
- }
470
- return true;
471
- }
472
- });
473
- const manager2 = getThinkingManager();
474
- const result = manager2.setSubAgentReduction(Number.parseFloat(reduction));
475
- if (!result.success) {
476
- console.log("");
477
- console.log(a.red(result.error));
478
- console.log("");
479
- return;
480
- }
481
- console.log("");
482
- console.log(a.green(isZh ? "\u2705 Reduction factor updated" : "\u2705 Reduction factor updated"));
483
- console.log(a.dim(isZh ? `New reduction: ${(Number.parseFloat(reduction) * 100).toFixed(0)}%` : `New reduction: ${(Number.parseFloat(reduction) * 100).toFixed(0)}%`));
484
- console.log(a.dim(isZh ? `Sub-agent budget: ${manager2.calculateSubAgentBudget().toLocaleString()} tokens` : `Sub-agent budget: ${manager2.calculateSubAgentBudget().toLocaleString()} tokens`));
485
- console.log("");
486
- } else if (action === "always") {
487
- const { always } = await inquirer.prompt({
488
- type: "confirm",
489
- name: "always",
490
- message: isZh ? "Always use thinking mode (even for simple tasks)?" : "Always use thinking mode (even for simple tasks)?",
491
- default: currentConfig.alwaysUseThinking
492
- });
493
- const manager2 = getThinkingManager();
494
- manager2.setAlwaysUseThinking(always);
495
- console.log("");
496
- console.log(a.green(always ? isZh ? "\u2705 Always use thinking enabled" : "\u2705 Always use thinking enabled" : isZh ? "\u2705 Always use thinking disabled" : "\u2705 Always use thinking disabled"));
497
- console.log("");
498
- } else if (action === "reset") {
499
- await thinkingReset(options);
500
- }
501
- await thinkingConfig(options);
502
- }
503
- function thinkingCheck(complexity, model) {
504
- const isZh = i18n.language === "zh-CN";
505
- const useThinking = shouldUseThinkingMode(complexity);
506
- const complexityText = {
507
- simple: isZh ? "\u7B80\u5355" : "simple",
508
- medium: isZh ? "\u4E2D\u7B49" : "medium",
509
- complex: isZh ? "\u590D\u6742" : "complex"
510
- }[complexity];
511
- console.log("");
512
- console.log(a.bold(isZh ? "\u{1F9E0} Thinking Mode Check" : "\u{1F9E0} Thinking Mode Check"));
513
- console.log(a.dim("\u2500".repeat(60)));
514
- console.log("");
515
- console.log(` ${isZh ? "\u4EFB\u52A1\u590D\u6742\u5EA6" : "Task Complexity"}: ${complexityText}`);
516
- console.log(` ${isZh ? "\u4F7F\u7528 Thinking Mode" : "Use Thinking Mode"}: ${useThinking ? a.green("Yes") : a.yellow("No")}`);
517
- console.log("");
518
- }
519
- function thinkingHelp(_options = {}) {
520
- const isZh = i18n.language === "zh-CN";
521
- console.log("");
522
- console.log(a.bold.cyan(isZh ? "\u{1F9E0} Thinking Mode Commands" : "\u{1F9E0} Thinking Mode Commands"));
523
- console.log(a.dim("\u2500".repeat(60)));
524
- console.log("");
525
- const commands = [
526
- {
527
- cmd: "ccjk thinking",
528
- desc: isZh ? "Display thinking mode status" : "Display thinking mode status"
529
- },
530
- {
531
- cmd: "ccjk thinking enable",
532
- desc: isZh ? "Enable thinking mode" : "Enable thinking mode"
533
- },
534
- {
535
- cmd: "ccjk thinking disable",
536
- desc: isZh ? "Disable thinking mode" : "Disable thinking mode"
537
- },
538
- {
539
- cmd: "ccjk thinking toggle",
540
- desc: isZh ? "Toggle thinking mode on/off" : "Toggle thinking mode on/off"
541
- },
542
- {
543
- cmd: "ccjk thinking budget <tokens>",
544
- desc: isZh ? "Set budget tokens (1000-200000)" : "Set budget tokens (1000-200000)"
545
- },
546
- {
547
- cmd: "ccjk thinking config",
548
- desc: isZh ? "Interactive configuration menu" : "Interactive configuration menu"
549
- },
550
- {
551
- cmd: "ccjk thinking check <complexity>",
552
- desc: isZh ? "Check if thinking will be used" : "Check if thinking will be used"
553
- },
554
- {
555
- cmd: "ccjk thinking reset",
556
- desc: isZh ? "Reset to default settings" : "Reset to default settings"
557
- }
558
- ];
559
- for (const { cmd, desc } of commands) {
560
- console.log(` ${a.green(cmd)}`);
561
- console.log(` ${a.dim(desc)}`);
562
- console.log("");
563
- }
564
- console.log(a.dim(isZh ? "\u{1F4A1} Thinking Mode is enabled by default for Opus 4.5" : "\u{1F4A1} Thinking Mode is enabled by default for Opus 4.5"));
565
- console.log(a.dim(isZh ? " It provides extended reasoning for complex tasks." : " It provides extended reasoning for complex tasks."));
566
- console.log("");
567
- }
568
- async function thinking(action, args = [], options = {}) {
569
- try {
570
- switch (action) {
571
- case "enable":
572
- await thinkingEnable(options);
573
- break;
574
- case "disable":
575
- await thinkingDisable(options);
576
- break;
577
- case "toggle":
578
- await thinkingToggle(options);
579
- break;
580
- case "budget":
581
- if (args.length === 0) {
582
- const isZh = i18n.language === "zh-CN";
583
- console.log("");
584
- console.log(a.yellow(isZh ? "\u26A0\uFE0F Please specify token amount" : "\u26A0\uFE0F Please specify token amount"));
585
- console.log(a.dim(isZh ? "Usage: ccjk thinking budget <tokens>" : "Usage: ccjk thinking budget <tokens>"));
586
- console.log("");
587
- return;
588
- }
589
- await thinkingBudget(args[0], options);
590
- break;
591
- case "inherit":
592
- await thinkingInheritance(true, options);
593
- break;
594
- case "no-inherit":
595
- await thinkingInheritance(false, options);
596
- break;
597
- case "config":
598
- await thinkingConfig(options);
599
- break;
600
- case "check":
601
- if (args.length === 0) {
602
- thinkingCheck("complex");
603
- } else {
604
- const complexity = ["simple", "medium", "complex"].includes(args[0]) ? args[0] : "complex";
605
- thinkingCheck(complexity);
606
- }
607
- break;
608
- case "reset":
609
- await thinkingReset(options);
610
- break;
611
- case "help":
612
- thinkingHelp(options);
613
- break;
614
- case "status":
615
- default:
616
- await thinkingStatus(options);
617
- break;
618
- }
619
- } catch (error) {
620
- if (!handleExitPromptError(error)) {
621
- handleGeneralError(error);
622
- }
623
- }
624
- }
625
-
626
- export { thinking, thinkingBudget, thinkingCheck, thinkingConfig, thinkingDisable, thinkingEnable, thinkingHelp, thinkingInheritance, thinkingReset, thinkingStatus, thinkingToggle };