@agenticmail/enterprise 0.5.258 → 0.5.259
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-XFFCIWIW.js +510 -0
- package/dist/chunk-FA3RK6I4.js +4488 -0
- package/dist/chunk-W66ZR4KK.js +1224 -0
- package/dist/chunk-X2PYK6HH.js +3778 -0
- package/dist/cli-agent-VOYA45UD.js +1768 -0
- package/dist/cli-serve-DOREU7ON.js +114 -0
- package/dist/cli.js +3 -3
- package/dist/dashboard/pages/skill-connections.js +122 -5
- package/dist/index.js +3 -3
- package/dist/routes-RED54L7N.js +13531 -0
- package/dist/runtime-JL2PBKYR.js +45 -0
- package/dist/server-EJUUUXBC.js +15 -0
- package/dist/setup-MCPCSGLO.js +20 -0
- package/package.json +1 -1
- package/src/dashboard/pages/skill-connections.js +122 -5
- package/src/engine/routes.ts +26 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import "./chunk-KFQGP6VL.js";
|
|
2
|
+
|
|
3
|
+
// src/cli-serve.ts
|
|
4
|
+
import { existsSync, readFileSync } from "fs";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
import { homedir } from "os";
|
|
7
|
+
function loadEnvFile() {
|
|
8
|
+
const candidates = [
|
|
9
|
+
join(process.cwd(), ".env"),
|
|
10
|
+
join(homedir(), ".agenticmail", ".env")
|
|
11
|
+
];
|
|
12
|
+
for (const envPath of candidates) {
|
|
13
|
+
if (!existsSync(envPath)) continue;
|
|
14
|
+
try {
|
|
15
|
+
const content = readFileSync(envPath, "utf8");
|
|
16
|
+
for (const line of content.split("\n")) {
|
|
17
|
+
const trimmed = line.trim();
|
|
18
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
19
|
+
const eq = trimmed.indexOf("=");
|
|
20
|
+
if (eq < 0) continue;
|
|
21
|
+
const key = trimmed.slice(0, eq).trim();
|
|
22
|
+
let val = trimmed.slice(eq + 1).trim();
|
|
23
|
+
if (val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'")) {
|
|
24
|
+
val = val.slice(1, -1);
|
|
25
|
+
}
|
|
26
|
+
if (!process.env[key]) process.env[key] = val;
|
|
27
|
+
}
|
|
28
|
+
console.log(`Loaded config from ${envPath}`);
|
|
29
|
+
return;
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function ensureSecrets() {
|
|
35
|
+
const { randomUUID } = await import("crypto");
|
|
36
|
+
const envDir = join(homedir(), ".agenticmail");
|
|
37
|
+
const envPath = join(envDir, ".env");
|
|
38
|
+
let dirty = false;
|
|
39
|
+
if (!process.env.JWT_SECRET) {
|
|
40
|
+
process.env.JWT_SECRET = randomUUID() + randomUUID();
|
|
41
|
+
dirty = true;
|
|
42
|
+
console.log("[startup] Generated new JWT_SECRET (existing sessions will need to re-login)");
|
|
43
|
+
}
|
|
44
|
+
if (!process.env.AGENTICMAIL_VAULT_KEY) {
|
|
45
|
+
process.env.AGENTICMAIL_VAULT_KEY = randomUUID() + randomUUID();
|
|
46
|
+
dirty = true;
|
|
47
|
+
console.log("[startup] Generated new AGENTICMAIL_VAULT_KEY");
|
|
48
|
+
console.log("[startup] \u26A0\uFE0F Previously encrypted credentials will need to be re-entered in the dashboard");
|
|
49
|
+
}
|
|
50
|
+
if (dirty) {
|
|
51
|
+
try {
|
|
52
|
+
if (!existsSync(envDir)) {
|
|
53
|
+
const { mkdirSync } = await import("fs");
|
|
54
|
+
mkdirSync(envDir, { recursive: true });
|
|
55
|
+
}
|
|
56
|
+
const { appendFileSync } = await import("fs");
|
|
57
|
+
const lines = [];
|
|
58
|
+
let existing = "";
|
|
59
|
+
if (existsSync(envPath)) {
|
|
60
|
+
existing = readFileSync(envPath, "utf8");
|
|
61
|
+
}
|
|
62
|
+
if (!existing.includes("JWT_SECRET=")) {
|
|
63
|
+
lines.push(`JWT_SECRET=${process.env.JWT_SECRET}`);
|
|
64
|
+
}
|
|
65
|
+
if (!existing.includes("AGENTICMAIL_VAULT_KEY=")) {
|
|
66
|
+
lines.push(`AGENTICMAIL_VAULT_KEY=${process.env.AGENTICMAIL_VAULT_KEY}`);
|
|
67
|
+
}
|
|
68
|
+
if (lines.length) {
|
|
69
|
+
appendFileSync(envPath, "\n" + lines.join("\n") + "\n", { mode: 384 });
|
|
70
|
+
console.log(`[startup] Saved secrets to ${envPath}`);
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.warn(`[startup] Could not save secrets to ${envPath}: ${e.message}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function runServe(_args) {
|
|
78
|
+
loadEnvFile();
|
|
79
|
+
const DATABASE_URL = process.env.DATABASE_URL;
|
|
80
|
+
const PORT = parseInt(process.env.PORT || "8080", 10);
|
|
81
|
+
await ensureSecrets();
|
|
82
|
+
const JWT_SECRET = process.env.JWT_SECRET;
|
|
83
|
+
const VAULT_KEY = process.env.AGENTICMAIL_VAULT_KEY;
|
|
84
|
+
if (!DATABASE_URL) {
|
|
85
|
+
console.error("ERROR: DATABASE_URL is required.");
|
|
86
|
+
console.error("");
|
|
87
|
+
console.error("Set it via environment variable or .env file:");
|
|
88
|
+
console.error(" DATABASE_URL=postgresql://user:pass@host:5432/db npx @agenticmail/enterprise start");
|
|
89
|
+
console.error("");
|
|
90
|
+
console.error("Or create a .env file (in cwd or ~/.agenticmail/.env):");
|
|
91
|
+
console.error(" DATABASE_URL=postgresql://user:pass@host:5432/db");
|
|
92
|
+
console.error(" JWT_SECRET=your-secret-here");
|
|
93
|
+
console.error(" PORT=3200");
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
const { createAdapter } = await import("./factory-672W7A5B.js");
|
|
97
|
+
const { createServer } = await import("./server-EJUUUXBC.js");
|
|
98
|
+
const db = await createAdapter({
|
|
99
|
+
type: DATABASE_URL.startsWith("postgres") ? "postgres" : "sqlite",
|
|
100
|
+
connectionString: DATABASE_URL
|
|
101
|
+
});
|
|
102
|
+
await db.migrate();
|
|
103
|
+
const server = createServer({
|
|
104
|
+
port: PORT,
|
|
105
|
+
db,
|
|
106
|
+
jwtSecret: JWT_SECRET,
|
|
107
|
+
corsOrigins: ["*"]
|
|
108
|
+
});
|
|
109
|
+
await server.start();
|
|
110
|
+
console.log(`AgenticMail Enterprise server running on :${PORT}`);
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
runServe
|
|
114
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -53,14 +53,14 @@ Skill Development:
|
|
|
53
53
|
break;
|
|
54
54
|
case "serve":
|
|
55
55
|
case "start":
|
|
56
|
-
import("./cli-serve-
|
|
56
|
+
import("./cli-serve-DOREU7ON.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
|
|
57
57
|
break;
|
|
58
58
|
case "agent":
|
|
59
|
-
import("./cli-agent-
|
|
59
|
+
import("./cli-agent-VOYA45UD.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
|
|
60
60
|
break;
|
|
61
61
|
case "setup":
|
|
62
62
|
default:
|
|
63
|
-
import("./setup-
|
|
63
|
+
import("./setup-MCPCSGLO.js").then((m) => m.runSetupWizard()).catch(fatal);
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
function fatal(err) {
|
|
@@ -124,10 +124,17 @@ function McpServersSection() {
|
|
|
124
124
|
.catch(function(e) { toast(e.message, 'error'); });
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
var _deleteTarget = useState(null); var deleteTarget = _deleteTarget[0]; var setDeleteTarget = _deleteTarget[1];
|
|
128
|
+
var _deleteStep = useState(0); var deleteStep = _deleteStep[0]; var setDeleteStep = _deleteStep[1];
|
|
129
|
+
var _deleteConfirmText = useState(''); var deleteConfirmText = _deleteConfirmText[0]; var setDeleteConfirmText = _deleteConfirmText[1];
|
|
130
|
+
|
|
131
|
+
var startDelete = function(server) { setDeleteTarget(server); setDeleteStep(1); setDeleteConfirmText(''); };
|
|
132
|
+
var cancelDelete = function() { setDeleteTarget(null); setDeleteStep(0); setDeleteConfirmText(''); };
|
|
133
|
+
|
|
134
|
+
var executeDelete = function() {
|
|
135
|
+
if (!deleteTarget) return;
|
|
136
|
+
engineCall('/mcp-servers/' + deleteTarget.id, { method: 'DELETE' })
|
|
137
|
+
.then(function() { toast('MCP server "' + deleteTarget.name + '" permanently deleted', 'success'); cancelDelete(); load(); })
|
|
131
138
|
.catch(function(e) { toast(e.message, 'error'); });
|
|
132
139
|
};
|
|
133
140
|
|
|
@@ -230,7 +237,7 @@ function McpServersSection() {
|
|
|
230
237
|
h('button', { className: 'btn btn-ghost btn-sm', title: server.enabled ? 'Disable' : 'Enable', onClick: function() { toggleServer(server); } },
|
|
231
238
|
server.enabled ? I.pause() : I.play()),
|
|
232
239
|
h('button', { className: 'btn btn-ghost btn-sm', title: 'Edit', onClick: function() { openEdit(server); } }, I.settings()),
|
|
233
|
-
h('button', { className: 'btn btn-ghost btn-sm', title: 'Remove', style: { color: 'var(--danger)' }, onClick: function() {
|
|
240
|
+
h('button', { className: 'btn btn-ghost btn-sm', title: 'Remove', style: { color: 'var(--danger)' }, onClick: function() { startDelete(server); } }, I.x())
|
|
234
241
|
)
|
|
235
242
|
),
|
|
236
243
|
// Show tools if expanded (server has discovered tools)
|
|
@@ -472,6 +479,116 @@ function McpServersSection() {
|
|
|
472
479
|
)
|
|
473
480
|
)
|
|
474
481
|
)
|
|
482
|
+
),
|
|
483
|
+
|
|
484
|
+
// ─── 3-Step Delete Confirmation Modal ───
|
|
485
|
+
deleteTarget && h('div', { className: 'modal-overlay', onClick: cancelDelete },
|
|
486
|
+
h('div', { className: 'modal', onClick: function(e) { e.stopPropagation(); }, style: { width: 480, maxHeight: '80vh', overflow: 'auto' } },
|
|
487
|
+
h('div', { className: 'modal-header' },
|
|
488
|
+
h('h2', { style: { fontSize: 16, color: 'var(--danger)' } },
|
|
489
|
+
deleteStep === 1 ? 'Delete MCP Server' : deleteStep === 2 ? 'Agent Impact Warning' : 'Final Confirmation'
|
|
490
|
+
),
|
|
491
|
+
h('button', { className: 'btn btn-ghost btn-icon', onClick: cancelDelete }, '\u00D7')
|
|
492
|
+
),
|
|
493
|
+
h('div', { className: 'modal-body', style: { padding: 20 } },
|
|
494
|
+
// Step indicator
|
|
495
|
+
h('div', { style: { display: 'flex', gap: 8, marginBottom: 20, justifyContent: 'center' } },
|
|
496
|
+
[1, 2, 3].map(function(s) {
|
|
497
|
+
return h('div', { key: s, style: {
|
|
498
|
+
width: 28, height: 28, borderRadius: '50%', display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
499
|
+
fontSize: 12, fontWeight: 700,
|
|
500
|
+
background: s === deleteStep ? 'var(--danger)' : s < deleteStep ? 'var(--success)' : 'var(--bg-tertiary)',
|
|
501
|
+
color: s <= deleteStep ? '#fff' : 'var(--text-muted)',
|
|
502
|
+
border: '2px solid ' + (s === deleteStep ? 'var(--danger)' : s < deleteStep ? 'var(--success)' : 'var(--border)')
|
|
503
|
+
} }, s < deleteStep ? '\u2713' : s);
|
|
504
|
+
})
|
|
505
|
+
),
|
|
506
|
+
|
|
507
|
+
// Step 1: What you're deleting
|
|
508
|
+
deleteStep === 1 && h(Fragment, null,
|
|
509
|
+
h('div', { style: { padding: 16, background: 'rgba(239,68,68,0.08)', border: '1px solid rgba(239,68,68,0.2)', borderRadius: 'var(--radius)', marginBottom: 16 } },
|
|
510
|
+
h('div', { style: { fontWeight: 700, fontSize: 14, marginBottom: 8 } }, deleteTarget.name),
|
|
511
|
+
h('div', { style: { fontSize: 12, color: 'var(--text-secondary)', marginBottom: 4 } },
|
|
512
|
+
deleteTarget.type === 'stdio'
|
|
513
|
+
? 'Command: ' + (deleteTarget.command || '') + ' ' + ((deleteTarget.args || []).join(' '))
|
|
514
|
+
: 'URL: ' + (deleteTarget.url || '')
|
|
515
|
+
),
|
|
516
|
+
deleteTarget.toolCount > 0 && h('div', { style: { fontSize: 12, color: 'var(--text-secondary)' } },
|
|
517
|
+
deleteTarget.toolCount + ' tool(s) will be permanently removed'
|
|
518
|
+
),
|
|
519
|
+
deleteTarget.tools && deleteTarget.tools.length > 0 && h('div', { style: { display: 'flex', flexWrap: 'wrap', gap: 4, marginTop: 8 } },
|
|
520
|
+
deleteTarget.tools.slice(0, 15).map(function(t) {
|
|
521
|
+
return h('span', { key: t.name, style: { padding: '2px 6px', borderRadius: 4, fontSize: 10, background: 'rgba(239,68,68,0.1)', color: 'var(--danger)', border: '1px solid rgba(239,68,68,0.2)' } }, t.name);
|
|
522
|
+
}),
|
|
523
|
+
deleteTarget.tools.length > 15 && h('span', { style: { fontSize: 10, color: 'var(--text-muted)', padding: '2px 4px' } }, '+' + (deleteTarget.tools.length - 15) + ' more')
|
|
524
|
+
)
|
|
525
|
+
),
|
|
526
|
+
h('p', { style: { fontSize: 13, color: 'var(--text-secondary)', lineHeight: 1.6 } },
|
|
527
|
+
'This will permanently delete the MCP server configuration and disconnect it from all agents. The server process will be terminated immediately.'
|
|
528
|
+
),
|
|
529
|
+
h('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end', marginTop: 20 } },
|
|
530
|
+
h('button', { className: 'btn btn-ghost', onClick: cancelDelete }, 'Cancel'),
|
|
531
|
+
h('button', { className: 'btn btn-danger', onClick: function() { setDeleteStep(2); } }, 'Continue')
|
|
532
|
+
)
|
|
533
|
+
),
|
|
534
|
+
|
|
535
|
+
// Step 2: Agent impact
|
|
536
|
+
deleteStep === 2 && h(Fragment, null,
|
|
537
|
+
h('div', { style: { padding: 16, background: 'rgba(245,158,11,0.08)', border: '1px solid rgba(245,158,11,0.2)', borderRadius: 'var(--radius)', marginBottom: 16 } },
|
|
538
|
+
h('div', { style: { fontWeight: 700, fontSize: 13, marginBottom: 8, color: '#f59e0b' } }, 'Agent Impact'),
|
|
539
|
+
h('ul', { style: { margin: 0, paddingLeft: 20, fontSize: 12, color: 'var(--text-secondary)', lineHeight: 1.8 } },
|
|
540
|
+
h('li', null, 'Agents currently using these tools will get errors on their next call'),
|
|
541
|
+
h('li', null, 'Agents may have stored tool names in their memory from previous sessions'),
|
|
542
|
+
h('li', null, 'Running tasks that depend on these tools may fail'),
|
|
543
|
+
h('li', null, h('strong', null, 'Any in-progress work using these tools cannot be recovered'))
|
|
544
|
+
)
|
|
545
|
+
),
|
|
546
|
+
deleteTarget.assignedAgents && deleteTarget.assignedAgents.length > 0 && h('div', { style: { padding: 12, background: 'var(--bg-secondary)', border: '1px solid var(--border)', borderRadius: 'var(--radius)', marginBottom: 16, fontSize: 12 } },
|
|
547
|
+
h('div', { style: { fontWeight: 600, marginBottom: 6, color: 'var(--text-muted)' } }, 'Affected Agents:'),
|
|
548
|
+
h('div', { style: { display: 'flex', flexWrap: 'wrap', gap: 4 } },
|
|
549
|
+
deleteTarget.assignedAgents.map(function(aid) {
|
|
550
|
+
var a = agents.find(function(x) { return x.id === aid; });
|
|
551
|
+
return h('span', { key: aid, style: { padding: '3px 8px', borderRadius: 6, fontSize: 11, background: 'rgba(239,68,68,0.1)', color: 'var(--danger)', border: '1px solid rgba(239,68,68,0.15)' } }, a ? (a.display_name || a.name) : aid.slice(0, 8));
|
|
552
|
+
})
|
|
553
|
+
)
|
|
554
|
+
),
|
|
555
|
+
h('p', { style: { fontSize: 13, color: 'var(--text-secondary)', lineHeight: 1.6 } },
|
|
556
|
+
'After deletion, affected agents will be notified that these tools are no longer available. They will not attempt to use them in future sessions.'
|
|
557
|
+
),
|
|
558
|
+
h('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end', marginTop: 20 } },
|
|
559
|
+
h('button', { className: 'btn btn-ghost', onClick: function() { setDeleteStep(1); } }, 'Back'),
|
|
560
|
+
h('button', { className: 'btn btn-danger', onClick: function() { setDeleteStep(3); } }, 'I Understand')
|
|
561
|
+
)
|
|
562
|
+
),
|
|
563
|
+
|
|
564
|
+
// Step 3: Type name to confirm
|
|
565
|
+
deleteStep === 3 && h(Fragment, null,
|
|
566
|
+
h('div', { style: { padding: 16, background: 'rgba(239,68,68,0.08)', border: '1px solid rgba(239,68,68,0.2)', borderRadius: 'var(--radius)', marginBottom: 16, textAlign: 'center' } },
|
|
567
|
+
h('div', { style: { fontSize: 32, marginBottom: 8 } }, '\u26A0\uFE0F'),
|
|
568
|
+
h('div', { style: { fontWeight: 700, fontSize: 14, color: 'var(--danger)' } }, 'This action is irreversible'),
|
|
569
|
+
h('div', { style: { fontSize: 12, color: 'var(--text-secondary)', marginTop: 4 } },
|
|
570
|
+
'Type "' + deleteTarget.name + '" to confirm deletion'
|
|
571
|
+
)
|
|
572
|
+
),
|
|
573
|
+
h('input', {
|
|
574
|
+
className: 'input',
|
|
575
|
+
placeholder: 'Type server name to confirm...',
|
|
576
|
+
value: deleteConfirmText,
|
|
577
|
+
onChange: function(e) { setDeleteConfirmText(e.target.value); },
|
|
578
|
+
style: { marginBottom: 16, borderColor: deleteConfirmText === deleteTarget.name ? 'var(--danger)' : 'var(--border)' }
|
|
579
|
+
}),
|
|
580
|
+
h('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end' } },
|
|
581
|
+
h('button', { className: 'btn btn-ghost', onClick: function() { setDeleteStep(2); } }, 'Back'),
|
|
582
|
+
h('button', {
|
|
583
|
+
className: 'btn btn-danger',
|
|
584
|
+
disabled: deleteConfirmText !== deleteTarget.name,
|
|
585
|
+
onClick: executeDelete,
|
|
586
|
+
style: { opacity: deleteConfirmText === deleteTarget.name ? 1 : 0.4 }
|
|
587
|
+
}, 'Delete Permanently')
|
|
588
|
+
)
|
|
589
|
+
)
|
|
590
|
+
)
|
|
591
|
+
)
|
|
475
592
|
)
|
|
476
593
|
);
|
|
477
594
|
}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
provision,
|
|
9
9
|
runSetupWizard
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W66ZR4KK.js";
|
|
11
11
|
import {
|
|
12
12
|
ValidationError,
|
|
13
13
|
auditLogger,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
requireRole,
|
|
22
22
|
securityHeaders,
|
|
23
23
|
validate
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-X2PYK6HH.js";
|
|
25
25
|
import "./chunk-OF4MUWWS.js";
|
|
26
26
|
import {
|
|
27
27
|
AgenticMailManager,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
executeTool,
|
|
44
44
|
runAgentLoop,
|
|
45
45
|
toolsToDefinitions
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-FA3RK6I4.js";
|
|
47
47
|
import {
|
|
48
48
|
PROVIDER_REGISTRY,
|
|
49
49
|
listAllProviders,
|