@agenticmail/enterprise 0.5.175 → 0.5.176

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,49 @@
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-LUQCZYB6.js";
18
+ import "./chunk-AQH4DFYV.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-NRF3YRF7.js";
27
+ import "./chunk-TYW5XTOW.js";
28
+ import "./chunk-KFQGP6VL.js";
29
+ export {
30
+ AgentRuntime,
31
+ EmailChannel,
32
+ FollowUpScheduler,
33
+ PROVIDER_REGISTRY,
34
+ SessionManager,
35
+ SubAgentManager,
36
+ ToolRegistry,
37
+ callLLM,
38
+ createAgentRuntime,
39
+ createNoopHooks,
40
+ createRuntimeHooks,
41
+ estimateMessageTokens,
42
+ estimateTokens,
43
+ executeTool,
44
+ listAllProviders,
45
+ resolveApiKeyForProvider,
46
+ resolveProvider,
47
+ runAgentLoop,
48
+ toolsToDefinitions
49
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-PMEDKRCU.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-FN5FRXME.js";
10
+ import "./chunk-MHIFVS5L.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.175",
3
+ "version": "0.5.176",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1070,6 +1070,38 @@ export class AgentLifecycleManager {
1070
1070
  this.agents.set(agent.id, agent);
1071
1071
  if (!this.engineDb) return;
1072
1072
  try {
1073
+ // Reload config from DB first to avoid overwriting dashboard changes
1074
+ // (agent machine and enterprise server both write to the same row)
1075
+ const dbAgent = await this.engineDb.getManagedAgent(agent.id);
1076
+ if (dbAgent) {
1077
+ // Merge: DB config is authoritative for dashboard-editable fields (model, identity, manager, etc.)
1078
+ // In-memory agent is authoritative for runtime fields (emailConfig tokens, state, health, usage)
1079
+ const dbConfig = dbAgent.config as any;
1080
+ const memConfig = agent.config as any;
1081
+
1082
+ // Preserve dashboard-managed fields from DB if they differ
1083
+ if (dbConfig.model) memConfig.model = dbConfig.model;
1084
+ if (dbConfig.identity) memConfig.identity = dbConfig.identity;
1085
+ if (dbConfig.manager) memConfig.manager = dbConfig.manager;
1086
+ if (dbConfig.catchUp) memConfig.catchUp = dbConfig.catchUp;
1087
+ if (dbConfig.autonomy) memConfig.autonomy = dbConfig.autonomy;
1088
+ if (dbConfig.deployment) memConfig.deployment = dbConfig.deployment;
1089
+ if (dbConfig.schedule) memConfig.schedule = dbConfig.schedule;
1090
+ if (dbConfig.skills) memConfig.skills = dbConfig.skills;
1091
+ if (dbConfig.permissionProfileId) memConfig.permissionProfileId = dbConfig.permissionProfileId;
1092
+ // emailConfig: preserve dashboard fields but keep runtime tokens from memory
1093
+ if (dbConfig.emailConfig && memConfig.emailConfig) {
1094
+ const dbEmail = dbConfig.emailConfig;
1095
+ const memEmail = memConfig.emailConfig;
1096
+ // Dashboard fields from DB
1097
+ if (dbEmail.oauthClientId) memEmail.oauthClientId = dbEmail.oauthClientId;
1098
+ if (dbEmail.oauthClientSecret) memEmail.oauthClientSecret = dbEmail.oauthClientSecret;
1099
+ if (dbEmail.oauthRedirectUri) memEmail.oauthRedirectUri = dbEmail.oauthRedirectUri;
1100
+ if (dbEmail.oauthScopes) memEmail.oauthScopes = dbEmail.oauthScopes;
1101
+ // Runtime tokens stay from memory (they're fresher)
1102
+ }
1103
+ }
1104
+
1073
1105
  await withRetry(
1074
1106
  () => this.engineDb!.upsertManagedAgent(agent),
1075
1107
  { maxAttempts: 3, baseDelayMs: 100, maxDelayMs: 2000 }