diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionFileAttachments.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionFileAttachments.svelte index 3f23a9c9c6..84b7dfd7fa 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionFileAttachments.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionFileAttachments.svelte @@ -24,7 +24,7 @@ onSystemPromptClick }: Props = $props(); - const fileUploadTooltipText = 'Add files'; + const fileUploadTooltipText = 'Add files or context'; function handleFileUpload(fileType?: FileTypeCategory) { onFileUpload?.(fileType); diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/AgenticContent.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/AgenticContent.svelte index d6e437598d..cb8b2e4eec 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/AgenticContent.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/AgenticContent.svelte @@ -7,17 +7,21 @@ * similar to the reasoning/thinking block UI. */ - import { MarkdownContent, SyntaxHighlightedCode } from '$lib/components/app'; + import { + CollapsibleContentBlock, + MarkdownContent, + SyntaxHighlightedCode + } from '$lib/components/app'; import { config } from '$lib/stores/settings.svelte'; import { Wrench, Loader2 } from '@lucide/svelte'; - import CollapsibleInfoCard from './CollapsibleInfoCard.svelte'; + import { AgenticSectionType } from '$lib/types/agentic'; interface Props { content: string; } interface AgenticSection { - type: 'text' | 'tool_call' | 'tool_call_pending' | 'tool_call_streaming'; + type: AgenticSectionType; content: string; toolName?: string; toolArgs?: string; @@ -66,7 +70,7 @@ if (match.index > lastIndex) { const textBefore = rawContent.slice(lastIndex, match.index).trim(); if (textBefore) { - sections.push({ type: 'text', content: textBefore }); + sections.push({ type: AgenticSectionType.TEXT, content: textBefore }); } } @@ -82,7 +86,7 @@ const toolResult = match[3].replace(/^\n+|\n+$/g, ''); sections.push({ - type: 'tool_call', + type: AgenticSectionType.TOOL_CALL, content: toolResult, toolName, toolArgs, @@ -115,7 +119,7 @@ if (pendingIndex > 0) { const textBefore = remainingContent.slice(0, pendingIndex).trim(); if (textBefore) { - sections.push({ type: 'text', content: textBefore }); + sections.push({ type: AgenticSectionType.TEXT, content: textBefore }); } } @@ -132,7 +136,7 @@ const streamingResult = (pendingMatch[3] || '').replace(/^\n+|\n+$/g, ''); sections.push({ - type: 'tool_call_pending', + type: AgenticSectionType.TOOL_CALL_PENDING, content: streamingResult, toolName, toolArgs, @@ -144,7 +148,7 @@ if (pendingIndex > 0) { const textBefore = remainingContent.slice(0, pendingIndex).trim(); if (textBefore) { - sections.push({ type: 'text', content: textBefore }); + sections.push({ type: AgenticSectionType.TEXT, content: textBefore }); } } @@ -169,7 +173,7 @@ } sections.push({ - type: 'tool_call_streaming', + type: AgenticSectionType.TOOL_CALL_STREAMING, content: '', toolName: partialWithNameMatch[1], toolArgs: partialArgs || undefined, @@ -181,7 +185,7 @@ if (pendingIndex > 0) { const textBefore = remainingContent.slice(0, pendingIndex).trim(); if (textBefore) { - sections.push({ type: 'text', content: textBefore }); + sections.push({ type: AgenticSectionType.TEXT, content: textBefore }); } } @@ -189,7 +193,7 @@ const nameMatch = earlyMatch[1]?.match(/<<]+)>>>/); sections.push({ - type: 'tool_call_streaming', + type: AgenticSectionType.TOOL_CALL_STREAMING, content: '', toolName: nameMatch?.[1], toolArgs: undefined, @@ -207,13 +211,13 @@ } if (remainingText) { - sections.push({ type: 'text', content: remainingText }); + sections.push({ type: AgenticSectionType.TEXT, content: remainingText }); } } // If no tool calls found, return content as single text section if (sections.length === 0 && rawContent.trim()) { - sections.push({ type: 'text', content: rawContent }); + sections.push({ type: AgenticSectionType.TEXT, content: rawContent }); } return sections; @@ -231,13 +235,12 @@
{#each sections as section, index (index)} - {#if section.type === 'text'} + {#if section.type === AgenticSectionType.TEXT}
- {:else if section.type === 'tool_call_streaming'} - - {/if}
- - {:else if section.type === 'tool_call' || section.type === 'tool_call_pending'} - {@const isPending = section.type === 'tool_call_pending'} + + {:else if section.type === AgenticSectionType.TOOL_CALL || section.type === AgenticSectionType.TOOL_CALL_PENDING} + {@const isPending = section.type === AgenticSectionType.TOOL_CALL_PENDING} {@const toolIcon = isPending ? Loader2 : Wrench} {@const toolIconClass = isPending ? 'h-4 w-4 animate-spin' : 'h-4 w-4'} - {/if} - + {/if} {/each} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte index 518375582e..3ded592344 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte @@ -134,7 +134,7 @@ function handleEdit() { isEditing = true; - // Clear placeholder content for system messages + // Clear temporary placeholder content for system messages editedContent = message.role === 'system' && message.content === SYSTEM_MESSAGE_PLACEHOLDER ? '' @@ -183,7 +183,7 @@ // System messages: update in place without branching const newContent = editedContent.trim(); - // If content is empty or still the placeholder, remove without deleting children + // If content is empty, remove without deleting children if (!newContent) { const conversationDeleted = await removeSystemPromptPlaceholder(message.id); isEditing = false; diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageThinkingBlock.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageThinkingBlock.svelte index 3e66580682..7e53726d3a 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageThinkingBlock.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageThinkingBlock.svelte @@ -1,7 +1,7 @@ - - + diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/CollapsibleInfoCard.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/CollapsibleContentBlock.svelte similarity index 100% rename from tools/server/webui/src/lib/components/app/chat/ChatMessages/CollapsibleInfoCard.svelte rename to tools/server/webui/src/lib/components/app/chat/ChatMessages/CollapsibleContentBlock.svelte diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogMcpServersSettings.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogMcpServersSettings.svelte index ab6f7d91cb..504c882d0f 100644 --- a/tools/server/webui/src/lib/components/app/dialogs/DialogMcpServersSettings.svelte +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogMcpServersSettings.svelte @@ -1,6 +1,6 @@