@agenticmail/enterprise 0.5.11 → 0.5.13
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-6TDW6ZNI.js +48 -0
- package/dist/chunk-AXLDCUI7.js +1943 -0
- package/dist/chunk-WOJ47LRQ.js +889 -0
- package/dist/cli-recover-BPRSA6ND.js +97 -0
- package/dist/cli-verify-Y34ZU5GM.js +98 -0
- package/dist/cli.js +3 -3
- package/dist/dashboard/pages/agents.js +66 -5
- package/dist/factory-4F24TJEY.js +9 -0
- package/dist/index.js +3 -3
- package/dist/postgres-YCHGNRSM.js +581 -0
- package/dist/server-KBYLJ4EZ.js +11 -0
- package/dist/setup-SZPCU3TC.js +20 -0
- package/package.json +1 -1
- package/src/dashboard/pages/agents.js +66 -5
- package/src/db/postgres.ts +6 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DomainLock
|
|
3
|
+
} from "./chunk-UPU23ZRG.js";
|
|
4
|
+
import "./chunk-KFQGP6VL.js";
|
|
5
|
+
|
|
6
|
+
// src/domain-lock/cli-recover.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 runRecover(args) {
|
|
13
|
+
const { default: inquirer } = await import("inquirer");
|
|
14
|
+
const { default: chalk } = await import("chalk");
|
|
15
|
+
const { default: ora } = await import("ora");
|
|
16
|
+
console.log("");
|
|
17
|
+
console.log(chalk.bold(" AgenticMail Enterprise \u2014 Domain Recovery"));
|
|
18
|
+
console.log(chalk.dim(" Recover your domain registration on a new machine."));
|
|
19
|
+
console.log("");
|
|
20
|
+
let domain = getFlag(args, "--domain");
|
|
21
|
+
if (!domain) {
|
|
22
|
+
const answer = await inquirer.prompt([{
|
|
23
|
+
type: "input",
|
|
24
|
+
name: "domain",
|
|
25
|
+
message: "Domain to recover:",
|
|
26
|
+
suffix: chalk.dim(" (e.g. agents.agenticmail.io)"),
|
|
27
|
+
validate: (v) => v.includes(".") || "Enter a valid domain"
|
|
28
|
+
}]);
|
|
29
|
+
domain = answer.domain;
|
|
30
|
+
}
|
|
31
|
+
let key = getFlag(args, "--key");
|
|
32
|
+
if (!key) {
|
|
33
|
+
const answer = await inquirer.prompt([{
|
|
34
|
+
type: "password",
|
|
35
|
+
name: "key",
|
|
36
|
+
message: "Deployment key:",
|
|
37
|
+
mask: "*",
|
|
38
|
+
validate: (v) => {
|
|
39
|
+
if (v.length !== 64) return "Deployment key should be 64 hex characters";
|
|
40
|
+
if (!/^[0-9a-fA-F]+$/.test(v)) return "Deployment key should be hexadecimal";
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
key = answer.key;
|
|
45
|
+
}
|
|
46
|
+
const spinner = ora("Contacting AgenticMail registry...").start();
|
|
47
|
+
const lock = new DomainLock();
|
|
48
|
+
const result = await lock.recover(domain, key);
|
|
49
|
+
if (!result.success) {
|
|
50
|
+
spinner.fail("Recovery failed");
|
|
51
|
+
console.log("");
|
|
52
|
+
console.error(chalk.red(` ${result.error}`));
|
|
53
|
+
console.log("");
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
spinner.succeed("Domain recovery initiated");
|
|
57
|
+
const { default: bcrypt } = await import("bcryptjs");
|
|
58
|
+
const keyHash = await bcrypt.hash(key, 12);
|
|
59
|
+
const dbPath = getFlag(args, "--db");
|
|
60
|
+
const dbType = getFlag(args, "--db-type") || "sqlite";
|
|
61
|
+
if (dbPath) {
|
|
62
|
+
try {
|
|
63
|
+
const spinnerDb = ora("Saving to local database...").start();
|
|
64
|
+
const { createAdapter } = await import("./factory-4F24TJEY.js");
|
|
65
|
+
const db = await createAdapter({ type: dbType, connectionString: dbPath });
|
|
66
|
+
await db.migrate();
|
|
67
|
+
await db.updateSettings({
|
|
68
|
+
domain,
|
|
69
|
+
deploymentKeyHash: keyHash,
|
|
70
|
+
domainRegistrationId: result.registrationId,
|
|
71
|
+
domainDnsChallenge: result.dnsChallenge,
|
|
72
|
+
domainRegisteredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
73
|
+
domainStatus: "pending_dns"
|
|
74
|
+
});
|
|
75
|
+
spinnerDb.succeed("Local database updated");
|
|
76
|
+
await db.disconnect();
|
|
77
|
+
} catch (err) {
|
|
78
|
+
console.log(chalk.yellow(`
|
|
79
|
+
Could not update local DB: ${err.message}`));
|
|
80
|
+
console.log(chalk.dim(" You can manually update settings after setup."));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
console.log("");
|
|
84
|
+
console.log(chalk.green.bold(" Domain recovery successful!"));
|
|
85
|
+
console.log("");
|
|
86
|
+
console.log(chalk.bold(" Update your DNS TXT record:"));
|
|
87
|
+
console.log("");
|
|
88
|
+
console.log(` ${chalk.bold("Host:")} ${chalk.cyan(`_agenticmail-verify.${domain}`)}`);
|
|
89
|
+
console.log(` ${chalk.bold("Type:")} ${chalk.cyan("TXT")}`);
|
|
90
|
+
console.log(` ${chalk.bold("Value:")} ${chalk.cyan(result.dnsChallenge)}`);
|
|
91
|
+
console.log("");
|
|
92
|
+
console.log(chalk.dim(" Then run: npx @agenticmail/enterprise verify-domain"));
|
|
93
|
+
console.log("");
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
runRecover
|
|
97
|
+
};
|
|
@@ -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-4F24TJEY.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-BPRSA6ND.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-Y34ZU5GM.js").then((m) => m.runVerifyDomain(args.slice(1))).catch(fatal);
|
|
21
21
|
break;
|
|
22
22
|
case "--help":
|
|
23
23
|
case "-h":
|
|
@@ -48,7 +48,7 @@ Skill Development:
|
|
|
48
48
|
break;
|
|
49
49
|
case "setup":
|
|
50
50
|
default:
|
|
51
|
-
import("./setup-
|
|
51
|
+
import("./setup-SZPCU3TC.js").then((m) => m.runSetupWizard()).catch(fatal);
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
function fatal(err) {
|
|
@@ -244,12 +244,20 @@ export function CreateAgentWizard({ onClose, onCreated, toast }) {
|
|
|
244
244
|
const [selectedSoul, setSelectedSoul] = useState(null);
|
|
245
245
|
const [previewOpen, setPreviewOpen] = useState(false);
|
|
246
246
|
const [loading, setLoading] = useState(false);
|
|
247
|
+
const [showSetupGuide, setShowSetupGuide] = useState(false);
|
|
248
|
+
const [setupChecked, setSetupChecked] = useState(false);
|
|
247
249
|
|
|
248
250
|
useEffect(() => {
|
|
249
251
|
engineCall('/skills/by-category').then(d => setAllSkills(d.categories || {})).catch(() => {});
|
|
250
252
|
engineCall('/profiles/presets').then(d => setPresets(d.presets || [])).catch(() => {});
|
|
251
253
|
engineCall('/souls/by-category').then(d => { setSoulCategories(d.categories || {}); setSoulMeta(d.categoryMeta || {}); }).catch(() => {});
|
|
252
|
-
apiCall('/providers').then(function(d) {
|
|
254
|
+
apiCall('/providers').then(function(d) {
|
|
255
|
+
var provList = d.providers || [];
|
|
256
|
+
setProviders(provList);
|
|
257
|
+
var hasConfigured = provList.some(function(p) { return p.configured; });
|
|
258
|
+
if (!hasConfigured) { setShowSetupGuide(true); }
|
|
259
|
+
setSetupChecked(true);
|
|
260
|
+
}).catch(function() { setShowSetupGuide(true); setSetupChecked(true); });
|
|
253
261
|
}, []);
|
|
254
262
|
|
|
255
263
|
// Fetch models when provider changes
|
|
@@ -452,6 +460,59 @@ export function CreateAgentWizard({ onClose, onCreated, toast }) {
|
|
|
452
460
|
|
|
453
461
|
const stepIcons = ['soul', 'basics', 'skills', 'perms', 'deploy', 'review'];
|
|
454
462
|
|
|
463
|
+
// ─── Setup Guide Modal ───────────────────────────────────
|
|
464
|
+
if (showSetupGuide) {
|
|
465
|
+
return h('div', { className: 'modal-overlay', onClick: e => { if (e.target === e.currentTarget) onClose(); } },
|
|
466
|
+
h('div', { className: 'modal', style: { maxWidth: 600 } },
|
|
467
|
+
h('div', { className: 'modal-header' },
|
|
468
|
+
h('div', null,
|
|
469
|
+
h('h2', null, '⚡ Setup Required'),
|
|
470
|
+
h('p', { style: { fontSize: 12, color: 'var(--text-muted)', margin: '2px 0 0', fontWeight: 400 } }, 'Complete these steps before creating your first agent')
|
|
471
|
+
),
|
|
472
|
+
h('button', { className: 'btn btn-ghost btn-icon', onClick: onClose }, I.x())
|
|
473
|
+
),
|
|
474
|
+
h('div', { className: 'modal-body', style: { padding: '24px' } },
|
|
475
|
+
h('p', { style: { marginBottom: 20, color: 'var(--text-secondary)', lineHeight: 1.6 } },
|
|
476
|
+
'Your agents need an LLM provider (like Anthropic or OpenAI) to think and act. Set up at least one provider with an API key before creating agents.'
|
|
477
|
+
),
|
|
478
|
+
h('div', { style: { display: 'flex', flexDirection: 'column', gap: 16 } },
|
|
479
|
+
h('div', { style: { padding: 16, borderRadius: 'var(--radius-lg)', border: '1px solid var(--border)', background: 'var(--bg-secondary)' } },
|
|
480
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: 12, marginBottom: 8 } },
|
|
481
|
+
h('div', { style: { width: 28, height: 28, borderRadius: '50%', background: 'var(--accent)', color: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center', fontWeight: 700, fontSize: 14, flexShrink: 0 } }, '1'),
|
|
482
|
+
h('strong', null, 'Add an LLM Provider API Key')
|
|
483
|
+
),
|
|
484
|
+
h('p', { style: { margin: 0, color: 'var(--text-muted)', fontSize: 13, paddingLeft: 40, lineHeight: 1.5 } },
|
|
485
|
+
'Go to Settings → LLM Providers and add your API key for at least one provider. Recommended: Anthropic (Claude) or OpenAI (GPT).'
|
|
486
|
+
)
|
|
487
|
+
),
|
|
488
|
+
h('div', { style: { padding: 16, borderRadius: 'var(--radius-lg)', border: '1px solid var(--border)', background: 'var(--bg-secondary)' } },
|
|
489
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: 12, marginBottom: 8 } },
|
|
490
|
+
h('div', { style: { width: 28, height: 28, borderRadius: '50%', background: 'var(--accent)', color: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center', fontWeight: 700, fontSize: 14, flexShrink: 0 } }, '2'),
|
|
491
|
+
h('strong', null, 'Configure Email Domain (Optional)')
|
|
492
|
+
),
|
|
493
|
+
h('p', { style: { margin: 0, color: 'var(--text-muted)', fontSize: 13, paddingLeft: 40, lineHeight: 1.5 } },
|
|
494
|
+
'Set up your email domain in Settings → Domain so agents can send and receive emails as agent@yourdomain.com.'
|
|
495
|
+
)
|
|
496
|
+
),
|
|
497
|
+
h('div', { style: { padding: 16, borderRadius: 'var(--radius-lg)', border: '1px solid var(--border)', background: 'var(--bg-secondary)' } },
|
|
498
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: 12, marginBottom: 8 } },
|
|
499
|
+
h('div', { style: { width: 28, height: 28, borderRadius: '50%', background: 'var(--accent)', color: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center', fontWeight: 700, fontSize: 14, flexShrink: 0 } }, '3'),
|
|
500
|
+
h('strong', null, 'Set Security Policies (Optional)')
|
|
501
|
+
),
|
|
502
|
+
h('p', { style: { margin: 0, color: 'var(--text-muted)', fontSize: 13, paddingLeft: 40, lineHeight: 1.5 } },
|
|
503
|
+
'Review Settings → Guardrails to set tool approval policies, rate limits, and data loss prevention rules.'
|
|
504
|
+
)
|
|
505
|
+
)
|
|
506
|
+
),
|
|
507
|
+
h('div', { style: { display: 'flex', gap: 12, marginTop: 24, justifyContent: 'flex-end' } },
|
|
508
|
+
h('button', { className: 'btn btn-ghost', onClick: function() { setShowSetupGuide(false); } }, 'Skip for Now'),
|
|
509
|
+
h('a', { href: '#/settings', className: 'btn btn-primary', onClick: function() { onClose(); } }, 'Go to Settings')
|
|
510
|
+
)
|
|
511
|
+
)
|
|
512
|
+
)
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
|
|
455
516
|
return h('div', { className: 'modal-overlay', onClick: e => { if (e.target === e.currentTarget) onClose(); } },
|
|
456
517
|
h('div', { className: 'modal modal-xl' },
|
|
457
518
|
h('div', { className: 'modal-header' },
|
|
@@ -669,14 +730,14 @@ export function CreateAgentWizard({ onClose, onCreated, toast }) {
|
|
|
669
730
|
value: form.provider || 'anthropic',
|
|
670
731
|
onChange: function(e) { setForm(Object.assign({}, form, { provider: e.target.value })); },
|
|
671
732
|
},
|
|
672
|
-
providers.length > 0
|
|
733
|
+
providers.length > 0 && providers.some(function(p) { return p.configured; })
|
|
673
734
|
? providers.filter(function(p) { return p.configured; }).map(function(p) {
|
|
674
735
|
return h('option', { key: p.id, value: p.id }, p.name + (p.isLocal ? ' (Local)' : ''));
|
|
675
736
|
})
|
|
676
737
|
: [
|
|
677
|
-
h('option', { value: 'anthropic' }, 'Anthropic'),
|
|
678
|
-
h('option', { value: 'openai' }, 'OpenAI'),
|
|
679
|
-
h('option', { value: 'google' }, 'Google'),
|
|
738
|
+
h('option', { value: 'anthropic' }, 'Anthropic (Claude)'),
|
|
739
|
+
h('option', { value: 'openai' }, 'OpenAI (GPT)'),
|
|
740
|
+
h('option', { value: 'google' }, 'Google (Gemini)'),
|
|
680
741
|
h('option', { value: 'deepseek' }, 'DeepSeek'),
|
|
681
742
|
h('option', { value: 'xai' }, 'xAI (Grok)'),
|
|
682
743
|
h('option', { value: 'mistral' }, 'Mistral'),
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
requireRole,
|
|
27
27
|
securityHeaders,
|
|
28
28
|
validate
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-AXLDCUI7.js";
|
|
30
30
|
import {
|
|
31
31
|
PROVIDER_REGISTRY,
|
|
32
32
|
listAllProviders,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
import {
|
|
37
37
|
provision,
|
|
38
38
|
runSetupWizard
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-WOJ47LRQ.js";
|
|
40
40
|
import {
|
|
41
41
|
ENGINE_TABLES,
|
|
42
42
|
ENGINE_TABLES_POSTGRES,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
import {
|
|
99
99
|
createAdapter,
|
|
100
100
|
getSupportedDatabases
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-6TDW6ZNI.js";
|
|
102
102
|
import {
|
|
103
103
|
AGENTICMAIL_TOOLS,
|
|
104
104
|
ALL_TOOLS,
|