feat(file-check): 更新文件检核工具 API Key 配置及相关文档

This commit is contained in:
hugo committed 2026-06-17 22:29:15 +08:00
1 parent 634dee4b81
commit 55cf7ff734
74 files changed
+1525 -1182

No files matched your search

@@ -1,11 +1,13 @@
/**
* 出货聊天:任务编号提取(纯函数)。
*
* 从消息正文匹配 SHIPPING_TASK_ID_RE,或从侧栏会话标题模糊查找。
* features/chat/shipping/shippingTaskId.ts
* 用途:从消息或会话历史中识别发货任务编号(SN- 格式)。
* 依赖:constants/shipping.SHIPPING_TASK_ID_RE、chat.types。
* 逻辑:useChatShipping 切换任务/恢复会话时调用。
*/
import { SHIPPING_TASK_ID_RE } from '../constants/shipping';
import type { ChatSessionItem } from '../types/chat.types';
/** 从消息列表倒序查找最近出现的 SN- 任务编号。 */
export function findLatestShippingTaskId(msgs: Array<{ content?: string }>): string {
for (let i = msgs.length - 1; i >= 0; i -= 1) {
const match = String(msgs[i]?.content || '').match(SHIPPING_TASK_ID_RE);
@@ -14,6 +16,7 @@ export function findLatestShippingTaskId(msgs: Array<{ content?: string }>): str
return '';
}
/** 在侧栏历史中按标题模糊匹配含 taskId 的会话。 */
export function findHistorySessionForShippingTask(
history: ChatSessionItem[],
taskId: string,