Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
import type { SubscriptionAuthStatuses } from "@akeru/contracts";
export type BotInboxItem = SubscriptionAuthStatuses["inbox"][number];
export function selectOpenBotInboxItems(
inbox: ReadonlyArray<BotInboxItem>,
botIds?: ReadonlySet<string>,
): ReadonlyArray<BotInboxItem> {
return inbox
.filter((item) => item.status === "open" && (botIds === undefined || botIds.has(item.botId)))
.toSorted((left, right) => right.lastSeenAt.localeCompare(left.lastSeenAt));
}