@agenticmail/enterprise 0.5.345 → 0.5.347

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.
Files changed (45) hide show
  1. package/dist/{chunk-URC3SFYD.js → chunk-47GC5I25.js} +2 -2
  2. package/dist/{chunk-WV6DLTYP.js → chunk-QJKE4CP4.js} +34 -19
  3. package/dist/{cli-recover-K7A4IIQY.js → cli-recover-CO2RNTTL.js} +1 -1
  4. package/dist/{cli-serve-DUUELMXK.js → cli-serve-F6QWHAUX.js} +27 -6
  5. package/dist/cli.js +3 -3
  6. package/dist/index.js +2 -2
  7. package/dist/{server-ZFVGQJUL.js → server-EJBLWFHI.js} +1 -1
  8. package/dist/{setup-D7IXATAY.js → setup-IXC3WPV2.js} +1 -1
  9. package/logs/cloudflared-error.log +4 -0
  10. package/package.json +1 -1
  11. package/dist/agent-heartbeat-ZFKA6GMI.js +0 -510
  12. package/dist/agent-tools-R6RSBDJQ.js +0 -13949
  13. package/dist/browser-tool-4KWE37RL.js +0 -4003
  14. package/dist/cli-agent-2NBPF3GN.js +0 -2473
  15. package/dist/cli-agent-HWEJ3REY.js +0 -2473
  16. package/dist/cli-agent-K6UFZRXC.js +0 -2473
  17. package/dist/cli-recover-7UPG4QZ6.js +0 -488
  18. package/dist/cli-recover-TTOR7CJR.js +0 -487
  19. package/dist/cli-serve-4MT7RDEL.js +0 -260
  20. package/dist/cli-serve-5VFU4GR4.js +0 -260
  21. package/dist/cli-serve-BQ7NJMGJ.js +0 -260
  22. package/dist/cli-verify-WICBVLAM.js +0 -149
  23. package/dist/factory-4V2W4BSV.js +0 -11
  24. package/dist/mysql-STM7UWYW.js +0 -580
  25. package/dist/postgres-USXBPTHX.js +0 -875
  26. package/dist/routes-T3CDAQTD.js +0 -92
  27. package/dist/runtime-L5ADJORP.js +0 -45
  28. package/dist/runtime-X4BTVICL.js +0 -45
  29. package/dist/server-AAGH5NRQ.js +0 -28
  30. package/dist/server-KSN56EZQ.js +0 -28
  31. package/dist/server-WQ6LLYGB.js +0 -28
  32. package/dist/setup-2E6ZFVSS.js +0 -20
  33. package/dist/setup-3LZARKFD.js +0 -20
  34. package/dist/setup-4AS2ASES.js +0 -20
  35. package/dist/setup-6DRKSOMH.js +0 -20
  36. package/dist/setup-EG5V6EKA.js +0 -20
  37. package/dist/setup-KHWRJILU.js +0 -20
  38. package/dist/setup-LOX32DNQ.js +0 -20
  39. package/dist/setup-MQYVGERK.js +0 -20
  40. package/dist/setup-PIBCCQVU.js +0 -20
  41. package/dist/setup-UR2MFWCK.js +0 -20
  42. package/dist/setup-UUNBBOQH.js +0 -20
  43. package/dist/setup-ZZSBCXJ3.js +0 -20
  44. package/dist/sqlite-QXRWM272.js +0 -572
  45. package/dist/turso-QDQ4SSGE.js +0 -501
@@ -2405,7 +2405,7 @@ function createAdminRoutes(db) {
2405
2405
  const platform = os.default.platform();
2406
2406
  if (platform === "darwin") {
2407
2407
  try {
2408
- execSync("which brew", { timeout: 3e3 });
2408
+ execSync(process.platform === "win32" ? "where brew" : "which brew", { timeout: 3e3 });
2409
2409
  execSync("brew install cloudflared 2>&1", { encoding: "utf8", timeout: 12e4 });
2410
2410
  } catch {
2411
2411
  const arch = os.default.arch() === "arm64" ? "arm64" : "amd64";
@@ -2494,7 +2494,7 @@ function createAdminRoutes(db) {
2494
2494
  }
2495
2495
  }
2496
2496
  try {
2497
- execSync("which pm2", { timeout: 3e3 });
2497
+ execSync(process.platform === "win32" ? "where pm2" : "which pm2", { timeout: 3e3 });
2498
2498
  try {
2499
2499
  execSync("pm2 delete cloudflared 2>/dev/null", { timeout: 5e3 });
2500
2500
  } catch {
@@ -258,7 +258,7 @@ async function promptDatabase(inquirer, chalk) {
258
258
  // src/setup/deployment.ts
259
259
  import { execSync, exec as execCb } from "child_process";
260
260
  import { promisify } from "util";
261
- import { existsSync, writeFileSync, readFileSync } from "fs";
261
+ import { existsSync, writeFileSync, readFileSync, statSync } from "fs";
262
262
  import { join } from "path";
263
263
  import { homedir, platform, arch } from "os";
264
264
  var execP = promisify(execCb);
@@ -431,16 +431,32 @@ async function runCloudSetup(inquirer, chalk, existingSubdomain) {
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
+ const localAppData = process.env.LOCALAPPDATA || `${process.env.USERPROFILE}\\AppData\\Local`;
435
+ const cfDir = `${localAppData}\\cloudflared`;
436
+ const cfExe = `${cfDir}\\cloudflared.exe`;
437
+ let found = false;
434
438
  try {
435
- execSync("winget install --id Cloudflare.cloudflared --accept-source-agreements --accept-package-agreements", { stdio: "pipe", timeout: 12e4 });
439
+ statSync(cfExe);
440
+ found = true;
436
441
  } catch {
437
- console.log(chalk.dim(" winget failed, trying direct download..."));
438
- const archStr = arch() === "arm64" ? "arm64" : "amd64";
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 });
442
+ }
443
+ if (!found) {
444
+ try {
445
+ execSync("winget install --id Cloudflare.cloudflared --accept-source-agreements --accept-package-agreements", { stdio: "pipe", timeout: 12e4 });
446
+ found = true;
447
+ } catch {
448
+ console.log(chalk.dim(" winget failed, trying direct download..."));
449
+ try {
450
+ const archStr = arch() === "arm64" ? "arm64" : "amd64";
451
+ const dlUrl = `https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-${archStr}.exe`;
452
+ execSync(`powershell -Command "New-Item -ItemType Directory -Force -Path '${cfDir}' | Out-Null; Invoke-WebRequest -Uri '${dlUrl}' -OutFile '${cfExe}'"`, { stdio: "inherit", timeout: 12e4 });
453
+ found = true;
454
+ } catch (dlErr) {
455
+ console.log(chalk.dim(` Download failed: ${dlErr.message?.substring(0, 100)}`));
456
+ }
457
+ }
458
+ }
459
+ if (found) {
444
460
  process.env.PATH = `${cfDir};${process.env.PATH}`;
445
461
  }
446
462
  } else {
@@ -1046,7 +1062,7 @@ async function promptRegistration(inquirer, chalk, ora, domain, companyName, adm
1046
1062
  // src/setup/provision.ts
1047
1063
  import { randomUUID, randomBytes as randomBytes2 } from "crypto";
1048
1064
  import { execSync as execSync2, spawn } from "child_process";
1049
- import { statSync, readFileSync as readFileSync2 } from "fs";
1065
+ import { statSync as statSync2, readFileSync as readFileSync2 } from "fs";
1050
1066
  import { join as join2 } from "path";
1051
1067
  import { homedir as homedir2 } from "os";
1052
1068
  function generateOrgId() {
@@ -1218,7 +1234,7 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
1218
1234
  const { deployTarget, company, database, domain, tunnel, cloud } = config;
1219
1235
  if (deployTarget === "cloudflare-tunnel" && tunnel) {
1220
1236
  spinner.start(`Starting local server on port ${tunnel.port}...`);
1221
- const { createServer: createServer2 } = await import("./server-ZFVGQJUL.js");
1237
+ const { createServer: createServer2 } = await import("./server-EJBLWFHI.js");
1222
1238
  const server2 = createServer2({ port: tunnel.port, db, jwtSecret });
1223
1239
  const handle2 = await server2.start();
1224
1240
  spinner.succeed("Server running");
@@ -1292,7 +1308,7 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
1292
1308
  const localAppData = process.env.LOCALAPPDATA || `${process.env.USERPROFILE}\\AppData\\Local`;
1293
1309
  const candidate = `${localAppData}\\cloudflared\\cloudflared.exe`;
1294
1310
  try {
1295
- statSync(candidate);
1311
+ statSync2(candidate);
1296
1312
  cfPath = candidate;
1297
1313
  } catch {
1298
1314
  }
@@ -1307,7 +1323,6 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
1307
1323
  const startScript = join2(amDir, "start.cjs");
1308
1324
  writeFileSync2(startScript, [
1309
1325
  `// Auto-generated by AgenticMail setup \u2014 do not edit`,
1310
- `const { execFileSync } = require('child_process');`,
1311
1326
  `const { readFileSync } = require('fs');`,
1312
1327
  `const { join } = require('path');`,
1313
1328
  `// Load .env`,
@@ -1316,13 +1331,13 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
1316
1331
  ` const lines = readFileSync(envFile, 'utf8').split('\\n');`,
1317
1332
  ` for (const line of lines) {`,
1318
1333
  ` const m = line.match(/^([A-Z_]+)=(.*)$/);`,
1319
- ` if (m) process.env[m[1]] = m[2];`,
1334
+ ` if (m && !process.env[m[1]]) process.env[m[1]] = m[2];`,
1320
1335
  ` }`,
1321
1336
  `} catch {}`,
1322
- `// Run the CLI`,
1337
+ `// Run via npx (shell:true handles .cmd on Windows)`,
1323
1338
  `const { spawnSync } = require('child_process');`,
1324
- `const r = spawnSync(process.execPath, [require.resolve('@agenticmail/enterprise/dist/cli.js'), 'start'], {`,
1325
- ` stdio: 'inherit', env: process.env`,
1339
+ `const r = spawnSync('npx', ['@agenticmail/enterprise', 'start'], {`,
1340
+ ` stdio: 'inherit', env: process.env, shell: true`,
1326
1341
  `});`,
1327
1342
  `process.exit(r.status || 0);`
1328
1343
  ].join("\n"));
@@ -1400,7 +1415,7 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
1400
1415
  const localAppData = process.env.LOCALAPPDATA || `${process.env.USERPROFILE}\\AppData\\Local`;
1401
1416
  const candidate = `${localAppData}\\cloudflared\\cloudflared.exe`;
1402
1417
  try {
1403
- statSync(candidate);
1418
+ statSync2(candidate);
1404
1419
  fallbackCfPath = candidate;
1405
1420
  } catch {
1406
1421
  }
@@ -1520,7 +1535,7 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
1520
1535
  return {};
1521
1536
  }
1522
1537
  spinner.start("Starting local server...");
1523
- const { createServer } = await import("./server-ZFVGQJUL.js");
1538
+ const { createServer } = await import("./server-EJBLWFHI.js");
1524
1539
  const server = createServer({ port: 3e3, db, jwtSecret });
1525
1540
  const handle = await server.start();
1526
1541
  spinner.succeed("Server running");
@@ -418,7 +418,7 @@ async function runCloudRecover(args, inquirer, chalk, ora) {
418
418
  const { execSync } = await import("child_process");
419
419
  const { platform, arch } = await import("os");
420
420
  try {
421
- execSync("which cloudflared", { timeout: 3e3 });
421
+ execSync(process.platform === "win32" ? "where cloudflared" : "which cloudflared", { timeout: 3e3 });
422
422
  console.log(chalk.green(" cloudflared already installed"));
423
423
  } catch {
424
424
  const spinner2 = ora("Installing cloudflared...").start();
@@ -94,7 +94,7 @@ async function runServe(_args) {
94
94
  process.exit(1);
95
95
  }
96
96
  const { createAdapter, smartDbConfig } = await import("./factory-RTZU2K54.js");
97
- const { createServer } = await import("./server-ZFVGQJUL.js");
97
+ const { createServer } = await import("./server-EJBLWFHI.js");
98
98
  const db = await createAdapter(smartDbConfig(DATABASE_URL));
99
99
  await db.migrate();
100
100
  const server = createServer({
@@ -128,21 +128,42 @@ async function runServe(_args) {
128
128
  try {
129
129
  const { execSync, spawn } = await import("child_process");
130
130
  try {
131
- execSync("which cloudflared", { timeout: 3e3 });
131
+ execSync(process.platform === "win32" ? "where cloudflared" : "which cloudflared", { timeout: 3e3 });
132
132
  } catch {
133
133
  console.log("[startup] cloudflared not found \u2014 skipping tunnel auto-start");
134
134
  console.log("[startup] Install cloudflared to enable tunnel: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/");
135
135
  return;
136
136
  }
137
137
  try {
138
- execSync('pgrep -f "cloudflared.*tunnel.*run"', { timeout: 3e3 });
139
- console.log("[startup] cloudflared tunnel already running");
140
- return;
138
+ if (process.platform === "win32") {
139
+ const tasklist = execSync('tasklist /FI "IMAGENAME eq cloudflared.exe" /NH', { encoding: "utf8", timeout: 5e3 });
140
+ if (tasklist.includes("cloudflared.exe")) {
141
+ console.log("[startup] cloudflared tunnel already running");
142
+ return;
143
+ }
144
+ } else {
145
+ execSync('pgrep -f "cloudflared.*tunnel.*run"', { timeout: 3e3 });
146
+ console.log("[startup] cloudflared tunnel already running");
147
+ return;
148
+ }
141
149
  } catch {
142
150
  }
143
151
  const subdomain = process.env.AGENTICMAIL_SUBDOMAIN || process.env.AGENTICMAIL_DOMAIN || "";
144
152
  console.log(`[startup] Starting cloudflared tunnel${subdomain ? ` for ${subdomain}.agenticmail.io` : ""}...`);
145
- const child = spawn("cloudflared", ["tunnel", "--no-autoupdate", "run", "--token", tunnelToken], {
153
+ let cfBin = "cloudflared";
154
+ if (process.platform === "win32") {
155
+ try {
156
+ cfBin = execSync("where cloudflared", { encoding: "utf8", timeout: 3e3 }).trim().split("\n")[0].trim();
157
+ } catch {
158
+ const candidate = `${process.env.LOCALAPPDATA || ""}\\cloudflared\\cloudflared.exe`;
159
+ try {
160
+ (await import("fs")).statSync(candidate);
161
+ cfBin = candidate;
162
+ } catch {
163
+ }
164
+ }
165
+ }
166
+ const child = spawn(cfBin, ["tunnel", "--no-autoupdate", "run", "--token", tunnelToken], {
146
167
  detached: true,
147
168
  stdio: "ignore"
148
169
  });
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ switch (command) {
14
14
  import("./cli-submit-skill-SNGAHVB7.js").then((m) => m.runSubmitSkill(args.slice(1))).catch(fatal);
15
15
  break;
16
16
  case "recover":
17
- import("./cli-recover-K7A4IIQY.js").then((m) => m.runRecover(args.slice(1))).catch(fatal);
17
+ import("./cli-recover-CO2RNTTL.js").then((m) => m.runRecover(args.slice(1))).catch(fatal);
18
18
  break;
19
19
  case "verify-domain":
20
20
  import("./cli-verify-7EMGBE46.js").then((m) => m.runVerifyDomain(args.slice(1))).catch(fatal);
@@ -57,14 +57,14 @@ Skill Development:
57
57
  break;
58
58
  case "serve":
59
59
  case "start":
60
- import("./cli-serve-DUUELMXK.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
60
+ import("./cli-serve-F6QWHAUX.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
61
61
  break;
62
62
  case "agent":
63
63
  import("./cli-agent-35EZUQ4N.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
64
64
  break;
65
65
  case "setup":
66
66
  default:
67
- import("./setup-PIBCCQVU.js").then((m) => m.runSetupWizard()).catch(fatal);
67
+ import("./setup-IXC3WPV2.js").then((m) => m.runSetupWizard()).catch(fatal);
68
68
  break;
69
69
  }
70
70
  function fatal(err) {
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  provision,
15
15
  runSetupWizard
16
- } from "./chunk-WV6DLTYP.js";
16
+ } from "./chunk-QJKE4CP4.js";
17
17
  import {
18
18
  AgentRuntime,
19
19
  EmailChannel,
@@ -42,7 +42,7 @@ import {
42
42
  requireRole,
43
43
  securityHeaders,
44
44
  validate
45
- } from "./chunk-URC3SFYD.js";
45
+ } from "./chunk-47GC5I25.js";
46
46
  import "./chunk-DJBCRQTD.js";
47
47
  import {
48
48
  PROVIDER_REGISTRY,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-URC3SFYD.js";
3
+ } from "./chunk-47GC5I25.js";
4
4
  import "./chunk-DJBCRQTD.js";
5
5
  import "./chunk-UF3ZJMJO.js";
6
6
  import "./chunk-JDBIUPHF.js";
@@ -6,7 +6,7 @@ import {
6
6
  promptRegistration,
7
7
  provision,
8
8
  runSetupWizard
9
- } from "./chunk-2DE62O56.js";
9
+ } from "./chunk-QJKE4CP4.js";
10
10
  import "./chunk-Z3I6GNTS.js";
11
11
  import "./chunk-KFQGP6VL.js";
12
12
  export {
@@ -129,3 +129,7 @@
129
129
  2026-03-05 08:08:16: 2026-03-05T07:08:16Z ERR error="unexpected EOF" connIndex=3 event=1 ingressRule=0 originService=http://localhost:3100
130
130
  2026-03-05 08:08:16: 2026-03-05T07:08:16Z ERR Request failed error="unexpected EOF" connIndex=3 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.200.53 type=http
131
131
  2026-03-05 08:08:16: 2026-03-05T07:08:16Z ERR Request failed error="unexpected EOF" connIndex=3 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.200.53 type=http
132
+ 2026-03-05 17:11:24: 2026-03-05T16:11:24Z ERR error="stream 2437 canceled by remote with error code 0" connIndex=3 event=1 ingressRule=0 originService=http://localhost:3100
133
+ 2026-03-05 17:11:24: 2026-03-05T16:11:24Z ERR error="stream 2433 canceled by remote with error code 0" connIndex=3 event=1 ingressRule=0 originService=http://localhost:3100
134
+ 2026-03-05 17:11:24: 2026-03-05T16:11:24Z ERR Request failed error="stream 2437 canceled by remote with error code 0" connIndex=3 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.200.53 type=http
135
+ 2026-03-05 17:11:24: 2026-03-05T16:11:24Z ERR Request failed error="stream 2433 canceled by remote with error code 0" connIndex=3 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.200.53 type=http
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.345",
3
+ "version": "0.5.347",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {