@agenticmail/core 0.3.1 → 0.3.2
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 +8 -1
- package/dist/index.js +36 -33
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1271,7 +1271,14 @@ declare class DependencyInstaller {
|
|
|
1271
1271
|
*/
|
|
1272
1272
|
installDocker(): Promise<void>;
|
|
1273
1273
|
/**
|
|
1274
|
-
*
|
|
1274
|
+
* Attempt to start the Docker daemon.
|
|
1275
|
+
* On macOS: opens Docker Desktop app.
|
|
1276
|
+
* On Linux: tries systemctl.
|
|
1277
|
+
*/
|
|
1278
|
+
private startDockerDaemon;
|
|
1279
|
+
/**
|
|
1280
|
+
* Wait for Docker daemon to be ready (up to 3 minutes).
|
|
1281
|
+
* Docker Desktop can take 1-2+ minutes on first launch.
|
|
1275
1282
|
*/
|
|
1276
1283
|
private waitForDocker;
|
|
1277
1284
|
/**
|
package/dist/index.js
CHANGED
|
@@ -5453,19 +5453,8 @@ var DependencyInstaller = class {
|
|
|
5453
5453
|
execSync2("docker info", { timeout: 1e4, stdio: "ignore" });
|
|
5454
5454
|
return;
|
|
5455
5455
|
} catch {
|
|
5456
|
-
this.onProgress("
|
|
5457
|
-
|
|
5458
|
-
if (os2 === "darwin") {
|
|
5459
|
-
try {
|
|
5460
|
-
execSync2("open -a Docker", { timeout: 1e4, stdio: "ignore" });
|
|
5461
|
-
} catch {
|
|
5462
|
-
}
|
|
5463
|
-
} else if (os2 === "linux") {
|
|
5464
|
-
try {
|
|
5465
|
-
execSync2("sudo systemctl start docker", { timeout: 15e3, stdio: "ignore" });
|
|
5466
|
-
} catch {
|
|
5467
|
-
}
|
|
5468
|
-
}
|
|
5456
|
+
this.onProgress("Docker found but not running \u2014 starting it now...");
|
|
5457
|
+
this.startDockerDaemon();
|
|
5469
5458
|
await this.waitForDocker();
|
|
5470
5459
|
return;
|
|
5471
5460
|
}
|
|
@@ -5480,10 +5469,7 @@ var DependencyInstaller = class {
|
|
|
5480
5469
|
}
|
|
5481
5470
|
execSync2("brew install --cask docker", { timeout: 3e5, stdio: "inherit" });
|
|
5482
5471
|
this.onProgress("Docker installed. Starting Docker Desktop...");
|
|
5483
|
-
|
|
5484
|
-
execSync2("open -a Docker", { timeout: 1e4, stdio: "ignore" });
|
|
5485
|
-
} catch {
|
|
5486
|
-
}
|
|
5472
|
+
this.startDockerDaemon();
|
|
5487
5473
|
await this.waitForDocker();
|
|
5488
5474
|
} else if (os === "linux") {
|
|
5489
5475
|
this.onProgress("Installing Docker...");
|
|
@@ -5498,21 +5484,49 @@ var DependencyInstaller = class {
|
|
|
5498
5484
|
}
|
|
5499
5485
|
}
|
|
5500
5486
|
/**
|
|
5501
|
-
*
|
|
5487
|
+
* Attempt to start the Docker daemon.
|
|
5488
|
+
* On macOS: opens Docker Desktop app.
|
|
5489
|
+
* On Linux: tries systemctl.
|
|
5490
|
+
*/
|
|
5491
|
+
startDockerDaemon() {
|
|
5492
|
+
const os = platform2();
|
|
5493
|
+
if (os === "darwin") {
|
|
5494
|
+
try {
|
|
5495
|
+
execSync2("open -a Docker", { timeout: 1e4, stdio: "ignore" });
|
|
5496
|
+
} catch {
|
|
5497
|
+
}
|
|
5498
|
+
} else if (os === "linux") {
|
|
5499
|
+
try {
|
|
5500
|
+
execSync2("sudo systemctl start docker", { timeout: 15e3, stdio: "ignore" });
|
|
5501
|
+
} catch {
|
|
5502
|
+
}
|
|
5503
|
+
}
|
|
5504
|
+
}
|
|
5505
|
+
/**
|
|
5506
|
+
* Wait for Docker daemon to be ready (up to 3 minutes).
|
|
5507
|
+
* Docker Desktop can take 1-2+ minutes on first launch.
|
|
5502
5508
|
*/
|
|
5503
5509
|
async waitForDocker() {
|
|
5504
|
-
this.onProgress("Waiting for Docker to
|
|
5505
|
-
const maxWait =
|
|
5510
|
+
this.onProgress("Waiting for Docker to start (this can take a minute)...");
|
|
5511
|
+
const maxWait = 18e4;
|
|
5506
5512
|
const start = Date.now();
|
|
5513
|
+
let attempts = 0;
|
|
5507
5514
|
while (Date.now() - start < maxWait) {
|
|
5508
5515
|
try {
|
|
5509
5516
|
execSync2("docker info", { timeout: 5e3, stdio: "ignore" });
|
|
5510
5517
|
return;
|
|
5511
5518
|
} catch {
|
|
5512
5519
|
}
|
|
5520
|
+
attempts++;
|
|
5521
|
+
if (attempts % 5 === 0) {
|
|
5522
|
+
const elapsed = Math.round((Date.now() - start) / 1e3);
|
|
5523
|
+
this.onProgress(`Still waiting for Docker to start (${elapsed}s)...`);
|
|
5524
|
+
}
|
|
5513
5525
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
5514
5526
|
}
|
|
5515
|
-
throw new Error(
|
|
5527
|
+
throw new Error(
|
|
5528
|
+
"Docker daemon did not start in time. Open Docker Desktop manually, wait for it to finish loading, then run this again."
|
|
5529
|
+
);
|
|
5516
5530
|
}
|
|
5517
5531
|
/**
|
|
5518
5532
|
* Start the Stalwart mail server Docker container.
|
|
@@ -5525,18 +5539,7 @@ var DependencyInstaller = class {
|
|
|
5525
5539
|
execSync2("docker info", { timeout: 1e4, stdio: "ignore" });
|
|
5526
5540
|
} catch {
|
|
5527
5541
|
this.onProgress("Starting Docker...");
|
|
5528
|
-
|
|
5529
|
-
if (os === "darwin") {
|
|
5530
|
-
try {
|
|
5531
|
-
execSync2("open -a Docker", { timeout: 1e4, stdio: "ignore" });
|
|
5532
|
-
} catch {
|
|
5533
|
-
}
|
|
5534
|
-
} else if (os === "linux") {
|
|
5535
|
-
try {
|
|
5536
|
-
execSync2("sudo systemctl start docker", { timeout: 15e3, stdio: "ignore" });
|
|
5537
|
-
} catch {
|
|
5538
|
-
}
|
|
5539
|
-
}
|
|
5542
|
+
this.startDockerDaemon();
|
|
5540
5543
|
await this.waitForDocker();
|
|
5541
5544
|
}
|
|
5542
5545
|
this.onProgress("Starting Stalwart mail server...");
|