adhdev 0.6.24 → 0.6.26

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
@@ -30351,7 +30351,7 @@ ${e?.stack || ""}`);
30351
30351
  let token = "";
30352
30352
  try {
30353
30353
  const config2 = JSON.parse(fs10.readFileSync(configPath, "utf-8"));
30354
- token = config2.connectionToken || "";
30354
+ token = config2.machineSecret || "";
30355
30355
  } catch {
30356
30356
  }
30357
30357
  const http3 = esmRequire("https");
@@ -31188,7 +31188,7 @@ var init_adhdev_daemon = __esm({
31188
31188
  fs11 = __toESM(require("fs"));
31189
31189
  path14 = __toESM(require("path"));
31190
31190
  import_chalk2 = __toESM(require("chalk"));
31191
- pkgVersion = "0.6.24";
31191
+ pkgVersion = "0.6.26";
31192
31192
  if (pkgVersion === "unknown") {
31193
31193
  try {
31194
31194
  const possiblePaths = [
@@ -31255,9 +31255,12 @@ ${err?.stack || ""}`);
31255
31255
  }
31256
31256
  writeDaemonPid(process.pid);
31257
31257
  const config2 = loadConfig();
31258
- const authToken = config2.machineSecret || config2.connectionToken;
31258
+ const authToken = config2.machineSecret;
31259
31259
  if (!authToken) {
31260
- console.log(import_chalk2.default.red("\n\u2717 No credentials found."));
31260
+ console.log(import_chalk2.default.red("\n\u2717 No machine secret found."));
31261
+ if (config2.connectionToken) {
31262
+ console.log(import_chalk2.default.yellow(" Legacy connectionToken detected \u2014 please re-run setup."));
31263
+ }
31261
31264
  console.log(import_chalk2.default.gray(" Run `adhdev setup` first.\n"));
31262
31265
  process.exit(1);
31263
31266
  }
@@ -31680,13 +31683,12 @@ async function quickSetup() {
31680
31683
  markSetupComplete(["daemon"], ["adhdev"]);
31681
31684
  if (loginResult) {
31682
31685
  const configUpdate = {
31683
- connectionToken: loginResult.connectionToken,
31686
+ machineSecret: loginResult.machineSecret,
31684
31687
  userEmail: loginResult.email,
31685
31688
  userName: loginResult.name
31686
31689
  };
31687
- if (loginResult.machineId && loginResult.machineSecret) {
31690
+ if (loginResult.machineId) {
31688
31691
  configUpdate.machineId = loginResult.machineId;
31689
- configUpdate.machineSecret = loginResult.machineSecret;
31690
31692
  console.log(import_chalk3.default.green(` \u2713 Machine registered`));
31691
31693
  }
31692
31694
  updateConfig(configUpdate);
@@ -31777,12 +31779,11 @@ async function loginFlow() {
31777
31779
  return null;
31778
31780
  }
31779
31781
  const data = await res.json();
31780
- if (data.status === "completed" && data.connectionToken) {
31782
+ if (data.status === "completed" && data.machineSecret) {
31781
31783
  pollSpinner.succeed(`Authenticated as ${import_chalk3.default.bold(data.user?.email || "user")}`);
31782
31784
  return {
31783
- connectionToken: data.connectionToken,
31784
31785
  machineId: data.machineId || void 0,
31785
- machineSecret: data.machineSecret || void 0,
31786
+ machineSecret: data.machineSecret,
31786
31787
  email: data.user?.email,
31787
31788
  name: data.user?.name
31788
31789
  };
@@ -32390,7 +32391,8 @@ function registerSetupCommands(program2, providerLoader) {
32390
32391
  }
32391
32392
  const config2 = loadConfig2();
32392
32393
  config2.apiToken = null;
32393
- config2.connectionToken = null;
32394
+ config2.machineSecret = void 0;
32395
+ config2.machineId = void 0;
32394
32396
  config2.userEmail = null;
32395
32397
  config2.userName = null;
32396
32398
  saveConfig2(config2);