@agenticmail/enterprise 0.5.26 → 0.5.28
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-OUQXTFOT.js +2115 -0
- package/dist/chunk-TCMLGWLQ.js +898 -0
- package/dist/chunk-ZMZCLNTY.js +48 -0
- package/dist/cli-recover-BW6DAPJY.js +97 -0
- package/dist/cli-verify-CZHJ2MW2.js +98 -0
- package/dist/cli.js +3 -3
- package/dist/dashboard/pages/agents.js +35 -1
- package/dist/dashboard/pages/settings.js +65 -33
- package/dist/factory-W7N4VZNK.js +9 -0
- package/dist/index.js +3 -3
- package/dist/postgres-PG4ZGLJ4.js +597 -0
- package/dist/server-BV7HHV7K.js +12 -0
- package/dist/setup-3M3NTZNY.js +20 -0
- package/package.json +1 -1
- package/src/admin/routes.ts +2 -0
- package/src/dashboard/pages/agents.js +35 -1
- package/src/dashboard/pages/settings.js +65 -33
- package/src/db/adapter.ts +2 -0
- package/src/db/postgres.ts +8 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/db/factory.ts
|
|
2
|
+
var ADAPTER_MAP = {
|
|
3
|
+
postgres: () => import("./postgres-PG4ZGLJ4.js").then((m) => m.PostgresAdapter),
|
|
4
|
+
supabase: () => import("./postgres-PG4ZGLJ4.js").then((m) => m.PostgresAdapter),
|
|
5
|
+
// Supabase IS Postgres
|
|
6
|
+
neon: () => import("./postgres-PG4ZGLJ4.js").then((m) => m.PostgresAdapter),
|
|
7
|
+
// Neon IS Postgres
|
|
8
|
+
cockroachdb: () => import("./postgres-PG4ZGLJ4.js").then((m) => m.PostgresAdapter),
|
|
9
|
+
// CockroachDB is PG-compatible
|
|
10
|
+
mysql: () => import("./mysql-SPPOCBFA.js").then((m) => m.MysqlAdapter),
|
|
11
|
+
planetscale: () => import("./mysql-SPPOCBFA.js").then((m) => m.MysqlAdapter),
|
|
12
|
+
// PlanetScale IS MySQL
|
|
13
|
+
mongodb: () => import("./mongodb-MWH3DGZY.js").then((m) => m.MongoAdapter),
|
|
14
|
+
sqlite: () => import("./sqlite-BA2TMKVB.js").then((m) => m.SqliteAdapter),
|
|
15
|
+
turso: () => import("./turso-CEAPRUFX.js").then((m) => m.TursoAdapter),
|
|
16
|
+
dynamodb: () => import("./dynamodb-QS64UREL.js").then((m) => m.DynamoAdapter)
|
|
17
|
+
};
|
|
18
|
+
async function createAdapter(config) {
|
|
19
|
+
const loader = ADAPTER_MAP[config.type];
|
|
20
|
+
if (!loader) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
`Unsupported database type: "${config.type}". Supported: ${Object.keys(ADAPTER_MAP).join(", ")}`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
const AdapterClass = await loader();
|
|
26
|
+
const adapter = new AdapterClass();
|
|
27
|
+
await adapter.connect(config);
|
|
28
|
+
return adapter;
|
|
29
|
+
}
|
|
30
|
+
function getSupportedDatabases() {
|
|
31
|
+
return [
|
|
32
|
+
{ type: "postgres", label: "PostgreSQL", group: "SQL" },
|
|
33
|
+
{ type: "mysql", label: "MySQL / MariaDB", group: "SQL" },
|
|
34
|
+
{ type: "sqlite", label: "SQLite (embedded, dev/small)", group: "SQL" },
|
|
35
|
+
{ type: "mongodb", label: "MongoDB", group: "NoSQL" },
|
|
36
|
+
{ type: "turso", label: "Turso (LibSQL, edge)", group: "Edge" },
|
|
37
|
+
{ type: "dynamodb", label: "DynamoDB (AWS)", group: "Cloud" },
|
|
38
|
+
{ type: "supabase", label: "Supabase (managed Postgres)", group: "Cloud" },
|
|
39
|
+
{ type: "neon", label: "Neon (serverless Postgres)", group: "Cloud" },
|
|
40
|
+
{ type: "planetscale", label: "PlanetScale (managed MySQL)", group: "Cloud" },
|
|
41
|
+
{ type: "cockroachdb", label: "CockroachDB", group: "Distributed" }
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
createAdapter,
|
|
47
|
+
getSupportedDatabases
|
|
48
|
+
};
|
|
@@ -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-W7N4VZNK.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-W7N4VZNK.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-BW6DAPJY.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-CZHJ2MW2.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-3M3NTZNY.js").then((m) => m.runSetupWizard()).catch(fatal);
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
function fatal(err) {
|
|
@@ -233,7 +233,7 @@ export function DeploymentProgress({ agentId, onComplete }) {
|
|
|
233
233
|
export function CreateAgentWizard({ onClose, onCreated, toast }) {
|
|
234
234
|
const [step, setStep] = useState(0);
|
|
235
235
|
const steps = ['Role', 'Basics', 'Persona', 'Skills', 'Permissions', 'Deployment', 'Review'];
|
|
236
|
-
const [form, setForm] = useState({ name: '', email: '', role: 'assistant', description: '', personality: '', skills: [], preset: null, customTools: { allowed: [], blocked: [] }, deployTarget: '
|
|
236
|
+
const [form, setForm] = useState({ name: '', email: '', role: 'assistant', description: '', personality: '', skills: [], preset: null, customTools: { allowed: [], blocked: [] }, deployTarget: 'fly', knowledgeBases: [], provider: '', model: '', approvalRequired: true, soulId: null, avatar: null, gender: '', dateOfBirth: '', maritalStatus: '', culturalBackground: '', language: 'en-us', autoOnboard: true, maxRiskLevel: 'medium', blockedSideEffects: ['runs-code', 'deletes-data', 'financial', 'controls-device'], approvalForRiskLevels: ['high', 'critical'], approvalForSideEffects: ['sends-email', 'sends-message'], rateLimits: { toolCallsPerMinute: 30, toolCallsPerHour: 500, toolCallsPerDay: 5000, externalActionsPerHour: 50 }, constraints: { maxConcurrentTasks: 5, maxSessionDurationMinutes: 480, sandboxMode: false }, traits: { communication: 'direct', detail: 'detail-oriented', energy: 'calm', humor: 'warm', formality: 'adaptive', empathy: 'moderate', patience: 'patient', creativity: 'creative' } });
|
|
237
237
|
const [allSkills, setAllSkills] = useState({});
|
|
238
238
|
const [providers, setProviders] = useState([]);
|
|
239
239
|
const [providerModels, setProviderModels] = useState([]);
|
|
@@ -245,6 +245,38 @@ export function CreateAgentWizard({ onClose, onCreated, toast }) {
|
|
|
245
245
|
const [previewOpen, setPreviewOpen] = useState(false);
|
|
246
246
|
const [loading, setLoading] = useState(false);
|
|
247
247
|
const [showSetupGuide, setShowSetupGuide] = useState(false);
|
|
248
|
+
const [draftSaved, setDraftSaved] = useState(false);
|
|
249
|
+
|
|
250
|
+
// Load draft from localStorage on mount
|
|
251
|
+
useEffect(function() {
|
|
252
|
+
try {
|
|
253
|
+
var draft = localStorage.getItem('em_agent_draft');
|
|
254
|
+
if (draft) {
|
|
255
|
+
var parsed = JSON.parse(draft);
|
|
256
|
+
setForm(function(f) { return Object.assign({}, f, parsed); });
|
|
257
|
+
if (parsed._step) setStep(parsed._step);
|
|
258
|
+
}
|
|
259
|
+
} catch {}
|
|
260
|
+
}, []);
|
|
261
|
+
|
|
262
|
+
// Save draft function
|
|
263
|
+
var saveDraft = useCallback(function() {
|
|
264
|
+
try {
|
|
265
|
+
localStorage.setItem('em_agent_draft', JSON.stringify(Object.assign({}, form, { _step: step })));
|
|
266
|
+
setDraftSaved(true);
|
|
267
|
+
setTimeout(function() { setDraftSaved(false); }, 2000);
|
|
268
|
+
} catch {}
|
|
269
|
+
}, [form, step]);
|
|
270
|
+
|
|
271
|
+
// Auto-save draft on step change
|
|
272
|
+
useEffect(function() {
|
|
273
|
+
if (form.name) {
|
|
274
|
+
try { localStorage.setItem('em_agent_draft', JSON.stringify(Object.assign({}, form, { _step: step }))); } catch {}
|
|
275
|
+
}
|
|
276
|
+
}, [step]);
|
|
277
|
+
|
|
278
|
+
// Clear draft after successful creation
|
|
279
|
+
var clearDraft = function() { try { localStorage.removeItem('em_agent_draft'); } catch {} };
|
|
248
280
|
const [setupChecked, setSetupChecked] = useState(false);
|
|
249
281
|
|
|
250
282
|
useEffect(() => {
|
|
@@ -455,6 +487,7 @@ export function CreateAgentWizard({ onClose, onCreated, toast }) {
|
|
|
455
487
|
toast('Agent "' + form.name + '" created successfully', 'success');
|
|
456
488
|
}
|
|
457
489
|
|
|
490
|
+
clearDraft();
|
|
458
491
|
onCreated();
|
|
459
492
|
onClose();
|
|
460
493
|
} catch (err) { toast(err.message, 'error'); }
|
|
@@ -1069,6 +1102,7 @@ export function CreateAgentWizard({ onClose, onCreated, toast }) {
|
|
|
1069
1102
|
h('div', { className: 'modal-footer' },
|
|
1070
1103
|
step > 0 && h('button', { className: 'btn btn-secondary', onClick: () => setStep(step - 1) }, 'Back'),
|
|
1071
1104
|
step === 0 && !form.soulId && h('button', { className: 'btn btn-ghost', onClick: () => setStep(1) }, 'Skip — Configure Manually'),
|
|
1105
|
+
h('button', { className: 'btn btn-ghost', onClick: saveDraft, style: { fontSize: 12 } }, draftSaved ? '\u2713 Draft Saved' : 'Save Draft'),
|
|
1072
1106
|
h('div', { style: { flex: 1 } }),
|
|
1073
1107
|
step < lastStep && h('button', { className: 'btn btn-primary', disabled: !canNext(), onClick: () => setStep(step + 1) }, 'Next'),
|
|
1074
1108
|
step === lastStep && h('button', { className: 'btn btn-primary', disabled: loading, onClick: doCreate }, loading ? 'Creating...' : 'Create Agent')
|
|
@@ -383,41 +383,73 @@ export function SettingsPage() {
|
|
|
383
383
|
)
|
|
384
384
|
),
|
|
385
385
|
|
|
386
|
-
tab === 'email' && h('div',
|
|
387
|
-
|
|
388
|
-
h('div', { className: 'card
|
|
389
|
-
h('
|
|
390
|
-
h('div', {
|
|
391
|
-
h('div', {
|
|
392
|
-
h('
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
),
|
|
403
|
-
h('button', { className: 'btn btn-primary btn-sm', onClick: () => apiCall('/settings', { method: 'PATCH', body: JSON.stringify({ smtpHost: 'smtp.gmail.com', smtpPort: 587, smtpUser: settings.relayEmail || null, smtpPass: settings.relayPassword || null }) }).then(d => { setSettings(s => ({ ...s, ...d })); toast('Relay config saved', 'success'); }).catch(e => toast(e.message, 'error')) }, 'Save Relay Config')
|
|
404
|
-
),
|
|
405
|
-
h('div', { className: 'preset-card', style: { cursor: 'default' } },
|
|
406
|
-
h('h4', null, 'Custom Domain'),
|
|
407
|
-
h('p', { style: { marginBottom: 12 } }, 'Professional setup. Agents send from agent@yourdomain.com with full email authentication.'),
|
|
408
|
-
h('div', { className: 'form-group' },
|
|
409
|
-
h('label', { className: 'form-label' }, 'Domain'),
|
|
410
|
-
h('input', { className: 'input', value: settings.emailDomain || '', onChange: e => setSettings(s => ({ ...s, emailDomain: e.target.value })), placeholder: 'yourdomain.com' })
|
|
411
|
-
),
|
|
412
|
-
h('div', { className: 'form-group' },
|
|
413
|
-
h('label', { className: 'form-label' }, 'Cloudflare API Token'),
|
|
414
|
-
h('input', { className: 'input', type: 'password', value: settings.cfApiToken || '', onChange: e => setSettings(s => ({ ...s, cfApiToken: e.target.value })), placeholder: 'Your Cloudflare API token' })
|
|
386
|
+
tab === 'email' && h('div', null,
|
|
387
|
+
// Saved configurations summary
|
|
388
|
+
(settings.smtpUser || settings.cfApiToken) && h('div', { className: 'card', style: { marginBottom: 16 } },
|
|
389
|
+
h('div', { className: 'card-header' }, h('h3', null, 'Active Email Configuration')),
|
|
390
|
+
h('div', { className: 'card-body' },
|
|
391
|
+
h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 } },
|
|
392
|
+
settings.smtpUser && h('div', { style: { padding: 12, background: 'var(--bg-success, rgba(34,197,94,0.08))', borderRadius: 'var(--radius)', border: '1px solid var(--border)' } },
|
|
393
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, marginBottom: 8 } },
|
|
394
|
+
h('span', { style: { color: '#22c55e', fontSize: 18 } }, '\u2713'),
|
|
395
|
+
h('strong', null, 'Relay Configured')
|
|
396
|
+
),
|
|
397
|
+
h('div', { style: { fontSize: 13, color: 'var(--text-secondary)' } },
|
|
398
|
+
h('div', null, 'Host: ', h('code', null, settings.smtpHost || 'smtp.gmail.com')),
|
|
399
|
+
h('div', null, 'User: ', h('code', null, settings.smtpUser)),
|
|
400
|
+
h('div', null, 'Password: ', h('code', null, '\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022'))
|
|
401
|
+
)
|
|
415
402
|
),
|
|
416
|
-
h('div', {
|
|
417
|
-
h('
|
|
418
|
-
|
|
403
|
+
settings.cfApiToken && h('div', { style: { padding: 12, background: 'var(--bg-success, rgba(34,197,94,0.08))', borderRadius: 'var(--radius)', border: '1px solid var(--border)' } },
|
|
404
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, marginBottom: 8 } },
|
|
405
|
+
h('span', { style: { color: '#22c55e', fontSize: 18 } }, '\u2713'),
|
|
406
|
+
h('strong', null, 'Custom Domain Configured')
|
|
407
|
+
),
|
|
408
|
+
h('div', { style: { fontSize: 13, color: 'var(--text-secondary)' } },
|
|
409
|
+
h('div', null, 'Domain: ', h('code', null, settings.domain || 'Not set')),
|
|
410
|
+
h('div', null, 'CF Token: ', h('code', null, (settings.cfApiToken || '').slice(0, 8) + '\u2022\u2022\u2022\u2022')),
|
|
411
|
+
h('div', null, 'CF Account: ', h('code', null, settings.cfAccountId || 'Not set'))
|
|
412
|
+
)
|
|
413
|
+
)
|
|
414
|
+
)
|
|
415
|
+
)
|
|
416
|
+
),
|
|
417
|
+
h('div', { className: 'card' },
|
|
418
|
+
h('div', { className: 'card-header' }, h('h3', null, 'Email & Domain Configuration')),
|
|
419
|
+
h('div', { className: 'card-body' },
|
|
420
|
+
h('p', { style: { color: 'var(--text-secondary)', fontSize: 13, marginBottom: 20 } }, 'Configure how agents send and receive email. Choose between a relay (Gmail/Outlook forwarding) or a custom domain with full DKIM/SPF/DMARC.'),
|
|
421
|
+
h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 } },
|
|
422
|
+
h('div', { className: 'preset-card', style: { cursor: 'default' } },
|
|
423
|
+
h('h4', null, 'Gmail / Outlook Relay'),
|
|
424
|
+
h('p', { style: { marginBottom: 12 } }, 'Easy setup. Agents send from yourname+agent@gmail.com. Best for getting started.'),
|
|
425
|
+
h('div', { className: 'form-group' },
|
|
426
|
+
h('label', { className: 'form-label' }, 'Email Address'),
|
|
427
|
+
h('input', { className: 'input', value: settings.smtpUser || '', onChange: e => setSettings(s => ({ ...s, smtpUser: e.target.value })), placeholder: 'you@gmail.com' })
|
|
428
|
+
),
|
|
429
|
+
h('div', { className: 'form-group' },
|
|
430
|
+
h('label', { className: 'form-label' }, 'App Password'),
|
|
431
|
+
h('input', { className: 'input', type: 'password', value: settings.smtpPass || '', onChange: e => setSettings(s => ({ ...s, smtpPass: e.target.value })), placeholder: 'xxxx xxxx xxxx xxxx' }),
|
|
432
|
+
h('p', { className: 'form-help' }, h('a', { href: 'https://myaccount.google.com/apppasswords', target: '_blank' }, 'Get app password from Google'))
|
|
433
|
+
),
|
|
434
|
+
h('button', { className: 'btn btn-primary btn-sm', onClick: () => apiCall('/settings', { method: 'PATCH', body: JSON.stringify({ smtpHost: 'smtp.gmail.com', smtpPort: 587, smtpUser: settings.smtpUser || null, smtpPass: settings.smtpPass || null }) }).then(d => { setSettings(s => ({ ...s, ...d })); toast('Relay config saved', 'success'); }).catch(e => toast(e.message, 'error')) }, 'Save Relay Config')
|
|
419
435
|
),
|
|
420
|
-
h('
|
|
436
|
+
h('div', { className: 'preset-card', style: { cursor: 'default' } },
|
|
437
|
+
h('h4', null, 'Custom Domain'),
|
|
438
|
+
h('p', { style: { marginBottom: 12 } }, 'Professional setup. Agents send from agent@yourdomain.com with full email authentication.'),
|
|
439
|
+
h('div', { className: 'form-group' },
|
|
440
|
+
h('label', { className: 'form-label' }, 'Domain'),
|
|
441
|
+
h('input', { className: 'input', value: settings.domain || '', onChange: e => setSettings(s => ({ ...s, domain: e.target.value })), placeholder: 'yourdomain.com' })
|
|
442
|
+
),
|
|
443
|
+
h('div', { className: 'form-group' },
|
|
444
|
+
h('label', { className: 'form-label' }, 'Cloudflare API Token'),
|
|
445
|
+
h('input', { className: 'input', type: 'password', value: settings.cfApiToken || '', onChange: e => setSettings(s => ({ ...s, cfApiToken: e.target.value })), placeholder: 'Your Cloudflare API token' })
|
|
446
|
+
),
|
|
447
|
+
h('div', { className: 'form-group' },
|
|
448
|
+
h('label', { className: 'form-label' }, 'Cloudflare Account ID'),
|
|
449
|
+
h('input', { className: 'input', value: settings.cfAccountId || '', onChange: e => setSettings(s => ({ ...s, cfAccountId: e.target.value })), placeholder: 'Account ID' })
|
|
450
|
+
),
|
|
451
|
+
h('button', { className: 'btn btn-primary btn-sm', onClick: () => apiCall('/settings', { method: 'PATCH', body: JSON.stringify({ domain: settings.domain || null, cfApiToken: settings.cfApiToken || null, cfAccountId: settings.cfAccountId || null }) }).then(d => { setSettings(s => ({ ...s, ...d })); toast('Domain config saved', 'success'); }).catch(e => toast(e.message, 'error')) }, 'Save Domain Config')
|
|
452
|
+
)
|
|
421
453
|
)
|
|
422
454
|
)
|
|
423
455
|
)
|
package/dist/index.js
CHANGED
|
@@ -50,11 +50,11 @@ import {
|
|
|
50
50
|
requireRole,
|
|
51
51
|
securityHeaders,
|
|
52
52
|
validate
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-OUQXTFOT.js";
|
|
54
54
|
import {
|
|
55
55
|
provision,
|
|
56
56
|
runSetupWizard
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-TCMLGWLQ.js";
|
|
58
58
|
import {
|
|
59
59
|
ENGINE_TABLES,
|
|
60
60
|
ENGINE_TABLES_POSTGRES,
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
import {
|
|
100
100
|
createAdapter,
|
|
101
101
|
getSupportedDatabases
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-ZMZCLNTY.js";
|
|
103
103
|
import {
|
|
104
104
|
AGENTICMAIL_TOOLS,
|
|
105
105
|
ALL_TOOLS,
|