+ {agents.map((agent, index) => {
+ const rec = asRecord(agent);
+ if (!rec) {
+ return null;
+ }
+ const title = asString(rec.title) || "untitled";
+ const chatStatus = asString(rec.status) || "unknown";
+ const type = asString(rec.type) || "general";
+ const chatId = asString(rec.chat_id);
+ const agentChatPath = chatId
+ ? safeBuildAgentChatPath({ chatId })
+ : null;
+
+ const row = (
+
+ {title} ({type}, {chatStatus})
+
+ );
+
+ if (!agentChatPath) {
+ return (
+
+ {row}
+
+ );
+ }
+
+ return (
+
+
+ {row}
+
+
+
+ );
+ })}
+
+