ccjk 13.3.5 → 13.3.7

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 (150) hide show
  1. package/dist/chunks/agent-teams.mjs +7 -5
  2. package/dist/chunks/agent.mjs +2 -2
  3. package/dist/chunks/agents.mjs +16 -16
  4. package/dist/chunks/api-cli.mjs +6 -6
  5. package/dist/chunks/api-providers.mjs +1 -1
  6. package/dist/chunks/api.mjs +4 -4
  7. package/dist/chunks/auto-bootstrap.mjs +1 -1
  8. package/dist/chunks/auto-fix.mjs +49 -4
  9. package/dist/chunks/auto-fixer.mjs +7 -5
  10. package/dist/chunks/auto-init.mjs +9 -7208
  11. package/dist/chunks/auto-memory-bridge.mjs +9 -3
  12. package/dist/chunks/auto-updater.mjs +9 -9
  13. package/dist/chunks/auto-upgrade.mjs +5 -3
  14. package/dist/chunks/banner.mjs +4 -3
  15. package/dist/chunks/boost.mjs +118 -62
  16. package/dist/chunks/ccjk-agents.mjs +3 -3
  17. package/dist/chunks/ccjk-all.mjs +7 -7
  18. package/dist/chunks/ccjk-config.mjs +2 -2
  19. package/dist/chunks/ccjk-hooks.mjs +4 -4
  20. package/dist/chunks/ccjk-mcp.mjs +5 -5
  21. package/dist/chunks/ccjk-setup.mjs +5 -5
  22. package/dist/chunks/ccjk-skills.mjs +5 -5
  23. package/dist/chunks/ccr.mjs +18 -16
  24. package/dist/chunks/ccu.mjs +2 -2
  25. package/dist/chunks/check-updates.mjs +8 -8
  26. package/dist/chunks/claude-code-config-manager.mjs +11 -8
  27. package/dist/chunks/claude-code-incremental-manager.mjs +7 -7
  28. package/dist/chunks/claude-config.mjs +1 -1
  29. package/dist/chunks/claude-wrapper.mjs +1 -1
  30. package/dist/chunks/cli-hook.mjs +15 -15
  31. package/dist/chunks/codex-config-switch.mjs +7 -7
  32. package/dist/chunks/codex-provider-manager.mjs +7 -7
  33. package/dist/chunks/codex-uninstaller.mjs +2 -2
  34. package/dist/chunks/codex.mjs +5 -5
  35. package/dist/chunks/commands.mjs +2 -2
  36. package/dist/chunks/commands2.mjs +3 -3
  37. package/dist/chunks/commit.mjs +2 -2
  38. package/dist/chunks/completion.mjs +2 -2
  39. package/dist/chunks/config-consolidator.mjs +2 -2
  40. package/dist/chunks/config-switch.mjs +8 -8
  41. package/dist/chunks/config.mjs +6 -5
  42. package/dist/chunks/config2.mjs +5 -5
  43. package/dist/chunks/config3.mjs +4 -4
  44. package/dist/chunks/constants.mjs +1 -1
  45. package/dist/chunks/context-opt.mjs +92 -90
  46. package/dist/chunks/context.mjs +659 -0
  47. package/dist/chunks/dashboard.mjs +14 -9
  48. package/dist/chunks/doctor.mjs +4 -4
  49. package/dist/chunks/eval.mjs +502 -0
  50. package/dist/chunks/evolution.mjs +46 -39
  51. package/dist/chunks/health-alerts.mjs +9 -9
  52. package/dist/chunks/help.mjs +1 -1
  53. package/dist/chunks/hook-installer.mjs +6 -3
  54. package/dist/chunks/index.mjs +23 -0
  55. package/dist/chunks/index10.mjs +634 -571
  56. package/dist/chunks/index11.mjs +1061 -569
  57. package/dist/chunks/index12.mjs +914 -1076
  58. package/dist/chunks/index13.mjs +136 -951
  59. package/dist/chunks/index14.mjs +209 -185
  60. package/dist/chunks/index2.mjs +19 -24
  61. package/dist/chunks/index3.mjs +19085 -12
  62. package/dist/chunks/index4.mjs +16 -19092
  63. package/dist/chunks/index5.mjs +7602 -16
  64. package/dist/chunks/index6.mjs +159 -7590
  65. package/dist/chunks/index7.mjs +1602 -171
  66. package/dist/chunks/index8.mjs +19 -1602
  67. package/dist/chunks/index9.mjs +612 -15
  68. package/dist/chunks/init.mjs +26 -19
  69. package/dist/chunks/installer.mjs +5 -5
  70. package/dist/chunks/installer2.mjs +2 -2
  71. package/dist/chunks/intent-engine.mjs +1 -1
  72. package/dist/chunks/interview.mjs +4 -4
  73. package/dist/chunks/manager.mjs +1 -1
  74. package/dist/chunks/marketplace.mjs +2 -2
  75. package/dist/chunks/mcp-cli.mjs +12 -12
  76. package/dist/chunks/mcp.mjs +8 -8
  77. package/dist/chunks/memory.mjs +8 -8
  78. package/dist/chunks/menu-hierarchical.mjs +24 -22
  79. package/dist/chunks/menu.mjs +27 -22
  80. package/dist/chunks/metrics-display.mjs +2 -2
  81. package/dist/chunks/migrator.mjs +1 -1
  82. package/dist/chunks/monitor.mjs +2 -2
  83. package/dist/chunks/notification.mjs +6 -6
  84. package/dist/chunks/onboarding-wizard.mjs +6 -5
  85. package/dist/chunks/onboarding.mjs +4 -4
  86. package/dist/chunks/package.mjs +1 -1
  87. package/dist/chunks/paradigm.mjs +2 -2
  88. package/dist/chunks/permission-manager.mjs +2 -2
  89. package/dist/chunks/permissions.mjs +3 -3
  90. package/dist/chunks/persistence-manager.mjs +19 -12
  91. package/dist/chunks/persistence.mjs +5 -3
  92. package/dist/chunks/plugin.mjs +2 -2
  93. package/dist/chunks/prompts.mjs +5 -5
  94. package/dist/chunks/providers.mjs +2 -2
  95. package/dist/chunks/quick-actions.mjs +7 -6
  96. package/dist/chunks/quick-provider.mjs +5 -4
  97. package/dist/chunks/quick-setup.mjs +20 -15
  98. package/dist/chunks/remote.mjs +15 -16
  99. package/dist/chunks/{convoy-manager.mjs → session-manager.mjs} +1129 -1095
  100. package/dist/chunks/session.mjs +2 -2
  101. package/dist/chunks/sessions.mjs +3 -3
  102. package/dist/chunks/silent-updater.mjs +1 -1
  103. package/dist/chunks/simple-config.mjs +2 -2
  104. package/dist/chunks/skill2.mjs +3 -3
  105. package/dist/chunks/skills-sync.mjs +5 -5
  106. package/dist/chunks/skills.mjs +3 -3
  107. package/dist/chunks/slash-commands.mjs +9 -8
  108. package/dist/chunks/smart-defaults.mjs +9 -5
  109. package/dist/chunks/startup.mjs +1 -1
  110. package/dist/chunks/stats.mjs +2 -2
  111. package/dist/chunks/status.mjs +37 -22
  112. package/dist/chunks/team.mjs +3 -3
  113. package/dist/chunks/thinking.mjs +4 -4
  114. package/dist/chunks/trace.mjs +2 -2
  115. package/dist/chunks/uninstall.mjs +9 -9
  116. package/dist/chunks/update.mjs +14 -11
  117. package/dist/chunks/upgrade-manager.mjs +3 -3
  118. package/dist/chunks/upgrade.mjs +25 -9
  119. package/dist/chunks/version-checker.mjs +4 -4
  120. package/dist/chunks/vim.mjs +3 -3
  121. package/dist/chunks/workflows.mjs +1 -1
  122. package/dist/chunks/wsl.mjs +1 -1
  123. package/dist/chunks/zero-config.mjs +4 -4
  124. package/dist/cli.mjs +60 -26
  125. package/dist/index.d.mts +4392 -4392
  126. package/dist/index.d.ts +4392 -4392
  127. package/dist/index.mjs +4314 -4314
  128. package/dist/shared/{ccjk.DcKLglJQ.mjs → ccjk.BIxuVL3_.mjs} +2 -2
  129. package/dist/shared/{ccjk.DJdmgr2d.mjs → ccjk.BJMRY2Ra.mjs} +5 -3
  130. package/dist/shared/{ccjk.B1TwPltj.mjs → ccjk.BOu1yav7.mjs} +3 -2
  131. package/dist/shared/{ccjk.mJpVRDZ8.mjs → ccjk.BWFpnOr3.mjs} +1 -1
  132. package/dist/shared/{ccjk.BfIpomdz.mjs → ccjk.CHUEFqmw.mjs} +3 -2
  133. package/dist/shared/{ccjk.CqdbaXqU.mjs → ccjk.CLUL0pAV.mjs} +9 -5
  134. package/dist/shared/{ccjk.Cot9p9_n.mjs → ccjk.Cjj8SVrn.mjs} +1 -1
  135. package/dist/shared/{ccjk.CfrpIIKy.mjs → ccjk.Crd_nEfj.mjs} +38 -20
  136. package/dist/shared/{ccjk.DCw2WnZU.mjs → ccjk.CvChMYvB.mjs} +1 -1
  137. package/dist/shared/{ccjk.CXzjn01x.mjs → ccjk.D8ZLYSZZ.mjs} +1 -1
  138. package/dist/shared/{ccjk.BrPUmTqm.mjs → ccjk.DJuyfrlL.mjs} +164 -82
  139. package/dist/shared/{ccjk.DHXfsrwn.mjs → ccjk.DRfdq6yl.mjs} +4 -4
  140. package/dist/shared/{ccjk.DXRAZcix.mjs → ccjk.DScm_NnL.mjs} +8 -4
  141. package/dist/shared/{ccjk.XsJWJuQP.mjs → ccjk.DfZKjHvG.mjs} +6 -128
  142. package/dist/shared/{ccjk.BFxsJM0k.mjs → ccjk.DwSebGy0.mjs} +4 -3
  143. package/dist/shared/ccjk.DxWqH-EF.mjs +170 -0
  144. package/dist/shared/{ccjk.Cwa_FiTX.mjs → ccjk.I6IuYdc_.mjs} +2 -2
  145. package/dist/shared/{ccjk.DpstNaeR.mjs → ccjk.KpFl2RDA.mjs} +3 -3
  146. package/dist/shared/{ccjk.dYDLfmph.mjs → ccjk._dESH4Rk.mjs} +1 -1
  147. package/dist/shared/{ccjk.BxSmJ8B7.mjs → ccjk.wLJHO0Af.mjs} +2 -1
  148. package/package.json +65 -67
  149. package/dist/chunks/index15.mjs +0 -218
  150. package/dist/shared/{ccjk.c-ETfBZ_.mjs → ccjk.eIn-g1yI.mjs} +96 -96
@@ -1,15 +1,15 @@
1
- import a from '../chunks/index3.mjs';
2
- import { i as inquirer } from '../chunks/index4.mjs';
1
+ import a from '../chunks/index2.mjs';
2
+ import { i as inquirer } from '../chunks/index3.mjs';
3
3
  import { CLAUDE_DIR, SETTINGS_FILE } from '../chunks/constants.mjs';
4
- import { ensureI18nInitialized, i18n } from '../chunks/index6.mjs';
4
+ import { ensureI18nInitialized, i18n } from '../chunks/index5.mjs';
5
5
  import { g as getExistingApiConfig, d as configureApi, s as switchToOfficialLogin, b as backupExistingConfig, e as applyAiLanguageDirective } from '../chunks/config.mjs';
6
6
  import { fileURLToPath } from 'node:url';
7
7
  import { updateZcfConfig } from '../chunks/ccjk-config.mjs';
8
8
  import { exists, removeFile, ensureDir, copyFile } from '../chunks/fs-operations.mjs';
9
9
  import { readJsonConfig, writeJsonConfig } from '../chunks/json-config.mjs';
10
- import { m as mergeAndCleanPermissions } from './ccjk.DXRAZcix.mjs';
10
+ import { m as mergeAndCleanPermissions } from './ccjk.DScm_NnL.mjs';
11
11
  import { a as addNumbersToChoices } from './ccjk.BFQ7yr5S.mjs';
12
- import { p as promptBoolean } from './ccjk.mJpVRDZ8.mjs';
12
+ import { p as promptBoolean } from './ccjk.BWFpnOr3.mjs';
13
13
  import { j as join, d as dirname } from './ccjk.bQ7Dh1g4.mjs';
14
14
  import { existsSync } from 'node:fs';
15
15
  import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
@@ -715,128 +715,6 @@ function getTagLabel(tag) {
715
715
  return i18n.t(tagKeys[tag]);
716
716
  }
717
717
 
718
- function migrateSettingsForTokenRetrieval() {
719
- ensureI18nInitialized();
720
- const result = {
721
- success: false,
722
- changes: [],
723
- backupPath: null,
724
- errors: []
725
- };
726
- try {
727
- if (!exists(SETTINGS_FILE)) {
728
- result.errors.push(i18n.t("common:fileNotFound", { file: "settings.json" }));
729
- return result;
730
- }
731
- const settings = readJsonConfig(SETTINGS_FILE);
732
- if (!settings) {
733
- result.errors.push(i18n.t("common:failedToReadFile", { file: "settings.json" }));
734
- return result;
735
- }
736
- let modified = false;
737
- if (settings.env) {
738
- if ("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" in settings.env) {
739
- delete settings.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC;
740
- result.changes.push("Removed CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC (was blocking token retrieval)");
741
- modified = true;
742
- }
743
- if (settings.env.MCP_TIMEOUT) {
744
- const timeout = Number.parseInt(settings.env.MCP_TIMEOUT, 10);
745
- if (!Number.isNaN(timeout) && timeout > 2e4) {
746
- const oldValue = settings.env.MCP_TIMEOUT;
747
- settings.env.MCP_TIMEOUT = "15000";
748
- result.changes.push(`Reduced MCP_TIMEOUT from ${oldValue}ms to 15000ms (was causing slow failures)`);
749
- modified = true;
750
- }
751
- }
752
- }
753
- if (!modified) {
754
- result.success = true;
755
- return result;
756
- }
757
- const backupPath = backupExistingConfig();
758
- if (backupPath) {
759
- result.backupPath = backupPath;
760
- } else {
761
- result.errors.push("Failed to create backup (continuing anyway)");
762
- }
763
- writeJsonConfig(SETTINGS_FILE, settings);
764
- result.success = true;
765
- return result;
766
- } catch (error) {
767
- result.errors.push(`Migration failed: ${error instanceof Error ? error.message : String(error)}`);
768
- return result;
769
- }
770
- }
771
- function needsMigration() {
772
- try {
773
- if (!exists(SETTINGS_FILE)) {
774
- return false;
775
- }
776
- const settings = readJsonConfig(SETTINGS_FILE);
777
- if (!settings || !settings.env) {
778
- return false;
779
- }
780
- const hasProblematicVar = "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" in settings.env;
781
- const hasExcessiveTimeout = settings.env.MCP_TIMEOUT && Number.parseInt(settings.env.MCP_TIMEOUT, 10) > 2e4;
782
- return Boolean(hasProblematicVar || hasExcessiveTimeout);
783
- } catch {
784
- return false;
785
- }
786
- }
787
- function displayMigrationResult(result) {
788
- ensureI18nInitialized();
789
- if (result.success) {
790
- if (result.changes.length > 0) {
791
- console.log(a.green(`
792
- \u2705 ${i18n.t("common:configurationFixed")}
793
- `));
794
- console.log(a.bold("Changes made:"));
795
- for (const change of result.changes) {
796
- console.log(a.gray(` \u2022 ${change}`));
797
- }
798
- if (result.backupPath) {
799
- console.log(a.gray(`
800
- \u{1F4E6} Backup created: ${result.backupPath}`));
801
- }
802
- console.log(a.yellow("\n\u26A0\uFE0F Please restart Claude Code CLI for changes to take effect.\n"));
803
- } else {
804
- console.log(a.green(`
805
- \u2705 ${i18n.t("common:noMigrationNeeded")}
806
- `));
807
- }
808
- } else {
809
- console.log(a.red(`
810
- \u274C ${i18n.t("common:migrationFailed")}
811
- `));
812
- if (result.errors.length > 0) {
813
- console.log(a.bold("Errors:"));
814
- for (const error of result.errors) {
815
- console.log(a.red(` \u2022 ${error}`));
816
- }
817
- }
818
- if (result.backupPath) {
819
- console.log(a.gray(`
820
- \u{1F4E6} Backup available at: ${result.backupPath}`));
821
- console.log(a.gray("You can restore with: cp <backup-path>/settings.json ~/.claude/settings.json\n"));
822
- }
823
- }
824
- }
825
- async function promptMigration() {
826
- ensureI18nInitialized();
827
- const inquirer = await import('../chunks/index4.mjs').then(function (n) { return n.c; });
828
- console.log(a.yellow("\n\u26A0\uFE0F Problematic configuration detected!\n"));
829
- console.log(a.gray("Your settings.json contains configurations that prevent Claude Code"));
830
- console.log(a.gray("from retrieving token counts, causing /compact failures.\n"));
831
- const { shouldMigrate } = await inquirer.default.prompt({
832
- type: "confirm",
833
- name: "shouldMigrate",
834
- message: "Would you like to fix these issues automatically? (backup will be created)",
835
- default: true
836
- });
837
- return shouldMigrate;
838
- }
839
-
840
718
  function getRootDir() {
841
719
  const currentFilePath = fileURLToPath(import.meta.url);
842
720
  const distDir = dirname(dirname(currentFilePath));
@@ -1048,4 +926,4 @@ async function cleanupOldVersionFiles() {
1048
926
  }
1049
927
  }
1050
928
 
1051
- export { WORKFLOW_CONFIG_BASE as W, modifyApiConfigPartially as a, configureApiCompletely as b, configureOutputStyle as c, displayMigrationResult as d, formatApiKeyDisplay as f, migrateSettingsForTokenRetrieval as m, needsMigration as n, promptMigration as p, selectAndInstallWorkflows as s, updatePromptOnly as u, validateApiKey as v };
929
+ export { WORKFLOW_CONFIG_BASE as W, configureApiCompletely as a, configureOutputStyle as c, formatApiKeyDisplay as f, modifyApiConfigPartially as m, selectAndInstallWorkflows as s, updatePromptOnly as u, validateApiKey as v };
@@ -1,5 +1,5 @@
1
- import Database from 'better-sqlite3';
2
1
  import { existsSync, mkdirSync } from 'node:fs';
2
+ import Database from 'better-sqlite3';
3
3
  import { j as join, d as dirname } from './ccjk.bQ7Dh1g4.mjs';
4
4
 
5
5
  class TaskPersistence {
@@ -165,7 +165,8 @@ class TaskPersistence {
165
165
  SELECT * FROM tasks WHERE id = ?
166
166
  `);
167
167
  const row = stmt.get(taskId);
168
- if (!row) return void 0;
168
+ if (!row)
169
+ return void 0;
169
170
  return this.rowToTask(row);
170
171
  }
171
172
  /**
@@ -322,7 +323,7 @@ class TaskPersistence {
322
323
  /**
323
324
  * Calculate topological level for a task
324
325
  */
325
- calculateTopologicalLevel(taskId, sessionId) {
326
+ calculateTopologicalLevel(taskId, _sessionId) {
326
327
  const visited = /* @__PURE__ */ new Set();
327
328
  const calculating = /* @__PURE__ */ new Set();
328
329
  const calculate = (id) => {
@@ -0,0 +1,170 @@
1
+ import a from '../chunks/index2.mjs';
2
+ import { SETTINGS_FILE } from '../chunks/constants.mjs';
3
+ import { ensureI18nInitialized, i18n } from '../chunks/index5.mjs';
4
+ import { ClaudeCodeConfigManager } from '../chunks/claude-code-config-manager.mjs';
5
+ import { b as backupExistingConfig } from '../chunks/config.mjs';
6
+ import { exists } from '../chunks/fs-operations.mjs';
7
+ import { readJsonConfig, writeJsonConfig } from '../chunks/json-config.mjs';
8
+
9
+ function migrateSettingsForTokenRetrieval() {
10
+ ensureI18nInitialized();
11
+ const result = {
12
+ success: false,
13
+ changes: [],
14
+ backupPath: null,
15
+ errors: []
16
+ };
17
+ try {
18
+ if (!exists(SETTINGS_FILE)) {
19
+ result.errors.push(i18n.t("common:fileNotFound", { file: "settings.json" }));
20
+ return result;
21
+ }
22
+ const settings = readJsonConfig(SETTINGS_FILE);
23
+ if (!settings) {
24
+ result.errors.push(i18n.t("common:failedToReadFile", { file: "settings.json" }));
25
+ return result;
26
+ }
27
+ let modified = false;
28
+ if (settings.env) {
29
+ if ("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" in settings.env) {
30
+ delete settings.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC;
31
+ result.changes.push("Removed CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC (was blocking token retrieval)");
32
+ modified = true;
33
+ }
34
+ if (settings.env.MCP_TIMEOUT) {
35
+ const timeout = Number.parseInt(settings.env.MCP_TIMEOUT, 10);
36
+ if (!Number.isNaN(timeout) && timeout > 2e4) {
37
+ const oldValue = settings.env.MCP_TIMEOUT;
38
+ settings.env.MCP_TIMEOUT = "15000";
39
+ result.changes.push(`Reduced MCP_TIMEOUT from ${oldValue}ms to 15000ms (was causing slow failures)`);
40
+ modified = true;
41
+ }
42
+ }
43
+ const hasAdaptiveModelDefaults = Boolean(
44
+ settings.env.ANTHROPIC_DEFAULT_HAIKU_MODEL || settings.env.ANTHROPIC_DEFAULT_SONNET_MODEL || settings.env.ANTHROPIC_DEFAULT_OPUS_MODEL
45
+ );
46
+ if (hasAdaptiveModelDefaults && settings.env.ANTHROPIC_MODEL) {
47
+ delete settings.env.ANTHROPIC_MODEL;
48
+ result.changes.push("Removed stale ANTHROPIC_MODEL override so Claude Code can use adaptive Haiku/Sonnet/Opus routing");
49
+ modified = true;
50
+ }
51
+ }
52
+ if (settings.model && (settings.env?.ANTHROPIC_DEFAULT_HAIKU_MODEL || settings.env?.ANTHROPIC_DEFAULT_SONNET_MODEL || settings.env?.ANTHROPIC_DEFAULT_OPUS_MODEL)) {
53
+ delete settings.model;
54
+ result.changes.push("Removed stale settings.model override because adaptive default model variants are configured");
55
+ modified = true;
56
+ }
57
+ const profileConfig = ClaudeCodeConfigManager.readConfig();
58
+ if (profileConfig) {
59
+ let profileModified = false;
60
+ for (const [profileId, profile] of Object.entries(profileConfig.profiles)) {
61
+ const hasAdaptiveModelDefaults = Boolean(
62
+ profile.defaultHaikuModel || profile.defaultSonnetModel || profile.defaultOpusModel
63
+ );
64
+ if (hasAdaptiveModelDefaults && profile.primaryModel) {
65
+ delete profile.primaryModel;
66
+ result.changes.push(`Removed stale primaryModel override from Claude Code profile "${profile.name || profileId}"`);
67
+ profileModified = true;
68
+ }
69
+ }
70
+ if (profileModified) {
71
+ ClaudeCodeConfigManager.writeConfig(profileConfig);
72
+ modified = true;
73
+ }
74
+ }
75
+ if (!modified) {
76
+ result.success = true;
77
+ return result;
78
+ }
79
+ const backupPath = backupExistingConfig();
80
+ if (backupPath) {
81
+ result.backupPath = backupPath;
82
+ } else {
83
+ result.errors.push("Failed to create backup (continuing anyway)");
84
+ }
85
+ writeJsonConfig(SETTINGS_FILE, settings);
86
+ result.success = true;
87
+ return result;
88
+ } catch (error) {
89
+ result.errors.push(`Migration failed: ${error instanceof Error ? error.message : String(error)}`);
90
+ return result;
91
+ }
92
+ }
93
+ function needsMigration() {
94
+ try {
95
+ if (!exists(SETTINGS_FILE)) {
96
+ return false;
97
+ }
98
+ const settings = readJsonConfig(SETTINGS_FILE);
99
+ if (!settings || !settings.env) {
100
+ return false;
101
+ }
102
+ const hasProblematicVar = "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC" in settings.env;
103
+ const hasExcessiveTimeout = settings.env.MCP_TIMEOUT && Number.parseInt(settings.env.MCP_TIMEOUT, 10) > 2e4;
104
+ const hasAdaptiveModelDefaults = Boolean(
105
+ settings.env.ANTHROPIC_DEFAULT_HAIKU_MODEL || settings.env.ANTHROPIC_DEFAULT_SONNET_MODEL || settings.env.ANTHROPIC_DEFAULT_OPUS_MODEL
106
+ );
107
+ const hasPinnedAdaptiveOverride = Boolean(settings.env.ANTHROPIC_MODEL && hasAdaptiveModelDefaults) || Boolean(settings.model && hasAdaptiveModelDefaults);
108
+ const profileConfig = ClaudeCodeConfigManager.readConfig();
109
+ const hasProfilePinnedAdaptiveOverride = Boolean(profileConfig && Object.values(profileConfig.profiles).some(
110
+ (profile) => profile.primaryModel && (profile.defaultHaikuModel || profile.defaultSonnetModel || profile.defaultOpusModel)
111
+ ));
112
+ return Boolean(hasProblematicVar || hasExcessiveTimeout || hasPinnedAdaptiveOverride || hasProfilePinnedAdaptiveOverride);
113
+ } catch {
114
+ return false;
115
+ }
116
+ }
117
+ function displayMigrationResult(result) {
118
+ ensureI18nInitialized();
119
+ if (result.success) {
120
+ if (result.changes.length > 0) {
121
+ console.log(a.green(`
122
+ \u2705 ${i18n.t("common:configurationFixed")}
123
+ `));
124
+ console.log(a.bold("Changes made:"));
125
+ for (const change of result.changes) {
126
+ console.log(a.gray(` \u2022 ${change}`));
127
+ }
128
+ if (result.backupPath) {
129
+ console.log(a.gray(`
130
+ \u{1F4E6} Backup created: ${result.backupPath}`));
131
+ }
132
+ console.log(a.yellow("\n\u26A0\uFE0F Please restart Claude Code CLI for changes to take effect.\n"));
133
+ } else {
134
+ console.log(a.green(`
135
+ \u2705 ${i18n.t("common:noMigrationNeeded")}
136
+ `));
137
+ }
138
+ } else {
139
+ console.log(a.red(`
140
+ \u274C ${i18n.t("common:migrationFailed")}
141
+ `));
142
+ if (result.errors.length > 0) {
143
+ console.log(a.bold("Errors:"));
144
+ for (const error of result.errors) {
145
+ console.log(a.red(` \u2022 ${error}`));
146
+ }
147
+ }
148
+ if (result.backupPath) {
149
+ console.log(a.gray(`
150
+ \u{1F4E6} Backup available at: ${result.backupPath}`));
151
+ console.log(a.gray("You can restore with: cp <backup-path>/settings.json ~/.claude/settings.json\n"));
152
+ }
153
+ }
154
+ }
155
+ async function promptMigration() {
156
+ ensureI18nInitialized();
157
+ const inquirer = await import('../chunks/index3.mjs').then(function (n) { return n.c; });
158
+ console.log(a.yellow("\n\u26A0\uFE0F Problematic configuration detected!\n"));
159
+ console.log(a.gray("Your settings.json contains configurations that prevent Claude Code"));
160
+ console.log(a.gray("from retrieving token counts, causing /compact failures.\n"));
161
+ const { shouldMigrate } = await inquirer.default.prompt({
162
+ type: "confirm",
163
+ name: "shouldMigrate",
164
+ message: "Would you like to fix these issues automatically? (backup will be created)",
165
+ default: true
166
+ });
167
+ return shouldMigrate;
168
+ }
169
+
170
+ export { displayMigrationResult as d, migrateSettingsForTokenRetrieval as m, needsMigration as n, promptMigration as p };
@@ -1,5 +1,5 @@
1
- import a from '../chunks/index3.mjs';
2
- import { i as inquirer } from '../chunks/index4.mjs';
1
+ import a from '../chunks/index2.mjs';
2
+ import { i as inquirer } from '../chunks/index3.mjs';
3
3
  import { b as getPresetById, c as getRecommendedPresets, a as getChinesePresets, g as getAllPresets } from './ccjk.DopKzo3z.mjs';
4
4
  import { existsSync, readFileSync, mkdirSync } from 'node:fs';
5
5
  import { homedir } from 'node:os';
@@ -1,11 +1,11 @@
1
- import a from '../chunks/index3.mjs';
2
- import { i as inquirer } from '../chunks/index4.mjs';
1
+ import a from '../chunks/index2.mjs';
2
+ import { i as inquirer } from '../chunks/index3.mjs';
3
3
  import { h as getMcpService, i as dynamicMcpRegistry, a as readCodexConfig, j as applyCodexPlatformCommand, w as writeCodexConfig, M as MCP_SERVICE_CONFIGS } from '../chunks/codex.mjs';
4
4
  import { SETTINGS_FILE, CLAUDE_DIR, ClAUDE_CONFIG_FILE, CODEX_CONFIG_FILE } from '../chunks/constants.mjs';
5
5
  import { exists, ensureDir } from '../chunks/fs-operations.mjs';
6
6
  import { readJsonConfig, writeJsonConfig } from '../chunks/json-config.mjs';
7
7
  import { d as deepMerge, r as readMcpConfig, b as buildMcpServerConfig, w as writeMcpConfig } from '../chunks/claude-config.mjs';
8
- import { ensureI18nInitialized, i18n } from '../chunks/index6.mjs';
8
+ import { ensureI18nInitialized, i18n } from '../chunks/index5.mjs';
9
9
  import { k as isWindows, l as getSystemRoot } from '../chunks/platform.mjs';
10
10
 
11
11
  function readClaudeConfig(configPath = SETTINGS_FILE) {
@@ -3,7 +3,7 @@ import { existsSync } from 'node:fs';
3
3
  import { readFile } from 'node:fs/promises';
4
4
  import { homedir } from 'node:os';
5
5
  import { promisify } from 'node:util';
6
- import { i18n } from '../chunks/index6.mjs';
6
+ import { i18n } from '../chunks/index5.mjs';
7
7
  import { j as join } from './ccjk.bQ7Dh1g4.mjs';
8
8
 
9
9
  const execAsync = promisify(exec);
@@ -122,7 +122,8 @@ class FsParadigm {
122
122
  */
123
123
  async detect(projectRoot) {
124
124
  const cached = this.cache.get(projectRoot);
125
- if (cached) return cached;
125
+ if (cached)
126
+ return cached;
126
127
  const scores = await Promise.all(
127
128
  PARADIGMS.map(async (paradigm) => ({
128
129
  paradigm,
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "13.3.5",
5
- "packageManager": "pnpm@10.17.1",
4
+ "version": "13.3.7",
6
5
  "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
6
  "author": {
8
7
  "name": "CCJK Team",
@@ -81,6 +80,69 @@
81
80
  "engines": {
82
81
  "node": ">=20"
83
82
  },
83
+ "dependencies": {
84
+ "better-sqlite3": "^12.6.2",
85
+ "fdir": "^6.5.0",
86
+ "globby": "^14.1.0",
87
+ "ioredis": "^5.9.3",
88
+ "node-cron": "^4.2.1",
89
+ "sql.js": "^1.14.0",
90
+ "tar": "^7.5.9",
91
+ "tinyglobby": "^0.2.15",
92
+ "web-tree-sitter": "^0.26.5"
93
+ },
94
+ "devDependencies": {
95
+ "@antfu/eslint-config": "^5.4.1",
96
+ "@anthropic-ai/sdk": "^0.52.0",
97
+ "@types/better-sqlite3": "^7.6.13",
98
+ "@types/fs-extra": "^11.0.4",
99
+ "@types/inquirer": "^9.0.9",
100
+ "@types/node": "^22.18.6",
101
+ "@types/node-cron": "^3.0.11",
102
+ "@types/semver": "^7.7.1",
103
+ "@types/uuid": "^11.0.0",
104
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
105
+ "@typescript-eslint/parser": "^6.0.0",
106
+ "@vitest/coverage-v8": "^3.2.4",
107
+ "@vitest/ui": "^3.2.4",
108
+ "ansis": "^4.2.0",
109
+ "cac": "^6.7.14",
110
+ "chokidar": "^4.0.3",
111
+ "concurrently": "^9.2.1",
112
+ "consola": "^3.4.2",
113
+ "dayjs": "^1.11.19",
114
+ "eslint": "^9.36.0",
115
+ "eslint-plugin-format": "^1.4.0",
116
+ "find-up-simple": "^1.0.1",
117
+ "fs-extra": "^11.3.3",
118
+ "gray-matter": "^4.0.3",
119
+ "handlebars": "^4.7.8",
120
+ "husky": "^9.1.7",
121
+ "i18next": "^25.8.13",
122
+ "i18next-fs-backend": "^2.6.1",
123
+ "inquirer": "^12.9.6",
124
+ "inquirer-toggle": "^1.0.1",
125
+ "lint-staged": "^16.2.7",
126
+ "lowdb": "^7.0.1",
127
+ "nanoid": "^5.1.6",
128
+ "ofetch": "^1.5.1",
129
+ "ohash": "^1.1.4",
130
+ "ora": "^8.2.0",
131
+ "pathe": "^2.0.3",
132
+ "pkgroll": "^2.26.3",
133
+ "prettier": "^3.8.1",
134
+ "semver": "^7.7.4",
135
+ "shx": "^0.4.0",
136
+ "smol-toml": "^1.6.0",
137
+ "tinyexec": "^1.0.2",
138
+ "trash": "^10.1.0",
139
+ "tsx": "^4.21.0",
140
+ "tweetnacl": "^1.0.3",
141
+ "typescript": "^5.9.3",
142
+ "unbuild": "^3.6.1",
143
+ "uuid": "^11.1.0",
144
+ "vitest": "^3.2.4"
145
+ },
84
146
  "scripts": {
85
147
  "dev": "tsx ./src/cli.ts",
86
148
  "build": "unbuild",
@@ -88,7 +150,6 @@
88
150
  "typecheck": "tsc --noEmit",
89
151
  "release:verify": "node scripts/release-verify.mjs",
90
152
  "release:verify:full": "node scripts/release-verify.mjs --with-tests",
91
- "prepublishOnly": "node scripts/validate-prepublish.mjs && pnpm contract:check && pnpm build",
92
153
  "lint": "eslint",
93
154
  "lint:fix": "eslint --fix",
94
155
  "test": "vitest",
@@ -110,7 +171,6 @@
110
171
  "test:integration:run": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
111
172
  "test:integration:ui": "NODE_ENV=test vitest --config vitest.integration.config.ts --ui",
112
173
  "test:integration:coverage": "NODE_ENV=test vitest run --config vitest.integration.config.ts --coverage",
113
- "prepare": "husky",
114
174
  "format": "prettier --write src/**/*.ts",
115
175
  "prepublish:fix": "node scripts/fix-package-catalog.mjs",
116
176
  "cleanup": "node scripts/cleanup.js",
@@ -145,67 +205,5 @@
145
205
  "i18n:check": "tsx scripts/check-i18n.ts",
146
206
  "i18n:report": "tsx scripts/check-i18n.ts --report",
147
207
  "contract:check": "node scripts/check-remote-contract.mjs"
148
- },
149
- "dependencies": {
150
- "fdir": "^6.5.0",
151
- "globby": "^14.1.0",
152
- "ioredis": "^5.9.3",
153
- "node-cron": "^4.2.1",
154
- "sql.js": "^1.14.0",
155
- "tar": "^7.5.9",
156
- "tinyglobby": "^0.2.15",
157
- "web-tree-sitter": "^0.26.5"
158
- },
159
- "devDependencies": {
160
- "@antfu/eslint-config": "^5.4.1",
161
- "@anthropic-ai/sdk": "^0.52.0",
162
- "@types/better-sqlite3": "^7.6.13",
163
- "@types/fs-extra": "^11.0.4",
164
- "@types/inquirer": "^9.0.9",
165
- "@types/node": "^22.18.6",
166
- "@types/node-cron": "^3.0.11",
167
- "@types/semver": "^7.7.1",
168
- "@types/uuid": "^11.0.0",
169
- "@typescript-eslint/eslint-plugin": "^6.0.0",
170
- "@typescript-eslint/parser": "^6.0.0",
171
- "@vitest/coverage-v8": "^3.2.4",
172
- "@vitest/ui": "^3.2.4",
173
- "ansis": "^4.2.0",
174
- "cac": "^6.7.14",
175
- "chokidar": "^4.0.3",
176
- "concurrently": "^9.2.1",
177
- "consola": "^3.4.2",
178
- "dayjs": "^1.11.19",
179
- "eslint": "^9.36.0",
180
- "eslint-plugin-format": "^1.4.0",
181
- "find-up-simple": "^1.0.1",
182
- "fs-extra": "^11.3.3",
183
- "gray-matter": "^4.0.3",
184
- "handlebars": "^4.7.8",
185
- "husky": "^9.1.7",
186
- "i18next": "^25.8.13",
187
- "i18next-fs-backend": "^2.6.1",
188
- "inquirer": "^12.9.6",
189
- "inquirer-toggle": "^1.0.1",
190
- "lint-staged": "^16.2.7",
191
- "lowdb": "^7.0.1",
192
- "nanoid": "^5.1.6",
193
- "ofetch": "^1.5.1",
194
- "ohash": "^1.1.4",
195
- "ora": "^8.2.0",
196
- "pathe": "^2.0.3",
197
- "pkgroll": "^2.26.3",
198
- "prettier": "^3.8.1",
199
- "semver": "^7.7.4",
200
- "shx": "^0.4.0",
201
- "smol-toml": "^1.6.0",
202
- "tinyexec": "^1.0.2",
203
- "trash": "^10.1.0",
204
- "tsx": "^4.21.0",
205
- "tweetnacl": "^1.0.3",
206
- "typescript": "^5.9.3",
207
- "unbuild": "^3.6.1",
208
- "uuid": "^11.1.0",
209
- "vitest": "^3.2.4"
210
208
  }
211
- }
209
+ }