agenticmail 0.3.12 → 0.3.14
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 +35 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4077,11 +4077,14 @@ async function cmdSetup() {
|
|
|
4077
4077
|
log2(` ${c2.bold("Welcome!")} We're going to set up everything your AI agent`);
|
|
4078
4078
|
log2(` needs to send and receive real email.`);
|
|
4079
4079
|
log2("");
|
|
4080
|
+
const hasOpenClaw = existsSync2(join(homedir(), ".openclaw", "openclaw.json"));
|
|
4081
|
+
const totalSteps = hasOpenClaw ? 5 : 4;
|
|
4080
4082
|
log2(` Here's what we'll do:`);
|
|
4081
4083
|
log2(` ${c2.dim("1.")} Check your system for required tools`);
|
|
4082
4084
|
log2(` ${c2.dim("2.")} Create your private account and keys`);
|
|
4083
4085
|
log2(` ${c2.dim("3.")} Start the mail server`);
|
|
4084
4086
|
log2(` ${c2.dim("4.")} Connect your email`);
|
|
4087
|
+
if (hasOpenClaw) log2(` ${c2.dim("5.")} Configure OpenClaw integration`);
|
|
4085
4088
|
log2("");
|
|
4086
4089
|
await pick(` ${c2.magenta("Press any key to get started...")} `, [
|
|
4087
4090
|
"1",
|
|
@@ -4126,7 +4129,7 @@ async function cmdSetup() {
|
|
|
4126
4129
|
]);
|
|
4127
4130
|
log2("");
|
|
4128
4131
|
const setup = new SetupManager();
|
|
4129
|
-
log2(` ${c2.bold(
|
|
4132
|
+
log2(` ${c2.bold(`Step 1 of ${totalSteps}`)} ${c2.dim("\u2014")} ${c2.bold("Checking your system")}`);
|
|
4130
4133
|
log2("");
|
|
4131
4134
|
const deps = await setup.checkDependencies();
|
|
4132
4135
|
const FRIENDLY = {
|
|
@@ -4146,7 +4149,7 @@ async function cmdSetup() {
|
|
|
4146
4149
|
}
|
|
4147
4150
|
log2("");
|
|
4148
4151
|
await new Promise((r) => setTimeout(r, 500));
|
|
4149
|
-
log2(` ${c2.bold(
|
|
4152
|
+
log2(` ${c2.bold(`Step 2 of ${totalSteps}`)} ${c2.dim("\u2014")} ${c2.bold("Creating your account")}`);
|
|
4150
4153
|
log2("");
|
|
4151
4154
|
const configSpinner = new Spinner("config");
|
|
4152
4155
|
configSpinner.start();
|
|
@@ -4163,7 +4166,7 @@ async function cmdSetup() {
|
|
|
4163
4166
|
}
|
|
4164
4167
|
log2("");
|
|
4165
4168
|
await new Promise((r) => setTimeout(r, 500));
|
|
4166
|
-
log2(` ${c2.bold(
|
|
4169
|
+
log2(` ${c2.bold(`Step 3 of ${totalSteps}`)} ${c2.dim("\u2014")} ${c2.bold("Starting services")}`);
|
|
4167
4170
|
log2("");
|
|
4168
4171
|
{
|
|
4169
4172
|
const spinner = new Spinner("docker");
|
|
@@ -4214,7 +4217,7 @@ async function cmdSetup() {
|
|
|
4214
4217
|
ok2(c2.green("All systems go!"));
|
|
4215
4218
|
log2("");
|
|
4216
4219
|
await new Promise((r) => setTimeout(r, 800));
|
|
4217
|
-
log2(` ${c2.bold(
|
|
4220
|
+
log2(` ${c2.bold(`Step 4 of ${totalSteps}`)} ${c2.dim("\u2014")} ${c2.bold("Connect your email")}`);
|
|
4218
4221
|
log2("");
|
|
4219
4222
|
const serverSpinner = new Spinner("server", "Starting the server...");
|
|
4220
4223
|
serverSpinner.start();
|
|
@@ -4338,7 +4341,10 @@ async function cmdSetup() {
|
|
|
4338
4341
|
} else if (!existingEmail) {
|
|
4339
4342
|
info2("No problem! You can set up email anytime by running this again.");
|
|
4340
4343
|
}
|
|
4341
|
-
if (serverReady) {
|
|
4344
|
+
if (hasOpenClaw && serverReady) {
|
|
4345
|
+
log2("");
|
|
4346
|
+
log2(` ${c2.bold(`Step 5 of ${totalSteps}`)} ${c2.dim("\u2014")} ${c2.bold("Configure OpenClaw integration")}`);
|
|
4347
|
+
log2("");
|
|
4342
4348
|
await registerWithOpenClaw(result.config);
|
|
4343
4349
|
}
|
|
4344
4350
|
printSummary(result, false);
|
|
@@ -4445,7 +4451,30 @@ async function registerWithOpenClaw(config) {
|
|
|
4445
4451
|
}
|
|
4446
4452
|
};
|
|
4447
4453
|
writeFileSync2(openclawConfig, JSON.stringify(ocConfig, null, 2) + "\n", "utf8");
|
|
4448
|
-
ok2(`OpenClaw
|
|
4454
|
+
ok2(`OpenClaw config updated: ${c2.cyan(openclawConfig)}`);
|
|
4455
|
+
if (pluginPath) ok2(`Plugin found: ${c2.cyan(pluginPath)}`);
|
|
4456
|
+
let hasOpenClawCli = false;
|
|
4457
|
+
try {
|
|
4458
|
+
const { execSync } = await import("child_process");
|
|
4459
|
+
execSync("which openclaw", { stdio: "ignore" });
|
|
4460
|
+
hasOpenClawCli = true;
|
|
4461
|
+
} catch {
|
|
4462
|
+
}
|
|
4463
|
+
if (hasOpenClawCli) {
|
|
4464
|
+
log2("");
|
|
4465
|
+
const restartSpinner = new Spinner("gateway", "Restarting OpenClaw gateway...");
|
|
4466
|
+
restartSpinner.start();
|
|
4467
|
+
try {
|
|
4468
|
+
const { execSync } = await import("child_process");
|
|
4469
|
+
execSync("openclaw gateway restart", { stdio: "pipe", timeout: 3e4 });
|
|
4470
|
+
restartSpinner.succeed("OpenClaw gateway restarted");
|
|
4471
|
+
} catch {
|
|
4472
|
+
restartSpinner.fail("Gateway restart failed");
|
|
4473
|
+
log2(` Run manually: ${c2.green("openclaw gateway restart")}`);
|
|
4474
|
+
}
|
|
4475
|
+
} else {
|
|
4476
|
+
info2(`Restart OpenClaw to pick up the changes: ${c2.green("openclaw gateway restart")}`);
|
|
4477
|
+
}
|
|
4449
4478
|
} catch {
|
|
4450
4479
|
}
|
|
4451
4480
|
}
|