@agenticmail/enterprise 0.5.205 → 0.5.207
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-UMTRYIL4.js +510 -0
- package/dist/chunk-3FAXFUMK.js +4494 -0
- package/dist/chunk-73H2CQN2.js +3685 -0
- package/dist/chunk-C6FRGFDA.js +4494 -0
- package/dist/chunk-NTUFF6XP.js +1224 -0
- package/dist/chunk-XUF2WJRM.js +3685 -0
- package/dist/chunk-YDRP5PXX.js +1224 -0
- package/dist/cli-agent-33ZNJCCK.js +1602 -0
- package/dist/cli-agent-KMHJ3FAP.js +1602 -0
- package/dist/cli-serve-K27BP4J4.js +114 -0
- package/dist/cli-serve-QNUAKPMI.js +114 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +3 -3
- package/dist/routes-7VPMCOUY.js +13280 -0
- package/dist/runtime-ND55ZF2I.js +45 -0
- package/dist/runtime-ZUCF6OPX.js +45 -0
- package/dist/server-CCNNMVJJ.js +15 -0
- package/dist/server-Y5ZRZIBT.js +15 -0
- package/dist/setup-BWGC6WK7.js +20 -0
- package/dist/setup-Z6ZVNE7V.js +20 -0
- package/package.json +1 -1
- package/src/runtime/gateway.ts +45 -0
- package/src/server.ts +4 -1
|
@@ -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-C6FRGFDA.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-3FAXFUMK.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-73H2CQN2.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-XUF2WJRM.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-YDRP5PXX.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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
promptCompanyInfo,
|
|
3
|
+
promptDatabase,
|
|
4
|
+
promptDeployment,
|
|
5
|
+
promptDomain,
|
|
6
|
+
promptRegistration,
|
|
7
|
+
provision,
|
|
8
|
+
runSetupWizard
|
|
9
|
+
} from "./chunk-NTUFF6XP.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/runtime/gateway.ts
CHANGED
|
@@ -245,6 +245,51 @@ export function createRuntimeGateway(config: GatewayConfig): Hono {
|
|
|
245
245
|
|
|
246
246
|
// ─── Inbound Email Hook ──────────────────────────
|
|
247
247
|
|
|
248
|
+
// ─── Chat dispatch (from enterprise messaging/chat pollers) ──
|
|
249
|
+
app.post('/chat', async function(c) {
|
|
250
|
+
try {
|
|
251
|
+
var body = await c.req.json();
|
|
252
|
+
// Find or create a session for this chat context
|
|
253
|
+
var source = body.source || body.spaceName || 'unknown';
|
|
254
|
+
var spaceId = body.spaceId || body.chatId || 'default';
|
|
255
|
+
var sessionTag = source + ':' + spaceId;
|
|
256
|
+
|
|
257
|
+
// Look for existing session with this tag
|
|
258
|
+
var sessions = await runtime.listSessions();
|
|
259
|
+
var existing = sessions.find(function(s: any) { return s.tag === sessionTag && s.status === 'active'; });
|
|
260
|
+
var session: any;
|
|
261
|
+
|
|
262
|
+
if (existing) {
|
|
263
|
+
session = existing;
|
|
264
|
+
} else {
|
|
265
|
+
// Create new session
|
|
266
|
+
session = await runtime.createSession({
|
|
267
|
+
tag: sessionTag,
|
|
268
|
+
metadata: { source: source, spaceId: spaceId, senderName: body.senderName, isDM: body.isDM },
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Send message to the session
|
|
273
|
+
await runtime.sendMessage(session.id, body.messageText || body.message || '', {
|
|
274
|
+
senderName: body.senderName,
|
|
275
|
+
senderEmail: body.senderEmail,
|
|
276
|
+
source: source,
|
|
277
|
+
isDM: body.isDM,
|
|
278
|
+
isManager: body.isManager,
|
|
279
|
+
priority: body.priority,
|
|
280
|
+
messageId: body.messageId,
|
|
281
|
+
isCustomer: body.isCustomer,
|
|
282
|
+
customerSystemPrompt: body.customerSystemPrompt,
|
|
283
|
+
restrictTools: body.restrictTools,
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
return c.json({ ok: true, sessionId: session.id });
|
|
287
|
+
} catch (err: any) {
|
|
288
|
+
console.error('[runtime] /chat error:', err.message);
|
|
289
|
+
return c.json({ error: err.message }, 500);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
|
|
248
293
|
app.post('/hooks/inbound', async function(c) {
|
|
249
294
|
try {
|
|
250
295
|
var body = await c.req.json();
|
package/src/server.ts
CHANGED
|
@@ -240,10 +240,13 @@ export function createServer(config: ServerConfig): ServerInstance {
|
|
|
240
240
|
return next();
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
// Skip auth for runtime/chat — internal dispatch from enterprise to agent process
|
|
243
|
+
// Skip auth for runtime/chat and runtime/hooks — internal dispatch from enterprise to agent process
|
|
244
244
|
if (c.req.path.includes('/runtime/chat') && c.req.method === 'POST') {
|
|
245
245
|
return next();
|
|
246
246
|
}
|
|
247
|
+
if (c.req.path.includes('/runtime/hooks/') && c.req.method === 'POST') {
|
|
248
|
+
return next();
|
|
249
|
+
}
|
|
247
250
|
|
|
248
251
|
// Check API key first
|
|
249
252
|
const apiKeyHeader = c.req.header('X-API-Key');
|