@pairlobby/protocol 0.11.0

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 (55) hide show
  1. package/LICENSE +93 -0
  2. package/README.md +5 -0
  3. package/dist/auto-close.d.ts +34 -0
  4. package/dist/auto-close.d.ts.map +1 -0
  5. package/dist/auto-close.js +12 -0
  6. package/dist/auto-close.js.map +1 -0
  7. package/dist/credentials.d.ts +15 -0
  8. package/dist/credentials.d.ts.map +1 -0
  9. package/dist/credentials.js +48 -0
  10. package/dist/credentials.js.map +1 -0
  11. package/dist/errors.d.ts +23 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +78 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/events.d.ts +3177 -0
  16. package/dist/events.d.ts.map +1 -0
  17. package/dist/events.js +145 -0
  18. package/dist/events.js.map +1 -0
  19. package/dist/handover.d.ts +266 -0
  20. package/dist/handover.d.ts.map +1 -0
  21. package/dist/handover.js +37 -0
  22. package/dist/handover.js.map +1 -0
  23. package/dist/http.d.ts +8849 -0
  24. package/dist/http.d.ts.map +1 -0
  25. package/dist/http.js +157 -0
  26. package/dist/http.js.map +1 -0
  27. package/dist/ids.d.ts +26 -0
  28. package/dist/ids.d.ts.map +1 -0
  29. package/dist/ids.js +46 -0
  30. package/dist/ids.js.map +1 -0
  31. package/dist/index.d.ts +13 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +13 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/limits.d.ts +74 -0
  36. package/dist/limits.d.ts.map +1 -0
  37. package/dist/limits.js +56 -0
  38. package/dist/limits.js.map +1 -0
  39. package/dist/names.d.ts +16 -0
  40. package/dist/names.d.ts.map +1 -0
  41. package/dist/names.js +7 -0
  42. package/dist/names.js.map +1 -0
  43. package/dist/records.d.ts +1109 -0
  44. package/dist/records.d.ts.map +1 -0
  45. package/dist/records.js +169 -0
  46. package/dist/records.js.map +1 -0
  47. package/dist/requests.d.ts +71 -0
  48. package/dist/requests.d.ts.map +1 -0
  49. package/dist/requests.js +93 -0
  50. package/dist/requests.js.map +1 -0
  51. package/dist/wire.d.ts +4266 -0
  52. package/dist/wire.d.ts.map +1 -0
  53. package/dist/wire.js +24 -0
  54. package/dist/wire.js.map +1 -0
  55. package/package.json +35 -0
package/dist/wire.d.ts ADDED
@@ -0,0 +1,4266 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Sent once at upgrade, before any live event. Replaying history up to
4
+ * `watermarkSeq` and then applying subsequent frames closes the race between a
5
+ * paginated read and the live subscription.
6
+ */
7
+ export declare const ServerHello: z.ZodObject<{
8
+ type: z.ZodLiteral<"hello">;
9
+ snapshot: z.ZodObject<{
10
+ roomId: z.ZodString;
11
+ messageReceiptScope: z.ZodOptional<z.ZodEnum<["recipient", "members"]>>;
12
+ messageStagesSupported: z.ZodOptional<z.ZodBoolean>;
13
+ rejoinSupported: z.ZodOptional<z.ZodBoolean>;
14
+ renameSelfSupported: z.ZodOptional<z.ZodBoolean>;
15
+ adminRolesSupported: z.ZodOptional<z.ZodBoolean>;
16
+ inviteRoleSupported: z.ZodOptional<z.ZodBoolean>;
17
+ autoCloseSupported: z.ZodOptional<z.ZodBoolean>;
18
+ interruptSupported: z.ZodOptional<z.ZodBoolean>;
19
+ lastMessageAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
20
+ autoCloseArmed: z.ZodOptional<z.ZodBoolean>;
21
+ autoCloseAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
22
+ closeReason: z.ZodOptional<z.ZodEnum<["manual", "inactivity", "age", "agents_and_guests_left"]>>;
23
+ quotedMessagesSupported: z.ZodOptional<z.ZodBoolean>;
24
+ groupTurnsSupported: z.ZodOptional<z.ZodBoolean>;
25
+ workingStatusSupported: z.ZodOptional<z.ZodBoolean>;
26
+ turnMode: z.ZodOptional<z.ZodEnum<["sequential", "parallel"]>>;
27
+ name: z.ZodString;
28
+ lifecycle: z.ZodEnum<["open", "closed", "expired", "deleted"]>;
29
+ locked: z.ZodOptional<z.ZodBoolean>;
30
+ createdAt: z.ZodNumber;
31
+ expiresAt: z.ZodNullable<z.ZodNumber>;
32
+ closedAt: z.ZodNullable<z.ZodNumber>;
33
+ controlRevision: z.ZodNumber;
34
+ latestSeq: z.ZodNumber;
35
+ earliestSeq: z.ZodNumber;
36
+ participants: z.ZodArray<z.ZodObject<{
37
+ participantId: z.ZodString;
38
+ displayName: z.ZodString;
39
+ nameSource: z.ZodOptional<z.ZodEnum<["profile", "room"]>>;
40
+ kind: z.ZodEnum<["agent", "human"]>;
41
+ role: z.ZodEnum<["guest", "member", "controller"]>;
42
+ capabilities: z.ZodNullable<z.ZodObject<{
43
+ deliverUnsolicited: z.ZodDefault<z.ZodBoolean>;
44
+ cancelTurn: z.ZodDefault<z.ZodBoolean>;
45
+ cancelTool: z.ZodDefault<z.ZodBoolean>;
46
+ runtime: z.ZodOptional<z.ZodString>;
47
+ runtimeVersion: z.ZodOptional<z.ZodString>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ deliverUnsolicited: boolean;
50
+ cancelTurn: boolean;
51
+ cancelTool: boolean;
52
+ runtime?: string | undefined;
53
+ runtimeVersion?: string | undefined;
54
+ }, {
55
+ deliverUnsolicited?: boolean | undefined;
56
+ cancelTurn?: boolean | undefined;
57
+ cancelTool?: boolean | undefined;
58
+ runtime?: string | undefined;
59
+ runtimeVersion?: string | undefined;
60
+ }>>;
61
+ joinedAt: z.ZodNumber;
62
+ revoked: z.ZodBoolean;
63
+ left: z.ZodBoolean;
64
+ paused: z.ZodBoolean;
65
+ muted: z.ZodOptional<z.ZodBoolean>;
66
+ controlRevision: z.ZodNumber;
67
+ acknowledgedOutcome: z.ZodNullable<z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>>;
68
+ acknowledgedRevision: z.ZodOptional<z.ZodNumber>;
69
+ interruptRequested: z.ZodOptional<z.ZodBoolean>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ participantId: string;
72
+ displayName: string;
73
+ kind: "agent" | "human";
74
+ role: "controller" | "guest" | "member";
75
+ capabilities: {
76
+ deliverUnsolicited: boolean;
77
+ cancelTurn: boolean;
78
+ cancelTool: boolean;
79
+ runtime?: string | undefined;
80
+ runtimeVersion?: string | undefined;
81
+ } | null;
82
+ controlRevision: number;
83
+ joinedAt: number;
84
+ paused: boolean;
85
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
86
+ revoked: boolean;
87
+ left: boolean;
88
+ muted?: boolean | undefined;
89
+ nameSource?: "profile" | "room" | undefined;
90
+ interruptRequested?: boolean | undefined;
91
+ acknowledgedRevision?: number | undefined;
92
+ }, {
93
+ participantId: string;
94
+ displayName: string;
95
+ kind: "agent" | "human";
96
+ role: "controller" | "guest" | "member";
97
+ capabilities: {
98
+ deliverUnsolicited?: boolean | undefined;
99
+ cancelTurn?: boolean | undefined;
100
+ cancelTool?: boolean | undefined;
101
+ runtime?: string | undefined;
102
+ runtimeVersion?: string | undefined;
103
+ } | null;
104
+ controlRevision: number;
105
+ joinedAt: number;
106
+ paused: boolean;
107
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
108
+ revoked: boolean;
109
+ left: boolean;
110
+ muted?: boolean | undefined;
111
+ nameSource?: "profile" | "room" | undefined;
112
+ interruptRequested?: boolean | undefined;
113
+ acknowledgedRevision?: number | undefined;
114
+ }>, "many">;
115
+ policy: z.ZodObject<{
116
+ joinPolicy: z.ZodDefault<z.ZodEnum<["invite_only", "open_to_guests"]>>;
117
+ inviteRole: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
118
+ autoClose: z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
119
+ mode: z.ZodLiteral<"off">;
120
+ }, "strip", z.ZodTypeAny, {
121
+ mode: "off";
122
+ }, {
123
+ mode: "off";
124
+ }>, z.ZodObject<{
125
+ mode: z.ZodLiteral<"inactivity">;
126
+ afterMs: z.ZodNumber;
127
+ }, "strip", z.ZodTypeAny, {
128
+ mode: "inactivity";
129
+ afterMs: number;
130
+ }, {
131
+ mode: "inactivity";
132
+ afterMs: number;
133
+ }>, z.ZodObject<{
134
+ mode: z.ZodLiteral<"age">;
135
+ afterMs: z.ZodNumber;
136
+ }, "strip", z.ZodTypeAny, {
137
+ mode: "age";
138
+ afterMs: number;
139
+ }, {
140
+ mode: "age";
141
+ afterMs: number;
142
+ }>, z.ZodObject<{
143
+ mode: z.ZodLiteral<"agents_and_guests_left">;
144
+ }, "strip", z.ZodTypeAny, {
145
+ mode: "agents_and_guests_left";
146
+ }, {
147
+ mode: "agents_and_guests_left";
148
+ }>]>>;
149
+ localJoin: z.ZodOptional<z.ZodBoolean>;
150
+ maxParticipants: z.ZodNumber;
151
+ maxEventPayloadBytes: z.ZodNumber;
152
+ maxRetainedEventBytes: z.ZodNumber;
153
+ maxRetainedEvents: z.ZodNumber;
154
+ roomLifetimeMs: z.ZodNullable<z.ZodNumber>;
155
+ inviteLifetimeMs: z.ZodNullable<z.ZodNumber>;
156
+ exportWindowMs: z.ZodNumber;
157
+ connectTicketLifetimeMs: z.ZodNumber;
158
+ }, "strip", z.ZodTypeAny, {
159
+ joinPolicy: "invite_only" | "open_to_guests";
160
+ maxParticipants: number;
161
+ maxEventPayloadBytes: number;
162
+ maxRetainedEventBytes: number;
163
+ maxRetainedEvents: number;
164
+ roomLifetimeMs: number | null;
165
+ inviteLifetimeMs: number | null;
166
+ exportWindowMs: number;
167
+ connectTicketLifetimeMs: number;
168
+ autoClose?: {
169
+ mode: "off";
170
+ } | {
171
+ mode: "inactivity";
172
+ afterMs: number;
173
+ } | {
174
+ mode: "age";
175
+ afterMs: number;
176
+ } | {
177
+ mode: "agents_and_guests_left";
178
+ } | undefined;
179
+ inviteRole?: "guest" | "member" | undefined;
180
+ localJoin?: boolean | undefined;
181
+ }, {
182
+ maxParticipants: number;
183
+ maxEventPayloadBytes: number;
184
+ maxRetainedEventBytes: number;
185
+ maxRetainedEvents: number;
186
+ roomLifetimeMs: number | null;
187
+ inviteLifetimeMs: number | null;
188
+ exportWindowMs: number;
189
+ connectTicketLifetimeMs: number;
190
+ autoClose?: {
191
+ mode: "off";
192
+ } | {
193
+ mode: "inactivity";
194
+ afterMs: number;
195
+ } | {
196
+ mode: "age";
197
+ afterMs: number;
198
+ } | {
199
+ mode: "agents_and_guests_left";
200
+ } | undefined;
201
+ joinPolicy?: "invite_only" | "open_to_guests" | undefined;
202
+ inviteRole?: "guest" | "member" | undefined;
203
+ localJoin?: boolean | undefined;
204
+ }>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ name: string;
207
+ expiresAt: number | null;
208
+ roomId: string;
209
+ createdAt: number;
210
+ closedAt: number | null;
211
+ lifecycle: "open" | "closed" | "expired" | "deleted";
212
+ policy: {
213
+ joinPolicy: "invite_only" | "open_to_guests";
214
+ maxParticipants: number;
215
+ maxEventPayloadBytes: number;
216
+ maxRetainedEventBytes: number;
217
+ maxRetainedEvents: number;
218
+ roomLifetimeMs: number | null;
219
+ inviteLifetimeMs: number | null;
220
+ exportWindowMs: number;
221
+ connectTicketLifetimeMs: number;
222
+ autoClose?: {
223
+ mode: "off";
224
+ } | {
225
+ mode: "inactivity";
226
+ afterMs: number;
227
+ } | {
228
+ mode: "age";
229
+ afterMs: number;
230
+ } | {
231
+ mode: "agents_and_guests_left";
232
+ } | undefined;
233
+ inviteRole?: "guest" | "member" | undefined;
234
+ localJoin?: boolean | undefined;
235
+ };
236
+ controlRevision: number;
237
+ latestSeq: number;
238
+ earliestSeq: number;
239
+ participants: {
240
+ participantId: string;
241
+ displayName: string;
242
+ kind: "agent" | "human";
243
+ role: "controller" | "guest" | "member";
244
+ capabilities: {
245
+ deliverUnsolicited: boolean;
246
+ cancelTurn: boolean;
247
+ cancelTool: boolean;
248
+ runtime?: string | undefined;
249
+ runtimeVersion?: string | undefined;
250
+ } | null;
251
+ controlRevision: number;
252
+ joinedAt: number;
253
+ paused: boolean;
254
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
255
+ revoked: boolean;
256
+ left: boolean;
257
+ muted?: boolean | undefined;
258
+ nameSource?: "profile" | "room" | undefined;
259
+ interruptRequested?: boolean | undefined;
260
+ acknowledgedRevision?: number | undefined;
261
+ }[];
262
+ locked?: boolean | undefined;
263
+ turnMode?: "sequential" | "parallel" | undefined;
264
+ lastMessageAt?: number | null | undefined;
265
+ autoCloseArmed?: boolean | undefined;
266
+ autoCloseAt?: number | null | undefined;
267
+ closeReason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
268
+ messageReceiptScope?: "recipient" | "members" | undefined;
269
+ messageStagesSupported?: boolean | undefined;
270
+ rejoinSupported?: boolean | undefined;
271
+ renameSelfSupported?: boolean | undefined;
272
+ adminRolesSupported?: boolean | undefined;
273
+ inviteRoleSupported?: boolean | undefined;
274
+ autoCloseSupported?: boolean | undefined;
275
+ interruptSupported?: boolean | undefined;
276
+ quotedMessagesSupported?: boolean | undefined;
277
+ groupTurnsSupported?: boolean | undefined;
278
+ workingStatusSupported?: boolean | undefined;
279
+ }, {
280
+ name: string;
281
+ expiresAt: number | null;
282
+ roomId: string;
283
+ createdAt: number;
284
+ closedAt: number | null;
285
+ lifecycle: "open" | "closed" | "expired" | "deleted";
286
+ policy: {
287
+ maxParticipants: number;
288
+ maxEventPayloadBytes: number;
289
+ maxRetainedEventBytes: number;
290
+ maxRetainedEvents: number;
291
+ roomLifetimeMs: number | null;
292
+ inviteLifetimeMs: number | null;
293
+ exportWindowMs: number;
294
+ connectTicketLifetimeMs: number;
295
+ autoClose?: {
296
+ mode: "off";
297
+ } | {
298
+ mode: "inactivity";
299
+ afterMs: number;
300
+ } | {
301
+ mode: "age";
302
+ afterMs: number;
303
+ } | {
304
+ mode: "agents_and_guests_left";
305
+ } | undefined;
306
+ joinPolicy?: "invite_only" | "open_to_guests" | undefined;
307
+ inviteRole?: "guest" | "member" | undefined;
308
+ localJoin?: boolean | undefined;
309
+ };
310
+ controlRevision: number;
311
+ latestSeq: number;
312
+ earliestSeq: number;
313
+ participants: {
314
+ participantId: string;
315
+ displayName: string;
316
+ kind: "agent" | "human";
317
+ role: "controller" | "guest" | "member";
318
+ capabilities: {
319
+ deliverUnsolicited?: boolean | undefined;
320
+ cancelTurn?: boolean | undefined;
321
+ cancelTool?: boolean | undefined;
322
+ runtime?: string | undefined;
323
+ runtimeVersion?: string | undefined;
324
+ } | null;
325
+ controlRevision: number;
326
+ joinedAt: number;
327
+ paused: boolean;
328
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
329
+ revoked: boolean;
330
+ left: boolean;
331
+ muted?: boolean | undefined;
332
+ nameSource?: "profile" | "room" | undefined;
333
+ interruptRequested?: boolean | undefined;
334
+ acknowledgedRevision?: number | undefined;
335
+ }[];
336
+ locked?: boolean | undefined;
337
+ turnMode?: "sequential" | "parallel" | undefined;
338
+ lastMessageAt?: number | null | undefined;
339
+ autoCloseArmed?: boolean | undefined;
340
+ autoCloseAt?: number | null | undefined;
341
+ closeReason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
342
+ messageReceiptScope?: "recipient" | "members" | undefined;
343
+ messageStagesSupported?: boolean | undefined;
344
+ rejoinSupported?: boolean | undefined;
345
+ renameSelfSupported?: boolean | undefined;
346
+ adminRolesSupported?: boolean | undefined;
347
+ inviteRoleSupported?: boolean | undefined;
348
+ autoCloseSupported?: boolean | undefined;
349
+ interruptSupported?: boolean | undefined;
350
+ quotedMessagesSupported?: boolean | undefined;
351
+ groupTurnsSupported?: boolean | undefined;
352
+ workingStatusSupported?: boolean | undefined;
353
+ }>;
354
+ watermarkSeq: z.ZodNumber;
355
+ }, "strip", z.ZodTypeAny, {
356
+ type: "hello";
357
+ snapshot: {
358
+ name: string;
359
+ expiresAt: number | null;
360
+ roomId: string;
361
+ createdAt: number;
362
+ closedAt: number | null;
363
+ lifecycle: "open" | "closed" | "expired" | "deleted";
364
+ policy: {
365
+ joinPolicy: "invite_only" | "open_to_guests";
366
+ maxParticipants: number;
367
+ maxEventPayloadBytes: number;
368
+ maxRetainedEventBytes: number;
369
+ maxRetainedEvents: number;
370
+ roomLifetimeMs: number | null;
371
+ inviteLifetimeMs: number | null;
372
+ exportWindowMs: number;
373
+ connectTicketLifetimeMs: number;
374
+ autoClose?: {
375
+ mode: "off";
376
+ } | {
377
+ mode: "inactivity";
378
+ afterMs: number;
379
+ } | {
380
+ mode: "age";
381
+ afterMs: number;
382
+ } | {
383
+ mode: "agents_and_guests_left";
384
+ } | undefined;
385
+ inviteRole?: "guest" | "member" | undefined;
386
+ localJoin?: boolean | undefined;
387
+ };
388
+ controlRevision: number;
389
+ latestSeq: number;
390
+ earliestSeq: number;
391
+ participants: {
392
+ participantId: string;
393
+ displayName: string;
394
+ kind: "agent" | "human";
395
+ role: "controller" | "guest" | "member";
396
+ capabilities: {
397
+ deliverUnsolicited: boolean;
398
+ cancelTurn: boolean;
399
+ cancelTool: boolean;
400
+ runtime?: string | undefined;
401
+ runtimeVersion?: string | undefined;
402
+ } | null;
403
+ controlRevision: number;
404
+ joinedAt: number;
405
+ paused: boolean;
406
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
407
+ revoked: boolean;
408
+ left: boolean;
409
+ muted?: boolean | undefined;
410
+ nameSource?: "profile" | "room" | undefined;
411
+ interruptRequested?: boolean | undefined;
412
+ acknowledgedRevision?: number | undefined;
413
+ }[];
414
+ locked?: boolean | undefined;
415
+ turnMode?: "sequential" | "parallel" | undefined;
416
+ lastMessageAt?: number | null | undefined;
417
+ autoCloseArmed?: boolean | undefined;
418
+ autoCloseAt?: number | null | undefined;
419
+ closeReason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
420
+ messageReceiptScope?: "recipient" | "members" | undefined;
421
+ messageStagesSupported?: boolean | undefined;
422
+ rejoinSupported?: boolean | undefined;
423
+ renameSelfSupported?: boolean | undefined;
424
+ adminRolesSupported?: boolean | undefined;
425
+ inviteRoleSupported?: boolean | undefined;
426
+ autoCloseSupported?: boolean | undefined;
427
+ interruptSupported?: boolean | undefined;
428
+ quotedMessagesSupported?: boolean | undefined;
429
+ groupTurnsSupported?: boolean | undefined;
430
+ workingStatusSupported?: boolean | undefined;
431
+ };
432
+ watermarkSeq: number;
433
+ }, {
434
+ type: "hello";
435
+ snapshot: {
436
+ name: string;
437
+ expiresAt: number | null;
438
+ roomId: string;
439
+ createdAt: number;
440
+ closedAt: number | null;
441
+ lifecycle: "open" | "closed" | "expired" | "deleted";
442
+ policy: {
443
+ maxParticipants: number;
444
+ maxEventPayloadBytes: number;
445
+ maxRetainedEventBytes: number;
446
+ maxRetainedEvents: number;
447
+ roomLifetimeMs: number | null;
448
+ inviteLifetimeMs: number | null;
449
+ exportWindowMs: number;
450
+ connectTicketLifetimeMs: number;
451
+ autoClose?: {
452
+ mode: "off";
453
+ } | {
454
+ mode: "inactivity";
455
+ afterMs: number;
456
+ } | {
457
+ mode: "age";
458
+ afterMs: number;
459
+ } | {
460
+ mode: "agents_and_guests_left";
461
+ } | undefined;
462
+ joinPolicy?: "invite_only" | "open_to_guests" | undefined;
463
+ inviteRole?: "guest" | "member" | undefined;
464
+ localJoin?: boolean | undefined;
465
+ };
466
+ controlRevision: number;
467
+ latestSeq: number;
468
+ earliestSeq: number;
469
+ participants: {
470
+ participantId: string;
471
+ displayName: string;
472
+ kind: "agent" | "human";
473
+ role: "controller" | "guest" | "member";
474
+ capabilities: {
475
+ deliverUnsolicited?: boolean | undefined;
476
+ cancelTurn?: boolean | undefined;
477
+ cancelTool?: boolean | undefined;
478
+ runtime?: string | undefined;
479
+ runtimeVersion?: string | undefined;
480
+ } | null;
481
+ controlRevision: number;
482
+ joinedAt: number;
483
+ paused: boolean;
484
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
485
+ revoked: boolean;
486
+ left: boolean;
487
+ muted?: boolean | undefined;
488
+ nameSource?: "profile" | "room" | undefined;
489
+ interruptRequested?: boolean | undefined;
490
+ acknowledgedRevision?: number | undefined;
491
+ }[];
492
+ locked?: boolean | undefined;
493
+ turnMode?: "sequential" | "parallel" | undefined;
494
+ lastMessageAt?: number | null | undefined;
495
+ autoCloseArmed?: boolean | undefined;
496
+ autoCloseAt?: number | null | undefined;
497
+ closeReason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
498
+ messageReceiptScope?: "recipient" | "members" | undefined;
499
+ messageStagesSupported?: boolean | undefined;
500
+ rejoinSupported?: boolean | undefined;
501
+ renameSelfSupported?: boolean | undefined;
502
+ adminRolesSupported?: boolean | undefined;
503
+ inviteRoleSupported?: boolean | undefined;
504
+ autoCloseSupported?: boolean | undefined;
505
+ interruptSupported?: boolean | undefined;
506
+ quotedMessagesSupported?: boolean | undefined;
507
+ groupTurnsSupported?: boolean | undefined;
508
+ workingStatusSupported?: boolean | undefined;
509
+ };
510
+ watermarkSeq: number;
511
+ }>;
512
+ export declare const ServerEventFrame: z.ZodObject<{
513
+ type: z.ZodLiteral<"event">;
514
+ event: z.ZodIntersection<z.ZodObject<{
515
+ protocolVersion: z.ZodLiteral<1>;
516
+ roomId: z.ZodString;
517
+ seq: z.ZodNumber;
518
+ eventId: z.ZodString;
519
+ senderId: z.ZodNullable<z.ZodString>;
520
+ idempotencyKey: z.ZodNullable<z.ZodString>;
521
+ recipientId: z.ZodNullable<z.ZodString>;
522
+ recipientIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
523
+ allRecipients: z.ZodOptional<z.ZodBoolean>;
524
+ replyTo: z.ZodNullable<z.ZodString>;
525
+ quoteOf: z.ZodOptional<z.ZodString>;
526
+ at: z.ZodNumber;
527
+ }, "strip", z.ZodTypeAny, {
528
+ at: number;
529
+ eventId: string;
530
+ protocolVersion: 1;
531
+ roomId: string;
532
+ seq: number;
533
+ senderId: string | null;
534
+ idempotencyKey: string | null;
535
+ recipientId: string | null;
536
+ replyTo: string | null;
537
+ recipientIds?: string[] | undefined;
538
+ allRecipients?: boolean | undefined;
539
+ quoteOf?: string | undefined;
540
+ }, {
541
+ at: number;
542
+ eventId: string;
543
+ protocolVersion: 1;
544
+ roomId: string;
545
+ seq: number;
546
+ senderId: string | null;
547
+ idempotencyKey: string | null;
548
+ recipientId: string | null;
549
+ replyTo: string | null;
550
+ recipientIds?: string[] | undefined;
551
+ allRecipients?: boolean | undefined;
552
+ quoteOf?: string | undefined;
553
+ }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
554
+ type: z.ZodLiteral<"message">;
555
+ payload: z.ZodObject<{
556
+ text: z.ZodEffects<z.ZodString, string, string>;
557
+ priority: z.ZodDefault<z.ZodEnum<["normal", "priority"]>>;
558
+ responseStage: z.ZodOptional<z.ZodEnum<["progress", "final"]>>;
559
+ }, "strip", z.ZodTypeAny, {
560
+ text: string;
561
+ priority: "normal" | "priority";
562
+ responseStage?: "progress" | "final" | undefined;
563
+ }, {
564
+ text: string;
565
+ priority?: "normal" | "priority" | undefined;
566
+ responseStage?: "progress" | "final" | undefined;
567
+ }>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ type: "message";
570
+ payload: {
571
+ text: string;
572
+ priority: "normal" | "priority";
573
+ responseStage?: "progress" | "final" | undefined;
574
+ };
575
+ }, {
576
+ type: "message";
577
+ payload: {
578
+ text: string;
579
+ priority?: "normal" | "priority" | undefined;
580
+ responseStage?: "progress" | "final" | undefined;
581
+ };
582
+ }>, z.ZodObject<{
583
+ type: z.ZodLiteral<"message.received">;
584
+ payload: z.ZodObject<{
585
+ eventId: z.ZodString;
586
+ stage: z.ZodOptional<z.ZodLiteral<"read">>;
587
+ action: z.ZodOptional<z.ZodEnum<["working", "waiting", "no_action", "declined", "reply_pending", "done"]>>;
588
+ reason: z.ZodOptional<z.ZodString>;
589
+ responseEventId: z.ZodOptional<z.ZodString>;
590
+ }, "strip", z.ZodTypeAny, {
591
+ eventId: string;
592
+ stage?: "read" | undefined;
593
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
594
+ reason?: string | undefined;
595
+ responseEventId?: string | undefined;
596
+ }, {
597
+ eventId: string;
598
+ stage?: "read" | undefined;
599
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
600
+ reason?: string | undefined;
601
+ responseEventId?: string | undefined;
602
+ }>;
603
+ }, "strip", z.ZodTypeAny, {
604
+ type: "message.received";
605
+ payload: {
606
+ eventId: string;
607
+ stage?: "read" | undefined;
608
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
609
+ reason?: string | undefined;
610
+ responseEventId?: string | undefined;
611
+ };
612
+ }, {
613
+ type: "message.received";
614
+ payload: {
615
+ eventId: string;
616
+ stage?: "read" | undefined;
617
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
618
+ reason?: string | undefined;
619
+ responseEventId?: string | undefined;
620
+ };
621
+ }>, z.ZodObject<{
622
+ type: z.ZodLiteral<"message.delivery_failed">;
623
+ payload: z.ZodObject<{
624
+ eventId: z.ZodString;
625
+ reason: z.ZodString;
626
+ stage: z.ZodOptional<z.ZodEnum<["delivery", "execution", "publishing"]>>;
627
+ }, "strip", z.ZodTypeAny, {
628
+ eventId: string;
629
+ reason: string;
630
+ stage?: "delivery" | "execution" | "publishing" | undefined;
631
+ }, {
632
+ eventId: string;
633
+ reason: string;
634
+ stage?: "delivery" | "execution" | "publishing" | undefined;
635
+ }>;
636
+ }, "strip", z.ZodTypeAny, {
637
+ type: "message.delivery_failed";
638
+ payload: {
639
+ eventId: string;
640
+ reason: string;
641
+ stage?: "delivery" | "execution" | "publishing" | undefined;
642
+ };
643
+ }, {
644
+ type: "message.delivery_failed";
645
+ payload: {
646
+ eventId: string;
647
+ reason: string;
648
+ stage?: "delivery" | "execution" | "publishing" | undefined;
649
+ };
650
+ }>, z.ZodObject<{
651
+ type: z.ZodLiteral<"handover.offered">;
652
+ payload: z.ZodObject<{
653
+ handoverId: z.ZodString;
654
+ revision: z.ZodNumber;
655
+ document: z.ZodObject<{
656
+ metadata: z.ZodObject<{
657
+ goal: z.ZodString;
658
+ recipient: z.ZodString;
659
+ mode: z.ZodEnum<["sequential", "concurrent"]>;
660
+ nextAction: z.ZodString;
661
+ decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
662
+ blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
663
+ repository: z.ZodOptional<z.ZodObject<{
664
+ remote: z.ZodOptional<z.ZodString>;
665
+ branch: z.ZodString;
666
+ commit: z.ZodString;
667
+ worktreePath: z.ZodOptional<z.ZodString>;
668
+ dirty: z.ZodBoolean;
669
+ missingPaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
670
+ }, "strip", z.ZodTypeAny, {
671
+ dirty: boolean;
672
+ branch: string;
673
+ commit: string;
674
+ missingPaths: string[];
675
+ remote?: string | undefined;
676
+ worktreePath?: string | undefined;
677
+ }, {
678
+ dirty: boolean;
679
+ branch: string;
680
+ commit: string;
681
+ remote?: string | undefined;
682
+ worktreePath?: string | undefined;
683
+ missingPaths?: string[] | undefined;
684
+ }>>;
685
+ tests: z.ZodOptional<z.ZodObject<{
686
+ command: z.ZodString;
687
+ result: z.ZodEnum<["passed", "failed", "not_run"]>;
688
+ notes: z.ZodOptional<z.ZodString>;
689
+ }, "strip", z.ZodTypeAny, {
690
+ command: string;
691
+ result: "passed" | "failed" | "not_run";
692
+ notes?: string | undefined;
693
+ }, {
694
+ command: string;
695
+ result: "passed" | "failed" | "not_run";
696
+ notes?: string | undefined;
697
+ }>>;
698
+ }, "strip", z.ZodTypeAny, {
699
+ mode: "sequential" | "concurrent";
700
+ goal: string;
701
+ recipient: string;
702
+ nextAction: string;
703
+ decisions: string[];
704
+ blockers: string[];
705
+ repository?: {
706
+ dirty: boolean;
707
+ branch: string;
708
+ commit: string;
709
+ missingPaths: string[];
710
+ remote?: string | undefined;
711
+ worktreePath?: string | undefined;
712
+ } | undefined;
713
+ tests?: {
714
+ command: string;
715
+ result: "passed" | "failed" | "not_run";
716
+ notes?: string | undefined;
717
+ } | undefined;
718
+ }, {
719
+ mode: "sequential" | "concurrent";
720
+ goal: string;
721
+ recipient: string;
722
+ nextAction: string;
723
+ decisions?: string[] | undefined;
724
+ blockers?: string[] | undefined;
725
+ repository?: {
726
+ dirty: boolean;
727
+ branch: string;
728
+ commit: string;
729
+ remote?: string | undefined;
730
+ worktreePath?: string | undefined;
731
+ missingPaths?: string[] | undefined;
732
+ } | undefined;
733
+ tests?: {
734
+ command: string;
735
+ result: "passed" | "failed" | "not_run";
736
+ notes?: string | undefined;
737
+ } | undefined;
738
+ }>;
739
+ body: z.ZodString;
740
+ }, "strip", z.ZodTypeAny, {
741
+ metadata: {
742
+ mode: "sequential" | "concurrent";
743
+ goal: string;
744
+ recipient: string;
745
+ nextAction: string;
746
+ decisions: string[];
747
+ blockers: string[];
748
+ repository?: {
749
+ dirty: boolean;
750
+ branch: string;
751
+ commit: string;
752
+ missingPaths: string[];
753
+ remote?: string | undefined;
754
+ worktreePath?: string | undefined;
755
+ } | undefined;
756
+ tests?: {
757
+ command: string;
758
+ result: "passed" | "failed" | "not_run";
759
+ notes?: string | undefined;
760
+ } | undefined;
761
+ };
762
+ body: string;
763
+ }, {
764
+ metadata: {
765
+ mode: "sequential" | "concurrent";
766
+ goal: string;
767
+ recipient: string;
768
+ nextAction: string;
769
+ decisions?: string[] | undefined;
770
+ blockers?: string[] | undefined;
771
+ repository?: {
772
+ dirty: boolean;
773
+ branch: string;
774
+ commit: string;
775
+ remote?: string | undefined;
776
+ worktreePath?: string | undefined;
777
+ missingPaths?: string[] | undefined;
778
+ } | undefined;
779
+ tests?: {
780
+ command: string;
781
+ result: "passed" | "failed" | "not_run";
782
+ notes?: string | undefined;
783
+ } | undefined;
784
+ };
785
+ body: string;
786
+ }>;
787
+ }, "strip", z.ZodTypeAny, {
788
+ handoverId: string;
789
+ revision: number;
790
+ document: {
791
+ metadata: {
792
+ mode: "sequential" | "concurrent";
793
+ goal: string;
794
+ recipient: string;
795
+ nextAction: string;
796
+ decisions: string[];
797
+ blockers: string[];
798
+ repository?: {
799
+ dirty: boolean;
800
+ branch: string;
801
+ commit: string;
802
+ missingPaths: string[];
803
+ remote?: string | undefined;
804
+ worktreePath?: string | undefined;
805
+ } | undefined;
806
+ tests?: {
807
+ command: string;
808
+ result: "passed" | "failed" | "not_run";
809
+ notes?: string | undefined;
810
+ } | undefined;
811
+ };
812
+ body: string;
813
+ };
814
+ }, {
815
+ handoverId: string;
816
+ revision: number;
817
+ document: {
818
+ metadata: {
819
+ mode: "sequential" | "concurrent";
820
+ goal: string;
821
+ recipient: string;
822
+ nextAction: string;
823
+ decisions?: string[] | undefined;
824
+ blockers?: string[] | undefined;
825
+ repository?: {
826
+ dirty: boolean;
827
+ branch: string;
828
+ commit: string;
829
+ remote?: string | undefined;
830
+ worktreePath?: string | undefined;
831
+ missingPaths?: string[] | undefined;
832
+ } | undefined;
833
+ tests?: {
834
+ command: string;
835
+ result: "passed" | "failed" | "not_run";
836
+ notes?: string | undefined;
837
+ } | undefined;
838
+ };
839
+ body: string;
840
+ };
841
+ }>;
842
+ }, "strip", z.ZodTypeAny, {
843
+ type: "handover.offered";
844
+ payload: {
845
+ handoverId: string;
846
+ revision: number;
847
+ document: {
848
+ metadata: {
849
+ mode: "sequential" | "concurrent";
850
+ goal: string;
851
+ recipient: string;
852
+ nextAction: string;
853
+ decisions: string[];
854
+ blockers: string[];
855
+ repository?: {
856
+ dirty: boolean;
857
+ branch: string;
858
+ commit: string;
859
+ missingPaths: string[];
860
+ remote?: string | undefined;
861
+ worktreePath?: string | undefined;
862
+ } | undefined;
863
+ tests?: {
864
+ command: string;
865
+ result: "passed" | "failed" | "not_run";
866
+ notes?: string | undefined;
867
+ } | undefined;
868
+ };
869
+ body: string;
870
+ };
871
+ };
872
+ }, {
873
+ type: "handover.offered";
874
+ payload: {
875
+ handoverId: string;
876
+ revision: number;
877
+ document: {
878
+ metadata: {
879
+ mode: "sequential" | "concurrent";
880
+ goal: string;
881
+ recipient: string;
882
+ nextAction: string;
883
+ decisions?: string[] | undefined;
884
+ blockers?: string[] | undefined;
885
+ repository?: {
886
+ dirty: boolean;
887
+ branch: string;
888
+ commit: string;
889
+ remote?: string | undefined;
890
+ worktreePath?: string | undefined;
891
+ missingPaths?: string[] | undefined;
892
+ } | undefined;
893
+ tests?: {
894
+ command: string;
895
+ result: "passed" | "failed" | "not_run";
896
+ notes?: string | undefined;
897
+ } | undefined;
898
+ };
899
+ body: string;
900
+ };
901
+ };
902
+ }>, z.ZodObject<{
903
+ type: z.ZodLiteral<"handover.accepted">;
904
+ payload: z.ZodObject<{
905
+ handoverId: z.ZodString;
906
+ revision: z.ZodNumber;
907
+ note: z.ZodOptional<z.ZodString>;
908
+ }, "strip", z.ZodTypeAny, {
909
+ handoverId: string;
910
+ revision: number;
911
+ note?: string | undefined;
912
+ }, {
913
+ handoverId: string;
914
+ revision: number;
915
+ note?: string | undefined;
916
+ }>;
917
+ }, "strip", z.ZodTypeAny, {
918
+ type: "handover.accepted";
919
+ payload: {
920
+ handoverId: string;
921
+ revision: number;
922
+ note?: string | undefined;
923
+ };
924
+ }, {
925
+ type: "handover.accepted";
926
+ payload: {
927
+ handoverId: string;
928
+ revision: number;
929
+ note?: string | undefined;
930
+ };
931
+ }>, z.ZodObject<{
932
+ type: z.ZodLiteral<"handover.declined">;
933
+ payload: z.ZodObject<{
934
+ handoverId: z.ZodString;
935
+ revision: z.ZodNumber;
936
+ reason: z.ZodOptional<z.ZodString>;
937
+ }, "strip", z.ZodTypeAny, {
938
+ handoverId: string;
939
+ revision: number;
940
+ reason?: string | undefined;
941
+ }, {
942
+ handoverId: string;
943
+ revision: number;
944
+ reason?: string | undefined;
945
+ }>;
946
+ }, "strip", z.ZodTypeAny, {
947
+ type: "handover.declined";
948
+ payload: {
949
+ handoverId: string;
950
+ revision: number;
951
+ reason?: string | undefined;
952
+ };
953
+ }, {
954
+ type: "handover.declined";
955
+ payload: {
956
+ handoverId: string;
957
+ revision: number;
958
+ reason?: string | undefined;
959
+ };
960
+ }>, z.ZodObject<{
961
+ type: z.ZodLiteral<"participant.joined">;
962
+ payload: z.ZodObject<{
963
+ participantId: z.ZodString;
964
+ displayName: z.ZodString;
965
+ kind: z.ZodEnum<["agent", "human"]>;
966
+ role: z.ZodEnum<["guest", "member", "controller"]>;
967
+ capabilities: z.ZodOptional<z.ZodObject<{
968
+ deliverUnsolicited: z.ZodDefault<z.ZodBoolean>;
969
+ cancelTurn: z.ZodDefault<z.ZodBoolean>;
970
+ cancelTool: z.ZodDefault<z.ZodBoolean>;
971
+ runtime: z.ZodOptional<z.ZodString>;
972
+ runtimeVersion: z.ZodOptional<z.ZodString>;
973
+ }, "strip", z.ZodTypeAny, {
974
+ deliverUnsolicited: boolean;
975
+ cancelTurn: boolean;
976
+ cancelTool: boolean;
977
+ runtime?: string | undefined;
978
+ runtimeVersion?: string | undefined;
979
+ }, {
980
+ deliverUnsolicited?: boolean | undefined;
981
+ cancelTurn?: boolean | undefined;
982
+ cancelTool?: boolean | undefined;
983
+ runtime?: string | undefined;
984
+ runtimeVersion?: string | undefined;
985
+ }>>;
986
+ }, "strip", z.ZodTypeAny, {
987
+ participantId: string;
988
+ displayName: string;
989
+ kind: "agent" | "human";
990
+ role: "controller" | "guest" | "member";
991
+ capabilities?: {
992
+ deliverUnsolicited: boolean;
993
+ cancelTurn: boolean;
994
+ cancelTool: boolean;
995
+ runtime?: string | undefined;
996
+ runtimeVersion?: string | undefined;
997
+ } | undefined;
998
+ }, {
999
+ participantId: string;
1000
+ displayName: string;
1001
+ kind: "agent" | "human";
1002
+ role: "controller" | "guest" | "member";
1003
+ capabilities?: {
1004
+ deliverUnsolicited?: boolean | undefined;
1005
+ cancelTurn?: boolean | undefined;
1006
+ cancelTool?: boolean | undefined;
1007
+ runtime?: string | undefined;
1008
+ runtimeVersion?: string | undefined;
1009
+ } | undefined;
1010
+ }>;
1011
+ }, "strip", z.ZodTypeAny, {
1012
+ type: "participant.joined";
1013
+ payload: {
1014
+ participantId: string;
1015
+ displayName: string;
1016
+ kind: "agent" | "human";
1017
+ role: "controller" | "guest" | "member";
1018
+ capabilities?: {
1019
+ deliverUnsolicited: boolean;
1020
+ cancelTurn: boolean;
1021
+ cancelTool: boolean;
1022
+ runtime?: string | undefined;
1023
+ runtimeVersion?: string | undefined;
1024
+ } | undefined;
1025
+ };
1026
+ }, {
1027
+ type: "participant.joined";
1028
+ payload: {
1029
+ participantId: string;
1030
+ displayName: string;
1031
+ kind: "agent" | "human";
1032
+ role: "controller" | "guest" | "member";
1033
+ capabilities?: {
1034
+ deliverUnsolicited?: boolean | undefined;
1035
+ cancelTurn?: boolean | undefined;
1036
+ cancelTool?: boolean | undefined;
1037
+ runtime?: string | undefined;
1038
+ runtimeVersion?: string | undefined;
1039
+ } | undefined;
1040
+ };
1041
+ }>, z.ZodObject<{
1042
+ type: z.ZodLiteral<"participant.renamed">;
1043
+ payload: z.ZodObject<{
1044
+ participantId: z.ZodString;
1045
+ previousName: z.ZodString;
1046
+ name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
1047
+ source: z.ZodEnum<["profile", "room"]>;
1048
+ }, "strip", z.ZodTypeAny, {
1049
+ name: string;
1050
+ source: "profile" | "room";
1051
+ participantId: string;
1052
+ previousName: string;
1053
+ }, {
1054
+ name: string;
1055
+ source: "profile" | "room";
1056
+ participantId: string;
1057
+ previousName: string;
1058
+ }>;
1059
+ }, "strip", z.ZodTypeAny, {
1060
+ type: "participant.renamed";
1061
+ payload: {
1062
+ name: string;
1063
+ source: "profile" | "room";
1064
+ participantId: string;
1065
+ previousName: string;
1066
+ };
1067
+ }, {
1068
+ type: "participant.renamed";
1069
+ payload: {
1070
+ name: string;
1071
+ source: "profile" | "room";
1072
+ participantId: string;
1073
+ previousName: string;
1074
+ };
1075
+ }>, z.ZodObject<{
1076
+ type: z.ZodLiteral<"participant.left">;
1077
+ payload: z.ZodObject<{
1078
+ participantId: z.ZodString;
1079
+ }, "strip", z.ZodTypeAny, {
1080
+ participantId: string;
1081
+ }, {
1082
+ participantId: string;
1083
+ }>;
1084
+ }, "strip", z.ZodTypeAny, {
1085
+ type: "participant.left";
1086
+ payload: {
1087
+ participantId: string;
1088
+ };
1089
+ }, {
1090
+ type: "participant.left";
1091
+ payload: {
1092
+ participantId: string;
1093
+ };
1094
+ }>, z.ZodObject<{
1095
+ type: z.ZodLiteral<"participant.revoked">;
1096
+ payload: z.ZodObject<{
1097
+ participantId: z.ZodString;
1098
+ }, "strip", z.ZodTypeAny, {
1099
+ participantId: string;
1100
+ }, {
1101
+ participantId: string;
1102
+ }>;
1103
+ }, "strip", z.ZodTypeAny, {
1104
+ type: "participant.revoked";
1105
+ payload: {
1106
+ participantId: string;
1107
+ };
1108
+ }, {
1109
+ type: "participant.revoked";
1110
+ payload: {
1111
+ participantId: string;
1112
+ };
1113
+ }>, z.ZodObject<{
1114
+ type: z.ZodLiteral<"control.pause">;
1115
+ payload: z.ZodObject<{
1116
+ targetParticipantId: z.ZodString;
1117
+ revision: z.ZodNumber;
1118
+ reason: z.ZodOptional<z.ZodString>;
1119
+ interrupt: z.ZodOptional<z.ZodBoolean>;
1120
+ }, "strip", z.ZodTypeAny, {
1121
+ revision: number;
1122
+ targetParticipantId: string;
1123
+ reason?: string | undefined;
1124
+ interrupt?: boolean | undefined;
1125
+ }, {
1126
+ revision: number;
1127
+ targetParticipantId: string;
1128
+ reason?: string | undefined;
1129
+ interrupt?: boolean | undefined;
1130
+ }>;
1131
+ }, "strip", z.ZodTypeAny, {
1132
+ type: "control.pause";
1133
+ payload: {
1134
+ revision: number;
1135
+ targetParticipantId: string;
1136
+ reason?: string | undefined;
1137
+ interrupt?: boolean | undefined;
1138
+ };
1139
+ }, {
1140
+ type: "control.pause";
1141
+ payload: {
1142
+ revision: number;
1143
+ targetParticipantId: string;
1144
+ reason?: string | undefined;
1145
+ interrupt?: boolean | undefined;
1146
+ };
1147
+ }>, z.ZodObject<{
1148
+ type: z.ZodLiteral<"control.resume">;
1149
+ payload: z.ZodObject<{
1150
+ targetParticipantId: z.ZodString;
1151
+ revision: z.ZodNumber;
1152
+ }, "strip", z.ZodTypeAny, {
1153
+ revision: number;
1154
+ targetParticipantId: string;
1155
+ }, {
1156
+ revision: number;
1157
+ targetParticipantId: string;
1158
+ }>;
1159
+ }, "strip", z.ZodTypeAny, {
1160
+ type: "control.resume";
1161
+ payload: {
1162
+ revision: number;
1163
+ targetParticipantId: string;
1164
+ };
1165
+ }, {
1166
+ type: "control.resume";
1167
+ payload: {
1168
+ revision: number;
1169
+ targetParticipantId: string;
1170
+ };
1171
+ }>, z.ZodObject<{
1172
+ type: z.ZodLiteral<"control.ack">;
1173
+ payload: z.ZodObject<{
1174
+ targetParticipantId: z.ZodString;
1175
+ revision: z.ZodNumber;
1176
+ outcome: z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>;
1177
+ detail: z.ZodOptional<z.ZodString>;
1178
+ }, "strip", z.ZodTypeAny, {
1179
+ revision: number;
1180
+ targetParticipantId: string;
1181
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1182
+ detail?: string | undefined;
1183
+ }, {
1184
+ revision: number;
1185
+ targetParticipantId: string;
1186
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1187
+ detail?: string | undefined;
1188
+ }>;
1189
+ }, "strip", z.ZodTypeAny, {
1190
+ type: "control.ack";
1191
+ payload: {
1192
+ revision: number;
1193
+ targetParticipantId: string;
1194
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1195
+ detail?: string | undefined;
1196
+ };
1197
+ }, {
1198
+ type: "control.ack";
1199
+ payload: {
1200
+ revision: number;
1201
+ targetParticipantId: string;
1202
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1203
+ detail?: string | undefined;
1204
+ };
1205
+ }>, z.ZodObject<{
1206
+ type: z.ZodLiteral<"room.closed">;
1207
+ payload: z.ZodObject<{
1208
+ exportWindowEndsAt: z.ZodNumber;
1209
+ reason: z.ZodOptional<z.ZodEnum<["manual", "inactivity", "age", "agents_and_guests_left"]>>;
1210
+ }, "strip", z.ZodTypeAny, {
1211
+ exportWindowEndsAt: number;
1212
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1213
+ }, {
1214
+ exportWindowEndsAt: number;
1215
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1216
+ }>;
1217
+ }, "strip", z.ZodTypeAny, {
1218
+ type: "room.closed";
1219
+ payload: {
1220
+ exportWindowEndsAt: number;
1221
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1222
+ };
1223
+ }, {
1224
+ type: "room.closed";
1225
+ payload: {
1226
+ exportWindowEndsAt: number;
1227
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1228
+ };
1229
+ }>, z.ZodObject<{
1230
+ type: z.ZodLiteral<"room.auto_close_changed">;
1231
+ payload: z.ZodObject<{
1232
+ autoClose: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
1233
+ mode: z.ZodLiteral<"off">;
1234
+ }, "strip", z.ZodTypeAny, {
1235
+ mode: "off";
1236
+ }, {
1237
+ mode: "off";
1238
+ }>, z.ZodObject<{
1239
+ mode: z.ZodLiteral<"inactivity">;
1240
+ afterMs: z.ZodNumber;
1241
+ }, "strip", z.ZodTypeAny, {
1242
+ mode: "inactivity";
1243
+ afterMs: number;
1244
+ }, {
1245
+ mode: "inactivity";
1246
+ afterMs: number;
1247
+ }>, z.ZodObject<{
1248
+ mode: z.ZodLiteral<"age">;
1249
+ afterMs: z.ZodNumber;
1250
+ }, "strip", z.ZodTypeAny, {
1251
+ mode: "age";
1252
+ afterMs: number;
1253
+ }, {
1254
+ mode: "age";
1255
+ afterMs: number;
1256
+ }>, z.ZodObject<{
1257
+ mode: z.ZodLiteral<"agents_and_guests_left">;
1258
+ }, "strip", z.ZodTypeAny, {
1259
+ mode: "agents_and_guests_left";
1260
+ }, {
1261
+ mode: "agents_and_guests_left";
1262
+ }>]>;
1263
+ previous: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
1264
+ mode: z.ZodLiteral<"off">;
1265
+ }, "strip", z.ZodTypeAny, {
1266
+ mode: "off";
1267
+ }, {
1268
+ mode: "off";
1269
+ }>, z.ZodObject<{
1270
+ mode: z.ZodLiteral<"inactivity">;
1271
+ afterMs: z.ZodNumber;
1272
+ }, "strip", z.ZodTypeAny, {
1273
+ mode: "inactivity";
1274
+ afterMs: number;
1275
+ }, {
1276
+ mode: "inactivity";
1277
+ afterMs: number;
1278
+ }>, z.ZodObject<{
1279
+ mode: z.ZodLiteral<"age">;
1280
+ afterMs: z.ZodNumber;
1281
+ }, "strip", z.ZodTypeAny, {
1282
+ mode: "age";
1283
+ afterMs: number;
1284
+ }, {
1285
+ mode: "age";
1286
+ afterMs: number;
1287
+ }>, z.ZodObject<{
1288
+ mode: z.ZodLiteral<"agents_and_guests_left">;
1289
+ }, "strip", z.ZodTypeAny, {
1290
+ mode: "agents_and_guests_left";
1291
+ }, {
1292
+ mode: "agents_and_guests_left";
1293
+ }>]>;
1294
+ }, "strip", z.ZodTypeAny, {
1295
+ autoClose: {
1296
+ mode: "off";
1297
+ } | {
1298
+ mode: "inactivity";
1299
+ afterMs: number;
1300
+ } | {
1301
+ mode: "age";
1302
+ afterMs: number;
1303
+ } | {
1304
+ mode: "agents_and_guests_left";
1305
+ };
1306
+ previous: {
1307
+ mode: "off";
1308
+ } | {
1309
+ mode: "inactivity";
1310
+ afterMs: number;
1311
+ } | {
1312
+ mode: "age";
1313
+ afterMs: number;
1314
+ } | {
1315
+ mode: "agents_and_guests_left";
1316
+ };
1317
+ }, {
1318
+ autoClose: {
1319
+ mode: "off";
1320
+ } | {
1321
+ mode: "inactivity";
1322
+ afterMs: number;
1323
+ } | {
1324
+ mode: "age";
1325
+ afterMs: number;
1326
+ } | {
1327
+ mode: "agents_and_guests_left";
1328
+ };
1329
+ previous: {
1330
+ mode: "off";
1331
+ } | {
1332
+ mode: "inactivity";
1333
+ afterMs: number;
1334
+ } | {
1335
+ mode: "age";
1336
+ afterMs: number;
1337
+ } | {
1338
+ mode: "agents_and_guests_left";
1339
+ };
1340
+ }>;
1341
+ }, "strip", z.ZodTypeAny, {
1342
+ type: "room.auto_close_changed";
1343
+ payload: {
1344
+ autoClose: {
1345
+ mode: "off";
1346
+ } | {
1347
+ mode: "inactivity";
1348
+ afterMs: number;
1349
+ } | {
1350
+ mode: "age";
1351
+ afterMs: number;
1352
+ } | {
1353
+ mode: "agents_and_guests_left";
1354
+ };
1355
+ previous: {
1356
+ mode: "off";
1357
+ } | {
1358
+ mode: "inactivity";
1359
+ afterMs: number;
1360
+ } | {
1361
+ mode: "age";
1362
+ afterMs: number;
1363
+ } | {
1364
+ mode: "agents_and_guests_left";
1365
+ };
1366
+ };
1367
+ }, {
1368
+ type: "room.auto_close_changed";
1369
+ payload: {
1370
+ autoClose: {
1371
+ mode: "off";
1372
+ } | {
1373
+ mode: "inactivity";
1374
+ afterMs: number;
1375
+ } | {
1376
+ mode: "age";
1377
+ afterMs: number;
1378
+ } | {
1379
+ mode: "agents_and_guests_left";
1380
+ };
1381
+ previous: {
1382
+ mode: "off";
1383
+ } | {
1384
+ mode: "inactivity";
1385
+ afterMs: number;
1386
+ } | {
1387
+ mode: "age";
1388
+ afterMs: number;
1389
+ } | {
1390
+ mode: "agents_and_guests_left";
1391
+ };
1392
+ };
1393
+ }>, z.ZodObject<{
1394
+ type: z.ZodLiteral<"room.renamed">;
1395
+ payload: z.ZodObject<{
1396
+ name: z.ZodString;
1397
+ previousName: z.ZodString;
1398
+ }, "strip", z.ZodTypeAny, {
1399
+ name: string;
1400
+ previousName: string;
1401
+ }, {
1402
+ name: string;
1403
+ previousName: string;
1404
+ }>;
1405
+ }, "strip", z.ZodTypeAny, {
1406
+ type: "room.renamed";
1407
+ payload: {
1408
+ name: string;
1409
+ previousName: string;
1410
+ };
1411
+ }, {
1412
+ type: "room.renamed";
1413
+ payload: {
1414
+ name: string;
1415
+ previousName: string;
1416
+ };
1417
+ }>, z.ZodObject<{
1418
+ type: z.ZodLiteral<"room.expiry_changed">;
1419
+ payload: z.ZodObject<{
1420
+ expiresAt: z.ZodNullable<z.ZodNumber>;
1421
+ previousExpiresAt: z.ZodNullable<z.ZodNumber>;
1422
+ }, "strip", z.ZodTypeAny, {
1423
+ expiresAt: number | null;
1424
+ previousExpiresAt: number | null;
1425
+ }, {
1426
+ expiresAt: number | null;
1427
+ previousExpiresAt: number | null;
1428
+ }>;
1429
+ }, "strip", z.ZodTypeAny, {
1430
+ type: "room.expiry_changed";
1431
+ payload: {
1432
+ expiresAt: number | null;
1433
+ previousExpiresAt: number | null;
1434
+ };
1435
+ }, {
1436
+ type: "room.expiry_changed";
1437
+ payload: {
1438
+ expiresAt: number | null;
1439
+ previousExpiresAt: number | null;
1440
+ };
1441
+ }>, z.ZodObject<{
1442
+ type: z.ZodLiteral<"room.access_changed">;
1443
+ payload: z.ZodObject<{
1444
+ joinPolicy: z.ZodEnum<["invite_only", "open_to_guests"]>;
1445
+ inviteRole: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
1446
+ }, "strip", z.ZodTypeAny, {
1447
+ joinPolicy: "invite_only" | "open_to_guests";
1448
+ inviteRole?: "guest" | "member" | undefined;
1449
+ }, {
1450
+ joinPolicy: "invite_only" | "open_to_guests";
1451
+ inviteRole?: "guest" | "member" | undefined;
1452
+ }>;
1453
+ }, "strip", z.ZodTypeAny, {
1454
+ type: "room.access_changed";
1455
+ payload: {
1456
+ joinPolicy: "invite_only" | "open_to_guests";
1457
+ inviteRole?: "guest" | "member" | undefined;
1458
+ };
1459
+ }, {
1460
+ type: "room.access_changed";
1461
+ payload: {
1462
+ joinPolicy: "invite_only" | "open_to_guests";
1463
+ inviteRole?: "guest" | "member" | undefined;
1464
+ };
1465
+ }>, z.ZodObject<{
1466
+ type: z.ZodLiteral<"room.local_join_changed">;
1467
+ payload: z.ZodObject<{
1468
+ localJoin: z.ZodBoolean;
1469
+ }, "strip", z.ZodTypeAny, {
1470
+ localJoin: boolean;
1471
+ }, {
1472
+ localJoin: boolean;
1473
+ }>;
1474
+ }, "strip", z.ZodTypeAny, {
1475
+ type: "room.local_join_changed";
1476
+ payload: {
1477
+ localJoin: boolean;
1478
+ };
1479
+ }, {
1480
+ type: "room.local_join_changed";
1481
+ payload: {
1482
+ localJoin: boolean;
1483
+ };
1484
+ }>, z.ZodObject<{
1485
+ type: z.ZodLiteral<"room.invitation_changed">;
1486
+ payload: z.ZodObject<{
1487
+ handle: z.ZodString;
1488
+ state: z.ZodEnum<["invited", "withdrawn"]>;
1489
+ role: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
1490
+ agents: z.ZodOptional<z.ZodNumber>;
1491
+ }, "strip", z.ZodTypeAny, {
1492
+ handle: string;
1493
+ state: "invited" | "withdrawn";
1494
+ role?: "guest" | "member" | undefined;
1495
+ agents?: number | undefined;
1496
+ }, {
1497
+ handle: string;
1498
+ state: "invited" | "withdrawn";
1499
+ role?: "guest" | "member" | undefined;
1500
+ agents?: number | undefined;
1501
+ }>;
1502
+ }, "strip", z.ZodTypeAny, {
1503
+ type: "room.invitation_changed";
1504
+ payload: {
1505
+ handle: string;
1506
+ state: "invited" | "withdrawn";
1507
+ role?: "guest" | "member" | undefined;
1508
+ agents?: number | undefined;
1509
+ };
1510
+ }, {
1511
+ type: "room.invitation_changed";
1512
+ payload: {
1513
+ handle: string;
1514
+ state: "invited" | "withdrawn";
1515
+ role?: "guest" | "member" | undefined;
1516
+ agents?: number | undefined;
1517
+ };
1518
+ }>, z.ZodObject<{
1519
+ type: z.ZodLiteral<"room.lock_changed">;
1520
+ payload: z.ZodObject<{
1521
+ locked: z.ZodBoolean;
1522
+ }, "strip", z.ZodTypeAny, {
1523
+ locked: boolean;
1524
+ }, {
1525
+ locked: boolean;
1526
+ }>;
1527
+ }, "strip", z.ZodTypeAny, {
1528
+ type: "room.lock_changed";
1529
+ payload: {
1530
+ locked: boolean;
1531
+ };
1532
+ }, {
1533
+ type: "room.lock_changed";
1534
+ payload: {
1535
+ locked: boolean;
1536
+ };
1537
+ }>, z.ZodObject<{
1538
+ type: z.ZodLiteral<"participant.mute_changed">;
1539
+ payload: z.ZodObject<{
1540
+ participantId: z.ZodString;
1541
+ muted: z.ZodBoolean;
1542
+ }, "strip", z.ZodTypeAny, {
1543
+ participantId: string;
1544
+ muted: boolean;
1545
+ }, {
1546
+ participantId: string;
1547
+ muted: boolean;
1548
+ }>;
1549
+ }, "strip", z.ZodTypeAny, {
1550
+ type: "participant.mute_changed";
1551
+ payload: {
1552
+ participantId: string;
1553
+ muted: boolean;
1554
+ };
1555
+ }, {
1556
+ type: "participant.mute_changed";
1557
+ payload: {
1558
+ participantId: string;
1559
+ muted: boolean;
1560
+ };
1561
+ }>, z.ZodObject<{
1562
+ type: z.ZodLiteral<"participant.role_changed">;
1563
+ payload: z.ZodObject<{
1564
+ participantId: z.ZodString;
1565
+ role: z.ZodEnum<["guest", "member", "controller"]>;
1566
+ previousRole: z.ZodEnum<["guest", "member", "controller"]>;
1567
+ }, "strip", z.ZodTypeAny, {
1568
+ participantId: string;
1569
+ role: "controller" | "guest" | "member";
1570
+ previousRole: "controller" | "guest" | "member";
1571
+ }, {
1572
+ participantId: string;
1573
+ role: "controller" | "guest" | "member";
1574
+ previousRole: "controller" | "guest" | "member";
1575
+ }>;
1576
+ }, "strip", z.ZodTypeAny, {
1577
+ type: "participant.role_changed";
1578
+ payload: {
1579
+ participantId: string;
1580
+ role: "controller" | "guest" | "member";
1581
+ previousRole: "controller" | "guest" | "member";
1582
+ };
1583
+ }, {
1584
+ type: "participant.role_changed";
1585
+ payload: {
1586
+ participantId: string;
1587
+ role: "controller" | "guest" | "member";
1588
+ previousRole: "controller" | "guest" | "member";
1589
+ };
1590
+ }>, z.ZodObject<{
1591
+ type: z.ZodLiteral<"conversation.turn_changed">;
1592
+ payload: z.ZodObject<{
1593
+ action: z.ZodEnum<["claimed", "working", "passed", "skipped", "cancelled", "mode"]>;
1594
+ requestIds: z.ZodArray<z.ZodString, "many">;
1595
+ participantIds: z.ZodArray<z.ZodString, "many">;
1596
+ mode: z.ZodEnum<["sequential", "parallel"]>;
1597
+ }, "strip", z.ZodTypeAny, {
1598
+ mode: "sequential" | "parallel";
1599
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1600
+ requestIds: string[];
1601
+ participantIds: string[];
1602
+ }, {
1603
+ mode: "sequential" | "parallel";
1604
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1605
+ requestIds: string[];
1606
+ participantIds: string[];
1607
+ }>;
1608
+ }, "strip", z.ZodTypeAny, {
1609
+ type: "conversation.turn_changed";
1610
+ payload: {
1611
+ mode: "sequential" | "parallel";
1612
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1613
+ requestIds: string[];
1614
+ participantIds: string[];
1615
+ };
1616
+ }, {
1617
+ type: "conversation.turn_changed";
1618
+ payload: {
1619
+ mode: "sequential" | "parallel";
1620
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1621
+ requestIds: string[];
1622
+ participantIds: string[];
1623
+ };
1624
+ }>]>>;
1625
+ }, "strip", z.ZodTypeAny, {
1626
+ type: "event";
1627
+ event: {
1628
+ at: number;
1629
+ eventId: string;
1630
+ protocolVersion: 1;
1631
+ roomId: string;
1632
+ seq: number;
1633
+ senderId: string | null;
1634
+ idempotencyKey: string | null;
1635
+ recipientId: string | null;
1636
+ replyTo: string | null;
1637
+ recipientIds?: string[] | undefined;
1638
+ allRecipients?: boolean | undefined;
1639
+ quoteOf?: string | undefined;
1640
+ } & ({
1641
+ type: "message";
1642
+ payload: {
1643
+ text: string;
1644
+ priority: "normal" | "priority";
1645
+ responseStage?: "progress" | "final" | undefined;
1646
+ };
1647
+ } | {
1648
+ type: "message.received";
1649
+ payload: {
1650
+ eventId: string;
1651
+ stage?: "read" | undefined;
1652
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
1653
+ reason?: string | undefined;
1654
+ responseEventId?: string | undefined;
1655
+ };
1656
+ } | {
1657
+ type: "message.delivery_failed";
1658
+ payload: {
1659
+ eventId: string;
1660
+ reason: string;
1661
+ stage?: "delivery" | "execution" | "publishing" | undefined;
1662
+ };
1663
+ } | {
1664
+ type: "handover.offered";
1665
+ payload: {
1666
+ handoverId: string;
1667
+ revision: number;
1668
+ document: {
1669
+ metadata: {
1670
+ mode: "sequential" | "concurrent";
1671
+ goal: string;
1672
+ recipient: string;
1673
+ nextAction: string;
1674
+ decisions: string[];
1675
+ blockers: string[];
1676
+ repository?: {
1677
+ dirty: boolean;
1678
+ branch: string;
1679
+ commit: string;
1680
+ missingPaths: string[];
1681
+ remote?: string | undefined;
1682
+ worktreePath?: string | undefined;
1683
+ } | undefined;
1684
+ tests?: {
1685
+ command: string;
1686
+ result: "passed" | "failed" | "not_run";
1687
+ notes?: string | undefined;
1688
+ } | undefined;
1689
+ };
1690
+ body: string;
1691
+ };
1692
+ };
1693
+ } | {
1694
+ type: "handover.accepted";
1695
+ payload: {
1696
+ handoverId: string;
1697
+ revision: number;
1698
+ note?: string | undefined;
1699
+ };
1700
+ } | {
1701
+ type: "handover.declined";
1702
+ payload: {
1703
+ handoverId: string;
1704
+ revision: number;
1705
+ reason?: string | undefined;
1706
+ };
1707
+ } | {
1708
+ type: "participant.joined";
1709
+ payload: {
1710
+ participantId: string;
1711
+ displayName: string;
1712
+ kind: "agent" | "human";
1713
+ role: "controller" | "guest" | "member";
1714
+ capabilities?: {
1715
+ deliverUnsolicited: boolean;
1716
+ cancelTurn: boolean;
1717
+ cancelTool: boolean;
1718
+ runtime?: string | undefined;
1719
+ runtimeVersion?: string | undefined;
1720
+ } | undefined;
1721
+ };
1722
+ } | {
1723
+ type: "participant.renamed";
1724
+ payload: {
1725
+ name: string;
1726
+ source: "profile" | "room";
1727
+ participantId: string;
1728
+ previousName: string;
1729
+ };
1730
+ } | {
1731
+ type: "participant.left";
1732
+ payload: {
1733
+ participantId: string;
1734
+ };
1735
+ } | {
1736
+ type: "participant.revoked";
1737
+ payload: {
1738
+ participantId: string;
1739
+ };
1740
+ } | {
1741
+ type: "control.pause";
1742
+ payload: {
1743
+ revision: number;
1744
+ targetParticipantId: string;
1745
+ reason?: string | undefined;
1746
+ interrupt?: boolean | undefined;
1747
+ };
1748
+ } | {
1749
+ type: "control.resume";
1750
+ payload: {
1751
+ revision: number;
1752
+ targetParticipantId: string;
1753
+ };
1754
+ } | {
1755
+ type: "control.ack";
1756
+ payload: {
1757
+ revision: number;
1758
+ targetParticipantId: string;
1759
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1760
+ detail?: string | undefined;
1761
+ };
1762
+ } | {
1763
+ type: "room.closed";
1764
+ payload: {
1765
+ exportWindowEndsAt: number;
1766
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1767
+ };
1768
+ } | {
1769
+ type: "room.auto_close_changed";
1770
+ payload: {
1771
+ autoClose: {
1772
+ mode: "off";
1773
+ } | {
1774
+ mode: "inactivity";
1775
+ afterMs: number;
1776
+ } | {
1777
+ mode: "age";
1778
+ afterMs: number;
1779
+ } | {
1780
+ mode: "agents_and_guests_left";
1781
+ };
1782
+ previous: {
1783
+ mode: "off";
1784
+ } | {
1785
+ mode: "inactivity";
1786
+ afterMs: number;
1787
+ } | {
1788
+ mode: "age";
1789
+ afterMs: number;
1790
+ } | {
1791
+ mode: "agents_and_guests_left";
1792
+ };
1793
+ };
1794
+ } | {
1795
+ type: "room.renamed";
1796
+ payload: {
1797
+ name: string;
1798
+ previousName: string;
1799
+ };
1800
+ } | {
1801
+ type: "room.expiry_changed";
1802
+ payload: {
1803
+ expiresAt: number | null;
1804
+ previousExpiresAt: number | null;
1805
+ };
1806
+ } | {
1807
+ type: "room.access_changed";
1808
+ payload: {
1809
+ joinPolicy: "invite_only" | "open_to_guests";
1810
+ inviteRole?: "guest" | "member" | undefined;
1811
+ };
1812
+ } | {
1813
+ type: "room.local_join_changed";
1814
+ payload: {
1815
+ localJoin: boolean;
1816
+ };
1817
+ } | {
1818
+ type: "room.invitation_changed";
1819
+ payload: {
1820
+ handle: string;
1821
+ state: "invited" | "withdrawn";
1822
+ role?: "guest" | "member" | undefined;
1823
+ agents?: number | undefined;
1824
+ };
1825
+ } | {
1826
+ type: "room.lock_changed";
1827
+ payload: {
1828
+ locked: boolean;
1829
+ };
1830
+ } | {
1831
+ type: "participant.mute_changed";
1832
+ payload: {
1833
+ participantId: string;
1834
+ muted: boolean;
1835
+ };
1836
+ } | {
1837
+ type: "participant.role_changed";
1838
+ payload: {
1839
+ participantId: string;
1840
+ role: "controller" | "guest" | "member";
1841
+ previousRole: "controller" | "guest" | "member";
1842
+ };
1843
+ } | {
1844
+ type: "conversation.turn_changed";
1845
+ payload: {
1846
+ mode: "sequential" | "parallel";
1847
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1848
+ requestIds: string[];
1849
+ participantIds: string[];
1850
+ };
1851
+ });
1852
+ }, {
1853
+ type: "event";
1854
+ event: {
1855
+ at: number;
1856
+ eventId: string;
1857
+ protocolVersion: 1;
1858
+ roomId: string;
1859
+ seq: number;
1860
+ senderId: string | null;
1861
+ idempotencyKey: string | null;
1862
+ recipientId: string | null;
1863
+ replyTo: string | null;
1864
+ recipientIds?: string[] | undefined;
1865
+ allRecipients?: boolean | undefined;
1866
+ quoteOf?: string | undefined;
1867
+ } & ({
1868
+ type: "message";
1869
+ payload: {
1870
+ text: string;
1871
+ priority?: "normal" | "priority" | undefined;
1872
+ responseStage?: "progress" | "final" | undefined;
1873
+ };
1874
+ } | {
1875
+ type: "message.received";
1876
+ payload: {
1877
+ eventId: string;
1878
+ stage?: "read" | undefined;
1879
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
1880
+ reason?: string | undefined;
1881
+ responseEventId?: string | undefined;
1882
+ };
1883
+ } | {
1884
+ type: "message.delivery_failed";
1885
+ payload: {
1886
+ eventId: string;
1887
+ reason: string;
1888
+ stage?: "delivery" | "execution" | "publishing" | undefined;
1889
+ };
1890
+ } | {
1891
+ type: "handover.offered";
1892
+ payload: {
1893
+ handoverId: string;
1894
+ revision: number;
1895
+ document: {
1896
+ metadata: {
1897
+ mode: "sequential" | "concurrent";
1898
+ goal: string;
1899
+ recipient: string;
1900
+ nextAction: string;
1901
+ decisions?: string[] | undefined;
1902
+ blockers?: string[] | undefined;
1903
+ repository?: {
1904
+ dirty: boolean;
1905
+ branch: string;
1906
+ commit: string;
1907
+ remote?: string | undefined;
1908
+ worktreePath?: string | undefined;
1909
+ missingPaths?: string[] | undefined;
1910
+ } | undefined;
1911
+ tests?: {
1912
+ command: string;
1913
+ result: "passed" | "failed" | "not_run";
1914
+ notes?: string | undefined;
1915
+ } | undefined;
1916
+ };
1917
+ body: string;
1918
+ };
1919
+ };
1920
+ } | {
1921
+ type: "handover.accepted";
1922
+ payload: {
1923
+ handoverId: string;
1924
+ revision: number;
1925
+ note?: string | undefined;
1926
+ };
1927
+ } | {
1928
+ type: "handover.declined";
1929
+ payload: {
1930
+ handoverId: string;
1931
+ revision: number;
1932
+ reason?: string | undefined;
1933
+ };
1934
+ } | {
1935
+ type: "participant.joined";
1936
+ payload: {
1937
+ participantId: string;
1938
+ displayName: string;
1939
+ kind: "agent" | "human";
1940
+ role: "controller" | "guest" | "member";
1941
+ capabilities?: {
1942
+ deliverUnsolicited?: boolean | undefined;
1943
+ cancelTurn?: boolean | undefined;
1944
+ cancelTool?: boolean | undefined;
1945
+ runtime?: string | undefined;
1946
+ runtimeVersion?: string | undefined;
1947
+ } | undefined;
1948
+ };
1949
+ } | {
1950
+ type: "participant.renamed";
1951
+ payload: {
1952
+ name: string;
1953
+ source: "profile" | "room";
1954
+ participantId: string;
1955
+ previousName: string;
1956
+ };
1957
+ } | {
1958
+ type: "participant.left";
1959
+ payload: {
1960
+ participantId: string;
1961
+ };
1962
+ } | {
1963
+ type: "participant.revoked";
1964
+ payload: {
1965
+ participantId: string;
1966
+ };
1967
+ } | {
1968
+ type: "control.pause";
1969
+ payload: {
1970
+ revision: number;
1971
+ targetParticipantId: string;
1972
+ reason?: string | undefined;
1973
+ interrupt?: boolean | undefined;
1974
+ };
1975
+ } | {
1976
+ type: "control.resume";
1977
+ payload: {
1978
+ revision: number;
1979
+ targetParticipantId: string;
1980
+ };
1981
+ } | {
1982
+ type: "control.ack";
1983
+ payload: {
1984
+ revision: number;
1985
+ targetParticipantId: string;
1986
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1987
+ detail?: string | undefined;
1988
+ };
1989
+ } | {
1990
+ type: "room.closed";
1991
+ payload: {
1992
+ exportWindowEndsAt: number;
1993
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1994
+ };
1995
+ } | {
1996
+ type: "room.auto_close_changed";
1997
+ payload: {
1998
+ autoClose: {
1999
+ mode: "off";
2000
+ } | {
2001
+ mode: "inactivity";
2002
+ afterMs: number;
2003
+ } | {
2004
+ mode: "age";
2005
+ afterMs: number;
2006
+ } | {
2007
+ mode: "agents_and_guests_left";
2008
+ };
2009
+ previous: {
2010
+ mode: "off";
2011
+ } | {
2012
+ mode: "inactivity";
2013
+ afterMs: number;
2014
+ } | {
2015
+ mode: "age";
2016
+ afterMs: number;
2017
+ } | {
2018
+ mode: "agents_and_guests_left";
2019
+ };
2020
+ };
2021
+ } | {
2022
+ type: "room.renamed";
2023
+ payload: {
2024
+ name: string;
2025
+ previousName: string;
2026
+ };
2027
+ } | {
2028
+ type: "room.expiry_changed";
2029
+ payload: {
2030
+ expiresAt: number | null;
2031
+ previousExpiresAt: number | null;
2032
+ };
2033
+ } | {
2034
+ type: "room.access_changed";
2035
+ payload: {
2036
+ joinPolicy: "invite_only" | "open_to_guests";
2037
+ inviteRole?: "guest" | "member" | undefined;
2038
+ };
2039
+ } | {
2040
+ type: "room.local_join_changed";
2041
+ payload: {
2042
+ localJoin: boolean;
2043
+ };
2044
+ } | {
2045
+ type: "room.invitation_changed";
2046
+ payload: {
2047
+ handle: string;
2048
+ state: "invited" | "withdrawn";
2049
+ role?: "guest" | "member" | undefined;
2050
+ agents?: number | undefined;
2051
+ };
2052
+ } | {
2053
+ type: "room.lock_changed";
2054
+ payload: {
2055
+ locked: boolean;
2056
+ };
2057
+ } | {
2058
+ type: "participant.mute_changed";
2059
+ payload: {
2060
+ participantId: string;
2061
+ muted: boolean;
2062
+ };
2063
+ } | {
2064
+ type: "participant.role_changed";
2065
+ payload: {
2066
+ participantId: string;
2067
+ role: "controller" | "guest" | "member";
2068
+ previousRole: "controller" | "guest" | "member";
2069
+ };
2070
+ } | {
2071
+ type: "conversation.turn_changed";
2072
+ payload: {
2073
+ mode: "sequential" | "parallel";
2074
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
2075
+ requestIds: string[];
2076
+ participantIds: string[];
2077
+ };
2078
+ });
2079
+ }>;
2080
+ export declare const ServerErrorFrame: z.ZodIntersection<z.ZodObject<{
2081
+ type: z.ZodLiteral<"error">;
2082
+ fatal: z.ZodBoolean;
2083
+ }, "strip", z.ZodTypeAny, {
2084
+ type: "error";
2085
+ fatal: boolean;
2086
+ }, {
2087
+ type: "error";
2088
+ fatal: boolean;
2089
+ }>, z.ZodObject<{
2090
+ error: z.ZodObject<{
2091
+ code: z.ZodEnum<["invite_expired", "invite_already_redeemed", "invite_unknown", "unauthorized", "participant_revoked", "room_expired", "room_closed", "room_locked", "participant_muted", "turn_conflict", "turn_required", "turn_expired", "room_not_found", "quota_exceeded", "cursor_gap", "stale_handover_revision", "handover_already_resolved", "idempotency_conflict", "participant_limit_reached", "payload_too_large", "unsupported_capability", "protocol_version_unsupported", "invalid_request", "server_unavailable"]>;
2092
+ message: z.ZodString;
2093
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
2094
+ earliestAvailableSeq: z.ZodOptional<z.ZodNumber>;
2095
+ currentRevision: z.ZodOptional<z.ZodNumber>;
2096
+ }, "strip", z.ZodTypeAny, {
2097
+ code: "invite_expired" | "invite_already_redeemed" | "invite_unknown" | "unauthorized" | "participant_revoked" | "room_expired" | "room_closed" | "room_locked" | "participant_muted" | "turn_conflict" | "turn_required" | "turn_expired" | "room_not_found" | "quota_exceeded" | "cursor_gap" | "stale_handover_revision" | "handover_already_resolved" | "idempotency_conflict" | "participant_limit_reached" | "payload_too_large" | "unsupported_capability" | "protocol_version_unsupported" | "invalid_request" | "server_unavailable";
2098
+ message: string;
2099
+ retryAfterMs?: number | undefined;
2100
+ earliestAvailableSeq?: number | undefined;
2101
+ currentRevision?: number | undefined;
2102
+ }, {
2103
+ code: "invite_expired" | "invite_already_redeemed" | "invite_unknown" | "unauthorized" | "participant_revoked" | "room_expired" | "room_closed" | "room_locked" | "participant_muted" | "turn_conflict" | "turn_required" | "turn_expired" | "room_not_found" | "quota_exceeded" | "cursor_gap" | "stale_handover_revision" | "handover_already_resolved" | "idempotency_conflict" | "participant_limit_reached" | "payload_too_large" | "unsupported_capability" | "protocol_version_unsupported" | "invalid_request" | "server_unavailable";
2104
+ message: string;
2105
+ retryAfterMs?: number | undefined;
2106
+ earliestAvailableSeq?: number | undefined;
2107
+ currentRevision?: number | undefined;
2108
+ }>;
2109
+ }, "strip", z.ZodTypeAny, {
2110
+ error: {
2111
+ code: "invite_expired" | "invite_already_redeemed" | "invite_unknown" | "unauthorized" | "participant_revoked" | "room_expired" | "room_closed" | "room_locked" | "participant_muted" | "turn_conflict" | "turn_required" | "turn_expired" | "room_not_found" | "quota_exceeded" | "cursor_gap" | "stale_handover_revision" | "handover_already_resolved" | "idempotency_conflict" | "participant_limit_reached" | "payload_too_large" | "unsupported_capability" | "protocol_version_unsupported" | "invalid_request" | "server_unavailable";
2112
+ message: string;
2113
+ retryAfterMs?: number | undefined;
2114
+ earliestAvailableSeq?: number | undefined;
2115
+ currentRevision?: number | undefined;
2116
+ };
2117
+ }, {
2118
+ error: {
2119
+ code: "invite_expired" | "invite_already_redeemed" | "invite_unknown" | "unauthorized" | "participant_revoked" | "room_expired" | "room_closed" | "room_locked" | "participant_muted" | "turn_conflict" | "turn_required" | "turn_expired" | "room_not_found" | "quota_exceeded" | "cursor_gap" | "stale_handover_revision" | "handover_already_resolved" | "idempotency_conflict" | "participant_limit_reached" | "payload_too_large" | "unsupported_capability" | "protocol_version_unsupported" | "invalid_request" | "server_unavailable";
2120
+ message: string;
2121
+ retryAfterMs?: number | undefined;
2122
+ earliestAvailableSeq?: number | undefined;
2123
+ currentRevision?: number | undefined;
2124
+ };
2125
+ }>>;
2126
+ export declare const ServerFrame: z.ZodUnion<[z.ZodObject<{
2127
+ type: z.ZodLiteral<"hello">;
2128
+ snapshot: z.ZodObject<{
2129
+ roomId: z.ZodString;
2130
+ messageReceiptScope: z.ZodOptional<z.ZodEnum<["recipient", "members"]>>;
2131
+ messageStagesSupported: z.ZodOptional<z.ZodBoolean>;
2132
+ rejoinSupported: z.ZodOptional<z.ZodBoolean>;
2133
+ renameSelfSupported: z.ZodOptional<z.ZodBoolean>;
2134
+ adminRolesSupported: z.ZodOptional<z.ZodBoolean>;
2135
+ inviteRoleSupported: z.ZodOptional<z.ZodBoolean>;
2136
+ autoCloseSupported: z.ZodOptional<z.ZodBoolean>;
2137
+ interruptSupported: z.ZodOptional<z.ZodBoolean>;
2138
+ lastMessageAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2139
+ autoCloseArmed: z.ZodOptional<z.ZodBoolean>;
2140
+ autoCloseAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2141
+ closeReason: z.ZodOptional<z.ZodEnum<["manual", "inactivity", "age", "agents_and_guests_left"]>>;
2142
+ quotedMessagesSupported: z.ZodOptional<z.ZodBoolean>;
2143
+ groupTurnsSupported: z.ZodOptional<z.ZodBoolean>;
2144
+ workingStatusSupported: z.ZodOptional<z.ZodBoolean>;
2145
+ turnMode: z.ZodOptional<z.ZodEnum<["sequential", "parallel"]>>;
2146
+ name: z.ZodString;
2147
+ lifecycle: z.ZodEnum<["open", "closed", "expired", "deleted"]>;
2148
+ locked: z.ZodOptional<z.ZodBoolean>;
2149
+ createdAt: z.ZodNumber;
2150
+ expiresAt: z.ZodNullable<z.ZodNumber>;
2151
+ closedAt: z.ZodNullable<z.ZodNumber>;
2152
+ controlRevision: z.ZodNumber;
2153
+ latestSeq: z.ZodNumber;
2154
+ earliestSeq: z.ZodNumber;
2155
+ participants: z.ZodArray<z.ZodObject<{
2156
+ participantId: z.ZodString;
2157
+ displayName: z.ZodString;
2158
+ nameSource: z.ZodOptional<z.ZodEnum<["profile", "room"]>>;
2159
+ kind: z.ZodEnum<["agent", "human"]>;
2160
+ role: z.ZodEnum<["guest", "member", "controller"]>;
2161
+ capabilities: z.ZodNullable<z.ZodObject<{
2162
+ deliverUnsolicited: z.ZodDefault<z.ZodBoolean>;
2163
+ cancelTurn: z.ZodDefault<z.ZodBoolean>;
2164
+ cancelTool: z.ZodDefault<z.ZodBoolean>;
2165
+ runtime: z.ZodOptional<z.ZodString>;
2166
+ runtimeVersion: z.ZodOptional<z.ZodString>;
2167
+ }, "strip", z.ZodTypeAny, {
2168
+ deliverUnsolicited: boolean;
2169
+ cancelTurn: boolean;
2170
+ cancelTool: boolean;
2171
+ runtime?: string | undefined;
2172
+ runtimeVersion?: string | undefined;
2173
+ }, {
2174
+ deliverUnsolicited?: boolean | undefined;
2175
+ cancelTurn?: boolean | undefined;
2176
+ cancelTool?: boolean | undefined;
2177
+ runtime?: string | undefined;
2178
+ runtimeVersion?: string | undefined;
2179
+ }>>;
2180
+ joinedAt: z.ZodNumber;
2181
+ revoked: z.ZodBoolean;
2182
+ left: z.ZodBoolean;
2183
+ paused: z.ZodBoolean;
2184
+ muted: z.ZodOptional<z.ZodBoolean>;
2185
+ controlRevision: z.ZodNumber;
2186
+ acknowledgedOutcome: z.ZodNullable<z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>>;
2187
+ acknowledgedRevision: z.ZodOptional<z.ZodNumber>;
2188
+ interruptRequested: z.ZodOptional<z.ZodBoolean>;
2189
+ }, "strip", z.ZodTypeAny, {
2190
+ participantId: string;
2191
+ displayName: string;
2192
+ kind: "agent" | "human";
2193
+ role: "controller" | "guest" | "member";
2194
+ capabilities: {
2195
+ deliverUnsolicited: boolean;
2196
+ cancelTurn: boolean;
2197
+ cancelTool: boolean;
2198
+ runtime?: string | undefined;
2199
+ runtimeVersion?: string | undefined;
2200
+ } | null;
2201
+ controlRevision: number;
2202
+ joinedAt: number;
2203
+ paused: boolean;
2204
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
2205
+ revoked: boolean;
2206
+ left: boolean;
2207
+ muted?: boolean | undefined;
2208
+ nameSource?: "profile" | "room" | undefined;
2209
+ interruptRequested?: boolean | undefined;
2210
+ acknowledgedRevision?: number | undefined;
2211
+ }, {
2212
+ participantId: string;
2213
+ displayName: string;
2214
+ kind: "agent" | "human";
2215
+ role: "controller" | "guest" | "member";
2216
+ capabilities: {
2217
+ deliverUnsolicited?: boolean | undefined;
2218
+ cancelTurn?: boolean | undefined;
2219
+ cancelTool?: boolean | undefined;
2220
+ runtime?: string | undefined;
2221
+ runtimeVersion?: string | undefined;
2222
+ } | null;
2223
+ controlRevision: number;
2224
+ joinedAt: number;
2225
+ paused: boolean;
2226
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
2227
+ revoked: boolean;
2228
+ left: boolean;
2229
+ muted?: boolean | undefined;
2230
+ nameSource?: "profile" | "room" | undefined;
2231
+ interruptRequested?: boolean | undefined;
2232
+ acknowledgedRevision?: number | undefined;
2233
+ }>, "many">;
2234
+ policy: z.ZodObject<{
2235
+ joinPolicy: z.ZodDefault<z.ZodEnum<["invite_only", "open_to_guests"]>>;
2236
+ inviteRole: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
2237
+ autoClose: z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2238
+ mode: z.ZodLiteral<"off">;
2239
+ }, "strip", z.ZodTypeAny, {
2240
+ mode: "off";
2241
+ }, {
2242
+ mode: "off";
2243
+ }>, z.ZodObject<{
2244
+ mode: z.ZodLiteral<"inactivity">;
2245
+ afterMs: z.ZodNumber;
2246
+ }, "strip", z.ZodTypeAny, {
2247
+ mode: "inactivity";
2248
+ afterMs: number;
2249
+ }, {
2250
+ mode: "inactivity";
2251
+ afterMs: number;
2252
+ }>, z.ZodObject<{
2253
+ mode: z.ZodLiteral<"age">;
2254
+ afterMs: z.ZodNumber;
2255
+ }, "strip", z.ZodTypeAny, {
2256
+ mode: "age";
2257
+ afterMs: number;
2258
+ }, {
2259
+ mode: "age";
2260
+ afterMs: number;
2261
+ }>, z.ZodObject<{
2262
+ mode: z.ZodLiteral<"agents_and_guests_left">;
2263
+ }, "strip", z.ZodTypeAny, {
2264
+ mode: "agents_and_guests_left";
2265
+ }, {
2266
+ mode: "agents_and_guests_left";
2267
+ }>]>>;
2268
+ localJoin: z.ZodOptional<z.ZodBoolean>;
2269
+ maxParticipants: z.ZodNumber;
2270
+ maxEventPayloadBytes: z.ZodNumber;
2271
+ maxRetainedEventBytes: z.ZodNumber;
2272
+ maxRetainedEvents: z.ZodNumber;
2273
+ roomLifetimeMs: z.ZodNullable<z.ZodNumber>;
2274
+ inviteLifetimeMs: z.ZodNullable<z.ZodNumber>;
2275
+ exportWindowMs: z.ZodNumber;
2276
+ connectTicketLifetimeMs: z.ZodNumber;
2277
+ }, "strip", z.ZodTypeAny, {
2278
+ joinPolicy: "invite_only" | "open_to_guests";
2279
+ maxParticipants: number;
2280
+ maxEventPayloadBytes: number;
2281
+ maxRetainedEventBytes: number;
2282
+ maxRetainedEvents: number;
2283
+ roomLifetimeMs: number | null;
2284
+ inviteLifetimeMs: number | null;
2285
+ exportWindowMs: number;
2286
+ connectTicketLifetimeMs: number;
2287
+ autoClose?: {
2288
+ mode: "off";
2289
+ } | {
2290
+ mode: "inactivity";
2291
+ afterMs: number;
2292
+ } | {
2293
+ mode: "age";
2294
+ afterMs: number;
2295
+ } | {
2296
+ mode: "agents_and_guests_left";
2297
+ } | undefined;
2298
+ inviteRole?: "guest" | "member" | undefined;
2299
+ localJoin?: boolean | undefined;
2300
+ }, {
2301
+ maxParticipants: number;
2302
+ maxEventPayloadBytes: number;
2303
+ maxRetainedEventBytes: number;
2304
+ maxRetainedEvents: number;
2305
+ roomLifetimeMs: number | null;
2306
+ inviteLifetimeMs: number | null;
2307
+ exportWindowMs: number;
2308
+ connectTicketLifetimeMs: number;
2309
+ autoClose?: {
2310
+ mode: "off";
2311
+ } | {
2312
+ mode: "inactivity";
2313
+ afterMs: number;
2314
+ } | {
2315
+ mode: "age";
2316
+ afterMs: number;
2317
+ } | {
2318
+ mode: "agents_and_guests_left";
2319
+ } | undefined;
2320
+ joinPolicy?: "invite_only" | "open_to_guests" | undefined;
2321
+ inviteRole?: "guest" | "member" | undefined;
2322
+ localJoin?: boolean | undefined;
2323
+ }>;
2324
+ }, "strip", z.ZodTypeAny, {
2325
+ name: string;
2326
+ expiresAt: number | null;
2327
+ roomId: string;
2328
+ createdAt: number;
2329
+ closedAt: number | null;
2330
+ lifecycle: "open" | "closed" | "expired" | "deleted";
2331
+ policy: {
2332
+ joinPolicy: "invite_only" | "open_to_guests";
2333
+ maxParticipants: number;
2334
+ maxEventPayloadBytes: number;
2335
+ maxRetainedEventBytes: number;
2336
+ maxRetainedEvents: number;
2337
+ roomLifetimeMs: number | null;
2338
+ inviteLifetimeMs: number | null;
2339
+ exportWindowMs: number;
2340
+ connectTicketLifetimeMs: number;
2341
+ autoClose?: {
2342
+ mode: "off";
2343
+ } | {
2344
+ mode: "inactivity";
2345
+ afterMs: number;
2346
+ } | {
2347
+ mode: "age";
2348
+ afterMs: number;
2349
+ } | {
2350
+ mode: "agents_and_guests_left";
2351
+ } | undefined;
2352
+ inviteRole?: "guest" | "member" | undefined;
2353
+ localJoin?: boolean | undefined;
2354
+ };
2355
+ controlRevision: number;
2356
+ latestSeq: number;
2357
+ earliestSeq: number;
2358
+ participants: {
2359
+ participantId: string;
2360
+ displayName: string;
2361
+ kind: "agent" | "human";
2362
+ role: "controller" | "guest" | "member";
2363
+ capabilities: {
2364
+ deliverUnsolicited: boolean;
2365
+ cancelTurn: boolean;
2366
+ cancelTool: boolean;
2367
+ runtime?: string | undefined;
2368
+ runtimeVersion?: string | undefined;
2369
+ } | null;
2370
+ controlRevision: number;
2371
+ joinedAt: number;
2372
+ paused: boolean;
2373
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
2374
+ revoked: boolean;
2375
+ left: boolean;
2376
+ muted?: boolean | undefined;
2377
+ nameSource?: "profile" | "room" | undefined;
2378
+ interruptRequested?: boolean | undefined;
2379
+ acknowledgedRevision?: number | undefined;
2380
+ }[];
2381
+ locked?: boolean | undefined;
2382
+ turnMode?: "sequential" | "parallel" | undefined;
2383
+ lastMessageAt?: number | null | undefined;
2384
+ autoCloseArmed?: boolean | undefined;
2385
+ autoCloseAt?: number | null | undefined;
2386
+ closeReason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
2387
+ messageReceiptScope?: "recipient" | "members" | undefined;
2388
+ messageStagesSupported?: boolean | undefined;
2389
+ rejoinSupported?: boolean | undefined;
2390
+ renameSelfSupported?: boolean | undefined;
2391
+ adminRolesSupported?: boolean | undefined;
2392
+ inviteRoleSupported?: boolean | undefined;
2393
+ autoCloseSupported?: boolean | undefined;
2394
+ interruptSupported?: boolean | undefined;
2395
+ quotedMessagesSupported?: boolean | undefined;
2396
+ groupTurnsSupported?: boolean | undefined;
2397
+ workingStatusSupported?: boolean | undefined;
2398
+ }, {
2399
+ name: string;
2400
+ expiresAt: number | null;
2401
+ roomId: string;
2402
+ createdAt: number;
2403
+ closedAt: number | null;
2404
+ lifecycle: "open" | "closed" | "expired" | "deleted";
2405
+ policy: {
2406
+ maxParticipants: number;
2407
+ maxEventPayloadBytes: number;
2408
+ maxRetainedEventBytes: number;
2409
+ maxRetainedEvents: number;
2410
+ roomLifetimeMs: number | null;
2411
+ inviteLifetimeMs: number | null;
2412
+ exportWindowMs: number;
2413
+ connectTicketLifetimeMs: number;
2414
+ autoClose?: {
2415
+ mode: "off";
2416
+ } | {
2417
+ mode: "inactivity";
2418
+ afterMs: number;
2419
+ } | {
2420
+ mode: "age";
2421
+ afterMs: number;
2422
+ } | {
2423
+ mode: "agents_and_guests_left";
2424
+ } | undefined;
2425
+ joinPolicy?: "invite_only" | "open_to_guests" | undefined;
2426
+ inviteRole?: "guest" | "member" | undefined;
2427
+ localJoin?: boolean | undefined;
2428
+ };
2429
+ controlRevision: number;
2430
+ latestSeq: number;
2431
+ earliestSeq: number;
2432
+ participants: {
2433
+ participantId: string;
2434
+ displayName: string;
2435
+ kind: "agent" | "human";
2436
+ role: "controller" | "guest" | "member";
2437
+ capabilities: {
2438
+ deliverUnsolicited?: boolean | undefined;
2439
+ cancelTurn?: boolean | undefined;
2440
+ cancelTool?: boolean | undefined;
2441
+ runtime?: string | undefined;
2442
+ runtimeVersion?: string | undefined;
2443
+ } | null;
2444
+ controlRevision: number;
2445
+ joinedAt: number;
2446
+ paused: boolean;
2447
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
2448
+ revoked: boolean;
2449
+ left: boolean;
2450
+ muted?: boolean | undefined;
2451
+ nameSource?: "profile" | "room" | undefined;
2452
+ interruptRequested?: boolean | undefined;
2453
+ acknowledgedRevision?: number | undefined;
2454
+ }[];
2455
+ locked?: boolean | undefined;
2456
+ turnMode?: "sequential" | "parallel" | undefined;
2457
+ lastMessageAt?: number | null | undefined;
2458
+ autoCloseArmed?: boolean | undefined;
2459
+ autoCloseAt?: number | null | undefined;
2460
+ closeReason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
2461
+ messageReceiptScope?: "recipient" | "members" | undefined;
2462
+ messageStagesSupported?: boolean | undefined;
2463
+ rejoinSupported?: boolean | undefined;
2464
+ renameSelfSupported?: boolean | undefined;
2465
+ adminRolesSupported?: boolean | undefined;
2466
+ inviteRoleSupported?: boolean | undefined;
2467
+ autoCloseSupported?: boolean | undefined;
2468
+ interruptSupported?: boolean | undefined;
2469
+ quotedMessagesSupported?: boolean | undefined;
2470
+ groupTurnsSupported?: boolean | undefined;
2471
+ workingStatusSupported?: boolean | undefined;
2472
+ }>;
2473
+ watermarkSeq: z.ZodNumber;
2474
+ }, "strip", z.ZodTypeAny, {
2475
+ type: "hello";
2476
+ snapshot: {
2477
+ name: string;
2478
+ expiresAt: number | null;
2479
+ roomId: string;
2480
+ createdAt: number;
2481
+ closedAt: number | null;
2482
+ lifecycle: "open" | "closed" | "expired" | "deleted";
2483
+ policy: {
2484
+ joinPolicy: "invite_only" | "open_to_guests";
2485
+ maxParticipants: number;
2486
+ maxEventPayloadBytes: number;
2487
+ maxRetainedEventBytes: number;
2488
+ maxRetainedEvents: number;
2489
+ roomLifetimeMs: number | null;
2490
+ inviteLifetimeMs: number | null;
2491
+ exportWindowMs: number;
2492
+ connectTicketLifetimeMs: number;
2493
+ autoClose?: {
2494
+ mode: "off";
2495
+ } | {
2496
+ mode: "inactivity";
2497
+ afterMs: number;
2498
+ } | {
2499
+ mode: "age";
2500
+ afterMs: number;
2501
+ } | {
2502
+ mode: "agents_and_guests_left";
2503
+ } | undefined;
2504
+ inviteRole?: "guest" | "member" | undefined;
2505
+ localJoin?: boolean | undefined;
2506
+ };
2507
+ controlRevision: number;
2508
+ latestSeq: number;
2509
+ earliestSeq: number;
2510
+ participants: {
2511
+ participantId: string;
2512
+ displayName: string;
2513
+ kind: "agent" | "human";
2514
+ role: "controller" | "guest" | "member";
2515
+ capabilities: {
2516
+ deliverUnsolicited: boolean;
2517
+ cancelTurn: boolean;
2518
+ cancelTool: boolean;
2519
+ runtime?: string | undefined;
2520
+ runtimeVersion?: string | undefined;
2521
+ } | null;
2522
+ controlRevision: number;
2523
+ joinedAt: number;
2524
+ paused: boolean;
2525
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
2526
+ revoked: boolean;
2527
+ left: boolean;
2528
+ muted?: boolean | undefined;
2529
+ nameSource?: "profile" | "room" | undefined;
2530
+ interruptRequested?: boolean | undefined;
2531
+ acknowledgedRevision?: number | undefined;
2532
+ }[];
2533
+ locked?: boolean | undefined;
2534
+ turnMode?: "sequential" | "parallel" | undefined;
2535
+ lastMessageAt?: number | null | undefined;
2536
+ autoCloseArmed?: boolean | undefined;
2537
+ autoCloseAt?: number | null | undefined;
2538
+ closeReason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
2539
+ messageReceiptScope?: "recipient" | "members" | undefined;
2540
+ messageStagesSupported?: boolean | undefined;
2541
+ rejoinSupported?: boolean | undefined;
2542
+ renameSelfSupported?: boolean | undefined;
2543
+ adminRolesSupported?: boolean | undefined;
2544
+ inviteRoleSupported?: boolean | undefined;
2545
+ autoCloseSupported?: boolean | undefined;
2546
+ interruptSupported?: boolean | undefined;
2547
+ quotedMessagesSupported?: boolean | undefined;
2548
+ groupTurnsSupported?: boolean | undefined;
2549
+ workingStatusSupported?: boolean | undefined;
2550
+ };
2551
+ watermarkSeq: number;
2552
+ }, {
2553
+ type: "hello";
2554
+ snapshot: {
2555
+ name: string;
2556
+ expiresAt: number | null;
2557
+ roomId: string;
2558
+ createdAt: number;
2559
+ closedAt: number | null;
2560
+ lifecycle: "open" | "closed" | "expired" | "deleted";
2561
+ policy: {
2562
+ maxParticipants: number;
2563
+ maxEventPayloadBytes: number;
2564
+ maxRetainedEventBytes: number;
2565
+ maxRetainedEvents: number;
2566
+ roomLifetimeMs: number | null;
2567
+ inviteLifetimeMs: number | null;
2568
+ exportWindowMs: number;
2569
+ connectTicketLifetimeMs: number;
2570
+ autoClose?: {
2571
+ mode: "off";
2572
+ } | {
2573
+ mode: "inactivity";
2574
+ afterMs: number;
2575
+ } | {
2576
+ mode: "age";
2577
+ afterMs: number;
2578
+ } | {
2579
+ mode: "agents_and_guests_left";
2580
+ } | undefined;
2581
+ joinPolicy?: "invite_only" | "open_to_guests" | undefined;
2582
+ inviteRole?: "guest" | "member" | undefined;
2583
+ localJoin?: boolean | undefined;
2584
+ };
2585
+ controlRevision: number;
2586
+ latestSeq: number;
2587
+ earliestSeq: number;
2588
+ participants: {
2589
+ participantId: string;
2590
+ displayName: string;
2591
+ kind: "agent" | "human";
2592
+ role: "controller" | "guest" | "member";
2593
+ capabilities: {
2594
+ deliverUnsolicited?: boolean | undefined;
2595
+ cancelTurn?: boolean | undefined;
2596
+ cancelTool?: boolean | undefined;
2597
+ runtime?: string | undefined;
2598
+ runtimeVersion?: string | undefined;
2599
+ } | null;
2600
+ controlRevision: number;
2601
+ joinedAt: number;
2602
+ paused: boolean;
2603
+ acknowledgedOutcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected" | null;
2604
+ revoked: boolean;
2605
+ left: boolean;
2606
+ muted?: boolean | undefined;
2607
+ nameSource?: "profile" | "room" | undefined;
2608
+ interruptRequested?: boolean | undefined;
2609
+ acknowledgedRevision?: number | undefined;
2610
+ }[];
2611
+ locked?: boolean | undefined;
2612
+ turnMode?: "sequential" | "parallel" | undefined;
2613
+ lastMessageAt?: number | null | undefined;
2614
+ autoCloseArmed?: boolean | undefined;
2615
+ autoCloseAt?: number | null | undefined;
2616
+ closeReason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
2617
+ messageReceiptScope?: "recipient" | "members" | undefined;
2618
+ messageStagesSupported?: boolean | undefined;
2619
+ rejoinSupported?: boolean | undefined;
2620
+ renameSelfSupported?: boolean | undefined;
2621
+ adminRolesSupported?: boolean | undefined;
2622
+ inviteRoleSupported?: boolean | undefined;
2623
+ autoCloseSupported?: boolean | undefined;
2624
+ interruptSupported?: boolean | undefined;
2625
+ quotedMessagesSupported?: boolean | undefined;
2626
+ groupTurnsSupported?: boolean | undefined;
2627
+ workingStatusSupported?: boolean | undefined;
2628
+ };
2629
+ watermarkSeq: number;
2630
+ }>, z.ZodObject<{
2631
+ type: z.ZodLiteral<"event">;
2632
+ event: z.ZodIntersection<z.ZodObject<{
2633
+ protocolVersion: z.ZodLiteral<1>;
2634
+ roomId: z.ZodString;
2635
+ seq: z.ZodNumber;
2636
+ eventId: z.ZodString;
2637
+ senderId: z.ZodNullable<z.ZodString>;
2638
+ idempotencyKey: z.ZodNullable<z.ZodString>;
2639
+ recipientId: z.ZodNullable<z.ZodString>;
2640
+ recipientIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2641
+ allRecipients: z.ZodOptional<z.ZodBoolean>;
2642
+ replyTo: z.ZodNullable<z.ZodString>;
2643
+ quoteOf: z.ZodOptional<z.ZodString>;
2644
+ at: z.ZodNumber;
2645
+ }, "strip", z.ZodTypeAny, {
2646
+ at: number;
2647
+ eventId: string;
2648
+ protocolVersion: 1;
2649
+ roomId: string;
2650
+ seq: number;
2651
+ senderId: string | null;
2652
+ idempotencyKey: string | null;
2653
+ recipientId: string | null;
2654
+ replyTo: string | null;
2655
+ recipientIds?: string[] | undefined;
2656
+ allRecipients?: boolean | undefined;
2657
+ quoteOf?: string | undefined;
2658
+ }, {
2659
+ at: number;
2660
+ eventId: string;
2661
+ protocolVersion: 1;
2662
+ roomId: string;
2663
+ seq: number;
2664
+ senderId: string | null;
2665
+ idempotencyKey: string | null;
2666
+ recipientId: string | null;
2667
+ replyTo: string | null;
2668
+ recipientIds?: string[] | undefined;
2669
+ allRecipients?: boolean | undefined;
2670
+ quoteOf?: string | undefined;
2671
+ }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2672
+ type: z.ZodLiteral<"message">;
2673
+ payload: z.ZodObject<{
2674
+ text: z.ZodEffects<z.ZodString, string, string>;
2675
+ priority: z.ZodDefault<z.ZodEnum<["normal", "priority"]>>;
2676
+ responseStage: z.ZodOptional<z.ZodEnum<["progress", "final"]>>;
2677
+ }, "strip", z.ZodTypeAny, {
2678
+ text: string;
2679
+ priority: "normal" | "priority";
2680
+ responseStage?: "progress" | "final" | undefined;
2681
+ }, {
2682
+ text: string;
2683
+ priority?: "normal" | "priority" | undefined;
2684
+ responseStage?: "progress" | "final" | undefined;
2685
+ }>;
2686
+ }, "strip", z.ZodTypeAny, {
2687
+ type: "message";
2688
+ payload: {
2689
+ text: string;
2690
+ priority: "normal" | "priority";
2691
+ responseStage?: "progress" | "final" | undefined;
2692
+ };
2693
+ }, {
2694
+ type: "message";
2695
+ payload: {
2696
+ text: string;
2697
+ priority?: "normal" | "priority" | undefined;
2698
+ responseStage?: "progress" | "final" | undefined;
2699
+ };
2700
+ }>, z.ZodObject<{
2701
+ type: z.ZodLiteral<"message.received">;
2702
+ payload: z.ZodObject<{
2703
+ eventId: z.ZodString;
2704
+ stage: z.ZodOptional<z.ZodLiteral<"read">>;
2705
+ action: z.ZodOptional<z.ZodEnum<["working", "waiting", "no_action", "declined", "reply_pending", "done"]>>;
2706
+ reason: z.ZodOptional<z.ZodString>;
2707
+ responseEventId: z.ZodOptional<z.ZodString>;
2708
+ }, "strip", z.ZodTypeAny, {
2709
+ eventId: string;
2710
+ stage?: "read" | undefined;
2711
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
2712
+ reason?: string | undefined;
2713
+ responseEventId?: string | undefined;
2714
+ }, {
2715
+ eventId: string;
2716
+ stage?: "read" | undefined;
2717
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
2718
+ reason?: string | undefined;
2719
+ responseEventId?: string | undefined;
2720
+ }>;
2721
+ }, "strip", z.ZodTypeAny, {
2722
+ type: "message.received";
2723
+ payload: {
2724
+ eventId: string;
2725
+ stage?: "read" | undefined;
2726
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
2727
+ reason?: string | undefined;
2728
+ responseEventId?: string | undefined;
2729
+ };
2730
+ }, {
2731
+ type: "message.received";
2732
+ payload: {
2733
+ eventId: string;
2734
+ stage?: "read" | undefined;
2735
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
2736
+ reason?: string | undefined;
2737
+ responseEventId?: string | undefined;
2738
+ };
2739
+ }>, z.ZodObject<{
2740
+ type: z.ZodLiteral<"message.delivery_failed">;
2741
+ payload: z.ZodObject<{
2742
+ eventId: z.ZodString;
2743
+ reason: z.ZodString;
2744
+ stage: z.ZodOptional<z.ZodEnum<["delivery", "execution", "publishing"]>>;
2745
+ }, "strip", z.ZodTypeAny, {
2746
+ eventId: string;
2747
+ reason: string;
2748
+ stage?: "delivery" | "execution" | "publishing" | undefined;
2749
+ }, {
2750
+ eventId: string;
2751
+ reason: string;
2752
+ stage?: "delivery" | "execution" | "publishing" | undefined;
2753
+ }>;
2754
+ }, "strip", z.ZodTypeAny, {
2755
+ type: "message.delivery_failed";
2756
+ payload: {
2757
+ eventId: string;
2758
+ reason: string;
2759
+ stage?: "delivery" | "execution" | "publishing" | undefined;
2760
+ };
2761
+ }, {
2762
+ type: "message.delivery_failed";
2763
+ payload: {
2764
+ eventId: string;
2765
+ reason: string;
2766
+ stage?: "delivery" | "execution" | "publishing" | undefined;
2767
+ };
2768
+ }>, z.ZodObject<{
2769
+ type: z.ZodLiteral<"handover.offered">;
2770
+ payload: z.ZodObject<{
2771
+ handoverId: z.ZodString;
2772
+ revision: z.ZodNumber;
2773
+ document: z.ZodObject<{
2774
+ metadata: z.ZodObject<{
2775
+ goal: z.ZodString;
2776
+ recipient: z.ZodString;
2777
+ mode: z.ZodEnum<["sequential", "concurrent"]>;
2778
+ nextAction: z.ZodString;
2779
+ decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2780
+ blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2781
+ repository: z.ZodOptional<z.ZodObject<{
2782
+ remote: z.ZodOptional<z.ZodString>;
2783
+ branch: z.ZodString;
2784
+ commit: z.ZodString;
2785
+ worktreePath: z.ZodOptional<z.ZodString>;
2786
+ dirty: z.ZodBoolean;
2787
+ missingPaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2788
+ }, "strip", z.ZodTypeAny, {
2789
+ dirty: boolean;
2790
+ branch: string;
2791
+ commit: string;
2792
+ missingPaths: string[];
2793
+ remote?: string | undefined;
2794
+ worktreePath?: string | undefined;
2795
+ }, {
2796
+ dirty: boolean;
2797
+ branch: string;
2798
+ commit: string;
2799
+ remote?: string | undefined;
2800
+ worktreePath?: string | undefined;
2801
+ missingPaths?: string[] | undefined;
2802
+ }>>;
2803
+ tests: z.ZodOptional<z.ZodObject<{
2804
+ command: z.ZodString;
2805
+ result: z.ZodEnum<["passed", "failed", "not_run"]>;
2806
+ notes: z.ZodOptional<z.ZodString>;
2807
+ }, "strip", z.ZodTypeAny, {
2808
+ command: string;
2809
+ result: "passed" | "failed" | "not_run";
2810
+ notes?: string | undefined;
2811
+ }, {
2812
+ command: string;
2813
+ result: "passed" | "failed" | "not_run";
2814
+ notes?: string | undefined;
2815
+ }>>;
2816
+ }, "strip", z.ZodTypeAny, {
2817
+ mode: "sequential" | "concurrent";
2818
+ goal: string;
2819
+ recipient: string;
2820
+ nextAction: string;
2821
+ decisions: string[];
2822
+ blockers: string[];
2823
+ repository?: {
2824
+ dirty: boolean;
2825
+ branch: string;
2826
+ commit: string;
2827
+ missingPaths: string[];
2828
+ remote?: string | undefined;
2829
+ worktreePath?: string | undefined;
2830
+ } | undefined;
2831
+ tests?: {
2832
+ command: string;
2833
+ result: "passed" | "failed" | "not_run";
2834
+ notes?: string | undefined;
2835
+ } | undefined;
2836
+ }, {
2837
+ mode: "sequential" | "concurrent";
2838
+ goal: string;
2839
+ recipient: string;
2840
+ nextAction: string;
2841
+ decisions?: string[] | undefined;
2842
+ blockers?: string[] | undefined;
2843
+ repository?: {
2844
+ dirty: boolean;
2845
+ branch: string;
2846
+ commit: string;
2847
+ remote?: string | undefined;
2848
+ worktreePath?: string | undefined;
2849
+ missingPaths?: string[] | undefined;
2850
+ } | undefined;
2851
+ tests?: {
2852
+ command: string;
2853
+ result: "passed" | "failed" | "not_run";
2854
+ notes?: string | undefined;
2855
+ } | undefined;
2856
+ }>;
2857
+ body: z.ZodString;
2858
+ }, "strip", z.ZodTypeAny, {
2859
+ metadata: {
2860
+ mode: "sequential" | "concurrent";
2861
+ goal: string;
2862
+ recipient: string;
2863
+ nextAction: string;
2864
+ decisions: string[];
2865
+ blockers: string[];
2866
+ repository?: {
2867
+ dirty: boolean;
2868
+ branch: string;
2869
+ commit: string;
2870
+ missingPaths: string[];
2871
+ remote?: string | undefined;
2872
+ worktreePath?: string | undefined;
2873
+ } | undefined;
2874
+ tests?: {
2875
+ command: string;
2876
+ result: "passed" | "failed" | "not_run";
2877
+ notes?: string | undefined;
2878
+ } | undefined;
2879
+ };
2880
+ body: string;
2881
+ }, {
2882
+ metadata: {
2883
+ mode: "sequential" | "concurrent";
2884
+ goal: string;
2885
+ recipient: string;
2886
+ nextAction: string;
2887
+ decisions?: string[] | undefined;
2888
+ blockers?: string[] | undefined;
2889
+ repository?: {
2890
+ dirty: boolean;
2891
+ branch: string;
2892
+ commit: string;
2893
+ remote?: string | undefined;
2894
+ worktreePath?: string | undefined;
2895
+ missingPaths?: string[] | undefined;
2896
+ } | undefined;
2897
+ tests?: {
2898
+ command: string;
2899
+ result: "passed" | "failed" | "not_run";
2900
+ notes?: string | undefined;
2901
+ } | undefined;
2902
+ };
2903
+ body: string;
2904
+ }>;
2905
+ }, "strip", z.ZodTypeAny, {
2906
+ handoverId: string;
2907
+ revision: number;
2908
+ document: {
2909
+ metadata: {
2910
+ mode: "sequential" | "concurrent";
2911
+ goal: string;
2912
+ recipient: string;
2913
+ nextAction: string;
2914
+ decisions: string[];
2915
+ blockers: string[];
2916
+ repository?: {
2917
+ dirty: boolean;
2918
+ branch: string;
2919
+ commit: string;
2920
+ missingPaths: string[];
2921
+ remote?: string | undefined;
2922
+ worktreePath?: string | undefined;
2923
+ } | undefined;
2924
+ tests?: {
2925
+ command: string;
2926
+ result: "passed" | "failed" | "not_run";
2927
+ notes?: string | undefined;
2928
+ } | undefined;
2929
+ };
2930
+ body: string;
2931
+ };
2932
+ }, {
2933
+ handoverId: string;
2934
+ revision: number;
2935
+ document: {
2936
+ metadata: {
2937
+ mode: "sequential" | "concurrent";
2938
+ goal: string;
2939
+ recipient: string;
2940
+ nextAction: string;
2941
+ decisions?: string[] | undefined;
2942
+ blockers?: string[] | undefined;
2943
+ repository?: {
2944
+ dirty: boolean;
2945
+ branch: string;
2946
+ commit: string;
2947
+ remote?: string | undefined;
2948
+ worktreePath?: string | undefined;
2949
+ missingPaths?: string[] | undefined;
2950
+ } | undefined;
2951
+ tests?: {
2952
+ command: string;
2953
+ result: "passed" | "failed" | "not_run";
2954
+ notes?: string | undefined;
2955
+ } | undefined;
2956
+ };
2957
+ body: string;
2958
+ };
2959
+ }>;
2960
+ }, "strip", z.ZodTypeAny, {
2961
+ type: "handover.offered";
2962
+ payload: {
2963
+ handoverId: string;
2964
+ revision: number;
2965
+ document: {
2966
+ metadata: {
2967
+ mode: "sequential" | "concurrent";
2968
+ goal: string;
2969
+ recipient: string;
2970
+ nextAction: string;
2971
+ decisions: string[];
2972
+ blockers: string[];
2973
+ repository?: {
2974
+ dirty: boolean;
2975
+ branch: string;
2976
+ commit: string;
2977
+ missingPaths: string[];
2978
+ remote?: string | undefined;
2979
+ worktreePath?: string | undefined;
2980
+ } | undefined;
2981
+ tests?: {
2982
+ command: string;
2983
+ result: "passed" | "failed" | "not_run";
2984
+ notes?: string | undefined;
2985
+ } | undefined;
2986
+ };
2987
+ body: string;
2988
+ };
2989
+ };
2990
+ }, {
2991
+ type: "handover.offered";
2992
+ payload: {
2993
+ handoverId: string;
2994
+ revision: number;
2995
+ document: {
2996
+ metadata: {
2997
+ mode: "sequential" | "concurrent";
2998
+ goal: string;
2999
+ recipient: string;
3000
+ nextAction: string;
3001
+ decisions?: string[] | undefined;
3002
+ blockers?: string[] | undefined;
3003
+ repository?: {
3004
+ dirty: boolean;
3005
+ branch: string;
3006
+ commit: string;
3007
+ remote?: string | undefined;
3008
+ worktreePath?: string | undefined;
3009
+ missingPaths?: string[] | undefined;
3010
+ } | undefined;
3011
+ tests?: {
3012
+ command: string;
3013
+ result: "passed" | "failed" | "not_run";
3014
+ notes?: string | undefined;
3015
+ } | undefined;
3016
+ };
3017
+ body: string;
3018
+ };
3019
+ };
3020
+ }>, z.ZodObject<{
3021
+ type: z.ZodLiteral<"handover.accepted">;
3022
+ payload: z.ZodObject<{
3023
+ handoverId: z.ZodString;
3024
+ revision: z.ZodNumber;
3025
+ note: z.ZodOptional<z.ZodString>;
3026
+ }, "strip", z.ZodTypeAny, {
3027
+ handoverId: string;
3028
+ revision: number;
3029
+ note?: string | undefined;
3030
+ }, {
3031
+ handoverId: string;
3032
+ revision: number;
3033
+ note?: string | undefined;
3034
+ }>;
3035
+ }, "strip", z.ZodTypeAny, {
3036
+ type: "handover.accepted";
3037
+ payload: {
3038
+ handoverId: string;
3039
+ revision: number;
3040
+ note?: string | undefined;
3041
+ };
3042
+ }, {
3043
+ type: "handover.accepted";
3044
+ payload: {
3045
+ handoverId: string;
3046
+ revision: number;
3047
+ note?: string | undefined;
3048
+ };
3049
+ }>, z.ZodObject<{
3050
+ type: z.ZodLiteral<"handover.declined">;
3051
+ payload: z.ZodObject<{
3052
+ handoverId: z.ZodString;
3053
+ revision: z.ZodNumber;
3054
+ reason: z.ZodOptional<z.ZodString>;
3055
+ }, "strip", z.ZodTypeAny, {
3056
+ handoverId: string;
3057
+ revision: number;
3058
+ reason?: string | undefined;
3059
+ }, {
3060
+ handoverId: string;
3061
+ revision: number;
3062
+ reason?: string | undefined;
3063
+ }>;
3064
+ }, "strip", z.ZodTypeAny, {
3065
+ type: "handover.declined";
3066
+ payload: {
3067
+ handoverId: string;
3068
+ revision: number;
3069
+ reason?: string | undefined;
3070
+ };
3071
+ }, {
3072
+ type: "handover.declined";
3073
+ payload: {
3074
+ handoverId: string;
3075
+ revision: number;
3076
+ reason?: string | undefined;
3077
+ };
3078
+ }>, z.ZodObject<{
3079
+ type: z.ZodLiteral<"participant.joined">;
3080
+ payload: z.ZodObject<{
3081
+ participantId: z.ZodString;
3082
+ displayName: z.ZodString;
3083
+ kind: z.ZodEnum<["agent", "human"]>;
3084
+ role: z.ZodEnum<["guest", "member", "controller"]>;
3085
+ capabilities: z.ZodOptional<z.ZodObject<{
3086
+ deliverUnsolicited: z.ZodDefault<z.ZodBoolean>;
3087
+ cancelTurn: z.ZodDefault<z.ZodBoolean>;
3088
+ cancelTool: z.ZodDefault<z.ZodBoolean>;
3089
+ runtime: z.ZodOptional<z.ZodString>;
3090
+ runtimeVersion: z.ZodOptional<z.ZodString>;
3091
+ }, "strip", z.ZodTypeAny, {
3092
+ deliverUnsolicited: boolean;
3093
+ cancelTurn: boolean;
3094
+ cancelTool: boolean;
3095
+ runtime?: string | undefined;
3096
+ runtimeVersion?: string | undefined;
3097
+ }, {
3098
+ deliverUnsolicited?: boolean | undefined;
3099
+ cancelTurn?: boolean | undefined;
3100
+ cancelTool?: boolean | undefined;
3101
+ runtime?: string | undefined;
3102
+ runtimeVersion?: string | undefined;
3103
+ }>>;
3104
+ }, "strip", z.ZodTypeAny, {
3105
+ participantId: string;
3106
+ displayName: string;
3107
+ kind: "agent" | "human";
3108
+ role: "controller" | "guest" | "member";
3109
+ capabilities?: {
3110
+ deliverUnsolicited: boolean;
3111
+ cancelTurn: boolean;
3112
+ cancelTool: boolean;
3113
+ runtime?: string | undefined;
3114
+ runtimeVersion?: string | undefined;
3115
+ } | undefined;
3116
+ }, {
3117
+ participantId: string;
3118
+ displayName: string;
3119
+ kind: "agent" | "human";
3120
+ role: "controller" | "guest" | "member";
3121
+ capabilities?: {
3122
+ deliverUnsolicited?: boolean | undefined;
3123
+ cancelTurn?: boolean | undefined;
3124
+ cancelTool?: boolean | undefined;
3125
+ runtime?: string | undefined;
3126
+ runtimeVersion?: string | undefined;
3127
+ } | undefined;
3128
+ }>;
3129
+ }, "strip", z.ZodTypeAny, {
3130
+ type: "participant.joined";
3131
+ payload: {
3132
+ participantId: string;
3133
+ displayName: string;
3134
+ kind: "agent" | "human";
3135
+ role: "controller" | "guest" | "member";
3136
+ capabilities?: {
3137
+ deliverUnsolicited: boolean;
3138
+ cancelTurn: boolean;
3139
+ cancelTool: boolean;
3140
+ runtime?: string | undefined;
3141
+ runtimeVersion?: string | undefined;
3142
+ } | undefined;
3143
+ };
3144
+ }, {
3145
+ type: "participant.joined";
3146
+ payload: {
3147
+ participantId: string;
3148
+ displayName: string;
3149
+ kind: "agent" | "human";
3150
+ role: "controller" | "guest" | "member";
3151
+ capabilities?: {
3152
+ deliverUnsolicited?: boolean | undefined;
3153
+ cancelTurn?: boolean | undefined;
3154
+ cancelTool?: boolean | undefined;
3155
+ runtime?: string | undefined;
3156
+ runtimeVersion?: string | undefined;
3157
+ } | undefined;
3158
+ };
3159
+ }>, z.ZodObject<{
3160
+ type: z.ZodLiteral<"participant.renamed">;
3161
+ payload: z.ZodObject<{
3162
+ participantId: z.ZodString;
3163
+ previousName: z.ZodString;
3164
+ name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
3165
+ source: z.ZodEnum<["profile", "room"]>;
3166
+ }, "strip", z.ZodTypeAny, {
3167
+ name: string;
3168
+ source: "profile" | "room";
3169
+ participantId: string;
3170
+ previousName: string;
3171
+ }, {
3172
+ name: string;
3173
+ source: "profile" | "room";
3174
+ participantId: string;
3175
+ previousName: string;
3176
+ }>;
3177
+ }, "strip", z.ZodTypeAny, {
3178
+ type: "participant.renamed";
3179
+ payload: {
3180
+ name: string;
3181
+ source: "profile" | "room";
3182
+ participantId: string;
3183
+ previousName: string;
3184
+ };
3185
+ }, {
3186
+ type: "participant.renamed";
3187
+ payload: {
3188
+ name: string;
3189
+ source: "profile" | "room";
3190
+ participantId: string;
3191
+ previousName: string;
3192
+ };
3193
+ }>, z.ZodObject<{
3194
+ type: z.ZodLiteral<"participant.left">;
3195
+ payload: z.ZodObject<{
3196
+ participantId: z.ZodString;
3197
+ }, "strip", z.ZodTypeAny, {
3198
+ participantId: string;
3199
+ }, {
3200
+ participantId: string;
3201
+ }>;
3202
+ }, "strip", z.ZodTypeAny, {
3203
+ type: "participant.left";
3204
+ payload: {
3205
+ participantId: string;
3206
+ };
3207
+ }, {
3208
+ type: "participant.left";
3209
+ payload: {
3210
+ participantId: string;
3211
+ };
3212
+ }>, z.ZodObject<{
3213
+ type: z.ZodLiteral<"participant.revoked">;
3214
+ payload: z.ZodObject<{
3215
+ participantId: z.ZodString;
3216
+ }, "strip", z.ZodTypeAny, {
3217
+ participantId: string;
3218
+ }, {
3219
+ participantId: string;
3220
+ }>;
3221
+ }, "strip", z.ZodTypeAny, {
3222
+ type: "participant.revoked";
3223
+ payload: {
3224
+ participantId: string;
3225
+ };
3226
+ }, {
3227
+ type: "participant.revoked";
3228
+ payload: {
3229
+ participantId: string;
3230
+ };
3231
+ }>, z.ZodObject<{
3232
+ type: z.ZodLiteral<"control.pause">;
3233
+ payload: z.ZodObject<{
3234
+ targetParticipantId: z.ZodString;
3235
+ revision: z.ZodNumber;
3236
+ reason: z.ZodOptional<z.ZodString>;
3237
+ interrupt: z.ZodOptional<z.ZodBoolean>;
3238
+ }, "strip", z.ZodTypeAny, {
3239
+ revision: number;
3240
+ targetParticipantId: string;
3241
+ reason?: string | undefined;
3242
+ interrupt?: boolean | undefined;
3243
+ }, {
3244
+ revision: number;
3245
+ targetParticipantId: string;
3246
+ reason?: string | undefined;
3247
+ interrupt?: boolean | undefined;
3248
+ }>;
3249
+ }, "strip", z.ZodTypeAny, {
3250
+ type: "control.pause";
3251
+ payload: {
3252
+ revision: number;
3253
+ targetParticipantId: string;
3254
+ reason?: string | undefined;
3255
+ interrupt?: boolean | undefined;
3256
+ };
3257
+ }, {
3258
+ type: "control.pause";
3259
+ payload: {
3260
+ revision: number;
3261
+ targetParticipantId: string;
3262
+ reason?: string | undefined;
3263
+ interrupt?: boolean | undefined;
3264
+ };
3265
+ }>, z.ZodObject<{
3266
+ type: z.ZodLiteral<"control.resume">;
3267
+ payload: z.ZodObject<{
3268
+ targetParticipantId: z.ZodString;
3269
+ revision: z.ZodNumber;
3270
+ }, "strip", z.ZodTypeAny, {
3271
+ revision: number;
3272
+ targetParticipantId: string;
3273
+ }, {
3274
+ revision: number;
3275
+ targetParticipantId: string;
3276
+ }>;
3277
+ }, "strip", z.ZodTypeAny, {
3278
+ type: "control.resume";
3279
+ payload: {
3280
+ revision: number;
3281
+ targetParticipantId: string;
3282
+ };
3283
+ }, {
3284
+ type: "control.resume";
3285
+ payload: {
3286
+ revision: number;
3287
+ targetParticipantId: string;
3288
+ };
3289
+ }>, z.ZodObject<{
3290
+ type: z.ZodLiteral<"control.ack">;
3291
+ payload: z.ZodObject<{
3292
+ targetParticipantId: z.ZodString;
3293
+ revision: z.ZodNumber;
3294
+ outcome: z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>;
3295
+ detail: z.ZodOptional<z.ZodString>;
3296
+ }, "strip", z.ZodTypeAny, {
3297
+ revision: number;
3298
+ targetParticipantId: string;
3299
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3300
+ detail?: string | undefined;
3301
+ }, {
3302
+ revision: number;
3303
+ targetParticipantId: string;
3304
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3305
+ detail?: string | undefined;
3306
+ }>;
3307
+ }, "strip", z.ZodTypeAny, {
3308
+ type: "control.ack";
3309
+ payload: {
3310
+ revision: number;
3311
+ targetParticipantId: string;
3312
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3313
+ detail?: string | undefined;
3314
+ };
3315
+ }, {
3316
+ type: "control.ack";
3317
+ payload: {
3318
+ revision: number;
3319
+ targetParticipantId: string;
3320
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3321
+ detail?: string | undefined;
3322
+ };
3323
+ }>, z.ZodObject<{
3324
+ type: z.ZodLiteral<"room.closed">;
3325
+ payload: z.ZodObject<{
3326
+ exportWindowEndsAt: z.ZodNumber;
3327
+ reason: z.ZodOptional<z.ZodEnum<["manual", "inactivity", "age", "agents_and_guests_left"]>>;
3328
+ }, "strip", z.ZodTypeAny, {
3329
+ exportWindowEndsAt: number;
3330
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
3331
+ }, {
3332
+ exportWindowEndsAt: number;
3333
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
3334
+ }>;
3335
+ }, "strip", z.ZodTypeAny, {
3336
+ type: "room.closed";
3337
+ payload: {
3338
+ exportWindowEndsAt: number;
3339
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
3340
+ };
3341
+ }, {
3342
+ type: "room.closed";
3343
+ payload: {
3344
+ exportWindowEndsAt: number;
3345
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
3346
+ };
3347
+ }>, z.ZodObject<{
3348
+ type: z.ZodLiteral<"room.auto_close_changed">;
3349
+ payload: z.ZodObject<{
3350
+ autoClose: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
3351
+ mode: z.ZodLiteral<"off">;
3352
+ }, "strip", z.ZodTypeAny, {
3353
+ mode: "off";
3354
+ }, {
3355
+ mode: "off";
3356
+ }>, z.ZodObject<{
3357
+ mode: z.ZodLiteral<"inactivity">;
3358
+ afterMs: z.ZodNumber;
3359
+ }, "strip", z.ZodTypeAny, {
3360
+ mode: "inactivity";
3361
+ afterMs: number;
3362
+ }, {
3363
+ mode: "inactivity";
3364
+ afterMs: number;
3365
+ }>, z.ZodObject<{
3366
+ mode: z.ZodLiteral<"age">;
3367
+ afterMs: z.ZodNumber;
3368
+ }, "strip", z.ZodTypeAny, {
3369
+ mode: "age";
3370
+ afterMs: number;
3371
+ }, {
3372
+ mode: "age";
3373
+ afterMs: number;
3374
+ }>, z.ZodObject<{
3375
+ mode: z.ZodLiteral<"agents_and_guests_left">;
3376
+ }, "strip", z.ZodTypeAny, {
3377
+ mode: "agents_and_guests_left";
3378
+ }, {
3379
+ mode: "agents_and_guests_left";
3380
+ }>]>;
3381
+ previous: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
3382
+ mode: z.ZodLiteral<"off">;
3383
+ }, "strip", z.ZodTypeAny, {
3384
+ mode: "off";
3385
+ }, {
3386
+ mode: "off";
3387
+ }>, z.ZodObject<{
3388
+ mode: z.ZodLiteral<"inactivity">;
3389
+ afterMs: z.ZodNumber;
3390
+ }, "strip", z.ZodTypeAny, {
3391
+ mode: "inactivity";
3392
+ afterMs: number;
3393
+ }, {
3394
+ mode: "inactivity";
3395
+ afterMs: number;
3396
+ }>, z.ZodObject<{
3397
+ mode: z.ZodLiteral<"age">;
3398
+ afterMs: z.ZodNumber;
3399
+ }, "strip", z.ZodTypeAny, {
3400
+ mode: "age";
3401
+ afterMs: number;
3402
+ }, {
3403
+ mode: "age";
3404
+ afterMs: number;
3405
+ }>, z.ZodObject<{
3406
+ mode: z.ZodLiteral<"agents_and_guests_left">;
3407
+ }, "strip", z.ZodTypeAny, {
3408
+ mode: "agents_and_guests_left";
3409
+ }, {
3410
+ mode: "agents_and_guests_left";
3411
+ }>]>;
3412
+ }, "strip", z.ZodTypeAny, {
3413
+ autoClose: {
3414
+ mode: "off";
3415
+ } | {
3416
+ mode: "inactivity";
3417
+ afterMs: number;
3418
+ } | {
3419
+ mode: "age";
3420
+ afterMs: number;
3421
+ } | {
3422
+ mode: "agents_and_guests_left";
3423
+ };
3424
+ previous: {
3425
+ mode: "off";
3426
+ } | {
3427
+ mode: "inactivity";
3428
+ afterMs: number;
3429
+ } | {
3430
+ mode: "age";
3431
+ afterMs: number;
3432
+ } | {
3433
+ mode: "agents_and_guests_left";
3434
+ };
3435
+ }, {
3436
+ autoClose: {
3437
+ mode: "off";
3438
+ } | {
3439
+ mode: "inactivity";
3440
+ afterMs: number;
3441
+ } | {
3442
+ mode: "age";
3443
+ afterMs: number;
3444
+ } | {
3445
+ mode: "agents_and_guests_left";
3446
+ };
3447
+ previous: {
3448
+ mode: "off";
3449
+ } | {
3450
+ mode: "inactivity";
3451
+ afterMs: number;
3452
+ } | {
3453
+ mode: "age";
3454
+ afterMs: number;
3455
+ } | {
3456
+ mode: "agents_and_guests_left";
3457
+ };
3458
+ }>;
3459
+ }, "strip", z.ZodTypeAny, {
3460
+ type: "room.auto_close_changed";
3461
+ payload: {
3462
+ autoClose: {
3463
+ mode: "off";
3464
+ } | {
3465
+ mode: "inactivity";
3466
+ afterMs: number;
3467
+ } | {
3468
+ mode: "age";
3469
+ afterMs: number;
3470
+ } | {
3471
+ mode: "agents_and_guests_left";
3472
+ };
3473
+ previous: {
3474
+ mode: "off";
3475
+ } | {
3476
+ mode: "inactivity";
3477
+ afterMs: number;
3478
+ } | {
3479
+ mode: "age";
3480
+ afterMs: number;
3481
+ } | {
3482
+ mode: "agents_and_guests_left";
3483
+ };
3484
+ };
3485
+ }, {
3486
+ type: "room.auto_close_changed";
3487
+ payload: {
3488
+ autoClose: {
3489
+ mode: "off";
3490
+ } | {
3491
+ mode: "inactivity";
3492
+ afterMs: number;
3493
+ } | {
3494
+ mode: "age";
3495
+ afterMs: number;
3496
+ } | {
3497
+ mode: "agents_and_guests_left";
3498
+ };
3499
+ previous: {
3500
+ mode: "off";
3501
+ } | {
3502
+ mode: "inactivity";
3503
+ afterMs: number;
3504
+ } | {
3505
+ mode: "age";
3506
+ afterMs: number;
3507
+ } | {
3508
+ mode: "agents_and_guests_left";
3509
+ };
3510
+ };
3511
+ }>, z.ZodObject<{
3512
+ type: z.ZodLiteral<"room.renamed">;
3513
+ payload: z.ZodObject<{
3514
+ name: z.ZodString;
3515
+ previousName: z.ZodString;
3516
+ }, "strip", z.ZodTypeAny, {
3517
+ name: string;
3518
+ previousName: string;
3519
+ }, {
3520
+ name: string;
3521
+ previousName: string;
3522
+ }>;
3523
+ }, "strip", z.ZodTypeAny, {
3524
+ type: "room.renamed";
3525
+ payload: {
3526
+ name: string;
3527
+ previousName: string;
3528
+ };
3529
+ }, {
3530
+ type: "room.renamed";
3531
+ payload: {
3532
+ name: string;
3533
+ previousName: string;
3534
+ };
3535
+ }>, z.ZodObject<{
3536
+ type: z.ZodLiteral<"room.expiry_changed">;
3537
+ payload: z.ZodObject<{
3538
+ expiresAt: z.ZodNullable<z.ZodNumber>;
3539
+ previousExpiresAt: z.ZodNullable<z.ZodNumber>;
3540
+ }, "strip", z.ZodTypeAny, {
3541
+ expiresAt: number | null;
3542
+ previousExpiresAt: number | null;
3543
+ }, {
3544
+ expiresAt: number | null;
3545
+ previousExpiresAt: number | null;
3546
+ }>;
3547
+ }, "strip", z.ZodTypeAny, {
3548
+ type: "room.expiry_changed";
3549
+ payload: {
3550
+ expiresAt: number | null;
3551
+ previousExpiresAt: number | null;
3552
+ };
3553
+ }, {
3554
+ type: "room.expiry_changed";
3555
+ payload: {
3556
+ expiresAt: number | null;
3557
+ previousExpiresAt: number | null;
3558
+ };
3559
+ }>, z.ZodObject<{
3560
+ type: z.ZodLiteral<"room.access_changed">;
3561
+ payload: z.ZodObject<{
3562
+ joinPolicy: z.ZodEnum<["invite_only", "open_to_guests"]>;
3563
+ inviteRole: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
3564
+ }, "strip", z.ZodTypeAny, {
3565
+ joinPolicy: "invite_only" | "open_to_guests";
3566
+ inviteRole?: "guest" | "member" | undefined;
3567
+ }, {
3568
+ joinPolicy: "invite_only" | "open_to_guests";
3569
+ inviteRole?: "guest" | "member" | undefined;
3570
+ }>;
3571
+ }, "strip", z.ZodTypeAny, {
3572
+ type: "room.access_changed";
3573
+ payload: {
3574
+ joinPolicy: "invite_only" | "open_to_guests";
3575
+ inviteRole?: "guest" | "member" | undefined;
3576
+ };
3577
+ }, {
3578
+ type: "room.access_changed";
3579
+ payload: {
3580
+ joinPolicy: "invite_only" | "open_to_guests";
3581
+ inviteRole?: "guest" | "member" | undefined;
3582
+ };
3583
+ }>, z.ZodObject<{
3584
+ type: z.ZodLiteral<"room.local_join_changed">;
3585
+ payload: z.ZodObject<{
3586
+ localJoin: z.ZodBoolean;
3587
+ }, "strip", z.ZodTypeAny, {
3588
+ localJoin: boolean;
3589
+ }, {
3590
+ localJoin: boolean;
3591
+ }>;
3592
+ }, "strip", z.ZodTypeAny, {
3593
+ type: "room.local_join_changed";
3594
+ payload: {
3595
+ localJoin: boolean;
3596
+ };
3597
+ }, {
3598
+ type: "room.local_join_changed";
3599
+ payload: {
3600
+ localJoin: boolean;
3601
+ };
3602
+ }>, z.ZodObject<{
3603
+ type: z.ZodLiteral<"room.invitation_changed">;
3604
+ payload: z.ZodObject<{
3605
+ handle: z.ZodString;
3606
+ state: z.ZodEnum<["invited", "withdrawn"]>;
3607
+ role: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
3608
+ agents: z.ZodOptional<z.ZodNumber>;
3609
+ }, "strip", z.ZodTypeAny, {
3610
+ handle: string;
3611
+ state: "invited" | "withdrawn";
3612
+ role?: "guest" | "member" | undefined;
3613
+ agents?: number | undefined;
3614
+ }, {
3615
+ handle: string;
3616
+ state: "invited" | "withdrawn";
3617
+ role?: "guest" | "member" | undefined;
3618
+ agents?: number | undefined;
3619
+ }>;
3620
+ }, "strip", z.ZodTypeAny, {
3621
+ type: "room.invitation_changed";
3622
+ payload: {
3623
+ handle: string;
3624
+ state: "invited" | "withdrawn";
3625
+ role?: "guest" | "member" | undefined;
3626
+ agents?: number | undefined;
3627
+ };
3628
+ }, {
3629
+ type: "room.invitation_changed";
3630
+ payload: {
3631
+ handle: string;
3632
+ state: "invited" | "withdrawn";
3633
+ role?: "guest" | "member" | undefined;
3634
+ agents?: number | undefined;
3635
+ };
3636
+ }>, z.ZodObject<{
3637
+ type: z.ZodLiteral<"room.lock_changed">;
3638
+ payload: z.ZodObject<{
3639
+ locked: z.ZodBoolean;
3640
+ }, "strip", z.ZodTypeAny, {
3641
+ locked: boolean;
3642
+ }, {
3643
+ locked: boolean;
3644
+ }>;
3645
+ }, "strip", z.ZodTypeAny, {
3646
+ type: "room.lock_changed";
3647
+ payload: {
3648
+ locked: boolean;
3649
+ };
3650
+ }, {
3651
+ type: "room.lock_changed";
3652
+ payload: {
3653
+ locked: boolean;
3654
+ };
3655
+ }>, z.ZodObject<{
3656
+ type: z.ZodLiteral<"participant.mute_changed">;
3657
+ payload: z.ZodObject<{
3658
+ participantId: z.ZodString;
3659
+ muted: z.ZodBoolean;
3660
+ }, "strip", z.ZodTypeAny, {
3661
+ participantId: string;
3662
+ muted: boolean;
3663
+ }, {
3664
+ participantId: string;
3665
+ muted: boolean;
3666
+ }>;
3667
+ }, "strip", z.ZodTypeAny, {
3668
+ type: "participant.mute_changed";
3669
+ payload: {
3670
+ participantId: string;
3671
+ muted: boolean;
3672
+ };
3673
+ }, {
3674
+ type: "participant.mute_changed";
3675
+ payload: {
3676
+ participantId: string;
3677
+ muted: boolean;
3678
+ };
3679
+ }>, z.ZodObject<{
3680
+ type: z.ZodLiteral<"participant.role_changed">;
3681
+ payload: z.ZodObject<{
3682
+ participantId: z.ZodString;
3683
+ role: z.ZodEnum<["guest", "member", "controller"]>;
3684
+ previousRole: z.ZodEnum<["guest", "member", "controller"]>;
3685
+ }, "strip", z.ZodTypeAny, {
3686
+ participantId: string;
3687
+ role: "controller" | "guest" | "member";
3688
+ previousRole: "controller" | "guest" | "member";
3689
+ }, {
3690
+ participantId: string;
3691
+ role: "controller" | "guest" | "member";
3692
+ previousRole: "controller" | "guest" | "member";
3693
+ }>;
3694
+ }, "strip", z.ZodTypeAny, {
3695
+ type: "participant.role_changed";
3696
+ payload: {
3697
+ participantId: string;
3698
+ role: "controller" | "guest" | "member";
3699
+ previousRole: "controller" | "guest" | "member";
3700
+ };
3701
+ }, {
3702
+ type: "participant.role_changed";
3703
+ payload: {
3704
+ participantId: string;
3705
+ role: "controller" | "guest" | "member";
3706
+ previousRole: "controller" | "guest" | "member";
3707
+ };
3708
+ }>, z.ZodObject<{
3709
+ type: z.ZodLiteral<"conversation.turn_changed">;
3710
+ payload: z.ZodObject<{
3711
+ action: z.ZodEnum<["claimed", "working", "passed", "skipped", "cancelled", "mode"]>;
3712
+ requestIds: z.ZodArray<z.ZodString, "many">;
3713
+ participantIds: z.ZodArray<z.ZodString, "many">;
3714
+ mode: z.ZodEnum<["sequential", "parallel"]>;
3715
+ }, "strip", z.ZodTypeAny, {
3716
+ mode: "sequential" | "parallel";
3717
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
3718
+ requestIds: string[];
3719
+ participantIds: string[];
3720
+ }, {
3721
+ mode: "sequential" | "parallel";
3722
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
3723
+ requestIds: string[];
3724
+ participantIds: string[];
3725
+ }>;
3726
+ }, "strip", z.ZodTypeAny, {
3727
+ type: "conversation.turn_changed";
3728
+ payload: {
3729
+ mode: "sequential" | "parallel";
3730
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
3731
+ requestIds: string[];
3732
+ participantIds: string[];
3733
+ };
3734
+ }, {
3735
+ type: "conversation.turn_changed";
3736
+ payload: {
3737
+ mode: "sequential" | "parallel";
3738
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
3739
+ requestIds: string[];
3740
+ participantIds: string[];
3741
+ };
3742
+ }>]>>;
3743
+ }, "strip", z.ZodTypeAny, {
3744
+ type: "event";
3745
+ event: {
3746
+ at: number;
3747
+ eventId: string;
3748
+ protocolVersion: 1;
3749
+ roomId: string;
3750
+ seq: number;
3751
+ senderId: string | null;
3752
+ idempotencyKey: string | null;
3753
+ recipientId: string | null;
3754
+ replyTo: string | null;
3755
+ recipientIds?: string[] | undefined;
3756
+ allRecipients?: boolean | undefined;
3757
+ quoteOf?: string | undefined;
3758
+ } & ({
3759
+ type: "message";
3760
+ payload: {
3761
+ text: string;
3762
+ priority: "normal" | "priority";
3763
+ responseStage?: "progress" | "final" | undefined;
3764
+ };
3765
+ } | {
3766
+ type: "message.received";
3767
+ payload: {
3768
+ eventId: string;
3769
+ stage?: "read" | undefined;
3770
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
3771
+ reason?: string | undefined;
3772
+ responseEventId?: string | undefined;
3773
+ };
3774
+ } | {
3775
+ type: "message.delivery_failed";
3776
+ payload: {
3777
+ eventId: string;
3778
+ reason: string;
3779
+ stage?: "delivery" | "execution" | "publishing" | undefined;
3780
+ };
3781
+ } | {
3782
+ type: "handover.offered";
3783
+ payload: {
3784
+ handoverId: string;
3785
+ revision: number;
3786
+ document: {
3787
+ metadata: {
3788
+ mode: "sequential" | "concurrent";
3789
+ goal: string;
3790
+ recipient: string;
3791
+ nextAction: string;
3792
+ decisions: string[];
3793
+ blockers: string[];
3794
+ repository?: {
3795
+ dirty: boolean;
3796
+ branch: string;
3797
+ commit: string;
3798
+ missingPaths: string[];
3799
+ remote?: string | undefined;
3800
+ worktreePath?: string | undefined;
3801
+ } | undefined;
3802
+ tests?: {
3803
+ command: string;
3804
+ result: "passed" | "failed" | "not_run";
3805
+ notes?: string | undefined;
3806
+ } | undefined;
3807
+ };
3808
+ body: string;
3809
+ };
3810
+ };
3811
+ } | {
3812
+ type: "handover.accepted";
3813
+ payload: {
3814
+ handoverId: string;
3815
+ revision: number;
3816
+ note?: string | undefined;
3817
+ };
3818
+ } | {
3819
+ type: "handover.declined";
3820
+ payload: {
3821
+ handoverId: string;
3822
+ revision: number;
3823
+ reason?: string | undefined;
3824
+ };
3825
+ } | {
3826
+ type: "participant.joined";
3827
+ payload: {
3828
+ participantId: string;
3829
+ displayName: string;
3830
+ kind: "agent" | "human";
3831
+ role: "controller" | "guest" | "member";
3832
+ capabilities?: {
3833
+ deliverUnsolicited: boolean;
3834
+ cancelTurn: boolean;
3835
+ cancelTool: boolean;
3836
+ runtime?: string | undefined;
3837
+ runtimeVersion?: string | undefined;
3838
+ } | undefined;
3839
+ };
3840
+ } | {
3841
+ type: "participant.renamed";
3842
+ payload: {
3843
+ name: string;
3844
+ source: "profile" | "room";
3845
+ participantId: string;
3846
+ previousName: string;
3847
+ };
3848
+ } | {
3849
+ type: "participant.left";
3850
+ payload: {
3851
+ participantId: string;
3852
+ };
3853
+ } | {
3854
+ type: "participant.revoked";
3855
+ payload: {
3856
+ participantId: string;
3857
+ };
3858
+ } | {
3859
+ type: "control.pause";
3860
+ payload: {
3861
+ revision: number;
3862
+ targetParticipantId: string;
3863
+ reason?: string | undefined;
3864
+ interrupt?: boolean | undefined;
3865
+ };
3866
+ } | {
3867
+ type: "control.resume";
3868
+ payload: {
3869
+ revision: number;
3870
+ targetParticipantId: string;
3871
+ };
3872
+ } | {
3873
+ type: "control.ack";
3874
+ payload: {
3875
+ revision: number;
3876
+ targetParticipantId: string;
3877
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3878
+ detail?: string | undefined;
3879
+ };
3880
+ } | {
3881
+ type: "room.closed";
3882
+ payload: {
3883
+ exportWindowEndsAt: number;
3884
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
3885
+ };
3886
+ } | {
3887
+ type: "room.auto_close_changed";
3888
+ payload: {
3889
+ autoClose: {
3890
+ mode: "off";
3891
+ } | {
3892
+ mode: "inactivity";
3893
+ afterMs: number;
3894
+ } | {
3895
+ mode: "age";
3896
+ afterMs: number;
3897
+ } | {
3898
+ mode: "agents_and_guests_left";
3899
+ };
3900
+ previous: {
3901
+ mode: "off";
3902
+ } | {
3903
+ mode: "inactivity";
3904
+ afterMs: number;
3905
+ } | {
3906
+ mode: "age";
3907
+ afterMs: number;
3908
+ } | {
3909
+ mode: "agents_and_guests_left";
3910
+ };
3911
+ };
3912
+ } | {
3913
+ type: "room.renamed";
3914
+ payload: {
3915
+ name: string;
3916
+ previousName: string;
3917
+ };
3918
+ } | {
3919
+ type: "room.expiry_changed";
3920
+ payload: {
3921
+ expiresAt: number | null;
3922
+ previousExpiresAt: number | null;
3923
+ };
3924
+ } | {
3925
+ type: "room.access_changed";
3926
+ payload: {
3927
+ joinPolicy: "invite_only" | "open_to_guests";
3928
+ inviteRole?: "guest" | "member" | undefined;
3929
+ };
3930
+ } | {
3931
+ type: "room.local_join_changed";
3932
+ payload: {
3933
+ localJoin: boolean;
3934
+ };
3935
+ } | {
3936
+ type: "room.invitation_changed";
3937
+ payload: {
3938
+ handle: string;
3939
+ state: "invited" | "withdrawn";
3940
+ role?: "guest" | "member" | undefined;
3941
+ agents?: number | undefined;
3942
+ };
3943
+ } | {
3944
+ type: "room.lock_changed";
3945
+ payload: {
3946
+ locked: boolean;
3947
+ };
3948
+ } | {
3949
+ type: "participant.mute_changed";
3950
+ payload: {
3951
+ participantId: string;
3952
+ muted: boolean;
3953
+ };
3954
+ } | {
3955
+ type: "participant.role_changed";
3956
+ payload: {
3957
+ participantId: string;
3958
+ role: "controller" | "guest" | "member";
3959
+ previousRole: "controller" | "guest" | "member";
3960
+ };
3961
+ } | {
3962
+ type: "conversation.turn_changed";
3963
+ payload: {
3964
+ mode: "sequential" | "parallel";
3965
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
3966
+ requestIds: string[];
3967
+ participantIds: string[];
3968
+ };
3969
+ });
3970
+ }, {
3971
+ type: "event";
3972
+ event: {
3973
+ at: number;
3974
+ eventId: string;
3975
+ protocolVersion: 1;
3976
+ roomId: string;
3977
+ seq: number;
3978
+ senderId: string | null;
3979
+ idempotencyKey: string | null;
3980
+ recipientId: string | null;
3981
+ replyTo: string | null;
3982
+ recipientIds?: string[] | undefined;
3983
+ allRecipients?: boolean | undefined;
3984
+ quoteOf?: string | undefined;
3985
+ } & ({
3986
+ type: "message";
3987
+ payload: {
3988
+ text: string;
3989
+ priority?: "normal" | "priority" | undefined;
3990
+ responseStage?: "progress" | "final" | undefined;
3991
+ };
3992
+ } | {
3993
+ type: "message.received";
3994
+ payload: {
3995
+ eventId: string;
3996
+ stage?: "read" | undefined;
3997
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
3998
+ reason?: string | undefined;
3999
+ responseEventId?: string | undefined;
4000
+ };
4001
+ } | {
4002
+ type: "message.delivery_failed";
4003
+ payload: {
4004
+ eventId: string;
4005
+ reason: string;
4006
+ stage?: "delivery" | "execution" | "publishing" | undefined;
4007
+ };
4008
+ } | {
4009
+ type: "handover.offered";
4010
+ payload: {
4011
+ handoverId: string;
4012
+ revision: number;
4013
+ document: {
4014
+ metadata: {
4015
+ mode: "sequential" | "concurrent";
4016
+ goal: string;
4017
+ recipient: string;
4018
+ nextAction: string;
4019
+ decisions?: string[] | undefined;
4020
+ blockers?: string[] | undefined;
4021
+ repository?: {
4022
+ dirty: boolean;
4023
+ branch: string;
4024
+ commit: string;
4025
+ remote?: string | undefined;
4026
+ worktreePath?: string | undefined;
4027
+ missingPaths?: string[] | undefined;
4028
+ } | undefined;
4029
+ tests?: {
4030
+ command: string;
4031
+ result: "passed" | "failed" | "not_run";
4032
+ notes?: string | undefined;
4033
+ } | undefined;
4034
+ };
4035
+ body: string;
4036
+ };
4037
+ };
4038
+ } | {
4039
+ type: "handover.accepted";
4040
+ payload: {
4041
+ handoverId: string;
4042
+ revision: number;
4043
+ note?: string | undefined;
4044
+ };
4045
+ } | {
4046
+ type: "handover.declined";
4047
+ payload: {
4048
+ handoverId: string;
4049
+ revision: number;
4050
+ reason?: string | undefined;
4051
+ };
4052
+ } | {
4053
+ type: "participant.joined";
4054
+ payload: {
4055
+ participantId: string;
4056
+ displayName: string;
4057
+ kind: "agent" | "human";
4058
+ role: "controller" | "guest" | "member";
4059
+ capabilities?: {
4060
+ deliverUnsolicited?: boolean | undefined;
4061
+ cancelTurn?: boolean | undefined;
4062
+ cancelTool?: boolean | undefined;
4063
+ runtime?: string | undefined;
4064
+ runtimeVersion?: string | undefined;
4065
+ } | undefined;
4066
+ };
4067
+ } | {
4068
+ type: "participant.renamed";
4069
+ payload: {
4070
+ name: string;
4071
+ source: "profile" | "room";
4072
+ participantId: string;
4073
+ previousName: string;
4074
+ };
4075
+ } | {
4076
+ type: "participant.left";
4077
+ payload: {
4078
+ participantId: string;
4079
+ };
4080
+ } | {
4081
+ type: "participant.revoked";
4082
+ payload: {
4083
+ participantId: string;
4084
+ };
4085
+ } | {
4086
+ type: "control.pause";
4087
+ payload: {
4088
+ revision: number;
4089
+ targetParticipantId: string;
4090
+ reason?: string | undefined;
4091
+ interrupt?: boolean | undefined;
4092
+ };
4093
+ } | {
4094
+ type: "control.resume";
4095
+ payload: {
4096
+ revision: number;
4097
+ targetParticipantId: string;
4098
+ };
4099
+ } | {
4100
+ type: "control.ack";
4101
+ payload: {
4102
+ revision: number;
4103
+ targetParticipantId: string;
4104
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
4105
+ detail?: string | undefined;
4106
+ };
4107
+ } | {
4108
+ type: "room.closed";
4109
+ payload: {
4110
+ exportWindowEndsAt: number;
4111
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
4112
+ };
4113
+ } | {
4114
+ type: "room.auto_close_changed";
4115
+ payload: {
4116
+ autoClose: {
4117
+ mode: "off";
4118
+ } | {
4119
+ mode: "inactivity";
4120
+ afterMs: number;
4121
+ } | {
4122
+ mode: "age";
4123
+ afterMs: number;
4124
+ } | {
4125
+ mode: "agents_and_guests_left";
4126
+ };
4127
+ previous: {
4128
+ mode: "off";
4129
+ } | {
4130
+ mode: "inactivity";
4131
+ afterMs: number;
4132
+ } | {
4133
+ mode: "age";
4134
+ afterMs: number;
4135
+ } | {
4136
+ mode: "agents_and_guests_left";
4137
+ };
4138
+ };
4139
+ } | {
4140
+ type: "room.renamed";
4141
+ payload: {
4142
+ name: string;
4143
+ previousName: string;
4144
+ };
4145
+ } | {
4146
+ type: "room.expiry_changed";
4147
+ payload: {
4148
+ expiresAt: number | null;
4149
+ previousExpiresAt: number | null;
4150
+ };
4151
+ } | {
4152
+ type: "room.access_changed";
4153
+ payload: {
4154
+ joinPolicy: "invite_only" | "open_to_guests";
4155
+ inviteRole?: "guest" | "member" | undefined;
4156
+ };
4157
+ } | {
4158
+ type: "room.local_join_changed";
4159
+ payload: {
4160
+ localJoin: boolean;
4161
+ };
4162
+ } | {
4163
+ type: "room.invitation_changed";
4164
+ payload: {
4165
+ handle: string;
4166
+ state: "invited" | "withdrawn";
4167
+ role?: "guest" | "member" | undefined;
4168
+ agents?: number | undefined;
4169
+ };
4170
+ } | {
4171
+ type: "room.lock_changed";
4172
+ payload: {
4173
+ locked: boolean;
4174
+ };
4175
+ } | {
4176
+ type: "participant.mute_changed";
4177
+ payload: {
4178
+ participantId: string;
4179
+ muted: boolean;
4180
+ };
4181
+ } | {
4182
+ type: "participant.role_changed";
4183
+ payload: {
4184
+ participantId: string;
4185
+ role: "controller" | "guest" | "member";
4186
+ previousRole: "controller" | "guest" | "member";
4187
+ };
4188
+ } | {
4189
+ type: "conversation.turn_changed";
4190
+ payload: {
4191
+ mode: "sequential" | "parallel";
4192
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
4193
+ requestIds: string[];
4194
+ participantIds: string[];
4195
+ };
4196
+ });
4197
+ }>, z.ZodIntersection<z.ZodObject<{
4198
+ type: z.ZodLiteral<"error">;
4199
+ fatal: z.ZodBoolean;
4200
+ }, "strip", z.ZodTypeAny, {
4201
+ type: "error";
4202
+ fatal: boolean;
4203
+ }, {
4204
+ type: "error";
4205
+ fatal: boolean;
4206
+ }>, z.ZodObject<{
4207
+ error: z.ZodObject<{
4208
+ code: z.ZodEnum<["invite_expired", "invite_already_redeemed", "invite_unknown", "unauthorized", "participant_revoked", "room_expired", "room_closed", "room_locked", "participant_muted", "turn_conflict", "turn_required", "turn_expired", "room_not_found", "quota_exceeded", "cursor_gap", "stale_handover_revision", "handover_already_resolved", "idempotency_conflict", "participant_limit_reached", "payload_too_large", "unsupported_capability", "protocol_version_unsupported", "invalid_request", "server_unavailable"]>;
4209
+ message: z.ZodString;
4210
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
4211
+ earliestAvailableSeq: z.ZodOptional<z.ZodNumber>;
4212
+ currentRevision: z.ZodOptional<z.ZodNumber>;
4213
+ }, "strip", z.ZodTypeAny, {
4214
+ code: "invite_expired" | "invite_already_redeemed" | "invite_unknown" | "unauthorized" | "participant_revoked" | "room_expired" | "room_closed" | "room_locked" | "participant_muted" | "turn_conflict" | "turn_required" | "turn_expired" | "room_not_found" | "quota_exceeded" | "cursor_gap" | "stale_handover_revision" | "handover_already_resolved" | "idempotency_conflict" | "participant_limit_reached" | "payload_too_large" | "unsupported_capability" | "protocol_version_unsupported" | "invalid_request" | "server_unavailable";
4215
+ message: string;
4216
+ retryAfterMs?: number | undefined;
4217
+ earliestAvailableSeq?: number | undefined;
4218
+ currentRevision?: number | undefined;
4219
+ }, {
4220
+ code: "invite_expired" | "invite_already_redeemed" | "invite_unknown" | "unauthorized" | "participant_revoked" | "room_expired" | "room_closed" | "room_locked" | "participant_muted" | "turn_conflict" | "turn_required" | "turn_expired" | "room_not_found" | "quota_exceeded" | "cursor_gap" | "stale_handover_revision" | "handover_already_resolved" | "idempotency_conflict" | "participant_limit_reached" | "payload_too_large" | "unsupported_capability" | "protocol_version_unsupported" | "invalid_request" | "server_unavailable";
4221
+ message: string;
4222
+ retryAfterMs?: number | undefined;
4223
+ earliestAvailableSeq?: number | undefined;
4224
+ currentRevision?: number | undefined;
4225
+ }>;
4226
+ }, "strip", z.ZodTypeAny, {
4227
+ error: {
4228
+ code: "invite_expired" | "invite_already_redeemed" | "invite_unknown" | "unauthorized" | "participant_revoked" | "room_expired" | "room_closed" | "room_locked" | "participant_muted" | "turn_conflict" | "turn_required" | "turn_expired" | "room_not_found" | "quota_exceeded" | "cursor_gap" | "stale_handover_revision" | "handover_already_resolved" | "idempotency_conflict" | "participant_limit_reached" | "payload_too_large" | "unsupported_capability" | "protocol_version_unsupported" | "invalid_request" | "server_unavailable";
4229
+ message: string;
4230
+ retryAfterMs?: number | undefined;
4231
+ earliestAvailableSeq?: number | undefined;
4232
+ currentRevision?: number | undefined;
4233
+ };
4234
+ }, {
4235
+ error: {
4236
+ code: "invite_expired" | "invite_already_redeemed" | "invite_unknown" | "unauthorized" | "participant_revoked" | "room_expired" | "room_closed" | "room_locked" | "participant_muted" | "turn_conflict" | "turn_required" | "turn_expired" | "room_not_found" | "quota_exceeded" | "cursor_gap" | "stale_handover_revision" | "handover_already_resolved" | "idempotency_conflict" | "participant_limit_reached" | "payload_too_large" | "unsupported_capability" | "protocol_version_unsupported" | "invalid_request" | "server_unavailable";
4237
+ message: string;
4238
+ retryAfterMs?: number | undefined;
4239
+ earliestAvailableSeq?: number | undefined;
4240
+ currentRevision?: number | undefined;
4241
+ };
4242
+ }>>]>;
4243
+ export type ServerFrame = z.infer<typeof ServerFrame>;
4244
+ /** Consumption acknowledgement, separate from delivery: it moves the participant's read cursor. */
4245
+ export declare const ClientAckFrame: z.ZodObject<{
4246
+ type: z.ZodLiteral<"ack">;
4247
+ throughSeq: z.ZodNumber;
4248
+ }, "strip", z.ZodTypeAny, {
4249
+ type: "ack";
4250
+ throughSeq: number;
4251
+ }, {
4252
+ type: "ack";
4253
+ throughSeq: number;
4254
+ }>;
4255
+ export declare const ClientFrame: z.ZodObject<{
4256
+ type: z.ZodLiteral<"ack">;
4257
+ throughSeq: z.ZodNumber;
4258
+ }, "strip", z.ZodTypeAny, {
4259
+ type: "ack";
4260
+ throughSeq: number;
4261
+ }, {
4262
+ type: "ack";
4263
+ throughSeq: number;
4264
+ }>;
4265
+ export type ClientFrame = z.infer<typeof ClientFrame>;
4266
+ //# sourceMappingURL=wire.d.ts.map