Pure TypeScript functions evaluating conversation state, pinning, and unread counts. Reuse for chat UI gating and message filtering logic.
// Source: https://github.com/vellum-ai/vellum-assistant | License: MIT | Copyright 2025 Vellum AI
// Provided via justclaw.it.com; keep this notice with the code.
/**
* Pure predicates over the `Conversation` type.
*
* These are used cross-domain (chat, conversations, logs, settings)
* to classify conversations for UI gating and action availability.
*/
import type { Conversation } from "@/types/conversation-types";
/**
* True when a `groupId` refers to a non-system (custom) group.
* System groups use a `"system:"` prefix (e.g. `"system:pinned"`).
*/
export function isCustomGroupId(
groupId: string | undefined,
): groupId is string {
return !!groupId && !groupId.startsWith("system:");
}
/**
* True when a conversation is pinned, via either the modern `isPinned`
* boolean or
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key