import { ThoughtNode, ThoughtBusinessType, ThoughtNodeStatus } from '../thought_chain_types'; /** * 历史 chain 原始节点类型(与后端对齐) */ export interface RawChainNode { businessType: ThoughtBusinessType; nodeStatus: ThoughtNodeStatus; content: string; type?: string; [key: string]: any; } /** * 统一的标题映射 */ export declare function getThoughtTitleByBusinessType(type: ThoughtBusinessType): string; /** * 根据业务类型和节点状态动态生成标题 * 节点状态:1.待执行 2.运行中 3.执行完成 4.执行失败 5.异常 */ export declare function getThoughtTitleByBusinessTypeAndStatus(type: ThoughtBusinessType, nodeStatus: ThoughtNodeStatus): string; /** * 将历史回复中的 chain 数组映射为 UI 使用的 ThoughtNode 列表 * 2025-12-19 新增: 支持 rtext 思维链 UI 升级。 * 2025-01-28 更新: 支持历史数据中的 reply.content 结构。 */ export declare function mapReplyChainToNodes(chain: RawChainNode[] | undefined | null): ThoughtNode[]; /** * SSE 消息在当前文件中只需要关心与思维链相关的字段。 * 这里使用 Pick 代替直接引入完整类型,避免与示例组件产生循环依赖。 */ export interface ThoughtSSEChunkMeta { businessType?: ThoughtBusinessType; nodeStatus?: ThoughtNodeStatus; reply?: { content?: string; type?: string; }; respTime?: number; chainRespTime?: number; } /** * 将实时 SSE chunk 合并到现有 ThoughtNode 列表中 * - 若尚未存在对应业务类型,则创建一个新的节点 * - 若已存在,则根据 nodeStatus 更新状态与内容(追加文本) */ export declare function mergeLiveChunkToNodes(nodes: ThoughtNode[], chunk: ThoughtSSEChunkMeta): ThoughtNode[];