feat: complete SDK features — Hooks, MCP timeout, Image vision (#49, #51, #52)#92
Merged
Conversation
Add optional timeout field throughout the MCP server stack: - McpServerDefinition type (timeout?: number) - McpServerInput interface and buildUserMcpServers() pass-through - parseMcpServers() validation (positive number, max 300000ms) - isValidMcpServer() client-side validation - SettingsModal UI: timeout input in both add and edit forms - Tests for session builder and parser timeout handling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add vision capability checking and image thumbnail previews in ChatInput: - Warn when attaching images to models without vision support - Show 28x28 thumbnail previews for image files in attachment chips - Extract isImageFile/hasImageAttachments utilities with 8 unit tests - Derive supportsVision from model capabilities in +page.svelte Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes 3 SDK feature issues from the feature audit.
Issue #49 — SDK Hooks: Complete Implementation
onUserPromptSubmittedhook tobuildSessionHooks()(6th of 6 SDK hooks now wired)resumeSession()not passinghooks— hook events now fire correctly after session resumeHookUserPromptMessagetype and updatedHookMessage/ServerMessageunionsIssue #51 — MCP Servers: Timeout Support
timeout?: numberfield toMcpServerDefinitionandMcpServerInputtypesbuildUserMcpServers()to conditionally pass timeout to SDKparseMcpServers()(positive, max 300000ms, rounded to integer)isValidMcpServer()client-side validationIssue #52 — Image Input: Vision Check + Thumbnails
URL.revokeObjectURLcleanup)isImageFile()/hasImageAttachments()utilities insrc/lib/utils/image.tssupportsVisionfrom model capabilities in+page.svelteValidation
svelte-check: 0 errors, 0 warningsnpm run build: successnpm run test:unit: 321/321 tests passing (14 new tests added)Files Changed (11 files)
src/lib/types/index.tssrc/lib/server/copilot/session.ts,src/lib/server/ws/handler.tssrc/lib/stores/settings.svelte.tssrc/lib/components/ChatInput.svelte,src/lib/components/SettingsModal.sveltesrc/routes/+page.sveltesrc/lib/utils/image.ts(new)session.test.ts,parse-mcp-servers.test.ts,image.test.ts(new)Closes #49, closes #51, closes #52