live turn显示agent图标
This commit is contained in:
@@ -570,6 +570,7 @@ const ConversationTabView = memo(function ConversationTabView({
|
|||||||
const messageListNode = (
|
const messageListNode = (
|
||||||
<MessageListView
|
<MessageListView
|
||||||
conversationId={effectiveConversationId}
|
conversationId={effectiveConversationId}
|
||||||
|
agentType={selectedAgent}
|
||||||
connStatus={connStatus}
|
connStatus={connStatus}
|
||||||
isActive={isActive}
|
isActive={isActive}
|
||||||
sendSignal={sendSignal}
|
sendSignal={sendSignal}
|
||||||
|
|||||||
@@ -9,9 +9,12 @@ import {
|
|||||||
estimateChangedLineStats,
|
estimateChangedLineStats,
|
||||||
} from "@/lib/line-change-stats"
|
} from "@/lib/line-change-stats"
|
||||||
import { FilePenLine, Timer, Wrench } from "lucide-react"
|
import { FilePenLine, Timer, Wrench } from "lucide-react"
|
||||||
|
import type { AgentType } from "@/lib/types"
|
||||||
|
import { AgentIcon } from "@/components/agent-icon"
|
||||||
|
|
||||||
interface LiveTurnStatsProps {
|
interface LiveTurnStatsProps {
|
||||||
message: LiveMessage
|
message: LiveMessage
|
||||||
|
agentType: AgentType
|
||||||
isStreaming?: boolean
|
isStreaming?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,6 +263,7 @@ function extractLiveEditStats(message: LiveMessage): LiveEditStats {
|
|||||||
|
|
||||||
export function LiveTurnStats({
|
export function LiveTurnStats({
|
||||||
message,
|
message,
|
||||||
|
agentType,
|
||||||
isStreaming = true,
|
isStreaming = true,
|
||||||
}: LiveTurnStatsProps) {
|
}: LiveTurnStatsProps) {
|
||||||
const locale = useLocale()
|
const locale = useLocale()
|
||||||
@@ -309,7 +313,7 @@ export function LiveTurnStats({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-8 shrink-0 items-center justify-center gap-3 px-4 text-xs leading-none text-muted-foreground">
|
<div className="flex h-8 shrink-0 items-center justify-center gap-3 px-4 text-xs leading-none text-muted-foreground">
|
||||||
<span className="inline-block h-1.5 w-1.5 rounded-full bg-primary animate-pulse shrink-0" />
|
<AgentIcon agentType={agentType} className="h-3.5 w-3.5 animate-pulse" />
|
||||||
{isThinking ? (
|
{isThinking ? (
|
||||||
<span>{t("thinking")}</span>
|
<span>{t("thinking")}</span>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -24,12 +24,13 @@ import {
|
|||||||
buildPlanKey,
|
buildPlanKey,
|
||||||
extractLatestPlanEntriesFromMessages,
|
extractLatestPlanEntriesFromMessages,
|
||||||
} from "@/lib/agent-plan"
|
} from "@/lib/agent-plan"
|
||||||
import type { ConnectionStatus, SessionStats } from "@/lib/types"
|
import type { AgentType, ConnectionStatus, SessionStats } from "@/lib/types"
|
||||||
import { VirtualizedMessageThread } from "@/components/message/virtualized-message-thread"
|
import { VirtualizedMessageThread } from "@/components/message/virtualized-message-thread"
|
||||||
import { useStickToBottomContext } from "use-stick-to-bottom"
|
import { useStickToBottomContext } from "use-stick-to-bottom"
|
||||||
|
|
||||||
interface MessageListViewProps {
|
interface MessageListViewProps {
|
||||||
conversationId: number
|
conversationId: number
|
||||||
|
agentType: AgentType
|
||||||
connStatus?: ConnectionStatus | null
|
connStatus?: ConnectionStatus | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
sendSignal?: number
|
sendSignal?: number
|
||||||
@@ -128,6 +129,7 @@ const AutoScrollOnSend = memo(function AutoScrollOnSend({
|
|||||||
|
|
||||||
export function MessageListView({
|
export function MessageListView({
|
||||||
conversationId,
|
conversationId,
|
||||||
|
agentType,
|
||||||
connStatus,
|
connStatus,
|
||||||
isActive = true,
|
isActive = true,
|
||||||
sendSignal = 0,
|
sendSignal = 0,
|
||||||
@@ -309,6 +311,7 @@ export function MessageListView({
|
|||||||
{liveMessage && connStatus === "prompting" && (
|
{liveMessage && connStatus === "prompting" && (
|
||||||
<LiveTurnStats
|
<LiveTurnStats
|
||||||
message={liveMessage}
|
message={liveMessage}
|
||||||
|
agentType={agentType}
|
||||||
isStreaming={connStatus === "prompting"}
|
isStreaming={connStatus === "prompting"}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user