feat: add final result rendering with status badges and artifacts

- FinalResult component showing SubagentResult summary and artifacts
- Status badges: Success (green), Partial (amber), Failed (red)
- Quality and source badges (Verified/Inferred, Tool Output/Web/etc)
- Artifact list with file icons
- Integrated into chat page after stream completes

Closes #10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shahondin1624
2026-03-12 11:38:29 +01:00
parent 4f2bf514e5
commit 2ff3e181a4
4 changed files with 107 additions and 0 deletions

View File

@@ -1,9 +1,11 @@
<script lang="ts">
import type { ChatMessage } from '$lib/types';
import type { SubagentResult } from '$lib/proto/llm_multiverse/v1/common_pb';
import MessageList from '$lib/components/MessageList.svelte';
import MessageInput from '$lib/components/MessageInput.svelte';
import OrchestrationProgress from '$lib/components/OrchestrationProgress.svelte';
import ThinkingSection from '$lib/components/ThinkingSection.svelte';
import FinalResult from '$lib/components/FinalResult.svelte';
import { processRequest, OrchestratorError } from '$lib/services/orchestrator';
import { OrchestrationState } from '$lib/proto/llm_multiverse/v1/orchestrator_pb';
@@ -13,11 +15,13 @@
let sessionId = $state(crypto.randomUUID());
let orchestrationState: OrchestrationState = $state(OrchestrationState.UNSPECIFIED);
let intermediateResult: string = $state('');
let finalResult: SubagentResult | null = $state(null);
async function handleSend(content: string) {
error = null;
orchestrationState = OrchestrationState.UNSPECIFIED;
intermediateResult = '';
finalResult = null;
const userMessage: ChatMessage = {
id: crypto.randomUUID(),
@@ -43,6 +47,9 @@
if (response.intermediateResult) {
intermediateResult = response.intermediateResult;
}
if (response.finalResult) {
finalResult = response.finalResult;
}
const idx = messages.length - 1;
messages[idx] = {
...messages[idx],
@@ -91,6 +98,10 @@
</div>
{/if}
{#if finalResult && !isStreaming}
<FinalResult result={finalResult} />
{/if}
{#if error}
<div class="mx-4 mb-2 rounded-lg bg-red-50 px-4 py-2 text-sm text-red-600">
{error}