@agenticmail/enterprise 0.5.260 → 0.5.261

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-PHQXZJVW.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-GW65LEIJ.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-CO2KR3YH.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,7 @@
1
+ import {
2
+ TaskQueueManager
3
+ } from "./chunk-2BQMGELC.js";
4
+ import "./chunk-KFQGP6VL.js";
5
+ export {
6
+ TaskQueueManager
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.260",
3
+ "version": "0.5.261",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -394,6 +394,22 @@ export class TaskQueueManager {
394
394
  return res.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
395
395
  }
396
396
 
397
+ async getTaskBySessionId(sessionId: string): Promise<TaskRecord | null> {
398
+ if (this.db) {
399
+ try {
400
+ const row = await this.db.get(
401
+ `SELECT * FROM task_pipeline WHERE session_id = ? AND status = 'in_progress' ORDER BY created_at DESC LIMIT 1`,
402
+ [sessionId]
403
+ );
404
+ return row ? this.rowToTask(row) : null;
405
+ } catch { /* fall through */ }
406
+ }
407
+ for (const task of this.tasks.values()) {
408
+ if (task.sessionId === sessionId && task.status === 'in_progress') return task;
409
+ }
410
+ return null;
411
+ }
412
+
397
413
  async getTaskHistory(orgId: string, limit = 50, offset = 0): Promise<TaskRecord[]> {
398
414
  if (this.db) {
399
415
  try {
@@ -529,9 +529,7 @@ export function createRuntimeHooks(deps: HookDependencies): RuntimeHooks {
529
529
  var tq = new TaskQueueManager();
530
530
  (tq as any).db = deps.engineDb;
531
531
  await tq.init();
532
- // Find active task for this session
533
- var tasks = await tq.listTasks({ orgId: deps.orgId, status: 'in_progress' });
534
- var sessionTask = tasks.find(function(t: any) { return t.sessionId === sessionId; });
532
+ var sessionTask = await tq.getTaskBySessionId(sessionId);
535
533
  if (sessionTask) {
536
534
  await tq.updateTask(sessionTask.id, {
537
535
  activityLog: [...(sessionTask.activityLog || []), {