@blueking/chat-x 0.0.47-beta.2 → 0.0.47-beta.4
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.css +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/mcp/generated/docs/ai-prompt-list.md +6 -3
- package/dist/mcp/generated/docs/ai-skill-list.md +75 -0
- package/dist/mcp/generated/docs/ai-slash-input.md +17 -3
- package/dist/mcp/generated/docs/chat-input.md +22 -5
- package/dist/mcp/generated/docs/input-attachment.md +6 -1
- package/dist/mcp/generated/index.json +45 -7
- package/package.json +2 -2
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<!-- AI SUMMARY -->
|
|
2
2
|
## 快速了解
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
\ Prompt 选择列表,供 AiSlashInput 插入模板文本。 源码位置:src/components/chat-input/ai-slash-input/ai-prompt-list/ai-prompt-list.vue。
|
|
5
|
+
|
|
6
|
+
### 关联组件
|
|
7
|
+
- **ai-slash-input** — 输入 \ 时由 AiSlashInput tippy 菜单渲染
|
|
5
8
|
|
|
6
9
|
---
|
|
7
10
|
<!-- FULL DOC -->
|
|
@@ -13,13 +16,13 @@
|
|
|
13
16
|
## 源码事实
|
|
14
17
|
|
|
15
18
|
- **源码位置**:`src/components/chat-input/ai-slash-input/ai-prompt-list/ai-prompt-list.vue`
|
|
16
|
-
-
|
|
19
|
+
- **能力说明**:`\` Prompt 选择列表,供 AiSlashInput 插入模板文本。
|
|
17
20
|
|
|
18
21
|
## API 摘要
|
|
19
22
|
|
|
20
23
|
### Props
|
|
21
24
|
|
|
22
|
-
- `{ onSelect: (prompt: string)
|
|
25
|
+
- `{ onSelect: (prompt: string) => void; prompts: string[]; }`
|
|
23
26
|
|
|
24
27
|
### Emits
|
|
25
28
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<!-- AI SUMMARY -->
|
|
2
|
+
## 快速了解
|
|
3
|
+
|
|
4
|
+
/ Skill 选择列表,供 AiSlashInput 插入 Skill 标签。 无 icon 或 icon 加载失败时展示 skill_name 首字母 fallback。 源码位置:src/components/chat-input/ai-slash-input/ai-skill-list/ai-skill-list.vue。
|
|
5
|
+
|
|
6
|
+
### 关联组件
|
|
7
|
+
- **ai-slash-input** — 输入 / 时由 AiSlashInput tippy 菜单渲染
|
|
8
|
+
- **chat-input** — 经 ChatInput.skills 透传数据源
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
<!-- FULL DOC -->
|
|
12
|
+
|
|
13
|
+
# AiSkillList Skill 列表
|
|
14
|
+
|
|
15
|
+
> **能力域**:输入交互
|
|
16
|
+
|
|
17
|
+
## 源码事实
|
|
18
|
+
|
|
19
|
+
- **源码位置**:`src/components/chat-input/ai-slash-input/ai-skill-list/ai-skill-list.vue`
|
|
20
|
+
- **能力说明**:`/` Skill 选择列表,供 `AiSlashInput` 插入 Skill 标签;列表项固定高度且 `flex-shrink: 0`,避免滚动容器内被压缩。
|
|
21
|
+
|
|
22
|
+
## 行为说明
|
|
23
|
+
|
|
24
|
+
- 仅展示 `skill_name`,不展示 `description`
|
|
25
|
+
- 支持键盘上下选择与 Enter 确认(`useMenuKeydown`);`skills` 变化时高亮重置到首项
|
|
26
|
+
- 点击列表项调用 `onSelect(skill)`
|
|
27
|
+
- 图标规则:
|
|
28
|
+
- 有 `icon` 且未加载失败:渲染 `<img>`
|
|
29
|
+
- 无 `icon`,或 `<img>` 触发 `@error`:渲染首字母 fallback(`skill_name[0]` 大写,蓝底白字)
|
|
30
|
+
|
|
31
|
+
## API 摘要
|
|
32
|
+
|
|
33
|
+
### Props
|
|
34
|
+
|
|
35
|
+
| 属性名 | 类型 | 必填 | 说明 |
|
|
36
|
+
| -------- | ---------------------------------- | ---- | ---------------------------- |
|
|
37
|
+
| skills | `ISkillListItem[]` | ✅ | Skill 列表数据 |
|
|
38
|
+
| onSelect | `(skill: ISkillListItem) => void` | ✅ | 选中 Skill 时的回调 |
|
|
39
|
+
|
|
40
|
+
### Emits
|
|
41
|
+
|
|
42
|
+
- 无(选择通过 `onSelect` prop 回调)。
|
|
43
|
+
|
|
44
|
+
### Slots
|
|
45
|
+
|
|
46
|
+
- 无。
|
|
47
|
+
|
|
48
|
+
### Expose
|
|
49
|
+
|
|
50
|
+
- 无。
|
|
51
|
+
|
|
52
|
+
## 类型定义
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
interface ISkillListItem {
|
|
56
|
+
description: string;
|
|
57
|
+
icon: string;
|
|
58
|
+
skill_code: string;
|
|
59
|
+
skill_name: string;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 组件依赖
|
|
64
|
+
|
|
65
|
+
- `useMenuKeydown`(键盘导航)
|
|
66
|
+
|
|
67
|
+
## 关联组件
|
|
68
|
+
|
|
69
|
+
- [AiSlashInput](/components/input/ai-slash-input) — 输入 `/` 时渲染本列表
|
|
70
|
+
- [ChatInput](/components/input/chat-input) — 通过 `skills` prop 透传数据
|
|
71
|
+
|
|
72
|
+
## 使用建议
|
|
73
|
+
|
|
74
|
+
- 优先通过 `ChatInput` / `AiSlashInput` 使用;直接使用前确认 `skills` 结构符合 `ISkillListItem`。
|
|
75
|
+
- 上层应对已插入的 Skill 做去重过滤(`AiSlashInput` 已实现)。
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<!-- AI SUMMARY -->
|
|
2
2
|
## 快速了解
|
|
3
3
|
|
|
4
|
-
ChatInput 内部富文本输入,支持 / Prompt 与 @ 资源标签。 源码位置:src/components/chat-input/ai-slash-input/ai-slash-input.vue。
|
|
4
|
+
ChatInput 内部富文本输入,支持 / Skill、\ Prompt 与 @ 资源标签。 源码位置:src/components/chat-input/ai-slash-input/ai-slash-input.vue。
|
|
5
|
+
|
|
6
|
+
### 关联组件
|
|
7
|
+
- **ai-skill-list** — 输入 / 时渲染 Skill 选择列表
|
|
8
|
+
- **ai-prompt-list** — 输入 \ 时渲染 Prompt 选择列表
|
|
9
|
+
- **ai-slash-menu** — 输入 @ 时渲染资源选择菜单
|
|
5
10
|
|
|
6
11
|
---
|
|
7
12
|
<!-- FULL DOC -->
|
|
@@ -13,13 +18,21 @@ ChatInput 内部富文本输入,支持 / Prompt 与 @ 资源标签。 源码
|
|
|
13
18
|
## 源码事实
|
|
14
19
|
|
|
15
20
|
- **源码位置**:`src/components/chat-input/ai-slash-input/ai-slash-input.vue`
|
|
16
|
-
- **能力说明**:ChatInput 内部富文本输入,支持
|
|
21
|
+
- **能力说明**:ChatInput 内部富文本输入,支持 `/` Skill、`\` Prompt 与 `@` 资源标签。
|
|
22
|
+
|
|
23
|
+
## 触发字符
|
|
24
|
+
|
|
25
|
+
| 字符 | 菜单类型 | 渲染组件 | 数据源 prop |
|
|
26
|
+
| ---- | -------- | -------- | ----------- |
|
|
27
|
+
| `/` | skill | `AiSkillList` | `skills` |
|
|
28
|
+
| `\` | prompt | `AiPromptList` | `prompts` |
|
|
29
|
+
| `@` | slash | `AiSlashMenu` | `resources` |
|
|
17
30
|
|
|
18
31
|
## API 摘要
|
|
19
32
|
|
|
20
33
|
### Props
|
|
21
34
|
|
|
22
|
-
- `{ modelValue: string | TagSchema; placeholder?: string; prompts?: string[]; resources?: IAiSlashMenuItem[]; }`
|
|
35
|
+
- `{ modelValue: string | TagSchema; placeholder?: string; prompts?: string[]; resources?: IAiSlashMenuItem[]; skills?: ISkillListItem[]; }`
|
|
23
36
|
|
|
24
37
|
### Emits
|
|
25
38
|
|
|
@@ -35,6 +48,7 @@ ChatInput 内部富文本输入,支持 / Prompt 与 @ 资源标签。 源码
|
|
|
35
48
|
|
|
36
49
|
## 组件依赖
|
|
37
50
|
|
|
51
|
+
- `AiSkillList`
|
|
38
52
|
- `AiPromptList`
|
|
39
53
|
- `AiSlashMenu`
|
|
40
54
|
|
|
@@ -183,9 +183,24 @@ const handleSendMessage = async (
|
|
|
183
183
|
|
|
184
184
|
**渲染效果**(顶部引用区,点击右侧 × 关闭引用)
|
|
185
185
|
|
|
186
|
-
##
|
|
186
|
+
## Skill 列表(`/` 触发)
|
|
187
187
|
|
|
188
|
-
通过 `
|
|
188
|
+
通过 `skills` 传入 Skill 列表,用户在编辑器中输入 `/` 唤出 [AiSkillList](/components/input/ai-skill-list) 菜单,支持按名称/编码模糊搜索,选择后以 Skill 标签嵌入编辑器。无 icon 或 icon 加载失败时展示首字母 fallback。已插入的 Skill 不会再出现在下拉菜单中(自动去重)。
|
|
189
|
+
|
|
190
|
+
```vue
|
|
191
|
+
<script setup lang="ts">
|
|
192
|
+
import type { ISkillListItem } from '@blueking/chat-x';
|
|
193
|
+
|
|
194
|
+
const skills: ISkillListItem[] = [
|
|
195
|
+
{ skill_code: 'translate', skill_name: '翻译', description: '翻译文本', icon: '' },
|
|
196
|
+
{ skill_code: 'summarize', skill_name: '总结', description: '总结内容', icon: 'https://example.com/icon.png' },
|
|
197
|
+
];
|
|
198
|
+
</script>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Prompt 模板(`\` 触发)
|
|
202
|
+
|
|
203
|
+
通过 `prompts` 传入字符串数组,用户在编辑器中输入 `\` 唤出 Prompt 菜单,支持模糊搜索,选择后自动填入编辑器:
|
|
189
204
|
|
|
190
205
|
```vue
|
|
191
206
|
<script setup lang="ts">
|
|
@@ -519,7 +534,8 @@ const handleSendMessage = async (
|
|
|
519
534
|
| modelValue | `string \| TagSchema` | - | ✅ | 编辑器的值,支持 `v-model` |
|
|
520
535
|
| messageStatus | `MessageStatus` | - | - | 消息状态,控制按钮;输入为空时内部强制 `disabled` |
|
|
521
536
|
| cite | `string` | `''` | - | 引用内容,支持 `v-model:cite`,不为空时显示引用区 |
|
|
522
|
-
|
|
|
537
|
+
| skills | `ISkillListItem[]` | `[]` | - | Skill 列表,输入 `/` 触发,选中后插入 Skill 标签 |
|
|
538
|
+
| prompts | `string[]` | `[]` | - | Prompt 模板列表,输入 `\` 触发 |
|
|
523
539
|
| resources | `IAiSlashMenuItem[]` | `[]` | - | 资源列表,输入 `@` 触发,按 `type` 分组展示 |
|
|
524
540
|
| shortcuts | `Shortcut[]` | - | - | 快捷指令列表,显示在底部工具栏 |
|
|
525
541
|
| shortcutId | `string` | - | - | 当前选中的快捷指令 ID,匹配时列表收起为已选样式 |
|
|
@@ -536,8 +552,9 @@ const handleSendMessage = async (
|
|
|
536
552
|
### 默认占位符
|
|
537
553
|
|
|
538
554
|
```
|
|
539
|
-
输入 "/"唤出
|
|
540
|
-
输入"
|
|
555
|
+
输入 "/" 唤出 Skill
|
|
556
|
+
输入 "\" 唤出 Prompt
|
|
557
|
+
输入 "@" 唤出 工具和 MCP
|
|
541
558
|
通过 Shift + Enter 进行换行输入
|
|
542
559
|
```
|
|
543
560
|
|
|
@@ -14,6 +14,10 @@ ChatInput 底部附件区布局,承载快捷按钮、文件与发送图标。
|
|
|
14
14
|
|
|
15
15
|
- **源码位置**:`src/components/chat-input/input-attachment/input-attachment.vue`
|
|
16
16
|
- **能力说明**:ChatInput 底部附件区布局,承载快捷按钮、文件与发送图标。
|
|
17
|
+
- **交互说明**:
|
|
18
|
+
- `sendMessage` 点击绑定在 `.send-message-icon` 容器上(覆盖图标与按钮空白区域),而非仅绑定在 `SendMessageIcon` 上。
|
|
19
|
+
- `Streaming` / `Pending` / `Fetching` 时展示 `LoadingMessageIcon`,点击发出 `stopSending`。
|
|
20
|
+
- `Disabled`、`sendDisabledTip`、`Pending`、`Streaming` 状态下点击发送容器不会发出 `sendMessage`。
|
|
17
21
|
|
|
18
22
|
## API 摘要
|
|
19
23
|
|
|
@@ -40,4 +44,5 @@ ChatInput 底部附件区布局,承载快捷按钮、文件与发送图标。
|
|
|
40
44
|
|
|
41
45
|
## 使用建议
|
|
42
46
|
|
|
43
|
-
- 优先通过上层组合组件使用;直接使用前请确认 props 数据结构来自对应类型定义。
|
|
47
|
+
- 优先通过上层组合组件使用;直接使用前请确认 props 数据结构来自对应类型定义。
|
|
48
|
+
- 自定义 `send-icon` 插槽时需自行处理发送/停止点击逻辑。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "2.0.0",
|
|
3
|
-
"generatedAt": "2026-07-
|
|
3
|
+
"generatedAt": "2026-07-16T12:12:34.511Z",
|
|
4
4
|
"domains": {
|
|
5
5
|
"setup": {
|
|
6
6
|
"label": "对话搭建",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"components": [
|
|
45
45
|
"ai-prompt-list",
|
|
46
46
|
"ai-selection",
|
|
47
|
+
"ai-skill-list",
|
|
47
48
|
"ai-slash-editor",
|
|
48
49
|
"ai-slash-input",
|
|
49
50
|
"ai-slash-menu",
|
|
@@ -671,9 +672,14 @@
|
|
|
671
672
|
"name": "AiPromptList Prompt 列表",
|
|
672
673
|
"slug": "ai-prompt-list",
|
|
673
674
|
"kind": "component",
|
|
674
|
-
"description": "
|
|
675
|
-
"aiSummary": "
|
|
676
|
-
"relatedComponents": [
|
|
675
|
+
"description": "\\ Prompt 选择列表,供 AiSlashInput 插入模板文本。",
|
|
676
|
+
"aiSummary": "\\ Prompt 选择列表,供 AiSlashInput 插入模板文本。 源码位置:src/components/chat-input/ai-slash-input/ai-prompt-list/ai-prompt-list.vue。",
|
|
677
|
+
"relatedComponents": [
|
|
678
|
+
{
|
|
679
|
+
"slug": "ai-slash-input",
|
|
680
|
+
"relation": "输入 \\ 时由 AiSlashInput tippy 菜单渲染"
|
|
681
|
+
}
|
|
682
|
+
],
|
|
677
683
|
"docFile": "docs/ai-prompt-list.md",
|
|
678
684
|
"domain": "input"
|
|
679
685
|
},
|
|
@@ -696,6 +702,25 @@
|
|
|
696
702
|
"docFile": "docs/ai-selection.md",
|
|
697
703
|
"domain": "input"
|
|
698
704
|
},
|
|
705
|
+
{
|
|
706
|
+
"name": "AiSkillList Skill 列表",
|
|
707
|
+
"slug": "ai-skill-list",
|
|
708
|
+
"kind": "component",
|
|
709
|
+
"description": "/ Skill 选择列表,供 AiSlashInput 插入 Skill 标签。",
|
|
710
|
+
"aiSummary": "/ Skill 选择列表,供 AiSlashInput 插入 Skill 标签。 无 icon 或 icon 加载失败时展示 skill_name 首字母 fallback。 源码位置:src/components/chat-input/ai-slash-input/ai-skill-list/ai-skill-list.vue。",
|
|
711
|
+
"relatedComponents": [
|
|
712
|
+
{
|
|
713
|
+
"slug": "ai-slash-input",
|
|
714
|
+
"relation": "输入 / 时由 AiSlashInput tippy 菜单渲染"
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
"slug": "chat-input",
|
|
718
|
+
"relation": "经 ChatInput.skills 透传数据源"
|
|
719
|
+
}
|
|
720
|
+
],
|
|
721
|
+
"docFile": "docs/ai-skill-list.md",
|
|
722
|
+
"domain": "input"
|
|
723
|
+
},
|
|
699
724
|
{
|
|
700
725
|
"name": "AiSlashEditor 富文本编辑器",
|
|
701
726
|
"slug": "ai-slash-editor",
|
|
@@ -710,9 +735,22 @@
|
|
|
710
735
|
"name": "AiSlashInput 富文本命令输入",
|
|
711
736
|
"slug": "ai-slash-input",
|
|
712
737
|
"kind": "component",
|
|
713
|
-
"description": "ChatInput 内部富文本输入,支持 / Prompt 与 @ 资源标签。",
|
|
714
|
-
"aiSummary": "ChatInput 内部富文本输入,支持 / Prompt 与 @ 资源标签。 源码位置:src/components/chat-input/ai-slash-input/ai-slash-input.vue。",
|
|
715
|
-
"relatedComponents": [
|
|
738
|
+
"description": "ChatInput 内部富文本输入,支持 / Skill、\\ Prompt 与 @ 资源标签。",
|
|
739
|
+
"aiSummary": "ChatInput 内部富文本输入,支持 / Skill、\\ Prompt 与 @ 资源标签。 源码位置:src/components/chat-input/ai-slash-input/ai-slash-input.vue。",
|
|
740
|
+
"relatedComponents": [
|
|
741
|
+
{
|
|
742
|
+
"slug": "ai-skill-list",
|
|
743
|
+
"relation": "输入 / 时渲染 Skill 选择列表"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"slug": "ai-prompt-list",
|
|
747
|
+
"relation": "输入 \\ 时渲染 Prompt 选择列表"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"slug": "ai-slash-menu",
|
|
751
|
+
"relation": "输入 @ 时渲染资源选择菜单"
|
|
752
|
+
}
|
|
753
|
+
],
|
|
716
754
|
"docFile": "docs/ai-slash-input.md",
|
|
717
755
|
"domain": "input"
|
|
718
756
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueking/chat-x",
|
|
3
|
-
"version": "0.0.47-beta.
|
|
3
|
+
"version": "0.0.47-beta.4",
|
|
4
4
|
"description": "蓝鲸智云 AI Chat 组件库 —— 遵循 AG-UI,为 AI Agent 和人类开发者共同设计的对话 UI 组件库。",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"vitepress": "2.0.0-alpha.16",
|
|
80
80
|
"vitest": "^4.0.18",
|
|
81
81
|
"vue-tsc": "^3.1.4",
|
|
82
|
-
"@blueking/chat-helper": "0.0.12-beta.
|
|
82
|
+
"@blueking/chat-helper": "0.0.12-beta.10"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"dev": "vite --config vite.config.ts",
|