adhdev 0.8.0 → 0.8.1

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 CHANGED
@@ -40039,6 +40039,15 @@ var init_poller = __esm({
40039
40039
  cdpManagerKey: ideType,
40040
40040
  instanceKey: `ide:${ideType}`
40041
40041
  });
40042
+ const activeSessionId2 = agentStreamManager.getActiveSessionId(parentSessionId);
40043
+ if (!activeSessionId2 || enabledExtTypes.size === 1) {
40044
+ await agentStreamManager.setActiveSession(
40045
+ cdp,
40046
+ parentSessionId,
40047
+ extInstance.getInstanceId()
40048
+ );
40049
+ LOG.info("AgentStream", `Auto-activated enabled extension: ${extType} (${ideType})`);
40050
+ }
40042
40051
  }
40043
40052
  LOG.info("AgentStream", `Extension added: ${extType} (enabled for ${ideType})`);
40044
40053
  }
@@ -48207,7 +48216,7 @@ var init_adhdev_daemon = __esm({
48207
48216
  fs18 = __toESM(require("fs"));
48208
48217
  path21 = __toESM(require("path"));
48209
48218
  import_chalk2 = __toESM(require("chalk"));
48210
- pkgVersion = "0.8.0";
48219
+ pkgVersion = "0.8.1";
48211
48220
  if (pkgVersion === "unknown") {
48212
48221
  try {
48213
48222
  const possiblePaths = [
@@ -48688,9 +48697,13 @@ var wizard_exports = {};
48688
48697
  __export(wizard_exports, {
48689
48698
  runWizard: () => runWizard
48690
48699
  });
48700
+ function hasCloudMachineAuth() {
48701
+ const config2 = loadConfig();
48702
+ return Boolean(config2.machineSecret && config2.machineSecret.trim());
48703
+ }
48691
48704
  async function runWizard(options = {}) {
48692
48705
  console.log(LOGO);
48693
- if (isSetupComplete() && !options.force) {
48706
+ if (isSetupComplete() && hasCloudMachineAuth() && !options.force) {
48694
48707
  const config2 = loadConfig();
48695
48708
  console.log(import_chalk3.default.green("\u2713") + " ADHDev is already configured.");
48696
48709
  console.log(import_chalk3.default.gray(` Account: ${config2.userEmail || "not logged in"}`));
@@ -48755,29 +48768,46 @@ async function checkForUpdate() {
48755
48768
  async function quickSetup() {
48756
48769
  console.log(import_chalk3.default.bold("\n\u{1F680} Quick Setup\n"));
48757
48770
  const loginResult = await loginFlow();
48771
+ const setupDate = (/* @__PURE__ */ new Date()).toISOString();
48758
48772
  if (!loginResult) {
48759
- console.log(import_chalk3.default.yellow("\u26A0 Setup completed without login. You can login later with `adhdev setup`."));
48773
+ updateConfig({
48774
+ selectedIde: "daemon",
48775
+ configuredIdes: ["daemon"],
48776
+ installedExtensions: ["adhdev"],
48777
+ setupCompleted: false,
48778
+ setupDate,
48779
+ userEmail: null,
48780
+ userName: null,
48781
+ machineSecret: null
48782
+ });
48783
+ console.log(import_chalk3.default.yellow("\u26A0 Setup is not complete without login. Run `adhdev setup` after signing in."));
48760
48784
  }
48761
- markSetupComplete(["daemon"], ["adhdev"]);
48762
48785
  if (loginResult) {
48786
+ markSetupComplete(["daemon"], ["adhdev"]);
48763
48787
  const configUpdate = {
48764
48788
  machineSecret: loginResult.machineSecret,
48765
48789
  userEmail: loginResult.email,
48766
48790
  userName: loginResult.name,
48791
+ setupDate,
48767
48792
  ...loginResult.registeredMachineId ? { registeredMachineId: loginResult.registeredMachineId } : {}
48768
48793
  };
48769
48794
  updateConfig(configUpdate);
48770
48795
  console.log(import_chalk3.default.green(` \u2713 Machine registered`));
48771
48796
  }
48772
48797
  await installCliOnly();
48773
- await startDaemonFlow();
48798
+ if (loginResult) {
48799
+ await startDaemonFlow();
48800
+ } else {
48801
+ console.log(import_chalk3.default.gray(" Start daemon after login: adhdev setup"));
48802
+ console.log();
48803
+ }
48774
48804
  console.log(DIVIDER);
48775
48805
  console.log(import_chalk3.default.bold("\n\u{1F389} Setup Complete!\n"));
48776
48806
  console.log(` ${import_chalk3.default.bold("User:")} ${loginResult?.email || "not logged in"}`);
48777
- console.log(` ${import_chalk3.default.bold("Status:")} ${import_chalk3.default.green("Ready to connect")}`);
48807
+ console.log(` ${import_chalk3.default.bold("Status:")} ${loginResult ? import_chalk3.default.green("Ready to connect") : import_chalk3.default.yellow("Login required")}`);
48778
48808
  console.log();
48779
48809
  console.log(import_chalk3.default.gray(" Next steps:"));
48780
- console.log(import_chalk3.default.gray(" adhdev daemon \u2014 Start the main daemon (required for all features)"));
48810
+ console.log(import_chalk3.default.gray(` ${loginResult ? "adhdev daemon \u2014 Start the main daemon (required for all features)" : "adhdev setup \u2014 Sign in to finish setup and enable the daemon"}`));
48781
48811
  console.log(import_chalk3.default.gray(" adhdev launch cursor \u2014 Launch Cursor IDE with remote control"));
48782
48812
  console.log(import_chalk3.default.gray(" adhdev launch windsurf \u2014 Launch Windsurf IDE with remote control"));
48783
48813
  console.log(import_chalk3.default.gray(" adhdev launch gemini \u2014 Start Gemini CLI agent via daemon"));
@@ -49393,12 +49423,19 @@ function registerSetupCommands(program2, providerLoader) {
49393
49423
  program2.command("status").description("Show current ADHDev setup status").action(async () => {
49394
49424
  const { loadConfig: loadConfig2, detectIDEs: detectIDEs2, detectCLIs: detectCLIs2 } = await Promise.resolve().then(() => (init_src(), src_exports));
49395
49425
  const config2 = loadConfig2();
49426
+ const hasMachineSecret = Boolean(config2.machineSecret && config2.machineSecret.trim());
49396
49427
  console.log(import_chalk4.default.bold("\n\u{1F9A6} ADHDev Status\n"));
49397
49428
  if (!config2.setupCompleted) {
49398
49429
  console.log(import_chalk4.default.yellow(" Status: Not configured"));
49399
49430
  console.log(import_chalk4.default.gray(" Run `adhdev setup` to get started.\n"));
49400
49431
  return;
49401
49432
  }
49433
+ if (!hasMachineSecret) {
49434
+ console.log(` ${import_chalk4.default.bold("Status:")} ${import_chalk4.default.yellow("Login required")}`);
49435
+ console.log(import_chalk4.default.gray(" Setup was started, but this machine is not linked to an ADHDev account yet."));
49436
+ console.log(import_chalk4.default.gray(" Run `adhdev setup` to finish authentication.\n"));
49437
+ return;
49438
+ }
49402
49439
  const ideList = config2.configuredIdes?.length ? config2.configuredIdes : config2.selectedIde ? [config2.selectedIde] : [];
49403
49440
  console.log(` ${import_chalk4.default.bold("Status:")} ${import_chalk4.default.green("\u2713 Configured")}`);
49404
49441
  if (ideList.length > 0) {