@opentiny/tiny-robot-chat 0.5.2-alpha.7 → 0.5.2-alpha.8
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 +1038 -0
- package/dist/index.js +2742 -0
- package/dist/style.css +1 -0
- package/package.json +5 -5
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1038 @@
|
|
|
1
|
+
import { BubbleListProps } from '@opentiny/tiny-robot';
|
|
2
|
+
import { BubbleProviderProps } from '@opentiny/tiny-robot';
|
|
3
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
4
|
+
import { ComponentProvideOptions } from 'vue';
|
|
5
|
+
import { ComputedRef } from 'vue';
|
|
6
|
+
import { DefaultActions } from '@opentiny/tiny-robot';
|
|
7
|
+
import { DefineComponent } from 'vue';
|
|
8
|
+
import { HistoryMenuItem } from '@opentiny/tiny-robot';
|
|
9
|
+
import { HistoryProps } from '@opentiny/tiny-robot';
|
|
10
|
+
import { LayoutFloatingDragDetail } from '@opentiny/tiny-robot';
|
|
11
|
+
import { LayoutFloatingOptions } from '@opentiny/tiny-robot';
|
|
12
|
+
import { LayoutFloatingResizeDetail } from '@opentiny/tiny-robot';
|
|
13
|
+
import { LayoutFloatingState } from '@opentiny/tiny-robot';
|
|
14
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
15
|
+
import { PromptProps } from '@opentiny/tiny-robot';
|
|
16
|
+
import { PromptsProps } from '@opentiny/tiny-robot';
|
|
17
|
+
import { PublicProps } from 'vue';
|
|
18
|
+
import { SenderProps } from '@opentiny/tiny-robot';
|
|
19
|
+
import { ShallowRef } from 'vue';
|
|
20
|
+
import { UseConversationOptions } from '@opentiny/tiny-robot-kit';
|
|
21
|
+
import { UseConversationReturn } from '@opentiny/tiny-robot-kit';
|
|
22
|
+
import { WelcomeProps } from '@opentiny/tiny-robot';
|
|
23
|
+
|
|
24
|
+
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
25
|
+
"bubble-event": (payload: ChatBubbleEventPayload) => any;
|
|
26
|
+
"update:floating-state": (value: LayoutFloatingState) => any;
|
|
27
|
+
"floating-drag-start": (detail: LayoutFloatingState) => any;
|
|
28
|
+
"floating-drag": (detail: LayoutFloatingState) => any;
|
|
29
|
+
"floating-drag-end": (detail: LayoutFloatingState) => any;
|
|
30
|
+
"floating-resize-start": (detail: LayoutFloatingResizeDetail) => any;
|
|
31
|
+
"floating-resize": (detail: LayoutFloatingResizeDetail) => any;
|
|
32
|
+
"floating-resize-end": (detail: LayoutFloatingResizeDetail) => any;
|
|
33
|
+
"history-action": (payload: ChatHistoryActionPayload) => any;
|
|
34
|
+
"prompt-click": (payload: ChatPromptClickPayload) => any;
|
|
35
|
+
"bubble-state-change": (payload: ChatBubbleStateChangePayload) => any;
|
|
36
|
+
"left-aside-open-change": (args_0: {
|
|
37
|
+
open: boolean;
|
|
38
|
+
source: "user" | "viewport";
|
|
39
|
+
}) => any;
|
|
40
|
+
"right-aside-open-change": (args_0: {
|
|
41
|
+
open: boolean;
|
|
42
|
+
source: "user" | "viewport";
|
|
43
|
+
}) => any;
|
|
44
|
+
"runtime-action-error": (payload: ChatRuntimeActionErrorPayload) => any;
|
|
45
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
46
|
+
"onBubble-event"?: ((payload: ChatBubbleEventPayload) => any) | undefined;
|
|
47
|
+
"onUpdate:floating-state"?: ((value: LayoutFloatingState) => any) | undefined;
|
|
48
|
+
"onFloating-drag-start"?: ((detail: LayoutFloatingState) => any) | undefined;
|
|
49
|
+
"onFloating-drag"?: ((detail: LayoutFloatingState) => any) | undefined;
|
|
50
|
+
"onFloating-drag-end"?: ((detail: LayoutFloatingState) => any) | undefined;
|
|
51
|
+
"onFloating-resize-start"?: ((detail: LayoutFloatingResizeDetail) => any) | undefined;
|
|
52
|
+
"onFloating-resize"?: ((detail: LayoutFloatingResizeDetail) => any) | undefined;
|
|
53
|
+
"onFloating-resize-end"?: ((detail: LayoutFloatingResizeDetail) => any) | undefined;
|
|
54
|
+
"onHistory-action"?: ((payload: ChatHistoryActionPayload) => any) | undefined;
|
|
55
|
+
"onPrompt-click"?: ((payload: ChatPromptClickPayload) => any) | undefined;
|
|
56
|
+
"onBubble-state-change"?: ((payload: ChatBubbleStateChangePayload) => any) | undefined;
|
|
57
|
+
"onLeft-aside-open-change"?: ((args_0: {
|
|
58
|
+
open: boolean;
|
|
59
|
+
source: "user" | "viewport";
|
|
60
|
+
}) => any) | undefined;
|
|
61
|
+
"onRight-aside-open-change"?: ((args_0: {
|
|
62
|
+
open: boolean;
|
|
63
|
+
source: "user" | "viewport";
|
|
64
|
+
}) => any) | undefined;
|
|
65
|
+
"onRuntime-action-error"?: ((payload: ChatRuntimeActionErrorPayload) => any) | undefined;
|
|
66
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
67
|
+
|
|
68
|
+
declare const __VLS_component_2: DefineComponent<ChatUIProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
69
|
+
cancel: () => any;
|
|
70
|
+
submit: (payload: ChatSendPayload) => any;
|
|
71
|
+
clear: () => any;
|
|
72
|
+
"create-conversation": () => any;
|
|
73
|
+
"switch-conversation": (payload: {
|
|
74
|
+
readonly id: string;
|
|
75
|
+
}) => any;
|
|
76
|
+
"rename-conversation": (payload: {
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly title: string;
|
|
79
|
+
}) => any;
|
|
80
|
+
"delete-conversation": (payload: {
|
|
81
|
+
readonly id: string;
|
|
82
|
+
}) => any;
|
|
83
|
+
"model-select": (payload: ChatModelSelectPayload) => any;
|
|
84
|
+
"model-feature-change": (payload: ChatModelFeatureChangePayload) => any;
|
|
85
|
+
"mcp-add-server": (payload: ChatMcpAddServerPayload) => any;
|
|
86
|
+
"mcp-remove-server": (payload: ChatMcpRemoveServerPayload) => any;
|
|
87
|
+
"mcp-server-enabled-change": (payload: ChatMcpServerEnabledChangePayload) => any;
|
|
88
|
+
"mcp-tool-enabled-change": (payload: ChatMcpToolEnabledChangePayload) => any;
|
|
89
|
+
"bubble-event": (payload: ChatBubbleEventPayload) => any;
|
|
90
|
+
"update:floating-state": (value: LayoutFloatingState) => any;
|
|
91
|
+
"floating-drag-start": (detail: LayoutFloatingState) => any;
|
|
92
|
+
"floating-drag": (detail: LayoutFloatingState) => any;
|
|
93
|
+
"floating-drag-end": (detail: LayoutFloatingState) => any;
|
|
94
|
+
"floating-resize-start": (detail: LayoutFloatingResizeDetail) => any;
|
|
95
|
+
"floating-resize": (detail: LayoutFloatingResizeDetail) => any;
|
|
96
|
+
"floating-resize-end": (detail: LayoutFloatingResizeDetail) => any;
|
|
97
|
+
"update:inputValue": (value: string) => any;
|
|
98
|
+
"history-action": (payload: ChatHistoryActionPayload) => any;
|
|
99
|
+
"prompt-click": (payload: ChatPromptClickPayload) => any;
|
|
100
|
+
"bubble-state-change": (payload: ChatBubbleStateChangePayload) => any;
|
|
101
|
+
"left-aside-open-change": (payload: ChatAsideOpenChangePayload) => any;
|
|
102
|
+
"right-aside-open-change": (payload: ChatAsideOpenChangePayload) => any;
|
|
103
|
+
}, string, PublicProps, Readonly<ChatUIProps> & Readonly<{
|
|
104
|
+
onCancel?: (() => any) | undefined;
|
|
105
|
+
onSubmit?: ((payload: ChatSendPayload) => any) | undefined;
|
|
106
|
+
onClear?: (() => any) | undefined;
|
|
107
|
+
"onCreate-conversation"?: (() => any) | undefined;
|
|
108
|
+
"onSwitch-conversation"?: ((payload: {
|
|
109
|
+
readonly id: string;
|
|
110
|
+
}) => any) | undefined;
|
|
111
|
+
"onRename-conversation"?: ((payload: {
|
|
112
|
+
readonly id: string;
|
|
113
|
+
readonly title: string;
|
|
114
|
+
}) => any) | undefined;
|
|
115
|
+
"onDelete-conversation"?: ((payload: {
|
|
116
|
+
readonly id: string;
|
|
117
|
+
}) => any) | undefined;
|
|
118
|
+
"onModel-select"?: ((payload: ChatModelSelectPayload) => any) | undefined;
|
|
119
|
+
"onModel-feature-change"?: ((payload: ChatModelFeatureChangePayload) => any) | undefined;
|
|
120
|
+
"onMcp-add-server"?: ((payload: ChatMcpAddServerPayload) => any) | undefined;
|
|
121
|
+
"onMcp-remove-server"?: ((payload: ChatMcpRemoveServerPayload) => any) | undefined;
|
|
122
|
+
"onMcp-server-enabled-change"?: ((payload: ChatMcpServerEnabledChangePayload) => any) | undefined;
|
|
123
|
+
"onMcp-tool-enabled-change"?: ((payload: ChatMcpToolEnabledChangePayload) => any) | undefined;
|
|
124
|
+
"onBubble-event"?: ((payload: ChatBubbleEventPayload) => any) | undefined;
|
|
125
|
+
"onUpdate:floating-state"?: ((value: LayoutFloatingState) => any) | undefined;
|
|
126
|
+
"onFloating-drag-start"?: ((detail: LayoutFloatingState) => any) | undefined;
|
|
127
|
+
"onFloating-drag"?: ((detail: LayoutFloatingState) => any) | undefined;
|
|
128
|
+
"onFloating-drag-end"?: ((detail: LayoutFloatingState) => any) | undefined;
|
|
129
|
+
"onFloating-resize-start"?: ((detail: LayoutFloatingResizeDetail) => any) | undefined;
|
|
130
|
+
"onFloating-resize"?: ((detail: LayoutFloatingResizeDetail) => any) | undefined;
|
|
131
|
+
"onFloating-resize-end"?: ((detail: LayoutFloatingResizeDetail) => any) | undefined;
|
|
132
|
+
"onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
|
133
|
+
"onHistory-action"?: ((payload: ChatHistoryActionPayload) => any) | undefined;
|
|
134
|
+
"onPrompt-click"?: ((payload: ChatPromptClickPayload) => any) | undefined;
|
|
135
|
+
"onBubble-state-change"?: ((payload: ChatBubbleStateChangePayload) => any) | undefined;
|
|
136
|
+
"onLeft-aside-open-change"?: ((payload: ChatAsideOpenChangePayload) => any) | undefined;
|
|
137
|
+
"onRight-aside-open-change"?: ((payload: ChatAsideOpenChangePayload) => any) | undefined;
|
|
138
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
139
|
+
scrollTarget: HTMLDivElement;
|
|
140
|
+
}, any>;
|
|
141
|
+
|
|
142
|
+
declare type __VLS_Props = {
|
|
143
|
+
runtime: ChatRuntime;
|
|
144
|
+
ui?: ChatUIOptions;
|
|
145
|
+
title?: string;
|
|
146
|
+
floatingState?: LayoutFloatingState;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
declare function __VLS_template(): {
|
|
150
|
+
attrs: Partial<{}>;
|
|
151
|
+
slots: {
|
|
152
|
+
'layout-header'?(_: {
|
|
153
|
+
title: string;
|
|
154
|
+
isEmpty: boolean;
|
|
155
|
+
conversation: {
|
|
156
|
+
items: readonly ChatConversationInfo[];
|
|
157
|
+
activeId: string | null;
|
|
158
|
+
title: string;
|
|
159
|
+
};
|
|
160
|
+
createConversation: () => void;
|
|
161
|
+
isLeftAsideOpen: boolean;
|
|
162
|
+
openLeftAside: () => void;
|
|
163
|
+
closeLeftAside: () => void;
|
|
164
|
+
toggleLeftAside: () => void;
|
|
165
|
+
openRightAside: () => void;
|
|
166
|
+
closeRightAside: () => void;
|
|
167
|
+
}): any;
|
|
168
|
+
'layout-left-aside'?(_: {
|
|
169
|
+
conversation: {
|
|
170
|
+
items: readonly ChatConversationInfo[];
|
|
171
|
+
activeId: string | null;
|
|
172
|
+
title: string;
|
|
173
|
+
};
|
|
174
|
+
isOpen: boolean;
|
|
175
|
+
createConversation: () => void;
|
|
176
|
+
switchConversation: (id: string) => void;
|
|
177
|
+
renameConversation: (id: string, title: string) => void;
|
|
178
|
+
deleteConversation: (id: string) => void;
|
|
179
|
+
openLeftAside: () => void;
|
|
180
|
+
closeLeftAside: () => void;
|
|
181
|
+
toggleLeftAside: () => void;
|
|
182
|
+
}): any;
|
|
183
|
+
'layout-right-aside'?(_: {}): any;
|
|
184
|
+
'layout-right-aside-title'?(_: {}): any;
|
|
185
|
+
'layout-main'?(_: {
|
|
186
|
+
messages: ChatMessageItem<ChatMessageContent, Record<string, unknown>>[];
|
|
187
|
+
request: ChatRequestView | undefined;
|
|
188
|
+
conversation: {
|
|
189
|
+
items: readonly ChatConversationInfo[];
|
|
190
|
+
activeId: string | null;
|
|
191
|
+
title: string;
|
|
192
|
+
};
|
|
193
|
+
}): any;
|
|
194
|
+
'layout-footer'?(_: {
|
|
195
|
+
value: string;
|
|
196
|
+
loading: boolean;
|
|
197
|
+
disabled: boolean;
|
|
198
|
+
submitDisabled: boolean;
|
|
199
|
+
setInputValue: (value: string) => void;
|
|
200
|
+
submit: (payload: {
|
|
201
|
+
text: string;
|
|
202
|
+
structuredData?: ChatStructuredData;
|
|
203
|
+
}) => void;
|
|
204
|
+
cancel: () => void;
|
|
205
|
+
clear: () => void;
|
|
206
|
+
}): any;
|
|
207
|
+
'composer-before'?(_: {
|
|
208
|
+
value: string;
|
|
209
|
+
loading: boolean;
|
|
210
|
+
disabled: boolean;
|
|
211
|
+
submitDisabled: boolean;
|
|
212
|
+
setInputValue: (value: string) => void;
|
|
213
|
+
submit: (payload: {
|
|
214
|
+
text: string;
|
|
215
|
+
structuredData?: ChatStructuredData;
|
|
216
|
+
}) => void;
|
|
217
|
+
cancel: () => void;
|
|
218
|
+
clear: () => void;
|
|
219
|
+
}): any;
|
|
220
|
+
'header-notice'?(_: {}): any;
|
|
221
|
+
'request-error'?(_: {
|
|
222
|
+
error: {};
|
|
223
|
+
}): any;
|
|
224
|
+
'welcome-footer'?(_: {}): any;
|
|
225
|
+
'prompts-footer'?(_: {}): any;
|
|
226
|
+
'bubble-prefix'?(_: {}): any;
|
|
227
|
+
'bubble-suffix'?(_: {}): any;
|
|
228
|
+
'bubble-after'?(_: {}): any;
|
|
229
|
+
'bubble-content-footer'?(_: {}): any;
|
|
230
|
+
'sender-footer'?(_: {}): any;
|
|
231
|
+
'sender-footer-right'?(_: {}): any;
|
|
232
|
+
};
|
|
233
|
+
refs: {};
|
|
234
|
+
rootEl: any;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
declare function __VLS_template_2(): {
|
|
238
|
+
attrs: Partial<{}>;
|
|
239
|
+
slots: {
|
|
240
|
+
'layout-left-aside'?(_: {
|
|
241
|
+
conversation: {
|
|
242
|
+
items: readonly ChatConversationInfo[];
|
|
243
|
+
activeId: string | null;
|
|
244
|
+
title: string;
|
|
245
|
+
};
|
|
246
|
+
isOpen: boolean;
|
|
247
|
+
createConversation: typeof handleCreateConversation;
|
|
248
|
+
switchConversation: (id: string) => void;
|
|
249
|
+
renameConversation: (id: string, title: string) => void;
|
|
250
|
+
deleteConversation: (id: string) => void;
|
|
251
|
+
openLeftAside: () => void;
|
|
252
|
+
closeLeftAside: () => void;
|
|
253
|
+
toggleLeftAside: () => void;
|
|
254
|
+
}): any;
|
|
255
|
+
'header-notice'?(_: {}): any;
|
|
256
|
+
'layout-header'?(_: {
|
|
257
|
+
title: string;
|
|
258
|
+
isEmpty: boolean;
|
|
259
|
+
conversation: {
|
|
260
|
+
items: readonly ChatConversationInfo[];
|
|
261
|
+
activeId: string | null;
|
|
262
|
+
title: string;
|
|
263
|
+
};
|
|
264
|
+
createConversation: typeof handleCreateConversation;
|
|
265
|
+
isLeftAsideOpen: boolean;
|
|
266
|
+
openLeftAside: () => void;
|
|
267
|
+
closeLeftAside: () => void;
|
|
268
|
+
toggleLeftAside: () => void;
|
|
269
|
+
openRightAside: () => void;
|
|
270
|
+
closeRightAside: () => void;
|
|
271
|
+
}): any;
|
|
272
|
+
'request-error'?(_: {
|
|
273
|
+
error: {};
|
|
274
|
+
}): any;
|
|
275
|
+
'layout-main'?(_: {
|
|
276
|
+
messages: ChatMessageItem<ChatMessageContent, Record<string, unknown>>[];
|
|
277
|
+
request: ChatRequestView | undefined;
|
|
278
|
+
conversation: {
|
|
279
|
+
items: readonly ChatConversationInfo[];
|
|
280
|
+
activeId: string | null;
|
|
281
|
+
title: string;
|
|
282
|
+
};
|
|
283
|
+
}): any;
|
|
284
|
+
'welcome-footer'?(_: {}): any;
|
|
285
|
+
'prompts-footer'?(_: {}): any;
|
|
286
|
+
'composer-before'?(_: {
|
|
287
|
+
value: string;
|
|
288
|
+
loading: boolean;
|
|
289
|
+
disabled: boolean;
|
|
290
|
+
submitDisabled: boolean;
|
|
291
|
+
setInputValue: (value: string) => void;
|
|
292
|
+
submit: (payload: {
|
|
293
|
+
text: string;
|
|
294
|
+
structuredData?: ChatStructuredData;
|
|
295
|
+
}) => void;
|
|
296
|
+
cancel: () => void;
|
|
297
|
+
clear: () => void;
|
|
298
|
+
}): any;
|
|
299
|
+
'composer-before'?(_: {
|
|
300
|
+
value: string;
|
|
301
|
+
loading: boolean;
|
|
302
|
+
disabled: boolean;
|
|
303
|
+
submitDisabled: boolean;
|
|
304
|
+
setInputValue: (value: string) => void;
|
|
305
|
+
submit: (payload: {
|
|
306
|
+
text: string;
|
|
307
|
+
structuredData?: ChatStructuredData;
|
|
308
|
+
}) => void;
|
|
309
|
+
cancel: () => void;
|
|
310
|
+
clear: () => void;
|
|
311
|
+
}): any;
|
|
312
|
+
'layout-footer'?(_: {
|
|
313
|
+
value: string;
|
|
314
|
+
loading: boolean;
|
|
315
|
+
disabled: boolean;
|
|
316
|
+
submitDisabled: boolean;
|
|
317
|
+
setInputValue: (value: string) => void;
|
|
318
|
+
submit: (payload: {
|
|
319
|
+
text: string;
|
|
320
|
+
structuredData?: ChatStructuredData;
|
|
321
|
+
}) => void;
|
|
322
|
+
cancel: () => void;
|
|
323
|
+
clear: () => void;
|
|
324
|
+
}): any;
|
|
325
|
+
'layout-footer'?(_: {
|
|
326
|
+
value: string;
|
|
327
|
+
loading: boolean;
|
|
328
|
+
disabled: boolean;
|
|
329
|
+
submitDisabled: boolean;
|
|
330
|
+
setInputValue: (value: string) => void;
|
|
331
|
+
submit: (payload: {
|
|
332
|
+
text: string;
|
|
333
|
+
structuredData?: ChatStructuredData;
|
|
334
|
+
}) => void;
|
|
335
|
+
cancel: () => void;
|
|
336
|
+
clear: () => void;
|
|
337
|
+
}): any;
|
|
338
|
+
'sender-footer'?(_: {}): any;
|
|
339
|
+
'sender-footer'?(_: {}): any;
|
|
340
|
+
'sender-footer-right'?(_: {}): any;
|
|
341
|
+
'sender-footer-right'?(_: {}): any;
|
|
342
|
+
'bubble-prefix'?(_: {}): any;
|
|
343
|
+
'bubble-suffix'?(_: {}): any;
|
|
344
|
+
'bubble-after'?(_: {}): any;
|
|
345
|
+
'bubble-content-footer'?(_: {}): any;
|
|
346
|
+
'layout-right-aside-title'?(_: {}): any;
|
|
347
|
+
'layout-right-aside'?(_: {}): any;
|
|
348
|
+
};
|
|
349
|
+
refs: {
|
|
350
|
+
scrollTarget: HTMLDivElement;
|
|
351
|
+
};
|
|
352
|
+
rootEl: any;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
356
|
+
|
|
357
|
+
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
358
|
+
|
|
359
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
360
|
+
new (): {
|
|
361
|
+
$slots: S;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
366
|
+
new (): {
|
|
367
|
+
$slots: S;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
declare const CHAT_BUILT_IN_MODEL_FEATURES: readonly ["thinking", "search"];
|
|
372
|
+
|
|
373
|
+
declare const CHAT_REASONING_EFFORTS: readonly ["low", "medium", "high", "max"];
|
|
374
|
+
|
|
375
|
+
declare interface ChatAsideOpenChangePayload {
|
|
376
|
+
readonly open: boolean;
|
|
377
|
+
readonly source: 'user' | 'viewport';
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export declare interface ChatAsideOptions {
|
|
381
|
+
readonly mode?: 'dock' | 'drawer';
|
|
382
|
+
readonly width?: number;
|
|
383
|
+
readonly collapsedWidth?: number;
|
|
384
|
+
readonly open?: boolean;
|
|
385
|
+
readonly defaultOpen?: boolean;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export declare interface ChatBrandOptions {
|
|
389
|
+
readonly name?: string;
|
|
390
|
+
readonly logo?: unknown;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export declare type ChatBubbleEventPayload = {
|
|
394
|
+
readonly name: string;
|
|
395
|
+
readonly payload?: unknown;
|
|
396
|
+
readonly messageIndex: number;
|
|
397
|
+
readonly contentIndex: number;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
export declare type ChatBubbleListOptions = Omit<BubbleListProps, 'messages' | 'autoScroll'>;
|
|
401
|
+
|
|
402
|
+
declare interface ChatBubbleOptions {
|
|
403
|
+
readonly autoScroll?: boolean;
|
|
404
|
+
readonly bubbleProvider?: Omit<BubbleProviderProps, 'store'>;
|
|
405
|
+
readonly bubbleList?: ChatBubbleListOptions;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export declare type ChatBubbleStateChangePayload = {
|
|
409
|
+
readonly key: string;
|
|
410
|
+
readonly value: unknown;
|
|
411
|
+
readonly messageIndex: number;
|
|
412
|
+
readonly contentIndex: number;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
export declare interface ChatBubbleView {
|
|
416
|
+
readonly messages?: readonly ChatMessageItem[];
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export declare type ChatBuiltInModelFeature = (typeof CHAT_BUILT_IN_MODEL_FEATURES)[number];
|
|
420
|
+
|
|
421
|
+
export declare interface ChatComposerLayoutOptions {
|
|
422
|
+
readonly welcome?: ChatWelcomeComposerPlacement;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export declare interface ChatComposerRuntime {
|
|
426
|
+
disabled?: ChatReadable<boolean>;
|
|
427
|
+
submitDisabled?: ChatReadable<boolean>;
|
|
428
|
+
model?: ChatModelRuntime;
|
|
429
|
+
mcp?: ChatMcpRuntime;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export declare interface ChatConversation extends ChatConversationInfo {
|
|
433
|
+
messages: readonly ChatMessageItem[];
|
|
434
|
+
requestState: ChatRequestState;
|
|
435
|
+
processingState?: ChatProcessingState;
|
|
436
|
+
lastError?: unknown | null;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export declare interface ChatConversationInfo {
|
|
440
|
+
id: string;
|
|
441
|
+
title: string;
|
|
442
|
+
createdAt?: number;
|
|
443
|
+
updatedAt?: number;
|
|
444
|
+
metadata?: Record<string, unknown>;
|
|
445
|
+
[key: string]: unknown;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export declare interface ChatConversationView {
|
|
449
|
+
readonly items?: readonly ChatConversationInfo[];
|
|
450
|
+
readonly activeId?: string | null;
|
|
451
|
+
readonly title?: string;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export declare type ChatCssSize = string | number;
|
|
455
|
+
|
|
456
|
+
declare interface ChatHeaderSlotProps {
|
|
457
|
+
readonly title: string;
|
|
458
|
+
readonly isEmpty: boolean;
|
|
459
|
+
readonly conversation: ChatConversationView;
|
|
460
|
+
readonly createConversation: () => void;
|
|
461
|
+
readonly isLeftAsideOpen: boolean;
|
|
462
|
+
readonly openLeftAside: () => void;
|
|
463
|
+
readonly closeLeftAside: () => void;
|
|
464
|
+
readonly toggleLeftAside: () => void;
|
|
465
|
+
readonly openRightAside: () => void;
|
|
466
|
+
readonly closeRightAside: () => void;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
declare interface ChatHistoryActionPayload {
|
|
470
|
+
readonly action: HistoryMenuItem;
|
|
471
|
+
readonly conversation: ChatConversationInfo;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
export declare type ChatHistoryItem = ChatConversationInfo & {
|
|
475
|
+
raw: ChatConversationInfo;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
export declare type ChatHistoryOptions = Omit<HistoryProps<ChatConversationInfo>, 'data' | 'selected' | 'onItemAction'>;
|
|
479
|
+
|
|
480
|
+
export declare interface ChatLabels {
|
|
481
|
+
newConversationTitle: string;
|
|
482
|
+
createConversation: string;
|
|
483
|
+
renameConversation: string;
|
|
484
|
+
deleteConversation: string;
|
|
485
|
+
expandConversationList: string;
|
|
486
|
+
collapseConversationList: string;
|
|
487
|
+
composerPlaceholder: string;
|
|
488
|
+
composerLoadingPlaceholder: string;
|
|
489
|
+
selectModel: string;
|
|
490
|
+
mcp: string;
|
|
491
|
+
thinkingFeature: string;
|
|
492
|
+
searchFeature: string;
|
|
493
|
+
welcomeTitle: string;
|
|
494
|
+
welcomeDescription: string;
|
|
495
|
+
rightAsideTitle: string;
|
|
496
|
+
openRightAside: string;
|
|
497
|
+
closeRightAside: string;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export declare interface ChatLayoutOptions {
|
|
501
|
+
readonly composer?: Readonly<ChatComposerLayoutOptions>;
|
|
502
|
+
readonly surface?: Readonly<ChatSurfaceOptions>;
|
|
503
|
+
readonly emptyState?: 'start' | 'center';
|
|
504
|
+
readonly contentMaxWidth?: ChatCssSize;
|
|
505
|
+
readonly panelPadding?: ChatCssSize;
|
|
506
|
+
readonly panelGap?: ChatCssSize;
|
|
507
|
+
readonly leftAside?: false | Readonly<ChatAsideOptions>;
|
|
508
|
+
readonly rightAside?: false | Readonly<ChatRightAsideOptions>;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
declare interface ChatLeftAsideSlotProps {
|
|
512
|
+
readonly conversation: ChatConversationView;
|
|
513
|
+
readonly isOpen: boolean;
|
|
514
|
+
readonly createConversation: () => void;
|
|
515
|
+
readonly switchConversation: (id: string) => void;
|
|
516
|
+
readonly renameConversation: (id: string, title: string) => void;
|
|
517
|
+
readonly deleteConversation: (id: string) => void;
|
|
518
|
+
readonly openLeftAside: () => void;
|
|
519
|
+
readonly closeLeftAside: () => void;
|
|
520
|
+
readonly toggleLeftAside: () => void;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
declare interface ChatMainSlotProps {
|
|
524
|
+
readonly messages: readonly ChatMessageItem[];
|
|
525
|
+
readonly request?: ChatRequestView;
|
|
526
|
+
readonly conversation: ChatConversationView;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
declare interface ChatMcpAddServerPayload {
|
|
530
|
+
readonly id: string;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
declare type ChatMcpOptions = Record<string, never>;
|
|
534
|
+
|
|
535
|
+
declare interface ChatMcpRemoveServerPayload {
|
|
536
|
+
readonly id: string;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
export declare interface ChatMcpRunConfig {
|
|
540
|
+
serverIds: readonly string[];
|
|
541
|
+
toolIds: Readonly<Record<string, readonly string[]>>;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export declare interface ChatMcpRuntime {
|
|
545
|
+
servers: ChatReadable<readonly ChatMcpServerInfo[]>;
|
|
546
|
+
tools: ChatReadable<ChatMcpToolState>;
|
|
547
|
+
addServer: (id: string) => Promise<void> | void;
|
|
548
|
+
removeServer: (id: string) => Promise<void> | void;
|
|
549
|
+
setServerEnabled: (id: string, enabled: boolean) => Promise<void> | void;
|
|
550
|
+
setToolEnabled: (serverId: string, toolId: string, enabled: boolean) => Promise<void> | void;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export declare interface ChatMcpServerConfig {
|
|
554
|
+
id: string;
|
|
555
|
+
name: string;
|
|
556
|
+
baseUrl: string;
|
|
557
|
+
installed?: boolean;
|
|
558
|
+
description?: string;
|
|
559
|
+
icon?: string;
|
|
560
|
+
headers?: Record<string, string>;
|
|
561
|
+
timeout?: number;
|
|
562
|
+
validate?: (serverId: string) => void;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
declare interface ChatMcpServerEnabledChangePayload {
|
|
566
|
+
readonly id: string;
|
|
567
|
+
readonly enabled: boolean;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export declare interface ChatMcpServerInfo {
|
|
571
|
+
id: string;
|
|
572
|
+
name: string;
|
|
573
|
+
description?: string;
|
|
574
|
+
installed: boolean;
|
|
575
|
+
enabled: boolean;
|
|
576
|
+
loading?: boolean;
|
|
577
|
+
error?: unknown;
|
|
578
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export declare type ChatMcpServers = readonly ChatMcpServerConfig[];
|
|
582
|
+
|
|
583
|
+
export declare interface ChatMcpServerView {
|
|
584
|
+
readonly id: string;
|
|
585
|
+
readonly name: string;
|
|
586
|
+
readonly description?: string;
|
|
587
|
+
readonly installed: boolean;
|
|
588
|
+
readonly enabled: boolean;
|
|
589
|
+
readonly loading?: boolean;
|
|
590
|
+
readonly error?: unknown;
|
|
591
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
declare interface ChatMcpToolDefinition {
|
|
595
|
+
serverId: string;
|
|
596
|
+
id: string;
|
|
597
|
+
name: string;
|
|
598
|
+
originalName: string;
|
|
599
|
+
description?: string;
|
|
600
|
+
inputSchema?: Record<string, unknown>;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
declare interface ChatMcpToolEnabledChangePayload {
|
|
604
|
+
readonly serverId: string;
|
|
605
|
+
readonly toolId: string;
|
|
606
|
+
readonly enabled: boolean;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export declare interface ChatMcpToolInfo {
|
|
610
|
+
id: string;
|
|
611
|
+
name: string;
|
|
612
|
+
description?: string;
|
|
613
|
+
enabled: boolean;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export declare type ChatMcpToolMap = Readonly<Partial<Record<string, readonly ChatMcpToolView[]>>>;
|
|
617
|
+
|
|
618
|
+
export declare type ChatMcpToolState = Readonly<Partial<Record<string, readonly ChatMcpToolInfo[]>>>;
|
|
619
|
+
|
|
620
|
+
export declare interface ChatMcpToolView {
|
|
621
|
+
readonly id: string;
|
|
622
|
+
readonly name: string;
|
|
623
|
+
readonly description?: string;
|
|
624
|
+
readonly enabled: boolean;
|
|
625
|
+
readonly loading?: boolean;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export declare interface ChatMcpView {
|
|
629
|
+
readonly servers?: readonly ChatMcpServerView[];
|
|
630
|
+
readonly tools?: ChatMcpToolMap;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export declare type ChatMessageContent = string | ChatMessagePart[];
|
|
634
|
+
|
|
635
|
+
export declare interface ChatMessageItem<T extends ChatMessageContent = ChatMessageContent, S extends Record<string, unknown> = Record<string, unknown>> {
|
|
636
|
+
role?: string;
|
|
637
|
+
content?: T;
|
|
638
|
+
reasoning_content?: string;
|
|
639
|
+
tool_calls?: ChatToolCall[];
|
|
640
|
+
tool_call_id?: string;
|
|
641
|
+
name?: string;
|
|
642
|
+
id?: string;
|
|
643
|
+
loading?: boolean;
|
|
644
|
+
state?: S;
|
|
645
|
+
metadata?: Record<string, unknown>;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export declare interface ChatMessagePart {
|
|
649
|
+
type: string;
|
|
650
|
+
[key: string]: unknown;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
declare interface ChatModelFeatureChangePayload {
|
|
654
|
+
readonly id: ChatBuiltInModelFeature;
|
|
655
|
+
readonly enabled: boolean;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export declare interface ChatModelOption {
|
|
659
|
+
id: string;
|
|
660
|
+
label: string;
|
|
661
|
+
capabilities?: Readonly<Partial<Record<ChatBuiltInModelFeature, boolean>>>;
|
|
662
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
declare type ChatModelOptions = Record<string, never>;
|
|
666
|
+
|
|
667
|
+
export declare interface ChatModelOptionView {
|
|
668
|
+
readonly id: string;
|
|
669
|
+
readonly label: string;
|
|
670
|
+
readonly capabilities?: Readonly<Partial<Record<ChatBuiltInModelFeature, boolean>>>;
|
|
671
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export declare interface ChatModelRuntime {
|
|
675
|
+
options: ChatReadable<readonly ChatModelOption[]>;
|
|
676
|
+
selectedId: ChatReadable<string | null>;
|
|
677
|
+
features: ChatReadable<Readonly<Partial<Record<ChatBuiltInModelFeature, boolean>>>>;
|
|
678
|
+
reasoning?: ChatReadable<ChatRunConfigReasoning>;
|
|
679
|
+
select: (id: string | null) => Promise<void> | void;
|
|
680
|
+
setFeature: (id: ChatBuiltInModelFeature, enabled: boolean) => Promise<void> | void;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
declare interface ChatModelSelectPayload {
|
|
684
|
+
readonly id: string | null;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export declare interface ChatModelView {
|
|
688
|
+
readonly options?: readonly ChatModelOptionView[];
|
|
689
|
+
readonly selectedId?: string | null;
|
|
690
|
+
readonly features?: Readonly<Partial<Record<ChatBuiltInModelFeature, boolean>>>;
|
|
691
|
+
readonly selecting?: boolean;
|
|
692
|
+
readonly pendingFeatureIds?: readonly ChatBuiltInModelFeature[];
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export declare type ChatProcessingState = 'requesting' | 'completing' | string;
|
|
696
|
+
|
|
697
|
+
declare interface ChatPromptClickPayload {
|
|
698
|
+
readonly event: MouseEvent;
|
|
699
|
+
readonly item: PromptProps;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
export declare interface ChatPromptsOptions extends Omit<PromptsProps, 'items'> {
|
|
703
|
+
readonly items?: PromptProps[];
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
export declare interface ChatProviderConfig {
|
|
707
|
+
type: ChatProviderType;
|
|
708
|
+
label?: string;
|
|
709
|
+
apiUrl?: string;
|
|
710
|
+
apiKey?: string;
|
|
711
|
+
headers?: Record<string, string>;
|
|
712
|
+
timeout?: number;
|
|
713
|
+
models: ChatProviderModelConfig[];
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export declare interface ChatProviderFeatureBody {
|
|
717
|
+
enabled?: Record<string, unknown>;
|
|
718
|
+
disabled?: Record<string, unknown>;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export declare interface ChatProviderModelConfig extends Omit<ChatModelOption, 'metadata'> {
|
|
722
|
+
featureBody?: Partial<Record<ChatBuiltInModelFeature, ChatProviderFeatureBody>>;
|
|
723
|
+
reasoning?: ChatProviderReasoningConfig;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export declare interface ChatProviderReasoningConfig {
|
|
727
|
+
efforts?: readonly ChatReasoningEffort[];
|
|
728
|
+
defaultEffort?: ChatReasoningEffort;
|
|
729
|
+
effortParam?: string;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export declare type ChatProviderType = 'openai' | 'deepseek' | 'qwen';
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Read-only reactive value used by the ChatRuntime protocol.
|
|
736
|
+
*
|
|
737
|
+
* Keep this structural instead of exposing Vue's nominal Ref/ComputedRef
|
|
738
|
+
* types. Consumers may use a different compatible Vue installation (for
|
|
739
|
+
* example a workspace package with its own Vue peer), while the protocol only
|
|
740
|
+
* needs the read-only `.value` contract.
|
|
741
|
+
*/
|
|
742
|
+
export declare interface ChatReadable<T> {
|
|
743
|
+
readonly value: T;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
export declare type ChatReasoningEffort = (typeof CHAT_REASONING_EFFORTS)[number];
|
|
747
|
+
|
|
748
|
+
export declare type ChatRequestState = 'idle' | 'processing' | 'completed' | 'aborted' | 'error';
|
|
749
|
+
|
|
750
|
+
declare interface ChatRequestView {
|
|
751
|
+
readonly state: ChatRequestState;
|
|
752
|
+
readonly processingState?: ChatProcessingState;
|
|
753
|
+
readonly error?: unknown;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export declare interface ChatRightAsideOptions extends ChatAsideOptions {
|
|
757
|
+
readonly showClose?: boolean;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
export declare interface ChatRunConfig {
|
|
761
|
+
modelId?: string;
|
|
762
|
+
features?: Readonly<Partial<Record<ChatBuiltInModelFeature, boolean>>>;
|
|
763
|
+
reasoning?: ChatRunConfigReasoning;
|
|
764
|
+
mcp?: ChatMcpRunConfig;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
export declare interface ChatRunConfigReasoning {
|
|
768
|
+
enabled: boolean;
|
|
769
|
+
effort?: ChatReasoningEffort;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
export declare interface ChatRuntime {
|
|
773
|
+
conversations: ChatReadable<readonly ChatConversationInfo[]>;
|
|
774
|
+
activeConversation: ChatReadable<ChatConversation | null>;
|
|
775
|
+
composer: ChatComposerRuntime;
|
|
776
|
+
actions: ChatRuntimeActions;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export declare interface ChatRuntimeActionErrorPayload {
|
|
780
|
+
readonly action: 'send' | 'abort' | 'create-conversation' | 'switch-conversation' | 'rename-conversation' | 'delete-conversation' | 'select-model' | 'set-model-feature' | 'add-mcp-server' | 'remove-mcp-server' | 'set-mcp-server-enabled' | 'set-mcp-tool-enabled';
|
|
781
|
+
readonly payload?: unknown;
|
|
782
|
+
readonly error: unknown;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
export declare interface ChatRuntimeActions {
|
|
786
|
+
send: (payload: ChatSendPayload) => Promise<boolean>;
|
|
787
|
+
abort?: () => Promise<void> | void;
|
|
788
|
+
createConversation: (payload?: {
|
|
789
|
+
title?: string;
|
|
790
|
+
metadata?: Record<string, unknown>;
|
|
791
|
+
}) => Promise<void> | void;
|
|
792
|
+
switchConversation: (id: string) => Promise<void> | void;
|
|
793
|
+
renameConversation: (id: string, title: string) => Promise<void> | void;
|
|
794
|
+
deleteConversation: (id: string) => Promise<void> | void;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
export declare type ChatSenderDefaultActions = Omit<DefaultActions, 'submit'> & {
|
|
798
|
+
readonly submit?: Omit<SubmitActionConfig, 'disabled'>;
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
export declare interface ChatSenderOptions extends Omit<SenderProps, 'modelValue' | 'defaultValue' | 'loading' | 'disabled' | 'defaultActions'> {
|
|
802
|
+
readonly defaultActions?: ChatSenderDefaultActions;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export declare interface ChatSenderSlotProps {
|
|
806
|
+
readonly value: string;
|
|
807
|
+
readonly loading: boolean;
|
|
808
|
+
readonly disabled: boolean;
|
|
809
|
+
readonly submitDisabled: boolean;
|
|
810
|
+
readonly setInputValue: (value: string) => void;
|
|
811
|
+
readonly submit: (payload: {
|
|
812
|
+
text: string;
|
|
813
|
+
structuredData?: ChatStructuredData;
|
|
814
|
+
}) => void;
|
|
815
|
+
readonly cancel: () => void;
|
|
816
|
+
readonly clear: () => void;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
export declare interface ChatSenderView {
|
|
820
|
+
readonly loading?: boolean;
|
|
821
|
+
readonly disabled?: boolean;
|
|
822
|
+
readonly submitDisabled?: boolean;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
export declare interface ChatSendPayload {
|
|
826
|
+
readonly text: string;
|
|
827
|
+
readonly structuredData?: ChatStructuredData;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export declare type ChatStructuredData = ChatStructuredDataItem[];
|
|
831
|
+
|
|
832
|
+
export declare interface ChatStructuredDataItem {
|
|
833
|
+
type: string;
|
|
834
|
+
[key: string]: unknown;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
export declare interface ChatSurfaceOptions {
|
|
838
|
+
readonly mode?: 'normal' | 'floating';
|
|
839
|
+
readonly floatingOptions?: Readonly<LayoutFloatingOptions>;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export declare interface ChatToolCall {
|
|
843
|
+
id: string;
|
|
844
|
+
type: 'function' | string;
|
|
845
|
+
function: {
|
|
846
|
+
name: string;
|
|
847
|
+
arguments: string;
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
declare type ChatToolCallTool = (serverId: string, toolName: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
852
|
+
|
|
853
|
+
declare type ChatToolListTools = (serverIds: readonly string[], toolIds: Readonly<Record<string, readonly string[]>>) => Promise<readonly ChatMcpToolDefinition[]>;
|
|
854
|
+
|
|
855
|
+
export declare interface ChatUIData {
|
|
856
|
+
readonly conversation?: ChatConversationView;
|
|
857
|
+
readonly bubble?: ChatBubbleView;
|
|
858
|
+
readonly sender?: ChatSenderView;
|
|
859
|
+
readonly model?: ChatModelView;
|
|
860
|
+
readonly mcp?: ChatMcpView;
|
|
861
|
+
readonly request?: ChatRequestView;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
export declare interface ChatUIEmits {
|
|
865
|
+
'update:floating-state': [value: LayoutFloatingState];
|
|
866
|
+
'floating-drag-start': [detail: LayoutFloatingDragDetail];
|
|
867
|
+
'floating-drag': [detail: LayoutFloatingDragDetail];
|
|
868
|
+
'floating-drag-end': [detail: LayoutFloatingDragDetail];
|
|
869
|
+
'floating-resize-start': [detail: LayoutFloatingResizeDetail];
|
|
870
|
+
'floating-resize': [detail: LayoutFloatingResizeDetail];
|
|
871
|
+
'floating-resize-end': [detail: LayoutFloatingResizeDetail];
|
|
872
|
+
'update:inputValue': [value: string];
|
|
873
|
+
submit: [payload: ChatSendPayload];
|
|
874
|
+
cancel: [];
|
|
875
|
+
clear: [];
|
|
876
|
+
'create-conversation': [];
|
|
877
|
+
'switch-conversation': [payload: {
|
|
878
|
+
readonly id: string;
|
|
879
|
+
}];
|
|
880
|
+
'rename-conversation': [payload: {
|
|
881
|
+
readonly id: string;
|
|
882
|
+
readonly title: string;
|
|
883
|
+
}];
|
|
884
|
+
'delete-conversation': [payload: {
|
|
885
|
+
readonly id: string;
|
|
886
|
+
}];
|
|
887
|
+
'history-action': [payload: ChatHistoryActionPayload];
|
|
888
|
+
'prompt-click': [payload: ChatPromptClickPayload];
|
|
889
|
+
'bubble-state-change': [payload: ChatBubbleStateChangePayload];
|
|
890
|
+
'bubble-event': [payload: ChatBubbleEventPayload];
|
|
891
|
+
'model-select': [payload: ChatModelSelectPayload];
|
|
892
|
+
'model-feature-change': [payload: ChatModelFeatureChangePayload];
|
|
893
|
+
'mcp-add-server': [payload: ChatMcpAddServerPayload];
|
|
894
|
+
'mcp-remove-server': [payload: ChatMcpRemoveServerPayload];
|
|
895
|
+
'mcp-server-enabled-change': [payload: ChatMcpServerEnabledChangePayload];
|
|
896
|
+
'mcp-tool-enabled-change': [payload: ChatMcpToolEnabledChangePayload];
|
|
897
|
+
'left-aside-open-change': [payload: ChatAsideOpenChangePayload];
|
|
898
|
+
'right-aside-open-change': [payload: ChatAsideOpenChangePayload];
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
export declare interface ChatUIOptions {
|
|
902
|
+
layout?: Readonly<ChatLayoutOptions>;
|
|
903
|
+
brand?: Readonly<ChatBrandOptions>;
|
|
904
|
+
labels?: Readonly<Partial<ChatLabels>>;
|
|
905
|
+
header?: false;
|
|
906
|
+
history?: false | Readonly<ChatHistoryOptions>;
|
|
907
|
+
welcome?: false | Readonly<ChatWelcomeOptions>;
|
|
908
|
+
prompts?: false | Readonly<ChatPromptsOptions>;
|
|
909
|
+
bubble?: Readonly<ChatBubbleOptions>;
|
|
910
|
+
sender?: false | Readonly<ChatSenderOptions>;
|
|
911
|
+
model?: false | Readonly<ChatModelOptions>;
|
|
912
|
+
mcp?: false | Readonly<ChatMcpOptions>;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export declare interface ChatUIProps {
|
|
916
|
+
data?: Readonly<ChatUIData>;
|
|
917
|
+
ui?: Readonly<ChatUIOptions>;
|
|
918
|
+
inputValue?: string;
|
|
919
|
+
defaultInputValue?: string;
|
|
920
|
+
floatingState?: LayoutFloatingState;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
export declare interface ChatUISlots {
|
|
924
|
+
'layout-header'?: (props: ChatHeaderSlotProps) => unknown;
|
|
925
|
+
'layout-left-aside'?: (props: ChatLeftAsideSlotProps) => unknown;
|
|
926
|
+
'layout-right-aside'?: () => unknown;
|
|
927
|
+
'layout-right-aside-title'?: () => unknown;
|
|
928
|
+
'layout-main'?: (props: ChatMainSlotProps) => unknown;
|
|
929
|
+
'layout-footer'?: (props: ChatSenderSlotProps) => unknown;
|
|
930
|
+
'composer-before'?: (props: ChatSenderSlotProps) => unknown;
|
|
931
|
+
'header-notice'?: () => unknown;
|
|
932
|
+
'request-error'?: (props: {
|
|
933
|
+
error: unknown;
|
|
934
|
+
}) => unknown;
|
|
935
|
+
'welcome-footer'?: () => unknown;
|
|
936
|
+
'prompts-footer'?: () => unknown;
|
|
937
|
+
'bubble-prefix'?: () => unknown;
|
|
938
|
+
'bubble-suffix'?: () => unknown;
|
|
939
|
+
'bubble-after'?: () => unknown;
|
|
940
|
+
'bubble-content-footer'?: () => unknown;
|
|
941
|
+
'sender-footer'?: () => unknown;
|
|
942
|
+
'sender-footer-right'?: () => unknown;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
export declare type ChatWelcomeComposerPlacement = 'footer' | 'center';
|
|
946
|
+
|
|
947
|
+
export declare type ChatWelcomeOptions = Partial<WelcomeProps>;
|
|
948
|
+
|
|
949
|
+
/** Writable counterpart used only where an adapter must mirror state out. */
|
|
950
|
+
export declare interface ChatWritable<T> {
|
|
951
|
+
value: T;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
declare function handleCreateConversation(): void;
|
|
955
|
+
|
|
956
|
+
declare interface KitRuntimeSendPayload extends ChatSendPayload {
|
|
957
|
+
runConfig?: ChatRunConfig;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
export { LayoutFloatingDragDetail }
|
|
961
|
+
|
|
962
|
+
export { LayoutFloatingOptions }
|
|
963
|
+
|
|
964
|
+
export { LayoutFloatingResizeDetail }
|
|
965
|
+
|
|
966
|
+
export { LayoutFloatingState }
|
|
967
|
+
|
|
968
|
+
declare type SubmitActionConfig = NonNullable<DefaultActions['submit']>;
|
|
969
|
+
|
|
970
|
+
declare type TitleGenerator = (text: string) => string;
|
|
971
|
+
|
|
972
|
+
export declare const TrChat: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
973
|
+
|
|
974
|
+
export declare const TrChatUI: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
975
|
+
|
|
976
|
+
export declare function useChatHistoryItems(options: UseChatHistoryItemsOptions): Readonly<ShallowRef<readonly ChatHistoryItem[]>>;
|
|
977
|
+
|
|
978
|
+
export declare interface UseChatHistoryItemsOptions {
|
|
979
|
+
conversations: MaybeRefOrGetter<readonly ChatConversationInfo[] | undefined>;
|
|
980
|
+
defaultTitle: MaybeRefOrGetter<string>;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
export declare function useChatRuntimeAdapter(options: UseChatRuntimeAdapterOptions): {
|
|
984
|
+
data: ComputedRef<ChatUIData>;
|
|
985
|
+
inputValue: ChatReadable<string>;
|
|
986
|
+
setInputValue: (value: string) => void;
|
|
987
|
+
send: (payload: ChatSendPayload) => boolean | Promise<boolean>;
|
|
988
|
+
abort: () => Promise<void | undefined>;
|
|
989
|
+
createConversation: () => Promise<void | undefined>;
|
|
990
|
+
switchConversation: (id: string) => Promise<void | undefined>;
|
|
991
|
+
renameConversation: (id: string, title: string) => Promise<void | undefined>;
|
|
992
|
+
deleteConversation: (id: string) => Promise<void | undefined>;
|
|
993
|
+
selectModel: (id: string | null) => Promise<void>;
|
|
994
|
+
setModelFeature: (id: ChatBuiltInModelFeature, enabled: boolean) => Promise<void>;
|
|
995
|
+
addMcpServer: (id: string) => Promise<void>;
|
|
996
|
+
removeMcpServer: (id: string) => Promise<void>;
|
|
997
|
+
setMcpServerEnabled: (id: string, enabled: boolean) => Promise<void>;
|
|
998
|
+
setMcpToolEnabled: (serverId: string, toolId: string, enabled: boolean) => Promise<void>;
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
export declare interface UseChatRuntimeAdapterOptions {
|
|
1002
|
+
runtime: MaybeRefOrGetter<ChatRuntime>;
|
|
1003
|
+
title?: MaybeRefOrGetter<string | undefined>;
|
|
1004
|
+
onActionError: (payload: ChatRuntimeActionErrorPayload) => void;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
declare type UseKitChatComposerOptions = ChatRuntime['composer'];
|
|
1008
|
+
|
|
1009
|
+
export declare function useKitChatRuntime(options: UseKitChatRuntimeOptions): ChatRuntime;
|
|
1010
|
+
|
|
1011
|
+
export declare interface UseKitChatRuntimeOptions {
|
|
1012
|
+
conversation: UseConversationReturn;
|
|
1013
|
+
lastError?: ChatWritable<unknown | null>;
|
|
1014
|
+
titleGenerator?: TitleGenerator;
|
|
1015
|
+
send?: (payload: KitRuntimeSendPayload) => Promise<void> | void;
|
|
1016
|
+
composer?: UseKitChatComposerOptions;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
export declare function useLocalChatRuntime(options: UseLocalChatRuntimeOptions): ChatRuntime;
|
|
1020
|
+
|
|
1021
|
+
export declare interface UseLocalChatRuntimeMcpAdapter {
|
|
1022
|
+
runtime: ChatMcpRuntime;
|
|
1023
|
+
listTools: ChatToolListTools;
|
|
1024
|
+
callTool: ChatToolCallTool;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
export declare interface UseLocalChatRuntimeOptions {
|
|
1028
|
+
conversation?: Omit<UseConversationOptions, 'useMessageOptions'> & {
|
|
1029
|
+
useMessageOptions?: Partial<UseConversationOptions['useMessageOptions']>;
|
|
1030
|
+
};
|
|
1031
|
+
titleGenerator?: (text: string) => string;
|
|
1032
|
+
composer?: Pick<ChatComposerRuntime, 'disabled' | 'submitDisabled'>;
|
|
1033
|
+
modelProviders?: readonly ChatProviderConfig[];
|
|
1034
|
+
mcp?: UseLocalChatRuntimeMcpAdapter;
|
|
1035
|
+
mcpServers?: ChatMcpServers;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
export { }
|