@blueking/chat-helper 0.0.1-beta.12 → 0.0.1-beta.14

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.
@@ -51,6 +51,7 @@ export interface IAgentCommandComponentApi {
51
51
  }
52
52
  export interface IAgentInfo {
53
53
  agentName?: string;
54
+ resources?: IAgentResources;
54
55
  saasUrl?: string;
55
56
  chatGroup?: {
56
57
  enabled: boolean;
@@ -69,6 +70,7 @@ export interface IAgentInfo {
69
70
  }
70
71
  export interface IAgentInfoApi {
71
72
  agent_name: string;
73
+ resources?: IAgentResources;
72
74
  saas_url?: string;
73
75
  chat_group?: {
74
76
  enabled: boolean;
@@ -85,3 +87,15 @@ export interface IAgentInfoApi {
85
87
  content?: IMessage[];
86
88
  };
87
89
  }
90
+ export interface IAgentResourceItem {
91
+ code: string;
92
+ icon: null | string;
93
+ id: null | number;
94
+ name: string;
95
+ }
96
+ export interface IAgentResources {
97
+ command?: IAgentResourceItem[];
98
+ knowledgebase?: IAgentResourceItem[];
99
+ mcp?: IAgentResourceItem[];
100
+ tool?: IAgentResourceItem[];
101
+ }
@@ -11,6 +11,32 @@ import type { IAgentInfo } from './type';
11
11
  export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtocol) => {
12
12
  info: import("vue").Ref<{
13
13
  agentName?: string;
14
+ resources?: {
15
+ command?: {
16
+ code: string;
17
+ icon: null | string;
18
+ id: null | number;
19
+ name: string;
20
+ }[];
21
+ knowledgebase?: {
22
+ code: string;
23
+ icon: null | string;
24
+ id: null | number;
25
+ name: string;
26
+ }[];
27
+ mcp?: {
28
+ code: string;
29
+ icon: null | string;
30
+ id: null | number;
31
+ name: string;
32
+ }[];
33
+ tool?: {
34
+ code: string;
35
+ icon: null | string;
36
+ id: null | number;
37
+ name: string;
38
+ }[];
39
+ };
14
40
  saasUrl?: string;
15
41
  chatGroup?: {
16
42
  enabled: boolean;
@@ -272,6 +298,32 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
272
298
  };
273
299
  }, IAgentInfo | {
274
300
  agentName?: string;
301
+ resources?: {
302
+ command?: {
303
+ code: string;
304
+ icon: null | string;
305
+ id: null | number;
306
+ name: string;
307
+ }[];
308
+ knowledgebase?: {
309
+ code: string;
310
+ icon: null | string;
311
+ id: null | number;
312
+ name: string;
313
+ }[];
314
+ mcp?: {
315
+ code: string;
316
+ icon: null | string;
317
+ id: null | number;
318
+ name: string;
319
+ }[];
320
+ tool?: {
321
+ code: string;
322
+ icon: null | string;
323
+ id: null | number;
324
+ name: string;
325
+ }[];
326
+ };
275
327
  saasUrl?: string;
276
328
  chatGroup?: {
277
329
  enabled: boolean;
@@ -535,7 +587,7 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
535
587
  isInfoLoading: import("vue").Ref<boolean, boolean>;
536
588
  isChatting: import("vue").Ref<boolean, boolean>;
537
589
  chat: (userInput: IUserMessage["content"], sessionCode: string, url?: string, config?: IRequestConfig, property?: IMessageProperty) => Promise<void>;
538
- resendMessage: (messageId: string, sessionCode: string, newContent?: string, url?: string, config?: IRequestConfig) => Promise<void>;
590
+ resendMessage: (messageId: string, sessionCode: string, newContent?: IUserMessage["content"], url?: string, config?: IRequestConfig) => Promise<void>;
539
591
  resumeStreamingChat: (sessionCode: string, url?: string, config?: IRequestConfig) => void;
540
592
  abortChat: () => void;
541
593
  stopChat: (sessionCode: string) => Promise<void>;
@@ -212,7 +212,7 @@ import { MessageRole, MessageStatus } from '../message/index.ts.js';
212
212
  *
213
213
  * @param messageId - 用户消息 ID(id 字段)
214
214
  * @param sessionCode - 会话编码
215
- * @param newContent - 新内容(可选,不传则使用原消息内容)
215
+ * @param newContent - 新内容(可选,不传则使用原消息内容;支持多模态)
216
216
  * @param url - 请求 URL(可选)
217
217
  * @param config - 请求配置(可选)
218
218
  */ const resendMessage = function() {
@@ -229,7 +229,7 @@ import { MessageRole, MessageStatus } from '../message/index.ts.js';
229
229
  throw new Error('Can only resend user messages');
230
230
  }
231
231
  // 2. 获取原消息内容和 property(在删除前保存)
232
- const originalContent = typeof targetMessage.content === 'string' ? targetMessage.content : JSON.stringify(targetMessage.content);
232
+ const originalContent = targetMessage.content;
233
233
  const originalProperty = targetMessage.property;
234
234
  // 3. 确定最终发送的内容
235
235
  const finalContent = newContent !== null && newContent !== void 0 ? newContent : originalContent;
@@ -63,6 +63,7 @@
63
63
  staff: data.chat_group.staff,
64
64
  username: data.chat_group.username
65
65
  } : undefined,
66
- saasUrl: data === null || data === void 0 ? void 0 : data.saas_url
66
+ saasUrl: data === null || data === void 0 ? void 0 : data.saas_url,
67
+ resources: data === null || data === void 0 ? void 0 : data.resources
67
68
  };
68
69
  };
package/dist/index.d.ts CHANGED
@@ -13,6 +13,32 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
13
13
  agent: {
14
14
  info: import("vue").Ref<{
15
15
  agentName?: string;
16
+ resources?: {
17
+ command?: {
18
+ code: string;
19
+ icon: null | string;
20
+ id: null | number;
21
+ name: string;
22
+ }[];
23
+ knowledgebase?: {
24
+ code: string;
25
+ icon: null | string;
26
+ id: null | number;
27
+ name: string;
28
+ }[];
29
+ mcp?: {
30
+ code: string;
31
+ icon: null | string;
32
+ id: null | number;
33
+ name: string;
34
+ }[];
35
+ tool?: {
36
+ code: string;
37
+ icon: null | string;
38
+ id: null | number;
39
+ name: string;
40
+ }[];
41
+ };
16
42
  saasUrl?: string;
17
43
  chatGroup?: {
18
44
  enabled: boolean;
@@ -274,6 +300,32 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
274
300
  };
275
301
  }, import("./agent").IAgentInfo | {
276
302
  agentName?: string;
303
+ resources?: {
304
+ command?: {
305
+ code: string;
306
+ icon: null | string;
307
+ id: null | number;
308
+ name: string;
309
+ }[];
310
+ knowledgebase?: {
311
+ code: string;
312
+ icon: null | string;
313
+ id: null | number;
314
+ name: string;
315
+ }[];
316
+ mcp?: {
317
+ code: string;
318
+ icon: null | string;
319
+ id: null | number;
320
+ name: string;
321
+ }[];
322
+ tool?: {
323
+ code: string;
324
+ icon: null | string;
325
+ id: null | number;
326
+ name: string;
327
+ }[];
328
+ };
277
329
  saasUrl?: string;
278
330
  chatGroup?: {
279
331
  enabled: boolean;
@@ -537,7 +589,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
537
589
  isInfoLoading: import("vue").Ref<boolean, boolean>;
538
590
  isChatting: import("vue").Ref<boolean, boolean>;
539
591
  chat: (userInput: import("./message").IUserMessage["content"], sessionCode: string, url?: string, config?: import("./http").IRequestConfig, property?: import("./message").IMessageProperty) => Promise<void>;
540
- resendMessage: (messageId: string, sessionCode: string, newContent?: string, url?: string, config?: import("./http").IRequestConfig) => Promise<void>;
592
+ resendMessage: (messageId: string, sessionCode: string, newContent?: import("./message").IUserMessage["content"], url?: string, config?: import("./http").IRequestConfig) => Promise<void>;
541
593
  resumeStreamingChat: (sessionCode: string, url?: string, config?: import("./http").IRequestConfig) => void;
542
594
  abortChat: () => void;
543
595
  stopChat: (sessionCode: string) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/chat-helper",
3
- "version": "0.0.1-beta.12",
3
+ "version": "0.0.1-beta.14",
4
4
  "description": "",
5
5
  "main": "./dist/index.ts.js",
6
6
  "types": "./dist/index.d.ts",