@agenticmail/enterprise 0.5.340 → 0.5.342
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/{chunk-G5EUEON7.js → chunk-2DE62O56.js} +51 -42
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/setup-D7IXATAY.js +20 -0
- package/dist/setup-ZZSBCXJ3.js +20 -0
- package/logs/enterprise-error.log +6 -0
- package/package.json +1 -1
- package/dist/chunk-3RI3AIJN.js +0 -1519
- package/dist/chunk-AD4DFKHR.js +0 -4928
- package/dist/chunk-DWHJYAV6.js +0 -26055
- package/dist/chunk-GNABVGDZ.js +0 -4928
- package/dist/chunk-HTT6LUPP.js +0 -5101
- package/dist/chunk-I25KEJVB.js +0 -1562
- package/dist/chunk-JH76GUKT.js +0 -5101
- package/dist/chunk-KHYCWUTO.js +0 -1539
- package/dist/chunk-PAHT4ABL.js +0 -106
- package/dist/chunk-QCV66KWM.js +0 -1576
- package/dist/chunk-RHO7WRVJ.js +0 -1519
- package/dist/chunk-UQXPVWXG.js +0 -5101
- package/dist/chunk-VIHOFXA4.js +0 -1526
- package/dist/chunk-WEPTZQL7.js +0 -1519
- package/dist/chunk-XMDE2NGH.js +0 -116
|
@@ -256,7 +256,7 @@ async function promptDatabase(inquirer, chalk) {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
// src/setup/deployment.ts
|
|
259
|
-
import { execSync
|
|
259
|
+
import { execSync, exec as execCb } from "child_process";
|
|
260
260
|
import { promisify } from "util";
|
|
261
261
|
import { existsSync, writeFileSync, readFileSync } from "fs";
|
|
262
262
|
import { join } from "path";
|
|
@@ -264,7 +264,7 @@ import { homedir, platform, arch } from "os";
|
|
|
264
264
|
var execP = promisify(execCb);
|
|
265
265
|
function whichCmd(bin) {
|
|
266
266
|
const cmd = platform() === "win32" ? `where ${bin}` : `which ${bin}`;
|
|
267
|
-
return
|
|
267
|
+
return execSync(cmd, { encoding: "utf8", timeout: 5e3, stdio: ["pipe", "pipe", "pipe"] }).trim().split(/\r?\n/)[0];
|
|
268
268
|
}
|
|
269
269
|
var SUBDOMAIN_REGISTRY_URL = process.env.AGENTICMAIL_SUBDOMAIN_REGISTRY_URL || "https://registry.agenticmail.io";
|
|
270
270
|
async function promptDeployment(inquirer, chalk, existingSubdomain) {
|
|
@@ -426,18 +426,22 @@ async function runCloudSetup(inquirer, chalk, existingSubdomain) {
|
|
|
426
426
|
try {
|
|
427
427
|
const os = platform();
|
|
428
428
|
if (os === "darwin") {
|
|
429
|
-
|
|
429
|
+
execSync("brew install cloudflared", { stdio: "pipe", timeout: 12e4 });
|
|
430
430
|
} else if (os === "linux") {
|
|
431
431
|
const archStr = arch() === "arm64" ? "arm64" : "amd64";
|
|
432
|
-
|
|
432
|
+
execSync(`curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${archStr} -o /usr/local/bin/cloudflared && chmod +x /usr/local/bin/cloudflared`, { stdio: "pipe", timeout: 12e4 });
|
|
433
433
|
} else if (os === "win32") {
|
|
434
434
|
try {
|
|
435
|
-
|
|
435
|
+
execSync("winget install --id Cloudflare.cloudflared --accept-source-agreements --accept-package-agreements", { stdio: "pipe", timeout: 12e4 });
|
|
436
436
|
} catch {
|
|
437
437
|
console.log(chalk.dim(" winget failed, trying direct download..."));
|
|
438
438
|
const archStr = arch() === "arm64" ? "arm64" : "amd64";
|
|
439
|
-
|
|
440
|
-
|
|
439
|
+
const localAppData = process.env.LOCALAPPDATA || `${process.env.USERPROFILE}\\AppData\\Local`;
|
|
440
|
+
const cfDir = `${localAppData}\\cloudflared`;
|
|
441
|
+
const cfExe = `${cfDir}\\cloudflared.exe`;
|
|
442
|
+
const dlUrl = `https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-${archStr}.exe`;
|
|
443
|
+
execSync(`powershell -Command "New-Item -ItemType Directory -Force -Path '${cfDir}' | Out-Null; Invoke-WebRequest -Uri '${dlUrl}' -OutFile '${cfExe}'"`, { stdio: "pipe", timeout: 12e4 });
|
|
444
|
+
process.env.PATH = `${cfDir};${process.env.PATH}`;
|
|
441
445
|
}
|
|
442
446
|
} else {
|
|
443
447
|
console.log(chalk.yellow(" Please install cloudflared manually: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/"));
|
|
@@ -522,7 +526,7 @@ async function runTunnelSetup(inquirer, chalk) {
|
|
|
522
526
|
let installed = false;
|
|
523
527
|
let version = "";
|
|
524
528
|
try {
|
|
525
|
-
version =
|
|
529
|
+
version = execSync("cloudflared --version 2>&1", { encoding: "utf8", timeout: 5e3 }).trim();
|
|
526
530
|
installed = true;
|
|
527
531
|
} catch {
|
|
528
532
|
}
|
|
@@ -545,7 +549,7 @@ async function runTunnelSetup(inquirer, chalk) {
|
|
|
545
549
|
console.log(chalk.dim(" Installing..."));
|
|
546
550
|
try {
|
|
547
551
|
await installCloudflared();
|
|
548
|
-
version =
|
|
552
|
+
version = execSync("cloudflared --version 2>&1", { encoding: "utf8", timeout: 5e3 }).trim();
|
|
549
553
|
console.log(chalk.green(` \u2713 Installed (${version})
|
|
550
554
|
`));
|
|
551
555
|
} catch (err) {
|
|
@@ -608,14 +612,14 @@ async function runTunnelSetup(inquirer, chalk) {
|
|
|
608
612
|
let tunnelId = "";
|
|
609
613
|
try {
|
|
610
614
|
console.log(chalk.dim(" Creating tunnel..."));
|
|
611
|
-
const out =
|
|
615
|
+
const out = execSync(`cloudflared tunnel create ${tunnelName} 2>&1`, { encoding: "utf8", timeout: 3e4 });
|
|
612
616
|
const match = out.match(/Created tunnel .+ with id ([a-f0-9-]+)/);
|
|
613
617
|
tunnelId = match?.[1] || "";
|
|
614
618
|
console.log(chalk.green(` \u2713 Tunnel created: ${tunnelName} (${tunnelId})`));
|
|
615
619
|
} catch (e) {
|
|
616
620
|
if (e.message?.includes("already exists") || e.stderr?.includes("already exists")) {
|
|
617
621
|
try {
|
|
618
|
-
const listOut =
|
|
622
|
+
const listOut = execSync("cloudflared tunnel list --output json 2>&1", { encoding: "utf8", timeout: 15e3 });
|
|
619
623
|
const tunnels = JSON.parse(listOut);
|
|
620
624
|
const existing = tunnels.find((t) => t.name === tunnelName);
|
|
621
625
|
if (existing) {
|
|
@@ -647,7 +651,7 @@ async function runTunnelSetup(inquirer, chalk) {
|
|
|
647
651
|
writeFileSync(join(cfDir, "config.yml"), config);
|
|
648
652
|
console.log(chalk.green(` \u2713 Config written: ${domain} \u2192 localhost:${port}`));
|
|
649
653
|
try {
|
|
650
|
-
|
|
654
|
+
execSync(`cloudflared tunnel route dns ${tunnelId} ${domain} 2>&1`, { encoding: "utf8", timeout: 3e4 });
|
|
651
655
|
console.log(chalk.green(` \u2713 DNS CNAME created: ${domain}`));
|
|
652
656
|
} catch (e) {
|
|
653
657
|
if (e.message?.includes("already exists") || e.stderr?.includes("already exists")) {
|
|
@@ -660,19 +664,19 @@ async function runTunnelSetup(inquirer, chalk) {
|
|
|
660
664
|
try {
|
|
661
665
|
whichCmd("pm2");
|
|
662
666
|
try {
|
|
663
|
-
|
|
667
|
+
execSync("pm2 delete cloudflared 2>/dev/null", { timeout: 5e3 });
|
|
664
668
|
} catch {
|
|
665
669
|
}
|
|
666
|
-
|
|
670
|
+
execSync(`pm2 start cloudflared --name cloudflared -- tunnel run`, { encoding: "utf8", timeout: 15e3 });
|
|
667
671
|
try {
|
|
668
|
-
|
|
672
|
+
execSync("pm2 save 2>/dev/null", { timeout: 5e3 });
|
|
669
673
|
} catch {
|
|
670
674
|
}
|
|
671
675
|
try {
|
|
672
|
-
const startupOut =
|
|
676
|
+
const startupOut = execSync("pm2 startup 2>&1", { encoding: "utf8", timeout: 15e3 });
|
|
673
677
|
const sudoMatch = startupOut.match(/sudo .+$/m);
|
|
674
678
|
if (sudoMatch) try {
|
|
675
|
-
|
|
679
|
+
execSync(sudoMatch[0], { timeout: 15e3, stdio: "pipe" });
|
|
676
680
|
} catch {
|
|
677
681
|
}
|
|
678
682
|
} catch {
|
|
@@ -684,21 +688,21 @@ async function runTunnelSetup(inquirer, chalk) {
|
|
|
684
688
|
if (!started) {
|
|
685
689
|
try {
|
|
686
690
|
console.log(chalk.dim(" Installing PM2 for process management..."));
|
|
687
|
-
|
|
691
|
+
execSync("npm install -g pm2", { timeout: 6e4, stdio: "pipe" });
|
|
688
692
|
try {
|
|
689
|
-
|
|
693
|
+
execSync("pm2 delete cloudflared 2>/dev/null", { timeout: 5e3 });
|
|
690
694
|
} catch {
|
|
691
695
|
}
|
|
692
|
-
|
|
696
|
+
execSync(`pm2 start cloudflared --name cloudflared -- tunnel run`, { encoding: "utf8", timeout: 15e3 });
|
|
693
697
|
try {
|
|
694
|
-
|
|
698
|
+
execSync("pm2 save 2>/dev/null", { timeout: 5e3 });
|
|
695
699
|
} catch {
|
|
696
700
|
}
|
|
697
701
|
try {
|
|
698
|
-
const startupOut =
|
|
702
|
+
const startupOut = execSync("pm2 startup 2>&1", { encoding: "utf8", timeout: 15e3 });
|
|
699
703
|
const sudoMatch = startupOut.match(/sudo .+$/m);
|
|
700
704
|
if (sudoMatch) try {
|
|
701
|
-
|
|
705
|
+
execSync(sudoMatch[0], { timeout: 15e3, stdio: "pipe" });
|
|
702
706
|
} catch {
|
|
703
707
|
}
|
|
704
708
|
} catch {
|
|
@@ -728,18 +732,18 @@ async function installCloudflared() {
|
|
|
728
732
|
if (plat === "darwin") {
|
|
729
733
|
try {
|
|
730
734
|
whichCmd("brew");
|
|
731
|
-
|
|
735
|
+
execSync("brew install cloudflared 2>&1", { encoding: "utf8", timeout: 12e4 });
|
|
732
736
|
return;
|
|
733
737
|
} catch {
|
|
734
738
|
}
|
|
735
739
|
const cfArch = a === "arm64" ? "arm64" : "amd64";
|
|
736
|
-
|
|
740
|
+
execSync(
|
|
737
741
|
`curl -L -o /usr/local/bin/cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-darwin-${cfArch} && chmod +x /usr/local/bin/cloudflared`,
|
|
738
742
|
{ timeout: 6e4 }
|
|
739
743
|
);
|
|
740
744
|
} else if (plat === "linux") {
|
|
741
745
|
const cfArch = a === "arm64" ? "arm64" : "amd64";
|
|
742
|
-
|
|
746
|
+
execSync(
|
|
743
747
|
`curl -L -o /usr/local/bin/cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch} && chmod +x /usr/local/bin/cloudflared`,
|
|
744
748
|
{ timeout: 6e4 }
|
|
745
749
|
);
|
|
@@ -1041,6 +1045,7 @@ async function promptRegistration(inquirer, chalk, ora, domain, companyName, adm
|
|
|
1041
1045
|
|
|
1042
1046
|
// src/setup/provision.ts
|
|
1043
1047
|
import { randomUUID, randomBytes as randomBytes2 } from "crypto";
|
|
1048
|
+
import { execSync as execSync2 } from "child_process";
|
|
1044
1049
|
function generateOrgId() {
|
|
1045
1050
|
const chars = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
1046
1051
|
const bytes = randomBytes2(10);
|
|
@@ -1231,46 +1236,50 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
|
|
|
1231
1236
|
spinner.start("Configuring agenticmail.io deployment...");
|
|
1232
1237
|
try {
|
|
1233
1238
|
const whichCmd2 = process.platform === "win32" ? "where" : "which";
|
|
1234
|
-
|
|
1239
|
+
execSync2(`${whichCmd2} cloudflared`, { stdio: "pipe", timeout: 5e3 });
|
|
1235
1240
|
} catch {
|
|
1236
1241
|
spinner.text = "Installing cloudflared...";
|
|
1237
1242
|
try {
|
|
1238
1243
|
if (process.platform === "win32") {
|
|
1239
1244
|
try {
|
|
1240
|
-
|
|
1245
|
+
execSync2("winget install --id Cloudflare.cloudflared --accept-source-agreements --accept-package-agreements", { stdio: "pipe", timeout: 12e4 });
|
|
1241
1246
|
} catch {
|
|
1242
1247
|
const archStr = process.arch === "arm64" ? "arm64" : "amd64";
|
|
1243
|
-
|
|
1244
|
-
|
|
1248
|
+
const localAppData = process.env.LOCALAPPDATA || `${process.env.USERPROFILE}\\AppData\\Local`;
|
|
1249
|
+
const cfDir = `${localAppData}\\cloudflared`;
|
|
1250
|
+
const cfExe = `${cfDir}\\cloudflared.exe`;
|
|
1251
|
+
const dlUrl = `https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-${archStr}.exe`;
|
|
1252
|
+
execSync2(`powershell -Command "New-Item -ItemType Directory -Force -Path '${cfDir}' | Out-Null; Invoke-WebRequest -Uri '${dlUrl}' -OutFile '${cfExe}'"`, { stdio: "pipe", timeout: 12e4 });
|
|
1253
|
+
process.env.PATH = `${cfDir};${process.env.PATH}`;
|
|
1245
1254
|
}
|
|
1246
1255
|
} else if (process.platform === "darwin") {
|
|
1247
|
-
|
|
1256
|
+
execSync2("brew install cloudflared", { stdio: "pipe", timeout: 12e4 });
|
|
1248
1257
|
} else {
|
|
1249
1258
|
const archStr = process.arch === "arm64" ? "arm64" : "amd64";
|
|
1250
|
-
|
|
1259
|
+
execSync2(`curl -L -o /usr/local/bin/cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${archStr} && chmod +x /usr/local/bin/cloudflared`, { stdio: "pipe", timeout: 12e4 });
|
|
1251
1260
|
}
|
|
1252
1261
|
} catch {
|
|
1253
1262
|
}
|
|
1254
1263
|
}
|
|
1255
1264
|
try {
|
|
1256
|
-
|
|
1265
|
+
execSync2("npm ls -g pm2 --depth=0", { stdio: "pipe", timeout: 1e4 });
|
|
1257
1266
|
} catch {
|
|
1258
1267
|
spinner.text = "Installing PM2 process manager...";
|
|
1259
1268
|
try {
|
|
1260
|
-
|
|
1269
|
+
execSync2("npm install -g pm2", { stdio: "pipe", timeout: 6e4 });
|
|
1261
1270
|
} catch {
|
|
1262
1271
|
}
|
|
1263
1272
|
}
|
|
1264
1273
|
try {
|
|
1265
1274
|
try {
|
|
1266
|
-
|
|
1275
|
+
execSync2("pm2 delete cloudflared 2>&1", { stdio: "pipe", timeout: 1e4 });
|
|
1267
1276
|
} catch {
|
|
1268
1277
|
}
|
|
1269
1278
|
try {
|
|
1270
|
-
|
|
1279
|
+
execSync2("pm2 delete enterprise 2>&1", { stdio: "pipe", timeout: 1e4 });
|
|
1271
1280
|
} catch {
|
|
1272
1281
|
}
|
|
1273
|
-
|
|
1282
|
+
execSync2(`pm2 start cloudflared --name cloudflared --interpreter none -- tunnel --no-autoupdate run --token ${cloud.tunnelToken}`, { stdio: "pipe", timeout: 15e3 });
|
|
1274
1283
|
const envVars = [
|
|
1275
1284
|
`PORT=${cloud.port || 8080}`,
|
|
1276
1285
|
`DATABASE_URL=${database.connectionString || ""}`,
|
|
@@ -1279,7 +1288,7 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
|
|
|
1279
1288
|
`AGENTICMAIL_DOMAIN=${cloud.fqdn}`
|
|
1280
1289
|
].join(" ");
|
|
1281
1290
|
const pm2Env = process.platform === "win32" ? `--env PORT=${cloud.port || 8080}` : "";
|
|
1282
|
-
|
|
1291
|
+
execSync2(`pm2 start npx --name enterprise -- @agenticmail/enterprise start`, {
|
|
1283
1292
|
stdio: "pipe",
|
|
1284
1293
|
timeout: 15e3,
|
|
1285
1294
|
env: {
|
|
@@ -1292,14 +1301,14 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
|
|
|
1292
1301
|
}
|
|
1293
1302
|
});
|
|
1294
1303
|
try {
|
|
1295
|
-
|
|
1304
|
+
execSync2("pm2 save", { timeout: 1e4, stdio: "pipe" });
|
|
1296
1305
|
} catch {
|
|
1297
1306
|
}
|
|
1298
1307
|
try {
|
|
1299
|
-
const startupOut =
|
|
1308
|
+
const startupOut = execSync2("pm2 startup 2>&1", { encoding: "utf8", timeout: 15e3 });
|
|
1300
1309
|
const sudoMatch = startupOut.match(/sudo .+$/m);
|
|
1301
1310
|
if (sudoMatch) try {
|
|
1302
|
-
|
|
1311
|
+
execSync2(sudoMatch[0], { timeout: 15e3, stdio: "pipe" });
|
|
1303
1312
|
} catch {
|
|
1304
1313
|
}
|
|
1305
1314
|
} catch {
|
|
@@ -1530,7 +1539,7 @@ async function runSetupWizard() {
|
|
|
1530
1539
|
const { default: chalk } = await import("chalk");
|
|
1531
1540
|
console.log("");
|
|
1532
1541
|
console.log(chalk.cyan(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
|
|
1533
|
-
console.log(chalk.cyan(" \u2551") + chalk.bold.white(" \
|
|
1542
|
+
console.log(chalk.cyan(" \u2551") + chalk.bold.white(" \u{1F380} AgenticMail Enterprise \u{1F380} ") + chalk.cyan("\u2551"));
|
|
1534
1543
|
console.log(chalk.cyan(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
1535
1544
|
console.log("");
|
|
1536
1545
|
console.log(chalk.bold.white(" The AI Agent Operating System for Organizations"));
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
promptCompanyInfo,
|
|
3
|
+
promptDatabase,
|
|
4
|
+
promptDeployment,
|
|
5
|
+
promptDomain,
|
|
6
|
+
promptRegistration,
|
|
7
|
+
provision,
|
|
8
|
+
runSetupWizard
|
|
9
|
+
} from "./chunk-2DE62O56.js";
|
|
10
|
+
import "./chunk-Z3I6GNTS.js";
|
|
11
|
+
import "./chunk-KFQGP6VL.js";
|
|
12
|
+
export {
|
|
13
|
+
promptCompanyInfo,
|
|
14
|
+
promptDatabase,
|
|
15
|
+
promptDeployment,
|
|
16
|
+
promptDomain,
|
|
17
|
+
promptRegistration,
|
|
18
|
+
provision,
|
|
19
|
+
runSetupWizard
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
promptCompanyInfo,
|
|
3
|
+
promptDatabase,
|
|
4
|
+
promptDeployment,
|
|
5
|
+
promptDomain,
|
|
6
|
+
promptRegistration,
|
|
7
|
+
provision,
|
|
8
|
+
runSetupWizard
|
|
9
|
+
} from "./chunk-MGNDXWOU.js";
|
|
10
|
+
import "./chunk-Z3I6GNTS.js";
|
|
11
|
+
import "./chunk-KFQGP6VL.js";
|
|
12
|
+
export {
|
|
13
|
+
promptCompanyInfo,
|
|
14
|
+
promptDatabase,
|
|
15
|
+
promptDeployment,
|
|
16
|
+
promptDomain,
|
|
17
|
+
promptRegistration,
|
|
18
|
+
provision,
|
|
19
|
+
runSetupWizard
|
|
20
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
2026-03-05 16:03:41: [chat-poller] Error polling Agentic Mail Support Space: The operation was aborted due to timeout
|
|
2
|
+
2026-03-05 16:03:41: [chat-poller] 1 consecutive errors, backing off 30s
|
|
3
|
+
2026-03-05 16:07:41: [chat-poller] Error polling Agentic Mail Support Space: The operation was aborted due to timeout
|
|
4
|
+
2026-03-05 16:07:41: [chat-poller] 1 consecutive errors, backing off 30s
|
|
5
|
+
2026-03-05 16:18:12: [chat-poller] Error polling Agentic Mail Support Space: The operation was aborted due to timeout
|
|
6
|
+
2026-03-05 16:18:12: [chat-poller] 1 consecutive errors, backing off 30s
|