adhdev 0.1.8 → 0.1.10
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/index.js +105 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -553,19 +553,47 @@ async function quickSetup() {
|
|
|
553
553
|
spinner.stop();
|
|
554
554
|
if (installedIDEs.length === 0) {
|
|
555
555
|
console.log(import_chalk.default.red("\u2717 No supported IDE with CLI found."));
|
|
556
|
-
console.log(import_chalk.default.gray(" Supported: VS Code, Cursor, Antigravity, Windsurf"));
|
|
556
|
+
console.log(import_chalk.default.gray(" Supported: VS Code, Cursor, Antigravity, Windsurf, VSCodium"));
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
559
|
+
console.log(import_chalk.default.green(`Found ${installedIDEs.length} IDE(s):
|
|
560
|
+
`));
|
|
561
|
+
installedIDEs.forEach((ide) => {
|
|
562
|
+
const version = ide.version ? import_chalk.default.gray(` v${ide.version}`) : "";
|
|
563
|
+
console.log(` ${import_chalk.default.green("\u2713")} ${ide.icon} ${import_chalk.default.bold(ide.displayName)}${version}`);
|
|
564
|
+
});
|
|
565
|
+
console.log();
|
|
566
|
+
let selectedIDEs;
|
|
567
|
+
if (installedIDEs.length === 1) {
|
|
568
|
+
selectedIDEs = installedIDEs;
|
|
569
|
+
console.log(import_chalk.default.gray(` Auto-selected: ${installedIDEs[0].displayName}
|
|
570
|
+
`));
|
|
566
571
|
} else {
|
|
567
|
-
|
|
568
|
-
|
|
572
|
+
const { selectedIdeIds } = await import_inquirer.default.prompt([
|
|
573
|
+
{
|
|
574
|
+
type: "checkbox",
|
|
575
|
+
name: "selectedIdeIds",
|
|
576
|
+
message: "Select IDEs to set up (Space to toggle, Enter to confirm):",
|
|
577
|
+
choices: installedIDEs.map((ide) => ({
|
|
578
|
+
name: `${ide.icon} ${ide.displayName}${ide.version ? import_chalk.default.gray(` v${ide.version}`) : ""}`,
|
|
579
|
+
value: ide.id,
|
|
580
|
+
checked: true
|
|
581
|
+
// 기본 모두 선택
|
|
582
|
+
})),
|
|
583
|
+
validate: (input) => input.length > 0 ? true : "Select at least one IDE"
|
|
584
|
+
}
|
|
585
|
+
]);
|
|
586
|
+
selectedIDEs = installedIDEs.filter((i) => selectedIdeIds.includes(i.id));
|
|
587
|
+
}
|
|
588
|
+
const bridgeExt = EXTENSION_CATALOG.find((e) => e.category === "bridge");
|
|
589
|
+
for (const ide of selectedIDEs) {
|
|
590
|
+
const installSpinner = (0, import_ora.default)(`Installing ADHDev Bridge \u2192 ${ide.displayName}...`).start();
|
|
591
|
+
const result = await installExtension(ide, bridgeExt);
|
|
592
|
+
if (result.success) {
|
|
593
|
+
installSpinner.succeed(result.alreadyInstalled ? `${ide.icon} ${ide.displayName} \u2014 Bridge already installed \u2713` : `${ide.icon} ${ide.displayName} \u2014 Bridge installed \u2713`);
|
|
594
|
+
} else {
|
|
595
|
+
installSpinner.fail(`${ide.icon} ${ide.displayName} \u2014 Failed: ${result.error}`);
|
|
596
|
+
}
|
|
569
597
|
}
|
|
570
598
|
console.log(DIVIDER);
|
|
571
599
|
const loginResult = await loginFlow();
|
|
@@ -573,9 +601,12 @@ async function quickSetup() {
|
|
|
573
601
|
console.log(import_chalk.default.yellow("\u26A0 Setup completed without login. You can login later with `adhdev setup`."));
|
|
574
602
|
}
|
|
575
603
|
if (loginResult?.connectionToken) {
|
|
576
|
-
|
|
604
|
+
for (const ide of selectedIDEs) {
|
|
605
|
+
await injectTokenToIDE(ide, loginResult.connectionToken);
|
|
606
|
+
}
|
|
577
607
|
}
|
|
578
|
-
|
|
608
|
+
const primaryIde = selectedIDEs[0];
|
|
609
|
+
markSetupComplete(primaryIde.id, ["adhdev"]);
|
|
579
610
|
if (loginResult) {
|
|
580
611
|
updateConfig({
|
|
581
612
|
connectionToken: loginResult.connectionToken,
|
|
@@ -585,10 +616,15 @@ async function quickSetup() {
|
|
|
585
616
|
}
|
|
586
617
|
console.log(DIVIDER);
|
|
587
618
|
console.log(import_chalk.default.bold("\n\u{1F389} Setup Complete!\n"));
|
|
588
|
-
|
|
619
|
+
if (selectedIDEs.length === 1) {
|
|
620
|
+
console.log(` ${import_chalk.default.bold("IDE:")} ${selectedIDEs[0].icon} ${selectedIDEs[0].displayName}`);
|
|
621
|
+
} else {
|
|
622
|
+
console.log(` ${import_chalk.default.bold("IDEs:")} ${selectedIDEs.map((i) => `${i.icon} ${i.displayName}`).join(", ")}`);
|
|
623
|
+
}
|
|
589
624
|
console.log(` ${import_chalk.default.bold("User:")} ${loginResult?.email || "not logged in"}`);
|
|
590
625
|
console.log(` ${import_chalk.default.bold("Status:")} ${import_chalk.default.green("Ready to connect")}`);
|
|
591
626
|
console.log();
|
|
627
|
+
await suggestGlobalInstall();
|
|
592
628
|
}
|
|
593
629
|
async function customSetup() {
|
|
594
630
|
console.log(import_chalk.default.bold("\n\u{1F4CD} Step 1/4 \u2014 Detecting installed IDEs...\n"));
|
|
@@ -852,6 +888,61 @@ async function addExtensionsFlow() {
|
|
|
852
888
|
});
|
|
853
889
|
console.log(import_chalk.default.green("\n\u2713 Extensions added!"));
|
|
854
890
|
}
|
|
891
|
+
async function suggestGlobalInstall() {
|
|
892
|
+
const { execSync: execSyncLocal } = await import("child_process");
|
|
893
|
+
let isGloballyInstalled = false;
|
|
894
|
+
try {
|
|
895
|
+
const result = execSyncLocal("npm list -g adhdev --json 2>/dev/null || npm list -g adhdev --json 2>nul", {
|
|
896
|
+
encoding: "utf-8",
|
|
897
|
+
timeout: 1e4,
|
|
898
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
899
|
+
});
|
|
900
|
+
const parsed = JSON.parse(result);
|
|
901
|
+
isGloballyInstalled = !!parsed.dependencies?.adhdev;
|
|
902
|
+
} catch {
|
|
903
|
+
isGloballyInstalled = false;
|
|
904
|
+
}
|
|
905
|
+
if (isGloballyInstalled) return;
|
|
906
|
+
console.log(import_chalk.default.cyan(DIVIDER));
|
|
907
|
+
console.log(import_chalk.default.bold("\n\u{1F4A1} Install ADHDev CLI globally?\n"));
|
|
908
|
+
console.log(import_chalk.default.gray(" The `adhdev` command lets you:"));
|
|
909
|
+
console.log(import_chalk.default.gray(" \u2022 Launch IDE with CDP debugging (adhdev launch cursor)"));
|
|
910
|
+
console.log(import_chalk.default.gray(" \u2022 Relaunch IDE from the extension"));
|
|
911
|
+
console.log(import_chalk.default.gray(" \u2022 Check status anytime (adhdev status)"));
|
|
912
|
+
console.log();
|
|
913
|
+
const { doInstall } = await import_inquirer.default.prompt([
|
|
914
|
+
{
|
|
915
|
+
type: "confirm",
|
|
916
|
+
name: "doInstall",
|
|
917
|
+
message: `Install globally? (npm install -g adhdev)`,
|
|
918
|
+
default: true
|
|
919
|
+
}
|
|
920
|
+
]);
|
|
921
|
+
if (!doInstall) {
|
|
922
|
+
console.log(import_chalk.default.gray("\n You can install later: npm install -g adhdev\n"));
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
const installSpinner = (0, import_ora.default)("Installing adhdev globally...").start();
|
|
926
|
+
try {
|
|
927
|
+
execSyncLocal("npm install -g adhdev", {
|
|
928
|
+
encoding: "utf-8",
|
|
929
|
+
timeout: 6e4,
|
|
930
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
931
|
+
});
|
|
932
|
+
installSpinner.succeed("adhdev CLI installed globally \u2713");
|
|
933
|
+
console.log(import_chalk.default.gray(" Try: adhdev launch cursor"));
|
|
934
|
+
console.log();
|
|
935
|
+
} catch (e) {
|
|
936
|
+
installSpinner.fail("Global install failed");
|
|
937
|
+
console.log(import_chalk.default.yellow(` Error: ${e?.message?.split("\n")[0] || "Unknown"}`));
|
|
938
|
+
console.log(import_chalk.default.gray(" Try manually: npm install -g adhdev"));
|
|
939
|
+
const os2 = await import("os");
|
|
940
|
+
if (os2.platform() === "win32") {
|
|
941
|
+
console.log(import_chalk.default.gray(" On Windows, you may need to run PowerShell as Administrator"));
|
|
942
|
+
}
|
|
943
|
+
console.log();
|
|
944
|
+
}
|
|
945
|
+
}
|
|
855
946
|
|
|
856
947
|
// src/launch.ts
|
|
857
948
|
var import_child_process3 = require("child_process");
|
|
@@ -1156,7 +1247,7 @@ async function launchLinux(ide, port, workspace, newWindow) {
|
|
|
1156
1247
|
|
|
1157
1248
|
// src/index.ts
|
|
1158
1249
|
var program = new import_commander.Command();
|
|
1159
|
-
program.name("adhdev").description("\u{1F309} ADHDev \u2014 Agent Dashboard Hub for your IDE").version("0.1.
|
|
1250
|
+
program.name("adhdev").description("\u{1F309} ADHDev \u2014 Agent Dashboard Hub for your IDE").version("0.1.9");
|
|
1160
1251
|
program.command("setup", { isDefault: true }).description("Run the interactive setup wizard").option("-f, --force", "Force re-run setup even if already configured").action(async (options) => {
|
|
1161
1252
|
await runWizard({ force: options.force });
|
|
1162
1253
|
});
|