@agenticmail/core 0.5.22 → 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 +18 -5
- package/dist/index.js +133 -115
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1456,12 +1456,13 @@ declare class DependencyInstaller {
|
|
|
1456
1456
|
* Runs the built-in installer silently (--accept-license to link CLI tools),
|
|
1457
1457
|
* then starts Docker Desktop hidden (no GUI window).
|
|
1458
1458
|
*/
|
|
1459
|
-
private setupExistingDockerApp;
|
|
1460
1459
|
/**
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1460
|
+
* Docker.app exists but daemon isn't running.
|
|
1461
|
+
* Simple approach: if Docker was already running, great. If not, just
|
|
1462
|
+
* tell the user to open Docker and accept the terms themselves.
|
|
1463
|
+
* No GUI manipulation, no programmatic license tricks — just wait.
|
|
1463
1464
|
*/
|
|
1464
|
-
private
|
|
1465
|
+
private setupExistingDockerApp;
|
|
1465
1466
|
/**
|
|
1466
1467
|
* Hide Docker Desktop completely — close all windows, hide from dock, make invisible.
|
|
1467
1468
|
* Called after starting Docker to ensure the user never sees any Docker UI.
|
|
@@ -1470,8 +1471,20 @@ declare class DependencyInstaller {
|
|
|
1470
1471
|
/**
|
|
1471
1472
|
* Full Docker Desktop install on macOS.
|
|
1472
1473
|
* Tries Homebrew first (cleaner), falls back to DMG download.
|
|
1473
|
-
*
|
|
1474
|
+
* After install, tells the user to open Docker and accept the terms.
|
|
1475
|
+
* No GUI manipulation — the user handles Docker themselves.
|
|
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).
|
|
1474
1486
|
*/
|
|
1487
|
+
private linkDockerCli;
|
|
1475
1488
|
private installDockerMac;
|
|
1476
1489
|
/**
|
|
1477
1490
|
* Install Docker Engine on Linux using Docker's official convenience script.
|
package/dist/index.js
CHANGED
|
@@ -6221,86 +6221,44 @@ var DependencyInstaller = class {
|
|
|
6221
6221
|
* Runs the built-in installer silently (--accept-license to link CLI tools),
|
|
6222
6222
|
* then starts Docker Desktop hidden (no GUI window).
|
|
6223
6223
|
*/
|
|
6224
|
-
|
|
6224
|
+
/**
|
|
6225
|
+
* Docker.app exists but daemon isn't running.
|
|
6226
|
+
* Simple approach: if Docker was already running, great. If not, just
|
|
6227
|
+
* tell the user to open Docker and accept the terms themselves.
|
|
6228
|
+
* No GUI manipulation, no programmatic license tricks — just wait.
|
|
6229
|
+
*/
|
|
6230
|
+
async setupExistingDockerApp(_appPath) {
|
|
6225
6231
|
if (this.isDockerReady()) {
|
|
6226
6232
|
this.onProgress("__progress__:100:Engine is ready!");
|
|
6227
|
-
this.hideDockerWindow();
|
|
6228
|
-
this.configureDockerHeadless();
|
|
6229
6233
|
return;
|
|
6230
6234
|
}
|
|
6231
|
-
this.
|
|
6232
|
-
const
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
const user = process.env.USER || execSync("whoami", { timeout: 5e3 }).toString().trim();
|
|
6235
|
+
this.onProgress("Open Docker Desktop and accept the license agreement, then we'll continue automatically...");
|
|
6236
|
+
const totalTime = 6e5;
|
|
6237
|
+
const start = Date.now();
|
|
6238
|
+
while (Date.now() - start < totalTime) {
|
|
6236
6239
|
try {
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6240
|
+
execFileSync2("docker", ["info"], { timeout: 5e3, stdio: "ignore" });
|
|
6241
|
+
this.onProgress("__progress__:100:Engine is ready!");
|
|
6242
|
+
this.configureDockerHeadless();
|
|
6243
|
+
this.hideDockerWindow();
|
|
6244
|
+
return;
|
|
6241
6245
|
} catch {
|
|
6242
6246
|
}
|
|
6247
|
+
const elapsed = Date.now() - start;
|
|
6248
|
+
const pct = Math.min(95, Math.round(elapsed / totalTime * 100));
|
|
6249
|
+
const msgs = [
|
|
6250
|
+
"Open Docker Desktop and accept the license to continue...",
|
|
6251
|
+
"Waiting for Docker to be ready...",
|
|
6252
|
+
"Accept the terms in Docker Desktop to continue...",
|
|
6253
|
+
"Still waiting for Docker..."
|
|
6254
|
+
];
|
|
6255
|
+
const msgIdx = Math.floor(elapsed / 8e3) % msgs.length;
|
|
6256
|
+
this.onProgress(`__progress__:${pct}:${msgs[msgIdx]}`);
|
|
6257
|
+
await new Promise((r) => setTimeout(r, 3e3));
|
|
6243
6258
|
}
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
}
|
|
6248
|
-
try {
|
|
6249
|
-
execSync(`osascript -e 'quit app "Docker"' 2>/dev/null`, { timeout: 5e3, stdio: "ignore" });
|
|
6250
|
-
} catch {
|
|
6251
|
-
}
|
|
6252
|
-
try {
|
|
6253
|
-
execSync("pkill -f Docker.app 2>/dev/null", { timeout: 5e3, stdio: "ignore" });
|
|
6254
|
-
} catch {
|
|
6255
|
-
}
|
|
6256
|
-
await new Promise((r) => setTimeout(r, 2e3));
|
|
6257
|
-
this.configureDockerHeadless();
|
|
6258
|
-
this.onProgress("__progress__:50:Starting engine...");
|
|
6259
|
-
this.startDockerDaemon();
|
|
6260
|
-
await this.waitForDocker();
|
|
6261
|
-
this.hideDockerWindow();
|
|
6262
|
-
}
|
|
6263
|
-
/**
|
|
6264
|
-
* Accept Docker Desktop license by writing acceptance files directly to disk.
|
|
6265
|
-
* This bypasses the GUI terms dialog entirely.
|
|
6266
|
-
*/
|
|
6267
|
-
acceptLicenseProgrammatically() {
|
|
6268
|
-
try {
|
|
6269
|
-
const sysDir = "/Library/Application Support/com.docker.docker";
|
|
6270
|
-
if (!existsSync4(sysDir)) {
|
|
6271
|
-
try {
|
|
6272
|
-
mkdirSync3(sysDir, { recursive: true });
|
|
6273
|
-
} catch {
|
|
6274
|
-
}
|
|
6275
|
-
}
|
|
6276
|
-
if (existsSync4(sysDir)) {
|
|
6277
|
-
writeFileSync3(join6(sysDir, "install-settings.json"), JSON.stringify({ acceptLicense: true }));
|
|
6278
|
-
}
|
|
6279
|
-
} catch {
|
|
6280
|
-
}
|
|
6281
|
-
try {
|
|
6282
|
-
const userDir = join6(process.env.HOME || homedir5(), "Library/Group Containers/group.com.docker");
|
|
6283
|
-
if (!existsSync4(userDir)) {
|
|
6284
|
-
mkdirSync3(userDir, { recursive: true });
|
|
6285
|
-
}
|
|
6286
|
-
const settingsFile = join6(userDir, "settings-store.json");
|
|
6287
|
-
const settings = {};
|
|
6288
|
-
if (existsSync4(settingsFile)) {
|
|
6289
|
-
try {
|
|
6290
|
-
Object.assign(settings, JSON.parse(readFileSync2(settingsFile, "utf-8")));
|
|
6291
|
-
} catch {
|
|
6292
|
-
}
|
|
6293
|
-
}
|
|
6294
|
-
Object.assign(settings, {
|
|
6295
|
-
AutoStart: false,
|
|
6296
|
-
OpenUIOnStartupDisabled: true,
|
|
6297
|
-
TipShown: true,
|
|
6298
|
-
SUAutomaticallyUpdate: false,
|
|
6299
|
-
AnalyticsEnabled: false
|
|
6300
|
-
});
|
|
6301
|
-
writeFileSync3(settingsFile, JSON.stringify(settings, null, 2));
|
|
6302
|
-
} catch {
|
|
6303
|
-
}
|
|
6259
|
+
throw new Error(
|
|
6260
|
+
"Docker did not start. Open Docker Desktop from your Applications folder, accept the license agreement, then run this command again."
|
|
6261
|
+
);
|
|
6304
6262
|
}
|
|
6305
6263
|
/**
|
|
6306
6264
|
* Hide Docker Desktop completely — close all windows, hide from dock, make invisible.
|
|
@@ -6351,70 +6309,130 @@ var DependencyInstaller = class {
|
|
|
6351
6309
|
/**
|
|
6352
6310
|
* Full Docker Desktop install on macOS.
|
|
6353
6311
|
* Tries Homebrew first (cleaner), falls back to DMG download.
|
|
6354
|
-
*
|
|
6312
|
+
* After install, tells the user to open Docker and accept the terms.
|
|
6313
|
+
* No GUI manipulation — the user handles Docker themselves.
|
|
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).
|
|
6355
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
|
+
}
|
|
6356
6371
|
async installDockerMac() {
|
|
6372
|
+
let installed = false;
|
|
6373
|
+
this.fixLocalDirPermissions();
|
|
6357
6374
|
if (hasHomebrew()) {
|
|
6358
|
-
this.onProgress("__progress__:5:Installing
|
|
6375
|
+
this.onProgress("__progress__:5:Installing Docker Desktop...");
|
|
6359
6376
|
try {
|
|
6360
6377
|
const brewResult = await runSilent(
|
|
6361
6378
|
"brew",
|
|
6362
6379
|
["install", "--cask", "docker"],
|
|
6363
6380
|
{ timeout: 6e5 }
|
|
6364
6381
|
);
|
|
6365
|
-
if (brewResult.exitCode === 0) {
|
|
6366
|
-
|
|
6367
|
-
const appPath = this.findDockerApp();
|
|
6368
|
-
if (appPath) {
|
|
6369
|
-
await this.setupExistingDockerApp(appPath);
|
|
6370
|
-
return;
|
|
6371
|
-
}
|
|
6382
|
+
if (brewResult.exitCode === 0 && this.findDockerApp()) {
|
|
6383
|
+
installed = true;
|
|
6372
6384
|
}
|
|
6373
6385
|
} catch {
|
|
6374
6386
|
}
|
|
6375
|
-
this.onProgress("__progress__:10:Trying direct download...");
|
|
6376
|
-
}
|
|
6377
|
-
const cpu = arch2();
|
|
6378
|
-
const archName = cpu === "arm64" ? "arm64" : "amd64";
|
|
6379
|
-
const dmgUrl = `https://desktop.docker.com/mac/main/${archName}/Docker.dmg`;
|
|
6380
|
-
const dmgPath = "/tmp/Docker.dmg";
|
|
6381
|
-
this.onProgress("__progress__:5:Downloading mail server engine...");
|
|
6382
|
-
const dlResult = await runSilent("curl", [
|
|
6383
|
-
"-fSL",
|
|
6384
|
-
"-o",
|
|
6385
|
-
dmgPath,
|
|
6386
|
-
dmgUrl
|
|
6387
|
-
], { timeout: 6e5 });
|
|
6388
|
-
if (dlResult.exitCode !== 0) {
|
|
6389
|
-
throw new Error("Failed to download Docker Desktop. Check your internet connection and try again.");
|
|
6390
6387
|
}
|
|
6391
|
-
|
|
6392
|
-
|
|
6388
|
+
if (!installed) {
|
|
6389
|
+
const cpu = arch2();
|
|
6390
|
+
const archName = cpu === "arm64" ? "arm64" : "amd64";
|
|
6391
|
+
const dmgUrl = `https://desktop.docker.com/mac/main/${archName}/Docker.dmg`;
|
|
6392
|
+
const dmgPath = "/tmp/Docker.dmg";
|
|
6393
|
+
this.onProgress("__progress__:5:Downloading Docker Desktop...");
|
|
6394
|
+
const dlResult = await runSilent("curl", [
|
|
6395
|
+
"-fSL",
|
|
6396
|
+
"-o",
|
|
6397
|
+
dmgPath,
|
|
6398
|
+
dmgUrl
|
|
6399
|
+
], { timeout: 6e5 });
|
|
6400
|
+
if (dlResult.exitCode !== 0) {
|
|
6401
|
+
throw new Error("Failed to download Docker Desktop. Check your internet connection and try again.");
|
|
6402
|
+
}
|
|
6403
|
+
this.onProgress("__progress__:40:Installing Docker Desktop...");
|
|
6393
6404
|
try {
|
|
6394
|
-
|
|
6405
|
+
try {
|
|
6406
|
+
execSync("hdiutil detach /Volumes/Docker 2>/dev/null", { timeout: 1e4, stdio: "ignore" });
|
|
6407
|
+
} catch {
|
|
6408
|
+
}
|
|
6409
|
+
execSync(`hdiutil attach "${dmgPath}" -nobrowse -quiet`, { timeout: 3e4, stdio: "ignore" });
|
|
6395
6410
|
} catch {
|
|
6411
|
+
throw new Error("Failed to mount Docker DMG. The download may be corrupted \u2014 try again.");
|
|
6412
|
+
}
|
|
6413
|
+
if (!existsSync4("/Applications/Docker.app")) {
|
|
6414
|
+
try {
|
|
6415
|
+
execSync('cp -R "/Volumes/Docker/Docker.app" /Applications/', { timeout: 6e4, stdio: "ignore" });
|
|
6416
|
+
} catch {
|
|
6417
|
+
throw new Error("Failed to install. You may need to run this with admin privileges.");
|
|
6418
|
+
}
|
|
6396
6419
|
}
|
|
6397
|
-
execSync(`hdiutil attach "${dmgPath}" -nobrowse -quiet`, { timeout: 3e4, stdio: "ignore" });
|
|
6398
|
-
} catch {
|
|
6399
|
-
throw new Error("Failed to mount Docker DMG. The download may be corrupted \u2014 try again.");
|
|
6400
|
-
}
|
|
6401
|
-
this.onProgress("__progress__:55:Installing...");
|
|
6402
|
-
if (!existsSync4("/Applications/Docker.app")) {
|
|
6403
6420
|
try {
|
|
6404
|
-
execSync(
|
|
6421
|
+
execSync("hdiutil detach /Volumes/Docker -quiet", { timeout: 15e3, stdio: "ignore" });
|
|
6405
6422
|
} catch {
|
|
6406
|
-
throw new Error("Failed to install. You may need to run this with admin privileges.");
|
|
6407
6423
|
}
|
|
6424
|
+
try {
|
|
6425
|
+
await unlink(dmgPath);
|
|
6426
|
+
} catch {
|
|
6427
|
+
}
|
|
6428
|
+
const appPath2 = this.findDockerApp();
|
|
6429
|
+
if (appPath2) this.linkDockerCli(appPath2);
|
|
6408
6430
|
}
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
}
|
|
6413
|
-
try {
|
|
6414
|
-
await unlink(dmgPath);
|
|
6415
|
-
} catch {
|
|
6431
|
+
const appPath = this.findDockerApp();
|
|
6432
|
+
if (!appPath) {
|
|
6433
|
+
throw new Error("Docker Desktop was installed but could not be found. Try again.");
|
|
6416
6434
|
}
|
|
6417
|
-
await this.setupExistingDockerApp(
|
|
6435
|
+
await this.setupExistingDockerApp(appPath);
|
|
6418
6436
|
}
|
|
6419
6437
|
/**
|
|
6420
6438
|
* Install Docker Engine on Linux using Docker's official convenience script.
|