* feat: add PRO badge and credits modal for HuggingChat
- Add isPro field to User type and persist from OAuth login
- Fetch fresh isPro status from HuggingFace public API on page load
- Display "Get PRO" button for non-PRO users in sidebar
- Display "PRO" badge for PRO users in sidebar
- Update SubscribeModal to show "Purchase Credits" for PRO users
- Add IconPro component for gradient sparkle icon
* feat: improve SubscribeModal UI for PRO users
- Use IconDazzled with yellow-orange-red gradient for "Out of Credits"
- Use IconPro with pink-green-yellow gradient for "Upgrade Required"
- Update credits message to mention HF services and Inference Providers
Adding tool-tip and updating color for sidebar toggle button. (#2044)
- Replace isomorphic-dompurify with htmlparser2 (works in Web Workers)
- Add sanitizeHtmlForMultimedia() for video/audio/source tag allowlisting
- Update tests to expect escaped (not stripped) disallowed tags
feat(markdown): allow video and audio tags (#2037)
* feat(markdown): allow video and audio tags in markdown
- Add custom image renderer to convert video/audio URLs to media tags
- Use DOMPurify to sanitize raw HTML, allowing only video/audio/source
- Add comprehensive tests for media rendering and XSS prevention
* feat(mcp): increase tool timeout from 30s to 60s
* feat(mcp): update tool prompt to mention video/audio support
* test: update markdown test for DOMPurify behavior
MCP Tool Progress Notifications and MCP SDK bump. (#2030)
* feat(mcp): add direct Exa API integration to bypass slow mcp.exa.ai
Intercepts calls to mcp.exa.ai and routes them directly to api.exa.ai,
eliminating the slow hosted MCP server (~3-12s latency) while keeping
the same user configuration.
- Add exaDirect.ts module with direct API client
- Intercept tool listing in tools.ts to return hardcoded definitions
- Intercept tool calls in httpClient.ts to use direct API
- Add EXA_API_KEY config for authentication
No user config changes needed - existing MCP_SERVERS with mcp.exa.ai
continue to work transparently.
* Add scroll to metadata output in ToolUpdate
Wrapped the metadata <pre> block with custom scrollbar, max height, and vertical overflow for better readability when displaying large metadata content.
* fix(mcp): bypass mcp.exa.ai in health check, security/leak fixes
- Add Exa bypass to /api/mcp/health endpoint for instant response
- Support x-api-key header for API key (preferred over URL param)
- Fix event listener leak by addin…
Replaces the use of the last block for tool updates with a search for an existing tool block by UUID. This ensures that updates are correctly grouped with their corresponding tool blocks, improving message block handling.
Replace welcome modal video with optimized GIF for mobile compatibility
Videos with autoplay don't work reliably on mobile browsers. This change
replaces the external CDN video with a locally hosted animated GIF that
works consistently across all devices.
- Created 2x retina resolution GIF (840x384, renders at 420x192)
- Optimized to 1.08MB with 24-color palette
- 20 frames at 10fps for smooth 2-second loop
- Updated WelcomeModal to use img tag instead of video
- Removes dependency on external CDN
Co-authored-by: Claude <noreply@anthropic.com>
* Add voice transcription feature to chat
Introduces voice recording and transcription in the chat window using Whisper models. Adds new components for voice recording and audio waveform visualization, updates feature flags and environment variables, and implements a server API endpoint for audio transcription.
* Fix frequencyData reactivity in VoiceRecorder
Replaces in-place mutation of frequencyData with assignment of a new Uint8Array to ensure Svelte reactivity in the voice visualization.
* Improve AudioWaveform visualization and responsiveness
Refactors AudioWaveform.svelte to use a timeline-based amplitude visualization with dynamic pill count based on container width, smoother animation, and responsive resizing. Updates VoiceRecorder.svelte to remove fixed pillCount and adjust maxHeight for better appearance. These changes provide a more accurate and visually appealing waveform display.
* Improve audio waveform and voice recorder UI
Reduced pill width and gap in AudioWavef…
* Optimize message update handling and rendering
Refactors ChatMessage.svelte to interleave tool and stream updates for more accurate message rendering, consolidates consecutive stream tokens, and updates ToolUpdate.svelte styles for improved spacing. Also optimizes update handling in both the client and server to merge consecutive stream updates, reducing unnecessary array growth and improving performance.
* Improve message updates reactivity and storage efficiency
In the Svelte page, message update merging now creates new objects and arrays to ensure UI reactivity when streaming tokens are merged. On the server, ephemeral stream tokens and keep-alive updates are filtered out before persisting messages to the database, reducing payload size and improving rehydration performance.
* Improve chat message block handling and update persistence
Refactors ChatMessage.svelte to better handle interleaved tool and stream updates, ensuring correct text chunking and fallback behavior. Update…
Improves swipe gesture handling by using the final movement direction for slow drags instead of a fixed position threshold. Adds tracking of the last touch X position to better determine user intent when ending a drag.
Add DeleteConversationModal and update delete flow
Introduces a new DeleteConversationModal component for confirming conversation deletion. Refactors NavConversationItem to use the modal for delete confirmation instead of inline buttons, improving user experience and code clarity.
Touch events on interactive elements (buttons, links, inputs) no longer trigger drawer opening gestures or prevent default behavior, improving usability and avoiding interference with native interactions.
Adds e.preventDefault() to block Safari's back navigation gesture on iOS when opening the mobile nav. Sets touchstart event listener to passive: false to allow preventDefault().
* Adjust button and menu item sizes for better UI consistency
Updated various button and dropdown menu item classes in ChatInput.svelte and ChatWindow.svelte to use larger default sizes (size-8, h-9) with responsive adjustments for small screens (sm:size-7, sm:h-8). This improves visual consistency and touch target accessibility across the chat interface.
* Replace custom SVG icons with Lucide icons
Swapped out CarbonAdd and custom SVG icons for Lucide's IconPlus and IconArrowUp in ChatInput and ChatWindow components to standardize icon usage and improve maintainability.
* Update model list styles for responsiveness
Replaced fixed height/width classes with responsive 'size' utility classes for images and icons. Adjusted text size for model names on small screens to improve mobile usability.
* Add swipe gesture support to MobileNav
Introduces swipe gesture detection for opening and closing the mobile navigation drawer. Swiping right from the left edge opens the nav, and swiping l…
Replaces CarbonTools and related Carbon icons with Lucide equivalents throughout the UI, updating imports and usage in Svelte components. Updates Hugging Face organization avatar URLs to the new /api/avatars/{org} endpoint in both frontend and backend code. Adds new models to dev and prod YAML configs, and improves the models page layout and filtering. Also updates dependencies to include @iconify-json/lucide and the latest @sinclair/typebox.
Improve snapScrollToBottom action for user intent
Refactored snapScrollToBottom to better detect user scroll intent, handle force re-attachment, and optimize performance during streaming. Updated ChatWindow.svelte to use a combined scroll dependency and force re-attach when a user sends a new message, ensuring reliable auto-scroll behavior.
* fix: improve auto-scroll behavior for chat messages
- Replace scroll position comparison with wheel/touch event detection
to properly detect user scroll intent (fixes false detachment when
content above viewport changes size)
- Add IntersectionObserver on sentinel element for reliable bottom detection
- Increase threshold from 10px to 50px to prevent edge-case issues
- Include tool update count in scroll signal so tool calls and thinking
blocks properly trigger scroll updates
- Add passive event listeners for better scroll performance
* fix: add scrollbar drag detection and race condition handling
- Detect scrollbar drags by comparing scroll positions when not from
wheel/touch events
- Add 100ms grace period after programmatic scrolls to prevent false
detachment from content resize race conditions
- Update prevScrollTop on all scroll events to maintain accurate tracking
* Improve snapScrollToBottom scroll handling and re-attachment
Enhances the scroll logic to better h…
Add mcpServersLoaded store to track server load state
Introduces a new writable store, mcpServersLoaded, to indicate when MCP servers have finished loading. Updates ChatWindow.svelte to only show router examples after servers are loaded, improving UI consistency and preventing premature rendering.
fix: prevent navigation double-click issue in production
Change preload behavior for conversation links from "hover" to "tap".
The issue was caused by SvelteKit's data preloading on hover combined
with production network conditions. When hovering over a conversation
link, preloading would start but could be slow or fail due to network
latency. Clicking while a preload was pending/failed would cause the
first click to be ineffective.
By using data-sveltekit-preload-data="tap", the preload only starts
when the user clicks, eliminating the race condition between hover
preload and click navigation.
Co-authored-by: Claude <noreply@anthropic.com>
* Preserve original content-type in fetch-url API
The API now returns the content-type from the fetched response instead of always using text/plain. This allows clients to receive the correct content type for the requested resource.
* Improve MIME type handling for URL file fetches
Adds a utility for safer MIME type inference and selection, using file extensions and forwarded headers. Updates file fetch logic in UrlFetchModal and loadAttachmentsFromUrls to use the new helper, improving filename extraction and MIME type accuracy. The API endpoint now always returns 'text/plain' for safety, exposing the original content type in a custom header.
* Update src/lib/components/chat/UrlFetchModal.svelte
Co-authored-by: Eliott C. <coyotte508@gmail.com>
* Update src/lib/utils/loadAttachmentsFromUrls.ts
Co-authored-by: Eliott C. <coyotte508@gmail.com>
---------
Co-authored-by: Eliott C. <coyotte508@gmail.com>
* mcp: tool results now properly rendered
- Text content: <pre> + monospace (terminal-style)
- Image content: base64 decoded as <img>
Conforms to MCP spec 2025-06-18
* fix: wrap long lines in tool result text output
* mcp: smaller monospace font for tool results
Improve error handling for MCP transport failures
Enhances error reporting by preferring the original HTTP transport error when both HTTP and SSE transports fail, ensuring the UI displays the primary failure reason. Updates ServerCard to better display long error messages.
* Add image reference support for MCP tool calls
Introduces image reference resolution and attachment for MCP tool arguments, allowing tools to accept lightweight image reference strings (e.g. 'latest', 'image_1') and receive resolved image payloads. Updates tool invocation and flow logic to use these references, and improves tool prompt instructions for image input handling.
* Enable multiple file uploads in ChatInput
* Refactor multimodal model selection logic
* Remove 'latest' image reference support
Eliminates handling of the 'latest' image reference in image resolver logic and updates related comments and prompts to only support 'image_1', 'image_2', etc. This simplifies image reference usage and clarifies instructions for tool input parameters.
* Refactor imageRefs to fileRefs for tool payloads
Introduces a styled 'Now with MCP!' badge positioned at the bottom right of the video area in the WelcomeModal component to highlight the new MCP feature.
* Update ServerCard.svelte
feat(mcp): add Model Context Protocol integration with tool support
Improve MCP tools caching and server selection logic
Replaces single-entry MCP tools cache with a multi-keyed cache based on server configuration, improving cache accuracy for different server sets. Refactors server selection logic in runMcpFlow to better handle custom server lists and selected server names. Removes MCP flow from generate.ts, streamlining text generation logic.
* Add OAuth authentication for MCP servers
Introduces browser-based OAuth flow for MCP servers, including new auth helpers, localStorage management, and UI actions for authentication and sign-out. Server cards now support authentication, and enabled servers include persisted auth headers for API requests. Adds callback handler and route for OAuth completion.
* Add server authentication status and UI indicators
Introduces an 'authRequired' property to MCPServer and health check responses to indicate when authenti…
Adds a gradient highlight for the router (Omni) model tile in the models page, updates its description in both backend and UI, and refines active model border styling for better theme support. Also tweaks the chat input dropdown hover style for consistency.
* Replace file upload button with bits-ui DropdownMenu
Replaces the previous file upload button and tooltip with a DropdownMenu from bits-ui, providing a more modern UI for file/image uploads in ChatInput.svelte. Adds new dependencies to package.json for bits-ui and related packages.
* Add URL file fetch modal to chat input
Introduces UrlFetchModal.svelte for fetching files from HTTPS URLs and adds it to ChatInput.svelte. Updates file upload dropdown to support uploading text files from device or URL, and refines mime type handling in ChatWindow.svelte to always allow common text-like files and images for multimodal models.
* Copy shared files when creating conversation from share
Adds logic to duplicate files from a shared conversation to a new conversation when created from a share. Files are renamed and metadata is updated to associate them with the new conversation.
* Centralize MIME type allowlists and update usage
Introduces src/lib/constants/mime.ts to centralize text and…
* redirect to the convo
* backend redirect to the convo
* fix: fetch url logs
* server side redirect
* require a query only for the get
* fix error type
* fix: fetch url logs
---------
Co-authored-by: rtrm <remy.trompier@gmail.com>
* Add custom scrollbar class to Modal component
Applied the 'scrollbar-custom' class to the Modal's main container to enable custom scrollbar styling. This improves the appearance and consistency of scrollbars within modals.
* Add support for loading attachments from URLs
Implements the ability to load file attachments via URL parameters using a new utility (loadAttachmentsFromUrls) and a server-side proxy endpoint (/api/fetch-url) to securely fetch remote files. Updates chat and model pages to handle 'attachments' query parameters, injects file content into user messages, and improves multimodal message preparation. Also includes minor UI adjustments for file display and refactors Plausible analytics script initialization.
* Block redirects in fetch-url API endpoint
* Add model refresh API and refactor model loading
Introduces a POST /models/refresh endpoint for admins to trigger a model refresh and receive a summary of changes. Refactors model loading logic in models.ts to support dynamic refresh, exposes refreshModels and lastModelRefreshSummary, and adds a test script (test-refresh.mjs) to verify refresh functionality. Minor code cleanup and improved override handling included.
* Delete test-refresh.mjs
Disable the share button while generating (#1958)