@agenticmail/core 0.5.2 → 0.5.3
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/README.md +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +106 -24
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @agenticmail/core
|
|
2
2
|
|
|
3
|
-
Core SDK for [AgenticMail](https://github.com/agenticmail/agenticmail) —
|
|
3
|
+
Core SDK for [AgenticMail](https://github.com/agenticmail/agenticmail) — the first platform to give AI agents real email addresses and phone numbers.
|
|
4
4
|
|
|
5
5
|
This is the foundation layer that everything else builds on. If the API server, MCP server, OpenClaw plugin, and CLI are the ways people interact with AgenticMail, this package is what actually does the work underneath. It handles creating and managing AI agent accounts, sending and receiving real email, watching inboxes for new messages in real time, routing email to and from the internet (through Gmail relay or a custom domain with Cloudflare), filtering spam, scanning outgoing emails to prevent agents from leaking sensitive data, and storing everything in a local SQLite database.
|
|
6
6
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1419,10 +1419,22 @@ declare class DependencyInstaller {
|
|
|
1419
1419
|
constructor(onProgress?: InstallProgress);
|
|
1420
1420
|
/**
|
|
1421
1421
|
* Ensure Docker is installed AND the daemon is running.
|
|
1422
|
-
*
|
|
1422
|
+
* macOS: Downloads official DMG and runs Docker's CLI installer (no Homebrew needed).
|
|
1423
|
+
* Linux: Uses Docker's official convenience script (https://get.docker.com).
|
|
1423
1424
|
* Starts the daemon if Docker CLI is present but daemon is stopped.
|
|
1424
1425
|
*/
|
|
1425
1426
|
installDocker(): Promise<void>;
|
|
1427
|
+
/**
|
|
1428
|
+
* Install Docker Desktop on macOS using the official DMG installer.
|
|
1429
|
+
* Downloads the DMG, mounts it, runs the silent CLI installer, then starts Docker Desktop.
|
|
1430
|
+
* This is Docker's recommended command-line installation method.
|
|
1431
|
+
*/
|
|
1432
|
+
private installDockerMac;
|
|
1433
|
+
/**
|
|
1434
|
+
* Install Docker Engine on Linux using Docker's official convenience script.
|
|
1435
|
+
* Also adds the current user to the docker group for rootless usage.
|
|
1436
|
+
*/
|
|
1437
|
+
private installDockerLinux;
|
|
1426
1438
|
/**
|
|
1427
1439
|
* Attempt to start the Docker daemon using multiple strategies.
|
|
1428
1440
|
* On macOS: tries Docker Desktop app, then docker CLI commands.
|
package/dist/index.js
CHANGED
|
@@ -5903,7 +5903,7 @@ function runWithRollingOutput(command, args, opts = {}) {
|
|
|
5903
5903
|
const timeout = opts.timeout ?? 3e5;
|
|
5904
5904
|
return new Promise((resolve, reject) => {
|
|
5905
5905
|
const child = spawnChild(command, args, {
|
|
5906
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
5906
|
+
stdio: [opts.inheritStdin ? "inherit" : "ignore", "pipe", "pipe"],
|
|
5907
5907
|
timeout
|
|
5908
5908
|
});
|
|
5909
5909
|
const lines = [];
|
|
@@ -6024,7 +6024,8 @@ var DependencyInstaller = class {
|
|
|
6024
6024
|
}
|
|
6025
6025
|
/**
|
|
6026
6026
|
* Ensure Docker is installed AND the daemon is running.
|
|
6027
|
-
*
|
|
6027
|
+
* macOS: Downloads official DMG and runs Docker's CLI installer (no Homebrew needed).
|
|
6028
|
+
* Linux: Uses Docker's official convenience script (https://get.docker.com).
|
|
6028
6029
|
* Starts the daemon if Docker CLI is present but daemon is stopped.
|
|
6029
6030
|
*/
|
|
6030
6031
|
async installDocker() {
|
|
@@ -6047,33 +6048,116 @@ var DependencyInstaller = class {
|
|
|
6047
6048
|
}
|
|
6048
6049
|
const os = platform2();
|
|
6049
6050
|
if (os === "darwin") {
|
|
6050
|
-
this.
|
|
6051
|
+
await this.installDockerMac();
|
|
6052
|
+
} else if (os === "linux") {
|
|
6053
|
+
await this.installDockerLinux();
|
|
6054
|
+
} else {
|
|
6055
|
+
throw new Error(`Automatic Docker installation not supported on ${os}. Install it manually: https://docs.docker.com/get-docker/`);
|
|
6056
|
+
}
|
|
6057
|
+
}
|
|
6058
|
+
/**
|
|
6059
|
+
* Install Docker Desktop on macOS using the official DMG installer.
|
|
6060
|
+
* Downloads the DMG, mounts it, runs the silent CLI installer, then starts Docker Desktop.
|
|
6061
|
+
* This is Docker's recommended command-line installation method.
|
|
6062
|
+
*/
|
|
6063
|
+
async installDockerMac() {
|
|
6064
|
+
const cpu = arch2();
|
|
6065
|
+
const archName = cpu === "arm64" ? "arm64" : "amd64";
|
|
6066
|
+
const dmgUrl = `https://desktop.docker.com/mac/main/${archName}/Docker.dmg`;
|
|
6067
|
+
const dmgPath = "/tmp/Docker.dmg";
|
|
6068
|
+
this.onProgress("__progress__:5:Downloading Docker Desktop...");
|
|
6069
|
+
const dlResult = await runWithRollingOutput("curl", [
|
|
6070
|
+
"-fSL",
|
|
6071
|
+
"--progress-bar",
|
|
6072
|
+
"-o",
|
|
6073
|
+
dmgPath,
|
|
6074
|
+
dmgUrl
|
|
6075
|
+
], { timeout: 6e5 });
|
|
6076
|
+
if (dlResult.exitCode !== 0) {
|
|
6077
|
+
throw new Error("Failed to download Docker Desktop. Check your internet connection and try again.");
|
|
6078
|
+
}
|
|
6079
|
+
this.onProgress("__progress__:40:Installing Docker Desktop...");
|
|
6080
|
+
try {
|
|
6051
6081
|
try {
|
|
6052
|
-
|
|
6082
|
+
execSync("hdiutil detach /Volumes/Docker 2>/dev/null", { timeout: 1e4, stdio: "ignore" });
|
|
6053
6083
|
} catch {
|
|
6054
|
-
throw new Error("Homebrew is required to install Docker on macOS. Install it from https://brew.sh then try again.");
|
|
6055
6084
|
}
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6085
|
+
execSync(`hdiutil attach "${dmgPath}" -nobrowse -quiet`, { timeout: 3e4, stdio: "ignore" });
|
|
6086
|
+
} catch {
|
|
6087
|
+
throw new Error("Failed to mount Docker DMG. The download may be corrupted \u2014 try again.");
|
|
6088
|
+
}
|
|
6089
|
+
this.onProgress("__progress__:55:Running Docker installer...");
|
|
6090
|
+
const user = process.env.USER || execSync("whoami", { timeout: 5e3 }).toString().trim();
|
|
6091
|
+
try {
|
|
6092
|
+
const installResult = await runWithRollingOutput(
|
|
6093
|
+
"/Volumes/Docker/Docker.app/Contents/MacOS/install",
|
|
6094
|
+
["--accept-license", `--user=${user}`],
|
|
6095
|
+
{ timeout: 12e4 }
|
|
6096
|
+
);
|
|
6097
|
+
if (installResult.exitCode !== 0) {
|
|
6098
|
+
if (!existsSync4("/Applications/Docker.app")) {
|
|
6099
|
+
throw new Error("Installer exited with errors");
|
|
6100
|
+
}
|
|
6059
6101
|
}
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
if (result.exitCode !== 0) {
|
|
6068
|
-
throw new Error("Install script failed");
|
|
6102
|
+
} catch (err) {
|
|
6103
|
+
if (!existsSync4("/Applications/Docker.app")) {
|
|
6104
|
+
this.onProgress("__progress__:60:Trying alternative install method...");
|
|
6105
|
+
try {
|
|
6106
|
+
execSync('cp -R "/Volumes/Docker/Docker.app" /Applications/', { timeout: 6e4, stdio: "ignore" });
|
|
6107
|
+
} catch {
|
|
6108
|
+
throw new Error("Failed to install Docker Desktop. Try dragging Docker.app to Applications manually.");
|
|
6069
6109
|
}
|
|
6110
|
+
}
|
|
6111
|
+
}
|
|
6112
|
+
try {
|
|
6113
|
+
execSync("hdiutil detach /Volumes/Docker -quiet", { timeout: 15e3, stdio: "ignore" });
|
|
6114
|
+
} catch {
|
|
6115
|
+
}
|
|
6116
|
+
try {
|
|
6117
|
+
await unlink(dmgPath);
|
|
6118
|
+
} catch {
|
|
6119
|
+
}
|
|
6120
|
+
this.onProgress("__progress__:70:Starting Docker Desktop...");
|
|
6121
|
+
this.startDockerDaemon();
|
|
6122
|
+
await this.waitForDocker();
|
|
6123
|
+
}
|
|
6124
|
+
/**
|
|
6125
|
+
* Install Docker Engine on Linux using Docker's official convenience script.
|
|
6126
|
+
* Also adds the current user to the docker group for rootless usage.
|
|
6127
|
+
*/
|
|
6128
|
+
async installDockerLinux() {
|
|
6129
|
+
this.onProgress("__progress__:5:Installing Docker Engine...");
|
|
6130
|
+
const dlResult = await runShellWithRollingOutput(
|
|
6131
|
+
"curl -fsSL https://get.docker.com -o /tmp/install-docker.sh && sudo sh /tmp/install-docker.sh",
|
|
6132
|
+
{ timeout: 3e5 }
|
|
6133
|
+
);
|
|
6134
|
+
if (dlResult.exitCode !== 0) {
|
|
6135
|
+
throw new Error(
|
|
6136
|
+
"Failed to install Docker Engine. You may need sudo privileges.\nManual install: https://docs.docker.com/engine/install/"
|
|
6137
|
+
);
|
|
6138
|
+
}
|
|
6139
|
+
const user = process.env.USER || process.env.LOGNAME || "";
|
|
6140
|
+
if (user && user !== "root") {
|
|
6141
|
+
this.onProgress("__progress__:80:Adding user to docker group...");
|
|
6142
|
+
try {
|
|
6143
|
+
execSync(`sudo usermod -aG docker ${user}`, { timeout: 1e4, stdio: "ignore" });
|
|
6070
6144
|
} catch {
|
|
6071
|
-
throw new Error("Failed to install Docker. Install it manually: https://docs.docker.com/get-docker/");
|
|
6072
6145
|
}
|
|
6073
|
-
await this.waitForDocker();
|
|
6074
|
-
} else {
|
|
6075
|
-
throw new Error(`Automatic Docker installation not supported on ${os}. Install it manually: https://docs.docker.com/get-docker/`);
|
|
6076
6146
|
}
|
|
6147
|
+
try {
|
|
6148
|
+
await unlink("/tmp/install-docker.sh");
|
|
6149
|
+
} catch {
|
|
6150
|
+
}
|
|
6151
|
+
this.onProgress("__progress__:85:Starting Docker service...");
|
|
6152
|
+
try {
|
|
6153
|
+
execSync("sudo systemctl enable --now docker", { timeout: 15e3, stdio: "ignore" });
|
|
6154
|
+
} catch {
|
|
6155
|
+
try {
|
|
6156
|
+
execSync("sudo service docker start", { timeout: 15e3, stdio: "ignore" });
|
|
6157
|
+
} catch {
|
|
6158
|
+
}
|
|
6159
|
+
}
|
|
6160
|
+
await this.waitForDocker();
|
|
6077
6161
|
}
|
|
6078
6162
|
/**
|
|
6079
6163
|
* Attempt to start the Docker daemon using multiple strategies.
|
|
@@ -6191,9 +6275,7 @@ var DependencyInstaller = class {
|
|
|
6191
6275
|
}
|
|
6192
6276
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
6193
6277
|
}
|
|
6194
|
-
throw new Error(
|
|
6195
|
-
"DOCKER_MANUAL_START"
|
|
6196
|
-
);
|
|
6278
|
+
throw new Error("DOCKER_MANUAL_START");
|
|
6197
6279
|
}
|
|
6198
6280
|
/**
|
|
6199
6281
|
* Start the Stalwart mail server Docker container.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticmail/core",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "Core SDK for AgenticMail
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"description": "Core SDK for AgenticMail \u2014 email, SMS, and phone number access for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -52,6 +52,8 @@
|
|
|
52
52
|
"bugs": "https://github.com/agenticmail/agenticmail/issues",
|
|
53
53
|
"keywords": [
|
|
54
54
|
"email",
|
|
55
|
+
"sms",
|
|
56
|
+
"phone",
|
|
55
57
|
"ai",
|
|
56
58
|
"agent",
|
|
57
59
|
"mail",
|
|
@@ -59,7 +61,9 @@
|
|
|
59
61
|
"imap",
|
|
60
62
|
"agenticmail",
|
|
61
63
|
"ai-agent",
|
|
62
|
-
"mcp"
|
|
64
|
+
"mcp",
|
|
65
|
+
"google-voice",
|
|
66
|
+
"text-message"
|
|
63
67
|
],
|
|
64
68
|
"publishConfig": {
|
|
65
69
|
"access": "public"
|