@agenticmail/enterprise 0.5.67 → 0.5.69

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,47 @@
1
+ import {
2
+ AgentRuntime,
3
+ EmailChannel,
4
+ FollowUpScheduler,
5
+ SessionManager,
6
+ SubAgentManager,
7
+ ToolRegistry,
8
+ callLLM,
9
+ createAgentRuntime,
10
+ createNoopHooks,
11
+ createRuntimeHooks,
12
+ estimateMessageTokens,
13
+ estimateTokens,
14
+ executeTool,
15
+ runAgentLoop,
16
+ toolsToDefinitions
17
+ } from "./chunk-E2QHM43W.js";
18
+ import "./chunk-TYW5XTOW.js";
19
+ import "./chunk-JLSQOQ5L.js";
20
+ import {
21
+ PROVIDER_REGISTRY,
22
+ listAllProviders,
23
+ resolveApiKeyForProvider,
24
+ resolveProvider
25
+ } from "./chunk-67KZYSLU.js";
26
+ import "./chunk-KFQGP6VL.js";
27
+ export {
28
+ AgentRuntime,
29
+ EmailChannel,
30
+ FollowUpScheduler,
31
+ PROVIDER_REGISTRY,
32
+ SessionManager,
33
+ SubAgentManager,
34
+ ToolRegistry,
35
+ callLLM,
36
+ createAgentRuntime,
37
+ createNoopHooks,
38
+ createRuntimeHooks,
39
+ estimateMessageTokens,
40
+ estimateTokens,
41
+ executeTool,
42
+ listAllProviders,
43
+ resolveApiKeyForProvider,
44
+ resolveProvider,
45
+ runAgentLoop,
46
+ toolsToDefinitions
47
+ };
@@ -0,0 +1,47 @@
1
+ import {
2
+ AgentRuntime,
3
+ EmailChannel,
4
+ FollowUpScheduler,
5
+ SessionManager,
6
+ SubAgentManager,
7
+ ToolRegistry,
8
+ callLLM,
9
+ createAgentRuntime,
10
+ createNoopHooks,
11
+ createRuntimeHooks,
12
+ estimateMessageTokens,
13
+ estimateTokens,
14
+ executeTool,
15
+ runAgentLoop,
16
+ toolsToDefinitions
17
+ } from "./chunk-YI3VDFCW.js";
18
+ import "./chunk-TYW5XTOW.js";
19
+ import "./chunk-JLSQOQ5L.js";
20
+ import {
21
+ PROVIDER_REGISTRY,
22
+ listAllProviders,
23
+ resolveApiKeyForProvider,
24
+ resolveProvider
25
+ } from "./chunk-67KZYSLU.js";
26
+ import "./chunk-KFQGP6VL.js";
27
+ export {
28
+ AgentRuntime,
29
+ EmailChannel,
30
+ FollowUpScheduler,
31
+ PROVIDER_REGISTRY,
32
+ SessionManager,
33
+ SubAgentManager,
34
+ ToolRegistry,
35
+ callLLM,
36
+ createAgentRuntime,
37
+ createNoopHooks,
38
+ createRuntimeHooks,
39
+ estimateMessageTokens,
40
+ estimateTokens,
41
+ executeTool,
42
+ listAllProviders,
43
+ resolveApiKeyForProvider,
44
+ resolveProvider,
45
+ runAgentLoop,
46
+ toolsToDefinitions
47
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-FOMA7G3G.js";
4
+ import "./chunk-3SMTCIR4.js";
5
+ import "./chunk-JLSQOQ5L.js";
6
+ import "./chunk-RO537U6H.js";
7
+ import "./chunk-DRXMYYKN.js";
8
+ import "./chunk-67KZYSLU.js";
9
+ import "./chunk-KFQGP6VL.js";
10
+ export {
11
+ createServer
12
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-REEOTFHO.js";
4
+ import "./chunk-3SMTCIR4.js";
5
+ import "./chunk-JLSQOQ5L.js";
6
+ import "./chunk-RO537U6H.js";
7
+ import "./chunk-DRXMYYKN.js";
8
+ import "./chunk-67KZYSLU.js";
9
+ import "./chunk-KFQGP6VL.js";
10
+ export {
11
+ createServer
12
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ promptCompanyInfo,
3
+ promptDatabase,
4
+ promptDeployment,
5
+ promptDomain,
6
+ promptRegistration,
7
+ provision,
8
+ runSetupWizard
9
+ } from "./chunk-5CJEN2T2.js";
10
+ import "./chunk-WP76IB36.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-52PGPO5P.js";
10
+ import "./chunk-WP76IB36.js";
11
+ import "./chunk-KFQGP6VL.js";
12
+ export {
13
+ promptCompanyInfo,
14
+ promptDatabase,
15
+ promptDeployment,
16
+ promptDomain,
17
+ promptRegistration,
18
+ provision,
19
+ runSetupWizard
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.67",
3
+ "version": "0.5.69",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,6 +47,14 @@ export function createAgentRoutes(opts: {
47
47
  try {
48
48
  const actor = c.req.header('X-User-Id') || updatedBy;
49
49
  const agent = await lifecycle.updateConfig(c.req.param('id'), updates, actor);
50
+ // Sync name/email to admin agents table
51
+ const adminDb = getAdminDb();
52
+ if (adminDb && (updates.name || updates.email)) {
53
+ const sync: any = {};
54
+ if (updates.name) sync.name = updates.name;
55
+ if (updates.email) sync.email = updates.email;
56
+ adminDb.updateAgent(c.req.param('id'), sync).catch(() => {});
57
+ }
50
58
  return c.json({ agent });
51
59
  } catch (e: any) {
52
60
  return c.json({ error: e.message }, 400);
@@ -91,6 +99,14 @@ export function createAgentRoutes(opts: {
91
99
  try {
92
100
  const actor = c.req.header('X-User-Id') || updatedBy;
93
101
  const agent = await lifecycle.hotUpdate(c.req.param('id'), updates, actor);
102
+ // Sync name/email to admin agents table
103
+ const adminDb = getAdminDb();
104
+ if (adminDb && (updates.name || updates.email)) {
105
+ const sync: any = {};
106
+ if (updates.name) sync.name = updates.name;
107
+ if (updates.email) sync.email = updates.email;
108
+ adminDb.updateAgent(c.req.param('id'), sync).catch(() => {});
109
+ }
94
110
  return c.json({ agent });
95
111
  } catch (e: any) {
96
112
  return c.json({ error: e.message }, 400);
@@ -522,8 +538,9 @@ export function createAgentRoutes(opts: {
522
538
  return c.json({ error: `Unknown provider: ${provider}. Valid: imap, microsoft, google` }, 400);
523
539
  }
524
540
 
525
- // Save to agent config
541
+ // Save to agent config and persist to DB
526
542
  const _managed = lifecycle.getAgent(agentId); if (_managed) { _managed.config.emailConfig = emailConfig; _managed.updatedAt = new Date().toISOString(); }
543
+ await lifecycle.saveAgent(agentId);
527
544
 
528
545
  // Also update the primary agents table email if we have one
529
546
  if (emailConfig.email) {
@@ -634,12 +651,14 @@ export function createAgentRoutes(opts: {
634
651
  emailConfig.lastConnected = new Date().toISOString();
635
652
  emailConfig.lastError = null;
636
653
  const _managed = lifecycle.getAgent(agentId); if (_managed) { _managed.config.emailConfig = emailConfig; _managed.updatedAt = new Date().toISOString(); }
654
+ await lifecycle.saveAgent(agentId);
637
655
 
638
656
  return c.json({ success: true, email: emailConfig.email, status: 'connected' });
639
657
  } catch (err: any) {
640
658
  emailConfig.status = 'error';
641
659
  emailConfig.lastError = err.message;
642
660
  const _managed = lifecycle.getAgent(agentId); if (_managed) { _managed.config.emailConfig = emailConfig; _managed.updatedAt = new Date().toISOString(); }
661
+ await lifecycle.saveAgent(agentId);
643
662
  return c.json({ error: err.message }, 500);
644
663
  }
645
664
  });
@@ -696,12 +715,13 @@ export function createAgentRoutes(opts: {
696
715
  /**
697
716
  * DELETE /bridge/agents/:id/email-config — Disconnect email.
698
717
  */
699
- router.delete('/bridge/agents/:id/email-config', (c) => {
718
+ router.delete('/bridge/agents/:id/email-config', async (c) => {
700
719
  const agentId = c.req.param('id');
701
720
  const managed = lifecycle.getAgent(agentId);
702
721
  if (!managed) return c.json({ error: 'Agent not found' }, 404);
703
722
 
704
723
  const _m = lifecycle.getAgent(agentId); if (_m) { _m.config.emailConfig = null; _m.updatedAt = new Date().toISOString(); }
724
+ await lifecycle.saveAgent(agentId);
705
725
  return c.json({ success: true });
706
726
  });
707
727
 
@@ -929,6 +929,12 @@ export class AgentLifecycleManager {
929
929
  return false;
930
930
  }
931
931
 
932
+ /** Public persist — for use by routes that mutate agent config directly (e.g. email config) */
933
+ async saveAgent(agentId: string): Promise<void> {
934
+ const agent = this.agents.get(agentId);
935
+ if (agent) await this.persistAgent(agent);
936
+ }
937
+
932
938
  private async persistAgent(agent: ManagedAgent) {
933
939
  if (!agent.name) agent.name = agent.id;
934
940
  this.agents.set(agent.id, agent);