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 +13 -11
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29911,7 +29911,7 @@ ${e?.stack || ""}`);
|
|
|
29911
29911
|
let token = "";
|
|
29912
29912
|
try {
|
|
29913
29913
|
const config2 = JSON.parse(fs10.readFileSync(configPath, "utf-8"));
|
|
29914
|
-
token = config2.
|
|
29914
|
+
token = config2.machineSecret || "";
|
|
29915
29915
|
} catch {
|
|
29916
29916
|
}
|
|
29917
29917
|
const http3 = esmRequire("https");
|
|
@@ -30748,7 +30748,7 @@ var init_adhdev_daemon = __esm({
|
|
|
30748
30748
|
fs11 = __toESM(require("fs"));
|
|
30749
30749
|
path14 = __toESM(require("path"));
|
|
30750
30750
|
import_chalk2 = __toESM(require("chalk"));
|
|
30751
|
-
pkgVersion = "0.6.
|
|
30751
|
+
pkgVersion = "0.6.26";
|
|
30752
30752
|
if (pkgVersion === "unknown") {
|
|
30753
30753
|
try {
|
|
30754
30754
|
const possiblePaths = [
|
|
@@ -30815,9 +30815,12 @@ ${err?.stack || ""}`);
|
|
|
30815
30815
|
}
|
|
30816
30816
|
writeDaemonPid(process.pid);
|
|
30817
30817
|
const config2 = loadConfig();
|
|
30818
|
-
const authToken = config2.machineSecret
|
|
30818
|
+
const authToken = config2.machineSecret;
|
|
30819
30819
|
if (!authToken) {
|
|
30820
|
-
console.log(import_chalk2.default.red("\n\u2717 No
|
|
30820
|
+
console.log(import_chalk2.default.red("\n\u2717 No machine secret found."));
|
|
30821
|
+
if (config2.connectionToken) {
|
|
30822
|
+
console.log(import_chalk2.default.yellow(" Legacy connectionToken detected \u2014 please re-run setup."));
|
|
30823
|
+
}
|
|
30821
30824
|
console.log(import_chalk2.default.gray(" Run `adhdev setup` first.\n"));
|
|
30822
30825
|
process.exit(1);
|
|
30823
30826
|
}
|
|
@@ -31265,13 +31268,12 @@ async function quickSetup() {
|
|
|
31265
31268
|
markSetupComplete(["daemon"], ["adhdev"]);
|
|
31266
31269
|
if (loginResult) {
|
|
31267
31270
|
const configUpdate = {
|
|
31268
|
-
|
|
31271
|
+
machineSecret: loginResult.machineSecret,
|
|
31269
31272
|
userEmail: loginResult.email,
|
|
31270
31273
|
userName: loginResult.name
|
|
31271
31274
|
};
|
|
31272
|
-
if (loginResult.machineId
|
|
31275
|
+
if (loginResult.machineId) {
|
|
31273
31276
|
configUpdate.machineId = loginResult.machineId;
|
|
31274
|
-
configUpdate.machineSecret = loginResult.machineSecret;
|
|
31275
31277
|
console.log(import_chalk3.default.green(` \u2713 Machine registered`));
|
|
31276
31278
|
}
|
|
31277
31279
|
updateConfig(configUpdate);
|
|
@@ -31362,12 +31364,11 @@ async function loginFlow() {
|
|
|
31362
31364
|
return null;
|
|
31363
31365
|
}
|
|
31364
31366
|
const data = await res.json();
|
|
31365
|
-
if (data.status === "completed" && data.
|
|
31367
|
+
if (data.status === "completed" && data.machineSecret) {
|
|
31366
31368
|
pollSpinner.succeed(`Authenticated as ${import_chalk3.default.bold(data.user?.email || "user")}`);
|
|
31367
31369
|
return {
|
|
31368
|
-
connectionToken: data.connectionToken,
|
|
31369
31370
|
machineId: data.machineId || void 0,
|
|
31370
|
-
machineSecret: data.machineSecret
|
|
31371
|
+
machineSecret: data.machineSecret,
|
|
31371
31372
|
email: data.user?.email,
|
|
31372
31373
|
name: data.user?.name
|
|
31373
31374
|
};
|