Skip to content

Conversation

gary149
Copy link
Collaborator

@gary149 gary149 commented Oct 3, 2025

No description provided.

gary149 added 16 commits October 6, 2025 20:12
Introduces Model Context Protocol (MCP) tool support by adding new server modules (httpClient, registry, tools), a ToolUpdate Svelte component, and Tool type definitions. Updates chat message handling and message update logic to integrate tool updates, and adds the @modelcontextprotocol/sdk dependency.
Introduces debug and warning logs around MCP tool calls in generate.ts to improve traceability of tool invocation, completion, and errors. Minor formatting adjustments in ChatMessage.svelte for derived store usage.
Improves tool mapping in getOpenAiToolsForMcp by adding plain tool names and preventing duplicates. Updates MCP flow routing to select multimodal models when image input is detected, improving support for multimodal requests.
Refactors MCP tool listing and invocation for better type safety and normalization. Enhances OpenAI chat completion streaming with stricter typing, improved multimodal support, and more robust tool call aggregation. Cleans up type definitions and utility functions for message updates. Fixes minor bugs and improves code clarity throughout MCP and text generation modules.
Enhanced ToolUpdate.svelte to better format and display tool parameters, outputs, and error messages. Refactored httpClient.ts to robustly fallback from streamable to SSE transport, improving error handling and connection management for MCP tool calls.
Implements source citation extraction and annotation in generated answers, propagates source metadata through message updates, and displays sources with favicons and hostnames in the chat UI. Updates Markdown rendering to decorate citations and refines math inline parsing to avoid false positives. Improves handling of sources in server, client, and type definitions for consistent citation support.
Enhances citation mapping logic in text generation to ensure only valid indices are used and injects mapping instructions for sources. Refactors citation rendering in marked.ts to operate on HTML code blocks instead of markdown, improving inline citation placement. Updates ChatMessage.svelte to use parsed origin for favicons and hostname normalization. Fixes message content update logic in conversation page.
Enhanced citation mapping logic in text generation to prevent redundant system messages and ensure correct injection timing. Improved accessibility for source links in ChatMessage.svelte by adding title and aria-label attributes. Refined citation rendering in marked.ts for more accurate inline citation formatting.
Enhances citation mapping and normalization to avoid duplicate system messages and properly mask code segments. Refines URL extraction and normalization, improves link sanitization in markdown rendering, and updates citation rendering logic to use safe href attributes. Also fixes message content updates to preserve initial content during streaming.
Changed executeToolCalls to be an async generator yielding MessageUpdate objects instead of returning an array. Updated runMcpFlow to consume the generator and yield updates as they are produced, improving streaming and memory efficiency.
Changed executeToolCalls to yield structured ToolExecutionEvent objects, separating 'update' and 'complete' events. Updated runMcpFlow to handle the new event types and improved error handling and logging for missing execution summaries.
Updated the preprompt for title generation to provide clearer, stricter instructions and examples for generating concise, descriptive titles. Improved fallback handling by ensuring summary is always a string and clarified that no post-processing is performed.
Introduces support for converting bracketed citations (e.g., [1]) in markdown content into links when matching sources are provided. Updates ChatMessage to pass sources to MarkdownRenderer, and adds tests to verify correct linkification and fallback behavior.
Refactors citation tracking to use canonicalized URLs and robust URL extraction via linkify-it, preventing duplicate or spurious citations. Updates MarkdownRenderer to avoid adding citations inside code/pre tags. Adds a new url.ts utility for URL normalization and extraction. Updates routerExamples with a new Flappy Bird example. Adjusts MCP tool invocation and flow to use the new citation processing methods. Adds linkify-it and its types as dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant