ccjk 12.3.4 → 13.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/chunks/api-cli.mjs +1 -1
  2. package/dist/chunks/api.mjs +2 -2
  3. package/dist/chunks/auto-fix.mjs +148 -0
  4. package/dist/chunks/auto-upgrade.mjs +150 -0
  5. package/dist/chunks/ccjk-agents.mjs +1 -2
  6. package/dist/chunks/ccjk-all.mjs +5 -6
  7. package/dist/chunks/ccjk-hooks.mjs +4 -5
  8. package/dist/chunks/ccjk-mcp.mjs +6 -7
  9. package/dist/chunks/ccjk-setup.mjs +1 -2
  10. package/dist/chunks/ccjk-skills.mjs +5 -6
  11. package/dist/chunks/ccr.mjs +1 -2
  12. package/dist/chunks/claude-code-config-manager.mjs +1 -1
  13. package/dist/chunks/commands2.mjs +11 -3
  14. package/dist/chunks/config.mjs +26 -1
  15. package/dist/chunks/doctor.mjs +1 -1
  16. package/dist/chunks/index14.mjs +6 -5
  17. package/dist/chunks/index2.mjs +2 -2
  18. package/dist/chunks/init.mjs +2 -2
  19. package/dist/chunks/installer2.mjs +74 -150
  20. package/dist/chunks/intent-engine.mjs +142 -0
  21. package/dist/chunks/menu-hierarchical.mjs +1 -2
  22. package/dist/chunks/menu.mjs +23 -2
  23. package/dist/chunks/onboarding-wizard.mjs +1 -1
  24. package/dist/chunks/package.mjs +1 -1
  25. package/dist/chunks/slash-commands.mjs +1 -1
  26. package/dist/chunks/smart-guide.mjs +8 -8
  27. package/dist/chunks/upgrade.mjs +34 -0
  28. package/dist/cli.mjs +42 -13
  29. package/dist/i18n/locales/en/agentBrowser.json +1 -0
  30. package/dist/i18n/locales/zh-CN/agentBrowser.json +1 -0
  31. package/dist/index.d.mts +222 -126
  32. package/dist/index.d.ts +222 -126
  33. package/dist/index.mjs +7 -4
  34. package/dist/shared/{ccjk.CtXhbEqb.mjs → ccjk.CqdbaXqU.mjs} +1 -1
  35. package/dist/shared/{ccjk.DfXjf8EC.mjs → ccjk.Cwa_FiTX.mjs} +1 -1
  36. package/dist/shared/{ccjk.hrRv8G6j.mjs → ccjk.DHXfsrwn.mjs} +1502 -3
  37. package/dist/shared/{ccjk.CL4Yat0G.mjs → ccjk.DopKzo3z.mjs} +3 -1
  38. package/package.json +64 -67
  39. package/dist/shared/ccjk.UIvifqNE.mjs +0 -1486
@@ -1,7 +1,7 @@
1
1
  import a from './index3.mjs';
2
2
  import { i18n } from './index6.mjs';
3
3
  import { d as configureApi, g as getExistingApiConfig } from './config.mjs';
4
- import { g as getAllPresets } from '../shared/ccjk.CL4Yat0G.mjs';
4
+ import { g as getAllPresets } from '../shared/ccjk.DopKzo3z.mjs';
5
5
  import '../shared/ccjk.BAGoDD49.mjs';
6
6
  import 'node:fs';
7
7
  import 'node:process';
@@ -1,8 +1,8 @@
1
1
  import a from './index3.mjs';
2
2
  import { i18n, format } from './index6.mjs';
3
3
  import { STATUS, COLORS as theme } from './banner.mjs';
4
- import { r as runConfigWizard, t as testApiConnection, d as displayCurrentStatus, q as quickSetup } from '../shared/ccjk.DfXjf8EC.mjs';
5
- import { g as getAllPresets } from '../shared/ccjk.CL4Yat0G.mjs';
4
+ import { r as runConfigWizard, t as testApiConnection, d as displayCurrentStatus, q as quickSetup } from '../shared/ccjk.Cwa_FiTX.mjs';
5
+ import { g as getAllPresets } from '../shared/ccjk.DopKzo3z.mjs';
6
6
  import '../shared/ccjk.BAGoDD49.mjs';
7
7
  import 'node:fs';
8
8
  import 'node:process';
@@ -0,0 +1,148 @@
1
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { homedir } from 'node:os';
4
+
5
+ async function detectSettingsIssues() {
6
+ const issues = [];
7
+ const settingsPath = join(homedir(), ".claude", "settings.json");
8
+ if (!existsSync(settingsPath)) {
9
+ issues.push({
10
+ type: "missing",
11
+ severity: "critical",
12
+ description: "settings.json not found",
13
+ fix: async () => {
14
+ try {
15
+ const { init } = await import('./init.mjs').then(function (n) { return n.c; });
16
+ await init({ silent: true, skipPrompt: true });
17
+ return true;
18
+ } catch {
19
+ return false;
20
+ }
21
+ }
22
+ });
23
+ return issues;
24
+ }
25
+ try {
26
+ const content = readFileSync(settingsPath, "utf-8");
27
+ const settings = JSON.parse(content);
28
+ if (!settings.apiType) {
29
+ issues.push({
30
+ type: "invalid",
31
+ severity: "critical",
32
+ description: "Missing apiType in settings.json",
33
+ fix: async () => {
34
+ settings.apiType = "anthropic";
35
+ writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
36
+ return true;
37
+ }
38
+ });
39
+ }
40
+ if (!settings.apiKey && !process.env.ANTHROPIC_API_KEY) {
41
+ issues.push({
42
+ type: "missing",
43
+ severity: "warning",
44
+ description: "No API key configured",
45
+ fix: async () => {
46
+ console.log("\u26A0\uFE0F Please run: ccjk init --api-key YOUR_KEY");
47
+ return false;
48
+ }
49
+ });
50
+ }
51
+ } catch (error) {
52
+ issues.push({
53
+ type: "invalid",
54
+ severity: "critical",
55
+ description: "Invalid JSON format in settings.json",
56
+ fix: async () => {
57
+ try {
58
+ const backupPath = `${settingsPath}.backup`;
59
+ const content = readFileSync(settingsPath, "utf-8");
60
+ writeFileSync(backupPath, content);
61
+ const { init } = await import('./init.mjs').then(function (n) { return n.c; });
62
+ await init({ silent: true, skipPrompt: true, force: true });
63
+ return true;
64
+ } catch {
65
+ return false;
66
+ }
67
+ }
68
+ });
69
+ }
70
+ return issues;
71
+ }
72
+ async function detectMcpIssues() {
73
+ const issues = [];
74
+ const mcpConfigPath = join(homedir(), ".claude", "mcp_settings.json");
75
+ if (!existsSync(mcpConfigPath)) {
76
+ return issues;
77
+ }
78
+ try {
79
+ const content = readFileSync(mcpConfigPath, "utf-8");
80
+ JSON.parse(content);
81
+ } catch {
82
+ issues.push({
83
+ type: "invalid",
84
+ severity: "warning",
85
+ description: "Invalid MCP configuration",
86
+ fix: async () => {
87
+ try {
88
+ const backupPath = `${mcpConfigPath}.backup`;
89
+ const content = readFileSync(mcpConfigPath, "utf-8");
90
+ writeFileSync(backupPath, content);
91
+ writeFileSync(mcpConfigPath, JSON.stringify({ mcpServers: {} }, null, 2));
92
+ return true;
93
+ } catch {
94
+ return false;
95
+ }
96
+ }
97
+ });
98
+ }
99
+ return issues;
100
+ }
101
+ async function autoFixAll(silent = true) {
102
+ const allIssues = [
103
+ ...await detectSettingsIssues(),
104
+ ...await detectMcpIssues()
105
+ ];
106
+ let fixed = 0;
107
+ let failed = 0;
108
+ for (const issue of allIssues) {
109
+ if (issue.severity === "info") {
110
+ continue;
111
+ }
112
+ if (!silent) {
113
+ console.log(`\u{1F527} Fixing: ${issue.description}`);
114
+ }
115
+ try {
116
+ const success = await issue.fix();
117
+ if (success) {
118
+ fixed++;
119
+ if (!silent) {
120
+ console.log(` \u2705 Fixed`);
121
+ }
122
+ } else {
123
+ failed++;
124
+ if (!silent) {
125
+ console.log(` \u274C Failed`);
126
+ }
127
+ }
128
+ } catch (error) {
129
+ failed++;
130
+ if (!silent) {
131
+ console.log(` \u274C Error: ${error}`);
132
+ }
133
+ }
134
+ }
135
+ return {
136
+ fixed,
137
+ failed,
138
+ total: allIssues.length
139
+ };
140
+ }
141
+ async function runAutoFixOnStartup() {
142
+ try {
143
+ await autoFixAll(true);
144
+ } catch {
145
+ }
146
+ }
147
+
148
+ export { autoFixAll, detectMcpIssues, detectSettingsIssues, runAutoFixOnStartup };
@@ -0,0 +1,150 @@
1
+ import { execSync } from 'node:child_process';
2
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { homedir } from 'node:os';
5
+
6
+ function getCurrentVersion() {
7
+ try {
8
+ const packagePath = join(__dirname, "../../package.json");
9
+ const pkg = JSON.parse(readFileSync(packagePath, "utf-8"));
10
+ return pkg.version;
11
+ } catch {
12
+ return "0.0.0";
13
+ }
14
+ }
15
+ async function getLatestVersion() {
16
+ try {
17
+ const result = execSync("npm view @cometx/ccjk version", {
18
+ encoding: "utf-8",
19
+ timeout: 3e3,
20
+ stdio: ["pipe", "pipe", "ignore"]
21
+ // 忽略 stderr
22
+ });
23
+ return result.trim();
24
+ } catch {
25
+ return getCurrentVersion();
26
+ }
27
+ }
28
+ function compareVersions(v1, v2) {
29
+ const parts1 = v1.split(".").map(Number);
30
+ const parts2 = v2.split(".").map(Number);
31
+ for (let i = 0; i < 3; i++) {
32
+ const p1 = parts1[i] || 0;
33
+ const p2 = parts2[i] || 0;
34
+ if (p1 > p2)
35
+ return 1;
36
+ if (p1 < p2)
37
+ return -1;
38
+ }
39
+ return 0;
40
+ }
41
+ function detectUpdateType(current, latest) {
42
+ const c = current.split(".").map(Number);
43
+ const l = latest.split(".").map(Number);
44
+ if (l[0] > c[0])
45
+ return "major";
46
+ if (l[1] > c[1])
47
+ return "minor";
48
+ if (l[2] > c[2])
49
+ return "patch";
50
+ return null;
51
+ }
52
+ async function checkForUpdates() {
53
+ const current = getCurrentVersion();
54
+ const latest = await getLatestVersion();
55
+ const hasUpdate = compareVersions(latest, current) > 0;
56
+ const updateType = hasUpdate ? detectUpdateType(current, latest) : null;
57
+ return {
58
+ current,
59
+ latest,
60
+ hasUpdate,
61
+ updateType
62
+ };
63
+ }
64
+ const PROMPT_STATE_FILE = join(homedir(), ".claude", ".upgrade-state.json");
65
+ const CHECK_INTERVAL = 24 * 60 * 60 * 1e3;
66
+ const PROMPT_INTERVAL = 7 * 24 * 60 * 60 * 1e3;
67
+ function readPromptState() {
68
+ try {
69
+ if (existsSync(PROMPT_STATE_FILE)) {
70
+ return JSON.parse(readFileSync(PROMPT_STATE_FILE, "utf-8"));
71
+ }
72
+ } catch {
73
+ }
74
+ return {
75
+ lastChecked: 0,
76
+ lastPrompted: 0
77
+ };
78
+ }
79
+ function savePromptState(state) {
80
+ try {
81
+ writeFileSync(PROMPT_STATE_FILE, JSON.stringify(state, null, 2));
82
+ } catch {
83
+ }
84
+ }
85
+ function shouldShowPrompt(versionInfo, state) {
86
+ const now = Date.now();
87
+ if (state.dismissedVersion === versionInfo.latest) {
88
+ return false;
89
+ }
90
+ if (now - state.lastPrompted < PROMPT_INTERVAL) {
91
+ return false;
92
+ }
93
+ return versionInfo.hasUpdate;
94
+ }
95
+ function showUpgradePrompt(versionInfo) {
96
+ const { current, latest, updateType } = versionInfo;
97
+ console.log("\n" + "=".repeat(60));
98
+ console.log("\u{1F680} New version available!");
99
+ console.log(` Current: v${current}`);
100
+ console.log(` Latest: v${latest} (${updateType} update)`);
101
+ console.log("\n Upgrade now:");
102
+ console.log(" npm install -g @cometx/ccjk@latest");
103
+ console.log(" # or");
104
+ console.log(" pnpm add -g @cometx/ccjk@latest");
105
+ console.log("=".repeat(60) + "\n");
106
+ }
107
+ async function autoCheckUpdates(silent = false) {
108
+ try {
109
+ const state = readPromptState();
110
+ const now = Date.now();
111
+ if (now - state.lastChecked < CHECK_INTERVAL) {
112
+ return;
113
+ }
114
+ state.lastChecked = now;
115
+ savePromptState(state);
116
+ const versionInfo = await checkForUpdates();
117
+ if (!silent && shouldShowPrompt(versionInfo, state)) {
118
+ showUpgradePrompt(versionInfo);
119
+ state.lastPrompted = now;
120
+ savePromptState(state);
121
+ }
122
+ } catch {
123
+ }
124
+ }
125
+ async function performUpgrade() {
126
+ try {
127
+ console.log("\u{1F680} Upgrading CCJK...");
128
+ let packageManager = "npm";
129
+ try {
130
+ execSync("pnpm --version", { stdio: "ignore" });
131
+ packageManager = "pnpm";
132
+ } catch {
133
+ try {
134
+ execSync("yarn --version", { stdio: "ignore" });
135
+ packageManager = "yarn";
136
+ } catch {
137
+ }
138
+ }
139
+ const command = packageManager === "yarn" ? "yarn global add @cometx/ccjk@latest" : `${packageManager} add -g @cometx/ccjk@latest`;
140
+ console.log(` Running: ${command}`);
141
+ execSync(command, { stdio: "inherit" });
142
+ console.log("\n\u2705 Upgrade completed!");
143
+ return true;
144
+ } catch (error) {
145
+ console.error("\u274C Upgrade failed:", error);
146
+ return false;
147
+ }
148
+ }
149
+
150
+ export { autoCheckUpdates, checkForUpdates, performUpgrade };
@@ -1,6 +1,5 @@
1
1
  import process__default, { cwd } from 'node:process';
2
- import { c as consola, g as getTemplatesClient } from '../shared/ccjk.UIvifqNE.mjs';
3
- import { P as ProjectAnalyzer } from '../shared/ccjk.hrRv8G6j.mjs';
2
+ import { c as consola, P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.DHXfsrwn.mjs';
4
3
  import { i18n } from './index6.mjs';
5
4
  import { existsSync, readFileSync, writeFileSync, readdirSync } from 'node:fs';
6
5
  import { CLAUDE_AGENTS_DIR } from './constants.mjs';
@@ -1,11 +1,10 @@
1
1
  import a from './index3.mjs';
2
- import { c as consola } from '../shared/ccjk.UIvifqNE.mjs';
3
- import { c as createCompleteCloudClient } from '../shared/ccjk.CtXhbEqb.mjs';
2
+ import { c as consola, a as analyzeProject } from '../shared/ccjk.DHXfsrwn.mjs';
3
+ import { c as createCompleteCloudClient } from '../shared/ccjk.CqdbaXqU.mjs';
4
4
  import { i18n, ensureI18nInitialized } from './index6.mjs';
5
5
  import { createHash } from 'node:crypto';
6
6
  import { promises, readFileSync } from 'node:fs';
7
7
  import { join } from 'node:path';
8
- import { a as analyzeProject } from '../shared/ccjk.hrRv8G6j.mjs';
9
8
  import { c as createDefaultGateway } from '../shared/ccjk.BtB1e5jm.mjs';
10
9
  import { ccjkAgents } from './ccjk-agents.mjs';
11
10
  import { ccjkHooks } from './ccjk-hooks.mjs';
@@ -13,12 +12,12 @@ import { ccjkMcp } from './ccjk-mcp.mjs';
13
12
  import { ccjkSkills } from './ccjk-skills.mjs';
14
13
  import { e as extractString } from '../shared/ccjk.C2jHOZVP.mjs';
15
14
  import '../shared/ccjk.BAGoDD49.mjs';
16
- import 'node:url';
17
- import 'node:process';
18
- import '../shared/ccjk.bQ7Dh1g4.mjs';
19
15
  import './index9.mjs';
16
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
20
17
  import 'tinyglobby';
21
18
  import '../shared/ccjk.BBtCGd_g.mjs';
19
+ import 'node:url';
20
+ import 'node:process';
22
21
  import './constants.mjs';
23
22
  import 'node:os';
24
23
  import '../shared/ccjk.D6ycHbak.mjs';
@@ -1,13 +1,15 @@
1
1
  import { performance } from 'node:perf_hooks';
2
- import { c as consola, g as getTemplatesClient } from '../shared/ccjk.UIvifqNE.mjs';
2
+ import { c as consola, P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.DHXfsrwn.mjs';
3
3
  import { i as inquirer } from './index4.mjs';
4
- import { P as ProjectAnalyzer } from '../shared/ccjk.hrRv8G6j.mjs';
5
4
  import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs';
6
5
  import process__default from 'node:process';
7
6
  import { exec } from 'node:child_process';
8
7
  import { promisify } from 'node:util';
9
8
  import { j as join, d as dirname } from '../shared/ccjk.bQ7Dh1g4.mjs';
10
9
  import { i18n } from './index6.mjs';
10
+ import './index9.mjs';
11
+ import 'tinyglobby';
12
+ import '../shared/ccjk.BBtCGd_g.mjs';
11
13
  import 'node:readline';
12
14
  import '../shared/ccjk.BAGoDD49.mjs';
13
15
  import 'stream';
@@ -22,9 +24,6 @@ import 'node:os';
22
24
  import 'node:crypto';
23
25
  import 'buffer';
24
26
  import 'string_decoder';
25
- import './index9.mjs';
26
- import 'tinyglobby';
27
- import '../shared/ccjk.BBtCGd_g.mjs';
28
27
  import 'node:url';
29
28
 
30
29
  var HookType = /* @__PURE__ */ ((HookType2) => {
@@ -1,14 +1,18 @@
1
1
  import { join } from 'node:path';
2
2
  import { cwd } from 'node:process';
3
3
  import a from './index3.mjs';
4
- import { c as consola, g as getTemplatesClient } from '../shared/ccjk.UIvifqNE.mjs';
4
+ import { c as consola, a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.DHXfsrwn.mjs';
5
5
  import { i as inquirer } from './index4.mjs';
6
- import { a as analyzeProject } from '../shared/ccjk.hrRv8G6j.mjs';
7
6
  import { CLAUDE_DIR } from './constants.mjs';
8
7
  import { ensureI18nInitialized, i18n } from './index6.mjs';
9
8
  import { c as backupMcpConfig, r as readMcpConfig, m as mergeMcpServers, w as writeMcpConfig } from './claude-config.mjs';
10
9
  import { e as commandExists } from './platform.mjs';
11
10
  import '../shared/ccjk.BAGoDD49.mjs';
11
+ import 'node:fs';
12
+ import './index9.mjs';
13
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
14
+ import 'tinyglobby';
15
+ import '../shared/ccjk.BBtCGd_g.mjs';
12
16
  import 'node:readline';
13
17
  import 'stream';
14
18
  import 'node:tty';
@@ -22,11 +26,6 @@ import 'node:os';
22
26
  import 'node:crypto';
23
27
  import 'buffer';
24
28
  import 'string_decoder';
25
- import 'node:fs';
26
- import './index9.mjs';
27
- import '../shared/ccjk.bQ7Dh1g4.mjs';
28
- import 'tinyglobby';
29
- import '../shared/ccjk.BBtCGd_g.mjs';
30
29
  import 'node:url';
31
30
  import './json-config.mjs';
32
31
  import '../shared/ccjk.RyizuzOI.mjs';
@@ -1,6 +1,5 @@
1
1
  import a from './index3.mjs';
2
- import { c as consola } from '../shared/ccjk.UIvifqNE.mjs';
3
- import { P as ProjectAnalyzer } from '../shared/ccjk.hrRv8G6j.mjs';
2
+ import { c as consola, P as ProjectAnalyzer } from '../shared/ccjk.DHXfsrwn.mjs';
4
3
  import { i18n } from './index6.mjs';
5
4
  import { promises } from 'node:fs';
6
5
  import { performance } from 'node:perf_hooks';
@@ -3,12 +3,15 @@ import { homedir } from 'node:os';
3
3
  import { join, dirname } from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import a from './index3.mjs';
6
- import { c as consola, g as getTemplatesClient } from '../shared/ccjk.UIvifqNE.mjs';
6
+ import { c as consola, a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.DHXfsrwn.mjs';
7
7
  import { i as inquirer } from './index4.mjs';
8
- import { a as analyzeProject } from '../shared/ccjk.hrRv8G6j.mjs';
9
8
  import { i18n } from './index6.mjs';
10
9
  import { g as getSkillParser } from '../shared/ccjk.DsYaCCx4.mjs';
11
10
  import '../shared/ccjk.BAGoDD49.mjs';
11
+ import './index9.mjs';
12
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
13
+ import 'tinyglobby';
14
+ import '../shared/ccjk.BBtCGd_g.mjs';
12
15
  import 'node:readline';
13
16
  import 'stream';
14
17
  import 'node:tty';
@@ -22,10 +25,6 @@ import 'child_process';
22
25
  import 'node:crypto';
23
26
  import 'buffer';
24
27
  import 'string_decoder';
25
- import './index9.mjs';
26
- import '../shared/ccjk.bQ7Dh1g4.mjs';
27
- import 'tinyglobby';
28
- import '../shared/ccjk.BBtCGd_g.mjs';
29
28
 
30
29
  const __filename = fileURLToPath(import.meta.url);
31
30
  const __dirname = dirname(__filename);
@@ -60,8 +60,7 @@ import '../shared/ccjk.dYDLfmph.mjs';
60
60
  import './simple-config.mjs';
61
61
  import './commands.mjs';
62
62
  import './ccjk-agents.mjs';
63
- import '../shared/ccjk.UIvifqNE.mjs';
64
- import '../shared/ccjk.hrRv8G6j.mjs';
63
+ import '../shared/ccjk.DHXfsrwn.mjs';
65
64
  import './index9.mjs';
66
65
  import 'tinyglobby';
67
66
  import '../shared/ccjk.CfKKcvWy.mjs';
@@ -206,7 +206,7 @@ class ClaudeCodeConfigManager {
206
206
  ensureI18nInitialized();
207
207
  try {
208
208
  if (!profile) {
209
- const { switchToOfficialLogin } = await import('./config.mjs').then(function (n) { return n.j; });
209
+ const { switchToOfficialLogin } = await import('./config.mjs').then(function (n) { return n.k; });
210
210
  switchToOfficialLogin();
211
211
  return;
212
212
  }
@@ -1,10 +1,20 @@
1
1
  import process__default from 'node:process';
2
2
  import a from './index3.mjs';
3
- import { checkAgentBrowserInstalled, getInstallPath } from './installer2.mjs';
3
+ import { checkAgentBrowserInstalled } from './installer2.mjs';
4
4
  import '../shared/ccjk.BAGoDD49.mjs';
5
+ import 'node:child_process';
6
+ import 'node:util';
7
+ import './index6.mjs';
5
8
  import 'node:fs';
9
+ import 'node:url';
10
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
11
+ import './platform.mjs';
6
12
  import 'node:os';
13
+ import './main.mjs';
14
+ import 'module';
7
15
  import 'node:path';
16
+ import 'node:stream';
17
+ import 'node:readline';
8
18
 
9
19
  const { cyan: _cyan, yellow: yellow$1, gray: _gray, green: green$1, red: _red, blue: _blue$1, bold: _bold, dim: _dim$1 } = a;
10
20
  class AgentBrowserSession {
@@ -284,10 +294,8 @@ async function agentBrowserStatus(options) {
284
294
  ${bold(cyan("Agent Browser Status"))}
285
295
  `);
286
296
  const installed = await checkAgentBrowserInstalled();
287
- const installPath = getInstallPath();
288
297
  if (installed) {
289
298
  console.log(` ${green("\u2713")} Agent Browser is ${green("installed")}`);
290
- console.log(` ${gray("Path:")} ${installPath}`);
291
299
  try {
292
300
  const { execSync } = await import('node:child_process');
293
301
  const version = execSync('agent-browser --version 2>/dev/null || echo "unknown"', {
@@ -157,6 +157,9 @@ function updateCustomModel(primaryModel, haikuModel, sonnetModel, opusModel) {
157
157
  delete settings.model;
158
158
  settings.env = settings.env || {};
159
159
  clearModelEnv(settings.env);
160
+ if (primaryModel?.trim()) {
161
+ settings.env.ANTHROPIC_MODEL = primaryModel.trim();
162
+ }
160
163
  if (haikuModel?.trim())
161
164
  settings.env.ANTHROPIC_DEFAULT_HAIKU_MODEL = haikuModel.trim();
162
165
  if (sonnetModel?.trim())
@@ -259,6 +262,27 @@ function getExistingModelConfig() {
259
262
  }
260
263
  return "default";
261
264
  }
265
+ function getExistingCustomModelConfig() {
266
+ const settings = readJsonConfig(SETTINGS_FILE);
267
+ if (!settings || !settings.env) {
268
+ return null;
269
+ }
270
+ const {
271
+ ANTHROPIC_MODEL,
272
+ ANTHROPIC_DEFAULT_HAIKU_MODEL,
273
+ ANTHROPIC_DEFAULT_SONNET_MODEL,
274
+ ANTHROPIC_DEFAULT_OPUS_MODEL
275
+ } = settings.env;
276
+ if (!ANTHROPIC_MODEL && !ANTHROPIC_DEFAULT_HAIKU_MODEL && !ANTHROPIC_DEFAULT_SONNET_MODEL && !ANTHROPIC_DEFAULT_OPUS_MODEL) {
277
+ return null;
278
+ }
279
+ return {
280
+ primaryModel: ANTHROPIC_MODEL,
281
+ haikuModel: ANTHROPIC_DEFAULT_HAIKU_MODEL,
282
+ sonnetModel: ANTHROPIC_DEFAULT_SONNET_MODEL,
283
+ opusModel: ANTHROPIC_DEFAULT_OPUS_MODEL
284
+ };
285
+ }
262
286
  function getExistingApiConfig() {
263
287
  const settings = readJsonConfig(SETTINGS_FILE);
264
288
  if (!settings || !settings.env) {
@@ -364,6 +388,7 @@ const config = {
364
388
  copyConfigFiles: copyConfigFiles,
365
389
  ensureClaudeDir: ensureClaudeDir,
366
390
  getExistingApiConfig: getExistingApiConfig,
391
+ getExistingCustomModelConfig: getExistingCustomModelConfig,
367
392
  getExistingModelConfig: getExistingModelConfig,
368
393
  mergeConfigs: mergeConfigs,
369
394
  mergeSettingsFile: mergeSettingsFile,
@@ -373,4 +398,4 @@ const config = {
373
398
  updateDefaultModel: updateDefaultModel
374
399
  };
375
400
 
376
- export { clearModelEnv as a, backupExistingConfig as b, copyConfigFiles as c, configureApi as d, applyAiLanguageDirective as e, getExistingModelConfig as f, getExistingApiConfig as g, updateDefaultModel as h, ensureClaudeDir as i, config as j, promptApiConfigurationAction as p, switchToOfficialLogin as s, updateCustomModel as u };
401
+ export { clearModelEnv as a, backupExistingConfig as b, copyConfigFiles as c, configureApi as d, applyAiLanguageDirective as e, getExistingModelConfig as f, getExistingApiConfig as g, getExistingCustomModelConfig as h, updateDefaultModel as i, ensureClaudeDir as j, config as k, promptApiConfigurationAction as p, switchToOfficialLogin as s, updateCustomModel as u };
@@ -814,7 +814,7 @@ async function checkPermissionRules() {
814
814
  }
815
815
  async function fixSettingsFile() {
816
816
  const isZh = i18n.language === "zh-CN";
817
- const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.j; });
817
+ const { copyConfigFiles } = await import('./config.mjs').then(function (n) { return n.k; });
818
818
  console.log("");
819
819
  console.log(a.bold.cyan("\u{1F527} Fixing settings.json"));
820
820
  console.log(a.dim("\u2500".repeat(50)));
@@ -10,11 +10,12 @@ import './index6.mjs';
10
10
  import 'node:url';
11
11
 
12
12
  const CORE_SKILLS = [
13
- "agent-browser",
14
- "tdd",
15
- "debugging",
16
- "code-review",
17
- "git-worktrees"
13
+ "brainstorming",
14
+ "writing-plans",
15
+ "executing-plans",
16
+ "systematic-debugging",
17
+ "test-driven-development",
18
+ "using-git-worktrees"
18
19
  ];
19
20
 
20
21
  function getSuperpowersDir$1() {
@@ -1,5 +1,5 @@
1
- export { c as configureOfficialMode, a as configureSimpleMode, b as configureWithPreset, e as detectCurrentMode, d as displayCurrentStatus, g as getCurrentConfig, q as quickSetup, r as runConfigWizard, t as testApiConnection, v as validateApiKey } from '../shared/ccjk.DfXjf8EC.mjs';
2
- export { P as PROVIDER_PRESETS, g as getAllPresets, a as getChinesePresets, b as getPresetById, c as getRecommendedPresets } from '../shared/ccjk.CL4Yat0G.mjs';
1
+ export { c as configureOfficialMode, a as configureSimpleMode, b as configureWithPreset, e as detectCurrentMode, d as displayCurrentStatus, g as getCurrentConfig, q as quickSetup, r as runConfigWizard, t as testApiConnection, v as validateApiKey } from '../shared/ccjk.Cwa_FiTX.mjs';
2
+ export { P as PROVIDER_PRESETS, g as getAllPresets, a as getChinesePresets, b as getPresetById, c as getRecommendedPresets } from '../shared/ccjk.DopKzo3z.mjs';
3
3
  import './index3.mjs';
4
4
  import '../shared/ccjk.BAGoDD49.mjs';
5
5
  import './index4.mjs';
@@ -17,7 +17,7 @@ import { a as addCompletedOnboarding, s as setPrimaryApiKey, c as backupMcpConfi
17
17
  import { r as resolveCodeType } from '../shared/ccjk.Cot9p9_n.mjs';
18
18
  import { exists } from './fs-operations.mjs';
19
19
  import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
20
- import { p as promptApiConfigurationAction, i as ensureClaudeDir, g as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, c as copyConfigFiles, e as applyAiLanguageDirective, d as configureApi } from './config.mjs';
20
+ import { p as promptApiConfigurationAction, j as ensureClaudeDir, g as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, c as copyConfigFiles, e as applyAiLanguageDirective, d as configureApi } from './config.mjs';
21
21
  import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DcKLglJQ.mjs';
22
22
  import { getInstallationStatus, installClaudeCode } from './installer.mjs';
23
23
  import { p as parseOrchestrationLevel, w as writeOrchestrationPolicy } from './smart-defaults.mjs';
@@ -1026,7 +1026,7 @@ async function init(options = {}) {
1026
1026
  const hasModelParams = options.apiModel || options.apiHaikuModel || options.apiSonnetModel || options.apiOpusModel;
1027
1027
  if (hasModelParams && action !== "docs-only" && codeToolType === "claude-code") {
1028
1028
  if (options.skipPrompt) {
1029
- const { updateCustomModel } = await import('./config.mjs').then(function (n) { return n.j; });
1029
+ const { updateCustomModel } = await import('./config.mjs').then(function (n) { return n.k; });
1030
1030
  updateCustomModel(
1031
1031
  options.apiModel || void 0,
1032
1032
  options.apiHaikuModel || void 0,