@agenticmail/core 0.5.11 → 0.5.13
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 +9 -12
- package/dist/index.js +50 -40
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1440,19 +1440,16 @@ declare class DependencyInstaller {
|
|
|
1440
1440
|
*/
|
|
1441
1441
|
private findDockerApp;
|
|
1442
1442
|
/**
|
|
1443
|
-
*
|
|
1444
|
-
*
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
*
|
|
1449
|
-
*
|
|
1450
|
-
*
|
|
1451
|
-
* We try multiple approaches:
|
|
1452
|
-
* 1. Write to the system-level path (may fail without sudo — that's OK)
|
|
1453
|
-
* 2. Write to the user-level Docker settings (Group Containers)
|
|
1443
|
+
* Check if Docker Desktop license has already been accepted.
|
|
1444
|
+
* Returns true if we're confident the user has accepted before.
|
|
1445
|
+
*/
|
|
1446
|
+
private isDockerLicenseAccepted;
|
|
1447
|
+
/**
|
|
1448
|
+
* Configure Docker Desktop to run headless after first-time setup.
|
|
1449
|
+
* Call this AFTER Docker has been started and license accepted.
|
|
1450
|
+
* Suppresses UI, dock icon, tips, analytics, and auto-updates.
|
|
1454
1451
|
*/
|
|
1455
|
-
private
|
|
1452
|
+
private configureDockerHeadless;
|
|
1456
1453
|
/**
|
|
1457
1454
|
* Docker.app exists but CLI isn't available or daemon isn't running.
|
|
1458
1455
|
* Runs the built-in installer silently (--accept-license to link CLI tools),
|
package/dist/index.js
CHANGED
|
@@ -6150,42 +6150,38 @@ var DependencyInstaller = class {
|
|
|
6150
6150
|
return null;
|
|
6151
6151
|
}
|
|
6152
6152
|
/**
|
|
6153
|
-
*
|
|
6154
|
-
*
|
|
6155
|
-
* appearing and blocking automated setup.
|
|
6156
|
-
*
|
|
6157
|
-
* Docker Desktop checks /Library/Application Support/com.docker.docker/install-settings.json
|
|
6158
|
-
* (system-level, requires sudo) for {"acceptLicense": true}. The --accept-license
|
|
6159
|
-
* flag on the installer binary tries to write this but fails without sudo.
|
|
6160
|
-
*
|
|
6161
|
-
* We try multiple approaches:
|
|
6162
|
-
* 1. Write to the system-level path (may fail without sudo — that's OK)
|
|
6163
|
-
* 2. Write to the user-level Docker settings (Group Containers)
|
|
6153
|
+
* Check if Docker Desktop license has already been accepted.
|
|
6154
|
+
* Returns true if we're confident the user has accepted before.
|
|
6164
6155
|
*/
|
|
6165
|
-
|
|
6166
|
-
const systemDir = "/Library/Application Support/com.docker.docker";
|
|
6167
|
-
const systemFile = join6(systemDir, "install-settings.json");
|
|
6168
|
-
const licenseJson = JSON.stringify({ acceptLicense: true });
|
|
6156
|
+
isDockerLicenseAccepted() {
|
|
6169
6157
|
try {
|
|
6170
|
-
|
|
6171
|
-
|
|
6158
|
+
const systemFile = "/Library/Application Support/com.docker.docker/install-settings.json";
|
|
6159
|
+
if (existsSync4(systemFile)) {
|
|
6160
|
+
const raw = readFileSync2(systemFile, "utf-8");
|
|
6161
|
+
const data = JSON.parse(raw);
|
|
6162
|
+
if (data.acceptLicense) return true;
|
|
6172
6163
|
}
|
|
6173
|
-
writeFileSync3(systemFile, licenseJson, { mode: 420 });
|
|
6174
6164
|
} catch {
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
});
|
|
6181
|
-
} catch {
|
|
6165
|
+
}
|
|
6166
|
+
try {
|
|
6167
|
+
const settingsFile = join6(process.env.HOME || "", "Library/Group Containers/group.com.docker/settings-store.json");
|
|
6168
|
+
if (existsSync4(settingsFile)) {
|
|
6169
|
+
return true;
|
|
6182
6170
|
}
|
|
6171
|
+
} catch {
|
|
6183
6172
|
}
|
|
6173
|
+
return false;
|
|
6174
|
+
}
|
|
6175
|
+
/**
|
|
6176
|
+
* Configure Docker Desktop to run headless after first-time setup.
|
|
6177
|
+
* Call this AFTER Docker has been started and license accepted.
|
|
6178
|
+
* Suppresses UI, dock icon, tips, analytics, and auto-updates.
|
|
6179
|
+
*/
|
|
6180
|
+
configureDockerHeadless() {
|
|
6184
6181
|
try {
|
|
6185
6182
|
const userDockerDir = join6(process.env.HOME || "", "Library/Group Containers/group.com.docker");
|
|
6186
6183
|
const settingsFile = join6(userDockerDir, "settings-store.json");
|
|
6187
6184
|
const headlessDefaults = {
|
|
6188
|
-
AcceptedLicense: true,
|
|
6189
6185
|
AutoStart: false,
|
|
6190
6186
|
// Don't auto-start on login (we start it ourselves)
|
|
6191
6187
|
OpenUIOnStartupDisabled: true,
|
|
@@ -6226,9 +6222,9 @@ var DependencyInstaller = class {
|
|
|
6226
6222
|
*/
|
|
6227
6223
|
async setupExistingDockerApp(appPath) {
|
|
6228
6224
|
const installBin = join6(appPath, "Contents", "MacOS", "install");
|
|
6229
|
-
this.
|
|
6225
|
+
const isFirstLaunch = !this.isDockerLicenseAccepted();
|
|
6230
6226
|
if (existsSync4(installBin)) {
|
|
6231
|
-
this.onProgress("__progress__:30:Setting up
|
|
6227
|
+
this.onProgress("__progress__:30:Setting up CLI tools...");
|
|
6232
6228
|
const user = process.env.USER || execSync("whoami", { timeout: 5e3 }).toString().trim();
|
|
6233
6229
|
try {
|
|
6234
6230
|
execSync(`"${installBin}" --accept-license --user=${user}`, {
|
|
@@ -6238,10 +6234,21 @@ var DependencyInstaller = class {
|
|
|
6238
6234
|
} catch {
|
|
6239
6235
|
}
|
|
6240
6236
|
}
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6237
|
+
if (isFirstLaunch) {
|
|
6238
|
+
this.onProgress("__progress__:50:Opening Docker \u2014 please accept the license agreement...");
|
|
6239
|
+
try {
|
|
6240
|
+
execFileSync2("open", ["-a", appPath], { timeout: 1e4, stdio: "ignore" });
|
|
6241
|
+
} catch {
|
|
6242
|
+
}
|
|
6243
|
+
await this.waitForDocker();
|
|
6244
|
+
this.configureDockerHeadless();
|
|
6245
|
+
this.hideDockerWindow();
|
|
6246
|
+
} else {
|
|
6247
|
+
this.onProgress("__progress__:50:Starting engine...");
|
|
6248
|
+
this.startDockerDaemon();
|
|
6249
|
+
this.hideDockerWindow();
|
|
6250
|
+
await this.waitForDocker();
|
|
6251
|
+
}
|
|
6245
6252
|
}
|
|
6246
6253
|
/**
|
|
6247
6254
|
* Hide Docker Desktop completely — close all windows, hide from dock, make invisible.
|
|
@@ -6339,8 +6346,7 @@ var DependencyInstaller = class {
|
|
|
6339
6346
|
} catch {
|
|
6340
6347
|
throw new Error("Failed to mount Docker DMG. The download may be corrupted \u2014 try again.");
|
|
6341
6348
|
}
|
|
6342
|
-
this.
|
|
6343
|
-
this.onProgress("__progress__:55:Running Docker installer...");
|
|
6349
|
+
this.onProgress("__progress__:55:Running installer...");
|
|
6344
6350
|
const user = process.env.USER || execSync("whoami", { timeout: 5e3 }).toString().trim();
|
|
6345
6351
|
try {
|
|
6346
6352
|
execSync(`/Volumes/Docker/Docker.app/Contents/MacOS/install --accept-license --user=${user}`, {
|
|
@@ -6353,7 +6359,7 @@ var DependencyInstaller = class {
|
|
|
6353
6359
|
try {
|
|
6354
6360
|
execSync('cp -R "/Volumes/Docker/Docker.app" /Applications/', { timeout: 6e4, stdio: "ignore" });
|
|
6355
6361
|
} catch {
|
|
6356
|
-
throw new Error("Failed to install
|
|
6362
|
+
throw new Error("Failed to install. You may need to run this with admin privileges.");
|
|
6357
6363
|
}
|
|
6358
6364
|
}
|
|
6359
6365
|
}
|
|
@@ -6365,10 +6371,14 @@ var DependencyInstaller = class {
|
|
|
6365
6371
|
await unlink(dmgPath);
|
|
6366
6372
|
} catch {
|
|
6367
6373
|
}
|
|
6368
|
-
this.onProgress("__progress__:70:
|
|
6369
|
-
|
|
6370
|
-
|
|
6374
|
+
this.onProgress("__progress__:70:Opening Docker \u2014 please accept the license agreement...");
|
|
6375
|
+
try {
|
|
6376
|
+
execFileSync2("open", ["-a", "/Applications/Docker.app"], { timeout: 1e4, stdio: "ignore" });
|
|
6377
|
+
} catch {
|
|
6378
|
+
}
|
|
6371
6379
|
await this.waitForDocker();
|
|
6380
|
+
this.configureDockerHeadless();
|
|
6381
|
+
this.hideDockerWindow();
|
|
6372
6382
|
}
|
|
6373
6383
|
/**
|
|
6374
6384
|
* Install Docker Engine on Linux using Docker's official convenience script.
|
|
@@ -6556,11 +6566,11 @@ var DependencyInstaller = class {
|
|
|
6556
6566
|
const msgIdx = Math.floor(elapsed / 1e4) % msgs.length;
|
|
6557
6567
|
this.onProgress(`__progress__:${pct}:${msgs[msgIdx]}`);
|
|
6558
6568
|
}
|
|
6559
|
-
if (os === "darwin") this.hideDockerWindow();
|
|
6569
|
+
if (os === "darwin" && this.isDockerLicenseAccepted()) this.hideDockerWindow();
|
|
6560
6570
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
6561
6571
|
}
|
|
6562
6572
|
throw new Error(
|
|
6563
|
-
"
|
|
6573
|
+
"Engine could not be started after trying all available methods. If this is your first time, open Docker from your Applications folder, accept the license agreement, then run this command again."
|
|
6564
6574
|
);
|
|
6565
6575
|
}
|
|
6566
6576
|
/**
|