ccjk 12.0.0 → 12.0.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.
- package/dist/chunks/agent-teams.mjs +17 -18
- package/dist/chunks/agent.mjs +105 -102
- package/dist/chunks/agents.mjs +87 -77
- package/dist/chunks/api-cli.mjs +41 -27
- package/dist/chunks/api-providers.mjs +2 -4
- package/dist/chunks/api.mjs +22 -11
- package/dist/chunks/auto-bootstrap.mjs +3 -5
- package/dist/chunks/auto-init.mjs +3 -4
- package/dist/chunks/auto-updater.mjs +103 -91
- package/dist/chunks/banner.mjs +41 -42
- package/dist/chunks/boost.mjs +30 -31
- package/dist/chunks/ccjk-agents.mjs +6 -9
- package/dist/chunks/ccjk-all.mjs +703 -85
- package/dist/chunks/ccjk-config.mjs +6 -6
- package/dist/chunks/ccjk-hooks.mjs +20 -9
- package/dist/chunks/ccjk-mcp.mjs +64 -52
- package/dist/chunks/ccjk-setup.mjs +35 -25
- package/dist/chunks/ccjk-skills.mjs +51 -41
- package/dist/chunks/ccr.mjs +42 -32
- package/dist/chunks/ccu.mjs +16 -12
- package/dist/chunks/check-updates.mjs +30 -19
- package/dist/chunks/claude-code-config-manager.mjs +25 -10
- package/dist/chunks/claude-code-incremental-manager.mjs +65 -51
- package/dist/chunks/claude-config.mjs +2 -2
- package/dist/chunks/claude-wrapper.mjs +9 -6
- package/dist/chunks/cleanup-migration.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +10 -3
- package/dist/chunks/cloud-sync.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +58 -45
- package/dist/chunks/codex-provider-manager.mjs +29 -16
- package/dist/chunks/codex-uninstaller.mjs +5 -6
- package/dist/chunks/codex.mjs +89 -89
- package/dist/chunks/commands.mjs +28 -29
- package/dist/chunks/commands2.mjs +4 -3
- package/dist/chunks/commit.mjs +42 -23
- package/dist/chunks/completion.mjs +46 -47
- package/dist/chunks/config-consolidator.mjs +12 -13
- package/dist/chunks/config-switch.mjs +66 -53
- package/dist/chunks/config.mjs +10 -10
- package/dist/chunks/config2.mjs +53 -42
- package/dist/chunks/config3.mjs +107 -93
- package/dist/chunks/constants.mjs +2 -4
- package/dist/chunks/context-loader.mjs +5 -4
- package/dist/chunks/context.mjs +77 -76
- package/dist/chunks/convoy-manager.mjs +4 -4
- package/dist/chunks/dashboard.mjs +28 -29
- package/dist/chunks/doctor.mjs +68 -54
- package/dist/chunks/evolution.mjs +37 -38
- package/dist/chunks/features.mjs +103 -92
- package/dist/chunks/fs-operations.mjs +1 -1
- package/dist/chunks/health-alerts.mjs +1 -1
- package/dist/chunks/health-check.mjs +1 -1
- package/dist/chunks/help.mjs +117 -116
- package/dist/chunks/hook-installer.mjs +3 -2
- package/dist/chunks/index.mjs +20 -6
- package/dist/chunks/index10.mjs +1171 -0
- package/dist/chunks/index11.mjs +1008 -0
- package/dist/chunks/index12.mjs +193 -0
- package/dist/chunks/index13.mjs +218 -0
- package/dist/chunks/index14.mjs +663 -0
- package/dist/chunks/index2.mjs +19 -10
- package/dist/chunks/index3.mjs +19079 -164
- package/dist/chunks/index4.mjs +8 -1171
- package/dist/chunks/index5.mjs +7479 -884
- package/dist/chunks/index6.mjs +160 -184
- package/dist/chunks/index7.mjs +3573 -653
- package/dist/chunks/index8.mjs +19 -0
- package/dist/chunks/index9.mjs +616 -0
- package/dist/chunks/init.mjs +173 -173
- package/dist/chunks/installer.mjs +92 -82
- package/dist/chunks/installer2.mjs +3 -2
- package/dist/chunks/interview.mjs +118 -107
- package/dist/chunks/json-config.mjs +3 -2
- package/dist/chunks/linux.mjs +3863 -0
- package/dist/chunks/macos.mjs +69 -0
- package/dist/chunks/main.mjs +635 -0
- package/dist/chunks/marketplace.mjs +69 -66
- package/dist/chunks/mcp-cli.mjs +61 -48
- package/dist/chunks/mcp.mjs +140 -127
- package/dist/chunks/menu.mjs +85 -85
- package/dist/chunks/metrics-display.mjs +41 -40
- package/dist/chunks/migrator.mjs +4 -5
- package/dist/chunks/monitor.mjs +95 -95
- package/dist/chunks/notification.mjs +151 -141
- package/dist/chunks/onboarding.mjs +26 -15
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/paradigm.mjs +24 -23
- package/dist/chunks/permission-manager.mjs +10 -11
- package/dist/chunks/permissions.mjs +72 -57
- package/dist/chunks/persistence-manager.mjs +97 -84
- package/dist/chunks/persistence.mjs +1 -1
- package/dist/chunks/platform.mjs +29 -29
- package/dist/chunks/plugin.mjs +104 -105
- package/dist/chunks/prompts.mjs +36 -25
- package/dist/chunks/providers.mjs +68 -69
- package/dist/chunks/quick-actions.mjs +71 -72
- package/dist/chunks/quick-provider.mjs +56 -40
- package/dist/chunks/quick-setup.mjs +71 -60
- package/dist/chunks/remote.mjs +21 -12
- package/dist/chunks/session.mjs +116 -103
- package/dist/chunks/sessions.mjs +29 -28
- package/dist/chunks/silent-updater.mjs +8 -10
- package/dist/chunks/simple-config.mjs +13 -10
- package/dist/chunks/skill.mjs +8560 -103
- package/dist/chunks/skills-sync.mjs +5212 -79
- package/dist/chunks/skills.mjs +105 -94
- package/dist/chunks/slash-commands.mjs +36 -37
- package/dist/chunks/smart-defaults.mjs +7 -3
- package/dist/chunks/smart-guide.mjs +1 -1
- package/dist/chunks/startup.mjs +2 -4
- package/dist/chunks/stats.mjs +41 -42
- package/dist/chunks/status.mjs +49 -50
- package/dist/chunks/team.mjs +24 -12
- package/dist/chunks/thinking.mjs +74 -63
- package/dist/chunks/trace.mjs +20 -19
- package/dist/chunks/uninstall.mjs +69 -56
- package/dist/chunks/update.mjs +39 -28
- package/dist/chunks/upgrade-manager.mjs +24 -18
- package/dist/chunks/version-checker.mjs +45 -41
- package/dist/chunks/vim.mjs +81 -69
- package/dist/chunks/windows.mjs +14 -0
- package/dist/chunks/workflows.mjs +15 -15
- package/dist/chunks/wsl.mjs +129 -0
- package/dist/chunks/zero-config.mjs +45 -34
- package/dist/cli.mjs +20 -20
- package/dist/index.mjs +41 -31
- package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
- package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
- package/dist/shared/{ccjk.CGcy7cNM.mjs → ccjk.BDKUdmLk.mjs} +1 -1
- package/dist/shared/{ccjk.DtMBiwVG.mjs → ccjk.BFxsJM0k.mjs} +1 -1
- package/dist/shared/{ccjk.j4uut26D.mjs → ccjk.BIxuVL3_.mjs} +5 -5
- package/dist/shared/ccjk.BRZ9ww8S.mjs +142 -0
- package/dist/shared/{ccjk.CN0edl87.mjs → ccjk.BSYWk9ML.mjs} +1 -1
- package/dist/shared/{ccjk.Dk1HDseQ.mjs → ccjk.BnpWvs9V.mjs} +75 -75
- package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
- package/dist/shared/{ccjk.DKojSRzw.mjs → ccjk.BrPUmTqm.mjs} +1 -1
- package/dist/shared/{ccjk.C10pepYx.mjs → ccjk.BxSmJ8B7.mjs} +1 -1
- package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
- package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
- package/dist/shared/{ccjk.BN90X6oc.mjs → ccjk.CePkJq2S.mjs} +17 -17
- package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.CfKKcvWy.mjs} +1 -1
- package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
- package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
- package/dist/shared/{ccjk.DfwJOEok.mjs → ccjk.D5MFQT7w.mjs} +1 -1
- package/dist/shared/{ccjk.cChAaGgT.mjs → ccjk.DG_o24cZ.mjs} +6 -6
- package/dist/shared/{ccjk.bhFAMRyc.mjs → ccjk.DLLw-h4Y.mjs} +32 -32
- package/dist/shared/ccjk.DOwtZMk8.mjs +4019 -0
- package/dist/shared/{ccjk.BsXQugfY.mjs → ccjk.DTdjs-qK.mjs} +13 -13
- package/dist/shared/{ccjk.Bdhyg3X-.mjs → ccjk.DsYaCCx4.mjs} +1 -1
- package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
- package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
- package/dist/shared/{ccjk.h7_W-wTs.mjs → ccjk.SPoXMvZD.mjs} +1 -1
- package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
- package/dist/shared/{ccjk.CrB6OYHv.mjs → ccjk._dESH4Rk.mjs} +2 -2
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
- package/dist/shared/{ccjk.CBhIZiPz.mjs → ccjk.hoqrwWdN.mjs} +1 -1
- package/dist/shared/{ccjk.BNwRnWYx.mjs → ccjk.s7OCVzdd.mjs} +1230 -33
- package/dist/shared/{ccjk.BOIUTf5z.mjs → ccjk.waa2ikKJ.mjs} +8 -9
- package/package.json +31 -30
- package/dist/shared/ccjk.DHbrGcgg.mjs +0 -13
- package/dist/shared/ccjk.DntgA8fQ.mjs +0 -42
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import process__default from 'node:process';
|
|
4
|
-
import
|
|
5
|
-
import inquirer from '
|
|
6
|
-
import ora from '
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { ensureI18nInitialized, i18n } from './index3.mjs';
|
|
4
|
+
import a from './index2.mjs';
|
|
5
|
+
import { i as inquirer } from './index3.mjs';
|
|
6
|
+
import ora from './index7.mjs';
|
|
7
|
+
import { exec as q } from './main.mjs';
|
|
8
|
+
import { ensureI18nInitialized, i18n } from './index5.mjs';
|
|
10
9
|
import { updateClaudeCode } from './auto-updater.mjs';
|
|
11
10
|
import { exists } from './fs-operations.mjs';
|
|
12
11
|
import { f as findCommandPath, g as getPlatform, a as getHomebrewCommandPaths, b as isTermux, c as getTermuxPrefix, d as isWSL, e as getWSLInfo, w as wrapCommandWithSudo, h as commandExists, j as getRecommendedInstallMethods } from './platform.mjs';
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import 'node:path';
|
|
12
|
+
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
13
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
14
|
+
import 'node:readline';
|
|
15
|
+
import 'stream';
|
|
16
|
+
import 'node:tty';
|
|
17
|
+
import 'node:async_hooks';
|
|
18
|
+
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
21
19
|
import 'node:util';
|
|
22
|
-
import '
|
|
20
|
+
import 'tty';
|
|
21
|
+
import 'fs';
|
|
22
|
+
import 'child_process';
|
|
23
|
+
import 'node:path';
|
|
23
24
|
import 'node:crypto';
|
|
25
|
+
import 'buffer';
|
|
26
|
+
import 'string_decoder';
|
|
27
|
+
import 'module';
|
|
28
|
+
import 'node:child_process';
|
|
29
|
+
import 'node:stream';
|
|
30
|
+
import 'node:url';
|
|
31
|
+
import '../shared/ccjk.DOwtZMk8.mjs';
|
|
32
|
+
import './version-checker.mjs';
|
|
33
|
+
import '../shared/ccjk.CxpGa6MC.mjs';
|
|
24
34
|
import 'node:fs/promises';
|
|
25
35
|
|
|
26
36
|
async function isClaudeCodeInstalled() {
|
|
@@ -31,10 +41,10 @@ async function installClaudeCode(skipMethodSelection = false) {
|
|
|
31
41
|
const codeType = "claude-code";
|
|
32
42
|
const installed = await isClaudeCodeInstalled();
|
|
33
43
|
if (installed) {
|
|
34
|
-
console.log(
|
|
44
|
+
console.log(a.green(`\u2714 ${i18n.t("installation:alreadyInstalled")}`));
|
|
35
45
|
const version = await detectInstalledVersion(codeType);
|
|
36
46
|
if (version) {
|
|
37
|
-
console.log(
|
|
47
|
+
console.log(a.gray(` ${i18n.t("installation:detectedVersion", { version })}`));
|
|
38
48
|
}
|
|
39
49
|
const verification = await verifyInstallation(codeType);
|
|
40
50
|
if (verification.symlinkCreated) {
|
|
@@ -44,45 +54,45 @@ async function installClaudeCode(skipMethodSelection = false) {
|
|
|
44
54
|
return;
|
|
45
55
|
}
|
|
46
56
|
if (isTermux()) {
|
|
47
|
-
console.log(
|
|
57
|
+
console.log(a.yellow(`\u2139 ${i18n.t("installation:termuxDetected")}`));
|
|
48
58
|
const termuxPrefix = getTermuxPrefix();
|
|
49
|
-
console.log(
|
|
50
|
-
console.log(
|
|
51
|
-
console.log(
|
|
59
|
+
console.log(a.gray(i18n.t("installation:termuxPathInfo", { path: termuxPrefix })));
|
|
60
|
+
console.log(a.gray(`Node.js: ${termuxPrefix}/bin/node`));
|
|
61
|
+
console.log(a.gray(`npm: ${termuxPrefix}/bin/npm`));
|
|
52
62
|
}
|
|
53
63
|
if (isWSL()) {
|
|
54
64
|
const wslInfo = getWSLInfo();
|
|
55
65
|
if (wslInfo?.distro) {
|
|
56
|
-
console.log(
|
|
66
|
+
console.log(a.yellow(`\u2139 ${i18n.t("installation:wslDetected", { distro: wslInfo.distro })}`));
|
|
57
67
|
} else {
|
|
58
|
-
console.log(
|
|
68
|
+
console.log(a.yellow(`\u2139 ${i18n.t("installation:wslDetectedGeneric")}`));
|
|
59
69
|
}
|
|
60
|
-
console.log(
|
|
70
|
+
console.log(a.gray(i18n.t("installation:wslPathInfo", { path: `${homedir()}/.claude/` })));
|
|
61
71
|
}
|
|
62
72
|
if (skipMethodSelection) {
|
|
63
73
|
console.log(i18n.t("installation:installing"));
|
|
64
74
|
try {
|
|
65
75
|
const { command, args, usedSudo } = wrapCommandWithSudo("npm", ["install", "-g", "@anthropic-ai/claude-code", "--force"]);
|
|
66
76
|
if (usedSudo) {
|
|
67
|
-
console.log(
|
|
77
|
+
console.log(a.yellow(`\u2139 ${i18n.t("installation:usingSudo")}`));
|
|
68
78
|
}
|
|
69
|
-
await
|
|
79
|
+
await q(command, args);
|
|
70
80
|
console.log(`\u2714 ${i18n.t("installation:installSuccess")}`);
|
|
71
81
|
await setInstallMethod("npm");
|
|
72
82
|
const verification = await verifyInstallation(codeType);
|
|
73
83
|
displayVerificationResult(verification, codeType);
|
|
74
84
|
if (isTermux()) {
|
|
75
|
-
console.log(
|
|
85
|
+
console.log(a.gray(`
|
|
76
86
|
Claude Code installed to: ${getTermuxPrefix()}/bin/claude`));
|
|
77
87
|
}
|
|
78
88
|
if (isWSL()) {
|
|
79
|
-
console.log(
|
|
89
|
+
console.log(a.gray(`
|
|
80
90
|
${i18n.t("installation:wslInstallSuccess")}`));
|
|
81
91
|
}
|
|
82
92
|
} catch (error) {
|
|
83
93
|
console.error(`\u2716 ${i18n.t("installation:installFailed")}`);
|
|
84
94
|
if (isTermux()) {
|
|
85
|
-
console.error(
|
|
95
|
+
console.error(a.yellow(`
|
|
86
96
|
${i18n.t("installation:termuxInstallHint")}
|
|
87
97
|
`));
|
|
88
98
|
}
|
|
@@ -92,23 +102,23 @@ ${i18n.t("installation:termuxInstallHint")}
|
|
|
92
102
|
}
|
|
93
103
|
const method = await selectInstallMethod(codeType);
|
|
94
104
|
if (!method) {
|
|
95
|
-
console.log(
|
|
105
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
96
106
|
return;
|
|
97
107
|
}
|
|
98
108
|
const success = await executeInstallMethod(method, codeType);
|
|
99
109
|
if (!success) {
|
|
100
110
|
const retrySuccess = await handleInstallFailure(codeType, [method]);
|
|
101
111
|
if (!retrySuccess) {
|
|
102
|
-
console.error(
|
|
112
|
+
console.error(a.red(`\u2716 ${i18n.t("installation:installFailed")}`));
|
|
103
113
|
throw new Error(i18n.t("installation:installFailed"));
|
|
104
114
|
}
|
|
105
115
|
}
|
|
106
116
|
if (isTermux()) {
|
|
107
|
-
console.log(
|
|
117
|
+
console.log(a.gray(`
|
|
108
118
|
Claude Code installed to: ${getTermuxPrefix()}/bin/claude`));
|
|
109
119
|
}
|
|
110
120
|
if (isWSL()) {
|
|
111
|
-
console.log(
|
|
121
|
+
console.log(a.gray(`
|
|
112
122
|
${i18n.t("installation:wslInstallSuccess")}`));
|
|
113
123
|
}
|
|
114
124
|
}
|
|
@@ -121,10 +131,10 @@ async function installCodex(skipMethodSelection = false) {
|
|
|
121
131
|
const codeTypeName = i18n.t("common:codex");
|
|
122
132
|
const installed = await isCodexInstalled();
|
|
123
133
|
if (installed) {
|
|
124
|
-
console.log(
|
|
134
|
+
console.log(a.green(`\u2714 ${codeTypeName} ${i18n.t("installation:alreadyInstalled")}`));
|
|
125
135
|
const version = await detectInstalledVersion(codeType);
|
|
126
136
|
if (version) {
|
|
127
|
-
console.log(
|
|
137
|
+
console.log(a.gray(` ${i18n.t("installation:detectedVersion", { version })}`));
|
|
128
138
|
}
|
|
129
139
|
return;
|
|
130
140
|
}
|
|
@@ -133,28 +143,28 @@ async function installCodex(skipMethodSelection = false) {
|
|
|
133
143
|
try {
|
|
134
144
|
const { command, args, usedSudo } = wrapCommandWithSudo("npm", ["install", "-g", "@openai/codex", "--force"]);
|
|
135
145
|
if (usedSudo) {
|
|
136
|
-
console.log(
|
|
146
|
+
console.log(a.yellow(`\u2139 ${i18n.t("installation:usingSudo")}`));
|
|
137
147
|
}
|
|
138
|
-
await
|
|
139
|
-
console.log(
|
|
148
|
+
await q(command, args);
|
|
149
|
+
console.log(a.green(`\u2714 ${codeTypeName} ${i18n.t("installation:installSuccess")}`));
|
|
140
150
|
const verification = await verifyInstallation(codeType);
|
|
141
151
|
displayVerificationResult(verification, codeType);
|
|
142
152
|
} catch (error) {
|
|
143
|
-
console.error(
|
|
153
|
+
console.error(a.red(`\u2716 ${codeTypeName} ${i18n.t("installation:installFailed")}`));
|
|
144
154
|
throw error;
|
|
145
155
|
}
|
|
146
156
|
return;
|
|
147
157
|
}
|
|
148
158
|
const method = await selectInstallMethod(codeType);
|
|
149
159
|
if (!method) {
|
|
150
|
-
console.log(
|
|
160
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
151
161
|
return;
|
|
152
162
|
}
|
|
153
163
|
const success = await executeInstallMethod(method, codeType);
|
|
154
164
|
if (!success) {
|
|
155
165
|
const retrySuccess = await handleInstallFailure(codeType, [method]);
|
|
156
166
|
if (!retrySuccess) {
|
|
157
|
-
console.error(
|
|
167
|
+
console.error(a.red(`\u2716 ${codeTypeName} ${i18n.t("installation:installFailed")}`));
|
|
158
168
|
throw new Error(i18n.t("installation:installFailed"));
|
|
159
169
|
}
|
|
160
170
|
}
|
|
@@ -186,7 +196,7 @@ async function uninstallCodeTool(codeType) {
|
|
|
186
196
|
if (!method) {
|
|
187
197
|
if (codeType === "claude-code") {
|
|
188
198
|
try {
|
|
189
|
-
const result = await
|
|
199
|
+
const result = await q("brew", ["list", "--cask", "claude-code"]);
|
|
190
200
|
if (result.exitCode === 0) {
|
|
191
201
|
method = "homebrew";
|
|
192
202
|
}
|
|
@@ -194,7 +204,7 @@ async function uninstallCodeTool(codeType) {
|
|
|
194
204
|
}
|
|
195
205
|
} else if (codeType === "codex") {
|
|
196
206
|
try {
|
|
197
|
-
const result = await
|
|
207
|
+
const result = await q("brew", ["list", "--cask", "codex"]);
|
|
198
208
|
if (result.exitCode === 0) {
|
|
199
209
|
method = "homebrew";
|
|
200
210
|
}
|
|
@@ -209,7 +219,7 @@ async function uninstallCodeTool(codeType) {
|
|
|
209
219
|
const platform = getPlatform();
|
|
210
220
|
if (platform === "macos" || platform === "linux") {
|
|
211
221
|
try {
|
|
212
|
-
const testResult = codeType === "claude-code" ? await
|
|
222
|
+
const testResult = codeType === "claude-code" ? await q("brew", ["list", "--cask", "claude-code"]) : await q("brew", ["list", "--cask", "codex"]);
|
|
213
223
|
if (testResult.exitCode === 0) {
|
|
214
224
|
method = "homebrew";
|
|
215
225
|
}
|
|
@@ -231,14 +241,14 @@ async function uninstallCodeTool(codeType) {
|
|
|
231
241
|
spinner.info(i18n.t("installation:usingSudo"));
|
|
232
242
|
spinner.start();
|
|
233
243
|
}
|
|
234
|
-
await
|
|
244
|
+
await q(command, args);
|
|
235
245
|
break;
|
|
236
246
|
}
|
|
237
247
|
case "homebrew": {
|
|
238
248
|
if (codeType === "claude-code") {
|
|
239
|
-
await
|
|
249
|
+
await q("brew", ["uninstall", "--cask", "claude-code"]);
|
|
240
250
|
} else {
|
|
241
|
-
await
|
|
251
|
+
await q("brew", ["uninstall", "--cask", "codex"]);
|
|
242
252
|
}
|
|
243
253
|
break;
|
|
244
254
|
}
|
|
@@ -248,21 +258,21 @@ async function uninstallCodeTool(codeType) {
|
|
|
248
258
|
const command = codeType === "claude-code" ? "claude" : "codex";
|
|
249
259
|
try {
|
|
250
260
|
const whichCmd = getPlatform() === "windows" ? "where" : "which";
|
|
251
|
-
const result = await
|
|
261
|
+
const result = await q(whichCmd, [command]);
|
|
252
262
|
if (result.stdout) {
|
|
253
263
|
const binaryPath = result.stdout.trim().split("\n")[0];
|
|
254
264
|
spinner.info(i18n.t("installation:binaryLocation", { path: binaryPath }));
|
|
255
265
|
const platform = getPlatform();
|
|
256
266
|
if (platform === "windows") {
|
|
257
267
|
const quotedBinaryPath = `"${binaryPath}"`;
|
|
258
|
-
await
|
|
268
|
+
await q("cmd", ["/c", "del", "/f", "/q", quotedBinaryPath]);
|
|
259
269
|
} else {
|
|
260
270
|
const { command: rmCmd, args: rmArgs } = wrapCommandWithSudo("rm", ["-f", binaryPath]);
|
|
261
271
|
if (rmCmd === "sudo") {
|
|
262
272
|
spinner.info(i18n.t("installation:usingSudo"));
|
|
263
273
|
spinner.start();
|
|
264
274
|
}
|
|
265
|
-
await
|
|
275
|
+
await q(rmCmd, rmArgs);
|
|
266
276
|
}
|
|
267
277
|
}
|
|
268
278
|
} catch {
|
|
@@ -277,7 +287,7 @@ async function uninstallCodeTool(codeType) {
|
|
|
277
287
|
} catch (error) {
|
|
278
288
|
spinner.fail(i18n.t("installation:uninstallFailed", { method, codeType: codeTypeName }));
|
|
279
289
|
if (error instanceof Error) {
|
|
280
|
-
console.error(
|
|
290
|
+
console.error(a.gray(error.message));
|
|
281
291
|
}
|
|
282
292
|
return false;
|
|
283
293
|
}
|
|
@@ -300,7 +310,7 @@ async function setInstallMethod(method, codeType = "claude-code") {
|
|
|
300
310
|
async function detectInstalledVersion(codeType) {
|
|
301
311
|
try {
|
|
302
312
|
const command = codeType === "claude-code" ? "claude" : "codex";
|
|
303
|
-
const result = await
|
|
313
|
+
const result = await q(command, ["--version"]);
|
|
304
314
|
if (result.exitCode === 0 && result.stdout) {
|
|
305
315
|
const versionMatch = result.stdout.match(/(\d+\.\d+\.\d+)/);
|
|
306
316
|
return versionMatch ? versionMatch[1] : result.stdout.trim();
|
|
@@ -344,7 +354,7 @@ function getInstallMethodOptions(codeType, recommendedMethods) {
|
|
|
344
354
|
return availableMethods.map((method) => {
|
|
345
355
|
const isTopRecommended = method === topRecommended;
|
|
346
356
|
const methodLabel = getInstallMethodLabel(method);
|
|
347
|
-
const title = isTopRecommended ? `${methodLabel} ${
|
|
357
|
+
const title = isTopRecommended ? `${methodLabel} ${a.green(`[${i18n.t("installation:recommendedMethod")}]`)}` : methodLabel;
|
|
348
358
|
return {
|
|
349
359
|
title,
|
|
350
360
|
value: method
|
|
@@ -357,7 +367,7 @@ async function selectInstallMethod(codeType, excludeMethods = []) {
|
|
|
357
367
|
const recommendedMethods = getRecommendedInstallMethods(codeType);
|
|
358
368
|
const methodOptions = getInstallMethodOptions(codeType, recommendedMethods).filter((option) => !excludeMethods.includes(option.value));
|
|
359
369
|
if (methodOptions.length === 0) {
|
|
360
|
-
console.log(
|
|
370
|
+
console.log(a.yellow(i18n.t("installation:noMoreMethods")));
|
|
361
371
|
return null;
|
|
362
372
|
}
|
|
363
373
|
const response = await inquirer.prompt({
|
|
@@ -384,22 +394,22 @@ async function executeInstallMethod(method, codeType) {
|
|
|
384
394
|
spinner.info(i18n.t("installation:usingSudo"));
|
|
385
395
|
spinner.start();
|
|
386
396
|
}
|
|
387
|
-
await
|
|
397
|
+
await q(command, args);
|
|
388
398
|
await setInstallMethod("npm", codeType);
|
|
389
399
|
break;
|
|
390
400
|
}
|
|
391
401
|
case "homebrew": {
|
|
392
402
|
if (codeType === "claude-code") {
|
|
393
|
-
await
|
|
403
|
+
await q("brew", ["install", "--cask", "claude-code"]);
|
|
394
404
|
} else {
|
|
395
|
-
await
|
|
405
|
+
await q("brew", ["install", "--cask", "codex"]);
|
|
396
406
|
}
|
|
397
407
|
await setInstallMethod("homebrew", codeType);
|
|
398
408
|
break;
|
|
399
409
|
}
|
|
400
410
|
case "curl": {
|
|
401
411
|
if (codeType === "claude-code") {
|
|
402
|
-
await
|
|
412
|
+
await q("bash", ["-c", "curl -fsSL https://claude.ai/install.sh | bash"]);
|
|
403
413
|
} else {
|
|
404
414
|
spinner.stop();
|
|
405
415
|
return await executeInstallMethod("npm", codeType);
|
|
@@ -409,7 +419,7 @@ async function executeInstallMethod(method, codeType) {
|
|
|
409
419
|
}
|
|
410
420
|
case "powershell": {
|
|
411
421
|
if (codeType === "claude-code") {
|
|
412
|
-
await
|
|
422
|
+
await q("powershell", ["-Command", "irm https://claude.ai/install.ps1 | iex"]);
|
|
413
423
|
} else {
|
|
414
424
|
spinner.stop();
|
|
415
425
|
return await executeInstallMethod("npm", codeType);
|
|
@@ -419,7 +429,7 @@ async function executeInstallMethod(method, codeType) {
|
|
|
419
429
|
}
|
|
420
430
|
case "cmd": {
|
|
421
431
|
if (codeType === "claude-code") {
|
|
422
|
-
await
|
|
432
|
+
await q("cmd", ["/c", "curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd"]);
|
|
423
433
|
} else {
|
|
424
434
|
spinner.stop();
|
|
425
435
|
return await executeInstallMethod("npm", codeType);
|
|
@@ -437,7 +447,7 @@ async function executeInstallMethod(method, codeType) {
|
|
|
437
447
|
} catch (error) {
|
|
438
448
|
spinner.fail(i18n.t("installation:installMethodFailed", { method }));
|
|
439
449
|
if (error instanceof Error) {
|
|
440
|
-
console.error(
|
|
450
|
+
console.error(a.gray(error.message));
|
|
441
451
|
}
|
|
442
452
|
return false;
|
|
443
453
|
}
|
|
@@ -466,7 +476,7 @@ async function handleInstallFailure(codeType, failedMethods) {
|
|
|
466
476
|
async function isCommandInPath(command) {
|
|
467
477
|
try {
|
|
468
478
|
const cmd = getPlatform() === "windows" ? "where" : "which";
|
|
469
|
-
const res = await
|
|
479
|
+
const res = await q(cmd, [command]);
|
|
470
480
|
return res.exitCode === 0;
|
|
471
481
|
} catch {
|
|
472
482
|
return false;
|
|
@@ -580,7 +590,7 @@ async function createHomebrewSymlink(command, sourcePath) {
|
|
|
580
590
|
];
|
|
581
591
|
let targetDir = null;
|
|
582
592
|
for (const binPath of homebrewBinPaths) {
|
|
583
|
-
if (
|
|
593
|
+
if (fs.existsSync(binPath)) {
|
|
584
594
|
targetDir = binPath;
|
|
585
595
|
break;
|
|
586
596
|
}
|
|
@@ -594,16 +604,16 @@ async function createHomebrewSymlink(command, sourcePath) {
|
|
|
594
604
|
}
|
|
595
605
|
const symlinkPath = join(targetDir, command);
|
|
596
606
|
try {
|
|
597
|
-
const stats =
|
|
607
|
+
const stats = fs.lstatSync(symlinkPath);
|
|
598
608
|
if (stats.isSymbolicLink()) {
|
|
599
|
-
const existingTarget =
|
|
609
|
+
const existingTarget = fs.readlinkSync(symlinkPath);
|
|
600
610
|
if (existingTarget === sourcePath) {
|
|
601
611
|
return {
|
|
602
612
|
success: true,
|
|
603
613
|
symlinkPath
|
|
604
614
|
};
|
|
605
615
|
}
|
|
606
|
-
|
|
616
|
+
fs.unlinkSync(symlinkPath);
|
|
607
617
|
} else {
|
|
608
618
|
return {
|
|
609
619
|
success: false,
|
|
@@ -621,7 +631,7 @@ async function createHomebrewSymlink(command, sourcePath) {
|
|
|
621
631
|
}
|
|
622
632
|
}
|
|
623
633
|
try {
|
|
624
|
-
|
|
634
|
+
fs.symlinkSync(sourcePath, symlinkPath);
|
|
625
635
|
return {
|
|
626
636
|
success: true,
|
|
627
637
|
symlinkPath
|
|
@@ -646,33 +656,33 @@ function displayVerificationResult(result, codeType) {
|
|
|
646
656
|
const codeTypeName = codeType === "claude-code" ? i18n.t("common:claudeCode") : i18n.t("common:codex");
|
|
647
657
|
if (result.success) {
|
|
648
658
|
if (result.symlinkCreated) {
|
|
649
|
-
console.log(
|
|
650
|
-
console.log(
|
|
659
|
+
console.log(a.green(`\u2714 ${codeTypeName} ${i18n.t("installation:verificationSuccess")}`));
|
|
660
|
+
console.log(a.gray(` ${i18n.t("installation:symlinkCreated", { path: result.commandPath })}`));
|
|
651
661
|
} else if (result.commandPath) {
|
|
652
|
-
console.log(
|
|
653
|
-
console.log(
|
|
662
|
+
console.log(a.green(`\u2714 ${codeTypeName} ${i18n.t("installation:verificationSuccess")}`));
|
|
663
|
+
console.log(a.gray(` ${i18n.t("installation:foundAtPath", { path: result.commandPath })}`));
|
|
654
664
|
}
|
|
655
665
|
if (result.version) {
|
|
656
|
-
console.log(
|
|
666
|
+
console.log(a.gray(` ${i18n.t("installation:detectedVersion", { version: result.version })}`));
|
|
657
667
|
}
|
|
658
668
|
if (result.error === "PATH_UPDATE_NEEDED") {
|
|
659
|
-
console.log(
|
|
669
|
+
console.log(a.yellow(`
|
|
660
670
|
\u26A0 ${i18n.t("installation:pathUpdateNeeded")}`));
|
|
661
|
-
console.log(
|
|
662
|
-
console.log(
|
|
663
|
-
console.log(
|
|
664
|
-
console.log(
|
|
671
|
+
console.log(a.gray(` ${i18n.t("installation:pathUpdateHint")}`));
|
|
672
|
+
console.log(a.green(` export PATH="$HOME/.local/bin:$PATH"`));
|
|
673
|
+
console.log(a.gray(` ${i18n.t("installation:pathUpdatePermanent")}`));
|
|
674
|
+
console.log(a.green(` echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc`));
|
|
665
675
|
}
|
|
666
676
|
} else {
|
|
667
|
-
console.log(
|
|
677
|
+
console.log(a.yellow(`\u26A0 ${codeTypeName} ${i18n.t("installation:verificationFailed")}`));
|
|
668
678
|
if (result.commandPath) {
|
|
669
|
-
console.log(
|
|
679
|
+
console.log(a.gray(` ${i18n.t("installation:foundAtPath", { path: result.commandPath })}`));
|
|
670
680
|
}
|
|
671
681
|
if (result.error && result.error !== "PATH_UPDATE_NEEDED") {
|
|
672
|
-
console.log(
|
|
682
|
+
console.log(a.gray(` ${result.error}`));
|
|
673
683
|
}
|
|
674
684
|
if (result.needsSymlink && !result.symlinkCreated) {
|
|
675
|
-
console.log(
|
|
685
|
+
console.log(a.yellow(` ${i18n.t("installation:manualSymlinkHint")}`));
|
|
676
686
|
}
|
|
677
687
|
}
|
|
678
688
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import
|
|
4
|
+
import a from './index2.mjs';
|
|
5
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
5
6
|
|
|
6
|
-
const { cyan, yellow, gray, green, red, blue: _blue, bold, dim: _dim } =
|
|
7
|
+
const { cyan, yellow, gray, green, red, blue: _blue, bold, dim: _dim } = a;
|
|
7
8
|
const INSTALL_DIR = join(homedir(), ".agent-browser");
|
|
8
9
|
const BIN_PATH = join(INSTALL_DIR, "bin", "agent-browser");
|
|
9
10
|
function getInstallPath() {
|