agenticmail 0.3.6 → 0.3.7

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.
Files changed (2) hide show
  1. package/dist/cli.js +46 -0
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -3423,6 +3423,52 @@ ${c.dim(boxChar.bl + boxChar.h.repeat(bWidth) + boxChar.br)}`);
3423
3423
  log("");
3424
3424
  log(` ${c.bold("Email Setup")}`);
3425
3425
  log("");
3426
+ let existingEmail = null;
3427
+ let existingProvider = null;
3428
+ try {
3429
+ const statusResp = await apiFetch("/api/agenticmail/gateway/status");
3430
+ if (statusResp.ok) {
3431
+ const status = await statusResp.json();
3432
+ if (status.mode === "relay" && status.relay?.email) {
3433
+ existingEmail = status.relay.email;
3434
+ existingProvider = status.relay.provider || "custom";
3435
+ }
3436
+ }
3437
+ } catch {
3438
+ }
3439
+ if (existingEmail) {
3440
+ const provLabel = existingProvider === "gmail" ? "Gmail" : existingProvider === "outlook" ? "Outlook" : existingProvider;
3441
+ log(` ${c.dim("Currently connected:")} ${c.cyan(existingEmail)} ${c.dim(`(${provLabel})`)}`);
3442
+ log("");
3443
+ log(` ${c.green("[1]")} Keep current email`);
3444
+ log(` ${c.green("[2]")} Remove and connect a different email`);
3445
+ log(` ${c.green("[3]")} Set up a custom domain`);
3446
+ log("");
3447
+ const existChoice = await question(` ${c.dim(">")}: `);
3448
+ if (isBack(existChoice)) {
3449
+ log("");
3450
+ return;
3451
+ }
3452
+ const ec = existChoice.trim();
3453
+ if (ec === "1" || !ec) {
3454
+ ok(`Keeping ${c.cyan(existingEmail)}`);
3455
+ log("");
3456
+ return;
3457
+ }
3458
+ if (ec === "3") {
3459
+ info("Custom domain setup is available via the API.");
3460
+ info(`Run: ${c.cyan("POST /api/agenticmail/gateway/domain")}`);
3461
+ info("You need a Cloudflare account with API token and account ID.");
3462
+ log("");
3463
+ return;
3464
+ }
3465
+ if (ec !== "2") {
3466
+ fail("Invalid choice.");
3467
+ log("");
3468
+ return;
3469
+ }
3470
+ log("");
3471
+ }
3426
3472
  log(` ${c.cyan("1.")} Gmail`);
3427
3473
  log(` ${c.cyan("2.")} Outlook / Hotmail`);
3428
3474
  log(` ${c.cyan("3.")} Skip`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenticmail",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Email infrastructure for AI agents — send and receive real email programmatically",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",