import type { FileAttachment, Message } from "@/ipc/ipc_types"; import { atom } from "jotai"; import type { ChatSummary } from "@/lib/schemas"; // Per-chat atoms implemented with maps keyed by chatId export const chatMessagesByIdAtom = atom>(new Map()); export const chatErrorByIdAtom = atom>(new Map()); // Atom to hold the currently selected chat ID export const selectedChatIdAtom = atom(null); export const isStreamingByIdAtom = atom>(new Map()); export const chatInputValueAtom = atom(""); export const homeChatInputValueAtom = atom(""); // Atoms for chat list management export const chatsAtom = atom([]); export const chatsLoadingAtom = atom(false); // Used for scrolling to the bottom of the chat messages (per chat) export const chatStreamCountByIdAtom = atom>(new Map()); export const recentStreamChatIdsAtom = atom>(new Set()); export const attachmentsAtom = atom([]);