@agenticmail/core 0.5.26 → 0.5.28
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 +2 -61
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5898,65 +5898,6 @@ import { existsSync as existsSync4 } 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";
|
|
5901
|
-
function runWithRollingOutput(command, args, opts = {}) {
|
|
5902
|
-
const maxLines = opts.maxLines ?? 20;
|
|
5903
|
-
const timeout = opts.timeout ?? 3e5;
|
|
5904
|
-
return new Promise((resolve, reject) => {
|
|
5905
|
-
const child = spawnChild(command, args, {
|
|
5906
|
-
stdio: [opts.inheritStdin ? "inherit" : "ignore", "pipe", "pipe"],
|
|
5907
|
-
timeout
|
|
5908
|
-
});
|
|
5909
|
-
const lines = [];
|
|
5910
|
-
let displayedCount = 0;
|
|
5911
|
-
let fullOutput = "";
|
|
5912
|
-
const processData = (data) => {
|
|
5913
|
-
const text = data.toString();
|
|
5914
|
-
fullOutput += text;
|
|
5915
|
-
const newLines = text.split("\n");
|
|
5916
|
-
for (const line of newLines) {
|
|
5917
|
-
const trimmed = line.trimEnd();
|
|
5918
|
-
if (!trimmed) continue;
|
|
5919
|
-
lines.push(trimmed);
|
|
5920
|
-
if (displayedCount > 0) {
|
|
5921
|
-
const toClear = Math.min(displayedCount, maxLines);
|
|
5922
|
-
process.stdout.write(`\x1B[${toClear}A`);
|
|
5923
|
-
for (let i = 0; i < toClear; i++) {
|
|
5924
|
-
process.stdout.write("\x1B[2K\n");
|
|
5925
|
-
}
|
|
5926
|
-
process.stdout.write(`\x1B[${toClear}A`);
|
|
5927
|
-
}
|
|
5928
|
-
const visible = lines.slice(-maxLines);
|
|
5929
|
-
for (const vLine of visible) {
|
|
5930
|
-
process.stdout.write(` \x1B[90m${vLine.slice(0, 100)}\x1B[0m
|
|
5931
|
-
`);
|
|
5932
|
-
}
|
|
5933
|
-
displayedCount = visible.length;
|
|
5934
|
-
}
|
|
5935
|
-
};
|
|
5936
|
-
child.stdout?.on("data", processData);
|
|
5937
|
-
child.stderr?.on("data", processData);
|
|
5938
|
-
child.on("close", (code) => {
|
|
5939
|
-
if (displayedCount > 0) {
|
|
5940
|
-
process.stdout.write(`\x1B[${displayedCount}A`);
|
|
5941
|
-
for (let i = 0; i < displayedCount; i++) {
|
|
5942
|
-
process.stdout.write("\x1B[2K\n");
|
|
5943
|
-
}
|
|
5944
|
-
process.stdout.write(`\x1B[${displayedCount}A`);
|
|
5945
|
-
}
|
|
5946
|
-
resolve({ exitCode: code ?? 1, fullOutput });
|
|
5947
|
-
});
|
|
5948
|
-
child.on("error", (err) => {
|
|
5949
|
-
if (displayedCount > 0) {
|
|
5950
|
-
process.stdout.write(`\x1B[${displayedCount}A`);
|
|
5951
|
-
for (let i = 0; i < displayedCount; i++) {
|
|
5952
|
-
process.stdout.write("\x1B[2K\n");
|
|
5953
|
-
}
|
|
5954
|
-
process.stdout.write(`\x1B[${displayedCount}A`);
|
|
5955
|
-
}
|
|
5956
|
-
reject(err);
|
|
5957
|
-
});
|
|
5958
|
-
});
|
|
5959
|
-
}
|
|
5960
5901
|
function runShellWithRollingOutput(cmd, opts = {}) {
|
|
5961
5902
|
const maxLines = opts.maxLines ?? 20;
|
|
5962
5903
|
const timeout = opts.timeout ?? 3e5;
|
|
@@ -6379,9 +6320,9 @@ var DependencyInstaller = class {
|
|
|
6379
6320
|
}
|
|
6380
6321
|
this.onProgress("__progress__:10:Pulling mail server image...");
|
|
6381
6322
|
if (platform2() === "darwin") this.linkComposePlugin();
|
|
6382
|
-
let composeResult = await
|
|
6323
|
+
let composeResult = await runSilent("docker", ["compose", "-f", composePath, "up", "-d"], { timeout: 12e4 });
|
|
6383
6324
|
if (composeResult.exitCode !== 0 && hasCommand("docker-compose")) {
|
|
6384
|
-
composeResult = await
|
|
6325
|
+
composeResult = await runSilent("docker-compose", ["-f", composePath, "up", "-d"], { timeout: 12e4 });
|
|
6385
6326
|
}
|
|
6386
6327
|
if (composeResult.exitCode !== 0) {
|
|
6387
6328
|
throw new Error("Failed to start mail server container. Check Docker is running.");
|