@opentiny/genui-sdk-vue 1.2.1 → 1.3.0-alpha.3

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.
Files changed (36) hide show
  1. package/README.md +10 -2
  2. package/dist/ConfigProvider-BzxW9L3f.js +95 -0
  3. package/dist/ConfigProvider-BzxW9L3f.js.map +1 -0
  4. package/dist/GenuiRenderer-B9wcUl25.js +15164 -0
  5. package/dist/GenuiRenderer-B9wcUl25.js.map +1 -0
  6. package/dist/___vite-browser-external_commonjs-proxy-4gYZYw55.js +1 -0
  7. package/dist/___vite-browser-external_commonjs-proxy-4gYZYw55.js.map +1 -0
  8. package/dist/chat.d.ts +82 -2410
  9. package/dist/chat.js +18 -19
  10. package/dist/chat.js.map +1 -0
  11. package/dist/chat.types-BRLoMarP.js +1792 -0
  12. package/dist/chat.types-BRLoMarP.js.map +1 -0
  13. package/dist/config-provider.d.ts +9 -0
  14. package/dist/config-provider.js +6 -1
  15. package/dist/config-provider.js.map +1 -0
  16. package/dist/index.d.ts +89 -2407
  17. package/dist/index.js +28 -26
  18. package/dist/index.js.map +1 -0
  19. package/dist/{injection-tokens-D8CFCpjy.js → injection-tokens-CuDQs1ne.js} +49 -49
  20. package/dist/injection-tokens-CuDQs1ne.js.map +1 -0
  21. package/dist/legacy-chat.d.ts +1277 -0
  22. package/dist/legacy-chat.js +67 -0
  23. package/dist/legacy-chat.js.map +1 -0
  24. package/dist/legacy-renderer.d.ts +59 -0
  25. package/dist/legacy-renderer.js +41 -0
  26. package/dist/legacy-renderer.js.map +1 -0
  27. package/dist/renderer.d.ts +6 -2031
  28. package/dist/renderer.js +2 -1
  29. package/dist/renderer.js.map +1 -0
  30. package/dist/transform-jsx.d.ts +3 -1
  31. package/dist/transform-jsx.js +1 -0
  32. package/dist/transform-jsx.js.map +1 -0
  33. package/package.json +30 -33
  34. package/dist/ConfigProvider-BaJsiFgd.js +0 -86
  35. package/dist/SchemaCardRenderer-Bjn61C0M.js +0 -13440
  36. package/dist/chat.types-Cqd67Yp-.js +0 -1753
@@ -0,0 +1,1277 @@
1
+ import { AIClient } from '@opentiny/tiny-robot-kit';
2
+ import { AllowedComponentProps } from 'vue';
3
+ import { BubbleCommonProps } from '@opentiny/tiny-robot';
4
+ import { BubbleMarkdownContentRenderer } from '@opentiny/tiny-robot';
5
+ import { BubbleProps } from '@opentiny/tiny-robot';
6
+ import { BubbleRoleConfig } from '@opentiny/tiny-robot';
7
+ import { CardSchema } from '@opentiny/genui-sdk-core';
8
+ import { ChatMessage } from '@opentiny/tiny-robot-kit';
9
+ import { Component } from 'vue';
10
+ import { ComponentCustomProperties } from 'vue';
11
+ import { ComponentCustomProps } from 'vue';
12
+ import { ComponentInternalInstance } from 'vue';
13
+ import { ComponentOptionsBase } from 'vue';
14
+ import { ComponentOptionsMixin } from 'vue';
15
+ import { ComponentProvideOptions } from 'vue';
16
+ import { ComponentPublicInstance } from 'vue';
17
+ import { ComputedRef } from 'vue';
18
+ import { Conversation } from '@opentiny/tiny-robot-kit';
19
+ import { ConversationState } from '@opentiny/tiny-robot-kit';
20
+ import { ConversationStorageStrategy } from '@opentiny/tiny-robot-kit';
21
+ import { DebuggerEvent } from 'vue';
22
+ import { DefineComponent } from 'vue';
23
+ import { GlobalComponents } from 'vue';
24
+ import { GlobalDirectives } from 'vue';
25
+ import { IChatMessage } from '@opentiny/genui-sdk-core';
26
+ import { IGenPromptAction } from '@opentiny/genui-sdk-core';
27
+ import { IGenPromptComponent } from '@opentiny/genui-sdk-core';
28
+ import { IGenPromptExample } from '@opentiny/genui-sdk-core';
29
+ import { IGenPromptSnippet } from '@opentiny/genui-sdk-core';
30
+ import { IMaterials } from '@opentiny/genui-sdk-core';
31
+ import { InjectionKey } from 'vue';
32
+ import { INotificationPayload } from '@opentiny/genui-sdk-core';
33
+ import { IStreamData } from '@opentiny/genui-sdk-core';
34
+ import { MessageState } from '@opentiny/tiny-robot-kit';
35
+ import { nextTick } from 'vue';
36
+ import { OnCleanup } from '@vue/reactivity';
37
+ import { PublicProps } from 'vue';
38
+ import { Reactive } from 'vue';
39
+ import { Ref } from 'vue';
40
+ import { RendererElement } from 'vue';
41
+ import { RendererNode } from 'vue';
42
+ import { ShallowUnwrapRef } from 'vue';
43
+ import { Slot } from 'vue';
44
+ import { UnwrapNestedRefs } from 'vue';
45
+ import { UseConversationOptions } from '@opentiny/tiny-robot-kit';
46
+ import { UseMessageReturn as UseMessageReturn_3 } from '@opentiny/tiny-robot-kit';
47
+ import { UserItem } from '@opentiny/tiny-robot';
48
+ import { VNode } from 'vue';
49
+ import { VNodeProps } from 'vue';
50
+ import { WatchOptions } from 'vue';
51
+ import { WatchStopHandle } from 'vue';
52
+
53
+ declare const __VLS_component: DefineComponent<IChatProps, {
54
+ $: ComponentInternalInstance;
55
+ $data: {};
56
+ $props: Partial<{}> & Omit<{
57
+ readonly url?: string;
58
+ readonly model?: string;
59
+ readonly temperature?: number;
60
+ readonly messages?: IMessage_2[];
61
+ readonly chatConfig?: IChatConfig_2;
62
+ readonly requiredCompleteFieldSelectors?: string[];
63
+ readonly customComponents?: ICustomComponentItem_2[];
64
+ readonly customSnippets?: IGenPromptSnippet[];
65
+ readonly customExamples?: IGenPromptExample[];
66
+ readonly customActions?: ICustomActionItem_2[];
67
+ readonly rendererSlots?: IRendererSlots_2;
68
+ readonly thinkComponent?: Component<BubbleProps>;
69
+ readonly roles?: IRolesConfig_2;
70
+ readonly features?: ModelCapability_2;
71
+ readonly customFetch?: CustomFetch_2;
72
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
73
+ $attrs: {
74
+ [x: string]: unknown;
75
+ };
76
+ $refs: {
77
+ [x: string]: unknown;
78
+ } & {
79
+ messagesContainer: HTMLDivElement;
80
+ };
81
+ $slots: Readonly<{
82
+ [name: string]: Slot<any>;
83
+ }> & {
84
+ empty?(_: {}): any;
85
+ };
86
+ $root: ComponentPublicInstance | null;
87
+ $parent: ComponentPublicInstance | null;
88
+ $host: Element | null;
89
+ $emit: (event: string, ...args: any[]) => void;
90
+ $el: HTMLDivElement;
91
+ $options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
92
+ setInputMessage: (message: string) => void;
93
+ handleNewConversation: () => void;
94
+ getProps: () => IChatProps;
95
+ getConversation: () => UseConversationReturn_2;
96
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
97
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
98
+ getMessageRenderers: () => {
99
+ 'custom-text': (props: BubbleCommonProps & {
100
+ content: string;
101
+ }) => VNode<RendererNode, RendererElement, {
102
+ [key: string]: any;
103
+ }>;
104
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
105
+ [key: string]: any;
106
+ }>;
107
+ tool: DefineComponent< {
108
+ name: string;
109
+ status: "running" | "success" | "failed" | "cancelled";
110
+ content?: string | {
111
+ params?: object;
112
+ result?: object;
113
+ [x: string]: unknown;
114
+ };
115
+ formatPretty?: boolean;
116
+ defaultOpen?: boolean;
117
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
118
+ name: string;
119
+ status: "running" | "success" | "failed" | "cancelled";
120
+ content?: string | {
121
+ params?: object;
122
+ result?: object;
123
+ [x: string]: unknown;
124
+ };
125
+ formatPretty?: boolean;
126
+ defaultOpen?: boolean;
127
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
128
+ reasoning: DefineComponent< {
129
+ content: string;
130
+ thinking?: boolean;
131
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
132
+ content: string;
133
+ thinking?: boolean;
134
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
135
+ markdown: BubbleMarkdownContentRenderer;
136
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
137
+ attachments: FileMeta[];
138
+ templateData: UserItem[];
139
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
140
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
141
+ 'error-text': DefineComponent< {
142
+ content: string;
143
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
144
+ content: string;
145
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
146
+ };
147
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
148
+ generating: ComputedRef<boolean>;
149
+ lastSchemaCardId: ComputedRef<any>;
150
+ continueChatAction: {
151
+ name: string;
152
+ description: string;
153
+ execute: (params: {
154
+ message: string;
155
+ }, context: Record<string, any>) => void;
156
+ parameters: {
157
+ type: "object";
158
+ properties: {
159
+ message: {
160
+ type: string;
161
+ description: string;
162
+ };
163
+ };
164
+ };
165
+ };
166
+ saveStateAction: {
167
+ name: string;
168
+ description: string;
169
+ execute: (params: any, context: Record<string | symbol, any>) => void;
170
+ parameters: {
171
+ type: "null";
172
+ };
173
+ };
174
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
175
+ beforeCreate?: (() => void) | (() => void)[];
176
+ created?: (() => void) | (() => void)[];
177
+ beforeMount?: (() => void) | (() => void)[];
178
+ mounted?: (() => void) | (() => void)[];
179
+ beforeUpdate?: (() => void) | (() => void)[];
180
+ updated?: (() => void) | (() => void)[];
181
+ activated?: (() => void) | (() => void)[];
182
+ deactivated?: (() => void) | (() => void)[];
183
+ beforeDestroy?: (() => void) | (() => void)[];
184
+ beforeUnmount?: (() => void) | (() => void)[];
185
+ destroyed?: (() => void) | (() => void)[];
186
+ unmounted?: (() => void) | (() => void)[];
187
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
188
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
189
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
190
+ };
191
+ $forceUpdate: () => void;
192
+ $nextTick: nextTick;
193
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
194
+ messages?: IMessage_2[];
195
+ customComponents?: ICustomComponentItem_2[];
196
+ customActions?: ICustomActionItem_2[];
197
+ requiredCompleteFieldSelectors?: string[];
198
+ customFetch?: CustomFetch_2;
199
+ url?: string;
200
+ model?: string;
201
+ temperature?: number;
202
+ customSnippets?: IGenPromptSnippet[];
203
+ customExamples?: IGenPromptExample[];
204
+ chatConfig?: IChatConfig_2;
205
+ rendererSlots?: IRendererSlots_2;
206
+ thinkComponent?: Component<BubbleProps>;
207
+ roles?: IRolesConfig_2;
208
+ features?: ModelCapability_2;
209
+ setInputMessage: (message: string) => void;
210
+ handleNewConversation: () => void;
211
+ getProps: () => IChatProps;
212
+ getConversation: () => UseConversationReturn_2;
213
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
214
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
215
+ getMessageRenderers: () => {
216
+ 'custom-text': (props: BubbleCommonProps & {
217
+ content: string;
218
+ }) => VNode<RendererNode, RendererElement, {
219
+ [key: string]: any;
220
+ }>;
221
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
222
+ [key: string]: any;
223
+ }>;
224
+ tool: DefineComponent< {
225
+ name: string;
226
+ status: "running" | "success" | "failed" | "cancelled";
227
+ content?: string | {
228
+ params?: object;
229
+ result?: object;
230
+ [x: string]: unknown;
231
+ };
232
+ formatPretty?: boolean;
233
+ defaultOpen?: boolean;
234
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
235
+ name: string;
236
+ status: "running" | "success" | "failed" | "cancelled";
237
+ content?: string | {
238
+ params?: object;
239
+ result?: object;
240
+ [x: string]: unknown;
241
+ };
242
+ formatPretty?: boolean;
243
+ defaultOpen?: boolean;
244
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
245
+ reasoning: DefineComponent< {
246
+ content: string;
247
+ thinking?: boolean;
248
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
249
+ content: string;
250
+ thinking?: boolean;
251
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
252
+ markdown: BubbleMarkdownContentRenderer;
253
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
254
+ attachments: FileMeta[];
255
+ templateData: UserItem[];
256
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
257
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
258
+ 'error-text': DefineComponent< {
259
+ content: string;
260
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
261
+ content: string;
262
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
263
+ };
264
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
265
+ generating: boolean;
266
+ lastSchemaCardId: any;
267
+ continueChatAction: {
268
+ name: string;
269
+ description: string;
270
+ execute: (params: {
271
+ message: string;
272
+ }, context: Record<string, any>) => void;
273
+ parameters: {
274
+ type: "object";
275
+ properties: {
276
+ message: {
277
+ type: string;
278
+ description: string;
279
+ };
280
+ };
281
+ };
282
+ };
283
+ saveStateAction: {
284
+ name: string;
285
+ description: string;
286
+ execute: (params: any, context: Record<string | symbol, any>) => void;
287
+ parameters: {
288
+ type: "null";
289
+ };
290
+ };
291
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IChatProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {
292
+ chatRef: {
293
+ $: ComponentInternalInstance;
294
+ $data: {};
295
+ $props: Partial<{}> & Omit<{
296
+ readonly url?: string;
297
+ readonly model?: string;
298
+ readonly temperature?: number;
299
+ readonly messages?: IMessage_2[];
300
+ readonly chatConfig?: IChatConfig_2;
301
+ readonly requiredCompleteFieldSelectors?: string[];
302
+ readonly customComponents?: ICustomComponentItem_2[];
303
+ readonly customSnippets?: IGenPromptSnippet[];
304
+ readonly customExamples?: IGenPromptExample[];
305
+ readonly customActions?: ICustomActionItem_2[];
306
+ readonly rendererSlots?: IRendererSlots_2;
307
+ readonly thinkComponent?: Component<BubbleProps>;
308
+ readonly roles?: IRolesConfig_2;
309
+ readonly features?: ModelCapability_2;
310
+ readonly customFetch?: CustomFetch_2;
311
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
312
+ $attrs: {
313
+ [x: string]: unknown;
314
+ };
315
+ $refs: {
316
+ [x: string]: unknown;
317
+ } & {
318
+ messagesContainer: HTMLDivElement;
319
+ };
320
+ $slots: Readonly<{
321
+ [name: string]: Slot<any>;
322
+ }>;
323
+ $root: ComponentPublicInstance | null;
324
+ $parent: ComponentPublicInstance | null;
325
+ $host: Element | null;
326
+ $emit: (event: string, ...args: any[]) => void;
327
+ $el: HTMLDivElement;
328
+ $options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
329
+ setInputMessage: (message: string) => void;
330
+ handleNewConversation: () => void;
331
+ getProps: () => IChatProps;
332
+ getConversation: () => UseConversationReturn_2;
333
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
334
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
335
+ getMessageRenderers: () => {
336
+ 'custom-text': (props: BubbleCommonProps & {
337
+ content: string;
338
+ }) => VNode<RendererNode, RendererElement, {
339
+ [key: string]: any;
340
+ }>;
341
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
342
+ [key: string]: any;
343
+ }>;
344
+ tool: DefineComponent< {
345
+ name: string;
346
+ status: "running" | "success" | "failed" | "cancelled";
347
+ content?: string | {
348
+ params?: object;
349
+ result?: object;
350
+ [x: string]: unknown;
351
+ };
352
+ formatPretty?: boolean;
353
+ defaultOpen?: boolean;
354
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
355
+ name: string;
356
+ status: "running" | "success" | "failed" | "cancelled";
357
+ content?: string | {
358
+ params?: object;
359
+ result?: object;
360
+ [x: string]: unknown;
361
+ };
362
+ formatPretty?: boolean;
363
+ defaultOpen?: boolean;
364
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
365
+ reasoning: DefineComponent< {
366
+ content: string;
367
+ thinking?: boolean;
368
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
369
+ content: string;
370
+ thinking?: boolean;
371
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
372
+ markdown: BubbleMarkdownContentRenderer;
373
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
374
+ attachments: FileMeta[];
375
+ templateData: UserItem[];
376
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
377
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
378
+ 'error-text': DefineComponent< {
379
+ content: string;
380
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
381
+ content: string;
382
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
383
+ };
384
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
385
+ generating: ComputedRef<boolean>;
386
+ lastSchemaCardId: ComputedRef<any>;
387
+ continueChatAction: {
388
+ name: string;
389
+ description: string;
390
+ execute: (params: {
391
+ message: string;
392
+ }, context: Record<string, any>) => void;
393
+ parameters: {
394
+ type: "object";
395
+ properties: {
396
+ message: {
397
+ type: string;
398
+ description: string;
399
+ };
400
+ };
401
+ };
402
+ };
403
+ saveStateAction: {
404
+ name: string;
405
+ description: string;
406
+ execute: (params: any, context: Record<string | symbol, any>) => void;
407
+ parameters: {
408
+ type: "null";
409
+ };
410
+ };
411
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
412
+ beforeCreate?: (() => void) | (() => void)[];
413
+ created?: (() => void) | (() => void)[];
414
+ beforeMount?: (() => void) | (() => void)[];
415
+ mounted?: (() => void) | (() => void)[];
416
+ beforeUpdate?: (() => void) | (() => void)[];
417
+ updated?: (() => void) | (() => void)[];
418
+ activated?: (() => void) | (() => void)[];
419
+ deactivated?: (() => void) | (() => void)[];
420
+ beforeDestroy?: (() => void) | (() => void)[];
421
+ beforeUnmount?: (() => void) | (() => void)[];
422
+ destroyed?: (() => void) | (() => void)[];
423
+ unmounted?: (() => void) | (() => void)[];
424
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
425
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
426
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
427
+ };
428
+ $forceUpdate: () => void;
429
+ $nextTick: nextTick;
430
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
431
+ } & Readonly<{}> & Omit<Readonly<IChatProps> & Readonly<{}>, "generating" | "continueChatAction" | "saveStateAction" | "setInputMessage" | "handleNewConversation" | "getProps" | "getConversation" | "getResponseHandlers" | "setResponseHandlers" | "getMessageRenderers" | "setMessageRenderer" | "lastSchemaCardId"> & ShallowUnwrapRef< {
432
+ setInputMessage: (message: string) => void;
433
+ handleNewConversation: () => void;
434
+ getProps: () => IChatProps;
435
+ getConversation: () => UseConversationReturn_2;
436
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
437
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
438
+ getMessageRenderers: () => {
439
+ 'custom-text': (props: BubbleCommonProps & {
440
+ content: string;
441
+ }) => VNode<RendererNode, RendererElement, {
442
+ [key: string]: any;
443
+ }>;
444
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
445
+ [key: string]: any;
446
+ }>;
447
+ tool: DefineComponent< {
448
+ name: string;
449
+ status: "running" | "success" | "failed" | "cancelled";
450
+ content?: string | {
451
+ params?: object;
452
+ result?: object;
453
+ [x: string]: unknown;
454
+ };
455
+ formatPretty?: boolean;
456
+ defaultOpen?: boolean;
457
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
458
+ name: string;
459
+ status: "running" | "success" | "failed" | "cancelled";
460
+ content?: string | {
461
+ params?: object;
462
+ result?: object;
463
+ [x: string]: unknown;
464
+ };
465
+ formatPretty?: boolean;
466
+ defaultOpen?: boolean;
467
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
468
+ reasoning: DefineComponent< {
469
+ content: string;
470
+ thinking?: boolean;
471
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
472
+ content: string;
473
+ thinking?: boolean;
474
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
475
+ markdown: BubbleMarkdownContentRenderer;
476
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
477
+ attachments: FileMeta[];
478
+ templateData: UserItem[];
479
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
480
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
481
+ 'error-text': DefineComponent< {
482
+ content: string;
483
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
484
+ content: string;
485
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
486
+ };
487
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
488
+ generating: ComputedRef<boolean>;
489
+ lastSchemaCardId: ComputedRef<any>;
490
+ continueChatAction: {
491
+ name: string;
492
+ description: string;
493
+ execute: (params: {
494
+ message: string;
495
+ }, context: Record<string, any>) => void;
496
+ parameters: {
497
+ type: "object";
498
+ properties: {
499
+ message: {
500
+ type: string;
501
+ description: string;
502
+ };
503
+ };
504
+ };
505
+ };
506
+ saveStateAction: {
507
+ name: string;
508
+ description: string;
509
+ execute: (params: any, context: Record<string | symbol, any>) => void;
510
+ parameters: {
511
+ type: "null";
512
+ };
513
+ };
514
+ }> & {} & ComponentCustomProperties & {} & {
515
+ $slots: {
516
+ empty?(_: {}): any;
517
+ };
518
+ };
519
+ }, HTMLDivElement>;
520
+
521
+ declare function __VLS_template(): {
522
+ attrs: Partial<{}>;
523
+ slots: any;
524
+ refs: {
525
+ chatRef: {
526
+ $: ComponentInternalInstance;
527
+ $data: {};
528
+ $props: Partial<{}> & Omit<{
529
+ readonly url?: string;
530
+ readonly model?: string;
531
+ readonly temperature?: number;
532
+ readonly messages?: IMessage_2[];
533
+ readonly chatConfig?: IChatConfig_2;
534
+ readonly requiredCompleteFieldSelectors?: string[];
535
+ readonly customComponents?: ICustomComponentItem_2[];
536
+ readonly customSnippets?: IGenPromptSnippet[];
537
+ readonly customExamples?: IGenPromptExample[];
538
+ readonly customActions?: ICustomActionItem_2[];
539
+ readonly rendererSlots?: IRendererSlots_2;
540
+ readonly thinkComponent?: Component<BubbleProps>;
541
+ readonly roles?: IRolesConfig_2;
542
+ readonly features?: ModelCapability_2;
543
+ readonly customFetch?: CustomFetch_2;
544
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
545
+ $attrs: {
546
+ [x: string]: unknown;
547
+ };
548
+ $refs: {
549
+ [x: string]: unknown;
550
+ } & {
551
+ messagesContainer: HTMLDivElement;
552
+ };
553
+ $slots: Readonly<{
554
+ [name: string]: Slot<any>;
555
+ }>;
556
+ $root: ComponentPublicInstance | null;
557
+ $parent: ComponentPublicInstance | null;
558
+ $host: Element | null;
559
+ $emit: (event: string, ...args: any[]) => void;
560
+ $el: HTMLDivElement;
561
+ $options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
562
+ setInputMessage: (message: string) => void;
563
+ handleNewConversation: () => void;
564
+ getProps: () => IChatProps;
565
+ getConversation: () => UseConversationReturn_2;
566
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
567
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
568
+ getMessageRenderers: () => {
569
+ 'custom-text': (props: BubbleCommonProps & {
570
+ content: string;
571
+ }) => VNode<RendererNode, RendererElement, {
572
+ [key: string]: any;
573
+ }>;
574
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
575
+ [key: string]: any;
576
+ }>;
577
+ tool: DefineComponent< {
578
+ name: string;
579
+ status: "running" | "success" | "failed" | "cancelled";
580
+ content?: string | {
581
+ params?: object;
582
+ result?: object;
583
+ [x: string]: unknown;
584
+ };
585
+ formatPretty?: boolean;
586
+ defaultOpen?: boolean;
587
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
588
+ name: string;
589
+ status: "running" | "success" | "failed" | "cancelled";
590
+ content?: string | {
591
+ params?: object;
592
+ result?: object;
593
+ [x: string]: unknown;
594
+ };
595
+ formatPretty?: boolean;
596
+ defaultOpen?: boolean;
597
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
598
+ reasoning: DefineComponent< {
599
+ content: string;
600
+ thinking?: boolean;
601
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
602
+ content: string;
603
+ thinking?: boolean;
604
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
605
+ markdown: BubbleMarkdownContentRenderer;
606
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
607
+ attachments: FileMeta[];
608
+ templateData: UserItem[];
609
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
610
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
611
+ 'error-text': DefineComponent< {
612
+ content: string;
613
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
614
+ content: string;
615
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
616
+ };
617
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
618
+ generating: ComputedRef<boolean>;
619
+ lastSchemaCardId: ComputedRef<any>;
620
+ continueChatAction: {
621
+ name: string;
622
+ description: string;
623
+ execute: (params: {
624
+ message: string;
625
+ }, context: Record<string, any>) => void;
626
+ parameters: {
627
+ type: "object";
628
+ properties: {
629
+ message: {
630
+ type: string;
631
+ description: string;
632
+ };
633
+ };
634
+ };
635
+ };
636
+ saveStateAction: {
637
+ name: string;
638
+ description: string;
639
+ execute: (params: any, context: Record<string | symbol, any>) => void;
640
+ parameters: {
641
+ type: "null";
642
+ };
643
+ };
644
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
645
+ beforeCreate?: (() => void) | (() => void)[];
646
+ created?: (() => void) | (() => void)[];
647
+ beforeMount?: (() => void) | (() => void)[];
648
+ mounted?: (() => void) | (() => void)[];
649
+ beforeUpdate?: (() => void) | (() => void)[];
650
+ updated?: (() => void) | (() => void)[];
651
+ activated?: (() => void) | (() => void)[];
652
+ deactivated?: (() => void) | (() => void)[];
653
+ beforeDestroy?: (() => void) | (() => void)[];
654
+ beforeUnmount?: (() => void) | (() => void)[];
655
+ destroyed?: (() => void) | (() => void)[];
656
+ unmounted?: (() => void) | (() => void)[];
657
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
658
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
659
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
660
+ };
661
+ $forceUpdate: () => void;
662
+ $nextTick: nextTick;
663
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
664
+ } & Readonly<{}> & Omit<Readonly<IChatProps> & Readonly<{}>, "generating" | "continueChatAction" | "saveStateAction" | "setInputMessage" | "handleNewConversation" | "getProps" | "getConversation" | "getResponseHandlers" | "setResponseHandlers" | "getMessageRenderers" | "setMessageRenderer" | "lastSchemaCardId"> & ShallowUnwrapRef< {
665
+ setInputMessage: (message: string) => void;
666
+ handleNewConversation: () => void;
667
+ getProps: () => IChatProps;
668
+ getConversation: () => UseConversationReturn_2;
669
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
670
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
671
+ getMessageRenderers: () => {
672
+ 'custom-text': (props: BubbleCommonProps & {
673
+ content: string;
674
+ }) => VNode<RendererNode, RendererElement, {
675
+ [key: string]: any;
676
+ }>;
677
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
678
+ [key: string]: any;
679
+ }>;
680
+ tool: DefineComponent< {
681
+ name: string;
682
+ status: "running" | "success" | "failed" | "cancelled";
683
+ content?: string | {
684
+ params?: object;
685
+ result?: object;
686
+ [x: string]: unknown;
687
+ };
688
+ formatPretty?: boolean;
689
+ defaultOpen?: boolean;
690
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
691
+ name: string;
692
+ status: "running" | "success" | "failed" | "cancelled";
693
+ content?: string | {
694
+ params?: object;
695
+ result?: object;
696
+ [x: string]: unknown;
697
+ };
698
+ formatPretty?: boolean;
699
+ defaultOpen?: boolean;
700
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
701
+ reasoning: DefineComponent< {
702
+ content: string;
703
+ thinking?: boolean;
704
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
705
+ content: string;
706
+ thinking?: boolean;
707
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
708
+ markdown: BubbleMarkdownContentRenderer;
709
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
710
+ attachments: FileMeta[];
711
+ templateData: UserItem[];
712
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
713
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
714
+ 'error-text': DefineComponent< {
715
+ content: string;
716
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
717
+ content: string;
718
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
719
+ };
720
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
721
+ generating: ComputedRef<boolean>;
722
+ lastSchemaCardId: ComputedRef<any>;
723
+ continueChatAction: {
724
+ name: string;
725
+ description: string;
726
+ execute: (params: {
727
+ message: string;
728
+ }, context: Record<string, any>) => void;
729
+ parameters: {
730
+ type: "object";
731
+ properties: {
732
+ message: {
733
+ type: string;
734
+ description: string;
735
+ };
736
+ };
737
+ };
738
+ };
739
+ saveStateAction: {
740
+ name: string;
741
+ description: string;
742
+ execute: (params: any, context: Record<string | symbol, any>) => void;
743
+ parameters: {
744
+ type: "null";
745
+ };
746
+ };
747
+ }> & {} & ComponentCustomProperties & {} & {
748
+ $slots: {
749
+ empty?(_: {}): any;
750
+ };
751
+ };
752
+ };
753
+ rootEl: HTMLDivElement;
754
+ };
755
+
756
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
757
+
758
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
759
+ new (): {
760
+ $slots: S;
761
+ };
762
+ };
763
+
764
+ export declare function createI18n(options?: I18nOptions): I18nInstance;
765
+
766
+ /**
767
+ * 自定义请求函数类型
768
+ * @param url 请求地址
769
+ * @param options 请求选项(包含 method, headers, body, signal 等)
770
+ * @returns 返回 Response 对象或 Promise<Response>
771
+ */
772
+ export declare type CustomFetch = (url: string, options: {
773
+ method: string;
774
+ headers: Record<string, string>;
775
+ body: string;
776
+ signal?: AbortSignal;
777
+ }) => Promise<Response> | Response;
778
+
779
+ /**
780
+ * 自定义请求函数类型
781
+ * @param url 请求地址
782
+ * @param options 请求选项(包含 method, headers, body, signal 等)
783
+ * @returns 返回 Response 对象或 Promise<Response>
784
+ */
785
+ declare type CustomFetch_2 = (url: string, options: {
786
+ method: string;
787
+ headers: Record<string, string>;
788
+ body: string;
789
+ signal?: AbortSignal;
790
+ }) => Promise<Response> | Response;
791
+
792
+ export declare const DEFAULT_IMAGE_FEATURES: ImageFeatures;
793
+
794
+ export declare const emitter: EventEmitter;
795
+
796
+ export declare class EventEmitter {
797
+ private events;
798
+ constructor();
799
+ /**
800
+ * @param {string} eventName - 事件名
801
+ * @param {Function} callback - 回调函数
802
+ * @param {boolean} [once=false] - 是否只触发一次
803
+ */
804
+ on(eventName: string, callback: Function, once?: boolean): void;
805
+ /**
806
+ * @param {string} eventName - 事件名
807
+ * @param {Function} callback - 要移除的回调(必须是注册时的同一个函数引用)
808
+ */
809
+ off(eventName: string, callback: Function): void;
810
+ /**
811
+ * @param {string} eventName - 事件名
812
+ * @param {...any} args - 传递给回调的参数
813
+ */
814
+ emit(eventName: string, ...args: any[]): void;
815
+ /**
816
+ * @param {string} eventName - 事件名
817
+ * @param {Function} callback - 回调函数
818
+ */
819
+ once(eventName: string, callback: Function): void;
820
+ }
821
+
822
+ declare interface FileMeta {
823
+ name: string;
824
+ type: string;
825
+ size: number;
826
+ lastModified: number;
827
+ base64: string;
828
+ }
829
+
830
+ export declare const GENUI_CONFIG: unique symbol;
831
+
832
+ export declare const GENUI_I18N: unique symbol;
833
+
834
+ export declare const GENUI_MATERIALS: InjectionKey<IMaterials>;
835
+
836
+ export declare const GenuiLegacyChat: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
837
+
838
+ export declare interface I18nInstance {
839
+ locale: Ref<string>;
840
+ messages: Readonly<Reactive<UnwrapNestedRefs<I18nMessages>>>;
841
+ setLocale: (lang: string) => void;
842
+ mergeMessages: (newMessages: I18nMessages, isCoverSameKey?: boolean) => void;
843
+ t: (key: string, params?: I18nTranslateParams) => string;
844
+ }
845
+
846
+ export declare type I18nMessageObject = {
847
+ [key: string]: string | I18nMessageObject;
848
+ };
849
+
850
+ export declare type I18nMessages = {
851
+ [lang: string]: I18nMessageObject;
852
+ };
853
+
854
+ export declare interface I18nOptions {
855
+ locale?: string;
856
+ messages?: I18nMessages;
857
+ }
858
+
859
+ export declare type I18nTranslateParams = {
860
+ [key: string]: string | number | boolean;
861
+ };
862
+
863
+ export declare interface IBubbleSlotsProps {
864
+ index: number;
865
+ bubbleProps: BubbleProps;
866
+ isFinished: boolean;
867
+ messageManager: UseMessageReturn_3;
868
+ chatMessage: IChatMessage;
869
+ }
870
+
871
+ export declare interface IChatConfig {
872
+ addToolCallContext?: boolean;
873
+ showThinkingResult?: boolean;
874
+ }
875
+
876
+ declare interface IChatConfig_2 {
877
+ addToolCallContext?: boolean;
878
+ showThinkingResult?: boolean;
879
+ }
880
+
881
+ export declare interface IChatProps {
882
+ url?: string;
883
+ model?: string;
884
+ temperature?: number;
885
+ messages?: IMessage[];
886
+ chatConfig?: IChatConfig;
887
+ requiredCompleteFieldSelectors?: string[];
888
+ customComponents?: ICustomComponentItem[];
889
+ customSnippets?: IGenPromptSnippet[];
890
+ customExamples?: IGenPromptExample[];
891
+ customActions?: ICustomActionItem[];
892
+ rendererSlots?: IRendererSlots;
893
+ thinkComponent?: Component<BubbleProps>;
894
+ roles?: IRolesConfig;
895
+ features?: ModelCapability;
896
+ customFetch?: CustomFetch;
897
+ }
898
+
899
+ declare interface ICustomAction extends Partial<IGenPromptAction> {
900
+ execute: (params: any, context: Record<string, any>) => any;
901
+ }
902
+
903
+ export declare interface ICustomActionItem extends IGenPromptAction {
904
+ execute: (params: any, context: Record<string, any>) => any;
905
+ }
906
+
907
+ declare interface ICustomActionItem_2 extends IGenPromptAction {
908
+ execute: (params: any, context: Record<string, any>) => any;
909
+ }
910
+
911
+ export declare interface ICustomComponentItem extends IGenPromptComponent {
912
+ ref: Component;
913
+ }
914
+
915
+ declare interface ICustomComponentItem_2 extends IGenPromptComponent {
916
+ ref: Component;
917
+ }
918
+
919
+ export declare interface ImageFeatures {
920
+ enabled: boolean;
921
+ maxImageSize: number;
922
+ maxFilesPerRequest: number;
923
+ supportedFileTypes: string[];
924
+ }
925
+
926
+ declare interface ImageFeatures_2 {
927
+ enabled: boolean;
928
+ maxImageSize: number;
929
+ maxFilesPerRequest: number;
930
+ supportedFileTypes: string[];
931
+ }
932
+
933
+ export declare interface IMessage {
934
+ role: 'user' | 'assistant';
935
+ content: string;
936
+ messages?: IMessageItem[];
937
+ }
938
+
939
+ declare interface IMessage_2 {
940
+ role: 'user' | 'assistant';
941
+ content: string;
942
+ messages?: IMessageItem_2[];
943
+ }
944
+
945
+ export declare interface IMessageItem {
946
+ type: string;
947
+ content: string;
948
+ [customKey: string]: any;
949
+ }
950
+
951
+ declare interface IMessageItem_2 {
952
+ type: string;
953
+ content: string;
954
+ [customKey: string]: any;
955
+ }
956
+
957
+ export declare class IndexedDBStrategy implements ConversationStorageStrategy {
958
+ private dbName;
959
+ private storeName;
960
+ private dataKey;
961
+ private db;
962
+ constructor(dbName?: string, storeName?: string, dataKey?: string);
963
+ private openDB;
964
+ saveConversations(conversations: Conversation[]): Promise<void>;
965
+ loadConversations(): Promise<Conversation[]>;
966
+ }
967
+
968
+ /**
969
+ * 通知事件发射器类型,专门用于处理 'notification' 事件
970
+ */
971
+ export declare interface INotificationEventEmitter {
972
+ on(eventName: 'notification', callback: (payload: INotificationPayload) => void, once?: boolean): void;
973
+ off(eventName: 'notification', callback: (payload: INotificationPayload) => void): void;
974
+ emit(eventName: 'notification', payload: INotificationPayload): void;
975
+ once(eventName: 'notification', callback: (payload: INotificationPayload) => void): void;
976
+ }
977
+
978
+ /**
979
+ * 通知事件发射器类型,专门用于处理 'notification' 事件
980
+ */
981
+ declare interface INotificationEventEmitter_2 {
982
+ on(eventName: 'notification', callback: (payload: INotificationPayload) => void, once?: boolean): void;
983
+ off(eventName: 'notification', callback: (payload: INotificationPayload) => void): void;
984
+ emit(eventName: 'notification', payload: INotificationPayload): void;
985
+ once(eventName: 'notification', callback: (payload: INotificationPayload) => void): void;
986
+ }
987
+
988
+ declare interface IRendererProps {
989
+ content: string | {
990
+ [prop: string]: any;
991
+ };
992
+ generating?: boolean;
993
+ isJsonComplete?: boolean;
994
+ customComponents?: Record<string, Component>;
995
+ customActions?: Record<string, ICustomAction>;
996
+ requiredCompleteFieldSelectors?: string[];
997
+ id?: string;
998
+ state?: Record<string, any>;
999
+ }
1000
+
1001
+ declare interface IRendererSlots {
1002
+ header?: Component<IRendererSlotsProps> | ((props: IRendererSlotsProps) => VNode | VNode[]);
1003
+ footer?: Component<IRendererSlotsProps> | ((props: IRendererSlotsProps) => VNode | VNode[]);
1004
+ }
1005
+
1006
+ declare interface IRendererSlots_2 {
1007
+ header?: Component<IRendererSlotsProps_2> | ((props: IRendererSlotsProps_2) => VNode | VNode[]);
1008
+ footer?: Component<IRendererSlotsProps_2> | ((props: IRendererSlotsProps_2) => VNode | VNode[]);
1009
+ }
1010
+
1011
+ declare interface IRendererSlotsProps {
1012
+ schema: CardSchema;
1013
+ isError: boolean;
1014
+ isFinished: boolean;
1015
+ }
1016
+
1017
+ declare interface IRendererSlotsProps_2 {
1018
+ schema: CardSchema;
1019
+ isError: boolean;
1020
+ isFinished: boolean;
1021
+ }
1022
+
1023
+ declare interface IResponseHandler<T> {
1024
+ name: string;
1025
+ match: (data: T, context: any) => boolean;
1026
+ handler: (data: T, context: any) => boolean;
1027
+ notMatchHandler?: (data: T, context: any) => boolean;
1028
+ start?: (context: any, handlers: {
1029
+ onData: (data: IChatMessage) => void;
1030
+ onDone: () => void;
1031
+ onError: (error: Error) => void;
1032
+ }) => void;
1033
+ end?: (context: any) => void;
1034
+ }
1035
+
1036
+ export declare interface IRolesConfig {
1037
+ user: Partial<BubbleRoleConfig>;
1038
+ assistant: Partial<BubbleRoleConfig>;
1039
+ }
1040
+
1041
+ declare interface IRolesConfig_2 {
1042
+ user: Partial<BubbleRoleConfig>;
1043
+ assistant: Partial<BubbleRoleConfig>;
1044
+ }
1045
+
1046
+ declare type ISlotProps = any;
1047
+
1048
+ export declare interface IThinkComponentProps {
1049
+ emitter: INotificationEventEmitter;
1050
+ message: IMessage;
1051
+ showThinkingResult: boolean;
1052
+ }
1053
+
1054
+ declare interface IThinkComponentProps_2 {
1055
+ emitter: INotificationEventEmitter_2;
1056
+ message: IMessage_2;
1057
+ showThinkingResult: boolean;
1058
+ }
1059
+
1060
+ export declare class MessageManager {
1061
+ messageManagerMap: Map<string, UseMessageReturn>;
1062
+ conversationState: Reactive<ConversationState>;
1063
+ options: UseMessageOptions;
1064
+ constructor(conversationState: Reactive<ConversationState>, options: UseMessageOptions);
1065
+ getMessageManager(conversationId: string): UseMessageReturn;
1066
+ setMessageManager(id: string, options?: UseMessageOptions): UseMessageReturn;
1067
+ deleteMessageManager(id: string): void;
1068
+ }
1069
+
1070
+ export declare interface ModelCapability {
1071
+ supportImage?: ImageFeatures;
1072
+ supportFunctionCalling?: boolean;
1073
+ [key: string]: any;
1074
+ }
1075
+
1076
+ declare interface ModelCapability_2 {
1077
+ supportImage?: ImageFeatures_2;
1078
+ supportFunctionCalling?: boolean;
1079
+ [key: string]: any;
1080
+ }
1081
+
1082
+ export declare interface ModelFeatures {
1083
+ supportImage?: boolean | ImageFeatures;
1084
+ supportFunctionCalling?: boolean;
1085
+ [key: string]: any;
1086
+ }
1087
+
1088
+ export declare interface ModelInfo {
1089
+ name: string;
1090
+ features?: ModelFeatures;
1091
+ }
1092
+
1093
+ declare interface Props {
1094
+ templateData?: UserItem[];
1095
+ attachments?: FileMeta[];
1096
+ }
1097
+
1098
+ export declare const scrollEnd: (container: Ref<HTMLElement | undefined>) => {
1099
+ scrollToBottom: () => void;
1100
+ scrollToBottomWithRetry: (maxRetries?: number, retryDelay?: number) => void;
1101
+ autoScrollToBottom: () => void;
1102
+ isLastMessageInBottom: Ref<boolean, boolean>;
1103
+ updateIsLastMessageInBottom: () => void;
1104
+ };
1105
+
1106
+ export declare class ThinkTagWrapPattern {
1107
+ protected thinkStartFlag: string;
1108
+ protected thinkEndFlag: string;
1109
+ protected startRegex: RegExp;
1110
+ protected endRegex: RegExp;
1111
+ protected partialStartRegex: RegExp;
1112
+ protected partialEndRegex: RegExp;
1113
+ get regExpMap(): {
1114
+ start: {
1115
+ full: RegExp;
1116
+ partial: RegExp;
1117
+ };
1118
+ end: {
1119
+ full: RegExp;
1120
+ partial: RegExp;
1121
+ };
1122
+ };
1123
+ }
1124
+
1125
+ export declare function throttle<T extends (...args: any[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;
1126
+
1127
+ export declare const toSlotFunction: (slot: Component<ISlotProps> | ((props: ISlotProps) => VNode | VNode[]) | undefined) => (props: ISlotProps) => VNode | VNode[];
1128
+
1129
+ /**
1130
+ * useConversation composable
1131
+ * 提供会话管理和持久化功能
1132
+ *
1133
+ * @param options useConversation选项
1134
+ * @returns UseConversationReturn
1135
+ */
1136
+ export declare function useConversation(options: UseConversationOptions): UseConversationReturn;
1137
+
1138
+ /**
1139
+ * useConversation返回值接口
1140
+ */
1141
+ export declare interface UseConversationReturn {
1142
+ /** 会话状态 */
1143
+ state: ConversationState;
1144
+ /** 消息管理 */
1145
+ messageManager: ComputedRef<UseMessageReturn>;
1146
+ /** 创建新会话 */
1147
+ createConversation: (title?: string, metadata?: Record<string, unknown>) => string;
1148
+ /** 切换会话 */
1149
+ switchConversation: (id: string) => void;
1150
+ /** 删除会话 */
1151
+ deleteConversation: (id: string) => void;
1152
+ /** 更新会话标题 */
1153
+ updateTitle: (id: string, title: string) => void;
1154
+ /** 更新会话元数据 */
1155
+ updateMetadata: (id: string, metadata: Record<string, unknown>) => void;
1156
+ /** 保存会话 */
1157
+ saveConversations: () => Promise<void>;
1158
+ /** 加载会话 */
1159
+ loadConversations: () => Promise<void>;
1160
+ /** 生成会话标题 */
1161
+ generateTitle: (id: string) => Promise<string>;
1162
+ /** 获取当前会话 */
1163
+ getCurrentConversation: () => Conversation | null;
1164
+ }
1165
+
1166
+ /**
1167
+ * useConversation返回值接口
1168
+ */
1169
+ declare interface UseConversationReturn_2 {
1170
+ /** 会话状态 */
1171
+ state: ConversationState;
1172
+ /** 消息管理 */
1173
+ messageManager: ComputedRef<UseMessageReturn_2>;
1174
+ /** 创建新会话 */
1175
+ createConversation: (title?: string, metadata?: Record<string, unknown>) => string;
1176
+ /** 切换会话 */
1177
+ switchConversation: (id: string) => void;
1178
+ /** 删除会话 */
1179
+ deleteConversation: (id: string) => void;
1180
+ /** 更新会话标题 */
1181
+ updateTitle: (id: string, title: string) => void;
1182
+ /** 更新会话元数据 */
1183
+ updateMetadata: (id: string, metadata: Record<string, unknown>) => void;
1184
+ /** 保存会话 */
1185
+ saveConversations: () => Promise<void>;
1186
+ /** 加载会话 */
1187
+ loadConversations: () => Promise<void>;
1188
+ /** 生成会话标题 */
1189
+ generateTitle: (id: string) => Promise<string>;
1190
+ /** 获取当前会话 */
1191
+ getCurrentConversation: () => Conversation | null;
1192
+ }
1193
+
1194
+ export declare const useI18n: () => I18nInstance;
1195
+
1196
+ export declare function useMessage(options: UseMessageOptions): UseMessageReturn;
1197
+
1198
+ /**
1199
+ * useMessage选项接口
1200
+ */
1201
+ export declare interface UseMessageOptions {
1202
+ /** AI客户端实例 */
1203
+ client: AIClient;
1204
+ /** 消息ID */
1205
+ conversationId: string;
1206
+ /** 是否默认使用流式响应 */
1207
+ useStreamByDefault?: boolean;
1208
+ /** 错误消息模板 */
1209
+ errorMessage?: string;
1210
+ /** 初始消息列表 */
1211
+ initialMessages?: ChatMessage[];
1212
+ events?: {
1213
+ onReceiveData?: <T = any>(data: T, messages: Ref<ChatMessage[]>, preventDefault: () => void) => void;
1214
+ onFinish?: (finishReason: string | undefined, context: {
1215
+ messages: Ref<ChatMessage[]>;
1216
+ messageState: Reactive<MessageState>;
1217
+ }, preventDefault: () => void) => void;
1218
+ };
1219
+ }
1220
+
1221
+ /**
1222
+ * useMessage返回值接口
1223
+ */
1224
+ export declare interface UseMessageReturn {
1225
+ /** 消息ID */
1226
+ conversationId: string;
1227
+ /** 消息列表 */
1228
+ messages: Ref<ChatMessage[]>;
1229
+ /** 消息状态 */
1230
+ messageState: Reactive<MessageState>;
1231
+ /** 输入消息 */
1232
+ inputMessage: Ref<string>;
1233
+ /** 是否使用流式响应 */
1234
+ useStream: Ref<boolean>;
1235
+ /** 发送消息 */
1236
+ sendMessage: (content?: ChatMessage['content'], clearInput?: boolean) => Promise<void>;
1237
+ /** 手动执行addMessage添加消息后,可以执行send发送消息 */
1238
+ send: () => Promise<void>;
1239
+ /** 清空消息 */
1240
+ clearMessages: () => void;
1241
+ /** 添加消息 */
1242
+ addMessage: (message: ChatMessage | ChatMessage[]) => void;
1243
+ /** 中止请求 */
1244
+ abortRequest: () => void;
1245
+ /** 重试请求 */
1246
+ retryRequest: (msgIndex: number) => Promise<void>;
1247
+ }
1248
+
1249
+ /**
1250
+ * useMessage返回值接口
1251
+ */
1252
+ declare interface UseMessageReturn_2 {
1253
+ /** 消息ID */
1254
+ conversationId: string;
1255
+ /** 消息列表 */
1256
+ messages: Ref<ChatMessage[]>;
1257
+ /** 消息状态 */
1258
+ messageState: Reactive<MessageState>;
1259
+ /** 输入消息 */
1260
+ inputMessage: Ref<string>;
1261
+ /** 是否使用流式响应 */
1262
+ useStream: Ref<boolean>;
1263
+ /** 发送消息 */
1264
+ sendMessage: (content?: ChatMessage['content'], clearInput?: boolean) => Promise<void>;
1265
+ /** 手动执行addMessage添加消息后,可以执行send发送消息 */
1266
+ send: () => Promise<void>;
1267
+ /** 清空消息 */
1268
+ clearMessages: () => void;
1269
+ /** 添加消息 */
1270
+ addMessage: (message: ChatMessage | ChatMessage[]) => void;
1271
+ /** 中止请求 */
1272
+ abortRequest: () => void;
1273
+ /** 重试请求 */
1274
+ retryRequest: (msgIndex: number) => Promise<void>;
1275
+ }
1276
+
1277
+ export { }