@blueking/chat-x 0.0.47-beta.4 → 0.0.48-beta.1
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/components/chat-input/chat-input.vue.d.ts +15 -2
- package/dist/components/chat-input/input-attachment/input-attachment.vue.d.ts +4 -2
- package/dist/components/chat-input/model-selector/capabilities.d.ts +3 -0
- package/dist/components/chat-input/model-selector/index.d.ts +3 -0
- package/dist/components/chat-input/model-selector/model-selector-panel.vue.d.ts +26 -0
- package/dist/components/chat-input/model-selector/model-selector-trigger.vue.d.ts +14 -0
- package/dist/components/chat-input/model-selector/model-selector.vue.d.ts +39 -0
- package/dist/components/chat-input/model-selector/types.d.ts +61 -0
- package/dist/components/chat-input/model-selector/use-model-selector.d.ts +17 -0
- package/dist/components/chat-message/message-container/message-container.vue.d.ts +2 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/icons/input.d.ts +7 -0
- package/dist/index.css +1 -1
- package/dist/index.js +2147 -1853
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +5 -1
- package/dist/mcp/generated/docs/chat-container.md +189 -74
- package/dist/mcp/generated/docs/chat-input.md +57 -0
- package/dist/mcp/generated/docs/input-attachment.md +1 -0
- package/dist/mcp/generated/docs/message-container.md +47 -0
- package/dist/mcp/generated/docs/message-tools.md +5 -1
- package/dist/mcp/generated/docs/model-selector.md +157 -0
- package/dist/mcp/generated/docs/tool-btn.md +33 -4
- package/dist/mcp/generated/index.json +31 -3
- package/dist/mcp/index.js +0 -0
- package/dist/types/tool.d.ts +6 -2
- package/package.json +21 -20
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { type Interrupt, type InterruptResume, type UserMessage, MessageContentType, MessageStatus } from '../../ag-ui/types';
|
|
2
2
|
import { type AITippyProps, type IAiSlashMenuItem, type ISkillListItem, type Shortcut, type TagSchema, type UploadFile, UploadStatus } from '../../types';
|
|
3
|
+
import type { IModelOption } from './model-selector';
|
|
3
4
|
export type ChatInputEmits = {
|
|
4
5
|
(e: 'selectShortcut', shortcut: Shortcut): void;
|
|
5
6
|
(e: 'deleteShortcut'): void;
|
|
6
7
|
(e: 'update:modelValue', value: string | TagSchema, selectedResourceList: IAiSlashMenuItem[]): void;
|
|
8
|
+
(e: 'modelChange', model: IModelOption): void;
|
|
7
9
|
};
|
|
8
10
|
export type ChatInputProps = {
|
|
9
11
|
defaultUploadFiles?: UploadFile[];
|
|
10
12
|
inputMaxHeight?: number;
|
|
11
13
|
messageStatus?: MessageStatus;
|
|
14
|
+
models?: IModelOption[];
|
|
12
15
|
modelValue: string | TagSchema;
|
|
13
16
|
onSendMessage?: (message: UserMessage['content'], docSchema: TagSchema, options?: {
|
|
14
17
|
interrupt?: Interrupt;
|
|
@@ -31,6 +34,7 @@ export type ChatInputProps = {
|
|
|
31
34
|
type __VLS_Props = ChatInputProps;
|
|
32
35
|
type __VLS_ModelProps = {
|
|
33
36
|
'cite'?: string;
|
|
37
|
+
'selectedModel'?: string;
|
|
34
38
|
};
|
|
35
39
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
36
40
|
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_14: {
|
|
@@ -55,7 +59,10 @@ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_14: {
|
|
|
55
59
|
} | undefined;
|
|
56
60
|
status?: UploadStatus | undefined;
|
|
57
61
|
}[];
|
|
58
|
-
}, __VLS_51: {}, __VLS_75: {
|
|
62
|
+
}, __VLS_51: {}, __VLS_75: {
|
|
63
|
+
models: IModelOption[] | undefined;
|
|
64
|
+
selectedModel: string | undefined;
|
|
65
|
+
}, __VLS_85: {};
|
|
59
66
|
type __VLS_Slots = {} & {
|
|
60
67
|
top?: (props: typeof __VLS_1) => any;
|
|
61
68
|
} & {
|
|
@@ -67,13 +74,16 @@ type __VLS_Slots = {} & {
|
|
|
67
74
|
} & {
|
|
68
75
|
attachment?: (props: typeof __VLS_51) => any;
|
|
69
76
|
} & {
|
|
70
|
-
'
|
|
77
|
+
'model-selector'?: (props: typeof __VLS_75) => any;
|
|
78
|
+
} & {
|
|
79
|
+
'send-icon'?: (props: typeof __VLS_85) => any;
|
|
71
80
|
};
|
|
72
81
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
73
82
|
focus: () => void;
|
|
74
83
|
triggerSendMessage: () => Promise<void>;
|
|
75
84
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
76
85
|
"update:cite": (value: string) => any;
|
|
86
|
+
"update:selectedModel": (value: string | undefined) => any;
|
|
77
87
|
} & {
|
|
78
88
|
"update:modelValue": (value: string | ({
|
|
79
89
|
text: string;
|
|
@@ -88,6 +98,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
88
98
|
})[][], selectedResourceList: IAiSlashMenuItem[]) => any;
|
|
89
99
|
selectShortcut: (shortcut: Shortcut) => any;
|
|
90
100
|
deleteShortcut: () => any;
|
|
101
|
+
modelChange: (model: IModelOption) => any;
|
|
91
102
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
92
103
|
"onUpdate:modelValue"?: ((value: string | ({
|
|
93
104
|
text: string;
|
|
@@ -102,7 +113,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
102
113
|
})[][], selectedResourceList: IAiSlashMenuItem[]) => any) | undefined;
|
|
103
114
|
onSelectShortcut?: ((shortcut: Shortcut) => any) | undefined;
|
|
104
115
|
onDeleteShortcut?: (() => any) | undefined;
|
|
116
|
+
onModelChange?: ((model: IModelOption) => any) | undefined;
|
|
105
117
|
"onUpdate:cite"?: ((value: string) => any) | undefined;
|
|
118
|
+
"onUpdate:selectedModel"?: ((value: string | undefined) => any) | undefined;
|
|
106
119
|
}>, {
|
|
107
120
|
placeholder: string;
|
|
108
121
|
prompts: string[];
|
|
@@ -6,11 +6,13 @@ type __VLS_Props = {
|
|
|
6
6
|
sendDisabledTip?: string;
|
|
7
7
|
tippyOptions?: AITippyProps;
|
|
8
8
|
};
|
|
9
|
-
declare var __VLS_1: {}, __VLS_3: {};
|
|
9
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
10
10
|
type __VLS_Slots = {} & {
|
|
11
11
|
default?: (props: typeof __VLS_1) => any;
|
|
12
12
|
} & {
|
|
13
|
-
'send
|
|
13
|
+
'before-send'?: (props: typeof __VLS_3) => any;
|
|
14
|
+
} & {
|
|
15
|
+
'send-icon'?: (props: typeof __VLS_5) => any;
|
|
14
16
|
};
|
|
15
17
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
16
18
|
sendMessage: () => any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IModelOption } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 待展示的模型列表(已按关键字过滤) */
|
|
4
|
+
models: IModelOption[];
|
|
5
|
+
/** 搜索框占位文案 */
|
|
6
|
+
searchPlaceholder?: string;
|
|
7
|
+
/** 当前选中模型的 llm_name */
|
|
8
|
+
selectedName?: string;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_ModelProps = {
|
|
11
|
+
/** 搜索关键字(受控,回传给容器交由 composable 过滤) */
|
|
12
|
+
'keyword'?: string;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
16
|
+
focusSearch: () => void;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:keyword": (value: string) => any;
|
|
19
|
+
} & {
|
|
20
|
+
select: (model: IModelOption) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
onSelect?: ((model: IModelOption) => any) | undefined;
|
|
23
|
+
"onUpdate:keyword"?: ((value: string) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IModelOption } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 是否禁用 */
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** 是否展开(下拉打开),用于箭头翻转与背景态 */
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
/** 当前选中的模型 */
|
|
8
|
+
model?: IModelOption;
|
|
9
|
+
/** 无选中时的占位文案 */
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type TippyOptions } from 'vue-tippy';
|
|
2
|
+
import type { IModelOption } from './types';
|
|
3
|
+
import 'tippy.js/dist/tippy.css';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** 是否禁用整个选择器 */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** 模型列表 */
|
|
8
|
+
models?: IModelOption[];
|
|
9
|
+
/** trigger 无选中时的占位文案 */
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
/** 搜索框占位文案 */
|
|
12
|
+
searchPlaceholder?: string;
|
|
13
|
+
/** 透传给 tippy 的额外配置 */
|
|
14
|
+
tippyOptions?: Partial<Omit<TippyOptions, 'getReferenceClientRect' | 'triggerTarget'>>;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_ModelProps = {
|
|
17
|
+
/** 当前选中的模型(值为 llm_name,v-model) */
|
|
18
|
+
modelValue?: string;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
23
|
+
} & {
|
|
24
|
+
change: (model: IModelOption) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
onChange?: ((model: IModelOption) => any) | undefined;
|
|
27
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
placeholder: string;
|
|
30
|
+
searchPlaceholder: string;
|
|
31
|
+
tippyOptions: Partial<Omit<Partial<Omit<import("tippy.js").Props, "content" | "triggerTarget" | "getReferenceClientRect"> & {
|
|
32
|
+
content: import("vue-tippy").TippyContent;
|
|
33
|
+
triggerTarget: import("vue-tippy").TippyTarget;
|
|
34
|
+
getReferenceClientRect: null | (() => DOMRect & any);
|
|
35
|
+
}>, "triggerTarget" | "getReferenceClientRect">>;
|
|
36
|
+
models: IModelOption[];
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** 模型能力标签,如「图生文」「深度思考」「快速思考」(由组件依据 property 派生,走内置 i18n) */
|
|
2
|
+
export interface IModelCapability {
|
|
3
|
+
/** 标签文案 */
|
|
4
|
+
text: string;
|
|
5
|
+
/** 语义主题,决定标签配色,缺省为 default */
|
|
6
|
+
theme?: ModelCapabilityTheme;
|
|
7
|
+
}
|
|
8
|
+
/** 模型选项(贴合后端模型接口结构) */
|
|
9
|
+
export interface IModelOption {
|
|
10
|
+
/** 基础模型标识,如 deepseek */
|
|
11
|
+
base_model?: string;
|
|
12
|
+
/** 模型描述,作为选项 hover 的 title 提示 */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** 是否禁用(前端扩展字段,后端无此字段时默认不禁用) */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** 模型图标地址 */
|
|
17
|
+
icon?: string;
|
|
18
|
+
/** 模型主键 id */
|
|
19
|
+
id: number;
|
|
20
|
+
/** 模型编码 */
|
|
21
|
+
llm_code: string;
|
|
22
|
+
/** 模型展示名,同时作为选中值(v-model:selectedModel) */
|
|
23
|
+
llm_name: string;
|
|
24
|
+
/** 模型类型,如 chat.completion */
|
|
25
|
+
llm_type: string;
|
|
26
|
+
/** 最大 token 数 */
|
|
27
|
+
max_token_size: number;
|
|
28
|
+
/** 模型能力属性,用于派生能力标签 */
|
|
29
|
+
property: IModelProperty;
|
|
30
|
+
/** 空间维度鉴权模式,如 APPLY */
|
|
31
|
+
space_auth_mode: string;
|
|
32
|
+
/** 标签名列表 */
|
|
33
|
+
tag_names?: string[];
|
|
34
|
+
/** 用户维度鉴权模式,如 PUBLIC */
|
|
35
|
+
user_auth_mode: string;
|
|
36
|
+
}
|
|
37
|
+
/** 模型属性(后端 property 字段),描述模型支持的能力开关与运行参数 */
|
|
38
|
+
export interface IModelProperty {
|
|
39
|
+
/** 智能体类型,如 openai */
|
|
40
|
+
agent_type?: string;
|
|
41
|
+
/** 是否为默认模型 */
|
|
42
|
+
default?: boolean;
|
|
43
|
+
/** 是否自建部署 */
|
|
44
|
+
is_self_host?: boolean;
|
|
45
|
+
/** 模型最大上下文长度 */
|
|
46
|
+
max_model_len?: number;
|
|
47
|
+
/** 是否支持摘要 */
|
|
48
|
+
support_summary?: boolean;
|
|
49
|
+
/** 是否支持深度思考 */
|
|
50
|
+
support_thinking?: boolean;
|
|
51
|
+
/** 是否支持快速思考 */
|
|
52
|
+
support_thinking_quick?: boolean;
|
|
53
|
+
/** 是否支持工具调用 */
|
|
54
|
+
support_tools?: boolean;
|
|
55
|
+
/** 是否支持图生文(视觉) */
|
|
56
|
+
support_vision?: boolean;
|
|
57
|
+
/** 是否支持上下文窗口 */
|
|
58
|
+
support_window?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** 模型能力标签的语义主题,决定标签配色(与设计稿语义色一一对应) */
|
|
61
|
+
export type ModelCapabilityTheme = 'default' | 'primary' | 'success' | 'warning';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { IModelOption } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 模型选择的纯数据逻辑(与 UI 解耦,可独立单测):
|
|
5
|
+
* 仅负责「按关键字过滤」与「解析当前选中模型」,不持有任何展示/交互态。
|
|
6
|
+
*/
|
|
7
|
+
export declare const useModelSelector: (params: {
|
|
8
|
+
/** 模型列表 */
|
|
9
|
+
models: ComputedRef<IModelOption[]> | Ref<IModelOption[]>;
|
|
10
|
+
/** 当前选中模型(值为 llm_name) */
|
|
11
|
+
selectedModel: Ref<string | undefined>;
|
|
12
|
+
}) => {
|
|
13
|
+
keyword: import("vue").ShallowRef<string, string>;
|
|
14
|
+
filteredModels: ComputedRef<IModelOption[]>;
|
|
15
|
+
currentModel: ComputedRef<IModelOption | undefined>;
|
|
16
|
+
resetKeyword: () => void;
|
|
17
|
+
};
|
|
@@ -14,6 +14,7 @@ export type MessageContainerProps = {
|
|
|
14
14
|
messageGroups: MessageGroup[];
|
|
15
15
|
messages: Message[];
|
|
16
16
|
messageStatus?: MessageStatus;
|
|
17
|
+
messageTools?: IToolBtn[];
|
|
17
18
|
messageToolsStatus?: MessageToolsStatus;
|
|
18
19
|
messageToolsTippyOptions?: MessageToolsProps['tippyOptions'];
|
|
19
20
|
onAgentAction?: AgentActionCallback;
|
|
@@ -21,6 +22,7 @@ export type MessageContainerProps = {
|
|
|
21
22
|
onInterruptResume?: OnInterruptResume;
|
|
22
23
|
onUserAction?: UserActionCallback;
|
|
23
24
|
renderMode?: RenderMode;
|
|
25
|
+
updateTools?: IToolBtn[];
|
|
24
26
|
} & {
|
|
25
27
|
onUserInputConfirm?: (message: Message, content: UserMessage['content'], docSchema: TagSchema) => Promise<void>;
|
|
26
28
|
onUserShortcutConfirm?: (message: Message, formModel: Record<string, unknown>) => Promise<void>;
|
|
@@ -8,7 +8,9 @@ import ChatContainer from './chat-container/chat-container.vue';
|
|
|
8
8
|
import commonErrorContent from './chat-content/common-error-content/common-error-content.vue';
|
|
9
9
|
import ContentRender from './chat-content/content-render/content-render.vue';
|
|
10
10
|
import ChatInput from './chat-input/chat-input.vue';
|
|
11
|
+
import { ModelSelector } from './chat-input/model-selector';
|
|
11
12
|
export * from './chat-content';
|
|
13
|
+
export type { IModelCapability, IModelOption, IModelProperty, ModelCapabilityTheme } from './chat-input/model-selector';
|
|
12
14
|
import MessageContainer from './chat-message/message-container/message-container.vue';
|
|
13
15
|
import MessageRender from './chat-message/message-render/message-render.vue';
|
|
14
16
|
import ExecutionSummary from './execution-summary/execution-summary.vue';
|
|
@@ -23,4 +25,4 @@ import SelectionFooter from './selection-footer/selection-footer.vue';
|
|
|
23
25
|
import ToolCallRender from './tool-call/toolcall-render/toolcall-render.vue';
|
|
24
26
|
export * from './chat-message/interrupt-message';
|
|
25
27
|
export * from './markdown-token';
|
|
26
|
-
export { AiImage, AiLoading, AiSelection, ChatContainer, ChatInput, commonErrorContent, ContentRender, ExecutionSummary, HighlightKeyword, ImagePreview, ImagePreviewGroup, MessageContainer, MessageLoading, MessageRender, MessageTools, MessageUserFeedback, ScrollBtn, SelectionFooter, ShortcutBtn, ShortcutBtns, ShortcutRender, ToolCallRender, };
|
|
28
|
+
export { AiImage, AiLoading, AiSelection, ChatContainer, ChatInput, commonErrorContent, ContentRender, ExecutionSummary, HighlightKeyword, ImagePreview, ImagePreviewGroup, MessageContainer, MessageLoading, MessageRender, MessageTools, MessageUserFeedback, ModelSelector, ScrollBtn, SelectionFooter, ShortcutBtn, ShortcutBtns, ShortcutRender, ToolCallRender, };
|
package/dist/icons/input.d.ts
CHANGED
|
@@ -10,3 +10,10 @@ export declare const DeleteCircleIcon: import("vue").VNode<import("vue").Rendere
|
|
|
10
10
|
export declare const FileUploadIcon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
}>;
|
|
13
|
+
/**
|
|
14
|
+
* 搜索(放大镜)图标 —— 用于模型选择下拉的搜索框
|
|
15
|
+
* 来源 Figma node I547:8700;329417:19319 search,已归一到 viewBox 0 0 1024 1024(通用放大镜,待设计复核)
|
|
16
|
+
*/
|
|
17
|
+
export declare const SearchIcon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}>;
|