@agenticmail/core 0.5.23 → 0.5.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.
package/dist/index.d.ts CHANGED
@@ -1474,6 +1474,17 @@ declare class DependencyInstaller {
1474
1474
  * After install, tells the user to open Docker and accept the terms.
1475
1475
  * No GUI manipulation — the user handles Docker themselves.
1476
1476
  */
1477
+ /**
1478
+ * Ensure /usr/local/bin and /usr/local/cli-plugins are writable by the
1479
+ * current user. Brew needs to create symlinks there and will fail silently
1480
+ * if they're root-owned (it tries sudo which fails non-interactively).
1481
+ */
1482
+ private fixLocalDirPermissions;
1483
+ /**
1484
+ * After DMG install, manually link Docker CLI tools (brew does this
1485
+ * automatically, but the DMG path doesn't).
1486
+ */
1487
+ private linkDockerCli;
1477
1488
  private installDockerMac;
1478
1489
  /**
1479
1490
  * Install Docker Engine on Linux using Docker's official convenience script.
package/dist/index.js CHANGED
@@ -5894,7 +5894,7 @@ var DependencyChecker = class {
5894
5894
 
5895
5895
  // src/setup/installer.ts
5896
5896
  import { execFileSync as execFileSync2, execSync, spawn as spawnChild } from "child_process";
5897
- import { existsSync as existsSync4, readdirSync, lstatSync, readlinkSync, writeFileSync as writeFileSync3, readFileSync as readFileSync2 } from "fs";
5897
+ import { existsSync as existsSync4, readdirSync, lstatSync, readlinkSync, writeFileSync as writeFileSync3, readFileSync as readFileSync2, mkdirSync as mkdirSync3 } from "fs";
5898
5898
  import { writeFile, rename, chmod as chmod2, mkdir as mkdir2, unlink } from "fs/promises";
5899
5899
  import { join as join6 } from "path";
5900
5900
  import { homedir as homedir5, platform as platform2, arch as arch2 } from "os";
@@ -6312,8 +6312,65 @@ var DependencyInstaller = class {
6312
6312
  * After install, tells the user to open Docker and accept the terms.
6313
6313
  * No GUI manipulation — the user handles Docker themselves.
6314
6314
  */
6315
+ /**
6316
+ * Ensure /usr/local/bin and /usr/local/cli-plugins are writable by the
6317
+ * current user. Brew needs to create symlinks there and will fail silently
6318
+ * if they're root-owned (it tries sudo which fails non-interactively).
6319
+ */
6320
+ fixLocalDirPermissions() {
6321
+ const user = process.env.USER || "";
6322
+ if (!user) return;
6323
+ const dirs = ["/usr/local/bin", "/usr/local/cli-plugins"];
6324
+ for (const dir of dirs) {
6325
+ try {
6326
+ if (!existsSync4(dir)) {
6327
+ execSync(`mkdir -p "${dir}"`, { timeout: 5e3, stdio: "ignore" });
6328
+ }
6329
+ const stat = execSync(`stat -f '%Su' "${dir}"`, { timeout: 5e3, stdio: ["ignore", "pipe", "ignore"] }).toString().trim();
6330
+ if (stat !== user) {
6331
+ try {
6332
+ execSync(`find "${dir}" -maxdepth 1 -type l ! -exec test -e {} \\; -delete 2>/dev/null`, { timeout: 5e3, stdio: "ignore" });
6333
+ } catch {
6334
+ }
6335
+ try {
6336
+ execSync(`chown -R ${user} "${dir}"`, { timeout: 5e3, stdio: "ignore" });
6337
+ } catch {
6338
+ }
6339
+ }
6340
+ } catch {
6341
+ }
6342
+ }
6343
+ }
6344
+ /**
6345
+ * After DMG install, manually link Docker CLI tools (brew does this
6346
+ * automatically, but the DMG path doesn't).
6347
+ */
6348
+ linkDockerCli(appPath) {
6349
+ const links = [
6350
+ [join6(appPath, "Contents/Resources/bin/docker"), "/usr/local/bin/docker"],
6351
+ [join6(appPath, "Contents/Resources/bin/docker-credential-desktop"), "/usr/local/bin/docker-credential-desktop"],
6352
+ [join6(appPath, "Contents/Resources/bin/docker-credential-ecr-login"), "/usr/local/bin/docker-credential-ecr-login"],
6353
+ [join6(appPath, "Contents/Resources/bin/docker-credential-osxkeychain"), "/usr/local/bin/docker-credential-osxkeychain"],
6354
+ [join6(appPath, "Contents/Resources/cli-plugins/docker-compose"), "/usr/local/cli-plugins/docker-compose"]
6355
+ ];
6356
+ for (const [src, dest] of links) {
6357
+ try {
6358
+ if (existsSync4(src)) {
6359
+ const destDir = join6(dest, "..");
6360
+ if (!existsSync4(destDir)) mkdirSync3(destDir, { recursive: true });
6361
+ try {
6362
+ execSync(`rm -f "${dest}"`, { timeout: 3e3, stdio: "ignore" });
6363
+ } catch {
6364
+ }
6365
+ execSync(`ln -s "${src}" "${dest}"`, { timeout: 3e3, stdio: "ignore" });
6366
+ }
6367
+ } catch {
6368
+ }
6369
+ }
6370
+ }
6315
6371
  async installDockerMac() {
6316
6372
  let installed = false;
6373
+ this.fixLocalDirPermissions();
6317
6374
  if (hasHomebrew()) {
6318
6375
  this.onProgress("__progress__:5:Installing Docker Desktop...");
6319
6376
  try {
@@ -6368,20 +6425,9 @@ var DependencyInstaller = class {
6368
6425
  await unlink(dmgPath);
6369
6426
  } catch {
6370
6427
  }
6428
+ const appPath2 = this.findDockerApp();
6429
+ if (appPath2) this.linkDockerCli(appPath2);
6371
6430
  }
6372
- try {
6373
- execSync(`osascript -e 'quit app "Docker Desktop"' 2>/dev/null`, { timeout: 5e3, stdio: "ignore" });
6374
- } catch {
6375
- }
6376
- try {
6377
- execSync(`osascript -e 'quit app "Docker"' 2>/dev/null`, { timeout: 5e3, stdio: "ignore" });
6378
- } catch {
6379
- }
6380
- try {
6381
- execSync("pkill -f Docker.app 2>/dev/null", { timeout: 5e3, stdio: "ignore" });
6382
- } catch {
6383
- }
6384
- await new Promise((r) => setTimeout(r, 2e3));
6385
6431
  const appPath = this.findDockerApp();
6386
6432
  if (!appPath) {
6387
6433
  throw new Error("Docker Desktop was installed but could not be found. Try again.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/core",
3
- "version": "0.5.23",
3
+ "version": "0.5.24",
4
4
  "description": "Core SDK for AgenticMail \u2014 email, SMS, and phone number access for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",