@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
|
@@ -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/src/db/adapter.ts
CHANGED
|
@@ -195,6 +195,8 @@ export interface CompanySettings {
|
|
|
195
195
|
domainVerifiedAt?: string;
|
|
196
196
|
domainRegisteredAt?: string;
|
|
197
197
|
domainStatus?: 'unregistered' | 'pending_dns' | 'verified' | 'failed';
|
|
198
|
+
cfApiToken?: string;
|
|
199
|
+
cfAccountId?: string;
|
|
198
200
|
toolSecurityConfig?: Record<string, any>;
|
|
199
201
|
firewallConfig?: FirewallConfig;
|
|
200
202
|
modelPricingConfig?: ModelPricingConfig;
|
package/src/db/postgres.ts
CHANGED
|
@@ -102,6 +102,10 @@ export class PostgresAdapter extends DatabaseAdapter {
|
|
|
102
102
|
await client.query(`
|
|
103
103
|
ALTER TABLE company_settings ADD COLUMN IF NOT EXISTS org_id TEXT
|
|
104
104
|
`).catch(() => {});
|
|
105
|
+
await client.query(`
|
|
106
|
+
ALTER TABLE company_settings ADD COLUMN IF NOT EXISTS cf_api_token TEXT;
|
|
107
|
+
ALTER TABLE company_settings ADD COLUMN IF NOT EXISTS cf_account_id TEXT;
|
|
108
|
+
`).catch(() => {});
|
|
105
109
|
await client.query('COMMIT');
|
|
106
110
|
} catch (err) {
|
|
107
111
|
await client.query('ROLLBACK');
|
|
@@ -141,6 +145,8 @@ export class PostgresAdapter extends DatabaseAdapter {
|
|
|
141
145
|
domainVerifiedAt: 'domain_verified_at',
|
|
142
146
|
domainRegisteredAt: 'domain_registered_at',
|
|
143
147
|
domainStatus: 'domain_status',
|
|
148
|
+
cfApiToken: 'cf_api_token',
|
|
149
|
+
cfAccountId: 'cf_account_id',
|
|
144
150
|
};
|
|
145
151
|
for (const [key, col] of Object.entries(map)) {
|
|
146
152
|
if ((updates as any)[key] !== undefined) {
|
|
@@ -545,6 +551,8 @@ export class PostgresAdapter extends DatabaseAdapter {
|
|
|
545
551
|
domainVerifiedAt: r.domain_verified_at || undefined,
|
|
546
552
|
domainRegisteredAt: r.domain_registered_at || undefined,
|
|
547
553
|
domainStatus: r.domain_status || 'unregistered',
|
|
554
|
+
cfApiToken: r.cf_api_token || undefined,
|
|
555
|
+
cfAccountId: r.cf_account_id || undefined,
|
|
548
556
|
};
|
|
549
557
|
}
|
|
550
558
|
}
|