@agenticmail/enterprise 0.5.31 → 0.5.32

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.
@@ -209,7 +209,7 @@ export function createAgentRoutes(opts: {
209
209
  * Returns both IDs and the full agent object.
210
210
  */
211
211
  router.post('/bridge/agents', async (c) => {
212
- const { orgId, name, email, displayName, role, model, deployment, permissionProfile, presetName, createdBy, persona, permissions: permissionsData } = await c.req.json();
212
+ const { orgId, name, email, displayName, role, model, deployment, permissionProfile, presetName, createdBy, persona, permissions: permissionsData, skills, knowledgeBases, description, soulId, deployTarget } = await c.req.json();
213
213
 
214
214
  if (!name || !orgId) {
215
215
  return c.json({ error: 'name and orgId are required' }, 400);
@@ -218,32 +218,43 @@ export function createAgentRoutes(opts: {
218
218
  const actor = c.req.header('X-User-Id') || createdBy || 'system';
219
219
  const agentId = crypto.randomUUID();
220
220
 
221
- // Build the engine AgentConfig
221
+ // Build the engine AgentConfig — store EVERYTHING from the wizard
222
+ const agentEmail = email || `${name.toLowerCase().replace(/\s+/g, '-')}@agenticmail.local`;
223
+ const agentRole = role || 'assistant';
224
+ const agentDescription = description || persona?.description || '';
225
+
222
226
  const config: any = {
223
227
  id: agentId,
224
228
  name,
225
229
  displayName: displayName || name,
230
+ email: agentEmail,
231
+ role: agentRole,
232
+ description: agentDescription,
233
+ soulId: soulId || null,
226
234
  identity: {
227
- name: name,
228
- email: email || `${name.toLowerCase().replace(/\s+/g, '-')}@agenticmail.local`,
229
- role: role || 'assistant',
230
- personality: 'professional',
231
- description: persona?.description || '',
232
- ...(persona?.avatar && { avatar: persona.avatar }),
233
- ...(persona?.gender && { gender: persona.gender }),
234
- ...(persona?.dateOfBirth && { dateOfBirth: persona.dateOfBirth }),
235
- ...(persona?.maritalStatus && { maritalStatus: persona.maritalStatus }),
236
- ...(persona?.culturalBackground && { culturalBackground: persona.culturalBackground }),
237
- ...(persona?.language && { language: persona.language }),
238
- ...(persona?.traits && { traits: persona.traits }),
235
+ name,
236
+ displayName: displayName || name,
237
+ email: agentEmail,
238
+ role: agentRole,
239
+ personality: persona?.personality || 'professional',
240
+ description: agentDescription,
241
+ avatar: persona?.avatar || null,
242
+ gender: persona?.gender || '',
243
+ dateOfBirth: persona?.dateOfBirth || '',
244
+ maritalStatus: persona?.maritalStatus || '',
245
+ culturalBackground: persona?.culturalBackground || '',
246
+ language: persona?.language || 'en-us',
247
+ traits: persona?.traits || {},
239
248
  },
240
249
  model: model || {
241
250
  provider: 'anthropic',
242
251
  modelId: 'claude-sonnet-4-5-20250929',
243
252
  thinkingLevel: 'medium',
244
253
  },
254
+ skills: Array.isArray(skills) ? skills : [],
255
+ knowledgeBases: Array.isArray(knowledgeBases) ? knowledgeBases : [],
245
256
  deployment: deployment || {
246
- target: 'docker',
257
+ target: deployTarget || 'docker',
247
258
  config: { docker: { image: 'agenticmail/agent', tag: 'latest', ports: [3000], env: {}, volumes: [], restart: 'unless-stopped' } },
248
259
  },
249
260
  permissionProfileId: permissionProfile || 'default',
@@ -280,9 +291,9 @@ export function createAgentRoutes(opts: {
280
291
  adminAgent = await _adminDb.createAgent({
281
292
  id: agentId,
282
293
  name,
283
- email: email || `${name.toLowerCase().replace(/\s+/g, '-')}@agenticmail.local`,
284
- role: role || 'assistant',
285
- metadata: { engineLinked: true, orgId },
294
+ email: agentEmail,
295
+ role: agentRole,
296
+ metadata: { engineLinked: true, orgId, soulId: soulId || undefined },
286
297
  createdBy: actor,
287
298
  });
288
299
  }