@agenticmail/enterprise 0.5.26 → 0.5.27
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.
|
@@ -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')
|
package/package.json
CHANGED
|
@@ -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')
|