feat: 完善智能体图片聊天与会话恢复

- 增加私有图片上传、绑定、历史回显与生命周期清理

- 支持输入草稿恢复、图片交互和模型图片能力约束

- 修复旧脏会话幂等删除与前端会话恢复
This commit is contained in:
2026-07-17 19:54:26 +08:00
parent 62d763199f
commit 1e6158be77
62 changed files with 5333 additions and 189 deletions

View File

@@ -1,16 +1,18 @@
<script setup lang="ts">
import type {
ChatTimelineItem,
ChatImageLoader,
ChatTimelineMessageItem,
ChatTimelineMessagePart,
ChatTimelineToolApprovalPayload,
} from './types';
import {computed} from 'vue';
import { computed } from 'vue';
import ChatThinkingBlock from '../chat-thinking/ChatThinkingBlock.vue';
import ChatErrorNotice from './ChatErrorNotice.vue';
import ChatKnowledgeCard from './ChatKnowledgeCard.vue';
import ChatImageAttachments from './ChatImageAttachments.vue';
import ChatMessageToolbar from './ChatMessageToolbar.vue';
import ChatTextBlock from './ChatTextBlock.vue';
import ChatTimelineStatusRow from './ChatTimelineStatusRow.vue';
@@ -22,6 +24,7 @@ const props = defineProps<{
regenerable?: boolean;
regenerateDisabled?: boolean;
assistantActionsVisible?: boolean;
imageLoader?: ChatImageLoader;
item: ChatTimelineItem;
variantLoading?: boolean;
}>();
@@ -127,6 +130,12 @@ function updateThinkingExpanded(partId: string, expanded: boolean) {
{ 'has-variant-navigator': showVariantNavigator },
]"
>
<ChatImageAttachments
v-if="messageItem.images?.length"
:items="messageItem.images"
:image-loader="imageLoader"
compact
/>
<template v-for="part in getMessageParts(messageItem)" :key="part.id">
<ChatThinkingBlock
v-if="part.type === 'thinking'"