feat: 支持 AI 设计项目多会话交互
需求:用户可在同一设计项目中新建和切换会话,任务列表保持项目级共享。 实现: - 增加会话选择、新建入口及本地数据迁移 - Conversation 独立消息、Brief、Quote 与流式状态 - 保留项目任务并修复 Task revision 与 ABA 异步竞态 - 保持 Enter 发送、Shift+Enter 换行及 IME 保护
This commit is contained in:
@@ -47,14 +47,28 @@ export type DesignMessage = {
|
||||
export type DesignWorkspaceSummary = {
|
||||
workspaceId: string;
|
||||
title: string;
|
||||
turnRevision: number;
|
||||
viewRevision: number;
|
||||
conversationCount: number;
|
||||
phase: DesignWorkspacePhase;
|
||||
brief: DesignBrief;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type DesignWorkspace = DesignWorkspaceSummary & {
|
||||
conversations: DesignConversationSummary[];
|
||||
};
|
||||
|
||||
export type DesignConversationSummary = {
|
||||
conversationId: string;
|
||||
workspaceId: string;
|
||||
title: string;
|
||||
turnRevision: number;
|
||||
phase: DesignWorkspacePhase;
|
||||
brief: DesignBrief;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type DesignConversation = DesignConversationSummary & {
|
||||
messages: DesignMessage[];
|
||||
};
|
||||
|
||||
@@ -86,6 +100,7 @@ export type DesignAssetUploadInput = {
|
||||
export type DesignGenerationTask = {
|
||||
taskId: string;
|
||||
workspaceId: string;
|
||||
conversationId: string | null;
|
||||
medium: DesignMedium;
|
||||
status: DesignTaskStatus;
|
||||
briefVersion: number;
|
||||
@@ -106,12 +121,13 @@ export type DesignGenerationTaskUpdatedEvent = {
|
||||
generationTask: DesignGenerationTask;
|
||||
};
|
||||
|
||||
export type DesignGenerationTasksSnapshotEvent = {
|
||||
export type DesignConversationSnapshotEvent = {
|
||||
id: string;
|
||||
type: 'design.generation_tasks.snapshot';
|
||||
type: 'design.conversation.snapshot';
|
||||
workspaceId: string;
|
||||
conversationId: string;
|
||||
workspaceViewRevision: number;
|
||||
workspace: DesignWorkspace;
|
||||
conversation: DesignConversation;
|
||||
generationTasks: DesignGenerationTask[];
|
||||
};
|
||||
|
||||
@@ -119,6 +135,7 @@ export type DesignAssistantDeltaEvent = {
|
||||
id: string;
|
||||
type: 'design.assistant.delta';
|
||||
workspaceId: string;
|
||||
conversationId: string;
|
||||
clientTurnId: string;
|
||||
turnRevision: number;
|
||||
chunkIndex: number;
|
||||
@@ -127,7 +144,7 @@ export type DesignAssistantDeltaEvent = {
|
||||
|
||||
export type DesignWorkspaceEvent =
|
||||
| DesignGenerationTaskUpdatedEvent
|
||||
| DesignGenerationTasksSnapshotEvent
|
||||
| DesignConversationSnapshotEvent
|
||||
| DesignAssistantDeltaEvent;
|
||||
|
||||
export type DesignWorkspaceBootstrap = {
|
||||
@@ -140,6 +157,12 @@ export type DesignCreateWorkspaceInput = {
|
||||
title: string;
|
||||
};
|
||||
|
||||
export type DesignCreateConversationInput = {
|
||||
workspaceId: string;
|
||||
clientConversationId: string;
|
||||
title: string;
|
||||
};
|
||||
|
||||
export type DesignRenameWorkspaceInput = {
|
||||
workspaceId: string;
|
||||
title: string;
|
||||
@@ -147,6 +170,7 @@ export type DesignRenameWorkspaceInput = {
|
||||
|
||||
export type DesignSubmitMessageInput = {
|
||||
workspaceId: string;
|
||||
conversationId: string;
|
||||
clientTurnId: string;
|
||||
expectedTurnRevision: number;
|
||||
message: string;
|
||||
@@ -155,6 +179,7 @@ export type DesignSubmitMessageInput = {
|
||||
|
||||
export type DesignConfirmGenerationInput = {
|
||||
workspaceId: string;
|
||||
conversationId: string;
|
||||
clientTurnId: string;
|
||||
expectedTurnRevision: number;
|
||||
quoteId: string;
|
||||
|
||||
Reference in New Issue
Block a user