agenticmail 0.3.22 → 0.3.24

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 +33 -9
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -4427,14 +4427,14 @@ async function restartOpenClawGateway() {
4427
4427
  restartSpinner.start();
4428
4428
  try {
4429
4429
  const { execSync } = await import("child_process");
4430
- execSync("openclaw gateway restart", { stdio: "pipe", timeout: 3e4 });
4430
+ execSync("openclaw gateway start", { stdio: "pipe", timeout: 3e4 });
4431
4431
  restartSpinner.succeed("OpenClaw gateway restarted");
4432
4432
  } catch {
4433
4433
  restartSpinner.fail("Gateway restart failed");
4434
- log2(` Run manually: ${c2.green("openclaw gateway restart")}`);
4434
+ log2(` Run manually: ${c2.green("openclaw gateway start")}`);
4435
4435
  }
4436
4436
  } else {
4437
- info2(`Restart OpenClaw to pick up the changes: ${c2.green("openclaw gateway restart")}`);
4437
+ info2(`Restart OpenClaw to pick up the changes: ${c2.green("openclaw gateway start")}`);
4438
4438
  }
4439
4439
  }
4440
4440
  async function registerWithOpenClaw(config) {
@@ -4489,8 +4489,32 @@ async function registerWithOpenClaw(config) {
4489
4489
  } catch {
4490
4490
  }
4491
4491
  if (!agentApiKey) {
4492
- info2("No agent found \u2014 OpenClaw config will be linked when you run setup again after connecting your email.");
4493
- return;
4492
+ const createSpinner = new Spinner("config", "Creating default agent...");
4493
+ createSpinner.start();
4494
+ try {
4495
+ const base = `http://${config.api.host}:${config.api.port}`;
4496
+ const createResp = await fetch(`${base}/api/agenticmail/accounts`, {
4497
+ method: "POST",
4498
+ headers: {
4499
+ "Authorization": `Bearer ${config.masterKey}`,
4500
+ "Content-Type": "application/json"
4501
+ },
4502
+ body: JSON.stringify({ name: "secretary", role: "secretary" }),
4503
+ signal: AbortSignal.timeout(1e4)
4504
+ });
4505
+ if (createResp.ok) {
4506
+ const agent = await createResp.json();
4507
+ agentApiKey = agent.apiKey;
4508
+ createSpinner.succeed(`Default agent ${c2.bold('"secretary"')} created`);
4509
+ } else {
4510
+ const errText = await createResp.text();
4511
+ createSpinner.fail(`Could not create agent: ${errText}`);
4512
+ return;
4513
+ }
4514
+ } catch (err) {
4515
+ createSpinner.fail(`Could not create agent: ${err.message}`);
4516
+ return;
4517
+ }
4494
4518
  }
4495
4519
  const apiUrl = `http://${config.api.host}:${config.api.port}`;
4496
4520
  const updated = mergePluginConfig(existing, apiUrl, config.masterKey, agentApiKey, pluginDir);
@@ -5311,7 +5335,7 @@ async function cmdOpenClaw() {
5311
5335
  }
5312
5336
  if (!hasOpenClawCli) {
5313
5337
  log2(` ${c2.yellow("\u26A0")} OpenClaw CLI not found in PATH`);
5314
- log2(` Run manually: ${c2.green("openclaw gateway restart")}`);
5338
+ log2(` Run manually: ${c2.green("openclaw gateway start")}`);
5315
5339
  } else {
5316
5340
  const isInteractive = process.stdin.isTTY === true;
5317
5341
  let shouldRestart = !isInteractive;
@@ -5324,16 +5348,16 @@ async function cmdOpenClaw() {
5324
5348
  restartSpinner.start();
5325
5349
  try {
5326
5350
  const { execSync } = await import("child_process");
5327
- execSync("openclaw gateway restart", { stdio: "pipe", timeout: 3e4 });
5351
+ execSync("openclaw gateway start", { stdio: "pipe", timeout: 3e4 });
5328
5352
  restartSpinner.succeed("OpenClaw gateway restarted");
5329
5353
  gatewayRestarted = true;
5330
5354
  } catch (err) {
5331
5355
  restartSpinner.fail("Gateway restart failed");
5332
5356
  log2(` ${c2.yellow("\u26A0")} Gateway restart failed: ${err.message}`);
5333
- log2(` Run manually: ${c2.green("openclaw gateway restart")}`);
5357
+ log2(` Run manually: ${c2.green("openclaw gateway start")}`);
5334
5358
  }
5335
5359
  } else {
5336
- log2(` ${c2.dim("Skipped.")} Run later: ${c2.green("openclaw gateway restart")}`);
5360
+ log2(` ${c2.dim("Skipped.")} Run later: ${c2.green("openclaw gateway start")}`);
5337
5361
  }
5338
5362
  }
5339
5363
  log2("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenticmail",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
4
4
  "description": "Email infrastructure for AI agents — send and receive real email programmatically",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",