@opentiny/tiny-robot 0.4.0-alpha.0 → 0.4.0-alpha.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 CHANGED
@@ -17,6 +17,8 @@ import { Directive } from 'vue';
17
17
  import { ExtractPropTypes } from 'vue';
18
18
  import { GlobalComponents } from 'vue';
19
19
  import { GlobalDirectives } from 'vue';
20
+ import { MaybeComputedElementRef } from '@vueuse/core';
21
+ import { MaybeRefOrGetter } from 'vue';
20
22
  import { nextTick } from 'vue';
21
23
  import { OnCleanup } from '@vue/reactivity';
22
24
  import { PropType } from 'vue';
@@ -32,15 +34,27 @@ import { VNodeProps } from 'vue';
32
34
  import { WatchOptions } from 'vue';
33
35
  import { WatchStopHandle } from 'vue';
34
36
 
35
- declare const __VLS_component: DefineComponent<BubbleProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleProps> & Readonly<{}>, {
37
+ declare const __VLS_component: DefineComponent<BubbleProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
38
+ "state-change": (payload: {
39
+ key: string;
40
+ value: unknown;
41
+ messageIndex: number;
42
+ contentIndex?: number;
43
+ }) => any;
44
+ }, string, PublicProps, Readonly<BubbleProps> & Readonly<{
45
+ "onState-change"?: ((payload: {
46
+ key: string;
47
+ value: unknown;
48
+ messageIndex: number;
49
+ contentIndex?: number;
50
+ }) => any) | undefined;
51
+ }>, {
36
52
  placement: "start" | "end";
37
- shape: "rounded" | "corner" | "none";
38
- splitPolymorphic: boolean;
39
- }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
40
-
41
- declare const __VLS_component_10: DefineComponent<SuggestionPillButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SuggestionPillButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
53
+ shape: "corner" | "rounded" | "none";
54
+ contentRenderMode: "single" | "split";
55
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
42
56
 
43
- declare const __VLS_component_11: DefineComponent<__VLS_PublicProps_3, {
57
+ declare const __VLS_component_10: DefineComponent<__VLS_PublicProps_3, {
44
58
  children: ComputedRef<(HTMLElement | SVGElement)[]>;
45
59
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
46
60
  "update:showAll": (value: boolean | undefined) => any;
@@ -60,7 +74,7 @@ floatingItemsRef: HTMLDivElement;
60
74
  floatingMaybeItemRefs: unknown[];
61
75
  }, HTMLDivElement>;
62
76
 
63
- declare const __VLS_component_12: DefineComponent<__VLS_PublicProps_4, {
77
+ declare const __VLS_component_11: DefineComponent<__VLS_PublicProps_4, {
64
78
  update: () => void;
65
79
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
66
80
  "update:selectedGroup": (value: string) => any;
@@ -196,7 +210,7 @@ show?: TooltipContentProps["show"];
196
210
  }>, {}, {}, {}, {}, {}> | null;
197
211
  }, any>;
198
212
 
199
- declare const __VLS_component_13: DefineComponent<__VLS_PublicProps_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
213
+ declare const __VLS_component_12: DefineComponent<__VLS_PublicProps_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
200
214
  "update:theme": (value: string) => any;
201
215
  "update:colorMode": (value: ColorMode) => any;
202
216
  }, string, PublicProps, Readonly<__VLS_PublicProps_5> & Readonly<{
@@ -207,20 +221,37 @@ targetElement: string;
207
221
  storageKey: string;
208
222
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
209
223
 
210
- declare const __VLS_component_14: DefineComponent<WelcomeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<WelcomeProps> & Readonly<{}>, {
224
+ declare const __VLS_component_13: DefineComponent<WelcomeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<WelcomeProps> & Readonly<{}>, {
211
225
  align: "left" | "center" | "right" | string;
212
226
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
213
227
 
214
- declare const __VLS_component_2: DefineComponent<BubbleListProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleListProps> & Readonly<{}>, {
228
+ declare const __VLS_component_2: DefineComponent<BubbleListProps, {
229
+ scrollToBottom: (behavior?: ScrollBehavior) => Promise<void>;
230
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
231
+ "state-change": (payload: {
232
+ key: string;
233
+ value: unknown;
234
+ messageIndex: number;
235
+ contentIndex?: number;
236
+ }) => any;
237
+ }, string, PublicProps, Readonly<BubbleListProps> & Readonly<{
238
+ "onState-change"?: ((payload: {
239
+ key: string;
240
+ value: unknown;
241
+ messageIndex: number;
242
+ contentIndex?: number;
243
+ }) => any) | undefined;
244
+ }>, {
215
245
  groupStrategy: "consecutive" | "divider" | ((messages: BubbleMessage[], dividerRole?: string) => BubbleMessageGroup[]);
216
246
  dividerRole: string;
217
- }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
247
+ fallbackRole: string;
248
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
249
+ listRef: HTMLDivElement;
250
+ }, HTMLDivElement>;
218
251
 
219
252
  declare const __VLS_component_3: DefineComponent<BubbleProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
220
253
 
221
- declare const __VLS_component_4: DefineComponent<BubbleBoxProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleBoxProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
222
-
223
- declare const __VLS_component_5: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
254
+ declare const __VLS_component_4: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
224
255
  "update:show": (value: boolean) => any;
225
256
  "update:fullscreen": (value: boolean | undefined) => any;
226
257
  } & {
@@ -233,9 +264,9 @@ onClose?: (() => any) | undefined;
233
264
  title: string;
234
265
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
235
266
 
236
- declare const __VLS_component_6: DefineComponent<DragOverlayProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DragOverlayProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
267
+ declare const __VLS_component_5: DefineComponent<DragOverlayProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DragOverlayProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
237
268
 
238
- declare const __VLS_component_7: DefineComponent<__VLS_PublicProps_2, {
269
+ declare const __VLS_component_6: DefineComponent<__VLS_PublicProps_2, {
239
270
  update: () => void;
240
271
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
241
272
  "update:show": (value: boolean) => any;
@@ -343,13 +374,13 @@ content?: () => VNode[];
343
374
  }) | null;
344
375
  }, any>;
345
376
 
346
- declare const __VLS_component_8: DefineComponent<PromptsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
377
+ declare const __VLS_component_7: DefineComponent<PromptsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
347
378
  "item-click": (ev: MouseEvent, item: PromptProps) => any;
348
379
  }, string, PublicProps, Readonly<PromptsProps> & Readonly<{
349
380
  "onItem-click"?: ((ev: MouseEvent, item: PromptProps) => any) | undefined;
350
381
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
351
382
 
352
- declare const __VLS_component_9: DefineComponent<SenderProps, {
383
+ declare const __VLS_component_8: DefineComponent<SenderProps, {
353
384
  focus: () => void;
354
385
  blur: () => void;
355
386
  clear: () => void;
@@ -904,65 +935,58 @@ inputBoxType: string;
904
935
  buttonsContainerRef: HTMLDivElement;
905
936
  }, HTMLDivElement>;
906
937
 
938
+ declare const __VLS_component_9: DefineComponent<SuggestionPillButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SuggestionPillButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
939
+
907
940
  declare type __VLS_PrettifyLocal<T> = {
908
941
  [K in keyof T]: T[K];
909
942
  } & {};
910
943
 
911
- declare type __VLS_Props = BubbleRendererMessage<string | BubbleChatMessageItem | undefined>;
944
+ declare type __VLS_Props = ContainerProps;
912
945
 
913
- declare type __VLS_Props_2 = ContainerProps;
946
+ declare type __VLS_Props_2 = DropdownMenuProps;
914
947
 
915
- declare type __VLS_Props_3 = DropdownMenuProps;
948
+ declare type __VLS_Props_3 = SuggestionPillsProps;
916
949
 
917
- declare type __VLS_Props_4 = SuggestionPillsProps;
950
+ declare type __VLS_Props_4 = SuggestionPopoverProps;
918
951
 
919
- declare type __VLS_Props_5 = SuggestionPopoverProps;
952
+ declare type __VLS_Props_5 = ThemeProviderProps;
920
953
 
921
- declare type __VLS_Props_6 = ThemeProviderProps;
922
-
923
- declare type __VLS_Props_7 = McpServerPickerProps;
954
+ declare type __VLS_Props_6 = McpServerPickerProps;
924
955
 
925
956
  declare type __VLS_PublicProps = {
926
957
  'show': ContainerProps['show'];
927
958
  'fullscreen'?: ContainerProps['fullscreen'];
928
- } & __VLS_Props_2;
959
+ } & __VLS_Props;
929
960
 
930
961
  declare type __VLS_PublicProps_2 = {
931
962
  'show'?: boolean;
932
- } & __VLS_Props_3;
963
+ } & __VLS_Props_2;
933
964
 
934
965
  declare type __VLS_PublicProps_3 = {
935
966
  'showAll'?: SuggestionPillsProps['showAll'];
936
- } & __VLS_Props_4;
967
+ } & __VLS_Props_3;
937
968
 
938
969
  declare type __VLS_PublicProps_4 = {
939
970
  'selectedGroup'?: string;
940
- } & __VLS_Props_5;
971
+ } & __VLS_Props_4;
941
972
 
942
973
  declare type __VLS_PublicProps_5 = {
943
974
  'theme'?: string;
944
975
  'colorMode'?: ColorMode;
945
- } & __VLS_Props_6;
976
+ } & __VLS_Props_5;
946
977
 
947
978
  declare type __VLS_PublicProps_6 = {
948
979
  'visible': boolean;
949
- } & __VLS_Props_7;
980
+ } & __VLS_Props_6;
950
981
 
951
982
  declare function __VLS_template(): {
952
983
  attrs: Partial<{}>;
953
984
  slots: Readonly<BubbleSlots> & BubbleSlots;
954
985
  refs: {};
955
- rootEl: any;
986
+ rootEl: HTMLDivElement;
956
987
  };
957
988
 
958
989
  declare function __VLS_template_10(): {
959
- attrs: Partial<{}>;
960
- slots: Readonly<SuggestionPillButtonSlots> & SuggestionPillButtonSlots;
961
- refs: {};
962
- rootEl: HTMLButtonElement;
963
- };
964
-
965
- declare function __VLS_template_11(): {
966
990
  attrs: Partial<{}>;
967
991
  slots: Readonly<SuggestionPillsSlots> & SuggestionPillsSlots;
968
992
  refs: {
@@ -975,7 +999,7 @@ declare function __VLS_template_11(): {
975
999
  rootEl: HTMLDivElement;
976
1000
  };
977
1001
 
978
- declare function __VLS_template_12(): {
1002
+ declare function __VLS_template_11(): {
979
1003
  attrs: Partial<{}>;
980
1004
  slots: Readonly<SuggestionPopoverSlots> & SuggestionPopoverSlots;
981
1005
  refs: {
@@ -1094,7 +1118,7 @@ declare function __VLS_template_12(): {
1094
1118
  rootEl: any;
1095
1119
  };
1096
1120
 
1097
- declare function __VLS_template_13(): {
1121
+ declare function __VLS_template_12(): {
1098
1122
  attrs: Partial<{}>;
1099
1123
  slots: {
1100
1124
  default?(_: {}): any;
@@ -1103,7 +1127,7 @@ declare function __VLS_template_13(): {
1103
1127
  rootEl: any;
1104
1128
  };
1105
1129
 
1106
- declare function __VLS_template_14(): {
1130
+ declare function __VLS_template_13(): {
1107
1131
  attrs: Partial<{}>;
1108
1132
  slots: Readonly<WelcomeSlots> & WelcomeSlots;
1109
1133
  refs: {};
@@ -1113,7 +1137,9 @@ declare function __VLS_template_14(): {
1113
1137
  declare function __VLS_template_2(): {
1114
1138
  attrs: Partial<{}>;
1115
1139
  slots: Readonly<BubbleListSlots> & BubbleListSlots;
1116
- refs: {};
1140
+ refs: {
1141
+ listRef: HTMLDivElement;
1142
+ };
1117
1143
  rootEl: HTMLDivElement;
1118
1144
  };
1119
1145
 
@@ -1127,22 +1153,13 @@ declare function __VLS_template_3(): {
1127
1153
  };
1128
1154
 
1129
1155
  declare function __VLS_template_4(): {
1130
- attrs: Partial<{}>;
1131
- slots: {
1132
- default?(_: {}): any;
1133
- };
1134
- refs: {};
1135
- rootEl: HTMLDivElement;
1136
- };
1137
-
1138
- declare function __VLS_template_5(): {
1139
1156
  attrs: Partial<{}>;
1140
1157
  slots: Readonly<ContainerSlots> & ContainerSlots;
1141
1158
  refs: {};
1142
1159
  rootEl: HTMLDivElement;
1143
1160
  };
1144
1161
 
1145
- declare function __VLS_template_6(): {
1162
+ declare function __VLS_template_5(): {
1146
1163
  attrs: Partial<{}>;
1147
1164
  slots: {
1148
1165
  overlay?(_: {
@@ -1153,7 +1170,7 @@ declare function __VLS_template_6(): {
1153
1170
  rootEl: any;
1154
1171
  };
1155
1172
 
1156
- declare function __VLS_template_7(): {
1173
+ declare function __VLS_template_6(): {
1157
1174
  attrs: Partial<{}>;
1158
1175
  slots: {
1159
1176
  trigger?(_: {}): any;
@@ -1255,14 +1272,14 @@ declare function __VLS_template_7(): {
1255
1272
  rootEl: any;
1256
1273
  };
1257
1274
 
1258
- declare function __VLS_template_8(): {
1275
+ declare function __VLS_template_7(): {
1259
1276
  attrs: Partial<{}>;
1260
1277
  slots: Readonly<PromptsSlots> & PromptsSlots;
1261
1278
  refs: {};
1262
1279
  rootEl: HTMLDivElement;
1263
1280
  };
1264
1281
 
1265
- declare function __VLS_template_9(): {
1282
+ declare function __VLS_template_8(): {
1266
1283
  attrs: Partial<{}>;
1267
1284
  slots: {
1268
1285
  header?(_: {}): any;
@@ -1772,6 +1789,13 @@ declare function __VLS_template_9(): {
1772
1789
  rootEl: HTMLDivElement;
1773
1790
  };
1774
1791
 
1792
+ declare function __VLS_template_9(): {
1793
+ attrs: Partial<{}>;
1794
+ slots: Readonly<SuggestionPillButtonSlots> & SuggestionPillButtonSlots;
1795
+ refs: {};
1796
+ rootEl: HTMLButtonElement;
1797
+ };
1798
+
1775
1799
  declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
1776
1800
 
1777
1801
  declare type __VLS_TemplateResult_10 = ReturnType<typeof __VLS_template_10>;
@@ -1782,8 +1806,6 @@ declare type __VLS_TemplateResult_12 = ReturnType<typeof __VLS_template_12>;
1782
1806
 
1783
1807
  declare type __VLS_TemplateResult_13 = ReturnType<typeof __VLS_template_13>;
1784
1808
 
1785
- declare type __VLS_TemplateResult_14 = ReturnType<typeof __VLS_template_14>;
1786
-
1787
1809
  declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
1788
1810
 
1789
1811
  declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
@@ -1830,12 +1852,6 @@ declare type __VLS_WithTemplateSlots_13<T, S> = T & {
1830
1852
  };
1831
1853
  };
1832
1854
 
1833
- declare type __VLS_WithTemplateSlots_14<T, S> = T & {
1834
- new (): {
1835
- $slots: S;
1836
- };
1837
- };
1838
-
1839
1855
  declare type __VLS_WithTemplateSlots_2<T, S> = T & {
1840
1856
  new (): {
1841
1857
  $slots: S;
@@ -1957,68 +1973,31 @@ declare interface BaseTextItem {
1957
1973
  content: string;
1958
1974
  }
1959
1975
 
1960
- declare const Bubble: typeof _default_20 & {
1976
+ declare const Bubble: typeof _default_18 & {
1961
1977
  install: typeof bubbleInstall;
1962
1978
  };
1963
1979
  export { Bubble }
1964
1980
  export { Bubble as TrBubble }
1965
1981
 
1966
- /**
1967
- * 基础消息类型(移除了样式相关属性)
1968
- */
1969
- declare type BubbleBaseMessage = Omit<BubbleProps, 'content' | 'role' | 'avatar' | 'placement' | 'shape' | 'splitPolymorphic'> & {
1970
- role: string;
1971
- };
1972
-
1973
- /**
1974
- * 气泡容器属性
1975
- */
1976
- export declare type BubbleBoxProps = Pick<BubbleProps, 'placement' | 'shape'>;
1977
-
1978
1982
  export declare type BubbleBoxRendererMatch = {
1979
- find: (props: BubbleContentBoxProps) => boolean;
1980
- renderer: Component;
1983
+ find: (messages: BubbleMessage[], contentIndex?: number) => boolean;
1984
+ renderer: Component<BubbleBoxRendererProps>;
1981
1985
  priority?: number;
1986
+ attributes?: Record<string, string>;
1982
1987
  };
1983
1988
 
1984
- /**
1985
- * 聊天消息接口(支持 OpenAI 格式)
1986
- */
1987
- export declare interface BubbleChatMessage {
1988
- role: string;
1989
- content?: string | BubbleChatMessageItem[];
1990
- reasoning_content?: string;
1991
- tool_calls?: ToolCall[];
1992
- tool_call_id?: string;
1993
- name?: string;
1994
- }
1995
-
1996
- /**
1997
- * 多态内容项
1998
- * 用于支持多种内容类型(文本、图片、音频等)
1999
- */
2000
- export declare interface BubbleChatMessageItem {
2001
- /**
2002
- * 内容类型标识符(例如:'text'、'image_url' 等)
2003
- */
2004
- type?: string;
2005
- /**
2006
- * 内容类型特定的附加属性
2007
- */
2008
- [key: string]: unknown;
2009
- }
2010
-
2011
- /**
2012
- * ContentBox 组件 Props
2013
- */
2014
- export declare type BubbleContentBoxProps = BubbleBoxProps & {
2015
- messages: BubbleRendererMessage[];
2016
- };
1989
+ export declare type BubbleBoxRendererProps = Pick<BubbleProps, 'placement' | 'shape'>;
2017
1990
 
2018
1991
  export declare type BubbleContentRendererMatch = {
2019
- find: (message: BubbleRendererMessage) => boolean;
2020
- renderer: Component;
1992
+ find: (message: BubbleMessage, contentIndex?: number) => boolean;
1993
+ renderer: Component<BubbleContentRendererProps>;
2021
1994
  priority?: number;
1995
+ attributes?: Record<string, string>;
1996
+ };
1997
+
1998
+ export declare type BubbleContentRendererProps<T extends ChatMessageContent = ChatMessageContent, S extends Record<string, unknown> = Record<string, unknown>> = {
1999
+ message: BubbleMessage<T, S>;
2000
+ contentIndex?: number;
2022
2001
  };
2023
2002
 
2024
2003
  /**
@@ -2028,18 +2007,7 @@ declare type BubbleGroupFunction = (messages: BubbleMessage[], dividerRole?: str
2028
2007
 
2029
2008
  declare const bubbleInstall: (app: App) => void;
2030
2009
 
2031
- export declare interface BubbleItemSlot {
2032
- prefix?: (slotProps: BubbleItemSlotProps) => VNode | VNode[];
2033
- suffix?: (slotProps: BubbleItemSlotProps) => VNode | VNode[];
2034
- 'content-footer'?: (slotProps: BubbleItemSlotProps) => VNode | VNode[];
2035
- after?: (slotProps: BubbleItemSlotProps) => VNode | VNode[];
2036
- }
2037
-
2038
- declare type BubbleItemSlotProps = BubbleSlotProps & {
2039
- messages: BubbleMessage[];
2040
- };
2041
-
2042
- declare const BubbleList: typeof _default_21 & {
2010
+ declare const BubbleList: typeof _default_19 & {
2043
2011
  install: typeof bubbleListInstall;
2044
2012
  };
2045
2013
  export { BubbleList }
@@ -2047,10 +2015,6 @@ export { BubbleList as TrBubbleList }
2047
2015
 
2048
2016
  declare const bubbleListInstall: (app: App) => void;
2049
2017
 
2050
- /**
2051
- * BubbleList 组件 Props
2052
- * 用于管理消息流和分组策略
2053
- */
2054
2018
  export declare interface BubbleListProps {
2055
2019
  messages: BubbleMessage[];
2056
2020
  /**
@@ -2070,110 +2034,63 @@ export declare interface BubbleListProps {
2070
2034
  * @default 'user'
2071
2035
  */
2072
2036
  dividerRole?: string;
2037
+ /**
2038
+ * 当消息没有角色或角色为空时,使用此角色
2039
+ * @default 'assistant'
2040
+ */
2041
+ fallbackRole?: string;
2073
2042
  /**
2074
2043
  * 角色配置(头像、位置、形状)
2075
2044
  */
2076
2045
  roleConfigs?: Record<string, BubbleRoleConfig>;
2046
+ contentRenderMode?: BubbleProps['contentRenderMode'];
2077
2047
  /**
2078
- * 是否拆分多态内容配置
2048
+ * 是否自动滚动到底部。需要满足以下条件:
2049
+ * - BubbleList 是可滚动容器(需要 scrollHeight > clientHeight)
2050
+ * - 滚动容器接近底部
2051
+ *
2052
+ * @default false
2079
2053
  */
2080
- splitPolymorphic?: BubbleProps['splitPolymorphic'];
2054
+ autoScroll?: boolean;
2081
2055
  }
2082
2056
 
2083
- declare type BubbleListSlotProps = BubbleItemSlotProps & {
2057
+ declare type BubbleListSlotProps = BubbleSlotProps & {
2084
2058
  messageIndexes: number[];
2085
2059
  };
2086
2060
 
2087
2061
  export declare interface BubbleListSlots {
2088
2062
  prefix?: (slotProps: BubbleListSlotProps) => VNode | VNode[];
2089
2063
  suffix?: (slotProps: BubbleListSlotProps) => VNode | VNode[];
2090
- 'content-footer'?: (slotProps: BubbleListSlotProps) => VNode | VNode[];
2091
2064
  after?: (slotProps: BubbleListSlotProps) => VNode | VNode[];
2065
+ 'content-footer'?: (slotProps: BubbleListSlotProps & {
2066
+ contentIndex?: number;
2067
+ }) => VNode | VNode[];
2092
2068
  }
2093
2069
 
2094
- /**
2095
- * 统一消息类型
2096
- */
2097
- export declare type BubbleMessage = BubblePlainMessage | BubblePolymorphicMessage;
2098
-
2099
- /**
2100
- * 统一分组类型
2101
- */
2102
- export declare type BubbleMessageGroup = BubblePlainMessageGroup | BubblePolymorphicMessageGroup;
2103
-
2104
- /**
2105
- * 普通消息(字符串内容)
2106
- */
2107
- export declare type BubblePlainMessage = BubbleBaseMessage & {
2108
- content: string;
2109
- };
2110
-
2111
- /**
2112
- * 普通消息分组(内容为字符串)
2113
- */
2114
- declare type BubblePlainMessageGroup = {
2115
- role: string;
2116
- messages: BubblePlainMessage[];
2117
- isPolymorphic: false;
2118
- messageIndexes: number[];
2119
- };
2120
-
2121
- /**
2122
- * 多态消息(数组内容)
2123
- */
2124
- export declare type BubblePolymorphicMessage = BubbleBaseMessage & {
2125
- content: BubbleChatMessageItem[];
2070
+ export declare type BubbleMessage<T extends ChatMessageContent = ChatMessageContent, S extends Record<string, unknown> = Record<string, unknown>> = ChatMessageWithOptionalRole<T> & {
2071
+ id?: string;
2072
+ loading?: boolean;
2073
+ state?: S;
2126
2074
  };
2127
2075
 
2128
- /**
2129
- * 多态消息分组(内容为 BubbleChatMessageItem 数组)
2130
- */
2131
- declare type BubblePolymorphicMessageGroup = {
2076
+ export declare type BubbleMessageGroup = {
2132
2077
  role: string;
2133
- messages: BubblePolymorphicMessage[];
2134
- isPolymorphic: true;
2078
+ messages: BubbleMessage[];
2135
2079
  messageIndexes: number[];
2080
+ startIndex: number;
2136
2081
  };
2137
2082
 
2138
- /**
2139
- * Bubble 组件 Props
2140
- * 用于渲染单个气泡的外观和内容
2141
- */
2142
- export declare type BubbleProps = Omit<BubbleChatMessage, 'role'> & {
2143
- role?: string;
2144
- /**
2145
- * 气泡头像
2146
- */
2083
+ export declare type BubbleProps = BubbleMessage & {
2084
+ hidden?: boolean;
2147
2085
  avatar?: VNode | Component;
2148
- /**
2149
- * 气泡对齐位置,默认 'start'
2150
- */
2151
2086
  placement?: 'start' | 'end';
2152
- /**
2153
- * 气泡形状,默认 'corner'
2154
- */
2155
- shape?: 'rounded' | 'corner' | 'none';
2156
- /**
2157
- * 气泡加载状态
2158
- */
2159
- loading?: boolean;
2160
- /**
2161
- * 是否隐藏气泡
2162
- */
2163
- hidden?: boolean;
2164
- /**
2165
- * 是否拆分多态内容(每个内容项各自渲染一个气泡)
2166
- * - true:每个内容项各自渲染一个气泡
2167
- * - false:所有内容项合并在同一个气泡中渲染(默认)
2168
- */
2169
- splitPolymorphic?: boolean;
2170
- /**
2171
- * 额外配置
2172
- */
2173
- extras?: Record<string, unknown>;
2087
+ shape?: 'corner' | 'rounded' | 'none';
2088
+ contentRenderMode?: 'single' | 'split';
2089
+ fallbackBoxRenderer?: Component<BubbleBoxRendererProps>;
2090
+ fallbackContentRenderer?: Component<BubbleContentRendererProps>;
2174
2091
  };
2175
2092
 
2176
- declare const BubbleProvider: typeof _default_22 & {
2093
+ declare const BubbleProvider: typeof _default_20 & {
2177
2094
  install: typeof bubbleProviderInstall;
2178
2095
  };
2179
2096
  export { BubbleProvider }
@@ -2184,45 +2101,136 @@ declare const bubbleProviderInstall: (app: App) => void;
2184
2101
  export declare interface BubbleProviderProps {
2185
2102
  boxRendererMatches?: BubbleBoxRendererMatch[];
2186
2103
  contentRendererMatches?: BubbleContentRendererMatch[];
2187
- fallbackBoxRenderer?: Component;
2188
- fallbackContentRenderer?: Component;
2104
+ fallbackBoxRenderer?: Component<BubbleBoxRendererProps>;
2105
+ fallbackContentRenderer?: Component<BubbleContentRendererProps>;
2189
2106
  initialStore?: Record<string, unknown>;
2190
2107
  }
2191
2108
 
2192
2109
  /**
2193
- * 渲染器消息(扁平化的单条内容)
2110
+ * 气泡渲染器匹配优先级常量
2111
+ *
2112
+ * 用于定义不同类型渲染器的匹配优先级,数值越小优先级越高
2113
+ *
2114
+ * - LOADING: 通常基于 message.loading 判断。比如: `{ loading: true }`
2115
+ * - NORMAL: 普通渲染器的默认优先级
2116
+ * - CONTENT: 通常基于 message.content 判断。比如: `{ content: [{ type: 'image_url', image_url: 'xxx' }] }`
2117
+ * - ROLE: 通常基于 message.role 判断。比如: `{ role: 'tool' }`
2194
2118
  */
2195
- export declare type BubbleRendererMessage<T = string | BubbleChatMessageItem | undefined, E extends Record<string, unknown> = Record<string, unknown>> = Omit<BubbleBaseMessage, 'role'> & {
2196
- role?: string;
2197
- content: T;
2198
- extras?: E;
2119
+ export declare const BubbleRendererMatchPriority: {
2120
+ readonly LOADING: -1;
2121
+ readonly NORMAL: 0;
2122
+ readonly CONTENT: 10;
2123
+ readonly ROLE: 20;
2124
+ };
2125
+
2126
+ export declare const BubbleRenderers: {
2127
+ Box: {
2128
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<BubbleBoxRendererProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
2129
+ P: {};
2130
+ B: {};
2131
+ D: {};
2132
+ C: {};
2133
+ M: {};
2134
+ Defaults: {};
2135
+ }, Readonly<BubbleBoxRendererProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
2136
+ __isFragment?: never;
2137
+ __isTeleport?: never;
2138
+ __isSuspense?: never;
2139
+ } & ComponentOptionsBase<Readonly<BubbleBoxRendererProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
2140
+ $slots: {
2141
+ default?(_: {}): any;
2142
+ };
2143
+ });
2144
+ Image: DefineComponent< {
2145
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2146
+ contentIndex?: number;
2147
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
2148
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2149
+ contentIndex?: number;
2150
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLImageElement>;
2151
+ Loading: DefineComponent< {
2152
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2153
+ contentIndex?: number;
2154
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
2155
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2156
+ contentIndex?: number;
2157
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
2158
+ Markdown: DefineComponent< {
2159
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2160
+ contentIndex?: number;
2161
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
2162
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2163
+ contentIndex?: number;
2164
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2165
+ Reasoning: DefineComponent< {
2166
+ message: BubbleMessage<ChatMessageContent, {
2167
+ thinking?: boolean;
2168
+ open?: boolean;
2169
+ }>;
2170
+ contentIndex?: number;
2171
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
2172
+ message: BubbleMessage<ChatMessageContent, {
2173
+ thinking?: boolean;
2174
+ open?: boolean;
2175
+ }>;
2176
+ contentIndex?: number;
2177
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2178
+ Text: DefineComponent< {
2179
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2180
+ contentIndex?: number;
2181
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
2182
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2183
+ contentIndex?: number;
2184
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2185
+ Tool: DefineComponent<BubbleContentRendererProps<ChatMessageContent, {
2186
+ toolCall?: Record<string, {
2187
+ status?: "success" | "running" | "failed" | "cancelled";
2188
+ open?: boolean;
2189
+ }>;
2190
+ }> & {
2191
+ toolIndex: number;
2192
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleContentRendererProps<ChatMessageContent, {
2193
+ toolCall?: Record<string, {
2194
+ status?: "success" | "running" | "failed" | "cancelled";
2195
+ open?: boolean;
2196
+ }>;
2197
+ }> & {
2198
+ toolIndex: number;
2199
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
2200
+ ToolRole: DefineComponent< {
2201
+ message: BubbleMessage<string, Record<string, unknown>>;
2202
+ contentIndex?: number;
2203
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
2204
+ message: BubbleMessage<string, Record<string, unknown>>;
2205
+ contentIndex?: number;
2206
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2207
+ Tools: DefineComponent< {
2208
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2209
+ contentIndex?: number;
2210
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
2211
+ message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2212
+ contentIndex?: number;
2213
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2199
2214
  };
2200
2215
 
2201
2216
  /**
2202
2217
  * 角色配置
2203
2218
  * 用于配置不同角色的气泡样式
2204
2219
  */
2205
- export declare type BubbleRoleConfig = Pick<BubbleProps, 'avatar' | 'placement' | 'shape' | 'hidden'>;
2220
+ export declare type BubbleRoleConfig = Pick<BubbleProps, 'avatar' | 'placement' | 'shape' | 'hidden' | 'fallbackBoxRenderer' | 'fallbackContentRenderer'>;
2206
2221
 
2207
2222
  declare type BubbleSlotProps = {
2208
- rendererMessages: BubbleRendererMessage[];
2209
- role?: string;
2210
- isPolymorphic?: undefined;
2211
- isFirstPolymorphic?: undefined;
2212
- polymorphicIndex?: undefined;
2213
- } | {
2214
- rendererMessages: BubbleRendererMessage[];
2223
+ messages: BubbleMessage[];
2215
2224
  role?: string;
2216
- isPolymorphic: boolean;
2217
- isFirstPolymorphic: boolean;
2218
- polymorphicIndex: number;
2219
2225
  };
2220
2226
 
2221
2227
  export declare interface BubbleSlots {
2222
2228
  prefix?: (slotProps: BubbleSlotProps) => VNode | VNode[];
2223
2229
  suffix?: (slotProps: BubbleSlotProps) => VNode | VNode[];
2224
- 'content-footer'?: (slotProps: BubbleSlotProps) => VNode | VNode[];
2225
2230
  after?: (slotProps: BubbleSlotProps) => VNode | VNode[];
2231
+ 'content-footer'?: (slotProps: BubbleSlotProps & {
2232
+ contentIndex?: number;
2233
+ }) => VNode | VNode[];
2226
2234
  }
2227
2235
 
2228
2236
  export declare interface ButtonGroupConfig {
@@ -2231,6 +2239,29 @@ export declare interface ButtonGroupConfig {
2231
2239
  voice?: VoiceButtonConfig;
2232
2240
  }
2233
2241
 
2242
+ /**
2243
+ * 聊天消息接口(支持 OpenAI 格式)
2244
+ */
2245
+ declare interface ChatMessage<T extends ChatMessageContent = ChatMessageContent> {
2246
+ role: string;
2247
+ content?: T;
2248
+ reasoning_content?: string;
2249
+ tool_calls?: ToolCall[];
2250
+ tool_call_id?: string;
2251
+ name?: string;
2252
+ }
2253
+
2254
+ export declare type ChatMessageContent = string | ChatMessageContentItem[];
2255
+
2256
+ export declare type ChatMessageContentItem = {
2257
+ type: string;
2258
+ [key: string]: any;
2259
+ };
2260
+
2261
+ declare type ChatMessageWithOptionalRole<T extends ChatMessageContent = ChatMessageContent> = Omit<ChatMessage<T>, 'role'> & {
2262
+ role?: string;
2263
+ };
2264
+
2234
2265
  export declare type ColorMode = 'light' | 'dark' | 'auto';
2235
2266
 
2236
2267
  export declare interface ContainerEmits {
@@ -2267,61 +2298,49 @@ declare const _default: {
2267
2298
  };
2268
2299
  export default _default;
2269
2300
 
2270
- declare const _default_10: typeof _default_28 & {
2271
- install: typeof install_7;
2272
- };
2273
- export { _default_10 as History }
2274
- export { _default_10 as TrHistory }
2275
-
2276
- declare const _default_11: typeof _default_29 & {
2277
- install: typeof install_8;
2278
- };
2279
- export { _default_11 as IconButton }
2280
- export { _default_11 as TrIconButton }
2281
-
2282
- declare const _default_12: typeof _default_32 & {
2301
+ declare const _default_10: typeof _default_30 & {
2283
2302
  install: typeof install_9;
2284
2303
  };
2285
- export { _default_12 as Sender }
2286
- export { _default_12 as TrSender }
2304
+ export { _default_10 as Sender }
2305
+ export { _default_10 as TrSender }
2287
2306
 
2288
- declare const _default_13: typeof _default_34 & {
2307
+ declare const _default_11: typeof _default_32 & {
2289
2308
  install: typeof install_10;
2290
2309
  };
2291
- export { _default_13 as SuggestionPills }
2292
- export { _default_13 as TrSuggestionPills }
2310
+ export { _default_11 as SuggestionPills }
2311
+ export { _default_11 as TrSuggestionPills }
2293
2312
 
2294
- declare const _default_14: typeof _default_35 & {
2313
+ declare const _default_12: typeof _default_33 & {
2295
2314
  install: typeof install_11;
2296
2315
  };
2297
- export { _default_14 as SuggestionPopover }
2298
- export { _default_14 as TrSuggestionPopover }
2316
+ export { _default_12 as SuggestionPopover }
2317
+ export { _default_12 as TrSuggestionPopover }
2299
2318
 
2300
- declare const _default_15: typeof _default_36 & {
2319
+ declare const _default_13: typeof _default_34 & {
2301
2320
  install: typeof install_12;
2302
2321
  };
2303
- export { _default_15 as ThemeProvider }
2304
- export { _default_15 as TrThemeProvider }
2322
+ export { _default_13 as ThemeProvider }
2323
+ export { _default_13 as TrThemeProvider }
2305
2324
 
2306
- declare const _default_16: typeof _default_37 & {
2325
+ declare const _default_14: typeof _default_35 & {
2307
2326
  install: typeof install_13;
2308
2327
  };
2309
- export { _default_16 as TrWelcome }
2310
- export { _default_16 as Welcome }
2328
+ export { _default_14 as TrWelcome }
2329
+ export { _default_14 as Welcome }
2311
2330
 
2312
- declare const _default_17: typeof _default_38 & {
2331
+ declare const _default_15: typeof _default_36 & {
2313
2332
  install: typeof install_14;
2314
2333
  };
2315
- export { _default_17 as McpServerPicker }
2316
- export { _default_17 as TrMcpServerPicker }
2334
+ export { _default_15 as McpServerPicker }
2335
+ export { _default_15 as TrMcpServerPicker }
2317
2336
 
2318
- declare const _default_18: typeof _default_39 & {
2337
+ declare const _default_16: typeof _default_37 & {
2319
2338
  install: typeof install_15;
2320
2339
  };
2321
- export { _default_18 as McpAddForm }
2322
- export { _default_18 as TrMcpAddForm }
2340
+ export { _default_16 as McpAddForm }
2341
+ export { _default_16 as TrMcpAddForm }
2323
2342
 
2324
- declare const _default_19: DefineComponent<AttachmentListProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
2343
+ declare const _default_17: DefineComponent<AttachmentListProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
2325
2344
  "update:items": (items: Attachment[]) => any;
2326
2345
  remove: (file: Attachment) => any;
2327
2346
  download: (event: MouseEvent, file: Attachment) => any;
@@ -2347,27 +2366,27 @@ fileMatchers: FileTypeMatcher[];
2347
2366
  variant: DisplayVariant;
2348
2367
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
2349
2368
 
2350
- declare const _default_2: typeof _default_19 & {
2369
+ declare const _default_18: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2370
+
2371
+ declare const _default_19: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
2372
+
2373
+ declare const _default_2: typeof _default_17 & {
2351
2374
  install: typeof install;
2352
2375
  };
2353
2376
  export { _default_2 as Attachments }
2354
2377
  export { _default_2 as TrAttachments }
2355
2378
 
2356
- declare const _default_20: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2379
+ declare const _default_20: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
2357
2380
 
2358
- declare const _default_21: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
2381
+ declare const _default_21: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
2359
2382
 
2360
- declare const _default_22: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
2383
+ declare const _default_22: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
2361
2384
 
2362
2385
  declare const _default_23: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
2363
2386
 
2364
- declare const _default_24: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
2365
-
2366
- declare const _default_25: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
2367
-
2368
- declare const _default_26: __VLS_WithTemplateSlots_7<typeof __VLS_component_7, __VLS_TemplateResult_7["slots"]>;
2387
+ declare const _default_24: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
2369
2388
 
2370
- declare const _default_27: DefineComponent<FeedbackProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
2389
+ declare const _default_25: DefineComponent<FeedbackProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
2371
2390
  action: (name: string) => any;
2372
2391
  operation: (name: string) => any;
2373
2392
  }, string, PublicProps, Readonly<FeedbackProps> & Readonly<{
@@ -2379,7 +2398,7 @@ actionsLimit: number;
2379
2398
  sourcesLinesLimit: number;
2380
2399
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
2381
2400
 
2382
- declare const _default_28: <T extends HistoryItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2401
+ declare const _default_26: <T extends HistoryItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2383
2402
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
2384
2403
  readonly "onItem-click"?: ((item: T) => any) | undefined;
2385
2404
  readonly "onItem-title-change"?: ((newTitle: string, item: T) => any) | undefined;
@@ -2393,34 +2412,36 @@ declare const _default_28: <T extends HistoryItem>(__VLS_props: NonNullable<Awai
2393
2412
  __ctx?: Awaited<typeof __VLS_setup>;
2394
2413
  };
2395
2414
 
2396
- declare const _default_29: DefineComponent<IconButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IconButtonProps> & Readonly<{}>, {
2415
+ declare const _default_27: DefineComponent<IconButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IconButtonProps> & Readonly<{}>, {
2397
2416
  size: string | number;
2398
2417
  svgSize: string | number;
2399
2418
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
2400
2419
 
2401
- declare const _default_3: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
2402
- export { _default_3 as BubbleBasicBox }
2403
- export { _default_3 as TrBubbleBasicBox }
2404
-
2405
- declare const _default_30: DefineComponent<PromptProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<PromptProps> & Readonly<{}>, {
2420
+ declare const _default_28: DefineComponent<PromptProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<PromptProps> & Readonly<{}>, {
2406
2421
  size: "small" | "medium" | "large";
2407
2422
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
2408
2423
 
2409
- declare const _default_31: __VLS_WithTemplateSlots_8<typeof __VLS_component_8, __VLS_TemplateResult_8["slots"]>;
2424
+ declare const _default_29: __VLS_WithTemplateSlots_7<typeof __VLS_component_7, __VLS_TemplateResult_7["slots"]>;
2425
+
2426
+ declare const _default_3: typeof _default_21 & {
2427
+ install: typeof install_2;
2428
+ };
2429
+ export { _default_3 as Container }
2430
+ export { _default_3 as TrContainer }
2410
2431
 
2411
- declare const _default_32: __VLS_WithTemplateSlots_9<typeof __VLS_component_9, __VLS_TemplateResult_9["slots"]>;
2432
+ declare const _default_30: __VLS_WithTemplateSlots_8<typeof __VLS_component_8, __VLS_TemplateResult_8["slots"]>;
2412
2433
 
2413
- declare const _default_33: __VLS_WithTemplateSlots_10<typeof __VLS_component_10, __VLS_TemplateResult_10["slots"]>;
2434
+ declare const _default_31: __VLS_WithTemplateSlots_9<typeof __VLS_component_9, __VLS_TemplateResult_9["slots"]>;
2414
2435
 
2415
- declare const _default_34: __VLS_WithTemplateSlots_11<typeof __VLS_component_11, __VLS_TemplateResult_11["slots"]>;
2436
+ declare const _default_32: __VLS_WithTemplateSlots_10<typeof __VLS_component_10, __VLS_TemplateResult_10["slots"]>;
2416
2437
 
2417
- declare const _default_35: __VLS_WithTemplateSlots_12<typeof __VLS_component_12, __VLS_TemplateResult_12["slots"]>;
2438
+ declare const _default_33: __VLS_WithTemplateSlots_11<typeof __VLS_component_11, __VLS_TemplateResult_11["slots"]>;
2418
2439
 
2419
- declare const _default_36: __VLS_WithTemplateSlots_13<typeof __VLS_component_13, __VLS_TemplateResult_13["slots"]>;
2440
+ declare const _default_34: __VLS_WithTemplateSlots_12<typeof __VLS_component_12, __VLS_TemplateResult_12["slots"]>;
2420
2441
 
2421
- declare const _default_37: __VLS_WithTemplateSlots_14<typeof __VLS_component_14, __VLS_TemplateResult_14["slots"]>;
2442
+ declare const _default_35: __VLS_WithTemplateSlots_13<typeof __VLS_component_13, __VLS_TemplateResult_13["slots"]>;
2422
2443
 
2423
- declare const _default_38: DefineComponent<__VLS_PublicProps_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
2444
+ declare const _default_36: DefineComponent<__VLS_PublicProps_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
2424
2445
  "update:visible": (value: boolean) => any;
2425
2446
  } & {
2426
2447
  refresh: (tab: "installed" | "market") => any;
@@ -2471,7 +2492,7 @@ allowPluginAdd: boolean;
2471
2492
  marketLoading: boolean;
2472
2493
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2473
2494
 
2474
- declare const _default_39: DefineComponent<McpAddFormProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
2495
+ declare const _default_37: DefineComponent<McpAddFormProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
2475
2496
  cancel: () => any;
2476
2497
  confirm: (type: AddType, data: string | McpAddFormData) => any;
2477
2498
  "update:addType": (value: AddType) => any;
@@ -2483,39 +2504,41 @@ onConfirm?: ((type: AddType, data: string | McpAddFormData) => any) | undefined;
2483
2504
  addType: AddType;
2484
2505
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
2485
2506
 
2486
- declare const _default_4: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2487
- export { _default_4 as BubbleMarkdownRenderer }
2488
- export { _default_4 as TrBubbleMarkdownRenderer }
2507
+ declare const _default_4: typeof _default_22 & {
2508
+ install: typeof install_3;
2509
+ };
2510
+ export { _default_4 as Conversations }
2511
+ export { _default_4 as TrConversations }
2489
2512
 
2490
2513
  declare const _default_5: typeof _default_23 & {
2491
- install: typeof install_2;
2514
+ install: typeof install_4;
2492
2515
  };
2493
- export { _default_5 as Container }
2494
- export { _default_5 as TrContainer }
2516
+ export { _default_5 as DragOverlay }
2517
+ export { _default_5 as TrDragOverlay }
2495
2518
 
2496
2519
  declare const _default_6: typeof _default_24 & {
2497
- install: typeof install_3;
2520
+ install: typeof install_5;
2498
2521
  };
2499
- export { _default_6 as Conversations }
2500
- export { _default_6 as TrConversations }
2522
+ export { _default_6 as DropdownMenu }
2523
+ export { _default_6 as TrDropdownMenu }
2501
2524
 
2502
2525
  declare const _default_7: typeof _default_25 & {
2503
- install: typeof install_4;
2526
+ install: typeof install_6;
2504
2527
  };
2505
- export { _default_7 as DragOverlay }
2506
- export { _default_7 as TrDragOverlay }
2528
+ export { _default_7 as Feedback }
2529
+ export { _default_7 as TrFeedback }
2507
2530
 
2508
2531
  declare const _default_8: typeof _default_26 & {
2509
- install: typeof install_5;
2532
+ install: typeof install_7;
2510
2533
  };
2511
- export { _default_8 as DropdownMenu }
2512
- export { _default_8 as TrDropdownMenu }
2534
+ export { _default_8 as History }
2535
+ export { _default_8 as TrHistory }
2513
2536
 
2514
2537
  declare const _default_9: typeof _default_27 & {
2515
- install: typeof install_6;
2538
+ install: typeof install_8;
2516
2539
  };
2517
- export { _default_9 as Feedback }
2518
- export { _default_9 as TrFeedback }
2540
+ export { _default_9 as IconButton }
2541
+ export { _default_9 as TrIconButton }
2519
2542
 
2520
2543
  export declare type DisplayVariant = 'picture' | 'card' | 'auto';
2521
2544
 
@@ -2986,7 +3009,7 @@ export declare interface PopupConfig {
2986
3009
  };
2987
3010
  }
2988
3011
 
2989
- declare const Prompt: typeof _default_30 & {
3012
+ declare const Prompt: typeof _default_28 & {
2990
3013
  install: typeof installPrompt;
2991
3014
  };
2992
3015
  export { Prompt }
@@ -3023,7 +3046,7 @@ export declare interface PromptProps {
3023
3046
  size?: 'small' | 'medium' | 'large';
3024
3047
  }
3025
3048
 
3026
- declare const Prompts: typeof _default_31 & {
3049
+ declare const Prompts: typeof _default_29 & {
3027
3050
  install: typeof installPrompts;
3028
3051
  };
3029
3052
  export { Prompts }
@@ -3178,7 +3201,7 @@ export declare interface SuggestionGroup<T = Record<string, unknown>> {
3178
3201
 
3179
3202
  export declare type SuggestionItem<T = Record<string, unknown>> = SuggestionBaseItem & T;
3180
3203
 
3181
- declare const SuggestionPillButton: typeof _default_33 & {
3204
+ declare const SuggestionPillButton: typeof _default_31 & {
3182
3205
  install: typeof installPillButton;
3183
3206
  };
3184
3207
  export { SuggestionPillButton }
@@ -3348,14 +3371,14 @@ export declare type ThemeType = 'light' | 'dark';
3348
3371
  /**
3349
3372
  * 工具调用接口(支持 OpenAI 格式)
3350
3373
  */
3351
- export declare interface ToolCall {
3374
+ declare interface ToolCall {
3352
3375
  id: string;
3353
3376
  type: 'function' | string;
3354
3377
  function: {
3355
3378
  name: string;
3356
3379
  arguments: string;
3357
3380
  };
3358
- [x: string]: unknown;
3381
+ [x: string]: any;
3359
3382
  }
3360
3383
 
3361
3384
  declare interface TooltipContentProps {
@@ -3376,6 +3399,43 @@ export declare interface UrlAttachment extends BaseAttachment {
3376
3399
  rawFile?: File;
3377
3400
  }
3378
3401
 
3402
+ /**
3403
+ * 当目标滚动容器 `target` 接近底部时,且源数据 `source` 变化,自动滚动到底部
3404
+ * @param target 目标滚动容器的元素引用
3405
+ * @param source 监听的源数据,当该数据变化时会触发自动滚动
3406
+ * @param options 配置选项
3407
+ * @param options.scrollOnMount 是否在组件挂载时滚动到底部,默认为 true
3408
+ * @param options.bottomThreshold 判断接近底部的阈值(像素),默认为 20
3409
+ * @returns scrollToBottom 手动滚动到底部的方法
3410
+ */
3411
+ export declare function useAutoScroll(target: MaybeComputedElementRef, source: MaybeRefOrGetter<any>, options?: {
3412
+ scrollOnMount?: boolean;
3413
+ scrollThrottle?: number;
3414
+ bottomThreshold?: number;
3415
+ }): {
3416
+ scrollToBottom: (behavior?: ScrollBehavior) => Promise<void>;
3417
+ };
3418
+
3419
+ export declare function useBubbleBoxRenderer(messages: MaybeRefOrGetter<BubbleMessage[]>, contentIndex?: number): ComputedRef<{
3420
+ renderer: Component;
3421
+ attributes?: Record<string, string>;
3422
+ }>;
3423
+
3424
+ export declare function useBubbleContentRenderer(message: MaybeRefOrGetter<BubbleMessage>, contentIndex?: number): ComputedRef<Component>;
3425
+
3426
+ export declare function useBubbleStateChangeFn(): (key: string, _value: unknown) => void;
3427
+
3428
+ /**
3429
+ * Omit specified fields from message and return computed props
3430
+ * @param props - The original props containing the message
3431
+ * @param fields - Array of field names to omit from the message
3432
+ * @returns An object containing restMessage and restProps computed refs
3433
+ */
3434
+ export declare function useOmitMessageFields<P extends BubbleContentRendererProps, K extends keyof BubbleMessage>(props: P, fields: K[]): {
3435
+ restMessage: ComputedRef<Omit<BubbleMessage, K>>;
3436
+ restProps: ComputedRef<P>;
3437
+ };
3438
+
3379
3439
  export declare type UserItem = UserTextItem | UserTemplateItem;
3380
3440
 
3381
3441
  export declare type UserTemplateItem = Omit<Pick<TemplateItem, 'type' | 'content'>, 'id'> & {