@opentiny/tiny-robot 0.3.0-alpha.8 → 0.3.0-rc.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
@@ -1,6 +1,7 @@
1
1
  import { AllowedComponentProps } from 'vue';
2
2
  import { App } from 'vue';
3
3
  import { AutoSize as AutoSize_2 } from './index.type';
4
+ import { BubbleContentItem as BubbleContentItem_2 } from './renderers';
4
5
  import { Component } from 'vue';
5
6
  import { ComponentCustomProperties } from 'vue';
6
7
  import { ComponentCustomProps } from 'vue';
@@ -22,11 +23,11 @@ import { FileTypeMatcher as FileTypeMatcher_2 } from './index.type';
22
23
  import { GlobalComponents } from 'vue';
23
24
  import { GlobalDirectives } from 'vue';
24
25
  import { InputMode as InputMode_2 } from './index.type';
26
+ import { ISuggestionItem as ISuggestionItem_2 } from './index.type';
25
27
  import { MarketCategoryOption as MarketCategoryOption_2 } from './index.type';
26
28
  import { nextTick } from 'vue';
27
29
  import { OnCleanup } from '@vue/reactivity';
28
30
  import { Options } from 'markdown-it';
29
- import { Props } from './components/SuggestionList.vue';
30
31
  import { PropType } from 'vue';
31
32
  import { PublicProps } from 'vue';
32
33
  import { Ref } from 'vue';
@@ -44,13 +45,15 @@ import { WatchOptions } from 'vue';
44
45
  import { WatchStopHandle } from 'vue';
45
46
 
46
47
  declare const __VLS_component: DefineComponent<BubbleProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleProps> & Readonly<{}>, {
47
- content: string;
48
+ content: string | BubbleContentItem_2[];
48
49
  placement: "start" | "end";
49
50
  shape: "rounded" | "corner";
50
51
  maxWidth: string | number;
51
52
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
52
53
 
53
- declare const __VLS_component_10: DefineComponent<__VLS_PublicProps_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
54
+ declare const __VLS_component_10: DefineComponent<__VLS_PublicProps_4, {
55
+ update: () => void;
56
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
54
57
  "update:selectedGroup": (value: string) => any;
55
58
  } & {
56
59
  close: () => any;
@@ -113,7 +116,8 @@ transitionProps?: TransitionProps;
113
116
  triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
114
117
  }> & Readonly<{}>, {
115
118
  triggerRef: ComputedRef<HTMLElement | SVGElement | null | undefined>;
116
- popperRef: Ref<HTMLElement | SVGElement | null | undefined, HTMLElement | SVGElement | null | undefined>;
119
+ popperRef: ComputedRef<HTMLDivElement | null>;
120
+ update: () => void;
117
121
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
118
122
  placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
119
123
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
@@ -149,9 +153,10 @@ preventOverflow?: boolean;
149
153
  show?: boolean;
150
154
  transitionProps?: TransitionProps;
151
155
  triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
152
- }> & Readonly<{}>, "placement" | "triggerRef" | "popperRef"> & ShallowUnwrapRef< {
156
+ }> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> & ShallowUnwrapRef< {
153
157
  triggerRef: ComputedRef<HTMLElement | SVGElement | null | undefined>;
154
- popperRef: Ref<HTMLElement | SVGElement | null | undefined, HTMLElement | SVGElement | null | undefined>;
158
+ popperRef: ComputedRef<HTMLDivElement | null>;
159
+ update: () => void;
155
160
  }> & {} & ComponentCustomProperties & {} & {
156
161
  $slots: Readonly<{
157
162
  trigger?: () => VNode[];
@@ -187,7 +192,7 @@ align: "left" | "center" | "right" | string;
187
192
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
188
193
 
189
194
  declare const __VLS_component_2: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
190
- messageRenderers: Record<string, BubbleMessageRenderer>;
195
+ contentRenderers: Record<string, BubbleContentRenderer>;
191
196
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
192
197
 
193
198
  declare const __VLS_component_3: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
@@ -200,7 +205,9 @@ declare const __VLS_component_3: DefineComponent<__VLS_PublicProps, {}, {}, {},
200
205
 
201
206
  declare const __VLS_component_4: DefineComponent<DragOverlayProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DragOverlayProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
202
207
 
203
- declare const __VLS_component_5: DefineComponent<__VLS_PublicProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
208
+ declare const __VLS_component_5: DefineComponent<__VLS_PublicProps_2, {
209
+ update: () => void;
210
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
204
211
  "update:show": (value: boolean) => any;
205
212
  } & {
206
213
  "item-click": (item: DropdownMenuItem) => any;
@@ -254,7 +261,8 @@ transitionProps?: TransitionProps;
254
261
  triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
255
262
  }> & Readonly<{}>, {
256
263
  triggerRef: ComputedRef<HTMLElement | SVGElement | null | undefined>;
257
- popperRef: Ref<HTMLElement | SVGElement | null | undefined, HTMLElement | SVGElement | null | undefined>;
264
+ popperRef: ComputedRef<HTMLDivElement | null>;
265
+ update: () => void;
258
266
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
259
267
  placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
260
268
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
@@ -290,9 +298,10 @@ preventOverflow?: boolean;
290
298
  show?: boolean;
291
299
  transitionProps?: TransitionProps;
292
300
  triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
293
- }> & Readonly<{}>, "placement" | "triggerRef" | "popperRef"> & ShallowUnwrapRef< {
301
+ }> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> & ShallowUnwrapRef< {
294
302
  triggerRef: ComputedRef<HTMLElement | SVGElement | null | undefined>;
295
- popperRef: Ref<HTMLElement | SVGElement | null | undefined, HTMLElement | SVGElement | null | undefined>;
303
+ popperRef: ComputedRef<HTMLDivElement | null>;
304
+ update: () => void;
296
305
  }> & {} & ComponentCustomProperties & {} & {
297
306
  $slots: Readonly<{
298
307
  trigger?: () => VNode[];
@@ -318,17 +327,44 @@ submit: () => void;
318
327
  startSpeech: () => void;
319
328
  stopSpeech: () => void;
320
329
  activateTemplateFirstField: () => void;
321
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
322
- [x: string]: any;
323
- } & {
324
- [x: string]: any;
330
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
331
+ clear: () => any;
332
+ blur: (event: FocusEvent) => any;
333
+ cancel: () => any;
334
+ focus: (event: FocusEvent) => any;
335
+ submit: (value: string) => any;
336
+ "update:modelValue": (value: string) => any;
337
+ "update:templateData": (value: UserItem[]) => any;
338
+ "speech-start": () => any;
339
+ "speech-end": (transcript?: string | undefined) => any;
340
+ "speech-interim": (transcript: string) => any;
341
+ "speech-error": (error: Error) => any;
342
+ "suggestion-select": (value: string) => any;
343
+ "escape-press": () => any;
344
+ "reset-template": () => any;
345
+ "files-selected": (files: File[]) => any;
325
346
  }, string, PublicProps, Readonly<SenderProps> & Readonly<{
326
- [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
347
+ onClear?: (() => any) | undefined;
348
+ onBlur?: ((event: FocusEvent) => any) | undefined;
349
+ onCancel?: (() => any) | undefined;
350
+ onFocus?: ((event: FocusEvent) => any) | undefined;
351
+ onSubmit?: ((value: string) => any) | undefined;
352
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
353
+ "onUpdate:templateData"?: ((value: UserItem[]) => any) | undefined;
354
+ "onSpeech-start"?: (() => any) | undefined;
355
+ "onSpeech-end"?: ((transcript?: string | undefined) => any) | undefined;
356
+ "onSpeech-interim"?: ((transcript: string) => any) | undefined;
357
+ "onSpeech-error"?: ((error: Error) => any) | undefined;
358
+ "onSuggestion-select"?: ((value: string) => any) | undefined;
359
+ "onEscape-press"?: (() => any) | undefined;
360
+ "onReset-template"?: (() => any) | undefined;
361
+ "onFiles-selected"?: ((files: File[]) => any) | undefined;
327
362
  }>, {
328
- mode: InputMode_2;
329
- loading: boolean;
330
363
  disabled: boolean;
331
364
  modelValue: string;
365
+ placeholder: string;
366
+ mode: InputMode_2;
367
+ loading: boolean;
332
368
  autofocus: boolean;
333
369
  clearable: boolean;
334
370
  showWordLimit: boolean;
@@ -336,10 +372,9 @@ allowSpeech: boolean;
336
372
  allowFiles: boolean;
337
373
  submitType: SubmitTrigger_2;
338
374
  stopText: string;
339
- suggestions: string[];
375
+ suggestions: ISuggestionItem_2[];
340
376
  autoSize: AutoSize_2;
341
377
  maxLength: number;
342
- placeholder: string;
343
378
  suggestionPopupWidth: string | number;
344
379
  theme: ThemeType_2;
345
380
  templateData: UserItem[];
@@ -827,28 +862,6 @@ showTooltip: boolean;
827
862
  inputBoxType: string;
828
863
  }> | null;
829
864
  buttonsContainerRef: HTMLDivElement;
830
- suggestionsListRef: CreateComponentPublicInstanceWithMixins<Readonly<Props> & Readonly<{
831
- onSelect?: ((item: string) => any) | undefined;
832
- "onItem-hover"?: ((index: number) => any) | undefined;
833
- "onItem-leave"?: (() => any) | undefined;
834
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
835
- select: (item: string) => any;
836
- "item-hover": (index: number) => any;
837
- "item-leave": () => any;
838
- }, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
839
- suggestionsListRef: HTMLDivElement;
840
- }, any, ComponentProvideOptions, {
841
- P: {};
842
- B: {};
843
- D: {};
844
- C: {};
845
- M: {};
846
- Defaults: {};
847
- }, Readonly<Props> & Readonly<{
848
- onSelect?: ((item: string) => any) | undefined;
849
- "onItem-hover"?: ((index: number) => any) | undefined;
850
- "onItem-leave"?: (() => any) | undefined;
851
- }>, {}, {}, {}, {}, {}> | null;
852
865
  }, HTMLDivElement>;
853
866
 
854
867
  declare const __VLS_component_8: DefineComponent<SuggestionPillButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SuggestionPillButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
@@ -874,7 +887,7 @@ floatingMaybeItemRefs: unknown[];
874
887
  }, HTMLDivElement>;
875
888
 
876
889
  declare type __VLS_Props = {
877
- messageRenderers?: Record<string, BubbleMessageRenderer>;
890
+ contentRenderers?: Record<string, BubbleContentRenderer>;
878
891
  };
879
892
 
880
893
  declare type __VLS_Props_2 = DropdownMenuProps;
@@ -883,6 +896,8 @@ declare type __VLS_Props_3 = SuggestionPillsProps;
883
896
 
884
897
  declare type __VLS_Props_4 = SuggestionPopoverProps;
885
898
 
899
+ declare type __VLS_Props_5 = McpServerPickerProps;
900
+
886
901
  declare type __VLS_PublicProps = {
887
902
  'show': ContainerProps['show'];
888
903
  'fullscreen'?: ContainerProps['fullscreen'];
@@ -900,6 +915,10 @@ declare type __VLS_PublicProps_4 = {
900
915
  'selectedGroup'?: string;
901
916
  } & __VLS_Props_4;
902
917
 
918
+ declare type __VLS_PublicProps_5 = {
919
+ 'visible': boolean;
920
+ } & __VLS_Props_5;
921
+
903
922
  declare function __VLS_template(): {
904
923
  attrs: Partial<{}>;
905
924
  slots: Readonly<BubbleSlots> & BubbleSlots;
@@ -953,7 +972,8 @@ declare function __VLS_template_10(): {
953
972
  triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
954
973
  }> & Readonly<{}>, {
955
974
  triggerRef: ComputedRef<HTMLElement | SVGElement | null | undefined>;
956
- popperRef: Ref<HTMLElement | SVGElement | null | undefined, HTMLElement | SVGElement | null | undefined>;
975
+ popperRef: ComputedRef<HTMLDivElement | null>;
976
+ update: () => void;
957
977
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
958
978
  placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
959
979
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
@@ -989,9 +1009,10 @@ declare function __VLS_template_10(): {
989
1009
  show?: boolean;
990
1010
  transitionProps?: TransitionProps;
991
1011
  triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
992
- }> & Readonly<{}>, "placement" | "triggerRef" | "popperRef"> & ShallowUnwrapRef< {
1012
+ }> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> & ShallowUnwrapRef< {
993
1013
  triggerRef: ComputedRef<HTMLElement | SVGElement | null | undefined>;
994
- popperRef: Ref<HTMLElement | SVGElement | null | undefined, HTMLElement | SVGElement | null | undefined>;
1014
+ popperRef: ComputedRef<HTMLDivElement | null>;
1015
+ update: () => void;
995
1016
  }> & {} & ComponentCustomProperties & {} & {
996
1017
  $slots: Readonly<{
997
1018
  trigger?: () => VNode[];
@@ -1106,7 +1127,8 @@ declare function __VLS_template_5(): {
1106
1127
  triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
1107
1128
  }> & Readonly<{}>, {
1108
1129
  triggerRef: ComputedRef<HTMLElement | SVGElement | null | undefined>;
1109
- popperRef: Ref<HTMLElement | SVGElement | null | undefined, HTMLElement | SVGElement | null | undefined>;
1130
+ popperRef: ComputedRef<HTMLDivElement | null>;
1131
+ update: () => void;
1110
1132
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
1111
1133
  placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
1112
1134
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
@@ -1142,9 +1164,10 @@ declare function __VLS_template_5(): {
1142
1164
  show?: boolean;
1143
1165
  transitionProps?: TransitionProps;
1144
1166
  triggerEvents?: Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
1145
- }> & Readonly<{}>, "placement" | "triggerRef" | "popperRef"> & ShallowUnwrapRef< {
1167
+ }> & Readonly<{}>, "placement" | "popperRef" | "update" | "triggerRef"> & ShallowUnwrapRef< {
1146
1168
  triggerRef: ComputedRef<HTMLElement | SVGElement | null | undefined>;
1147
- popperRef: Ref<HTMLElement | SVGElement | null | undefined, HTMLElement | SVGElement | null | undefined>;
1169
+ popperRef: ComputedRef<HTMLDivElement | null>;
1170
+ update: () => void;
1148
1171
  }> & {} & ComponentCustomProperties & {} & {
1149
1172
  $slots: Readonly<{
1150
1173
  trigger?: () => VNode[];
@@ -1660,28 +1683,6 @@ declare function __VLS_template_7(): {
1660
1683
  inputBoxType: string;
1661
1684
  }> | null;
1662
1685
  buttonsContainerRef: HTMLDivElement;
1663
- suggestionsListRef: CreateComponentPublicInstanceWithMixins<Readonly<Props> & Readonly<{
1664
- onSelect?: ((item: string) => any) | undefined;
1665
- "onItem-hover"?: ((index: number) => any) | undefined;
1666
- "onItem-leave"?: (() => any) | undefined;
1667
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
1668
- select: (item: string) => any;
1669
- "item-hover": (index: number) => any;
1670
- "item-leave": () => any;
1671
- }, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
1672
- suggestionsListRef: HTMLDivElement;
1673
- }, any, ComponentProvideOptions, {
1674
- P: {};
1675
- B: {};
1676
- D: {};
1677
- C: {};
1678
- M: {};
1679
- Defaults: {};
1680
- }, Readonly<Props> & Readonly<{
1681
- onSelect?: ((item: string) => any) | undefined;
1682
- "onItem-hover"?: ((index: number) => any) | undefined;
1683
- "onItem-leave"?: (() => any) | undefined;
1684
- }>, {}, {}, {}, {}, {}> | null;
1685
1686
  };
1686
1687
  rootEl: HTMLDivElement;
1687
1688
  };
@@ -1818,61 +1819,14 @@ export declare interface ActionButtonsProps {
1818
1819
  stopText?: string;
1819
1820
  }
1820
1821
 
1821
- export declare interface AddPluginCodeData {
1822
- aiPlugin: string;
1823
- openapi: string;
1824
- }
1825
-
1826
- export declare interface AddPluginDialogEmits {
1827
- (e: 'update:visible', value: boolean): void;
1828
- (e: 'confirm', data: AddPluginFormData): void;
1829
- (e: 'cancel'): void;
1830
- (e: 'open-code-editor'): void;
1831
- }
1832
-
1833
- export declare interface AddPluginDialogProps {
1834
- visible: boolean;
1835
- title?: string;
1836
- }
1837
-
1838
- export declare interface AddPluginFormData {
1839
- name: string;
1840
- description: string;
1841
- type: string;
1842
- url: string;
1843
- headers: string;
1844
- thumbnail?: File | null;
1845
- }
1846
-
1847
- export declare type Attachment = {
1848
- id?: string;
1849
- name?: string;
1850
- status?: FileStatus;
1851
- url: string;
1852
- fileType?: FileType;
1853
- size: number;
1854
- message?: string;
1855
- rawFile?: File;
1856
- } | {
1857
- id?: string;
1858
- name?: string;
1859
- status?: FileStatus;
1860
- url?: string;
1861
- fileType?: FileType;
1862
- size?: number;
1863
- message?: string;
1864
- rawFile: File;
1865
- };
1822
+ export declare type Attachment = UrlAttachment | RawFileAttachment;
1866
1823
 
1867
1824
  export declare interface AttachmentListEmits {
1868
1825
  (e: 'update:items', items: Attachment[]): void;
1869
1826
  (e: 'remove', file: Attachment): void;
1870
- (e: 'download', payload: {
1871
- event: MouseEvent;
1872
- file: Attachment;
1873
- }): void;
1827
+ (e: 'download', event: MouseEvent, file: Attachment): void;
1874
1828
  (e: 'retry', file: Attachment): void;
1875
- (e: 'preview', file: Attachment): void;
1829
+ (e: 'preview', event: MouseEvent, file: Attachment): void;
1876
1830
  (e: 'action', payload: {
1877
1831
  action: ActionButton;
1878
1832
  file: Attachment;
@@ -1894,6 +1848,14 @@ export declare type AutoSize = boolean | {
1894
1848
  maxRows: number;
1895
1849
  };
1896
1850
 
1851
+ export declare interface BaseAttachment {
1852
+ id?: string;
1853
+ name?: string;
1854
+ status?: FileStatus;
1855
+ fileType?: FileType;
1856
+ message?: string;
1857
+ }
1858
+
1897
1859
  declare type BaseCardProps = Pick<AttachmentListProps, 'fileIcons' | 'disabled' | 'actions' | 'fileMatchers'>;
1898
1860
 
1899
1861
  export declare type BaseFileType = 'image' | 'pdf' | 'word' | 'excel' | 'ppt' | 'folder' | 'other';
@@ -1932,10 +1894,38 @@ export declare interface BubbleCommonProps {
1932
1894
  * 气泡形状,默认 'corner'
1933
1895
  */
1934
1896
  shape?: 'rounded' | 'corner';
1935
- hidden?: boolean;
1897
+ /**
1898
+ * 气泡内容渲染器。
1899
+ * 如果 Bubble 中的 content 是长度大于 0 的数组,则 contentRenderer 无效。将会使用 BubbleProvider 中注册的渲染器
1900
+ */
1901
+ contentRenderer?: BubbleContentRenderer;
1902
+ /**
1903
+ * 自定义气泡内容字段。比如 customContentField 设置为 'my-content',则 Bubble 优先渲染 my-content 属性到气泡内容
1904
+ */
1905
+ customContentField?: string;
1906
+ /**
1907
+ * 气泡最大宽度
1908
+ */
1936
1909
  maxWidth?: string | number;
1937
1910
  }
1938
1911
 
1912
+ export declare abstract class BubbleContentClassRenderer {
1913
+ abstract render(options: {
1914
+ [key: string]: any;
1915
+ }): VNode;
1916
+ }
1917
+
1918
+ export declare type BubbleContentFunctionRenderer = (options: {
1919
+ [key: string]: any;
1920
+ }) => VNode;
1921
+
1922
+ export declare interface BubbleContentItem {
1923
+ type: string;
1924
+ [key: string]: any;
1925
+ }
1926
+
1927
+ export declare type BubbleContentRenderer = BubbleContentFunctionRenderer | BubbleContentClassRenderer | Component;
1928
+
1939
1929
  declare const bubbleInstall: (app: App) => void;
1940
1930
 
1941
1931
  declare const BubbleList: typeof _default_17 & {
@@ -1965,45 +1955,33 @@ export declare interface BubbleListProps {
1965
1955
  autoScroll?: boolean;
1966
1956
  }
1967
1957
 
1968
- export declare class BubbleMarkdownMessageRenderer extends BubbleMessageClassRenderer {
1958
+ export declare class BubbleMarkdownContentRenderer extends BubbleContentClassRenderer {
1969
1959
  readonly mdConfig: Options;
1970
- readonly dompurifyConfig: Config & {
1971
- disable?: boolean;
1972
- };
1960
+ readonly dompurifyConfig: Config;
1961
+ readonly sanitizeDisabled: boolean;
1962
+ readonly defaultAttrs: Record<string, unknown>;
1973
1963
  private md;
1974
- constructor(mdConfig?: Options, dompurifyConfig?: Config & {
1975
- disable?: boolean;
1976
- });
1964
+ constructor(options?: BubbleMarkdownRendererOptions);
1977
1965
  render(options: {
1978
1966
  content?: string;
1967
+ [key: string]: unknown;
1979
1968
  }): VNode<RendererNode, RendererElement, {
1980
1969
  [key: string]: any;
1981
1970
  }>;
1982
1971
  }
1983
1972
 
1984
- export declare abstract class BubbleMessageClassRenderer {
1985
- abstract render(options: {
1986
- [key: string]: any;
1987
- }): VNode;
1988
- }
1989
-
1990
- export declare type BubbleMessageFunctionRenderer = (options: {
1991
- [key: string]: any;
1992
- }) => VNode;
1993
-
1994
- export declare interface BubbleMessageProps {
1995
- type: string;
1996
- [key: string]: any;
1973
+ declare interface BubbleMarkdownRendererOptions {
1974
+ mdConfig?: Options;
1975
+ dompurifyConfig?: Config;
1976
+ sanitizeDisabled?: boolean;
1977
+ defaultAttrs?: Record<string, unknown>;
1997
1978
  }
1998
1979
 
1999
- export declare type BubbleMessageRenderer = BubbleMessageFunctionRenderer | BubbleMessageClassRenderer | Component;
2000
-
2001
1980
  export declare interface BubbleProps extends BubbleCommonProps {
2002
1981
  /**
2003
1982
  * 气泡内容
2004
1983
  */
2005
- content?: string;
2006
- messages?: BubbleMessageProps[];
1984
+ content?: string | BubbleContentItem[];
2007
1985
  id?: string | number | symbol;
2008
1986
  role?: string;
2009
1987
  loading?: boolean;
@@ -2019,6 +1997,7 @@ export { BubbleProvider as TrBubbleProvider }
2019
1997
  declare const bubbleProviderInstall: (app: App) => void;
2020
1998
 
2021
1999
  export declare type BubbleRoleConfig = BubbleCommonProps & {
2000
+ hidden?: boolean;
2022
2001
  slots?: BubbleSlots;
2023
2002
  };
2024
2003
 
@@ -2062,17 +2041,6 @@ export declare interface ControlState {
2062
2041
  disabled?: boolean;
2063
2042
  }
2064
2043
 
2065
- export declare interface CreatePluginDialogEmits {
2066
- (e: 'update:visible', value: boolean): void;
2067
- (e: 'confirm', data: AddPluginCodeData): void;
2068
- (e: 'cancel'): void;
2069
- }
2070
-
2071
- export declare interface CreatePluginDialogProps {
2072
- visible: boolean;
2073
- title?: string;
2074
- }
2075
-
2076
2044
  declare const _default: {
2077
2045
  install<T>(app: App<T>): void;
2078
2046
  };
@@ -2111,12 +2079,9 @@ export { _default_14 as TrMcpServerPicker }
2111
2079
  declare const _default_15: DefineComponent<AttachmentListProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
2112
2080
  "update:items": (items: Attachment[]) => any;
2113
2081
  remove: (file: Attachment) => any;
2114
- download: (payload: {
2115
- event: MouseEvent;
2116
- file: Attachment;
2117
- }) => any;
2082
+ download: (event: MouseEvent, file: Attachment) => any;
2118
2083
  retry: (file: Attachment) => any;
2119
- preview: (file: Attachment) => any;
2084
+ preview: (event: MouseEvent, file: Attachment) => any;
2120
2085
  action: (payload: {
2121
2086
  action: ActionButton;
2122
2087
  file: Attachment;
@@ -2124,12 +2089,9 @@ file: Attachment;
2124
2089
  }, string, PublicProps, Readonly<AttachmentListProps> & Readonly<{
2125
2090
  "onUpdate:items"?: ((items: Attachment[]) => any) | undefined;
2126
2091
  onRemove?: ((file: Attachment) => any) | undefined;
2127
- onDownload?: ((payload: {
2128
- event: MouseEvent;
2129
- file: Attachment;
2130
- }) => any) | undefined;
2092
+ onDownload?: ((event: MouseEvent, file: Attachment) => any) | undefined;
2131
2093
  onRetry?: ((file: Attachment) => any) | undefined;
2132
- onPreview?: ((file: Attachment) => any) | undefined;
2094
+ onPreview?: ((event: MouseEvent, file: Attachment) => any) | undefined;
2133
2095
  onAction?: ((payload: {
2134
2096
  action: ActionButton;
2135
2097
  file: Attachment;
@@ -2199,21 +2161,39 @@ declare const _default_30: __VLS_WithTemplateSlots_10<typeof __VLS_component_10,
2199
2161
 
2200
2162
  declare const _default_31: __VLS_WithTemplateSlots_11<typeof __VLS_component_11, __VLS_TemplateResult_11["slots"]>;
2201
2163
 
2202
- declare const _default_32: DefineComponent<McpServerPickerProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
2203
- [x: string]: any;
2164
+ declare const _default_32: DefineComponent<__VLS_PublicProps_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
2165
+ "update:visible": (value: boolean) => any;
2204
2166
  } & {
2205
- [x: string]: any;
2206
- }, string, PublicProps, Readonly<McpServerPickerProps> & Readonly<{
2207
- [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
2167
+ refresh: (tab: "installed" | "market") => any;
2168
+ "update:visible": (visible: boolean) => any;
2169
+ "market-category-change": (category: string) => any;
2170
+ "tab-change": (activeTab: "installed" | "market") => any;
2171
+ "plugin-toggle": (plugin: PluginInfo, enabled: boolean) => any;
2172
+ "plugin-delete": (plugin: PluginInfo) => any;
2173
+ "plugin-add": (plugin: PluginInfo, added: boolean) => any;
2174
+ "plugin-create": (type: "code" | "form", data: PluginCreationData) => any;
2175
+ "tool-toggle": (plugin: PluginInfo, toolId: string, enabled: boolean) => any;
2176
+ "update:activeCount": (count: number) => any;
2177
+ }, string, PublicProps, Readonly<__VLS_PublicProps_5> & Readonly<{
2178
+ onRefresh?: ((tab: "installed" | "market") => any) | undefined;
2179
+ "onUpdate:visible"?: ((value: boolean) => any) | undefined;
2180
+ "onMarket-category-change"?: ((category: string) => any) | undefined;
2181
+ "onTab-change"?: ((activeTab: "installed" | "market") => any) | undefined;
2182
+ "onPlugin-toggle"?: ((plugin: PluginInfo, enabled: boolean) => any) | undefined;
2183
+ "onPlugin-delete"?: ((plugin: PluginInfo) => any) | undefined;
2184
+ "onPlugin-add"?: ((plugin: PluginInfo, added: boolean) => any) | undefined;
2185
+ "onPlugin-create"?: ((type: "code" | "form", data: PluginCreationData) => any) | undefined;
2186
+ "onTool-toggle"?: ((plugin: PluginInfo, toolId: string, enabled: boolean) => any) | undefined;
2187
+ "onUpdate:activeCount"?: ((count: number) => any) | undefined;
2208
2188
  }>, {
2209
2189
  title: string;
2210
2190
  loading: boolean;
2211
- visible: boolean;
2212
2191
  searchPlaceholder: string;
2213
- enableParentChildSync: boolean;
2214
2192
  installedPlugins: PluginInfo[];
2215
2193
  marketPlugins: PluginInfo[];
2216
2194
  enableSearch: boolean;
2195
+ installedSearchFn: (query: string, item: PluginInfo) => boolean;
2196
+ marketSearchFn: (query: string, item: PluginInfo) => boolean;
2217
2197
  marketCategoryOptions: MarketCategoryOption_2[];
2218
2198
  marketCategoryPlaceholder: string;
2219
2199
  enableMarketCategoryFilter: boolean;
@@ -2459,11 +2439,8 @@ export declare interface FeedbackProps {
2459
2439
 
2460
2440
  export declare interface FileCardEmits {
2461
2441
  (e: 'remove', file: Attachment): void;
2462
- (e: 'preview', file: Attachment): void;
2463
- (e: 'download', payload: {
2464
- event: MouseEvent;
2465
- file: Attachment;
2466
- }): void;
2442
+ (e: 'preview', event: MouseEvent, file: Attachment): void;
2443
+ (e: 'download', event: MouseEvent, file: Attachment): void;
2467
2444
  (e: 'retry', file: Attachment): void;
2468
2445
  (e: 'action', payload: {
2469
2446
  action: ActionButton;
@@ -2480,10 +2457,8 @@ export declare interface FileCardProps extends BaseCardProps {
2480
2457
  /**
2481
2458
  * 文件拒绝信息
2482
2459
  */
2483
- export declare interface FileRejection {
2460
+ export declare interface FileRejection extends RejectionReason {
2484
2461
  files: File[];
2485
- code: DragZoneErrorCode;
2486
- message: string;
2487
2462
  }
2488
2463
 
2489
2464
  export declare type FileStatus = 'uploading' | 'success' | 'error';
@@ -2508,6 +2483,8 @@ export declare interface Handlers {
2508
2483
  handleDrop: (e: DragEvent) => void;
2509
2484
  }
2510
2485
 
2486
+ declare type HighlightFunction = (suggestionText: string, inputText: string) => SuggestionTextPart[];
2487
+
2511
2488
  export declare type HistoryData = HistoryItem[] | HistoryGroup[];
2512
2489
 
2513
2490
  export declare interface HistoryEvents {
@@ -2582,6 +2559,11 @@ declare const installPrompt: <T>(app: App<T>) => void;
2582
2559
 
2583
2560
  declare const installPrompts: <T>(app: App<T>) => void;
2584
2561
 
2562
+ export declare interface ISuggestionItem {
2563
+ content: string;
2564
+ highlights?: string[] | HighlightFunction;
2565
+ }
2566
+
2585
2567
  export declare interface KeyboardHandler {
2586
2568
  handleKeyPress: (e: KeyboardEvent) => void;
2587
2569
  triggerSubmit: () => void;
@@ -2593,17 +2575,13 @@ export declare interface MarketCategoryOption {
2593
2575
  }
2594
2576
 
2595
2577
  export declare interface McpServerPickerEmits {
2596
- (e: 'search', query: string, tab: 'installed' | 'market'): void;
2597
2578
  (e: 'market-category-change', category: string): void;
2598
2579
  (e: 'tab-change', activeTab: 'installed' | 'market'): void;
2599
2580
  (e: 'plugin-toggle', plugin: PluginInfo, enabled: boolean): void;
2600
2581
  (e: 'plugin-delete', plugin: PluginInfo): void;
2601
2582
  (e: 'plugin-add', plugin: PluginInfo, added: boolean): void;
2602
- (e: 'plugin-expand', plugin: PluginInfo, expanded: boolean): void;
2583
+ (e: 'plugin-create', type: 'form' | 'code', data: PluginCreationData): void;
2603
2584
  (e: 'tool-toggle', plugin: PluginInfo, toolId: string, enabled: boolean): void;
2604
- (e: 'custom-add'): void;
2605
- (e: 'plugin-form-add', data: AddPluginFormData): void;
2606
- (e: 'plugin-code-add', data: AddPluginCodeData): void;
2607
2585
  (e: 'refresh', tab: 'installed' | 'market'): void;
2608
2586
  (e: 'update:activeCount', count: number): void;
2609
2587
  (e: 'update:visible', visible: boolean): void;
@@ -2614,6 +2592,8 @@ export declare interface McpServerPickerProps {
2614
2592
  marketPlugins?: PluginInfo[];
2615
2593
  searchPlaceholder?: string;
2616
2594
  enableSearch?: boolean;
2595
+ installedSearchFn?: (query: string, item: PluginInfo) => boolean;
2596
+ marketSearchFn?: (query: string, item: PluginInfo) => boolean;
2617
2597
  marketCategoryOptions?: MarketCategoryOption[];
2618
2598
  marketCategoryPlaceholder?: string;
2619
2599
  enableMarketCategoryFilter?: boolean;
@@ -2632,7 +2612,6 @@ export declare interface McpServerPickerProps {
2632
2612
  allowToolToggle?: boolean;
2633
2613
  allowPluginDelete?: boolean;
2634
2614
  allowPluginAdd?: boolean;
2635
- enableParentChildSync?: boolean;
2636
2615
  loading?: boolean;
2637
2616
  marketLoading?: boolean;
2638
2617
  }
@@ -2646,8 +2625,6 @@ export declare type MultiTabHistoryProps = {
2646
2625
  } & BaseHistoryProps;
2647
2626
 
2648
2627
  export declare interface PluginCardEmits {
2649
- (e: 'update:expanded', value: boolean): void;
2650
- (e: 'toggle-expand'): void;
2651
2628
  (e: 'toggle-plugin', enabled: boolean): void;
2652
2629
  (e: 'toggle-tool', toolId: string, enabled: boolean): void;
2653
2630
  (e: 'add-plugin', added: boolean): void;
@@ -2659,15 +2636,18 @@ export declare type PluginCardMode = 'installed' | 'market';
2659
2636
  export declare interface PluginCardProps {
2660
2637
  plugin: PluginInfo;
2661
2638
  mode?: PluginCardMode;
2662
- expandable?: boolean;
2663
- expanded?: boolean;
2664
2639
  showToolCount?: boolean;
2665
- enableParentChildSync?: boolean;
2666
2640
  }
2667
2641
 
2668
- export declare interface PluginDialogState {
2669
- codeEditor: boolean;
2670
- formEditor: boolean;
2642
+ export declare type PluginCreationData = PluginFormData | string;
2643
+
2644
+ export declare interface PluginFormData {
2645
+ name: string;
2646
+ description: string;
2647
+ type: 'sse' | 'streamableHttp';
2648
+ url: string;
2649
+ headers: string;
2650
+ thumbnail?: File | null;
2671
2651
  }
2672
2652
 
2673
2653
  export declare interface PluginInfo {
@@ -2675,14 +2655,18 @@ export declare interface PluginInfo {
2675
2655
  name: string;
2676
2656
  icon: string;
2677
2657
  description: string;
2678
- toolCount?: number;
2679
- enabled?: boolean;
2658
+ enabled: boolean;
2680
2659
  expanded?: boolean;
2681
- tools?: PluginTool[];
2660
+ tools: PluginTool[];
2682
2661
  added?: boolean;
2683
2662
  category?: string;
2684
2663
  }
2685
2664
 
2665
+ export declare interface PluginModalEmits {
2666
+ (e: 'update:visible', value: boolean): void;
2667
+ (e: 'confirm', type: 'form' | 'code', data: PluginCreationData): void;
2668
+ }
2669
+
2686
2670
  export declare interface PluginTool {
2687
2671
  id: string;
2688
2672
  name: string;
@@ -2773,6 +2757,20 @@ export declare interface PromptsSlots {
2773
2757
  footer?: () => unknown;
2774
2758
  }
2775
2759
 
2760
+ export declare interface RawFileAttachment extends BaseAttachment {
2761
+ rawFile: File;
2762
+ url?: string;
2763
+ size?: number;
2764
+ }
2765
+
2766
+ /**
2767
+ * 文件拒绝原因
2768
+ */
2769
+ export declare interface RejectionReason {
2770
+ code: DragZoneErrorCode;
2771
+ message: string;
2772
+ }
2773
+
2776
2774
  export declare type SenderEmits = {
2777
2775
  (e: 'update:modelValue', value: string): void;
2778
2776
  (e: 'update:templateData', value: UserItem[]): void;
@@ -2808,7 +2806,7 @@ export declare interface SenderProps {
2808
2806
  speech?: boolean | SpeechConfig;
2809
2807
  placeholder?: string;
2810
2808
  showWordLimit?: boolean;
2811
- suggestions?: string[];
2809
+ suggestions?: ISuggestionItem[];
2812
2810
  suggestionPopupWidth?: string | number;
2813
2811
  theme?: ThemeType;
2814
2812
  templateData?: UserItem[];
@@ -3015,11 +3013,21 @@ export declare type ThemeType = 'light' | 'dark';
3015
3013
 
3016
3014
  export declare type TooltipRender = () => VNode | string;
3017
3015
 
3016
+ export declare interface UrlAttachment extends BaseAttachment {
3017
+ url: string;
3018
+ size: number;
3019
+ rawFile?: File;
3020
+ }
3021
+
3018
3022
  export declare type UserItem = UserTextItem | UserTemplateItem;
3019
3023
 
3020
- export declare type UserTemplateItem = Pick<TemplateItem, 'type' | 'content'>;
3024
+ export declare type UserTemplateItem = Omit<Pick<TemplateItem, 'type' | 'content'>, 'id'> & {
3025
+ id?: TemplateItem['id'];
3026
+ };
3021
3027
 
3022
- export declare type UserTextItem = Omit<TextItem, 'id'>;
3028
+ export declare type UserTextItem = Omit<TextItem, 'id'> & {
3029
+ id?: TextItem['id'];
3030
+ };
3023
3031
 
3024
3032
  /**
3025
3033
  * 拖拽区域指令