@fv-ui/ai-chat 1.3.0 → 1.4.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 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$1: {
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$1) => any;
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$1: {};
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$1) => any;
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 项重新置为 loading(具体上传由外部接线,这里只驱动状态流转) */
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$1: {
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$1) => any;
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 */
@@ -1634,13 +1661,17 @@ interface MessageUsage {
1634
1661
  }
1635
1662
  /** 消息附件文件描述(序列化安全:只含可 JSON 化字段,不含 File 原始对象) */
1636
1663
  interface ChatFile {
1637
- /** 附件唯一标识 */
1664
+ /** 附件唯一标识(先传后发架构下为服务端附件 id) */
1638
1665
  id: string;
1639
1666
  /** 文件名 */
1640
1667
  name: string;
1641
1668
  /** 体积(字节) */
1642
1669
  size?: number;
1643
- /** 预览/下载地址(data URL 或远程地址) */
1670
+ /**
1671
+ * 预览/下载地址(data URL、本地 objectURL 或远程地址)。
1672
+ * 远程地址需鉴权取流时经 AiChat 的 resolveFileUrl 换可渲染地址,
1673
+ * 此时本字段存原始远程地址(供解析函数取用)
1674
+ */
1644
1675
  url?: string;
1645
1676
  /** 附件类别,缺省按 'file' 处理 */
1646
1677
  type?: 'image' | 'file';
@@ -1814,6 +1845,11 @@ type __VLS_Props$3 = {
1814
1845
  showTime?: boolean;
1815
1846
  /** 消息时间自定义格式化(透传 AiMessage) */
1816
1847
  timeFormat?: (message: MessageNode, timestamp: number) => string;
1848
+ /**
1849
+ * 附件地址解析钩子(鉴权取流;透传 AiMessage):消息附件 url 渲染前调用,
1850
+ * 返回可直渲地址;缺省原样使用 url
1851
+ */
1852
+ resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
1817
1853
  /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
1818
1854
  locale?: LocaleInput;
1819
1855
  };
@@ -1834,28 +1870,28 @@ declare var __VLS_10: {};
1834
1870
  declare var __VLS_13: {};
1835
1871
  declare var __VLS_16$1: {};
1836
1872
  declare var __VLS_19: {};
1837
- declare var __VLS_41: {
1873
+ declare var __VLS_42: {
1838
1874
  message: MessageNode;
1839
1875
  };
1840
- declare var __VLS_44: {
1876
+ declare var __VLS_45: {
1841
1877
  message: MessageNode;
1842
1878
  };
1843
- declare var __VLS_47: {};
1844
- declare var __VLS_50: {
1879
+ declare var __VLS_48: {};
1880
+ declare var __VLS_51: {
1845
1881
  status: "thinking" | "error" | "done";
1846
1882
  message: MessageNode;
1847
1883
  };
1848
- declare var __VLS_53: {
1884
+ declare var __VLS_54: {
1849
1885
  message: MessageNode;
1850
1886
  };
1851
- declare var __VLS_56: {
1887
+ declare var __VLS_57: {
1852
1888
  message: MessageNode;
1853
1889
  };
1854
- declare var __VLS_64$1: {
1890
+ declare var __VLS_65$1: {
1855
1891
  scrollToBottom: typeof scrollToBottom;
1856
1892
  awayFromBottom: boolean;
1857
1893
  };
1858
- declare var __VLS_80: {};
1894
+ declare var __VLS_81: {};
1859
1895
  type __VLS_Slots$2 = {} & {
1860
1896
  empty?: (props: typeof __VLS_1$1) => any;
1861
1897
  } & {
@@ -1867,21 +1903,21 @@ type __VLS_Slots$2 = {} & {
1867
1903
  } & {
1868
1904
  'welcome-suggestions'?: (props: typeof __VLS_19) => any;
1869
1905
  } & {
1870
- 'message-avatar'?: (props: typeof __VLS_41) => any;
1906
+ 'message-avatar'?: (props: typeof __VLS_42) => any;
1871
1907
  } & {
1872
- 'message-actions'?: (props: typeof __VLS_44) => any;
1908
+ 'message-actions'?: (props: typeof __VLS_45) => any;
1873
1909
  } & {
1874
- 'user-avatar'?: (props: typeof __VLS_47) => any;
1910
+ 'user-avatar'?: (props: typeof __VLS_48) => any;
1875
1911
  } & {
1876
- 'assistant-avatar'?: (props: typeof __VLS_50) => any;
1912
+ 'assistant-avatar'?: (props: typeof __VLS_51) => any;
1877
1913
  } & {
1878
- 'user-name'?: (props: typeof __VLS_53) => any;
1914
+ 'user-name'?: (props: typeof __VLS_54) => any;
1879
1915
  } & {
1880
- 'assistant-name'?: (props: typeof __VLS_56) => any;
1916
+ 'assistant-name'?: (props: typeof __VLS_57) => any;
1881
1917
  } & {
1882
- 'scroll-button'?: (props: typeof __VLS_64$1) => any;
1918
+ 'scroll-button'?: (props: typeof __VLS_65$1) => any;
1883
1919
  } & {
1884
- 'scroll-button-icon'?: (props: typeof __VLS_80) => any;
1920
+ 'scroll-button-icon'?: (props: typeof __VLS_81) => any;
1885
1921
  };
1886
1922
  declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
1887
1923
  scrollTo: typeof scrollTo$1;
@@ -1896,6 +1932,7 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
1896
1932
  select: (item: AiMessagesSuggestion) => any;
1897
1933
  "branch-change": (dir: BranchDirection, message: MessageNode) => any;
1898
1934
  "followup-select": (item: string, message: MessageNode) => any;
1935
+ "message-file-click": (file: ChatFile, message: MessageNode) => any;
1899
1936
  }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1900
1937
  onScroll?: ((event: Event) => any) | undefined;
1901
1938
  onCopy?: ((message: MessageNode) => any) | undefined;
@@ -1903,6 +1940,7 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
1903
1940
  onSelect?: ((item: AiMessagesSuggestion) => any) | undefined;
1904
1941
  "onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
1905
1942
  "onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
1943
+ "onMessage-file-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
1906
1944
  }>, {
1907
1945
  description: string;
1908
1946
  name: string;
@@ -1930,6 +1968,7 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$3, {
1930
1968
  assistantName: string;
1931
1969
  showTime: boolean;
1932
1970
  timeFormat: (message: MessageNode, timestamp: number) => string;
1971
+ resolveFileUrl: (file: ChatFile) => Promise<string> | string;
1933
1972
  suggestionsTitle: string;
1934
1973
  suggestionsWrap: boolean;
1935
1974
  scrollThreshold: number;
@@ -2058,6 +2097,18 @@ type __VLS_Props$2 = {
2058
2097
  accept?: string;
2059
2098
  /** 附件数量上限(透传 Attachments,0 不限) */
2060
2099
  attachmentLimit?: number;
2100
+ /**
2101
+ * 附件上传钩子(先传后发):选文件即调,成功返回附件描述(id/name/type 等回填列表项,
2102
+ * id 随发送进入 adapter 的 user 消息 files);返回错误文案串/抛错置 error 可重传。
2103
+ * 缺省不调(附件仅本地待发展示,不落服务端)
2104
+ */
2105
+ uploadAttachment?: (file: File, item: AttachmentItem) => Promise<Partial<AttachmentItem> | string | undefined | void> | Partial<AttachmentItem> | string | undefined | void;
2106
+ /**
2107
+ * 附件地址解析钩子(鉴权取流):消息气泡渲染附件 url 前调用,返回可直渲地址
2108
+ * (如 JWT fetch 换 blob objectURL)。缺省原样使用 url(blob/dataURL/公开地址)。
2109
+ * 消费方宜在钩子内按 url 缓存,避免同一附件重复取流
2110
+ */
2111
+ resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
2061
2112
  /** 主题:light/dark/auto(注入 html dark class) */
2062
2113
  theme?: 'light' | 'dark' | 'auto';
2063
2114
  /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象;解析后向整框后代注入(后代仍可用自身 locale prop 覆盖) */
@@ -2082,62 +2133,62 @@ declare function expandThoughtChains(): void;
2082
2133
  declare function collapseThoughtChains(): void;
2083
2134
  /** 消息区滚动到指定位置(透传 AiMessages scrollTo;options 同原生 ScrollToOptions) */
2084
2135
  declare function scrollTo(options: ScrollToOptions | number): void;
2085
- declare var __VLS_28: {
2136
+ declare var __VLS_29: {
2086
2137
  message: MessageNode;
2087
2138
  };
2088
- declare var __VLS_31: {
2139
+ declare var __VLS_32: {
2089
2140
  message: MessageNode;
2090
2141
  };
2091
- declare var __VLS_34: {};
2092
- declare var __VLS_37: {
2142
+ declare var __VLS_35: {};
2143
+ declare var __VLS_38: {
2093
2144
  status: "thinking" | "error" | "done";
2094
2145
  message: MessageNode;
2095
2146
  };
2096
- declare var __VLS_40: {
2147
+ declare var __VLS_41: {
2097
2148
  message: MessageNode;
2098
2149
  };
2099
- declare var __VLS_43: {
2150
+ declare var __VLS_44: {
2100
2151
  message: MessageNode;
2101
2152
  };
2102
- declare var __VLS_46: {};
2103
- declare var __VLS_49: {};
2104
- declare var __VLS_52: {};
2105
- declare var __VLS_55: {};
2106
- declare var __VLS_58: {};
2107
- declare var __VLS_61: {
2153
+ declare var __VLS_47: {};
2154
+ declare var __VLS_50: {};
2155
+ declare var __VLS_53: {};
2156
+ declare var __VLS_56: {};
2157
+ declare var __VLS_59: {};
2158
+ declare var __VLS_62: {
2108
2159
  scrollToBottom: (smooth?: boolean) => void;
2109
2160
  awayFromBottom: boolean;
2110
2161
  };
2111
- declare var __VLS_64: {};
2112
- declare var __VLS_100: {};
2162
+ declare var __VLS_65: {};
2163
+ declare var __VLS_103: {};
2113
2164
  type __VLS_Slots$1 = {} & {
2114
- 'message-avatar'?: (props: typeof __VLS_28) => any;
2165
+ 'message-avatar'?: (props: typeof __VLS_29) => any;
2115
2166
  } & {
2116
- 'message-actions'?: (props: typeof __VLS_31) => any;
2167
+ 'message-actions'?: (props: typeof __VLS_32) => any;
2117
2168
  } & {
2118
- 'user-avatar'?: (props: typeof __VLS_34) => any;
2169
+ 'user-avatar'?: (props: typeof __VLS_35) => any;
2119
2170
  } & {
2120
- 'assistant-avatar'?: (props: typeof __VLS_37) => any;
2171
+ 'assistant-avatar'?: (props: typeof __VLS_38) => any;
2121
2172
  } & {
2122
- 'user-name'?: (props: typeof __VLS_40) => any;
2173
+ 'user-name'?: (props: typeof __VLS_41) => any;
2123
2174
  } & {
2124
- 'assistant-name'?: (props: typeof __VLS_43) => any;
2175
+ 'assistant-name'?: (props: typeof __VLS_44) => any;
2125
2176
  } & {
2126
- empty?: (props: typeof __VLS_46) => any;
2177
+ empty?: (props: typeof __VLS_47) => any;
2127
2178
  } & {
2128
- 'welcome-name'?: (props: typeof __VLS_49) => any;
2179
+ 'welcome-name'?: (props: typeof __VLS_50) => any;
2129
2180
  } & {
2130
- 'welcome-description'?: (props: typeof __VLS_52) => any;
2181
+ 'welcome-description'?: (props: typeof __VLS_53) => any;
2131
2182
  } & {
2132
- 'welcome-icon'?: (props: typeof __VLS_55) => any;
2183
+ 'welcome-icon'?: (props: typeof __VLS_56) => any;
2133
2184
  } & {
2134
- 'welcome-suggestions'?: (props: typeof __VLS_58) => any;
2185
+ 'welcome-suggestions'?: (props: typeof __VLS_59) => any;
2135
2186
  } & {
2136
- 'scroll-button'?: (props: typeof __VLS_61) => any;
2187
+ 'scroll-button'?: (props: typeof __VLS_62) => any;
2137
2188
  } & {
2138
- 'scroll-button-icon'?: (props: typeof __VLS_64) => any;
2189
+ 'scroll-button-icon'?: (props: typeof __VLS_65) => any;
2139
2190
  } & {
2140
- 'sender-prefix'?: (props: typeof __VLS_100) => any;
2191
+ 'sender-prefix'?: (props: typeof __VLS_103) => any;
2141
2192
  };
2142
2193
  declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
2143
2194
  sendMessage: typeof sendMessage;
@@ -2156,10 +2207,15 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
2156
2207
  error: (err: Error, message?: MessageNode | undefined) => any;
2157
2208
  "branch-change": (dir: BranchDirection, message: MessageNode) => any;
2158
2209
  "followup-select": (item: string, message: MessageNode) => any;
2210
+ "message-file-click": (file: ChatFile, message: MessageNode) => any;
2159
2211
  "update:messages": (value: MessageNode[]) => any;
2160
2212
  "suggestion-select": (item: AiChatSuggestion) => any;
2161
2213
  "message-complete": (message: MessageNode) => any;
2162
2214
  "attachment-exceed": (file: File) => any;
2215
+ "attachment-uploaded": (item: AttachmentItem, result: {
2216
+ ok: boolean;
2217
+ message?: string;
2218
+ }) => any;
2163
2219
  "tool-event": (ev: {
2164
2220
  toolName: string;
2165
2221
  status: "start" | "done";
@@ -2170,10 +2226,15 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
2170
2226
  onError?: ((err: Error, message?: MessageNode | undefined) => any) | undefined;
2171
2227
  "onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
2172
2228
  "onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
2229
+ "onMessage-file-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
2173
2230
  "onUpdate:messages"?: ((value: MessageNode[]) => any) | undefined;
2174
2231
  "onSuggestion-select"?: ((item: AiChatSuggestion) => any) | undefined;
2175
2232
  "onMessage-complete"?: ((message: MessageNode) => any) | undefined;
2176
2233
  "onAttachment-exceed"?: ((file: File) => any) | undefined;
2234
+ "onAttachment-uploaded"?: ((item: AttachmentItem, result: {
2235
+ ok: boolean;
2236
+ message?: string;
2237
+ }) => any) | undefined;
2177
2238
  "onTool-event"?: ((ev: {
2178
2239
  toolName: string;
2179
2240
  status: "start" | "done";
@@ -2206,6 +2267,7 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
2206
2267
  assistantName: string;
2207
2268
  showTime: boolean;
2208
2269
  timeFormat: (message: MessageNode, timestamp: number) => string;
2270
+ resolveFileUrl: (file: ChatFile) => Promise<string> | string;
2209
2271
  suggestionsWrap: boolean;
2210
2272
  scrollThreshold: number;
2211
2273
  showScrollButton: boolean;
@@ -2223,6 +2285,7 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$2, {
2223
2285
  features: AiChatFeatures;
2224
2286
  allowAttachments: boolean;
2225
2287
  attachmentLimit: number;
2288
+ uploadAttachment: (file: File, item: AttachmentItem) => Promise<Partial<AttachmentItem> | string | undefined | void> | Partial<AttachmentItem> | string | undefined | void;
2226
2289
  theme: "light" | "dark" | "auto";
2227
2290
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
2228
2291
  declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
@@ -2299,6 +2362,11 @@ type __VLS_Props$1 = {
2299
2362
  /** 消息时间自定义格式化(透传 message 与已归一为 ms 的时间戳;
2300
2363
  * 缺省自动识别 + 格式化为 'YYYY-MM-DD HH:mm',本机时区) */
2301
2364
  timeFormat?: (message: MessageNode, timestamp: number) => string;
2365
+ /**
2366
+ * 附件地址解析钩子(鉴权取流):附件 url 渲染前调用,返回可直渲地址
2367
+ * (如 JWT fetch 换 blob objectURL);缺省原样使用 url。消费方宜按 url 缓存
2368
+ */
2369
+ resolveFileUrl?: (file: ChatFile) => Promise<string> | string;
2302
2370
  /** 语言包:'zh-CN'/'en-US' 整包或部分文案对象(优先于祖先注入与全局设置) */
2303
2371
  locale?: LocaleInput;
2304
2372
  };
@@ -2323,7 +2391,7 @@ declare var __VLS_22: {
2323
2391
  message: MessageNode;
2324
2392
  files: ChatFile[];
2325
2393
  };
2326
- declare var __VLS_66: {
2394
+ declare var __VLS_73: {
2327
2395
  message: MessageNode;
2328
2396
  };
2329
2397
  type __VLS_Slots = {} & {
@@ -2339,7 +2407,7 @@ type __VLS_Slots = {} & {
2339
2407
  } & {
2340
2408
  'message-files'?: (props: typeof __VLS_22) => any;
2341
2409
  } & {
2342
- 'message-actions'?: (props: typeof __VLS_66) => any;
2410
+ 'message-actions'?: (props: typeof __VLS_73) => any;
2343
2411
  };
2344
2412
  declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
2345
2413
  message: vue.ComputedRef<MessageNode>;
@@ -2351,12 +2419,14 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
2351
2419
  typing: () => any;
2352
2420
  "branch-change": (dir: BranchDirection, message: MessageNode) => any;
2353
2421
  "followup-select": (item: string, message: MessageNode) => any;
2422
+ "file-click": (file: ChatFile, message: MessageNode) => any;
2354
2423
  }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
2355
2424
  onCopy?: ((message: MessageNode) => any) | undefined;
2356
2425
  onRegenerate?: ((message: MessageNode) => any) | undefined;
2357
2426
  onTyping?: (() => any) | undefined;
2358
2427
  "onBranch-change"?: ((dir: BranchDirection, message: MessageNode) => any) | undefined;
2359
2428
  "onFollowup-select"?: ((item: string, message: MessageNode) => any) | undefined;
2429
+ "onFile-click"?: ((file: ChatFile, message: MessageNode) => any) | undefined;
2360
2430
  }>, {
2361
2431
  typing: boolean | {
2362
2432
  step?: number;
@@ -2381,6 +2451,7 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
2381
2451
  assistantName: string;
2382
2452
  showTime: boolean;
2383
2453
  timeFormat: (message: MessageNode, timestamp: number) => string;
2454
+ resolveFileUrl: (file: ChatFile) => Promise<string> | string;
2384
2455
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
2385
2456
  declare const __VLS_export$1: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
2386
2457
  declare const _default$1: typeof __VLS_export$1;
@@ -2610,4 +2681,4 @@ declare function createMessageTree(initial?: {
2610
2681
  declare const version = "0.1.0";
2611
2682
 
2612
2683
  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 };
2684
+ 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 };