feat: 对接设计 Agent Gateway WebSocket
需求:服务端统一 Agent Gateway 将设计任务状态流切换为 WebSocket,客户端需要实时展示生成任务并支持断线恢复。 实现:Electron Main 管理 Session、一次性 Ticket、WebSocket 心跳与游标续传,按关闭码回收会话;Renderer 继续通过本机 Host API 的 SSE 投影接收任务事件,并保留 REST 降级同步。 验证:typecheck、变更文件 ESLint、37 个聚焦测试及 build:vite 通过。
This commit is contained in:
@@ -85,6 +85,26 @@ export type DesignGenerationTask = {
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type DesignGenerationTaskUpdatedEvent = {
|
||||
id: string;
|
||||
type: 'design.generation_task.updated';
|
||||
workspaceId: string;
|
||||
workspaceViewRevision: number;
|
||||
generationTask: DesignGenerationTask;
|
||||
};
|
||||
|
||||
export type DesignGenerationTasksSnapshotEvent = {
|
||||
id: string;
|
||||
type: 'design.generation_tasks.snapshot';
|
||||
workspaceId: string;
|
||||
workspaceViewRevision: number;
|
||||
generationTasks: DesignGenerationTask[];
|
||||
};
|
||||
|
||||
export type DesignWorkspaceEvent =
|
||||
| DesignGenerationTaskUpdatedEvent
|
||||
| DesignGenerationTasksSnapshotEvent;
|
||||
|
||||
export type DesignWorkspaceBootstrap = {
|
||||
capabilities: DesignCapabilities;
|
||||
workspaces: DesignWorkspaceSummary[];
|
||||
|
||||
Reference in New Issue
Block a user