@blueking/ai-blueking 2.1.3 → 2.1.4-beta.2

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,10 +1,15 @@
1
1
  import type { AIBluekingExpose, AIBluekingProps } from './types';
2
+ import type { Message, MessageToolsStatus } from '@blueking/chat-x';
2
3
  type __VLS_Slots = {
3
4
  codeHeader?: (props: {
4
5
  language: string;
5
6
  token: unknown[];
6
7
  }) => unknown;
7
8
  headerLeft?: () => unknown;
9
+ message?: (props: {
10
+ message: Message;
11
+ messageToolsStatus?: MessageToolsStatus;
12
+ }) => unknown;
8
13
  };
9
14
  declare const __VLS_base: import("vue").DefineComponent<AIBluekingProps, AIBluekingExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
15
  [x: string]: any;
@@ -1 +1 @@
1
- {"version":3,"file":"ai-blueking.vue.d.ts","sourceRoot":"","sources":["../src/ai-blueking.vue"],"names":[],"mappings":"AA8VE,OAAO,KAAK,EAAmB,gBAAgB,EAAE,eAAe,EAAY,MAAM,SAAS,CAAC;AAO5F,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC;IACxE,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;CAC5B,CAAC;AAulBJ,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAKd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ai-blueking.vue.d.ts","sourceRoot":"","sources":["../src/ai-blueking.vue"],"names":[],"mappings":"AAwWE,OAAO,KAAK,EAAmB,gBAAgB,EAAE,eAAe,EAAY,MAAM,SAAS,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAMpE,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC;IACxE,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;KAAE,KAAK,OAAO,CAAC;CAC7F,CAAC;AAkmBJ,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAKd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,12 +2,16 @@ import { RenderMode } from '@blueking/chat-x';
2
2
  import type { IShortcut } from '../manager/business/types';
3
3
  import type { IChatHelper } from '../types';
4
4
  import type { ChatBotExpose, ChatBotProps } from './types';
5
- import type { IAiSlashMenuItem } from '@blueking/chat-x';
5
+ import type { IAiSlashMenuItem, Message, MessageToolsStatus } from '@blueking/chat-x';
6
6
  type __VLS_Slots = {
7
7
  codeHeader?: (props: {
8
8
  language: string;
9
9
  token: unknown[];
10
10
  }) => unknown;
11
+ message?: (props: {
12
+ message: Message;
13
+ messageToolsStatus?: MessageToolsStatus;
14
+ }) => unknown;
11
15
  };
12
16
  declare const __VLS_base: import("vue").DefineComponent<ChatBotProps, ChatBotExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
17
  error: (error: Error) => any;
@@ -22,8 +26,8 @@ declare const __VLS_base: import("vue").DefineComponent<ChatBotProps, ChatBotExp
22
26
  }) => any;
23
27
  "session-switched": (session: import("@blueking/chat-helper").ISession<unknown, unknown> | null) => any;
24
28
  "agent-info-loaded": (chatHelper: IChatHelper) => any;
25
- "confirm-share": (messages: import("@blueking/chat-x").Message[]) => any;
26
- feedback: (tool: import("@blueking/chat-x").IToolBtn, message: import("@blueking/chat-x").Message, reasonList: string[], otherReason: string) => any;
29
+ "confirm-share": (messages: Message[]) => any;
30
+ feedback: (tool: import("@blueking/chat-x").IToolBtn, message: Message, reasonList: string[], otherReason: string) => any;
27
31
  "cancel-share": () => any;
28
32
  "execution-panel-change": (isCollapse: boolean) => any;
29
33
  "request-share": () => any;
@@ -40,8 +44,8 @@ declare const __VLS_base: import("vue").DefineComponent<ChatBotProps, ChatBotExp
40
44
  }) => any) | undefined;
41
45
  "onSession-switched"?: ((session: import("@blueking/chat-helper").ISession<unknown, unknown> | null) => any) | undefined;
42
46
  "onAgent-info-loaded"?: ((chatHelper: IChatHelper) => any) | undefined;
43
- "onConfirm-share"?: ((messages: import("@blueking/chat-x").Message[]) => any) | undefined;
44
- onFeedback?: ((tool: import("@blueking/chat-x").IToolBtn, message: import("@blueking/chat-x").Message, reasonList: string[], otherReason: string) => any) | undefined;
47
+ "onConfirm-share"?: ((messages: Message[]) => any) | undefined;
48
+ onFeedback?: ((tool: import("@blueking/chat-x").IToolBtn, message: Message, reasonList: string[], otherReason: string) => any) | undefined;
45
49
  "onCancel-share"?: (() => any) | undefined;
46
50
  "onExecution-panel-change"?: ((isCollapse: boolean) => any) | undefined;
47
51
  "onRequest-share"?: (() => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"chat-bot.vue.d.ts","sourceRoot":"","sources":["../../src/components/chat-bot.vue"],"names":[],"mappings":"AA8cE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAW9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAgB,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzE,OAAO,KAAK,EAAmB,gBAAgB,EAAY,MAAM,kBAAkB,CAAC;AAiBpF,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC;CACzE,CAAC;AA2ZJ,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAKd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"chat-bot.vue.d.ts","sourceRoot":"","sources":["../../src/components/chat-bot.vue"],"names":[],"mappings":"AAydE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAW9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAgB,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzE,OAAO,KAAK,EAAmB,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAY,MAAM,kBAAkB,CAAC;AAkBjH,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC;IACxE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;KAAE,KAAK,OAAO,CAAC;CAC7F,CAAC;AAoaJ,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAKd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -215,6 +215,10 @@ export declare function useAiBluekingInit(params: UseAiBluekingInitParams): {
215
215
  language: string;
216
216
  token: unknown[];
217
217
  }) => unknown;
218
+ message?: (props: {
219
+ message: import("@blueking/chat-x").Message;
220
+ messageToolsStatus?: import("@blueking/chat-x").MessageToolsStatus;
221
+ }) => unknown;
218
222
  };
219
223
  }) | undefined, ({
220
224
  $: import("vue").ComponentInternalInstance;
@@ -392,6 +396,10 @@ export declare function useAiBluekingInit(params: UseAiBluekingInitParams): {
392
396
  language: string;
393
397
  token: unknown[];
394
398
  }) => unknown;
399
+ message?: (props: {
400
+ message: import("@blueking/chat-x").Message;
401
+ messageToolsStatus?: import("@blueking/chat-x").MessageToolsStatus;
402
+ }) => unknown;
395
403
  };
396
404
  }) | undefined>;
397
405
  draggableContainerRef: import("vue").Ref<DraggableContainerExpose | undefined, DraggableContainerExpose | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-ai-blueking-init.d.ts","sourceRoot":"","sources":["../../src/composables/use-ai-blueking-init.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAGvE,OAAO,EAAE,qBAAqB,EAAkB,MAAM,oBAAoB,CAAC;AAG3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;AAE1E,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB;;;;;;;;;;;;;;;uBAe7D,CAAA;qBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsE8B,CAAC;6BAGrC,CAAC;mBAA0B,CAAC;mBAAiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAsIsulB,GAAG,8CAA8C,GAAG,y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AW,uBAAuB;IACtC,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB;;;;;;;;;;;;;;;uBAe7D,CAAA;qBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsE8B,CAAC;6BAGrC,CAAC;mBAA0B,CAAC;mBAAiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAsIsulB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAhNx4lB,CAAC;;wDAWjB,CAAH;;;;;;;;;;;;kCAqMwtN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAzIpqN,CAAC;6BAGrC,CAAC;mBAA0B,CAAC;mBAAiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAsIsulB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAhNx4lB,CAAC;;wDAWjB,CAAH;;;;;;;;;;;;kCAqMwtN,CAAC;;;;;;;;;;;;;;wBAjItsN,OAAO;;;;yBA9CG,KAAK;EA8KlC"}
package/dist/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export type { AIBluekingEmits, AIBluekingExpose, AIBluekingProps, DropdownMenuCo
10
10
  export type { IAgentInfo, IMessage, ISession, MessageRole, MessageStatus } from '@blueking/chat-helper';
11
11
  export { AGUIProtocol, useChatHelper } from '@blueking/chat-helper';
12
12
  export { MessageContentType, RenderMode } from '@blueking/chat-x';
13
+ export { parseCustomBlocks, type ContentBlock, type CustomBlock, type TextBlock } from './utils';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAGvH,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtH,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAE1F,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,kBAAkB,EACvB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,eAAe,EACf,cAAc,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Ae,GACrB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,kBAAkB,EACvB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,eAAe,EACf,cAAc,GACf,MAAM,WAAW,CAAC;AAGnB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGjH,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGxG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGpE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './message-utils';
2
+ export * from './parse-custom-blocks';
2
3
  /**
3
4
  * 获取 cookie
4
5
  * @param {*} name cookie 的名称
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AASA,cAAc,iBAAiB,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,WAQ3C,CAAC;AAWF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAc1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA6BpE;AAED;;GAEG;AACH,wBAAgB,WAAW,4CAc1B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,2BAErC;AAED;;GAEG;AACH,wBAAgB,KAAK,YAEpB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAMnE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AASA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,WAQ3C,CAAC;AAWF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAc1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA6BpE;AAED;;GAEG;AACH,wBAAgB,WAAW,4CAc1B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,2BAErC;AAED;;GAEG;AACH,wBAAgB,KAAK,YAEpB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAMnE"}
@@ -0,0 +1,22 @@
1
+ export interface CustomBlock {
2
+ type: 'custom';
3
+ data: Record<string, unknown>;
4
+ raw: string;
5
+ }
6
+ export interface TextBlock {
7
+ type: 'text';
8
+ content: string;
9
+ }
10
+ export type ContentBlock = CustomBlock | TextBlock;
11
+ /**
12
+ * 解析消息内容,将 ```custom-component 代码块识别为自定义组件,
13
+ * 其余部分作为普通 Markdown 文本。
14
+ *
15
+ * AI prompt 示例:
16
+ * 请使用以下格式输出自定义组件:
17
+ * ```custom-component
18
+ * {"type": "chart", "chartType": "bar", ...}
19
+ * ```
20
+ */
21
+ export declare function parseCustomBlocks(content: unknown): ContentBlock[];
22
+ //# sourceMappingURL=parse-custom-blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-custom-blocks.d.ts","sourceRoot":"","sources":["../../src/utils/parse-custom-blocks.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAEnD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,EAAE,CA4ClE"}
@@ -53784,141 +53784,145 @@ var Iq = /* @__PURE__ */ b({
53784
53784
  "stop"
53785
53785
  ],
53786
53786
  setup(e, { expose: t, emit: n }) {
53787
- let r = e, i = n, a = V(), o = V(), s = V(), c = W([]), l = V(null), d = u({
53787
+ let r = e, i = n, o = se(), s = V(), c = V(), l = V(), d = W([]), f = V(null), h = u({
53788
53788
  get: () => r.renderMode ?? IN.Chat,
53789
53789
  set: () => {}
53790
- }), f = async () => {
53791
- await M(), a.value && (a.value.scrollTop = a.value.scrollHeight);
53792
- }, p = () => {
53793
- s.value?.focus?.();
53794
- }, { chatHelper: h, isStandaloneMode: _, isInitialized: y, initError: b, chatBusinessManager: x, sessionBusinessManager: C, shortcutManager: w } = Aq({
53790
+ }), _ = async () => {
53791
+ await M(), s.value && (s.value.scrollTop = s.value.scrollHeight);
53792
+ }, y = () => {
53793
+ l.value?.focus?.();
53794
+ }, { chatHelper: b, isStandaloneMode: x, isInitialized: C, initError: w, chatBusinessManager: T, sessionBusinessManager: E, shortcutManager: O } = Aq({
53795
53795
  props: r,
53796
53796
  emit: i,
53797
- scrollToBottom: f
53798
- }), { userInput: T, cite: E, handleUpdateModelValue: O, doSendMessage: k, handleSendMessage: A, handleUpload: j, handleStopSending: I, stopGeneration: L } = Mq({
53797
+ scrollToBottom: _
53798
+ }), { userInput: k, cite: A, handleUpdateModelValue: j, doSendMessage: I, handleSendMessage: L, handleUpload: R, handleStopSending: z, stopGeneration: ee } = Mq({
53799
53799
  emit: i,
53800
- chatHelper: h,
53801
- chatBusinessManager: x,
53802
- selectedShortcut: l,
53803
- selectedResources: c
53804
- }), { handleSelectShortcut: R, handleCloseShortcut: z, handleShortcutSubmit: ee, selectShortcutWithText: te, getShortcutFromMessage: ne, buildShortcutProperty: H, sendShortcutDirectly: re } = Pq({
53800
+ chatHelper: b,
53801
+ chatBusinessManager: T,
53802
+ selectedShortcut: f,
53803
+ selectedResources: d
53804
+ }), { handleSelectShortcut: te, handleCloseShortcut: ne, handleShortcutSubmit: H, selectShortcutWithText: re, getShortcutFromMessage: G, buildShortcutProperty: ie, sendShortcutDirectly: ae } = Pq({
53805
53805
  props: r,
53806
53806
  emit: i,
53807
- chatHelper: h,
53808
- shortcutManager: w,
53809
- doSendMessage: k,
53810
- selectedShortcut: l
53811
- }), { messageStatus: G, messageToolsStatus: ie, messages: ae, isMessagesLoading: q, isGenerating: oe, currentSession: se, isWelcomeState: ce, openingRemark: le, effectiveResources: ue, effectivePrompts: de, effectiveSupportUpload: fe, chatbotStyle: pe, filteredShortcuts: me } = jq({
53807
+ chatHelper: b,
53808
+ shortcutManager: O,
53809
+ doSendMessage: I,
53810
+ selectedShortcut: f
53811
+ }), { messageStatus: q, messageToolsStatus: oe, messages: ce, isMessagesLoading: le, isGenerating: ue, currentSession: de, isWelcomeState: fe, openingRemark: pe, effectiveResources: me, effectivePrompts: he, effectiveSupportUpload: ge, chatbotStyle: _e, filteredShortcuts: ve } = jq({
53812
53812
  props: r,
53813
- chatHelper: h,
53814
- chatBusinessManager: x,
53815
- sessionBusinessManager: C,
53816
- shortcutManager: w,
53817
- isStandaloneMode: _,
53818
- isInitialized: y,
53819
- selectedShortcut: l
53820
- }), { handleAgentAction: he, handleAgentFeedback: ge, handleUserAction: _e, handleUserInputConfirm: ve, handleUserShortcutConfirm: ye, handleStopStreaming: be } = Fq({
53813
+ chatHelper: b,
53814
+ chatBusinessManager: T,
53815
+ sessionBusinessManager: E,
53816
+ shortcutManager: O,
53817
+ isStandaloneMode: x,
53818
+ isInitialized: C,
53819
+ selectedShortcut: f
53820
+ }), { handleAgentAction: ye, handleAgentFeedback: be, handleUserAction: xe, handleUserInputConfirm: Se, handleUserShortcutConfirm: Ce, handleStopStreaming: we } = Fq({
53821
53821
  emit: i,
53822
- chatHelper: h,
53823
- chatBusinessManager: x,
53824
- cite: E,
53825
- focusInput: p,
53826
- scrollToBottom: f,
53827
- getShortcutFromMessage: ne,
53828
- buildShortcutProperty: H
53829
- }), xe = u(() => !y.value || q.value), { handleConfirmShare: Se } = Nq({
53822
+ chatHelper: b,
53823
+ chatBusinessManager: T,
53824
+ cite: A,
53825
+ focusInput: y,
53826
+ scrollToBottom: _,
53827
+ getShortcutFromMessage: G,
53828
+ buildShortcutProperty: ie
53829
+ }), Te = u(() => !C.value || le.value), { handleConfirmShare: Ee } = Nq({
53830
53830
  emit: i,
53831
- chatHelper: h,
53832
- isStandaloneMode: _
53833
- }), Ce = (e) => {
53831
+ chatHelper: b,
53832
+ isStandaloneMode: x
53833
+ }), De = (e) => {
53834
53834
  i("execution-panel-change", e);
53835
- }, we = async (e) => {
53835
+ }, Oe = async (e) => {
53836
53836
  let t = e.data?.props;
53837
- if (t?.task_id != null && t?.node_id) return h.value?.message.getFlowAgentTaskNodeInfo(t.task_id, t.node_id);
53837
+ if (t?.task_id != null && t?.node_id) return b.value?.message.getFlowAgentTaskNodeInfo(t.task_id, t.node_id);
53838
53838
  };
53839
53839
  return t({
53840
- sendMessage: (e) => A(e, [[]]),
53841
- stopGeneration: L,
53840
+ sendMessage: (e) => L(e, [[]]),
53841
+ stopGeneration: ee,
53842
53842
  switchSession: async (e) => {
53843
- if (!C.value) {
53843
+ if (!E.value) {
53844
53844
  console.error("[ChatBot] Cannot switch session: sessionBusinessManager not initialized");
53845
53845
  return;
53846
53846
  }
53847
53847
  try {
53848
- await C.value.switchSession(e), i("session-switched", C.value.currentSession.value);
53848
+ await E.value.switchSession(e), i("session-switched", E.value.currentSession.value);
53849
53849
  } catch (e) {
53850
53850
  console.error("Failed to switch session:", e), i("error", e);
53851
53851
  }
53852
53852
  },
53853
- messages: ae,
53854
- currentSession: se,
53855
- isGenerating: oe,
53856
- getChatHelper: () => h.value,
53853
+ messages: ce,
53854
+ currentSession: de,
53855
+ isGenerating: ue,
53856
+ getChatHelper: () => b.value,
53857
53857
  setCiteText: (e) => {
53858
- E.value = e;
53858
+ A.value = e;
53859
53859
  },
53860
- focusInput: p,
53861
- enterShareMode: () => o.value?.enterShareMode(),
53862
- exitShareMode: () => o.value?.exitShareMode(),
53860
+ focusInput: y,
53861
+ enterShareMode: () => c.value?.enterShareMode(),
53862
+ exitShareMode: () => c.value?.exitShareMode(),
53863
53863
  selectShortcut: (e, t) => {
53864
- te(e, t);
53864
+ re(e, t);
53865
53865
  },
53866
- sendShortcut: (e, t) => re(e, t)
53866
+ sendShortcut: (e, t) => ae(e, t)
53867
53867
  }), (t, n) => (B(), m("div", {
53868
53868
  class: N([
53869
53869
  "ai-chatbot",
53870
53870
  r.extCls,
53871
- { "welcome-state": K(ce) }
53871
+ { "welcome-state": K(fe) }
53872
53872
  ]),
53873
- style: F(K(pe))
53873
+ style: F(K(_e))
53874
53874
  }, [v(K(TK), {
53875
53875
  ref_key: "chatContainerRef",
53876
- ref: o,
53877
- cite: K(E),
53878
- "onUpdate:cite": n[0] ||= (e) => D(E) ? E.value = e : null,
53879
- "selected-shortcut": l.value,
53880
- "onUpdate:selectedShortcut": n[1] ||= (e) => l.value = e,
53881
- "render-mode": d.value,
53882
- "onUpdate:renderMode": n[2] ||= (e) => d.value = e,
53883
- "chat-loading": xe.value,
53876
+ ref: c,
53877
+ cite: K(A),
53878
+ "onUpdate:cite": n[0] ||= (e) => D(A) ? A.value = e : null,
53879
+ "selected-shortcut": f.value,
53880
+ "onUpdate:selectedShortcut": n[1] ||= (e) => f.value = e,
53881
+ "render-mode": h.value,
53882
+ "onUpdate:renderMode": n[2] ||= (e) => h.value = e,
53883
+ "chat-loading": Te.value,
53884
53884
  "common-tippy-options": e.messageToolsTippyOptions,
53885
- "message-status": K(G),
53886
- "message-tools-status": K(ie),
53887
- messages: K(ae),
53888
- "model-value": K(T),
53889
- "on-agent-action": K(he),
53890
- "on-agent-feedback": K(ge),
53891
- "on-custom-tab-change": we,
53892
- "on-send-message": K(A),
53893
- "on-stop-sending": K(I),
53894
- "on-upload": K(j),
53895
- "on-user-action": K(_e),
53896
- "on-user-input-confirm": K(ve),
53897
- "on-user-shortcut-confirm": K(ye),
53898
- "opening-remark": K(le),
53885
+ "message-status": K(q),
53886
+ "message-tools-status": K(oe),
53887
+ messages: K(ce),
53888
+ "model-value": K(k),
53889
+ "on-agent-action": K(ye),
53890
+ "on-agent-feedback": K(be),
53891
+ "on-custom-tab-change": Oe,
53892
+ "on-send-message": K(L),
53893
+ "on-stop-sending": K(z),
53894
+ "on-upload": K(R),
53895
+ "on-user-action": K(xe),
53896
+ "on-user-input-confirm": K(Se),
53897
+ "on-user-shortcut-confirm": K(Ce),
53898
+ "opening-remark": K(pe),
53899
53899
  placeholder: r.placeholder,
53900
53900
  placement: r.placement,
53901
- prompts: K(de),
53901
+ prompts: K(he),
53902
53902
  "resize-props": r.resizeProps,
53903
- resources: K(ue),
53904
- "shortcut-id": l.value?.id,
53905
- shortcuts: K(me),
53906
- "support-upload": K(fe),
53907
- onCollapseChange: Ce,
53908
- onConfirmShare: K(Se),
53909
- onDeleteShortcut: K(z),
53910
- onSelectShortcut: K(R),
53911
- onShortcutClose: K(z),
53912
- onShortcutSubmit: K(ee),
53913
- onStopStreaming: K(be),
53914
- "onUpdate:modelValue": K(O)
53903
+ resources: K(me),
53904
+ "shortcut-id": f.value?.id,
53905
+ shortcuts: K(ve),
53906
+ "support-upload": K(ge),
53907
+ onCollapseChange: De,
53908
+ onConfirmShare: K(Ee),
53909
+ onDeleteShortcut: K(ne),
53910
+ onSelectShortcut: K(te),
53911
+ onShortcutClose: K(ne),
53912
+ onShortcutSubmit: K(H),
53913
+ onStopStreaming: K(we),
53914
+ "onUpdate:modelValue": K(j)
53915
53915
  }, {
53916
- message: J(({ message: n, messageToolsStatus: r }) => [v(K(JG), {
53916
+ message: J(({ message: n, messageToolsStatus: r }) => [p(" 消费方提供了 #message slot 时,优先使用消费方的渲染 "), K(o).message ? U(t.$slots, "message", {
53917
+ key: 0,
53918
+ message: n,
53919
+ messageToolsStatus: r
53920
+ }) : (B(), m(a, { key: 1 }, [p(" 否则使用默认的 MessageRender "), v(K(JG), {
53917
53921
  message: n,
53918
53922
  "message-tools-status": r,
53919
- "on-action": (e) => K(_e)(e, n),
53920
- "on-input-confirm": (e, t) => K(ve)(n, e, t),
53921
- "on-shortcut-confirm": (e) => K(ye)(n, e),
53923
+ "on-action": (e) => K(xe)(e, n),
53924
+ "on-input-confirm": (e, t) => K(Se)(n, e, t),
53925
+ "on-shortcut-confirm": (e) => K(Ce)(n, e),
53922
53926
  "tippy-options": e.messageToolsTippyOptions
53923
53927
  }, g({ _: 2 }, [t.$slots.codeHeader ? {
53924
53928
  name: "codeHeader",
@@ -53931,7 +53935,7 @@ var Iq = /* @__PURE__ */ b({
53931
53935
  "on-input-confirm",
53932
53936
  "on-shortcut-confirm",
53933
53937
  "tippy-options"
53934
- ])]),
53938
+ ])], 2112))]),
53935
53939
  _: 3
53936
53940
  }, 8, /* @__PURE__ */ "cite.selected-shortcut.render-mode.chat-loading.common-tippy-options.message-status.message-tools-status.messages.model-value.on-agent-action.on-agent-feedback.on-send-message.on-stop-sending.on-upload.on-user-action.on-user-input-confirm.on-user-shortcut-confirm.opening-remark.placeholder.placement.prompts.resize-props.resources.shortcut-id.shortcuts.support-upload.onConfirmShare.onDeleteShortcut.onSelectShortcut.onShortcutClose.onShortcutSubmit.onStopStreaming.onUpdate:modelValue".split("."))], 6));
53937
53941
  }
@@ -55674,6 +55678,10 @@ var xJ = { class: "draggable-container-content" }, SJ = /* @__PURE__ */ be(/* @_
55674
55678
  name: "codeHeader",
55675
55679
  fn: J((t) => [U(e.$slots, "codeHeader", P(S(t)), void 0, !0)]),
55676
55680
  key: "0"
55681
+ } : void 0, e.$slots.message ? {
55682
+ name: "message",
55683
+ fn: J((t) => [U(e.$slots, "message", P(S(t)), void 0, !0)]),
55684
+ key: "1"
55677
55685
  } : void 0]), 1032, [
55678
55686
  "always-create-new-session",
55679
55687
  "auto-load",
@@ -55753,7 +55761,7 @@ var xJ = { class: "draggable-container-content" }, SJ = /* @__PURE__ */ be(/* @_
55753
55761
  ])) : p("v-if", !0)
55754
55762
  ], 2)], 8, ["to"]));
55755
55763
  }
55756
- }), [["__scopeId", "data-v-a1adc8bc"]]), DJ = [
55764
+ }), [["__scopeId", "data-v-9223bc8d"]]), DJ = [
55757
55765
  "close",
55758
55766
  "show",
55759
55767
  "stop",