优化: 清理无意义注释(走查编号前缀/过时历史标注/死代码注释)
This commit is contained in:
+5
-5
@@ -43,7 +43,7 @@ export const aiApi = {
|
||||
},
|
||||
|
||||
/**
|
||||
* 重新生成最后一条 AI 回复(UX-02)。
|
||||
* 重新生成最后一条 AI 回复。
|
||||
* 后端:占用 generating → 弹出末尾 AI 回复(保留触发它的 user 消息)→ 重跑 agentic loop。
|
||||
* 前端消费:与 sendMessage 一样需本地 push 空气泡占位 + 置 streaming(见 useAiSend.regenerate)。
|
||||
*/
|
||||
@@ -56,7 +56,7 @@ export const aiApi = {
|
||||
},
|
||||
|
||||
/**
|
||||
* 编辑最后一条 user 消息并重新生成(UX-09)。
|
||||
* 编辑最后一条 user 消息并重新生成。
|
||||
* 后端:占用 generating → 替换末条 user content → 其后消息标 truncated(软删)→ 重跑 agentic loop。
|
||||
* 前端消费:调 editMessage 前需移除被编辑消息之后的所有消息(视图截断)+ push 空气泡占位 + 置 streaming。
|
||||
* 中间 user 消息编辑被后端拒绝(只允许末条)。
|
||||
@@ -205,7 +205,7 @@ export const aiApi = {
|
||||
},
|
||||
|
||||
/**
|
||||
* 一次性测试连接(P0-1):用**表单当前值**测试,不写库。
|
||||
* 一次性测试连接用**表单当前值**测试,不写库。
|
||||
* - 新建态:传表单填的 providerType/baseUrl/apiKey,providerId=null。
|
||||
* - 编辑态(apiKey 留空=不改):传 providerId 让后端从 DB 沿用旧密钥;
|
||||
* apiKey 非空则直接用表单新值。
|
||||
@@ -329,13 +329,13 @@ export const aiApi = {
|
||||
return invoke('ai_conversation_archive', { conversationId, archived })
|
||||
},
|
||||
|
||||
/** 置顶/取消置顶对话(UX-17) */
|
||||
/** 置顶/取消置顶对话*/
|
||||
setPinnedConversation(conversationId: string, pinned: boolean): Promise<void> {
|
||||
return invoke('ai_conversation_set_pinned', { conversationId, pinned })
|
||||
},
|
||||
|
||||
/**
|
||||
/** 导出对话为指定格式(UX-18:对话导出;消费 batch46 ai_conversation_export IPC)。
|
||||
/** 导出对话为指定格式对话导出;消费 batch46 ai_conversation_export IPC)。
|
||||
* 后端返回导出内容 String(markdown/json/txt),前端落 Blob 下载或复制剪贴板。
|
||||
* @param format 'markdown' | 'json' | 'txt'
|
||||
*/
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ export const ideaApi = {
|
||||
/**
|
||||
* 列出灵感。
|
||||
*
|
||||
* **双签名向后兼容**(F-260621-02):
|
||||
* **双签名向后兼容**
|
||||
* - `list(status?)`:旧签名,仅状态过滤(等价 `list({ status })`)。
|
||||
* - `list(query?)`:新签名,多条件(status/keyword/order_by/limit/offset)走后端 WHERE。
|
||||
*
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ export interface ProjectQuery {
|
||||
export const projectApi = {
|
||||
/**
|
||||
* 列出未删除项目。
|
||||
* F-260621-02:可选 query(关键词/排序/分页)。不传 = 当前全量行为(向后兼容)。
|
||||
* 可选 query(关键词/排序/分页)。不传 = 当前全量行为(向后兼容)。
|
||||
*/
|
||||
list(query?: ProjectQuery): Promise<ProjectRecord[]> {
|
||||
return invoke('list_projects', { query })
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ export const taskApi = {
|
||||
/**
|
||||
* 列出任务。
|
||||
*
|
||||
* **双签名向后兼容**(F-260621-02):
|
||||
* **双签名向后兼容**
|
||||
* - `list(projectId?)`:旧签名,仅项目过滤(等价 `list({ project_id: projectId })`)。
|
||||
* - `list(query?)`:新签名,多条件(status/keyword/project_id/priority/assignee/...)走后端 WHERE。
|
||||
*
|
||||
|
||||
+12
-12
@@ -328,15 +328,15 @@ export interface AiProviderConfig {
|
||||
base_url: string
|
||||
default_model: string
|
||||
models: string | null
|
||||
/** 模型能力配置数组(F-01:4 维度 + 路由控制;DB TEXT 列 JSON 解析,老库可能缺失) */
|
||||
/** 模型能力配置数组4 维度 + 路由控制;DB TEXT 列 JSON 解析,老库可能缺失) */
|
||||
model_configs?: ModelConfig[]
|
||||
is_default: boolean
|
||||
config: string | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
/** provider 是否进入负载均衡池(F-260614-04c)。false=仅配置存在,不参与主链路由/选池。老库默认 true。 */
|
||||
/** provider 是否进入负载均衡池(c)。false=仅配置存在,不参与主链路由/选池。老库默认 true。 */
|
||||
enabled?: boolean
|
||||
/** provider 在负载均衡池中的选择权重(0-100,F-260614-04c)。高权重优先被选为主;同权重近似轮询。老库默认 50。 */
|
||||
/** provider 在负载均衡池中的选择权重(0-100,c)。高权重优先被选为主;同权重近似轮询。老库默认 50。 */
|
||||
weight?: number
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ export type Capability = 'tool_use' | 'embedding' | 'code_gen'
|
||||
/** 维度 3 — 价格分级(成本)。serde snake_case 字面量。'free' 已删(B-260618-05 死档,预设/启发式从不赋值)。 */
|
||||
export type CostTier = 'low' | 'medium' | 'high'
|
||||
|
||||
/** 维度 4 — 智力分级。serde snake_case 字面量。CR-260618-11#3:与 CostTier 同,cost/intel 已从路由硬过滤(B-260618-03)及前端标签(UX-260618-04)去除,字段保留仅 DB 兼容,不再参与路由选模型。 */
|
||||
/** 维度 4 — 智力分级。serde snake_case 字面量。CR-260618-11#3:与 CostTier 同,cost/intel 已从路由硬过滤及前端标签去除,字段保留仅 DB 兼容,不再参与路由选模型。 */
|
||||
export type IntelligenceTier = 'lite' | 'standard' | 'plus' | 'ultra'
|
||||
|
||||
/** 探测来源(只读,由后端探测器填充)。serde snake_case 字面量。 */
|
||||
@@ -384,7 +384,7 @@ export interface ModelConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* AI 错误分类字面量集(B-260615-42)。
|
||||
* AI 错误分类字面量集。
|
||||
* 与后端 `commands::ai::ErrorType` 的 serde(rename_all = "snake_case") 严格对齐。
|
||||
* 前端消费方 switch 于此常量集做差异化提示(auth 引导填 key / network 提示连接 / 等)。
|
||||
*/
|
||||
@@ -458,7 +458,7 @@ export type AiChatEvent = ({
|
||||
} | {
|
||||
type: 'AiHeartbeat'
|
||||
} | {
|
||||
// F-260616-03: 达 max_iterations 暂停态(后端仍 generating=true),前端展示操作卡询问继续/停止
|
||||
// 达 max_iterations 暂停态(后端仍 generating=true),前端展示操作卡询问继续/停止
|
||||
type: 'AiMaxRoundsReached'
|
||||
} | {
|
||||
// F-260619-03 Phase B: 路径授权弹窗(LLM 想访问白名单外目录,后端挂起 loop 等用户决定)。
|
||||
@@ -480,7 +480,7 @@ export type AiChatEvent = ({
|
||||
// enum 写入口(替代旧 bool 轨 add),消费方不再回退 streaming/generating bool 判断。
|
||||
type: 'AiConvStateChanged'; conv_state: ConvState
|
||||
} | {
|
||||
// F-260616-07: 流式调用自动重试提示(前端可在错误气泡内显示「重试 n/m」)
|
||||
// 流式调用自动重试提示(前端可在错误气泡内显示「重试 n/m」)
|
||||
type: 'AiStreamRetry'; attempt: number; max_attempts: number
|
||||
} | {
|
||||
// F-15 上下文管理生命周期事件(原 useAiContext 独立监听器,现合入统一分发器)
|
||||
@@ -674,7 +674,7 @@ export interface AiToolCallInfo {
|
||||
result?: unknown
|
||||
/** 审批风险说明(AiApprovalRequired 时填充) */
|
||||
reason?: string
|
||||
/** AE-2025-03:write_file 行级 unified diff(旧文件 vs 新内容),审批卡即时预览。
|
||||
/** write_file 行级 unified diff(旧文件 vs 新内容),审批卡即时预览。
|
||||
* 旧文件不存在(新建)或非 write_file 为 undefined,前端回退显新 content。 */
|
||||
diff?: string
|
||||
/**
|
||||
@@ -729,7 +729,7 @@ export interface GoalEntry {
|
||||
status: 'active' | 'completed'
|
||||
}
|
||||
|
||||
/** 审批选择类型(F-260615-01: single=单选默认,multiple=多选) */
|
||||
/** 审批选择类型single=单选默认,multiple=多选) */
|
||||
export type ApprovalSelectType = 'single' | 'multiple'
|
||||
|
||||
/** 人工审批请求 */
|
||||
@@ -739,7 +739,7 @@ export interface HumanApprovalRequest {
|
||||
title: string
|
||||
description: string
|
||||
options: string[]
|
||||
/** F-260615-01: 缺省 single(向后兼容),multiple 时允许多选 */
|
||||
/** 缺省 single(向后兼容),multiple 时允许多选 */
|
||||
select_type?: ApprovalSelectType
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ export interface HumanApprovalResponse {
|
||||
execution_id: string
|
||||
node_id: string
|
||||
decision: string
|
||||
/** F-260615-01: 多选结果(single 时长度=1,multiple 时长度≥1) */
|
||||
/** 多选结果(single 时长度=1,multiple 时长度≥1) */
|
||||
decisions?: string[]
|
||||
comment?: string
|
||||
}
|
||||
@@ -758,7 +758,7 @@ export interface AiConversationDetail {
|
||||
id: ConvId
|
||||
title: string | null
|
||||
messages: string // JSON string of ChatMessage[]
|
||||
/** 生成中返回 true(后端 ai_conversation_switch 在 generating 时置),前端据此禁编辑(FR-C5) */
|
||||
/** 生成中返回 true(后端 ai_conversation_switch 在 generating 时置),前端据此禁编辑*/
|
||||
readonly?: boolean
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ export const workflowApi = {
|
||||
* 触发工作流执行,返回 execution_id。
|
||||
*
|
||||
* F-260616-06 阶段2(②-2): taskId/targetStatus 可选,同时传时工作流完成/失败联动推进任务。
|
||||
* B-260615-34:Tauri 2 IPC 不转 camelCase,snake_case 对齐后端 workflow.rs。
|
||||
* Tauri 2 IPC 不转 camelCase,snake_case 对齐后端 workflow.rs。
|
||||
*/
|
||||
run(
|
||||
name: string,
|
||||
@@ -46,8 +46,8 @@ export const workflowApi = {
|
||||
* 统一以 decisions 数组表达选择,按 select_type 判定单/多选:
|
||||
* - 单选:decision 取 decisions[0];
|
||||
* - 多选:decisions 透传全量,decision 取首项作占位(后端按 decisions 走)。
|
||||
* options 透传闭环后端校验(R-PD-5)。
|
||||
* B-260615-34:Tauri 2 IPC 不转 camelCase,snake_case 对齐后端 workflow.rs。
|
||||
* options 透传闭环后端校验。
|
||||
* Tauri 2 IPC 不转 camelCase,snake_case 对齐后端 workflow.rs。
|
||||
*/
|
||||
approveHumanApproval(params: {
|
||||
execution_id: string
|
||||
|
||||
Reference in New Issue
Block a user