@agenticmail/enterprise 0.5.67 → 0.5.68

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-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,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.68",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -522,8 +522,9 @@ export function createAgentRoutes(opts: {
522
522
  return c.json({ error: `Unknown provider: ${provider}. Valid: imap, microsoft, google` }, 400);
523
523
  }
524
524
 
525
- // Save to agent config
525
+ // Save to agent config and persist to DB
526
526
  const _managed = lifecycle.getAgent(agentId); if (_managed) { _managed.config.emailConfig = emailConfig; _managed.updatedAt = new Date().toISOString(); }
527
+ await lifecycle.saveAgent(agentId);
527
528
 
528
529
  // Also update the primary agents table email if we have one
529
530
  if (emailConfig.email) {
@@ -634,12 +635,14 @@ export function createAgentRoutes(opts: {
634
635
  emailConfig.lastConnected = new Date().toISOString();
635
636
  emailConfig.lastError = null;
636
637
  const _managed = lifecycle.getAgent(agentId); if (_managed) { _managed.config.emailConfig = emailConfig; _managed.updatedAt = new Date().toISOString(); }
638
+ await lifecycle.saveAgent(agentId);
637
639
 
638
640
  return c.json({ success: true, email: emailConfig.email, status: 'connected' });
639
641
  } catch (err: any) {
640
642
  emailConfig.status = 'error';
641
643
  emailConfig.lastError = err.message;
642
644
  const _managed = lifecycle.getAgent(agentId); if (_managed) { _managed.config.emailConfig = emailConfig; _managed.updatedAt = new Date().toISOString(); }
645
+ await lifecycle.saveAgent(agentId);
643
646
  return c.json({ error: err.message }, 500);
644
647
  }
645
648
  });
@@ -696,12 +699,13 @@ export function createAgentRoutes(opts: {
696
699
  /**
697
700
  * DELETE /bridge/agents/:id/email-config — Disconnect email.
698
701
  */
699
- router.delete('/bridge/agents/:id/email-config', (c) => {
702
+ router.delete('/bridge/agents/:id/email-config', async (c) => {
700
703
  const agentId = c.req.param('id');
701
704
  const managed = lifecycle.getAgent(agentId);
702
705
  if (!managed) return c.json({ error: 'Agent not found' }, 404);
703
706
 
704
707
  const _m = lifecycle.getAgent(agentId); if (_m) { _m.config.emailConfig = null; _m.updatedAt = new Date().toISOString(); }
708
+ await lifecycle.saveAgent(agentId);
705
709
  return c.json({ success: true });
706
710
  });
707
711
 
@@ -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);