@fv-ui/ai-chat 1.4.1 → 1.5.0
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/dist/index.d.ts +326 -240
- package/dist/style.css +1 -1
- package/es/index.mjs +290 -28
- package/lib/index.js +289 -27
- 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;
|
|
@@ -1257,6 +1274,8 @@ type __VLS_Props$5 = {
|
|
|
1257
1274
|
beforeUpload?: (file: File) => boolean | Promise<boolean>;
|
|
1258
1275
|
/** 选文件即上传钩子(先传后发):成功回填附件描述,失败置 error 可重传;缺省不调 */
|
|
1259
1276
|
upload?: AttachmentUpload;
|
|
1277
|
+
/** 整体禁用(触发按钮不可点;生成中锁定输入区场景,单飞行闸语义) */
|
|
1278
|
+
disabled?: boolean;
|
|
1260
1279
|
/** 布局:inline(默认)按钮+列表+提示一行;triggerOnly 只渲染回形针按钮;listOnly 只渲染文件列表 */
|
|
1261
1280
|
layout?: 'inline' | 'triggerOnly' | 'listOnly';
|
|
1262
1281
|
/** 语言配置:内置语言名(如 'en-US')或部分文案对象(深合并覆盖) */
|
|
@@ -1295,6 +1314,7 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {
|
|
|
1295
1314
|
onUploaded?: ((item: AttachmentItem, result?: Partial<AttachmentItem> | undefined) => any) | undefined;
|
|
1296
1315
|
}>, {
|
|
1297
1316
|
locale: LocaleInput;
|
|
1317
|
+
disabled: boolean;
|
|
1298
1318
|
modelValue: object[];
|
|
1299
1319
|
layout: "inline" | "triggerOnly" | "listOnly";
|
|
1300
1320
|
accept: string;
|
|
@@ -1357,7 +1377,7 @@ declare var __VLS_3$1: {
|
|
|
1357
1377
|
item: ConversationItem;
|
|
1358
1378
|
active: boolean;
|
|
1359
1379
|
};
|
|
1360
|
-
declare var __VLS_31: {
|
|
1380
|
+
declare var __VLS_31$1: {
|
|
1361
1381
|
item: ConversationItem;
|
|
1362
1382
|
};
|
|
1363
1383
|
type __VLS_Slots$3 = {} & {
|
|
@@ -1365,7 +1385,7 @@ type __VLS_Slots$3 = {} & {
|
|
|
1365
1385
|
} & {
|
|
1366
1386
|
item?: (props: typeof __VLS_3$1) => any;
|
|
1367
1387
|
} & {
|
|
1368
|
-
menu?: (props: typeof __VLS_31) => any;
|
|
1388
|
+
menu?: (props: typeof __VLS_31$1) => any;
|
|
1369
1389
|
};
|
|
1370
1390
|
declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {
|
|
1371
1391
|
handleMenuCommand: typeof handleMenuCommand;
|
|
@@ -1565,6 +1585,15 @@ interface FvCommonMessage {
|
|
|
1565
1585
|
* try-catch 包裹,解析失败按 null 处理不渲染(见 parseSuggestions)
|
|
1566
1586
|
*/
|
|
1567
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;
|
|
1568
1597
|
status?: 'GENERATING' | 'SUCCESS' | 'FAILED' | 'INTERRUPTED' | null;
|
|
1569
1598
|
failReason?: string | null;
|
|
1570
1599
|
promptTokens?: number | null;
|
|
@@ -1652,6 +1681,18 @@ declare function createSSEParser(onEvent: (ev: SSEEvent) => void, options?: {
|
|
|
1652
1681
|
* core 其余模块(adapter/storage/sse)的类型在此汇聚再导出,
|
|
1653
1682
|
* 消费方 `import type { MessageNode, ChatAdapter, ... } from '@fv-ui/ai-chat'`。
|
|
1654
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
|
+
}
|
|
1655
1696
|
/** 消息角色 */
|
|
1656
1697
|
type MessageRole = 'user' | 'assistant';
|
|
1657
1698
|
/** 消息生命周期状态 */
|
|
@@ -1743,6 +1784,12 @@ interface MessageNode {
|
|
|
1743
1784
|
* (JSON 数组原文)解析灌入。空/缺省不渲染;展示端仅链尾消息渲染 chips
|
|
1744
1785
|
*/
|
|
1745
1786
|
suggestions?: string[];
|
|
1787
|
+
/**
|
|
1788
|
+
* 消息评价(Fv 系 V58+):点赞/点踩当前态与附言。历史恢复由消费方从
|
|
1789
|
+
* FvCommonMessage.feedback/feedbackComment 灌入;点击按钮经 feedbackHandler
|
|
1790
|
+
* 钩子上报,乐观更新失败回滚。仅 assistant 最终回答行有意义
|
|
1791
|
+
*/
|
|
1792
|
+
feedback?: MessageFeedback;
|
|
1746
1793
|
/** 中间轮工具调用列表(JSON 字符串或已展开数组;Fv 系 assistant 行 toolCalls 非空即中间轮) */
|
|
1747
1794
|
toolCalls?: string | ToolCallItem[];
|
|
1748
1795
|
/** 父节点 id,根消息为 null */
|
|
@@ -1788,6 +1835,188 @@ interface MessageTree {
|
|
|
1788
1835
|
fromJSON(s: string): void;
|
|
1789
1836
|
}
|
|
1790
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
|
+
|
|
1791
2020
|
/** 建议项(Prompts PromptItem 同构:key 必填) */
|
|
1792
2021
|
interface AiMessagesSuggestion {
|
|
1793
2022
|
key: string | number;
|
|
@@ -1796,7 +2025,7 @@ interface AiMessagesSuggestion {
|
|
|
1796
2025
|
icon?: string | Component;
|
|
1797
2026
|
disabled?: boolean;
|
|
1798
2027
|
}
|
|
1799
|
-
type __VLS_Props$
|
|
2028
|
+
type __VLS_Props$2 = {
|
|
1800
2029
|
/** 当前链消息(根 → 焦点,时间正序) */
|
|
1801
2030
|
messages: MessageNode[];
|
|
1802
2031
|
/** 全量节点表(分支计算需查父节点 childrenIds) */
|
|
@@ -1866,6 +2095,11 @@ type __VLS_Props$3 = {
|
|
|
1866
2095
|
* 返回可直渲地址;缺省原样使用 url
|
|
1867
2096
|
*/
|
|
1868
2097
|
resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
|
|
2098
|
+
/**
|
|
2099
|
+
* 消息评价提交钩子(透传 AiMessage;仅 assistant 最终回答行渲染按钮,
|
|
2100
|
+
* 缺省不渲染)。点击 👍/👎 经此上抛消费方端点,乐观更新失败回滚
|
|
2101
|
+
*/
|
|
2102
|
+
feedbackHandler?: FeedbackHandler;
|
|
1869
2103
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
1870
2104
|
locale?: LocaleInput;
|
|
1871
2105
|
};
|
|
@@ -1881,61 +2115,61 @@ declare function scrollToTop(): void;
|
|
|
1881
2115
|
declare function scrollTo$1(options: ScrollToOptions | number): void;
|
|
1882
2116
|
declare function expandThoughtChains$1(): void;
|
|
1883
2117
|
declare function collapseThoughtChains$1(): void;
|
|
1884
|
-
declare var __VLS_1
|
|
2118
|
+
declare var __VLS_1: {};
|
|
1885
2119
|
declare var __VLS_10: {};
|
|
1886
2120
|
declare var __VLS_13: {};
|
|
1887
|
-
declare var __VLS_16
|
|
2121
|
+
declare var __VLS_16: {};
|
|
1888
2122
|
declare var __VLS_19: {};
|
|
1889
|
-
declare var
|
|
2123
|
+
declare var __VLS_44: {
|
|
1890
2124
|
message: MessageNode;
|
|
1891
2125
|
};
|
|
1892
|
-
declare var
|
|
2126
|
+
declare var __VLS_47: {
|
|
1893
2127
|
message: MessageNode;
|
|
1894
2128
|
};
|
|
1895
|
-
declare var
|
|
1896
|
-
declare var
|
|
2129
|
+
declare var __VLS_50: {};
|
|
2130
|
+
declare var __VLS_53: {
|
|
1897
2131
|
status: "thinking" | "error" | "done";
|
|
1898
2132
|
message: MessageNode;
|
|
1899
2133
|
};
|
|
1900
|
-
declare var
|
|
2134
|
+
declare var __VLS_56: {
|
|
1901
2135
|
message: MessageNode;
|
|
1902
2136
|
};
|
|
1903
|
-
declare var
|
|
2137
|
+
declare var __VLS_59: {
|
|
1904
2138
|
message: MessageNode;
|
|
1905
2139
|
};
|
|
1906
|
-
declare var
|
|
2140
|
+
declare var __VLS_67$1: {
|
|
1907
2141
|
scrollToBottom: typeof scrollToBottom;
|
|
1908
2142
|
awayFromBottom: boolean;
|
|
1909
2143
|
};
|
|
1910
|
-
declare var
|
|
1911
|
-
type __VLS_Slots$
|
|
1912
|
-
empty?: (props: typeof __VLS_1
|
|
2144
|
+
declare var __VLS_83: {};
|
|
2145
|
+
type __VLS_Slots$1 = {} & {
|
|
2146
|
+
empty?: (props: typeof __VLS_1) => any;
|
|
1913
2147
|
} & {
|
|
1914
2148
|
'welcome-name'?: (props: typeof __VLS_10) => any;
|
|
1915
2149
|
} & {
|
|
1916
2150
|
'welcome-description'?: (props: typeof __VLS_13) => any;
|
|
1917
2151
|
} & {
|
|
1918
|
-
'welcome-icon'?: (props: typeof __VLS_16
|
|
2152
|
+
'welcome-icon'?: (props: typeof __VLS_16) => any;
|
|
1919
2153
|
} & {
|
|
1920
2154
|
'welcome-suggestions'?: (props: typeof __VLS_19) => any;
|
|
1921
2155
|
} & {
|
|
1922
|
-
'message-avatar'?: (props: typeof
|
|
2156
|
+
'message-avatar'?: (props: typeof __VLS_44) => any;
|
|
1923
2157
|
} & {
|
|
1924
|
-
'message-actions'?: (props: typeof
|
|
2158
|
+
'message-actions'?: (props: typeof __VLS_47) => any;
|
|
1925
2159
|
} & {
|
|
1926
|
-
'user-avatar'?: (props: typeof
|
|
2160
|
+
'user-avatar'?: (props: typeof __VLS_50) => any;
|
|
1927
2161
|
} & {
|
|
1928
|
-
'assistant-avatar'?: (props: typeof
|
|
2162
|
+
'assistant-avatar'?: (props: typeof __VLS_53) => any;
|
|
1929
2163
|
} & {
|
|
1930
|
-
'user-name'?: (props: typeof
|
|
2164
|
+
'user-name'?: (props: typeof __VLS_56) => any;
|
|
1931
2165
|
} & {
|
|
1932
|
-
'assistant-name'?: (props: typeof
|
|
2166
|
+
'assistant-name'?: (props: typeof __VLS_59) => any;
|
|
1933
2167
|
} & {
|
|
1934
|
-
'scroll-button'?: (props: typeof
|
|
2168
|
+
'scroll-button'?: (props: typeof __VLS_67$1) => any;
|
|
1935
2169
|
} & {
|
|
1936
|
-
'scroll-button-icon'?: (props: typeof
|
|
2170
|
+
'scroll-button-icon'?: (props: typeof __VLS_83) => any;
|
|
1937
2171
|
};
|
|
1938
|
-
declare const __VLS_base$
|
|
2172
|
+
declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
1939
2173
|
scrollTo: typeof scrollTo$1;
|
|
1940
2174
|
scrollToBottom: typeof scrollToBottom;
|
|
1941
2175
|
scrollToTop: typeof scrollToTop;
|
|
@@ -1948,14 +2182,18 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
|
1948
2182
|
select: (item: AiMessagesSuggestion) => any;
|
|
1949
2183
|
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
1950
2184
|
"followup-select": (item: string, message: MessageNode) => any;
|
|
2185
|
+
"feedback-change": (message: MessageNode, action: "LIKE" | "DISLIKE" | "CLEAR") => any;
|
|
2186
|
+
"feedback-error": (message: string) => any;
|
|
1951
2187
|
"message-file-click": (file: ChatFile, message: MessageNode) => any;
|
|
1952
|
-
}, string, vue.PublicProps, Readonly<__VLS_Props$
|
|
2188
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
|
|
1953
2189
|
onScroll?: ((event: Event) => any) | undefined;
|
|
1954
2190
|
onCopy?: ((message: MessageNode) => any) | undefined;
|
|
1955
2191
|
onRegenerate?: ((message: MessageNode) => any) | undefined;
|
|
1956
2192
|
onSelect?: ((item: AiMessagesSuggestion) => any) | undefined;
|
|
1957
2193
|
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
1958
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;
|
|
1959
2197
|
"onMessage-file-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
1960
2198
|
}>, {
|
|
1961
2199
|
description: string;
|
|
@@ -1985,16 +2223,17 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
|
1985
2223
|
showTime: boolean;
|
|
1986
2224
|
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
1987
2225
|
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2226
|
+
feedbackHandler: FeedbackHandler;
|
|
1988
2227
|
suggestionsTitle: string;
|
|
1989
2228
|
suggestionsWrap: boolean;
|
|
1990
2229
|
scrollThreshold: number;
|
|
1991
2230
|
showScrollButton: boolean;
|
|
1992
2231
|
scrollButtonThreshold: number;
|
|
1993
2232
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
1994
|
-
declare const __VLS_export$
|
|
1995
|
-
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;
|
|
1996
2235
|
|
|
1997
|
-
type __VLS_WithSlots$
|
|
2236
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
1998
2237
|
new (): {
|
|
1999
2238
|
$slots: S;
|
|
2000
2239
|
};
|
|
@@ -2024,7 +2263,7 @@ interface AiChatFeatures {
|
|
|
2024
2263
|
continueGenerate?: boolean;
|
|
2025
2264
|
fullscreenEditor?: boolean;
|
|
2026
2265
|
}
|
|
2027
|
-
type __VLS_Props$
|
|
2266
|
+
type __VLS_Props$1 = {
|
|
2028
2267
|
/** 默认模型(顶栏单选展示;未传 models 时作为单模型) */
|
|
2029
2268
|
model?: string;
|
|
2030
2269
|
/** 可选模型列表(multiple 选择器) */
|
|
@@ -2125,6 +2364,13 @@ type __VLS_Props$2 = {
|
|
|
2125
2364
|
* 消费方宜在钩子内按 url 缓存,避免同一附件重复取流
|
|
2126
2365
|
*/
|
|
2127
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;
|
|
2128
2374
|
/** 主题:light/dark/auto(注入 html dark class) */
|
|
2129
2375
|
theme?: 'light' | 'dark' | 'auto';
|
|
2130
2376
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象;解析后向整框后代注入(后代仍可用自身 locale prop 覆盖) */
|
|
@@ -2149,64 +2395,64 @@ declare function expandThoughtChains(): void;
|
|
|
2149
2395
|
declare function collapseThoughtChains(): void;
|
|
2150
2396
|
/** 消息区滚动到指定位置(透传 AiMessages scrollTo;options 同原生 ScrollToOptions) */
|
|
2151
2397
|
declare function scrollTo(options: ScrollToOptions | number): void;
|
|
2152
|
-
declare var
|
|
2398
|
+
declare var __VLS_31: {
|
|
2153
2399
|
message: MessageNode;
|
|
2154
2400
|
};
|
|
2155
|
-
declare var
|
|
2401
|
+
declare var __VLS_34: {
|
|
2156
2402
|
message: MessageNode;
|
|
2157
2403
|
};
|
|
2158
|
-
declare var
|
|
2159
|
-
declare var
|
|
2404
|
+
declare var __VLS_37: {};
|
|
2405
|
+
declare var __VLS_40: {
|
|
2160
2406
|
status: "thinking" | "error" | "done";
|
|
2161
2407
|
message: MessageNode;
|
|
2162
2408
|
};
|
|
2163
|
-
declare var
|
|
2409
|
+
declare var __VLS_43: {
|
|
2164
2410
|
message: MessageNode;
|
|
2165
2411
|
};
|
|
2166
|
-
declare var
|
|
2412
|
+
declare var __VLS_46: {
|
|
2167
2413
|
message: MessageNode;
|
|
2168
2414
|
};
|
|
2169
|
-
declare var
|
|
2170
|
-
declare var
|
|
2171
|
-
declare var
|
|
2172
|
-
declare var
|
|
2173
|
-
declare var
|
|
2174
|
-
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: {
|
|
2175
2421
|
scrollToBottom: (smooth?: boolean) => void;
|
|
2176
2422
|
awayFromBottom: boolean;
|
|
2177
2423
|
};
|
|
2178
|
-
declare var
|
|
2179
|
-
declare var
|
|
2180
|
-
type __VLS_Slots
|
|
2181
|
-
'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;
|
|
2182
2428
|
} & {
|
|
2183
|
-
'message-actions'?: (props: typeof
|
|
2429
|
+
'message-actions'?: (props: typeof __VLS_34) => any;
|
|
2184
2430
|
} & {
|
|
2185
|
-
'user-avatar'?: (props: typeof
|
|
2431
|
+
'user-avatar'?: (props: typeof __VLS_37) => any;
|
|
2186
2432
|
} & {
|
|
2187
|
-
'assistant-avatar'?: (props: typeof
|
|
2433
|
+
'assistant-avatar'?: (props: typeof __VLS_40) => any;
|
|
2188
2434
|
} & {
|
|
2189
|
-
'user-name'?: (props: typeof
|
|
2435
|
+
'user-name'?: (props: typeof __VLS_43) => any;
|
|
2190
2436
|
} & {
|
|
2191
|
-
'assistant-name'?: (props: typeof
|
|
2437
|
+
'assistant-name'?: (props: typeof __VLS_46) => any;
|
|
2192
2438
|
} & {
|
|
2193
|
-
empty?: (props: typeof
|
|
2439
|
+
empty?: (props: typeof __VLS_49) => any;
|
|
2194
2440
|
} & {
|
|
2195
|
-
'welcome-name'?: (props: typeof
|
|
2441
|
+
'welcome-name'?: (props: typeof __VLS_52) => any;
|
|
2196
2442
|
} & {
|
|
2197
|
-
'welcome-description'?: (props: typeof
|
|
2443
|
+
'welcome-description'?: (props: typeof __VLS_55) => any;
|
|
2198
2444
|
} & {
|
|
2199
|
-
'welcome-icon'?: (props: typeof
|
|
2445
|
+
'welcome-icon'?: (props: typeof __VLS_58) => any;
|
|
2200
2446
|
} & {
|
|
2201
|
-
'welcome-suggestions'?: (props: typeof
|
|
2447
|
+
'welcome-suggestions'?: (props: typeof __VLS_61) => any;
|
|
2202
2448
|
} & {
|
|
2203
|
-
'scroll-button'?: (props: typeof
|
|
2449
|
+
'scroll-button'?: (props: typeof __VLS_64) => any;
|
|
2204
2450
|
} & {
|
|
2205
|
-
'scroll-button-icon'?: (props: typeof
|
|
2451
|
+
'scroll-button-icon'?: (props: typeof __VLS_67) => any;
|
|
2206
2452
|
} & {
|
|
2207
|
-
'sender-prefix'?: (props: typeof
|
|
2453
|
+
'sender-prefix'?: (props: typeof __VLS_105) => any;
|
|
2208
2454
|
};
|
|
2209
|
-
declare const __VLS_base
|
|
2455
|
+
declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
|
|
2210
2456
|
sendMessage: typeof sendMessage;
|
|
2211
2457
|
stop: typeof stop;
|
|
2212
2458
|
regenerate: typeof regenerate;
|
|
@@ -2223,6 +2469,8 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2223
2469
|
error: (err: Error, message?: MessageNode | undefined) => any;
|
|
2224
2470
|
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
2225
2471
|
"followup-select": (item: string, message: MessageNode) => any;
|
|
2472
|
+
"feedback-change": (message: MessageNode, action: "LIKE" | "DISLIKE" | "CLEAR") => any;
|
|
2473
|
+
"feedback-error": (message: string) => any;
|
|
2226
2474
|
"message-file-click": (file: ChatFile, message: MessageNode) => any;
|
|
2227
2475
|
"update:messages": (value: MessageNode[]) => any;
|
|
2228
2476
|
"suggestion-select": (item: AiChatSuggestion) => any;
|
|
@@ -2236,12 +2484,14 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2236
2484
|
toolName: string;
|
|
2237
2485
|
status: "start" | "done";
|
|
2238
2486
|
}) => any;
|
|
2239
|
-
}, string, vue.PublicProps, Readonly<__VLS_Props$
|
|
2487
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
2240
2488
|
onScroll?: ((event: Event) => any) | undefined;
|
|
2241
2489
|
onSend?: ((text: string, files?: ChatFile[] | undefined) => any) | undefined;
|
|
2242
2490
|
onError?: ((err: Error, message?: MessageNode | undefined) => any) | undefined;
|
|
2243
2491
|
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
2244
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;
|
|
2245
2495
|
"onMessage-file-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
2246
2496
|
"onUpdate:messages"?: ((value: MessageNode[]) => any) | undefined;
|
|
2247
2497
|
"onSuggestion-select"?: ((item: AiChatSuggestion) => any) | undefined;
|
|
@@ -2284,6 +2534,7 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2284
2534
|
showTime: boolean;
|
|
2285
2535
|
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
2286
2536
|
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2537
|
+
feedbackHandler: FeedbackHandler;
|
|
2287
2538
|
suggestionsWrap: boolean;
|
|
2288
2539
|
scrollThreshold: number;
|
|
2289
2540
|
showScrollButton: boolean;
|
|
@@ -2304,171 +2555,6 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2304
2555
|
uploadAttachment: (file: File, item: AttachmentItem) => Promise<Partial<AttachmentItem> | string | undefined | void> | Partial<AttachmentItem> | string | undefined | void;
|
|
2305
2556
|
theme: "light" | "dark" | "auto";
|
|
2306
2557
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
2307
|
-
declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
2308
|
-
declare const _default$2: typeof __VLS_export$2;
|
|
2309
|
-
|
|
2310
|
-
type __VLS_WithSlots$1<T, S> = T & {
|
|
2311
|
-
new (): {
|
|
2312
|
-
$slots: S;
|
|
2313
|
-
};
|
|
2314
|
-
};
|
|
2315
|
-
|
|
2316
|
-
/** 单条消息展示需要的分支元数据(由 AiMessages 计算注入) */
|
|
2317
|
-
interface AiMessageBranchInfo {
|
|
2318
|
-
/** 同层分支总数 */
|
|
2319
|
-
count: number;
|
|
2320
|
-
/** 当前分支序号(1 起) */
|
|
2321
|
-
index: number;
|
|
2322
|
-
}
|
|
2323
|
-
type __VLS_Props$1 = {
|
|
2324
|
-
/** 消息节点(树节点代理,流式期间 content/reasoning 增长驱动更新) */
|
|
2325
|
-
message: MessageNode;
|
|
2326
|
-
/** 同层分支元数据;缺省视为单分支(不渲染切换器) */
|
|
2327
|
-
branch?: AiMessageBranchInfo;
|
|
2328
|
-
/**
|
|
2329
|
-
* 是否当前链最后一条消息(由 AiMessages 按链位置判定注入)。
|
|
2330
|
-
* 追问建议 chips 仅链尾消息渲染——此前消息即使留有 suggestions 也不显示
|
|
2331
|
-
*/
|
|
2332
|
-
isLast?: boolean;
|
|
2333
|
-
/** 显示操作按钮(复制/重生成;仅 assistant) */
|
|
2334
|
-
showActions?: boolean;
|
|
2335
|
-
/** 显示分支切换器(branch.count > 1 时) */
|
|
2336
|
-
showBranchSwitch?: boolean;
|
|
2337
|
-
/** 显示用户头像(false 时用户消息不渲染头像块;助手侧不受影响;默认隐藏) */
|
|
2338
|
-
showUserAvatar?: boolean;
|
|
2339
|
-
/** 显示用户名称(false 时用户消息不渲染头部名称行;助手侧不受影响;默认隐藏) */
|
|
2340
|
-
showUserName?: boolean;
|
|
2341
|
-
/** 显示助手头像(false 时助手消息不渲染头像块;用户侧不受影响;默认显示) */
|
|
2342
|
-
showAssistantAvatar?: boolean;
|
|
2343
|
-
/** 显示助手名称(false 时助手消息不渲染头部名称行;用户侧不受影响;默认隐藏) */
|
|
2344
|
-
showAssistantName?: boolean;
|
|
2345
|
-
/** 用户头像图片 URL(空串回落内置图标;细分插槽可整体覆盖) */
|
|
2346
|
-
userAvatar?: string;
|
|
2347
|
-
/** 助手头像图片 URL(传入则完全覆盖不分状态;空串按状态回落内置 GIF:thinking=fvai-thinking.gif,done/error=fvai-idle.gif;细分插槽可整体覆盖) */
|
|
2348
|
-
assistantAvatar?: string;
|
|
2349
|
-
/** 助手头像缩放系数(默认 1 不缩放;亦可用 CSS 变量 --fv-msg-avatar-scale 覆盖,prop 优先) */
|
|
2350
|
-
assistantAvatarScale?: number;
|
|
2351
|
-
/** 头像圆形模式(默认 true:圆角 50%;false 回落默认圆角)。亦可用 CSS 变量
|
|
2352
|
-
* --fv-msg-avatar-radius 直接覆盖圆角取值,变量优先于本开关 */
|
|
2353
|
-
avatarCircle?: boolean;
|
|
2354
|
-
/** 用户名称(空串回落「你」;细分插槽可整体覆盖) */
|
|
2355
|
-
userName?: string;
|
|
2356
|
-
/** 助手名称(空串回落「Gizmo」;细分插槽可整体覆盖) */
|
|
2357
|
-
assistantName?: string;
|
|
2358
|
-
/** 正文出完自动收起思考链(默认开启):status 落 done 且正文打字机不再打字
|
|
2359
|
-
* (未启用打字机则落定即收;仍在播积压则播完即收)时折叠;error 不收(保留链供排查) */
|
|
2360
|
-
autoCollapse?: boolean;
|
|
2361
|
-
/** 打字机(透传 Typewriter;仅 assistant 流式期间生效,落定/历史消息整段渲染) */
|
|
2362
|
-
typing?: boolean | {
|
|
2363
|
-
step?: number;
|
|
2364
|
-
interval?: number;
|
|
2365
|
-
};
|
|
2366
|
-
/** 思考链长文案展开/收起开关(透传 ThoughtChain collapsible;默认关闭,超长 title 原样全量展示) */
|
|
2367
|
-
collapsible?: boolean;
|
|
2368
|
-
/** 显示工具步用时 description(透传 ThoughtChain showDuration;默认关闭) */
|
|
2369
|
-
showDuration?: boolean;
|
|
2370
|
-
/** 代码块「预览」触发语言(透传 Markdown/Typewriter;命中语言的代码块右上角注入按钮,
|
|
2371
|
-
* 点击行为由消费方事件委托实现,如 AiChat 打开 Artifacts 面板) */
|
|
2372
|
-
codeTriggerLangs?: string[];
|
|
2373
|
-
/** 显示消息时间(操作区按钮之后;默认 true)。时间源:message.createdTime
|
|
2374
|
-
* (Fv 系后端直灌,秒级/毫秒级时间戳或 ISO 字符串自动识别)优先,缺省回落
|
|
2375
|
-
* message.createdAt(ms 时间戳);两者皆无则不渲染。助手消息 SSE 生成中不显示,
|
|
2376
|
-
* 正文打完字(未启用打字机则落定)后才显示;user 消息恒显示 */
|
|
2377
|
-
showTime?: boolean;
|
|
2378
|
-
/** 消息时间自定义格式化(透传 message 与已归一为 ms 的时间戳;
|
|
2379
|
-
* 缺省自动识别 + 格式化为 'YYYY-MM-DD HH:mm',本机时区) */
|
|
2380
|
-
timeFormat?: (message: MessageNode, timestamp: number) => string;
|
|
2381
|
-
/**
|
|
2382
|
-
* 附件地址解析钩子(鉴权取流):附件 url 渲染前调用,返回可直渲地址
|
|
2383
|
-
* (如 JWT fetch 换 blob objectURL);缺省原样使用 url。消费方宜按 url 缓存
|
|
2384
|
-
*/
|
|
2385
|
-
resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
|
|
2386
|
-
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
2387
|
-
locale?: LocaleInput;
|
|
2388
|
-
};
|
|
2389
|
-
/** 展开/折叠本条消息的思考链(user 消息与无思考链消息调用无效) */
|
|
2390
|
-
declare function expandThoughtChain(): void;
|
|
2391
|
-
declare function collapseThoughtChain(): void;
|
|
2392
|
-
declare var __VLS_1: {
|
|
2393
|
-
message: MessageNode;
|
|
2394
|
-
};
|
|
2395
|
-
declare var __VLS_3: {};
|
|
2396
|
-
declare var __VLS_16: {
|
|
2397
|
-
status: "thinking" | "error" | "done";
|
|
2398
|
-
message: MessageNode;
|
|
2399
|
-
};
|
|
2400
|
-
declare var __VLS_18: {
|
|
2401
|
-
message: MessageNode;
|
|
2402
|
-
};
|
|
2403
|
-
declare var __VLS_20: {
|
|
2404
|
-
message: MessageNode;
|
|
2405
|
-
};
|
|
2406
|
-
declare var __VLS_22: {
|
|
2407
|
-
message: MessageNode;
|
|
2408
|
-
files: ChatFile[];
|
|
2409
|
-
};
|
|
2410
|
-
declare var __VLS_73: {
|
|
2411
|
-
message: MessageNode;
|
|
2412
|
-
};
|
|
2413
|
-
type __VLS_Slots = {} & {
|
|
2414
|
-
'message-avatar'?: (props: typeof __VLS_1) => any;
|
|
2415
|
-
} & {
|
|
2416
|
-
'user-avatar'?: (props: typeof __VLS_3) => any;
|
|
2417
|
-
} & {
|
|
2418
|
-
'assistant-avatar'?: (props: typeof __VLS_16) => any;
|
|
2419
|
-
} & {
|
|
2420
|
-
'user-name'?: (props: typeof __VLS_18) => any;
|
|
2421
|
-
} & {
|
|
2422
|
-
'assistant-name'?: (props: typeof __VLS_20) => any;
|
|
2423
|
-
} & {
|
|
2424
|
-
'message-files'?: (props: typeof __VLS_22) => any;
|
|
2425
|
-
} & {
|
|
2426
|
-
'message-actions'?: (props: typeof __VLS_73) => any;
|
|
2427
|
-
};
|
|
2428
|
-
declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
|
|
2429
|
-
message: vue.ComputedRef<MessageNode>;
|
|
2430
|
-
expandThoughtChain: typeof expandThoughtChain;
|
|
2431
|
-
collapseThoughtChain: typeof collapseThoughtChain;
|
|
2432
|
-
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
2433
|
-
copy: (message: MessageNode) => any;
|
|
2434
|
-
regenerate: (message: MessageNode) => any;
|
|
2435
|
-
typing: () => any;
|
|
2436
|
-
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
2437
|
-
"followup-select": (item: string, message: MessageNode) => any;
|
|
2438
|
-
"file-click": (file: ChatFile, message: MessageNode) => any;
|
|
2439
|
-
}, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
2440
|
-
onCopy?: ((message: MessageNode) => any) | undefined;
|
|
2441
|
-
onRegenerate?: ((message: MessageNode) => any) | undefined;
|
|
2442
|
-
onTyping?: (() => any) | undefined;
|
|
2443
|
-
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
2444
|
-
"onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
|
|
2445
|
-
"onFile-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
2446
|
-
}>, {
|
|
2447
|
-
typing: boolean | {
|
|
2448
|
-
step?: number;
|
|
2449
|
-
interval?: number;
|
|
2450
|
-
};
|
|
2451
|
-
autoCollapse: boolean;
|
|
2452
|
-
collapsible: boolean;
|
|
2453
|
-
showDuration: boolean;
|
|
2454
|
-
branch: AiMessageBranchInfo;
|
|
2455
|
-
isLast: boolean;
|
|
2456
|
-
showActions: boolean;
|
|
2457
|
-
showBranchSwitch: boolean;
|
|
2458
|
-
showUserAvatar: boolean;
|
|
2459
|
-
showUserName: boolean;
|
|
2460
|
-
showAssistantAvatar: boolean;
|
|
2461
|
-
showAssistantName: boolean;
|
|
2462
|
-
userAvatar: string;
|
|
2463
|
-
assistantAvatar: string;
|
|
2464
|
-
assistantAvatarScale: number;
|
|
2465
|
-
avatarCircle: boolean;
|
|
2466
|
-
userName: string;
|
|
2467
|
-
assistantName: string;
|
|
2468
|
-
showTime: boolean;
|
|
2469
|
-
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
2470
|
-
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2471
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
2472
2558
|
declare const __VLS_export$1: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
2473
2559
|
declare const _default$1: typeof __VLS_export$1;
|
|
2474
2560
|
|
|
@@ -2696,5 +2782,5 @@ declare function createMessageTree(initial?: {
|
|
|
2696
2782
|
|
|
2697
2783
|
declare const version = "0.1.0";
|
|
2698
2784
|
|
|
2699
|
-
export { _default as FvAiArtifacts, _default$
|
|
2700
|
-
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 };
|