新增: AI Chat多项增强(审批去重/编辑重发/导出/实体引用/会话置顶搜索)+任务推进链df-nodes落地

This commit is contained in:
2026-06-16 12:41:13 +08:00
parent 212a927eee
commit 7d5cd4c89a
62 changed files with 4576 additions and 248 deletions

View File

@@ -125,7 +125,7 @@ export interface WorkflowRecord {
/** 工作流事件载荷(后端 emit 的结构) */
/** 工作流事件类型字面量联合(对应后端 WorkflowEvent serde tag=type rename_all=snake_caseR7收窄防写错 type 字符串) */
export type WorkflowEventType =
| 'node_started' | 'node_progress' | 'node_output' | 'node_completed' | 'node_failed'
| 'node_started' | 'node_progress' | 'node_output' | 'node_completed' | 'node_failed' | 'node_cancelled'
| 'workflow_paused' | 'workflow_completed' | 'workflow_failed'
| 'human_approval_request' | 'human_approval_response'
@@ -180,6 +180,13 @@ export interface AiProviderConfig {
updated_at: string
}
/**
* AI 错误分类字面量集(B-260615-42)。
* 与后端 `commands::ai::ErrorType` 的 serde(rename_all = "snake_case") 严格对齐。
* 前端消费方 switch 于此常量集做差异化提示(auth 引导填 key / network 提示连接 / 等)。
*/
export type AiErrorType = 'auth' | 'network' | 'timeout' | 'provider_config' | 'unknown'
/** AI 聊天事件(后端 emit 的结构conversation_id 用于多对话流式路由) */
export type AiChatEvent = ({
type: 'AiTextDelta'; delta: string
@@ -194,11 +201,14 @@ export type AiChatEvent = ({
} | {
type: 'AiCompleted'; total_tokens: number; prompt_tokens: number; completion_tokens: number
} | {
type: 'AiError'; error: string
type: 'AiError'; error: string; error_type?: AiErrorType
} | {
type: 'AiAgentRound'; round: number
} | {
type: 'AiHeartbeat'
} | {
// F-260616-03: 达 max_iterations 暂停态(后端仍 generating=true),前端展示操作卡询问继续/停止
type: 'AiMaxRoundsReached'
}) & {
conversation_id?: string
}
@@ -233,6 +243,7 @@ export interface AiConversationSummary {
provider_id: string | null
model: string | null
archived: boolean
pinned?: boolean
prompt_tokens?: number | null
completion_tokens?: number | null
created_at: string