@fv-ui/ai-chat 1.3.0 → 1.4.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/dist/index.d.ts +157 -70
- package/dist/style.css +1 -1
- package/es/index.mjs +225 -106
- package/lib/index.js +224 -105
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,8 @@ declare const zhCN: {
|
|
|
83
83
|
attachments: {
|
|
84
84
|
add: string;
|
|
85
85
|
retry: string;
|
|
86
|
+
/** 上传中状态角标文案(loading 态 files 卡片辅助提示) */
|
|
87
|
+
uploading: string;
|
|
86
88
|
};
|
|
87
89
|
filesCard: {
|
|
88
90
|
remove: string;
|
|
@@ -297,7 +299,7 @@ declare var __VLS_1$9: {};
|
|
|
297
299
|
declare var __VLS_10$2: {};
|
|
298
300
|
declare var __VLS_12$1: {};
|
|
299
301
|
declare var __VLS_14: {};
|
|
300
|
-
declare var __VLS_32: {};
|
|
302
|
+
declare var __VLS_32$1: {};
|
|
301
303
|
type __VLS_Slots$e = {} & {
|
|
302
304
|
avatar?: (props: typeof __VLS_1$9) => any;
|
|
303
305
|
} & {
|
|
@@ -307,7 +309,7 @@ type __VLS_Slots$e = {} & {
|
|
|
307
309
|
} & {
|
|
308
310
|
content?: (props: typeof __VLS_14) => any;
|
|
309
311
|
} & {
|
|
310
|
-
footer?: (props: typeof __VLS_32) => any;
|
|
312
|
+
footer?: (props: typeof __VLS_32$1) => any;
|
|
311
313
|
};
|
|
312
314
|
declare const __VLS_base$e: vue.DefineComponent<__VLS_Props$f, {
|
|
313
315
|
interrupt: typeof interrupt;
|
|
@@ -539,10 +541,10 @@ declare function closeHeader$2(): void;
|
|
|
539
541
|
declare var __VLS_1$8: {};
|
|
540
542
|
declare var __VLS_3$3: {};
|
|
541
543
|
declare var __VLS_5: {};
|
|
542
|
-
declare var __VLS_52
|
|
544
|
+
declare var __VLS_52: {
|
|
543
545
|
keyword: string;
|
|
544
546
|
};
|
|
545
|
-
declare var __VLS_54: {};
|
|
547
|
+
declare var __VLS_54$1: {};
|
|
546
548
|
declare var __VLS_56$1: {};
|
|
547
549
|
declare var __VLS_134: {};
|
|
548
550
|
type __VLS_Slots$c = {} & {
|
|
@@ -552,9 +554,9 @@ type __VLS_Slots$c = {} & {
|
|
|
552
554
|
} & {
|
|
553
555
|
prefix?: (props: typeof __VLS_5) => any;
|
|
554
556
|
} & {
|
|
555
|
-
trigger?: (props: typeof __VLS_52
|
|
557
|
+
trigger?: (props: typeof __VLS_52) => any;
|
|
556
558
|
} & {
|
|
557
|
-
'action-list'?: (props: typeof __VLS_54) => any;
|
|
559
|
+
'action-list'?: (props: typeof __VLS_54$1) => any;
|
|
558
560
|
} & {
|
|
559
561
|
'action-left'?: (props: typeof __VLS_56$1) => any;
|
|
560
562
|
} & {
|
|
@@ -893,7 +895,7 @@ declare var __VLS_19$2: {
|
|
|
893
895
|
nodeId: string;
|
|
894
896
|
};
|
|
895
897
|
declare var __VLS_21$2: {};
|
|
896
|
-
declare var __VLS_80
|
|
898
|
+
declare var __VLS_80: {};
|
|
897
899
|
type __VLS_Slots$a = {} & {
|
|
898
900
|
header?: (props: typeof __VLS_1$7) => any;
|
|
899
901
|
} & {
|
|
@@ -903,7 +905,7 @@ type __VLS_Slots$a = {} & {
|
|
|
903
905
|
} & {
|
|
904
906
|
'action-list'?: (props: typeof __VLS_21$2) => any;
|
|
905
907
|
} & {
|
|
906
|
-
footer?: (props: typeof __VLS_80
|
|
908
|
+
footer?: (props: typeof __VLS_80) => any;
|
|
907
909
|
};
|
|
908
910
|
declare const __VLS_base$a: vue.DefineComponent<__VLS_Props$b, {
|
|
909
911
|
getCurrentValue: typeof getCurrentValue;
|
|
@@ -1000,17 +1002,17 @@ type __VLS_Props$a = {
|
|
|
1000
1002
|
declare function toggle(): void;
|
|
1001
1003
|
declare var __VLS_1$6: {};
|
|
1002
1004
|
declare var __VLS_36: {};
|
|
1003
|
-
declare var __VLS_38: {};
|
|
1004
|
-
declare var __VLS_51: {};
|
|
1005
|
+
declare var __VLS_38$1: {};
|
|
1006
|
+
declare var __VLS_51$1: {};
|
|
1005
1007
|
declare var __VLS_53$1: {};
|
|
1006
1008
|
type __VLS_Slots$9 = {} & {
|
|
1007
1009
|
'status-icon'?: (props: typeof __VLS_1$6) => any;
|
|
1008
1010
|
} & {
|
|
1009
1011
|
label?: (props: typeof __VLS_36) => any;
|
|
1010
1012
|
} & {
|
|
1011
|
-
arrow?: (props: typeof __VLS_38) => any;
|
|
1013
|
+
arrow?: (props: typeof __VLS_38$1) => any;
|
|
1012
1014
|
} & {
|
|
1013
|
-
error?: (props: typeof __VLS_51) => any;
|
|
1015
|
+
error?: (props: typeof __VLS_51$1) => any;
|
|
1014
1016
|
} & {
|
|
1015
1017
|
content?: (props: typeof __VLS_53$1) => any;
|
|
1016
1018
|
};
|
|
@@ -1075,12 +1077,12 @@ type __VLS_Props$9 = {
|
|
|
1075
1077
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
1076
1078
|
locale?: LocaleInput;
|
|
1077
1079
|
};
|
|
1078
|
-
declare var __VLS_45: {
|
|
1080
|
+
declare var __VLS_45$1: {
|
|
1079
1081
|
item: ThoughtChainItem;
|
|
1080
1082
|
index: number;
|
|
1081
1083
|
};
|
|
1082
1084
|
type __VLS_Slots$8 = {} & {
|
|
1083
|
-
content?: (props: typeof __VLS_45) => any;
|
|
1085
|
+
content?: (props: typeof __VLS_45$1) => any;
|
|
1084
1086
|
};
|
|
1085
1087
|
declare const __VLS_base$8: vue.DefineComponent<__VLS_Props$9, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
1086
1088
|
typing: () => any;
|
|
@@ -1194,6 +1196,8 @@ type __VLS_Props$6 = {
|
|
|
1194
1196
|
status?: 'loading' | 'success' | 'error';
|
|
1195
1197
|
/** 图片缩略图尺寸(image 模式) */
|
|
1196
1198
|
imageSize?: string;
|
|
1199
|
+
/** 错误提示文案(status=error 时替代大小行展示,如上传失败原因) */
|
|
1200
|
+
errorText?: string;
|
|
1197
1201
|
/** 删除回调:右上删除按钮点击时调用 */
|
|
1198
1202
|
onDelete?: () => void;
|
|
1199
1203
|
/** 语言配置:内置语言名(如 'en-US')或部分文案对象(深合并覆盖) */
|
|
@@ -1211,6 +1215,7 @@ declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$6, {}, {}, {}, {}, v
|
|
|
1211
1215
|
status: "loading" | "success" | "error";
|
|
1212
1216
|
fileType: "image" | "file";
|
|
1213
1217
|
imageSize: string;
|
|
1218
|
+
errorText: string;
|
|
1214
1219
|
onDelete: () => void;
|
|
1215
1220
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
1216
1221
|
declare const __VLS_export$6: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
|
|
@@ -1233,6 +1238,12 @@ interface AttachmentItem {
|
|
|
1233
1238
|
raw?: File;
|
|
1234
1239
|
[key: string]: unknown;
|
|
1235
1240
|
}
|
|
1241
|
+
/**
|
|
1242
|
+
* 上传钩子:选文件即调(先传后发架构),成功返回附件描述回填 item
|
|
1243
|
+
* (远程信息合并进列表项,发送时随 @send 上抛);抛错/resolve 错误文案置 error
|
|
1244
|
+
* 可重传。缺省不调(纯本地待发列表,向后兼容)
|
|
1245
|
+
*/
|
|
1246
|
+
type AttachmentUpload = (file: File, item: AttachmentItem) => Promise<Partial<AttachmentItem> | undefined | void> | Partial<AttachmentItem> | undefined | void;
|
|
1236
1247
|
type __VLS_Props$5 = {
|
|
1237
1248
|
/** 附件列表(v-model) */
|
|
1238
1249
|
modelValue?: object[];
|
|
@@ -1244,12 +1255,14 @@ type __VLS_Props$5 = {
|
|
|
1244
1255
|
count?: number;
|
|
1245
1256
|
/** 上传前校验,返回 false(或 resolve false)拦截 */
|
|
1246
1257
|
beforeUpload?: (file: File) => boolean | Promise<boolean>;
|
|
1258
|
+
/** 选文件即上传钩子(先传后发):成功回填附件描述,失败置 error 可重传;缺省不调 */
|
|
1259
|
+
upload?: AttachmentUpload;
|
|
1247
1260
|
/** 布局:inline(默认)按钮+列表+提示一行;triggerOnly 只渲染回形针按钮;listOnly 只渲染文件列表 */
|
|
1248
1261
|
layout?: 'inline' | 'triggerOnly' | 'listOnly';
|
|
1249
1262
|
/** 语言配置:内置语言名(如 'en-US')或部分文案对象(深合并覆盖) */
|
|
1250
1263
|
locale?: LocaleInput;
|
|
1251
1264
|
};
|
|
1252
|
-
/** 重传:error
|
|
1265
|
+
/** 重传:error 项重新走 upload(无钩子时仅置回 loading 等外部接线) */
|
|
1253
1266
|
declare function retry(item: AttachmentItem): void;
|
|
1254
1267
|
declare function openSelect(): void;
|
|
1255
1268
|
declare var __VLS_12: {
|
|
@@ -1273,11 +1286,13 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {
|
|
|
1273
1286
|
"update:modelValue": (list: object[]) => any;
|
|
1274
1287
|
change: (list: object[]) => any;
|
|
1275
1288
|
exceed: (file: File) => any;
|
|
1289
|
+
uploaded: (item: AttachmentItem, result?: Partial<AttachmentItem> | undefined) => any;
|
|
1276
1290
|
}, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
|
|
1277
1291
|
onDelete?: ((item: object) => any) | undefined;
|
|
1278
1292
|
"onUpdate:modelValue"?: ((list: object[]) => any) | undefined;
|
|
1279
1293
|
onChange?: ((list: object[]) => any) | undefined;
|
|
1280
1294
|
onExceed?: ((file: File) => any) | undefined;
|
|
1295
|
+
onUploaded?: ((item: AttachmentItem, result?: Partial<AttachmentItem> | undefined) => any) | undefined;
|
|
1281
1296
|
}>, {
|
|
1282
1297
|
locale: LocaleInput;
|
|
1283
1298
|
modelValue: object[];
|
|
@@ -1286,6 +1301,7 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {
|
|
|
1286
1301
|
tip: string;
|
|
1287
1302
|
count: number;
|
|
1288
1303
|
beforeUpload: (file: File) => boolean | Promise<boolean>;
|
|
1304
|
+
upload: AttachmentUpload;
|
|
1289
1305
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
1290
1306
|
declare const __VLS_export$5: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
|
|
1291
1307
|
declare const _default$5: typeof __VLS_export$5;
|
|
@@ -1341,7 +1357,7 @@ declare var __VLS_3$1: {
|
|
|
1341
1357
|
item: ConversationItem;
|
|
1342
1358
|
active: boolean;
|
|
1343
1359
|
};
|
|
1344
|
-
declare var __VLS_31
|
|
1360
|
+
declare var __VLS_31: {
|
|
1345
1361
|
item: ConversationItem;
|
|
1346
1362
|
};
|
|
1347
1363
|
type __VLS_Slots$3 = {} & {
|
|
@@ -1349,7 +1365,7 @@ type __VLS_Slots$3 = {} & {
|
|
|
1349
1365
|
} & {
|
|
1350
1366
|
item?: (props: typeof __VLS_3$1) => any;
|
|
1351
1367
|
} & {
|
|
1352
|
-
menu?: (props: typeof __VLS_31
|
|
1368
|
+
menu?: (props: typeof __VLS_31) => any;
|
|
1353
1369
|
};
|
|
1354
1370
|
declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {
|
|
1355
1371
|
handleMenuCommand: typeof handleMenuCommand;
|
|
@@ -1391,18 +1407,29 @@ type __VLS_WithSlots$3<T, S> = T & {
|
|
|
1391
1407
|
};
|
|
1392
1408
|
};
|
|
1393
1409
|
|
|
1410
|
+
/**
|
|
1411
|
+
* adapter 层透传的附件描述(结构兼容 types.ChatFile:消费方 ChatFile[] 可直传)。
|
|
1412
|
+
* 先传后发架构下 id 即消费方上传端点返回的附件标识,由 adapter 拼进 send 入参
|
|
1413
|
+
*/
|
|
1414
|
+
interface AdapterChatFile {
|
|
1415
|
+
/** 附件标识(先传后发场景为服务端附件 id) */
|
|
1416
|
+
id: string;
|
|
1417
|
+
name?: string;
|
|
1418
|
+
url?: string;
|
|
1419
|
+
type?: 'image' | 'file';
|
|
1420
|
+
size?: number;
|
|
1421
|
+
}
|
|
1394
1422
|
/** adapter 层透传的 OpenAI 风格消息 */
|
|
1395
1423
|
interface AdapterChatMessage {
|
|
1396
1424
|
role: 'user' | 'assistant' | 'system' | string;
|
|
1397
1425
|
content: string;
|
|
1426
|
+
/** 本条消息携带的附件(user 行;缺省无附件) */
|
|
1427
|
+
files?: AdapterChatFile[];
|
|
1398
1428
|
}
|
|
1399
1429
|
/** 发送请求体 */
|
|
1400
1430
|
interface ChatAdapterRequest {
|
|
1401
1431
|
/** 对话消息(时间正序) */
|
|
1402
|
-
messages: Array<
|
|
1403
|
-
role: string;
|
|
1404
|
-
content: string;
|
|
1405
|
-
}>;
|
|
1432
|
+
messages: Array<AdapterChatMessage>;
|
|
1406
1433
|
/** 覆盖配置中的模型 */
|
|
1407
1434
|
model?: string;
|
|
1408
1435
|
/** 是否流式,默认 true */
|
|
@@ -1507,6 +1534,22 @@ interface FvCommonMessage {
|
|
|
1507
1534
|
seq: number;
|
|
1508
1535
|
role: 'user' | 'assistant' | 'tool';
|
|
1509
1536
|
content: string | null;
|
|
1537
|
+
/**
|
|
1538
|
+
* V1.1+ 消息附件(仅 user 行非 null;旧数据/无附件恒 null,判空容错)。
|
|
1539
|
+
* 元素与上传端点出参同构(AiChatAttachmentDTO:id/originalName/type/suffix/
|
|
1540
|
+
* sizeBytes/downloadUrl),但**不含 createdTime**(快照 JSON 无该键,勿依赖)。
|
|
1541
|
+
* 消费方映射为 MessageNode.files 渲染 chips(downloadUrl 需鉴权取流时配
|
|
1542
|
+
* AiChat 的 resolveFileUrl 钩子)
|
|
1543
|
+
*/
|
|
1544
|
+
attachments?: Array<{
|
|
1545
|
+
id: string;
|
|
1546
|
+
originalName: string;
|
|
1547
|
+
type: 'IMAGE' | 'DOCUMENT' | string;
|
|
1548
|
+
suffix?: string;
|
|
1549
|
+
sizeBytes?: number;
|
|
1550
|
+
downloadUrl?: string;
|
|
1551
|
+
[k: string]: unknown;
|
|
1552
|
+
}> | null;
|
|
1510
1553
|
/**
|
|
1511
1554
|
* V57 思考留底(仅 assistant 最终行;null=GENERATING 未回写/user/tool 行恒 null,
|
|
1512
1555
|
* 空串=该轮无思考)——判空须用 !!r && r.length > 0,勿用 != null
|
|
@@ -1634,13 +1677,17 @@ interface MessageUsage {
|
|
|
1634
1677
|
}
|
|
1635
1678
|
/** 消息附件文件描述(序列化安全:只含可 JSON 化字段,不含 File 原始对象) */
|
|
1636
1679
|
interface ChatFile {
|
|
1637
|
-
/** 附件唯一标识 */
|
|
1680
|
+
/** 附件唯一标识(先传后发架构下为服务端附件 id) */
|
|
1638
1681
|
id: string;
|
|
1639
1682
|
/** 文件名 */
|
|
1640
1683
|
name: string;
|
|
1641
1684
|
/** 体积(字节) */
|
|
1642
1685
|
size?: number;
|
|
1643
|
-
/**
|
|
1686
|
+
/**
|
|
1687
|
+
* 预览/下载地址(data URL、本地 objectURL 或远程地址)。
|
|
1688
|
+
* 远程地址需鉴权取流时经 AiChat 的 resolveFileUrl 换可渲染地址,
|
|
1689
|
+
* 此时本字段存原始远程地址(供解析函数取用)
|
|
1690
|
+
*/
|
|
1644
1691
|
url?: string;
|
|
1645
1692
|
/** 附件类别,缺省按 'file' 处理 */
|
|
1646
1693
|
type?: 'image' | 'file';
|
|
@@ -1814,6 +1861,11 @@ type __VLS_Props$3 = {
|
|
|
1814
1861
|
showTime?: boolean;
|
|
1815
1862
|
/** 消息时间自定义格式化(透传 AiMessage) */
|
|
1816
1863
|
timeFormat?: (message: MessageNode, timestamp: number) => string;
|
|
1864
|
+
/**
|
|
1865
|
+
* 附件地址解析钩子(鉴权取流;透传 AiMessage):消息附件 url 渲染前调用,
|
|
1866
|
+
* 返回可直渲地址;缺省原样使用 url
|
|
1867
|
+
*/
|
|
1868
|
+
resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
|
|
1817
1869
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
1818
1870
|
locale?: LocaleInput;
|
|
1819
1871
|
};
|
|
@@ -1834,28 +1886,28 @@ declare var __VLS_10: {};
|
|
|
1834
1886
|
declare var __VLS_13: {};
|
|
1835
1887
|
declare var __VLS_16$1: {};
|
|
1836
1888
|
declare var __VLS_19: {};
|
|
1837
|
-
declare var
|
|
1889
|
+
declare var __VLS_42: {
|
|
1838
1890
|
message: MessageNode;
|
|
1839
1891
|
};
|
|
1840
|
-
declare var
|
|
1892
|
+
declare var __VLS_45: {
|
|
1841
1893
|
message: MessageNode;
|
|
1842
1894
|
};
|
|
1843
|
-
declare var
|
|
1844
|
-
declare var
|
|
1895
|
+
declare var __VLS_48: {};
|
|
1896
|
+
declare var __VLS_51: {
|
|
1845
1897
|
status: "thinking" | "error" | "done";
|
|
1846
1898
|
message: MessageNode;
|
|
1847
1899
|
};
|
|
1848
|
-
declare var
|
|
1900
|
+
declare var __VLS_54: {
|
|
1849
1901
|
message: MessageNode;
|
|
1850
1902
|
};
|
|
1851
|
-
declare var
|
|
1903
|
+
declare var __VLS_57: {
|
|
1852
1904
|
message: MessageNode;
|
|
1853
1905
|
};
|
|
1854
|
-
declare var
|
|
1906
|
+
declare var __VLS_65$1: {
|
|
1855
1907
|
scrollToBottom: typeof scrollToBottom;
|
|
1856
1908
|
awayFromBottom: boolean;
|
|
1857
1909
|
};
|
|
1858
|
-
declare var
|
|
1910
|
+
declare var __VLS_81: {};
|
|
1859
1911
|
type __VLS_Slots$2 = {} & {
|
|
1860
1912
|
empty?: (props: typeof __VLS_1$1) => any;
|
|
1861
1913
|
} & {
|
|
@@ -1867,21 +1919,21 @@ type __VLS_Slots$2 = {} & {
|
|
|
1867
1919
|
} & {
|
|
1868
1920
|
'welcome-suggestions'?: (props: typeof __VLS_19) => any;
|
|
1869
1921
|
} & {
|
|
1870
|
-
'message-avatar'?: (props: typeof
|
|
1922
|
+
'message-avatar'?: (props: typeof __VLS_42) => any;
|
|
1871
1923
|
} & {
|
|
1872
|
-
'message-actions'?: (props: typeof
|
|
1924
|
+
'message-actions'?: (props: typeof __VLS_45) => any;
|
|
1873
1925
|
} & {
|
|
1874
|
-
'user-avatar'?: (props: typeof
|
|
1926
|
+
'user-avatar'?: (props: typeof __VLS_48) => any;
|
|
1875
1927
|
} & {
|
|
1876
|
-
'assistant-avatar'?: (props: typeof
|
|
1928
|
+
'assistant-avatar'?: (props: typeof __VLS_51) => any;
|
|
1877
1929
|
} & {
|
|
1878
|
-
'user-name'?: (props: typeof
|
|
1930
|
+
'user-name'?: (props: typeof __VLS_54) => any;
|
|
1879
1931
|
} & {
|
|
1880
|
-
'assistant-name'?: (props: typeof
|
|
1932
|
+
'assistant-name'?: (props: typeof __VLS_57) => any;
|
|
1881
1933
|
} & {
|
|
1882
|
-
'scroll-button'?: (props: typeof
|
|
1934
|
+
'scroll-button'?: (props: typeof __VLS_65$1) => any;
|
|
1883
1935
|
} & {
|
|
1884
|
-
'scroll-button-icon'?: (props: typeof
|
|
1936
|
+
'scroll-button-icon'?: (props: typeof __VLS_81) => any;
|
|
1885
1937
|
};
|
|
1886
1938
|
declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
1887
1939
|
scrollTo: typeof scrollTo$1;
|
|
@@ -1896,6 +1948,7 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
|
1896
1948
|
select: (item: AiMessagesSuggestion) => any;
|
|
1897
1949
|
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
1898
1950
|
"followup-select": (item: string, message: MessageNode) => any;
|
|
1951
|
+
"message-file-click": (file: ChatFile, message: MessageNode) => any;
|
|
1899
1952
|
}, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
|
|
1900
1953
|
onScroll?: ((event: Event) => any) | undefined;
|
|
1901
1954
|
onCopy?: ((message: MessageNode) => any) | undefined;
|
|
@@ -1903,6 +1956,7 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
|
1903
1956
|
onSelect?: ((item: AiMessagesSuggestion) => any) | undefined;
|
|
1904
1957
|
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
1905
1958
|
"onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
|
|
1959
|
+
"onMessage-file-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
1906
1960
|
}>, {
|
|
1907
1961
|
description: string;
|
|
1908
1962
|
name: string;
|
|
@@ -1930,6 +1984,7 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
|
|
|
1930
1984
|
assistantName: string;
|
|
1931
1985
|
showTime: boolean;
|
|
1932
1986
|
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
1987
|
+
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
1933
1988
|
suggestionsTitle: string;
|
|
1934
1989
|
suggestionsWrap: boolean;
|
|
1935
1990
|
scrollThreshold: number;
|
|
@@ -2058,6 +2113,18 @@ type __VLS_Props$2 = {
|
|
|
2058
2113
|
accept?: string;
|
|
2059
2114
|
/** 附件数量上限(透传 Attachments,0 不限) */
|
|
2060
2115
|
attachmentLimit?: number;
|
|
2116
|
+
/**
|
|
2117
|
+
* 附件上传钩子(先传后发):选文件即调,成功返回附件描述(id/name/type 等回填列表项,
|
|
2118
|
+
* id 随发送进入 adapter 的 user 消息 files);返回错误文案串/抛错置 error 可重传。
|
|
2119
|
+
* 缺省不调(附件仅本地待发展示,不落服务端)
|
|
2120
|
+
*/
|
|
2121
|
+
uploadAttachment?: (file: File, item: AttachmentItem) => Promise<Partial<AttachmentItem> | string | undefined | void> | Partial<AttachmentItem> | string | undefined | void;
|
|
2122
|
+
/**
|
|
2123
|
+
* 附件地址解析钩子(鉴权取流):消息气泡渲染附件 url 前调用,返回可直渲地址
|
|
2124
|
+
* (如 JWT fetch 换 blob objectURL)。缺省原样使用 url(blob/dataURL/公开地址)。
|
|
2125
|
+
* 消费方宜在钩子内按 url 缓存,避免同一附件重复取流
|
|
2126
|
+
*/
|
|
2127
|
+
resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
|
|
2061
2128
|
/** 主题:light/dark/auto(注入 html dark class) */
|
|
2062
2129
|
theme?: 'light' | 'dark' | 'auto';
|
|
2063
2130
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象;解析后向整框后代注入(后代仍可用自身 locale prop 覆盖) */
|
|
@@ -2082,62 +2149,62 @@ declare function expandThoughtChains(): void;
|
|
|
2082
2149
|
declare function collapseThoughtChains(): void;
|
|
2083
2150
|
/** 消息区滚动到指定位置(透传 AiMessages scrollTo;options 同原生 ScrollToOptions) */
|
|
2084
2151
|
declare function scrollTo(options: ScrollToOptions | number): void;
|
|
2085
|
-
declare var
|
|
2152
|
+
declare var __VLS_29: {
|
|
2086
2153
|
message: MessageNode;
|
|
2087
2154
|
};
|
|
2088
|
-
declare var
|
|
2155
|
+
declare var __VLS_32: {
|
|
2089
2156
|
message: MessageNode;
|
|
2090
2157
|
};
|
|
2091
|
-
declare var
|
|
2092
|
-
declare var
|
|
2158
|
+
declare var __VLS_35: {};
|
|
2159
|
+
declare var __VLS_38: {
|
|
2093
2160
|
status: "thinking" | "error" | "done";
|
|
2094
2161
|
message: MessageNode;
|
|
2095
2162
|
};
|
|
2096
|
-
declare var
|
|
2163
|
+
declare var __VLS_41: {
|
|
2097
2164
|
message: MessageNode;
|
|
2098
2165
|
};
|
|
2099
|
-
declare var
|
|
2166
|
+
declare var __VLS_44: {
|
|
2100
2167
|
message: MessageNode;
|
|
2101
2168
|
};
|
|
2102
|
-
declare var
|
|
2103
|
-
declare var
|
|
2104
|
-
declare var
|
|
2105
|
-
declare var
|
|
2106
|
-
declare var
|
|
2107
|
-
declare var
|
|
2169
|
+
declare var __VLS_47: {};
|
|
2170
|
+
declare var __VLS_50: {};
|
|
2171
|
+
declare var __VLS_53: {};
|
|
2172
|
+
declare var __VLS_56: {};
|
|
2173
|
+
declare var __VLS_59: {};
|
|
2174
|
+
declare var __VLS_62: {
|
|
2108
2175
|
scrollToBottom: (smooth?: boolean) => void;
|
|
2109
2176
|
awayFromBottom: boolean;
|
|
2110
2177
|
};
|
|
2111
|
-
declare var
|
|
2112
|
-
declare var
|
|
2178
|
+
declare var __VLS_65: {};
|
|
2179
|
+
declare var __VLS_103: {};
|
|
2113
2180
|
type __VLS_Slots$1 = {} & {
|
|
2114
|
-
'message-avatar'?: (props: typeof
|
|
2181
|
+
'message-avatar'?: (props: typeof __VLS_29) => any;
|
|
2115
2182
|
} & {
|
|
2116
|
-
'message-actions'?: (props: typeof
|
|
2183
|
+
'message-actions'?: (props: typeof __VLS_32) => any;
|
|
2117
2184
|
} & {
|
|
2118
|
-
'user-avatar'?: (props: typeof
|
|
2185
|
+
'user-avatar'?: (props: typeof __VLS_35) => any;
|
|
2119
2186
|
} & {
|
|
2120
|
-
'assistant-avatar'?: (props: typeof
|
|
2187
|
+
'assistant-avatar'?: (props: typeof __VLS_38) => any;
|
|
2121
2188
|
} & {
|
|
2122
|
-
'user-name'?: (props: typeof
|
|
2189
|
+
'user-name'?: (props: typeof __VLS_41) => any;
|
|
2123
2190
|
} & {
|
|
2124
|
-
'assistant-name'?: (props: typeof
|
|
2191
|
+
'assistant-name'?: (props: typeof __VLS_44) => any;
|
|
2125
2192
|
} & {
|
|
2126
|
-
empty?: (props: typeof
|
|
2193
|
+
empty?: (props: typeof __VLS_47) => any;
|
|
2127
2194
|
} & {
|
|
2128
|
-
'welcome-name'?: (props: typeof
|
|
2195
|
+
'welcome-name'?: (props: typeof __VLS_50) => any;
|
|
2129
2196
|
} & {
|
|
2130
|
-
'welcome-description'?: (props: typeof
|
|
2197
|
+
'welcome-description'?: (props: typeof __VLS_53) => any;
|
|
2131
2198
|
} & {
|
|
2132
|
-
'welcome-icon'?: (props: typeof
|
|
2199
|
+
'welcome-icon'?: (props: typeof __VLS_56) => any;
|
|
2133
2200
|
} & {
|
|
2134
|
-
'welcome-suggestions'?: (props: typeof
|
|
2201
|
+
'welcome-suggestions'?: (props: typeof __VLS_59) => any;
|
|
2135
2202
|
} & {
|
|
2136
|
-
'scroll-button'?: (props: typeof
|
|
2203
|
+
'scroll-button'?: (props: typeof __VLS_62) => any;
|
|
2137
2204
|
} & {
|
|
2138
|
-
'scroll-button-icon'?: (props: typeof
|
|
2205
|
+
'scroll-button-icon'?: (props: typeof __VLS_65) => any;
|
|
2139
2206
|
} & {
|
|
2140
|
-
'sender-prefix'?: (props: typeof
|
|
2207
|
+
'sender-prefix'?: (props: typeof __VLS_103) => any;
|
|
2141
2208
|
};
|
|
2142
2209
|
declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
2143
2210
|
sendMessage: typeof sendMessage;
|
|
@@ -2156,10 +2223,15 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2156
2223
|
error: (err: Error, message?: MessageNode | undefined) => any;
|
|
2157
2224
|
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
2158
2225
|
"followup-select": (item: string, message: MessageNode) => any;
|
|
2226
|
+
"message-file-click": (file: ChatFile, message: MessageNode) => any;
|
|
2159
2227
|
"update:messages": (value: MessageNode[]) => any;
|
|
2160
2228
|
"suggestion-select": (item: AiChatSuggestion) => any;
|
|
2161
2229
|
"message-complete": (message: MessageNode) => any;
|
|
2162
2230
|
"attachment-exceed": (file: File) => any;
|
|
2231
|
+
"attachment-uploaded": (item: AttachmentItem, result: {
|
|
2232
|
+
ok: boolean;
|
|
2233
|
+
message?: string;
|
|
2234
|
+
}) => any;
|
|
2163
2235
|
"tool-event": (ev: {
|
|
2164
2236
|
toolName: string;
|
|
2165
2237
|
status: "start" | "done";
|
|
@@ -2170,10 +2242,15 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2170
2242
|
onError?: ((err: Error, message?: MessageNode | undefined) => any) | undefined;
|
|
2171
2243
|
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
2172
2244
|
"onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
|
|
2245
|
+
"onMessage-file-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
2173
2246
|
"onUpdate:messages"?: ((value: MessageNode[]) => any) | undefined;
|
|
2174
2247
|
"onSuggestion-select"?: ((item: AiChatSuggestion) => any) | undefined;
|
|
2175
2248
|
"onMessage-complete"?: ((message: MessageNode) => any) | undefined;
|
|
2176
2249
|
"onAttachment-exceed"?: ((file: File) => any) | undefined;
|
|
2250
|
+
"onAttachment-uploaded"?: ((item: AttachmentItem, result: {
|
|
2251
|
+
ok: boolean;
|
|
2252
|
+
message?: string;
|
|
2253
|
+
}) => any) | undefined;
|
|
2177
2254
|
"onTool-event"?: ((ev: {
|
|
2178
2255
|
toolName: string;
|
|
2179
2256
|
status: "start" | "done";
|
|
@@ -2206,6 +2283,7 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2206
2283
|
assistantName: string;
|
|
2207
2284
|
showTime: boolean;
|
|
2208
2285
|
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
2286
|
+
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2209
2287
|
suggestionsWrap: boolean;
|
|
2210
2288
|
scrollThreshold: number;
|
|
2211
2289
|
showScrollButton: boolean;
|
|
@@ -2223,6 +2301,7 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
|
|
|
2223
2301
|
features: AiChatFeatures;
|
|
2224
2302
|
allowAttachments: boolean;
|
|
2225
2303
|
attachmentLimit: number;
|
|
2304
|
+
uploadAttachment: (file: File, item: AttachmentItem) => Promise<Partial<AttachmentItem> | string | undefined | void> | Partial<AttachmentItem> | string | undefined | void;
|
|
2226
2305
|
theme: "light" | "dark" | "auto";
|
|
2227
2306
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
2228
2307
|
declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
@@ -2299,6 +2378,11 @@ type __VLS_Props$1 = {
|
|
|
2299
2378
|
/** 消息时间自定义格式化(透传 message 与已归一为 ms 的时间戳;
|
|
2300
2379
|
* 缺省自动识别 + 格式化为 'YYYY-MM-DD HH:mm',本机时区) */
|
|
2301
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;
|
|
2302
2386
|
/** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
|
|
2303
2387
|
locale?: LocaleInput;
|
|
2304
2388
|
};
|
|
@@ -2323,7 +2407,7 @@ declare var __VLS_22: {
|
|
|
2323
2407
|
message: MessageNode;
|
|
2324
2408
|
files: ChatFile[];
|
|
2325
2409
|
};
|
|
2326
|
-
declare var
|
|
2410
|
+
declare var __VLS_73: {
|
|
2327
2411
|
message: MessageNode;
|
|
2328
2412
|
};
|
|
2329
2413
|
type __VLS_Slots = {} & {
|
|
@@ -2339,7 +2423,7 @@ type __VLS_Slots = {} & {
|
|
|
2339
2423
|
} & {
|
|
2340
2424
|
'message-files'?: (props: typeof __VLS_22) => any;
|
|
2341
2425
|
} & {
|
|
2342
|
-
'message-actions'?: (props: typeof
|
|
2426
|
+
'message-actions'?: (props: typeof __VLS_73) => any;
|
|
2343
2427
|
};
|
|
2344
2428
|
declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
|
|
2345
2429
|
message: vue.ComputedRef<MessageNode>;
|
|
@@ -2351,12 +2435,14 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
|
|
|
2351
2435
|
typing: () => any;
|
|
2352
2436
|
"branch-change": (dir: BranchDirection, message: MessageNode) => any;
|
|
2353
2437
|
"followup-select": (item: string, message: MessageNode) => any;
|
|
2438
|
+
"file-click": (file: ChatFile, message: MessageNode) => any;
|
|
2354
2439
|
}, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
2355
2440
|
onCopy?: ((message: MessageNode) => any) | undefined;
|
|
2356
2441
|
onRegenerate?: ((message: MessageNode) => any) | undefined;
|
|
2357
2442
|
onTyping?: (() => any) | undefined;
|
|
2358
2443
|
"onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
|
|
2359
2444
|
"onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
|
|
2445
|
+
"onFile-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
|
|
2360
2446
|
}>, {
|
|
2361
2447
|
typing: boolean | {
|
|
2362
2448
|
step?: number;
|
|
@@ -2381,6 +2467,7 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
|
|
|
2381
2467
|
assistantName: string;
|
|
2382
2468
|
showTime: boolean;
|
|
2383
2469
|
timeFormat: (message: MessageNode, timestamp: number) => string;
|
|
2470
|
+
resolveFileUrl: (file: ChatFile) => Promise<string> | string;
|
|
2384
2471
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
2385
2472
|
declare const __VLS_export$1: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
2386
2473
|
declare const _default$1: typeof __VLS_export$1;
|
|
@@ -2610,4 +2697,4 @@ declare function createMessageTree(initial?: {
|
|
|
2610
2697
|
declare const version = "0.1.0";
|
|
2611
2698
|
|
|
2612
2699
|
export { _default as FvAiArtifacts, _default$2 as FvAiChat, _default$1 as FvAiMessage, _default$3 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 };
|
|
2613
|
-
export type { AdapterChatMessage, AiArtifactItem, AiChatArtifactsOptions, AiChatFeatures, AiChatSuggestion, AiMessageBranchInfo, AiMessagesSuggestion, 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 };
|
|
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 };
|