@kernelift/ai-chat 1.0.1 → 1.0.2
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/ai-chat.css +1 -1
- package/dist/index.d.ts +125 -32
- package/dist/index.js +74 -74
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ComponentOptionsMixin } from 'vue';
|
|
|
3
3
|
import { ComponentProvideOptions } from 'vue';
|
|
4
4
|
import { DefineComponent } from 'vue';
|
|
5
5
|
import { PublicProps } from 'vue';
|
|
6
|
+
import { VNode } from 'vue';
|
|
6
7
|
|
|
7
8
|
declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8
9
|
"update:modelValue": (value: ChatMessage) => any;
|
|
@@ -19,30 +20,30 @@ declare const __VLS_component_2: DefineComponent<__VLS_PublicProps_2, {}, {}, {}
|
|
|
19
20
|
"update:loading": (value: boolean) => any;
|
|
20
21
|
"update:record-id": (value: string | undefined) => any;
|
|
21
22
|
} & {
|
|
22
|
-
"bubble-event": (eventName: BubbleEvent, data: ChatMessage) => any;
|
|
23
|
-
clear: () => any;
|
|
24
|
-
"change-collapse": (collapse: boolean) => any;
|
|
25
|
-
"change-theme": (themeMode: "light" | "dark") => any;
|
|
26
|
-
"click-logo": () => any;
|
|
27
23
|
send: (value: string, isEnableThink?: boolean | undefined, isEnableNet?: boolean | undefined) => any;
|
|
28
24
|
cancel: () => any;
|
|
25
|
+
clear: () => any;
|
|
29
26
|
"create-record": (data: ChatMessage[]) => any;
|
|
30
27
|
"change-record": (value?: ChatRecord | undefined) => any;
|
|
28
|
+
"change-collapse": (collapse: boolean) => any;
|
|
29
|
+
"change-theme": (themeMode: "light" | "dark") => any;
|
|
31
30
|
"change-aside-width": (width: number) => any;
|
|
31
|
+
"click-logo": () => any;
|
|
32
|
+
"bubble-event": (eventName: BubbleEvent, data: ChatMessage) => any;
|
|
32
33
|
"close-workspace": () => any;
|
|
33
34
|
}, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
|
|
34
|
-
"onBubble-event"?: ((eventName: BubbleEvent, data: ChatMessage) => any) | undefined;
|
|
35
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
36
|
-
onClear?: (() => any) | undefined;
|
|
37
|
-
"onChange-collapse"?: ((collapse: boolean) => any) | undefined;
|
|
38
|
-
"onChange-theme"?: ((themeMode: "light" | "dark") => any) | undefined;
|
|
39
|
-
"onClick-logo"?: (() => any) | undefined;
|
|
40
35
|
onSend?: ((value: string, isEnableThink?: boolean | undefined, isEnableNet?: boolean | undefined) => any) | undefined;
|
|
41
36
|
onCancel?: (() => any) | undefined;
|
|
37
|
+
onClear?: (() => any) | undefined;
|
|
42
38
|
"onCreate-record"?: ((data: ChatMessage[]) => any) | undefined;
|
|
43
39
|
"onChange-record"?: ((value?: ChatRecord | undefined) => any) | undefined;
|
|
40
|
+
"onChange-collapse"?: ((collapse: boolean) => any) | undefined;
|
|
41
|
+
"onChange-theme"?: ((themeMode: "light" | "dark") => any) | undefined;
|
|
44
42
|
"onChange-aside-width"?: ((width: number) => any) | undefined;
|
|
43
|
+
"onClick-logo"?: (() => any) | undefined;
|
|
44
|
+
"onBubble-event"?: ((eventName: BubbleEvent, data: ChatMessage) => any) | undefined;
|
|
45
45
|
"onClose-workspace"?: (() => any) | undefined;
|
|
46
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
46
47
|
"onUpdate:messages"?: ((value: ChatMessage[]) => any) | undefined;
|
|
47
48
|
"onUpdate:loading"?: ((value: boolean) => any) | undefined;
|
|
48
49
|
"onUpdate:record-id"?: ((value: string | undefined) => any) | undefined;
|
|
@@ -69,9 +70,9 @@ declare const __VLS_component_3: DefineComponent<__VLS_PublicProps_3, {}, {}, {}
|
|
|
69
70
|
send: (text: string) => any;
|
|
70
71
|
cancel: () => any;
|
|
71
72
|
}, string, PublicProps, Readonly<__VLS_PublicProps_3> & Readonly<{
|
|
72
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
73
73
|
onSend?: ((text: string) => any) | undefined;
|
|
74
74
|
onCancel?: (() => any) | undefined;
|
|
75
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
75
76
|
"onUpdate:enableThink"?: ((value: boolean) => any) | undefined;
|
|
76
77
|
"onUpdate:enableNet"?: ((value: boolean) => any) | undefined;
|
|
77
78
|
}>, {
|
|
@@ -92,26 +93,7 @@ declare type __VLS_Props = {
|
|
|
92
93
|
messager: any;
|
|
93
94
|
};
|
|
94
95
|
|
|
95
|
-
declare type __VLS_Props_2 =
|
|
96
|
-
records?: ChatRecord[];
|
|
97
|
-
recordActions?: ChatRecordAction[];
|
|
98
|
-
hasHeader?: boolean;
|
|
99
|
-
hasThemeMode?: boolean;
|
|
100
|
-
hasThinking?: boolean;
|
|
101
|
-
hasNetSearch?: boolean;
|
|
102
|
-
hasSenderTools?: boolean;
|
|
103
|
-
showWorkspace?: boolean;
|
|
104
|
-
isGenerateLoading?: boolean;
|
|
105
|
-
defaultRecordId?: string;
|
|
106
|
-
defaultCollapse?: boolean;
|
|
107
|
-
defaultAsideWidth?: number;
|
|
108
|
-
markdownClassName?: string;
|
|
109
|
-
primaryColor?: string;
|
|
110
|
-
themeMode?: 'light' | 'dark';
|
|
111
|
-
enableNet?: boolean;
|
|
112
|
-
enableThink?: boolean;
|
|
113
|
-
messager: any;
|
|
114
|
-
};
|
|
96
|
+
declare type __VLS_Props_2 = ChatProps;
|
|
115
97
|
|
|
116
98
|
declare type __VLS_Props_3 = {
|
|
117
99
|
record?: ChatRecord | null;
|
|
@@ -329,6 +311,23 @@ export declare const ChatBubble: __VLS_WithTemplateSlots<typeof __VLS_component,
|
|
|
329
311
|
|
|
330
312
|
export declare const ChatContainer: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
331
313
|
|
|
314
|
+
/**
|
|
315
|
+
* @description 聊天事件
|
|
316
|
+
*/
|
|
317
|
+
export declare interface ChatEvents {
|
|
318
|
+
(e: 'send', value: string, isEnableThink?: boolean, isEnableNet?: boolean): void;
|
|
319
|
+
(e: 'cancel'): void;
|
|
320
|
+
(e: 'clear'): void;
|
|
321
|
+
(e: 'create-record', data: ChatMessage[]): void;
|
|
322
|
+
(e: 'change-record', value?: ChatRecord): void;
|
|
323
|
+
(e: 'change-collapse', collapse: boolean): void;
|
|
324
|
+
(e: 'change-theme', themeMode: 'light' | 'dark'): void;
|
|
325
|
+
(e: 'change-aside-width', width: number): void;
|
|
326
|
+
(e: 'click-logo'): void;
|
|
327
|
+
(e: 'bubble-event', eventName: BubbleEvent, data: ChatMessage): void;
|
|
328
|
+
(e: 'close-workspace'): void;
|
|
329
|
+
}
|
|
330
|
+
|
|
332
331
|
export declare const ChatHeader: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
333
332
|
|
|
334
333
|
/**
|
|
@@ -407,6 +406,30 @@ export declare interface ChatMessage {
|
|
|
407
406
|
};
|
|
408
407
|
}
|
|
409
408
|
|
|
409
|
+
/**
|
|
410
|
+
* @description 聊天属性
|
|
411
|
+
*/
|
|
412
|
+
export declare interface ChatProps {
|
|
413
|
+
records?: ChatRecord[];
|
|
414
|
+
recordActions?: ChatRecordAction[];
|
|
415
|
+
hasHeader?: boolean;
|
|
416
|
+
hasThemeMode?: boolean;
|
|
417
|
+
hasThinking?: boolean;
|
|
418
|
+
hasNetSearch?: boolean;
|
|
419
|
+
hasSenderTools?: boolean;
|
|
420
|
+
showWorkspace?: boolean;
|
|
421
|
+
isGenerateLoading?: boolean;
|
|
422
|
+
defaultRecordId?: string;
|
|
423
|
+
defaultCollapse?: boolean;
|
|
424
|
+
defaultAsideWidth?: number;
|
|
425
|
+
markdownClassName?: string;
|
|
426
|
+
primaryColor?: string;
|
|
427
|
+
themeMode?: 'light' | 'dark';
|
|
428
|
+
enableNet?: boolean;
|
|
429
|
+
enableThink?: boolean;
|
|
430
|
+
messager: any;
|
|
431
|
+
}
|
|
432
|
+
|
|
410
433
|
/**
|
|
411
434
|
* @description ai聊天历史记录
|
|
412
435
|
*/
|
|
@@ -434,6 +457,76 @@ export declare interface ChatRecordAction {
|
|
|
434
457
|
|
|
435
458
|
export declare const ChatSender: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
436
459
|
|
|
460
|
+
/**
|
|
461
|
+
* @description 聊天插槽
|
|
462
|
+
*/
|
|
463
|
+
export declare interface ChatSlots {
|
|
464
|
+
'left-aside': (props: {
|
|
465
|
+
mobile: boolean;
|
|
466
|
+
}) => VNode[];
|
|
467
|
+
aside: (props: {
|
|
468
|
+
record: ChatRecord | undefined;
|
|
469
|
+
mobile: boolean;
|
|
470
|
+
}) => VNode[];
|
|
471
|
+
logo: (props: {
|
|
472
|
+
mobile: boolean;
|
|
473
|
+
}) => VNode[];
|
|
474
|
+
'new-chat-button': (props: {
|
|
475
|
+
mobile: boolean;
|
|
476
|
+
}) => VNode[];
|
|
477
|
+
'record-dropdown': (props: {
|
|
478
|
+
mobile: boolean;
|
|
479
|
+
}) => VNode[];
|
|
480
|
+
header: (props: {
|
|
481
|
+
record: ChatRecord | undefined;
|
|
482
|
+
mobile: boolean;
|
|
483
|
+
}) => VNode[];
|
|
484
|
+
'header-logo': (props: {
|
|
485
|
+
mobile: boolean;
|
|
486
|
+
}) => VNode[];
|
|
487
|
+
'bubble-header': (props: {
|
|
488
|
+
data: ChatMessage;
|
|
489
|
+
mobile: boolean;
|
|
490
|
+
}) => VNode[];
|
|
491
|
+
'bubble-footer': (props: {
|
|
492
|
+
data: ChatMessage;
|
|
493
|
+
mobile: boolean;
|
|
494
|
+
}) => VNode[];
|
|
495
|
+
'bubble-event': (props: {
|
|
496
|
+
data: ChatMessage;
|
|
497
|
+
mobile: boolean;
|
|
498
|
+
}) => VNode[];
|
|
499
|
+
'bubble-content-footer': (props: {
|
|
500
|
+
data: ChatMessage;
|
|
501
|
+
mobile: boolean;
|
|
502
|
+
}) => VNode[];
|
|
503
|
+
'bubble-thinking-header': (props: {
|
|
504
|
+
data: ChatMessage;
|
|
505
|
+
mobile: boolean;
|
|
506
|
+
}) => VNode[];
|
|
507
|
+
'bubble-loading-content': (props: {
|
|
508
|
+
mobile: boolean;
|
|
509
|
+
}) => VNode[];
|
|
510
|
+
empty: (props: {
|
|
511
|
+
mobile: boolean;
|
|
512
|
+
}) => VNode[];
|
|
513
|
+
'sender-tools': (props: {
|
|
514
|
+
mobile: boolean;
|
|
515
|
+
}) => VNode[];
|
|
516
|
+
'sender-footer-tools': (props: {
|
|
517
|
+
value: string;
|
|
518
|
+
loading: boolean;
|
|
519
|
+
mobile: boolean;
|
|
520
|
+
}) => VNode[];
|
|
521
|
+
footer: (props: {
|
|
522
|
+
mobile: boolean;
|
|
523
|
+
}) => VNode[];
|
|
524
|
+
workspace: (props: {
|
|
525
|
+
record: ChatRecord | undefined;
|
|
526
|
+
mobile: boolean;
|
|
527
|
+
}) => VNode[];
|
|
528
|
+
}
|
|
529
|
+
|
|
437
530
|
export declare class SSEClient {
|
|
438
531
|
private controller;
|
|
439
532
|
private buffer;
|