@winmatrix/protocol 1.0.5 → 1.0.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.
@@ -0,0 +1,691 @@
1
+ import { z } from 'zod';
2
+ export declare const ChatPresentationFinalKind = "final-response";
3
+ export declare const CONVERSATION_CHAT_ACCEPTED_SCHEMA_VERSION = 1;
4
+ /** 首条消息由服务端分配真实会话 ID 后的 WS 确认帧。 */
5
+ export declare const ConversationChatAcceptedSchema: z.ZodObject<{
6
+ type: z.ZodLiteral<"conversation:chat_accepted">;
7
+ schemaVersion: z.ZodLiteral<1>;
8
+ conversationId: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ type: "conversation:chat_accepted";
11
+ schemaVersion: 1;
12
+ conversationId: string;
13
+ }, {
14
+ type: "conversation:chat_accepted";
15
+ schemaVersion: 1;
16
+ conversationId: string;
17
+ }>;
18
+ /**
19
+ * user 消息落库回执帧:前端 pending 区据落库 presentationOrder 转正归位。
20
+ * ack 丢失无补偿——由前端重叠窗口回读自愈(spec §4.2)。
21
+ */
22
+ export declare const MessageAckFrameSchema: z.ZodObject<{
23
+ type: z.ZodLiteral<"conversation:message_ack">;
24
+ conversationId: z.ZodString;
25
+ userMessageId: z.ZodString;
26
+ presentationOrder: z.ZodString;
27
+ turnKey: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ type: "conversation:message_ack";
30
+ turnKey: string;
31
+ presentationOrder: string;
32
+ conversationId: string;
33
+ userMessageId: string;
34
+ }, {
35
+ type: "conversation:message_ack";
36
+ turnKey: string;
37
+ presentationOrder: string;
38
+ conversationId: string;
39
+ userMessageId: string;
40
+ }>;
41
+ export declare const ChatPresentationLifecycleSchema: z.ZodEnum<["open", "patch", "settled", "discarded"]>;
42
+ export declare const ChatPresentationAnchorSchema: z.ZodObject<{
43
+ afterMessageId: z.ZodString;
44
+ slot: z.ZodNumber;
45
+ tieBreaker: z.ZodString;
46
+ }, "strip", z.ZodTypeAny, {
47
+ afterMessageId: string;
48
+ slot: number;
49
+ tieBreaker: string;
50
+ }, {
51
+ afterMessageId: string;
52
+ slot: number;
53
+ tieBreaker: string;
54
+ }>;
55
+ export declare const EmployeePresentationAuthorSchema: z.ZodObject<{
56
+ kind: z.ZodLiteral<"employee">;
57
+ roleId: z.ZodString;
58
+ digitalEmployeeName: z.ZodString;
59
+ digitalEmployeeId: z.ZodOptional<z.ZodString>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ roleId: string;
62
+ kind: "employee";
63
+ digitalEmployeeName: string;
64
+ digitalEmployeeId?: string | undefined;
65
+ }, {
66
+ roleId: string;
67
+ kind: "employee";
68
+ digitalEmployeeName: string;
69
+ digitalEmployeeId?: string | undefined;
70
+ }>;
71
+ export declare const SystemPresentationAuthorSchema: z.ZodObject<{
72
+ kind: z.ZodLiteral<"system">;
73
+ displayName: z.ZodString;
74
+ }, "strip", z.ZodTypeAny, {
75
+ kind: "system";
76
+ displayName: string;
77
+ }, {
78
+ kind: "system";
79
+ displayName: string;
80
+ }>;
81
+ export declare const UserPresentationAuthorSchema: z.ZodObject<{
82
+ kind: z.ZodLiteral<"user">;
83
+ displayName: z.ZodOptional<z.ZodString>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ kind: "user";
86
+ displayName?: string | undefined;
87
+ }, {
88
+ kind: "user";
89
+ displayName?: string | undefined;
90
+ }>;
91
+ export declare const ChatPresentationAuthorSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
92
+ kind: z.ZodLiteral<"user">;
93
+ displayName: z.ZodOptional<z.ZodString>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ kind: "user";
96
+ displayName?: string | undefined;
97
+ }, {
98
+ kind: "user";
99
+ displayName?: string | undefined;
100
+ }>, z.ZodObject<{
101
+ kind: z.ZodLiteral<"employee">;
102
+ roleId: z.ZodString;
103
+ digitalEmployeeName: z.ZodString;
104
+ digitalEmployeeId: z.ZodOptional<z.ZodString>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ roleId: string;
107
+ kind: "employee";
108
+ digitalEmployeeName: string;
109
+ digitalEmployeeId?: string | undefined;
110
+ }, {
111
+ roleId: string;
112
+ kind: "employee";
113
+ digitalEmployeeName: string;
114
+ digitalEmployeeId?: string | undefined;
115
+ }>, z.ZodObject<{
116
+ kind: z.ZodLiteral<"system">;
117
+ displayName: z.ZodString;
118
+ }, "strip", z.ZodTypeAny, {
119
+ kind: "system";
120
+ displayName: string;
121
+ }, {
122
+ kind: "system";
123
+ displayName: string;
124
+ }>]>;
125
+ export declare const ChatPresentationProducerSchema: z.ZodObject<{
126
+ module: z.ZodString;
127
+ runId: z.ZodOptional<z.ZodString>;
128
+ sourceId: z.ZodOptional<z.ZodString>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ module: string;
131
+ runId?: string | undefined;
132
+ sourceId?: string | undefined;
133
+ }, {
134
+ module: string;
135
+ runId?: string | undefined;
136
+ sourceId?: string | undefined;
137
+ }>;
138
+ /**
139
+ * step 身份嵌套对象(converge-message-id-identity design D2)。
140
+ * 全字段 optional:旧磁带/DB 事件回读经同一 schema,缺失 step 不拒 parse。
141
+ */
142
+ export declare const ChatPresentationStepSchema: z.ZodObject<{
143
+ workerBriefId: z.ZodOptional<z.ZodString>;
144
+ workerStepId: z.ZodOptional<z.ZodString>;
145
+ stepKey: z.ZodOptional<z.ZodString>;
146
+ roleId: z.ZodOptional<z.ZodString>;
147
+ attemptNo: z.ZodOptional<z.ZodNumber>;
148
+ repairRound: z.ZodOptional<z.ZodNumber>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ roleId?: string | undefined;
151
+ workerBriefId?: string | undefined;
152
+ workerStepId?: string | undefined;
153
+ attemptNo?: number | undefined;
154
+ repairRound?: number | undefined;
155
+ stepKey?: string | undefined;
156
+ }, {
157
+ roleId?: string | undefined;
158
+ workerBriefId?: string | undefined;
159
+ workerStepId?: string | undefined;
160
+ attemptNo?: number | undefined;
161
+ repairRound?: number | undefined;
162
+ stepKey?: string | undefined;
163
+ }>;
164
+ export declare const ChatPresentationEventSchema: z.ZodEffects<z.ZodObject<{
165
+ eventId: z.ZodString;
166
+ conversationId: z.ZodString;
167
+ turnId: z.ZodString;
168
+ presentationId: z.ZodString;
169
+ kind: z.ZodEnum<["final-response", "final-draft", "transient-thinking", "tool-execution", "orchestration", "execution-surface", "artifacts"]>;
170
+ lifecycle: z.ZodEnum<["open", "patch", "settled", "discarded"]>;
171
+ revision: z.ZodNumber;
172
+ /** 服务端发布时刻;仅用于当前页的同锚点因果排序,历史仍按 presentationOrder。 */
173
+ emittedAt: z.ZodNumber;
174
+ anchor: z.ZodObject<{
175
+ afterMessageId: z.ZodString;
176
+ slot: z.ZodNumber;
177
+ tieBreaker: z.ZodString;
178
+ }, "strip", z.ZodTypeAny, {
179
+ afterMessageId: string;
180
+ slot: number;
181
+ tieBreaker: string;
182
+ }, {
183
+ afterMessageId: string;
184
+ slot: number;
185
+ tieBreaker: string;
186
+ }>;
187
+ producer: z.ZodObject<{
188
+ module: z.ZodString;
189
+ runId: z.ZodOptional<z.ZodString>;
190
+ sourceId: z.ZodOptional<z.ZodString>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ module: string;
193
+ runId?: string | undefined;
194
+ sourceId?: string | undefined;
195
+ }, {
196
+ module: string;
197
+ runId?: string | undefined;
198
+ sourceId?: string | undefined;
199
+ }>;
200
+ author: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
201
+ kind: z.ZodLiteral<"user">;
202
+ displayName: z.ZodOptional<z.ZodString>;
203
+ }, "strip", z.ZodTypeAny, {
204
+ kind: "user";
205
+ displayName?: string | undefined;
206
+ }, {
207
+ kind: "user";
208
+ displayName?: string | undefined;
209
+ }>, z.ZodObject<{
210
+ kind: z.ZodLiteral<"employee">;
211
+ roleId: z.ZodString;
212
+ digitalEmployeeName: z.ZodString;
213
+ digitalEmployeeId: z.ZodOptional<z.ZodString>;
214
+ }, "strip", z.ZodTypeAny, {
215
+ roleId: string;
216
+ kind: "employee";
217
+ digitalEmployeeName: string;
218
+ digitalEmployeeId?: string | undefined;
219
+ }, {
220
+ roleId: string;
221
+ kind: "employee";
222
+ digitalEmployeeName: string;
223
+ digitalEmployeeId?: string | undefined;
224
+ }>, z.ZodObject<{
225
+ kind: z.ZodLiteral<"system">;
226
+ displayName: z.ZodString;
227
+ }, "strip", z.ZodTypeAny, {
228
+ kind: "system";
229
+ displayName: string;
230
+ }, {
231
+ kind: "system";
232
+ displayName: string;
233
+ }>]>>;
234
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
235
+ step: z.ZodOptional<z.ZodObject<{
236
+ workerBriefId: z.ZodOptional<z.ZodString>;
237
+ workerStepId: z.ZodOptional<z.ZodString>;
238
+ stepKey: z.ZodOptional<z.ZodString>;
239
+ roleId: z.ZodOptional<z.ZodString>;
240
+ attemptNo: z.ZodOptional<z.ZodNumber>;
241
+ repairRound: z.ZodOptional<z.ZodNumber>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ roleId?: string | undefined;
244
+ workerBriefId?: string | undefined;
245
+ workerStepId?: string | undefined;
246
+ attemptNo?: number | undefined;
247
+ repairRound?: number | undefined;
248
+ stepKey?: string | undefined;
249
+ }, {
250
+ roleId?: string | undefined;
251
+ workerBriefId?: string | undefined;
252
+ workerStepId?: string | undefined;
253
+ attemptNo?: number | undefined;
254
+ repairRound?: number | undefined;
255
+ stepKey?: string | undefined;
256
+ }>>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ payload: Record<string, unknown>;
259
+ kind: "artifacts" | "final-response" | "final-draft" | "transient-thinking" | "tool-execution" | "orchestration" | "execution-surface";
260
+ anchor: {
261
+ afterMessageId: string;
262
+ slot: number;
263
+ tieBreaker: string;
264
+ };
265
+ conversationId: string;
266
+ eventId: string;
267
+ turnId: string;
268
+ presentationId: string;
269
+ lifecycle: "open" | "patch" | "settled" | "discarded";
270
+ revision: number;
271
+ emittedAt: number;
272
+ producer: {
273
+ module: string;
274
+ runId?: string | undefined;
275
+ sourceId?: string | undefined;
276
+ };
277
+ author?: {
278
+ roleId: string;
279
+ kind: "employee";
280
+ digitalEmployeeName: string;
281
+ digitalEmployeeId?: string | undefined;
282
+ } | {
283
+ kind: "system";
284
+ displayName: string;
285
+ } | {
286
+ kind: "user";
287
+ displayName?: string | undefined;
288
+ } | undefined;
289
+ step?: {
290
+ roleId?: string | undefined;
291
+ workerBriefId?: string | undefined;
292
+ workerStepId?: string | undefined;
293
+ attemptNo?: number | undefined;
294
+ repairRound?: number | undefined;
295
+ stepKey?: string | undefined;
296
+ } | undefined;
297
+ }, {
298
+ payload: Record<string, unknown>;
299
+ kind: "artifacts" | "final-response" | "final-draft" | "transient-thinking" | "tool-execution" | "orchestration" | "execution-surface";
300
+ anchor: {
301
+ afterMessageId: string;
302
+ slot: number;
303
+ tieBreaker: string;
304
+ };
305
+ conversationId: string;
306
+ eventId: string;
307
+ turnId: string;
308
+ presentationId: string;
309
+ lifecycle: "open" | "patch" | "settled" | "discarded";
310
+ revision: number;
311
+ emittedAt: number;
312
+ producer: {
313
+ module: string;
314
+ runId?: string | undefined;
315
+ sourceId?: string | undefined;
316
+ };
317
+ author?: {
318
+ roleId: string;
319
+ kind: "employee";
320
+ digitalEmployeeName: string;
321
+ digitalEmployeeId?: string | undefined;
322
+ } | {
323
+ kind: "system";
324
+ displayName: string;
325
+ } | {
326
+ kind: "user";
327
+ displayName?: string | undefined;
328
+ } | undefined;
329
+ step?: {
330
+ roleId?: string | undefined;
331
+ workerBriefId?: string | undefined;
332
+ workerStepId?: string | undefined;
333
+ attemptNo?: number | undefined;
334
+ repairRound?: number | undefined;
335
+ stepKey?: string | undefined;
336
+ } | undefined;
337
+ }>, {
338
+ payload: Record<string, unknown>;
339
+ kind: "artifacts" | "final-response" | "final-draft" | "transient-thinking" | "tool-execution" | "orchestration" | "execution-surface";
340
+ anchor: {
341
+ afterMessageId: string;
342
+ slot: number;
343
+ tieBreaker: string;
344
+ };
345
+ conversationId: string;
346
+ eventId: string;
347
+ turnId: string;
348
+ presentationId: string;
349
+ lifecycle: "open" | "patch" | "settled" | "discarded";
350
+ revision: number;
351
+ emittedAt: number;
352
+ producer: {
353
+ module: string;
354
+ runId?: string | undefined;
355
+ sourceId?: string | undefined;
356
+ };
357
+ author?: {
358
+ roleId: string;
359
+ kind: "employee";
360
+ digitalEmployeeName: string;
361
+ digitalEmployeeId?: string | undefined;
362
+ } | {
363
+ kind: "system";
364
+ displayName: string;
365
+ } | {
366
+ kind: "user";
367
+ displayName?: string | undefined;
368
+ } | undefined;
369
+ step?: {
370
+ roleId?: string | undefined;
371
+ workerBriefId?: string | undefined;
372
+ workerStepId?: string | undefined;
373
+ attemptNo?: number | undefined;
374
+ repairRound?: number | undefined;
375
+ stepKey?: string | undefined;
376
+ } | undefined;
377
+ }, {
378
+ payload: Record<string, unknown>;
379
+ kind: "artifacts" | "final-response" | "final-draft" | "transient-thinking" | "tool-execution" | "orchestration" | "execution-surface";
380
+ anchor: {
381
+ afterMessageId: string;
382
+ slot: number;
383
+ tieBreaker: string;
384
+ };
385
+ conversationId: string;
386
+ eventId: string;
387
+ turnId: string;
388
+ presentationId: string;
389
+ lifecycle: "open" | "patch" | "settled" | "discarded";
390
+ revision: number;
391
+ emittedAt: number;
392
+ producer: {
393
+ module: string;
394
+ runId?: string | undefined;
395
+ sourceId?: string | undefined;
396
+ };
397
+ author?: {
398
+ roleId: string;
399
+ kind: "employee";
400
+ digitalEmployeeName: string;
401
+ digitalEmployeeId?: string | undefined;
402
+ } | {
403
+ kind: "system";
404
+ displayName: string;
405
+ } | {
406
+ kind: "user";
407
+ displayName?: string | undefined;
408
+ } | undefined;
409
+ step?: {
410
+ roleId?: string | undefined;
411
+ workerBriefId?: string | undefined;
412
+ workerStepId?: string | undefined;
413
+ attemptNo?: number | undefined;
414
+ repairRound?: number | undefined;
415
+ stepKey?: string | undefined;
416
+ } | undefined;
417
+ }>;
418
+ export declare const PresentationIntentSchema: z.ZodEffects<z.ZodObject<{
419
+ conversationId: z.ZodString;
420
+ turnId: z.ZodString;
421
+ presentationId: z.ZodOptional<z.ZodString>;
422
+ anchor: z.ZodOptional<z.ZodObject<{
423
+ afterMessageId: z.ZodString;
424
+ slot: z.ZodNumber;
425
+ tieBreaker: z.ZodString;
426
+ }, "strip", z.ZodTypeAny, {
427
+ afterMessageId: string;
428
+ slot: number;
429
+ tieBreaker: string;
430
+ }, {
431
+ afterMessageId: string;
432
+ slot: number;
433
+ tieBreaker: string;
434
+ }>>;
435
+ afterMessageId: z.ZodOptional<z.ZodString>;
436
+ tieBreaker: z.ZodOptional<z.ZodString>;
437
+ kind: z.ZodEnum<["final-response", "final-draft", "transient-thinking", "tool-execution", "orchestration", "execution-surface", "artifacts"]>;
438
+ lifecycle: z.ZodEnum<["open", "patch", "settled", "discarded"]>;
439
+ producer: z.ZodObject<{
440
+ module: z.ZodString;
441
+ runId: z.ZodOptional<z.ZodString>;
442
+ sourceId: z.ZodOptional<z.ZodString>;
443
+ }, "strip", z.ZodTypeAny, {
444
+ module: string;
445
+ runId?: string | undefined;
446
+ sourceId?: string | undefined;
447
+ }, {
448
+ module: string;
449
+ runId?: string | undefined;
450
+ sourceId?: string | undefined;
451
+ }>;
452
+ author: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
453
+ kind: z.ZodLiteral<"user">;
454
+ displayName: z.ZodOptional<z.ZodString>;
455
+ }, "strip", z.ZodTypeAny, {
456
+ kind: "user";
457
+ displayName?: string | undefined;
458
+ }, {
459
+ kind: "user";
460
+ displayName?: string | undefined;
461
+ }>, z.ZodObject<{
462
+ kind: z.ZodLiteral<"employee">;
463
+ roleId: z.ZodString;
464
+ digitalEmployeeName: z.ZodString;
465
+ digitalEmployeeId: z.ZodOptional<z.ZodString>;
466
+ }, "strip", z.ZodTypeAny, {
467
+ roleId: string;
468
+ kind: "employee";
469
+ digitalEmployeeName: string;
470
+ digitalEmployeeId?: string | undefined;
471
+ }, {
472
+ roleId: string;
473
+ kind: "employee";
474
+ digitalEmployeeName: string;
475
+ digitalEmployeeId?: string | undefined;
476
+ }>, z.ZodObject<{
477
+ kind: z.ZodLiteral<"system">;
478
+ displayName: z.ZodString;
479
+ }, "strip", z.ZodTypeAny, {
480
+ kind: "system";
481
+ displayName: string;
482
+ }, {
483
+ kind: "system";
484
+ displayName: string;
485
+ }>]>>;
486
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
487
+ step: z.ZodOptional<z.ZodObject<{
488
+ workerBriefId: z.ZodOptional<z.ZodString>;
489
+ workerStepId: z.ZodOptional<z.ZodString>;
490
+ stepKey: z.ZodOptional<z.ZodString>;
491
+ roleId: z.ZodOptional<z.ZodString>;
492
+ attemptNo: z.ZodOptional<z.ZodNumber>;
493
+ repairRound: z.ZodOptional<z.ZodNumber>;
494
+ }, "strip", z.ZodTypeAny, {
495
+ roleId?: string | undefined;
496
+ workerBriefId?: string | undefined;
497
+ workerStepId?: string | undefined;
498
+ attemptNo?: number | undefined;
499
+ repairRound?: number | undefined;
500
+ stepKey?: string | undefined;
501
+ }, {
502
+ roleId?: string | undefined;
503
+ workerBriefId?: string | undefined;
504
+ workerStepId?: string | undefined;
505
+ attemptNo?: number | undefined;
506
+ repairRound?: number | undefined;
507
+ stepKey?: string | undefined;
508
+ }>>;
509
+ }, "strip", z.ZodTypeAny, {
510
+ payload: Record<string, unknown>;
511
+ kind: "artifacts" | "final-response" | "final-draft" | "transient-thinking" | "tool-execution" | "orchestration" | "execution-surface";
512
+ conversationId: string;
513
+ turnId: string;
514
+ lifecycle: "open" | "patch" | "settled" | "discarded";
515
+ producer: {
516
+ module: string;
517
+ runId?: string | undefined;
518
+ sourceId?: string | undefined;
519
+ };
520
+ author?: {
521
+ roleId: string;
522
+ kind: "employee";
523
+ digitalEmployeeName: string;
524
+ digitalEmployeeId?: string | undefined;
525
+ } | {
526
+ kind: "system";
527
+ displayName: string;
528
+ } | {
529
+ kind: "user";
530
+ displayName?: string | undefined;
531
+ } | undefined;
532
+ afterMessageId?: string | undefined;
533
+ tieBreaker?: string | undefined;
534
+ anchor?: {
535
+ afterMessageId: string;
536
+ slot: number;
537
+ tieBreaker: string;
538
+ } | undefined;
539
+ presentationId?: string | undefined;
540
+ step?: {
541
+ roleId?: string | undefined;
542
+ workerBriefId?: string | undefined;
543
+ workerStepId?: string | undefined;
544
+ attemptNo?: number | undefined;
545
+ repairRound?: number | undefined;
546
+ stepKey?: string | undefined;
547
+ } | undefined;
548
+ }, {
549
+ payload: Record<string, unknown>;
550
+ kind: "artifacts" | "final-response" | "final-draft" | "transient-thinking" | "tool-execution" | "orchestration" | "execution-surface";
551
+ conversationId: string;
552
+ turnId: string;
553
+ lifecycle: "open" | "patch" | "settled" | "discarded";
554
+ producer: {
555
+ module: string;
556
+ runId?: string | undefined;
557
+ sourceId?: string | undefined;
558
+ };
559
+ author?: {
560
+ roleId: string;
561
+ kind: "employee";
562
+ digitalEmployeeName: string;
563
+ digitalEmployeeId?: string | undefined;
564
+ } | {
565
+ kind: "system";
566
+ displayName: string;
567
+ } | {
568
+ kind: "user";
569
+ displayName?: string | undefined;
570
+ } | undefined;
571
+ afterMessageId?: string | undefined;
572
+ tieBreaker?: string | undefined;
573
+ anchor?: {
574
+ afterMessageId: string;
575
+ slot: number;
576
+ tieBreaker: string;
577
+ } | undefined;
578
+ presentationId?: string | undefined;
579
+ step?: {
580
+ roleId?: string | undefined;
581
+ workerBriefId?: string | undefined;
582
+ workerStepId?: string | undefined;
583
+ attemptNo?: number | undefined;
584
+ repairRound?: number | undefined;
585
+ stepKey?: string | undefined;
586
+ } | undefined;
587
+ }>, {
588
+ payload: Record<string, unknown>;
589
+ kind: "artifacts" | "final-response" | "final-draft" | "transient-thinking" | "tool-execution" | "orchestration" | "execution-surface";
590
+ conversationId: string;
591
+ turnId: string;
592
+ lifecycle: "open" | "patch" | "settled" | "discarded";
593
+ producer: {
594
+ module: string;
595
+ runId?: string | undefined;
596
+ sourceId?: string | undefined;
597
+ };
598
+ author?: {
599
+ roleId: string;
600
+ kind: "employee";
601
+ digitalEmployeeName: string;
602
+ digitalEmployeeId?: string | undefined;
603
+ } | {
604
+ kind: "system";
605
+ displayName: string;
606
+ } | {
607
+ kind: "user";
608
+ displayName?: string | undefined;
609
+ } | undefined;
610
+ afterMessageId?: string | undefined;
611
+ tieBreaker?: string | undefined;
612
+ anchor?: {
613
+ afterMessageId: string;
614
+ slot: number;
615
+ tieBreaker: string;
616
+ } | undefined;
617
+ presentationId?: string | undefined;
618
+ step?: {
619
+ roleId?: string | undefined;
620
+ workerBriefId?: string | undefined;
621
+ workerStepId?: string | undefined;
622
+ attemptNo?: number | undefined;
623
+ repairRound?: number | undefined;
624
+ stepKey?: string | undefined;
625
+ } | undefined;
626
+ }, {
627
+ payload: Record<string, unknown>;
628
+ kind: "artifacts" | "final-response" | "final-draft" | "transient-thinking" | "tool-execution" | "orchestration" | "execution-surface";
629
+ conversationId: string;
630
+ turnId: string;
631
+ lifecycle: "open" | "patch" | "settled" | "discarded";
632
+ producer: {
633
+ module: string;
634
+ runId?: string | undefined;
635
+ sourceId?: string | undefined;
636
+ };
637
+ author?: {
638
+ roleId: string;
639
+ kind: "employee";
640
+ digitalEmployeeName: string;
641
+ digitalEmployeeId?: string | undefined;
642
+ } | {
643
+ kind: "system";
644
+ displayName: string;
645
+ } | {
646
+ kind: "user";
647
+ displayName?: string | undefined;
648
+ } | undefined;
649
+ afterMessageId?: string | undefined;
650
+ tieBreaker?: string | undefined;
651
+ anchor?: {
652
+ afterMessageId: string;
653
+ slot: number;
654
+ tieBreaker: string;
655
+ } | undefined;
656
+ presentationId?: string | undefined;
657
+ step?: {
658
+ roleId?: string | undefined;
659
+ workerBriefId?: string | undefined;
660
+ workerStepId?: string | undefined;
661
+ attemptNo?: number | undefined;
662
+ repairRound?: number | undefined;
663
+ stepKey?: string | undefined;
664
+ } | undefined;
665
+ }>;
666
+ export interface HistoryPresentationOrderEntry {
667
+ presentationOrder: bigint;
668
+ id: string;
669
+ }
670
+ export declare function compareHistoryPresentationOrder(left: HistoryPresentationOrderEntry, right: HistoryPresentationOrderEntry): number;
671
+ export declare function compareLivePresentationAnchor(left: ChatPresentationAnchor, right: ChatPresentationAnchor): number;
672
+ /**
673
+ * execution-surface 消息的合成 presentationId(converge-message-id-identity)。
674
+ * 与服务端/前端历史拼串字面量 `execution-surface:${turnId}` 逐字等价;
675
+ * 服务端 3 处 + 前端 3 处拼串改引本 helper(tasks 2.3)。
676
+ */
677
+ export declare function executionSurfacePresentationId(turnId: string): string;
678
+ /** brief 过程帧 presentationId 前缀(`brief-message:<briefId>`,同 brief 重试覆盖旧帧)。 */
679
+ export declare const BRIEF_PROCESS_FRAME_PREFIX = "brief-message:";
680
+ export type ChatPresentationLifecycle = z.infer<typeof ChatPresentationLifecycleSchema>;
681
+ export type ConversationChatAccepted = z.infer<typeof ConversationChatAcceptedSchema>;
682
+ export type MessageAckFrame = z.infer<typeof MessageAckFrameSchema>;
683
+ export type ChatPresentationAnchor = z.infer<typeof ChatPresentationAnchorSchema>;
684
+ export type EmployeePresentationAuthor = z.infer<typeof EmployeePresentationAuthorSchema>;
685
+ export type SystemPresentationAuthor = z.infer<typeof SystemPresentationAuthorSchema>;
686
+ export type ChatPresentationAuthor = z.infer<typeof ChatPresentationAuthorSchema>;
687
+ export type ChatPresentationProducer = z.infer<typeof ChatPresentationProducerSchema>;
688
+ export type ChatPresentationStep = z.infer<typeof ChatPresentationStepSchema>;
689
+ export type ChatPresentationEvent = z.infer<typeof ChatPresentationEventSchema>;
690
+ export type PresentationIntent = z.infer<typeof PresentationIntentSchema>;
691
+ //# sourceMappingURL=chatPresentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chatPresentation.d.ts","sourceRoot":"","sources":["../src/chatPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,yBAAyB,mBAAmB,CAAC;AAC1D,eAAO,MAAM,yCAAyC,IA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