@agenticmail/core 0.5.14 → 0.5.16
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.js +63 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6223,7 +6223,6 @@ var DependencyInstaller = class {
|
|
|
6223
6223
|
*/
|
|
6224
6224
|
async setupExistingDockerApp(appPath) {
|
|
6225
6225
|
const installBin = join6(appPath, "Contents", "MacOS", "install");
|
|
6226
|
-
const isFirstLaunch = !this.isDockerLicenseAccepted();
|
|
6227
6226
|
if (existsSync4(installBin)) {
|
|
6228
6227
|
this.onProgress("__progress__:30:Setting up CLI tools...");
|
|
6229
6228
|
const user = process.env.USER || execSync("whoami", { timeout: 5e3 }).toString().trim();
|
|
@@ -6235,23 +6234,39 @@ var DependencyInstaller = class {
|
|
|
6235
6234
|
} catch {
|
|
6236
6235
|
}
|
|
6237
6236
|
}
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6237
|
+
this.onProgress("__progress__:50:Starting engine...");
|
|
6238
|
+
this.startDockerDaemon();
|
|
6239
|
+
let dockerReady = false;
|
|
6240
|
+
for (let i = 0; i < 5; i++) {
|
|
6241
|
+
await new Promise((r) => setTimeout(r, 3e3));
|
|
6241
6242
|
try {
|
|
6242
|
-
execFileSync2("
|
|
6243
|
+
execFileSync2("docker", ["info"], { timeout: 5e3, stdio: "ignore" });
|
|
6244
|
+
dockerReady = true;
|
|
6245
|
+
break;
|
|
6243
6246
|
} catch {
|
|
6244
6247
|
}
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
this.
|
|
6248
|
-
this.hideDockerWindow();
|
|
6249
|
-
} else {
|
|
6250
|
-
this.onProgress("__progress__:50:Starting engine...");
|
|
6251
|
-
this.startDockerDaemon();
|
|
6248
|
+
}
|
|
6249
|
+
if (dockerReady) {
|
|
6250
|
+
this.onProgress("__progress__:100:Engine is ready!");
|
|
6252
6251
|
this.hideDockerWindow();
|
|
6253
|
-
|
|
6252
|
+
this.configureDockerHeadless();
|
|
6253
|
+
return;
|
|
6254
|
+
}
|
|
6255
|
+
try {
|
|
6256
|
+
execSync(`osascript -e 'quit app "Docker"'`, { timeout: 5e3, stdio: "ignore" });
|
|
6257
|
+
} catch {
|
|
6254
6258
|
}
|
|
6259
|
+
await new Promise((r) => setTimeout(r, 2e3));
|
|
6260
|
+
this._firstLaunchMode = true;
|
|
6261
|
+
this.onProgress("__progress__:50:Please accept the Docker license agreement...");
|
|
6262
|
+
try {
|
|
6263
|
+
execFileSync2("open", ["-a", appPath], { timeout: 1e4, stdio: "ignore" });
|
|
6264
|
+
} catch {
|
|
6265
|
+
}
|
|
6266
|
+
await this.waitForDocker();
|
|
6267
|
+
this._firstLaunchMode = false;
|
|
6268
|
+
this.configureDockerHeadless();
|
|
6269
|
+
this.hideDockerWindow();
|
|
6255
6270
|
}
|
|
6256
6271
|
/**
|
|
6257
6272
|
* Hide Docker Desktop completely — close all windows, hide from dock, make invisible.
|
|
@@ -6544,34 +6559,45 @@ var DependencyInstaller = class {
|
|
|
6544
6559
|
}
|
|
6545
6560
|
const elapsed = Date.now() - start;
|
|
6546
6561
|
const pct = Math.min(95, Math.round(elapsed / totalTime * 100));
|
|
6547
|
-
|
|
6548
|
-
if (currentStrategyElapsed >= perStrategyTime && strategyIdx < strategies.length - 1) {
|
|
6549
|
-
strategyIdx++;
|
|
6550
|
-
const strategy = strategies[strategyIdx];
|
|
6551
|
-
const msgs = {
|
|
6552
|
-
cli: "Checking engine...",
|
|
6553
|
-
reopen: "Restarting engine...",
|
|
6554
|
-
background: "Trying direct launch...",
|
|
6555
|
-
install: "Re-running installer...",
|
|
6556
|
-
service: "Trying service command...",
|
|
6557
|
-
snap: "Trying snap..."
|
|
6558
|
-
};
|
|
6559
|
-
this.onProgress(`__progress__:${pct}:${msgs[strategy] || "Trying another approach..."}`);
|
|
6560
|
-
this.startDockerDaemon(strategy);
|
|
6561
|
-
} else {
|
|
6562
|
+
if (this._firstLaunchMode) {
|
|
6562
6563
|
const msgs = [
|
|
6563
|
-
"
|
|
6564
|
-
"Waiting for
|
|
6565
|
-
"
|
|
6566
|
-
"
|
|
6567
|
-
"Still starting up...",
|
|
6568
|
-
"First launch takes a bit longer...",
|
|
6569
|
-
"Hang tight..."
|
|
6564
|
+
"Please accept the license agreement in the Docker window...",
|
|
6565
|
+
"Waiting for you to accept the terms...",
|
|
6566
|
+
"Accept the agreement to continue...",
|
|
6567
|
+
"Still waiting..."
|
|
6570
6568
|
];
|
|
6571
|
-
const msgIdx = Math.floor(elapsed /
|
|
6569
|
+
const msgIdx = Math.floor(elapsed / 8e3) % msgs.length;
|
|
6572
6570
|
this.onProgress(`__progress__:${pct}:${msgs[msgIdx]}`);
|
|
6571
|
+
} else {
|
|
6572
|
+
const currentStrategyElapsed = elapsed - strategyIdx * perStrategyTime;
|
|
6573
|
+
if (currentStrategyElapsed >= perStrategyTime && strategyIdx < strategies.length - 1) {
|
|
6574
|
+
strategyIdx++;
|
|
6575
|
+
const strategy = strategies[strategyIdx];
|
|
6576
|
+
const msgs = {
|
|
6577
|
+
cli: "Checking engine...",
|
|
6578
|
+
reopen: "Restarting engine...",
|
|
6579
|
+
background: "Trying direct launch...",
|
|
6580
|
+
install: "Re-running installer...",
|
|
6581
|
+
service: "Trying service command...",
|
|
6582
|
+
snap: "Trying snap..."
|
|
6583
|
+
};
|
|
6584
|
+
this.onProgress(`__progress__:${pct}:${msgs[strategy] || "Trying another approach..."}`);
|
|
6585
|
+
this.startDockerDaemon(strategy);
|
|
6586
|
+
} else {
|
|
6587
|
+
const msgs = [
|
|
6588
|
+
"Starting engine...",
|
|
6589
|
+
"Waiting for engine...",
|
|
6590
|
+
"Loading...",
|
|
6591
|
+
"Almost there...",
|
|
6592
|
+
"Still starting up...",
|
|
6593
|
+
"First launch takes a bit longer...",
|
|
6594
|
+
"Hang tight..."
|
|
6595
|
+
];
|
|
6596
|
+
const msgIdx = Math.floor(elapsed / 1e4) % msgs.length;
|
|
6597
|
+
this.onProgress(`__progress__:${pct}:${msgs[msgIdx]}`);
|
|
6598
|
+
}
|
|
6599
|
+
if (os === "darwin") this.hideDockerWindow();
|
|
6573
6600
|
}
|
|
6574
|
-
if (os === "darwin" && !this._firstLaunchMode) this.hideDockerWindow();
|
|
6575
6601
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
6576
6602
|
}
|
|
6577
6603
|
throw new Error(
|