@agenticmail/enterprise 0.5.405 → 0.5.407

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,10 @@
1
+ import {
2
+ registerBrowserRoutes
3
+ } from "./chunk-EFH6FMUG.js";
4
+ import "./chunk-DTNJPDWB.js";
5
+ import "./chunk-HJGNJNT4.js";
6
+ import "./chunk-A3PUJDNH.js";
7
+ import "./chunk-KFQGP6VL.js";
8
+ export {
9
+ registerBrowserRoutes
10
+ };
@@ -0,0 +1,46 @@
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-QL2LZO6K.js";
18
+ import "./chunk-WPM52NBU.js";
19
+ import {
20
+ PROVIDER_REGISTRY,
21
+ listAllProviders,
22
+ resolveApiKeyForProvider,
23
+ resolveProvider
24
+ } from "./chunk-UF3ZJMJO.js";
25
+ import "./chunk-KFQGP6VL.js";
26
+ export {
27
+ AgentRuntime,
28
+ EmailChannel,
29
+ FollowUpScheduler,
30
+ PROVIDER_REGISTRY,
31
+ SessionManager,
32
+ SubAgentManager,
33
+ ToolRegistry,
34
+ callLLM,
35
+ createAgentRuntime,
36
+ createNoopHooks,
37
+ createRuntimeHooks,
38
+ estimateMessageTokens,
39
+ estimateTokens,
40
+ executeTool,
41
+ listAllProviders,
42
+ resolveApiKeyForProvider,
43
+ resolveProvider,
44
+ runAgentLoop,
45
+ toolsToDefinitions
46
+ };
@@ -0,0 +1,46 @@
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-EM4DE3ZR.js";
18
+ import "./chunk-WPM52NBU.js";
19
+ import {
20
+ PROVIDER_REGISTRY,
21
+ listAllProviders,
22
+ resolveApiKeyForProvider,
23
+ resolveProvider
24
+ } from "./chunk-UF3ZJMJO.js";
25
+ import "./chunk-KFQGP6VL.js";
26
+ export {
27
+ AgentRuntime,
28
+ EmailChannel,
29
+ FollowUpScheduler,
30
+ PROVIDER_REGISTRY,
31
+ SessionManager,
32
+ SubAgentManager,
33
+ ToolRegistry,
34
+ callLLM,
35
+ createAgentRuntime,
36
+ createNoopHooks,
37
+ createRuntimeHooks,
38
+ estimateMessageTokens,
39
+ estimateTokens,
40
+ executeTool,
41
+ listAllProviders,
42
+ resolveApiKeyForProvider,
43
+ resolveProvider,
44
+ runAgentLoop,
45
+ toolsToDefinitions
46
+ };
@@ -0,0 +1,28 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-KEIOV7DI.js";
4
+ import "./chunk-DJBCRQTD.js";
5
+ import "./chunk-UF3ZJMJO.js";
6
+ import "./chunk-ZZQWXIAX.js";
7
+ import "./chunk-WYDVMFGJ.js";
8
+ import "./chunk-3UAFHUEC.js";
9
+ import "./chunk-E6B4W3WG.js";
10
+ import "./chunk-Z7NVD3OQ.js";
11
+ import "./chunk-VSBC4SWO.js";
12
+ import "./chunk-AF3WSNVX.js";
13
+ import "./chunk-74ZCQKYU.js";
14
+ import "./chunk-ZNLABJCS.js";
15
+ import "./chunk-C6JP5NR6.js";
16
+ import "./chunk-WUAWWKTN.js";
17
+ import "./chunk-E5QPDR3O.js";
18
+ import "./chunk-YDD5TC5Q.js";
19
+ import "./chunk-37ABTUFU.js";
20
+ import "./chunk-NU657BBQ.js";
21
+ import "./chunk-PGAU3W3M.js";
22
+ import "./chunk-FLQ5FLHW.js";
23
+ import "./chunk-YZRJHYKB.js";
24
+ import "./chunk-22U7TZPN.js";
25
+ import "./chunk-KFQGP6VL.js";
26
+ export {
27
+ createServer
28
+ };
@@ -0,0 +1,28 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-EQ276K4X.js";
4
+ import "./chunk-DJBCRQTD.js";
5
+ import "./chunk-UF3ZJMJO.js";
6
+ import "./chunk-ZZQWXIAX.js";
7
+ import "./chunk-WYDVMFGJ.js";
8
+ import "./chunk-3UAFHUEC.js";
9
+ import "./chunk-E6B4W3WG.js";
10
+ import "./chunk-Z7NVD3OQ.js";
11
+ import "./chunk-VSBC4SWO.js";
12
+ import "./chunk-AF3WSNVX.js";
13
+ import "./chunk-74ZCQKYU.js";
14
+ import "./chunk-ZNLABJCS.js";
15
+ import "./chunk-C6JP5NR6.js";
16
+ import "./chunk-WUAWWKTN.js";
17
+ import "./chunk-E5QPDR3O.js";
18
+ import "./chunk-YDD5TC5Q.js";
19
+ import "./chunk-37ABTUFU.js";
20
+ import "./chunk-NU657BBQ.js";
21
+ import "./chunk-PGAU3W3M.js";
22
+ import "./chunk-FLQ5FLHW.js";
23
+ import "./chunk-YZRJHYKB.js";
24
+ import "./chunk-22U7TZPN.js";
25
+ import "./chunk-KFQGP6VL.js";
26
+ export {
27
+ createServer
28
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createBrowserRouteContext,
3
+ listKnownProfileNames
4
+ } from "./chunk-YEJL3G2Z.js";
5
+ import "./chunk-DTNJPDWB.js";
6
+ import "./chunk-HJGNJNT4.js";
7
+ import "./chunk-A3PUJDNH.js";
8
+ import "./chunk-KFQGP6VL.js";
9
+ export {
10
+ createBrowserRouteContext,
11
+ listKnownProfileNames
12
+ };
@@ -0,0 +1,153 @@
1
+ import {
2
+ isLoopbackHost,
3
+ safeEqualSecret
4
+ } from "./chunk-A3PUJDNH.js";
5
+ import "./chunk-KFQGP6VL.js";
6
+
7
+ // src/browser/server-middleware.ts
8
+ import express from "express";
9
+
10
+ // src/browser/csrf.ts
11
+ function firstHeader(value) {
12
+ return Array.isArray(value) ? value[0] ?? "" : value ?? "";
13
+ }
14
+ function isMutatingMethod(method) {
15
+ const m = (method || "").trim().toUpperCase();
16
+ return m === "POST" || m === "PUT" || m === "PATCH" || m === "DELETE";
17
+ }
18
+ function isLoopbackUrl(value) {
19
+ const v = value.trim();
20
+ if (!v || v === "null") {
21
+ return false;
22
+ }
23
+ try {
24
+ const parsed = new URL(v);
25
+ return isLoopbackHost(parsed.hostname);
26
+ } catch {
27
+ return false;
28
+ }
29
+ }
30
+ function shouldRejectBrowserMutation(params) {
31
+ if (!isMutatingMethod(params.method)) {
32
+ return false;
33
+ }
34
+ const secFetchSite = (params.secFetchSite ?? "").trim().toLowerCase();
35
+ if (secFetchSite === "cross-site") {
36
+ return true;
37
+ }
38
+ const origin = (params.origin ?? "").trim();
39
+ if (origin) {
40
+ return !isLoopbackUrl(origin);
41
+ }
42
+ const referer = (params.referer ?? "").trim();
43
+ if (referer) {
44
+ return !isLoopbackUrl(referer);
45
+ }
46
+ return false;
47
+ }
48
+ function browserMutationGuardMiddleware() {
49
+ return (req, res, next) => {
50
+ const method = (req.method || "").trim().toUpperCase();
51
+ if (method === "OPTIONS") {
52
+ return next();
53
+ }
54
+ const origin = firstHeader(req.headers.origin);
55
+ const referer = firstHeader(req.headers.referer);
56
+ const secFetchSite = firstHeader(req.headers["sec-fetch-site"]);
57
+ if (shouldRejectBrowserMutation({
58
+ method,
59
+ origin,
60
+ referer,
61
+ secFetchSite
62
+ })) {
63
+ res.status(403).send("Forbidden");
64
+ return;
65
+ }
66
+ next();
67
+ };
68
+ }
69
+
70
+ // src/browser/http-auth.ts
71
+ function firstHeaderValue(value) {
72
+ return Array.isArray(value) ? value[0] ?? "" : value ?? "";
73
+ }
74
+ function parseBearerToken(authorization) {
75
+ if (!authorization || !authorization.toLowerCase().startsWith("bearer ")) {
76
+ return void 0;
77
+ }
78
+ const token = authorization.slice(7).trim();
79
+ return token || void 0;
80
+ }
81
+ function parseBasicPassword(authorization) {
82
+ if (!authorization || !authorization.toLowerCase().startsWith("basic ")) {
83
+ return void 0;
84
+ }
85
+ const encoded = authorization.slice(6).trim();
86
+ if (!encoded) {
87
+ return void 0;
88
+ }
89
+ try {
90
+ const decoded = Buffer.from(encoded, "base64").toString("utf8");
91
+ const sep = decoded.indexOf(":");
92
+ if (sep < 0) {
93
+ return void 0;
94
+ }
95
+ const password = decoded.slice(sep + 1).trim();
96
+ return password || void 0;
97
+ } catch {
98
+ return void 0;
99
+ }
100
+ }
101
+ function isAuthorizedBrowserRequest(req, auth) {
102
+ const authorization = firstHeaderValue(req.headers.authorization).trim();
103
+ if (auth.token) {
104
+ const bearer = parseBearerToken(authorization);
105
+ if (bearer && safeEqualSecret(bearer, auth.token)) {
106
+ return true;
107
+ }
108
+ }
109
+ if (auth.password) {
110
+ const passwordHeader = firstHeaderValue(req.headers["x-agenticmail-password"]).trim();
111
+ if (passwordHeader && safeEqualSecret(passwordHeader, auth.password)) {
112
+ return true;
113
+ }
114
+ const basicPassword = parseBasicPassword(authorization);
115
+ if (basicPassword && safeEqualSecret(basicPassword, auth.password)) {
116
+ return true;
117
+ }
118
+ }
119
+ return false;
120
+ }
121
+
122
+ // src/browser/server-middleware.ts
123
+ function installBrowserCommonMiddleware(app) {
124
+ app.use((req, res, next) => {
125
+ const ctrl = new AbortController();
126
+ const abort = () => ctrl.abort(new Error("request aborted"));
127
+ req.once("aborted", abort);
128
+ res.once("close", () => {
129
+ if (!res.writableEnded) {
130
+ abort();
131
+ }
132
+ });
133
+ req.signal = ctrl.signal;
134
+ next();
135
+ });
136
+ app.use(express.json({ limit: "1mb" }));
137
+ app.use(browserMutationGuardMiddleware());
138
+ }
139
+ function installBrowserAuthMiddleware(app, auth) {
140
+ if (!auth.token && !auth.password) {
141
+ return;
142
+ }
143
+ app.use((req, res, next) => {
144
+ if (isAuthorizedBrowserRequest(req, auth)) {
145
+ return next();
146
+ }
147
+ res.status(401).send("Unauthorized");
148
+ });
149
+ }
150
+ export {
151
+ installBrowserAuthMiddleware,
152
+ installBrowserCommonMiddleware
153
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ promptCompanyInfo,
3
+ promptDatabase,
4
+ promptDeployment,
5
+ promptDomain,
6
+ promptRegistration,
7
+ provision,
8
+ runSetupWizard
9
+ } from "./chunk-IC7LGL7B.js";
10
+ import "./chunk-P6W565WH.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-VR472JIR.js";
10
+ import "./chunk-P6W565WH.js";
11
+ import "./chunk-KFQGP6VL.js";
12
+ export {
13
+ promptCompanyInfo,
14
+ promptDatabase,
15
+ promptDeployment,
16
+ promptDomain,
17
+ promptRegistration,
18
+ provision,
19
+ runSetupWizard
20
+ };
@@ -273,3 +273,9 @@
273
273
  2026-03-06 06:36:47: 2026-03-06T05:36:47Z ERR Request failed error="stream 3129 canceled by remote with error code 0" connIndex=0 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.200.43 type=http
274
274
  2026-03-06 06:40:49: 2026-03-06T05:40:49Z ERR error="stream 649 canceled by remote with error code 0" connIndex=1 event=1 ingressRule=0 originService=http://localhost:3100
275
275
  2026-03-06 06:40:49: 2026-03-06T05:40:49Z ERR Request failed error="stream 649 canceled by remote with error code 0" connIndex=1 dest=https://enterprise.agenticmail.io/api/engine/agent-status-stream?agentId=3eecd57d-03ae-440d-8945-5b35f43a8d90 event=0 ip=198.41.192.37 type=http
276
+ 2026-03-06 15:54:20: 2026-03-06T14:54:20Z ERR error="stream 981 canceled by remote with error code 0" connIndex=2 event=1 ingressRule=0 originService=http://localhost:3100
277
+ 2026-03-06 15:54:20: 2026-03-06T14:54:20Z ERR Request failed error="stream 981 canceled by remote with error code 0" connIndex=2 dest=https://enterprise.agenticmail.io/api/engine/task-pipeline/stream event=0 ip=198.41.192.47 type=http
278
+ 2026-03-06 15:54:30: 2026-03-06T14:54:30Z ERR error="stream 1301 canceled by remote with error code 0" connIndex=2 event=1 ingressRule=0 originService=http://localhost:3100
279
+ 2026-03-06 15:54:30: 2026-03-06T14:54:30Z ERR Request failed error="stream 1301 canceled by remote with error code 0" connIndex=2 dest=https://enterprise.agenticmail.io/api/engine/task-pipeline/stream event=0 ip=198.41.192.47 type=http
280
+ 2026-03-06 16:01:25: 2026-03-06T15:01:25Z ERR error="unexpected EOF" connIndex=2 event=1 ingressRule=0 originService=http://localhost:3100
281
+ 2026-03-06 16:01:25: 2026-03-06T15:01:25Z ERR Request failed error="unexpected EOF" connIndex=2 dest=https://enterprise.agenticmail.io/api/engine/task-pipeline/stream event=0 ip=198.41.192.47 type=http
@@ -14,3 +14,5 @@
14
14
  2026-03-06 03:46:50: [TaskPoller] spawnForTask error: No API key configured for provider: undefined
15
15
  2026-03-06 14:40:46: [TaskPoller] spawnForTask error: No API key configured for provider: undefined
16
16
  2026-03-06 14:44:45: [TaskPoller] spawnForTask error: No API key configured for provider: undefined
17
+ 2026-03-06 15:48:10: Fatal error: current transaction is aborted, commands ignored until end of transaction block
18
+ 2026-03-06 16:01:22: [shutdown] Email notification error: Invalid character
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.405",
3
+ "version": "0.5.407",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {