agenticmail 0.3.16 → 0.3.18

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 +30 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -4375,14 +4375,38 @@ async function registerWithOpenClaw(config) {
4375
4375
  try {
4376
4376
  const raw = readFileSync2(openclawConfigPath, "utf-8");
4377
4377
  const existing = JSON5.parse(raw);
4378
- if (existing.plugins?.entries?.agenticmail?.config?.apiKey) {
4379
- ok2(`OpenClaw integration already configured`);
4380
- return;
4378
+ const existingEntry = existing.plugins?.entries?.agenticmail;
4379
+ if (existingEntry?.config?.apiKey) {
4380
+ const existingPaths = existing.plugins?.load?.paths ?? [];
4381
+ const pluginFound = existingPaths.some(
4382
+ (p) => existsSync2(join(p, "openclaw.plugin.json"))
4383
+ );
4384
+ if (pluginFound) {
4385
+ ok2(`OpenClaw integration already configured`);
4386
+ return;
4387
+ }
4388
+ }
4389
+ let pluginDir = resolveOpenClawPluginDir();
4390
+ if (!pluginDir) {
4391
+ const installSpinner = new Spinner("plugin", "Installing @agenticmail/openclaw...");
4392
+ installSpinner.start();
4393
+ try {
4394
+ const { execSync } = await import("child_process");
4395
+ execSync("npm i @agenticmail/openclaw", {
4396
+ cwd: homedir(),
4397
+ timeout: 6e4,
4398
+ stdio: ["ignore", "pipe", "pipe"]
4399
+ });
4400
+ installSpinner.succeed("Installed @agenticmail/openclaw");
4401
+ pluginDir = resolveOpenClawPluginDir();
4402
+ } catch (err) {
4403
+ installSpinner.fail(`Could not install: ${err.message}`);
4404
+ info2(`Install manually: ${c2.green("npm i @agenticmail/openclaw")}`);
4405
+ return;
4406
+ }
4381
4407
  }
4382
- const pluginDir = resolveOpenClawPluginDir();
4383
4408
  if (!pluginDir) {
4384
- info2(`Install the OpenClaw plugin first: ${c2.green("npm i @agenticmail/openclaw")}`);
4385
- info2(`Then run: ${c2.green("agenticmail openclaw")}`);
4409
+ fail2("Could not find @agenticmail/openclaw after install");
4386
4410
  return;
4387
4411
  }
4388
4412
  let agentApiKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenticmail",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "Email infrastructure for AI agents — send and receive real email programmatically",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",