@agenticmail/api 0.9.21 → 0.9.22
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/index.js +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -401,7 +401,11 @@ function createAccountRoutes(accountManager, db, config) {
|
|
|
401
401
|
router.get("/accounts/directory", requireAuth, async (_req, res, next) => {
|
|
402
402
|
try {
|
|
403
403
|
const agents = await accountManager.list();
|
|
404
|
-
const directory = agents.map((a) =>
|
|
404
|
+
const directory = agents.map((a) => {
|
|
405
|
+
const meta = a.metadata ?? {};
|
|
406
|
+
const host2 = typeof meta.host === "string" ? meta.host : null;
|
|
407
|
+
return { name: a.name, email: a.email, role: a.role, host: host2 };
|
|
408
|
+
});
|
|
405
409
|
res.json({ agents: directory });
|
|
406
410
|
} catch (err) {
|
|
407
411
|
next(err);
|
|
@@ -414,7 +418,9 @@ function createAccountRoutes(accountManager, db, config) {
|
|
|
414
418
|
res.status(404).json({ error: "Agent not found" });
|
|
415
419
|
return;
|
|
416
420
|
}
|
|
417
|
-
|
|
421
|
+
const meta = agent.metadata ?? {};
|
|
422
|
+
const host2 = typeof meta.host === "string" ? meta.host : null;
|
|
423
|
+
res.json({ name: agent.name, email: agent.email, role: agent.role, host: host2 });
|
|
418
424
|
} catch (err) {
|
|
419
425
|
next(err);
|
|
420
426
|
}
|