@agenticmail/core 0.5.25 → 0.5.27
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 +6 -0
- package/dist/index.js +29 -60
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1434,6 +1434,12 @@ declare class DependencyInstaller {
|
|
|
1434
1434
|
* Installs colima + docker + docker-compose via Homebrew, then starts Colima.
|
|
1435
1435
|
*/
|
|
1436
1436
|
private installDockerMac;
|
|
1437
|
+
/**
|
|
1438
|
+
* Link docker-compose as a Docker CLI plugin so `docker compose` (v2 syntax) works.
|
|
1439
|
+
* Brew installs docker-compose as a standalone binary, but many tools expect
|
|
1440
|
+
* the `docker compose` subcommand.
|
|
1441
|
+
*/
|
|
1442
|
+
private linkComposePlugin;
|
|
1437
1443
|
/**
|
|
1438
1444
|
* Start Colima and wait for Docker to be ready.
|
|
1439
1445
|
*/
|
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;
|
|
@@ -6119,9 +6060,33 @@ var DependencyInstaller = class {
|
|
|
6119
6060
|
"Installation completed but colima/docker not found in PATH.\nTry running manually: brew install colima docker docker-compose"
|
|
6120
6061
|
);
|
|
6121
6062
|
}
|
|
6063
|
+
this.linkComposePlugin();
|
|
6122
6064
|
this.onProgress("__progress__:50:Starting container engine...");
|
|
6123
6065
|
await this.startColima();
|
|
6124
6066
|
}
|
|
6067
|
+
/**
|
|
6068
|
+
* Link docker-compose as a Docker CLI plugin so `docker compose` (v2 syntax) works.
|
|
6069
|
+
* Brew installs docker-compose as a standalone binary, but many tools expect
|
|
6070
|
+
* the `docker compose` subcommand.
|
|
6071
|
+
*/
|
|
6072
|
+
linkComposePlugin() {
|
|
6073
|
+
try {
|
|
6074
|
+
const composeBin = execFileSync2("which", ["docker-compose"], { timeout: 5e3, stdio: ["ignore", "pipe", "ignore"] }).toString().trim();
|
|
6075
|
+
if (!composeBin) return;
|
|
6076
|
+
const pluginDir = join6(homedir5(), ".docker", "cli-plugins");
|
|
6077
|
+
const pluginPath = join6(pluginDir, "docker-compose");
|
|
6078
|
+
if (existsSync4(pluginPath)) return;
|
|
6079
|
+
try {
|
|
6080
|
+
execSync(`mkdir -p "${pluginDir}"`, { timeout: 5e3, stdio: "ignore" });
|
|
6081
|
+
} catch {
|
|
6082
|
+
}
|
|
6083
|
+
try {
|
|
6084
|
+
execSync(`ln -sf "${composeBin}" "${pluginPath}"`, { timeout: 5e3, stdio: "ignore" });
|
|
6085
|
+
} catch {
|
|
6086
|
+
}
|
|
6087
|
+
} catch {
|
|
6088
|
+
}
|
|
6089
|
+
}
|
|
6125
6090
|
/**
|
|
6126
6091
|
* Start Colima and wait for Docker to be ready.
|
|
6127
6092
|
*/
|
|
@@ -6354,7 +6319,11 @@ var DependencyInstaller = class {
|
|
|
6354
6319
|
}
|
|
6355
6320
|
}
|
|
6356
6321
|
this.onProgress("__progress__:10:Pulling mail server image...");
|
|
6357
|
-
|
|
6322
|
+
if (platform2() === "darwin") this.linkComposePlugin();
|
|
6323
|
+
let composeResult = await runSilent("docker", ["compose", "-f", composePath, "up", "-d"], { timeout: 12e4 });
|
|
6324
|
+
if (composeResult.exitCode !== 0 && hasCommand("docker-compose")) {
|
|
6325
|
+
composeResult = await runSilent("docker-compose", ["-f", composePath, "up", "-d"], { timeout: 12e4 });
|
|
6326
|
+
}
|
|
6358
6327
|
if (composeResult.exitCode !== 0) {
|
|
6359
6328
|
throw new Error("Failed to start mail server container. Check Docker is running.");
|
|
6360
6329
|
}
|