adhdev 0.5.11 → 0.5.12
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 +43 -270
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +34 -261
- 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 = {
|
|
@@ -30360,18 +30360,11 @@ __export(wizard_exports, {
|
|
|
30360
30360
|
runWizard: () => runWizard
|
|
30361
30361
|
});
|
|
30362
30362
|
async function runWizard(options = {}) {
|
|
30363
|
-
const loader = new import_daemon_core5.ProviderLoader({ logFn: () => {
|
|
30364
|
-
} });
|
|
30365
|
-
loader.loadAll();
|
|
30366
|
-
loader.registerToDetector();
|
|
30367
30363
|
console.log(LOGO);
|
|
30368
30364
|
if ((0, import_daemon_core5.isSetupComplete)() && !options.force) {
|
|
30369
30365
|
const config2 = (0, import_daemon_core5.loadConfig)();
|
|
30370
30366
|
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
30367
|
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
30368
|
console.log();
|
|
30376
30369
|
const { action } = await import_inquirer.default.prompt([
|
|
30377
30370
|
{
|
|
@@ -30409,80 +30402,15 @@ async function runWizard(options = {}) {
|
|
|
30409
30402
|
return;
|
|
30410
30403
|
}
|
|
30411
30404
|
}
|
|
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
|
-
}
|
|
30405
|
+
await quickSetup();
|
|
30431
30406
|
}
|
|
30432
30407
|
async function quickSetup() {
|
|
30433
30408
|
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
30409
|
const loginResult = await loginFlow();
|
|
30476
30410
|
if (!loginResult) {
|
|
30477
30411
|
console.log(import_chalk2.default.yellow("\u26A0 Setup completed without login. You can login later with `adhdev setup`."));
|
|
30478
30412
|
}
|
|
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"]);
|
|
30413
|
+
(0, import_daemon_core5.markSetupComplete)(["daemon"], ["adhdev"]);
|
|
30486
30414
|
if (loginResult) {
|
|
30487
30415
|
(0, import_daemon_core5.updateConfig)({
|
|
30488
30416
|
connectionToken: loginResult.connectionToken,
|
|
@@ -30492,15 +30420,6 @@ async function quickSetup() {
|
|
|
30492
30420
|
}
|
|
30493
30421
|
console.log(DIVIDER);
|
|
30494
30422
|
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
30423
|
console.log(` ${import_chalk2.default.bold("User:")} ${loginResult?.email || "not logged in"}`);
|
|
30505
30424
|
console.log(` ${import_chalk2.default.bold("Status:")} ${import_chalk2.default.green("Ready to connect")}`);
|
|
30506
30425
|
console.log();
|
|
@@ -30508,127 +30427,19 @@ async function quickSetup() {
|
|
|
30508
30427
|
console.log(import_chalk2.default.gray(" adhdev daemon \u2014 Start the main daemon (required for all features)"));
|
|
30509
30428
|
console.log(import_chalk2.default.gray(" adhdev launch <ide> \u2014 Launch an IDE with remote control (e.g. cursor)"));
|
|
30510
30429
|
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
30430
|
console.log(import_chalk2.default.gray(" adhdev status \u2014 Check setup status"));
|
|
30513
30431
|
console.log(import_chalk2.default.gray(" adhdev setup \u2014 Reconfigure ADHDev"));
|
|
30514
30432
|
console.log();
|
|
30515
30433
|
await installCliOnly();
|
|
30516
30434
|
await startDaemonFlow();
|
|
30517
30435
|
}
|
|
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
30436
|
async function loginFlow() {
|
|
30626
30437
|
console.log(import_chalk2.default.bold("\n\u{1F510} Login to ADHDev\n"));
|
|
30627
30438
|
const { wantLogin } = await import_inquirer.default.prompt([
|
|
30628
30439
|
{
|
|
30629
30440
|
type: "confirm",
|
|
30630
30441
|
name: "wantLogin",
|
|
30631
|
-
message: "Sign in to connect
|
|
30442
|
+
message: "Sign in to connect to your ADHDev account?",
|
|
30632
30443
|
default: true
|
|
30633
30444
|
}
|
|
30634
30445
|
]);
|
|
@@ -30695,49 +30506,6 @@ async function loginFlow() {
|
|
|
30695
30506
|
pollSpinner.fail("Authentication timed out");
|
|
30696
30507
|
return null;
|
|
30697
30508
|
}
|
|
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
30509
|
async function startDaemonFlow() {
|
|
30742
30510
|
const { isDaemonRunning: isDaemonRunning2 } = await Promise.resolve().then(() => (init_adhdev_daemon(), adhdev_daemon_exports));
|
|
30743
30511
|
if (isDaemonRunning2()) {
|
|
@@ -30749,7 +30517,7 @@ async function startDaemonFlow() {
|
|
|
30749
30517
|
{
|
|
30750
30518
|
type: "confirm",
|
|
30751
30519
|
name: "startDaemon",
|
|
30752
|
-
message: "Start the ADHDev Daemon now?
|
|
30520
|
+
message: "Start the ADHDev Daemon now?",
|
|
30753
30521
|
default: true
|
|
30754
30522
|
}
|
|
30755
30523
|
]);
|
|
@@ -30765,11 +30533,20 @@ async function startDaemonFlow() {
|
|
|
30765
30533
|
const os3 = await import("os");
|
|
30766
30534
|
const path3 = await import("path");
|
|
30767
30535
|
const logPath = path3.join(os3.homedir(), ".adhdev", "daemon.log");
|
|
30536
|
+
const platform2 = os3.platform();
|
|
30768
30537
|
try {
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30538
|
+
if (platform2 === "win32") {
|
|
30539
|
+
execSync(`start /B adhdev daemon > "${logPath}" 2>&1`, {
|
|
30540
|
+
timeout: 3e3,
|
|
30541
|
+
stdio: "ignore",
|
|
30542
|
+
shell: "cmd.exe"
|
|
30543
|
+
});
|
|
30544
|
+
} else {
|
|
30545
|
+
execSync(`nohup adhdev daemon > "${logPath}" 2>&1 &`, {
|
|
30546
|
+
timeout: 3e3,
|
|
30547
|
+
stdio: "ignore"
|
|
30548
|
+
});
|
|
30549
|
+
}
|
|
30773
30550
|
} catch {
|
|
30774
30551
|
daemon.start({ localPort: 19222, foreground: false }).catch(() => {
|
|
30775
30552
|
});
|
|
@@ -30777,13 +30554,11 @@ async function startDaemonFlow() {
|
|
|
30777
30554
|
await new Promise((r) => setTimeout(r, 2e3));
|
|
30778
30555
|
if (isDaemonRunning2()) {
|
|
30779
30556
|
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
30557
|
} else {
|
|
30783
30558
|
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
30559
|
}
|
|
30560
|
+
console.log(import_chalk2.default.gray(" Dashboard: https://adhf.dev/dashboard"));
|
|
30561
|
+
console.log(import_chalk2.default.gray(` Logs: ${logPath}`));
|
|
30787
30562
|
console.log();
|
|
30788
30563
|
} catch (e) {
|
|
30789
30564
|
daemonSpinner.fail(`Daemon start failed: ${e?.message || "Unknown"}`);
|
|
@@ -30809,7 +30584,6 @@ async function installCliOnly() {
|
|
|
30809
30584
|
console.log(import_chalk2.default.gray(" \u2022 Start the main daemon (adhdev daemon)"));
|
|
30810
30585
|
console.log(import_chalk2.default.gray(" \u2022 Launch IDE with CDP (adhdev launch <ide>)"));
|
|
30811
30586
|
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
30587
|
console.log(import_chalk2.default.gray(" \u2022 Check setup status (adhdev status)"));
|
|
30814
30588
|
console.log();
|
|
30815
30589
|
if (currentVersion) {
|
|
@@ -30860,7 +30634,6 @@ async function installCliOnly() {
|
|
|
30860
30634
|
}
|
|
30861
30635
|
installSpinner.succeed(`adhdev CLI ${currentVersion ? "updated" : "installed"} \u2713 (v${newVersion})`);
|
|
30862
30636
|
console.log(import_chalk2.default.gray(" Try: adhdev daemon"));
|
|
30863
|
-
console.log(import_chalk2.default.gray(" adhdev status"));
|
|
30864
30637
|
console.log();
|
|
30865
30638
|
} catch (e) {
|
|
30866
30639
|
installSpinner.fail("Install failed");
|
|
@@ -30909,7 +30682,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
30909
30682
|
});
|
|
30910
30683
|
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
30684
|
const {
|
|
30912
|
-
detectIDEs
|
|
30685
|
+
detectIDEs,
|
|
30913
30686
|
detectCLIs,
|
|
30914
30687
|
launchWithCdp
|
|
30915
30688
|
} = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
@@ -30972,7 +30745,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
30972
30745
|
}
|
|
30973
30746
|
let targetIdeId = targetArg;
|
|
30974
30747
|
if (!targetIdeId) {
|
|
30975
|
-
const ides = await
|
|
30748
|
+
const ides = await detectIDEs();
|
|
30976
30749
|
const installed = ides.filter((i) => i.installed && i.cliCommand);
|
|
30977
30750
|
if (installed.length === 0) {
|
|
30978
30751
|
console.log(import_chalk3.default.red("\n\u2717 No supported IDE found.\n"));
|
|
@@ -31010,7 +30783,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
31010
30783
|
\u2717 ${result.error}
|
|
31011
30784
|
`));
|
|
31012
30785
|
console.log(import_chalk3.default.gray(" Available IDEs:"));
|
|
31013
|
-
const ides = await
|
|
30786
|
+
const ides = await detectIDEs();
|
|
31014
30787
|
ides.forEach((ide) => {
|
|
31015
30788
|
if (ide.installed) {
|
|
31016
30789
|
console.log(` ${import_chalk3.default.green("\u2713")} ${ide.icon} ${import_chalk3.default.bold(ide.id)} \u2014 ${ide.displayName}`);
|
|
@@ -31056,7 +30829,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
31056
30829
|
}
|
|
31057
30830
|
});
|
|
31058
30831
|
program2.command("status").description("Show current ADHDev setup status").action(async () => {
|
|
31059
|
-
const { loadConfig: loadConfig3, detectIDEs
|
|
30832
|
+
const { loadConfig: loadConfig3, detectIDEs, detectCLIs } = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
31060
30833
|
const config2 = loadConfig3();
|
|
31061
30834
|
console.log(import_chalk3.default.bold("\n\u{1F9A6} ADHDev Status\n"));
|
|
31062
30835
|
if (!config2.setupCompleted) {
|
|
@@ -31067,7 +30840,7 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
31067
30840
|
const ideList = config2.configuredIdes?.length ? config2.configuredIdes : config2.selectedIde ? [config2.selectedIde] : [];
|
|
31068
30841
|
console.log(` ${import_chalk3.default.bold("Status:")} ${import_chalk3.default.green("\u2713 Configured")}`);
|
|
31069
30842
|
if (ideList.length > 0) {
|
|
31070
|
-
const ides = await
|
|
30843
|
+
const ides = await detectIDEs();
|
|
31071
30844
|
console.log(` ${import_chalk3.default.bold("IDEs:")}`);
|
|
31072
30845
|
for (const ideId of ideList) {
|
|
31073
30846
|
const ide = ides.find((i) => i.id === ideId);
|
|
@@ -31099,9 +30872,9 @@ function registerSetupCommands(program2, providerLoader) {
|
|
|
31099
30872
|
console.log();
|
|
31100
30873
|
});
|
|
31101
30874
|
program2.command("detect").description("Detect installed IDEs, CLI agents, and ACP agents").action(async () => {
|
|
31102
|
-
const { detectIDEs
|
|
30875
|
+
const { detectIDEs, detectCLIs } = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
31103
30876
|
console.log(import_chalk3.default.bold("\n\u{1F50D} Detecting installed IDEs...\n"));
|
|
31104
|
-
const ides = await
|
|
30877
|
+
const ides = await detectIDEs();
|
|
31105
30878
|
ides.forEach((ide) => {
|
|
31106
30879
|
if (ide.installed) {
|
|
31107
30880
|
const version2 = ide.version ? import_chalk3.default.gray(` v${ide.version}`) : "";
|
|
@@ -31434,8 +31207,8 @@ function registerProviderCommands(program2) {
|
|
|
31434
31207
|
const provider = program2.command("provider").description("\u{1F50C} Provider management \u2014 list, test, reload providers");
|
|
31435
31208
|
provider.command("list").description("List all loaded providers").option("-j, --json", "Output raw JSON").action(async (options) => {
|
|
31436
31209
|
try {
|
|
31437
|
-
const { ProviderLoader:
|
|
31438
|
-
const loader = new
|
|
31210
|
+
const { ProviderLoader: ProviderLoader2 } = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
31211
|
+
const loader = new ProviderLoader2();
|
|
31439
31212
|
loader.loadAll();
|
|
31440
31213
|
const providers = loader.getAll();
|
|
31441
31214
|
if (options.json) {
|