@agenticmail/enterprise 0.5.242 → 0.5.244

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,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-BCMKVA47.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-HOEKOOUY.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
56
+ import("./cli-serve-V7YB747O.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
57
57
  break;
58
58
  case "agent":
59
- import("./cli-agent-WUIV3COT.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
59
+ import("./cli-agent-O5AL2A3U.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
60
60
  break;
61
61
  case "setup":
62
62
  default:
63
- import("./setup-LLZ6NTTG.js").then((m) => m.runSetupWizard()).catch(fatal);
63
+ import("./setup-SOQGPCGF.js").then((m) => m.runSetupWizard()).catch(fatal);
64
64
  break;
65
65
  }
66
66
  function fatal(err) {
@@ -5,21 +5,21 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Browser Provider Setup Guide — AgenticMail Enterprise</title>
7
7
  <style>
8
- /* ── Inherit from the main dashboard theme via CSS custom properties ── */
8
+ /* ── Match the enterprise dashboard theme exactly ── */
9
9
  :root {
10
- --bg-primary: #0f172a; --bg-secondary: #1e293b; --bg-tertiary: #334155;
11
- --text-primary: #e2e8f0; --text-secondary: #cbd5e1; --text-muted: #94a3b8;
12
- --accent: #3b82f6; --accent-soft: rgba(59,130,246,0.12);
13
- --border: #334155; --radius: 10px;
14
- --success: #15803d; --warning: #f59e0b; --danger: #ef4444;
15
- --info-soft: rgba(59,130,246,0.08);
10
+ --bg-primary: #0f1117; --bg-secondary: #161822; --bg-tertiary: #1c1f2e; --bg-card: #181b28;
11
+ --text-primary: #e8eaf0; --text-secondary: #9ca3b8; --text-muted: #6b7394;
12
+ --accent: #6366f1; --accent-soft: rgba(99,102,241,0.12);
13
+ --border: #2a2f45; --border-light: #353a52; --radius: 10px;
14
+ --success: #15803d; --warning: #eab308; --danger: #ef4444;
15
+ --info-soft: rgba(99,102,241,0.06);
16
16
  }
17
- /* Light theme (warm golden — matches dashboard) */
17
+ /* Light theme (warm golden parchment — matches dashboard) */
18
18
  [data-theme="light"] {
19
- --bg-primary: #d0c5a0; --bg-secondary: #ddd3b2; --bg-tertiary: #c8bc94;
19
+ --bg-primary: #d0c5a0; --bg-secondary: #ddd3b2; --bg-tertiary: #c8bc94; --bg-card: #e5dcc0;
20
20
  --text-primary: #2c2410; --text-secondary: #3d3520; --text-muted: #6b5e42;
21
21
  --accent: #2563eb; --accent-soft: rgba(37,99,235,0.1);
22
- --border: #b8ad8a; --info-soft: rgba(37,99,235,0.06);
22
+ --border: #b8ad8a; --border-light: #a89e7a; --info-soft: rgba(37,99,235,0.06);
23
23
  }
24
24
  * { box-sizing: border-box; margin: 0; padding: 0; }
25
25
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.7; padding: 32px; max-width: 900px; margin: 0 auto; }
@@ -30,7 +30,7 @@
30
30
  code { background: var(--bg-primary); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--accent); }
31
31
  pre { background: var(--bg-primary); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius); overflow-x: auto; margin: 12px 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
32
32
  pre code { background: none; border: none; padding: 0; }
33
- .card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
33
+ .card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
34
34
  .tip { background: var(--info-soft); border: 1px solid rgba(59,130,246,0.3); padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; font-size: 13px; color: var(--text-secondary); }
35
35
  .warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3); padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; font-size: 13px; color: var(--text-secondary); }
36
36
  .danger { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3); padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; font-size: 13px; color: var(--text-secondary); }
@@ -58,7 +58,10 @@ export function MeetingCapabilitiesSection(props) {
58
58
 
59
59
  function stopMeetingBrowser() {
60
60
  setStopping(true);
61
- engineCall('/bridge/agents/' + agentId + '/browser-config/stop-meeting-browser', { method: 'POST' })
61
+ var body = {};
62
+ if (browserStatus && browserStatus.port) body.port = browserStatus.port;
63
+ if (browserStatus && browserStatus.cdpUrl) body.cdpUrl = browserStatus.cdpUrl;
64
+ engineCall('/bridge/agents/' + agentId + '/browser-config/stop-meeting-browser', { method: 'POST', body: JSON.stringify(body) })
62
65
  .then(function(d) {
63
66
  if (d.error) { toast(d.error, 'error'); }
64
67
  else { toast('Meeting browser stopped', 'success'); setBrowserStatus(null); }
@@ -184,7 +184,7 @@ function McpServersSection() {
184
184
  // Server list
185
185
  loading ? h('div', { style: { padding: 32, textAlign: 'center', color: 'var(--text-muted)', fontSize: 13 } }, 'Loading MCP servers...')
186
186
  : servers.length === 0 ? h('div', { style: { padding: 32, textAlign: 'center', border: '2px dashed var(--border)', borderRadius: 'var(--radius-lg)', color: 'var(--text-muted)' } },
187
- h('div', { style: { marginBottom: 8 } }, I.code()),
187
+ h('div', { style: { marginBottom: 8 } }, I.terminal()),
188
188
  h('p', { style: { fontSize: 14, fontWeight: 500, marginBottom: 4 } }, 'No MCP servers connected'),
189
189
  h('p', { style: { fontSize: 12 } }, 'Add an MCP server to extend your agents with external tools'),
190
190
  h('button', { className: 'btn btn-secondary btn-sm', style: { marginTop: 12 }, onClick: openAdd }, I.plus(), ' Add Your First Server')
@@ -723,7 +723,7 @@ export function SkillConnectionsPage() {
723
723
 
724
724
  // Tab bar
725
725
  h('div', { className: 'tabs', style: { marginBottom: 20 } },
726
- h('div', { className: 'tab' + (tab === 'mcp' ? ' active' : ''), onClick: function() { setTab('mcp'); } }, I.code(), ' MCP Servers'),
726
+ h('div', { className: 'tab' + (tab === 'mcp' ? ' active' : ''), onClick: function() { setTab('mcp'); } }, I.terminal(), ' MCP Servers'),
727
727
  h('div', { className: 'tab' + (tab === 'integrations' ? ' active' : ''), onClick: function() { setTab('integrations'); } }, I.globe(), ' Built-in Integrations'),
728
728
  h('div', { className: 'tab' + (tab === 'community' ? ' active' : ''), onClick: function() { setTab('community'); } }, I.users(), ' Community Skills')
729
729
  ),
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  provision,
9
9
  runSetupWizard
10
- } from "./chunk-H3NKARYD.js";
10
+ } from "./chunk-TM3CIRVW.js";
11
11
  import {
12
12
  AgenticMailManager,
13
13
  GoogleEmailProvider,
@@ -28,7 +28,7 @@ import {
28
28
  executeTool,
29
29
  runAgentLoop,
30
30
  toolsToDefinitions
31
- } from "./chunk-PAENAIFM.js";
31
+ } from "./chunk-4VZAJQUR.js";
32
32
  import {
33
33
  ValidationError,
34
34
  auditLogger,
@@ -42,7 +42,7 @@ import {
42
42
  requireRole,
43
43
  securityHeaders,
44
44
  validate
45
- } from "./chunk-SQ42SAUY.js";
45
+ } from "./chunk-EIORALQZ.js";
46
46
  import "./chunk-OF4MUWWS.js";
47
47
  import {
48
48
  PROVIDER_REGISTRY,