@agenticmail/enterprise 0.5.267 → 0.5.269

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,45 @@
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-HG24BS44.js";
18
+ import {
19
+ PROVIDER_REGISTRY,
20
+ listAllProviders,
21
+ resolveApiKeyForProvider,
22
+ resolveProvider
23
+ } from "./chunk-UF3ZJMJO.js";
24
+ import "./chunk-KFQGP6VL.js";
25
+ export {
26
+ AgentRuntime,
27
+ EmailChannel,
28
+ FollowUpScheduler,
29
+ PROVIDER_REGISTRY,
30
+ SessionManager,
31
+ SubAgentManager,
32
+ ToolRegistry,
33
+ callLLM,
34
+ createAgentRuntime,
35
+ createNoopHooks,
36
+ createRuntimeHooks,
37
+ estimateMessageTokens,
38
+ estimateTokens,
39
+ executeTool,
40
+ listAllProviders,
41
+ resolveApiKeyForProvider,
42
+ resolveProvider,
43
+ runAgentLoop,
44
+ toolsToDefinitions
45
+ };
@@ -0,0 +1,45 @@
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-U3HRI65F.js";
18
+ import {
19
+ PROVIDER_REGISTRY,
20
+ listAllProviders,
21
+ resolveApiKeyForProvider,
22
+ resolveProvider
23
+ } from "./chunk-UF3ZJMJO.js";
24
+ import "./chunk-KFQGP6VL.js";
25
+ export {
26
+ AgentRuntime,
27
+ EmailChannel,
28
+ FollowUpScheduler,
29
+ PROVIDER_REGISTRY,
30
+ SessionManager,
31
+ SubAgentManager,
32
+ ToolRegistry,
33
+ callLLM,
34
+ createAgentRuntime,
35
+ createNoopHooks,
36
+ createRuntimeHooks,
37
+ estimateMessageTokens,
38
+ estimateTokens,
39
+ executeTool,
40
+ listAllProviders,
41
+ resolveApiKeyForProvider,
42
+ resolveProvider,
43
+ runAgentLoop,
44
+ toolsToDefinitions
45
+ };
@@ -0,0 +1,15 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-536NATB3.js";
4
+ import "./chunk-OF4MUWWS.js";
5
+ import "./chunk-UF3ZJMJO.js";
6
+ import "./chunk-3OC6RH7W.js";
7
+ import "./chunk-2DDKGTD6.js";
8
+ import "./chunk-YVK6F5OD.js";
9
+ import "./chunk-MKRNEM5A.js";
10
+ import "./chunk-DRXMYYKN.js";
11
+ import "./chunk-6WSX7QXF.js";
12
+ import "./chunk-KFQGP6VL.js";
13
+ export {
14
+ createServer
15
+ };
@@ -0,0 +1,15 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-KP3ENFEU.js";
4
+ import "./chunk-OF4MUWWS.js";
5
+ import "./chunk-UF3ZJMJO.js";
6
+ import "./chunk-3OC6RH7W.js";
7
+ import "./chunk-2DDKGTD6.js";
8
+ import "./chunk-YVK6F5OD.js";
9
+ import "./chunk-MKRNEM5A.js";
10
+ import "./chunk-DRXMYYKN.js";
11
+ import "./chunk-6WSX7QXF.js";
12
+ import "./chunk-KFQGP6VL.js";
13
+ export {
14
+ createServer
15
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ promptCompanyInfo,
3
+ promptDatabase,
4
+ promptDeployment,
5
+ promptDomain,
6
+ promptRegistration,
7
+ provision,
8
+ runSetupWizard
9
+ } from "./chunk-W4RALP6L.js";
10
+ import "./chunk-ULRBF2T7.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-NP3DMOZK.js";
10
+ import "./chunk-ULRBF2T7.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.267",
3
+ "version": "0.5.269",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -134,13 +134,14 @@ export class DatabaseConnectionManager {
134
134
 
135
135
  private async ensureTable(): Promise<void> {
136
136
  if (!this.engineDb) return;
137
- // Detect dialect from adapter
138
- const dbType = (this.engineDb as any).type || (this.engineDb as any).dialect || (this.engineDb as any).getDialect?.() || '';
139
- // Also check constructor name or if run method signature hints at postgres
140
- const isPostgres = dbType === 'postgres' || dbType === 'postgresql'
141
- || (this.engineDb as any).constructor?.name?.toLowerCase()?.includes('postgres')
142
- || String((this.engineDb as any).run).includes('RETURNING');
143
- console.log(`[db-access] Detected dialect: type=${dbType}, constructor=${(this.engineDb as any).constructor?.name}, isPostgres=${isPostgres}`);
137
+ // Detect dialect: try Postgres-style NOW() first, fall back to SQLite datetime('now')
138
+ let isPostgres = false;
139
+ try {
140
+ await this.dbRun(`SELECT NOW()`);
141
+ isPostgres = true;
142
+ } catch {
143
+ isPostgres = false;
144
+ }
144
145
  const now = isPostgres ? 'NOW()' : "(datetime('now'))";
145
146
  const jsonType = isPostgres ? 'JSONB' : 'TEXT';
146
147
  const boolType = isPostgres ? 'BOOLEAN' : 'INTEGER';
@@ -220,7 +221,7 @@ export class DatabaseConnectionManager {
220
221
  private async loadAgentAccess(): Promise<void> {
221
222
  if (!this.engineDb) return;
222
223
  try {
223
- const rows = await this.dbAll('SELECT * FROM agent_database_access WHERE enabled = 1');
224
+ const rows = await this.dbAll('SELECT * FROM agent_database_access WHERE enabled IS NOT FALSE');
224
225
  for (const row of (rows || [])) {
225
226
  const access = this.rowToAccess(row);
226
227
  const list = this.agentAccess.get(access.agentId) || [];
@@ -343,8 +344,8 @@ export class DatabaseConnectionManager {
343
344
  [
344
345
  id, full.orgId, full.agentId, full.connectionId,
345
346
  JSON.stringify(full.permissions), JSON.stringify(full.queryLimits || null),
346
- JSON.stringify(full.schemaAccess || null), full.logAllQueries ? 1 : 0,
347
- full.requireApproval ? 1 : 0, full.enabled ? 1 : 0, now, now,
347
+ JSON.stringify(full.schemaAccess || null), full.logAllQueries,
348
+ full.requireApproval, full.enabled, now, now,
348
349
  ]
349
350
  );
350
351
  }
@@ -386,8 +387,8 @@ export class DatabaseConnectionManager {
386
387
  `UPDATE agent_database_access SET permissions = ?, query_limits = ?, schema_access = ?, log_all_queries = ?, require_approval = ?, enabled = ?, updated_at = ? WHERE agent_id = ? AND connection_id = ?`,
387
388
  [
388
389
  JSON.stringify(updated.permissions), JSON.stringify(updated.queryLimits || null),
389
- JSON.stringify(updated.schemaAccess || null), updated.logAllQueries ? 1 : 0,
390
- updated.requireApproval ? 1 : 0, updated.enabled ? 1 : 0, updated.updatedAt,
390
+ JSON.stringify(updated.schemaAccess || null), updated.logAllQueries,
391
+ updated.requireApproval, updated.enabled, updated.updatedAt,
391
392
  agentId, connectionId,
392
393
  ]
393
394
  );
@@ -664,7 +665,7 @@ export class DatabaseConnectionManager {
664
665
  [
665
666
  queryId, config.orgId, query.agentId, query.connectionId, config.name,
666
667
  operation, sanitizeForLogging(query.sql || ''), (query.params || []).length,
667
- rowsAffected, Date.now() - startMs, success ? 1 : 0, error || null,
668
+ rowsAffected, Date.now() - startMs, success, error || null,
668
669
  new Date().toISOString(),
669
670
  ]
670
671
  );
@@ -757,7 +757,7 @@ export async function setEngineDb(
757
757
  storageManager.setDb(db),
758
758
  policyImporter.setDb(db),
759
759
  (async () => { (taskQueue as any).db = (db as any)?.db || db; await taskQueue.init(); })(),
760
- databaseManager.setDb((db as any)?.db || db),
760
+ databaseManager.setDb(db),
761
761
  ]);
762
762
  // Initialize hierarchy manager + start background task monitor
763
763
  hierarchyManager = new AgentHierarchyManager(db);