@agenticmail/enterprise 0.5.204 → 0.5.205
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/agent-heartbeat-XJOKJ7XN.js +510 -0
- package/dist/chunk-3ULO6AZ2.js +1224 -0
- package/dist/chunk-7KFJ4IBO.js +3682 -0
- package/dist/chunk-F5KFQC34.js +4457 -0
- package/dist/cli-agent-KYGHCO36.js +1602 -0
- package/dist/cli-serve-D4S7YR2S.js +114 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +3 -3
- package/dist/routes-KTVR5FR2.js +13280 -0
- package/dist/runtime-YIM3AGF3.js +45 -0
- package/dist/server-KS4AZZJR.js +15 -0
- package/dist/setup-6RBJ2WQU.js +20 -0
- package/package.json +1 -1
- package/src/engine/task-queue.ts +17 -10
|
@@ -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-F5KFQC34.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-7KFJ4IBO.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-3ULO6AZ2.js";
|
|
10
|
+
import "./chunk-VQQ4SYYQ.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
package/src/engine/task-queue.ts
CHANGED
|
@@ -84,7 +84,7 @@ export class TaskQueueManager {
|
|
|
84
84
|
if (this.initialized) return;
|
|
85
85
|
if (this.db) {
|
|
86
86
|
try {
|
|
87
|
-
await this.db.run(`CREATE TABLE IF NOT EXISTS
|
|
87
|
+
await this.db.run(`CREATE TABLE IF NOT EXISTS task_pipeline (
|
|
88
88
|
id TEXT PRIMARY KEY,
|
|
89
89
|
org_id TEXT NOT NULL,
|
|
90
90
|
assigned_to TEXT NOT NULL,
|
|
@@ -98,7 +98,7 @@ export class TaskQueueManager {
|
|
|
98
98
|
status TEXT NOT NULL DEFAULT 'created',
|
|
99
99
|
priority TEXT NOT NULL DEFAULT 'normal',
|
|
100
100
|
progress INTEGER NOT NULL DEFAULT 0,
|
|
101
|
-
created_at TEXT NOT NULL DEFAULT
|
|
101
|
+
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
102
102
|
assigned_at TEXT,
|
|
103
103
|
started_at TEXT,
|
|
104
104
|
completed_at TEXT,
|
|
@@ -115,13 +115,14 @@ export class TaskQueueManager {
|
|
|
115
115
|
tokens_used INTEGER NOT NULL DEFAULT 0,
|
|
116
116
|
cost_usd REAL NOT NULL DEFAULT 0
|
|
117
117
|
)`);
|
|
118
|
-
await this.db.run(`CREATE INDEX IF NOT EXISTS
|
|
119
|
-
await this.db.run(`CREATE INDEX IF NOT EXISTS
|
|
120
|
-
await this.db.run(`CREATE INDEX IF NOT EXISTS
|
|
121
|
-
await this.db.run(`CREATE INDEX IF NOT EXISTS
|
|
118
|
+
await this.db.run(`CREATE INDEX IF NOT EXISTS idx_task_pipeline_org ON task_pipeline(org_id)`);
|
|
119
|
+
await this.db.run(`CREATE INDEX IF NOT EXISTS idx_task_pipeline_agent ON task_pipeline(assigned_to)`);
|
|
120
|
+
await this.db.run(`CREATE INDEX IF NOT EXISTS idx_task_pipeline_status ON task_pipeline(status)`);
|
|
121
|
+
await this.db.run(`CREATE INDEX IF NOT EXISTS idx_task_pipeline_created ON task_pipeline(created_at)`);
|
|
122
122
|
|
|
123
123
|
// Load recent tasks into memory
|
|
124
|
-
const
|
|
124
|
+
const cutoff = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
|
|
125
|
+
const rows = await this.db.all(`SELECT * FROM task_pipeline WHERE status IN ('created','assigned','in_progress') OR created_at > ? ORDER BY created_at DESC LIMIT 500`, [cutoff]);
|
|
125
126
|
for (const row of rows || []) {
|
|
126
127
|
this.tasks.set(row.id, this.rowToTask(row));
|
|
127
128
|
}
|
|
@@ -262,7 +263,7 @@ export class TaskQueueManager {
|
|
|
262
263
|
if (this.db) {
|
|
263
264
|
try {
|
|
264
265
|
const rows = await this.db.all(
|
|
265
|
-
`SELECT * FROM
|
|
266
|
+
`SELECT * FROM task_pipeline WHERE org_id = ? ORDER BY created_at DESC LIMIT ? OFFSET ?`,
|
|
266
267
|
[orgId, limit, offset]
|
|
267
268
|
);
|
|
268
269
|
return (rows || []).map((r: any) => this.rowToTask(r));
|
|
@@ -304,14 +305,20 @@ export class TaskQueueManager {
|
|
|
304
305
|
private async persist(task: TaskRecord): Promise<void> {
|
|
305
306
|
if (!this.db) return;
|
|
306
307
|
try {
|
|
307
|
-
await this.db.run(`INSERT
|
|
308
|
+
await this.db.run(`INSERT INTO task_pipeline (
|
|
308
309
|
id, org_id, assigned_to, assigned_to_name, created_by, created_by_name,
|
|
309
310
|
title, description, category, tags, status, priority, progress,
|
|
310
311
|
created_at, assigned_at, started_at, completed_at,
|
|
311
312
|
estimated_duration_ms, actual_duration_ms, result, error,
|
|
312
313
|
parent_task_id, related_agent_ids, session_id,
|
|
313
314
|
model, fallback_model, model_used, tokens_used, cost_usd
|
|
314
|
-
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
|
|
315
|
+
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
|
|
316
|
+
ON CONFLICT (id) DO UPDATE SET
|
|
317
|
+
status=EXCLUDED.status, priority=EXCLUDED.priority, progress=EXCLUDED.progress,
|
|
318
|
+
assigned_at=EXCLUDED.assigned_at, started_at=EXCLUDED.started_at, completed_at=EXCLUDED.completed_at,
|
|
319
|
+
actual_duration_ms=EXCLUDED.actual_duration_ms, result=EXCLUDED.result, error=EXCLUDED.error,
|
|
320
|
+
model_used=EXCLUDED.model_used, tokens_used=EXCLUDED.tokens_used, cost_usd=EXCLUDED.cost_usd,
|
|
321
|
+
session_id=EXCLUDED.session_id, title=EXCLUDED.title, description=EXCLUDED.description`, [
|
|
315
322
|
task.id, task.orgId, task.assignedTo, task.assignedToName,
|
|
316
323
|
task.createdBy, task.createdByName,
|
|
317
324
|
task.title, task.description, task.category, JSON.stringify(task.tags),
|