@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.
Files changed (198) hide show
  1. package/README.md +15 -8
  2. package/dist/ag-ui/types/contents.d.ts +2 -0
  3. package/dist/ag-ui/types/messages.d.ts +6 -1
  4. package/dist/common/constants.d.ts +2 -0
  5. package/dist/components/ai-buttons/add-menu-btn/add-menu-btn.vue.d.ts +24 -0
  6. package/dist/components/chat-content/collapsible-content/collapsible-content.vue.d.ts +28 -0
  7. package/dist/components/chat-content/file-content/upload-file-item.vue.d.ts +5 -2
  8. package/dist/components/chat-content/file-content/upload-image-item.vue.d.ts +1 -0
  9. package/dist/components/chat-content/flow-agent-content/use-flow-node-actions.d.ts +1 -1
  10. package/dist/components/chat-input/ai-slash-input/ai-slash-input.vue.d.ts +21 -10
  11. package/dist/components/chat-input/ai-slash-input/command.d.ts +6 -3
  12. package/dist/components/chat-input/ai-slash-input/constants.d.ts +2 -0
  13. package/dist/components/chat-input/ai-slash-input/use-menu-trigger.d.ts +17 -0
  14. package/dist/components/chat-input/build-default-placeholder.d.ts +9 -3
  15. package/dist/components/chat-input/chat-input.vue.d.ts +30 -18
  16. package/dist/components/chat-input/input-menu/constants.d.ts +60 -0
  17. package/dist/components/chat-input/input-menu/index.d.ts +4 -0
  18. package/dist/components/chat-input/input-menu/input-menu-option.vue.d.ts +14 -0
  19. package/dist/components/chat-input/input-menu/input-menu-panel.vue.d.ts +17 -0
  20. package/dist/components/chat-input/input-menu/use-input-menu.d.ts +22 -0
  21. package/dist/components/chat-input/model-selector/types.d.ts +3 -2
  22. package/dist/components/chat-message/message-container/message-container.vue.d.ts +1 -1
  23. package/dist/components/chat-message/user-message/user-message.vue.d.ts +1 -1
  24. package/dist/components/mention/create-mention-tippy.d.ts +27 -0
  25. package/dist/components/mention/index.d.ts +4 -0
  26. 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
  27. 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
  28. 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
  29. package/dist/components/resource-icon/index.d.ts +1 -0
  30. package/dist/components/resource-icon/resource-icon.vue.d.ts +11 -0
  31. package/dist/composables/index.d.ts +1 -0
  32. package/dist/composables/use-artifact-preview.d.ts +5 -2
  33. package/dist/composables/use-common.d.ts +0 -9
  34. package/dist/composables/use-global-config.d.ts +4 -0
  35. package/dist/composables/use-input-mention.d.ts +13 -0
  36. package/dist/composables/use-message-group.d.ts +1011 -72
  37. package/dist/icons/index.d.ts +1 -0
  38. package/dist/icons/input.d.ts +21 -0
  39. package/dist/icons/menu-item.d.ts +22 -0
  40. package/dist/index.css +1 -1
  41. package/dist/index.js +4953 -4429
  42. package/dist/index.js.map +1 -1
  43. package/dist/lang/lang.d.ts +13 -3
  44. package/dist/mcp/generated/docs/activity-message.md +3 -3
  45. package/dist/mcp/generated/docs/add-menu-btn.md +91 -0
  46. package/dist/mcp/generated/docs/ai-slash-input.md +72 -26
  47. package/dist/mcp/generated/docs/assistant-message.md +7 -1
  48. package/dist/mcp/generated/docs/chat-container.md +45 -6
  49. package/dist/mcp/generated/docs/chat-input.md +327 -483
  50. package/dist/mcp/generated/docs/collapsible-content.md +78 -0
  51. package/dist/mcp/generated/docs/constants.md +36 -3
  52. package/dist/mcp/generated/docs/execution-summary.md +1 -23
  53. package/dist/mcp/generated/docs/file-artifact-panel.md +24 -5
  54. package/dist/mcp/generated/docs/file-content.md +4 -0
  55. package/dist/mcp/generated/docs/file-upload-btn.md +15 -12
  56. package/dist/mcp/generated/docs/flow-agent-content.md +10 -12
  57. package/dist/mcp/generated/docs/input-menu-panel.md +166 -0
  58. package/dist/mcp/generated/docs/mention-tag.md +83 -0
  59. package/dist/mcp/generated/docs/mention-text.md +86 -0
  60. package/dist/mcp/generated/docs/message-container.md +1 -1
  61. package/dist/mcp/generated/docs/message-render.md +1 -1
  62. package/dist/mcp/generated/docs/message-tools.md +15 -4
  63. package/dist/mcp/generated/docs/messages.md +3 -0
  64. package/dist/mcp/generated/docs/model-selector.md +4 -2
  65. package/dist/mcp/generated/docs/overflow-tips.md +3 -3
  66. package/dist/mcp/generated/docs/resource-icon.md +102 -0
  67. package/dist/mcp/generated/docs/text-content.md +7 -3
  68. package/dist/mcp/generated/docs/theme.md +27 -35
  69. package/dist/mcp/generated/docs/use-artifact-preview.md +7 -3
  70. package/dist/mcp/generated/docs/use-command-selection.md +1 -1
  71. package/dist/mcp/generated/docs/use-container-scroll.md +2 -1
  72. package/dist/mcp/generated/docs/use-flow-node-actions.md +8 -15
  73. package/dist/mcp/generated/docs/use-global-config.md +11 -4
  74. package/dist/mcp/generated/docs/use-input-mention.md +119 -0
  75. package/dist/mcp/generated/docs/use-menu-keydown.md +15 -16
  76. package/dist/mcp/generated/docs/use-message-group.md +3 -6
  77. package/dist/mcp/generated/docs/user-message.md +39 -17
  78. package/dist/mcp/generated/index.json +233 -81
  79. package/dist/types/editor.d.ts +0 -29
  80. package/dist/types/index.d.ts +1 -0
  81. package/dist/types/input-menu.d.ts +46 -0
  82. package/dist/utils/artifact-tags.d.ts +36 -0
  83. package/dist/utils/collect-message-artifacts.d.ts +14 -0
  84. package/dist/utils/file.d.ts +3 -3
  85. package/dist/utils/index.d.ts +2 -1
  86. package/dist/utils/upload-file.d.ts +6 -1
  87. package/package.json +3 -2
  88. package/skills/blueking-chat-x/SKILL.md +143 -0
  89. package/skills/blueking-chat-x/references/_index.md +153 -0
  90. package/skills/blueking-chat-x/references/components/activity-layout.md +134 -0
  91. package/skills/blueking-chat-x/references/components/activity-message.md +486 -0
  92. package/skills/blueking-chat-x/references/components/add-menu-btn.md +88 -0
  93. package/skills/blueking-chat-x/references/components/ai-image.md +230 -0
  94. package/skills/blueking-chat-x/references/components/ai-loading.md +131 -0
  95. package/skills/blueking-chat-x/references/components/ai-selection.md +439 -0
  96. package/skills/blueking-chat-x/references/components/ai-slash-input.md +102 -0
  97. package/skills/blueking-chat-x/references/components/animation-text.md +202 -0
  98. package/skills/blueking-chat-x/references/components/assistant-message.md +504 -0
  99. package/skills/blueking-chat-x/references/components/chat-container.md +912 -0
  100. package/skills/blueking-chat-x/references/components/chat-input.md +614 -0
  101. package/skills/blueking-chat-x/references/components/cite-content.md +142 -0
  102. package/skills/blueking-chat-x/references/components/code-content.md +211 -0
  103. package/skills/blueking-chat-x/references/components/collapsible-content.md +76 -0
  104. package/skills/blueking-chat-x/references/components/common-error-content.md +73 -0
  105. package/skills/blueking-chat-x/references/components/content-render.md +233 -0
  106. package/skills/blueking-chat-x/references/components/delete-tool.md +191 -0
  107. package/skills/blueking-chat-x/references/components/desc-panel.md +162 -0
  108. package/skills/blueking-chat-x/references/components/detail-section.md +91 -0
  109. package/skills/blueking-chat-x/references/components/execution-summary.md +150 -0
  110. package/skills/blueking-chat-x/references/components/file-artifact-panel.md +307 -0
  111. package/skills/blueking-chat-x/references/components/file-content.md +340 -0
  112. package/skills/blueking-chat-x/references/components/file-icon.md +109 -0
  113. package/skills/blueking-chat-x/references/components/file-upload-btn.md +162 -0
  114. package/skills/blueking-chat-x/references/components/flow-agent-content.md +266 -0
  115. package/skills/blueking-chat-x/references/components/flow-agent-node-detail.md +236 -0
  116. package/skills/blueking-chat-x/references/components/highlight-keyword.md +146 -0
  117. package/skills/blueking-chat-x/references/components/image-content.md +182 -0
  118. package/skills/blueking-chat-x/references/components/image-preview-group.md +184 -0
  119. package/skills/blueking-chat-x/references/components/image-preview.md +226 -0
  120. package/skills/blueking-chat-x/references/components/info-message.md +144 -0
  121. package/skills/blueking-chat-x/references/components/input-attachment.md +49 -0
  122. package/skills/blueking-chat-x/references/components/input-info-alert.md +42 -0
  123. package/skills/blueking-chat-x/references/components/input-menu-panel.md +162 -0
  124. package/skills/blueking-chat-x/references/components/interrupt-message.md +212 -0
  125. package/skills/blueking-chat-x/references/components/key-value-content.md +128 -0
  126. package/skills/blueking-chat-x/references/components/knowledge-rag-content.md +122 -0
  127. package/skills/blueking-chat-x/references/components/latex-content.md +200 -0
  128. package/skills/blueking-chat-x/references/components/loading-message.md +192 -0
  129. package/skills/blueking-chat-x/references/components/markdown-content.md +232 -0
  130. package/skills/blueking-chat-x/references/components/mention-tag.md +79 -0
  131. package/skills/blueking-chat-x/references/components/mention-text.md +83 -0
  132. package/skills/blueking-chat-x/references/components/mermaid-content.md +189 -0
  133. package/skills/blueking-chat-x/references/components/message-container.md +645 -0
  134. package/skills/blueking-chat-x/references/components/message-loading.md +118 -0
  135. package/skills/blueking-chat-x/references/components/message-render.md +327 -0
  136. package/skills/blueking-chat-x/references/components/message-time.md +177 -0
  137. package/skills/blueking-chat-x/references/components/message-tools.md +427 -0
  138. package/skills/blueking-chat-x/references/components/model-selector.md +157 -0
  139. package/skills/blueking-chat-x/references/components/preview-toolbar.md +42 -0
  140. package/skills/blueking-chat-x/references/components/questions-container.md +85 -0
  141. package/skills/blueking-chat-x/references/components/reasoning-message.md +232 -0
  142. package/skills/blueking-chat-x/references/components/reference-content.md +135 -0
  143. package/skills/blueking-chat-x/references/components/reference-doc-content.md +109 -0
  144. package/skills/blueking-chat-x/references/components/resource-icon.md +98 -0
  145. package/skills/blueking-chat-x/references/components/scroll-btn.md +159 -0
  146. package/skills/blueking-chat-x/references/components/selection-footer.md +78 -0
  147. package/skills/blueking-chat-x/references/components/selection-question.md +88 -0
  148. package/skills/blueking-chat-x/references/components/shortcut-btn.md +204 -0
  149. package/skills/blueking-chat-x/references/components/shortcut-btns.md +266 -0
  150. package/skills/blueking-chat-x/references/components/shortcut-render.md +424 -0
  151. package/skills/blueking-chat-x/references/components/simple-table.md +101 -0
  152. package/skills/blueking-chat-x/references/components/text-content.md +80 -0
  153. package/skills/blueking-chat-x/references/components/tool-approval-card.md +183 -0
  154. package/skills/blueking-chat-x/references/components/tool-btn.md +317 -0
  155. package/skills/blueking-chat-x/references/components/tool-message.md +235 -0
  156. package/skills/blueking-chat-x/references/components/toolcall-render.md +348 -0
  157. package/skills/blueking-chat-x/references/components/user-feedback.md +233 -0
  158. package/skills/blueking-chat-x/references/components/user-message.md +444 -0
  159. package/skills/blueking-chat-x/references/components/user-question-answered-card.md +104 -0
  160. package/skills/blueking-chat-x/references/components/user-question-card.md +231 -0
  161. package/skills/blueking-chat-x/references/components/user-question-choice.md +105 -0
  162. package/skills/blueking-chat-x/references/components/user-question-option.md +42 -0
  163. package/skills/blueking-chat-x/references/components/vnode-renderer.md +122 -0
  164. package/skills/blueking-chat-x/references/composables/use-animation-text.md +196 -0
  165. package/skills/blueking-chat-x/references/composables/use-artifact-preview.md +235 -0
  166. package/skills/blueking-chat-x/references/composables/use-clipboard.md +203 -0
  167. package/skills/blueking-chat-x/references/composables/use-command-selection.md +150 -0
  168. package/skills/blueking-chat-x/references/composables/use-container-scroll.md +57 -0
  169. package/skills/blueking-chat-x/references/composables/use-custom-tab.md +158 -0
  170. package/skills/blueking-chat-x/references/composables/use-flow-node-actions.md +164 -0
  171. package/skills/blueking-chat-x/references/composables/use-full-screen.md +112 -0
  172. package/skills/blueking-chat-x/references/composables/use-global-config.md +155 -0
  173. package/skills/blueking-chat-x/references/composables/use-input-mention.md +115 -0
  174. package/skills/blueking-chat-x/references/composables/use-menu-keydown.md +161 -0
  175. package/skills/blueking-chat-x/references/composables/use-message-group.md +244 -0
  176. package/skills/blueking-chat-x/references/composables/use-observer-visible-list.md +188 -0
  177. package/skills/blueking-chat-x/references/composables/use-parent-scrolling.md +46 -0
  178. package/skills/blueking-chat-x/references/directives/index.md +61 -0
  179. package/skills/blueking-chat-x/references/directives/overflow-tips.md +205 -0
  180. package/skills/blueking-chat-x/references/icons/index.md +185 -0
  181. package/skills/blueking-chat-x/references/plugins/index.md +56 -0
  182. package/skills/blueking-chat-x/references/plugins/markdown-container.md +55 -0
  183. package/skills/blueking-chat-x/references/plugins/markdown-latex.md +205 -0
  184. package/skills/blueking-chat-x/references/plugins/markdown-mermaid.md +247 -0
  185. package/skills/blueking-chat-x/references/theme/theme.md +423 -0
  186. package/skills/blueking-chat-x/references/types/constants.md +340 -0
  187. package/skills/blueking-chat-x/references/types/index.md +120 -0
  188. package/skills/blueking-chat-x/references/types/interrupt.md +379 -0
  189. package/skills/blueking-chat-x/references/types/messages.md +556 -0
  190. package/skills/blueking-chat-x/references/types/schema.md +91 -0
  191. package/skills/blueking-chat-x/references/utils/index.md +196 -0
  192. package/skills/blueking-chat-x/scripts/generate-references.mjs +536 -0
  193. package/dist/components/chat-input/ai-slash-editor/ai-slash-editor.vue.d.ts +0 -28
  194. package/dist/components/chat-input/ai-slash-editor/theme.d.ts +0 -24
  195. package/dist/mcp/generated/docs/ai-prompt-list.md +0 -45
  196. package/dist/mcp/generated/docs/ai-skill-list.md +0 -75
  197. package/dist/mcp/generated/docs/ai-slash-editor.md +0 -43
  198. package/dist/mcp/generated/docs/ai-slash-menu.md +0 -42
@@ -1,6 +1,17 @@
1
1
  export declare const lang: {
2
2
  readonly 发送: "Send";
3
3
  readonly 停止: "Stop";
4
+ readonly 添加: "Add";
5
+ readonly Skill: "Skill";
6
+ readonly MCP: "MCP";
7
+ readonly Prompt: "Prompt";
8
+ readonly 文件: "File";
9
+ readonly 图片: "Image";
10
+ readonly 工具: "Tool";
11
+ readonly 知识库: "Knowledge Base";
12
+ readonly 会话产物: "Conversation Files";
13
+ readonly 收起: "Collapse";
14
+ readonly 显示更多: "Show More";
4
15
  readonly 问问小鲸: "Ask AI";
5
16
  readonly 复制: "Copy";
6
17
  readonly 分享: "Share";
@@ -130,8 +141,6 @@ export declare const lang: {
130
141
  readonly 全选: "Select All";
131
142
  readonly 确定: "Confirm";
132
143
  readonly '\u4E0A\u4F20\u6587\u4EF6\uFF0C\u6700\u591A\u652F\u6301 {count} \u4E2A\uFF0C\u5355\u4E2A\u6700\u5927 {size}MB': "Upload file, up to {count} files, max {size}MB each";
133
- readonly '\u652F\u6301\u683C\u5F0F\uFF1A{formats}': "Supported formats: {formats}";
134
- readonly '\u6709 {count} \u4E2A\u6587\u4EF6\u56E0\u683C\u5F0F\u4E0D\u652F\u6301\u672A\u6DFB\u52A0': "{count} files were not added because the format is not supported";
135
144
  readonly '\u4F60\u597D\uFF0C\u6211\u662F\u5C0F\u9CB8': "Hello, I am BlueKing AI Bot";
136
145
  readonly 清空搜索: "Clear Search";
137
146
  readonly 搜索结果为空: "Search Result is Empty";
@@ -161,5 +170,6 @@ export declare const lang: {
161
170
  readonly '\u6587\u4EF6\u4E0A\u4F20\u4E2D\uFF0C\u8BF7\u7A0D\u5019': "Uploading files, please wait";
162
171
  readonly '\u5B58\u5728\u4E0A\u4F20\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u8BD5': "Remove failed uploads before sending";
163
172
  readonly 上传失败: "Upload failed";
173
+ readonly '\u6709 {count} \u4E2A\u6587\u4EF6\u56E0\u683C\u5F0F\u4E0D\u652F\u6301\u672A\u6DFB\u52A0': "{count} file(s) were not added because the format is not supported";
164
174
  };
165
- export declare const t: (key: keyof typeof lang) => "Send" | "Stop" | "Ask AI" | "Copy" | "Share" | "Like" | "Unsatisfied" | "Delete" | "Quote" | "Regenerate" | "Regenerating will clear the content below" | "Submit" | "Cancel" | "Preview Content" | "Jump to Detail" | "Call Tool" | "Read Skill" | "Calling" | "Reading" | "Tell us your thoughts" | "What makes you satisfied?" | "What makes you dissatisfied?" | "Return Content" | "Edit" | "Deep Thinking" | "Quick Thinking" | "Image to Text" | "Loading image..." | "Failed to load image" | "Thinking..." | "Thinking Completed" | "Thinking Failed" | "Copy Success" | "Copy Failed" | "Return to bottom" | "Stop generating" | "Stopping" | "Duration" | "Yesterday" | "Parameters" | "Description" | "Execution Status" | "Running" | "Success" | "Failed" | "Pending" | "To Be Executed" | "Details" | "Retry" | "Retrying" | "Skipping" | "The task is retrying and cannot be skipped" | "The task is skipping and cannot be retried" | "Node" | "Node Config" | "Node Output" | "Basic Info" | "Flow Template" | "Node Name" | "Step Name" | "Execution Plan" | "Optional" | "Failure Handler" | "Timeout Control" | "Yes" | "No" | "Input Params" | "Output Params" | "Param Name" | "Param Value" | "Name" | "Structured Output" | "Manual Skip" | "No Data" | "Call MCP" | "More" | "Algorithm Plan Review Ticket" | "Reviewing" | "Approving" | "Abandoned" | "Approved" | "Cancelled" | "Expired" | "Rejected" | "Revoked" | "Ticket No." | "Submitted At" | "Current Handler" | "None" | "View Ticket Detail" | "Copy Ticket" | "Copy Ticket Link" | "Cancel Approval" | "Approval Cancelled" | "Refresh Ticket Status" | "This ticket has been rejected and cannot be cancelled" | "This ticket has been approved and cannot be cancelled" | "This ticket has been cancelled, no need to click again" | "Approval cannot be cancelled in the current status" | "There are {count} pending approval tickets in the current conversation. To continue, cancel approval first." | "Unsupported interrupt message" | "Searching" | "Search Completed" | "Upload File" | "Select model" | "Search models" | "Requesting..." | "Cancel satisfied" | "Cancel dissatisfied" | "Confirm delete this answer?" | "This operation cannot be undone. Please proceed with caution!" | "Preview" | "Zoom Out" | "Zoom In" | "Rotate" | "Download" | "Sorry, image loading failed. Please try reloading." | "Reset" | "Reload" | "W" | "H" | "Upload Image" | "Search keyword" | "Select date" | "Locate in Chat" | "Select All" | "Confirm" | "Upload file, up to {count} files, max {size}MB each" | "Supported formats: {formats}" | "{count} files were not added because the format is not supported" | "Hello, I am BlueKing AI Bot" | "Clear Search" | "Search Result is Empty" | "Valid Evidence" | "Full Screen" | "Exit Full Screen" | "Please choose to continue" | "Continue" | "Received: " | "Done" | "Skip" | "Single" | "Multiple" | "Others" | "Completed" | "question(s)" | "Answers" | "Replied" | "Please enter..." | "File Artifacts" | "File List" | "Search file keyword" | "Failed to load preview" | "No file to preview" | "Uploading files, please wait" | "Remove failed uploads before sending" | "Upload failed" | "发送" | "停止" | "问问小鲸" | "复制" | "分享" | "点赞" | "不满意" | "删除" | "引用" | "重新生成" | "重新生成将清空下文内容" | "提交" | "取消" | "预览内容" | "跳转详情" | "调用工具" | "读取 Skill" | "正在调用" | "正在读取" | "说出您的想法" | "什么原因让你满意?" | "什么原因让你不满意?" | "返回内容" | "编辑" | "深度思考" | "快速思考" | "图生文" | "图片加载中..." | "图片加载失败" | "思考中" | "已思考完成" | "思考失败" | "复制成功" | "复制失败" | "返回底部" | "停止生成" | "正在停止" | "耗时" | "昨天" | "参数" | "描述" | "执行情况" | "执行中" | "成功" | "失败" | "挂起" | "待执行" | "详情" | "重试" | "重试中" | "跳过中" | "任务正在重试中,不可跳过" | "任务正在跳过中,不可重试" | "节点" | "节点配置" | "节点输出" | "基础信息" | "流程模板" | "节点名称" | "步骤名称" | "执行方案" | "是否可选" | "失败处理" | "超时控制" | "是" | "否" | "输入参数" | "输出参数" | "参数名" | "参数值" | "名称" | "变量说明" | "结构化输出" | "手动跳过" | "暂无数据" | "调用 MCP" | "更多" | "算法方案评审单" | "评审中" | "审批中" | "已废弃" | "已批准" | "已通过" | "已取消" | "已过期" | "已拒绝" | "已撤销" | "单据编号" | "提交时间" | "当前处理人" | "无" | "查看单据详情" | "复制单据" | "复制单据链接" | "取消审批" | "已取消审批" | "刷新单据状态" | "单据已取消审批" | "该单据已被拒绝,无法取消" | "该单据已通过,无法取消" | "单据已取消,无需重复点击" | "当前状态无法取消审批" | "当前会话有 {count} 个待审批单,如需继续,请先取消审批" | "暂不支持的中断消息" | "检索中" | "检索完成" | "上传文件" | "选择模型" | "搜索模型关键字" | "请求中..." | "取消满意" | "取消不满意" | "确认删除该回答?" | "删除操作无法撤回,请谨慎操作!" | "预览" | "缩小" | "放大" | "旋转" | "下载" | "抱歉,图片加载失败,可尝试重新加载" | "重置" | "重新加载" | "宽" | "高" | "上传图片" | "搜索 关键字" | "选择日期" | "在对话中定位" | "全选" | "确定" | "上传文件,最多支持 {count} 个,单个最大 {size}MB" | "支持格式:{formats}" | "有 {count} 个文件因格式不支持未添加" | "你好,我是小鲸" | "清空搜索" | "搜索结果为空" | "有效证据" | "全屏" | "退出全屏" | "请选择以继续" | "继续" | "收到信息:" | "待审批" | "已审批" | "完成" | "跳过" | "单选" | "多选" | "其他" | "已完成" | "题" | "回答内容" | "已回复" | "请输入..." | "文件产物" | "文件列表" | "搜索文件关键字" | "预览加载失败" | "暂无可预览的文件" | "文件上传中,请稍候" | "存在上传失败的文件,请删除后重试" | "上传失败";
175
+ export declare const t: (key: keyof typeof lang) => "Send" | "Stop" | "Add" | "Skill" | "MCP" | "Prompt" | "File" | "Image" | "Tool" | "Knowledge Base" | "Conversation Files" | "Collapse" | "Show More" | "Ask AI" | "Copy" | "Share" | "Like" | "Unsatisfied" | "Delete" | "Quote" | "Regenerate" | "Regenerating will clear the content below" | "Submit" | "Cancel" | "Preview Content" | "Jump to Detail" | "Call Tool" | "Read Skill" | "Calling" | "Reading" | "Tell us your thoughts" | "What makes you satisfied?" | "What makes you dissatisfied?" | "Return Content" | "Edit" | "Deep Thinking" | "Quick Thinking" | "Image to Text" | "Loading image..." | "Failed to load image" | "Thinking..." | "Thinking Completed" | "Thinking Failed" | "Copy Success" | "Copy Failed" | "Return to bottom" | "Stop generating" | "Stopping" | "Duration" | "Yesterday" | "Parameters" | "Description" | "Execution Status" | "Running" | "Success" | "Failed" | "Pending" | "To Be Executed" | "Details" | "Retry" | "Retrying" | "Skipping" | "The task is retrying and cannot be skipped" | "The task is skipping and cannot be retried" | "Node" | "Node Config" | "Node Output" | "Basic Info" | "Flow Template" | "Node Name" | "Step Name" | "Execution Plan" | "Optional" | "Failure Handler" | "Timeout Control" | "Yes" | "No" | "Input Params" | "Output Params" | "Param Name" | "Param Value" | "Name" | "Structured Output" | "Manual Skip" | "No Data" | "Call MCP" | "More" | "Algorithm Plan Review Ticket" | "Reviewing" | "Approving" | "Abandoned" | "Approved" | "Cancelled" | "Expired" | "Rejected" | "Revoked" | "Ticket No." | "Submitted At" | "Current Handler" | "None" | "View Ticket Detail" | "Copy Ticket" | "Copy Ticket Link" | "Cancel Approval" | "Approval Cancelled" | "Refresh Ticket Status" | "This ticket has been rejected and cannot be cancelled" | "This ticket has been approved and cannot be cancelled" | "This ticket has been cancelled, no need to click again" | "Approval cannot be cancelled in the current status" | "There are {count} pending approval tickets in the current conversation. To continue, cancel approval first." | "Unsupported interrupt message" | "Searching" | "Search Completed" | "Upload File" | "Select model" | "Search models" | "Requesting..." | "Cancel satisfied" | "Cancel dissatisfied" | "Confirm delete this answer?" | "This operation cannot be undone. Please proceed with caution!" | "Preview" | "Zoom Out" | "Zoom In" | "Rotate" | "Download" | "Sorry, image loading failed. Please try reloading." | "Reset" | "Reload" | "W" | "H" | "Upload Image" | "Search keyword" | "Select date" | "Locate in Chat" | "Select All" | "Confirm" | "Upload file, up to {count} files, max {size}MB each" | "Hello, I am BlueKing AI Bot" | "Clear Search" | "Search Result is Empty" | "Valid Evidence" | "Full Screen" | "Exit Full Screen" | "Please choose to continue" | "Continue" | "Received: " | "Done" | "Skip" | "Single" | "Multiple" | "Others" | "Completed" | "question(s)" | "Answers" | "Replied" | "Please enter..." | "File Artifacts" | "File List" | "Search file keyword" | "Failed to load preview" | "No file to preview" | "Uploading files, please wait" | "Remove failed uploads before sending" | "Upload failed" | "{count} file(s) were not added because the format is not supported" | "发送" | "停止" | "添加" | "文件" | "图片" | "工具" | "知识库" | "会话产物" | "收起" | "显示更多" | "问问小鲸" | "复制" | "分享" | "点赞" | "不满意" | "删除" | "引用" | "重新生成" | "重新生成将清空下文内容" | "提交" | "取消" | "预览内容" | "跳转详情" | "调用工具" | "读取 Skill" | "正在调用" | "正在读取" | "说出您的想法" | "什么原因让你满意?" | "什么原因让你不满意?" | "返回内容" | "编辑" | "深度思考" | "快速思考" | "图生文" | "图片加载中..." | "图片加载失败" | "思考中" | "已思考完成" | "思考失败" | "复制成功" | "复制失败" | "返回底部" | "停止生成" | "正在停止" | "耗时" | "昨天" | "参数" | "描述" | "执行情况" | "执行中" | "成功" | "失败" | "挂起" | "待执行" | "详情" | "重试" | "重试中" | "跳过中" | "任务正在重试中,不可跳过" | "任务正在跳过中,不可重试" | "节点" | "节点配置" | "节点输出" | "基础信息" | "流程模板" | "节点名称" | "步骤名称" | "执行方案" | "是否可选" | "失败处理" | "超时控制" | "是" | "否" | "输入参数" | "输出参数" | "参数名" | "参数值" | "名称" | "变量说明" | "结构化输出" | "手动跳过" | "暂无数据" | "调用 MCP" | "更多" | "算法方案评审单" | "评审中" | "审批中" | "已废弃" | "已批准" | "已通过" | "已取消" | "已过期" | "已拒绝" | "已撤销" | "单据编号" | "提交时间" | "当前处理人" | "无" | "查看单据详情" | "复制单据" | "复制单据链接" | "取消审批" | "已取消审批" | "刷新单据状态" | "单据已取消审批" | "该单据已被拒绝,无法取消" | "该单据已通过,无法取消" | "单据已取消,无需重复点击" | "当前状态无法取消审批" | "当前会话有 {count} 个待审批单,如需继续,请先取消审批" | "暂不支持的中断消息" | "检索中" | "检索完成" | "上传文件" | "选择模型" | "搜索模型关键字" | "请求中..." | "取消满意" | "取消不满意" | "确认删除该回答?" | "删除操作无法撤回,请谨慎操作!" | "预览" | "缩小" | "放大" | "旋转" | "下载" | "抱歉,图片加载失败,可尝试重新加载" | "重置" | "重新加载" | "宽" | "高" | "上传图片" | "搜索 关键字" | "选择日期" | "在对话中定位" | "全选" | "确定" | "上传文件,最多支持 {count} 个,单个最大 {size}MB" | "你好,我是小鲸" | "清空搜索" | "搜索结果为空" | "有效证据" | "全屏" | "退出全屏" | "请选择以继续" | "继续" | "收到信息:" | "待审批" | "已审批" | "完成" | "跳过" | "单选" | "多选" | "其他" | "已完成" | "题" | "回答内容" | "已回复" | "请输入..." | "文件产物" | "文件列表" | "搜索文件关键字" | "预览加载失败" | "暂无可预览的文件" | "文件上传中,请稍候" | "存在上传失败的文件,请删除后重试" | "上传失败" | "有 {count} 个文件因格式不支持未添加";
@@ -166,7 +166,7 @@ const collapsed = ref(false); // false = 展开,true = 折叠
166
166
  - **默认激活**:当 `MessageContainer` 已注入滚动上下文(`useContainerScrollProvider`,供 `FlowAgentContent` 内 `useContainerScrollConsumer` 读取)时,组件挂载后若存在 `task.is_active === true` 且 `task.has_confidence === true` 的任务,会自动在侧栏打开该任务的「有效证据」Tab;无滚动 Provider(例如独立演示)时不做自动打开。用户手动切换 Tab 后不再沿用 `is_active` 默认高亮
167
167
  - **选中态**:当前侧栏 Tab 与任务行 / 节点行联动高亮(`is-selected`);任务 Tab 与「有效证据」Tab 均视为该任务的选中态
168
168
  - **节点列表**:每个节点显示状态圆点、名称和耗时;hover 时出现行尾操作按钮组
169
- - **失败节点操作**:失败且 `retryable` / `skippable` 为 `true` 的节点,hover 时额外展示「重试」「跳过」按钮,点击后通过 `onInterruptResume` 回传 Agent(不传 `interrupt`)。仅在对话流内出现:侧栏「执行情况」面板(`ExecutionSummary`)内渲染的同一消息只保留「详情」
169
+ - **失败节点操作**:失败且 `retryable` / `skippable` 为 `true` 的节点,hover 时额外展示「重试」「跳过」按钮,点击后通过 `onInterruptResume` 回传 Agent(不传 `interrupt`)
170
170
  - **节点详情**:点击「详情」会通过 `useCustomTabConsumer` 在 `ChatContainer` 侧边栏新增自定义 Tab,展示节点配置(基础信息、输入参数、输出参数)
171
171
 
172
172
  > `FlowAgentContent` 会读取 `ChatContainer` 注入的 `renderMode`。当 `renderMode === RenderMode.Share` 时,任务行不展示总耗时与「有效证据」,节点列表不展示耗时与「详情」按钮,避免分享预览中出现可交互入口。独立使用 `ActivityMessage` 且没有上层 Provider 时,默认按 `Chat` 模式渲染。
@@ -191,8 +191,8 @@ FlowAgentContent(activityType = 'flow_agent')
191
191
  ├── node.name(HighlightKeyword 支持搜索高亮)
192
192
  ├── node.elapsed_time
193
193
  └── 行尾操作按钮组(hover 显示)
194
- ├── 重试(失败 + retryable;侧栏执行情况面板内隐藏)→ onInterruptResume
195
- ├── 跳过(失败 + skippable;侧栏执行情况面板内隐藏)→ onInterruptResume
194
+ ├── 重试(失败 + retryable)→ onInterruptResume
195
+ ├── 跳过(失败 + skippable)→ onInterruptResume
196
196
  └── 详情 → 打开节点详情 Tab
197
197
  ```
198
198
 
@@ -0,0 +1,91 @@
1
+ <!-- AI SUMMARY -->
2
+ ## 快速了解
3
+
4
+ AddMenuBtn 是输入框底部工具栏最左侧的 + 号:只负责展示与 toggle 事件,菜单开合由上层控制; active 为 true 时保持 hover 底色;mousedown 已 preventDefault,点击不会抢走编辑器焦点。 源码位置:src/components/ai-buttons/add-menu-btn/add-menu-btn.vue。
5
+
6
+ ### 关联组件
7
+ - **chat-input** — 输入框底部工具栏渲染该按钮并处理 toggle
8
+ - **input-menu-panel** — 点击后唤起 plus 触发的聚合菜单
9
+ - **file-upload-btn** — 被本按钮取代的旧上传入口
10
+
11
+ ---
12
+ <!-- FULL DOC -->
13
+
14
+ # AddMenuBtn 添加菜单按钮
15
+
16
+ > **能力域**:输入交互
17
+
18
+ ## 源码事实
19
+
20
+ - **源码位置**:`src/components/ai-buttons/add-menu-btn/add-menu-btn.vue`
21
+ - **能力说明**:输入框底部工具栏最左侧的 + 号,点击 emit `toggle`,由上层决定唤起或收起聚合菜单。
22
+ - **文案**:tooltip 固定为 `t('添加')`,theme 为 `ai-chat-box`,偏移 `[0, 16]`。
23
+
24
+ ## 关键行为
25
+
26
+ - **不持有菜单状态**:`active` 由上层传入([ChatInput](/components/input/chat-input) 传 `menuTrigger === 'plus'`),组件自身只做样式切换。
27
+ - **不抢焦点**:`@mousedown.prevent` 阻止默认行为,点击时编辑器光标位置保持不变,聚合菜单的关键字锚点才能落在原处。
28
+ - **展开态与 hover 同色**:`.is-active` 与 `:hover` 共用 `$color-bg-tab` 语义底色,圆形按钮 32×32。
29
+ - **默认插槽**:默认渲染内置 `AddIcon`(该图标从包入口导出,可单独使用)。
30
+
31
+ ::: info 内部组件
32
+ 本组件不在包入口导出,通常经 [ChatInput](/components/input/chat-input) 使用。以下用法用于说明组件契约。
33
+ :::
34
+
35
+ ## 用法
36
+
37
+ ```vue
38
+ <template>
39
+ <AddMenuBtn
40
+ :active="isMenuOpen"
41
+ :tippy-options="tippyOptions"
42
+ @toggle="handleToggle"
43
+ />
44
+ </template>
45
+
46
+ <script setup lang="ts">
47
+ import { ref } from 'vue';
48
+
49
+ const isMenuOpen = ref(false);
50
+ const handleToggle = () => {
51
+ isMenuOpen.value = !isMenuOpen.value;
52
+ };
53
+ </script>
54
+ ```
55
+
56
+ **渲染效果**(点击切换展开态高亮)
57
+
58
+ ## API
59
+
60
+ ### Props
61
+
62
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
63
+ | ------------ | --------------- | ----------- | ---- | -------------------------- |
64
+ | active | `boolean` | `undefined` | - | 聚合菜单是否处于展开态 |
65
+ | tippyOptions | `AITippyProps` | `undefined` | - | tooltip 配置,会与内置配置合并 |
66
+
67
+ ### Emits
68
+
69
+ | 事件名 | 参数 | 触发时机 |
70
+ | ------ | ---- | -------- |
71
+ | toggle | `()` | 点击按钮 |
72
+
73
+ ### Slots
74
+
75
+ | 插槽名 | 说明 |
76
+ | ------- | -------------------------- |
77
+ | default | 替换按钮内图标,默认 `AddIcon` |
78
+
79
+ ## 与 FileUploadBtn 的关系
80
+
81
+ `ChatInput` 内部的上传入口已从 [FileUploadBtn](/components/input/file-upload-btn) 改为 + 号聚合菜单里的「文件」项:
82
+
83
+ - 上传能力开启(`supportUpload`)时,组件在菜单「添加」分组注入内置的 `type: 'file'` 条目,选中后唤起隐藏的原生 `input[type=file]`
84
+ - 「文件」、拖拽、粘贴与入队校验都走 `ChatInput` 的 `accept` prop,详见 [ChatInput 文件上传](/components/input/chat-input#file-upload)
85
+ - `FileUploadBtn` 组件仍然保留并可独立使用,但不再出现在 `ChatInput` 的默认布局中
86
+
87
+ ## 关联组件
88
+
89
+ - [ChatInput](/components/input/chat-input) — 按钮的宿主与 `toggle` 处理方
90
+ - [InputMenuPanel](/components/input/input-menu-panel) — 被唤起的聚合菜单
91
+ - [FileUploadBtn](/components/input/file-upload-btn) — 独立上传按钮
@@ -1,12 +1,12 @@
1
1
  <!-- AI SUMMARY -->
2
2
  ## 快速了解
3
3
 
4
- ChatInput 内部富文本输入,支持 / Skill、\ Prompt @ 资源标签。 源码位置:src/components/chat-input/ai-slash-input/ai-slash-input.vue。
4
+ ChatInput 内部富文本编辑区,基于 edix 编辑器渲染「文本 + 资源标签」文档。 自身不渲染菜单,只把触发方式与过滤关键字通过 menuChange 抛给上层,并暴露插入 / 替换 / 关闭菜单等命令。 源码位置:src/components/chat-input/ai-slash-input/ai-slash-input.vue。
5
5
 
6
6
  ### 关联组件
7
- - **ai-skill-list** — 输入 / 时渲染 Skill 选择列表
8
- - **ai-prompt-list** — 输入 \ 时渲染 Prompt 选择列表
9
- - **ai-slash-menu** — 输入 @ 时渲染资源选择菜单
7
+ - **chat-input** — 上层输入区,持有菜单状态并调用本组件的 expose 方法
8
+ - **input-menu-panel** — menuChange 驱动的菜单面板,选中后回调插入方法
9
+ - **mention-tag** — 文档中的 tag 节点由 MentionTag 渲染
10
10
 
11
11
  ---
12
12
  <!-- FULL DOC -->
@@ -18,42 +18,88 @@ ChatInput 内部富文本输入,支持 / Skill、\ Prompt 与 @ 资源标签
18
18
  ## 源码事实
19
19
 
20
20
  - **源码位置**:`src/components/chat-input/ai-slash-input/ai-slash-input.vue`
21
- - **能力说明**:ChatInput 内部富文本输入,支持 `/` Skill、`\` Prompt `@` 资源标签。
21
+ - **能力说明**:基于 [edix](/edix/) `contenteditable` 编辑区,文档结构为 `TagSchema`(二维数组:行 节点,节点为 `text` 或 `tag`)。
22
+ - **职责边界**:只管「编辑 + 触发态识别 + 插入」,**不渲染菜单**。菜单的数据、分组、显隐都在 [ChatInput](/components/input/chat-input) 与 [InputMenuPanel](/components/input/input-menu-panel) 中。
22
23
 
23
- ## 触发字符
24
+ ## 触发状态机
24
25
 
25
- | 字符 | 菜单类型 | 渲染组件 | 数据源 prop |
26
- | ---- | -------- | -------- | ----------- |
27
- | `/` | skill | `AiSkillList` | `skills` |
28
- | `\` | prompt | `AiPromptList` | `prompts` |
29
- | `@` | slash | `AiSlashMenu` | `resources` |
26
+ 触发状态由 `use-menu-trigger.ts` 维护,对外统一为 `{ trigger, keyword }`:
30
27
 
31
- > 输入框触达最大高度后,`.ai-slash-input-wrapper` `min-height:0` 收缩并内部滚动。
28
+ | 触发方式 | 唤起时机 | 过滤关键字来源 | 选中时消费的字符 |
29
+ | -------------------- | ----------------------- | ------------------------------------------ | --------------------- |
30
+ | `/` `@` `\`(字符) | `keydown` 命中触发字符 | 触发符 → 光标之间的非空白文本 | 关键字 + 触发符 |
31
+ | `plus` | 上层调用 `openPlusMenu` | 唤起瞬间光标位置 → 当前光标之间的文本 | 仅关键字 |
32
32
 
33
- ## API 摘要
33
+ - 内容或光标变化后延迟 16ms 重算触发态(等 DOM 应用本次输入),上下文失效(如光标移到触发符之前)时自动关闭。
34
+ - `plus` 唤起时若编辑器还没有文本节点(空输入框),关键字保持为空。
35
+ - 每次 `trigger` / `keyword` 变化都会 emit `menuChange`。
34
36
 
35
- ### Props
37
+ ## 文档与标签
36
38
 
37
- - `{ modelValue: string | TagSchema; placeholder?: string; prompts?: string[]; resources?: IAiSlashMenuItem[]; skills?: ISkillListItem[]; }`
39
+ 标签是 edix void 节点,识别依据是 `contenteditable="false"` 且带 `data-tag-type` 属性;节点数据全部落在 DOM 属性上,因此文档可以脱离 `menuSources` 独立还原(消息回显与 hover 气泡都依赖这点):
38
40
 
39
- ### Emits
41
+ | 节点数据 | 来源 | DOM 属性 |
42
+ | ------------- | ----------------------------- | --------------------- |
43
+ | `label` | `item.name` | `data-tag-label` |
44
+ | `value` | `item.id` | `data-tag-value` |
45
+ | `type` | `item.type` | `data-tag-type` |
46
+ | `icon` | `item.icon`(仅字符串 URL) | `data-tag-icon` |
47
+ | `description` | `item.description` | `data-tag-description` |
40
48
 
41
- - `{ (e: 'update:modelValue', value: TagSchema, selectedResourceList: IAiSlashMenuItem[]): void; (e: 'keydown', event: KeyboardEvent & KeyboardPayload): void; (e: 'upload', files: File[]): void; }`
49
+ 序列化为纯文本时,`skill` 输出 `/<value>`,其余类型输出 `@<label>`(见 `constants.ts` `tagSchemaToMessageString`)。
42
50
 
43
- ### Slots
51
+ ## 与 modelValue 的同步
44
52
 
45
- - 无。
53
+ `modelValue` 支持 `string` 与 `TagSchema` 两种形态:传字符串时经 `stringToDoc` 转成文档。当 `modelValue` 由外部异步更新(历史会话回填、父组件重置、编辑态回填)且与编辑器当前内容不一致时,组件通过 `GetDocSnapshot` 读取快照并与 `docToString(modelValue)` 比对,必要时执行 `ReplaceAll` 同步,避免内外状态脱节。
46
54
 
47
- ### Expose
55
+ ## 粘贴与换行
48
56
 
49
- - `{ cleanup: (`
57
+ - 粘贴内容中包含文件时阻止默认行为并 emit `upload`,交由上层走上传流程;纯文本粘贴保持编辑器默认行为。
58
+ - `Enter` 阻止编辑器默认换行(发送与否由上层判断),`Shift + Enter` 正常换行。
59
+ - 编辑区默认保持 4 行高度,避免输入后 placeholder 消失导致高度抖动;父级触达 `max-height` 后由本组件内部滚动。
50
60
 
51
- ## 组件依赖
61
+ ## API
52
62
 
53
- - `AiSkillList`
54
- - `AiPromptList`
55
- - `AiSlashMenu`
63
+ ### Props
64
+
65
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 |
66
+ | ----------- | --------------------- | -------------------------- | ---- | -------------------------- |
67
+ | modelValue | `string \| TagSchema` | - | ✅ | 编辑器文档 |
68
+ | placeholder | `string` | `请输入内容` / `Please enter content` | - | 占位文案,经 `aria-placeholder` 渲染,支持 `\n` 多行 |
69
+
70
+ ### Emits
71
+
72
+ | 事件名 | 参数 | 触发时机 |
73
+ | ----------------- | ------------------------------------------------------- | ------------------------------ |
74
+ | update:modelValue | `(value: TagSchema)` | 编辑器内容变化 |
75
+ | keydown | `(event: KeyboardEvent & KeyboardPayload)` | 编辑器按键(上层据此判断发送) |
76
+ | upload | `(files: File[])` | 粘贴内容中含文件 |
77
+ | menuChange | `(payload: { keyword: string; trigger: MenuTrigger \| null })` | 触发方式或过滤关键字变化 |
78
+
79
+ ### Expose
80
+
81
+ | 方法名 | 类型 | 说明 |
82
+ | -------------------- | ---------------------------------------- | ---------------------------------------------------------------- |
83
+ | insertMenuItem | `(item: IInputMenuItem) => void` | 消费「触发符 + 关键字」后在光标处插入标签并补一个空格 |
84
+ | appendMention | `(item: IInputMenuItem) => void` | 在文档末尾追加标签(位置由文档算出,不读光标,供外部无焦点时调用) |
85
+ | replaceAll | `(value: string) => void` | 整体替换文档内容(Prompt 选中走此路径) |
86
+ | consumeTriggerText | `() => [number, number]` | 仅删除「触发符 + 关键字」,返回删除后的 `[line, column]` |
87
+ | closeMenu | `() => void` | 关闭触发态 |
88
+ | cleanup | `() => void` | 清空文档并关闭触发态(发送后调用) |
89
+ | focus | `() => void` | 聚焦编辑器并把光标置于末尾 |
90
+ | openPlusMenu | `() => void` | 唤起 `plus` 聚合菜单;光标已在编辑器内时保持原位 |
91
+
92
+ ::: tip 为什么 appendMention 不读光标
93
+ 外部调用(如文件产物面板点「引用」)时编辑器通常没有焦点,而 DOM 选区与编辑器内部选区是异步同步的,依赖光标会把标签插到错误位置,因此位置直接由文档末尾算出。
94
+ :::
56
95
 
57
96
  ## 使用建议
58
97
 
59
- - 优先通过上层组合组件使用;直接使用前请确认 props 数据结构来自对应类型定义。
98
+ 直接使用本组件需要自行实现菜单与插入调度,通常应通过 [ChatInput](/components/input/chat-input) 使用。若确需单独接入,最小闭环是:监听 `menuChange` 决定菜单显隐与数据 → 用户选中后调用 `insertMenuItem` / `replaceAll` → 发送后调用 `cleanup`。
99
+
100
+ ## 关联组件
101
+
102
+ - [ChatInput](/components/input/chat-input) — 上层输入区
103
+ - [InputMenuPanel](/components/input/input-menu-panel) — 菜单面板与分组逻辑
104
+ - [MentionTag](/components/rendering/mention-tag) — 标签渲染
105
+ - [Edix 编辑器引擎](/edix/) — 文档模型与命令机制
@@ -33,7 +33,8 @@ AssistantMessage(根类名:ai-assistant-message)
33
33
  ├── ai-assistant-message-toolcalls(v-if toolCalls 非空,flex column,gap: 8px)
34
34
  │ └── ToolCallRender × N(toolCalls,不受 slot 影响)
35
35
  └── MessageArtifacts(v-if property.artifacts 非空)
36
- └── ArtifactFileCard × N(点击 → useArtifactPreview → 侧栏 FileArtifactPanel → ArtifactPreviewHost
36
+ └── ArtifactFileCard × N(点击卡片 → useArtifactPreview → 侧栏 FileArtifactPanel → ArtifactPreviewHost
37
+ 右侧操作区:引用(useInputMention)+ 下载)
37
38
  ```
38
39
 
39
40
  - **内容区**:`content` 经 `ContentRender`(`MessageContentType.Text`)由 `MarkdownContent` 渲染;default slot 仅收到 `{ content }`
@@ -378,6 +379,11 @@ AI 可在一次回复中发起多个工具调用,组件依次渲染:
378
379
 
379
380
  当 `property.artifacts` 非空时,在工具调用区下方渲染 `MessageArtifacts` 文件卡片列表。点击卡片会通过 `useArtifactPreview` 打开 `ChatContainer` 侧栏「文件产物」Tab(见 [FileArtifactPanel](/components/message/file-artifact-panel))。
380
381
 
382
+ 卡片右侧的操作区在 hover 时出现,按设计稿顺序为「引用」「下载」:
383
+
384
+ - **引用**:仅当存在 [useInputMention](/composables/use-input-mention) 上下文(即页面有输入框)时渲染,点击后文件以资源标签形态进入输入框
385
+ - **下载**:有外部 `onDownload` 或容器具备异步取链能力(传了 `onArtifactClick`)时渲染,取链期间图标切为 Loading
386
+
381
387
  `AIFileInfo` 仅含元信息(`name` / `outputId` / `size` / `type`);`download_url` / `preview_url` 由容器 `onArtifactClick` 异步获取。命中唯一文件依赖 `messageUid = uid ?? String(id)` + 卡片下标 + `outputId`。
382
388
 
383
389
  侧栏预览由面板内 `ArtifactPreviewHost` 按**文件分类**分派(详见面板文档「预览机制」):
@@ -30,6 +30,8 @@
30
30
  - **用户问题中断**:待回答 `UserQuestion` 时挂载 `UserQuestionCard`;结构化作答走 `onInterruptResume`,输入框直接发送走 `onSendMessage`(第三参数带 skip `payload` 与 `interrupt`),且不自动清空输入框
31
31
  - **执行摘要 / 侧栏全屏 / 自定义 Tab**:侧栏展示工具调用与 FlowAgent 记录,支持搜索定位;Tab 栏可全屏;`useCustomTabProvider` 支持动态 Tab
32
32
  - **模型选择**:透传 `models`、`v-model:selectedModel` 与 `@modelChange` 至 `ChatInput`,传入 `models` 后在发送按钮左侧展示 [ModelSelector](/components/input/model-selector)
33
+ - **输入框菜单**:`menuSources` 透传至 `ChatInput`,并自动把消息里的会话产物补进 `artifact` 分组;同时经 `useGlobalConfig` 下发给消息编辑态的内嵌输入框
34
+ - **资源引用注入**:通过 `useInputMentionProvider` 开放 `insertMention`,让消息区文件卡片与侧栏产物面板可把文件「@ 进输入框」
33
35
  - **分享模式 / 渲染模式**:内置多选分享;`renderMode` 经 Provider 下传。`Share` 态开放侧栏只读查看,隐藏底部输入与「重试 / 跳过」等交互
34
36
  - **字号主题**:`size` 为 `small`(默认 12px)/ `normal`(14px);根节点 `data-ai-size`,浮层同步 `document.body.dataset.aiSize`
35
37
  - **消息时间时区**:`timezone` 经 `useGlobalConfig` 下传给 `MessageTime`,统一整个会话的时间展示时区;未配置时按浏览器时区
@@ -55,7 +57,7 @@ ai-chat-container(:data-ai-size="size")
55
57
  │ └── #welcome(默认:Banner + welcomeTitle + openingRemark;自定义则整块替换)
56
58
  ├── SelectionFooter(分享模式)
57
59
  ├── ShortcutRender(有快捷指令时)
58
- └── ChatInput(透传 models / selectedModel;interrupt 槽展示 UserQuestionCard / InputInfoAlert)
60
+ └── ChatInput(透传 models / selectedModel / menuSources;interrupt 槽展示 UserQuestionCard / InputInfoAlert)
59
61
  ```
60
62
 
61
63
  ## 基础用法
@@ -134,8 +136,6 @@ ai-chat-container(:data-ai-size="size")
134
136
 
135
137
  侧边栏默认包含「执行情况」Tab,展示所有工具调用和 FlowAgent 类型的 Activity 消息。支持关键词搜索过滤和点击定位到对话中的消息位置。Tab 标签内 `.ai-execution-summary-icon` 固定 16×16px,避免被 flex 压缩。
136
138
 
137
- 面板内的消息虽与对话流复用同一套渲染链路,但按**只读回看**呈现:`ExecutionSummary` 会 provide 面板上下文,FlowAgent 失败节点在面板内不展示「重试 / 跳过」,只保留「详情」;对话流内不受影响。详见 [ExecutionSummary](/components/agent/execution-summary)。
138
-
139
139
  **展示条件**:侧栏是否渲染只取决于折叠态与是否存在可见 Tab —— `asideCollapsed === false` 且 `displayTabs` 非空即展开,与 `executionGroups`、`keyword`、是否有文件产物均无关。无执行数据时 `ExecutionSummary` 展示自身空态,无文件产物时 `FileArtifactPanel` 展示整块空态。`renderMode === Share` 分享态同样按折叠态展示侧栏(开放只读查看流程智能体详情/证据/执行情况),仅底部输入区保持隐藏。
140
140
 
141
141
  **展开 / 折叠由外部判断(严格受控)**:只要传入了 `asideCollapsed`,折叠态就**一律以外部值为准**。容器内部的展开动作(点击文件卡片预览、`addCustomTab` 打开节点详情等)只发出 `update:asideCollapsed` 请求,外部不改值就不会展开 —— 所以务必用 `v-model:asideCollapsed` 绑定,只写 `:aside-collapsed` 会让这些内部入口失效。完全不传该 prop 时退化为组件内部状态(默认折叠),内部入口照常生效。容器不会因为数据变空而自动收起或重置自定义 Tab。
@@ -246,7 +246,7 @@ ai-chat-container(:data-ai-size="size")
246
246
 
247
247
  ### 内置「文件产物」Tab
248
248
 
249
- 除「执行情况」外,容器内置一个常驻固定 Tab —— **「文件产物」**(`name: 'file-artifact'`),用于聚合预览当前会话所有 `AssistantMessage.property.artifacts`(按 `outputId` 去重):
249
+ 除「执行情况」外,容器内置一个常驻固定 Tab —— **「文件产物」**(`name: 'file-artifact'`),用于聚合预览当前会话具有 `outputId` 的助手产物、用户消息附件及输入框中上传成功的待发送附件(按 `outputId` 去重):
250
250
 
251
251
  - **常驻挂载 / 默认选中**:容器初始化即通过 `ensureCustomTab` 挂上该 Tab(不展开侧栏);因 `order: -1` 排在 Tab 栏首位,在用户未主动切换过 Tab 时它就是侧栏的默认面板。不随产物有无增删,无产物时由面板展示整块空态
252
252
  - **默认图标**:`ArtifactTabIcon`,16×16 线性折角文档,`fill` 走 `currentColor` 以继承 Tab 选中/默认色
@@ -620,6 +620,43 @@ ai-chat-container(:data-ai-size="size")
620
620
  3. 底部 `SelectionFooter` 提供全选、取消、确认操作
621
621
  4. 确认后触发 `confirmShare` 事件,携带选中的消息列表与触发按钮对象(`source`)
622
622
 
623
+ ## 输入框菜单与资源引用
624
+
625
+ `menuSources` 继承自 [ChatInput](/components/input/chat-input),一份数组按 `type` 分发到 `/`、`@`、`\` 与左下角 + 号。容器在此之上做了三件事:
626
+
627
+ **1. 会话产物自动收集**:`menuSources` 中没有 `artifact` 条目时,容器用 [`collectMessageArtifacts`](/utils/#会话产物收集) 从 `messages` 里收集产物补进去——来源是具有 `outputId` 的助手消息 `property.artifacts` 与用户消息二进制附件,不再回退到 URL 或文件名。上传响应的 `path` 由输入框映射为 `outputId`,尚未发送的成功附件也会追加到菜单。手动传入的 `artifact.id` 必须是对应文件的 `outputId`。业务方自己传了 `artifact` 条目时以传入的为准,容器不再自动补。没有产物时 `@` / + 号菜单不会出现「会话产物」分组。
628
+
629
+ **2. 资源引用入口**:容器通过 [useInputMention](/composables/use-input-mention) 提供 `insertMention`,消息区的文件卡片与侧栏产物面板因此能直接把文件「@ 进输入框」,无需逐层透传输入框实例。没有输入框的场景(`Share` 只读态)自动不显示引用按钮。
630
+
631
+ **3. 编辑态菜单下发**:`menuSources` 经 [useGlobalConfig](/composables/use-global-config) 注入,用户消息进入编辑态时就地渲染的 `ChatInput` 也能拿到同一份数据源。`supportUpload` 同样下发,编辑态输入框也会出现内置「文件」项。
632
+
633
+ ```vue
634
+ <template>
635
+ <ChatContainer
636
+ v-model="inputValue"
637
+ :menu-sources="menuSources"
638
+ :messages="messages"
639
+ :message-status="messageStatus"
640
+ :on-send-message="handleSendMessage"
641
+ />
642
+ </template>
643
+
644
+ <script setup lang="ts">
645
+ import { ref } from 'vue';
646
+ import { ChatContainer, type IInputMenuItem } from '@blueking/chat-x';
647
+
648
+ // 只需提供智能体能力与知识库;会话产物由容器从 messages 自动收集
649
+ const menuSources = ref<IInputMenuItem[]>([
650
+ { id: 'translate', type: 'skill', name: '翻译', description: '把选中的文本翻译成目标语言' },
651
+ { id: 'database-server', type: 'mcp', name: 'database-server' },
652
+ { id: 'kb-api', type: 'knowledgebase', name: 'API 接口文档' },
653
+ { id: 'prompt-article', type: 'prompt', name: '写文章', content: '帮我写一篇关于 {topic} 的文章' },
654
+ ]);
655
+ </script>
656
+ ```
657
+
658
+ > 用户消息要把 `@` 选中的资源以标签形态回显,需要业务侧把 `onSendMessage` 的 `docSchema` 存进 `message.property.docSchema`,详见 [MentionText](/components/rendering/mention-text)。
659
+
623
660
  ## 模型选择
624
661
 
625
662
  `ChatContainer` 将 `models`、`v-model:selected-model` 与 `@model-change` 透传至内部 [ChatInput](/components/input/chat-input)。传入 `models` 后,发送按钮左侧展示 [ModelSelector](/components/input/model-selector);选中值为模型的 `llm_name`,发送时可读取当前 `selectedModel`。
@@ -718,7 +755,7 @@ ChatContainer 的 Props 继承自 `ChatInputProps` 和 `MessageContainerProps`
718
755
  | onCustomTabChange | `(tab: CustomTab) => Promise<any>` | — | 自定义 Tab 切换回调,返回值作为 Tab 组件 props |
719
756
  | onArtifactClick | `(file: AIFileInfo) => Promise<{ download_url?: string; preview_url?: string }>` | — | 异步获取下载 / 预览链接(每次调用重新获取,无缓存;同文件并发去重)。文本类预览依赖 `download_url`,iframe 类依赖 `preview_url`;未传则隐藏下载、预览无数据 |
720
757
 
721
- > 其余 Props(如 `messages`、`messageStatus`、`onSendMessage`、`shortcuts`、`userMessageTools` 等)继承自 [ChatInput](/components/input/chat-input) 与 [MessageContainer](/components/setup/message-container)。`userMessageTools` 透传给内部 `MessageContainer`,用于按 id 覆盖或隐藏用户消息工具栏。
758
+ > 其余 Props(如 `messages`、`messageStatus`、`onSendMessage`、`menuSources`、`shortcuts`、`userMessageTools` 等)继承自 [ChatInput](/components/input/chat-input) 与 [MessageContainer](/components/setup/message-container)。`menuSources` 由容器补齐会话产物后再下发(见 [输入框菜单与资源引用](#输入框菜单与资源引用));`userMessageTools` 透传给内部 `MessageContainer`,用于按 id 覆盖或隐藏用户消息工具栏。
722
759
 
723
760
  ### v-model
724
761
 
@@ -743,6 +780,7 @@ ChatContainer 的 Props 继承自 `ChatInputProps` 和 `MessageContainerProps`
743
780
  | update:asideCollapsed | `(collapsed: boolean)` | 折叠态变更请求(`v-model:asideCollapsed`);受控时是否真的展开取决于外部是否更新该值 |
744
781
  | selectShortcut | `(shortcut: Shortcut)` | 选择快捷指令(继承自 ChatInput) |
745
782
  | deleteShortcut | — | 删除已选快捷指令(继承自 ChatInput) |
783
+ | deleteFile | `(file: Partial<UploadFile>)` | 取消输入框附件(继承自 ChatInput);业务方根据 `file.id` 调用删除接口,UI 立即移除,不等待结果 |
746
784
  | modelChange | `(model: IModelOption)` | 切换模型(继承自 ChatInput) |
747
785
 
748
786
  ### Slots
@@ -873,5 +911,6 @@ interface Shortcut {
873
911
  - [SelectionFooter](/components/input/selection-footer) — 多选操作栏
874
912
  - [ToolBtn](/components/feedback/tool-btn) — 侧栏全屏按钮
875
913
  - [useFullScreen](/composables/use-full-screen) — 侧栏全屏控制
876
- - [useGlobalConfig](/composables/use-global-config) — 注入 `size`、`supportUpload` 与 `timezone`
914
+ - [useGlobalConfig](/composables/use-global-config) — 注入 `size`、`supportUpload`、`timezone` 与 `menuSources`
915
+ - [useInputMention](/composables/use-input-mention) — 开放「资源插入输入框」能力
877
916
  - [主题配置](/theme/theme) — 字号主题 CSS 变量