@blueking/chat-x 0.0.45-beta.5 → 0.0.45-beta.7
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/README.md +1 -1
- package/dist/ag-ui/types/constants.d.ts +0 -16
- package/dist/ag-ui/types/contents.d.ts +0 -2
- package/dist/ag-ui/types/index.d.ts +0 -2
- package/dist/ag-ui/types/messages.d.ts +0 -2
- package/dist/components/chat-content/flow-agent-content/flow-agent-content.vue.d.ts +0 -3
- package/dist/components/chat-content/flow-agent-content/use-flow-agent.d.ts +0 -4
- package/dist/components/chat-input/ai-slash-input/command.d.ts +2 -1
- package/dist/components/chat-input/ai-slash-input/constants.d.ts +4 -0
- package/dist/components/chat-input/chat-input.vue.d.ts +8 -14
- package/dist/components/chat-input/input-attachment/input-attachment.vue.d.ts +0 -1
- package/dist/components/chat-message/activity-message/activity-message.vue.d.ts +1 -4
- package/dist/components/chat-message/assistant-message/assistant-message.vue.d.ts +1 -1
- package/dist/components/chat-message/message-container/message-container.vue.d.ts +7 -14
- package/dist/components/chat-message/message-render/message-render.vue.d.ts +0 -4
- package/dist/components/index.d.ts +2 -3
- package/dist/composables/use-global-config.d.ts +0 -3
- package/dist/composables/use-message-group.d.ts +823 -2609
- package/dist/icons/index.d.ts +0 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1935 -2537
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +2 -34
- package/dist/mcp/generated/docs/activity-message.md +7 -21
- package/dist/mcp/generated/docs/ai-image.md +4 -9
- package/dist/mcp/generated/docs/ai-loading.md +6 -11
- package/dist/mcp/generated/docs/ai-selection.md +5 -10
- package/dist/mcp/generated/docs/animation-text.md +4 -9
- package/dist/mcp/generated/docs/assistant-message.md +5 -10
- package/dist/mcp/generated/docs/chat-container.md +19 -173
- package/dist/mcp/generated/docs/chat-input.md +10 -78
- package/dist/mcp/generated/docs/cite-content.md +3 -8
- package/dist/mcp/generated/docs/code-content.md +4 -9
- package/dist/mcp/generated/docs/common-error-content.md +5 -10
- package/dist/mcp/generated/docs/constants.md +3 -68
- package/dist/mcp/generated/docs/content-render.md +5 -10
- package/dist/mcp/generated/docs/delete-tool.md +4 -9
- package/dist/mcp/generated/docs/desc-panel.md +4 -9
- package/dist/mcp/generated/docs/execution-summary.md +5 -10
- package/dist/mcp/generated/docs/file-content.md +4 -9
- package/dist/mcp/generated/docs/file-upload-btn.md +5 -10
- package/dist/mcp/generated/docs/highlight-keyword.md +5 -10
- package/dist/mcp/generated/docs/image-content.md +4 -9
- package/dist/mcp/generated/docs/image-preview-group.md +4 -9
- package/dist/mcp/generated/docs/image-preview.md +5 -10
- package/dist/mcp/generated/docs/info-message.md +2 -7
- package/dist/mcp/generated/docs/key-value-content.md +4 -9
- package/dist/mcp/generated/docs/latex-content.md +4 -9
- package/dist/mcp/generated/docs/loading-message.md +6 -11
- package/dist/mcp/generated/docs/markdown-container.md +1 -1
- package/dist/mcp/generated/docs/markdown-content.md +8 -13
- package/dist/mcp/generated/docs/markdown-latex.md +3 -3
- package/dist/mcp/generated/docs/markdown-mermaid.md +3 -3
- package/dist/mcp/generated/docs/mermaid-content.md +4 -9
- package/dist/mcp/generated/docs/message-container.md +11 -69
- package/dist/mcp/generated/docs/message-render.md +11 -23
- package/dist/mcp/generated/docs/message-tools.md +5 -10
- package/dist/mcp/generated/docs/messages.md +11 -75
- package/dist/mcp/generated/docs/overflow-tips.md +4 -4
- package/dist/mcp/generated/docs/reasoning-message.md +5 -10
- package/dist/mcp/generated/docs/reference-content.md +5 -10
- package/dist/mcp/generated/docs/scroll-btn.md +3 -8
- package/dist/mcp/generated/docs/selection-footer.md +4 -9
- package/dist/mcp/generated/docs/shortcut-btn.md +5 -10
- package/dist/mcp/generated/docs/shortcut-btns.md +5 -10
- package/dist/mcp/generated/docs/shortcut-render.md +5 -10
- package/dist/mcp/generated/docs/text-content.md +4 -9
- package/dist/mcp/generated/docs/theme.md +4 -50
- package/dist/mcp/generated/docs/tool-btn.md +4 -9
- package/dist/mcp/generated/docs/tool-message.md +5 -10
- package/dist/mcp/generated/docs/toolcall-render.md +5 -10
- package/dist/mcp/generated/docs/use-animation-text.md +4 -4
- package/dist/mcp/generated/docs/use-clipboard.md +3 -3
- package/dist/mcp/generated/docs/use-command-selection.md +1 -1
- package/dist/mcp/generated/docs/use-custom-tab.md +1 -1
- package/dist/mcp/generated/docs/use-full-screen.md +3 -3
- package/dist/mcp/generated/docs/use-global-config.md +5 -20
- package/dist/mcp/generated/docs/use-menu-keydown.md +1 -1
- package/dist/mcp/generated/docs/use-message-group.md +9 -40
- package/dist/mcp/generated/docs/use-observer-visible-list.md +1 -1
- package/dist/mcp/generated/docs/user-feedback.md +3 -8
- package/dist/mcp/generated/docs/user-message.md +13 -18
- package/dist/mcp/generated/index.json +560 -1103
- package/dist/mcp/index.js +0 -0
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/list-components.d.ts +6 -7
- package/dist/mcp/tools/list-components.js +29 -23
- package/dist/mcp/tools/list-components.js.map +1 -1
- package/dist/mcp/tools/search-docs.js +1 -1
- package/dist/mcp/tools/search-docs.js.map +1 -1
- package/dist/mcp/utils/doc-loader.d.ts +1 -1
- package/dist/types/editor.d.ts +1 -0
- package/package.json +21 -23
- package/dist/ag-ui/types/interrupt.d.ts +0 -137
- package/dist/ag-ui/types/schema.d.ts +0 -42
- package/dist/components/ai-questions/questions-container.vue.d.ts +0 -3
- package/dist/components/ai-questions/selection-question.vue.d.ts +0 -3
- package/dist/components/chat-content/flow-agent-content/use-flow-node-actions.d.ts +0 -32
- package/dist/components/chat-content/index.d.ts +0 -2
- package/dist/components/chat-input/input-info-alert.vue.d.ts +0 -6
- package/dist/components/chat-message/interrupt-message/index.d.ts +0 -2
- package/dist/components/chat-message/interrupt-message/interrupt-message.vue.d.ts +0 -17
- package/dist/components/chat-message/interrupt-message/tool-approval-card.vue.d.ts +0 -8
- package/dist/components/chat-message/interrupt-message/user-question/index.d.ts +0 -5
- package/dist/components/chat-message/interrupt-message/user-question/use-user-question.d.ts +0 -35
- package/dist/components/chat-message/interrupt-message/user-question/user-question-answered-card.vue.d.ts +0 -25
- package/dist/components/chat-message/interrupt-message/user-question/user-question-card.vue.d.ts +0 -25
- package/dist/components/chat-message/interrupt-message/user-question/user-question-choice.vue.d.ts +0 -13
- package/dist/components/chat-message/interrupt-message/user-question/user-question-option.vue.d.ts +0 -17
- package/dist/icons/interrupt.d.ts +0 -24
- package/dist/mcp/generated/docs/activity-layout.md +0 -138
- package/dist/mcp/generated/docs/ai-prompt-list.md +0 -42
- package/dist/mcp/generated/docs/ai-slash-editor.md +0 -43
- package/dist/mcp/generated/docs/ai-slash-input.md +0 -43
- package/dist/mcp/generated/docs/ai-slash-menu.md +0 -42
- package/dist/mcp/generated/docs/detail-section.md +0 -93
- package/dist/mcp/generated/docs/flow-agent-content.md +0 -252
- package/dist/mcp/generated/docs/flow-agent-node-detail.md +0 -240
- package/dist/mcp/generated/docs/input-attachment.md +0 -43
- package/dist/mcp/generated/docs/input-info-alert.md +0 -42
- package/dist/mcp/generated/docs/interrupt-message.md +0 -204
- package/dist/mcp/generated/docs/interrupt.md +0 -354
- package/dist/mcp/generated/docs/knowledge-rag-content.md +0 -126
- package/dist/mcp/generated/docs/message-loading.md +0 -120
- package/dist/mcp/generated/docs/preview-toolbar.md +0 -42
- package/dist/mcp/generated/docs/questions-container.md +0 -88
- package/dist/mcp/generated/docs/reference-doc-content.md +0 -112
- package/dist/mcp/generated/docs/schema.md +0 -93
- package/dist/mcp/generated/docs/selection-question.md +0 -91
- package/dist/mcp/generated/docs/simple-table.md +0 -103
- package/dist/mcp/generated/docs/tool-approval-card.md +0 -148
- package/dist/mcp/generated/docs/use-flow-node-actions.md +0 -124
- package/dist/mcp/generated/docs/user-question-answered-card.md +0 -106
- package/dist/mcp/generated/docs/user-question-card.md +0 -228
- package/dist/mcp/generated/docs/user-question-choice.md +0 -108
- package/dist/mcp/generated/docs/user-question-option.md +0 -42
- package/dist/mcp/generated/docs/vnode-renderer.md +0 -126
package/dist/mcp/index.js
CHANGED
|
File without changes
|
package/dist/mcp/server.js
CHANGED
|
@@ -35,7 +35,7 @@ function createServer() {
|
|
|
35
35
|
name: 'chat-x',
|
|
36
36
|
version: '0.1.0',
|
|
37
37
|
});
|
|
38
|
-
server.tool('list_components', '列出 @blueking/chat-x
|
|
38
|
+
server.tool('list_components', '列出 @blueking/chat-x 文档索引中的全部条目:原子/分子组件、composables、指令、插件、类型、工具、edix、i18n、图标、主题等;支持按文档分类与组件功能域筛选,并返回 aiSummary', list_components_js_1.listComponentsSchema, async (args) => (0, list_components_js_1.listComponents)(args));
|
|
39
39
|
server.tool('get_component_doc', '按 slug 获取对应 Wiki 文档全文(含 AI 摘要区块与清洗后的正文);覆盖组件、composable、指令、插件、类型等所有已编入索引的条目', get_component_doc_js_1.getComponentDocSchema, async (args) => (0, get_component_doc_js_1.getComponentDoc)(args));
|
|
40
40
|
server.tool('search_docs', '在 @blueking/chat-x 已生成文档中全文检索(含名称、描述、aiSummary、关联组件 relation、正文),返回匹配条目与上下文片段', search_docs_js_1.searchDocsSchema, async (args) => (0, search_docs_js_1.searchDocs)(args));
|
|
41
41
|
return server;
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../mcp/src/server.ts"],"names":[],"mappings":";;AA+BA,oCA4BC;AA3DD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oEAAoE;AAEpE,uEAAsF;AACtF,mEAAkF;AAClF,2DAAsE;AAEtE,SAAgB,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CACT,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../mcp/src/server.ts"],"names":[],"mappings":";;AA+BA,oCA4BC;AA3DD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oEAAoE;AAEpE,uEAAsF;AACtF,mEAAkF;AAClF,2DAAsE;AAEtE,SAAgB,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CACT,iBAAiB,EACjB,+GAA+G,EAC/G,yCAAoB,EACpB,KAAK,EAAC,IAAI,EAAC,EAAE,CAAC,IAAA,mCAAc,EAAC,IAAI,CAAC,CACnC,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,6EAA6E,EAC7E,4CAAqB,EACrB,KAAK,EAAC,IAAI,EAAC,EAAE,CAAC,IAAA,sCAAe,EAAC,IAAI,CAAC,CACpC,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,aAAa,EACb,+EAA+E,EAC/E,iCAAgB,EAChB,KAAK,EAAC,IAAI,EAAC,EAAE,CAAC,IAAA,2BAAU,EAAC,IAAI,CAAC,CAC/B,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const listComponentsSchema: {
|
|
3
|
-
|
|
3
|
+
category: z.ZodDefault<z.ZodEnum<{
|
|
4
4
|
all: "all";
|
|
5
|
-
|
|
5
|
+
atomic: "atomic";
|
|
6
|
+
molecular: "molecular";
|
|
6
7
|
composable: "composable";
|
|
7
8
|
directive: "directive";
|
|
8
9
|
plugin: "plugin";
|
|
@@ -15,19 +16,17 @@ export declare const listComponentsSchema: {
|
|
|
15
16
|
}>>;
|
|
16
17
|
domain: z.ZodDefault<z.ZodEnum<{
|
|
17
18
|
all: "all";
|
|
18
|
-
setup: "setup";
|
|
19
19
|
message: "message";
|
|
20
|
-
rendering: "rendering";
|
|
21
20
|
input: "input";
|
|
22
|
-
|
|
23
|
-
feedback: "feedback";
|
|
21
|
+
content: "content";
|
|
24
22
|
media: "media";
|
|
23
|
+
tools: "tools";
|
|
25
24
|
helper: "helper";
|
|
26
25
|
}>>;
|
|
27
26
|
};
|
|
28
27
|
export declare function listComponents(args: {
|
|
28
|
+
category: string;
|
|
29
29
|
domain: string;
|
|
30
|
-
kind: string;
|
|
31
30
|
}): {
|
|
32
31
|
content: {
|
|
33
32
|
type: "text";
|
|
@@ -30,10 +30,11 @@ exports.listComponents = listComponents;
|
|
|
30
30
|
const zod_1 = require("zod");
|
|
31
31
|
const doc_loader_js_1 = require("../utils/doc-loader.js");
|
|
32
32
|
exports.listComponentsSchema = {
|
|
33
|
-
|
|
33
|
+
category: zod_1.z
|
|
34
34
|
.enum([
|
|
35
35
|
'all',
|
|
36
|
-
'
|
|
36
|
+
'atomic',
|
|
37
|
+
'molecular',
|
|
37
38
|
'composable',
|
|
38
39
|
'directive',
|
|
39
40
|
'plugin',
|
|
@@ -45,15 +46,15 @@ exports.listComponentsSchema = {
|
|
|
45
46
|
'theme',
|
|
46
47
|
])
|
|
47
48
|
.default('all')
|
|
48
|
-
.describe('
|
|
49
|
+
.describe('过滤分类:all 返回全部,或按具体分类筛选'),
|
|
49
50
|
domain: zod_1.z
|
|
50
|
-
.enum(['all', '
|
|
51
|
+
.enum(['all', 'message', 'input', 'content', 'media', 'tools', 'helper'])
|
|
51
52
|
.default('all')
|
|
52
|
-
.describe('
|
|
53
|
+
.describe('按功能域过滤(仅对组件生效,其他分类不受影响)'),
|
|
53
54
|
};
|
|
54
55
|
function listComponents(args) {
|
|
55
56
|
const index = (0, doc_loader_js_1.loadIndex)();
|
|
56
|
-
const {
|
|
57
|
+
const { category, domain } = args;
|
|
57
58
|
const result = {
|
|
58
59
|
components: [],
|
|
59
60
|
composables: [],
|
|
@@ -66,34 +67,34 @@ function listComponents(args) {
|
|
|
66
67
|
icons: [],
|
|
67
68
|
theme: [],
|
|
68
69
|
};
|
|
69
|
-
if (shouldIncludeGroup('components',
|
|
70
|
-
result.components = filterComponentEntries(index.components, domain).map(mapEntry);
|
|
70
|
+
if (shouldIncludeGroup('components', category)) {
|
|
71
|
+
result.components = filterComponentEntries(index.components, category, domain).map(mapEntry);
|
|
71
72
|
}
|
|
72
|
-
if (shouldIncludeGroup('composables',
|
|
73
|
+
if (shouldIncludeGroup('composables', category)) {
|
|
73
74
|
result.composables = index.composables.map(mapEntry);
|
|
74
75
|
}
|
|
75
|
-
if (shouldIncludeGroup('types',
|
|
76
|
+
if (shouldIncludeGroup('types', category)) {
|
|
76
77
|
result.types = index.types.map(mapEntry);
|
|
77
78
|
}
|
|
78
|
-
if (shouldIncludeGroup('directives',
|
|
79
|
+
if (shouldIncludeGroup('directives', category)) {
|
|
79
80
|
result.directives = index.directives.map(mapEntry);
|
|
80
81
|
}
|
|
81
|
-
if (shouldIncludeGroup('plugins',
|
|
82
|
+
if (shouldIncludeGroup('plugins', category)) {
|
|
82
83
|
result.plugins = index.plugins.map(mapEntry);
|
|
83
84
|
}
|
|
84
|
-
if (shouldIncludeGroup('utils',
|
|
85
|
+
if (shouldIncludeGroup('utils', category)) {
|
|
85
86
|
result.utils = index.utils.map(mapEntry);
|
|
86
87
|
}
|
|
87
|
-
if (shouldIncludeGroup('edix',
|
|
88
|
+
if (shouldIncludeGroup('edix', category)) {
|
|
88
89
|
result.edix = index.edix.map(mapEntry);
|
|
89
90
|
}
|
|
90
|
-
if (shouldIncludeGroup('i18n',
|
|
91
|
+
if (shouldIncludeGroup('i18n', category)) {
|
|
91
92
|
result.i18n = index.i18n.map(mapEntry);
|
|
92
93
|
}
|
|
93
|
-
if (shouldIncludeGroup('icons',
|
|
94
|
+
if (shouldIncludeGroup('icons', category)) {
|
|
94
95
|
result.icons = index.icons.map(mapEntry);
|
|
95
96
|
}
|
|
96
|
-
if (shouldIncludeGroup('theme',
|
|
97
|
+
if (shouldIncludeGroup('theme', category)) {
|
|
97
98
|
result.theme = index.theme.map(mapEntry);
|
|
98
99
|
}
|
|
99
100
|
return {
|
|
@@ -105,8 +106,12 @@ function listComponents(args) {
|
|
|
105
106
|
],
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
|
-
function filterComponentEntries(entries, domain) {
|
|
109
|
+
function filterComponentEntries(entries, category, domain) {
|
|
109
110
|
let result = entries;
|
|
111
|
+
if (category === 'atomic')
|
|
112
|
+
result = result.filter(e => e.category === 'atomic');
|
|
113
|
+
else if (category === 'molecular')
|
|
114
|
+
result = result.filter(e => e.category === 'molecular');
|
|
110
115
|
if (domain !== 'all')
|
|
111
116
|
result = result.filter(e => (e.domain ?? 'helper') === domain);
|
|
112
117
|
return result;
|
|
@@ -115,17 +120,18 @@ function mapEntry(entry) {
|
|
|
115
120
|
return {
|
|
116
121
|
name: entry.name,
|
|
117
122
|
slug: entry.slug,
|
|
118
|
-
|
|
123
|
+
category: entry.category,
|
|
119
124
|
description: entry.description,
|
|
120
125
|
aiSummary: entry.aiSummary,
|
|
121
126
|
...(entry.domain !== undefined ? { domain: entry.domain } : {}),
|
|
122
127
|
};
|
|
123
128
|
}
|
|
124
|
-
function shouldIncludeGroup(groupKey,
|
|
125
|
-
if (
|
|
129
|
+
function shouldIncludeGroup(groupKey, category) {
|
|
130
|
+
if (category === 'all')
|
|
126
131
|
return true;
|
|
127
132
|
const single = {
|
|
128
|
-
|
|
133
|
+
atomic: 'components',
|
|
134
|
+
molecular: 'components',
|
|
129
135
|
composable: 'composables',
|
|
130
136
|
directive: 'directives',
|
|
131
137
|
plugin: 'plugins',
|
|
@@ -136,6 +142,6 @@ function shouldIncludeGroup(groupKey, kind) {
|
|
|
136
142
|
icon: 'icons',
|
|
137
143
|
theme: 'theme',
|
|
138
144
|
};
|
|
139
|
-
return single[
|
|
145
|
+
return single[category] === groupKey;
|
|
140
146
|
}
|
|
141
147
|
//# sourceMappingURL=list-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-components.js","sourceRoot":"","sources":["../../../mcp/src/tools/list-components.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"list-components.js","sourceRoot":"","sources":["../../../mcp/src/tools/list-components.ts"],"names":[],"mappings":";;;AAiEA,wCAwDC;AAzHD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,6BAAwB;AAExB,0DAAkE;AAErD,QAAA,oBAAoB,GAAG;IAClC,QAAQ,EAAE,OAAC;SACR,IAAI,CAAC;QACJ,KAAK;QACL,QAAQ;QACR,WAAW;QACX,YAAY;QACZ,WAAW;QACX,QAAQ;QACR,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,OAAO;KACR,CAAC;SACD,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,wBAAwB,CAAC;IACrC,MAAM,EAAE,OAAC;SACN,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;SACxE,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,yBAAyB,CAAC;CACvC,CAAC;AAcF,SAAgB,cAAc,CAAC,IAA0C;IACvE,MAAM,KAAK,GAAG,IAAA,yBAAS,GAAE,CAAC;IAC1B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAElC,MAAM,MAAM,GAAwD;QAClE,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,EAAE;QACf,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,IAAI,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC/C,MAAM,CAAC,UAAU,GAAG,sBAA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C7B,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAC3C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACvC,IAAI,GAAG,GAAG,CAAC,CAAC;IAEZ,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAClD,IAAI,GAAG,KAAK,CAAC,CAAC;YAAE,MAAM;QAEtB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,YAAY,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC;QACxE,MAAM,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClH,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/types/editor.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueking/chat-x",
|
|
3
|
-
"version": "0.0.45-beta.
|
|
3
|
+
"version": "0.0.45-beta.7",
|
|
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
|
-
},
|
|
24
6
|
"bin": {
|
|
25
7
|
"chat-x-mcp": "dist/mcp/index.js"
|
|
26
8
|
},
|
|
@@ -68,7 +50,6 @@
|
|
|
68
50
|
"zod": "^4.3.6"
|
|
69
51
|
},
|
|
70
52
|
"devDependencies": {
|
|
71
|
-
"@blueking/chat-helper": "workspace:*",
|
|
72
53
|
"@types/katex": "^0.16.7",
|
|
73
54
|
"@types/lodash": "^4.17.23",
|
|
74
55
|
"@types/markdown-it": "^14.1.2",
|
|
@@ -82,13 +63,12 @@
|
|
|
82
63
|
"glob": "^13.0.6",
|
|
83
64
|
"gray-matter": "^4.0.3",
|
|
84
65
|
"happy-dom": "^20.3.7",
|
|
85
|
-
"json-schema-to-ts": "^3.1.1",
|
|
86
66
|
"less": "^4.4.2",
|
|
87
67
|
"linkify-it": "^5.0.0",
|
|
88
68
|
"mdurl": "^2.0.0",
|
|
89
69
|
"monaco-editor": "^0.55.1",
|
|
90
|
-
"oxc-minify": "^0.121.0",
|
|
91
70
|
"postcss": "^8.5.9",
|
|
71
|
+
"oxc-minify": "^0.121.0",
|
|
92
72
|
"punycode.js": "^2.3.1",
|
|
93
73
|
"sass-embedded": "^1.93.3",
|
|
94
74
|
"tsx": "^4.21.0",
|
|
@@ -97,6 +77,24 @@
|
|
|
97
77
|
"vite-bundle-analyzer": "^1.3.2",
|
|
98
78
|
"vitepress": "2.0.0-alpha.16",
|
|
99
79
|
"vitest": "^4.0.18",
|
|
100
|
-
"vue-tsc": "^3.1.4"
|
|
80
|
+
"vue-tsc": "^3.1.4",
|
|
81
|
+
"@blueking/chat-helper": "0.0.12-beta.2"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"dev": "vite --config vite.config.ts",
|
|
85
|
+
"dts": "vue-tsc --project tsconfig.dts.json",
|
|
86
|
+
"build": "vitest && vite --config vite.config.ts build && pnpm dts",
|
|
87
|
+
"preview": "vite --config vite.config.ts build --mode preview && pnpm dts",
|
|
88
|
+
"lint:script": "eslint . --ext .vue,.ts --fix",
|
|
89
|
+
"lint:style": "stylelint \"**/*.{scss,css,vue}\" --fix",
|
|
90
|
+
"lint:all": "pnpm lint:script && pnpm lint:style",
|
|
91
|
+
"test": "vitest",
|
|
92
|
+
"test:coverage": "vitest run --coverage",
|
|
93
|
+
"wiki:dev": "vitepress dev wikis",
|
|
94
|
+
"wiki:build": "vitepress build wikis",
|
|
95
|
+
"mcp:build:index": "tsx mcp/scripts/build-index.ts",
|
|
96
|
+
"mcp:build": "tsc -p mcp/tsconfig.json && pnpm mcp:build:index",
|
|
97
|
+
"mcp:start": "node dist/mcp/index.js",
|
|
98
|
+
"mcp:dev": "tsx mcp/src/index.ts"
|
|
101
99
|
}
|
|
102
100
|
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import type { APPROVAL_STATUS, InterruptReason, MessageRole } from './constants';
|
|
2
|
-
import type { BaseMessage } from './messages';
|
|
3
|
-
/**
|
|
4
|
-
* 可恢复操作(resume operation)枚举。
|
|
5
|
-
*
|
|
6
|
-
* 统一标识用户在「中断消息 / 活动消息」上触发的、需回传 Agent 处理的动作;
|
|
7
|
-
* 业务侧通过 `onInterruptResume` 回调的 `payload.operation` 字段进行分支处理。
|
|
8
|
-
* 新增操作类型只需在此扩展,回调契约与透传链路保持不变。
|
|
9
|
-
*/
|
|
10
|
-
export declare enum InterruptResumeOperation {
|
|
11
|
-
/** 主动取消第三方工具审批:在 interrupt 记录上写入取消结果 */
|
|
12
|
-
ApprovalCancel = "approval_cancel",
|
|
13
|
-
/** 重试失败的流程节点:bkflow 节点状态重置为可执行 */
|
|
14
|
-
FlowNodeRetry = "flow_node_retry",
|
|
15
|
-
/** 跳过失败的流程节点:bkflow 节点标记为已跳过 */
|
|
16
|
-
FlowNodeSkip = "flow_node_skip"
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* AI Dev 第三方工具审批中断
|
|
20
|
-
*/
|
|
21
|
-
export type AIDevToolApprovalInterrupt = BaseInterrupt<InterruptReason.AIDevToolApproval, {
|
|
22
|
-
ticket: {
|
|
23
|
-
approvers: string[];
|
|
24
|
-
sn: string;
|
|
25
|
-
status: APPROVAL_STATUS;
|
|
26
|
-
submit_time: string;
|
|
27
|
-
title: string;
|
|
28
|
-
url: string;
|
|
29
|
-
};
|
|
30
|
-
}>;
|
|
31
|
-
export type BaseInterrupt<T extends InterruptReason, M extends Record<string, any>> = {
|
|
32
|
-
expiresAt?: string;
|
|
33
|
-
id: string;
|
|
34
|
-
message?: string;
|
|
35
|
-
metadata?: M;
|
|
36
|
-
properties?: Record<string, any>;
|
|
37
|
-
reason: T;
|
|
38
|
-
toolCallId: string;
|
|
39
|
-
};
|
|
40
|
-
export type BaseResume<T extends InterruptReason, P extends Record<string, any> = Record<string, any>> = {
|
|
41
|
-
interruptId: string;
|
|
42
|
-
payload: P;
|
|
43
|
-
reason: T;
|
|
44
|
-
status: 'cancelled' | 'resolved';
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* 流程节点(flow-agent)操作响应负载:重试 / 跳过失败节点。
|
|
48
|
-
* 流程节点不属于 interrupt,故节点定位信息(taskId / nodeId)随 payload 一并回传,
|
|
49
|
-
* 此时 `onInterruptResume` 的第二个 `interrupt` 参数为空。
|
|
50
|
-
*/
|
|
51
|
-
export type FlowNodeResume = {
|
|
52
|
-
operation: InterruptResumeOperation.FlowNodeRetry | InterruptResumeOperation.FlowNodeSkip;
|
|
53
|
-
payload: {
|
|
54
|
-
node_id: string;
|
|
55
|
-
task_id: number;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export type Interrupt = AIDevToolApprovalInterrupt | BaseInterrupt<InterruptReason, Record<string, any>> | UserQuestionInterrupt;
|
|
59
|
-
export type InterruptItem = Interrupt;
|
|
60
|
-
/**
|
|
61
|
-
* 中断消息
|
|
62
|
-
*
|
|
63
|
-
* 对应 AG-UI 协议 `RUN_FINISHED { outcome: { type: "interrupt", interrupts } }` 事件。
|
|
64
|
-
* 当 Agent 需要 human-in-the-loop(审批 / 补充信息 / 策略阻断等)时,
|
|
65
|
-
* 会派生此类型消息以驱动 UI 渲染等待用户响应;用户响应后通过
|
|
66
|
-
* `RunAgentInput.resume = { interruptId, payload }` 把结果回传给 Agent。
|
|
67
|
-
*
|
|
68
|
-
* @see https://docs.ag-ui.com/drafts/interrupts
|
|
69
|
-
*/
|
|
70
|
-
export type InterruptMessage = BaseMessage<MessageRole.Interrupt, {
|
|
71
|
-
message?: string;
|
|
72
|
-
/** 是否已被用户响应(resume)过,用于 UI 区分"等待响应 / 已处理"两种态 */
|
|
73
|
-
outcome?: RunFinishedOutcome;
|
|
74
|
-
/** outcome.type === success 用户 resume 时回传给 Agent 的 payload,便于回放与持久化 */
|
|
75
|
-
result?: BaseResume<InterruptReason>;
|
|
76
|
-
runId?: string;
|
|
77
|
-
threadId?: string;
|
|
78
|
-
}>;
|
|
79
|
-
export type InterruptResume = FlowNodeResume | ToolApprovalResume | UserQuestionResume;
|
|
80
|
-
/**
|
|
81
|
-
* 中断响应回调(统一约定:payload 在前,原始中断信息在后)
|
|
82
|
-
* @param payload 响应负载(resume payload),通过 `payload.operation` 区分动作类型
|
|
83
|
-
* @param interrupt 中断原始信息;流程节点等非中断来源的操作可不传
|
|
84
|
-
* @returns
|
|
85
|
-
*/
|
|
86
|
-
export type OnInterruptResume = (payload: InterruptResume, interrupt?: Interrupt) => Promise<void> | void;
|
|
87
|
-
export type RunFinishedOutcome = {
|
|
88
|
-
interrupts: Interrupt[];
|
|
89
|
-
type: 'interrupt';
|
|
90
|
-
} | {
|
|
91
|
-
type: 'success';
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* 第三方工具审批中断的响应负载(取消审批等动作)
|
|
95
|
-
*/
|
|
96
|
-
export type ToolApprovalResume = {
|
|
97
|
-
operation: InterruptResumeOperation.ApprovalCancel;
|
|
98
|
-
payload: {
|
|
99
|
-
interrupt_id: number | string;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* 用户对单个问题的回答
|
|
104
|
-
*/
|
|
105
|
-
export type UserQuestionAnswerItem = {
|
|
106
|
-
answer: UserQuestionOptionItem[];
|
|
107
|
-
multiSelect?: boolean;
|
|
108
|
-
question: string;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* 用户回答问题中断
|
|
112
|
-
*/
|
|
113
|
-
export type UserQuestionInterrupt = BaseInterrupt<InterruptReason.UserQuestion, {
|
|
114
|
-
questions: UserQuestionItem[];
|
|
115
|
-
}>;
|
|
116
|
-
/**
|
|
117
|
-
* 用户回答问题中的单个问题
|
|
118
|
-
*/
|
|
119
|
-
export type UserQuestionItem = {
|
|
120
|
-
header: string;
|
|
121
|
-
multiSelect?: boolean;
|
|
122
|
-
options?: UserQuestionOptionItem[];
|
|
123
|
-
question: string;
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* 用户回答问题选项;label 为 `others` 时代表用户自定义输入,description 为输入文本
|
|
127
|
-
*/
|
|
128
|
-
export type UserQuestionOptionItem = {
|
|
129
|
-
description: string;
|
|
130
|
-
label: string;
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* 用户回答问题中断响应
|
|
134
|
-
*/
|
|
135
|
-
export type UserQuestionResume = BaseResume<InterruptReason.UserQuestion, {
|
|
136
|
-
answers: UserQuestionAnswerItem[];
|
|
137
|
-
}>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
-
export declare const UserSingleChoiceQuestionSchema: {
|
|
3
|
-
readonly properties: {
|
|
4
|
-
readonly question: {
|
|
5
|
-
readonly enum: readonly [];
|
|
6
|
-
readonly type: "string";
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
readonly required: readonly ["question"];
|
|
10
|
-
readonly type: "object";
|
|
11
|
-
};
|
|
12
|
-
export declare const UserMultiChoiceQuestionSchema: {
|
|
13
|
-
readonly properties: {
|
|
14
|
-
readonly question: {
|
|
15
|
-
readonly items: {
|
|
16
|
-
readonly enum: readonly [];
|
|
17
|
-
readonly type: "string";
|
|
18
|
-
};
|
|
19
|
-
readonly uniqueItems: true;
|
|
20
|
-
readonly type: "array";
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
readonly required: readonly ["question"];
|
|
24
|
-
readonly type: "object";
|
|
25
|
-
};
|
|
26
|
-
export declare const UserQuestionSchema: {
|
|
27
|
-
readonly properties: {
|
|
28
|
-
readonly question: {
|
|
29
|
-
readonly items: {
|
|
30
|
-
readonly enum: readonly [];
|
|
31
|
-
readonly type: "string";
|
|
32
|
-
};
|
|
33
|
-
readonly uniqueItems: true;
|
|
34
|
-
readonly type: "array";
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
readonly required: readonly ["question"];
|
|
38
|
-
readonly type: "object";
|
|
39
|
-
};
|
|
40
|
-
export type UserMultiChoiceQuestion = FromSchema<typeof UserMultiChoiceQuestionSchema>;
|
|
41
|
-
export type UserQuestion = UserMultiChoiceQuestion;
|
|
42
|
-
export type UserSingleChoiceQuestion = FromSchema<typeof UserSingleChoiceQuestionSchema>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
declare const _default: typeof __VLS_export;
|
|
3
|
-
export default _default;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Component, Ref } from 'vue';
|
|
2
|
-
import { InterruptResumeOperation } from '../../../ag-ui/types/interrupt';
|
|
3
|
-
import type { BkFlowNode, BkFlowTask } from '../../../ag-ui/types/contents';
|
|
4
|
-
import type { OnInterruptResume } from '../../../ag-ui/types/interrupt';
|
|
5
|
-
import type { FlowNodeVM, FlowTaskVM } from './use-flow-agent';
|
|
6
|
-
/** 节点行尾操作类型标识 */
|
|
7
|
-
export type FlowNodeActionId = 'detail' | InterruptResumeOperation.FlowNodeRetry | InterruptResumeOperation.FlowNodeSkip;
|
|
8
|
-
/** 节点行尾操作视图模型:详情 / 重试 / 跳过统一为同一渲染单元(图标 + 文案 + 点击) */
|
|
9
|
-
export interface FlowNodeActionVM {
|
|
10
|
-
/** 按钮图标组件 */
|
|
11
|
-
icon: Component;
|
|
12
|
-
/** 唯一标识,用于 v-for key 与样式钩子 */
|
|
13
|
-
id: FlowNodeActionId;
|
|
14
|
-
/** 国际化文案 */
|
|
15
|
-
label: string;
|
|
16
|
-
/** 点击执行 */
|
|
17
|
-
run: () => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* flow-agent 节点行尾操作 composable。
|
|
21
|
-
*
|
|
22
|
-
* 将「详情(打开侧栏)」与「重试 / 跳过(回传 Agent resume)」聚合为统一的、声明式的
|
|
23
|
-
* 操作列表,组件层只需遍历渲染,显隐与点击行为均收敛于此,便于复用、单测与扩展。
|
|
24
|
-
*/
|
|
25
|
-
export declare const useFlowNodeActions: (options: {
|
|
26
|
-
/** resume 回调(与第三方审批取消同一回调,按 payload.operation 分流) */
|
|
27
|
-
onInterruptResume: Ref<OnInterruptResume | undefined>;
|
|
28
|
-
/** 打开节点详情侧栏(复用 useFlowTab 的能力) */
|
|
29
|
-
openNodeDetail: (task: BkFlowTask, node: BkFlowNode) => void;
|
|
30
|
-
}) => {
|
|
31
|
-
getNodeActions: (task: FlowTaskVM, node: FlowNodeVM) => FlowNodeActionVM[];
|
|
32
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
content: string;
|
|
3
|
-
};
|
|
4
|
-
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>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { InterruptMessage, OnInterruptResume } from '../../../ag-ui/types/interrupt';
|
|
2
|
-
import type { UserQuestionAnsweredCardSlots } from './user-question/user-question-answered-card.vue';
|
|
3
|
-
type __VLS_Slots = {
|
|
4
|
-
answeredQuestion: UserQuestionAnsweredCardSlots['answer'];
|
|
5
|
-
};
|
|
6
|
-
type __VLS_Props = Partial<InterruptMessage> & {
|
|
7
|
-
onInterruptResume?: OnInterruptResume;
|
|
8
|
-
};
|
|
9
|
-
declare const __VLS_base: 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>;
|
|
10
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
-
declare const _default: typeof __VLS_export;
|
|
12
|
-
export default _default;
|
|
13
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
-
new (): {
|
|
15
|
-
$slots: S;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AIDevToolApprovalInterrupt, OnInterruptResume } from '../../../ag-ui/types/interrupt';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
interrupt: AIDevToolApprovalInterrupt;
|
|
4
|
-
onInterruptResume?: OnInterruptResume;
|
|
5
|
-
};
|
|
6
|
-
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>;
|
|
7
|
-
declare const _default: typeof __VLS_export;
|
|
8
|
-
export default _default;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export * from './use-user-question';
|
|
2
|
-
export { default as UserQuestionAnsweredCard } from './user-question-answered-card.vue';
|
|
3
|
-
export { default as UserQuestionCard } from './user-question-card.vue';
|
|
4
|
-
export { default as UserQuestionChoice } from './user-question-choice.vue';
|
|
5
|
-
export { default as UserQuestionOption } from './user-question-option.vue';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { UserQuestionAnswerItem, UserQuestionInterrupt, UserQuestionItem, UserQuestionOptionItem, UserQuestionResume } from '../../../../ag-ui/types/interrupt';
|
|
2
|
-
/** label 为该值的选项代表「Others 自定义输入」 */
|
|
3
|
-
export declare const OTHERS_OPTION_LABEL = "others";
|
|
4
|
-
/** 选项序号字母:0 -> A、1 -> B …… 超过 26 时回退为数字 */
|
|
5
|
-
export declare const toLetter: (index: number) => string;
|
|
6
|
-
/** 归一化后的展示选项(含字母序号与 Others 标记),由选择题渲染组件内部使用 */
|
|
7
|
-
export type NormalizedUserQuestionOption = UserQuestionOptionItem & {
|
|
8
|
-
isOthers: boolean;
|
|
9
|
-
letter: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* 用户回答问题(human-in-the-loop)的答案聚合与 resume payload 构建。
|
|
13
|
-
*
|
|
14
|
-
* 设计目标:composable 只负责「收集每题答案 + 完成态计算 + payload 组装」,
|
|
15
|
-
* 对「回答形态」(单选/多选/表单/任意自定义)零感知;
|
|
16
|
-
* 各题如何作答与如何校验,全部下沉到对应的渲染组件(默认为选择题),
|
|
17
|
-
* 渲染组件作答有效时回传已组装的 {@link UserQuestionAnswerItem},无效时回传 undefined。
|
|
18
|
-
*
|
|
19
|
-
* @param getInterrupt 返回当前 UserQuestion 中断的 getter(响应式)
|
|
20
|
-
*/
|
|
21
|
-
export declare const useUserQuestion: (getInterrupt: () => undefined | UserQuestionInterrupt) => {
|
|
22
|
-
questions: import("vue").ComputedRef<UserQuestionItem[]>;
|
|
23
|
-
answeredCount: import("vue").ComputedRef<number>;
|
|
24
|
-
totalCount: import("vue").ComputedRef<number>;
|
|
25
|
-
completed: import("vue").ComputedRef<boolean>;
|
|
26
|
-
getAnswer: (questionIndex: number) => undefined | UserQuestionAnswerItem;
|
|
27
|
-
setAnswer: (questionIndex: number, answer: undefined | UserQuestionAnswerItem) => void;
|
|
28
|
-
buildResolvePayload: () => UserQuestionResume;
|
|
29
|
-
buildSkipPayload: () => UserQuestionResume;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* 自由文本 resume(用户在 chat-input 直接输入而非走结构化选择)。
|
|
33
|
-
* 多题场景下信息有损:统一作为单条 Others 自由文本回传。
|
|
34
|
-
*/
|
|
35
|
-
export declare const buildSkipResumePayload: (interrupt?: UserQuestionInterrupt) => UserQuestionResume;
|