@agenticmail/enterprise 0.5.148 → 0.5.150

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-ZHHX6MRM.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-ZPNDDWGA.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-4DDFW6IG.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.148",
3
+ "version": "0.5.150",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli-agent.ts CHANGED
@@ -22,6 +22,10 @@ import { Hono } from 'hono';
22
22
  import { serve } from '@hono/node-server';
23
23
 
24
24
  export async function runAgent(_args: string[]) {
25
+ // Catch unhandled errors so they show in logs
26
+ process.on('uncaughtException', (err) => { console.error('[FATAL] Uncaught exception:', err.message, err.stack?.slice(0, 500)); });
27
+ process.on('unhandledRejection', (reason: any) => { console.error('[FATAL] Unhandled rejection:', reason?.message || reason, reason?.stack?.slice(0, 500)); });
28
+
25
29
  const DATABASE_URL = process.env.DATABASE_URL;
26
30
  const JWT_SECRET = process.env.JWT_SECRET;
27
31
  const AGENT_ID = process.env.AGENTICMAIL_AGENT_ID;
@@ -574,6 +578,7 @@ async function startEmailPolling(
574
578
 
575
579
  // Initial load — mark existing messages as processed so we don't reply to old emails
576
580
  try {
581
+ console.log('[email-poll] Loading existing messages...');
577
582
  const existing = await emailProvider.listMessages('INBOX', { limit: 50 });
578
583
  for (const msg of existing) {
579
584
  processedIds.add(msg.uid);
@@ -583,6 +588,8 @@ async function startEmailPolling(
583
588
  console.error(`[email-poll] Failed to load existing messages: ${e.message}`);
584
589
  }
585
590
 
591
+ console.log('[email-poll] Setting up poll interval...');
592
+
586
593
  // Poll loop
587
594
  const POLL_INTERVAL = 30_000; // 30 seconds
588
595
  const agentEmail = (emailConfig.email || config.email?.address || '').toLowerCase();
@@ -819,9 +826,10 @@ When you receive an email containing a meeting link (meet.google.com, zoom.us, t
819
826
  }
820
827
 
821
828
  // Start polling
822
- setInterval(pollOnce, POLL_INTERVAL);
829
+ console.log('[email-poll] Starting poll loop (interval: 30s, first poll: 5s)');
830
+ setInterval(() => { console.log('[email-poll] Tick'); pollOnce(); }, POLL_INTERVAL);
823
831
  // First poll after 5s
824
- setTimeout(pollOnce, 5000);
832
+ setTimeout(() => { console.log('[email-poll] First poll firing'); pollOnce(); }, 5000);
825
833
  }
826
834
 
827
835
  // ─── Calendar Polling Loop ──────────────────────────────────
@@ -155,7 +155,10 @@ export function createAgentRoutes(opts: {
155
155
  return c.json({ usage: dbUsage, health: agent.health, state: agent.state });
156
156
  }
157
157
  }
158
- } catch {}
158
+ } catch (err: any) {
159
+ console.error('[usage-api] DB query failed:', err.message);
160
+ }
161
+ console.log('[usage-api] Returning in-memory usage for', agentId, 'tokensToday:', agent.usage?.tokensToday);
159
162
  return c.json({ usage: agent.usage, health: agent.health, state: agent.state });
160
163
  });
161
164
 
@@ -237,7 +237,6 @@ export class EngineDatabase {
237
237
  state = excluded.state,
238
238
  config = excluded.config,
239
239
  health = excluded.health,
240
- usage = excluded.usage,
241
240
  permission_profile_id = excluded.permission_profile_id,
242
241
  version = excluded.version,
243
242
  last_deployed_at = excluded.last_deployed_at,