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/cli/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: () => ProviderLoader2,
|
|
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 ProviderLoader2 = 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 ProviderLoader2({ 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 ProviderLoader2({
|
|
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,
|
|
@@ -30360,18 +30362,11 @@ __export(wizard_exports, {
|
|
|
30360
30362
|
runWizard: () => runWizard
|
|
30361
30363
|
});
|
|
30362
30364
|
async function runWizard(options = {}) {
|
|
30363
|
-
const loader = new import_daemon_core5.ProviderLoader({ logFn: () => {
|
|
30364
|
-
} });
|
|
30365
|
-
loader.loadAll();
|
|
30366
|
-
loader.registerToDetector();
|
|
30367
30365
|
console.log(LOGO);
|
|
30368
30366
|
if ((0, import_daemon_core5.isSetupComplete)() && !options.force) {
|
|
30369
30367
|
const config2 = (0, import_daemon_core5.loadConfig)();
|
|
30370
30368
|
console.log(import_chalk2.default.green("\u2713") + " ADHDev is already set up!");
|
|
30371
|
-
const ides = config2.configuredIdes?.length ? config2.configuredIdes.join(", ") : config2.selectedIde || "none";
|
|
30372
|
-
console.log(import_chalk2.default.gray(` IDEs: ${ides}`));
|
|
30373
30369
|
console.log(import_chalk2.default.gray(` User: ${config2.userEmail || "not logged in"}`));
|
|
30374
|
-
console.log(import_chalk2.default.gray(` Extensions: ${config2.installedExtensions.length} installed`));
|
|
30375
30370
|
console.log();
|
|
30376
30371
|
const { action } = await import_inquirer.default.prompt([
|
|
30377
30372
|
{
|
|
@@ -30409,80 +30404,15 @@ async function runWizard(options = {}) {
|
|
|
30409
30404
|
return;
|
|
30410
30405
|
}
|
|
30411
30406
|
}
|
|
30412
|
-
|
|
30413
|
-
{
|
|
30414
|
-
type: "list",
|
|
30415
|
-
name: "mode",
|
|
30416
|
-
message: "Setup mode:",
|
|
30417
|
-
choices: [
|
|
30418
|
-
{ name: `\u{1F680} ${import_chalk2.default.bold("Quick Setup")} \u2014 Auto-detect IDEs, login ${import_chalk2.default.gray("(recommended)")}`, value: "quick" },
|
|
30419
|
-
{ name: `\u2699\uFE0F ${import_chalk2.default.bold("Custom Setup")} \u2014 Choose IDE, AI extensions, and more`, value: "custom" },
|
|
30420
|
-
{ name: `\u{1F527} ${import_chalk2.default.bold("CLI Only")} \u2014 Install adhdev command globally`, value: "cli-only" }
|
|
30421
|
-
]
|
|
30422
|
-
}
|
|
30423
|
-
]);
|
|
30424
|
-
if (mode === "quick") {
|
|
30425
|
-
await quickSetup();
|
|
30426
|
-
} else if (mode === "cli-only") {
|
|
30427
|
-
await installCliOnly();
|
|
30428
|
-
} else {
|
|
30429
|
-
await customSetup();
|
|
30430
|
-
}
|
|
30407
|
+
await quickSetup();
|
|
30431
30408
|
}
|
|
30432
30409
|
async function quickSetup() {
|
|
30433
30410
|
console.log(import_chalk2.default.bold("\n\u{1F680} Quick Setup\n"));
|
|
30434
|
-
const spinner = (0, import_ora.default)("Detecting installed IDEs...").start();
|
|
30435
|
-
const ides = await (0, import_daemon_core5.detectIDEs)();
|
|
30436
|
-
const installedIDEs = ides.filter((i) => i.installed);
|
|
30437
|
-
spinner.stop();
|
|
30438
|
-
let selectedIDEs = [];
|
|
30439
|
-
if (installedIDEs.length === 0) {
|
|
30440
|
-
console.log(import_chalk2.default.yellow("\u26A0 No supported IDEs auto-detected."));
|
|
30441
|
-
console.log(import_chalk2.default.gray(" This is fine \u2014 the daemon will detect IDEs at runtime via CDP."));
|
|
30442
|
-
console.log(import_chalk2.default.gray(" Supported: VS Code, Cursor, Antigravity, Windsurf, VSCodium"));
|
|
30443
|
-
console.log();
|
|
30444
|
-
} else {
|
|
30445
|
-
console.log(import_chalk2.default.green(`Found ${installedIDEs.length} IDE(s):
|
|
30446
|
-
`));
|
|
30447
|
-
installedIDEs.forEach((ide) => {
|
|
30448
|
-
const version2 = ide.version ? import_chalk2.default.gray(` v${ide.version}`) : "";
|
|
30449
|
-
console.log(` ${import_chalk2.default.green("\u2713")} ${ide.icon} ${import_chalk2.default.bold(ide.displayName)}${version2}`);
|
|
30450
|
-
});
|
|
30451
|
-
console.log();
|
|
30452
|
-
if (installedIDEs.length === 1) {
|
|
30453
|
-
selectedIDEs = installedIDEs;
|
|
30454
|
-
console.log(import_chalk2.default.gray(` Auto-selected: ${installedIDEs[0].displayName}
|
|
30455
|
-
`));
|
|
30456
|
-
} else {
|
|
30457
|
-
const { selectedIdeIds } = await import_inquirer.default.prompt([
|
|
30458
|
-
{
|
|
30459
|
-
type: "checkbox",
|
|
30460
|
-
name: "selectedIdeIds",
|
|
30461
|
-
message: "Select IDEs to set up (Space to toggle, Enter to confirm):",
|
|
30462
|
-
choices: installedIDEs.map((ide) => ({
|
|
30463
|
-
name: `${ide.icon} ${ide.displayName}${ide.version ? import_chalk2.default.gray(` v${ide.version}`) : ""}`,
|
|
30464
|
-
value: ide.id,
|
|
30465
|
-
checked: true
|
|
30466
|
-
// All selected by default
|
|
30467
|
-
})),
|
|
30468
|
-
validate: (input) => input.length > 0 ? true : "Select at least one IDE"
|
|
30469
|
-
}
|
|
30470
|
-
]);
|
|
30471
|
-
selectedIDEs = installedIDEs.filter((i) => selectedIdeIds.includes(i.id));
|
|
30472
|
-
}
|
|
30473
|
-
}
|
|
30474
|
-
console.log(DIVIDER);
|
|
30475
30411
|
const loginResult = await loginFlow();
|
|
30476
30412
|
if (!loginResult) {
|
|
30477
30413
|
console.log(import_chalk2.default.yellow("\u26A0 Setup completed without login. You can login later with `adhdev setup`."));
|
|
30478
30414
|
}
|
|
30479
|
-
|
|
30480
|
-
for (const ide of selectedIDEs) {
|
|
30481
|
-
await injectTokenToIDE(ide, loginResult.connectionToken);
|
|
30482
|
-
}
|
|
30483
|
-
}
|
|
30484
|
-
const ideIds = selectedIDEs.map((i) => i.id);
|
|
30485
|
-
(0, import_daemon_core5.markSetupComplete)(ideIds.length > 0 ? ideIds : ["daemon-only"], ["adhdev"]);
|
|
30415
|
+
(0, import_daemon_core5.markSetupComplete)(["daemon"], ["adhdev"]);
|
|
30486
30416
|
if (loginResult) {
|
|
30487
30417
|
(0, import_daemon_core5.updateConfig)({
|
|
30488
30418
|
connectionToken: loginResult.connectionToken,
|
|
@@ -30492,15 +30422,6 @@ async function quickSetup() {
|
|
|
30492
30422
|
}
|
|
30493
30423
|
console.log(DIVIDER);
|
|
30494
30424
|
console.log(import_chalk2.default.bold("\n\u{1F389} Setup Complete!\n"));
|
|
30495
|
-
if (selectedIDEs.length > 0) {
|
|
30496
|
-
if (selectedIDEs.length === 1) {
|
|
30497
|
-
console.log(` ${import_chalk2.default.bold("IDE:")} ${selectedIDEs[0].icon} ${selectedIDEs[0].displayName}`);
|
|
30498
|
-
} else {
|
|
30499
|
-
console.log(` ${import_chalk2.default.bold("IDEs:")} ${selectedIDEs.map((i) => `${i.icon} ${i.displayName}`).join(", ")}`);
|
|
30500
|
-
}
|
|
30501
|
-
} else {
|
|
30502
|
-
console.log(` ${import_chalk2.default.bold("IDEs:")} ${import_chalk2.default.gray("None detected (daemon will auto-detect at runtime)")}`);
|
|
30503
|
-
}
|
|
30504
30425
|
console.log(` ${import_chalk2.default.bold("User:")} ${loginResult?.email || "not logged in"}`);
|
|
30505
30426
|
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("Ready to connect")}`);
|
|
30506
30427
|
console.log();
|
|
@@ -30508,127 +30429,19 @@ async function quickSetup() {
|
|
|
30508
30429
|
console.log(import_chalk2.default.gray(" adhdev daemon \u2014 Start the main daemon (required for all features)"));
|
|
30509
30430
|
console.log(import_chalk2.default.gray(" adhdev launch <ide> \u2014 Launch an IDE with remote control (e.g. cursor)"));
|
|
30510
30431
|
console.log(import_chalk2.default.gray(" adhdev launch <agent> \u2014 Start a CLI agent via daemon (e.g. gemini, claude)"));
|
|
30511
|
-
console.log(import_chalk2.default.gray(" adhdev cdp \u2014 Interactive CDP debug console"));
|
|
30512
30432
|
console.log(import_chalk2.default.gray(" adhdev status \u2014 Check setup status"));
|
|
30513
30433
|
console.log(import_chalk2.default.gray(" adhdev setup \u2014 Reconfigure ADHDev"));
|
|
30514
30434
|
console.log();
|
|
30515
30435
|
await installCliOnly();
|
|
30516
30436
|
await startDaemonFlow();
|
|
30517
30437
|
}
|
|
30518
|
-
async function customSetup() {
|
|
30519
|
-
console.log(import_chalk2.default.bold("\n\u{1F4CD} Step 1/4 \u2014 Detecting installed IDEs...\n"));
|
|
30520
|
-
const spinner = (0, import_ora.default)("Scanning your system...").start();
|
|
30521
|
-
const ides = await (0, import_daemon_core5.detectIDEs)();
|
|
30522
|
-
const installedIDEs = ides.filter((i) => i.installed);
|
|
30523
|
-
spinner.stop();
|
|
30524
|
-
if (installedIDEs.length === 0) {
|
|
30525
|
-
console.log(import_chalk2.default.yellow("\u26A0 No supported IDEs auto-detected."));
|
|
30526
|
-
console.log(import_chalk2.default.gray(" The daemon will detect IDEs at runtime via CDP."));
|
|
30527
|
-
console.log();
|
|
30528
|
-
console.log(DIVIDER);
|
|
30529
|
-
const loginResult2 = await loginFlow();
|
|
30530
|
-
(0, import_daemon_core5.markSetupComplete)(["daemon-only"], ["adhdev"]);
|
|
30531
|
-
if (loginResult2) {
|
|
30532
|
-
(0, import_daemon_core5.updateConfig)({
|
|
30533
|
-
connectionToken: loginResult2.connectionToken,
|
|
30534
|
-
userEmail: loginResult2.email,
|
|
30535
|
-
userName: loginResult2.name
|
|
30536
|
-
});
|
|
30537
|
-
}
|
|
30538
|
-
console.log(DIVIDER);
|
|
30539
|
-
console.log(import_chalk2.default.bold("\n\u{1F389} Setup Complete!\n"));
|
|
30540
|
-
console.log(` ${import_chalk2.default.bold("IDEs:")} ${import_chalk2.default.gray("None detected (daemon will auto-detect at runtime)")}`);
|
|
30541
|
-
console.log(` ${import_chalk2.default.bold("User:")} ${loginResult2?.email || "not logged in"}`);
|
|
30542
|
-
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("Ready to connect")}`);
|
|
30543
|
-
console.log();
|
|
30544
|
-
await startDaemonFlow();
|
|
30545
|
-
return;
|
|
30546
|
-
}
|
|
30547
|
-
console.log(import_chalk2.default.green(`Found ${installedIDEs.length} IDE(s):
|
|
30548
|
-
`));
|
|
30549
|
-
installedIDEs.forEach((ide) => {
|
|
30550
|
-
const version2 = ide.version ? import_chalk2.default.gray(` v${ide.version}`) : "";
|
|
30551
|
-
const cli = ide.cliCommand ? import_chalk2.default.gray(` (CLI: \u2713)`) : import_chalk2.default.yellow(` (CLI: \u2717 manual install)`);
|
|
30552
|
-
console.log(` ${ide.icon} ${import_chalk2.default.bold(ide.displayName)}${version2}${cli}`);
|
|
30553
|
-
});
|
|
30554
|
-
console.log();
|
|
30555
|
-
console.log(DIVIDER);
|
|
30556
|
-
console.log(import_chalk2.default.bold("\n\u{1F4CD} Step 2/4 \u2014 Select your primary IDE\n"));
|
|
30557
|
-
const { selectedIdeId } = await import_inquirer.default.prompt([
|
|
30558
|
-
{
|
|
30559
|
-
type: "list",
|
|
30560
|
-
name: "selectedIdeId",
|
|
30561
|
-
message: "Which IDE?",
|
|
30562
|
-
choices: installedIDEs.map((ide) => ({
|
|
30563
|
-
name: `${ide.icon} ${ide.displayName}${ide.version ? import_chalk2.default.gray(` v${ide.version}`) : ""}`,
|
|
30564
|
-
value: ide.id
|
|
30565
|
-
}))
|
|
30566
|
-
}
|
|
30567
|
-
]);
|
|
30568
|
-
const selectedIDE = installedIDEs.find((i) => i.id === selectedIdeId);
|
|
30569
|
-
console.log(DIVIDER);
|
|
30570
|
-
console.log(import_chalk2.default.bold("\n\u{1F4CD} Step 3/4 \u2014 Choose AI extensions\n"));
|
|
30571
|
-
const aiExtensions = (0, import_daemon_core5.getAIExtensions)();
|
|
30572
|
-
const { selectedExtIds } = await import_inquirer.default.prompt([
|
|
30573
|
-
{
|
|
30574
|
-
type: "checkbox",
|
|
30575
|
-
name: "selectedExtIds",
|
|
30576
|
-
message: "Select AI extensions:",
|
|
30577
|
-
choices: aiExtensions.map((ext) => ({
|
|
30578
|
-
name: `${ext.icon} ${ext.displayName} \u2014 ${import_chalk2.default.gray(ext.description)}`,
|
|
30579
|
-
value: ext.id,
|
|
30580
|
-
checked: ext.recommended
|
|
30581
|
-
}))
|
|
30582
|
-
}
|
|
30583
|
-
]);
|
|
30584
|
-
const selectedAIExts = aiExtensions.filter((e) => selectedExtIds.includes(e.id));
|
|
30585
|
-
const allExtensions = selectedAIExts;
|
|
30586
|
-
console.log(import_chalk2.default.bold("\n\u{1F4CD} Step 4/4 \u2014 Installing extensions\n"));
|
|
30587
|
-
if (selectedIDE.cliCommand) {
|
|
30588
|
-
await (0, import_daemon_core5.installExtensions)(
|
|
30589
|
-
selectedIDE,
|
|
30590
|
-
allExtensions,
|
|
30591
|
-
(current, total, ext, result) => {
|
|
30592
|
-
const status = result.alreadyInstalled ? import_chalk2.default.blue("already installed") : result.success ? import_chalk2.default.green("installed \u2713") : import_chalk2.default.red(`failed \u2717`);
|
|
30593
|
-
console.log(` [${current}/${total}] ${ext.icon} ${ext.displayName} \u2014 ${status}`);
|
|
30594
|
-
}
|
|
30595
|
-
);
|
|
30596
|
-
} else {
|
|
30597
|
-
console.log(import_chalk2.default.yellow("\u26A0 No CLI \u2014 install manually:"));
|
|
30598
|
-
allExtensions.forEach((ext) => {
|
|
30599
|
-
console.log(import_chalk2.default.gray(` ${ext.icon} ${ext.displayName}: ${ext.marketplaceId}`));
|
|
30600
|
-
});
|
|
30601
|
-
}
|
|
30602
|
-
console.log(DIVIDER);
|
|
30603
|
-
const loginResult = await loginFlow();
|
|
30604
|
-
if (loginResult?.connectionToken) {
|
|
30605
|
-
await injectTokenToIDE(selectedIDE, loginResult.connectionToken);
|
|
30606
|
-
}
|
|
30607
|
-
(0, import_daemon_core5.markSetupComplete)(selectedIdeId, allExtensions.map((e) => e.id));
|
|
30608
|
-
if (loginResult) {
|
|
30609
|
-
(0, import_daemon_core5.updateConfig)({
|
|
30610
|
-
connectionToken: loginResult.connectionToken,
|
|
30611
|
-
userEmail: loginResult.email,
|
|
30612
|
-
userName: loginResult.name
|
|
30613
|
-
});
|
|
30614
|
-
}
|
|
30615
|
-
console.log(DIVIDER);
|
|
30616
|
-
console.log(import_chalk2.default.bold("\n\u{1F389} Setup Complete!\n"));
|
|
30617
|
-
console.log(` ${import_chalk2.default.bold("IDE:")} ${selectedIDE.icon} ${selectedIDE.displayName}`);
|
|
30618
|
-
console.log(` ${import_chalk2.default.bold("Extensions:")} ${allExtensions.length} installed`);
|
|
30619
|
-
console.log(` ${import_chalk2.default.bold("User:")} ${loginResult?.email || "not logged in"}`);
|
|
30620
|
-
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("Ready to connect")}`);
|
|
30621
|
-
console.log();
|
|
30622
|
-
await startDaemonFlow();
|
|
30623
|
-
console.log(import_chalk2.default.gray("\nThank you for using ADHDev! \u{1F9A6}\n"));
|
|
30624
|
-
}
|
|
30625
30438
|
async function loginFlow() {
|
|
30626
30439
|
console.log(import_chalk2.default.bold("\n\u{1F510} Login to ADHDev\n"));
|
|
30627
30440
|
const { wantLogin } = await import_inquirer.default.prompt([
|
|
30628
30441
|
{
|
|
30629
30442
|
type: "confirm",
|
|
30630
30443
|
name: "wantLogin",
|
|
30631
|
-
message: "Sign in to connect
|
|
30444
|
+
message: "Sign in to connect to your ADHDev account?",
|
|
30632
30445
|
default: true
|
|
30633
30446
|
}
|
|
30634
30447
|
]);
|
|
@@ -30695,49 +30508,6 @@ async function loginFlow() {
|
|
|
30695
30508
|
pollSpinner.fail("Authentication timed out");
|
|
30696
30509
|
return null;
|
|
30697
30510
|
}
|
|
30698
|
-
async function injectTokenToIDE(ide, connectionToken) {
|
|
30699
|
-
if (!ide.cliCommand) return;
|
|
30700
|
-
try {
|
|
30701
|
-
const os3 = await import("os");
|
|
30702
|
-
const fs3 = await import("fs");
|
|
30703
|
-
const path3 = await import("path");
|
|
30704
|
-
const platform2 = os3.platform();
|
|
30705
|
-
const home = os3.homedir();
|
|
30706
|
-
const getSettingsPath = (appName2) => {
|
|
30707
|
-
if (platform2 === "darwin") {
|
|
30708
|
-
return path3.join(home, "Library", "Application Support", appName2, "User", "settings.json");
|
|
30709
|
-
} else if (platform2 === "win32") {
|
|
30710
|
-
return path3.join(process.env.APPDATA || path3.join(home, "AppData", "Roaming"), appName2, "User", "settings.json");
|
|
30711
|
-
} else {
|
|
30712
|
-
return path3.join(home, ".config", appName2, "User", "settings.json");
|
|
30713
|
-
}
|
|
30714
|
-
};
|
|
30715
|
-
const loader = new import_daemon_core5.ProviderLoader({ logFn: () => {
|
|
30716
|
-
} });
|
|
30717
|
-
loader.loadAll();
|
|
30718
|
-
const appNameMap = loader.getMacAppIdentifiers();
|
|
30719
|
-
const appName = appNameMap[ide.id];
|
|
30720
|
-
if (!appName) return;
|
|
30721
|
-
const settingsPath = getSettingsPath(appName);
|
|
30722
|
-
let settings = {};
|
|
30723
|
-
if (fs3.existsSync(settingsPath)) {
|
|
30724
|
-
try {
|
|
30725
|
-
settings = JSON.parse(fs3.readFileSync(settingsPath, "utf-8"));
|
|
30726
|
-
} catch {
|
|
30727
|
-
settings = {};
|
|
30728
|
-
}
|
|
30729
|
-
} else {
|
|
30730
|
-
fs3.mkdirSync(path3.dirname(settingsPath), { recursive: true });
|
|
30731
|
-
}
|
|
30732
|
-
settings["adhdev.connectionToken"] = connectionToken;
|
|
30733
|
-
settings["adhdev.autoConnect"] = true;
|
|
30734
|
-
fs3.writeFileSync(settingsPath, JSON.stringify(settings, null, 4), "utf-8");
|
|
30735
|
-
console.log(import_chalk2.default.green(" \u2713 Connection token saved to IDE settings"));
|
|
30736
|
-
} catch (e) {
|
|
30737
|
-
console.log(import_chalk2.default.yellow(` \u26A0 Could not inject token: ${e.message}`));
|
|
30738
|
-
console.log(import_chalk2.default.gray(` You can set it manually: adhdev.connectionToken = ${connectionToken}`));
|
|
30739
|
-
}
|
|
30740
|
-
}
|
|
30741
30511
|
async function startDaemonFlow() {
|
|
30742
30512
|
const { isDaemonRunning: isDaemonRunning2 } = await Promise.resolve().then(() => (init_adhdev_daemon(), adhdev_daemon_exports));
|
|
30743
30513
|
if (isDaemonRunning2()) {
|
|
@@ -30749,7 +30519,7 @@ async function startDaemonFlow() {
|
|
|
30749
30519
|
{
|
|
30750
30520
|
type: "confirm",
|
|
30751
30521
|
name: "startDaemon",
|
|
30752
|
-
message: "Start the ADHDev Daemon now?
|
|
30522
|
+
message: "Start the ADHDev Daemon now?",
|
|
30753
30523
|
default: true
|
|
30754
30524
|
}
|
|
30755
30525
|
]);
|
|
@@ -30765,11 +30535,20 @@ async function startDaemonFlow() {
|
|
|
30765
30535
|
const os3 = await import("os");
|
|
30766
30536
|
const path3 = await import("path");
|
|
30767
30537
|
const logPath = path3.join(os3.homedir(), ".adhdev", "daemon.log");
|
|
30538
|
+
const platform2 = os3.platform();
|
|
30768
30539
|
try {
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30540
|
+
if (platform2 === "win32") {
|
|
30541
|
+
execSync(`start /B adhdev daemon > "${logPath}" 2>&1`, {
|
|
30542
|
+
timeout: 3e3,
|
|
30543
|
+
stdio: "ignore",
|
|
30544
|
+
shell: "cmd.exe"
|
|
30545
|
+
});
|
|
30546
|
+
} else {
|
|
30547
|
+
execSync(`nohup adhdev daemon > "${logPath}" 2>&1 &`, {
|
|
30548
|
+
timeout: 3e3,
|
|
30549
|
+
stdio: "ignore"
|
|
30550
|
+
});
|
|
30551
|
+
}
|
|
30773
30552
|
} catch {
|
|
30774
30553
|
daemon.start({ localPort: 19222, foreground: false }).catch(() => {
|
|
30775
30554
|
});
|
|
@@ -30777,13 +30556,11 @@ async function startDaemonFlow() {
|
|
|
30777
30556
|
await new Promise((r) => setTimeout(r, 2e3));
|
|
30778
30557
|
if (isDaemonRunning2()) {
|
|
30779
30558
|
daemonSpinner.succeed("Daemon started");
|
|
30780
|
-
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
30781
|
-
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
30782
30559
|
} else {
|
|
30783
30560
|
daemonSpinner.succeed("Daemon starting in background");
|
|
30784
|
-
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
30785
|
-
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
30786
30561
|
}
|
|
30562
|
+
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
30563
|
+
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
30787
30564
|
console.log();
|
|
30788
30565
|
} catch (e) {
|
|
30789
30566
|
daemonSpinner.fail(`Daemon start failed: ${e?.message || "Unknown"}`);
|
|
@@ -30809,7 +30586,6 @@ async function installCliOnly() {
|
|
|
30809
30586
|
console.log(import_chalk2.default.gray(" \u2022 Start the main daemon (adhdev daemon)"));
|
|
30810
30587
|
console.log(import_chalk2.default.gray(" \u2022 Launch IDE with CDP (adhdev launch <ide>)"));
|
|
30811
30588
|
console.log(import_chalk2.default.gray(" \u2022 Start CLI agents (adhdev launch <agent>)"));
|
|
30812
|
-
console.log(import_chalk2.default.gray(" \u2022 CDP Debugging Console (adhdev cdp)"));
|
|
30813
30589
|
console.log(import_chalk2.default.gray(" \u2022 Check setup status (adhdev status)"));
|
|
30814
30590
|
console.log();
|
|
30815
30591
|
if (currentVersion) {
|
|
@@ -30860,7 +30636,6 @@ async function installCliOnly() {
|
|
|
30860
30636
|
}
|
|
30861
30637
|
installSpinner.succeed(`adhdev CLI ${currentVersion ? "updated" : "installed"} \u2713 (v${newVersion})`);
|
|
30862
30638
|
console.log(import_chalk2.default.gray(" Try: adhdev daemon"));
|
|
30863
|
-
console.log(import_chalk2.default.gray(" adhdev status"));
|
|
30864
30639
|
console.log();
|
|
30865
30640
|
} catch (e) {
|
|
30866
30641
|
installSpinner.fail("Install failed");
|
|
@@ -30909,7 +30684,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
30909
30684
|
});
|
|
30910
30685
|
program2.command("launch [target]").description("Launch IDE with CDP or start CLI agent (e.g. cursor, gemini, claude)").option("-w, --workspace <path>", "Workspace directory to open").option("-n, --new-window", "Open in a new window").option("-d, --dir <path>", "Working directory for CLI agent", process.cwd()).action(async (targetArg, options) => {
|
|
30911
30686
|
const {
|
|
30912
|
-
detectIDEs
|
|
30687
|
+
detectIDEs,
|
|
30913
30688
|
detectCLIs,
|
|
30914
30689
|
launchWithCdp
|
|
30915
30690
|
} = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
@@ -30972,7 +30747,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
30972
30747
|
}
|
|
30973
30748
|
let targetIdeId = targetArg;
|
|
30974
30749
|
if (!targetIdeId) {
|
|
30975
|
-
const ides = await
|
|
30750
|
+
const ides = await detectIDEs();
|
|
30976
30751
|
const installed = ides.filter((i) => i.installed && i.cliCommand);
|
|
30977
30752
|
if (installed.length === 0) {
|
|
30978
30753
|
console.log(import_chalk3.default.red("\n\u2717 No supported IDE found.\n"));
|
|
@@ -31010,7 +30785,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
31010
30785
|
\u2717 ${result.error}
|
|
31011
30786
|
`));
|
|
31012
30787
|
console.log(import_chalk3.default.gray(" Available IDEs:"));
|
|
31013
|
-
const ides = await
|
|
30788
|
+
const ides = await detectIDEs();
|
|
31014
30789
|
ides.forEach((ide) => {
|
|
31015
30790
|
if (ide.installed) {
|
|
31016
30791
|
console.log(` ${import_chalk3.default.green("\u2713")} ${ide.icon} ${import_chalk3.default.bold(ide.id)} \u2014 ${ide.displayName}`);
|
|
@@ -31056,7 +30831,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
31056
30831
|
}
|
|
31057
30832
|
});
|
|
31058
30833
|
program2.command("status").description("Show current ADHDev setup status").action(async () => {
|
|
31059
|
-
const { loadConfig: loadConfig3, detectIDEs
|
|
30834
|
+
const { loadConfig: loadConfig3, detectIDEs, detectCLIs } = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
31060
30835
|
const config2 = loadConfig3();
|
|
31061
30836
|
console.log(import_chalk3.default.bold("\n\u{1F9A6} ADHDev Status\n"));
|
|
31062
30837
|
if (!config2.setupCompleted) {
|
|
@@ -31067,7 +30842,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
31067
30842
|
const ideList = config2.configuredIdes?.length ? config2.configuredIdes : config2.selectedIde ? [config2.selectedIde] : [];
|
|
31068
30843
|
console.log(` ${import_chalk3.default.bold("Status:")} ${import_chalk3.default.green("\u2713 Configured")}`);
|
|
31069
30844
|
if (ideList.length > 0) {
|
|
31070
|
-
const ides = await
|
|
30845
|
+
const ides = await detectIDEs();
|
|
31071
30846
|
console.log(` ${import_chalk3.default.bold("IDEs:")}`);
|
|
31072
30847
|
for (const ideId of ideList) {
|
|
31073
30848
|
const ide = ides.find((i) => i.id === ideId);
|
|
@@ -31099,9 +30874,9 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
31099
30874
|
console.log();
|
|
31100
30875
|
});
|
|
31101
30876
|
program2.command("detect").description("Detect installed IDEs, CLI agents, and ACP agents").action(async () => {
|
|
31102
|
-
const { detectIDEs
|
|
30877
|
+
const { detectIDEs, detectCLIs } = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
31103
30878
|
console.log(import_chalk3.default.bold("\n\u{1F50D} Detecting installed IDEs...\n"));
|
|
31104
|
-
const ides = await
|
|
30879
|
+
const ides = await detectIDEs();
|
|
31105
30880
|
ides.forEach((ide) => {
|
|
31106
30881
|
if (ide.installed) {
|
|
31107
30882
|
const version2 = ide.version ? import_chalk3.default.gray(` v${ide.version}`) : "";
|
|
@@ -31434,8 +31209,8 @@ function registerProviderCommands(program2) {
|
|
|
31434
31209
|
const provider = program2.command("provider").description("\u{1F50C} Provider management \u2014 list, test, reload providers");
|
|
31435
31210
|
provider.command("list").description("List all loaded providers").option("-j, --json", "Output raw JSON").action(async (options) => {
|
|
31436
31211
|
try {
|
|
31437
|
-
const { ProviderLoader:
|
|
31438
|
-
const loader = new
|
|
31212
|
+
const { ProviderLoader: ProviderLoader2 } = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
31213
|
+
const loader = new ProviderLoader2();
|
|
31439
31214
|
loader.loadAll();
|
|
31440
31215
|
const providers = loader.getAll();
|
|
31441
31216
|
if (options.json) {
|