feat(FN-3971): add aggregate mailbox view for all agents

Adds an "All Agents" unified mailbox view to the dashboard, including a new aggregate API endpoint in `@fusion/core`, updated MailboxView UI with selection controls, CSS styling, and comprehensive tests across core and dashboard packages, with documentation updates.

Fusion-Task-Id: FN-3971
This commit is contained in:
Fusion
2026-05-10 21:37:30 -07:00
committed by gsxdsm
parent a156b74cdc
commit a3d67e088f
10 changed files with 316 additions and 16 deletions

View File

@@ -417,6 +417,32 @@ export class MessageStore extends EventEmitter<MessageStoreEvents> {
};
}
/**
* Get all agent-to-agent messages across all agents.
* @returns Array of messages (newest first)
*/
getAllAgentToAgentMessages(): Message[] {
const rows = this.db.prepare(`
SELECT * FROM messages
WHERE type = ?
ORDER BY createdAt DESC, rowid DESC
`).all("agent-to-agent");
return (rows as unknown as MessageRow[]).map((row) => this.rowToMessage(row));
}
/**
* Get unread count across all agent-to-agent messages.
*/
getUnreadAgentToAgentCount(): number {
const row = this.db.prepare(`
SELECT COUNT(*) as count FROM messages
WHERE type = ? AND read = 0
`).get("agent-to-agent") as { count: number } | undefined;
return row?.count ?? 0;
}
/**
* Set or update the hook used when messages are sent to agents.
*/