@kernelift/ai-chat 1.0.3 → 1.0.5
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/CHANGELOG.md +48 -0
- package/README.md +86 -100
- package/dist/ai-chat.css +1 -1
- package/dist/index.d.ts +72 -0
- package/dist/index.js +12172 -879
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ clear: () => any;
|
|
|
31
31
|
"click-logo": () => any;
|
|
32
32
|
"bubble-event": (eventName: BubbleEvent, data: ChatMessage) => any;
|
|
33
33
|
"close-workspace": () => any;
|
|
34
|
+
"scroll-bottom": () => any;
|
|
34
35
|
}, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
|
|
35
36
|
onSend?: ((value: string, isEnableThink?: boolean | undefined, isEnableNet?: boolean | undefined) => any) | undefined;
|
|
36
37
|
onCancel?: (() => any) | undefined;
|
|
@@ -43,6 +44,7 @@ onClear?: (() => any) | undefined;
|
|
|
43
44
|
"onClick-logo"?: (() => any) | undefined;
|
|
44
45
|
"onBubble-event"?: ((eventName: BubbleEvent, data: ChatMessage) => any) | undefined;
|
|
45
46
|
"onClose-workspace"?: (() => any) | undefined;
|
|
47
|
+
"onScroll-bottom"?: (() => any) | undefined;
|
|
46
48
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
47
49
|
"onUpdate:messages"?: ((value: ChatMessage[]) => any) | undefined;
|
|
48
50
|
"onUpdate:loading"?: ((value: boolean) => any) | undefined;
|
|
@@ -52,11 +54,14 @@ themeMode: "light" | "dark";
|
|
|
52
54
|
hasThemeMode: boolean;
|
|
53
55
|
hasThinking: boolean;
|
|
54
56
|
hasNetSearch: boolean;
|
|
57
|
+
inputHeight: number;
|
|
58
|
+
uuid: string;
|
|
55
59
|
records: ChatRecord[];
|
|
56
60
|
recordActions: ChatRecordAction[];
|
|
57
61
|
hasHeader: boolean;
|
|
58
62
|
hasSenderTools: boolean;
|
|
59
63
|
showWorkspace: boolean;
|
|
64
|
+
showSender: boolean;
|
|
60
65
|
defaultCollapse: boolean;
|
|
61
66
|
defaultAsideWidth: number;
|
|
62
67
|
primaryColor: string;
|
|
@@ -79,6 +84,7 @@ onCancel?: (() => any) | undefined;
|
|
|
79
84
|
loading: boolean;
|
|
80
85
|
hasThinking: boolean;
|
|
81
86
|
hasNetSearch: boolean;
|
|
87
|
+
inputHeight: number;
|
|
82
88
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
83
89
|
|
|
84
90
|
declare const __VLS_component_4: DefineComponent<__VLS_PublicProps_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -103,6 +109,7 @@ declare type __VLS_Props_4 = {
|
|
|
103
109
|
loading?: boolean;
|
|
104
110
|
hasThinking?: boolean;
|
|
105
111
|
hasNetSearch?: boolean;
|
|
112
|
+
inputHeight?: number;
|
|
106
113
|
};
|
|
107
114
|
|
|
108
115
|
declare type __VLS_Props_5 = {
|
|
@@ -138,6 +145,7 @@ declare function __VLS_template(): {
|
|
|
138
145
|
slots: {
|
|
139
146
|
header?(_: {}): any;
|
|
140
147
|
'thinking-header'?(_: {}): any;
|
|
148
|
+
'content-header'?(_: {}): any;
|
|
141
149
|
content?(_: {}): any;
|
|
142
150
|
'content-footer'?(_: {}): any;
|
|
143
151
|
footer?(_: {}): any;
|
|
@@ -171,8 +179,24 @@ declare function __VLS_template_2(): {
|
|
|
171
179
|
logo?(_: {
|
|
172
180
|
mobile: boolean;
|
|
173
181
|
}): any;
|
|
182
|
+
'record-footer'?(_: {
|
|
183
|
+
record: {
|
|
184
|
+
id: string;
|
|
185
|
+
name: string;
|
|
186
|
+
content: string;
|
|
187
|
+
type: string;
|
|
188
|
+
createTime: string;
|
|
189
|
+
userId: string;
|
|
190
|
+
updateTime?: string | undefined;
|
|
191
|
+
extraData?: {
|
|
192
|
+
[key: string]: any;
|
|
193
|
+
} | undefined;
|
|
194
|
+
} | null | undefined;
|
|
195
|
+
mobile: boolean;
|
|
196
|
+
}): any;
|
|
174
197
|
'new-chat-button'?(_: {
|
|
175
198
|
mobile: boolean;
|
|
199
|
+
execute: () => void;
|
|
176
200
|
}): any;
|
|
177
201
|
'record-dropdown'?(_: {
|
|
178
202
|
mobile: boolean;
|
|
@@ -207,6 +231,10 @@ declare function __VLS_template_2(): {
|
|
|
207
231
|
data: ChatMessage;
|
|
208
232
|
mobile: boolean;
|
|
209
233
|
}): any;
|
|
234
|
+
'bubble-content-header'?(_: {
|
|
235
|
+
data: ChatMessage;
|
|
236
|
+
mobile: boolean;
|
|
237
|
+
}): any;
|
|
210
238
|
'bubble-content-footer'?(_: {
|
|
211
239
|
data: ChatMessage;
|
|
212
240
|
mobile: boolean;
|
|
@@ -227,6 +255,25 @@ declare function __VLS_template_2(): {
|
|
|
227
255
|
'sender-footer-tools'?(_: {
|
|
228
256
|
value: string;
|
|
229
257
|
loading: boolean;
|
|
258
|
+
enableNet: boolean;
|
|
259
|
+
enableThink: boolean;
|
|
260
|
+
mobile: boolean;
|
|
261
|
+
}): any;
|
|
262
|
+
'sender-button'?(_: {
|
|
263
|
+
execute: () => void;
|
|
264
|
+
state: {
|
|
265
|
+
loading: boolean;
|
|
266
|
+
inputText: string;
|
|
267
|
+
};
|
|
268
|
+
mobile: boolean;
|
|
269
|
+
}): any;
|
|
270
|
+
'sender-textarea'?(_: {
|
|
271
|
+
execute: () => void;
|
|
272
|
+
state: {
|
|
273
|
+
loading: boolean;
|
|
274
|
+
inputText: string;
|
|
275
|
+
};
|
|
276
|
+
height: number;
|
|
230
277
|
mobile: boolean;
|
|
231
278
|
}): any;
|
|
232
279
|
footer?(_: {
|
|
@@ -255,10 +302,25 @@ declare function __VLS_template_2(): {
|
|
|
255
302
|
declare function __VLS_template_3(): {
|
|
256
303
|
attrs: Partial<{}>;
|
|
257
304
|
slots: {
|
|
305
|
+
textarea?(_: {
|
|
306
|
+
height: number;
|
|
307
|
+
execute: typeof handleClickButton;
|
|
308
|
+
state: {
|
|
309
|
+
loading: boolean;
|
|
310
|
+
inputText: string;
|
|
311
|
+
};
|
|
312
|
+
}): any;
|
|
258
313
|
tools?(_: {
|
|
259
314
|
value: string;
|
|
260
315
|
loading: boolean;
|
|
261
316
|
}): any;
|
|
317
|
+
'send-button'?(_: {
|
|
318
|
+
execute: typeof handleClickButton;
|
|
319
|
+
state: {
|
|
320
|
+
loading: boolean;
|
|
321
|
+
inputText: string;
|
|
322
|
+
};
|
|
323
|
+
}): any;
|
|
262
324
|
};
|
|
263
325
|
refs: {};
|
|
264
326
|
rootEl: HTMLDivElement;
|
|
@@ -326,6 +388,7 @@ export declare interface ChatEvents {
|
|
|
326
388
|
(e: 'click-logo'): void;
|
|
327
389
|
(e: 'bubble-event', eventName: BubbleEvent, data: ChatMessage): void;
|
|
328
390
|
(e: 'close-workspace'): void;
|
|
391
|
+
(e: 'scroll-bottom'): void;
|
|
329
392
|
}
|
|
330
393
|
|
|
331
394
|
export declare const ChatHeader: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -398,6 +461,10 @@ export declare interface ChatMessage {
|
|
|
398
461
|
* 工具调用
|
|
399
462
|
*/
|
|
400
463
|
toolCalls?: any[];
|
|
464
|
+
/**
|
|
465
|
+
* 是否隐藏底部工具
|
|
466
|
+
*/
|
|
467
|
+
hideFooterTools?: boolean;
|
|
401
468
|
/**
|
|
402
469
|
* 额外的数据
|
|
403
470
|
*/
|
|
@@ -410,14 +477,17 @@ export declare interface ChatMessage {
|
|
|
410
477
|
* @description 聊天属性
|
|
411
478
|
*/
|
|
412
479
|
export declare interface ChatProps {
|
|
480
|
+
uuid?: string;
|
|
413
481
|
records?: ChatRecord[];
|
|
414
482
|
recordActions?: ChatRecordAction[];
|
|
415
483
|
hasHeader?: boolean;
|
|
416
484
|
hasThemeMode?: boolean;
|
|
485
|
+
inputHeight?: number;
|
|
417
486
|
hasThinking?: boolean;
|
|
418
487
|
hasNetSearch?: boolean;
|
|
419
488
|
hasSenderTools?: boolean;
|
|
420
489
|
showWorkspace?: boolean;
|
|
490
|
+
showSender?: boolean;
|
|
421
491
|
isGenerateLoading?: boolean;
|
|
422
492
|
defaultRecordId?: string;
|
|
423
493
|
defaultCollapse?: boolean;
|
|
@@ -527,6 +597,8 @@ export declare interface ChatSlots {
|
|
|
527
597
|
}) => VNode[];
|
|
528
598
|
}
|
|
529
599
|
|
|
600
|
+
declare function handleClickButton(): void;
|
|
601
|
+
|
|
530
602
|
export declare class SSEClient {
|
|
531
603
|
private controller;
|
|
532
604
|
private buffer;
|