ccjk 13.3.6 → 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.
- package/dist/chunks/agent-teams.mjs +7 -5
- package/dist/chunks/agent.mjs +2 -2
- package/dist/chunks/agents.mjs +16 -16
- package/dist/chunks/api-cli.mjs +6 -6
- package/dist/chunks/api-providers.mjs +1 -1
- package/dist/chunks/api.mjs +4 -4
- package/dist/chunks/auto-bootstrap.mjs +1 -1
- package/dist/chunks/auto-fix.mjs +49 -4
- package/dist/chunks/auto-fixer.mjs +7 -5
- package/dist/chunks/auto-init.mjs +9 -7208
- package/dist/chunks/auto-memory-bridge.mjs +9 -3
- package/dist/chunks/auto-updater.mjs +9 -9
- package/dist/chunks/auto-upgrade.mjs +5 -3
- package/dist/chunks/banner.mjs +4 -3
- package/dist/chunks/boost.mjs +118 -62
- package/dist/chunks/ccjk-agents.mjs +3 -3
- package/dist/chunks/ccjk-all.mjs +7 -7
- package/dist/chunks/ccjk-config.mjs +2 -2
- package/dist/chunks/ccjk-hooks.mjs +4 -4
- package/dist/chunks/ccjk-mcp.mjs +5 -5
- package/dist/chunks/ccjk-setup.mjs +5 -5
- package/dist/chunks/ccjk-skills.mjs +5 -5
- package/dist/chunks/ccr.mjs +18 -16
- package/dist/chunks/ccu.mjs +2 -2
- package/dist/chunks/check-updates.mjs +8 -8
- package/dist/chunks/claude-code-config-manager.mjs +12 -10
- package/dist/chunks/claude-code-incremental-manager.mjs +7 -7
- package/dist/chunks/claude-config.mjs +1 -1
- package/dist/chunks/claude-wrapper.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +15 -15
- package/dist/chunks/codex-config-switch.mjs +7 -7
- package/dist/chunks/codex-provider-manager.mjs +7 -7
- package/dist/chunks/codex-uninstaller.mjs +2 -2
- package/dist/chunks/codex.mjs +5 -5
- package/dist/chunks/commands.mjs +2 -2
- package/dist/chunks/commands2.mjs +3 -3
- package/dist/chunks/commit.mjs +2 -2
- package/dist/chunks/completion.mjs +2 -2
- package/dist/chunks/config-consolidator.mjs +2 -2
- package/dist/chunks/config-switch.mjs +8 -8
- package/dist/chunks/config.mjs +6 -5
- package/dist/chunks/config2.mjs +5 -5
- package/dist/chunks/config3.mjs +4 -4
- package/dist/chunks/constants.mjs +1 -1
- package/dist/chunks/context-opt.mjs +92 -90
- package/dist/chunks/context.mjs +659 -0
- package/dist/chunks/dashboard.mjs +14 -9
- package/dist/chunks/doctor.mjs +4 -4
- package/dist/chunks/eval.mjs +502 -0
- package/dist/chunks/evolution.mjs +46 -39
- package/dist/chunks/health-alerts.mjs +9 -9
- package/dist/chunks/help.mjs +1 -1
- package/dist/chunks/hook-installer.mjs +6 -3
- package/dist/chunks/index.mjs +23 -0
- package/dist/chunks/index10.mjs +634 -571
- package/dist/chunks/index11.mjs +1061 -569
- package/dist/chunks/index12.mjs +914 -1076
- package/dist/chunks/index13.mjs +136 -951
- package/dist/chunks/index14.mjs +209 -185
- package/dist/chunks/index2.mjs +19 -24
- package/dist/chunks/index3.mjs +19085 -12
- package/dist/chunks/index4.mjs +16 -19092
- package/dist/chunks/index5.mjs +7602 -16
- package/dist/chunks/index6.mjs +159 -7590
- package/dist/chunks/index7.mjs +1602 -171
- package/dist/chunks/index8.mjs +19 -1602
- package/dist/chunks/index9.mjs +612 -15
- package/dist/chunks/init.mjs +26 -19
- package/dist/chunks/installer.mjs +5 -5
- package/dist/chunks/installer2.mjs +2 -2
- package/dist/chunks/intent-engine.mjs +1 -1
- package/dist/chunks/interview.mjs +4 -4
- package/dist/chunks/manager.mjs +1 -1
- package/dist/chunks/marketplace.mjs +2 -2
- package/dist/chunks/mcp-cli.mjs +12 -12
- package/dist/chunks/mcp.mjs +8 -8
- package/dist/chunks/memory.mjs +8 -8
- package/dist/chunks/menu-hierarchical.mjs +24 -22
- package/dist/chunks/menu.mjs +27 -22
- package/dist/chunks/metrics-display.mjs +2 -2
- package/dist/chunks/migrator.mjs +1 -1
- package/dist/chunks/monitor.mjs +2 -2
- package/dist/chunks/notification.mjs +6 -6
- package/dist/chunks/onboarding-wizard.mjs +6 -5
- package/dist/chunks/onboarding.mjs +4 -4
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/paradigm.mjs +2 -2
- package/dist/chunks/permission-manager.mjs +2 -2
- package/dist/chunks/permissions.mjs +3 -3
- package/dist/chunks/persistence-manager.mjs +19 -12
- package/dist/chunks/persistence.mjs +5 -3
- package/dist/chunks/plugin.mjs +2 -2
- package/dist/chunks/prompts.mjs +5 -5
- package/dist/chunks/providers.mjs +2 -2
- package/dist/chunks/quick-actions.mjs +7 -6
- package/dist/chunks/quick-provider.mjs +5 -4
- package/dist/chunks/quick-setup.mjs +20 -15
- package/dist/chunks/remote.mjs +15 -16
- package/dist/chunks/{convoy-manager.mjs → session-manager.mjs} +1129 -1095
- package/dist/chunks/session.mjs +2 -2
- package/dist/chunks/sessions.mjs +3 -3
- package/dist/chunks/silent-updater.mjs +1 -1
- package/dist/chunks/simple-config.mjs +2 -2
- package/dist/chunks/skill2.mjs +3 -3
- package/dist/chunks/skills-sync.mjs +5 -5
- package/dist/chunks/skills.mjs +3 -3
- package/dist/chunks/slash-commands.mjs +9 -8
- package/dist/chunks/smart-defaults.mjs +9 -5
- package/dist/chunks/startup.mjs +1 -1
- package/dist/chunks/stats.mjs +2 -2
- package/dist/chunks/status.mjs +37 -22
- package/dist/chunks/team.mjs +3 -3
- package/dist/chunks/thinking.mjs +4 -4
- package/dist/chunks/trace.mjs +2 -2
- package/dist/chunks/uninstall.mjs +9 -9
- package/dist/chunks/update.mjs +14 -11
- package/dist/chunks/upgrade-manager.mjs +3 -3
- package/dist/chunks/upgrade.mjs +25 -9
- package/dist/chunks/version-checker.mjs +4 -4
- package/dist/chunks/vim.mjs +3 -3
- package/dist/chunks/workflows.mjs +1 -1
- package/dist/chunks/wsl.mjs +1 -1
- package/dist/chunks/zero-config.mjs +4 -4
- package/dist/cli.mjs +60 -26
- package/dist/index.d.mts +4392 -4392
- package/dist/index.d.ts +4392 -4392
- package/dist/index.mjs +4314 -4314
- package/dist/shared/{ccjk.DcKLglJQ.mjs → ccjk.BIxuVL3_.mjs} +2 -2
- package/dist/shared/{ccjk.DJdmgr2d.mjs → ccjk.BJMRY2Ra.mjs} +5 -3
- package/dist/shared/{ccjk.B1TwPltj.mjs → ccjk.BOu1yav7.mjs} +3 -2
- package/dist/shared/{ccjk.mJpVRDZ8.mjs → ccjk.BWFpnOr3.mjs} +1 -1
- package/dist/shared/{ccjk.BfIpomdz.mjs → ccjk.CHUEFqmw.mjs} +3 -2
- package/dist/shared/{ccjk.CqdbaXqU.mjs → ccjk.CLUL0pAV.mjs} +9 -5
- package/dist/shared/{ccjk.Cot9p9_n.mjs → ccjk.Cjj8SVrn.mjs} +1 -1
- package/dist/shared/{ccjk.CfrpIIKy.mjs → ccjk.Crd_nEfj.mjs} +38 -20
- package/dist/shared/{ccjk.DCw2WnZU.mjs → ccjk.CvChMYvB.mjs} +1 -1
- package/dist/shared/{ccjk.CXzjn01x.mjs → ccjk.D8ZLYSZZ.mjs} +1 -1
- package/dist/shared/{ccjk.BrPUmTqm.mjs → ccjk.DJuyfrlL.mjs} +164 -82
- package/dist/shared/{ccjk.DHXfsrwn.mjs → ccjk.DRfdq6yl.mjs} +4 -4
- package/dist/shared/{ccjk.DXRAZcix.mjs → ccjk.DScm_NnL.mjs} +8 -4
- package/dist/shared/{ccjk.XsJWJuQP.mjs → ccjk.DfZKjHvG.mjs} +6 -128
- package/dist/shared/{ccjk.BFxsJM0k.mjs → ccjk.DwSebGy0.mjs} +4 -3
- package/dist/shared/ccjk.DxWqH-EF.mjs +170 -0
- package/dist/shared/{ccjk.Cwa_FiTX.mjs → ccjk.I6IuYdc_.mjs} +2 -2
- package/dist/shared/{ccjk.DpstNaeR.mjs → ccjk.KpFl2RDA.mjs} +3 -3
- package/dist/shared/{ccjk.dYDLfmph.mjs → ccjk._dESH4Rk.mjs} +1 -1
- package/dist/shared/{ccjk.BxSmJ8B7.mjs → ccjk.wLJHO0Af.mjs} +2 -1
- package/package.json +2 -1
- package/dist/chunks/index15.mjs +0 -218
- package/dist/shared/{ccjk.c-ETfBZ_.mjs → ccjk.eIn-g1yI.mjs} +96 -96
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import a from '../chunks/
|
|
2
|
-
import { i as inquirer } from '../chunks/
|
|
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/
|
|
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.
|
|
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.
|
|
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,
|
|
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)
|
|
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,
|
|
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/
|
|
2
|
-
import { i as inquirer } from '../chunks/
|
|
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/
|
|
2
|
-
import { i as inquirer } from '../chunks/
|
|
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/
|
|
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/
|
|
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)
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccjk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.3.
|
|
4
|
+
"version": "13.3.7",
|
|
5
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.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "CCJK Team",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"node": ">=20"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
+
"better-sqlite3": "^12.6.2",
|
|
84
85
|
"fdir": "^6.5.0",
|
|
85
86
|
"globby": "^14.1.0",
|
|
86
87
|
"ioredis": "^5.9.3",
|
package/dist/chunks/index15.mjs
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { promisify } from 'node:util';
|
|
2
|
-
import childProcess from 'node:child_process';
|
|
3
|
-
import fs, { constants } from 'node:fs/promises';
|
|
4
|
-
import process__default from 'node:process';
|
|
5
|
-
import os__default from 'node:os';
|
|
6
|
-
import fs__default from 'node:fs';
|
|
7
|
-
import 'node:buffer';
|
|
8
|
-
|
|
9
|
-
let isDockerCached;
|
|
10
|
-
|
|
11
|
-
function hasDockerEnv() {
|
|
12
|
-
try {
|
|
13
|
-
fs__default.statSync('/.dockerenv');
|
|
14
|
-
return true;
|
|
15
|
-
} catch {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function hasDockerCGroup() {
|
|
21
|
-
try {
|
|
22
|
-
return fs__default.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
|
|
23
|
-
} catch {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function isDocker() {
|
|
29
|
-
// TODO: Use `??=` when targeting Node.js 16.
|
|
30
|
-
if (isDockerCached === undefined) {
|
|
31
|
-
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return isDockerCached;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let cachedResult;
|
|
38
|
-
|
|
39
|
-
// Podman detection
|
|
40
|
-
const hasContainerEnv = () => {
|
|
41
|
-
try {
|
|
42
|
-
fs__default.statSync('/run/.containerenv');
|
|
43
|
-
return true;
|
|
44
|
-
} catch {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
function isInsideContainer() {
|
|
50
|
-
// TODO: Use `??=` when targeting Node.js 16.
|
|
51
|
-
if (cachedResult === undefined) {
|
|
52
|
-
cachedResult = hasContainerEnv() || isDocker();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return cachedResult;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const isWsl = () => {
|
|
59
|
-
if (process__default.platform !== 'linux') {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (os__default.release().toLowerCase().includes('microsoft')) {
|
|
64
|
-
if (isInsideContainer()) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
try {
|
|
72
|
-
if (fs__default.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft')) {
|
|
73
|
-
return !isInsideContainer();
|
|
74
|
-
}
|
|
75
|
-
} catch {}
|
|
76
|
-
|
|
77
|
-
// Fallback for custom kernels: check WSL-specific paths.
|
|
78
|
-
if (
|
|
79
|
-
fs__default.existsSync('/proc/sys/fs/binfmt_misc/WSLInterop')
|
|
80
|
-
|| fs__default.existsSync('/run/WSL')
|
|
81
|
-
) {
|
|
82
|
-
return !isInsideContainer();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return false;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const isWsl$1 = process__default.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
89
|
-
|
|
90
|
-
promisify(childProcess.execFile);
|
|
91
|
-
|
|
92
|
-
const powerShellPath$1 = () => `${process__default.env.SYSTEMROOT || process__default.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
93
|
-
|
|
94
|
-
function parseMountPointFromConfig(content) {
|
|
95
|
-
for (const line of content.split('\n')) {
|
|
96
|
-
// Skip comment lines
|
|
97
|
-
if (/^\s*#/.test(line)) {
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Match root at start of line (after optional whitespace)
|
|
102
|
-
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
103
|
-
if (!match) {
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return match.groups.mountPoint
|
|
108
|
-
.trim()
|
|
109
|
-
// Strip surrounding quotes
|
|
110
|
-
.replaceAll(/^["']|["']$/g, '');
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const execFile = promisify(childProcess.execFile);
|
|
115
|
-
|
|
116
|
-
const wslDrivesMountPoint = (() => {
|
|
117
|
-
// Default value for "root" param
|
|
118
|
-
// according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config
|
|
119
|
-
const defaultMountPoint = '/mnt/';
|
|
120
|
-
|
|
121
|
-
let mountPoint;
|
|
122
|
-
|
|
123
|
-
return async function () {
|
|
124
|
-
if (mountPoint) {
|
|
125
|
-
// Return memoized mount point value
|
|
126
|
-
return mountPoint;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const configFilePath = '/etc/wsl.conf';
|
|
130
|
-
|
|
131
|
-
let isConfigFileExists = false;
|
|
132
|
-
try {
|
|
133
|
-
await fs.access(configFilePath, constants.F_OK);
|
|
134
|
-
isConfigFileExists = true;
|
|
135
|
-
} catch {}
|
|
136
|
-
|
|
137
|
-
if (!isConfigFileExists) {
|
|
138
|
-
return defaultMountPoint;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const configContent = await fs.readFile(configFilePath, {encoding: 'utf8'});
|
|
142
|
-
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
143
|
-
|
|
144
|
-
if (parsedMountPoint === undefined) {
|
|
145
|
-
return defaultMountPoint;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
mountPoint = parsedMountPoint;
|
|
149
|
-
mountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;
|
|
150
|
-
|
|
151
|
-
return mountPoint;
|
|
152
|
-
};
|
|
153
|
-
})();
|
|
154
|
-
|
|
155
|
-
const powerShellPathFromWsl = async () => {
|
|
156
|
-
const mountPoint = await wslDrivesMountPoint();
|
|
157
|
-
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
const powerShellPath = isWsl$1 ? powerShellPathFromWsl : powerShellPath$1;
|
|
161
|
-
|
|
162
|
-
// Cache for PowerShell accessibility check
|
|
163
|
-
let canAccessPowerShellPromise;
|
|
164
|
-
|
|
165
|
-
const canAccessPowerShell = async () => {
|
|
166
|
-
canAccessPowerShellPromise ??= (async () => {
|
|
167
|
-
try {
|
|
168
|
-
const psPath = await powerShellPath();
|
|
169
|
-
await fs.access(psPath, constants.X_OK);
|
|
170
|
-
return true;
|
|
171
|
-
} catch {
|
|
172
|
-
// PowerShell is not accessible (either doesn't exist, no execute permission, or other error)
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
})();
|
|
176
|
-
|
|
177
|
-
return canAccessPowerShellPromise;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
const isUrl = path => /^[a-z]+:\/\//i.test(path);
|
|
181
|
-
|
|
182
|
-
const convertWslPathToWindows = async paths => {
|
|
183
|
-
const isBatch = Array.isArray(paths);
|
|
184
|
-
const pathArray = isBatch ? paths : [paths];
|
|
185
|
-
|
|
186
|
-
// Find indices of non-URL paths that need conversion
|
|
187
|
-
const indicesToConvert = [];
|
|
188
|
-
const pathsToConvert = [];
|
|
189
|
-
|
|
190
|
-
for (const [index, path] of pathArray.entries()) {
|
|
191
|
-
if (!isUrl(path)) {
|
|
192
|
-
indicesToConvert.push(index);
|
|
193
|
-
pathsToConvert.push(path);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Start with original paths (URLs stay as-is)
|
|
198
|
-
const results = [...pathArray];
|
|
199
|
-
|
|
200
|
-
if (pathsToConvert.length > 0) {
|
|
201
|
-
try {
|
|
202
|
-
const {stdout} = await execFile('wslpath', ['-aw', ...pathsToConvert], {encoding: 'utf8'});
|
|
203
|
-
const convertedPaths = stdout.split(/\r?\n/).filter(Boolean);
|
|
204
|
-
|
|
205
|
-
for (const [index, originalIndex] of indicesToConvert.entries()) {
|
|
206
|
-
results[originalIndex] = convertedPaths[index] ?? pathArray[originalIndex];
|
|
207
|
-
}
|
|
208
|
-
} catch {
|
|
209
|
-
// If wslpath fails, keep original paths
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return isBatch ? results : results[0];
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
const isUncPath = path => /^\\\\/u.test(path);
|
|
217
|
-
|
|
218
|
-
export { canAccessPowerShell, convertWslPathToWindows, isUncPath, isWsl$1 as isWsl, powerShellPath, powerShellPathFromWsl, wslDrivesMountPoint };
|