@blueking/chat-helper 0.0.1-beta.5 → 0.0.1-beta.7
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.
- package/README.md +1 -1
- package/dist/agent/use-agent.d.ts +36 -2
- package/dist/agent/use-agent.ts.js +41 -9
- package/dist/event/ag-ui.d.ts +4 -2
- package/dist/event/ag-ui.ts.js +29 -9
- package/dist/http/fetch/fetch.d.ts +32 -32
- package/dist/http/fetch/fetch.ts.js +1 -1
- package/dist/http/index.d.ts +17 -16
- package/dist/http/index.ts.js +1 -0
- package/dist/http/module/agent.d.ts +2 -2
- package/dist/http/module/index.d.ts +16 -16
- package/dist/http/module/message.d.ts +6 -6
- package/dist/http/module/message.ts.js +3 -2
- package/dist/http/module/session.d.ts +11 -11
- package/dist/http/transform/message.ts.js +2 -0
- package/dist/index.d.ts +256 -18
- package/dist/message/type.d.ts +2 -0
- package/dist/message/use-message.d.ts +69 -1
- package/dist/message/use-message.ts.js +8 -3
- package/dist/session/use-session.d.ts +136 -0
- package/dist/type.d.ts +4 -4
- package/package.json +1 -1
package/dist/message/type.d.ts
CHANGED
|
@@ -48,11 +48,13 @@ export interface IAssistantMessageApi extends IBaseMessageApi {
|
|
|
48
48
|
export interface IBaseMessage {
|
|
49
49
|
id: number;
|
|
50
50
|
property?: Record<string, unknown>;
|
|
51
|
+
sessionCode: string;
|
|
51
52
|
status?: MessageStatus;
|
|
52
53
|
}
|
|
53
54
|
export interface IBaseMessageApi {
|
|
54
55
|
id: number;
|
|
55
56
|
property?: Record<string, unknown>;
|
|
57
|
+
session_code: string;
|
|
56
58
|
status?: MessageStatus;
|
|
57
59
|
}
|
|
58
60
|
export interface IBaseMessageContent {
|
|
@@ -52,6 +52,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
52
52
|
})[];
|
|
53
53
|
id: number;
|
|
54
54
|
property?: Record<string, unknown>;
|
|
55
|
+
sessionCode: string;
|
|
55
56
|
status?: MessageStatus;
|
|
56
57
|
} | {
|
|
57
58
|
content: {
|
|
@@ -63,6 +64,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
63
64
|
role: MessageRole.Guide;
|
|
64
65
|
id: number;
|
|
65
66
|
property?: Record<string, unknown>;
|
|
67
|
+
sessionCode: string;
|
|
66
68
|
status?: MessageStatus;
|
|
67
69
|
} | {
|
|
68
70
|
content: {
|
|
@@ -74,6 +76,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
74
76
|
role: MessageRole.HiddenAssistant;
|
|
75
77
|
id: number;
|
|
76
78
|
property?: Record<string, unknown>;
|
|
79
|
+
sessionCode: string;
|
|
77
80
|
status?: MessageStatus;
|
|
78
81
|
} | {
|
|
79
82
|
content: {
|
|
@@ -85,6 +88,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
85
88
|
role: MessageRole.HiddenGuide;
|
|
86
89
|
id: number;
|
|
87
90
|
property?: Record<string, unknown>;
|
|
91
|
+
sessionCode: string;
|
|
88
92
|
status?: MessageStatus;
|
|
89
93
|
} | {
|
|
90
94
|
content: {
|
|
@@ -96,6 +100,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
96
100
|
role: MessageRole.Hidden;
|
|
97
101
|
id: number;
|
|
98
102
|
property?: Record<string, unknown>;
|
|
103
|
+
sessionCode: string;
|
|
99
104
|
status?: MessageStatus;
|
|
100
105
|
} | {
|
|
101
106
|
content: {
|
|
@@ -107,6 +112,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
107
112
|
role: MessageRole.HiddenSystem;
|
|
108
113
|
id: number;
|
|
109
114
|
property?: Record<string, unknown>;
|
|
115
|
+
sessionCode: string;
|
|
110
116
|
status?: MessageStatus;
|
|
111
117
|
} | {
|
|
112
118
|
content: {
|
|
@@ -118,6 +124,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
118
124
|
role: MessageRole.HiddenUser;
|
|
119
125
|
id: number;
|
|
120
126
|
property?: Record<string, unknown>;
|
|
127
|
+
sessionCode: string;
|
|
121
128
|
status?: MessageStatus;
|
|
122
129
|
} | {
|
|
123
130
|
content: {
|
|
@@ -129,6 +136,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
129
136
|
role: MessageRole.Info;
|
|
130
137
|
id: number;
|
|
131
138
|
property?: Record<string, unknown>;
|
|
139
|
+
sessionCode: string;
|
|
132
140
|
status?: MessageStatus;
|
|
133
141
|
} | {
|
|
134
142
|
content: {
|
|
@@ -140,6 +148,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
140
148
|
role: MessageRole.Pause;
|
|
141
149
|
id: number;
|
|
142
150
|
property?: Record<string, unknown>;
|
|
151
|
+
sessionCode: string;
|
|
143
152
|
status?: MessageStatus;
|
|
144
153
|
} | {
|
|
145
154
|
content: {
|
|
@@ -151,6 +160,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
151
160
|
role: MessageRole.Placeholder;
|
|
152
161
|
id: number;
|
|
153
162
|
property?: Record<string, unknown>;
|
|
163
|
+
sessionCode: string;
|
|
154
164
|
status?: MessageStatus;
|
|
155
165
|
} | {
|
|
156
166
|
content: {
|
|
@@ -162,6 +172,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
162
172
|
role: MessageRole.System;
|
|
163
173
|
id: number;
|
|
164
174
|
property?: Record<string, unknown>;
|
|
175
|
+
sessionCode: string;
|
|
165
176
|
status?: MessageStatus;
|
|
166
177
|
} | {
|
|
167
178
|
content: {
|
|
@@ -173,6 +184,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
173
184
|
role: MessageRole.TemplateAssistant;
|
|
174
185
|
id: number;
|
|
175
186
|
property?: Record<string, unknown>;
|
|
187
|
+
sessionCode: string;
|
|
176
188
|
status?: MessageStatus;
|
|
177
189
|
} | {
|
|
178
190
|
content: {
|
|
@@ -184,6 +196,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
184
196
|
role: MessageRole.TemplateGuide;
|
|
185
197
|
id: number;
|
|
186
198
|
property?: Record<string, unknown>;
|
|
199
|
+
sessionCode: string;
|
|
187
200
|
status?: MessageStatus;
|
|
188
201
|
} | {
|
|
189
202
|
content: {
|
|
@@ -195,6 +208,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
195
208
|
role: MessageRole.TemplateHidden;
|
|
196
209
|
id: number;
|
|
197
210
|
property?: Record<string, unknown>;
|
|
211
|
+
sessionCode: string;
|
|
198
212
|
status?: MessageStatus;
|
|
199
213
|
} | {
|
|
200
214
|
content: {
|
|
@@ -206,6 +220,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
206
220
|
role: MessageRole.TemplateSystem;
|
|
207
221
|
id: number;
|
|
208
222
|
property?: Record<string, unknown>;
|
|
223
|
+
sessionCode: string;
|
|
209
224
|
status?: MessageStatus;
|
|
210
225
|
} | {
|
|
211
226
|
content: {
|
|
@@ -217,6 +232,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
217
232
|
role: MessageRole.TemplateUser;
|
|
218
233
|
id: number;
|
|
219
234
|
property?: Record<string, unknown>;
|
|
235
|
+
sessionCode: string;
|
|
220
236
|
status?: MessageStatus;
|
|
221
237
|
} | {
|
|
222
238
|
content: {
|
|
@@ -228,6 +244,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
228
244
|
role: MessageRole.User;
|
|
229
245
|
id: number;
|
|
230
246
|
property?: Record<string, unknown>;
|
|
247
|
+
sessionCode: string;
|
|
231
248
|
status?: MessageStatus;
|
|
232
249
|
})[], IMessage[] | ({
|
|
233
250
|
role: MessageRole.Assistant;
|
|
@@ -275,6 +292,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
275
292
|
})[];
|
|
276
293
|
id: number;
|
|
277
294
|
property?: Record<string, unknown>;
|
|
295
|
+
sessionCode: string;
|
|
278
296
|
status?: MessageStatus;
|
|
279
297
|
} | {
|
|
280
298
|
content: {
|
|
@@ -286,6 +304,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
286
304
|
role: MessageRole.Guide;
|
|
287
305
|
id: number;
|
|
288
306
|
property?: Record<string, unknown>;
|
|
307
|
+
sessionCode: string;
|
|
289
308
|
status?: MessageStatus;
|
|
290
309
|
} | {
|
|
291
310
|
content: {
|
|
@@ -297,6 +316,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
297
316
|
role: MessageRole.HiddenAssistant;
|
|
298
317
|
id: number;
|
|
299
318
|
property?: Record<string, unknown>;
|
|
319
|
+
sessionCode: string;
|
|
300
320
|
status?: MessageStatus;
|
|
301
321
|
} | {
|
|
302
322
|
content: {
|
|
@@ -308,6 +328,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
308
328
|
role: MessageRole.HiddenGuide;
|
|
309
329
|
id: number;
|
|
310
330
|
property?: Record<string, unknown>;
|
|
331
|
+
sessionCode: string;
|
|
311
332
|
status?: MessageStatus;
|
|
312
333
|
} | {
|
|
313
334
|
content: {
|
|
@@ -319,6 +340,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
319
340
|
role: MessageRole.Hidden;
|
|
320
341
|
id: number;
|
|
321
342
|
property?: Record<string, unknown>;
|
|
343
|
+
sessionCode: string;
|
|
322
344
|
status?: MessageStatus;
|
|
323
345
|
} | {
|
|
324
346
|
content: {
|
|
@@ -330,6 +352,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
330
352
|
role: MessageRole.HiddenSystem;
|
|
331
353
|
id: number;
|
|
332
354
|
property?: Record<string, unknown>;
|
|
355
|
+
sessionCode: string;
|
|
333
356
|
status?: MessageStatus;
|
|
334
357
|
} | {
|
|
335
358
|
content: {
|
|
@@ -341,6 +364,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
341
364
|
role: MessageRole.HiddenUser;
|
|
342
365
|
id: number;
|
|
343
366
|
property?: Record<string, unknown>;
|
|
367
|
+
sessionCode: string;
|
|
344
368
|
status?: MessageStatus;
|
|
345
369
|
} | {
|
|
346
370
|
content: {
|
|
@@ -352,6 +376,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
352
376
|
role: MessageRole.Info;
|
|
353
377
|
id: number;
|
|
354
378
|
property?: Record<string, unknown>;
|
|
379
|
+
sessionCode: string;
|
|
355
380
|
status?: MessageStatus;
|
|
356
381
|
} | {
|
|
357
382
|
content: {
|
|
@@ -363,6 +388,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
363
388
|
role: MessageRole.Pause;
|
|
364
389
|
id: number;
|
|
365
390
|
property?: Record<string, unknown>;
|
|
391
|
+
sessionCode: string;
|
|
366
392
|
status?: MessageStatus;
|
|
367
393
|
} | {
|
|
368
394
|
content: {
|
|
@@ -374,6 +400,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
374
400
|
role: MessageRole.Placeholder;
|
|
375
401
|
id: number;
|
|
376
402
|
property?: Record<string, unknown>;
|
|
403
|
+
sessionCode: string;
|
|
377
404
|
status?: MessageStatus;
|
|
378
405
|
} | {
|
|
379
406
|
content: {
|
|
@@ -385,6 +412,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
385
412
|
role: MessageRole.System;
|
|
386
413
|
id: number;
|
|
387
414
|
property?: Record<string, unknown>;
|
|
415
|
+
sessionCode: string;
|
|
388
416
|
status?: MessageStatus;
|
|
389
417
|
} | {
|
|
390
418
|
content: {
|
|
@@ -396,6 +424,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
396
424
|
role: MessageRole.TemplateAssistant;
|
|
397
425
|
id: number;
|
|
398
426
|
property?: Record<string, unknown>;
|
|
427
|
+
sessionCode: string;
|
|
399
428
|
status?: MessageStatus;
|
|
400
429
|
} | {
|
|
401
430
|
content: {
|
|
@@ -407,6 +436,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
407
436
|
role: MessageRole.TemplateGuide;
|
|
408
437
|
id: number;
|
|
409
438
|
property?: Record<string, unknown>;
|
|
439
|
+
sessionCode: string;
|
|
410
440
|
status?: MessageStatus;
|
|
411
441
|
} | {
|
|
412
442
|
content: {
|
|
@@ -418,6 +448,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
418
448
|
role: MessageRole.TemplateHidden;
|
|
419
449
|
id: number;
|
|
420
450
|
property?: Record<string, unknown>;
|
|
451
|
+
sessionCode: string;
|
|
421
452
|
status?: MessageStatus;
|
|
422
453
|
} | {
|
|
423
454
|
content: {
|
|
@@ -429,6 +460,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
429
460
|
role: MessageRole.TemplateSystem;
|
|
430
461
|
id: number;
|
|
431
462
|
property?: Record<string, unknown>;
|
|
463
|
+
sessionCode: string;
|
|
432
464
|
status?: MessageStatus;
|
|
433
465
|
} | {
|
|
434
466
|
content: {
|
|
@@ -440,6 +472,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
440
472
|
role: MessageRole.TemplateUser;
|
|
441
473
|
id: number;
|
|
442
474
|
property?: Record<string, unknown>;
|
|
475
|
+
sessionCode: string;
|
|
443
476
|
status?: MessageStatus;
|
|
444
477
|
} | {
|
|
445
478
|
content: {
|
|
@@ -451,6 +484,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
451
484
|
role: MessageRole.User;
|
|
452
485
|
id: number;
|
|
453
486
|
property?: Record<string, unknown>;
|
|
487
|
+
sessionCode: string;
|
|
454
488
|
status?: MessageStatus;
|
|
455
489
|
})[]>;
|
|
456
490
|
isListLoading: import("vue").Ref<boolean, boolean>;
|
|
@@ -502,6 +536,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
502
536
|
})[];
|
|
503
537
|
id: number;
|
|
504
538
|
property?: Record<string, unknown>;
|
|
539
|
+
sessionCode: string;
|
|
505
540
|
status?: MessageStatus;
|
|
506
541
|
} | {
|
|
507
542
|
content: {
|
|
@@ -513,6 +548,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
513
548
|
role: MessageRole.Guide;
|
|
514
549
|
id: number;
|
|
515
550
|
property?: Record<string, unknown>;
|
|
551
|
+
sessionCode: string;
|
|
516
552
|
status?: MessageStatus;
|
|
517
553
|
} | {
|
|
518
554
|
content: {
|
|
@@ -524,6 +560,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
524
560
|
role: MessageRole.HiddenAssistant;
|
|
525
561
|
id: number;
|
|
526
562
|
property?: Record<string, unknown>;
|
|
563
|
+
sessionCode: string;
|
|
527
564
|
status?: MessageStatus;
|
|
528
565
|
} | {
|
|
529
566
|
content: {
|
|
@@ -535,6 +572,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
535
572
|
role: MessageRole.HiddenGuide;
|
|
536
573
|
id: number;
|
|
537
574
|
property?: Record<string, unknown>;
|
|
575
|
+
sessionCode: string;
|
|
538
576
|
status?: MessageStatus;
|
|
539
577
|
} | {
|
|
540
578
|
content: {
|
|
@@ -546,6 +584,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
546
584
|
role: MessageRole.Hidden;
|
|
547
585
|
id: number;
|
|
548
586
|
property?: Record<string, unknown>;
|
|
587
|
+
sessionCode: string;
|
|
549
588
|
status?: MessageStatus;
|
|
550
589
|
} | {
|
|
551
590
|
content: {
|
|
@@ -557,6 +596,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
557
596
|
role: MessageRole.HiddenSystem;
|
|
558
597
|
id: number;
|
|
559
598
|
property?: Record<string, unknown>;
|
|
599
|
+
sessionCode: string;
|
|
560
600
|
status?: MessageStatus;
|
|
561
601
|
} | {
|
|
562
602
|
content: {
|
|
@@ -568,6 +608,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
568
608
|
role: MessageRole.HiddenUser;
|
|
569
609
|
id: number;
|
|
570
610
|
property?: Record<string, unknown>;
|
|
611
|
+
sessionCode: string;
|
|
571
612
|
status?: MessageStatus;
|
|
572
613
|
} | {
|
|
573
614
|
content: {
|
|
@@ -579,6 +620,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
579
620
|
role: MessageRole.Info;
|
|
580
621
|
id: number;
|
|
581
622
|
property?: Record<string, unknown>;
|
|
623
|
+
sessionCode: string;
|
|
582
624
|
status?: MessageStatus;
|
|
583
625
|
} | {
|
|
584
626
|
content: {
|
|
@@ -590,6 +632,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
590
632
|
role: MessageRole.Pause;
|
|
591
633
|
id: number;
|
|
592
634
|
property?: Record<string, unknown>;
|
|
635
|
+
sessionCode: string;
|
|
593
636
|
status?: MessageStatus;
|
|
594
637
|
} | {
|
|
595
638
|
content: {
|
|
@@ -601,6 +644,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
601
644
|
role: MessageRole.Placeholder;
|
|
602
645
|
id: number;
|
|
603
646
|
property?: Record<string, unknown>;
|
|
647
|
+
sessionCode: string;
|
|
604
648
|
status?: MessageStatus;
|
|
605
649
|
} | {
|
|
606
650
|
content: {
|
|
@@ -612,6 +656,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
612
656
|
role: MessageRole.System;
|
|
613
657
|
id: number;
|
|
614
658
|
property?: Record<string, unknown>;
|
|
659
|
+
sessionCode: string;
|
|
615
660
|
status?: MessageStatus;
|
|
616
661
|
} | {
|
|
617
662
|
content: {
|
|
@@ -623,6 +668,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
623
668
|
role: MessageRole.TemplateAssistant;
|
|
624
669
|
id: number;
|
|
625
670
|
property?: Record<string, unknown>;
|
|
671
|
+
sessionCode: string;
|
|
626
672
|
status?: MessageStatus;
|
|
627
673
|
} | {
|
|
628
674
|
content: {
|
|
@@ -634,6 +680,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
634
680
|
role: MessageRole.TemplateGuide;
|
|
635
681
|
id: number;
|
|
636
682
|
property?: Record<string, unknown>;
|
|
683
|
+
sessionCode: string;
|
|
637
684
|
status?: MessageStatus;
|
|
638
685
|
} | {
|
|
639
686
|
content: {
|
|
@@ -645,6 +692,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
645
692
|
role: MessageRole.TemplateHidden;
|
|
646
693
|
id: number;
|
|
647
694
|
property?: Record<string, unknown>;
|
|
695
|
+
sessionCode: string;
|
|
648
696
|
status?: MessageStatus;
|
|
649
697
|
} | {
|
|
650
698
|
content: {
|
|
@@ -656,6 +704,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
656
704
|
role: MessageRole.TemplateSystem;
|
|
657
705
|
id: number;
|
|
658
706
|
property?: Record<string, unknown>;
|
|
707
|
+
sessionCode: string;
|
|
659
708
|
status?: MessageStatus;
|
|
660
709
|
} | {
|
|
661
710
|
content: {
|
|
@@ -667,6 +716,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
667
716
|
role: MessageRole.TemplateUser;
|
|
668
717
|
id: number;
|
|
669
718
|
property?: Record<string, unknown>;
|
|
719
|
+
sessionCode: string;
|
|
670
720
|
status?: MessageStatus;
|
|
671
721
|
} | {
|
|
672
722
|
content: {
|
|
@@ -678,6 +728,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
678
728
|
role: MessageRole.User;
|
|
679
729
|
id: number;
|
|
680
730
|
property?: Record<string, unknown>;
|
|
731
|
+
sessionCode: string;
|
|
681
732
|
status?: MessageStatus;
|
|
682
733
|
};
|
|
683
734
|
getMessageById: (id: number) => {
|
|
@@ -726,6 +777,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
726
777
|
})[];
|
|
727
778
|
id: number;
|
|
728
779
|
property?: Record<string, unknown>;
|
|
780
|
+
sessionCode: string;
|
|
729
781
|
status?: MessageStatus;
|
|
730
782
|
} | {
|
|
731
783
|
content: {
|
|
@@ -737,6 +789,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
737
789
|
role: MessageRole.Guide;
|
|
738
790
|
id: number;
|
|
739
791
|
property?: Record<string, unknown>;
|
|
792
|
+
sessionCode: string;
|
|
740
793
|
status?: MessageStatus;
|
|
741
794
|
} | {
|
|
742
795
|
content: {
|
|
@@ -748,6 +801,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
748
801
|
role: MessageRole.HiddenAssistant;
|
|
749
802
|
id: number;
|
|
750
803
|
property?: Record<string, unknown>;
|
|
804
|
+
sessionCode: string;
|
|
751
805
|
status?: MessageStatus;
|
|
752
806
|
} | {
|
|
753
807
|
content: {
|
|
@@ -759,6 +813,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
759
813
|
role: MessageRole.HiddenGuide;
|
|
760
814
|
id: number;
|
|
761
815
|
property?: Record<string, unknown>;
|
|
816
|
+
sessionCode: string;
|
|
762
817
|
status?: MessageStatus;
|
|
763
818
|
} | {
|
|
764
819
|
content: {
|
|
@@ -770,6 +825,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
770
825
|
role: MessageRole.Hidden;
|
|
771
826
|
id: number;
|
|
772
827
|
property?: Record<string, unknown>;
|
|
828
|
+
sessionCode: string;
|
|
773
829
|
status?: MessageStatus;
|
|
774
830
|
} | {
|
|
775
831
|
content: {
|
|
@@ -781,6 +837,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
781
837
|
role: MessageRole.HiddenSystem;
|
|
782
838
|
id: number;
|
|
783
839
|
property?: Record<string, unknown>;
|
|
840
|
+
sessionCode: string;
|
|
784
841
|
status?: MessageStatus;
|
|
785
842
|
} | {
|
|
786
843
|
content: {
|
|
@@ -792,6 +849,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
792
849
|
role: MessageRole.HiddenUser;
|
|
793
850
|
id: number;
|
|
794
851
|
property?: Record<string, unknown>;
|
|
852
|
+
sessionCode: string;
|
|
795
853
|
status?: MessageStatus;
|
|
796
854
|
} | {
|
|
797
855
|
content: {
|
|
@@ -803,6 +861,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
803
861
|
role: MessageRole.Info;
|
|
804
862
|
id: number;
|
|
805
863
|
property?: Record<string, unknown>;
|
|
864
|
+
sessionCode: string;
|
|
806
865
|
status?: MessageStatus;
|
|
807
866
|
} | {
|
|
808
867
|
content: {
|
|
@@ -814,6 +873,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
814
873
|
role: MessageRole.Pause;
|
|
815
874
|
id: number;
|
|
816
875
|
property?: Record<string, unknown>;
|
|
876
|
+
sessionCode: string;
|
|
817
877
|
status?: MessageStatus;
|
|
818
878
|
} | {
|
|
819
879
|
content: {
|
|
@@ -825,6 +885,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
825
885
|
role: MessageRole.Placeholder;
|
|
826
886
|
id: number;
|
|
827
887
|
property?: Record<string, unknown>;
|
|
888
|
+
sessionCode: string;
|
|
828
889
|
status?: MessageStatus;
|
|
829
890
|
} | {
|
|
830
891
|
content: {
|
|
@@ -836,6 +897,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
836
897
|
role: MessageRole.System;
|
|
837
898
|
id: number;
|
|
838
899
|
property?: Record<string, unknown>;
|
|
900
|
+
sessionCode: string;
|
|
839
901
|
status?: MessageStatus;
|
|
840
902
|
} | {
|
|
841
903
|
content: {
|
|
@@ -847,6 +909,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
847
909
|
role: MessageRole.TemplateAssistant;
|
|
848
910
|
id: number;
|
|
849
911
|
property?: Record<string, unknown>;
|
|
912
|
+
sessionCode: string;
|
|
850
913
|
status?: MessageStatus;
|
|
851
914
|
} | {
|
|
852
915
|
content: {
|
|
@@ -858,6 +921,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
858
921
|
role: MessageRole.TemplateGuide;
|
|
859
922
|
id: number;
|
|
860
923
|
property?: Record<string, unknown>;
|
|
924
|
+
sessionCode: string;
|
|
861
925
|
status?: MessageStatus;
|
|
862
926
|
} | {
|
|
863
927
|
content: {
|
|
@@ -869,6 +933,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
869
933
|
role: MessageRole.TemplateHidden;
|
|
870
934
|
id: number;
|
|
871
935
|
property?: Record<string, unknown>;
|
|
936
|
+
sessionCode: string;
|
|
872
937
|
status?: MessageStatus;
|
|
873
938
|
} | {
|
|
874
939
|
content: {
|
|
@@ -880,6 +945,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
880
945
|
role: MessageRole.TemplateSystem;
|
|
881
946
|
id: number;
|
|
882
947
|
property?: Record<string, unknown>;
|
|
948
|
+
sessionCode: string;
|
|
883
949
|
status?: MessageStatus;
|
|
884
950
|
} | {
|
|
885
951
|
content: {
|
|
@@ -891,6 +957,7 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
891
957
|
role: MessageRole.TemplateUser;
|
|
892
958
|
id: number;
|
|
893
959
|
property?: Record<string, unknown>;
|
|
960
|
+
sessionCode: string;
|
|
894
961
|
status?: MessageStatus;
|
|
895
962
|
} | {
|
|
896
963
|
content: {
|
|
@@ -902,9 +969,10 @@ export declare const useMessage: (http: IHttpModule) => {
|
|
|
902
969
|
role: MessageRole.User;
|
|
903
970
|
id: number;
|
|
904
971
|
property?: Record<string, unknown>;
|
|
972
|
+
sessionCode: string;
|
|
905
973
|
status?: MessageStatus;
|
|
906
974
|
};
|
|
907
|
-
|
|
975
|
+
plusLatestMessage: (sessionCode: string) => Promise<void>;
|
|
908
976
|
modifyMessage: (message: IMessage) => void;
|
|
909
977
|
deleteMessage: (id: number) => Promise<void>;
|
|
910
978
|
batchDeleteMessages: (ids: number[]) => Promise<void>;
|
|
@@ -41,8 +41,13 @@ import { MessageRole, MessageStatus } from './type.ts.js';
|
|
|
41
41
|
isListLoading.value = false;
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// 从接口获取最新的消息塞到前面
|
|
45
|
+
const plusLatestMessage = (sessionCode)=>{
|
|
46
|
+
return http.message.getMessages(sessionCode, 1).then((res)=>{
|
|
47
|
+
list.value.unshift(res[0]);
|
|
48
|
+
}).catch((err)=>{
|
|
49
|
+
console.error(err);
|
|
50
|
+
});
|
|
46
51
|
};
|
|
47
52
|
const modifyMessage = (message)=>{
|
|
48
53
|
list.value = list.value.map((item)=>item.id === message.id ? message : item);
|
|
@@ -79,7 +84,7 @@ import { MessageRole, MessageStatus } from './type.ts.js';
|
|
|
79
84
|
getMessages,
|
|
80
85
|
getCurrentLoadingMessage,
|
|
81
86
|
getMessageById,
|
|
82
|
-
|
|
87
|
+
plusLatestMessage,
|
|
83
88
|
modifyMessage,
|
|
84
89
|
deleteMessage,
|
|
85
90
|
batchDeleteMessages
|