Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat(ee): add selecting documents to chat
Marc Seitz372749d3483c
diff --git a/app/(ee)/api/ai/chat/[chatId]/messages/route.ts b/app/(ee)/api/ai/chat/[chatId]/messages/route.tsindex 813e48ba..db2cdcb5 100644--- a/app/(ee)/api/ai/chat/[chatId]/messages/route.ts+++ b/app/(ee)/api/ai/chat/[chatId]/messages/route.ts@@ -35,7 +35,8 @@ export async function POST();}- const { content, filterDocumentId } = validation.data;+ const { content, filterDocumentId, filterDataroomDocumentIds } =+ validation.data;const session = await getServerSession(authOptions);const searchParams = req.nextUrl.searchParams;@@ -124,6 +125,7 @@ export async function POST(vectorStoreId: chat.vectorStoreId,filteredDataroomDocumentIds,filterDocumentId,+ userSelectedDataroomDocumentIds: filterDataroomDocumentIds,});return result.toTextStreamResponse();diff --git a/components/view/viewer/dataroom-viewer.tsx b/components/view/viewer/dataroom-viewer.tsxindex e27bf32b..89273df7 100644--- a/components/view/viewer/dataroom-viewer.tsx+++ b/components/view/viewer/dataroom-viewer.tsx@@ -373,6 +373,14 @@ export default function DataroomViewer({);};+ // Prepare documents for chat context+ const documentsForChat = documents.map((doc) => ({+ dataroomDocumentId: doc.dataroomDocumentId,+ id: doc.id,+ name: doc.name,+ folderId: doc.folderId,+ }));+return (<ViewerChatProviderenabled={viewData.agentsEnabled}@@ -381,6 +389,8 @@ export default function DataroomViewer({linkId={linkId}viewId={viewId}viewerId={viewerId}+ documents={documentsForChat}+ folders={folders}><DataroomNavbrand={brand}diff --git a/ee/features/ai/components/document-context-selector.tsx b/ee/features/ai/components/document-context-selector.tsxnew file mode 100644index 00000000..8118444c--- /dev/null+++ b/ee/features/ai/components/document-context-selector.tsx@@ -0,0 +1,333 @@+"use client";++import { useCallback, useEffect, useMemo, useState } from "react";++import { DataroomFolder } from "@prisma/client";+import { FileTextIcon, FolderIcon, XIcon } from "lucide-react";++import { cn } from "@/lib/utils";++import { Button } from "@/components/ui/button";+import {+ Command,+ CommandEmpty,+ CommandGroup,+ CommandInput,+ CommandItem,+ CommandList,+} from "@/components/ui/command";+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@/components/ui/popover";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "@/components/ui/tooltip";++import { DataroomDocumentForChat } from "./viewer-chat-provider";++// ============================================================================+// Types+// ============================================================================++export interface SelectedContextItem {+ type: "document" | "folder";+ id: string; // dataroomDocumentId for documents, folder.id for folders+ name: string;+}++interface DocumentContextSelectorProps {+ documents: DataroomDocumentForChat[];+ folders: DataroomFolder[];+ selectedItems: SelectedContextItem[];+ onSelectionChange: (items: SelectedContextItem[]) => void;+ open: boolean;+ onOpenChange: (open: boolean) => void;+ disabled?: boolean;+}++// ============================================================================+// Helper Functions+// ============================================================================++/**+ * Get all documents within a folder (including nested folders)+ */+function getDocumentsInFolder(+ folderId: string,+ documents: DataroomDocumentForChat[],+ folders: DataroomFolder[],+): DataroomDocumentForChat[] {+ // Get direct documents in this folder+ const directDocs = documents.filter((doc) => doc.folderId === folderId);++ // Get child folders+ const childFolders = folders.filter((f) => f.parentId === folderId);++ // Recursively get documents from child folders+ const nestedDocs = childFolders.flatMap((childFolder) =>+ getDocumentsInFolder(childFolder.id, documents, folders),+ );++ return [...directDocs, ...nestedDocs];+}++// ============================================================================+// Main Component+// ============================================================================++export function DocumentContextSelector({+ documents,+ folders,+ selectedItems,+ onSelectionChange,+ open,+ onOpenChange,+ disabled = false,+}: DocumentContextSelectorProps) {+ const [searchQuery, setSearchQuery] = useState("");++ // Reset search query when popover opens+ useEffect(() => {+ if (open) {+ setSearchQuery("");+ }+ }, [open]);++ // Handle item selection+ const handleSelect = useCallback(+ (type: "document" | "folder", id: string, name: string) => {+ // Check if already selected+ const isSelected = selectedItems.some(+ (item) => item.type === type && item.id === id,+ );++ if (isSelected) {+ // Remove if already selected+ onSelectionChange(+ selectedItems.filter(+ (item) => !(item.type === type && item.id === id),+ ),+ );+ } else {+ // Add new selection+ onSelectionChange([...selectedItems, { type, id, name }]);+ }++ // Close popover+ onOpenChange(false);+ },+ [selectedItems, onSelectionChange, onOpenChange],+ );++ // Filter items based on search query+ const filteredFolders = useMemo(() => {+ if (!searchQuery) return folders;+ const query = searchQuery.toLowerCase();+ return folders.filter((folder) =>+ folder.name.toLowerCase().includes(query),+ );+ }, [folders, searchQuery]);++ const filteredDocuments = useMemo(() => {+ if (!searchQuery) return documents;+ const query = searchQuery.toLowerCase();+ return documents.filter((doc) => doc.name.toLowerCase().includes(query));+ }, [documents, searchQuery]);++ if (disabled || (documents.length === 0 && folders.length === 0)) {+ return null;+ }++ return (+ <Popover open={open} onOpenChange={onOpenChange}>+ <PopoverTrigger asChild>+ <div className="sr-only" aria-hidden="true" />+ </PopoverTrigger>+ <PopoverContent+ className="w-[320px] p-0"+ align="start"+ side="top"+ sideOffset={8}+ onOpenAutoFocus={(e) => e.preventDefault()}+ >+ <Command>+ <CommandInput+ placeholder="Search documents and folders..."+ value={searchQuery}+ onValueChange={setSearchQuery}+ autoFocus+ wrapperClassName="border-b border-border"+ className="focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-none focus:outline-none"+ />+ <CommandList className="max-h-[300px]">+ <CommandEmpty>No items found.</CommandEmpty>++ {filteredFolders.length > 0 && (+ <CommandGroup heading="Folders">+ {filteredFolders.map((folder) => {+ const isSelected = selectedItems.some(+ (item) => item.type === "folder" && item.id === folder.id,+ );+ const docCount = getDocumentsInFolder(+ folder.id,+ documents,+ folders,+ ).length;++ return (+ <CommandItem+ key={`folder-${folder.id}`}+ value={`folder-${folder.name}`}+ onSelect={() =>+ handleSelect("folder", folder.id, folder.name)+ }+ className={cn(+ "flex items-center gap-2",+ isSelected && "bg-accent",+ )}+ >+ <FolderIcon className="size-4 text-muted-foreground" />+ <span className="flex-1 truncate">{folder.name}</span>+ <span className="text-xs text-muted-foreground">+ {docCount} doc{docCount !== 1 ? "s" : ""}+ </span>+ </CommandItem>+ );+ })}+ </CommandGroup>+ )}++ {filteredDocuments.length > 0 && (+ <CommandGroup heading="Documents">+ {filteredDocuments.map((doc) => {+ const isSelected = selectedItems.some(+ (item) =>+ item.type === "document" &&+ item.id === doc.dataroomDocumentId,+ );++ return (+ <CommandItem+ key={`doc-${doc.dataroomDocumentId}`}+ value={`doc-${doc.name}`}+ onSelect={() =>+ handleSelect(+ "document",+ doc.dataroomDocumentId,+ doc.name,+ )+ }+ className={cn(+ "flex items-center gap-2",+ isSelected && "bg-accent",+ )}+ >+ <FileTextIcon className="size-4 text-muted-foreground" />+ <span className="flex-1 truncate">{doc.name}</span>+ </CommandItem>+ );+ })}+ </CommandGroup>+ )}+ </CommandList>+ </Command>+ </PopoverContent>+ </Popover>+ );+}++// ============================================================================+// Selected Items Display Component+// ============================================================================++interface SelectedContextItemsProps {+ items: SelectedContextItem[];+ onRemove: (type: "document" | "folder", id: string) => void;+}++export function SelectedContextItems({+ items,+ onRemove,+}: SelectedContextItemsProps) {+ if (items.length === 0) return null;++ return (+ <div className="flex flex-wrap items-center gap-2">+ {items.map((item) => (+ <ContextItemAttachment+ key={`${item.type}-${item.id}`}+ item={item}+ onRemove={() => onRemove(item.type, item.id)}+ />+ ))}+ </div>+ );+}++// ============================================================================+// Context Item Attachment Component (matches PromptInputAttachment style)+// ============================================================================++interface ContextItemAttachmentProps {+ item: SelectedContextItem;+ onRemove: () => void;+ className?: string;+}++function ContextItemAttachment({+ item,+ onRemove,+ className,+}: ContextItemAttachmentProps) {+ const Icon = item.type === "folder" ? FolderIcon : FileTextIcon;++ return (+ <TooltipProvider>+ <Tooltip delayDuration={300}>+ <TooltipTrigger asChild>+ <div+ className={cn(+ "group relative flex h-8 cursor-pointer select-none items-center gap-1.5 rounded-md border border-border px-1.5 text-sm font-medium transition-all hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",+ className,+ )}+ >+ <div className="relative size-5 shrink-0">+ <div className="absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded bg-background transition-opacity group-hover:opacity-0">+ <Icon className="size-4 text-muted-foreground" />+ </div>+ <Button+ aria-label="Remove from context"+ className="absolute inset-0 size-5 cursor-pointer rounded p-0 opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 [&>svg]:size-3"+ onClick={(e) => {+ e.preventDefault();+ e.stopPropagation();+ onRemove();+ }}+ type="button"+ variant="ghost"+ >+ <XIcon />+ <span className="sr-only">Remove</span>+ </Button>+ </div>+ <span className="max-w-[150px] flex-1 truncate">{item.name}</span>+ </div>+ </TooltipTrigger>+ <TooltipContent side="top" className="max-w-[300px]">+ <p className="break-all">{item.name}</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ );+}++// ============================================================================+// Utility Export+// ============================================================================++export { getDocumentsInFolder };diff --git a/ee/features/ai/components/viewer-chat-panel.tsx b/ee/features/ai/components/viewer-chat-panel.tsxindex b03b3f2e..46a13bb0 100644--- a/ee/features/ai/components/viewer-chat-panel.tsx+++ b/ee/features/ai/components/viewer-chat-panel.tsx@@ -1,8 +1,16 @@"use client";-import { useCallback, useState } from "react";+import { useCallback, useRef, useState } from "react";-import { FileTextIcon, Loader2, Plus, SparklesIcon, XIcon } from "lucide-react";+import {+ AtSignIcon,+ FileTextIcon,+ Loader2,+ Plus,+ PlusIcon,+ SparklesIcon,+ XIcon,+} from "lucide-react";import {Conversation,@@ -12,11 +20,13 @@ import {} from "@/components/ai-elements/conversation";import {PromptInput,+ PromptInputButton,PromptInputFooter,PromptInputHeader,type PromptInputMessage,PromptInputSubmit,PromptInputTextarea,+ PromptInputTools,} from "@/components/ai-elements/prompt-input";import { Button } from "@/components/ui/button";import {@@ -28,6 +38,12 @@ import {import { parseTextStream } from "../lib/stream/parse-text-stream";import ChatMessage from "./chat-message";+import {+ DocumentContextSelector,+ SelectedContextItem,+ SelectedContextItems,+ getDocumentsInFolder,+} from "./document-context-selector";import { useViewerChatSafe } from "./viewer-chat-provider";import { ViewerThreadSelector } from "./viewer-thread-selector";@@ -71,6 +87,8 @@ export function ViewerChatPanel({ className }: ViewerChatPanelProps) {linkId={context.config.linkId}viewId={context.config.viewId}viewerId={context.config.viewerId}+ documents={context.documents}+ folders={context.folders}/></div>);@@ -89,6 +107,23 @@ interface ViewerChatPanelContentProps {linkId?: string;viewId?: string;viewerId?: string;+ documents?: Array<{+ dataroomDocumentId: string;+ id: string;+ name: string;+ folderId: string | null;+ }>;+ folders?: Array<{+ id: string;+ name: string;+ parentId: string | null;+ path: string;+ orderIndex: number | null;+ dataroomId: string;+ createdAt: Date;+ updatedAt: Date;+ hierarchicalIndex: string | null;+ }>;}function ViewerChatPanelContent({@@ -100,14 +135,71 @@ function ViewerChatPanelContent({linkId,viewId,viewerId,+ documents = [],+ folders = [],}: ViewerChatPanelContentProps) {const [messages, setMessages] = useState<Message[]>([]);const [isLoading, setIsLoading] = useState(false);const [chatId, setChatId] = useState<string | null>(null);const [chatTitle, setChatTitle] = useState<string | undefined>();+ const [selectedContextItems, setSelectedContextItems] = useState<+ SelectedContextItem[]+ >([]);+ const [selectorOpen, setSelectorOpen] = useState(false);+ const abortControllerRef = useRef<AbortController | null>(null);const contextName = dataroomName || documentName || "Document";+ // Handle abort/stop+ const handleAbort = useCallback(() => {+ if (abortControllerRef.current) {+ abortControllerRef.current.abort();+ abortControllerRef.current = null;+ }+ setIsLoading(false);+ // Mark any streaming message as complete+ setMessages((prev) =>+ prev.map((m) =>+ m.isStreaming+ ? {+ ...m,+ isStreaming: false,+ content: m.content || "Message cancelled.",+ }+ : m,+ ),+ );+ }, []);++ // Calculate selected document IDs from context items (expanding folders)+ const getSelectedDocumentIds = useCallback((): string[] => {+ if (selectedContextItems.length === 0) return [];++ const docIds = new Set<string>();++ for (const item of selectedContextItems) {+ if (item.type === "document") {+ docIds.add(item.id);+ } else {+ // For folders, get all documents in the folder+ const docsInFolder = getDocumentsInFolder(item.id, documents, folders);+ docsInFolder.forEach((doc) => docIds.add(doc.dataroomDocumentId));+ }+ }++ return Array.from(docIds);+ }, [selectedContextItems, documents, folders]);++ // Handle removing a context item+ const handleRemoveContextItem = useCallback(+ (type: "document" | "folder", id: string) => {+ setSelectedContextItems((prev) =>+ prev.filter((item) => !(item.type === type && item.id === id)),+ );+ },+ [],+ );+// Create chat sessionconst createChat = async () => {try {@@ -208,6 +300,9 @@ function ViewerChatPanelContent({setMessages((prev) => [...prev, userMessage]);setIsLoading(true);+ // Create abort controller for this request+ abortControllerRef.current = new AbortController();+try {// Create chat if neededlet currentChatId = chatId;@@ -221,6 +316,9 @@ function ViewerChatPanelContent({const queryParams = viewerId ? `?viewerId=${viewerId}` : "";+ // Get selected document IDs for filtering+ const filterDataroomDocumentIds = getSelectedDocumentIds();+const response = await fetch(`/api/ai/chat/${currentChatId}/messages${queryParams}`,{@@ -230,7 +328,12 @@ function ViewerChatPanelContent({content: userMessage.content,// When viewing a specific document in a dataroom, filter search to that documentfilterDocumentId: documentId,+ // User-selected context filter (only if items are selected)+ ...(filterDataroomDocumentIds.length > 0 && {+ filterDataroomDocumentIds,+ }),}),+ signal: abortControllerRef.current.signal,},);@@ -285,6 +388,10 @@ function ViewerChatPanelContent({},});} catch (error) {+ // Don't show error if aborted+ if (error instanceof Error && error.name === "AbortError") {+ return;+ }console.error("Error sending message:", error);setMessages((prev) => [...prev,@@ -296,6 +403,7 @@ function ViewerChatPanelContent({]);} finally {setIsLoading(false);+ abortControllerRef.current = null;}};@@ -388,27 +496,85 @@ function ViewerChatPanelContent({</Conversation>{/* Input */}- <div className="border-t border-gray-200 p-3">+ <div className="relative border-t border-gray-200 p-3">+ {/* Document Context Selector (@ mention popover) */}+ {dataroomId && documents.length > 0 && (+ <DocumentContextSelector+ documents={documents}+ folders={folders}+ selectedItems={selectedContextItems}+ onSelectionChange={setSelectedContextItems}+ open={selectorOpen}+ onOpenChange={setSelectorOpen}+ />+ )}+<PromptInput onSubmit={handleSubmit}>- {/* Show focused document as an attachment when in dataroom */}- {documentId && documentName && (+ {/* Show focused document or selected context items */}+ {(documentId && documentName) || selectedContextItems.length > 0 ? (<PromptInputHeader>- <div className="flex items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2 py-1 text-xs text-muted-foreground">- <FileTextIcon className="size-3" />- <span className="max-w-[200px] truncate">{documentName}</span>- </div>+ {documentId && documentName ? (+ <TooltipProvider>+ <Tooltip delayDuration={300}>+ <TooltipTrigger asChild>+ <div className="relative flex h-8 select-none items-center gap-1.5 rounded-md border border-border bg-muted/50 px-1.5 text-sm font-medium text-muted-foreground transition-all dark:hover:bg-accent/50">+ <div className="relative size-5 shrink-0">+ <div className="absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded bg-background">+ <FileTextIcon className="size-4 text-muted-foreground" />+ </div>+ </div>+ <span className="max-w-[150px] flex-1 truncate">+ {documentName}+ </span>+ </div>+ </TooltipTrigger>+ <TooltipContent side="top" className="max-w-[300px]">+ <p className="break-all">{documentName}</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ ) : (+ <SelectedContextItems+ items={selectedContextItems}+ onRemove={handleRemoveContextItem}+ />+ )}</PromptInputHeader>- )}+ ) : null}<PromptInputTextarea- placeholder="Ask a question..."+ placeholder={+ dataroomId && documents.length > 0+ ? "Ask a question... (click + to add context)"+ : "Ask a question..."+ }disabled={isLoading}className="min-h-12"/>- <PromptInputFooter className="justify-end pt-2">- <PromptInputSubmit- disabled={isLoading}- status={isLoading ? "streaming" : "ready"}- />+ <PromptInputFooter className="pt-2">+ {/* @ button to open document selector */}+ {dataroomId && documents.length > 0 && (+ <PromptInputTools>+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ <PromptInputButton+ onClick={() => setSelectorOpen(true)}+ disabled={isLoading}+ >+ <PlusIcon className="size-4" />+ </PromptInputButton>+ </TooltipTrigger>+ <TooltipContent>Add document context</TooltipContent>+ </Tooltip>+ </TooltipProvider>+ </PromptInputTools>+ )}+ <div className="flex-1" />+ {isLoading ? (+ <PromptInputSubmit onClick={handleAbort} status="streaming" />+ ) : (+ <PromptInputSubmit status="ready" />+ )}</PromptInputFooter></PromptInput></div>diff --git a/ee/features/ai/components/viewer-chat-provider.tsx b/ee/features/ai/components/viewer-chat-provider.tsxindex 6bfbd421..8094fc13 100644--- a/ee/features/ai/components/viewer-chat-provider.tsx+++ b/ee/features/ai/components/viewer-chat-provider.tsx@@ -8,12 +8,21 @@ import {useState,} from "react";+import { DataroomFolder } from "@prisma/client";+import { cn } from "@/lib/utils";// ============================================================================// Types// ============================================================================+export interface DataroomDocumentForChat {+ dataroomDocumentId: string;+ id: string;+ name: string;+ folderId: string | null;+}+interface ViewerChatConfig {dataroomId?: string;dataroomName?: string;@@ -24,23 +33,18 @@ interface ViewerChatConfig {viewerId?: string;}-// interface FocusedDocument {-// id: string;-// name: string;-// }-interface ViewerChatContextType {// StateisOpen: boolean;isEnabled: boolean;config: ViewerChatConfig;- // focusedDocument: FocusedDocument | null;+ documents: DataroomDocumentForChat[];+ folders: DataroomFolder[];// Actionsopen: () => void;close: () => void;toggle: () => void;- // setFocusedDocument: (doc: FocusedDocument | null) => void;}// ============================================================================@@ -83,9 +87,8 @@ interface ViewerChatProviderProps {linkId?: string;viewId?: string;viewerId?: string;- // /** For dataroom document views - the currently focused document */- // focusedDocumentId?: string;- // focusedDocumentName?: string;+ documents?: DataroomDocumentForChat[];+ folders?: DataroomFolder[];}export function ViewerChatProvider({@@ -98,24 +101,14 @@ export function ViewerChatProvider({linkId,viewId,viewerId,- // focusedDocumentId,- // focusedDocumentName,+ documents = [],+ folders = [],}: ViewerChatProviderProps) {const [isOpen, setIsOpen] = useState(false);- // const [focusedDocument, setFocusedDocumentState] =- // useState<FocusedDocument | null>(- // focusedDocumentId && focusedDocumentName- // ? { id: focusedDocumentId, name: focusedDocumentName }- // : null,- // );const open = useCallback(() => setIsOpen(true), []);const close = useCallback(() => setIsOpen(false), []);const toggle = useCallback(() => setIsOpen((prev) => !prev), []);- // const setFocusedDocument = useCallback(- // (doc: FocusedDocument | null) => setFocusedDocumentState(doc),- // [],- // );const config: ViewerChatConfig = {dataroomId,@@ -131,11 +124,11 @@ export function ViewerChatProvider({isOpen,isEnabled: enabled,config,- // focusedDocument,+ documents,+ folders,open,close,toggle,- // setFocusedDocument,};return (diff --git a/ee/features/ai/lib/chat/send-message.ts b/ee/features/ai/lib/chat/send-message.tsindex 16647450..e641269d 100644--- a/ee/features/ai/lib/chat/send-message.ts+++ b/ee/features/ai/lib/chat/send-message.ts@@ -10,6 +10,8 @@ interface SendMessageOptions {filteredDataroomDocumentIds?: string[];/** Filter file_search results to a specific document by its ID */filterDocumentId?: string;+ /** User-selected dataroom document IDs to filter file_search results */+ userSelectedDataroomDocumentIds?: string[];}/**@@ -22,6 +24,7 @@ export async function sendMessage({vectorStoreId,filteredDataroomDocumentIds,filterDocumentId,+ userSelectedDataroomDocumentIds,}: SendMessageOptions) {// Get conversation history from databaseconst history = await prisma.chatMessage.findMany({@@ -63,7 +66,32 @@ If you cannot find the answer in the documents, say so clearly.`,key: "documentId",value: filterDocumentId,};- } else if (filteredDataroomDocumentIds) {+ } else if (+ userSelectedDataroomDocumentIds &&+ userSelectedDataroomDocumentIds.length > 0+ ) {+ // User explicitly selected documents to filter to+ // Intersect with permission-based filter if it exists+ let effectiveIds = userSelectedDataroomDocumentIds;+ if (filteredDataroomDocumentIds && filteredDataroomDocumentIds.length > 0) {+ // Only include user-selected IDs that are also in the permission-filtered list+ effectiveIds = userSelectedDataroomDocumentIds.filter((id) =>+ filteredDataroomDocumentIds.includes(id),+ );+ }+ if (effectiveIds.length > 0) {+ fileSearchOptions.filters = {+ type: "in",+ key: "dataroomDocumentId",+ value: effectiveIds,+ };+ }+ } else if (+ filteredDataroomDocumentIds &&+ filteredDataroomDocumentIds.length > 0+ ) {+ // Only apply filter if there are specific documents to filter to+ // An empty array would filter out ALL documentsfileSearchOptions.filters = {type: "in",key: "dataroomDocumentId",diff --git a/ee/features/ai/schemas/chat.ts b/ee/features/ai/schemas/chat.tsindex 10b752b2..8d949284 100644--- a/ee/features/ai/schemas/chat.ts+++ b/ee/features/ai/schemas/chat.ts@@ -19,6 +19,8 @@ export const sendMessageSchema = z.object({content: z.string().min(1).max(10000),/** Optional document ID to filter file_search results to a specific document */filterDocumentId: z.string().cuid().optional(),+ /** Optional array of dataroom document IDs to filter file_search results */+ filterDataroomDocumentIds: z.array(z.string().cuid()).optional(),});/**