* refactor: Reasoning components with independent toggle buttons
- Refactored ThinkingButton to remove unnecessary state and props.
- Updated ContentParts to simplify content rendering and remove hover handling.
- Improved Reasoning component to include independent toggle functionality for each THINK part.
- Adjusted styles for better layout consistency and user experience.
* refactor: isolate hover effects for Reasoning
- Updated ThinkingButton to improve hover effects and layout consistency.
- Refactored Reasoning component to include a new wrapper class for better styling.
- Adjusted icon visibility and transitions for a smoother user experience.
* fix: Prevent rendering of empty messages in Chat component
- Added a check to skip rendering if the message text is only whitespace, improving the user interface by avoiding empty containers.
* chore: Replace div with fragment in Thinking component for cleaner markup
* chore: move Thinking component to Content Parts directory
* refactor: prevent rendering of whitespace-only text in Part component only for edge cases
* ✨ feat: Refactor error handling and improve loading states in MessageContent component
* ✨ feat: Enhance Thinking and ContentParts components with improved hover functionality and clipboard support
* fix: Adjust padding in Thinking and ContentParts components for consistent layout
* ✨ feat: Add response label and improve message editing UI with contextual indicators
* ✨ feat: Add isEditing prop to Feedback and Fork components for improved editing state handling
* refactor: Remove isEditing prop from Feedback and Fork components for cleaner state management
* refactor: Migrate state management from Recoil to Jotai for font size and show thinking features
* refactor: Separate ToggleSwitch into RecoilToggle and JotaiToggle components for improved clarity and state management
* refactor: Remove unnecessary comments in ToggleSwitch and MessageContent components for cleaner code
* chore: reorder import statements in Thinking.tsx
* chore: reorder import statement in EditTextPart.tsx
* chore: reorder import statement
* chore: Reorganize imports in ToggleSwitch.tsx
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: Sanitize LLM titles by stripping <think> tags and fix modal overflow
* chore: linting
* chore: Simplify title sanitization by removing unnecessary variable assignment and import order
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* chore: correct startupConfig usage in ImportConversations component
* refactor: properly process configured speechToText and textToSpeech settings in getCustomConfigSpeech
* refactor: proxy configuration by utilizing HttpsProxyAgent for OpenAI Image Edits
* chore: add i18n localization comment for AlwaysMakeProd component
* feat: enhance accessibility by adding aria-label and aria-labelledby to Switch component
* feat: add aria-labels for accessibility in Agent and Assistant avatar buttons
* fix: add switch aria-labels for accessibility in various components
* feat: add aria-labels and localization keys for accessibility in DataTable, DataTableColumnHeader, and OGDialogTemplate components
* chore: refactor out nested ternary
* feat: add aria-label to DataTable filter button for My Files modal
* feat: add aria-labels for Buttons and localization strings
* feat: add aria-labels to Checkboxes in Agent Builder
* feat: enhance accessibility by adding aria-label and aria-labelledby to Checkbox component
* feat: add aria-label to FileSearchCheckbox in Agent Builder
* feat: add aria-label to Prompts text input area
* feat: enhance accessibility by adding aria-label and aria-labelledby to TextAreaAutosize component
* feat: remove improper role: "list" prop from List in Conversations.tsx to enhance accessibility and stop aria rules conflicting within react-virtualized component
* feat: enhance accessibility by allowing tab navigation and adding ring highlights for conversation title editing accept/reject buttons
* feat: add aria-label to Copy Link button in the conversation share modal
* feat: add title to QR code svg in conversation share modal to describe the image content
* feat: enhance accessibility by making Agent Avatar upload keyboard navigable and round out highlight border on focus
* feat: enhance accessibility by adding aria attributes around alerting users with screen readers to invalid email address inputs in the Agent Builder
* feat: add aria-labels to buttons in Advanced panel of Agent Builder
* feat: enhance accessibility by making FileUpload and Clear All buttons in PresetItems keyboard navigable
* feat: enchance accessiblity by indexing view and delete button aria-labels in shared links management modal to their specific chat titles
* feat: add border highlighting on focus for AnimatedSearchInput
* feat: add category description to aria-labels for prompts in ListCard
* feat: add proper scoping to rows and columns in table headers
* feat: add localized aria-labelling to EditTextPart's TextAreaAutosize component and base dynamic paramters panel components and their supporting translation keys
* feat: add localized aria-labels and aria-labelledBy to Checkbox components without them
* feat: add localized aria-labeledBy for endpoint settings Sliders
* feat: add localized aria-labels for TextareaAutosize components
* chore: remove unused i18n string
* feat: add localized aria-label for BookmarkForm Checkbox
* fix: add stopPropagation onKeyDown for Preview and Edit menu items in prompts that was causing the prompts to inadvertently be sent when triggered with keyboard navigation when Auto-send Prompts was toggled on
* fix: switch TableCell to TableHead for title cells according to harvard issue #789
* fix: add more descriptive localization key for file filter button in DataTable
* chore: remove self-explanatory code comment from RenameForm
* fix: remove stray bg-yellow highlight that was left in during debugging
* fix: add aria-label to model configurator panel back button
* fix: undo incorrect hoist of tool name split for aria-label and span in MCPInput
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* refactor: remove `useChatContext` from `useSelectMention`, explicitly pass `conversation` object
* feat: ephemeral agents via model specs
* refactor: Sync Jotai state with ephemeral agent state, also when Ephemeral Agent has no MCP servers selected
* refactor: move `useUpdateEphemeralAgent` to store and clean up imports
* refactor: reorder imports and invalidate queries for mcpConnectionStatus in event handler
* refactor: replace useApplyModelSpecEffects with useApplyModelSpecAgents and update event handlers to use new agent template logic
* ci: update useMCPSelect test to verify mcpValues sync with empty ephemeralAgent.mcp
* filter out unavailable servers
* bump render time
* Fix import path for useGetStartupConfig
* refactor: Change configuredServers to use Set for improved filtering of available MCPs
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* refactor: Default Model Spec Retrieval Logic, allowing last selected spec on new chat if last selection was a spec
* chore: Replace hardcoded 'new' conversation ID with Constants.NEW_CONVO for consistency
* chore: remove redundant condition for model spec preset selection in useNewConvo hook
* fix: reapply chat font size on load
* refactor: streamline font size handling in localStorage
* fix: update matchMedia mock to accurately reflect desktop and touchscreen capabilities
* refactor: implement Jotai for font size management and initialize on app load
- Replaced Recoil with Jotai for font size state management across components.
- Added a new `fontSize` atom to handle font size changes and persist them in localStorage.
- Implemented `initializeFontSize` function to apply saved font size on app load.
- Updated relevant components to utilize the new font size atom.
---------
Co-authored-by: ddooochii <ddooochii@gmail.com>
Co-authored-by: Danny Avila <danny@librechat.ai>
Enables word wrapping for text, markdown, and plaintext code blocks
to prevent horizontal scrolling on long lines. Improves readability
for prose content in fenced code blocks.
* Add Markdown rendering support for artifacts
* Add tests
* Remove custom code for mermaid
* Remove unnecessary dark mode hook
* refactor: optimize mermaid dependencies
- Added support for additional MIME types in artifact templates.
- Updated mermaidDependencies to include new packages: class-variance-authority, clsx, tailwind-merge, and @radix-ui/react-slot.
- Refactored zoom and refresh icons in MermaidDiagram component for improved clarity and maintainability.
* fix: add Markdown support for artifacts rendering
* feat: support 'text/md' as an additional MIME type for Markdown artifacts
* refactor: simplify markdownDependencies structure in artifacts utility
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* feat: Add group field to modelSpecs for flexible grouping
* resolve lint issues
* fix test
* docs: enhance modelSpecs group field documentation for clarity
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* feat: Enhance shared link functionality with target message support
* refactor: Remove comment on compound index in share schema
* chore: Reorganize imports in ShareButton component for clarity
* refactor: Integrate Recoil for latest message tracking in ShareButton component
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* chore: enhance logging for latest message actions in message components
* fix: Extract previous convoId from latest text in message helpers and process hooks
- Updated `useMessageHelpers` and `useMessageProcess` to extract `convoId` from the previous text key for improved message handling.
- Refactored `getLengthAndLastTenChars` to `getLengthAndLastNChars` for better flexibility in character length retrieval.
- Introduced `getLatestContentForKey` function to streamline content extraction from messages.
* chore: Enhance logging for clearing latest messages in conversation hooks
* refactor: Update message key formatting for improved URL parameter handling
- Modified `getLatestContentForKey` to change the format from `${text}-${i}` to `${text}&i=${i}` for better URL parameter structure.
- Adjusted `getTextKey` to increase character length retrieval from 12 to 16 in `getLengthAndLastNChars` for enhanced text processing.
* refactor: Simplify convoId extraction and enhance message formatting
- Updated `useMessageHelpers` and `useMessageProcess` to extract `convoId` using a new format for improved clarity.
- Refactored `getLatestContentForKey` to streamline content formatting and ensure consistent use of `Constants.COMMON_DIVIDER` for better message structure.
- Removed redundant length and last character extraction logic from `getLengthAndLastNChars` for cleaner code.
* chore: linting
* chore: Simplify pre-commit hook by removing unnecessary lines
* Check file size of conversation being imported against a configured max size to prevent bringing down the application by uploading a large file
chore: remove non-english localization as needs to be added via locize
* feat: Implement file size validation for conversation imports to prevent oversized uploads
---------
Co-authored-by: Marc Amick <MarcAmick@jhu.edu>
Co-authored-by: Danny Avila <danny@librechat.ai>
* 🔧 refactor: Improve accessibility and styling in ChatGroupItem and FilterPrompts components
* 🔧 fix: Add button type and keyboard accessibility to dropdown menu trigger in ChatGroupItem
* 🔧 fix(757): Enhance accessibility by updating aria-labels and adding localization for prompt groups
* 🔧 fix(618): Update version to 0.3.1 and enhance accessibility in InfoHoverCard component
* 🔧 fix(618): Update aria-label in InfoHoverCard to use dynamic text prop for improved accessibility
* 🔧 fix: Enhance accessibility by updating aria-labels and roles in Conversations components
* 🔧 fix(620): Enhance accessibility by adding tabIndex to Tabs.Content components in ArtifactTabs, Settings, and Speech components
* refactor: remove RevokeKeysButton component and update related components for accessibility
- Deleted RevokeKeysButton component.
- Updated SharedLinks and General components to use Label for accessibility.
- Enhanced Personalization component with aria-labelledby and aria-describedby attributes.
- Refactored ConversationModeSwitch to use ToggleSwitch for better state management.
- Improved AutoSendTextSelector with local state management and accessibility attributes.
- Replaced Switch components with ToggleSwitch in various Speech and TTS components for consistency.
- Added aria-labelledby attributes to Dropdown components for better accessibility.
- Updated translation.json to include new localization keys and improved existing ones.
- Enhanced Slider component to support aria attributes for better accessibility.
* 🔧 fix: Enhance user feedback for API key operations with success and error messages
* 🔧 fix: Update aria-labels in Avatar component for improved localization and accessibility
* 🔧 fix: Refactor handleFile and handleDrop functions for improved readability and maintainability
* 📎 feat: Direct Provider Attachment Support for Multimodal Content
* 📑 feat: Anthropic Direct Provider Upload (#9072)
* feat: implement Anthropic native PDF support with document preservation
- Add comprehensive debug logging throughout PDF processing pipeline
- Refactor attachment processing to separate image and document handling
- Create distinct addImageURLs(), addDocuments(), and processAttachments() methods
- Fix critical bugs in stream handling and parameter passing
- Add streamToBuffer utility for proper stream-to-buffer conversion
- Remove api/agents submodule from repository
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: remove out of scope formatting changes
* fix: stop duplication of file in chat on end of response stream
* chore: bring back file search and ocr options
* chore: localize upload to provider string in file menu
* refactor: change createMenuItems args to fit new pattern introduced by anthropic-native-pdf-support
* feat: add cache point for pdfs processed by anthropic endpoint since they are unlikely to change and should benefit from caching
* feat: combine Upload Image into Upload to Provider since they both perform direct upload and change provider upload icon to reflect multimodal upload
* feat: add citations support according to docs
* refactor: remove redundant 'document' check since documents are handled properly by formatMessage in the agents repo now
* refactor: change upload logic so anthropic endpoint isn't exempted from normal upload path using Agents for consistency with the rest of the upload logic
* fix: include width and height in return from uploadLocalFile so images are correctly identified when going through an AgentUpload in addImageURLs
* chore: remove client specific handling since the direct provider stuff is handled by the agent client
* feat: handle documents in AgentClient so no need for change to agents repo
* chore: removed unused changes
* chore: remove auto generated comments from OG commit
* feat: add logic for agents to use direct to provider uploads if supported (currently just anthropic)
* fix: reintroduce role check to fix render error because of undefined value for Content Part
* fix: actually fix render bug by using proper isCreatedByUser check and making sure our mutation of formattedMessage.content is consistent
---------
Co-authored-by: Andres Restrepo <andres@thelinuxkid.com>
Co-authored-by: Claude <noreply@anthropic.com>
📁 feat: Send Attachments Directly to Provider (OpenAI) (#9098)
* refactor: change references from direct upload to direct attach to better reflect functionality
since we are just using base64 encoding strategy now rather than Files/File API for sending our attachments directly to the provider, the upload nomenclature no longer makes sense. direct_attach better describes the different methods of sending attachments to providers anyways even if we later introduce direct upload support
* feat: add upload to provider option for openai (and agent) ui
* chore: move anthropic pdf validator over to packages/api
* feat: simple pdf validation according to openai docs
* feat: add provider agnostic validatePdf logic to start handling multiple endpoints
* feat: add handling for openai specific documentPart formatting
* refactor: move require statement to proper place at top of file
* chore: add in openAI endpoint for the rest of the document handling logic
* feat: add direct attach support for azureOpenAI endpoint and agents
* feat: add pdf validation for azureOpenAI endpoint
* refactor: unify all the endpoint checks with isDocumentSupportedEndpoint
* refactor: consolidate Upload to Provider vs Upload image logic for clarity
* refactor: remove anthropic from anthropic_multimodal fileType since we support multiple providers now
🗂️ feat: Send Attachments Directly to Provider (Google) (#9100)
* feat: add validation for google PDFs and add google endpoint as a document supporting endpoint
* feat: add proper pdf formatting for google endpoints (requires PR #14 in agents)
* feat: add multimodal support for google endpoint attachments
* feat: add audio file svg
* fix: refactor attachments logic so multi-attachment messages work properly
* feat: add video file svg
* fix: allows for followup questions of uploaded multimodal attachments
* fix: remove incorrect final message filtering that was breaking Attachment component rendering
fix: manualy rename 'documents' to 'Documents' in git since it wasn't picked up due to case insensitivity in dir name
fix: add logic so filepicker for a google agent has proper filetype filtering
🛫 refactor: Move Encoding Logic to packages/api (#9182)
* refactor: move audio encode over to TS
* refactor: audio encoding now functional in LC again
* refactor: move video encode over to TS
* refactor: move document encode over to TS
* refactor: video encoding now functional in LC again
* refactor: document encoding now functional in LC again
* fix: extend file type options in AttachFileMenu to include 'google_multimodal' and update dependency array to include agent?.provider
* feat: only accept pdfs if responses api is enabled for openai convos
chore: address ESLint comments
chore: add missing audio mimetype
* fix: type safety for message content parts and improve null handling
* chore: reorder AttachFileMenuProps for consistency and clarity
* chore: import order in AttachFileMenu
* fix: improve null handling for text parts in parseTextParts function
* fix: remove no longer used unsupported capability error message for file uploads
* fix: OpenAI Direct File Attachment Format
* fix: update encodeAndFormatDocuments to support OpenAI responses API and enhance document result types
* refactor: broaden providers supported for documents
* feat: enhance DragDrop context and modal to support document uploads based on provider capabilities
* fix: reorder import statements for consistency in video encoding module
---------
Co-authored-by: Dustin Healy <54083382+dustinhealy@users.noreply.github.com>
* 🔧 chore: Update @librechat/agents to v2.4.84 in package.json and package-lock.json
* feat: Serper as new scraperProvider for Web Search and add firecrawlVersion support
* fix: TWebSearchKeys and ensure unique API keys extraction
* chore: Add build:packages script to streamline package builds
* Refactor: Moved Redis cache infra logic into `packages/api`
- Moved cacheFactory and redisClients from `api/cache` into `packages/api/src/cache` so that features in `packages/api` can use cache without importing backward from the backend.
- Converted all moved files into TS with proper typing.
- Created integration tests to run against actual Redis servers for redisClients and cacheFactory.
- Added a GitHub workflow to run integration tests for the cache feature.
- Bug fix: keyvRedisClient now implements the PING feature properly.
* chore: consolidate imports in getLogStores.js
* chore: reorder imports
* chore: re-add fs-extra as dev dep.
* chore: reorder imports in cacheConfig.ts, cacheFactory.ts, and keyvMongo.ts
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* ✨ v0.8.0
* 🔧 chore: Update config version to 1.3.0
* 🔧 chore: Bump @librechat/api version to 1.4.1
* 🔧 chore: Update @librechat/client version to 0.3.1
* 🔧 chore: Bump librechat-data-provider version to 0.8.020
* 🔧 chore: Bump @librechat/data-schemas version to 0.0.23
* fix: Prevent MCPSelect from rendering when not pinned and no values are available
* fix: Exclude 'pinned' keys from timestamped storage cleanup logic
* fix: Safeguard MCPSelect rendering by adding optional chaining for mcpValues
* 🕵️ feat: Enhance Index Sync and MeiliSearch filtering for User Field
- Implemented `ensureFilterableAttributes` function to configure MeiliSearch indexes for messages and conversations to filter by user.
- Updated sync logic to trigger a full re-sync if the user field is missing or index settings are modified.
- Adjusted search queries in Conversation and Message models to include user filtering.
- Ensured 'user' field is marked as filterable in MongoDB schema for both messages and conversations.
This update improves data integrity and search capabilities by ensuring user-related data is properly indexed and retrievable.
* fix: message processing in Search component to use linear list and not tree
* feat: Implement user filtering in MeiliSearch for shared links
* refactor: Optimize message search retrieval by batching database calls
* chore: Update MeiliSearch parameters type to use SearchParams for improved type safety
* refactor: Remove unused imports and consolidate ephemeral agent logic
* refactor: Side Panel agent handling to account for ephemeral agents for UI
* refactor: Replace Constants.EPHEMERAL_AGENT_ID checks with isEphemeralAgent utility for consistency
* ci: AgentPanel tests with additional mock configurations and utility functions
* chore: Improve logging format for initial flow state creation
* refactor: MCP Tool Management with Improved Auth Handling and State Management
- Updated `CustomUserVarsSection` to include optional localization for placeholder text.
- Refactored `MCPToolSelectDialog` to streamline tool addition and management, including improved handling of authentication data.
- Introduced a new `addToolsToForm` function to encapsulate logic for adding tools to the form state.
- Enhanced `useRemoveMCPTool` hook to simplify tool removal logic and ensure proper state updates.
- Added loading state management for custom variable saving to improve user experience.
* refactor: Enhance MCP Tool Removal Logic and Integrate Toast Notifications
- Updated `MCPToolSelectDialog` to utilize the new `removeTool` function from the `useRemoveMCPTool` hook for improved tool removal handling.
- Refactored `useRemoveMCPTool` to accept options for toast notifications, allowing for more flexible user feedback during tool removal.
- Removed the previous inline tool removal logic to streamline the component's code and improve maintainability.
* refactor: Enhance user plugins mutation to invalidate MCP auth values on uninstall
* refactor: Replace refetchQueries with invalidateQueries for improved cache management
* chore: remove unused i18n key