ccjk 12.0.6 → 12.0.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/README.md +14 -0
- package/README.zh-CN.md +13 -0
- package/dist/chunks/api-cli.mjs +1 -1
- package/dist/chunks/ccjk-agents.mjs +3 -2
- package/dist/chunks/ccjk-all.mjs +129 -1764
- package/dist/chunks/ccjk-hooks.mjs +5 -4
- package/dist/chunks/ccjk-mcp.mjs +7 -6
- package/dist/chunks/ccjk-setup.mjs +3 -2
- package/dist/chunks/ccjk-skills.mjs +6 -5
- package/dist/chunks/ccr.mjs +6 -5
- package/dist/chunks/check-updates.mjs +8 -8
- package/dist/chunks/claude-code-config-manager.mjs +1 -1
- package/dist/chunks/claude-code-incremental-manager.mjs +2 -2
- package/dist/chunks/codex-config-switch.mjs +1 -1
- package/dist/chunks/codex-provider-manager.mjs +1 -1
- package/dist/chunks/config-switch.mjs +1 -1
- package/dist/chunks/config.mjs +1 -1
- package/dist/chunks/config2.mjs +1 -1
- package/dist/chunks/config3.mjs +1 -1
- package/dist/chunks/constants.mjs +33 -2
- package/dist/chunks/dashboard.mjs +115 -3
- package/dist/chunks/features.mjs +3 -3
- package/dist/chunks/init.mjs +108 -4
- package/dist/chunks/installer2.mjs +7 -7
- package/dist/chunks/manager.mjs +1048 -0
- package/dist/chunks/mcp-cli.mjs +1 -1
- package/dist/chunks/mcp.mjs +1 -1
- package/dist/chunks/menu.mjs +22 -1
- package/dist/chunks/notification.mjs +5 -2
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/quick-provider.mjs +1 -269
- package/dist/chunks/quick-setup.mjs +10 -10
- package/dist/chunks/remote.mjs +4 -1
- package/dist/chunks/simple-config.mjs +1 -1
- package/dist/chunks/skill.mjs +117 -9003
- package/dist/chunks/skill2.mjs +9003 -0
- package/dist/chunks/skills-sync.mjs +536 -55
- package/dist/chunks/skills.mjs +7 -1156
- package/dist/chunks/smart-defaults.mjs +87 -9
- package/dist/chunks/status.mjs +1 -1
- package/dist/chunks/uninstall.mjs +1 -1
- package/dist/chunks/update.mjs +2 -2
- package/dist/chunks/zero-config.mjs +6 -2
- package/dist/cli.mjs +3 -1
- package/dist/i18n/locales/en/cloud.json +40 -0
- package/dist/i18n/locales/zh-CN/cloud.json +40 -0
- package/dist/index.d.mts +2586 -2
- package/dist/index.d.ts +2586 -2
- package/dist/index.mjs +1340 -7
- package/dist/shared/ccjk.B364Fu0N.mjs +1819 -0
- package/dist/shared/ccjk.BtB1e5jm.mjs +171 -0
- package/dist/shared/{ccjk.BnpWvs9V.mjs → ccjk.BwfbSKN2.mjs} +1 -1
- package/dist/shared/{ccjk.AqnXPAzw.mjs → ccjk.C2jHOZVP.mjs} +1 -1
- package/dist/shared/{ccjk.BSYWk9ML.mjs → ccjk.Cjj8SVrn.mjs} +1 -1
- package/dist/shared/ccjk.D6ycHbak.mjs +270 -0
- package/dist/shared/ccjk.D8ZLYSZZ.mjs +299 -0
- package/dist/shared/{ccjk.s7OCVzdd.mjs → ccjk.DS7UESmF.mjs} +2 -1483
- package/dist/shared/{ccjk.BiCrMV5O.mjs → ccjk.DXRAZcix.mjs} +0 -28
- package/dist/shared/ccjk.UIvifqNE.mjs +1486 -0
- package/dist/shared/{ccjk.BDKUdmLk.mjs → ccjk.c-ETfBZ_.mjs} +208 -86
- package/package.json +5 -1
- package/templates/claude-code/common/settings.json +3 -1
package/dist/chunks/init.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { i as inquirer } from './index3.mjs';
|
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import process__default from 'node:process';
|
|
5
5
|
import { m as runCodexFullInit, d as selectMcpServices, g as getMcpServices, M as MCP_SERVICE_CONFIGS } from './codex.mjs';
|
|
6
|
-
import { a as modifyApiConfigPartially, b as configureApiCompletely, n as needsMigration, m as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration, s as selectAndInstallWorkflows, c as configureOutputStyle, f as formatApiKeyDisplay, W as WORKFLOW_CONFIG_BASE } from '../shared/ccjk.
|
|
6
|
+
import { a as modifyApiConfigPartially, b as configureApiCompletely, n as needsMigration, m as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration, s as selectAndInstallWorkflows, c as configureOutputStyle, f as formatApiKeyDisplay, W as WORKFLOW_CONFIG_BASE } from '../shared/ccjk.BwfbSKN2.mjs';
|
|
7
7
|
import { SETTINGS_FILE, DEFAULT_CODE_TOOL_TYPE, CODE_TOOL_BANNERS, API_DEFAULT_URL } from './constants.mjs';
|
|
8
8
|
import { ensureI18nInitialized, i18n } from './index5.mjs';
|
|
9
9
|
import { displayBannerWithInfo, padToDisplayWidth } from './banner.mjs';
|
|
@@ -14,12 +14,13 @@ import { promisify } from 'node:util';
|
|
|
14
14
|
import { updateCcr } from './auto-updater.mjs';
|
|
15
15
|
import { w as wrapCommandWithSudo, i as isWindows, b as isTermux } from './platform.mjs';
|
|
16
16
|
import { c as addCompletedOnboarding, s as setPrimaryApiKey, b as backupMcpConfig, a as buildMcpServerConfig, r as readMcpConfig, e as replaceMcpServers, f as fixWindowsMcpConfig, w as writeMcpConfig, g as syncMcpPermissions } from './claude-config.mjs';
|
|
17
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
17
|
+
import { r as resolveCodeType } from '../shared/ccjk.Cjj8SVrn.mjs';
|
|
18
18
|
import { exists } from './fs-operations.mjs';
|
|
19
19
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
20
20
|
import { p as promptApiConfigurationAction, i as ensureClaudeDir, e as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, c as copyConfigFiles, a as applyAiLanguageDirective, f as configureApi } from './config.mjs';
|
|
21
21
|
import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.BIxuVL3_.mjs';
|
|
22
22
|
import { getInstallationStatus, installClaudeCode } from './installer.mjs';
|
|
23
|
+
import { p as parseOrchestrationLevel, w as writeOrchestrationPolicy } from './smart-defaults.mjs';
|
|
23
24
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
24
25
|
import { resolveAiOutputLanguage } from './prompts.mjs';
|
|
25
26
|
import { g as getRuntimeVersion } from '../shared/ccjk.gDEDGD_t.mjs';
|
|
@@ -378,6 +379,12 @@ async function validateSkipPromptOptions(options) {
|
|
|
378
379
|
if (options.installSuperpowers === void 0) {
|
|
379
380
|
options.installSuperpowers = false;
|
|
380
381
|
}
|
|
382
|
+
if (typeof options.installAgentBrowser === "string") {
|
|
383
|
+
options.installAgentBrowser = options.installAgentBrowser.toLowerCase() === "true";
|
|
384
|
+
}
|
|
385
|
+
if (options.installAgentBrowser === void 0) {
|
|
386
|
+
options.installAgentBrowser = true;
|
|
387
|
+
}
|
|
381
388
|
if (options.configAction && !["new", "backup", "merge", "docs-only", "skip"].includes(options.configAction)) {
|
|
382
389
|
throw new Error(
|
|
383
390
|
i18n.t("errors:invalidConfigAction", { value: options.configAction })
|
|
@@ -441,6 +448,9 @@ async function validateSkipPromptOptions(options) {
|
|
|
441
448
|
throw new Error(i18n.t("errors:invalidDefaultOutputStyle", { style: options.defaultOutputStyle, validStyles: validStyles.join(", ") }));
|
|
442
449
|
}
|
|
443
450
|
}
|
|
451
|
+
if (options.orchestration !== void 0) {
|
|
452
|
+
parseOrchestrationLevel(options.orchestration);
|
|
453
|
+
}
|
|
444
454
|
if (typeof options.workflows === "string") {
|
|
445
455
|
if (options.workflows === "skip") {
|
|
446
456
|
options.workflows = false;
|
|
@@ -466,6 +476,9 @@ async function validateSkipPromptOptions(options) {
|
|
|
466
476
|
options.workflows = "all";
|
|
467
477
|
options.workflows = WORKFLOW_CONFIG_BASE.map((w) => w.id);
|
|
468
478
|
}
|
|
479
|
+
if (options.orchestration === void 0) {
|
|
480
|
+
options.orchestration = "max";
|
|
481
|
+
}
|
|
469
482
|
}
|
|
470
483
|
async function silentInit(options = {}) {
|
|
471
484
|
try {
|
|
@@ -474,13 +487,14 @@ async function silentInit(options = {}) {
|
|
|
474
487
|
cleanupZcfNamespace();
|
|
475
488
|
} catch {
|
|
476
489
|
}
|
|
477
|
-
const { detectSmartDefaults } = await import('./smart-defaults.mjs');
|
|
490
|
+
const { detectSmartDefaults } = await import('./smart-defaults.mjs').then(function (n) { return n.s; });
|
|
478
491
|
const defaults = await detectSmartDefaults();
|
|
479
492
|
if (!defaults.apiKey) {
|
|
480
493
|
throw new Error("Silent mode requires ANTHROPIC_API_KEY environment variable");
|
|
481
494
|
}
|
|
482
495
|
options.skipPrompt = true;
|
|
483
496
|
options.skipBanner = true;
|
|
497
|
+
options.initSource = "silent-init";
|
|
484
498
|
options.yes = true;
|
|
485
499
|
options.silent = false;
|
|
486
500
|
options.apiType = "api_key";
|
|
@@ -494,7 +508,9 @@ async function silentInit(options = {}) {
|
|
|
494
508
|
options.configAction = "backup";
|
|
495
509
|
options.installCometixLine = false;
|
|
496
510
|
options.installSuperpowers = false;
|
|
511
|
+
options.installAgentBrowser = options.installAgentBrowser ?? true;
|
|
497
512
|
options.workflows = false;
|
|
513
|
+
options.orchestration = options.orchestration || defaults.workflows.orchestrationLevel || "minimal";
|
|
498
514
|
console.log(`Initializing CCJK (silent mode)...`);
|
|
499
515
|
console.log(` Code Tool: ${defaults.codeToolType}`);
|
|
500
516
|
console.log(` API Provider: ${defaults.apiProvider || "anthropic"}`);
|
|
@@ -554,6 +570,8 @@ ${i18n.t("superpowers:title")}`));
|
|
|
554
570
|
}
|
|
555
571
|
}
|
|
556
572
|
async function init(options = {}) {
|
|
573
|
+
options.initSource = options.initSource || "init";
|
|
574
|
+
options.orchestration = parseOrchestrationLevel(options.orchestration);
|
|
557
575
|
try {
|
|
558
576
|
const { cleanupZcfNamespace } = await import('./cleanup-migration.mjs');
|
|
559
577
|
const { removed } = cleanupZcfNamespace();
|
|
@@ -825,9 +843,41 @@ async function init(options = {}) {
|
|
|
825
843
|
} else if (options.skipPrompt && options.configAction) {
|
|
826
844
|
action = options.configAction;
|
|
827
845
|
}
|
|
846
|
+
const isNewInstall = !existsSync(SETTINGS_FILE);
|
|
847
|
+
if (!options.skipPrompt && (isNewInstall || ["backup", "merge", "new"].includes(action))) {
|
|
848
|
+
const isZh = i18n.language === "zh-CN";
|
|
849
|
+
console.log("");
|
|
850
|
+
console.log(a.bold.cyan(isZh ? "\u{1F48E} \u9876\u7EA7\u5927\u795E\u7F16\u6392\u7406\u5FF5\uFF08\u9ED8\u8BA4\u9996\u9009\uFF09" : "\u{1F48E} Expert Workflow Orchestration (Default First Choice)"));
|
|
851
|
+
console.log(a.dim(isZh ? "\u53EF\u540C\u6B65\u4F18\u5316\u89C4\u5212\u3001\u9A8C\u8BC1\u3001\u5B50\u4EE3\u7406\u4E0E\u89C4\u5219\u6267\u884C\u8D28\u91CF\uFF0C\u5EFA\u8BAE\u9996\u6B21\u5B89\u88C5\u7ACB\u5373\u542F\u7528\u3002" : "Improves planning, verification, subagent strategy, and rule execution quality. Recommended on first install."));
|
|
852
|
+
const { orchestrationChoice } = await inquirer.prompt({
|
|
853
|
+
type: "list",
|
|
854
|
+
name: "orchestrationChoice",
|
|
855
|
+
message: isZh ? "\u8BF7\u9009\u62E9\u9ED8\u8BA4\u7F16\u6392\u7EA7\u522B\uFF1A" : "Select default orchestration level:",
|
|
856
|
+
default: "max",
|
|
857
|
+
choices: addNumbersToChoices([
|
|
858
|
+
{
|
|
859
|
+
name: isZh ? "\u9876\u7EA7\u6A21\u5F0F\uFF08\u63A8\u8350\uFF09- \u6700\u5927\u5316\u8D28\u91CF\u4E0E\u6D41\u7A0B\u7EA6\u675F" : "Expert Mode (Recommended) - Maximum quality and workflow enforcement",
|
|
860
|
+
value: "max"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
name: isZh ? "\u6807\u51C6\u6A21\u5F0F - \u5E73\u8861\u8D28\u91CF\u4E0E\u901F\u5EA6" : "Standard Mode - Balanced quality and speed",
|
|
864
|
+
value: "standard"
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
name: isZh ? "\u8F7B\u91CF\u6A21\u5F0F - \u66F4\u5C11\u6D41\u7A0B\uFF0C\u66F4\u5FEB\u6267\u884C" : "Minimal Mode - Lighter process, faster execution",
|
|
868
|
+
value: "minimal"
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
name: isZh ? "\u5173\u95ED - \u4E0D\u542F\u7528\u7F16\u6392\u7B56\u7565" : "Off - Disable orchestration policy",
|
|
872
|
+
value: "off"
|
|
873
|
+
}
|
|
874
|
+
])
|
|
875
|
+
});
|
|
876
|
+
options.orchestration = orchestrationChoice;
|
|
877
|
+
console.log(a.green(`\u2714 ${isZh ? "\u5DF2\u8BBE\u4E3A\u9ED8\u8BA4\u9996\u9009" : "Set as default first choice"}: ${orchestrationChoice}`));
|
|
878
|
+
}
|
|
828
879
|
if (!options.skipPrompt && !options.skipBanner) tracker.nextStep("Configuring API");
|
|
829
880
|
let apiConfig = null;
|
|
830
|
-
const isNewInstall = !existsSync(SETTINGS_FILE);
|
|
831
881
|
if (action !== "docs-only" && (isNewInstall || ["backup", "merge", "new"].includes(action))) {
|
|
832
882
|
if (options.skipPrompt) {
|
|
833
883
|
if (options.apiConfigs || options.apiConfigsFile) {
|
|
@@ -1105,6 +1155,37 @@ async function init(options = {}) {
|
|
|
1105
1155
|
if (!options.skipPrompt || options.installSuperpowers) {
|
|
1106
1156
|
await handleSuperpowersInstallation(options);
|
|
1107
1157
|
}
|
|
1158
|
+
let agentBrowserReady = false;
|
|
1159
|
+
try {
|
|
1160
|
+
const isZh = i18n.language === "zh-CN";
|
|
1161
|
+
let shouldInstallAgentBrowser = false;
|
|
1162
|
+
if (options.skipPrompt) {
|
|
1163
|
+
shouldInstallAgentBrowser = options.installAgentBrowser !== false;
|
|
1164
|
+
} else {
|
|
1165
|
+
shouldInstallAgentBrowser = await promptBoolean({
|
|
1166
|
+
message: isZh ? "\u5B89\u88C5 Agent Browser \u6D4F\u89C8\u5668\u81EA\u52A8\u5316\u6A21\u5757\uFF1F\uFF08\u63A8\u8350\uFF0C\u6D4F\u89C8\u5668\u4EFB\u52A1\u53EF\u65E0\u7F1D\u4F7F\u7528\uFF09" : "Install Agent Browser module? (recommended for seamless browser automation)",
|
|
1167
|
+
defaultValue: true
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
if (shouldInstallAgentBrowser) {
|
|
1171
|
+
const { checkAgentBrowserInstalled, installAgentBrowser } = await import('./installer2.mjs');
|
|
1172
|
+
const installed = await checkAgentBrowserInstalled();
|
|
1173
|
+
const success = installed ? true : await installAgentBrowser();
|
|
1174
|
+
if (success) {
|
|
1175
|
+
const { addSkill } = await import('./manager.mjs');
|
|
1176
|
+
const { browserSkill } = await import('./skill.mjs');
|
|
1177
|
+
addSkill(browserSkill);
|
|
1178
|
+
agentBrowserReady = true;
|
|
1179
|
+
console.log(a.green(`\u2714 ${isZh ? "Agent Browser \u5DF2\u5C31\u7EEA\uFF0C\u6D4F\u89C8\u5668 Skill \u5DF2\u542F\u7528" : "Agent Browser ready, browser skill enabled"}`));
|
|
1180
|
+
console.log(a.gray(` ${isZh ? "\u53EF\u76F4\u63A5\u4F7F\u7528:" : "Use directly:"} ccjk browser start https://example.com`));
|
|
1181
|
+
}
|
|
1182
|
+
} else {
|
|
1183
|
+
console.log(a.yellow(isZh ? "\u26A0 \u5DF2\u8DF3\u8FC7 Agent Browser \u5B89\u88C5" : "\u26A0 Agent Browser installation skipped"));
|
|
1184
|
+
}
|
|
1185
|
+
} catch (error) {
|
|
1186
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
1187
|
+
console.log(a.gray(`\u2139 Agent Browser setup skipped: ${msg}`));
|
|
1188
|
+
}
|
|
1108
1189
|
try {
|
|
1109
1190
|
const { injectSmartGuide } = await import('./smart-guide.mjs');
|
|
1110
1191
|
const smartGuideSuccess = await injectSmartGuide(configLang);
|
|
@@ -1114,6 +1195,18 @@ async function init(options = {}) {
|
|
|
1114
1195
|
} catch {
|
|
1115
1196
|
console.log(a.gray(`\u2139 ${i18n.t("smartGuide:skipped")}`));
|
|
1116
1197
|
}
|
|
1198
|
+
try {
|
|
1199
|
+
const finalOrchestrationLevel = parseOrchestrationLevel(options.orchestration);
|
|
1200
|
+
const policyPath = writeOrchestrationPolicy({
|
|
1201
|
+
level: finalOrchestrationLevel,
|
|
1202
|
+
language: configLang,
|
|
1203
|
+
source: options.initSource
|
|
1204
|
+
});
|
|
1205
|
+
console.log(a.green(`\u2714 Workflow orchestration: ${finalOrchestrationLevel} (${policyPath})`));
|
|
1206
|
+
} catch (error) {
|
|
1207
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
1208
|
+
console.log(a.gray(`\u2139 Workflow orchestration skipped: ${msg}`));
|
|
1209
|
+
}
|
|
1117
1210
|
if (!options.skipPrompt && !options.skipBanner) tracker.nextStep("Finalizing setup");
|
|
1118
1211
|
updateZcfConfig({
|
|
1119
1212
|
version: ccjkVersion,
|
|
@@ -1165,6 +1258,17 @@ async function init(options = {}) {
|
|
|
1165
1258
|
console.log(a.bold.green("\u2551") + padToDisplayWidth(` ${i18n.t("configuration:guidanceStep4")} `, 44) + a.yellow(padToDisplayWidth(i18n.t("configuration:guidanceStep4Command"), 18)) + a.bold.green("\u2551"));
|
|
1166
1259
|
console.log(`${a.bold.green("\u2551")} ${a.bold.green("\u2551")}`);
|
|
1167
1260
|
console.log(a.bold.green("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
1261
|
+
if (isNewInstall || ["backup", "merge", "new"].includes(action)) {
|
|
1262
|
+
const isZh = i18n.language === "zh-CN";
|
|
1263
|
+
console.log(a.cyan(isZh ? "\u{1F9E0} \u4E0A\u4E0B\u6587\u4F18\u5316\u5DF2\u542F\u7528\uFF08\u9ED8\u8BA4\uFF09" : "\u{1F9E0} Context optimization is enabled (default)"));
|
|
1264
|
+
console.log(a.dim(isZh ? " \u5EFA\u8BAE\u7ACB\u5373\u8FD0\u884C: ccjk morning \u67E5\u770B\u5065\u5EB7\u5206\u4E0E\u6536\u76CA\u6458\u8981" : " Recommended now: ccjk morning to view health score and value summary"));
|
|
1265
|
+
console.log(a.dim(isZh ? " \u6DF1\u5EA6\u590D\u76D8: ccjk review | \u4E0A\u4E0B\u6587\u8BE6\u60C5: ccjk context --show" : " Deep review: ccjk review | Context details: ccjk context --show"));
|
|
1266
|
+
if (agentBrowserReady) {
|
|
1267
|
+
console.log(a.cyan(isZh ? "\u{1F310} \u6D4F\u89C8\u5668\u81EA\u52A8\u5316\u5DF2\u5C31\u7EEA\uFF08\u65E0\u7F1D\uFF09" : "\u{1F310} Browser automation is ready (seamless)"));
|
|
1268
|
+
console.log(a.dim(isZh ? " \u76F4\u63A5\u5F00\u59CB: ccjk browser start https://example.com" : " Start directly: ccjk browser start https://example.com"));
|
|
1269
|
+
console.log(a.dim(isZh ? " \u5E38\u7528\u64CD\u4F5C: ccjk browser status | ccjk browser stop" : " Common actions: ccjk browser status | ccjk browser stop"));
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1168
1272
|
console.log("");
|
|
1169
1273
|
} catch (error) {
|
|
1170
1274
|
if (!handleExitPromptError(error)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import a from './index2.mjs';
|
|
1
2
|
import { existsSync } from 'node:fs';
|
|
2
3
|
import { homedir } from 'node:os';
|
|
3
4
|
import { join } from 'node:path';
|
|
4
|
-
import a from './index2.mjs';
|
|
5
5
|
import '../shared/ccjk.BAGoDD49.mjs';
|
|
6
6
|
|
|
7
7
|
const { cyan, yellow, gray, green, red, blue: _blue, bold, dim: _dim } = a;
|
|
@@ -25,7 +25,7 @@ async function checkAgentBrowserInstalled() {
|
|
|
25
25
|
}
|
|
26
26
|
try {
|
|
27
27
|
const { execSync } = await import('node:child_process');
|
|
28
|
-
execSync("npx --yes
|
|
28
|
+
execSync("npx --yes agent-browser --version 2>/dev/null", {
|
|
29
29
|
encoding: "utf-8",
|
|
30
30
|
stdio: "pipe",
|
|
31
31
|
timeout: 1e4
|
|
@@ -54,14 +54,14 @@ ${bold(cyan("Installing Agent Browser..."))}
|
|
|
54
54
|
mkdirSync(INSTALL_DIR, { recursive: true });
|
|
55
55
|
console.log(`${cyan("Step 1/3:")} Installing via npm...`);
|
|
56
56
|
try {
|
|
57
|
-
execSync("npm install -g
|
|
57
|
+
execSync("npm install -g agent-browser 2>&1", {
|
|
58
58
|
encoding: "utf-8",
|
|
59
59
|
stdio: options.verbose ? "inherit" : "pipe"
|
|
60
60
|
});
|
|
61
61
|
console.log(` ${green("\u2713")} npm package installed globally`);
|
|
62
62
|
} catch {
|
|
63
63
|
console.log(` ${yellow("!")} Global install failed, trying local install...`);
|
|
64
|
-
execSync(`npm install
|
|
64
|
+
execSync(`npm install agent-browser --prefix "${INSTALL_DIR}" 2>&1`, {
|
|
65
65
|
encoding: "utf-8",
|
|
66
66
|
stdio: options.verbose ? "inherit" : "pipe"
|
|
67
67
|
});
|
|
@@ -97,7 +97,7 @@ ${green("\u2713")} ${bold("Agent Browser installed successfully!")}
|
|
|
97
97
|
console.log(` ${red("\u2717")} Verification failed`);
|
|
98
98
|
console.log(`
|
|
99
99
|
${yellow("Try manual installation:")}`);
|
|
100
|
-
console.log(` npm install -g
|
|
100
|
+
console.log(` npm install -g agent-browser`);
|
|
101
101
|
console.log(` npx playwright install chromium
|
|
102
102
|
`);
|
|
103
103
|
return false;
|
|
@@ -110,7 +110,7 @@ ${red("\u2717")} Installation failed`);
|
|
|
110
110
|
}
|
|
111
111
|
console.log(`
|
|
112
112
|
${yellow("Manual installation:")}`);
|
|
113
|
-
console.log(` ${cyan("1.")} npm install -g
|
|
113
|
+
console.log(` ${cyan("1.")} npm install -g agent-browser`);
|
|
114
114
|
console.log(` ${cyan("2.")} npx playwright install chromium`);
|
|
115
115
|
console.log(` ${cyan("3.")} agent-browser --version
|
|
116
116
|
`);
|
|
@@ -126,7 +126,7 @@ ${bold(cyan("Uninstalling Agent Browser..."))}
|
|
|
126
126
|
try {
|
|
127
127
|
console.log(`${cyan("Step 1/2:")} Removing npm package...`);
|
|
128
128
|
try {
|
|
129
|
-
execSync("npm uninstall -g
|
|
129
|
+
execSync("npm uninstall -g agent-browser 2>&1", {
|
|
130
130
|
encoding: "utf-8",
|
|
131
131
|
stdio: options.verbose ? "inherit" : "pipe"
|
|
132
132
|
});
|