@agenticmail/enterprise 0.5.33 → 0.5.34

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-BXUATBCN.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-LLRHGL2Z.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-R6YVL6Y6.js";
10
+ import "./chunk-WEWW2XJW.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.33",
3
+ "version": "0.5.34",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -359,7 +359,7 @@ export class PostgresAdapter extends DatabaseAdapter {
359
359
  return {
360
360
  events: rows.map((r: any) => ({
361
361
  id: r.id, timestamp: r.timestamp, actor: r.actor, actorType: r.actor_type,
362
- action: r.action, resource: r.resource, details: JSON.parse(r.details || '{}'), ip: r.ip,
362
+ action: r.action, resource: r.resource, details: typeof r.details === 'string' ? JSON.parse(r.details || '{}') : (r.details || {}), ip: r.ip,
363
363
  })),
364
364
  total,
365
365
  };
@@ -464,7 +464,7 @@ export class PostgresAdapter extends DatabaseAdapter {
464
464
  return {
465
465
  enabled: !!rows[0].enabled,
466
466
  retainDays: rows[0].retain_days,
467
- excludeTags: JSON.parse(rows[0].exclude_tags || '[]'),
467
+ excludeTags: typeof rows[0].exclude_tags === 'string' ? JSON.parse(rows[0].exclude_tags || '[]') : (rows[0].exclude_tags || []),
468
468
  archiveFirst: !!rows[0].archive_first,
469
469
  };
470
470
  }
@@ -10,8 +10,10 @@
10
10
  import type { ManagedAgent, AgentState, StateTransition, AgentUsage, LifecycleEvent } from './lifecycle.js';
11
11
 
12
12
  /** Safe JSON parse — returns fallback on malformed data instead of throwing */
13
- function sj(val: string | null | undefined, fallback: any = {}): any {
14
- if (!val) return fallback;
13
+ function sj(val: any, fallback: any = {}): any {
14
+ if (val == null) return fallback;
15
+ if (typeof val === 'object') return val; // Postgres JSON/JSONB returns parsed objects
16
+ if (typeof val !== 'string') return fallback;
15
17
  try { return JSON.parse(val); } catch { return fallback; }
16
18
  }
17
19
  import type { AgentPermissionProfile } from './skills.js';
@@ -122,7 +122,7 @@ export class GuardrailEngine {
122
122
  for (const r of rules) {
123
123
  this.anomalyRules.set(r.id, {
124
124
  id: r.id, orgId: r.org_id, name: r.name, description: r.description,
125
- ruleType: r.rule_type, config: JSON.parse(r.config),
125
+ ruleType: r.rule_type, config: typeof r.config === "string" ? JSON.parse(r.config) : (r.config || {}),
126
126
  action: r.action, enabled: !!r.enabled,
127
127
  createdAt: r.created_at, updatedAt: r.updated_at,
128
128
  });
@@ -91,8 +91,8 @@ export class ActionJournal {
91
91
  this.entries = rows.map((r: any) => ({
92
92
  id: r.id, orgId: r.org_id, agentId: r.agent_id, sessionId: r.session_id,
93
93
  toolId: r.tool_id, toolName: r.tool_name, actionType: r.action_type,
94
- forwardData: JSON.parse(r.forward_data),
95
- reverseData: r.reverse_data ? JSON.parse(r.reverse_data) : undefined,
94
+ forwardData: typeof r.forward_data === "string" ? JSON.parse(r.forward_data) : (r.forward_data || {}),
95
+ reverseData: r.reverse_data ? (typeof r.reverse_data === "string" ? JSON.parse(r.reverse_data) : r.reverse_data) : undefined,
96
96
  reversible: !!r.reversible, reversed: !!r.reversed,
97
97
  reversedAt: r.reversed_at, reversedBy: r.reversed_by,
98
98
  createdAt: r.created_at,
@@ -118,8 +118,8 @@ export class OrgPolicyEngine {
118
118
  priority: r.priority,
119
119
  version: r.version,
120
120
  enforcement: r.enforcement as PolicyEnforcement,
121
- appliesTo: JSON.parse(r.applies_to || '["*"]'),
122
- tags: JSON.parse(r.tags || '[]'),
121
+ appliesTo: typeof r.applies_to === 'string' ? JSON.parse(r.applies_to || '["*"]') : (r.applies_to || ['*']),
122
+ tags: typeof r.tags === 'string' ? JSON.parse(r.tags || '[]') : (r.tags || []),
123
123
  enabled: !!r.enabled,
124
124
  createdBy: r.created_by,
125
125
  createdAt: r.created_at,
@@ -745,9 +745,9 @@ export class PolicyImporter {
745
745
  for (const r of rows) {
746
746
  this.jobs.set(r.id, {
747
747
  id: r.id, orgId: r.org_id, format: r.format, status: r.status,
748
- progress: JSON.parse(r.progress || '{}'),
749
- errors: JSON.parse(r.errors || '[]'),
750
- policyIds: JSON.parse(r.policy_ids || '[]'),
748
+ progress: typeof r.progress === "string" ? JSON.parse(r.progress || "{}") : (r.progress || {}),
749
+ errors: typeof r.errors === "string" ? JSON.parse(r.errors || "[]") : (r.errors || []),
750
+ policyIds: typeof r.policy_ids === "string" ? JSON.parse(r.policy_ids || "[]") : (r.policy_ids || []),
751
751
  createdBy: r.created_by, createdAt: r.created_at,
752
752
  completedAt: r.completed_at || undefined,
753
753
  });
@@ -233,7 +233,7 @@ export class StorageManager {
233
233
  return rows.map((r: any) => ({
234
234
  id: r.id, orgId: r.org_id, storageKey: r.storage_key, originalName: r.original_name,
235
235
  contentType: r.content_type, size: r.size, relatedType: r.related_type,
236
- relatedId: r.related_id, metadata: JSON.parse(r.metadata || '{}'),
236
+ relatedId: r.related_id, metadata: typeof r.metadata === "string" ? JSON.parse(r.metadata || "{}") : (r.metadata || {}),
237
237
  createdBy: r.created_by, createdAt: r.created_at,
238
238
  }));
239
239
  }