@blueking/chat-x 0.0.45-beta.4 → 0.0.45-beta.5

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.
@@ -1,4 +1,4 @@
1
- import { type UserMessage, MessageContentType, MessageStatus } from '../../ag-ui/types';
1
+ import { type Interrupt, type InterruptResume, type UserMessage, MessageContentType, MessageStatus } from '../../ag-ui/types';
2
2
  import { type AITippyProps, type IAiSlashMenuItem, type ISkillListItem, type Shortcut, type TagSchema, type UploadFile, UploadStatus } from '../../types';
3
3
  export type ChatInputEmits = {
4
4
  (e: 'selectShortcut', shortcut: Shortcut): void;
@@ -10,7 +10,10 @@ export type ChatInputProps = {
10
10
  inputMaxHeight?: number;
11
11
  messageStatus?: MessageStatus;
12
12
  modelValue: string | TagSchema;
13
- onSendMessage?: (message: UserMessage['content'], docSchema: TagSchema) => Promise<void>;
13
+ onSendMessage?: (message: UserMessage['content'], docSchema: TagSchema, options?: {
14
+ interrupt?: Interrupt;
15
+ payload?: InterruptResume;
16
+ }) => Promise<void>;
14
17
  onStopSending?: () => Promise<void>;
15
18
  onUpload?: (files: File) => Promise<{
16
19
  download_url?: string;
@@ -32,4 +32,4 @@ export declare const useUserQuestion: (getInterrupt: () => undefined | UserQuest
32
32
  * 自由文本 resume(用户在 chat-input 直接输入而非走结构化选择)。
33
33
  * 多题场景下信息有损:统一作为单条 Others 自由文本回传。
34
34
  */
35
- export declare const buildUserQuestionFreeTextResume: (interrupt: UserQuestionInterrupt, text: string) => UserQuestionResume;
35
+ export declare const buildSkipResumePayload: (interrupt?: UserQuestionInterrupt) => UserQuestionResume;
package/dist/index.js CHANGED
@@ -7875,28 +7875,17 @@ var Fd = ["src"], Id = {
7875
7875
  payload: { answers: l() }
7876
7876
  };
7877
7877
  },
7878
- buildSkipPayload: () => {
7879
- var t, n;
7880
- return {
7881
- interruptId: (t = (n = e()) == null ? void 0 : n.id) == null ? "" : t,
7882
- reason: gt.UserQuestion,
7883
- status: "cancelled",
7884
- payload: { answers: [] }
7885
- };
7886
- }
7878
+ buildSkipPayload: () => jf(e())
7887
7879
  };
7888
- }, jf = (e, t) => ({
7889
- interruptId: e.id,
7890
- reason: gt.UserQuestion,
7891
- status: "resolved",
7892
- payload: { answers: [{
7893
- question: "",
7894
- answer: [{
7895
- label: Of,
7896
- description: t
7897
- }]
7898
- }] }
7899
- }), Mf = { class: "ai-user-question-answered" }, Nf = { class: "ai-user-question-answered__header" }, Pf = { class: "ai-user-question-answered__title-wrap" }, Ff = { class: "ai-user-question-answered__title" }, If = { class: "ai-user-question-answered__status" }, Lf = { class: "ai-user-question-answered__body" }, Rf = { class: "ai-user-question-answered__question" }, zf = { class: "ai-user-question-answered__question-text" }, Bf = {
7880
+ }, jf = (e) => {
7881
+ var t;
7882
+ return {
7883
+ interruptId: (t = e == null ? void 0 : e.id) == null ? "" : t,
7884
+ reason: gt.UserQuestion,
7885
+ status: "cancelled",
7886
+ payload: { answers: [] }
7887
+ };
7888
+ }, Mf = { class: "ai-user-question-answered" }, Nf = { class: "ai-user-question-answered__header" }, Pf = { class: "ai-user-question-answered__title-wrap" }, Ff = { class: "ai-user-question-answered__title" }, If = { class: "ai-user-question-answered__status" }, Lf = { class: "ai-user-question-answered__body" }, Rf = { class: "ai-user-question-answered__question" }, zf = { class: "ai-user-question-answered__question-text" }, Bf = {
7900
7889
  key: 0,
7901
7890
  class: "ai-user-question-answered__tag"
7902
7891
  }, Vf = /* @__PURE__ */ m({
@@ -10145,11 +10134,10 @@ var Fd = ["src"], Id = {
10145
10134
  var e = X(function* (e, t) {
10146
10135
  var n;
10147
10136
  let r = Se.value;
10148
- if (u.onInterruptResume && r && typeof e == "string" && e.trim()) {
10149
- yield u.onInterruptResume(jf(r, e.trim()), r), Oe("", []);
10150
- return;
10151
- }
10152
- return (n = u.onSendMessage) == null ? void 0 : n.call(u, e, t);
10137
+ return (n = u.onSendMessage) == null ? void 0 : n.call(u, e, t, r ? {
10138
+ payload: jf(r),
10139
+ interrupt: r
10140
+ } : void 0);
10153
10141
  });
10154
10142
  return function(t, n) {
10155
10143
  return e.apply(this, arguments);
@@ -10636,4 +10624,4 @@ var Fd = ["src"], Id = {
10636
10624
  }
10637
10625
  }));
10638
10626
  //#endregion
10639
- export { Gt as AIBluekingBannerIcon, Wt as AIBluekingIcon, G as APPROVAL_STATUS, vt as APPROVAL_STATUS_MAP, Qn as ActiveLikeIcon, $n as ActiveUnLikeIcon, Hn as AgentIcon, Sg as AiImage, lr as AiLoading, hr as AiSelection, Ln as ArrowDownIcon, mn as ArrowLeftIcon, Xt as ArrowRightIcon, hn as ArrowRightPreviewIcon, en as BkFlowFailedIcon, nn as BkFlowPendingIcon, rn as BkFlowSkippedIcon, $t as BkFlowSuccessIcon, tn as BkFlowSuspendedIcon, Ct as CHAT_Z_INDEX, Ot as CONST_MESSAGE_TOOLS, At as CONST_UPDATE_TOOLS, kt as CONST_USER_MESSAGE_TOOLS, Ir as CONTAINER_SCROLL_TOKEN, Br as CUSTOM_TAB_TOKEN, _g as ChatContainer, wf as ChatInput, Cn as CheckCircleFillIcon, Gn as CiteIcon, Tn as CloseCircleFillIcon, yn as CloseCircleIcon, Bn as CloseIcon, Zc as CodeContent, Pn as CollapsedIcon, In as ContentLoadingIcon, Nl as ContentRender, Wn as CopyIcon, tr as DEFAULT_SHORTCUTS, nu as Delete, xn as DeleteCircleIcon, Xn as DeleteIcon, bn as DocLinkIcon, Kt as DocumentIcon, fn as DownloadIcon, Tt as EDITOR_MENU_Z_INDEX, wt as EDITOR_Z_INDEX, Vr as EXECUTION_TAB_NAME, Zn as EditIcon, kn as EnterIcon, Fn as ErrorIcon, an as ExecutionIcon, $h as ExecutionSummary, Sn as FileUploadIcon, dn as FitScreenIcon, Rn as FullScreenIcon, Kr as GLOBAL_CONFIG_TOKEN, Nt as HIGHLIGHT_KEYWORD_CLASS_NAME, Dn as HelpDocIcon, xp as HighlightKeyword, ld as IMAGE_PREVIEW_GROUP_KEY, _n as ImageBrokenIcon, il as ImageContent, Qt as ImageErrorIcon, Bd as ImagePreview, yg as ImagePreviewGroup, vn as ImageSizeIcon, On as InfoIcon, ru as InsertText, bh as InterruptMessageRender, gt as InterruptReason, yt as InterruptResumeOperation, Ft as LOADING_MESSAGE_ID, ol as LatexContent, Jn as LikeIcon, Zt as LinkIcon, Mn as LoadingMessageIcon, jt as MAX_UPLOAD_FILES, Mt as MAX_UPLOAD_FILE_SIZE, Al as MarkdownContent, It as MarkdownLanguageMap, cl as MermaidContent, Hh as MessageContainer, _t as MessageContentType, ag as MessageLoading, zh as MessageRender, K as MessageRole, ud as MessageState, q as MessageStatus, bp as MessageTools, fd as MessageToolsStatus, hp as MessageUserFeedback, Un as MoreAgentIcon, Vn as MoreIcon, on as NodeOutputIcon, sn as NodeTabIcon, Of as OTHERS_OPTION_LABEL, _i as OverflowTips, pn as PreviewCloseIcon, qt as PreviewIcon, Kn as RebuildIcon, gn as ReloadIcon, Yt as RemoveIcon, Pt as RenderMode, iu as ReplaceAll, En as RevokedIcon, un as RotateIcon, Dt as SELECTION_Z_INDEX, Et as SHORTCUT_MENU_Z_INDEX, Lr as SHOW_SCROLL_BOTTOM_BTN_DISTANCE, nr as ScrollBtn, ug as SelectionFooter, jn as SendMessageIcon, qn as ShareIcon, fr as ShortcutBtn, yr as ShortcutBtns, Ar as ShortcutRender, An as SkipIcon, Jt as TargetIcon, Nn as ThinkingIcon, wn as TimeIcon, eh as ToolCallRender, er as ToolIconsMap, zn as UnFullScreenIcon, Yn as UnLikeIcon, dd as UploadStatus, xt as UserMultiChoiceQuestionSchema, Vf as UserQuestionAnsweredCard, ip as UserQuestionCard, qf as UserQuestionChoice, Gf as UserQuestionOption, St as UserQuestionSchema, bt as UserSingleChoiceQuestionSchema, Dl as VNodeRenderer, cn as ZoomInIcon, ln as ZoomOutIcon, jf as buildUserQuestionFreeTextResume, dl as commonErrorContent, J as commonSVGProps, Qe as completeMarkdownSyntax, nd as createEditor, Ll as docToString, dt as formatDuration, pt as formatElapsedTime, Ve as formatFileSize, He as formatUploadNotAddedMessage, ft as generateUUID, ut as getCookieByName, Be as getFileExtension, ze as getFilePreviewUrl, ii as getScrollParent, Jr as injectGlobalConfig, mt as isEn, Re as isImageFile, ht as lang, Dc as markdownAnimationAttrs, Pc as markdownItBkInlineStyle, zc as markdownItLatex, Vc as markdownItMermaid, ou as microtask, au as min, Ue as needsMarkdownCompletion, cd as noop, rd as plainSchema, We as removeCompletionSuffix, sd as resourceTypeMap, od as schema, Rl as stringToDoc, W as t, kf as toLetter, jr as useAnimationText, Pr as useClipboard, Fr as useCommandSelection, zr as useContainerScrollConsumer, Rr as useContainerScrollProvider, Ur as useCustomTabConsumer, Hr as useCustomTabProvider, Gr as useFullScreen, qr as useGlobalConfig, Yr as useMenuKeydown, ri as useMessageGroup, gr as useObserverVisibleList, ai as useParentScrolling, Af as useUserQuestion, ad as voidNode };
10627
+ export { Gt as AIBluekingBannerIcon, Wt as AIBluekingIcon, G as APPROVAL_STATUS, vt as APPROVAL_STATUS_MAP, Qn as ActiveLikeIcon, $n as ActiveUnLikeIcon, Hn as AgentIcon, Sg as AiImage, lr as AiLoading, hr as AiSelection, Ln as ArrowDownIcon, mn as ArrowLeftIcon, Xt as ArrowRightIcon, hn as ArrowRightPreviewIcon, en as BkFlowFailedIcon, nn as BkFlowPendingIcon, rn as BkFlowSkippedIcon, $t as BkFlowSuccessIcon, tn as BkFlowSuspendedIcon, Ct as CHAT_Z_INDEX, Ot as CONST_MESSAGE_TOOLS, At as CONST_UPDATE_TOOLS, kt as CONST_USER_MESSAGE_TOOLS, Ir as CONTAINER_SCROLL_TOKEN, Br as CUSTOM_TAB_TOKEN, _g as ChatContainer, wf as ChatInput, Cn as CheckCircleFillIcon, Gn as CiteIcon, Tn as CloseCircleFillIcon, yn as CloseCircleIcon, Bn as CloseIcon, Zc as CodeContent, Pn as CollapsedIcon, In as ContentLoadingIcon, Nl as ContentRender, Wn as CopyIcon, tr as DEFAULT_SHORTCUTS, nu as Delete, xn as DeleteCircleIcon, Xn as DeleteIcon, bn as DocLinkIcon, Kt as DocumentIcon, fn as DownloadIcon, Tt as EDITOR_MENU_Z_INDEX, wt as EDITOR_Z_INDEX, Vr as EXECUTION_TAB_NAME, Zn as EditIcon, kn as EnterIcon, Fn as ErrorIcon, an as ExecutionIcon, $h as ExecutionSummary, Sn as FileUploadIcon, dn as FitScreenIcon, Rn as FullScreenIcon, Kr as GLOBAL_CONFIG_TOKEN, Nt as HIGHLIGHT_KEYWORD_CLASS_NAME, Dn as HelpDocIcon, xp as HighlightKeyword, ld as IMAGE_PREVIEW_GROUP_KEY, _n as ImageBrokenIcon, il as ImageContent, Qt as ImageErrorIcon, Bd as ImagePreview, yg as ImagePreviewGroup, vn as ImageSizeIcon, On as InfoIcon, ru as InsertText, bh as InterruptMessageRender, gt as InterruptReason, yt as InterruptResumeOperation, Ft as LOADING_MESSAGE_ID, ol as LatexContent, Jn as LikeIcon, Zt as LinkIcon, Mn as LoadingMessageIcon, jt as MAX_UPLOAD_FILES, Mt as MAX_UPLOAD_FILE_SIZE, Al as MarkdownContent, It as MarkdownLanguageMap, cl as MermaidContent, Hh as MessageContainer, _t as MessageContentType, ag as MessageLoading, zh as MessageRender, K as MessageRole, ud as MessageState, q as MessageStatus, bp as MessageTools, fd as MessageToolsStatus, hp as MessageUserFeedback, Un as MoreAgentIcon, Vn as MoreIcon, on as NodeOutputIcon, sn as NodeTabIcon, Of as OTHERS_OPTION_LABEL, _i as OverflowTips, pn as PreviewCloseIcon, qt as PreviewIcon, Kn as RebuildIcon, gn as ReloadIcon, Yt as RemoveIcon, Pt as RenderMode, iu as ReplaceAll, En as RevokedIcon, un as RotateIcon, Dt as SELECTION_Z_INDEX, Et as SHORTCUT_MENU_Z_INDEX, Lr as SHOW_SCROLL_BOTTOM_BTN_DISTANCE, nr as ScrollBtn, ug as SelectionFooter, jn as SendMessageIcon, qn as ShareIcon, fr as ShortcutBtn, yr as ShortcutBtns, Ar as ShortcutRender, An as SkipIcon, Jt as TargetIcon, Nn as ThinkingIcon, wn as TimeIcon, eh as ToolCallRender, er as ToolIconsMap, zn as UnFullScreenIcon, Yn as UnLikeIcon, dd as UploadStatus, xt as UserMultiChoiceQuestionSchema, Vf as UserQuestionAnsweredCard, ip as UserQuestionCard, qf as UserQuestionChoice, Gf as UserQuestionOption, St as UserQuestionSchema, bt as UserSingleChoiceQuestionSchema, Dl as VNodeRenderer, cn as ZoomInIcon, ln as ZoomOutIcon, jf as buildSkipResumePayload, dl as commonErrorContent, J as commonSVGProps, Qe as completeMarkdownSyntax, nd as createEditor, Ll as docToString, dt as formatDuration, pt as formatElapsedTime, Ve as formatFileSize, He as formatUploadNotAddedMessage, ft as generateUUID, ut as getCookieByName, Be as getFileExtension, ze as getFilePreviewUrl, ii as getScrollParent, Jr as injectGlobalConfig, mt as isEn, Re as isImageFile, ht as lang, Dc as markdownAnimationAttrs, Pc as markdownItBkInlineStyle, zc as markdownItLatex, Vc as markdownItMermaid, ou as microtask, au as min, Ue as needsMarkdownCompletion, cd as noop, rd as plainSchema, We as removeCompletionSuffix, sd as resourceTypeMap, od as schema, Rl as stringToDoc, W as t, kf as toLetter, jr as useAnimationText, Pr as useClipboard, Fr as useCommandSelection, zr as useContainerScrollConsumer, Rr as useContainerScrollProvider, Ur as useCustomTabConsumer, Hr as useCustomTabProvider, Gr as useFullScreen, qr as useGlobalConfig, Yr as useMenuKeydown, ri as useMessageGroup, gr as useObserverVisibleList, ai as useParentScrolling, Af as useUserQuestion, ad as voidNode };