@agenticmail/core 0.5.22 → 0.5.23
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 +7 -5
- package/dist/index.js +83 -111
- 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,7 +1471,8 @@ 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.
|
|
1474
1476
|
*/
|
|
1475
1477
|
private installDockerMac;
|
|
1476
1478
|
/**
|
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
|
|
5897
|
+
import { existsSync as existsSync4, readdirSync, lstatSync, readlinkSync, writeFileSync as writeFileSync3, readFileSync as readFileSync2 } 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";
|
|
@@ -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,84 @@ 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.
|
|
6355
6314
|
*/
|
|
6356
6315
|
async installDockerMac() {
|
|
6316
|
+
let installed = false;
|
|
6357
6317
|
if (hasHomebrew()) {
|
|
6358
|
-
this.onProgress("__progress__:5:Installing
|
|
6318
|
+
this.onProgress("__progress__:5:Installing Docker Desktop...");
|
|
6359
6319
|
try {
|
|
6360
6320
|
const brewResult = await runSilent(
|
|
6361
6321
|
"brew",
|
|
6362
6322
|
["install", "--cask", "docker"],
|
|
6363
6323
|
{ timeout: 6e5 }
|
|
6364
6324
|
);
|
|
6365
|
-
if (brewResult.exitCode === 0) {
|
|
6366
|
-
|
|
6367
|
-
const appPath = this.findDockerApp();
|
|
6368
|
-
if (appPath) {
|
|
6369
|
-
await this.setupExistingDockerApp(appPath);
|
|
6370
|
-
return;
|
|
6371
|
-
}
|
|
6325
|
+
if (brewResult.exitCode === 0 && this.findDockerApp()) {
|
|
6326
|
+
installed = true;
|
|
6372
6327
|
}
|
|
6373
6328
|
} catch {
|
|
6374
6329
|
}
|
|
6375
|
-
this.onProgress("__progress__:10:Trying direct download...");
|
|
6376
6330
|
}
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
"
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6331
|
+
if (!installed) {
|
|
6332
|
+
const cpu = arch2();
|
|
6333
|
+
const archName = cpu === "arm64" ? "arm64" : "amd64";
|
|
6334
|
+
const dmgUrl = `https://desktop.docker.com/mac/main/${archName}/Docker.dmg`;
|
|
6335
|
+
const dmgPath = "/tmp/Docker.dmg";
|
|
6336
|
+
this.onProgress("__progress__:5:Downloading Docker Desktop...");
|
|
6337
|
+
const dlResult = await runSilent("curl", [
|
|
6338
|
+
"-fSL",
|
|
6339
|
+
"-o",
|
|
6340
|
+
dmgPath,
|
|
6341
|
+
dmgUrl
|
|
6342
|
+
], { timeout: 6e5 });
|
|
6343
|
+
if (dlResult.exitCode !== 0) {
|
|
6344
|
+
throw new Error("Failed to download Docker Desktop. Check your internet connection and try again.");
|
|
6345
|
+
}
|
|
6346
|
+
this.onProgress("__progress__:40:Installing Docker Desktop...");
|
|
6393
6347
|
try {
|
|
6394
|
-
|
|
6348
|
+
try {
|
|
6349
|
+
execSync("hdiutil detach /Volumes/Docker 2>/dev/null", { timeout: 1e4, stdio: "ignore" });
|
|
6350
|
+
} catch {
|
|
6351
|
+
}
|
|
6352
|
+
execSync(`hdiutil attach "${dmgPath}" -nobrowse -quiet`, { timeout: 3e4, stdio: "ignore" });
|
|
6353
|
+
} catch {
|
|
6354
|
+
throw new Error("Failed to mount Docker DMG. The download may be corrupted \u2014 try again.");
|
|
6355
|
+
}
|
|
6356
|
+
if (!existsSync4("/Applications/Docker.app")) {
|
|
6357
|
+
try {
|
|
6358
|
+
execSync('cp -R "/Volumes/Docker/Docker.app" /Applications/', { timeout: 6e4, stdio: "ignore" });
|
|
6359
|
+
} catch {
|
|
6360
|
+
throw new Error("Failed to install. You may need to run this with admin privileges.");
|
|
6361
|
+
}
|
|
6362
|
+
}
|
|
6363
|
+
try {
|
|
6364
|
+
execSync("hdiutil detach /Volumes/Docker -quiet", { timeout: 15e3, stdio: "ignore" });
|
|
6395
6365
|
} catch {
|
|
6396
6366
|
}
|
|
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
6367
|
try {
|
|
6404
|
-
|
|
6368
|
+
await unlink(dmgPath);
|
|
6405
6369
|
} catch {
|
|
6406
|
-
throw new Error("Failed to install. You may need to run this with admin privileges.");
|
|
6407
6370
|
}
|
|
6408
6371
|
}
|
|
6409
6372
|
try {
|
|
6410
|
-
execSync(
|
|
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" });
|
|
6411
6378
|
} catch {
|
|
6412
6379
|
}
|
|
6413
6380
|
try {
|
|
6414
|
-
|
|
6381
|
+
execSync("pkill -f Docker.app 2>/dev/null", { timeout: 5e3, stdio: "ignore" });
|
|
6415
6382
|
} catch {
|
|
6416
6383
|
}
|
|
6417
|
-
await
|
|
6384
|
+
await new Promise((r) => setTimeout(r, 2e3));
|
|
6385
|
+
const appPath = this.findDockerApp();
|
|
6386
|
+
if (!appPath) {
|
|
6387
|
+
throw new Error("Docker Desktop was installed but could not be found. Try again.");
|
|
6388
|
+
}
|
|
6389
|
+
await this.setupExistingDockerApp(appPath);
|
|
6418
6390
|
}
|
|
6419
6391
|
/**
|
|
6420
6392
|
* Install Docker Engine on Linux using Docker's official convenience script.
|