@agenticmail/enterprise 0.5.329 → 0.5.330

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.
@@ -125,3 +125,7 @@
125
125
  2026-03-05 08:04:33: 2026-03-05T07:04:33Z ERR Request failed error="stream 2045 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
126
126
  2026-03-05 08:04:33: 2026-03-05T07:04:33Z ERR error="stream 2049 canceled by remote with error code 0" connIndex=3 event=1 ingressRule=0 originService=http://localhost:3100
127
127
  2026-03-05 08:04:33: 2026-03-05T07:04:33Z ERR Request failed error="stream 2049 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
128
+ 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
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
+ 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
+ 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
@@ -14,3 +14,4 @@
14
14
  2026-03-05 08:01:40: Loaded config from /Users/ope/Desktop/projects/agenticmail/enterprise/.env
15
15
  2026-03-05 08:01:57: Loaded config from /Users/ope/Desktop/projects/agenticmail/enterprise/.env
16
16
  2026-03-05 08:04:00: Loaded config from /Users/ope/Desktop/projects/agenticmail/enterprise/.env
17
+ 2026-03-05 08:08:16: Loaded config from /Users/ope/Desktop/projects/agenticmail/enterprise/.env
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.329",
3
+ "version": "0.5.330",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,8 @@
18
18
  "scripts": {
19
19
  "build": "tsup src/index.ts src/cli.ts src/registry/cli.ts --format esm --external better-sqlite3 --external mongodb --external mysql2 --external @libsql/client --external @aws-sdk/client-dynamodb --external @aws-sdk/lib-dynamodb --external @aws-sdk/client-s3 --external @aws-sdk/s3-request-presigner --external @google-cloud/storage --external @azure/storage-blob --external @mozilla/readability --external imapflow --external nodemailer --external linkedom --external postgres --external playwright-core --external ws --external express && mkdir -p dist/dashboard/components dist/dashboard/pages dist/dashboard/vendor dist/dashboard/assets dist/registry && cp src/dashboard/index.html dist/dashboard/ && cp src/dashboard/app.js dist/dashboard/ && cp src/dashboard/components/*.js dist/dashboard/components/ && cp src/dashboard/pages/*.js dist/dashboard/pages/ && rm -rf dist/dashboard/pages/agent-detail && cp -r src/dashboard/pages/agent-detail dist/dashboard/pages/agent-detail && cp src/dashboard/vendor/*.js dist/dashboard/vendor/ && cp -r src/dashboard/assets/* dist/dashboard/assets/ && mkdir -p dist/dashboard/data && cp src/dashboard/data/*.js dist/dashboard/data/ && mkdir -p dist/dashboard/docs && cp src/dashboard/docs/*.html dist/dashboard/docs/ && cp src/dashboard/docs/*.css dist/dashboard/docs/ && mkdir -p dist/assets && cp src/engine/assets/* dist/assets/ && cp src/engine/soul-templates.json dist/",
20
20
  "dev": "npm run build && node --watch start-live.mjs",
21
- "rebuild": "npm run build && pm2 restart enterprise"
21
+ "rebuild": "npm run build && pm2 restart enterprise",
22
+ "preuninstall": "node scripts/preuninstall.js"
22
23
  },
23
24
  "keywords": [
24
25
  "ai",
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Pre-uninstall cleanup for @agenticmail/enterprise
4
+ * Stops PM2 processes and removes LaunchAgent if present.
5
+ * Does NOT delete user data (database, config files) — that's the user's responsibility.
6
+ */
7
+
8
+ const { execSync } = require('child_process');
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const os = require('os');
12
+
13
+ function run(cmd, opts = {}) {
14
+ try {
15
+ return execSync(cmd, { stdio: 'pipe', timeout: 10000, ...opts }).toString().trim();
16
+ } catch { return ''; }
17
+ }
18
+
19
+ function log(msg) { console.log(`[agenticmail-uninstall] ${msg}`); }
20
+
21
+ try {
22
+ // 1. Stop PM2 processes
23
+ const pm2List = run('pm2 jlist');
24
+ if (pm2List) {
25
+ try {
26
+ const procs = JSON.parse(pm2List);
27
+ const ours = procs.filter(p =>
28
+ p.name === 'enterprise' ||
29
+ (p.pm2_env && p.pm2_env.pm_exec_path && p.pm2_env.pm_exec_path.includes('agenticmail'))
30
+ );
31
+ for (const proc of ours) {
32
+ log(`Stopping PM2 process: ${proc.name} (pid ${proc.pid})`);
33
+ run(`pm2 delete ${proc.pm_id}`);
34
+ }
35
+ if (ours.length > 0) {
36
+ run('pm2 save');
37
+ log(`Stopped and removed ${ours.length} PM2 process(es)`);
38
+ }
39
+ } catch { /* pm2 not available or parse error */ }
40
+ }
41
+
42
+ // 2. Remove LaunchAgent (macOS auto-start)
43
+ if (process.platform === 'darwin') {
44
+ const plistDir = path.join(os.homedir(), 'Library', 'LaunchAgents');
45
+ const plistFiles = ['com.PM2.plist', 'com.agenticmail.plist', 'pm2.' + os.userInfo().username + '.plist'];
46
+ for (const pf of plistFiles) {
47
+ const plistPath = path.join(plistDir, pf);
48
+ if (fs.existsSync(plistPath)) {
49
+ run(`launchctl unload "${plistPath}"`);
50
+ log(`Unloaded LaunchAgent: ${pf}`);
51
+ }
52
+ }
53
+ }
54
+
55
+ // 3. Remove systemd service (Linux auto-start)
56
+ if (process.platform === 'linux') {
57
+ const serviceFiles = [
58
+ path.join(os.homedir(), '.config', 'systemd', 'user', 'agenticmail.service'),
59
+ '/etc/systemd/system/agenticmail.service',
60
+ ];
61
+ for (const sf of serviceFiles) {
62
+ if (fs.existsSync(sf)) {
63
+ const name = path.basename(sf);
64
+ run(`systemctl --user disable ${name} 2>/dev/null || systemctl disable ${name} 2>/dev/null`);
65
+ run(`systemctl --user stop ${name} 2>/dev/null || systemctl stop ${name} 2>/dev/null`);
66
+ log(`Disabled systemd service: ${name}`);
67
+ }
68
+ }
69
+ }
70
+
71
+ log('Cleanup complete. Your database and config files have been preserved.');
72
+ log('To fully remove all data, delete your ~/.agenticmail/ directory and drop your database.');
73
+
74
+ } catch (e) {
75
+ // Never block uninstall
76
+ console.error('[agenticmail-uninstall] Warning: cleanup had errors:', e.message);
77
+ }