@agenticmail/enterprise 0.5.127 → 0.5.129
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/chunk-3UJJAD4H.js +2195 -0
- package/dist/chunk-7RU5FIWV.js +2404 -0
- package/dist/chunk-D2MMF22A.js +16163 -0
- package/dist/chunk-EUMQIDYD.js +2195 -0
- package/dist/chunk-I6X4KSPW.js +16167 -0
- package/dist/chunk-M6GX25GK.js +898 -0
- package/dist/chunk-MHIFVS5L.js +48 -0
- package/dist/chunk-WYFJXCSH.js +898 -0
- package/dist/cli-agent-4RBWFFRG.js +570 -0
- package/dist/cli-agent-EE2HIA5Y.js +576 -0
- package/dist/cli-recover-67E4PRX7.js +97 -0
- package/dist/cli-serve-EDOUC3I3.js +34 -0
- package/dist/cli-serve-JWB66CU3.js +34 -0
- package/dist/cli-verify-6WVZMPH3.js +98 -0
- package/dist/cli.js +5 -5
- package/dist/dashboard/pages/settings.js +55 -0
- package/dist/db-adapter-MB5ONQGD.js +7 -0
- package/dist/factory-MBP7N2OQ.js +9 -0
- package/dist/index.js +5 -5
- package/dist/postgres-DJYELYKL.js +609 -0
- package/dist/runtime-A66NGCLG.js +49 -0
- package/dist/runtime-C234QHTI.js +49 -0
- package/dist/server-4PR6ABAI.js +12 -0
- package/dist/server-ZOAAIRVP.js +12 -0
- package/dist/setup-UE2CI4KP.js +20 -0
- package/dist/setup-WCW5BH3U.js +20 -0
- package/package.json +1 -1
- package/src/admin/routes.ts +1 -0
- package/src/agent-tools/tools/google/gmail.ts +68 -2
- package/src/cli-agent.ts +47 -4
- package/src/dashboard/pages/settings.js +55 -0
- package/src/db/postgres.ts +3 -1
- package/src/engine/db-schema.ts +8 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "./chunk-KFQGP6VL.js";
|
|
2
|
+
|
|
3
|
+
// src/cli-serve.ts
|
|
4
|
+
async function runServe(_args) {
|
|
5
|
+
const DATABASE_URL = process.env.DATABASE_URL;
|
|
6
|
+
const JWT_SECRET = process.env.JWT_SECRET;
|
|
7
|
+
const PORT = parseInt(process.env.PORT || "8080", 10);
|
|
8
|
+
if (!DATABASE_URL) {
|
|
9
|
+
console.error("ERROR: DATABASE_URL environment variable is required");
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
if (!JWT_SECRET) {
|
|
13
|
+
console.error("ERROR: JWT_SECRET environment variable is required");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
const { createAdapter } = await import("./factory-MBP7N2OQ.js");
|
|
17
|
+
const { createServer } = await import("./server-4PR6ABAI.js");
|
|
18
|
+
const db = await createAdapter({
|
|
19
|
+
type: DATABASE_URL.startsWith("postgres") ? "postgres" : "sqlite",
|
|
20
|
+
connectionString: DATABASE_URL
|
|
21
|
+
});
|
|
22
|
+
await db.migrate();
|
|
23
|
+
const server = createServer({
|
|
24
|
+
port: PORT,
|
|
25
|
+
db,
|
|
26
|
+
jwtSecret: JWT_SECRET,
|
|
27
|
+
corsOrigins: ["*"]
|
|
28
|
+
});
|
|
29
|
+
await server.start();
|
|
30
|
+
console.log(`AgenticMail Enterprise server running on :${PORT}`);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
runServe
|
|
34
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "./chunk-KFQGP6VL.js";
|
|
2
|
+
|
|
3
|
+
// src/cli-serve.ts
|
|
4
|
+
async function runServe(_args) {
|
|
5
|
+
const DATABASE_URL = process.env.DATABASE_URL;
|
|
6
|
+
const JWT_SECRET = process.env.JWT_SECRET;
|
|
7
|
+
const PORT = parseInt(process.env.PORT || "8080", 10);
|
|
8
|
+
if (!DATABASE_URL) {
|
|
9
|
+
console.error("ERROR: DATABASE_URL environment variable is required");
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
if (!JWT_SECRET) {
|
|
13
|
+
console.error("ERROR: JWT_SECRET environment variable is required");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
const { createAdapter } = await import("./factory-MBP7N2OQ.js");
|
|
17
|
+
const { createServer } = await import("./server-ZOAAIRVP.js");
|
|
18
|
+
const db = await createAdapter({
|
|
19
|
+
type: DATABASE_URL.startsWith("postgres") ? "postgres" : "sqlite",
|
|
20
|
+
connectionString: DATABASE_URL
|
|
21
|
+
});
|
|
22
|
+
await db.migrate();
|
|
23
|
+
const server = createServer({
|
|
24
|
+
port: PORT,
|
|
25
|
+
db,
|
|
26
|
+
jwtSecret: JWT_SECRET,
|
|
27
|
+
corsOrigins: ["*"]
|
|
28
|
+
});
|
|
29
|
+
await server.start();
|
|
30
|
+
console.log(`AgenticMail Enterprise server running on :${PORT}`);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
runServe
|
|
34
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DomainLock
|
|
3
|
+
} from "./chunk-UPU23ZRG.js";
|
|
4
|
+
import "./chunk-KFQGP6VL.js";
|
|
5
|
+
|
|
6
|
+
// src/domain-lock/cli-verify.ts
|
|
7
|
+
function getFlag(args, name) {
|
|
8
|
+
const idx = args.indexOf(name);
|
|
9
|
+
if (idx !== -1 && args[idx + 1]) return args[idx + 1];
|
|
10
|
+
return void 0;
|
|
11
|
+
}
|
|
12
|
+
async function runVerifyDomain(args) {
|
|
13
|
+
const { default: chalk } = await import("chalk");
|
|
14
|
+
const { default: ora } = await import("ora");
|
|
15
|
+
console.log("");
|
|
16
|
+
console.log(chalk.bold(" AgenticMail Enterprise \u2014 Domain Verification"));
|
|
17
|
+
console.log("");
|
|
18
|
+
let domain = getFlag(args, "--domain");
|
|
19
|
+
let dnsChallenge;
|
|
20
|
+
let dbConnected = false;
|
|
21
|
+
let db = null;
|
|
22
|
+
if (!domain) {
|
|
23
|
+
const dbPath = getFlag(args, "--db");
|
|
24
|
+
const dbType = getFlag(args, "--db-type") || "sqlite";
|
|
25
|
+
if (dbPath) {
|
|
26
|
+
try {
|
|
27
|
+
const { createAdapter } = await import("./factory-MBP7N2OQ.js");
|
|
28
|
+
db = await createAdapter({ type: dbType, connectionString: dbPath });
|
|
29
|
+
await db.migrate();
|
|
30
|
+
const settings = await db.getSettings();
|
|
31
|
+
domain = settings?.domain;
|
|
32
|
+
dnsChallenge = settings?.domainDnsChallenge;
|
|
33
|
+
dbConnected = true;
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (!domain) {
|
|
39
|
+
const { default: inquirer } = await import("inquirer");
|
|
40
|
+
const answer = await inquirer.prompt([{
|
|
41
|
+
type: "input",
|
|
42
|
+
name: "domain",
|
|
43
|
+
message: "Domain to verify:",
|
|
44
|
+
suffix: chalk.dim(" (e.g. agents.agenticmail.io)"),
|
|
45
|
+
validate: (v) => v.includes(".") || "Enter a valid domain"
|
|
46
|
+
}]);
|
|
47
|
+
domain = answer.domain;
|
|
48
|
+
}
|
|
49
|
+
const spinner = ora("Checking DNS verification...").start();
|
|
50
|
+
const lock = new DomainLock();
|
|
51
|
+
const result = await lock.checkVerification(domain);
|
|
52
|
+
if (!result.success) {
|
|
53
|
+
spinner.fail("Verification check failed");
|
|
54
|
+
console.log("");
|
|
55
|
+
console.error(chalk.red(` ${result.error}`));
|
|
56
|
+
console.log("");
|
|
57
|
+
if (db) await db.disconnect();
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
if (result.verified) {
|
|
61
|
+
spinner.succeed("Domain verified!");
|
|
62
|
+
if (dbConnected && db) {
|
|
63
|
+
try {
|
|
64
|
+
await db.updateSettings({
|
|
65
|
+
domainStatus: "verified",
|
|
66
|
+
domainVerifiedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
67
|
+
});
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
console.log("");
|
|
72
|
+
console.log(chalk.green.bold(` ${domain} is verified and protected.`));
|
|
73
|
+
console.log(chalk.dim(" Your deployment domain is locked. No other instance can claim it."));
|
|
74
|
+
console.log("");
|
|
75
|
+
} else {
|
|
76
|
+
spinner.info("DNS record not found yet");
|
|
77
|
+
console.log("");
|
|
78
|
+
console.log(chalk.yellow(" The DNS TXT record has not been detected."));
|
|
79
|
+
console.log("");
|
|
80
|
+
console.log(chalk.bold(" Make sure this record exists:"));
|
|
81
|
+
console.log("");
|
|
82
|
+
console.log(` ${chalk.bold("Host:")} ${chalk.cyan(`_agenticmail-verify.${domain}`)}`);
|
|
83
|
+
console.log(` ${chalk.bold("Type:")} ${chalk.cyan("TXT")}`);
|
|
84
|
+
if (dnsChallenge) {
|
|
85
|
+
console.log(` ${chalk.bold("Value:")} ${chalk.cyan(dnsChallenge)}`);
|
|
86
|
+
} else {
|
|
87
|
+
console.log(` ${chalk.bold("Value:")} ${chalk.dim("(check your setup records or dashboard)")}`);
|
|
88
|
+
}
|
|
89
|
+
console.log("");
|
|
90
|
+
console.log(chalk.dim(" DNS changes can take up to 48 hours to propagate."));
|
|
91
|
+
console.log(chalk.dim(" Run this command again after adding the record."));
|
|
92
|
+
console.log("");
|
|
93
|
+
}
|
|
94
|
+
if (db) await db.disconnect();
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
runVerifyDomain
|
|
98
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -14,10 +14,10 @@ switch (command) {
|
|
|
14
14
|
import("./cli-submit-skill-LDFJGSKO.js").then((m) => m.runSubmitSkill(args.slice(1))).catch(fatal);
|
|
15
15
|
break;
|
|
16
16
|
case "recover":
|
|
17
|
-
import("./cli-recover-
|
|
17
|
+
import("./cli-recover-67E4PRX7.js").then((m) => m.runRecover(args.slice(1))).catch(fatal);
|
|
18
18
|
break;
|
|
19
19
|
case "verify-domain":
|
|
20
|
-
import("./cli-verify-
|
|
20
|
+
import("./cli-verify-6WVZMPH3.js").then((m) => m.runVerifyDomain(args.slice(1))).catch(fatal);
|
|
21
21
|
break;
|
|
22
22
|
case "--help":
|
|
23
23
|
case "-h":
|
|
@@ -47,14 +47,14 @@ Skill Development:
|
|
|
47
47
|
`);
|
|
48
48
|
break;
|
|
49
49
|
case "serve":
|
|
50
|
-
import("./cli-serve-
|
|
50
|
+
import("./cli-serve-JWB66CU3.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
|
|
51
51
|
break;
|
|
52
52
|
case "agent":
|
|
53
|
-
import("./cli-agent-
|
|
53
|
+
import("./cli-agent-EE2HIA5Y.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
|
|
54
54
|
break;
|
|
55
55
|
case "setup":
|
|
56
56
|
default:
|
|
57
|
-
import("./setup-
|
|
57
|
+
import("./setup-WCW5BH3U.js").then((m) => m.runSetupWizard()).catch(fatal);
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
function fatal(err) {
|
|
@@ -256,6 +256,61 @@ export function SettingsPage() {
|
|
|
256
256
|
h('button', { className: 'btn btn-primary', onClick: () => apiCall('/settings', { method: 'PATCH', body: JSON.stringify({ name: settings.name, domain: settings.domain, subdomain: settings.subdomain, logoUrl: settings.logoUrl, primaryColor: settings.primaryColor, plan: settings.plan }) }).then(d => { setSettings(d); toast('Settings saved', 'success'); }).catch(e => toast(e.message, 'error')) }, 'Save Changes')
|
|
257
257
|
)
|
|
258
258
|
),
|
|
259
|
+
|
|
260
|
+
// ─── Email Signature Template ─────────────────────
|
|
261
|
+
h('div', { className: 'card' },
|
|
262
|
+
h('div', { className: 'card-header' },
|
|
263
|
+
h('h3', null, 'Email Signature Template'),
|
|
264
|
+
h('span', { style: { fontSize: 12, color: 'var(--text-muted)', marginLeft: 8 } }, 'Applied to all agents')
|
|
265
|
+
),
|
|
266
|
+
h('div', { className: 'card-body' },
|
|
267
|
+
h('p', { style: { fontSize: 13, color: 'var(--text-muted)', marginBottom: 16 } }, 'Define an HTML signature template that agents will use in their Gmail accounts. Use {{name}}, {{role}}, {{email}}, {{phone}}, {{company}} as placeholders.'),
|
|
268
|
+
h('div', { className: 'form-group' },
|
|
269
|
+
h('label', { className: 'form-label' }, 'Signature HTML Template'),
|
|
270
|
+
h('textarea', {
|
|
271
|
+
className: 'input',
|
|
272
|
+
value: settings.signatureTemplate || '',
|
|
273
|
+
onChange: function(e) { setSettings(function(s) { return Object.assign({}, s, { signatureTemplate: e.target.value }); }); },
|
|
274
|
+
placeholder: '<table cellpadding="0" cellspacing="0" style="font-family: Arial, sans-serif; font-size: 13px; color: #333;">\n <tr>\n <td style="padding-right: 15px; border-right: 2px solid #6366f1;">\n <img src="{{logo}}" width="60" alt="{{company}}">\n </td>\n <td style="padding-left: 15px;">\n <b style="font-size: 14px;">{{name}}</b><br>\n <span style="color: #6366f1;">{{role}}</span><br>\n <span style="color: #888;">{{email}}</span><br>\n <span style="color: #888;">{{company}}</span>\n </td>\n </tr>\n</table>',
|
|
275
|
+
rows: 12,
|
|
276
|
+
style: { fontFamily: 'var(--font-mono)', fontSize: 12, resize: 'vertical' }
|
|
277
|
+
})
|
|
278
|
+
),
|
|
279
|
+
h('div', { style: { display: 'flex', gap: 8, flexWrap: 'wrap', marginBottom: 12 } },
|
|
280
|
+
h('span', { className: 'badge', style: { fontSize: 11 } }, '{{name}}'),
|
|
281
|
+
h('span', { className: 'badge', style: { fontSize: 11 } }, '{{role}}'),
|
|
282
|
+
h('span', { className: 'badge', style: { fontSize: 11 } }, '{{email}}'),
|
|
283
|
+
h('span', { className: 'badge', style: { fontSize: 11 } }, '{{phone}}'),
|
|
284
|
+
h('span', { className: 'badge', style: { fontSize: 11 } }, '{{company}}'),
|
|
285
|
+
h('span', { className: 'badge', style: { fontSize: 11 } }, '{{logo}}')
|
|
286
|
+
),
|
|
287
|
+
settings.signatureTemplate && h('div', { style: { marginBottom: 16 } },
|
|
288
|
+
h('label', { className: 'form-label' }, 'Preview'),
|
|
289
|
+
h('div', {
|
|
290
|
+
style: { background: 'white', padding: 16, borderRadius: 'var(--radius)', border: '1px solid var(--border)', color: '#333' },
|
|
291
|
+
dangerouslySetInnerHTML: {
|
|
292
|
+
__html: (settings.signatureTemplate || '')
|
|
293
|
+
.replace(/\{\{name\}\}/g, 'Jane Smith')
|
|
294
|
+
.replace(/\{\{role\}\}/g, 'Customer Support Lead')
|
|
295
|
+
.replace(/\{\{email\}\}/g, 'jane@company.com')
|
|
296
|
+
.replace(/\{\{phone\}\}/g, '+1 (555) 123-4567')
|
|
297
|
+
.replace(/\{\{company\}\}/g, settings.name || 'Your Company')
|
|
298
|
+
.replace(/\{\{logo\}\}/g, settings.logoUrl || 'https://placehold.co/60x60?text=Logo')
|
|
299
|
+
}
|
|
300
|
+
})
|
|
301
|
+
),
|
|
302
|
+
h('button', {
|
|
303
|
+
className: 'btn btn-primary',
|
|
304
|
+
onClick: function() {
|
|
305
|
+
apiCall('/settings', {
|
|
306
|
+
method: 'PATCH',
|
|
307
|
+
body: JSON.stringify({ signatureTemplate: settings.signatureTemplate })
|
|
308
|
+
}).then(function() { toast('Signature template saved', 'success'); }).catch(function(e) { toast(e.message, 'error'); });
|
|
309
|
+
}
|
|
310
|
+
}, 'Save Signature Template')
|
|
311
|
+
)
|
|
312
|
+
),
|
|
313
|
+
|
|
259
314
|
h('div', { className: 'card' },
|
|
260
315
|
h('div', { className: 'card-header' },
|
|
261
316
|
h('h3', null, 'Organization Email'),
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
provision,
|
|
15
15
|
runSetupWizard
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-M6GX25GK.js";
|
|
17
17
|
import {
|
|
18
18
|
ActionJournal,
|
|
19
19
|
ActivityTracker,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
MIGRATIONS_TABLE_POSTGRES,
|
|
46
46
|
sqliteToMySQL,
|
|
47
47
|
sqliteToPostgres
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-7RU5FIWV.js";
|
|
49
49
|
import {
|
|
50
50
|
AgentRuntime,
|
|
51
51
|
EmailChannel,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
executeTool,
|
|
61
61
|
runAgentLoop,
|
|
62
62
|
toolsToDefinitions
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-I6X4KSPW.js";
|
|
64
64
|
import "./chunk-TYW5XTOW.js";
|
|
65
65
|
import "./chunk-AQH4DFYV.js";
|
|
66
66
|
import {
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
requireRole,
|
|
77
77
|
securityHeaders,
|
|
78
78
|
validate
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-EUMQIDYD.js";
|
|
80
80
|
import "./chunk-3SMTCIR4.js";
|
|
81
81
|
import "./chunk-RO537U6H.js";
|
|
82
82
|
import "./chunk-DRXMYYKN.js";
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
import {
|
|
112
112
|
createAdapter,
|
|
113
113
|
getSupportedDatabases
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-MHIFVS5L.js";
|
|
115
115
|
import {
|
|
116
116
|
AGENTICMAIL_TOOLS,
|
|
117
117
|
ALL_TOOLS,
|