agenticmail 0.3.6 → 0.3.8
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 +48 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3148,7 +3148,7 @@ ${orig.text || ""}`;
|
|
|
3148
3148
|
const top = c.dim(boxChar.tl + boxChar.h.repeat(width) + boxChar.tr);
|
|
3149
3149
|
const bot = c.dim(boxChar.bl + boxChar.h.repeat(width) + boxChar.br);
|
|
3150
3150
|
if (savedUp > 0) {
|
|
3151
|
-
process.stdout.write(`\x1B[${savedUp
|
|
3151
|
+
process.stdout.write(`\x1B[${savedUp}A\r\x1B[J`);
|
|
3152
3152
|
}
|
|
3153
3153
|
process.stdout.write(`${top}
|
|
3154
3154
|
`);
|
|
@@ -3167,8 +3167,7 @@ ${orig.text || ""}`;
|
|
|
3167
3167
|
const onKey = (_ch, key) => {
|
|
3168
3168
|
if (!key) return;
|
|
3169
3169
|
const eraseBox = () => {
|
|
3170
|
-
|
|
3171
|
-
process.stdout.write(`\x1B[${up}A\r\x1B[J`);
|
|
3170
|
+
process.stdout.write(`\x1B[${savedUp}A\r\x1B[J`);
|
|
3172
3171
|
};
|
|
3173
3172
|
if (key.name === "escape") {
|
|
3174
3173
|
process.stdin.removeListener("keypress", onKey);
|
|
@@ -3423,6 +3422,52 @@ ${c.dim(boxChar.bl + boxChar.h.repeat(bWidth) + boxChar.br)}`);
|
|
|
3423
3422
|
log("");
|
|
3424
3423
|
log(` ${c.bold("Email Setup")}`);
|
|
3425
3424
|
log("");
|
|
3425
|
+
let existingEmail = null;
|
|
3426
|
+
let existingProvider = null;
|
|
3427
|
+
try {
|
|
3428
|
+
const statusResp = await apiFetch("/api/agenticmail/gateway/status");
|
|
3429
|
+
if (statusResp.ok) {
|
|
3430
|
+
const status = await statusResp.json();
|
|
3431
|
+
if (status.mode === "relay" && status.relay?.email) {
|
|
3432
|
+
existingEmail = status.relay.email;
|
|
3433
|
+
existingProvider = status.relay.provider || "custom";
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
} catch {
|
|
3437
|
+
}
|
|
3438
|
+
if (existingEmail) {
|
|
3439
|
+
const provLabel = existingProvider === "gmail" ? "Gmail" : existingProvider === "outlook" ? "Outlook" : existingProvider;
|
|
3440
|
+
log(` ${c.dim("Currently connected:")} ${c.cyan(existingEmail)} ${c.dim(`(${provLabel})`)}`);
|
|
3441
|
+
log("");
|
|
3442
|
+
log(` ${c.green("[1]")} Keep current email`);
|
|
3443
|
+
log(` ${c.green("[2]")} Remove and connect a different email`);
|
|
3444
|
+
log(` ${c.green("[3]")} Set up a custom domain`);
|
|
3445
|
+
log("");
|
|
3446
|
+
const existChoice = await question(` ${c.dim(">")}: `);
|
|
3447
|
+
if (isBack(existChoice)) {
|
|
3448
|
+
log("");
|
|
3449
|
+
return;
|
|
3450
|
+
}
|
|
3451
|
+
const ec = existChoice.trim();
|
|
3452
|
+
if (ec === "1" || !ec) {
|
|
3453
|
+
ok(`Keeping ${c.cyan(existingEmail)}`);
|
|
3454
|
+
log("");
|
|
3455
|
+
return;
|
|
3456
|
+
}
|
|
3457
|
+
if (ec === "3") {
|
|
3458
|
+
info("Custom domain setup is available via the API.");
|
|
3459
|
+
info(`Run: ${c.cyan("POST /api/agenticmail/gateway/domain")}`);
|
|
3460
|
+
info("You need a Cloudflare account with API token and account ID.");
|
|
3461
|
+
log("");
|
|
3462
|
+
return;
|
|
3463
|
+
}
|
|
3464
|
+
if (ec !== "2") {
|
|
3465
|
+
fail("Invalid choice.");
|
|
3466
|
+
log("");
|
|
3467
|
+
return;
|
|
3468
|
+
}
|
|
3469
|
+
log("");
|
|
3470
|
+
}
|
|
3426
3471
|
log(` ${c.cyan("1.")} Gmail`);
|
|
3427
3472
|
log(` ${c.cyan("2.")} Outlook / Hotmail`);
|
|
3428
3473
|
log(` ${c.cyan("3.")} Skip`);
|