adhdev 0.5.11 → 0.5.13
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/cli/index.js +59 -284
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +50 -275
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16718,14 +16718,14 @@ var require_dist = __commonJS({
|
|
|
16718
16718
|
LOG: () => LOG5,
|
|
16719
16719
|
ProviderCliAdapter: () => ProviderCliAdapter,
|
|
16720
16720
|
ProviderInstanceManager: () => ProviderInstanceManager,
|
|
16721
|
-
ProviderLoader: () =>
|
|
16721
|
+
ProviderLoader: () => ProviderLoader,
|
|
16722
16722
|
VersionArchive: () => VersionArchive2,
|
|
16723
16723
|
addCliHistory: () => addCliHistory,
|
|
16724
16724
|
connectCdpManager: () => connectCdpManager,
|
|
16725
16725
|
detectAllVersions: () => detectAllVersions2,
|
|
16726
16726
|
detectCLIs: () => detectCLIs,
|
|
16727
|
-
detectIDEs: () =>
|
|
16728
|
-
getAIExtensions: () =>
|
|
16727
|
+
detectIDEs: () => detectIDEs,
|
|
16728
|
+
getAIExtensions: () => getAIExtensions,
|
|
16729
16729
|
getAvailableIdeIds: () => getAvailableIdeIds,
|
|
16730
16730
|
getHostMemorySnapshot: () => getHostMemorySnapshot,
|
|
16731
16731
|
getLogLevel: () => getLogLevel,
|
|
@@ -16734,11 +16734,11 @@ var require_dist = __commonJS({
|
|
|
16734
16734
|
getWorkspaceActivity: () => getWorkspaceActivity,
|
|
16735
16735
|
getWorkspaceState: () => getWorkspaceState,
|
|
16736
16736
|
initDaemonComponents: () => initDaemonComponents2,
|
|
16737
|
-
installExtensions: () =>
|
|
16737
|
+
installExtensions: () => installExtensions,
|
|
16738
16738
|
installGlobalInterceptor: () => installGlobalInterceptor,
|
|
16739
16739
|
isExtensionInstalled: () => isExtensionInstalled,
|
|
16740
16740
|
isSetupComplete: () => isSetupComplete2,
|
|
16741
|
-
launchIDE: () =>
|
|
16741
|
+
launchIDE: () => launchIDE,
|
|
16742
16742
|
launchWithCdp: () => launchWithCdp,
|
|
16743
16743
|
loadConfig: () => loadConfig3,
|
|
16744
16744
|
logCommand: () => logCommand2,
|
|
@@ -16850,7 +16850,7 @@ var require_dist = __commonJS({
|
|
|
16850
16850
|
}
|
|
16851
16851
|
return null;
|
|
16852
16852
|
}
|
|
16853
|
-
async function
|
|
16853
|
+
async function detectIDEs() {
|
|
16854
16854
|
const os15 = (0, import_os2.platform)();
|
|
16855
16855
|
const results = [];
|
|
16856
16856
|
for (const def of getMergedDefinitions()) {
|
|
@@ -20871,7 +20871,7 @@ var require_dist = __commonJS({
|
|
|
20871
20871
|
var fs5 = __toESM2(require("fs"));
|
|
20872
20872
|
var path6 = __toESM2(require("path"));
|
|
20873
20873
|
var os7 = __toESM2(require("os"));
|
|
20874
|
-
var
|
|
20874
|
+
var ProviderLoader = class _ProviderLoader {
|
|
20875
20875
|
providers = /* @__PURE__ */ new Map();
|
|
20876
20876
|
builtinDirs;
|
|
20877
20877
|
userDir;
|
|
@@ -21750,7 +21750,7 @@ var require_dist = __commonJS({
|
|
|
21750
21750
|
var _providerLoader = null;
|
|
21751
21751
|
function getProviderLoader() {
|
|
21752
21752
|
if (!_providerLoader) {
|
|
21753
|
-
_providerLoader = new
|
|
21753
|
+
_providerLoader = new ProviderLoader({ logFn: () => {
|
|
21754
21754
|
} });
|
|
21755
21755
|
_providerLoader.loadAll();
|
|
21756
21756
|
_providerLoader.registerToDetector();
|
|
@@ -21951,7 +21951,7 @@ var require_dist = __commonJS({
|
|
|
21951
21951
|
async function launchWithCdp(options = {}) {
|
|
21952
21952
|
const platform8 = os8.platform();
|
|
21953
21953
|
let targetIde;
|
|
21954
|
-
const ides = await
|
|
21954
|
+
const ides = await detectIDEs();
|
|
21955
21955
|
if (options.ideId) {
|
|
21956
21956
|
targetIde = ides.find((i) => i.id === options.ideId && i.installed);
|
|
21957
21957
|
if (!targetIde) {
|
|
@@ -22381,7 +22381,7 @@ var require_dist = __commonJS({
|
|
|
22381
22381
|
}
|
|
22382
22382
|
// ─── IDE detection ───
|
|
22383
22383
|
case "detect_ides": {
|
|
22384
|
-
this.deps.detectedIdes.value = await
|
|
22384
|
+
this.deps.detectedIdes.value = await detectIDEs();
|
|
22385
22385
|
return { success: true, ides: this.deps.detectedIdes.value };
|
|
22386
22386
|
}
|
|
22387
22387
|
// ─── Machine Settings ───
|
|
@@ -28524,7 +28524,7 @@ data: ${JSON.stringify(msg.data)}
|
|
|
28524
28524
|
});
|
|
28525
28525
|
});
|
|
28526
28526
|
}
|
|
28527
|
-
async function
|
|
28527
|
+
async function installExtensions(ide, extensions, onProgress) {
|
|
28528
28528
|
const results = [];
|
|
28529
28529
|
for (let i = 0; i < extensions.length; i++) {
|
|
28530
28530
|
const ext = extensions[i];
|
|
@@ -28534,10 +28534,10 @@ data: ${JSON.stringify(msg.data)}
|
|
|
28534
28534
|
}
|
|
28535
28535
|
return results;
|
|
28536
28536
|
}
|
|
28537
|
-
function
|
|
28537
|
+
function getAIExtensions() {
|
|
28538
28538
|
return EXTENSION_CATALOG.filter((e) => e.category === "ai-agent");
|
|
28539
28539
|
}
|
|
28540
|
-
function
|
|
28540
|
+
function launchIDE(ide, workspacePath) {
|
|
28541
28541
|
if (!ide.cliCommand) return false;
|
|
28542
28542
|
try {
|
|
28543
28543
|
const args = workspacePath ? `"${workspacePath}"` : "";
|
|
@@ -28550,7 +28550,7 @@ data: ${JSON.stringify(msg.data)}
|
|
|
28550
28550
|
init_config();
|
|
28551
28551
|
async function initDaemonComponents2(config2) {
|
|
28552
28552
|
installGlobalInterceptor();
|
|
28553
|
-
const providerLoader = new
|
|
28553
|
+
const providerLoader = new ProviderLoader({
|
|
28554
28554
|
logFn: config2.providerLogFn
|
|
28555
28555
|
});
|
|
28556
28556
|
providerLoader.loadAll();
|
|
@@ -28564,7 +28564,7 @@ data: ${JSON.stringify(msg.data)}
|
|
|
28564
28564
|
getInstanceManager: () => instanceManager
|
|
28565
28565
|
}, providerLoader);
|
|
28566
28566
|
LOG5.info("Init", "Detecting IDEs...");
|
|
28567
|
-
detectedIdesRef.value = await
|
|
28567
|
+
detectedIdesRef.value = await detectIDEs();
|
|
28568
28568
|
const installed = detectedIdesRef.value.filter((i) => i.installed);
|
|
28569
28569
|
LOG5.info("Init", `Found ${installed.length} IDE(s): ${installed.map((i) => i.id).join(", ") || "none"}`);
|
|
28570
28570
|
const cdpSetupContext = {
|
|
@@ -29894,23 +29894,25 @@ var init_adhdev_daemon = __esm({
|
|
|
29894
29894
|
path2 = __toESM(require("path"));
|
|
29895
29895
|
crypto2 = __toESM(require("crypto"));
|
|
29896
29896
|
import_chalk = __toESM(require("chalk"));
|
|
29897
|
-
pkgVersion = "
|
|
29898
|
-
|
|
29899
|
-
|
|
29900
|
-
|
|
29901
|
-
|
|
29902
|
-
|
|
29903
|
-
|
|
29904
|
-
|
|
29905
|
-
|
|
29906
|
-
|
|
29907
|
-
|
|
29908
|
-
|
|
29897
|
+
pkgVersion = "0.5.13";
|
|
29898
|
+
if (pkgVersion === "unknown") {
|
|
29899
|
+
try {
|
|
29900
|
+
const possiblePaths = [
|
|
29901
|
+
path2.join(__dirname, "..", "package.json"),
|
|
29902
|
+
path2.join(__dirname, "package.json")
|
|
29903
|
+
];
|
|
29904
|
+
for (const p of possiblePaths) {
|
|
29905
|
+
try {
|
|
29906
|
+
const data = JSON.parse(fs2.readFileSync(p, "utf-8"));
|
|
29907
|
+
if (data.version) {
|
|
29908
|
+
pkgVersion = data.version;
|
|
29909
|
+
break;
|
|
29910
|
+
}
|
|
29911
|
+
} catch {
|
|
29909
29912
|
}
|
|
29910
|
-
} catch {
|
|
29911
29913
|
}
|
|
29914
|
+
} catch {
|
|
29912
29915
|
}
|
|
29913
|
-
} catch {
|
|
29914
29916
|
}
|
|
29915
29917
|
DANGEROUS_PATTERNS = [
|
|
29916
29918
|
/\brm\s+(-[a-z]*f|-[a-z]*r|--force|--recursive)/i,
|
|
@@ -30385,18 +30387,11 @@ ${import_chalk2.default.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u
|
|
|
30385
30387
|
`;
|
|
30386
30388
|
var DIVIDER = import_chalk2.default.gray("\u2500".repeat(44));
|
|
30387
30389
|
async function runWizard(options = {}) {
|
|
30388
|
-
const loader = new import_daemon_core5.ProviderLoader({ logFn: () => {
|
|
30389
|
-
} });
|
|
30390
|
-
loader.loadAll();
|
|
30391
|
-
loader.registerToDetector();
|
|
30392
30390
|
console.log(LOGO);
|
|
30393
30391
|
if ((0, import_daemon_core5.isSetupComplete)() && !options.force) {
|
|
30394
30392
|
const config2 = (0, import_daemon_core5.loadConfig)();
|
|
30395
30393
|
console.log(import_chalk2.default.green("\u2713") + " ADHDev is already set up!");
|
|
30396
|
-
const ides = config2.configuredIdes?.length ? config2.configuredIdes.join(", ") : config2.selectedIde || "none";
|
|
30397
|
-
console.log(import_chalk2.default.gray(` IDEs: ${ides}`));
|
|
30398
30394
|
console.log(import_chalk2.default.gray(` User: ${config2.userEmail || "not logged in"}`));
|
|
30399
|
-
console.log(import_chalk2.default.gray(` Extensions: ${config2.installedExtensions.length} installed`));
|
|
30400
30395
|
console.log();
|
|
30401
30396
|
const { action } = await import_inquirer.default.prompt([
|
|
30402
30397
|
{
|
|
@@ -30434,80 +30429,15 @@ async function runWizard(options = {}) {
|
|
|
30434
30429
|
return;
|
|
30435
30430
|
}
|
|
30436
30431
|
}
|
|
30437
|
-
|
|
30438
|
-
{
|
|
30439
|
-
type: "list",
|
|
30440
|
-
name: "mode",
|
|
30441
|
-
message: "Setup mode:",
|
|
30442
|
-
choices: [
|
|
30443
|
-
{ name: `\u{1F680} ${import_chalk2.default.bold("Quick Setup")} \u2014 Auto-detect IDEs, login ${import_chalk2.default.gray("(recommended)")}`, value: "quick" },
|
|
30444
|
-
{ name: `\u2699\uFE0F ${import_chalk2.default.bold("Custom Setup")} \u2014 Choose IDE, AI extensions, and more`, value: "custom" },
|
|
30445
|
-
{ name: `\u{1F527} ${import_chalk2.default.bold("CLI Only")} \u2014 Install adhdev command globally`, value: "cli-only" }
|
|
30446
|
-
]
|
|
30447
|
-
}
|
|
30448
|
-
]);
|
|
30449
|
-
if (mode === "quick") {
|
|
30450
|
-
await quickSetup();
|
|
30451
|
-
} else if (mode === "cli-only") {
|
|
30452
|
-
await installCliOnly();
|
|
30453
|
-
} else {
|
|
30454
|
-
await customSetup();
|
|
30455
|
-
}
|
|
30432
|
+
await quickSetup();
|
|
30456
30433
|
}
|
|
30457
30434
|
async function quickSetup() {
|
|
30458
30435
|
console.log(import_chalk2.default.bold("\n\u{1F680} Quick Setup\n"));
|
|
30459
|
-
const spinner = (0, import_ora.default)("Detecting installed IDEs...").start();
|
|
30460
|
-
const ides = await (0, import_daemon_core5.detectIDEs)();
|
|
30461
|
-
const installedIDEs = ides.filter((i) => i.installed);
|
|
30462
|
-
spinner.stop();
|
|
30463
|
-
let selectedIDEs = [];
|
|
30464
|
-
if (installedIDEs.length === 0) {
|
|
30465
|
-
console.log(import_chalk2.default.yellow("\u26A0 No supported IDEs auto-detected."));
|
|
30466
|
-
console.log(import_chalk2.default.gray(" This is fine \u2014 the daemon will detect IDEs at runtime via CDP."));
|
|
30467
|
-
console.log(import_chalk2.default.gray(" Supported: VS Code, Cursor, Antigravity, Windsurf, VSCodium"));
|
|
30468
|
-
console.log();
|
|
30469
|
-
} else {
|
|
30470
|
-
console.log(import_chalk2.default.green(`Found ${installedIDEs.length} IDE(s):
|
|
30471
|
-
`));
|
|
30472
|
-
installedIDEs.forEach((ide) => {
|
|
30473
|
-
const version2 = ide.version ? import_chalk2.default.gray(` v${ide.version}`) : "";
|
|
30474
|
-
console.log(` ${import_chalk2.default.green("\u2713")} ${ide.icon} ${import_chalk2.default.bold(ide.displayName)}${version2}`);
|
|
30475
|
-
});
|
|
30476
|
-
console.log();
|
|
30477
|
-
if (installedIDEs.length === 1) {
|
|
30478
|
-
selectedIDEs = installedIDEs;
|
|
30479
|
-
console.log(import_chalk2.default.gray(` Auto-selected: ${installedIDEs[0].displayName}
|
|
30480
|
-
`));
|
|
30481
|
-
} else {
|
|
30482
|
-
const { selectedIdeIds } = await import_inquirer.default.prompt([
|
|
30483
|
-
{
|
|
30484
|
-
type: "checkbox",
|
|
30485
|
-
name: "selectedIdeIds",
|
|
30486
|
-
message: "Select IDEs to set up (Space to toggle, Enter to confirm):",
|
|
30487
|
-
choices: installedIDEs.map((ide) => ({
|
|
30488
|
-
name: `${ide.icon} ${ide.displayName}${ide.version ? import_chalk2.default.gray(` v${ide.version}`) : ""}`,
|
|
30489
|
-
value: ide.id,
|
|
30490
|
-
checked: true
|
|
30491
|
-
// All selected by default
|
|
30492
|
-
})),
|
|
30493
|
-
validate: (input) => input.length > 0 ? true : "Select at least one IDE"
|
|
30494
|
-
}
|
|
30495
|
-
]);
|
|
30496
|
-
selectedIDEs = installedIDEs.filter((i) => selectedIdeIds.includes(i.id));
|
|
30497
|
-
}
|
|
30498
|
-
}
|
|
30499
|
-
console.log(DIVIDER);
|
|
30500
30436
|
const loginResult = await loginFlow();
|
|
30501
30437
|
if (!loginResult) {
|
|
30502
30438
|
console.log(import_chalk2.default.yellow("\u26A0 Setup completed without login. You can login later with `adhdev setup`."));
|
|
30503
30439
|
}
|
|
30504
|
-
|
|
30505
|
-
for (const ide of selectedIDEs) {
|
|
30506
|
-
await injectTokenToIDE(ide, loginResult.connectionToken);
|
|
30507
|
-
}
|
|
30508
|
-
}
|
|
30509
|
-
const ideIds = selectedIDEs.map((i) => i.id);
|
|
30510
|
-
(0, import_daemon_core5.markSetupComplete)(ideIds.length > 0 ? ideIds : ["daemon-only"], ["adhdev"]);
|
|
30440
|
+
(0, import_daemon_core5.markSetupComplete)(["daemon"], ["adhdev"]);
|
|
30511
30441
|
if (loginResult) {
|
|
30512
30442
|
(0, import_daemon_core5.updateConfig)({
|
|
30513
30443
|
connectionToken: loginResult.connectionToken,
|
|
@@ -30517,15 +30447,6 @@ async function quickSetup() {
|
|
|
30517
30447
|
}
|
|
30518
30448
|
console.log(DIVIDER);
|
|
30519
30449
|
console.log(import_chalk2.default.bold("\n\u{1F389} Setup Complete!\n"));
|
|
30520
|
-
if (selectedIDEs.length > 0) {
|
|
30521
|
-
if (selectedIDEs.length === 1) {
|
|
30522
|
-
console.log(` ${import_chalk2.default.bold("IDE:")} ${selectedIDEs[0].icon} ${selectedIDEs[0].displayName}`);
|
|
30523
|
-
} else {
|
|
30524
|
-
console.log(` ${import_chalk2.default.bold("IDEs:")} ${selectedIDEs.map((i) => `${i.icon} ${i.displayName}`).join(", ")}`);
|
|
30525
|
-
}
|
|
30526
|
-
} else {
|
|
30527
|
-
console.log(` ${import_chalk2.default.bold("IDEs:")} ${import_chalk2.default.gray("None detected (daemon will auto-detect at runtime)")}`);
|
|
30528
|
-
}
|
|
30529
30450
|
console.log(` ${import_chalk2.default.bold("User:")} ${loginResult?.email || "not logged in"}`);
|
|
30530
30451
|
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("Ready to connect")}`);
|
|
30531
30452
|
console.log();
|
|
@@ -30533,127 +30454,19 @@ async function quickSetup() {
|
|
|
30533
30454
|
console.log(import_chalk2.default.gray(" adhdev daemon \u2014 Start the main daemon (required for all features)"));
|
|
30534
30455
|
console.log(import_chalk2.default.gray(" adhdev launch <ide> \u2014 Launch an IDE with remote control (e.g. cursor)"));
|
|
30535
30456
|
console.log(import_chalk2.default.gray(" adhdev launch <agent> \u2014 Start a CLI agent via daemon (e.g. gemini, claude)"));
|
|
30536
|
-
console.log(import_chalk2.default.gray(" adhdev cdp \u2014 Interactive CDP debug console"));
|
|
30537
30457
|
console.log(import_chalk2.default.gray(" adhdev status \u2014 Check setup status"));
|
|
30538
30458
|
console.log(import_chalk2.default.gray(" adhdev setup \u2014 Reconfigure ADHDev"));
|
|
30539
30459
|
console.log();
|
|
30540
30460
|
await installCliOnly();
|
|
30541
30461
|
await startDaemonFlow();
|
|
30542
30462
|
}
|
|
30543
|
-
async function customSetup() {
|
|
30544
|
-
console.log(import_chalk2.default.bold("\n\u{1F4CD} Step 1/4 \u2014 Detecting installed IDEs...\n"));
|
|
30545
|
-
const spinner = (0, import_ora.default)("Scanning your system...").start();
|
|
30546
|
-
const ides = await (0, import_daemon_core5.detectIDEs)();
|
|
30547
|
-
const installedIDEs = ides.filter((i) => i.installed);
|
|
30548
|
-
spinner.stop();
|
|
30549
|
-
if (installedIDEs.length === 0) {
|
|
30550
|
-
console.log(import_chalk2.default.yellow("\u26A0 No supported IDEs auto-detected."));
|
|
30551
|
-
console.log(import_chalk2.default.gray(" The daemon will detect IDEs at runtime via CDP."));
|
|
30552
|
-
console.log();
|
|
30553
|
-
console.log(DIVIDER);
|
|
30554
|
-
const loginResult2 = await loginFlow();
|
|
30555
|
-
(0, import_daemon_core5.markSetupComplete)(["daemon-only"], ["adhdev"]);
|
|
30556
|
-
if (loginResult2) {
|
|
30557
|
-
(0, import_daemon_core5.updateConfig)({
|
|
30558
|
-
connectionToken: loginResult2.connectionToken,
|
|
30559
|
-
userEmail: loginResult2.email,
|
|
30560
|
-
userName: loginResult2.name
|
|
30561
|
-
});
|
|
30562
|
-
}
|
|
30563
|
-
console.log(DIVIDER);
|
|
30564
|
-
console.log(import_chalk2.default.bold("\n\u{1F389} Setup Complete!\n"));
|
|
30565
|
-
console.log(` ${import_chalk2.default.bold("IDEs:")} ${import_chalk2.default.gray("None detected (daemon will auto-detect at runtime)")}`);
|
|
30566
|
-
console.log(` ${import_chalk2.default.bold("User:")} ${loginResult2?.email || "not logged in"}`);
|
|
30567
|
-
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("Ready to connect")}`);
|
|
30568
|
-
console.log();
|
|
30569
|
-
await startDaemonFlow();
|
|
30570
|
-
return;
|
|
30571
|
-
}
|
|
30572
|
-
console.log(import_chalk2.default.green(`Found ${installedIDEs.length} IDE(s):
|
|
30573
|
-
`));
|
|
30574
|
-
installedIDEs.forEach((ide) => {
|
|
30575
|
-
const version2 = ide.version ? import_chalk2.default.gray(` v${ide.version}`) : "";
|
|
30576
|
-
const cli = ide.cliCommand ? import_chalk2.default.gray(` (CLI: \u2713)`) : import_chalk2.default.yellow(` (CLI: \u2717 manual install)`);
|
|
30577
|
-
console.log(` ${ide.icon} ${import_chalk2.default.bold(ide.displayName)}${version2}${cli}`);
|
|
30578
|
-
});
|
|
30579
|
-
console.log();
|
|
30580
|
-
console.log(DIVIDER);
|
|
30581
|
-
console.log(import_chalk2.default.bold("\n\u{1F4CD} Step 2/4 \u2014 Select your primary IDE\n"));
|
|
30582
|
-
const { selectedIdeId } = await import_inquirer.default.prompt([
|
|
30583
|
-
{
|
|
30584
|
-
type: "list",
|
|
30585
|
-
name: "selectedIdeId",
|
|
30586
|
-
message: "Which IDE?",
|
|
30587
|
-
choices: installedIDEs.map((ide) => ({
|
|
30588
|
-
name: `${ide.icon} ${ide.displayName}${ide.version ? import_chalk2.default.gray(` v${ide.version}`) : ""}`,
|
|
30589
|
-
value: ide.id
|
|
30590
|
-
}))
|
|
30591
|
-
}
|
|
30592
|
-
]);
|
|
30593
|
-
const selectedIDE = installedIDEs.find((i) => i.id === selectedIdeId);
|
|
30594
|
-
console.log(DIVIDER);
|
|
30595
|
-
console.log(import_chalk2.default.bold("\n\u{1F4CD} Step 3/4 \u2014 Choose AI extensions\n"));
|
|
30596
|
-
const aiExtensions = (0, import_daemon_core5.getAIExtensions)();
|
|
30597
|
-
const { selectedExtIds } = await import_inquirer.default.prompt([
|
|
30598
|
-
{
|
|
30599
|
-
type: "checkbox",
|
|
30600
|
-
name: "selectedExtIds",
|
|
30601
|
-
message: "Select AI extensions:",
|
|
30602
|
-
choices: aiExtensions.map((ext) => ({
|
|
30603
|
-
name: `${ext.icon} ${ext.displayName} \u2014 ${import_chalk2.default.gray(ext.description)}`,
|
|
30604
|
-
value: ext.id,
|
|
30605
|
-
checked: ext.recommended
|
|
30606
|
-
}))
|
|
30607
|
-
}
|
|
30608
|
-
]);
|
|
30609
|
-
const selectedAIExts = aiExtensions.filter((e) => selectedExtIds.includes(e.id));
|
|
30610
|
-
const allExtensions = selectedAIExts;
|
|
30611
|
-
console.log(import_chalk2.default.bold("\n\u{1F4CD} Step 4/4 \u2014 Installing extensions\n"));
|
|
30612
|
-
if (selectedIDE.cliCommand) {
|
|
30613
|
-
await (0, import_daemon_core5.installExtensions)(
|
|
30614
|
-
selectedIDE,
|
|
30615
|
-
allExtensions,
|
|
30616
|
-
(current, total, ext, result) => {
|
|
30617
|
-
const status = result.alreadyInstalled ? import_chalk2.default.blue("already installed") : result.success ? import_chalk2.default.green("installed \u2713") : import_chalk2.default.red(`failed \u2717`);
|
|
30618
|
-
console.log(` [${current}/${total}] ${ext.icon} ${ext.displayName} \u2014 ${status}`);
|
|
30619
|
-
}
|
|
30620
|
-
);
|
|
30621
|
-
} else {
|
|
30622
|
-
console.log(import_chalk2.default.yellow("\u26A0 No CLI \u2014 install manually:"));
|
|
30623
|
-
allExtensions.forEach((ext) => {
|
|
30624
|
-
console.log(import_chalk2.default.gray(` ${ext.icon} ${ext.displayName}: ${ext.marketplaceId}`));
|
|
30625
|
-
});
|
|
30626
|
-
}
|
|
30627
|
-
console.log(DIVIDER);
|
|
30628
|
-
const loginResult = await loginFlow();
|
|
30629
|
-
if (loginResult?.connectionToken) {
|
|
30630
|
-
await injectTokenToIDE(selectedIDE, loginResult.connectionToken);
|
|
30631
|
-
}
|
|
30632
|
-
(0, import_daemon_core5.markSetupComplete)(selectedIdeId, allExtensions.map((e) => e.id));
|
|
30633
|
-
if (loginResult) {
|
|
30634
|
-
(0, import_daemon_core5.updateConfig)({
|
|
30635
|
-
connectionToken: loginResult.connectionToken,
|
|
30636
|
-
userEmail: loginResult.email,
|
|
30637
|
-
userName: loginResult.name
|
|
30638
|
-
});
|
|
30639
|
-
}
|
|
30640
|
-
console.log(DIVIDER);
|
|
30641
|
-
console.log(import_chalk2.default.bold("\n\u{1F389} Setup Complete!\n"));
|
|
30642
|
-
console.log(` ${import_chalk2.default.bold("IDE:")} ${selectedIDE.icon} ${selectedIDE.displayName}`);
|
|
30643
|
-
console.log(` ${import_chalk2.default.bold("Extensions:")} ${allExtensions.length} installed`);
|
|
30644
|
-
console.log(` ${import_chalk2.default.bold("User:")} ${loginResult?.email || "not logged in"}`);
|
|
30645
|
-
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("Ready to connect")}`);
|
|
30646
|
-
console.log();
|
|
30647
|
-
await startDaemonFlow();
|
|
30648
|
-
console.log(import_chalk2.default.gray("\nThank you for using ADHDev! \u{1F9A6}\n"));
|
|
30649
|
-
}
|
|
30650
30463
|
async function loginFlow() {
|
|
30651
30464
|
console.log(import_chalk2.default.bold("\n\u{1F510} Login to ADHDev\n"));
|
|
30652
30465
|
const { wantLogin } = await import_inquirer.default.prompt([
|
|
30653
30466
|
{
|
|
30654
30467
|
type: "confirm",
|
|
30655
30468
|
name: "wantLogin",
|
|
30656
|
-
message: "Sign in to connect
|
|
30469
|
+
message: "Sign in to connect to your ADHDev account?",
|
|
30657
30470
|
default: true
|
|
30658
30471
|
}
|
|
30659
30472
|
]);
|
|
@@ -30720,49 +30533,6 @@ async function loginFlow() {
|
|
|
30720
30533
|
pollSpinner.fail("Authentication timed out");
|
|
30721
30534
|
return null;
|
|
30722
30535
|
}
|
|
30723
|
-
async function injectTokenToIDE(ide, connectionToken) {
|
|
30724
|
-
if (!ide.cliCommand) return;
|
|
30725
|
-
try {
|
|
30726
|
-
const os3 = await import("os");
|
|
30727
|
-
const fs3 = await import("fs");
|
|
30728
|
-
const path3 = await import("path");
|
|
30729
|
-
const platform2 = os3.platform();
|
|
30730
|
-
const home = os3.homedir();
|
|
30731
|
-
const getSettingsPath = (appName2) => {
|
|
30732
|
-
if (platform2 === "darwin") {
|
|
30733
|
-
return path3.join(home, "Library", "Application Support", appName2, "User", "settings.json");
|
|
30734
|
-
} else if (platform2 === "win32") {
|
|
30735
|
-
return path3.join(process.env.APPDATA || path3.join(home, "AppData", "Roaming"), appName2, "User", "settings.json");
|
|
30736
|
-
} else {
|
|
30737
|
-
return path3.join(home, ".config", appName2, "User", "settings.json");
|
|
30738
|
-
}
|
|
30739
|
-
};
|
|
30740
|
-
const loader = new import_daemon_core5.ProviderLoader({ logFn: () => {
|
|
30741
|
-
} });
|
|
30742
|
-
loader.loadAll();
|
|
30743
|
-
const appNameMap = loader.getMacAppIdentifiers();
|
|
30744
|
-
const appName = appNameMap[ide.id];
|
|
30745
|
-
if (!appName) return;
|
|
30746
|
-
const settingsPath = getSettingsPath(appName);
|
|
30747
|
-
let settings = {};
|
|
30748
|
-
if (fs3.existsSync(settingsPath)) {
|
|
30749
|
-
try {
|
|
30750
|
-
settings = JSON.parse(fs3.readFileSync(settingsPath, "utf-8"));
|
|
30751
|
-
} catch {
|
|
30752
|
-
settings = {};
|
|
30753
|
-
}
|
|
30754
|
-
} else {
|
|
30755
|
-
fs3.mkdirSync(path3.dirname(settingsPath), { recursive: true });
|
|
30756
|
-
}
|
|
30757
|
-
settings["adhdev.connectionToken"] = connectionToken;
|
|
30758
|
-
settings["adhdev.autoConnect"] = true;
|
|
30759
|
-
fs3.writeFileSync(settingsPath, JSON.stringify(settings, null, 4), "utf-8");
|
|
30760
|
-
console.log(import_chalk2.default.green(" \u2713 Connection token saved to IDE settings"));
|
|
30761
|
-
} catch (e) {
|
|
30762
|
-
console.log(import_chalk2.default.yellow(` \u26A0 Could not inject token: ${e.message}`));
|
|
30763
|
-
console.log(import_chalk2.default.gray(` You can set it manually: adhdev.connectionToken = ${connectionToken}`));
|
|
30764
|
-
}
|
|
30765
|
-
}
|
|
30766
30536
|
async function startDaemonFlow() {
|
|
30767
30537
|
const { isDaemonRunning: isDaemonRunning2 } = await Promise.resolve().then(() => (init_adhdev_daemon(), adhdev_daemon_exports));
|
|
30768
30538
|
if (isDaemonRunning2()) {
|
|
@@ -30774,7 +30544,7 @@ async function startDaemonFlow() {
|
|
|
30774
30544
|
{
|
|
30775
30545
|
type: "confirm",
|
|
30776
30546
|
name: "startDaemon",
|
|
30777
|
-
message: "Start the ADHDev Daemon now?
|
|
30547
|
+
message: "Start the ADHDev Daemon now?",
|
|
30778
30548
|
default: true
|
|
30779
30549
|
}
|
|
30780
30550
|
]);
|
|
@@ -30790,11 +30560,20 @@ async function startDaemonFlow() {
|
|
|
30790
30560
|
const os3 = await import("os");
|
|
30791
30561
|
const path3 = await import("path");
|
|
30792
30562
|
const logPath = path3.join(os3.homedir(), ".adhdev", "daemon.log");
|
|
30563
|
+
const platform2 = os3.platform();
|
|
30793
30564
|
try {
|
|
30794
|
-
|
|
30795
|
-
|
|
30796
|
-
|
|
30797
|
-
|
|
30565
|
+
if (platform2 === "win32") {
|
|
30566
|
+
execSync(`start /B adhdev daemon > "${logPath}" 2>&1`, {
|
|
30567
|
+
timeout: 3e3,
|
|
30568
|
+
stdio: "ignore",
|
|
30569
|
+
shell: "cmd.exe"
|
|
30570
|
+
});
|
|
30571
|
+
} else {
|
|
30572
|
+
execSync(`nohup adhdev daemon > "${logPath}" 2>&1 &`, {
|
|
30573
|
+
timeout: 3e3,
|
|
30574
|
+
stdio: "ignore"
|
|
30575
|
+
});
|
|
30576
|
+
}
|
|
30798
30577
|
} catch {
|
|
30799
30578
|
daemon.start({ localPort: 19222, foreground: false }).catch(() => {
|
|
30800
30579
|
});
|
|
@@ -30802,13 +30581,11 @@ async function startDaemonFlow() {
|
|
|
30802
30581
|
await new Promise((r) => setTimeout(r, 2e3));
|
|
30803
30582
|
if (isDaemonRunning2()) {
|
|
30804
30583
|
daemonSpinner.succeed("Daemon started");
|
|
30805
|
-
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
30806
|
-
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
30807
30584
|
} else {
|
|
30808
30585
|
daemonSpinner.succeed("Daemon starting in background");
|
|
30809
|
-
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
30810
|
-
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
30811
30586
|
}
|
|
30587
|
+
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
30588
|
+
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
30812
30589
|
console.log();
|
|
30813
30590
|
} catch (e) {
|
|
30814
30591
|
daemonSpinner.fail(`Daemon start failed: ${e?.message || "Unknown"}`);
|
|
@@ -30834,7 +30611,6 @@ async function installCliOnly() {
|
|
|
30834
30611
|
console.log(import_chalk2.default.gray(" \u2022 Start the main daemon (adhdev daemon)"));
|
|
30835
30612
|
console.log(import_chalk2.default.gray(" \u2022 Launch IDE with CDP (adhdev launch <ide>)"));
|
|
30836
30613
|
console.log(import_chalk2.default.gray(" \u2022 Start CLI agents (adhdev launch <agent>)"));
|
|
30837
|
-
console.log(import_chalk2.default.gray(" \u2022 CDP Debugging Console (adhdev cdp)"));
|
|
30838
30614
|
console.log(import_chalk2.default.gray(" \u2022 Check setup status (adhdev status)"));
|
|
30839
30615
|
console.log();
|
|
30840
30616
|
if (currentVersion) {
|
|
@@ -30885,7 +30661,6 @@ async function installCliOnly() {
|
|
|
30885
30661
|
}
|
|
30886
30662
|
installSpinner.succeed(`adhdev CLI ${currentVersion ? "updated" : "installed"} \u2713 (v${newVersion})`);
|
|
30887
30663
|
console.log(import_chalk2.default.gray(" Try: adhdev daemon"));
|
|
30888
|
-
console.log(import_chalk2.default.gray(" adhdev status"));
|
|
30889
30664
|
console.log();
|
|
30890
30665
|
} catch (e) {
|
|
30891
30666
|
installSpinner.fail("Install failed");
|