@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
|
@@ -301,6 +301,51 @@ AI 回复状态为 `error` 时,消息以错误样式展示:
|
|
|
301
301
|
|
|
302
302
|
连续多轮问答,组件按角色自动分组,每个 AI 组独立显示工具栏:
|
|
303
303
|
|
|
304
|
+
## 自定义消息工具栏
|
|
305
|
+
|
|
306
|
+
`messageTools`(左侧)与 `updateTools`(右侧反馈区)用于在**内置工具的基础上做增量定制**,无需重写整份列表。二者分别与内置 `CONST_MESSAGE_TOOLS`、`CONST_UPDATE_TOOLS` 按 `id` 合并,规则如下:
|
|
307
|
+
|
|
308
|
+
- **覆盖**:`id` 命中内置项时,做字段级浅合并(仅覆盖传入的字段,其余保留),不新增条目
|
|
309
|
+
- **追加**:`id` 为内置列表中不存在的新值时,追加到该组末尾(如自定义「保存」「收藏」按钮)
|
|
310
|
+
- **隐藏**:传入 `{ id: 'xxx', hidden: true }` 可移除对应内置项(如隐藏「分享」)
|
|
311
|
+
- **自定义图标**:通过 `icon`(组件/VNode)为自定义按钮提供图标,优先级高于内置 `ToolIconsMap`
|
|
312
|
+
- 不传 `messageTools` / `updateTools` 时,各自使用内置默认列表
|
|
313
|
+
|
|
314
|
+
```vue
|
|
315
|
+
<template>
|
|
316
|
+
<MessageContainer
|
|
317
|
+
:messages="messages"
|
|
318
|
+
:message-groups="messageGroups"
|
|
319
|
+
message-status="complete"
|
|
320
|
+
:message-tools="customMessageTools"
|
|
321
|
+
:update-tools="customUpdateTools"
|
|
322
|
+
:on-agent-action="handleAgentAction"
|
|
323
|
+
@stop-streaming="handleStopStreaming"
|
|
324
|
+
/>
|
|
325
|
+
</template>
|
|
326
|
+
|
|
327
|
+
<script setup lang="ts">
|
|
328
|
+
import { MessageContainer, DownloadIcon, type IToolBtn, type Message } from '@blueking/chat-x';
|
|
329
|
+
|
|
330
|
+
const customMessageTools: IToolBtn[] = [
|
|
331
|
+
{ id: 'save', name: '保存', description: '保存该回答', icon: DownloadIcon }, // 追加新按钮
|
|
332
|
+
{ id: 'copy', description: '复制全文' }, // 覆盖内置 copy 的 description
|
|
333
|
+
{ id: 'share', hidden: true }, // 隐藏内置「分享」
|
|
334
|
+
];
|
|
335
|
+
const customUpdateTools: IToolBtn[] = [
|
|
336
|
+
{ id: 'collect', name: '收藏', description: '收藏到我的空间', icon: DownloadIcon },
|
|
337
|
+
];
|
|
338
|
+
|
|
339
|
+
const handleAgentAction = async (tool: IToolBtn, messages: Message[]) => {
|
|
340
|
+
if (tool.id === 'save') {
|
|
341
|
+
// 处理保存
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
</script>
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
> **合并优先级**:`RenderMode.Test` 下仍会额外过滤掉「分享」按钮(即便合并后存在);即测试模式对 `share` 的过滤在自定义合并之后生效。
|
|
348
|
+
|
|
304
349
|
## 工具栏状态控制
|
|
305
350
|
|
|
306
351
|
通过 `messageToolsStatus` 控制消息工具栏的显示状态。常见用法:流式输出期间禁用工具栏:
|
|
@@ -501,6 +546,8 @@ AI 回复状态为 `error` 时,消息以错误样式展示:
|
|
|
501
546
|
| messages | `Message[]` | — | **必填**,消息列表 |
|
|
502
547
|
| messageGroups | `MessageGroup[]` | — | 预计算的消息分组;传入时跳过内部分组逻辑,由 `ChatContainer` 通过 `useMessageGroup` 提供 |
|
|
503
548
|
| messageStatus | `MessageStatus` | — | 当前整体消息状态,控制底部「停止生成」按钮显示;`ChatContainer` 会结合末尾 Loading 占位推导 `fetching` 等再传入 |
|
|
549
|
+
| messageTools | `IToolBtn[]` | — | AI 消息左侧工具(复制/引用等)的自定义配置;按 `id` 与内置 `CONST_MESSAGE_TOOLS` 合并(覆盖同 id、追加新 id、`hidden` 过滤),详见「自定义消息工具栏」 |
|
|
550
|
+
| updateTools | `IToolBtn[]` | — | AI 消息右侧反馈工具(点赞/踩/删除等)的自定义配置;按 `id` 与内置 `CONST_UPDATE_TOOLS` 合并,规则同上 |
|
|
504
551
|
| messageToolsStatus | `MessageToolsStatus` | — | 工具栏状态,透传给 `MessageTools` 和 `MessageRender` |
|
|
505
552
|
| messageToolsTippyOptions | `AITippyProps` | — | 透传给 `MessageTools` 和 `MessageRender`(进而透传给 `UserMessage` 的工具栏)的 Tippy 配置,用于自定义 tooltip 挂载点、位置等(如 `appendTo`、`placement`、`zIndex`) |
|
|
506
553
|
| enableSelection | `boolean` | `false` | 是否启用多选模式 |
|
|
@@ -361,11 +361,15 @@ const CONST_UPDATE_TOOLS = [
|
|
|
361
361
|
|
|
362
362
|
```typescript
|
|
363
363
|
import { MessageToolsStatus, type IToolBtn } from '@blueking/chat-x';
|
|
364
|
+
import type { Component, VNode } from 'vue';
|
|
364
365
|
|
|
365
366
|
interface IToolBtn {
|
|
366
|
-
id?:
|
|
367
|
+
id?: (string & {}) | ToolIcons; // 工具唯一标识;命中 ToolIconsMap 显示内置图标,否则显示 name 文本;支持业务自定义字符串
|
|
367
368
|
name?: string; // 工具名称,无对应图标时显示;也用作 tooltip fallback
|
|
368
369
|
description?: string; // tooltip 文本
|
|
370
|
+
icon?: Component | VNode; // 自定义图标(组件/VNode),优先级高于内置 ToolIconsMap[id]
|
|
371
|
+
hidden?: boolean; // 按 id 合并时隐藏该按钮(仅在 MessageContainer/ChatContainer 合并语义下生效)
|
|
372
|
+
triggerSelection?: boolean; // 标记点击后进入多选态(复用 share 选择流程),确认走 confirmShare
|
|
369
373
|
}
|
|
370
374
|
|
|
371
375
|
enum MessageToolsStatus {
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<!-- AI SUMMARY -->
|
|
2
|
+
## 快速了解
|
|
3
|
+
|
|
4
|
+
聊天输入区的模型下拉选择器,支持搜索过滤、能力标签与键盘导航。 源码位置:src/components/chat-input/model-selector/model-selector.vue。
|
|
5
|
+
|
|
6
|
+
### 关联组件
|
|
7
|
+
- **chat-input** — 传入 models 后在发送按钮左侧默认渲染
|
|
8
|
+
- **input-attachment** — 通过 before-send 插槽与发送按钮成组布局
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
<!-- FULL DOC -->
|
|
12
|
+
|
|
13
|
+
# ModelSelector 模型选择器
|
|
14
|
+
|
|
15
|
+
## 源码事实
|
|
16
|
+
|
|
17
|
+
- **源码位置**:`src/components/chat-input/model-selector/model-selector.vue`
|
|
18
|
+
- **能力域**:输入交互
|
|
19
|
+
- **能力说明**:基于 Tippy 下拉的模型选择器,包含触发器、搜索面板与能力标签展示;数据过滤逻辑由 `useModelSelector` composable 承担。
|
|
20
|
+
|
|
21
|
+
> **能力域**:输入交互
|
|
22
|
+
|
|
23
|
+
可在 [ChatInput](/components/input/chat-input) 传入 `models` 后自动出现在发送按钮左侧,也可单独使用。
|
|
24
|
+
|
|
25
|
+
## 组件结构
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
ModelSelector(Tippy 容器,theme: ai-model-selector)
|
|
29
|
+
├── ModelSelectorTrigger(触发器:图标 + 名称 + 箭头)
|
|
30
|
+
└── ModelSelectorPanel(下拉面板)
|
|
31
|
+
├── 搜索框(展开后自动聚焦)
|
|
32
|
+
└── 模型列表(支持键盘导航、选中态、禁用态、能力标签)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 基础用法
|
|
36
|
+
|
|
37
|
+
选中值为模型的 `llm_name`;能力标签由组件依据 `property`(`support_thinking` / `support_thinking_quick` / `support_vision`)自动派生,无需调用方传入。
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<template>
|
|
41
|
+
<ModelSelector
|
|
42
|
+
v-model="selectedModel"
|
|
43
|
+
:models="models"
|
|
44
|
+
@change="handleModelChange"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup lang="ts">
|
|
49
|
+
import { ref } from 'vue';
|
|
50
|
+
import { ModelSelector, type IModelOption } from '@blueking/chat-x';
|
|
51
|
+
|
|
52
|
+
// 选中值为 llm_name
|
|
53
|
+
const selectedModel = ref('DeepSeek-V4-Pro-Online-32k');
|
|
54
|
+
const models: IModelOption[] = [
|
|
55
|
+
{
|
|
56
|
+
id: 119,
|
|
57
|
+
llm_code: 'DeepSeek-V4-Pro-Online-32k',
|
|
58
|
+
llm_name: 'DeepSeek-V4-Pro-Online-32k',
|
|
59
|
+
llm_type: 'chat.completion',
|
|
60
|
+
space_auth_mode: 'APPLY',
|
|
61
|
+
user_auth_mode: 'PUBLIC',
|
|
62
|
+
max_token_size: 4096,
|
|
63
|
+
icon: 'https://example.com/deepseek.png',
|
|
64
|
+
description: 'DeepSeek-V4-Pro 旗舰版本,支持超长上下文与复杂任务处理',
|
|
65
|
+
base_model: 'deepseek',
|
|
66
|
+
tag_names: [],
|
|
67
|
+
// support_thinking → 深度思考、support_vision → 图生文
|
|
68
|
+
property: { support_thinking: true, support_vision: true, max_model_len: 32000 },
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
const handleModelChange = (model: IModelOption) => {
|
|
73
|
+
console.log('选中模型:', model);
|
|
74
|
+
};
|
|
75
|
+
</script>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## API
|
|
79
|
+
|
|
80
|
+
### Props
|
|
81
|
+
|
|
82
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
83
|
+
| ----------------- | -------------------------------------------------------------------------- | ---------------- | -------------------------------------- |
|
|
84
|
+
| disabled | `boolean` | `false` | 是否禁用整个选择器 |
|
|
85
|
+
| models | `IModelOption[]` | `[]` | 可选模型列表 |
|
|
86
|
+
| placeholder | `string` | `选择模型` | trigger 无选中时的占位文案 |
|
|
87
|
+
| searchPlaceholder | `string` | `搜索模型关键字` | 搜索框占位文案 |
|
|
88
|
+
| tippyOptions | `Partial<Omit<TippyOptions, 'getReferenceClientRect' \| 'triggerTarget'>>` | — | 透传给 Tippy 的额外配置 |
|
|
89
|
+
|
|
90
|
+
### v-model
|
|
91
|
+
|
|
92
|
+
| 属性名 | 类型 | 说明 |
|
|
93
|
+
| ------ | -------- | ----------------------------- |
|
|
94
|
+
| — | `string` | 当前选中模型的 `llm_name` 值 |
|
|
95
|
+
|
|
96
|
+
### Events
|
|
97
|
+
|
|
98
|
+
| 事件名 | 参数 | 说明 |
|
|
99
|
+
| ------ | ----------------------- | -------------------- |
|
|
100
|
+
| change | `(model: IModelOption)` | 用户选中模型时触发 |
|
|
101
|
+
|
|
102
|
+
## 类型定义
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import type { IModelCapability, IModelOption, IModelProperty, ModelCapabilityTheme } from '@blueking/chat-x';
|
|
106
|
+
|
|
107
|
+
type ModelCapabilityTheme = 'default' | 'primary' | 'success' | 'warning';
|
|
108
|
+
|
|
109
|
+
// 能力标签由组件依据 property 派生(文案走内置 i18n)
|
|
110
|
+
interface IModelCapability {
|
|
111
|
+
theme?: ModelCapabilityTheme;
|
|
112
|
+
text: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 模型能力属性,决定派生出的能力标签
|
|
116
|
+
interface IModelProperty {
|
|
117
|
+
agent_type?: string;
|
|
118
|
+
default?: boolean;
|
|
119
|
+
is_self_host?: boolean;
|
|
120
|
+
max_model_len?: number;
|
|
121
|
+
support_summary?: boolean;
|
|
122
|
+
support_thinking?: boolean; // → 深度思考
|
|
123
|
+
support_thinking_quick?: boolean; // → 快速思考
|
|
124
|
+
support_tools?: boolean;
|
|
125
|
+
support_vision?: boolean; // → 图生文
|
|
126
|
+
support_window?: boolean;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// 模型选项,贴合后端模型接口结构
|
|
130
|
+
interface IModelOption {
|
|
131
|
+
base_model?: string;
|
|
132
|
+
description?: string; // 选项 hover 的 title 提示
|
|
133
|
+
disabled?: boolean; // 前端扩展字段,禁用项不可选中
|
|
134
|
+
icon?: string;
|
|
135
|
+
id: number;
|
|
136
|
+
llm_code: string;
|
|
137
|
+
llm_name: string; // 展示名,同时作为选中值
|
|
138
|
+
llm_type: string;
|
|
139
|
+
max_token_size: number;
|
|
140
|
+
property: IModelProperty;
|
|
141
|
+
space_auth_mode: string;
|
|
142
|
+
tag_names?: string[];
|
|
143
|
+
user_auth_mode: string;
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 注意事项
|
|
148
|
+
|
|
149
|
+
1. `models` 为空或 `disabled` 为 `true` 时,下拉不会展开。
|
|
150
|
+
2. 选中值为模型的 `llm_name`;能力标签由组件依据 `property` 的 `support_thinking` / `support_thinking_quick` / `support_vision` 派生,文案走内置 i18n。
|
|
151
|
+
3. `description` 会作为选项 hover 的 `title` 提示展示。
|
|
152
|
+
4. 展开面板后会自动聚焦搜索框;列表支持键盘上下选择与 Enter 确认(复用 `useMenuKeydown`)。
|
|
153
|
+
|
|
154
|
+
## 关联组件
|
|
155
|
+
|
|
156
|
+
- [ChatInput](/components/input/chat-input):传入 `models` 后默认在发送按钮左侧渲染本组件,也可通过 `#model-selector` 插槽完全自定义。
|
|
157
|
+
- [ChatContainer](/components/setup/chat-container):透传 `models` 与 `v-model:selected-model`,并向上 emit `modelChange`。
|
|
@@ -30,8 +30,9 @@ div.ai-tool-btn(v-tippy,flex,min-width: 20px,height: 20px,border-radiu
|
|
|
30
30
|
disabled=true → .is-disabled(color: #979ba5; cursor: not-allowed)
|
|
31
31
|
:not(.is-disabled):hover → color: #4d4f56; background: #eaebf0
|
|
32
32
|
│
|
|
33
|
-
└── <slot
|
|
34
|
-
├── [
|
|
33
|
+
└── <slot>(默认内容,可完全自定义;优先级最高)
|
|
34
|
+
├── [icon] → <component :is="icon" />(自定义图标组件/VNode,优先级高于内置图标)
|
|
35
|
+
├── [id && id in ToolIconsMap] → <component :is="ToolIconsMap[id]" />(内置 SVG 图标)
|
|
35
36
|
└── [其他] → <div>{{ name }}</div>(文本回退,XSS 安全)
|
|
36
37
|
|
|
37
38
|
Tippy:content=description, theme='ai-chat-box', disabled=true 时 onShow 返回 false 不显示
|
|
@@ -195,6 +196,28 @@ click 事件:disabled=true 时被 JS 拦截,不触发 emit
|
|
|
195
196
|
|
|
196
197
|
`id` 不在 `ToolIconsMap` 时渲染 `name` 文本,适用于自定义扩展场景:
|
|
197
198
|
|
|
199
|
+
## 自定义图标(icon 属性)
|
|
200
|
+
|
|
201
|
+
当内置 `ToolIconsMap` 未覆盖所需图标时,可通过 `icon` 传入自定义图标组件或 VNode(如业务新增的「保存」按钮)。`icon` 的渲染优先级高于内置图标,因此即便 `id` 命中内置图标,也会以 `icon` 为准。
|
|
202
|
+
|
|
203
|
+
```vue
|
|
204
|
+
<template>
|
|
205
|
+
<ToolBtn
|
|
206
|
+
id="save"
|
|
207
|
+
name="保存"
|
|
208
|
+
description="保存该回答"
|
|
209
|
+
:icon="DownloadIcon"
|
|
210
|
+
@click="handleClick"
|
|
211
|
+
/>
|
|
212
|
+
</template>
|
|
213
|
+
|
|
214
|
+
<script setup lang="ts">
|
|
215
|
+
import { ToolBtn, DownloadIcon } from '@blueking/chat-x';
|
|
216
|
+
</script>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
> 优先级从高到低:默认插槽 `>` `icon` 属性 `>` 内置 `ToolIconsMap[id]` `>` `name` 文本回退。
|
|
220
|
+
|
|
198
221
|
## 自定义插槽内容
|
|
199
222
|
|
|
200
223
|
通过默认插槽可完全替换内置图标/文本,适用于预置 `ToolIconsMap` 未覆盖的图标场景(如侧栏全屏按钮):
|
|
@@ -225,9 +248,10 @@ click 事件:disabled=true 时被 JS 拦截,不触发 emit
|
|
|
225
248
|
|
|
226
249
|
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
227
250
|
| ------------ | -------------------------------------------------------------------------- | ---- | ------ | ------------------------------------------------------------------------------------------------------------------ |
|
|
228
|
-
| id | `
|
|
251
|
+
| id | `(string & {}) \| ToolIcons` | 否 | — | 按钮标识;命中 `ToolIconsMap` 时渲染对应 SVG 图标,否则渲染 `name` 文本;支持业务自定义任意字符串(如 `save`) |
|
|
229
252
|
| name | `string` | 否 | — | 按钮名称;`id` 无对应图标时作为文本内容渲染 |
|
|
230
253
|
| description | `string` | 否 | — | Tippy tooltip 内容;`disabled=true` 时不显示 tooltip |
|
|
254
|
+
| icon | `Component \| VNode` | 否 | — | 自定义图标组件或 VNode;优先级高于内置 `ToolIconsMap[id]`,低于默认插槽 |
|
|
231
255
|
| active | `boolean` | 否 | — | 激活态;`true` 时追加 `.is-active`(字色由 `id` 决定:`like`/`activeLike` 为蓝色 `#3a84ff`,其他为红色 `#E71818`) |
|
|
232
256
|
| disabled | `boolean` | 否 | — | 禁用态;`true` 时追加 `.is-disabled`,阻止 click 事件,隐藏 tooltip |
|
|
233
257
|
| tippyOptions | `Partial<Omit<TippyOptions, 'getReferenceClientRect' \| 'triggerTarget'>>` | 否 | — | 自定义 Tippy 配置,与内部默认配置合并;可用于控制 `content`、`appendTo`、`placement` 等 |
|
|
@@ -247,11 +271,16 @@ click 事件:disabled=true 时被 JS 拦截,不触发 emit
|
|
|
247
271
|
## 类型定义
|
|
248
272
|
|
|
249
273
|
```typescript
|
|
274
|
+
import type { Component, VNode } from 'vue';
|
|
275
|
+
|
|
250
276
|
// 来自 @blueking/chat-x 导出
|
|
251
277
|
interface IToolBtn {
|
|
252
|
-
id?:
|
|
278
|
+
id?: (string & {}) | ToolIcons; // 内置 ID 保留自动补全,同时允许业务自定义任意字符串(如 'save')
|
|
253
279
|
name?: string;
|
|
254
280
|
description?: string;
|
|
281
|
+
icon?: Component | VNode; // 自定义图标,优先级高于内置 ToolIconsMap
|
|
282
|
+
hidden?: boolean; // 按 id 合并时隐藏该按钮(如 { id: 'share', hidden: true } 移除内置项)
|
|
283
|
+
triggerSelection?: boolean; // 标记点击后进入多选态(复用 share 选择流程),确认走 confirmShare
|
|
255
284
|
}
|
|
256
285
|
|
|
257
286
|
// ToolBtn 完整 Props
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "2.0.0",
|
|
3
|
-
"generatedAt": "2026-07-
|
|
3
|
+
"generatedAt": "2026-07-27T02:31:49.169Z",
|
|
4
4
|
"domains": {
|
|
5
5
|
"setup": {
|
|
6
6
|
"label": "对话搭建",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"file-upload-btn",
|
|
53
53
|
"input-attachment",
|
|
54
54
|
"input-info-alert",
|
|
55
|
+
"model-selector",
|
|
55
56
|
"selection-footer",
|
|
56
57
|
"shortcut-btn",
|
|
57
58
|
"shortcut-btns",
|
|
@@ -787,6 +788,10 @@
|
|
|
787
788
|
"slug": "chat-container",
|
|
788
789
|
"relation": "顶层聊天布局中作为输入区子组件"
|
|
789
790
|
},
|
|
791
|
+
{
|
|
792
|
+
"slug": "model-selector",
|
|
793
|
+
"relation": "传入 models 后在发送按钮左侧默认展示模型选择器"
|
|
794
|
+
},
|
|
790
795
|
{
|
|
791
796
|
"slug": "cite-content",
|
|
792
797
|
"relation": "消息引用区展示选中的上下文片段"
|
|
@@ -834,6 +839,25 @@
|
|
|
834
839
|
"docFile": "docs/input-info-alert.md",
|
|
835
840
|
"domain": "input"
|
|
836
841
|
},
|
|
842
|
+
{
|
|
843
|
+
"name": "ModelSelector 模型选择器",
|
|
844
|
+
"slug": "model-selector",
|
|
845
|
+
"kind": "component",
|
|
846
|
+
"description": "聊天输入区的模型下拉选择器,支持搜索过滤、能力标签与键盘导航。",
|
|
847
|
+
"aiSummary": "聊天输入区的模型下拉选择器,支持搜索过滤、能力标签与键盘导航。 源码位置:src/components/chat-input/model-selector/model-selector.vue。",
|
|
848
|
+
"relatedComponents": [
|
|
849
|
+
{
|
|
850
|
+
"slug": "chat-input",
|
|
851
|
+
"relation": "传入 models 后在发送按钮左侧默认渲染"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
"slug": "input-attachment",
|
|
855
|
+
"relation": "通过 before-send 插槽与发送按钮成组布局"
|
|
856
|
+
}
|
|
857
|
+
],
|
|
858
|
+
"docFile": "docs/model-selector.md",
|
|
859
|
+
"domain": "input"
|
|
860
|
+
},
|
|
837
861
|
{
|
|
838
862
|
"name": "SelectionFooter 多选操作栏",
|
|
839
863
|
"slug": "selection-footer",
|
|
@@ -1431,8 +1455,8 @@
|
|
|
1431
1455
|
"name": "ChatContainer 聊天容器",
|
|
1432
1456
|
"slug": "chat-container",
|
|
1433
1457
|
"kind": "component",
|
|
1434
|
-
"description": "
|
|
1435
|
-
"aiSummary": "
|
|
1458
|
+
"description": "完整对话容器,组合消息列表、输入区、模型选择、快捷指令、执行摘要、分享选择和自定义 Tab。",
|
|
1459
|
+
"aiSummary": "完整对话容器,组合消息列表、输入区、模型选择、快捷指令、执行摘要、分享选择和自定义 Tab。 透传 models / selectedModel;支持 welcomeTitle 与 #welcome。 源码位置:src/components/chat-container/chat-container.vue。",
|
|
1436
1460
|
"relatedComponents": [
|
|
1437
1461
|
{
|
|
1438
1462
|
"slug": "message-container",
|
|
@@ -1442,6 +1466,10 @@
|
|
|
1442
1466
|
"slug": "chat-input",
|
|
1443
1467
|
"relation": "对话输入与快捷指令入口"
|
|
1444
1468
|
},
|
|
1469
|
+
{
|
|
1470
|
+
"slug": "model-selector",
|
|
1471
|
+
"relation": "透传 models / selectedModel,在输入区展示模型选择器"
|
|
1472
|
+
},
|
|
1445
1473
|
{
|
|
1446
1474
|
"slug": "shortcut-render",
|
|
1447
1475
|
"relation": "快捷指令表单浮层"
|
package/dist/mcp/index.js
CHANGED
|
File without changes
|
package/dist/types/tool.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Component, VNode } from 'vue';
|
|
2
|
+
import type { ToolIcons } from '../icons/tools';
|
|
2
3
|
import type { TippyOptions } from 'vue-tippy';
|
|
3
4
|
export declare enum MessageToolsStatus {
|
|
4
5
|
Disabled = "disabled",// 禁用
|
|
@@ -7,6 +8,9 @@ export declare enum MessageToolsStatus {
|
|
|
7
8
|
export type AITippyProps = Partial<Pick<TippyOptions, 'appendTo' | 'placement' | 'zIndex'>>;
|
|
8
9
|
export interface IToolBtn {
|
|
9
10
|
description?: string;
|
|
10
|
-
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
icon?: Component | VNode;
|
|
13
|
+
id?: (string & {}) | ToolIcons;
|
|
11
14
|
name?: string;
|
|
15
|
+
triggerSelection?: boolean;
|
|
12
16
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueking/chat-x",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48-beta.1",
|
|
4
4
|
"description": "蓝鲸智云 AI Chat 组件库 —— 遵循 AG-UI,为 AI Agent 和人类开发者共同设计的对话 UI 组件库。",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"prepublishOnly": "vite --config vite.config.ts build && pnpm dts && pnpm mcp:build",
|
|
8
|
+
"dev": "vite --config vite.config.ts",
|
|
9
|
+
"dts": "vue-tsc --project tsconfig.dts.json",
|
|
10
|
+
"build": "vitest && vite --config vite.config.ts build && pnpm dts",
|
|
11
|
+
"preview": "vite --config vite.config.ts build --mode preview && pnpm dts",
|
|
12
|
+
"lint:script": "eslint . --ext .vue,.ts --fix",
|
|
13
|
+
"lint:style": "stylelint \"**/*.{scss,css,vue}\" --fix",
|
|
14
|
+
"lint:all": "pnpm lint:script && pnpm lint:style",
|
|
15
|
+
"test": "vitest",
|
|
16
|
+
"test:coverage": "vitest run --coverage",
|
|
17
|
+
"wiki:dev": "vitepress dev wikis",
|
|
18
|
+
"wiki:build": "vitepress build wikis",
|
|
19
|
+
"mcp:build:index": "tsx mcp/scripts/build-index.ts",
|
|
20
|
+
"mcp:build": "tsc -p mcp/tsconfig.json && pnpm mcp:build:index",
|
|
21
|
+
"mcp:start": "node dist/mcp/index.js",
|
|
22
|
+
"mcp:dev": "tsx mcp/src/index.ts"
|
|
23
|
+
},
|
|
6
24
|
"bin": {
|
|
7
25
|
"chat-x-mcp": "dist/mcp/index.js"
|
|
8
26
|
},
|
|
@@ -50,6 +68,7 @@
|
|
|
50
68
|
"zod": "^4.3.6"
|
|
51
69
|
},
|
|
52
70
|
"devDependencies": {
|
|
71
|
+
"@blueking/chat-helper": "workspace:*",
|
|
53
72
|
"@types/katex": "^0.16.7",
|
|
54
73
|
"@types/lodash": "^4.17.23",
|
|
55
74
|
"@types/markdown-it": "^14.1.2",
|
|
@@ -78,24 +97,6 @@
|
|
|
78
97
|
"vite-bundle-analyzer": "^1.3.2",
|
|
79
98
|
"vitepress": "2.0.0-alpha.16",
|
|
80
99
|
"vitest": "^4.0.18",
|
|
81
|
-
"vue-tsc": "^3.1.4"
|
|
82
|
-
"@blueking/chat-helper": "0.0.12-beta.10"
|
|
83
|
-
},
|
|
84
|
-
"scripts": {
|
|
85
|
-
"dev": "vite --config vite.config.ts",
|
|
86
|
-
"dts": "vue-tsc --project tsconfig.dts.json",
|
|
87
|
-
"build": "vitest && vite --config vite.config.ts build && pnpm dts",
|
|
88
|
-
"preview": "vite --config vite.config.ts build --mode preview && pnpm dts",
|
|
89
|
-
"lint:script": "eslint . --ext .vue,.ts --fix",
|
|
90
|
-
"lint:style": "stylelint \"**/*.{scss,css,vue}\" --fix",
|
|
91
|
-
"lint:all": "pnpm lint:script && pnpm lint:style",
|
|
92
|
-
"test": "vitest",
|
|
93
|
-
"test:coverage": "vitest run --coverage",
|
|
94
|
-
"wiki:dev": "vitepress dev wikis",
|
|
95
|
-
"wiki:build": "vitepress build wikis",
|
|
96
|
-
"mcp:build:index": "tsx mcp/scripts/build-index.ts",
|
|
97
|
-
"mcp:build": "tsc -p mcp/tsconfig.json && pnpm mcp:build:index",
|
|
98
|
-
"mcp:start": "node dist/mcp/index.js",
|
|
99
|
-
"mcp:dev": "tsx mcp/src/index.ts"
|
|
100
|
+
"vue-tsc": "^3.1.4"
|
|
100
101
|
}
|
|
101
102
|
}
|