agenticmail 0.5.8 → 0.5.10
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 +91 -23
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4295,13 +4295,51 @@ var LOADING_MESSAGES = {
|
|
|
4295
4295
|
"Almost there..."
|
|
4296
4296
|
]
|
|
4297
4297
|
};
|
|
4298
|
+
var GRADIENT_COLORS = [
|
|
4299
|
+
205,
|
|
4300
|
+
// hot pink
|
|
4301
|
+
212,
|
|
4302
|
+
// light pink
|
|
4303
|
+
219,
|
|
4304
|
+
// pink-lavender
|
|
4305
|
+
183,
|
|
4306
|
+
// lavender
|
|
4307
|
+
147,
|
|
4308
|
+
// periwinkle
|
|
4309
|
+
111,
|
|
4310
|
+
// sky blue
|
|
4311
|
+
117,
|
|
4312
|
+
// light blue
|
|
4313
|
+
123,
|
|
4314
|
+
// cyan-blue
|
|
4315
|
+
159,
|
|
4316
|
+
// ice blue
|
|
4317
|
+
153,
|
|
4318
|
+
// pale blue
|
|
4319
|
+
189,
|
|
4320
|
+
// light lavender
|
|
4321
|
+
225,
|
|
4322
|
+
// baby pink
|
|
4323
|
+
218,
|
|
4324
|
+
// salmon pink
|
|
4325
|
+
211,
|
|
4326
|
+
// coral
|
|
4327
|
+
205
|
|
4328
|
+
// hot pink (loop)
|
|
4329
|
+
];
|
|
4330
|
+
function color256(code, s) {
|
|
4331
|
+
return `\x1B[38;5;${code}m${s}\x1B[0m`;
|
|
4332
|
+
}
|
|
4298
4333
|
var Spinner = class {
|
|
4299
4334
|
interval = null;
|
|
4300
4335
|
frameIdx = 0;
|
|
4301
4336
|
msgIdx = 0;
|
|
4302
4337
|
msgChangeCounter = 0;
|
|
4338
|
+
colorIdx = 0;
|
|
4303
4339
|
category;
|
|
4304
4340
|
currentMsg;
|
|
4341
|
+
progressMsg = "";
|
|
4342
|
+
// message set by progress update
|
|
4305
4343
|
progressPct = -1;
|
|
4306
4344
|
// -1 = no progress bar
|
|
4307
4345
|
constructor(category, initialMsg) {
|
|
@@ -4313,23 +4351,34 @@ var Spinner = class {
|
|
|
4313
4351
|
this.frameIdx = 0;
|
|
4314
4352
|
this.msgIdx = 0;
|
|
4315
4353
|
this.msgChangeCounter = 0;
|
|
4354
|
+
this.colorIdx = 0;
|
|
4316
4355
|
this.progressPct = -1;
|
|
4317
4356
|
const msgs = LOADING_MESSAGES[this.category] ?? LOADING_MESSAGES.general;
|
|
4318
4357
|
this.interval = setInterval(() => {
|
|
4319
4358
|
const frame = SPINNER_FRAMES[this.frameIdx % SPINNER_FRAMES.length];
|
|
4359
|
+
const clr = GRADIENT_COLORS[this.colorIdx % GRADIENT_COLORS.length];
|
|
4320
4360
|
if (this.progressPct >= 0) {
|
|
4321
4361
|
const barWidth = 20;
|
|
4322
4362
|
const filled = Math.round(this.progressPct / 100 * barWidth);
|
|
4323
4363
|
const empty = barWidth - filled;
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4364
|
+
let bar = "";
|
|
4365
|
+
for (let i = 0; i < filled; i++) {
|
|
4366
|
+
const barClr = GRADIENT_COLORS[(this.colorIdx + i) % GRADIENT_COLORS.length];
|
|
4367
|
+
bar += color256(barClr, "\u2588");
|
|
4368
|
+
}
|
|
4369
|
+
bar += c2.dim("\u2591".repeat(empty));
|
|
4370
|
+
const pctStr = color256(clr, `${this.progressPct}%`);
|
|
4371
|
+
const displayMsg = this.progressMsg || this.currentMsg;
|
|
4372
|
+
process.stdout.write(`\r ${color256(clr, frame)} ${bar} ${pctStr} ${color256(clr, displayMsg)}\x1B[K`);
|
|
4327
4373
|
} else {
|
|
4328
|
-
process.stdout.write(`\r ${
|
|
4374
|
+
process.stdout.write(`\r ${color256(clr, frame)} ${color256(clr, this.currentMsg)}\x1B[K`);
|
|
4329
4375
|
}
|
|
4330
4376
|
this.frameIdx++;
|
|
4331
4377
|
this.msgChangeCounter++;
|
|
4332
|
-
if (this.
|
|
4378
|
+
if (this.frameIdx % 2 === 0) {
|
|
4379
|
+
this.colorIdx = (this.colorIdx + 1) % GRADIENT_COLORS.length;
|
|
4380
|
+
}
|
|
4381
|
+
if (this.msgChangeCounter >= 30) {
|
|
4333
4382
|
this.msgChangeCounter = 0;
|
|
4334
4383
|
this.msgIdx = (this.msgIdx + 1) % msgs.length;
|
|
4335
4384
|
this.currentMsg = msgs[this.msgIdx];
|
|
@@ -4340,9 +4389,10 @@ var Spinner = class {
|
|
|
4340
4389
|
const match = msg.match(/^__progress__:(\d+):(.*)$/);
|
|
4341
4390
|
if (match) {
|
|
4342
4391
|
this.progressPct = Math.min(100, parseInt(match[1], 10));
|
|
4343
|
-
this.
|
|
4392
|
+
this.progressMsg = match[2];
|
|
4344
4393
|
} else {
|
|
4345
4394
|
this.currentMsg = msg;
|
|
4395
|
+
this.progressMsg = "";
|
|
4346
4396
|
}
|
|
4347
4397
|
this.msgChangeCounter = 0;
|
|
4348
4398
|
}
|
|
@@ -4468,7 +4518,7 @@ function stopApiServer() {
|
|
|
4468
4518
|
}
|
|
4469
4519
|
async function cmdSetup() {
|
|
4470
4520
|
log2("");
|
|
4471
|
-
log2(` ${c2.
|
|
4521
|
+
log2(` ${c2.pinkBg(" \u{1F380} AgenticMail Setup ")}`);
|
|
4472
4522
|
log2("");
|
|
4473
4523
|
log2(` ${c2.bold("Welcome!")} We're going to set up everything your AI agent`);
|
|
4474
4524
|
log2(` needs to send and receive real email.`);
|
|
@@ -4540,7 +4590,7 @@ async function cmdSetup() {
|
|
|
4540
4590
|
const ver = dep.version && /^\d/.test(dep.version) ? ` ${c2.dim("v" + dep.version)}` : "";
|
|
4541
4591
|
ok2(`${c2.bold(f.name)}${ver} ${c2.dim("\u2014 " + f.desc)}`);
|
|
4542
4592
|
} else {
|
|
4543
|
-
|
|
4593
|
+
console.log(` ${c2.yellow("\u25CC")} ${c2.bold(f.name)} ${c2.dim("\u2014 " + f.desc)} ${c2.yellow("(will install)")}`);
|
|
4544
4594
|
}
|
|
4545
4595
|
}
|
|
4546
4596
|
log2("");
|
|
@@ -4726,17 +4776,29 @@ async function cmdSetup() {
|
|
|
4726
4776
|
}
|
|
4727
4777
|
log2("");
|
|
4728
4778
|
let emailOk = false;
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4779
|
+
while (!emailOk) {
|
|
4780
|
+
if (choice === "1") {
|
|
4781
|
+
emailOk = await setupRelay(result.config);
|
|
4782
|
+
} else {
|
|
4783
|
+
await setupDomain(result.config);
|
|
4784
|
+
emailOk = true;
|
|
4785
|
+
}
|
|
4786
|
+
if (!emailOk) {
|
|
4787
|
+
log2("");
|
|
4788
|
+
info2("Email setup did not complete. Let's try again.");
|
|
4789
|
+
log2("");
|
|
4790
|
+
const retry = await ask(` ${c2.bold("Try again?")} ${c2.dim("(Y/n)")} `);
|
|
4791
|
+
if (retry.toLowerCase().startsWith("n")) {
|
|
4792
|
+
log2("");
|
|
4793
|
+
info2("You can set up email later by running: " + c2.green("npx agenticmail setup"));
|
|
4794
|
+
log2("");
|
|
4795
|
+
log2(` ${c2.dim("Your secret key:")} ${c2.yellow(result.config.masterKey)}`);
|
|
4796
|
+
log2(` ${c2.dim("Settings saved:")} ${c2.cyan(result.configPath)}`);
|
|
4797
|
+
log2("");
|
|
4798
|
+
process.exit(0);
|
|
4799
|
+
}
|
|
4800
|
+
log2("");
|
|
4801
|
+
}
|
|
4740
4802
|
}
|
|
4741
4803
|
} else if (!existingEmail) {
|
|
4742
4804
|
info2("No problem! You can set up email anytime by running this again.");
|
|
@@ -5120,6 +5182,12 @@ function parseFriendlyError(rawText) {
|
|
|
5120
5182
|
isAuthError: true
|
|
5121
5183
|
};
|
|
5122
5184
|
}
|
|
5185
|
+
if (error.includes("Invalid API key") || error.includes("Unauthorized") || error.includes("401")) {
|
|
5186
|
+
return {
|
|
5187
|
+
message: "Server authorization failed \u2014 the mail server may still be starting up. Try again in a moment.",
|
|
5188
|
+
isAuthError: false
|
|
5189
|
+
};
|
|
5190
|
+
}
|
|
5123
5191
|
if (error.includes("ECONNREFUSED") || error.includes("ETIMEDOUT") || error.includes("ENOTFOUND")) {
|
|
5124
5192
|
return {
|
|
5125
5193
|
message: "Could not reach the email server. Check your internet connection.",
|
|
@@ -5451,7 +5519,7 @@ function mergePluginConfig(existing, apiUrl, masterKey, agentApiKey, pluginDir)
|
|
|
5451
5519
|
}
|
|
5452
5520
|
async function cmdOpenClaw() {
|
|
5453
5521
|
log2("");
|
|
5454
|
-
log2(` ${c2.
|
|
5522
|
+
log2(` ${c2.pinkBg(" \u{1F380} AgenticMail for OpenClaw ")}`);
|
|
5455
5523
|
log2("");
|
|
5456
5524
|
log2(` ${c2.bold("Let's get your OpenClaw agent set up with email.")}`);
|
|
5457
5525
|
log2(` This will:`);
|
|
@@ -6136,7 +6204,7 @@ function printPluginSnippet(apiUrl, masterKey, agentApiKey) {
|
|
|
6136
6204
|
}
|
|
6137
6205
|
async function cmdStatus() {
|
|
6138
6206
|
log2("");
|
|
6139
|
-
log2(` ${c2.
|
|
6207
|
+
log2(` ${c2.pinkBg(" \u{1F380} AgenticMail Status ")}`);
|
|
6140
6208
|
log2("");
|
|
6141
6209
|
const setup = new SetupManager();
|
|
6142
6210
|
const FRIENDLY_NAMES = {
|
|
@@ -6241,7 +6309,7 @@ async function cmdStart() {
|
|
|
6241
6309
|
return;
|
|
6242
6310
|
}
|
|
6243
6311
|
log2("");
|
|
6244
|
-
log2(` ${c2.
|
|
6312
|
+
log2(` ${c2.pinkBg(" \u{1F380} Starting AgenticMail ")}`);
|
|
6245
6313
|
log2("");
|
|
6246
6314
|
const cfgPath = join(homedir(), ".agenticmail", "config.json");
|
|
6247
6315
|
let config;
|
|
@@ -6527,7 +6595,7 @@ switch (command) {
|
|
|
6527
6595
|
case "--help":
|
|
6528
6596
|
case "-h":
|
|
6529
6597
|
log2("");
|
|
6530
|
-
log2(` ${c2.
|
|
6598
|
+
log2(` ${c2.pinkBg(" \u{1F380} AgenticMail ")} ${c2.dim("Give your AI agent a real email address")}`);
|
|
6531
6599
|
log2("");
|
|
6532
6600
|
log2(" Commands:");
|
|
6533
6601
|
log2(` ${c2.green("agenticmail")} Get started (setup + start)`);
|
package/package.json
CHANGED