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

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