* 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
Expand image field support in tool prompts and rules
Moved message and file preparation logic to a shared utility (prepareFiles.ts) for OpenAI-compatible multimodal payloads. Updated endpointOai and runMcpFlow to use the new prepareMessagesWithFiles function, improving code reuse and maintainability.
Update image ref resolution to use conversation order
File reference resolver now maps image refs (e.g. image_1, image_2) to user-uploaded images in chronological order across the entire conversation, rather than only the latest user message. Updated tool prompt instructions to clarify this behavior for users.
* 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
* 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…