@blueking/chat-x 0.0.51-beta.5 → 0.0.52-dev.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/README.md +15 -8
- package/dist/ag-ui/types/contents.d.ts +2 -0
- package/dist/ag-ui/types/messages.d.ts +6 -1
- package/dist/common/constants.d.ts +2 -0
- package/dist/components/ai-buttons/add-menu-btn/add-menu-btn.vue.d.ts +24 -0
- package/dist/components/chat-content/collapsible-content/collapsible-content.vue.d.ts +28 -0
- package/dist/components/chat-content/file-content/upload-file-item.vue.d.ts +5 -2
- package/dist/components/chat-content/file-content/upload-image-item.vue.d.ts +1 -0
- package/dist/components/chat-content/flow-agent-content/use-flow-node-actions.d.ts +1 -1
- package/dist/components/chat-input/ai-slash-input/ai-slash-input.vue.d.ts +21 -10
- package/dist/components/chat-input/ai-slash-input/command.d.ts +6 -3
- package/dist/components/chat-input/ai-slash-input/constants.d.ts +2 -0
- package/dist/components/chat-input/ai-slash-input/use-menu-trigger.d.ts +17 -0
- package/dist/components/chat-input/build-default-placeholder.d.ts +9 -3
- package/dist/components/chat-input/chat-input.vue.d.ts +30 -18
- package/dist/components/chat-input/input-menu/constants.d.ts +60 -0
- package/dist/components/chat-input/input-menu/index.d.ts +4 -0
- package/dist/components/chat-input/input-menu/input-menu-option.vue.d.ts +14 -0
- package/dist/components/chat-input/input-menu/input-menu-panel.vue.d.ts +17 -0
- package/dist/components/chat-input/input-menu/use-input-menu.d.ts +22 -0
- package/dist/components/chat-input/model-selector/types.d.ts +3 -2
- package/dist/components/chat-message/message-container/message-container.vue.d.ts +1 -1
- package/dist/components/chat-message/user-message/user-message.vue.d.ts +1 -1
- package/dist/components/mention/create-mention-tippy.d.ts +27 -0
- package/dist/components/mention/index.d.ts +4 -0
- package/dist/components/{chat-input/ai-slash-input/ai-prompt-list/ai-prompt-list.vue.d.ts → mention/mention-popover.vue.d.ts} +3 -2
- package/dist/components/{chat-input/ai-slash-input/ai-skill-list/ai-skill-list.vue.d.ts → mention/mention-tag.vue.d.ts} +7 -3
- package/dist/components/{chat-input/ai-slash-input/ai-slash-menu/ai-slash-menu.vue.d.ts → mention/mention-text.vue.d.ts} +3 -3
- package/dist/components/resource-icon/index.d.ts +1 -0
- package/dist/components/resource-icon/resource-icon.vue.d.ts +11 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/use-artifact-preview.d.ts +5 -2
- package/dist/composables/use-common.d.ts +0 -9
- package/dist/composables/use-global-config.d.ts +4 -0
- package/dist/composables/use-input-mention.d.ts +13 -0
- package/dist/composables/use-message-group.d.ts +1011 -72
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/input.d.ts +21 -0
- package/dist/icons/menu-item.d.ts +22 -0
- package/dist/index.css +1 -1
- package/dist/index.js +4953 -4429
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +13 -3
- package/dist/mcp/generated/docs/activity-message.md +3 -3
- package/dist/mcp/generated/docs/add-menu-btn.md +91 -0
- package/dist/mcp/generated/docs/ai-slash-input.md +72 -26
- package/dist/mcp/generated/docs/assistant-message.md +7 -1
- package/dist/mcp/generated/docs/chat-container.md +45 -6
- package/dist/mcp/generated/docs/chat-input.md +327 -483
- package/dist/mcp/generated/docs/collapsible-content.md +78 -0
- package/dist/mcp/generated/docs/constants.md +36 -3
- package/dist/mcp/generated/docs/execution-summary.md +1 -23
- package/dist/mcp/generated/docs/file-artifact-panel.md +24 -5
- package/dist/mcp/generated/docs/file-content.md +4 -0
- package/dist/mcp/generated/docs/file-upload-btn.md +15 -12
- package/dist/mcp/generated/docs/flow-agent-content.md +10 -12
- package/dist/mcp/generated/docs/input-menu-panel.md +166 -0
- package/dist/mcp/generated/docs/mention-tag.md +83 -0
- package/dist/mcp/generated/docs/mention-text.md +86 -0
- package/dist/mcp/generated/docs/message-container.md +1 -1
- package/dist/mcp/generated/docs/message-render.md +1 -1
- package/dist/mcp/generated/docs/message-tools.md +15 -4
- package/dist/mcp/generated/docs/messages.md +3 -0
- package/dist/mcp/generated/docs/model-selector.md +4 -2
- package/dist/mcp/generated/docs/overflow-tips.md +3 -3
- package/dist/mcp/generated/docs/resource-icon.md +102 -0
- package/dist/mcp/generated/docs/text-content.md +7 -3
- package/dist/mcp/generated/docs/theme.md +27 -35
- package/dist/mcp/generated/docs/use-artifact-preview.md +7 -3
- package/dist/mcp/generated/docs/use-command-selection.md +1 -1
- package/dist/mcp/generated/docs/use-container-scroll.md +2 -1
- package/dist/mcp/generated/docs/use-flow-node-actions.md +8 -15
- package/dist/mcp/generated/docs/use-global-config.md +11 -4
- package/dist/mcp/generated/docs/use-input-mention.md +119 -0
- package/dist/mcp/generated/docs/use-menu-keydown.md +15 -16
- package/dist/mcp/generated/docs/use-message-group.md +3 -6
- package/dist/mcp/generated/docs/user-message.md +39 -17
- package/dist/mcp/generated/index.json +233 -81
- package/dist/types/editor.d.ts +0 -29
- package/dist/types/index.d.ts +1 -0
- package/dist/types/input-menu.d.ts +46 -0
- package/dist/utils/artifact-tags.d.ts +36 -0
- package/dist/utils/collect-message-artifacts.d.ts +14 -0
- package/dist/utils/file.d.ts +3 -3
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/upload-file.d.ts +6 -1
- package/package.json +3 -2
- package/skills/blueking-chat-x/SKILL.md +143 -0
- package/skills/blueking-chat-x/references/_index.md +153 -0
- package/skills/blueking-chat-x/references/components/activity-layout.md +134 -0
- package/skills/blueking-chat-x/references/components/activity-message.md +486 -0
- package/skills/blueking-chat-x/references/components/add-menu-btn.md +88 -0
- package/skills/blueking-chat-x/references/components/ai-image.md +230 -0
- package/skills/blueking-chat-x/references/components/ai-loading.md +131 -0
- package/skills/blueking-chat-x/references/components/ai-selection.md +439 -0
- package/skills/blueking-chat-x/references/components/ai-slash-input.md +102 -0
- package/skills/blueking-chat-x/references/components/animation-text.md +202 -0
- package/skills/blueking-chat-x/references/components/assistant-message.md +504 -0
- package/skills/blueking-chat-x/references/components/chat-container.md +912 -0
- package/skills/blueking-chat-x/references/components/chat-input.md +614 -0
- package/skills/blueking-chat-x/references/components/cite-content.md +142 -0
- package/skills/blueking-chat-x/references/components/code-content.md +211 -0
- package/skills/blueking-chat-x/references/components/collapsible-content.md +76 -0
- package/skills/blueking-chat-x/references/components/common-error-content.md +73 -0
- package/skills/blueking-chat-x/references/components/content-render.md +233 -0
- package/skills/blueking-chat-x/references/components/delete-tool.md +191 -0
- package/skills/blueking-chat-x/references/components/desc-panel.md +162 -0
- package/skills/blueking-chat-x/references/components/detail-section.md +91 -0
- package/skills/blueking-chat-x/references/components/execution-summary.md +150 -0
- package/skills/blueking-chat-x/references/components/file-artifact-panel.md +307 -0
- package/skills/blueking-chat-x/references/components/file-content.md +340 -0
- package/skills/blueking-chat-x/references/components/file-icon.md +109 -0
- package/skills/blueking-chat-x/references/components/file-upload-btn.md +162 -0
- package/skills/blueking-chat-x/references/components/flow-agent-content.md +266 -0
- package/skills/blueking-chat-x/references/components/flow-agent-node-detail.md +236 -0
- package/skills/blueking-chat-x/references/components/highlight-keyword.md +146 -0
- package/skills/blueking-chat-x/references/components/image-content.md +182 -0
- package/skills/blueking-chat-x/references/components/image-preview-group.md +184 -0
- package/skills/blueking-chat-x/references/components/image-preview.md +226 -0
- package/skills/blueking-chat-x/references/components/info-message.md +144 -0
- package/skills/blueking-chat-x/references/components/input-attachment.md +49 -0
- package/skills/blueking-chat-x/references/components/input-info-alert.md +42 -0
- package/skills/blueking-chat-x/references/components/input-menu-panel.md +162 -0
- package/skills/blueking-chat-x/references/components/interrupt-message.md +212 -0
- package/skills/blueking-chat-x/references/components/key-value-content.md +128 -0
- package/skills/blueking-chat-x/references/components/knowledge-rag-content.md +122 -0
- package/skills/blueking-chat-x/references/components/latex-content.md +200 -0
- package/skills/blueking-chat-x/references/components/loading-message.md +192 -0
- package/skills/blueking-chat-x/references/components/markdown-content.md +232 -0
- package/skills/blueking-chat-x/references/components/mention-tag.md +79 -0
- package/skills/blueking-chat-x/references/components/mention-text.md +83 -0
- package/skills/blueking-chat-x/references/components/mermaid-content.md +189 -0
- package/skills/blueking-chat-x/references/components/message-container.md +645 -0
- package/skills/blueking-chat-x/references/components/message-loading.md +118 -0
- package/skills/blueking-chat-x/references/components/message-render.md +327 -0
- package/skills/blueking-chat-x/references/components/message-time.md +177 -0
- package/skills/blueking-chat-x/references/components/message-tools.md +427 -0
- package/skills/blueking-chat-x/references/components/model-selector.md +157 -0
- package/skills/blueking-chat-x/references/components/preview-toolbar.md +42 -0
- package/skills/blueking-chat-x/references/components/questions-container.md +85 -0
- package/skills/blueking-chat-x/references/components/reasoning-message.md +232 -0
- package/skills/blueking-chat-x/references/components/reference-content.md +135 -0
- package/skills/blueking-chat-x/references/components/reference-doc-content.md +109 -0
- package/skills/blueking-chat-x/references/components/resource-icon.md +98 -0
- package/skills/blueking-chat-x/references/components/scroll-btn.md +159 -0
- package/skills/blueking-chat-x/references/components/selection-footer.md +78 -0
- package/skills/blueking-chat-x/references/components/selection-question.md +88 -0
- package/skills/blueking-chat-x/references/components/shortcut-btn.md +204 -0
- package/skills/blueking-chat-x/references/components/shortcut-btns.md +266 -0
- package/skills/blueking-chat-x/references/components/shortcut-render.md +424 -0
- package/skills/blueking-chat-x/references/components/simple-table.md +101 -0
- package/skills/blueking-chat-x/references/components/text-content.md +80 -0
- package/skills/blueking-chat-x/references/components/tool-approval-card.md +183 -0
- package/skills/blueking-chat-x/references/components/tool-btn.md +317 -0
- package/skills/blueking-chat-x/references/components/tool-message.md +235 -0
- package/skills/blueking-chat-x/references/components/toolcall-render.md +348 -0
- package/skills/blueking-chat-x/references/components/user-feedback.md +233 -0
- package/skills/blueking-chat-x/references/components/user-message.md +444 -0
- package/skills/blueking-chat-x/references/components/user-question-answered-card.md +104 -0
- package/skills/blueking-chat-x/references/components/user-question-card.md +231 -0
- package/skills/blueking-chat-x/references/components/user-question-choice.md +105 -0
- package/skills/blueking-chat-x/references/components/user-question-option.md +42 -0
- package/skills/blueking-chat-x/references/components/vnode-renderer.md +122 -0
- package/skills/blueking-chat-x/references/composables/use-animation-text.md +196 -0
- package/skills/blueking-chat-x/references/composables/use-artifact-preview.md +235 -0
- package/skills/blueking-chat-x/references/composables/use-clipboard.md +203 -0
- package/skills/blueking-chat-x/references/composables/use-command-selection.md +150 -0
- package/skills/blueking-chat-x/references/composables/use-container-scroll.md +57 -0
- package/skills/blueking-chat-x/references/composables/use-custom-tab.md +158 -0
- package/skills/blueking-chat-x/references/composables/use-flow-node-actions.md +164 -0
- package/skills/blueking-chat-x/references/composables/use-full-screen.md +112 -0
- package/skills/blueking-chat-x/references/composables/use-global-config.md +155 -0
- package/skills/blueking-chat-x/references/composables/use-input-mention.md +115 -0
- package/skills/blueking-chat-x/references/composables/use-menu-keydown.md +161 -0
- package/skills/blueking-chat-x/references/composables/use-message-group.md +244 -0
- package/skills/blueking-chat-x/references/composables/use-observer-visible-list.md +188 -0
- package/skills/blueking-chat-x/references/composables/use-parent-scrolling.md +46 -0
- package/skills/blueking-chat-x/references/directives/index.md +61 -0
- package/skills/blueking-chat-x/references/directives/overflow-tips.md +205 -0
- package/skills/blueking-chat-x/references/icons/index.md +185 -0
- package/skills/blueking-chat-x/references/plugins/index.md +56 -0
- package/skills/blueking-chat-x/references/plugins/markdown-container.md +55 -0
- package/skills/blueking-chat-x/references/plugins/markdown-latex.md +205 -0
- package/skills/blueking-chat-x/references/plugins/markdown-mermaid.md +247 -0
- package/skills/blueking-chat-x/references/theme/theme.md +423 -0
- package/skills/blueking-chat-x/references/types/constants.md +340 -0
- package/skills/blueking-chat-x/references/types/index.md +120 -0
- package/skills/blueking-chat-x/references/types/interrupt.md +379 -0
- package/skills/blueking-chat-x/references/types/messages.md +556 -0
- package/skills/blueking-chat-x/references/types/schema.md +91 -0
- package/skills/blueking-chat-x/references/utils/index.md +196 -0
- package/skills/blueking-chat-x/scripts/generate-references.mjs +536 -0
- package/dist/components/chat-input/ai-slash-editor/ai-slash-editor.vue.d.ts +0 -28
- package/dist/components/chat-input/ai-slash-editor/theme.d.ts +0 -24
- package/dist/mcp/generated/docs/ai-prompt-list.md +0 -45
- package/dist/mcp/generated/docs/ai-skill-list.md +0 -75
- package/dist/mcp/generated/docs/ai-slash-editor.md +0 -43
- package/dist/mcp/generated/docs/ai-slash-menu.md +0 -42
package/README.md
CHANGED
|
@@ -49,9 +49,9 @@ yarn add @blueking/chat-x
|
|
|
49
49
|
<ChatContainer
|
|
50
50
|
:messages="messages"
|
|
51
51
|
:on-agent-action="handleAgentAction"
|
|
52
|
+
:menu-sources="menuSources"
|
|
52
53
|
:on-send-message="handleSendMessage"
|
|
53
54
|
:on-stop-sending="handleStopSending"
|
|
54
|
-
:prompts="prompts"
|
|
55
55
|
:shortcuts="shortcuts"
|
|
56
56
|
@update:model-value="val => (userInput = val)"
|
|
57
57
|
/>
|
|
@@ -64,6 +64,7 @@ yarn add @blueking/chat-x
|
|
|
64
64
|
ChatContainer,
|
|
65
65
|
MessageRole,
|
|
66
66
|
MessageStatus,
|
|
67
|
+
type IInputMenuItem,
|
|
67
68
|
type IToolBtn,
|
|
68
69
|
type Message,
|
|
69
70
|
type Shortcut,
|
|
@@ -73,7 +74,11 @@ yarn add @blueking/chat-x
|
|
|
73
74
|
|
|
74
75
|
const messages = deepRef<Message[]>([]);
|
|
75
76
|
const userInput = shallowRef<string | TagSchema>('');
|
|
76
|
-
|
|
77
|
+
// 输入框菜单统一数据源:按 type 分发到 "/"、"@"、"\" 与左下角 + 号
|
|
78
|
+
const menuSources = shallowRef<IInputMenuItem[]>([
|
|
79
|
+
{ id: 'prompt-code', name: '写代码', type: 'prompt', content: '帮我写一段代码' },
|
|
80
|
+
{ id: 'kb-ops', name: '运维知识库', type: 'knowledgebase' },
|
|
81
|
+
]);
|
|
77
82
|
const shortcuts = shallowRef<Shortcut[]>([
|
|
78
83
|
{ id: 'ask', name: '问问小鲸', description: '向 AI 助手提问' },
|
|
79
84
|
{ id: 'code-review', name: '代码审查', description: '让 AI 审查你的代码' },
|
|
@@ -366,8 +371,9 @@ import type {
|
|
|
366
371
|
InputContent,
|
|
367
372
|
UploadFile,
|
|
368
373
|
ImageItem,
|
|
369
|
-
|
|
370
|
-
|
|
374
|
+
IInputMenuItem,
|
|
375
|
+
MenuItemType,
|
|
376
|
+
MenuTrigger,
|
|
371
377
|
} from '@blueking/chat-x';
|
|
372
378
|
```
|
|
373
379
|
|
|
@@ -378,8 +384,8 @@ import {
|
|
|
378
384
|
MessageRole,
|
|
379
385
|
MessageStatus,
|
|
380
386
|
MessageContentType,
|
|
381
|
-
CONST_MESSAGE_TOOLS, // AI
|
|
382
|
-
CONST_USER_MESSAGE_TOOLS, //
|
|
387
|
+
CONST_MESSAGE_TOOLS, // AI 消息默认工具:复制、重新生成、分享
|
|
388
|
+
CONST_USER_MESSAGE_TOOLS, // 用户消息默认工具:复制、编辑、删除
|
|
383
389
|
CONST_UPDATE_TOOLS, // 更新工具:点赞、不满意、删除
|
|
384
390
|
} from '@blueking/chat-x';
|
|
385
391
|
```
|
|
@@ -406,8 +412,9 @@ ChatContainer ← 一站式对话布局
|
|
|
406
412
|
├── ShortcutBtns ← 快捷指令引导
|
|
407
413
|
├── ShortcutRender ← 快捷指令表单
|
|
408
414
|
├── ChatInput ← 输入区
|
|
409
|
-
│ ├──
|
|
410
|
-
│
|
|
415
|
+
│ ├── InputMenuPanel ← 统一菜单(/ @ \ 与 + 号共用)
|
|
416
|
+
│ ├── AiSlashInput ← 富文本编辑区(触发符识别 + 资源标签)
|
|
417
|
+
│ └── InputAttachment ← 底部工具栏(+ 号 / 快捷指令 / 模型 / 发送)
|
|
411
418
|
└── SelectionFooter ← 多选操作栏
|
|
412
419
|
```
|
|
413
420
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OldShortcut, Shortcut } from '../../types';
|
|
1
|
+
import type { OldShortcut, Shortcut, TagSchema } from '../../types';
|
|
2
2
|
import type { MessageContentType, MessageRole, MessageStatus } from './constants';
|
|
3
3
|
import type { ContentMap, InputContent } from './contents';
|
|
4
4
|
import type { AIFileInfo } from './file';
|
|
@@ -25,6 +25,11 @@ export interface BaseMessage<T extends MessageType, C = string> {
|
|
|
25
25
|
uid?: string;
|
|
26
26
|
property?: {
|
|
27
27
|
artifacts?: AIFileInfo[];
|
|
28
|
+
/**
|
|
29
|
+
* 发送时输入框的富文本文档。content 仍是纯文本(不改后端契约),
|
|
30
|
+
* 有这份文档时用户消息会把 @ 选中的资源原样还原成标签,编辑回填也不会丢标签。
|
|
31
|
+
*/
|
|
32
|
+
docSchema?: TagSchema;
|
|
28
33
|
extra?: {
|
|
29
34
|
cite: {
|
|
30
35
|
data: {
|
|
@@ -23,6 +23,8 @@ export declare const SELECTION_Z_INDEX: number;
|
|
|
23
23
|
* 消息工具
|
|
24
24
|
*/
|
|
25
25
|
export declare const CONST_MESSAGE_TOOLS: IToolBtn[];
|
|
26
|
+
/** 设计稿标注:用户消息正文最高显示 200px,超出后折叠并展示「显示更多」 */
|
|
27
|
+
export declare const CONST_USER_MESSAGE_MAX_HEIGHT = 200;
|
|
26
28
|
export declare const CONST_USER_MESSAGE_TOOLS: IToolBtn[];
|
|
27
29
|
/**
|
|
28
30
|
* 更新工具
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AITippyProps } from '../../../types';
|
|
2
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
|
+
export type AddMenuBtnProps = {
|
|
4
|
+
/** 聚合菜单是否处于展开态 */
|
|
5
|
+
active?: boolean;
|
|
6
|
+
tippyOptions?: AITippyProps;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<AddMenuBtnProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
+
toggle: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<AddMenuBtnProps> & Readonly<{
|
|
15
|
+
onToggle?: (() => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 折叠态下内容区的最大高度,超出才出现展开按钮 */
|
|
3
|
+
maxHeight?: number;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_ModelProps = {
|
|
6
|
+
/** 展开态可由外部控制,便于「全部展开」这类批量操作 */
|
|
7
|
+
'expanded'?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare var __VLS_1: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:expanded": (value: boolean) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:expanded"?: ((value: boolean) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
maxHeight: number;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -2,11 +2,14 @@ import type { UploadFile } from '../../../types';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
file: Partial<UploadFile>;
|
|
4
4
|
readonly?: boolean;
|
|
5
|
+
previewable?: boolean;
|
|
5
6
|
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
delete: () =>
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
delete: () => void;
|
|
9
|
+
preview: () => void;
|
|
8
10
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
11
|
onDelete?: (() => any) | undefined;
|
|
12
|
+
onPreview?: (() => any) | undefined;
|
|
10
13
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
14
|
declare const _default: typeof __VLS_export;
|
|
12
15
|
export default _default;
|
|
@@ -30,7 +30,7 @@ export interface FlowNodeActionVM {
|
|
|
30
30
|
* 操作列表,组件层只需遍历渲染,显隐与点击行为均收敛于此,便于复用、单测与扩展。
|
|
31
31
|
*/
|
|
32
32
|
export declare const useFlowNodeActions: (options: {
|
|
33
|
-
/** 隐藏重试 / 跳过等交互式 resume
|
|
33
|
+
/** 隐藏重试 / 跳过等交互式 resume 操作(分享态只读,仅保留「详情」查看入口) */
|
|
34
34
|
hideResumeActions?: Ref<boolean>;
|
|
35
35
|
/** resume 回调(与第三方审批取消同一回调,按 payload.operation 分流) */
|
|
36
36
|
onInterruptResume: Ref<OnInterruptResume | undefined>;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { type KeyboardPayload } from '../../../edix';
|
|
2
|
-
import type { IAiSlashMenuItem, ISkillListItem } from '../../../types/editor';
|
|
3
2
|
import type { TagSchema } from '../../../types/input';
|
|
4
|
-
import '
|
|
3
|
+
import type { IInputMenuItem, MenuTrigger } from '../../../types/input-menu';
|
|
5
4
|
type __VLS_Props = {
|
|
6
5
|
modelValue: string | TagSchema;
|
|
7
6
|
placeholder?: string;
|
|
8
|
-
prompts?: string[];
|
|
9
|
-
resources?: IAiSlashMenuItem[];
|
|
10
|
-
skills?: ISkillListItem[];
|
|
11
7
|
};
|
|
12
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
9
|
+
appendMention: (item: IInputMenuItem) => void;
|
|
13
10
|
cleanup: () => void;
|
|
11
|
+
closeMenu: () => void;
|
|
12
|
+
consumeTriggerText: () => [number, number];
|
|
14
13
|
focus: () => void;
|
|
14
|
+
insertMenuItem: (item: IInputMenuItem) => void;
|
|
15
|
+
openPlusMenu: () => void;
|
|
16
|
+
replaceAll: (value: string) => void;
|
|
15
17
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
16
18
|
keydown: (event: KeyboardEvent & KeyboardPayload) => any;
|
|
17
19
|
"update:modelValue": (value: ({
|
|
@@ -22,10 +24,16 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
22
24
|
readonly label: string;
|
|
23
25
|
readonly value: string;
|
|
24
26
|
readonly type: string;
|
|
27
|
+
readonly icon: string;
|
|
28
|
+
readonly description: string;
|
|
25
29
|
};
|
|
26
30
|
type: "tag";
|
|
27
|
-
})[][]
|
|
31
|
+
})[][]) => any;
|
|
28
32
|
upload: (files: File[]) => any;
|
|
33
|
+
menuChange: (payload: {
|
|
34
|
+
keyword: string;
|
|
35
|
+
trigger: MenuTrigger | null;
|
|
36
|
+
}) => any;
|
|
29
37
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
38
|
onKeydown?: ((event: KeyboardEvent & KeyboardPayload) => any) | undefined;
|
|
31
39
|
"onUpdate:modelValue"?: ((value: ({
|
|
@@ -36,15 +44,18 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
36
44
|
readonly label: string;
|
|
37
45
|
readonly value: string;
|
|
38
46
|
readonly type: string;
|
|
47
|
+
readonly icon: string;
|
|
48
|
+
readonly description: string;
|
|
39
49
|
};
|
|
40
50
|
type: "tag";
|
|
41
|
-
})[][]
|
|
51
|
+
})[][]) => any) | undefined;
|
|
42
52
|
onUpload?: ((files: File[]) => any) | undefined;
|
|
53
|
+
onMenuChange?: ((payload: {
|
|
54
|
+
keyword: string;
|
|
55
|
+
trigger: MenuTrigger | null;
|
|
56
|
+
}) => any) | undefined;
|
|
43
57
|
}>, {
|
|
44
58
|
placeholder: string;
|
|
45
|
-
prompts: string[];
|
|
46
|
-
skills: ISkillListItem[];
|
|
47
|
-
resources: IAiSlashMenuItem[];
|
|
48
59
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
60
|
declare const _default: typeof __VLS_export;
|
|
50
61
|
export default _default;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { EditorCommand } from '../../../edix';
|
|
2
2
|
import type { Position } from '../../../edix/doc/types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IInputMenuItem } from '../../../types/input-menu';
|
|
4
4
|
export declare const DeleteTag: EditorCommand<[Position, Position]>;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* 插入菜单选项对应的 void 标签节点。
|
|
7
|
+
* value 取 item.id:序列化给后端时 skill 走 `/${value}`,因此业务方需保证 skill 的 id 为后端可识别的编码。
|
|
8
|
+
*/
|
|
9
|
+
export declare const InsertMenuTag: EditorCommand<[Position, IInputMenuItem]>;
|
|
6
10
|
export declare const InsertText: EditorCommand<[Position, string]>;
|
|
7
|
-
export declare const InsertSkillTag: EditorCommand<[Position, ISkillListItem]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MenuTrigger } from '../../../types/input-menu';
|
|
2
|
+
/**
|
|
3
|
+
* 输入框菜单的触发状态机。
|
|
4
|
+
*
|
|
5
|
+
* 字符触发(`@` `/` `\`)的过滤词是「触发符到光标」之间的文本,选中后连触发符一起被替换;
|
|
6
|
+
* `plus` 触发没有触发符,过滤词是「唤起时的光标位置到当前光标」之间的文本,选中后只替换这段文本。
|
|
7
|
+
* 两者统一暴露为 `keyword` + `consumeLength`,上层插入逻辑只有一条代码路径。
|
|
8
|
+
*/
|
|
9
|
+
export declare const useMenuTrigger: () => {
|
|
10
|
+
trigger: import("vue").ShallowRef<MenuTrigger | null, MenuTrigger | null>;
|
|
11
|
+
keyword: import("vue").ShallowRef<string, string>;
|
|
12
|
+
activateChar: (char: Exclude<MenuTrigger, "plus">) => void;
|
|
13
|
+
activatePlus: () => void;
|
|
14
|
+
close: () => void;
|
|
15
|
+
sync: () => void;
|
|
16
|
+
getConsumeLength: () => number;
|
|
17
|
+
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export interface BuildDefaultPlaceholderOptions {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/** 是否有 `@` 可唤出的资源(知识库、会话产物) */
|
|
3
|
+
hasAtMenu: boolean;
|
|
4
|
+
/** 是否有 `\` 可唤出的 Prompt */
|
|
5
|
+
hasPromptMenu: boolean;
|
|
6
|
+
/** 是否有 `/` 可唤出的能力(Skill、工具、MCP) */
|
|
7
|
+
hasSlashMenu: boolean;
|
|
5
8
|
isEn: boolean;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* 设计稿标注:智能体没有对应的资源或配置时,不显示对应的提示文案。
|
|
12
|
+
*/
|
|
7
13
|
export declare function buildDefaultPlaceholder(options: BuildDefaultPlaceholderOptions): string;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { type Interrupt, type InterruptResume, type UserMessage, MessageContentType, MessageStatus } from '../../ag-ui/types';
|
|
2
|
-
import { type AITippyProps, type
|
|
2
|
+
import { type AITippyProps, type IInputMenuItem, type Shortcut, type TagSchema, type UploadFile, UploadStatus } from '../../types';
|
|
3
|
+
import type { AIFileInfo } from '../../ag-ui/types/file';
|
|
3
4
|
import type { IModelOption } from './model-selector';
|
|
4
5
|
export type ChatInputEmits = {
|
|
5
6
|
(e: 'selectShortcut', shortcut: Shortcut): void;
|
|
6
7
|
(e: 'deleteShortcut'): void;
|
|
7
|
-
(e: '
|
|
8
|
+
(e: 'deleteFile', file: Partial<UploadFile>): void;
|
|
9
|
+
(e: 'update:modelValue', value: string | TagSchema, selectedResourceList: IInputMenuItem[]): void;
|
|
8
10
|
(e: 'modelChange', model: IModelOption): void;
|
|
9
11
|
};
|
|
10
12
|
export type ChatInputProps = {
|
|
11
13
|
accept?: string;
|
|
12
14
|
defaultUploadFiles?: UploadFile[];
|
|
13
15
|
inputMaxHeight?: number;
|
|
16
|
+
/** 菜单每个分组默认展示的条数,超出折叠为「更多 +N」 */
|
|
17
|
+
menuGroupItemLimit?: number;
|
|
18
|
+
/** 统一的菜单数据源:`@` `/` `\` 与左下角 + 号共用,按 type 分发到不同触发方式 */
|
|
19
|
+
menuSources?: IInputMenuItem[];
|
|
14
20
|
messageStatus?: MessageStatus;
|
|
15
21
|
models?: IModelOption[];
|
|
16
22
|
modelValue: string | TagSchema;
|
|
@@ -21,12 +27,9 @@ export type ChatInputProps = {
|
|
|
21
27
|
onStopSending?: () => Promise<void>;
|
|
22
28
|
onUpload?: (files: File[]) => Promise<ChatInputUploadResult | ChatInputUploadResult[]>;
|
|
23
29
|
placeholder?: string;
|
|
24
|
-
prompts?: string[];
|
|
25
|
-
resources?: IAiSlashMenuItem[];
|
|
26
30
|
sendDisabledTip?: string;
|
|
27
31
|
shortcutId?: string;
|
|
28
32
|
shortcuts?: Shortcut[];
|
|
29
|
-
skills?: ISkillListItem[];
|
|
30
33
|
supportUpload?: boolean;
|
|
31
34
|
tippyOptions?: AITippyProps;
|
|
32
35
|
};
|
|
@@ -34,6 +37,7 @@ export type ChatInputUploadResult = {
|
|
|
34
37
|
download_url?: string;
|
|
35
38
|
error?: string;
|
|
36
39
|
id?: string;
|
|
40
|
+
path?: string;
|
|
37
41
|
status?: 'failed' | 'success';
|
|
38
42
|
};
|
|
39
43
|
type __VLS_Props = ChatInputProps;
|
|
@@ -42,12 +46,13 @@ type __VLS_ModelProps = {
|
|
|
42
46
|
'selectedModel'?: string;
|
|
43
47
|
};
|
|
44
48
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
45
|
-
declare var __VLS_1: {}, __VLS_3: {},
|
|
49
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_14: {}, __VLS_23: {
|
|
46
50
|
files: {
|
|
47
51
|
data?: string | undefined;
|
|
48
52
|
filename?: string | undefined;
|
|
49
53
|
id?: string | undefined;
|
|
50
54
|
mimeType?: string | undefined;
|
|
55
|
+
outputId?: string | undefined;
|
|
51
56
|
size?: number | undefined;
|
|
52
57
|
type?: MessageContentType.Binary | undefined;
|
|
53
58
|
url?: string | undefined;
|
|
@@ -65,28 +70,30 @@ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_14: {
|
|
|
65
70
|
} | undefined;
|
|
66
71
|
status?: UploadStatus | undefined;
|
|
67
72
|
}[];
|
|
68
|
-
},
|
|
73
|
+
}, __VLS_61: {}, __VLS_85: {
|
|
69
74
|
models: IModelOption[] | undefined;
|
|
70
75
|
selectedModel: string | undefined;
|
|
71
|
-
},
|
|
76
|
+
}, __VLS_95: {};
|
|
72
77
|
type __VLS_Slots = {} & {
|
|
73
78
|
top?: (props: typeof __VLS_1) => any;
|
|
74
79
|
} & {
|
|
75
80
|
interrupt?: (props: typeof __VLS_3) => any;
|
|
76
81
|
} & {
|
|
77
|
-
'input-header'?: (props: typeof
|
|
82
|
+
'input-header'?: (props: typeof __VLS_14) => any;
|
|
78
83
|
} & {
|
|
79
|
-
files?: (props: typeof
|
|
84
|
+
files?: (props: typeof __VLS_23) => any;
|
|
80
85
|
} & {
|
|
81
|
-
attachment?: (props: typeof
|
|
86
|
+
attachment?: (props: typeof __VLS_61) => any;
|
|
82
87
|
} & {
|
|
83
|
-
'model-selector'?: (props: typeof
|
|
88
|
+
'model-selector'?: (props: typeof __VLS_85) => any;
|
|
84
89
|
} & {
|
|
85
|
-
'send-icon'?: (props: typeof
|
|
90
|
+
'send-icon'?: (props: typeof __VLS_95) => any;
|
|
86
91
|
};
|
|
87
92
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
88
93
|
focus: () => void;
|
|
94
|
+
insertMention: (item: IInputMenuItem) => void;
|
|
89
95
|
triggerSendMessage: () => Promise<void>;
|
|
96
|
+
uploadedArtifacts: import("vue").ComputedRef<AIFileInfo[]>;
|
|
90
97
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
91
98
|
"update:cite": (value: string) => any;
|
|
92
99
|
"update:selectedModel": (value: string | undefined) => any;
|
|
@@ -99,10 +106,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
99
106
|
readonly label: string;
|
|
100
107
|
readonly value: string;
|
|
101
108
|
readonly type: string;
|
|
109
|
+
readonly icon: string;
|
|
110
|
+
readonly description: string;
|
|
102
111
|
};
|
|
103
112
|
type: "tag";
|
|
104
|
-
})[][], selectedResourceList:
|
|
113
|
+
})[][], selectedResourceList: IInputMenuItem[]) => any;
|
|
105
114
|
selectShortcut: (shortcut: Shortcut) => any;
|
|
115
|
+
deleteFile: (file: Partial<UploadFile>) => any;
|
|
106
116
|
deleteShortcut: () => any;
|
|
107
117
|
modelChange: (model: IModelOption) => any;
|
|
108
118
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
@@ -114,20 +124,22 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
114
124
|
readonly label: string;
|
|
115
125
|
readonly value: string;
|
|
116
126
|
readonly type: string;
|
|
127
|
+
readonly icon: string;
|
|
128
|
+
readonly description: string;
|
|
117
129
|
};
|
|
118
130
|
type: "tag";
|
|
119
|
-
})[][], selectedResourceList:
|
|
131
|
+
})[][], selectedResourceList: IInputMenuItem[]) => any) | undefined;
|
|
120
132
|
onSelectShortcut?: ((shortcut: Shortcut) => any) | undefined;
|
|
133
|
+
onDeleteFile?: ((file: Partial<UploadFile>) => any) | undefined;
|
|
121
134
|
onDeleteShortcut?: (() => any) | undefined;
|
|
122
135
|
onModelChange?: ((model: IModelOption) => any) | undefined;
|
|
123
136
|
"onUpdate:cite"?: ((value: string) => any) | undefined;
|
|
124
137
|
"onUpdate:selectedModel"?: ((value: string | undefined) => any) | undefined;
|
|
125
138
|
}>, {
|
|
126
139
|
accept: string;
|
|
127
|
-
prompts: string[];
|
|
128
|
-
skills: ISkillListItem[];
|
|
129
|
-
resources: IAiSlashMenuItem[];
|
|
130
140
|
inputMaxHeight: number;
|
|
141
|
+
menuGroupItemLimit: number;
|
|
142
|
+
menuSources: IInputMenuItem[];
|
|
131
143
|
supportUpload: boolean;
|
|
132
144
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
133
145
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { lang } from '../../../lang/lang';
|
|
2
|
+
import type { MenuItemType, MenuTrigger } from '../../../types/input-menu';
|
|
3
|
+
/** 分组的静态定义:一个分组可聚合多个语义相近的 type */
|
|
4
|
+
export interface IMenuGroupDef {
|
|
5
|
+
key: string;
|
|
6
|
+
/** 文案 key,渲染时经 t() 转换 */
|
|
7
|
+
name: keyof typeof lang;
|
|
8
|
+
types: MenuItemType[];
|
|
9
|
+
}
|
|
10
|
+
export declare const MENU_GROUP_DEFS: {
|
|
11
|
+
add: {
|
|
12
|
+
key: string;
|
|
13
|
+
name: "添加";
|
|
14
|
+
types: "file"[];
|
|
15
|
+
};
|
|
16
|
+
skill: {
|
|
17
|
+
key: string;
|
|
18
|
+
name: "Skill";
|
|
19
|
+
types: "skill"[];
|
|
20
|
+
};
|
|
21
|
+
mcp: {
|
|
22
|
+
key: string;
|
|
23
|
+
name: "MCP";
|
|
24
|
+
types: "mcp"[];
|
|
25
|
+
};
|
|
26
|
+
tool: {
|
|
27
|
+
key: string;
|
|
28
|
+
name: "工具";
|
|
29
|
+
types: "tool"[];
|
|
30
|
+
};
|
|
31
|
+
knowledgebase: {
|
|
32
|
+
key: string;
|
|
33
|
+
name: "知识库";
|
|
34
|
+
types: ("doc" | "knowledgebase")[];
|
|
35
|
+
};
|
|
36
|
+
artifact: {
|
|
37
|
+
key: string;
|
|
38
|
+
name: "会话产物";
|
|
39
|
+
types: "artifact"[];
|
|
40
|
+
};
|
|
41
|
+
prompt: {
|
|
42
|
+
key: string;
|
|
43
|
+
name: "Prompt";
|
|
44
|
+
types: "prompt"[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export type MenuGroupKey = keyof typeof MENU_GROUP_DEFS;
|
|
48
|
+
/** 触发方式 → 分组渲染顺序 */
|
|
49
|
+
export declare const TRIGGER_GROUP_KEYS: Record<MenuTrigger, MenuGroupKey[]>;
|
|
50
|
+
/** 需要在下方画分隔线的分组(设计稿:+ 菜单「添加」组与其余资源之间有分隔线) */
|
|
51
|
+
export declare const DIVIDED_GROUP_KEYS: MenuGroupKey[];
|
|
52
|
+
/** 分组默认最多展示的条数,超出折叠为「更多 +N」 */
|
|
53
|
+
export declare const DEFAULT_GROUP_ITEM_LIMIT = 4;
|
|
54
|
+
/** 字符触发符与菜单的对应关系 */
|
|
55
|
+
export declare const CHAR_TRIGGERS: readonly ["@", "/", "\\"];
|
|
56
|
+
/**
|
|
57
|
+
* 取类型的展示名(文案 key,渲染时经 t() 转换)。
|
|
58
|
+
* 菜单分组标题与标签气泡标题共用,保证两处文案永远一致。
|
|
59
|
+
*/
|
|
60
|
+
export declare const getMenuTypeLabel: (type: string) => "" | keyof typeof lang;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CHAR_TRIGGERS, DEFAULT_GROUP_ITEM_LIMIT, MENU_GROUP_DEFS, TRIGGER_GROUP_KEYS } from './constants';
|
|
2
|
+
export type { MenuGroupKey } from './constants';
|
|
3
|
+
export { default as InputMenuPanel } from './input-menu-panel.vue';
|
|
4
|
+
export { useInputMenu } from './use-input-menu';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IInputMenuItem } from '../../../types/input-menu';
|
|
2
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 键盘导航选中态 */
|
|
5
|
+
active?: boolean;
|
|
6
|
+
item: IInputMenuItem;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
+
select: (item: IInputMenuItem) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onSelect?: ((item: IInputMenuItem) => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IInputMenuGroup, IInputMenuItem } from '../../../types/input-menu';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 当前可见且可选中的条目,顺序与面板一致 */
|
|
4
|
+
flatItems: IInputMenuItem[];
|
|
5
|
+
groups: IInputMenuGroup[];
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
8
|
+
select: (item: IInputMenuItem) => any;
|
|
9
|
+
close: () => any;
|
|
10
|
+
toggleGroup: (key: string) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onSelect?: ((item: IInputMenuItem) => any) | undefined;
|
|
13
|
+
onClose?: (() => any) | undefined;
|
|
14
|
+
onToggleGroup?: ((key: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { IInputMenuGroup, IInputMenuItem, MenuTrigger } from '../../../types/input-menu';
|
|
3
|
+
import type { MenuGroupKey } from './constants';
|
|
4
|
+
/**
|
|
5
|
+
* 输入框菜单的纯数据逻辑(与 UI 解耦,可独立单测):
|
|
6
|
+
* 按触发方式筛选类型 → 按关键字过滤 → 分组 → 应用折叠阈值 → 扁平化供键盘导航。
|
|
7
|
+
*/
|
|
8
|
+
export declare const useInputMenu: (params: {
|
|
9
|
+
/** 每个分组默认展示的条数上限 */
|
|
10
|
+
groupItemLimit: ComputedRef<number> | Ref<number>;
|
|
11
|
+
/** 过滤关键字(触发符之后用户输入的文本) */
|
|
12
|
+
keyword: ComputedRef<string> | Ref<string>;
|
|
13
|
+
/** 全部可选项 */
|
|
14
|
+
sources: ComputedRef<IInputMenuItem[]> | Ref<IInputMenuItem[]>;
|
|
15
|
+
/** 当前触发方式,为 null 表示菜单未激活 */
|
|
16
|
+
trigger: ComputedRef<MenuTrigger | null> | Ref<MenuTrigger | null>;
|
|
17
|
+
}) => {
|
|
18
|
+
groups: ComputedRef<IInputMenuGroup[]>;
|
|
19
|
+
flatItems: ComputedRef<IInputMenuItem[]>;
|
|
20
|
+
hasContent: ComputedRef<boolean>;
|
|
21
|
+
toggleGroup: (key: MenuGroupKey) => void;
|
|
22
|
+
};
|
|
@@ -6,6 +6,7 @@ export interface IModelCapability {
|
|
|
6
6
|
theme?: ModelCapabilityTheme;
|
|
7
7
|
}
|
|
8
8
|
/** 模型选项(贴合后端模型接口结构) */
|
|
9
|
+
import type { Component } from 'vue';
|
|
9
10
|
export interface IModelOption {
|
|
10
11
|
/** 基础模型标识,如 deepseek */
|
|
11
12
|
base_model?: string;
|
|
@@ -13,8 +14,8 @@ export interface IModelOption {
|
|
|
13
14
|
description?: string;
|
|
14
15
|
/** 是否禁用(前端扩展字段,后端无此字段时默认不禁用) */
|
|
15
16
|
disabled?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
icon?: string;
|
|
17
|
+
/** 模型图标:URL 字符串或 Vue 组件 */
|
|
18
|
+
icon?: Component | string;
|
|
18
19
|
/** 模型主键 id */
|
|
19
20
|
id: number;
|
|
20
21
|
/** 模型编码 */
|
|
@@ -22,8 +22,8 @@ export type MessageContainerProps = {
|
|
|
22
22
|
onInterruptResume?: OnInterruptResume;
|
|
23
23
|
onUserAction?: UserActionCallback;
|
|
24
24
|
renderMode?: RenderMode;
|
|
25
|
-
userMessageTools?: IToolBtn[];
|
|
26
25
|
updateTools?: IToolBtn[];
|
|
26
|
+
userMessageTools?: IToolBtn[];
|
|
27
27
|
} & {
|
|
28
28
|
onUserInputConfirm?: (message: Message, content: UserMessage['content'], docSchema: TagSchema) => Promise<void>;
|
|
29
29
|
onUserShortcutConfirm?: (message: Message, formModel: Record<string, unknown>) => Promise<void>;
|
|
@@ -12,8 +12,8 @@ interface UserMessageProps extends UserMessageActionsProps {
|
|
|
12
12
|
createdAt?: UserMessage['createdAt'];
|
|
13
13
|
id?: UserMessage['id'];
|
|
14
14
|
messageId?: UserMessage['messageId'];
|
|
15
|
-
name?: UserMessage['name'];
|
|
16
15
|
messageTools?: IToolBtn[];
|
|
16
|
+
name?: UserMessage['name'];
|
|
17
17
|
onAction?: MessageToolsProps['onAction'];
|
|
18
18
|
property?: UserMessage['property'];
|
|
19
19
|
role?: UserMessage['role'];
|