@agenticmail/core 0.5.7 → 0.5.8

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
@@ -1440,13 +1440,20 @@ declare class DependencyInstaller {
1440
1440
  */
1441
1441
  private findDockerApp;
1442
1442
  /**
1443
- * Docker.app exists but CLI isn't available.
1444
- * Run the built-in installer (--accept-license), start Docker Desktop, wait.
1443
+ * Docker.app exists but CLI isn't available or daemon isn't running.
1444
+ * Runs the built-in installer silently (--accept-license to link CLI tools),
1445
+ * then starts Docker Desktop hidden (no GUI window).
1445
1446
  */
1446
1447
  private setupExistingDockerApp;
1448
+ /**
1449
+ * Hide the Docker Desktop window using AppleScript.
1450
+ * Called after starting Docker to suppress the welcome/dashboard GUI.
1451
+ */
1452
+ private hideDockerWindow;
1447
1453
  /**
1448
1454
  * Full Docker Desktop install on macOS.
1449
- * Tries Homebrew first (cleaner, handles updates), falls back to DMG download.
1455
+ * Tries Homebrew first (cleaner), falls back to DMG download.
1456
+ * All output is suppressed — only our progress spinner shows.
1450
1457
  */
1451
1458
  private installDockerMac;
1452
1459
  /**
package/dist/index.js CHANGED
@@ -6016,6 +6016,24 @@ function runShellWithRollingOutput(cmd, opts = {}) {
6016
6016
  });
6017
6017
  });
6018
6018
  }
6019
+ function runSilent(command, args, opts = {}) {
6020
+ const timeout = opts.timeout ?? 3e5;
6021
+ return new Promise((resolve, reject) => {
6022
+ const child = spawnChild(command, args, {
6023
+ stdio: ["ignore", "pipe", "pipe"],
6024
+ timeout
6025
+ });
6026
+ let fullOutput = "";
6027
+ child.stdout?.on("data", (d) => {
6028
+ fullOutput += d.toString();
6029
+ });
6030
+ child.stderr?.on("data", (d) => {
6031
+ fullOutput += d.toString();
6032
+ });
6033
+ child.on("close", (code) => resolve({ exitCode: code ?? 1, fullOutput }));
6034
+ child.on("error", reject);
6035
+ });
6036
+ }
6019
6037
  function existsReal(p) {
6020
6038
  try {
6021
6039
  const stat = lstatSync(p);
@@ -6132,56 +6150,88 @@ var DependencyInstaller = class {
6132
6150
  return null;
6133
6151
  }
6134
6152
  /**
6135
- * Docker.app exists but CLI isn't available.
6136
- * Run the built-in installer (--accept-license), start Docker Desktop, wait.
6153
+ * Docker.app exists but CLI isn't available or daemon isn't running.
6154
+ * Runs the built-in installer silently (--accept-license to link CLI tools),
6155
+ * then starts Docker Desktop hidden (no GUI window).
6137
6156
  */
6138
6157
  async setupExistingDockerApp(appPath) {
6139
6158
  const installBin = join6(appPath, "Contents", "MacOS", "install");
6140
6159
  if (existsSync4(installBin)) {
6141
- this.onProgress("__progress__:20:Installing Docker CLI tools...");
6160
+ this.onProgress("__progress__:30:Setting up Docker CLI tools...");
6142
6161
  const user = process.env.USER || execSync("whoami", { timeout: 5e3 }).toString().trim();
6143
6162
  try {
6144
- await runWithRollingOutput(installBin, ["--accept-license", `--user=${user}`], {
6145
- timeout: 12e4
6163
+ execSync(`"${installBin}" --accept-license --user=${user}`, {
6164
+ timeout: 12e4,
6165
+ stdio: "ignore"
6146
6166
  });
6147
6167
  } catch {
6148
6168
  }
6149
6169
  }
6150
- this.onProgress("__progress__:40:Starting Docker Desktop...");
6170
+ this.onProgress("__progress__:50:Starting Docker engine...");
6151
6171
  this.startDockerDaemon();
6172
+ this.hideDockerWindow();
6152
6173
  await this.waitForDocker();
6153
6174
  }
6175
+ /**
6176
+ * Hide the Docker Desktop window using AppleScript.
6177
+ * Called after starting Docker to suppress the welcome/dashboard GUI.
6178
+ */
6179
+ hideDockerWindow() {
6180
+ try {
6181
+ execSync(
6182
+ `osascript -e 'tell application "System Events" to tell process "Docker Desktop" to set visible to false' 2>/dev/null`,
6183
+ { timeout: 5e3, stdio: "ignore" }
6184
+ );
6185
+ } catch {
6186
+ }
6187
+ try {
6188
+ execSync(
6189
+ `osascript -e 'tell application "Docker Desktop" to close every window' 2>/dev/null`,
6190
+ { timeout: 5e3, stdio: "ignore" }
6191
+ );
6192
+ } catch {
6193
+ }
6194
+ try {
6195
+ execSync(
6196
+ `osascript -e 'tell application "Docker" to close every window' 2>/dev/null`,
6197
+ { timeout: 5e3, stdio: "ignore" }
6198
+ );
6199
+ } catch {
6200
+ }
6201
+ }
6154
6202
  /**
6155
6203
  * Full Docker Desktop install on macOS.
6156
- * Tries Homebrew first (cleaner, handles updates), falls back to DMG download.
6204
+ * Tries Homebrew first (cleaner), falls back to DMG download.
6205
+ * All output is suppressed — only our progress spinner shows.
6157
6206
  */
6158
6207
  async installDockerMac() {
6159
6208
  if (hasHomebrew()) {
6160
- this.onProgress("__progress__:5:Installing Docker Desktop via Homebrew...");
6161
- const brewResult = await runWithRollingOutput(
6162
- "brew",
6163
- ["install", "--cask", "docker"],
6164
- { timeout: 6e5 }
6165
- // can be slow on first install
6166
- );
6167
- if (brewResult.exitCode === 0) {
6168
- this.onProgress("__progress__:50:Docker Desktop installed!");
6169
- const appPath = this.findDockerApp();
6170
- if (appPath) {
6171
- await this.setupExistingDockerApp(appPath);
6172
- return;
6209
+ this.onProgress("__progress__:5:Installing Docker Desktop...");
6210
+ try {
6211
+ const brewResult = await runSilent(
6212
+ "brew",
6213
+ ["install", "--cask", "docker"],
6214
+ { timeout: 6e5 }
6215
+ );
6216
+ if (brewResult.exitCode === 0) {
6217
+ this.onProgress("__progress__:45:Docker Desktop installed!");
6218
+ const appPath = this.findDockerApp();
6219
+ if (appPath) {
6220
+ await this.setupExistingDockerApp(appPath);
6221
+ return;
6222
+ }
6173
6223
  }
6224
+ } catch {
6174
6225
  }
6175
- this.onProgress("__progress__:10:Homebrew install didn't work, downloading directly...");
6226
+ this.onProgress("__progress__:10:Trying direct download...");
6176
6227
  }
6177
6228
  const cpu = arch2();
6178
6229
  const archName = cpu === "arm64" ? "arm64" : "amd64";
6179
6230
  const dmgUrl = `https://desktop.docker.com/mac/main/${archName}/Docker.dmg`;
6180
6231
  const dmgPath = "/tmp/Docker.dmg";
6181
6232
  this.onProgress("__progress__:5:Downloading Docker Desktop...");
6182
- const dlResult = await runWithRollingOutput("curl", [
6233
+ const dlResult = await runSilent("curl", [
6183
6234
  "-fSL",
6184
- "--progress-bar",
6185
6235
  "-o",
6186
6236
  dmgPath,
6187
6237
  dmgUrl
@@ -6202,14 +6252,10 @@ var DependencyInstaller = class {
6202
6252
  this.onProgress("__progress__:55:Running Docker installer...");
6203
6253
  const user = process.env.USER || execSync("whoami", { timeout: 5e3 }).toString().trim();
6204
6254
  try {
6205
- const installResult = await runWithRollingOutput(
6206
- "/Volumes/Docker/Docker.app/Contents/MacOS/install",
6207
- ["--accept-license", `--user=${user}`],
6208
- { timeout: 12e4 }
6209
- );
6210
- if (installResult.exitCode !== 0 && !existsSync4("/Applications/Docker.app")) {
6211
- throw new Error("Installer exited with errors");
6212
- }
6255
+ execSync(`/Volumes/Docker/Docker.app/Contents/MacOS/install --accept-license --user=${user}`, {
6256
+ timeout: 12e4,
6257
+ stdio: "ignore"
6258
+ });
6213
6259
  } catch {
6214
6260
  if (!existsSync4("/Applications/Docker.app")) {
6215
6261
  this.onProgress("__progress__:60:Trying alternative install method...");
@@ -6228,14 +6274,10 @@ var DependencyInstaller = class {
6228
6274
  await unlink(dmgPath);
6229
6275
  } catch {
6230
6276
  }
6231
- const installed = this.findDockerApp();
6232
- if (installed) {
6233
- await this.setupExistingDockerApp(installed);
6234
- } else {
6235
- this.onProgress("__progress__:70:Starting Docker Desktop...");
6236
- this.startDockerDaemon();
6237
- await this.waitForDocker();
6238
- }
6277
+ this.onProgress("__progress__:70:Starting Docker engine...");
6278
+ this.startDockerDaemon();
6279
+ this.hideDockerWindow();
6280
+ await this.waitForDocker();
6239
6281
  }
6240
6282
  /**
6241
6283
  * Install Docker Engine on Linux using Docker's official convenience script.
@@ -6423,6 +6465,7 @@ var DependencyInstaller = class {
6423
6465
  const msgIdx = Math.floor(elapsed / 1e4) % msgs.length;
6424
6466
  this.onProgress(`__progress__:${pct}:${msgs[msgIdx]}`);
6425
6467
  }
6468
+ if (os === "darwin") this.hideDockerWindow();
6426
6469
  await new Promise((r) => setTimeout(r, 3e3));
6427
6470
  }
6428
6471
  throw new Error(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/core",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
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",