import React, { type ReactNode } from "react"; import { IMessage, RenderFunctionCall, ToolRenderKind, ChatStrategies } from "./"; export type ThoughtChainStatus = "pending" | "loading" | "success" | "error"; export interface XAdkThoughtChainProps { /** 是否显示外层可折叠 header(默认 false) */ collapsible?: boolean; /** 状态枚举,优先级高于 loading(默认 'success') */ status?: ThoughtChainStatus; /** 标准 className */ className?: string; /** 标准 style */ style?: React.CSSProperties; /** 默认展开状态,仅在 collapsible=true 时生效 */ defaultOpen?: boolean; /** @deprecated 使用 status='loading' 替代,保留向后兼容 */ loading?: boolean; title?: ReactNode; items: ThoughtChainItemType[]; showFnCallDetail?: boolean; onConfirm?: (fnCall: any, confirmed: boolean) => void; blink?: boolean; /** 自定义工具调用渲染函数,返回 null 则使用默认渲染 */ renderFunctionCall?: RenderFunctionCall; /** * 工具名 → 渲染类型的解析策略,默认使用 defaultToolKindResolver */ toolKindResolver?: (name: string | undefined) => ToolRenderKind; /** 聊天策略,可由 Provider preset 自动下发,也可在组件局部覆盖。 */ strategies?: ChatStrategies; } export interface TimelineItemProps { icon: React.ReactNode; title: React.ReactNode; children: React.ReactNode; collapsible?: boolean; defaultOpen?: boolean; blink?: boolean; } export interface ThoughtChainItemType { type: "tool" | "text"; key: string; content: string; title?: ReactNode; collapsible?: boolean; msg?: IMessage; /** item 级别状态 */ status?: ThoughtChainStatus; }