@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 +10 -3
- package/dist/index.js +82 -39
- package/package.json +1 -1
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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__:
|
|
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
|
-
|
|
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__:
|
|
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
|
|
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
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
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:
|
|
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
|
|
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
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
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
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
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(
|