@agenticmail/enterprise 0.5.371 → 0.5.372

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.
@@ -0,0 +1,501 @@
1
+ import {
2
+ getAllCreateStatements
3
+ } from "./chunk-UDEOGAGB.js";
4
+ import {
5
+ DatabaseAdapter
6
+ } from "./chunk-FLRYMSKY.js";
7
+ import "./chunk-KFQGP6VL.js";
8
+
9
+ // src/db/turso.ts
10
+ import { randomUUID, createHash } from "crypto";
11
+ var libsqlClient;
12
+ async function getClient() {
13
+ if (!libsqlClient) {
14
+ try {
15
+ const { resolveDriver } = await import("./resolve-driver-CGIO5QM7.js");
16
+ libsqlClient = await resolveDriver("@libsql/client", "Turso/LibSQL driver not found. Install it: npm install @libsql/client");
17
+ } catch {
18
+ throw new Error("Turso driver not found. Install: npm install @libsql/client");
19
+ }
20
+ }
21
+ return libsqlClient;
22
+ }
23
+ var TursoAdapter = class extends DatabaseAdapter {
24
+ type = "turso";
25
+ client = null;
26
+ async connect(config) {
27
+ const lib = await getClient();
28
+ this.client = lib.createClient({
29
+ url: config.connectionString || "file:./agenticmail-enterprise.db",
30
+ authToken: config.authToken
31
+ });
32
+ }
33
+ async disconnect() {
34
+ if (this.client) this.client.close();
35
+ }
36
+ isConnected() {
37
+ return this.client !== null;
38
+ }
39
+ // ─── Engine Integration ──────────────────────────────────
40
+ getEngineDB() {
41
+ if (!this.client) return null;
42
+ const client = this.client;
43
+ return {
44
+ run: async (sql, params) => {
45
+ await client.execute({ sql, args: params || [] });
46
+ },
47
+ get: async (sql, params) => {
48
+ const result = await client.execute({ sql, args: params || [] });
49
+ return result.rows?.[0] || void 0;
50
+ },
51
+ all: async (sql, params) => {
52
+ const result = await client.execute({ sql, args: params || [] });
53
+ return result.rows || [];
54
+ }
55
+ };
56
+ }
57
+ getDialect() {
58
+ return "turso";
59
+ }
60
+ async run(sql, args = []) {
61
+ return this.client.execute({ sql, args });
62
+ }
63
+ async get(sql, args = []) {
64
+ const result = await this.run(sql, args);
65
+ if (!result.rows || result.rows.length === 0) return null;
66
+ return result.rows[0];
67
+ }
68
+ async all(sql, args = []) {
69
+ const result = await this.run(sql, args);
70
+ return result.rows || [];
71
+ }
72
+ async migrate() {
73
+ const stmts = getAllCreateStatements();
74
+ await this.client.batch(
75
+ stmts.map((sql) => ({ sql, args: [] })).concat([
76
+ { sql: `INSERT OR IGNORE INTO retention_policy (id) VALUES ('default')`, args: [] }
77
+ ]),
78
+ "write"
79
+ );
80
+ }
81
+ // ─── Company ─────────────────────────────────────────────
82
+ async getSettings() {
83
+ const r = await this.get("SELECT * FROM company_settings WHERE id = ?", ["default"]);
84
+ return r ? this.mapSettings(r) : null;
85
+ }
86
+ async updateSettings(updates) {
87
+ const map = {
88
+ name: "name",
89
+ domain: "domain",
90
+ subdomain: "subdomain",
91
+ smtpHost: "smtp_host",
92
+ smtpPort: "smtp_port",
93
+ smtpUser: "smtp_user",
94
+ smtpPass: "smtp_pass",
95
+ dkimPrivateKey: "dkim_private_key",
96
+ logoUrl: "logo_url",
97
+ primaryColor: "primary_color",
98
+ plan: "plan",
99
+ deploymentKeyHash: "deployment_key_hash",
100
+ domainRegistrationId: "domain_registration_id",
101
+ domainDnsChallenge: "domain_dns_challenge",
102
+ domainVerifiedAt: "domain_verified_at",
103
+ domainRegisteredAt: "domain_registered_at",
104
+ domainStatus: "domain_status"
105
+ };
106
+ const sets = [];
107
+ const vals = [];
108
+ for (const [key, col] of Object.entries(map)) {
109
+ if (updates[key] !== void 0) {
110
+ sets.push(`${col} = ?`);
111
+ vals.push(updates[key]);
112
+ }
113
+ }
114
+ if (updates.ssoConfig !== void 0) {
115
+ sets.push("sso_config = ?");
116
+ vals.push(JSON.stringify(updates.ssoConfig));
117
+ }
118
+ if (updates.toolSecurityConfig !== void 0) {
119
+ sets.push("tool_security_config = ?");
120
+ vals.push(JSON.stringify(updates.toolSecurityConfig));
121
+ }
122
+ if (updates.firewallConfig !== void 0) {
123
+ sets.push("firewall_config = ?");
124
+ vals.push(JSON.stringify(updates.firewallConfig));
125
+ }
126
+ if (updates.modelPricingConfig !== void 0) {
127
+ sets.push("model_pricing_config = ?");
128
+ vals.push(JSON.stringify(updates.modelPricingConfig));
129
+ }
130
+ if (updates.securityConfig !== void 0) {
131
+ sets.push("security_config = ?");
132
+ vals.push(JSON.stringify(updates.securityConfig));
133
+ }
134
+ sets.push("updated_at = datetime('now')");
135
+ vals.push("default");
136
+ await this.run(`UPDATE company_settings SET ${sets.join(", ")} WHERE id = ?`, vals);
137
+ return this.getSettings();
138
+ }
139
+ // ─── Agents ──────────────────────────────────────────────
140
+ async createAgent(input) {
141
+ const id = input.id || randomUUID();
142
+ const email = input.email || `${input.name.toLowerCase().replace(/\s+/g, "-")}@localhost`;
143
+ await this.run(
144
+ `INSERT INTO agents (id, name, email, role, metadata, created_by) VALUES (?, ?, ?, ?, ?, ?)`,
145
+ [id, input.name, email, input.role || "assistant", JSON.stringify(input.metadata || {}), input.createdBy]
146
+ );
147
+ return await this.getAgent(id);
148
+ }
149
+ async getAgent(id) {
150
+ const r = await this.get("SELECT * FROM agents WHERE id = ?", [id]);
151
+ return r ? this.mapAgent(r) : null;
152
+ }
153
+ async getAgentByName(name) {
154
+ const r = await this.get("SELECT * FROM agents WHERE name = ?", [name]);
155
+ return r ? this.mapAgent(r) : null;
156
+ }
157
+ async listAgents(opts) {
158
+ let q = "SELECT * FROM agents";
159
+ const params = [];
160
+ if (opts?.status) {
161
+ q += " WHERE status = ?";
162
+ params.push(opts.status);
163
+ }
164
+ q += " ORDER BY created_at DESC";
165
+ if (opts?.limit) q += ` LIMIT ${opts.limit}`;
166
+ if (opts?.offset) q += ` OFFSET ${opts.offset}`;
167
+ return (await this.all(q, params)).map((r) => this.mapAgent(r));
168
+ }
169
+ async updateAgent(id, updates) {
170
+ const fields = [];
171
+ const vals = [];
172
+ for (const [key, col] of Object.entries({ name: "name", email: "email", role: "role", status: "status" })) {
173
+ if (updates[key] !== void 0) {
174
+ fields.push(`${col} = ?`);
175
+ vals.push(updates[key]);
176
+ }
177
+ }
178
+ if (updates.metadata) {
179
+ fields.push("metadata = ?");
180
+ vals.push(JSON.stringify(updates.metadata));
181
+ }
182
+ fields.push("updated_at = datetime('now')");
183
+ vals.push(id);
184
+ await this.run(`UPDATE agents SET ${fields.join(", ")} WHERE id = ?`, vals);
185
+ return await this.getAgent(id);
186
+ }
187
+ async archiveAgent(id) {
188
+ await this.run("UPDATE agents SET status = 'archived', updated_at = datetime('now') WHERE id = ?", [id]);
189
+ }
190
+ async deleteAgent(id) {
191
+ await this.run("DELETE FROM agents WHERE id = ?", [id]);
192
+ }
193
+ async countAgents(status) {
194
+ const r = status ? await this.get("SELECT COUNT(*) as c FROM agents WHERE status = ?", [status]) : await this.get("SELECT COUNT(*) as c FROM agents", []);
195
+ return r.c;
196
+ }
197
+ // ─── Users ───────────────────────────────────────────────
198
+ async createUser(input) {
199
+ const id = randomUUID();
200
+ let passwordHash = null;
201
+ if (input.password) {
202
+ const { default: bcrypt } = await import("bcryptjs");
203
+ passwordHash = await bcrypt.hash(input.password, 12);
204
+ }
205
+ await this.run(
206
+ `INSERT INTO users (id, email, name, role, password_hash, sso_provider, sso_subject) VALUES (?, ?, ?, ?, ?, ?, ?)`,
207
+ [id, input.email, input.name, input.role, passwordHash, input.ssoProvider || null, input.ssoSubject || null]
208
+ );
209
+ return await this.getUser(id);
210
+ }
211
+ async getUser(id) {
212
+ const r = await this.get("SELECT * FROM users WHERE id = ?", [id]);
213
+ return r ? this.mapUser(r) : null;
214
+ }
215
+ async getUserByEmail(email) {
216
+ const r = await this.get("SELECT * FROM users WHERE email = ?", [email]);
217
+ return r ? this.mapUser(r) : null;
218
+ }
219
+ async getUserBySso(provider, subject) {
220
+ const r = await this.get("SELECT * FROM users WHERE sso_provider = ? AND sso_subject = ?", [provider, subject]);
221
+ return r ? this.mapUser(r) : null;
222
+ }
223
+ async listUsers(opts) {
224
+ let q = "SELECT * FROM users ORDER BY created_at DESC";
225
+ if (opts?.limit) q += ` LIMIT ${opts.limit}`;
226
+ if (opts?.offset) q += ` OFFSET ${opts.offset}`;
227
+ return (await this.all(q)).map((r) => this.mapUser(r));
228
+ }
229
+ async updateUser(id, updates) {
230
+ const fields = [];
231
+ const vals = [];
232
+ for (const key of ["email", "name", "role"]) {
233
+ if (updates[key] !== void 0) {
234
+ fields.push(`${key} = ?`);
235
+ vals.push(updates[key]);
236
+ }
237
+ }
238
+ fields.push("updated_at = datetime('now')");
239
+ vals.push(id);
240
+ await this.run(`UPDATE users SET ${fields.join(", ")} WHERE id = ?`, vals);
241
+ return await this.getUser(id);
242
+ }
243
+ async deleteUser(id) {
244
+ await this.run("DELETE FROM users WHERE id = ?", [id]);
245
+ }
246
+ // ─── Audit ───────────────────────────────────────────────
247
+ async logEvent(event) {
248
+ await this.run(
249
+ `INSERT INTO audit_log (id, actor, actor_type, action, resource, details, ip) VALUES (?, ?, ?, ?, ?, ?, ?)`,
250
+ [randomUUID(), event.actor, event.actorType, event.action, event.resource, JSON.stringify(event.details || {}), event.ip || null]
251
+ );
252
+ }
253
+ async queryAudit(filters) {
254
+ const where = [];
255
+ const params = [];
256
+ if (filters.actor) {
257
+ where.push("actor = ?");
258
+ params.push(filters.actor);
259
+ }
260
+ if (filters.action) {
261
+ where.push("action = ?");
262
+ params.push(filters.action);
263
+ }
264
+ if (filters.resource) {
265
+ where.push("resource LIKE ?");
266
+ params.push(`%${filters.resource}%`);
267
+ }
268
+ if (filters.from) {
269
+ where.push("timestamp >= ?");
270
+ params.push(filters.from.toISOString());
271
+ }
272
+ if (filters.to) {
273
+ where.push("timestamp <= ?");
274
+ params.push(filters.to.toISOString());
275
+ }
276
+ const wc = where.length > 0 ? `WHERE ${where.join(" AND ")}` : "";
277
+ const countRow = await this.get(`SELECT COUNT(*) as c FROM audit_log ${wc}`, params);
278
+ let q = `SELECT * FROM audit_log ${wc} ORDER BY timestamp DESC`;
279
+ if (filters.limit) q += ` LIMIT ${filters.limit}`;
280
+ if (filters.offset) q += ` OFFSET ${filters.offset}`;
281
+ const rows = await this.all(q, params);
282
+ return {
283
+ events: rows.map((r) => ({
284
+ id: r.id,
285
+ timestamp: new Date(r.timestamp),
286
+ actor: r.actor,
287
+ actorType: r.actor_type,
288
+ action: r.action,
289
+ resource: r.resource,
290
+ details: JSON.parse(r.details || "{}"),
291
+ ip: r.ip
292
+ })),
293
+ total: countRow.c
294
+ };
295
+ }
296
+ // ─── API Keys ────────────────────────────────────────────
297
+ async createApiKey(input) {
298
+ const id = randomUUID();
299
+ const plaintext = `ek_${randomUUID().replace(/-/g, "")}`;
300
+ const keyHash = createHash("sha256").update(plaintext).digest("hex");
301
+ const keyPrefix = plaintext.substring(0, 11);
302
+ await this.run(
303
+ `INSERT INTO api_keys (id, name, key_hash, key_prefix, scopes, created_by, expires_at) VALUES (?, ?, ?, ?, ?, ?, ?)`,
304
+ [id, input.name, keyHash, keyPrefix, JSON.stringify(input.scopes), input.createdBy, input.expiresAt?.toISOString() || null]
305
+ );
306
+ return { key: await this.getApiKey(id), plaintext };
307
+ }
308
+ async getApiKey(id) {
309
+ const r = await this.get("SELECT * FROM api_keys WHERE id = ?", [id]);
310
+ return r ? this.mapApiKey(r) : null;
311
+ }
312
+ async validateApiKey(plaintext) {
313
+ const keyHash = createHash("sha256").update(plaintext).digest("hex");
314
+ const r = await this.get("SELECT * FROM api_keys WHERE key_hash = ? AND revoked = 0", [keyHash]);
315
+ if (!r) return null;
316
+ const key = this.mapApiKey(r);
317
+ if (key.expiresAt && /* @__PURE__ */ new Date() > key.expiresAt) return null;
318
+ await this.run("UPDATE api_keys SET last_used_at = datetime('now') WHERE id = ?", [key.id]);
319
+ return key;
320
+ }
321
+ async listApiKeys(opts) {
322
+ let q = "SELECT * FROM api_keys";
323
+ const params = [];
324
+ if (opts?.createdBy) {
325
+ q += " WHERE created_by = ?";
326
+ params.push(opts.createdBy);
327
+ }
328
+ q += " ORDER BY created_at DESC";
329
+ return (await this.all(q, params)).map((r) => this.mapApiKey(r));
330
+ }
331
+ async revokeApiKey(id) {
332
+ await this.run("UPDATE api_keys SET revoked = 1 WHERE id = ?", [id]);
333
+ }
334
+ // ─── Rules ───────────────────────────────────────────────
335
+ async createRule(rule) {
336
+ const id = randomUUID();
337
+ await this.run(
338
+ `INSERT INTO email_rules (id, name, agent_id, conditions, actions, priority, enabled) VALUES (?, ?, ?, ?, ?, ?, ?)`,
339
+ [id, rule.name, rule.agentId || null, JSON.stringify(rule.conditions), JSON.stringify(rule.actions), rule.priority, rule.enabled ? 1 : 0]
340
+ );
341
+ const r = await this.get("SELECT * FROM email_rules WHERE id = ?", [id]);
342
+ return this.mapRule(r);
343
+ }
344
+ async getRules(agentId) {
345
+ let q = "SELECT * FROM email_rules";
346
+ const params = [];
347
+ if (agentId) {
348
+ q += " WHERE agent_id = ? OR agent_id IS NULL";
349
+ params.push(agentId);
350
+ }
351
+ q += " ORDER BY priority DESC";
352
+ return (await this.all(q, params)).map((r) => this.mapRule(r));
353
+ }
354
+ async updateRule(id, updates) {
355
+ const fields = [];
356
+ const vals = [];
357
+ if (updates.name !== void 0) {
358
+ fields.push("name = ?");
359
+ vals.push(updates.name);
360
+ }
361
+ if (updates.conditions) {
362
+ fields.push("conditions = ?");
363
+ vals.push(JSON.stringify(updates.conditions));
364
+ }
365
+ if (updates.actions) {
366
+ fields.push("actions = ?");
367
+ vals.push(JSON.stringify(updates.actions));
368
+ }
369
+ if (updates.priority !== void 0) {
370
+ fields.push("priority = ?");
371
+ vals.push(updates.priority);
372
+ }
373
+ if (updates.enabled !== void 0) {
374
+ fields.push("enabled = ?");
375
+ vals.push(updates.enabled ? 1 : 0);
376
+ }
377
+ fields.push("updated_at = datetime('now')");
378
+ vals.push(id);
379
+ await this.run(`UPDATE email_rules SET ${fields.join(", ")} WHERE id = ?`, vals);
380
+ const r = await this.get("SELECT * FROM email_rules WHERE id = ?", [id]);
381
+ return this.mapRule(r);
382
+ }
383
+ async deleteRule(id) {
384
+ await this.run("DELETE FROM email_rules WHERE id = ?", [id]);
385
+ }
386
+ // ─── Retention ───────────────────────────────────────────
387
+ async getRetentionPolicy() {
388
+ const r = await this.get("SELECT * FROM retention_policy WHERE id = ?", ["default"]);
389
+ if (!r) return { enabled: false, retainDays: 365, archiveFirst: true };
390
+ return { enabled: !!r.enabled, retainDays: r.retain_days, excludeTags: JSON.parse(r.exclude_tags || "[]"), archiveFirst: !!r.archive_first };
391
+ }
392
+ async setRetentionPolicy(policy) {
393
+ await this.run(
394
+ `UPDATE retention_policy SET enabled = ?, retain_days = ?, exclude_tags = ?, archive_first = ? WHERE id = 'default'`,
395
+ [policy.enabled ? 1 : 0, policy.retainDays, JSON.stringify(policy.excludeTags || []), policy.archiveFirst ? 1 : 0]
396
+ );
397
+ }
398
+ // ─── Stats ───────────────────────────────────────────────
399
+ async getStats() {
400
+ const [total, active, users, audit] = await Promise.all([
401
+ this.get("SELECT COUNT(*) as c FROM agents"),
402
+ this.get("SELECT COUNT(*) as c FROM agents WHERE status = 'active'"),
403
+ this.get("SELECT COUNT(*) as c FROM users"),
404
+ this.get("SELECT COUNT(*) as c FROM audit_log")
405
+ ]);
406
+ return {
407
+ totalAgents: total.c,
408
+ activeAgents: active.c,
409
+ totalUsers: users.c,
410
+ totalEmails: 0,
411
+ totalAuditEvents: audit.c
412
+ };
413
+ }
414
+ // ─── Mappers ─────────────────────────────────────────────
415
+ mapAgent(r) {
416
+ return {
417
+ id: r.id,
418
+ name: r.name,
419
+ email: r.email,
420
+ role: r.role,
421
+ status: r.status,
422
+ metadata: typeof r.metadata === "string" ? JSON.parse(r.metadata) : r.metadata || {},
423
+ createdAt: new Date(r.created_at),
424
+ updatedAt: new Date(r.updated_at),
425
+ createdBy: r.created_by
426
+ };
427
+ }
428
+ mapUser(r) {
429
+ return {
430
+ id: r.id,
431
+ email: r.email,
432
+ name: r.name,
433
+ role: r.role,
434
+ passwordHash: r.password_hash,
435
+ ssoProvider: r.sso_provider,
436
+ ssoSubject: r.sso_subject,
437
+ createdAt: new Date(r.created_at),
438
+ updatedAt: new Date(r.updated_at),
439
+ lastLoginAt: r.last_login_at ? new Date(r.last_login_at) : void 0
440
+ };
441
+ }
442
+ mapApiKey(r) {
443
+ return {
444
+ id: r.id,
445
+ name: r.name,
446
+ keyHash: r.key_hash,
447
+ keyPrefix: r.key_prefix,
448
+ scopes: typeof r.scopes === "string" ? JSON.parse(r.scopes) : r.scopes || [],
449
+ createdBy: r.created_by,
450
+ createdAt: new Date(r.created_at),
451
+ lastUsedAt: r.last_used_at ? new Date(r.last_used_at) : void 0,
452
+ expiresAt: r.expires_at ? new Date(r.expires_at) : void 0,
453
+ revoked: !!r.revoked
454
+ };
455
+ }
456
+ mapRule(r) {
457
+ return {
458
+ id: r.id,
459
+ name: r.name,
460
+ agentId: r.agent_id,
461
+ conditions: typeof r.conditions === "string" ? JSON.parse(r.conditions) : r.conditions || {},
462
+ actions: typeof r.actions === "string" ? JSON.parse(r.actions) : r.actions || {},
463
+ priority: r.priority,
464
+ enabled: !!r.enabled,
465
+ createdAt: new Date(r.created_at),
466
+ updatedAt: new Date(r.updated_at)
467
+ };
468
+ }
469
+ mapSettings(r) {
470
+ return {
471
+ id: r.id,
472
+ name: r.name,
473
+ domain: r.domain,
474
+ subdomain: r.subdomain,
475
+ smtpHost: r.smtp_host,
476
+ smtpPort: r.smtp_port,
477
+ smtpUser: r.smtp_user,
478
+ smtpPass: r.smtp_pass,
479
+ dkimPrivateKey: r.dkim_private_key,
480
+ logoUrl: r.logo_url,
481
+ primaryColor: r.primary_color,
482
+ ssoConfig: r.sso_config ? typeof r.sso_config === "string" ? JSON.parse(r.sso_config) : r.sso_config : void 0,
483
+ toolSecurityConfig: r.tool_security_config ? typeof r.tool_security_config === "string" ? JSON.parse(r.tool_security_config) : r.tool_security_config : {},
484
+ securityConfig: r.security_config ? typeof r.security_config === "string" ? JSON.parse(r.security_config) : r.security_config : {},
485
+ firewallConfig: r.firewall_config ? typeof r.firewall_config === "string" ? JSON.parse(r.firewall_config) : r.firewall_config : {},
486
+ modelPricingConfig: r.model_pricing_config ? typeof r.model_pricing_config === "string" ? JSON.parse(r.model_pricing_config) : r.model_pricing_config : {},
487
+ plan: r.plan,
488
+ createdAt: new Date(r.created_at),
489
+ updatedAt: new Date(r.updated_at),
490
+ deploymentKeyHash: r.deployment_key_hash,
491
+ domainRegistrationId: r.domain_registration_id,
492
+ domainDnsChallenge: r.domain_dns_challenge,
493
+ domainVerifiedAt: r.domain_verified_at || void 0,
494
+ domainRegisteredAt: r.domain_registered_at || void 0,
495
+ domainStatus: r.domain_status || "unregistered"
496
+ };
497
+ }
498
+ };
499
+ export {
500
+ TursoAdapter
501
+ };
@@ -175,3 +175,33 @@
175
175
  2026-03-05 21:40:08: 2026-03-05T20:40:08Z ERR Request failed error="stream 1937 canceled by remote with error code 0" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
176
176
  2026-03-05 21:40:56: 2026-03-05T20:40:56Z ERR error="stream 1945 canceled by remote with error code 0" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
177
177
  2026-03-05 21:40:56: 2026-03-05T20:40:56Z ERR Request failed error="stream 1945 canceled by remote with error code 0" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/task-pipeline/stream event=0 ip=198.41.192.107 type=http
178
+ 2026-03-05 21:41:36: 2026-03-05T20:41:36Z ERR error="unexpected EOF" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
179
+ 2026-03-05 21:41:36: 2026-03-05T20:41:36Z ERR Request failed error="unexpected EOF" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
180
+ 2026-03-05 21:41:36: 2026-03-05T20:41:36Z ERR error="unexpected EOF" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
181
+ 2026-03-05 21:41:36: 2026-03-05T20:41:36Z ERR Request failed error="unexpected EOF" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
182
+ 2026-03-05 21:41:36: 2026-03-05T20:41:36Z ERR error="unexpected EOF" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
183
+ 2026-03-05 21:41:36: 2026-03-05T20:41:36Z ERR Request failed error="unexpected EOF" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
184
+ 2026-03-05 21:41:36: 2026-03-05T20:41:36Z ERR error="unexpected EOF" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
185
+ 2026-03-05 21:41:36: 2026-03-05T20:41:36Z ERR Request failed error="unexpected EOF" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
186
+ 2026-03-05 21:43:26: 2026-03-05T20:43:26Z ERR error="unexpected EOF" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
187
+ 2026-03-05 21:43:26: 2026-03-05T20:43:26Z ERR Request failed error="unexpected EOF" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
188
+ 2026-03-05 21:43:26: 2026-03-05T20:43:26Z ERR error="unexpected EOF" connIndex=2 event=1 ingressRule=0 originService=http://localhost:3100
189
+ 2026-03-05 21:43:26: 2026-03-05T20:43:26Z ERR Request failed error="unexpected EOF" connIndex=2 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.57 type=http
190
+ 2026-03-05 21:43:26: 2026-03-05T20:43:26Z ERR error="unexpected EOF" connIndex=2 event=1 ingressRule=0 originService=http://localhost:3100
191
+ 2026-03-05 21:43:26: 2026-03-05T20:43:26Z ERR Request failed error="unexpected EOF" connIndex=2 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.57 type=http
192
+ 2026-03-05 21:43:26: 2026-03-05T20:43:26Z ERR error="unexpected EOF" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
193
+ 2026-03-05 21:43:26: 2026-03-05T20:43:26Z ERR Request failed error="unexpected EOF" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
194
+ 2026-03-05 21:43:29: 2026-03-05T20:43:29Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
195
+ 2026-03-05 21:43:29: 2026-03-05T20:43:29Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
196
+ 2026-03-05 21:43:29: 2026-03-05T20:43:29Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
197
+ 2026-03-05 21:43:29: 2026-03-05T20:43:29Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
198
+ 2026-03-05 21:43:29: 2026-03-05T20:43:29Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=3 event=1 ingressRule=0 originService=http://localhost:3100
199
+ 2026-03-05 21:43:29: 2026-03-05T20:43:29Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" 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
200
+ 2026-03-05 21:43:29: 2026-03-05T20:43:29Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=3 event=1 ingressRule=0 originService=http://localhost:3100
201
+ 2026-03-05 21:43:29: 2026-03-05T20:43:29Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" 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
202
+ 2026-03-05 21:44:20: 2026-03-05T20:44:20Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=1 event=1 ingressRule=0 originService=http://localhost:3100
203
+ 2026-03-05 21:44:20: 2026-03-05T20:44:20Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=1 dest=https://enterprise.agenticmail.io/dashboard/agents/3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.200.63 type=http
204
+ 2026-03-05 21:44:20: 2026-03-05T20:44:20Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
205
+ 2026-03-05 21:44:20: 2026-03-05T20:44:20Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=0 dest=https://enterprise.agenticmail.io/favicon.ico event=0 ip=198.41.192.107 type=http
206
+ 2026-03-05 21:44:54: 2026-03-05T20:44:54Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=0 event=1 ingressRule=0 originService=http://localhost:3100
207
+ 2026-03-05 21:44:54: 2026-03-05T20:44:54Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp [::1]:3100: connect: connection refused" connIndex=0 dest=https://enterprise.agenticmail.io/dashboard/agents/3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.107 type=http
@@ -222,3 +222,4 @@
222
222
  2026-03-05 20:50:21: }
223
223
  2026-03-05 20:50:21: }
224
224
  2026-03-05 21:38:44: Loaded config from /Users/ope/Desktop/projects/agenticmail/enterprise/.env
225
+ 2026-03-05 21:41:36: 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.371",
3
+ "version": "0.5.372",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -111,7 +111,8 @@
111
111
  "better-sqlite3": "^11.0.0",
112
112
  "mongodb": "^6.3.0",
113
113
  "mysql2": "^3.9.0",
114
- "postgres": "^3.4.0"
114
+ "postgres": "^3.4.0",
115
+ "pg": "^8.13.0"
115
116
  },
116
117
  "engines": {
117
118
  "node": ">=20.0.0"