@agenticmail/enterprise 0.5.66 → 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.
- package/dist/chunk-52PGPO5P.js +898 -0
- package/dist/chunk-CHX4QRYU.js +2125 -0
- package/dist/chunk-FOMA7G3G.js +2125 -0
- package/dist/chunk-FYYEDVXN.js +13099 -0
- package/dist/chunk-ORQTLTFF.js +898 -0
- package/dist/chunk-UGN6F7OP.js +9100 -0
- package/dist/chunk-YI3VDFCW.js +13099 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +4 -4
- package/dist/routes-M77KPYGV.js +6141 -0
- package/dist/routes-QYIH2M52.js +6137 -0
- package/dist/runtime-2QY67633.js +47 -0
- package/dist/runtime-S5ZFGTCN.js +47 -0
- package/dist/server-2IWGLRJM.js +12 -0
- package/dist/server-BFYIYXUE.js +12 -0
- package/dist/setup-PQYVB77E.js +20 -0
- package/dist/setup-S3D5IQ7W.js +20 -0
- package/package.json +1 -1
- package/src/engine/agent-routes.ts +14 -2
- package/src/engine/lifecycle.ts +6 -0
|
@@ -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-FYYEDVXN.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-CHX4QRYU.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-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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
promptCompanyInfo,
|
|
3
|
+
promptDatabase,
|
|
4
|
+
promptDeployment,
|
|
5
|
+
promptDomain,
|
|
6
|
+
promptRegistration,
|
|
7
|
+
provision,
|
|
8
|
+
runSetupWizard
|
|
9
|
+
} from "./chunk-ORQTLTFF.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
|
@@ -522,8 +522,17 @@ 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);
|
|
528
|
+
|
|
529
|
+
// Also update the primary agents table email if we have one
|
|
530
|
+
if (emailConfig.email) {
|
|
531
|
+
try {
|
|
532
|
+
const adminDb = getAdminDb();
|
|
533
|
+
if (adminDb) await adminDb.updateAgent(agentId, { email: emailConfig.email });
|
|
534
|
+
} catch { /* non-critical */ }
|
|
535
|
+
}
|
|
527
536
|
|
|
528
537
|
return c.json({
|
|
529
538
|
success: true,
|
|
@@ -626,12 +635,14 @@ export function createAgentRoutes(opts: {
|
|
|
626
635
|
emailConfig.lastConnected = new Date().toISOString();
|
|
627
636
|
emailConfig.lastError = null;
|
|
628
637
|
const _managed = lifecycle.getAgent(agentId); if (_managed) { _managed.config.emailConfig = emailConfig; _managed.updatedAt = new Date().toISOString(); }
|
|
638
|
+
await lifecycle.saveAgent(agentId);
|
|
629
639
|
|
|
630
640
|
return c.json({ success: true, email: emailConfig.email, status: 'connected' });
|
|
631
641
|
} catch (err: any) {
|
|
632
642
|
emailConfig.status = 'error';
|
|
633
643
|
emailConfig.lastError = err.message;
|
|
634
644
|
const _managed = lifecycle.getAgent(agentId); if (_managed) { _managed.config.emailConfig = emailConfig; _managed.updatedAt = new Date().toISOString(); }
|
|
645
|
+
await lifecycle.saveAgent(agentId);
|
|
635
646
|
return c.json({ error: err.message }, 500);
|
|
636
647
|
}
|
|
637
648
|
});
|
|
@@ -688,12 +699,13 @@ export function createAgentRoutes(opts: {
|
|
|
688
699
|
/**
|
|
689
700
|
* DELETE /bridge/agents/:id/email-config — Disconnect email.
|
|
690
701
|
*/
|
|
691
|
-
router.delete('/bridge/agents/:id/email-config', (c) => {
|
|
702
|
+
router.delete('/bridge/agents/:id/email-config', async (c) => {
|
|
692
703
|
const agentId = c.req.param('id');
|
|
693
704
|
const managed = lifecycle.getAgent(agentId);
|
|
694
705
|
if (!managed) return c.json({ error: 'Agent not found' }, 404);
|
|
695
706
|
|
|
696
707
|
const _m = lifecycle.getAgent(agentId); if (_m) { _m.config.emailConfig = null; _m.updatedAt = new Date().toISOString(); }
|
|
708
|
+
await lifecycle.saveAgent(agentId);
|
|
697
709
|
return c.json({ success: true });
|
|
698
710
|
});
|
|
699
711
|
|
package/src/engine/lifecycle.ts
CHANGED
|
@@ -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);
|