@fv-ui/ai-chat 1.4.2 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -3
- package/dist/index.d.ts +323 -240
- package/dist/style.css +1 -1
- package/es/index.mjs +302 -25
- package/lib/index.js +301 -24
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -122,6 +122,23 @@ declare const zhCN: {
|
|
|
122
122
|
/** 追问建议 chips 区 aria 标签 */
|
|
123
123
|
followups: string;
|
|
124
124
|
loadingPhrases: string[];
|
|
125
|
+
/** 消息评价(点赞/点踩) */
|
|
126
|
+
feedback: {
|
|
127
|
+
like: string;
|
|
128
|
+
dislike: string;
|
|
129
|
+
/** 点踩弹层标题 */
|
|
130
|
+
dislikeTitle: string;
|
|
131
|
+
/** 点踩附言输入占位(选填 ≤500 字) */
|
|
132
|
+
dislikePlaceholder: string;
|
|
133
|
+
/** 附言提交按钮(不带原因直接点踩) */
|
|
134
|
+
submit: string;
|
|
135
|
+
/** 附言跳过按钮 */
|
|
136
|
+
skip: string;
|
|
137
|
+
/** 评价提交失败(钩子 reject/返回错误文案时 toast) */
|
|
138
|
+
failed: string;
|
|
139
|
+
/** 已取消评价 toast(CLEAR 成功后提示) */
|
|
140
|
+
cleared: string;
|
|
141
|
+
};
|
|
125
142
|
};
|
|
126
143
|
aiArtifacts: {
|
|
127
144
|
copy: string;
|
|
@@ -299,7 +316,7 @@ declare var __VLS_1$9: {};
|
|
|
299
316
|
declare var __VLS_10$2: {};
|
|
300
317
|
declare var __VLS_12$1: {};
|
|
301
318
|
declare var __VLS_14: {};
|
|
302
|
-
declare var __VLS_32
|
|
319
|
+
declare var __VLS_32: {};
|
|
303
320
|
type __VLS_Slots$e = {} & {
|
|
304
321
|
avatar?: (props: typeof __VLS_1$9) => any;
|
|
305
322
|
} & {
|
|
@@ -309,7 +326,7 @@ type __VLS_Slots$e = {} & {
|
|
|
309
326
|
} & {
|
|
310
327
|
content?: (props: typeof __VLS_14) => any;
|
|
311
328
|
} & {
|
|
312
|
-
footer?: (props: typeof __VLS_32
|
|
329
|
+
footer?: (props: typeof __VLS_32) => any;
|
|
313
330
|
};
|
|
314
331
|
declare const __VLS_base$e: vue.DefineComponent<__VLS_Props$f, {
|
|
315
332
|
interrupt: typeof interrupt;
|
|
@@ -541,10 +558,10 @@ declare function closeHeader$2(): void;
|
|
|
541
558
|
declare var __VLS_1$8: {};
|
|
542
559
|
declare var __VLS_3$3: {};
|
|
543
560
|
declare var __VLS_5: {};
|
|
544
|
-
declare var __VLS_52: {
|
|
561
|
+
declare var __VLS_52$1: {
|
|
545
562
|
keyword: string;
|
|
546
563
|
};
|
|
547
|
-
declare var __VLS_54
|
|
564
|
+
declare var __VLS_54: {};
|
|
548
565
|
declare var __VLS_56$1: {};
|
|
549
566
|
declare var __VLS_134: {};
|
|
550
567
|
type __VLS_Slots$c = {} & {
|
|
@@ -554,9 +571,9 @@ type __VLS_Slots$c = {} & {
|
|
|
554
571
|
} & {
|
|
555
572
|
prefix?: (props: typeof __VLS_5) => any;
|
|
556
573
|
} & {
|
|
557
|
-
trigger?: (props: typeof __VLS_52) => any;
|
|
574
|
+
trigger?: (props: typeof __VLS_52$1) => any;
|
|
558
575
|
} & {
|
|
559
|
-
'action-list'?: (props: typeof __VLS_54
|
|
576
|
+
'action-list'?: (props: typeof __VLS_54) => any;
|
|
560
577
|
} & {
|
|
561
578
|
'action-left'?: (props: typeof __VLS_56$1) => any;
|
|
562
579
|
} & {
|
|
@@ -1002,17 +1019,17 @@ type __VLS_Props$a = {
|
|
|
1002
1019
|
declare function toggle(): void;
|
|
1003
1020
|
declare var __VLS_1$6: {};
|
|
1004
1021
|
declare var __VLS_36: {};
|
|
1005
|
-
declare var __VLS_38
|
|
1006
|
-
declare var __VLS_51
|
|
1022
|
+
declare var __VLS_38: {};
|
|
1023
|
+
declare var __VLS_51: {};
|
|
1007
1024
|
declare var __VLS_53$1: {};
|
|
1008
1025
|
type __VLS_Slots$9 = {} & {
|
|
1009
1026
|
'status-icon'?: (props: typeof __VLS_1$6) => any;
|
|
1010
1027
|
} & {
|
|
1011
1028
|
label?: (props: typeof __VLS_36) => any;
|
|
1012
1029
|
} & {
|
|
1013
|
-
arrow?: (props: typeof __VLS_38
|
|
1030
|
+
arrow?: (props: typeof __VLS_38) => any;
|
|
1014
1031
|
} & {
|
|
1015
|
-
error?: (props: typeof __VLS_51
|
|
1032
|
+
error?: (props: typeof __VLS_51) => any;
|
|
1016
1033
|
} & {
|
|
1017
1034
|
content?: (props: typeof __VLS_53$1) => any;
|
|
1018
1035
|
};
|
|
@@ -1077,12 +1094,12 @@ type __VLS_Props$9 = {
|
|
|
1077
1094
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
1078
1095
|
locale?: LocaleInput;
|
|
1079
1096
|
};
|
|
1080
|
-
declare var __VLS_45
|
|
1097
|
+
declare var __VLS_45: {
|
|
1081
1098
|
item: ThoughtChainItem;
|
|
1082
1099
|
index: number;
|
|
1083
1100
|
};
|
|
1084
1101
|
type __VLS_Slots$8 = {} & {
|
|
1085
|
-
content?: (props: typeof __VLS_45
|
|
1102
|
+
content?: (props: typeof __VLS_45) => any;
|
|
1086
1103
|
};
|
|
1087
1104
|
declare const __VLS_base$8: vue.DefineComponent<__VLS_Props$9, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
1088
1105
|
typing: () => any;
|
|
@@ -1360,7 +1377,7 @@ declare var __VLS_3$1: {
|
|
|
1360
1377
|
item: ConversationItem;
|
|
1361
1378
|
active: boolean;
|
|
1362
1379
|
};
|
|
1363
|
-
declare var __VLS_31: {
|
|
1380
|
+
declare var __VLS_31$1: {
|
|
1364
1381
|
item: ConversationItem;
|
|
1365
1382
|
};
|
|
1366
1383
|
type __VLS_Slots$3 = {} & {
|
|
@@ -1368,7 +1385,7 @@ type __VLS_Slots$3 = {} & {
|
|
|
1368
1385
|
} & {
|
|
1369
1386
|
item?: (props: typeof __VLS_3$1) => any;
|
|
1370
1387
|
} & {
|
|
1371
|
-
menu?: (props: typeof __VLS_31) => any;
|
|
1388
|
+
menu?: (props: typeof __VLS_31$1) => any;
|
|
1372
1389
|
};
|
|
1373
1390
|
declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {
|
|
1374
1391
|
handleMenuCommand: typeof handleMenuCommand;
|
|
@@ -1568,6 +1585,15 @@ interface FvCommonMessage {
|
|
|
1568
1585
|
* try-catch 包裹,解析失败按 null 处理不渲染(见 parseSuggestions)
|
|
1569
1586
|
*/
|
|
1570
1587
|
suggestions?: string | null;
|
|
1588
|
+
/**
|
|
1589
|
+
* V58+ 消息评价(仅 assistant 最终回答行;未评价/旧数据恒 null,判空容错)。
|
|
1590
|
+
* LIKE 点赞 / DISLIKE 点踩;配套 feedbackComment(附言 ≤500 字)、feedbackTime
|
|
1591
|
+
* (评价落库时间)同款容错。消费方映射为 MessageNode.feedback 灌入展示,
|
|
1592
|
+
* 评价提交走独立端点(POST /message/feedback),不经本适配器
|
|
1593
|
+
*/
|
|
1594
|
+
feedback?: 'LIKE' | 'DISLIKE' | null;
|
|
1595
|
+
feedbackComment?: string | null;
|
|
1596
|
+
feedbackTime?: string | null;
|
|
1571
1597
|
status?: 'GENERATING' | 'SUCCESS' | 'FAILED' | 'INTERRUPTED' | null;
|
|
1572
1598
|
failReason?: string | null;
|
|
1573
1599
|
promptTokens?: number | null;
|
|
@@ -1655,6 +1681,18 @@ declare function createSSEParser(onEvent: (ev: SSEEvent) => void, options?: {
|
|
|
1655
1681
|
* core 其余模块(adapter/storage/sse)的类型在此汇聚再导出,
|
|
1656
1682
|
* 消费方 `import type { MessageNode, ChatAdapter, ... } from '@fv-ui/ai-chat'`。
|
|
1657
1683
|
*/
|
|
1684
|
+
/**
|
|
1685
|
+
* 消息评价(Fv 系 V58+ 消息反馈):assistant 最终回答行的点赞/点踩留底。
|
|
1686
|
+
* action 为 null 表示未评价(缺省等同未评价);comment 随每次评价整体覆盖
|
|
1687
|
+
* (CLEAR 时一并清空)。历史恢复由消费方从 FvCommonMessage.feedback/
|
|
1688
|
+
* feedbackComment 灌入;流式新生成的回答初始未评价
|
|
1689
|
+
*/
|
|
1690
|
+
interface MessageFeedback {
|
|
1691
|
+
/** 当前评价态;null=未评价 */
|
|
1692
|
+
action: 'LIKE' | 'DISLIKE' | null;
|
|
1693
|
+
/** 评价附言(点踩原因等,≤500 字;随评价整体覆盖,无则 undefined) */
|
|
1694
|
+
comment?: string;
|
|
1695
|
+
}
|
|
1658
1696
|
/** 消息角色 */
|
|
1659
1697
|
type MessageRole = 'user' | 'assistant';
|
|
1660
1698
|
/** 消息生命周期状态 */
|
|
@@ -1746,6 +1784,12 @@ interface MessageNode {
|
|
|
1746
1784
|
* (JSON 数组原文)解析灌入。空/缺省不渲染;展示端仅链尾消息渲染 chips
|
|
1747
1785
|
*/
|
|
1748
1786
|
suggestions?: string[];
|
|
1787
|
+
/**
|
|
1788
|
+
* 消息评价(Fv 系 V58+):点赞/点踩当前态与附言。历史恢复由消费方从
|
|
1789
|
+
* FvCommonMessage.feedback/feedbackComment 灌入;点击按钮经 feedbackHandler
|
|
1790
|
+
* 钩子上报,乐观更新失败回滚。仅 assistant 最终回答行有意义
|
|
1791
|
+
*/
|
|
1792
|
+
feedback?: MessageFeedback;
|
|
1749
1793
|
/** 中间轮工具调用列表(JSON 字符串或已展开数组;Fv 系 assistant 行 toolCalls 非空即中间轮) */
|
|
1750
1794
|
toolCalls?: string | ToolCallItem[];
|
|
1751
1795
|
/** 父节点 id,根消息为 null */
|
|
@@ -1791,6 +1835,188 @@ interface MessageTree {
|
|
|
1791
1835
|
fromJSON(s: string): void;
|
|
1792
1836
|
}
|
|
1793
1837
|
|
|
1838
|
+
/**
|
|
1839
|
+
* 消息评价提交钩子(AiChat 透传,消费方接后端端点)。返回 resolved 即成功;
|
|
1840
|
+
* 返回错误文案串/抛错均视为失败(乐观更新回滚,文案经 feedback-error 上抛)。
|
|
1841
|
+
* action=CLEAR 时后端忽略 comment(取消评价,附言一并清空)
|
|
1842
|
+
*/
|
|
1843
|
+
type FeedbackHandler = (message: MessageNode, action: 'LIKE' | 'DISLIKE' | 'CLEAR', comment?: string) => Promise<unknown> | unknown;
|
|
1844
|
+
/** 单条消息展示需要的分支元数据(由 AiMessages 计算注入) */
|
|
1845
|
+
interface AiMessageBranchInfo {
|
|
1846
|
+
/** 同层分支总数 */
|
|
1847
|
+
count: number;
|
|
1848
|
+
/** 当前分支序号(1 起) */
|
|
1849
|
+
index: number;
|
|
1850
|
+
}
|
|
1851
|
+
type __VLS_Props$3 = {
|
|
1852
|
+
/** 消息节点(树节点代理,流式期间 content/reasoning 增长驱动更新) */
|
|
1853
|
+
message: MessageNode;
|
|
1854
|
+
/** 同层分支元数据;缺省视为单分支(不渲染切换器) */
|
|
1855
|
+
branch?: AiMessageBranchInfo;
|
|
1856
|
+
/**
|
|
1857
|
+
* 是否当前链最后一条消息(由 AiMessages 按链位置判定注入)。
|
|
1858
|
+
* 追问建议 chips 仅链尾消息渲染——此前消息即使留有 suggestions 也不显示
|
|
1859
|
+
*/
|
|
1860
|
+
isLast?: boolean;
|
|
1861
|
+
/** 显示操作按钮(复制/重生成;仅 assistant) */
|
|
1862
|
+
showActions?: boolean;
|
|
1863
|
+
/** 显示分支切换器(branch.count > 1 时) */
|
|
1864
|
+
showBranchSwitch?: boolean;
|
|
1865
|
+
/** 显示用户头像(false 时用户消息不渲染头像块;助手侧不受影响;默认隐藏) */
|
|
1866
|
+
showUserAvatar?: boolean;
|
|
1867
|
+
/** 显示用户名称(false 时用户消息不渲染头部名称行;助手侧不受影响;默认隐藏) */
|
|
1868
|
+
showUserName?: boolean;
|
|
1869
|
+
/** 显示助手头像(false 时助手消息不渲染头像块;用户侧不受影响;默认显示) */
|
|
1870
|
+
showAssistantAvatar?: boolean;
|
|
1871
|
+
/** 显示助手名称(false 时助手消息不渲染头部名称行;用户侧不受影响;默认隐藏) */
|
|
1872
|
+
showAssistantName?: boolean;
|
|
1873
|
+
/** 用户头像图片 URL(空串回落内置图标;细分插槽可整体覆盖) */
|
|
1874
|
+
userAvatar?: string;
|
|
1875
|
+
/** 助手头像图片 URL(传入则完全覆盖不分状态;空串按状态回落内置 GIF:thinking=fvai-thinking.gif,done/error=fvai-idle.gif;细分插槽可整体覆盖) */
|
|
1876
|
+
assistantAvatar?: string;
|
|
1877
|
+
/** 助手头像缩放系数(默认 1 不缩放;亦可用 CSS 变量 --fv-msg-avatar-scale 覆盖,prop 优先) */
|
|
1878
|
+
assistantAvatarScale?: number;
|
|
1879
|
+
/** 头像圆形模式(默认 true:圆角 50%;false 回落默认圆角)。亦可用 CSS 变量
|
|
1880
|
+
* --fv-msg-avatar-radius 直接覆盖圆角取值,变量优先于本开关 */
|
|
1881
|
+
avatarCircle?: boolean;
|
|
1882
|
+
/** 用户名称(空串回落「你」;细分插槽可整体覆盖) */
|
|
1883
|
+
userName?: string;
|
|
1884
|
+
/** 助手名称(空串回落「Gizmo」;细分插槽可整体覆盖) */
|
|
1885
|
+
assistantName?: string;
|
|
1886
|
+
/** 正文出完自动收起思考链(默认开启):status 落 done 且正文打字机不再打字
|
|
1887
|
+
* (未启用打字机则落定即收;仍在播积压则播完即收)时折叠;error 不收(保留链供排查) */
|
|
1888
|
+
autoCollapse?: boolean;
|
|
1889
|
+
/** 打字机(透传 Typewriter;仅 assistant 流式期间生效,落定/历史消息整段渲染) */
|
|
1890
|
+
typing?: boolean | {
|
|
1891
|
+
step?: number;
|
|
1892
|
+
interval?: number;
|
|
1893
|
+
};
|
|
1894
|
+
/** 思考链长文案展开/收起开关(透传 ThoughtChain collapsible;默认关闭,超长 title 原样全量展示) */
|
|
1895
|
+
collapsible?: boolean;
|
|
1896
|
+
/** 显示工具步用时 description(透传 ThoughtChain showDuration;默认关闭) */
|
|
1897
|
+
showDuration?: boolean;
|
|
1898
|
+
/** 代码块「预览」触发语言(透传 Markdown/Typewriter;命中语言的代码块右上角注入按钮,
|
|
1899
|
+
* 点击行为由消费方事件委托实现,如 AiChat 打开 Artifacts 面板) */
|
|
1900
|
+
codeTriggerLangs?: string[];
|
|
1901
|
+
/** 显示消息时间(操作区按钮之后;默认 true)。时间源:message.createdTime
|
|
1902
|
+
* (Fv 系后端直灌,秒级/毫秒级时间戳或 ISO 字符串自动识别)优先,缺省回落
|
|
1903
|
+
* message.createdAt(ms 时间戳);两者皆无则不渲染。助手消息 SSE 生成中不显示,
|
|
1904
|
+
* 正文打完字(未启用打字机则落定)后才显示;user 消息恒显示 */
|
|
1905
|
+
showTime?: boolean;
|
|
1906
|
+
/** 消息时间自定义格式化(透传 message 与已归一为 ms 的时间戳;
|
|
1907
|
+
* 缺省自动识别 + 格式化为 'YYYY-MM-DD HH:mm',本机时区) */
|
|
1908
|
+
timeFormat?: (message: MessageNode, timestamp: number) => string;
|
|
1909
|
+
/**
|
|
1910
|
+
* 附件地址解析钩子(鉴权取流):附件 url 渲染前调用,返回可直渲地址
|
|
1911
|
+
* (如 JWT fetch 换 blob objectURL);缺省原样使用 url。消费方宜按 url 缓存
|
|
1912
|
+
*/
|
|
1913
|
+
resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
|
|
1914
|
+
/**
|
|
1915
|
+
* 消息评价提交钩子(仅 assistant 最终回答行渲染按钮;缺省不渲染)。
|
|
1916
|
+
* 点击 👍 直接提交;点击 👎 弹附言层(可跳过);再次点击当前态按钮发 CLEAR。
|
|
1917
|
+
* 乐观更新:先翻转本地 feedback 再调钩子,失败回滚并上抛 feedback-error
|
|
1918
|
+
*/
|
|
1919
|
+
feedbackHandler?: FeedbackHandler;
|
|
1920
|
+
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
1921
|
+
locale?: LocaleInput;
|
|
1922
|
+
};
|
|
1923
|
+
/** 展开/折叠本条消息的思考链(user 消息与无思考链消息调用无效) */
|
|
1924
|
+
declare function expandThoughtChain(): void;
|
|
1925
|
+
declare function collapseThoughtChain(): void;
|
|
1926
|
+
declare var __VLS_1$1: {
|
|
1927
|
+
message: MessageNode;
|
|
1928
|
+
};
|
|
1929
|
+
declare var __VLS_3: {};
|
|
1930
|
+
declare var __VLS_16$1: {
|
|
1931
|
+
status: "thinking" | "error" | "done";
|
|
1932
|
+
message: MessageNode;
|
|
1933
|
+
};
|
|
1934
|
+
declare var __VLS_18: {
|
|
1935
|
+
message: MessageNode;
|
|
1936
|
+
};
|
|
1937
|
+
declare var __VLS_20: {
|
|
1938
|
+
message: MessageNode;
|
|
1939
|
+
};
|
|
1940
|
+
declare var __VLS_22: {
|
|
1941
|
+
message: MessageNode;
|
|
1942
|
+
files: ChatFile[];
|
|
1943
|
+
};
|
|
1944
|
+
declare var __VLS_73: {
|
|
1945
|
+
message: MessageNode;
|
|
1946
|
+
};
|
|
1947
|
+
type __VLS_Slots$2 = {} & {
|
|
1948
|
+
'message-avatar'?: (props: typeof __VLS_1$1) => any;
|
|
1949
|
+
} & {
|
|
1950
|
+
'user-avatar'?: (props: typeof __VLS_3) => any;
|
|
1951
|
+
} & {
|
|
1952
|
+
'assistant-avatar'?: (props: typeof __VLS_16$1) => any;
|
|
1953
|
+
} & {
|
|
1954
|
+
'user-name'?: (props: typeof __VLS_18) => any;
|
|
1955
|
+
} & {
|
|
1956
|
+
'assistant-name'?: (props: typeof __VLS_20) => any;
|
|
1957
|
+
} & {
|
|
1958
|
+
'message-files'?: (props: typeof __VLS_22) => any;
|
|
1959
|
+
} & {
|
|
1960
|
+
'message-actions'?: (props: typeof __VLS_73) => any;
|
|
1961
|
+
};
|
|
1962
|
+
declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
1963
|
+
message: vue.ComputedRef<MessageNode>;
|
|
1964
|
+
expandThoughtChain: typeof expandThoughtChain;
|
|
1965
|
+
collapseThoughtChain: typeof collapseThoughtChain;
|
|
1966
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
1967
|
+
copy: (message: MessageNode) => any;
|
|
1968
|
+
regenerate: (message: MessageNode) => any;
|
|
1969
|
+
typing: () => any;
|
|
1970
|
+
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
1971
|
+
"followup-select": (item: string, message: MessageNode) => any;
|
|
1972
|
+
"file-click": (file: ChatFile, message: MessageNode) => any;
|
|
1973
|
+
"feedback-change": (message: MessageNode, action: "LIKE" | "DISLIKE" | "CLEAR") => any;
|
|
1974
|
+
"feedback-error": (message: string) => any;
|
|
1975
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
|
|
1976
|
+
onCopy?: ((message: MessageNode) => any) | undefined;
|
|
1977
|
+
onRegenerate?: ((message: MessageNode) => any) | undefined;
|
|
1978
|
+
onTyping?: (() => any) | undefined;
|
|
1979
|
+
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
1980
|
+
"onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
|
|
1981
|
+
"onFile-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
1982
|
+
"onFeedback-change"?: ((message: MessageNode, action: "LIKE" | "DISLIKE" | "CLEAR") => any) | undefined;
|
|
1983
|
+
"onFeedback-error"?: ((message: string) => any) | undefined;
|
|
1984
|
+
}>, {
|
|
1985
|
+
typing: boolean | {
|
|
1986
|
+
step?: number;
|
|
1987
|
+
interval?: number;
|
|
1988
|
+
};
|
|
1989
|
+
autoCollapse: boolean;
|
|
1990
|
+
collapsible: boolean;
|
|
1991
|
+
showDuration: boolean;
|
|
1992
|
+
branch: AiMessageBranchInfo;
|
|
1993
|
+
isLast: boolean;
|
|
1994
|
+
showActions: boolean;
|
|
1995
|
+
showBranchSwitch: boolean;
|
|
1996
|
+
showUserAvatar: boolean;
|
|
1997
|
+
showUserName: boolean;
|
|
1998
|
+
showAssistantAvatar: boolean;
|
|
1999
|
+
showAssistantName: boolean;
|
|
2000
|
+
userAvatar: string;
|
|
2001
|
+
assistantAvatar: string;
|
|
2002
|
+
assistantAvatarScale: number;
|
|
2003
|
+
avatarCircle: boolean;
|
|
2004
|
+
userName: string;
|
|
2005
|
+
assistantName: string;
|
|
2006
|
+
showTime: boolean;
|
|
2007
|
+
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
2008
|
+
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2009
|
+
feedbackHandler: FeedbackHandler;
|
|
2010
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
2011
|
+
declare const __VLS_export$3: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
|
|
2012
|
+
declare const _default$3: typeof __VLS_export$3;
|
|
2013
|
+
|
|
2014
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
2015
|
+
new (): {
|
|
2016
|
+
$slots: S;
|
|
2017
|
+
};
|
|
2018
|
+
};
|
|
2019
|
+
|
|
1794
2020
|
/** 建议项(Prompts PromptItem 同构:key 必填) */
|
|
1795
2021
|
interface AiMessagesSuggestion {
|
|
1796
2022
|
key: string | number;
|
|
@@ -1799,7 +2025,7 @@ interface AiMessagesSuggestion {
|
|
|
1799
2025
|
icon?: string | Component;
|
|
1800
2026
|
disabled?: boolean;
|
|
1801
2027
|
}
|
|
1802
|
-
type __VLS_Props$
|
|
2028
|
+
type __VLS_Props$2 = {
|
|
1803
2029
|
/** 当前链消息(根 → 焦点,时间正序) */
|
|
1804
2030
|
messages: MessageNode[];
|
|
1805
2031
|
/** 全量节点表(分支计算需查父节点 childrenIds) */
|
|
@@ -1869,6 +2095,11 @@ type __VLS_Props$3 = {
|
|
|
1869
2095
|
* 返回可直渲地址;缺省原样使用 url
|
|
1870
2096
|
*/
|
|
1871
2097
|
resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
|
|
2098
|
+
/**
|
|
2099
|
+
* 消息评价提交钩子(透传 AiMessage;仅 assistant 最终回答行渲染按钮,
|
|
2100
|
+
* 缺省不渲染)。点击 👍/👎 经此上抛消费方端点,乐观更新失败回滚
|
|
2101
|
+
*/
|
|
2102
|
+
feedbackHandler?: FeedbackHandler;
|
|
1872
2103
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
1873
2104
|
locale?: LocaleInput;
|
|
1874
2105
|
};
|
|
@@ -1884,61 +2115,61 @@ declare function scrollToTop(): void;
|
|
|
1884
2115
|
declare function scrollTo$1(options: ScrollToOptions | number): void;
|
|
1885
2116
|
declare function expandThoughtChains$1(): void;
|
|
1886
2117
|
declare function collapseThoughtChains$1(): void;
|
|
1887
|
-
declare var __VLS_1
|
|
2118
|
+
declare var __VLS_1: {};
|
|
1888
2119
|
declare var __VLS_10: {};
|
|
1889
2120
|
declare var __VLS_13: {};
|
|
1890
|
-
declare var __VLS_16
|
|
2121
|
+
declare var __VLS_16: {};
|
|
1891
2122
|
declare var __VLS_19: {};
|
|
1892
|
-
declare var
|
|
2123
|
+
declare var __VLS_44: {
|
|
1893
2124
|
message: MessageNode;
|
|
1894
2125
|
};
|
|
1895
|
-
declare var
|
|
2126
|
+
declare var __VLS_47: {
|
|
1896
2127
|
message: MessageNode;
|
|
1897
2128
|
};
|
|
1898
|
-
declare var
|
|
1899
|
-
declare var
|
|
2129
|
+
declare var __VLS_50: {};
|
|
2130
|
+
declare var __VLS_53: {
|
|
1900
2131
|
status: "thinking" | "error" | "done";
|
|
1901
2132
|
message: MessageNode;
|
|
1902
2133
|
};
|
|
1903
|
-
declare var
|
|
2134
|
+
declare var __VLS_56: {
|
|
1904
2135
|
message: MessageNode;
|
|
1905
2136
|
};
|
|
1906
|
-
declare var
|
|
2137
|
+
declare var __VLS_59: {
|
|
1907
2138
|
message: MessageNode;
|
|
1908
2139
|
};
|
|
1909
|
-
declare var
|
|
2140
|
+
declare var __VLS_67$1: {
|
|
1910
2141
|
scrollToBottom: typeof scrollToBottom;
|
|
1911
2142
|
awayFromBottom: boolean;
|
|
1912
2143
|
};
|
|
1913
|
-
declare var
|
|
1914
|
-
type __VLS_Slots$
|
|
1915
|
-
empty?: (props: typeof __VLS_1
|
|
2144
|
+
declare var __VLS_83: {};
|
|
2145
|
+
type __VLS_Slots$1 = {} & {
|
|
2146
|
+
empty?: (props: typeof __VLS_1) => any;
|
|
1916
2147
|
} & {
|
|
1917
2148
|
'welcome-name'?: (props: typeof __VLS_10) => any;
|
|
1918
2149
|
} & {
|
|
1919
2150
|
'welcome-description'?: (props: typeof __VLS_13) => any;
|
|
1920
2151
|
} & {
|
|
1921
|
-
'welcome-icon'?: (props: typeof __VLS_16
|
|
2152
|
+
'welcome-icon'?: (props: typeof __VLS_16) => any;
|
|
1922
2153
|
} & {
|
|
1923
2154
|
'welcome-suggestions'?: (props: typeof __VLS_19) => any;
|
|
1924
2155
|
} & {
|
|
1925
|
-
'message-avatar'?: (props: typeof
|
|
2156
|
+
'message-avatar'?: (props: typeof __VLS_44) => any;
|
|
1926
2157
|
} & {
|
|
1927
|
-
'message-actions'?: (props: typeof
|
|
2158
|
+
'message-actions'?: (props: typeof __VLS_47) => any;
|
|
1928
2159
|
} & {
|
|
1929
|
-
'user-avatar'?: (props: typeof
|
|
2160
|
+
'user-avatar'?: (props: typeof __VLS_50) => any;
|
|
1930
2161
|
} & {
|
|
1931
|
-
'assistant-avatar'?: (props: typeof
|
|
2162
|
+
'assistant-avatar'?: (props: typeof __VLS_53) => any;
|
|
1932
2163
|
} & {
|
|
1933
|
-
'user-name'?: (props: typeof
|
|
2164
|
+
'user-name'?: (props: typeof __VLS_56) => any;
|
|
1934
2165
|
} & {
|
|
1935
|
-
'assistant-name'?: (props: typeof
|
|
2166
|
+
'assistant-name'?: (props: typeof __VLS_59) => any;
|
|
1936
2167
|
} & {
|
|
1937
|
-
'scroll-button'?: (props: typeof
|
|
2168
|
+
'scroll-button'?: (props: typeof __VLS_67$1) => any;
|
|
1938
2169
|
} & {
|
|
1939
|
-
'scroll-button-icon'?: (props: typeof
|
|
2170
|
+
'scroll-button-icon'?: (props: typeof __VLS_83) => any;
|
|
1940
2171
|
};
|
|
1941
|
-
declare const __VLS_base$
|
|
2172
|
+
declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
1942
2173
|
scrollTo: typeof scrollTo$1;
|
|
1943
2174
|
scrollToBottom: typeof scrollToBottom;
|
|
1944
2175
|
scrollToTop: typeof scrollToTop;
|
|
@@ -1951,14 +2182,18 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
|
1951
2182
|
select: (item: AiMessagesSuggestion) => any;
|
|
1952
2183
|
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
1953
2184
|
"followup-select": (item: string, message: MessageNode) => any;
|
|
2185
|
+
"feedback-change": (message: MessageNode, action: "LIKE" | "DISLIKE" | "CLEAR") => any;
|
|
2186
|
+
"feedback-error": (message: string) => any;
|
|
1954
2187
|
"message-file-click": (file: ChatFile, message: MessageNode) => any;
|
|
1955
|
-
}, string, vue.PublicProps, Readonly<__VLS_Props$
|
|
2188
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
|
|
1956
2189
|
onScroll?: ((event: Event) => any) | undefined;
|
|
1957
2190
|
onCopy?: ((message: MessageNode) => any) | undefined;
|
|
1958
2191
|
onRegenerate?: ((message: MessageNode) => any) | undefined;
|
|
1959
2192
|
onSelect?: ((item: AiMessagesSuggestion) => any) | undefined;
|
|
1960
2193
|
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
1961
2194
|
"onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
|
|
2195
|
+
"onFeedback-change"?: ((message: MessageNode, action: "LIKE" | "DISLIKE" | "CLEAR") => any) | undefined;
|
|
2196
|
+
"onFeedback-error"?: ((message: string) => any) | undefined;
|
|
1962
2197
|
"onMessage-file-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
1963
2198
|
}>, {
|
|
1964
2199
|
description: string;
|
|
@@ -1988,16 +2223,17 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
|
1988
2223
|
showTime: boolean;
|
|
1989
2224
|
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
1990
2225
|
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2226
|
+
feedbackHandler: FeedbackHandler;
|
|
1991
2227
|
suggestionsTitle: string;
|
|
1992
2228
|
suggestionsWrap: boolean;
|
|
1993
2229
|
scrollThreshold: number;
|
|
1994
2230
|
showScrollButton: boolean;
|
|
1995
2231
|
scrollButtonThreshold: number;
|
|
1996
2232
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
1997
|
-
declare const __VLS_export$
|
|
1998
|
-
declare const _default$
|
|
2233
|
+
declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
2234
|
+
declare const _default$2: typeof __VLS_export$2;
|
|
1999
2235
|
|
|
2000
|
-
type __VLS_WithSlots$
|
|
2236
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
2001
2237
|
new (): {
|
|
2002
2238
|
$slots: S;
|
|
2003
2239
|
};
|
|
@@ -2027,7 +2263,7 @@ interface AiChatFeatures {
|
|
|
2027
2263
|
continueGenerate?: boolean;
|
|
2028
2264
|
fullscreenEditor?: boolean;
|
|
2029
2265
|
}
|
|
2030
|
-
type __VLS_Props$
|
|
2266
|
+
type __VLS_Props$1 = {
|
|
2031
2267
|
/** 默认模型(顶栏单选展示;未传 models 时作为单模型) */
|
|
2032
2268
|
model?: string;
|
|
2033
2269
|
/** 可选模型列表(multiple 选择器) */
|
|
@@ -2128,6 +2364,13 @@ type __VLS_Props$2 = {
|
|
|
2128
2364
|
* 消费方宜在钩子内按 url 缓存,避免同一附件重复取流
|
|
2129
2365
|
*/
|
|
2130
2366
|
resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
|
|
2367
|
+
/**
|
|
2368
|
+
* 消息评价提交钩子(透传 AiMessages→AiMessage;仅 assistant 最终回答行
|
|
2369
|
+
* 渲染 👍/👎,缺省不渲染)。消费方在此接后端评价端点(如 Fv 系
|
|
2370
|
+
* POST /message/feedback):resolved 即成功,返回错误文案串/抛错触发
|
|
2371
|
+
* feedback-error(乐观更新已回滚)。action=CLEAR 取消评价(comment 忽略)
|
|
2372
|
+
*/
|
|
2373
|
+
feedbackHandler?: FeedbackHandler;
|
|
2131
2374
|
/** 主题:light/dark/auto(注入 html dark class) */
|
|
2132
2375
|
theme?: 'light' | 'dark' | 'auto';
|
|
2133
2376
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象;解析后向整框后代注入(后代仍可用自身 locale prop 覆盖) */
|
|
@@ -2152,64 +2395,64 @@ declare function expandThoughtChains(): void;
|
|
|
2152
2395
|
declare function collapseThoughtChains(): void;
|
|
2153
2396
|
/** 消息区滚动到指定位置(透传 AiMessages scrollTo;options 同原生 ScrollToOptions) */
|
|
2154
2397
|
declare function scrollTo(options: ScrollToOptions | number): void;
|
|
2155
|
-
declare var
|
|
2398
|
+
declare var __VLS_31: {
|
|
2156
2399
|
message: MessageNode;
|
|
2157
2400
|
};
|
|
2158
|
-
declare var
|
|
2401
|
+
declare var __VLS_34: {
|
|
2159
2402
|
message: MessageNode;
|
|
2160
2403
|
};
|
|
2161
|
-
declare var
|
|
2162
|
-
declare var
|
|
2404
|
+
declare var __VLS_37: {};
|
|
2405
|
+
declare var __VLS_40: {
|
|
2163
2406
|
status: "thinking" | "error" | "done";
|
|
2164
2407
|
message: MessageNode;
|
|
2165
2408
|
};
|
|
2166
|
-
declare var
|
|
2409
|
+
declare var __VLS_43: {
|
|
2167
2410
|
message: MessageNode;
|
|
2168
2411
|
};
|
|
2169
|
-
declare var
|
|
2412
|
+
declare var __VLS_46: {
|
|
2170
2413
|
message: MessageNode;
|
|
2171
2414
|
};
|
|
2172
|
-
declare var
|
|
2173
|
-
declare var
|
|
2174
|
-
declare var
|
|
2175
|
-
declare var
|
|
2176
|
-
declare var
|
|
2177
|
-
declare var
|
|
2415
|
+
declare var __VLS_49: {};
|
|
2416
|
+
declare var __VLS_52: {};
|
|
2417
|
+
declare var __VLS_55: {};
|
|
2418
|
+
declare var __VLS_58: {};
|
|
2419
|
+
declare var __VLS_61: {};
|
|
2420
|
+
declare var __VLS_64: {
|
|
2178
2421
|
scrollToBottom: (smooth?: boolean) => void;
|
|
2179
2422
|
awayFromBottom: boolean;
|
|
2180
2423
|
};
|
|
2181
|
-
declare var
|
|
2182
|
-
declare var
|
|
2183
|
-
type __VLS_Slots
|
|
2184
|
-
'message-avatar'?: (props: typeof
|
|
2424
|
+
declare var __VLS_67: {};
|
|
2425
|
+
declare var __VLS_105: {};
|
|
2426
|
+
type __VLS_Slots = {} & {
|
|
2427
|
+
'message-avatar'?: (props: typeof __VLS_31) => any;
|
|
2185
2428
|
} & {
|
|
2186
|
-
'message-actions'?: (props: typeof
|
|
2429
|
+
'message-actions'?: (props: typeof __VLS_34) => any;
|
|
2187
2430
|
} & {
|
|
2188
|
-
'user-avatar'?: (props: typeof
|
|
2431
|
+
'user-avatar'?: (props: typeof __VLS_37) => any;
|
|
2189
2432
|
} & {
|
|
2190
|
-
'assistant-avatar'?: (props: typeof
|
|
2433
|
+
'assistant-avatar'?: (props: typeof __VLS_40) => any;
|
|
2191
2434
|
} & {
|
|
2192
|
-
'user-name'?: (props: typeof
|
|
2435
|
+
'user-name'?: (props: typeof __VLS_43) => any;
|
|
2193
2436
|
} & {
|
|
2194
|
-
'assistant-name'?: (props: typeof
|
|
2437
|
+
'assistant-name'?: (props: typeof __VLS_46) => any;
|
|
2195
2438
|
} & {
|
|
2196
|
-
empty?: (props: typeof
|
|
2439
|
+
empty?: (props: typeof __VLS_49) => any;
|
|
2197
2440
|
} & {
|
|
2198
|
-
'welcome-name'?: (props: typeof
|
|
2441
|
+
'welcome-name'?: (props: typeof __VLS_52) => any;
|
|
2199
2442
|
} & {
|
|
2200
|
-
'welcome-description'?: (props: typeof
|
|
2443
|
+
'welcome-description'?: (props: typeof __VLS_55) => any;
|
|
2201
2444
|
} & {
|
|
2202
|
-
'welcome-icon'?: (props: typeof
|
|
2445
|
+
'welcome-icon'?: (props: typeof __VLS_58) => any;
|
|
2203
2446
|
} & {
|
|
2204
|
-
'welcome-suggestions'?: (props: typeof
|
|
2447
|
+
'welcome-suggestions'?: (props: typeof __VLS_61) => any;
|
|
2205
2448
|
} & {
|
|
2206
|
-
'scroll-button'?: (props: typeof
|
|
2449
|
+
'scroll-button'?: (props: typeof __VLS_64) => any;
|
|
2207
2450
|
} & {
|
|
2208
|
-
'scroll-button-icon'?: (props: typeof
|
|
2451
|
+
'scroll-button-icon'?: (props: typeof __VLS_67) => any;
|
|
2209
2452
|
} & {
|
|
2210
|
-
'sender-prefix'?: (props: typeof
|
|
2453
|
+
'sender-prefix'?: (props: typeof __VLS_105) => any;
|
|
2211
2454
|
};
|
|
2212
|
-
declare const __VLS_base
|
|
2455
|
+
declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
|
|
2213
2456
|
sendMessage: typeof sendMessage;
|
|
2214
2457
|
stop: typeof stop;
|
|
2215
2458
|
regenerate: typeof regenerate;
|
|
@@ -2226,6 +2469,8 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2226
2469
|
error: (err: Error, message?: MessageNode | undefined) => any;
|
|
2227
2470
|
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
2228
2471
|
"followup-select": (item: string, message: MessageNode) => any;
|
|
2472
|
+
"feedback-change": (message: MessageNode, action: "LIKE" | "DISLIKE" | "CLEAR") => any;
|
|
2473
|
+
"feedback-error": (message: string) => any;
|
|
2229
2474
|
"message-file-click": (file: ChatFile, message: MessageNode) => any;
|
|
2230
2475
|
"update:messages": (value: MessageNode[]) => any;
|
|
2231
2476
|
"suggestion-select": (item: AiChatSuggestion) => any;
|
|
@@ -2239,12 +2484,14 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2239
2484
|
toolName: string;
|
|
2240
2485
|
status: "start" | "done";
|
|
2241
2486
|
}) => any;
|
|
2242
|
-
}, string, vue.PublicProps, Readonly<__VLS_Props$
|
|
2487
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
2243
2488
|
onScroll?: ((event: Event) => any) | undefined;
|
|
2244
2489
|
onSend?: ((text: string, files?: ChatFile[] | undefined) => any) | undefined;
|
|
2245
2490
|
onError?: ((err: Error, message?: MessageNode | undefined) => any) | undefined;
|
|
2246
2491
|
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
2247
2492
|
"onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
|
|
2493
|
+
"onFeedback-change"?: ((message: MessageNode, action: "LIKE" | "DISLIKE" | "CLEAR") => any) | undefined;
|
|
2494
|
+
"onFeedback-error"?: ((message: string) => any) | undefined;
|
|
2248
2495
|
"onMessage-file-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
2249
2496
|
"onUpdate:messages"?: ((value: MessageNode[]) => any) | undefined;
|
|
2250
2497
|
"onSuggestion-select"?: ((item: AiChatSuggestion) => any) | undefined;
|
|
@@ -2287,6 +2534,7 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2287
2534
|
showTime: boolean;
|
|
2288
2535
|
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
2289
2536
|
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2537
|
+
feedbackHandler: FeedbackHandler;
|
|
2290
2538
|
suggestionsWrap: boolean;
|
|
2291
2539
|
scrollThreshold: number;
|
|
2292
2540
|
showScrollButton: boolean;
|
|
@@ -2307,171 +2555,6 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2307
2555
|
uploadAttachment: (file: File, item: AttachmentItem) => Promise<Partial<AttachmentItem> | string | undefined | void> | Partial<AttachmentItem> | string | undefined | void;
|
|
2308
2556
|
theme: "light" | "dark" | "auto";
|
|
2309
2557
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
2310
|
-
declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
2311
|
-
declare const _default$2: typeof __VLS_export$2;
|
|
2312
|
-
|
|
2313
|
-
type __VLS_WithSlots$1<T, S> = T & {
|
|
2314
|
-
new (): {
|
|
2315
|
-
$slots: S;
|
|
2316
|
-
};
|
|
2317
|
-
};
|
|
2318
|
-
|
|
2319
|
-
/** 单条消息展示需要的分支元数据(由 AiMessages 计算注入) */
|
|
2320
|
-
interface AiMessageBranchInfo {
|
|
2321
|
-
/** 同层分支总数 */
|
|
2322
|
-
count: number;
|
|
2323
|
-
/** 当前分支序号(1 起) */
|
|
2324
|
-
index: number;
|
|
2325
|
-
}
|
|
2326
|
-
type __VLS_Props$1 = {
|
|
2327
|
-
/** 消息节点(树节点代理,流式期间 content/reasoning 增长驱动更新) */
|
|
2328
|
-
message: MessageNode;
|
|
2329
|
-
/** 同层分支元数据;缺省视为单分支(不渲染切换器) */
|
|
2330
|
-
branch?: AiMessageBranchInfo;
|
|
2331
|
-
/**
|
|
2332
|
-
* 是否当前链最后一条消息(由 AiMessages 按链位置判定注入)。
|
|
2333
|
-
* 追问建议 chips 仅链尾消息渲染——此前消息即使留有 suggestions 也不显示
|
|
2334
|
-
*/
|
|
2335
|
-
isLast?: boolean;
|
|
2336
|
-
/** 显示操作按钮(复制/重生成;仅 assistant) */
|
|
2337
|
-
showActions?: boolean;
|
|
2338
|
-
/** 显示分支切换器(branch.count > 1 时) */
|
|
2339
|
-
showBranchSwitch?: boolean;
|
|
2340
|
-
/** 显示用户头像(false 时用户消息不渲染头像块;助手侧不受影响;默认隐藏) */
|
|
2341
|
-
showUserAvatar?: boolean;
|
|
2342
|
-
/** 显示用户名称(false 时用户消息不渲染头部名称行;助手侧不受影响;默认隐藏) */
|
|
2343
|
-
showUserName?: boolean;
|
|
2344
|
-
/** 显示助手头像(false 时助手消息不渲染头像块;用户侧不受影响;默认显示) */
|
|
2345
|
-
showAssistantAvatar?: boolean;
|
|
2346
|
-
/** 显示助手名称(false 时助手消息不渲染头部名称行;用户侧不受影响;默认隐藏) */
|
|
2347
|
-
showAssistantName?: boolean;
|
|
2348
|
-
/** 用户头像图片 URL(空串回落内置图标;细分插槽可整体覆盖) */
|
|
2349
|
-
userAvatar?: string;
|
|
2350
|
-
/** 助手头像图片 URL(传入则完全覆盖不分状态;空串按状态回落内置 GIF:thinking=fvai-thinking.gif,done/error=fvai-idle.gif;细分插槽可整体覆盖) */
|
|
2351
|
-
assistantAvatar?: string;
|
|
2352
|
-
/** 助手头像缩放系数(默认 1 不缩放;亦可用 CSS 变量 --fv-msg-avatar-scale 覆盖,prop 优先) */
|
|
2353
|
-
assistantAvatarScale?: number;
|
|
2354
|
-
/** 头像圆形模式(默认 true:圆角 50%;false 回落默认圆角)。亦可用 CSS 变量
|
|
2355
|
-
* --fv-msg-avatar-radius 直接覆盖圆角取值,变量优先于本开关 */
|
|
2356
|
-
avatarCircle?: boolean;
|
|
2357
|
-
/** 用户名称(空串回落「你」;细分插槽可整体覆盖) */
|
|
2358
|
-
userName?: string;
|
|
2359
|
-
/** 助手名称(空串回落「Gizmo」;细分插槽可整体覆盖) */
|
|
2360
|
-
assistantName?: string;
|
|
2361
|
-
/** 正文出完自动收起思考链(默认开启):status 落 done 且正文打字机不再打字
|
|
2362
|
-
* (未启用打字机则落定即收;仍在播积压则播完即收)时折叠;error 不收(保留链供排查) */
|
|
2363
|
-
autoCollapse?: boolean;
|
|
2364
|
-
/** 打字机(透传 Typewriter;仅 assistant 流式期间生效,落定/历史消息整段渲染) */
|
|
2365
|
-
typing?: boolean | {
|
|
2366
|
-
step?: number;
|
|
2367
|
-
interval?: number;
|
|
2368
|
-
};
|
|
2369
|
-
/** 思考链长文案展开/收起开关(透传 ThoughtChain collapsible;默认关闭,超长 title 原样全量展示) */
|
|
2370
|
-
collapsible?: boolean;
|
|
2371
|
-
/** 显示工具步用时 description(透传 ThoughtChain showDuration;默认关闭) */
|
|
2372
|
-
showDuration?: boolean;
|
|
2373
|
-
/** 代码块「预览」触发语言(透传 Markdown/Typewriter;命中语言的代码块右上角注入按钮,
|
|
2374
|
-
* 点击行为由消费方事件委托实现,如 AiChat 打开 Artifacts 面板) */
|
|
2375
|
-
codeTriggerLangs?: string[];
|
|
2376
|
-
/** 显示消息时间(操作区按钮之后;默认 true)。时间源:message.createdTime
|
|
2377
|
-
* (Fv 系后端直灌,秒级/毫秒级时间戳或 ISO 字符串自动识别)优先,缺省回落
|
|
2378
|
-
* message.createdAt(ms 时间戳);两者皆无则不渲染。助手消息 SSE 生成中不显示,
|
|
2379
|
-
* 正文打完字(未启用打字机则落定)后才显示;user 消息恒显示 */
|
|
2380
|
-
showTime?: boolean;
|
|
2381
|
-
/** 消息时间自定义格式化(透传 message 与已归一为 ms 的时间戳;
|
|
2382
|
-
* 缺省自动识别 + 格式化为 'YYYY-MM-DD HH:mm',本机时区) */
|
|
2383
|
-
timeFormat?: (message: MessageNode, timestamp: number) => string;
|
|
2384
|
-
/**
|
|
2385
|
-
* 附件地址解析钩子(鉴权取流):附件 url 渲染前调用,返回可直渲地址
|
|
2386
|
-
* (如 JWT fetch 换 blob objectURL);缺省原样使用 url。消费方宜按 url 缓存
|
|
2387
|
-
*/
|
|
2388
|
-
resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
|
|
2389
|
-
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
2390
|
-
locale?: LocaleInput;
|
|
2391
|
-
};
|
|
2392
|
-
/** 展开/折叠本条消息的思考链(user 消息与无思考链消息调用无效) */
|
|
2393
|
-
declare function expandThoughtChain(): void;
|
|
2394
|
-
declare function collapseThoughtChain(): void;
|
|
2395
|
-
declare var __VLS_1: {
|
|
2396
|
-
message: MessageNode;
|
|
2397
|
-
};
|
|
2398
|
-
declare var __VLS_3: {};
|
|
2399
|
-
declare var __VLS_16: {
|
|
2400
|
-
status: "thinking" | "error" | "done";
|
|
2401
|
-
message: MessageNode;
|
|
2402
|
-
};
|
|
2403
|
-
declare var __VLS_18: {
|
|
2404
|
-
message: MessageNode;
|
|
2405
|
-
};
|
|
2406
|
-
declare var __VLS_20: {
|
|
2407
|
-
message: MessageNode;
|
|
2408
|
-
};
|
|
2409
|
-
declare var __VLS_22: {
|
|
2410
|
-
message: MessageNode;
|
|
2411
|
-
files: ChatFile[];
|
|
2412
|
-
};
|
|
2413
|
-
declare var __VLS_73: {
|
|
2414
|
-
message: MessageNode;
|
|
2415
|
-
};
|
|
2416
|
-
type __VLS_Slots = {} & {
|
|
2417
|
-
'message-avatar'?: (props: typeof __VLS_1) => any;
|
|
2418
|
-
} & {
|
|
2419
|
-
'user-avatar'?: (props: typeof __VLS_3) => any;
|
|
2420
|
-
} & {
|
|
2421
|
-
'assistant-avatar'?: (props: typeof __VLS_16) => any;
|
|
2422
|
-
} & {
|
|
2423
|
-
'user-name'?: (props: typeof __VLS_18) => any;
|
|
2424
|
-
} & {
|
|
2425
|
-
'assistant-name'?: (props: typeof __VLS_20) => any;
|
|
2426
|
-
} & {
|
|
2427
|
-
'message-files'?: (props: typeof __VLS_22) => any;
|
|
2428
|
-
} & {
|
|
2429
|
-
'message-actions'?: (props: typeof __VLS_73) => any;
|
|
2430
|
-
};
|
|
2431
|
-
declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
|
|
2432
|
-
message: vue.ComputedRef<MessageNode>;
|
|
2433
|
-
expandThoughtChain: typeof expandThoughtChain;
|
|
2434
|
-
collapseThoughtChain: typeof collapseThoughtChain;
|
|
2435
|
-
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
2436
|
-
copy: (message: MessageNode) => any;
|
|
2437
|
-
regenerate: (message: MessageNode) => any;
|
|
2438
|
-
typing: () => any;
|
|
2439
|
-
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
2440
|
-
"followup-select": (item: string, message: MessageNode) => any;
|
|
2441
|
-
"file-click": (file: ChatFile, message: MessageNode) => any;
|
|
2442
|
-
}, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
2443
|
-
onCopy?: ((message: MessageNode) => any) | undefined;
|
|
2444
|
-
onRegenerate?: ((message: MessageNode) => any) | undefined;
|
|
2445
|
-
onTyping?: (() => any) | undefined;
|
|
2446
|
-
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
2447
|
-
"onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
|
|
2448
|
-
"onFile-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
2449
|
-
}>, {
|
|
2450
|
-
typing: boolean | {
|
|
2451
|
-
step?: number;
|
|
2452
|
-
interval?: number;
|
|
2453
|
-
};
|
|
2454
|
-
autoCollapse: boolean;
|
|
2455
|
-
collapsible: boolean;
|
|
2456
|
-
showDuration: boolean;
|
|
2457
|
-
branch: AiMessageBranchInfo;
|
|
2458
|
-
isLast: boolean;
|
|
2459
|
-
showActions: boolean;
|
|
2460
|
-
showBranchSwitch: boolean;
|
|
2461
|
-
showUserAvatar: boolean;
|
|
2462
|
-
showUserName: boolean;
|
|
2463
|
-
showAssistantAvatar: boolean;
|
|
2464
|
-
showAssistantName: boolean;
|
|
2465
|
-
userAvatar: string;
|
|
2466
|
-
assistantAvatar: string;
|
|
2467
|
-
assistantAvatarScale: number;
|
|
2468
|
-
avatarCircle: boolean;
|
|
2469
|
-
userName: string;
|
|
2470
|
-
assistantName: string;
|
|
2471
|
-
showTime: boolean;
|
|
2472
|
-
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
2473
|
-
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2474
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
2475
2558
|
declare const __VLS_export$1: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
2476
2559
|
declare const _default$1: typeof __VLS_export$1;
|
|
2477
2560
|
|
|
@@ -2699,5 +2782,5 @@ declare function createMessageTree(initial?: {
|
|
|
2699
2782
|
|
|
2700
2783
|
declare const version = "0.1.0";
|
|
2701
2784
|
|
|
2702
|
-
export { _default as FvAiArtifacts, _default$
|
|
2703
|
-
export type { AdapterChatFile, AdapterChatMessage, AiArtifactItem, AiChatArtifactsOptions, AiChatFeatures, AiChatSuggestion, AiMessageBranchInfo, AiMessagesSuggestion, AttachmentItem, AttachmentUpload, BranchDirection, ChatAdapter, ChatAdapterHandlers, ChatAdapterRequest, ChatFile, DeepPartialLocale, FvCommonAdapterConfig, FvCommonMessage, FvCommonMessagePage, FvCommonSendBody, FvCommonSessionDetail, FvCommonSessionItem, FvCommonToolEvent, LocaleInput, LocaleMessages, MessageNode, MessageNodeInput, MessageRole, MessageStatus, MessageTree, MessageUsage, OpenAIAdapterConfig, QueueItem, RawUsage, SSEEvent, SSEParser, SendOptions, StorageAdapter, ToolCallItem, ToolStepItem, UseChatOptions, UseChatReturn, UseMessagesReturn, UseRecordReturn, UseSendReturn, UseXStreamReturn };
|
|
2785
|
+
export { _default as FvAiArtifacts, _default$1 as FvAiChat, _default$3 as FvAiMessage, _default$2 as FvAiMessages, _default$5 as FvAttachments, _default$f as FvBubble, _default$e as FvBubbleList, FvCommonAdapter, FvCommonError, _default$4 as FvConversations, _default$b as FvEditorSender, _default$6 as FvFilesCard, _default$h as FvMarkdown, _default$c as FvMentionSender, _default$7 as FvPrompts, _default$d as FvSender, _default$a as FvThinking, _default$9 as FvThoughtChain, _default$g as FvTypewriter, _default$8 as FvWelcome, OpenAIAdapter, XRequest, configureLocale, createLocalStorageAdapter, createMemoryAdapter, createMessageTree, createSSEParser, enUS, parseSuggestions, useChat, useMessages, useRecord, useSend, useXStream, version, zhCN };
|
|
2786
|
+
export type { AdapterChatFile, AdapterChatMessage, AiArtifactItem, AiChatArtifactsOptions, AiChatFeatures, AiChatSuggestion, AiMessageBranchInfo, AiMessagesSuggestion, AttachmentItem, AttachmentUpload, BranchDirection, ChatAdapter, ChatAdapterHandlers, ChatAdapterRequest, ChatFile, DeepPartialLocale, FeedbackHandler, FvCommonAdapterConfig, FvCommonMessage, FvCommonMessagePage, FvCommonSendBody, FvCommonSessionDetail, FvCommonSessionItem, FvCommonToolEvent, LocaleInput, LocaleMessages, MessageFeedback, MessageNode, MessageNodeInput, MessageRole, MessageStatus, MessageTree, MessageUsage, OpenAIAdapterConfig, QueueItem, RawUsage, SSEEvent, SSEParser, SendOptions, StorageAdapter, ToolCallItem, ToolStepItem, UseChatOptions, UseChatReturn, UseMessagesReturn, UseRecordReturn, UseSendReturn, UseXStreamReturn };
|