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,13 +1,15 @@
/**
* 出货聊天:消息文本净化与动作指令解析(纯函数,无 Vue 依赖)。
*
* - sanitizeShippingConversationText:隐藏后台状态 token,统一 task_id 展示
* - extractShippingActionsDirective:解析 <!-- HXOPS_SHIPPING_ACTIONS --> 注释块
* - normalizeShippingHeaderForDisplay:表头列名展示(空格转 NBSP)
* features/chat/shipping/shippingText.ts
* 用途:发货聊天消息文本净化与 HTML 动作指令解析(纯函数,无 Vue 依赖)。
* 依赖:constants/shippingNoticeActions、types/shipping.types。
* 逻辑:ChatView 渲染前 sanitize;shippingMenu 解析 <!-- HXOPS_SHIPPING_ACTIONS --> 注释块。
*/
import { SHIPPING_INTERNAL_STATUS_TOKENS, SHIPPING_KNOWN_ACTION_ID_SET } from '@/constants/shippingNoticeActions';
import type { ShippingActionButton, ShippingActionVariant } from '../types/shipping.types';
/**
* 隐藏 Agent 回复中的内部状态 token,并将 task_id 统一为「任务编号」展示。
*/
export function sanitizeShippingConversationText(text: string, enabled: boolean): string {
if (!enabled) return text;
let result = String(text || '')
@@ -26,6 +28,9 @@ export function sanitizeShippingConversationText(text: string, enabled: boolean)
return result.replace(/\n{3,}/g, '\n\n').trim();
}
/**
* 解析消息中的 HXOPS_SHIPPING_ACTIONS HTML 注释,提取 action_buttons 并返回净化后文本。
*/
export function extractShippingActionsDirective(rawText: string): {
cleanedText: string;
buttons: ShippingActionButton[];
@@ -65,6 +70,9 @@ export function extractShippingActionsDirective(rawText: string): {
return { cleanedText: cleaned, buttons };
}
/**
* 库存表头列名展示规范化(空格转 NBSP,避免 Markdown 表格换行)。
*/
export function normalizeShippingHeaderForDisplay(raw: unknown): string {
const text = String(raw ?? '').replace(/\s+/g, ' ').trim();
return text.replace(/ /g, '\u00A0');