@blueking/chat-helper 0.0.1-beta.3 → 0.0.1-beta.31

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 (43) hide show
  1. package/README.md +962 -63
  2. package/dist/agent/type.d.ts +27 -2
  3. package/dist/agent/type.ts.js +1 -1
  4. package/dist/agent/use-agent.d.ts +516 -434
  5. package/dist/agent/use-agent.ts.js +224 -25
  6. package/dist/event/ag-ui.d.ts +39 -7
  7. package/dist/event/ag-ui.ts.js +224 -150
  8. package/dist/event/type.d.ts +99 -107
  9. package/dist/event/type.ts.js +34 -11
  10. package/dist/http/fetch/fetch.d.ts +40 -36
  11. package/dist/http/fetch/fetch.ts.js +59 -32
  12. package/dist/http/fetch/index.d.ts +1 -0
  13. package/dist/http/fetch/index.ts.js +17 -1
  14. package/dist/http/index.d.ts +25 -16
  15. package/dist/http/index.ts.js +60 -3
  16. package/dist/http/module/agent.d.ts +2 -2
  17. package/dist/http/module/index.d.ts +23 -16
  18. package/dist/http/module/index.ts.js +2 -1
  19. package/dist/http/module/message.d.ts +23 -7
  20. package/dist/http/module/message.ts.js +52 -7
  21. package/dist/http/module/session.d.ts +14 -11
  22. package/dist/http/module/session.ts.js +66 -4
  23. package/dist/http/transform/agent.ts.js +11 -8
  24. package/dist/http/transform/message.d.ts +6 -6
  25. package/dist/http/transform/message.ts.js +568 -118
  26. package/dist/http/transform/session.ts.js +9 -1
  27. package/dist/index.d.ts +2996 -2616
  28. package/dist/index.ts.js +26 -5
  29. package/dist/mediator/index.d.ts +2 -0
  30. package/dist/mediator/index.ts.js +26 -0
  31. package/dist/mediator/type.d.ts +50 -0
  32. package/dist/mediator/type.ts.js +28 -0
  33. package/dist/mediator/use-mediator.d.ts +7 -0
  34. package/dist/mediator/use-mediator.ts.js +47 -0
  35. package/dist/message/type.d.ts +280 -140
  36. package/dist/message/type.ts.js +16 -15
  37. package/dist/message/use-message.d.ts +837 -750
  38. package/dist/message/use-message.ts.js +226 -28
  39. package/dist/session/type.d.ts +10 -0
  40. package/dist/session/use-session.d.ts +1921 -1721
  41. package/dist/session/use-session.ts.js +198 -33
  42. package/dist/type.d.ts +4 -4
  43. package/package.json +2 -1
@@ -1,10 +1,23 @@
1
- import type { IHttpModule } from '../http';
2
- import type { IMessageModule } from '../message';
3
- import type { IUseChatHelperOptions } from '../type';
1
+ import { MessageRole, MessageStatus } from '../message';
2
+ import type { IRequestConfig, ISSEProtocol } from '../http';
3
+ import type { IMediatorModule } from '../mediator';
4
+ import type { IMessageProperty, IUserMessage } from '../message/type';
4
5
  import type { IAgentInfo } from './type';
5
- export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModule, message: IMessageModule) => {
6
+ /**
7
+ * Agent 模块
8
+ * @param options - 配置选项
9
+ * @param mediator - 中介者模块,用于获取其他模块的引用
10
+ */
11
+ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtocol) => {
6
12
  info: import("vue").Ref<{
7
13
  agentName?: string;
14
+ resources?: {
15
+ code: string;
16
+ icon: null | string;
17
+ id: null | number;
18
+ name: string;
19
+ type: string;
20
+ }[];
8
21
  saasUrl?: string;
9
22
  chatGroup?: {
10
23
  enabled: boolean;
@@ -14,6 +27,7 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
14
27
  conversationSettings?: {
15
28
  commands?: {
16
29
  agentId: number;
30
+ alias?: string;
17
31
  components: {
18
32
  default?: null | string;
19
33
  fillBack?: boolean;
@@ -36,6 +50,9 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
36
50
  id: string;
37
51
  name: string;
38
52
  status: string;
53
+ supportUpload?: {
54
+ vision: boolean;
55
+ };
39
56
  }[];
40
57
  enableChatSession?: boolean;
41
58
  openingRemark?: string;
@@ -43,232 +60,263 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
43
60
  };
44
61
  promptSetting?: {
45
62
  content?: ({
46
- role: import("../message").MessageRole.Assistant;
47
- content: ({
48
- type: import("../message").MessageContentType.Image;
49
- data: {
50
- height?: number;
51
- url: string;
52
- width?: number;
53
- };
54
- status: import("../message").MessageContentStatus;
63
+ activityType: import("../message").ActivityType;
64
+ content: {
65
+ nodes: Record<string, import("../event").IFlowAgentNode>;
66
+ task_id: number;
67
+ task_name: string;
68
+ task_outputs: string[];
69
+ task_state: import("../event").FlowTaskState;
55
70
  } | {
56
- type: import("../message").MessageContentType.ReferenceDocument;
57
- data: {
58
- icon?: string;
71
+ content: string;
72
+ referenceDocument: {
73
+ name: string;
59
74
  originFileUrl?: string;
60
- title: string;
61
75
  url: string;
62
76
  }[];
63
- status: import("../message").MessageContentStatus;
64
- } | {
65
- data: string;
66
- id?: number;
67
- type: import("../message").MessageContentType.Text;
68
- status: import("../message").MessageContentStatus;
69
77
  } | {
70
- type: import("../message").MessageContentType.Thinking;
71
- data: {
72
- duration?: number;
73
- text: string;
74
- title?: string;
78
+ name: string;
79
+ originFileUrl?: string;
80
+ url: string;
81
+ }[];
82
+ role: MessageRole.Activity;
83
+ id?: string;
84
+ messageId?: string;
85
+ name?: string;
86
+ sessionCode?: string;
87
+ status: MessageStatus;
88
+ } | {
89
+ content?: string;
90
+ property?: {
91
+ [x: string]: unknown;
92
+ extra?: {
93
+ [x: string]: unknown;
94
+ cite?: string | {
95
+ data: {
96
+ key: string;
97
+ value: string;
98
+ }[];
99
+ title: string;
100
+ type: string;
101
+ };
102
+ command?: string;
103
+ context?: Array<Record<string, unknown>>;
104
+ resources?: Array<Record<string, unknown>>;
75
105
  };
76
- status: import("../message").MessageContentStatus;
77
- } | {
78
- type: import("../message").MessageContentType.ToolCall;
79
- data: {
80
- args?: string;
81
- chunk?: string;
82
- parentMessageId?: string;
83
- result?: string;
84
- toolCallId: string;
85
- toolCallName: string;
106
+ };
107
+ role: MessageRole.Assistant;
108
+ toolCalls?: {
109
+ function: {
110
+ arguments: string;
111
+ description?: string;
112
+ mcpName?: string;
113
+ name: string;
86
114
  };
87
- status: import("../message").MessageContentStatus;
115
+ id: string;
116
+ type: import("../message").MessageType.Function;
117
+ }[];
118
+ id?: string;
119
+ messageId?: string;
120
+ name?: string;
121
+ sessionCode?: string;
122
+ status: MessageStatus;
123
+ } | {
124
+ content: string;
125
+ role: MessageRole.Developer;
126
+ id?: string;
127
+ messageId?: string;
128
+ name?: string;
129
+ sessionCode?: string;
130
+ status: MessageStatus;
131
+ } | {
132
+ content: string;
133
+ role: MessageRole.Guide;
134
+ id?: string;
135
+ messageId?: string;
136
+ name?: string;
137
+ sessionCode?: string;
138
+ status: MessageStatus;
139
+ } | {
140
+ content: string;
141
+ role: MessageRole.HiddenAssistant;
142
+ id?: string;
143
+ messageId?: string;
144
+ name?: string;
145
+ sessionCode?: string;
146
+ status: MessageStatus;
147
+ } | {
148
+ content: string;
149
+ role: MessageRole.HiddenGuide;
150
+ id?: string;
151
+ messageId?: string;
152
+ name?: string;
153
+ sessionCode?: string;
154
+ status: MessageStatus;
155
+ } | {
156
+ content: string;
157
+ role: MessageRole.Hidden;
158
+ id?: string;
159
+ messageId?: string;
160
+ name?: string;
161
+ sessionCode?: string;
162
+ status: MessageStatus;
163
+ } | {
164
+ content: string;
165
+ role: MessageRole.HiddenSystem;
166
+ id?: string;
167
+ messageId?: string;
168
+ name?: string;
169
+ sessionCode?: string;
170
+ status: MessageStatus;
171
+ } | {
172
+ content: string;
173
+ role: MessageRole.HiddenUser;
174
+ id?: string;
175
+ messageId?: string;
176
+ name?: string;
177
+ sessionCode?: string;
178
+ status: MessageStatus;
179
+ } | {
180
+ content: string;
181
+ role: MessageRole.Info;
182
+ id?: string;
183
+ messageId?: string;
184
+ name?: string;
185
+ sessionCode?: string;
186
+ status: MessageStatus;
187
+ } | {
188
+ content: string;
189
+ role: MessageRole.Pause;
190
+ id?: string;
191
+ messageId?: string;
192
+ name?: string;
193
+ sessionCode?: string;
194
+ status: MessageStatus;
195
+ } | {
196
+ content: string;
197
+ role: MessageRole.Placeholder;
198
+ id?: string;
199
+ messageId?: string;
200
+ name?: string;
201
+ sessionCode?: string;
202
+ status: MessageStatus;
203
+ } | {
204
+ content: string[];
205
+ duration?: number;
206
+ role: MessageRole.Reasoning;
207
+ id?: string;
208
+ messageId?: string;
209
+ name?: string;
210
+ sessionCode?: string;
211
+ status: MessageStatus;
212
+ } | {
213
+ content: string;
214
+ role: MessageRole.System;
215
+ id?: string;
216
+ messageId?: string;
217
+ name?: string;
218
+ sessionCode?: string;
219
+ status: MessageStatus;
220
+ } | {
221
+ content: string;
222
+ role: MessageRole.TemplateAssistant;
223
+ id?: string;
224
+ messageId?: string;
225
+ name?: string;
226
+ sessionCode?: string;
227
+ status: MessageStatus;
228
+ } | {
229
+ content: string;
230
+ role: MessageRole.TemplateGuide;
231
+ id?: string;
232
+ messageId?: string;
233
+ name?: string;
234
+ sessionCode?: string;
235
+ status: MessageStatus;
236
+ } | {
237
+ content: string;
238
+ role: MessageRole.TemplateHidden;
239
+ id?: string;
240
+ messageId?: string;
241
+ name?: string;
242
+ sessionCode?: string;
243
+ status: MessageStatus;
244
+ } | {
245
+ content: string;
246
+ role: MessageRole.TemplateSystem;
247
+ id?: string;
248
+ messageId?: string;
249
+ name?: string;
250
+ sessionCode?: string;
251
+ status: MessageStatus;
252
+ } | {
253
+ content: string;
254
+ role: MessageRole.TemplateUser;
255
+ id?: string;
256
+ messageId?: string;
257
+ name?: string;
258
+ sessionCode?: string;
259
+ status: MessageStatus;
260
+ } | {
261
+ content: string;
262
+ duration?: number;
263
+ error?: string;
264
+ role: MessageRole.Tool;
265
+ toolCallId: string;
266
+ id?: string;
267
+ messageId?: string;
268
+ name?: string;
269
+ sessionCode?: string;
270
+ status: MessageStatus;
271
+ } | {
272
+ content: string | ({
273
+ data?: string;
274
+ filename?: string;
275
+ id?: string;
276
+ mimeType: string;
277
+ type: import("../message").MessageType.Binary;
278
+ url?: string;
279
+ } | {
280
+ text: string;
281
+ type: import("../message").MessageType.Text;
88
282
  })[];
89
- id: number;
90
- property?: Record<string, unknown>;
91
- status?: import("../message").MessageStatus;
92
- } | {
93
- content: {
94
- data: string;
95
- id?: number;
96
- type: import("../message").MessageContentType.Text;
97
- status: import("../message").MessageContentStatus;
98
- }[];
99
- role: import("../message").MessageRole.Guide;
100
- id: number;
101
- property?: Record<string, unknown>;
102
- status?: import("../message").MessageStatus;
103
- } | {
104
- content: {
105
- data: string;
106
- id?: number;
107
- type: import("../message").MessageContentType.Text;
108
- status: import("../message").MessageContentStatus;
109
- }[];
110
- role: import("../message").MessageRole.HiddenAssistant;
111
- id: number;
112
- property?: Record<string, unknown>;
113
- status?: import("../message").MessageStatus;
114
- } | {
115
- content: {
116
- data: string;
117
- id?: number;
118
- type: import("../message").MessageContentType.Text;
119
- status: import("../message").MessageContentStatus;
120
- }[];
121
- role: import("../message").MessageRole.HiddenGuide;
122
- id: number;
123
- property?: Record<string, unknown>;
124
- status?: import("../message").MessageStatus;
125
- } | {
126
- content: {
127
- data: string;
128
- id?: number;
129
- type: import("../message").MessageContentType.Text;
130
- status: import("../message").MessageContentStatus;
131
- }[];
132
- role: import("../message").MessageRole.Hidden;
133
- id: number;
134
- property?: Record<string, unknown>;
135
- status?: import("../message").MessageStatus;
136
- } | {
137
- content: {
138
- data: string;
139
- id?: number;
140
- type: import("../message").MessageContentType.Text;
141
- status: import("../message").MessageContentStatus;
142
- }[];
143
- role: import("../message").MessageRole.HiddenSystem;
144
- id: number;
145
- property?: Record<string, unknown>;
146
- status?: import("../message").MessageStatus;
147
- } | {
148
- content: {
149
- data: string;
150
- id?: number;
151
- type: import("../message").MessageContentType.Text;
152
- status: import("../message").MessageContentStatus;
153
- }[];
154
- role: import("../message").MessageRole.HiddenUser;
155
- id: number;
156
- property?: Record<string, unknown>;
157
- status?: import("../message").MessageStatus;
158
- } | {
159
- content: {
160
- data: string;
161
- id?: number;
162
- type: import("../message").MessageContentType.Text;
163
- status: import("../message").MessageContentStatus;
164
- }[];
165
- role: import("../message").MessageRole.Info;
166
- id: number;
167
- property?: Record<string, unknown>;
168
- status?: import("../message").MessageStatus;
169
- } | {
170
- content: {
171
- data: string;
172
- id?: number;
173
- type: import("../message").MessageContentType.Text;
174
- status: import("../message").MessageContentStatus;
175
- }[];
176
- role: import("../message").MessageRole.Pause;
177
- id: number;
178
- property?: Record<string, unknown>;
179
- status?: import("../message").MessageStatus;
180
- } | {
181
- content: {
182
- data: string;
183
- id?: number;
184
- type: import("../message").MessageContentType.Text;
185
- status: import("../message").MessageContentStatus;
186
- }[];
187
- role: import("../message").MessageRole.Placeholder;
188
- id: number;
189
- property?: Record<string, unknown>;
190
- status?: import("../message").MessageStatus;
191
- } | {
192
- content: {
193
- data: string;
194
- id?: number;
195
- type: import("../message").MessageContentType.Text;
196
- status: import("../message").MessageContentStatus;
197
- }[];
198
- role: import("../message").MessageRole.System;
199
- id: number;
200
- property?: Record<string, unknown>;
201
- status?: import("../message").MessageStatus;
202
- } | {
203
- content: {
204
- data: string;
205
- id?: number;
206
- type: import("../message").MessageContentType.Text;
207
- status: import("../message").MessageContentStatus;
208
- }[];
209
- role: import("../message").MessageRole.TemplateAssistant;
210
- id: number;
211
- property?: Record<string, unknown>;
212
- status?: import("../message").MessageStatus;
213
- } | {
214
- content: {
215
- data: string;
216
- id?: number;
217
- type: import("../message").MessageContentType.Text;
218
- status: import("../message").MessageContentStatus;
219
- }[];
220
- role: import("../message").MessageRole.TemplateGuide;
221
- id: number;
222
- property?: Record<string, unknown>;
223
- status?: import("../message").MessageStatus;
224
- } | {
225
- content: {
226
- data: string;
227
- id?: number;
228
- type: import("../message").MessageContentType.Text;
229
- status: import("../message").MessageContentStatus;
230
- }[];
231
- role: import("../message").MessageRole.TemplateHidden;
232
- id: number;
233
- property?: Record<string, unknown>;
234
- status?: import("../message").MessageStatus;
235
- } | {
236
- content: {
237
- data: string;
238
- id?: number;
239
- type: import("../message").MessageContentType.Text;
240
- status: import("../message").MessageContentStatus;
241
- }[];
242
- role: import("../message").MessageRole.TemplateSystem;
243
- id: number;
244
- property?: Record<string, unknown>;
245
- status?: import("../message").MessageStatus;
246
- } | {
247
- content: {
248
- data: string;
249
- id?: number;
250
- type: import("../message").MessageContentType.Text;
251
- status: import("../message").MessageContentStatus;
252
- }[];
253
- role: import("../message").MessageRole.TemplateUser;
254
- id: number;
255
- property?: Record<string, unknown>;
256
- status?: import("../message").MessageStatus;
257
- } | {
258
- content: {
259
- data: string;
260
- id?: number;
261
- type: import("../message").MessageContentType.Text;
262
- status: import("../message").MessageContentStatus;
263
- }[];
264
- role: import("../message").MessageRole.User;
265
- id: number;
266
- property?: Record<string, unknown>;
267
- status?: import("../message").MessageStatus;
283
+ property?: {
284
+ [x: string]: unknown;
285
+ extra?: {
286
+ [x: string]: unknown;
287
+ cite?: string | {
288
+ data: {
289
+ key: string;
290
+ value: string;
291
+ }[];
292
+ title: string;
293
+ type: string;
294
+ };
295
+ command?: string;
296
+ context?: Array<Record<string, unknown>>;
297
+ resources?: Array<Record<string, unknown>>;
298
+ };
299
+ };
300
+ role: MessageRole.User;
301
+ id?: string;
302
+ messageId?: string;
303
+ name?: string;
304
+ sessionCode?: string;
305
+ status: MessageStatus;
268
306
  })[];
307
+ supportUpload?: {
308
+ vision: boolean;
309
+ };
269
310
  };
270
311
  }, IAgentInfo | {
271
312
  agentName?: string;
313
+ resources?: {
314
+ code: string;
315
+ icon: null | string;
316
+ id: null | number;
317
+ name: string;
318
+ type: string;
319
+ }[];
272
320
  saasUrl?: string;
273
321
  chatGroup?: {
274
322
  enabled: boolean;
@@ -278,6 +326,7 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
278
326
  conversationSettings?: {
279
327
  commands?: {
280
328
  agentId: number;
329
+ alias?: string;
281
330
  components: {
282
331
  default?: null | string;
283
332
  fillBack?: boolean;
@@ -300,6 +349,9 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
300
349
  id: string;
301
350
  name: string;
302
351
  status: string;
352
+ supportUpload?: {
353
+ vision: boolean;
354
+ };
303
355
  }[];
304
356
  enableChatSession?: boolean;
305
357
  openingRemark?: string;
@@ -307,234 +359,264 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
307
359
  };
308
360
  promptSetting?: {
309
361
  content?: ({
310
- role: import("../message").MessageRole.Assistant;
311
- content: ({
312
- type: import("../message").MessageContentType.Image;
313
- data: {
314
- height?: number;
315
- url: string;
316
- width?: number;
317
- };
318
- status: import("../message").MessageContentStatus;
362
+ activityType: import("../message").ActivityType;
363
+ content: {
364
+ nodes: Record<string, import("../event").IFlowAgentNode>;
365
+ task_id: number;
366
+ task_name: string;
367
+ task_outputs: string[];
368
+ task_state: import("../event").FlowTaskState;
319
369
  } | {
320
- type: import("../message").MessageContentType.ReferenceDocument;
321
- data: {
322
- icon?: string;
370
+ content: string;
371
+ referenceDocument: {
372
+ name: string;
323
373
  originFileUrl?: string;
324
- title: string;
325
374
  url: string;
326
375
  }[];
327
- status: import("../message").MessageContentStatus;
328
- } | {
329
- data: string;
330
- id?: number;
331
- type: import("../message").MessageContentType.Text;
332
- status: import("../message").MessageContentStatus;
333
376
  } | {
334
- type: import("../message").MessageContentType.Thinking;
335
- data: {
336
- duration?: number;
337
- text: string;
338
- title?: string;
377
+ name: string;
378
+ originFileUrl?: string;
379
+ url: string;
380
+ }[];
381
+ role: MessageRole.Activity;
382
+ id?: string;
383
+ messageId?: string;
384
+ name?: string;
385
+ sessionCode?: string;
386
+ status: MessageStatus;
387
+ } | {
388
+ content?: string;
389
+ property?: {
390
+ [x: string]: unknown;
391
+ extra?: {
392
+ [x: string]: unknown;
393
+ cite?: string | {
394
+ data: {
395
+ key: string;
396
+ value: string;
397
+ }[];
398
+ title: string;
399
+ type: string;
400
+ };
401
+ command?: string;
402
+ context?: Array<Record<string, unknown>>;
403
+ resources?: Array<Record<string, unknown>>;
339
404
  };
340
- status: import("../message").MessageContentStatus;
341
- } | {
342
- type: import("../message").MessageContentType.ToolCall;
343
- data: {
344
- args?: string;
345
- chunk?: string;
346
- parentMessageId?: string;
347
- result?: string;
348
- toolCallId: string;
349
- toolCallName: string;
405
+ };
406
+ role: MessageRole.Assistant;
407
+ toolCalls?: {
408
+ function: {
409
+ arguments: string;
410
+ description?: string;
411
+ mcpName?: string;
412
+ name: string;
350
413
  };
351
- status: import("../message").MessageContentStatus;
414
+ id: string;
415
+ type: import("../message").MessageType.Function;
416
+ }[];
417
+ id?: string;
418
+ messageId?: string;
419
+ name?: string;
420
+ sessionCode?: string;
421
+ status: MessageStatus;
422
+ } | {
423
+ content: string;
424
+ role: MessageRole.Developer;
425
+ id?: string;
426
+ messageId?: string;
427
+ name?: string;
428
+ sessionCode?: string;
429
+ status: MessageStatus;
430
+ } | {
431
+ content: string;
432
+ role: MessageRole.Guide;
433
+ id?: string;
434
+ messageId?: string;
435
+ name?: string;
436
+ sessionCode?: string;
437
+ status: MessageStatus;
438
+ } | {
439
+ content: string;
440
+ role: MessageRole.HiddenAssistant;
441
+ id?: string;
442
+ messageId?: string;
443
+ name?: string;
444
+ sessionCode?: string;
445
+ status: MessageStatus;
446
+ } | {
447
+ content: string;
448
+ role: MessageRole.HiddenGuide;
449
+ id?: string;
450
+ messageId?: string;
451
+ name?: string;
452
+ sessionCode?: string;
453
+ status: MessageStatus;
454
+ } | {
455
+ content: string;
456
+ role: MessageRole.Hidden;
457
+ id?: string;
458
+ messageId?: string;
459
+ name?: string;
460
+ sessionCode?: string;
461
+ status: MessageStatus;
462
+ } | {
463
+ content: string;
464
+ role: MessageRole.HiddenSystem;
465
+ id?: string;
466
+ messageId?: string;
467
+ name?: string;
468
+ sessionCode?: string;
469
+ status: MessageStatus;
470
+ } | {
471
+ content: string;
472
+ role: MessageRole.HiddenUser;
473
+ id?: string;
474
+ messageId?: string;
475
+ name?: string;
476
+ sessionCode?: string;
477
+ status: MessageStatus;
478
+ } | {
479
+ content: string;
480
+ role: MessageRole.Info;
481
+ id?: string;
482
+ messageId?: string;
483
+ name?: string;
484
+ sessionCode?: string;
485
+ status: MessageStatus;
486
+ } | {
487
+ content: string;
488
+ role: MessageRole.Pause;
489
+ id?: string;
490
+ messageId?: string;
491
+ name?: string;
492
+ sessionCode?: string;
493
+ status: MessageStatus;
494
+ } | {
495
+ content: string;
496
+ role: MessageRole.Placeholder;
497
+ id?: string;
498
+ messageId?: string;
499
+ name?: string;
500
+ sessionCode?: string;
501
+ status: MessageStatus;
502
+ } | {
503
+ content: string[];
504
+ duration?: number;
505
+ role: MessageRole.Reasoning;
506
+ id?: string;
507
+ messageId?: string;
508
+ name?: string;
509
+ sessionCode?: string;
510
+ status: MessageStatus;
511
+ } | {
512
+ content: string;
513
+ role: MessageRole.System;
514
+ id?: string;
515
+ messageId?: string;
516
+ name?: string;
517
+ sessionCode?: string;
518
+ status: MessageStatus;
519
+ } | {
520
+ content: string;
521
+ role: MessageRole.TemplateAssistant;
522
+ id?: string;
523
+ messageId?: string;
524
+ name?: string;
525
+ sessionCode?: string;
526
+ status: MessageStatus;
527
+ } | {
528
+ content: string;
529
+ role: MessageRole.TemplateGuide;
530
+ id?: string;
531
+ messageId?: string;
532
+ name?: string;
533
+ sessionCode?: string;
534
+ status: MessageStatus;
535
+ } | {
536
+ content: string;
537
+ role: MessageRole.TemplateHidden;
538
+ id?: string;
539
+ messageId?: string;
540
+ name?: string;
541
+ sessionCode?: string;
542
+ status: MessageStatus;
543
+ } | {
544
+ content: string;
545
+ role: MessageRole.TemplateSystem;
546
+ id?: string;
547
+ messageId?: string;
548
+ name?: string;
549
+ sessionCode?: string;
550
+ status: MessageStatus;
551
+ } | {
552
+ content: string;
553
+ role: MessageRole.TemplateUser;
554
+ id?: string;
555
+ messageId?: string;
556
+ name?: string;
557
+ sessionCode?: string;
558
+ status: MessageStatus;
559
+ } | {
560
+ content: string;
561
+ duration?: number;
562
+ error?: string;
563
+ role: MessageRole.Tool;
564
+ toolCallId: string;
565
+ id?: string;
566
+ messageId?: string;
567
+ name?: string;
568
+ sessionCode?: string;
569
+ status: MessageStatus;
570
+ } | {
571
+ content: string | ({
572
+ data?: string;
573
+ filename?: string;
574
+ id?: string;
575
+ mimeType: string;
576
+ type: import("../message").MessageType.Binary;
577
+ url?: string;
578
+ } | {
579
+ text: string;
580
+ type: import("../message").MessageType.Text;
352
581
  })[];
353
- id: number;
354
- property?: Record<string, unknown>;
355
- status?: import("../message").MessageStatus;
356
- } | {
357
- content: {
358
- data: string;
359
- id?: number;
360
- type: import("../message").MessageContentType.Text;
361
- status: import("../message").MessageContentStatus;
362
- }[];
363
- role: import("../message").MessageRole.Guide;
364
- id: number;
365
- property?: Record<string, unknown>;
366
- status?: import("../message").MessageStatus;
367
- } | {
368
- content: {
369
- data: string;
370
- id?: number;
371
- type: import("../message").MessageContentType.Text;
372
- status: import("../message").MessageContentStatus;
373
- }[];
374
- role: import("../message").MessageRole.HiddenAssistant;
375
- id: number;
376
- property?: Record<string, unknown>;
377
- status?: import("../message").MessageStatus;
378
- } | {
379
- content: {
380
- data: string;
381
- id?: number;
382
- type: import("../message").MessageContentType.Text;
383
- status: import("../message").MessageContentStatus;
384
- }[];
385
- role: import("../message").MessageRole.HiddenGuide;
386
- id: number;
387
- property?: Record<string, unknown>;
388
- status?: import("../message").MessageStatus;
389
- } | {
390
- content: {
391
- data: string;
392
- id?: number;
393
- type: import("../message").MessageContentType.Text;
394
- status: import("../message").MessageContentStatus;
395
- }[];
396
- role: import("../message").MessageRole.Hidden;
397
- id: number;
398
- property?: Record<string, unknown>;
399
- status?: import("../message").MessageStatus;
400
- } | {
401
- content: {
402
- data: string;
403
- id?: number;
404
- type: import("../message").MessageContentType.Text;
405
- status: import("../message").MessageContentStatus;
406
- }[];
407
- role: import("../message").MessageRole.HiddenSystem;
408
- id: number;
409
- property?: Record<string, unknown>;
410
- status?: import("../message").MessageStatus;
411
- } | {
412
- content: {
413
- data: string;
414
- id?: number;
415
- type: import("../message").MessageContentType.Text;
416
- status: import("../message").MessageContentStatus;
417
- }[];
418
- role: import("../message").MessageRole.HiddenUser;
419
- id: number;
420
- property?: Record<string, unknown>;
421
- status?: import("../message").MessageStatus;
422
- } | {
423
- content: {
424
- data: string;
425
- id?: number;
426
- type: import("../message").MessageContentType.Text;
427
- status: import("../message").MessageContentStatus;
428
- }[];
429
- role: import("../message").MessageRole.Info;
430
- id: number;
431
- property?: Record<string, unknown>;
432
- status?: import("../message").MessageStatus;
433
- } | {
434
- content: {
435
- data: string;
436
- id?: number;
437
- type: import("../message").MessageContentType.Text;
438
- status: import("../message").MessageContentStatus;
439
- }[];
440
- role: import("../message").MessageRole.Pause;
441
- id: number;
442
- property?: Record<string, unknown>;
443
- status?: import("../message").MessageStatus;
444
- } | {
445
- content: {
446
- data: string;
447
- id?: number;
448
- type: import("../message").MessageContentType.Text;
449
- status: import("../message").MessageContentStatus;
450
- }[];
451
- role: import("../message").MessageRole.Placeholder;
452
- id: number;
453
- property?: Record<string, unknown>;
454
- status?: import("../message").MessageStatus;
455
- } | {
456
- content: {
457
- data: string;
458
- id?: number;
459
- type: import("../message").MessageContentType.Text;
460
- status: import("../message").MessageContentStatus;
461
- }[];
462
- role: import("../message").MessageRole.System;
463
- id: number;
464
- property?: Record<string, unknown>;
465
- status?: import("../message").MessageStatus;
466
- } | {
467
- content: {
468
- data: string;
469
- id?: number;
470
- type: import("../message").MessageContentType.Text;
471
- status: import("../message").MessageContentStatus;
472
- }[];
473
- role: import("../message").MessageRole.TemplateAssistant;
474
- id: number;
475
- property?: Record<string, unknown>;
476
- status?: import("../message").MessageStatus;
477
- } | {
478
- content: {
479
- data: string;
480
- id?: number;
481
- type: import("../message").MessageContentType.Text;
482
- status: import("../message").MessageContentStatus;
483
- }[];
484
- role: import("../message").MessageRole.TemplateGuide;
485
- id: number;
486
- property?: Record<string, unknown>;
487
- status?: import("../message").MessageStatus;
488
- } | {
489
- content: {
490
- data: string;
491
- id?: number;
492
- type: import("../message").MessageContentType.Text;
493
- status: import("../message").MessageContentStatus;
494
- }[];
495
- role: import("../message").MessageRole.TemplateHidden;
496
- id: number;
497
- property?: Record<string, unknown>;
498
- status?: import("../message").MessageStatus;
499
- } | {
500
- content: {
501
- data: string;
502
- id?: number;
503
- type: import("../message").MessageContentType.Text;
504
- status: import("../message").MessageContentStatus;
505
- }[];
506
- role: import("../message").MessageRole.TemplateSystem;
507
- id: number;
508
- property?: Record<string, unknown>;
509
- status?: import("../message").MessageStatus;
510
- } | {
511
- content: {
512
- data: string;
513
- id?: number;
514
- type: import("../message").MessageContentType.Text;
515
- status: import("../message").MessageContentStatus;
516
- }[];
517
- role: import("../message").MessageRole.TemplateUser;
518
- id: number;
519
- property?: Record<string, unknown>;
520
- status?: import("../message").MessageStatus;
521
- } | {
522
- content: {
523
- data: string;
524
- id?: number;
525
- type: import("../message").MessageContentType.Text;
526
- status: import("../message").MessageContentStatus;
527
- }[];
528
- role: import("../message").MessageRole.User;
529
- id: number;
530
- property?: Record<string, unknown>;
531
- status?: import("../message").MessageStatus;
582
+ property?: {
583
+ [x: string]: unknown;
584
+ extra?: {
585
+ [x: string]: unknown;
586
+ cite?: string | {
587
+ data: {
588
+ key: string;
589
+ value: string;
590
+ }[];
591
+ title: string;
592
+ type: string;
593
+ };
594
+ command?: string;
595
+ context?: Array<Record<string, unknown>>;
596
+ resources?: Array<Record<string, unknown>>;
597
+ };
598
+ };
599
+ role: MessageRole.User;
600
+ id?: string;
601
+ messageId?: string;
602
+ name?: string;
603
+ sessionCode?: string;
604
+ status: MessageStatus;
532
605
  })[];
606
+ supportUpload?: {
607
+ vision: boolean;
608
+ };
533
609
  };
534
610
  }>;
535
611
  isInfoLoading: import("vue").Ref<boolean, boolean>;
536
- chat: () => void;
537
- stopChat: () => Promise<void>;
612
+ isChatting: import("vue").Ref<boolean, boolean>;
613
+ chat: (userInput: IUserMessage["content"], sessionCode: string, url?: string, config?: IRequestConfig, property?: IMessageProperty) => Promise<void>;
614
+ handleRole: (data: IAgentInfo, sessionCode: string) => void;
615
+ resendMessage: (messageId: string, sessionCode: string, newContent?: IUserMessage["content"], url?: string, config?: IRequestConfig) => Promise<void>;
616
+ resumeStreamingChat: (sessionCode: string, url?: string, config?: IRequestConfig) => void;
617
+ abortChat: () => void;
618
+ stopChat: (sessionCode: string) => Promise<void>;
538
619
  getAgentInfo: () => Promise<void>;
620
+ reset: (protocol: ISSEProtocol) => void;
539
621
  };
540
622
  export type IAgentModule = ReturnType<typeof useAgent>;