agenticmail 0.3.19 → 0.3.21
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.js +18 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4333,10 +4333,19 @@ async function cmdSetup() {
|
|
|
4333
4333
|
return;
|
|
4334
4334
|
}
|
|
4335
4335
|
log2("");
|
|
4336
|
+
let emailOk = false;
|
|
4336
4337
|
if (choice === "1") {
|
|
4337
|
-
await setupRelay(result.config);
|
|
4338
|
+
emailOk = await setupRelay(result.config);
|
|
4338
4339
|
} else {
|
|
4339
4340
|
await setupDomain(result.config);
|
|
4341
|
+
emailOk = true;
|
|
4342
|
+
}
|
|
4343
|
+
if (!emailOk) {
|
|
4344
|
+
log2("");
|
|
4345
|
+
info2("Email setup did not complete. Run " + c2.green("npx agenticmail setup") + " again to retry.");
|
|
4346
|
+
cleanupChild();
|
|
4347
|
+
printSummary(result, true);
|
|
4348
|
+
return;
|
|
4340
4349
|
}
|
|
4341
4350
|
} else if (!existingEmail) {
|
|
4342
4351
|
info2("No problem! You can set up email anytime by running this again.");
|
|
@@ -4444,7 +4453,10 @@ async function registerWithOpenClaw(config) {
|
|
|
4444
4453
|
}
|
|
4445
4454
|
} catch {
|
|
4446
4455
|
}
|
|
4447
|
-
if (!agentApiKey)
|
|
4456
|
+
if (!agentApiKey) {
|
|
4457
|
+
info2("No agent found \u2014 OpenClaw config will be linked when you run setup again after connecting your email.");
|
|
4458
|
+
return;
|
|
4459
|
+
}
|
|
4448
4460
|
const apiUrl = `http://${config.api.host}:${config.api.port}`;
|
|
4449
4461
|
const updated = mergePluginConfig(existing, apiUrl, config.masterKey, agentApiKey, pluginDir);
|
|
4450
4462
|
writeFileSync2(openclawConfigPath, JSON.stringify(updated, null, 2) + "\n");
|
|
@@ -4536,7 +4548,7 @@ async function setupRelay(config) {
|
|
|
4536
4548
|
log2("");
|
|
4537
4549
|
info2("Double-check your email and app password, then run: agenticmail setup");
|
|
4538
4550
|
}
|
|
4539
|
-
return;
|
|
4551
|
+
return false;
|
|
4540
4552
|
}
|
|
4541
4553
|
const data = await response.json();
|
|
4542
4554
|
spinner.succeed("Email connected!");
|
|
@@ -4549,12 +4561,13 @@ async function setupRelay(config) {
|
|
|
4549
4561
|
info2("People can email your agent at the address above.");
|
|
4550
4562
|
await sendWelcomeEmail(apiBase, data.agent.apiKey, email, data.agent.name, data.agent.subAddress);
|
|
4551
4563
|
}
|
|
4552
|
-
return;
|
|
4564
|
+
return true;
|
|
4553
4565
|
} catch (err) {
|
|
4554
4566
|
spinner.fail(`Couldn't connect: ${err.message}`);
|
|
4555
|
-
return;
|
|
4567
|
+
return false;
|
|
4556
4568
|
}
|
|
4557
4569
|
}
|
|
4570
|
+
return false;
|
|
4558
4571
|
}
|
|
4559
4572
|
function parseFriendlyError(rawText) {
|
|
4560
4573
|
try {
|