Adds http://localhost:* and http://127.0.0.1:* to allowed frame-ancestors
when running in development mode, enabling local testing of iframe embedding.
feat: restrict iframe embedding to huggingface.co
When ALLOW_IFRAME=true, instead of allowing all origins, now specifically
allows embedding only from https://huggingface.co and 'self'.
This enables embedding the chat UI on pages like huggingface.co/papers
while maintaining security by blocking embedding from other origins.
refactor: remove isPro from database schema (#2050)
* refactor: remove isPro from database schema
- Remove isPro field from User type
- Remove isPro parsing from OAuth login
- Remove isPro from user API response
- isPro is now fetched purely client-side from HuggingFace public API
* fix: keep isPro as null on fetch error to avoid showing wrong badge
feat: add PRO badge and credits modal for HuggingChat (#2048)
* 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
fix(mcp): communicate tool errors to LLM to prevent hallucinated success (#2036)
When MCP tool calls fail (e.g., timeout), the error was shown in the UI
but not sent to the LLM. This caused the LLM to hallucinate success
because it never received feedback about the failure.
Now error messages are included in toolMessages so the LLM can
acknowledge failures and respond appropriately.
MCP Tool Progress Notifications and MCP SDK bump. (#2030)
Use highlights instead of full page text to minimize context size.
The previous implementation requested `text: true` which returned
entire page contents (5-20K+ chars per result), overwhelming LLM context.
Now uses:
- highlights: 3 sentences, 2 per URL (concise, query-relevant)
- text fallback: max 500 chars (only if highlights empty)
This matches what the MCP server at mcp.exa.ai likely returns.
* 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…
Added checks in +page.svelte and models/[...model]/+page.svelte to require authentication if 'q', 'prompt', or 'attachments' query parameters are present. This prevents unauthenticated users from processing these parameters and ensures proper redirection to login when needed. Also improved error handling for non-JSON error responses.
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.
Handle closed connection errors in MCP HTTP client
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>
Fix transcription returning dots for silence/unclear audio
Whisper model returns "..." (or similar dot patterns) when audio is
too short, silent, or unclear. Filter out responses that only contain
dots server-side to prevent them from being inserted into the draft
message or triggering auto-send on mobile.
Co-authored-by: Claude <noreply@anthropic.com>
Updated meta tags in +layout.svelte for improved SEO and social sharing, including more detailed Twitter and Open Graph tags. Added robots.txt to control crawler access and reference sitemap.
Updated the redirect in the conversation page loader to use the `base` path from `$app/paths` instead of a hardcoded root path. This ensures correct redirection when the app is deployed under a subpath.
Refactors the requireAuthUser function to always append the 'next' parameter to the login URL, removing conditional logic based on shared state or pathname.
Disable mobile zoom
- Update viewport meta tag with maximum-scale=1 and user-scalable=no
- Add touch-action: pan-x pan-y to prevent pinch-to-zoom gestures
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.