ui: Linting & Formatting scripts (#26819)
This commit is contained in:
+26
-24
@@ -1,29 +1,28 @@
|
||||
<script lang="ts">
|
||||
import ChatMessageToolCallBlock from './ChatMessage/ChatMessageToolCall/ChatMessageToolCallBlock.svelte';
|
||||
import ChatMessageReasoningBlock from './ChatMessageReasoningBlock.svelte';
|
||||
import {
|
||||
ChatMessageStatistics,
|
||||
MarkdownContent,
|
||||
ChatMessageActionCardContinueRequest,
|
||||
ChatMessageActionCardPermissionRequest,
|
||||
ChatMessageActionCardContinueRequest
|
||||
ChatMessageStatistics,
|
||||
MarkdownContent
|
||||
} from '$lib/components/app';
|
||||
|
||||
import { AgenticSectionType, ChatMessageStatsView, ToolPermissionDecision } from '$lib/enums';
|
||||
import {
|
||||
agenticExecutingToolCallId,
|
||||
agenticLastError,
|
||||
agenticPendingContinueRequest,
|
||||
agenticPendingPermissionRequest,
|
||||
agenticResolveContinue,
|
||||
agenticResolvePermission
|
||||
} from '$lib/stores/agentic.svelte';
|
||||
import { config } from '$lib/stores/settings.svelte';
|
||||
import type {
|
||||
ChatMessageAgenticTimings,
|
||||
ChatMessageAgenticTurnStats,
|
||||
DatabaseMessage
|
||||
} from '$lib/types';
|
||||
import { deriveAgenticSections, type AgenticSection } from '$lib/utils';
|
||||
import {
|
||||
agenticPendingPermissionRequest,
|
||||
agenticResolvePermission,
|
||||
agenticPendingContinueRequest,
|
||||
agenticResolveContinue,
|
||||
agenticLastError,
|
||||
agenticExecutingToolCallId
|
||||
} from '$lib/stores/agentic.svelte';
|
||||
import { config } from '$lib/stores/settings.svelte';
|
||||
import ChatMessageReasoningBlock from './ChatMessageReasoningBlock.svelte';
|
||||
import ChatMessageToolCallBlock from './ChatMessage/ChatMessageToolCall/ChatMessageToolCallBlock.svelte';
|
||||
import { type AgenticSection, deriveAgenticSections } from '$lib/utils';
|
||||
|
||||
interface Props {
|
||||
message: DatabaseMessage;
|
||||
@@ -33,10 +32,10 @@
|
||||
}
|
||||
|
||||
let {
|
||||
message,
|
||||
toolMessages = [],
|
||||
isLastAssistantMessage = false,
|
||||
isStreaming = false,
|
||||
isLastAssistantMessage = false
|
||||
message,
|
||||
toolMessages = []
|
||||
}: Props = $props();
|
||||
|
||||
let expandedStates: Record<number, boolean> = $state({});
|
||||
@@ -60,6 +59,7 @@
|
||||
$effect(() => {
|
||||
if (pendingPermission !== prevPendingRef) {
|
||||
prevPendingRef = pendingPermission;
|
||||
|
||||
if (pendingPermission) {
|
||||
permissionDismissed = false;
|
||||
}
|
||||
@@ -81,6 +81,7 @@
|
||||
$effect(() => {
|
||||
if (pendingContinue !== prevContinueRef) {
|
||||
prevContinueRef = pendingContinue;
|
||||
|
||||
if (pendingContinue) {
|
||||
continueDismissed = false;
|
||||
}
|
||||
@@ -105,6 +106,7 @@
|
||||
|
||||
const turnGroups: TurnGroup[] = $derived.by(() => {
|
||||
const groups: TurnGroup[] = [];
|
||||
|
||||
let currentTurn: AgenticSection[] = [];
|
||||
let currentIndices: number[] = [];
|
||||
let prevWasTool = false;
|
||||
@@ -117,7 +119,7 @@
|
||||
section.type === AgenticSectionType.TOOL_CALL_STREAMING;
|
||||
|
||||
if (!isTool && prevWasTool && currentTurn.length > 0) {
|
||||
groups.push({ sections: currentTurn, flatIndices: currentIndices });
|
||||
groups.push({ flatIndices: currentIndices, sections: currentTurn });
|
||||
currentTurn = [];
|
||||
currentIndices = [];
|
||||
}
|
||||
@@ -128,7 +130,7 @@
|
||||
}
|
||||
|
||||
if (currentTurn.length > 0) {
|
||||
groups.push({ sections: currentTurn, flatIndices: currentIndices });
|
||||
groups.push({ flatIndices: currentIndices, sections: currentTurn });
|
||||
}
|
||||
|
||||
return groups;
|
||||
@@ -166,11 +168,11 @@
|
||||
|
||||
function buildTurnAgenticTimings(stats: ChatMessageAgenticTurnStats): ChatMessageAgenticTimings {
|
||||
return {
|
||||
turns: 1,
|
||||
llm: stats.llm,
|
||||
toolCalls: stats.toolCalls,
|
||||
toolCallsCount: stats.toolCalls.length,
|
||||
toolsMs: stats.toolsMs,
|
||||
toolCalls: stats.toolCalls,
|
||||
llm: stats.llm
|
||||
turns: 1
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user