@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
@@ -0,0 +1,3177 @@
1
+ import { z } from 'zod';
2
+ export declare const PROTOCOL_VERSION = 1;
3
+ export declare const PROTOCOL_VERSION_HEADER = "pairlobby-protocol";
4
+ export declare const ParticipantKind: z.ZodEnum<["agent", "human"]>;
5
+ export type ParticipantKind = z.infer<typeof ParticipantKind>;
6
+ /**
7
+ * A guest may read the room and leave it. Nothing else: no messages, no
8
+ * handovers, no acknowledgements, no invites, no control.
9
+ */
10
+ export declare const ParticipantRole: z.ZodEnum<["guest", "member", "controller"]>;
11
+ export type ParticipantRole = z.infer<typeof ParticipantRole>;
12
+ /**
13
+ * What an adapter reports actually happened, kept distinct from what the
14
+ * controller asked for. A human message alone never claims cancellation.
15
+ */
16
+ export declare const ControlOutcome: z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>;
17
+ export type ControlOutcome = z.infer<typeof ControlOutcome>;
18
+ export declare const AdapterCapabilities: z.ZodObject<{
19
+ /** The adapter can deliver an unsolicited message into a running session. */
20
+ deliverUnsolicited: z.ZodDefault<z.ZodBoolean>;
21
+ /** The adapter can end the model's current turn on request. */
22
+ cancelTurn: z.ZodDefault<z.ZodBoolean>;
23
+ /** The adapter can stop a tool the session is currently running. */
24
+ cancelTool: z.ZodDefault<z.ZodBoolean>;
25
+ runtime: z.ZodOptional<z.ZodString>;
26
+ runtimeVersion: z.ZodOptional<z.ZodString>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ deliverUnsolicited: boolean;
29
+ cancelTurn: boolean;
30
+ cancelTool: boolean;
31
+ runtime?: string | undefined;
32
+ runtimeVersion?: string | undefined;
33
+ }, {
34
+ deliverUnsolicited?: boolean | undefined;
35
+ cancelTurn?: boolean | undefined;
36
+ cancelTool?: boolean | undefined;
37
+ runtime?: string | undefined;
38
+ runtimeVersion?: string | undefined;
39
+ }>;
40
+ export type AdapterCapabilities = z.infer<typeof AdapterCapabilities>;
41
+ /** A participant confirms receipt of a message; only the target satisfies an addressed request. */
42
+ export declare const MessageAction: z.ZodEnum<["working", "waiting", "no_action", "declined", "reply_pending", "done"]>;
43
+ export type MessageAction = z.infer<typeof MessageAction>;
44
+ /**
45
+ * An account was asked into the room by its handle, or that invitation was withdrawn.
46
+ * Only a relay with accounts records these; the person's later arrival is an ordinary join.
47
+ */
48
+ declare const roomInvitationChangedPayload: z.ZodObject<{
49
+ handle: z.ZodString;
50
+ state: z.ZodEnum<["invited", "withdrawn"]>;
51
+ role: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
52
+ agents: z.ZodOptional<z.ZodNumber>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ handle: string;
55
+ state: "invited" | "withdrawn";
56
+ role?: "guest" | "member" | undefined;
57
+ agents?: number | undefined;
58
+ }, {
59
+ handle: string;
60
+ state: "invited" | "withdrawn";
61
+ role?: "guest" | "member" | undefined;
62
+ agents?: number | undefined;
63
+ }>;
64
+ export type RoomInvitationChange = z.infer<typeof roomInvitationChangedPayload>;
65
+ /** Event types a client may submit. Membership and control events are server-authored. */
66
+ export declare const CLIENT_EVENT_TYPES: readonly ["message", "message.received", "message.delivery_failed", "handover.offered", "handover.accepted", "handover.declined", "control.ack"];
67
+ export declare const EventSubmission: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
68
+ type: z.ZodLiteral<"message">;
69
+ payload: z.ZodObject<{
70
+ text: z.ZodEffects<z.ZodString, string, string>;
71
+ priority: z.ZodDefault<z.ZodEnum<["normal", "priority"]>>;
72
+ responseStage: z.ZodOptional<z.ZodEnum<["progress", "final"]>>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ text: string;
75
+ priority: "normal" | "priority";
76
+ responseStage?: "progress" | "final" | undefined;
77
+ }, {
78
+ text: string;
79
+ priority?: "normal" | "priority" | undefined;
80
+ responseStage?: "progress" | "final" | undefined;
81
+ }>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ type: "message";
84
+ payload: {
85
+ text: string;
86
+ priority: "normal" | "priority";
87
+ responseStage?: "progress" | "final" | undefined;
88
+ };
89
+ }, {
90
+ type: "message";
91
+ payload: {
92
+ text: string;
93
+ priority?: "normal" | "priority" | undefined;
94
+ responseStage?: "progress" | "final" | undefined;
95
+ };
96
+ }>, z.ZodObject<{
97
+ type: z.ZodLiteral<"message.received">;
98
+ payload: z.ZodObject<{
99
+ eventId: z.ZodString;
100
+ stage: z.ZodOptional<z.ZodLiteral<"read">>;
101
+ action: z.ZodOptional<z.ZodEnum<["working", "waiting", "no_action", "declined", "reply_pending", "done"]>>;
102
+ reason: z.ZodOptional<z.ZodString>;
103
+ responseEventId: z.ZodOptional<z.ZodString>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ eventId: string;
106
+ stage?: "read" | undefined;
107
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
108
+ reason?: string | undefined;
109
+ responseEventId?: string | undefined;
110
+ }, {
111
+ eventId: string;
112
+ stage?: "read" | undefined;
113
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
114
+ reason?: string | undefined;
115
+ responseEventId?: string | undefined;
116
+ }>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ type: "message.received";
119
+ payload: {
120
+ eventId: string;
121
+ stage?: "read" | undefined;
122
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
123
+ reason?: string | undefined;
124
+ responseEventId?: string | undefined;
125
+ };
126
+ }, {
127
+ type: "message.received";
128
+ payload: {
129
+ eventId: string;
130
+ stage?: "read" | undefined;
131
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
132
+ reason?: string | undefined;
133
+ responseEventId?: string | undefined;
134
+ };
135
+ }>, z.ZodObject<{
136
+ type: z.ZodLiteral<"message.delivery_failed">;
137
+ payload: z.ZodObject<{
138
+ eventId: z.ZodString;
139
+ reason: z.ZodString;
140
+ stage: z.ZodOptional<z.ZodEnum<["delivery", "execution", "publishing"]>>;
141
+ }, "strip", z.ZodTypeAny, {
142
+ eventId: string;
143
+ reason: string;
144
+ stage?: "delivery" | "execution" | "publishing" | undefined;
145
+ }, {
146
+ eventId: string;
147
+ reason: string;
148
+ stage?: "delivery" | "execution" | "publishing" | undefined;
149
+ }>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ type: "message.delivery_failed";
152
+ payload: {
153
+ eventId: string;
154
+ reason: string;
155
+ stage?: "delivery" | "execution" | "publishing" | undefined;
156
+ };
157
+ }, {
158
+ type: "message.delivery_failed";
159
+ payload: {
160
+ eventId: string;
161
+ reason: string;
162
+ stage?: "delivery" | "execution" | "publishing" | undefined;
163
+ };
164
+ }>, z.ZodObject<{
165
+ type: z.ZodLiteral<"handover.offered">;
166
+ payload: z.ZodObject<{
167
+ handoverId: z.ZodString;
168
+ revision: z.ZodNumber;
169
+ document: z.ZodObject<{
170
+ metadata: z.ZodObject<{
171
+ goal: z.ZodString;
172
+ recipient: z.ZodString;
173
+ mode: z.ZodEnum<["sequential", "concurrent"]>;
174
+ nextAction: z.ZodString;
175
+ decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
176
+ blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
177
+ repository: z.ZodOptional<z.ZodObject<{
178
+ remote: z.ZodOptional<z.ZodString>;
179
+ branch: z.ZodString;
180
+ commit: z.ZodString;
181
+ worktreePath: z.ZodOptional<z.ZodString>;
182
+ dirty: z.ZodBoolean;
183
+ missingPaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ dirty: boolean;
186
+ branch: string;
187
+ commit: string;
188
+ missingPaths: string[];
189
+ remote?: string | undefined;
190
+ worktreePath?: string | undefined;
191
+ }, {
192
+ dirty: boolean;
193
+ branch: string;
194
+ commit: string;
195
+ remote?: string | undefined;
196
+ worktreePath?: string | undefined;
197
+ missingPaths?: string[] | undefined;
198
+ }>>;
199
+ tests: z.ZodOptional<z.ZodObject<{
200
+ command: z.ZodString;
201
+ result: z.ZodEnum<["passed", "failed", "not_run"]>;
202
+ notes: z.ZodOptional<z.ZodString>;
203
+ }, "strip", z.ZodTypeAny, {
204
+ command: string;
205
+ result: "passed" | "failed" | "not_run";
206
+ notes?: string | undefined;
207
+ }, {
208
+ command: string;
209
+ result: "passed" | "failed" | "not_run";
210
+ notes?: string | undefined;
211
+ }>>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ mode: "sequential" | "concurrent";
214
+ goal: string;
215
+ recipient: string;
216
+ nextAction: string;
217
+ decisions: string[];
218
+ blockers: string[];
219
+ repository?: {
220
+ dirty: boolean;
221
+ branch: string;
222
+ commit: string;
223
+ missingPaths: string[];
224
+ remote?: string | undefined;
225
+ worktreePath?: string | undefined;
226
+ } | undefined;
227
+ tests?: {
228
+ command: string;
229
+ result: "passed" | "failed" | "not_run";
230
+ notes?: string | undefined;
231
+ } | undefined;
232
+ }, {
233
+ mode: "sequential" | "concurrent";
234
+ goal: string;
235
+ recipient: string;
236
+ nextAction: string;
237
+ decisions?: string[] | undefined;
238
+ blockers?: string[] | undefined;
239
+ repository?: {
240
+ dirty: boolean;
241
+ branch: string;
242
+ commit: string;
243
+ remote?: string | undefined;
244
+ worktreePath?: string | undefined;
245
+ missingPaths?: string[] | undefined;
246
+ } | undefined;
247
+ tests?: {
248
+ command: string;
249
+ result: "passed" | "failed" | "not_run";
250
+ notes?: string | undefined;
251
+ } | undefined;
252
+ }>;
253
+ body: z.ZodString;
254
+ }, "strip", z.ZodTypeAny, {
255
+ metadata: {
256
+ mode: "sequential" | "concurrent";
257
+ goal: string;
258
+ recipient: string;
259
+ nextAction: string;
260
+ decisions: string[];
261
+ blockers: string[];
262
+ repository?: {
263
+ dirty: boolean;
264
+ branch: string;
265
+ commit: string;
266
+ missingPaths: string[];
267
+ remote?: string | undefined;
268
+ worktreePath?: string | undefined;
269
+ } | undefined;
270
+ tests?: {
271
+ command: string;
272
+ result: "passed" | "failed" | "not_run";
273
+ notes?: string | undefined;
274
+ } | undefined;
275
+ };
276
+ body: string;
277
+ }, {
278
+ metadata: {
279
+ mode: "sequential" | "concurrent";
280
+ goal: string;
281
+ recipient: string;
282
+ nextAction: string;
283
+ decisions?: string[] | undefined;
284
+ blockers?: string[] | undefined;
285
+ repository?: {
286
+ dirty: boolean;
287
+ branch: string;
288
+ commit: string;
289
+ remote?: string | undefined;
290
+ worktreePath?: string | undefined;
291
+ missingPaths?: string[] | undefined;
292
+ } | undefined;
293
+ tests?: {
294
+ command: string;
295
+ result: "passed" | "failed" | "not_run";
296
+ notes?: string | undefined;
297
+ } | undefined;
298
+ };
299
+ body: string;
300
+ }>;
301
+ }, "strip", z.ZodTypeAny, {
302
+ handoverId: string;
303
+ revision: number;
304
+ document: {
305
+ metadata: {
306
+ mode: "sequential" | "concurrent";
307
+ goal: string;
308
+ recipient: string;
309
+ nextAction: string;
310
+ decisions: string[];
311
+ blockers: string[];
312
+ repository?: {
313
+ dirty: boolean;
314
+ branch: string;
315
+ commit: string;
316
+ missingPaths: string[];
317
+ remote?: string | undefined;
318
+ worktreePath?: string | undefined;
319
+ } | undefined;
320
+ tests?: {
321
+ command: string;
322
+ result: "passed" | "failed" | "not_run";
323
+ notes?: string | undefined;
324
+ } | undefined;
325
+ };
326
+ body: string;
327
+ };
328
+ }, {
329
+ handoverId: string;
330
+ revision: number;
331
+ document: {
332
+ metadata: {
333
+ mode: "sequential" | "concurrent";
334
+ goal: string;
335
+ recipient: string;
336
+ nextAction: string;
337
+ decisions?: string[] | undefined;
338
+ blockers?: string[] | undefined;
339
+ repository?: {
340
+ dirty: boolean;
341
+ branch: string;
342
+ commit: string;
343
+ remote?: string | undefined;
344
+ worktreePath?: string | undefined;
345
+ missingPaths?: string[] | undefined;
346
+ } | undefined;
347
+ tests?: {
348
+ command: string;
349
+ result: "passed" | "failed" | "not_run";
350
+ notes?: string | undefined;
351
+ } | undefined;
352
+ };
353
+ body: string;
354
+ };
355
+ }>;
356
+ }, "strip", z.ZodTypeAny, {
357
+ type: "handover.offered";
358
+ payload: {
359
+ handoverId: string;
360
+ revision: number;
361
+ document: {
362
+ metadata: {
363
+ mode: "sequential" | "concurrent";
364
+ goal: string;
365
+ recipient: string;
366
+ nextAction: string;
367
+ decisions: string[];
368
+ blockers: string[];
369
+ repository?: {
370
+ dirty: boolean;
371
+ branch: string;
372
+ commit: string;
373
+ missingPaths: string[];
374
+ remote?: string | undefined;
375
+ worktreePath?: string | undefined;
376
+ } | undefined;
377
+ tests?: {
378
+ command: string;
379
+ result: "passed" | "failed" | "not_run";
380
+ notes?: string | undefined;
381
+ } | undefined;
382
+ };
383
+ body: string;
384
+ };
385
+ };
386
+ }, {
387
+ type: "handover.offered";
388
+ payload: {
389
+ handoverId: string;
390
+ revision: number;
391
+ document: {
392
+ metadata: {
393
+ mode: "sequential" | "concurrent";
394
+ goal: string;
395
+ recipient: string;
396
+ nextAction: string;
397
+ decisions?: string[] | undefined;
398
+ blockers?: string[] | undefined;
399
+ repository?: {
400
+ dirty: boolean;
401
+ branch: string;
402
+ commit: string;
403
+ remote?: string | undefined;
404
+ worktreePath?: string | undefined;
405
+ missingPaths?: string[] | undefined;
406
+ } | undefined;
407
+ tests?: {
408
+ command: string;
409
+ result: "passed" | "failed" | "not_run";
410
+ notes?: string | undefined;
411
+ } | undefined;
412
+ };
413
+ body: string;
414
+ };
415
+ };
416
+ }>, z.ZodObject<{
417
+ type: z.ZodLiteral<"handover.accepted">;
418
+ payload: z.ZodObject<{
419
+ handoverId: z.ZodString;
420
+ revision: z.ZodNumber;
421
+ note: z.ZodOptional<z.ZodString>;
422
+ }, "strip", z.ZodTypeAny, {
423
+ handoverId: string;
424
+ revision: number;
425
+ note?: string | undefined;
426
+ }, {
427
+ handoverId: string;
428
+ revision: number;
429
+ note?: string | undefined;
430
+ }>;
431
+ }, "strip", z.ZodTypeAny, {
432
+ type: "handover.accepted";
433
+ payload: {
434
+ handoverId: string;
435
+ revision: number;
436
+ note?: string | undefined;
437
+ };
438
+ }, {
439
+ type: "handover.accepted";
440
+ payload: {
441
+ handoverId: string;
442
+ revision: number;
443
+ note?: string | undefined;
444
+ };
445
+ }>, z.ZodObject<{
446
+ type: z.ZodLiteral<"handover.declined">;
447
+ payload: z.ZodObject<{
448
+ handoverId: z.ZodString;
449
+ revision: z.ZodNumber;
450
+ reason: z.ZodOptional<z.ZodString>;
451
+ }, "strip", z.ZodTypeAny, {
452
+ handoverId: string;
453
+ revision: number;
454
+ reason?: string | undefined;
455
+ }, {
456
+ handoverId: string;
457
+ revision: number;
458
+ reason?: string | undefined;
459
+ }>;
460
+ }, "strip", z.ZodTypeAny, {
461
+ type: "handover.declined";
462
+ payload: {
463
+ handoverId: string;
464
+ revision: number;
465
+ reason?: string | undefined;
466
+ };
467
+ }, {
468
+ type: "handover.declined";
469
+ payload: {
470
+ handoverId: string;
471
+ revision: number;
472
+ reason?: string | undefined;
473
+ };
474
+ }>, z.ZodObject<{
475
+ type: z.ZodLiteral<"control.ack">;
476
+ payload: z.ZodObject<{
477
+ targetParticipantId: z.ZodString;
478
+ revision: z.ZodNumber;
479
+ outcome: z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>;
480
+ detail: z.ZodOptional<z.ZodString>;
481
+ }, "strip", z.ZodTypeAny, {
482
+ revision: number;
483
+ targetParticipantId: string;
484
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
485
+ detail?: string | undefined;
486
+ }, {
487
+ revision: number;
488
+ targetParticipantId: string;
489
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
490
+ detail?: string | undefined;
491
+ }>;
492
+ }, "strip", z.ZodTypeAny, {
493
+ type: "control.ack";
494
+ payload: {
495
+ revision: number;
496
+ targetParticipantId: string;
497
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
498
+ detail?: string | undefined;
499
+ };
500
+ }, {
501
+ type: "control.ack";
502
+ payload: {
503
+ revision: number;
504
+ targetParticipantId: string;
505
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
506
+ detail?: string | undefined;
507
+ };
508
+ }>]>;
509
+ export type EventSubmission = z.infer<typeof EventSubmission>;
510
+ export declare const EventBody: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
511
+ type: z.ZodLiteral<"message">;
512
+ payload: z.ZodObject<{
513
+ text: z.ZodEffects<z.ZodString, string, string>;
514
+ priority: z.ZodDefault<z.ZodEnum<["normal", "priority"]>>;
515
+ responseStage: z.ZodOptional<z.ZodEnum<["progress", "final"]>>;
516
+ }, "strip", z.ZodTypeAny, {
517
+ text: string;
518
+ priority: "normal" | "priority";
519
+ responseStage?: "progress" | "final" | undefined;
520
+ }, {
521
+ text: string;
522
+ priority?: "normal" | "priority" | undefined;
523
+ responseStage?: "progress" | "final" | undefined;
524
+ }>;
525
+ }, "strip", z.ZodTypeAny, {
526
+ type: "message";
527
+ payload: {
528
+ text: string;
529
+ priority: "normal" | "priority";
530
+ responseStage?: "progress" | "final" | undefined;
531
+ };
532
+ }, {
533
+ type: "message";
534
+ payload: {
535
+ text: string;
536
+ priority?: "normal" | "priority" | undefined;
537
+ responseStage?: "progress" | "final" | undefined;
538
+ };
539
+ }>, z.ZodObject<{
540
+ type: z.ZodLiteral<"message.received">;
541
+ payload: z.ZodObject<{
542
+ eventId: z.ZodString;
543
+ stage: z.ZodOptional<z.ZodLiteral<"read">>;
544
+ action: z.ZodOptional<z.ZodEnum<["working", "waiting", "no_action", "declined", "reply_pending", "done"]>>;
545
+ reason: z.ZodOptional<z.ZodString>;
546
+ responseEventId: z.ZodOptional<z.ZodString>;
547
+ }, "strip", z.ZodTypeAny, {
548
+ eventId: string;
549
+ stage?: "read" | undefined;
550
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
551
+ reason?: string | undefined;
552
+ responseEventId?: string | undefined;
553
+ }, {
554
+ eventId: string;
555
+ stage?: "read" | undefined;
556
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
557
+ reason?: string | undefined;
558
+ responseEventId?: string | undefined;
559
+ }>;
560
+ }, "strip", z.ZodTypeAny, {
561
+ type: "message.received";
562
+ payload: {
563
+ eventId: string;
564
+ stage?: "read" | undefined;
565
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
566
+ reason?: string | undefined;
567
+ responseEventId?: string | undefined;
568
+ };
569
+ }, {
570
+ type: "message.received";
571
+ payload: {
572
+ eventId: string;
573
+ stage?: "read" | undefined;
574
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
575
+ reason?: string | undefined;
576
+ responseEventId?: string | undefined;
577
+ };
578
+ }>, z.ZodObject<{
579
+ type: z.ZodLiteral<"message.delivery_failed">;
580
+ payload: z.ZodObject<{
581
+ eventId: z.ZodString;
582
+ reason: z.ZodString;
583
+ stage: z.ZodOptional<z.ZodEnum<["delivery", "execution", "publishing"]>>;
584
+ }, "strip", z.ZodTypeAny, {
585
+ eventId: string;
586
+ reason: string;
587
+ stage?: "delivery" | "execution" | "publishing" | undefined;
588
+ }, {
589
+ eventId: string;
590
+ reason: string;
591
+ stage?: "delivery" | "execution" | "publishing" | undefined;
592
+ }>;
593
+ }, "strip", z.ZodTypeAny, {
594
+ type: "message.delivery_failed";
595
+ payload: {
596
+ eventId: string;
597
+ reason: string;
598
+ stage?: "delivery" | "execution" | "publishing" | undefined;
599
+ };
600
+ }, {
601
+ type: "message.delivery_failed";
602
+ payload: {
603
+ eventId: string;
604
+ reason: string;
605
+ stage?: "delivery" | "execution" | "publishing" | undefined;
606
+ };
607
+ }>, z.ZodObject<{
608
+ type: z.ZodLiteral<"handover.offered">;
609
+ payload: z.ZodObject<{
610
+ handoverId: z.ZodString;
611
+ revision: z.ZodNumber;
612
+ document: z.ZodObject<{
613
+ metadata: z.ZodObject<{
614
+ goal: z.ZodString;
615
+ recipient: z.ZodString;
616
+ mode: z.ZodEnum<["sequential", "concurrent"]>;
617
+ nextAction: z.ZodString;
618
+ decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
619
+ blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
620
+ repository: z.ZodOptional<z.ZodObject<{
621
+ remote: z.ZodOptional<z.ZodString>;
622
+ branch: z.ZodString;
623
+ commit: z.ZodString;
624
+ worktreePath: z.ZodOptional<z.ZodString>;
625
+ dirty: z.ZodBoolean;
626
+ missingPaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
627
+ }, "strip", z.ZodTypeAny, {
628
+ dirty: boolean;
629
+ branch: string;
630
+ commit: string;
631
+ missingPaths: string[];
632
+ remote?: string | undefined;
633
+ worktreePath?: string | undefined;
634
+ }, {
635
+ dirty: boolean;
636
+ branch: string;
637
+ commit: string;
638
+ remote?: string | undefined;
639
+ worktreePath?: string | undefined;
640
+ missingPaths?: string[] | undefined;
641
+ }>>;
642
+ tests: z.ZodOptional<z.ZodObject<{
643
+ command: z.ZodString;
644
+ result: z.ZodEnum<["passed", "failed", "not_run"]>;
645
+ notes: z.ZodOptional<z.ZodString>;
646
+ }, "strip", z.ZodTypeAny, {
647
+ command: string;
648
+ result: "passed" | "failed" | "not_run";
649
+ notes?: string | undefined;
650
+ }, {
651
+ command: string;
652
+ result: "passed" | "failed" | "not_run";
653
+ notes?: string | undefined;
654
+ }>>;
655
+ }, "strip", z.ZodTypeAny, {
656
+ mode: "sequential" | "concurrent";
657
+ goal: string;
658
+ recipient: string;
659
+ nextAction: string;
660
+ decisions: string[];
661
+ blockers: string[];
662
+ repository?: {
663
+ dirty: boolean;
664
+ branch: string;
665
+ commit: string;
666
+ missingPaths: string[];
667
+ remote?: string | undefined;
668
+ worktreePath?: string | undefined;
669
+ } | undefined;
670
+ tests?: {
671
+ command: string;
672
+ result: "passed" | "failed" | "not_run";
673
+ notes?: string | undefined;
674
+ } | undefined;
675
+ }, {
676
+ mode: "sequential" | "concurrent";
677
+ goal: string;
678
+ recipient: string;
679
+ nextAction: string;
680
+ decisions?: string[] | undefined;
681
+ blockers?: string[] | undefined;
682
+ repository?: {
683
+ dirty: boolean;
684
+ branch: string;
685
+ commit: string;
686
+ remote?: string | undefined;
687
+ worktreePath?: string | undefined;
688
+ missingPaths?: string[] | undefined;
689
+ } | undefined;
690
+ tests?: {
691
+ command: string;
692
+ result: "passed" | "failed" | "not_run";
693
+ notes?: string | undefined;
694
+ } | undefined;
695
+ }>;
696
+ body: z.ZodString;
697
+ }, "strip", z.ZodTypeAny, {
698
+ metadata: {
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
+ body: string;
720
+ }, {
721
+ metadata: {
722
+ mode: "sequential" | "concurrent";
723
+ goal: string;
724
+ recipient: string;
725
+ nextAction: string;
726
+ decisions?: string[] | undefined;
727
+ blockers?: string[] | undefined;
728
+ repository?: {
729
+ dirty: boolean;
730
+ branch: string;
731
+ commit: string;
732
+ remote?: string | undefined;
733
+ worktreePath?: string | undefined;
734
+ missingPaths?: string[] | undefined;
735
+ } | undefined;
736
+ tests?: {
737
+ command: string;
738
+ result: "passed" | "failed" | "not_run";
739
+ notes?: string | undefined;
740
+ } | undefined;
741
+ };
742
+ body: string;
743
+ }>;
744
+ }, "strip", z.ZodTypeAny, {
745
+ handoverId: string;
746
+ revision: number;
747
+ document: {
748
+ metadata: {
749
+ mode: "sequential" | "concurrent";
750
+ goal: string;
751
+ recipient: string;
752
+ nextAction: string;
753
+ decisions: string[];
754
+ blockers: string[];
755
+ repository?: {
756
+ dirty: boolean;
757
+ branch: string;
758
+ commit: string;
759
+ missingPaths: string[];
760
+ remote?: string | undefined;
761
+ worktreePath?: string | undefined;
762
+ } | undefined;
763
+ tests?: {
764
+ command: string;
765
+ result: "passed" | "failed" | "not_run";
766
+ notes?: string | undefined;
767
+ } | undefined;
768
+ };
769
+ body: string;
770
+ };
771
+ }, {
772
+ handoverId: string;
773
+ revision: number;
774
+ document: {
775
+ metadata: {
776
+ mode: "sequential" | "concurrent";
777
+ goal: string;
778
+ recipient: string;
779
+ nextAction: string;
780
+ decisions?: string[] | undefined;
781
+ blockers?: string[] | undefined;
782
+ repository?: {
783
+ dirty: boolean;
784
+ branch: string;
785
+ commit: string;
786
+ remote?: string | undefined;
787
+ worktreePath?: string | undefined;
788
+ missingPaths?: string[] | undefined;
789
+ } | undefined;
790
+ tests?: {
791
+ command: string;
792
+ result: "passed" | "failed" | "not_run";
793
+ notes?: string | undefined;
794
+ } | undefined;
795
+ };
796
+ body: string;
797
+ };
798
+ }>;
799
+ }, "strip", z.ZodTypeAny, {
800
+ type: "handover.offered";
801
+ payload: {
802
+ handoverId: string;
803
+ revision: number;
804
+ document: {
805
+ metadata: {
806
+ mode: "sequential" | "concurrent";
807
+ goal: string;
808
+ recipient: string;
809
+ nextAction: string;
810
+ decisions: string[];
811
+ blockers: string[];
812
+ repository?: {
813
+ dirty: boolean;
814
+ branch: string;
815
+ commit: string;
816
+ missingPaths: string[];
817
+ remote?: string | undefined;
818
+ worktreePath?: string | undefined;
819
+ } | undefined;
820
+ tests?: {
821
+ command: string;
822
+ result: "passed" | "failed" | "not_run";
823
+ notes?: string | undefined;
824
+ } | undefined;
825
+ };
826
+ body: string;
827
+ };
828
+ };
829
+ }, {
830
+ type: "handover.offered";
831
+ payload: {
832
+ handoverId: string;
833
+ revision: number;
834
+ document: {
835
+ metadata: {
836
+ mode: "sequential" | "concurrent";
837
+ goal: string;
838
+ recipient: string;
839
+ nextAction: string;
840
+ decisions?: string[] | undefined;
841
+ blockers?: string[] | undefined;
842
+ repository?: {
843
+ dirty: boolean;
844
+ branch: string;
845
+ commit: string;
846
+ remote?: string | undefined;
847
+ worktreePath?: string | undefined;
848
+ missingPaths?: string[] | undefined;
849
+ } | undefined;
850
+ tests?: {
851
+ command: string;
852
+ result: "passed" | "failed" | "not_run";
853
+ notes?: string | undefined;
854
+ } | undefined;
855
+ };
856
+ body: string;
857
+ };
858
+ };
859
+ }>, z.ZodObject<{
860
+ type: z.ZodLiteral<"handover.accepted">;
861
+ payload: z.ZodObject<{
862
+ handoverId: z.ZodString;
863
+ revision: z.ZodNumber;
864
+ note: z.ZodOptional<z.ZodString>;
865
+ }, "strip", z.ZodTypeAny, {
866
+ handoverId: string;
867
+ revision: number;
868
+ note?: string | undefined;
869
+ }, {
870
+ handoverId: string;
871
+ revision: number;
872
+ note?: string | undefined;
873
+ }>;
874
+ }, "strip", z.ZodTypeAny, {
875
+ type: "handover.accepted";
876
+ payload: {
877
+ handoverId: string;
878
+ revision: number;
879
+ note?: string | undefined;
880
+ };
881
+ }, {
882
+ type: "handover.accepted";
883
+ payload: {
884
+ handoverId: string;
885
+ revision: number;
886
+ note?: string | undefined;
887
+ };
888
+ }>, z.ZodObject<{
889
+ type: z.ZodLiteral<"handover.declined">;
890
+ payload: z.ZodObject<{
891
+ handoverId: z.ZodString;
892
+ revision: z.ZodNumber;
893
+ reason: z.ZodOptional<z.ZodString>;
894
+ }, "strip", z.ZodTypeAny, {
895
+ handoverId: string;
896
+ revision: number;
897
+ reason?: string | undefined;
898
+ }, {
899
+ handoverId: string;
900
+ revision: number;
901
+ reason?: string | undefined;
902
+ }>;
903
+ }, "strip", z.ZodTypeAny, {
904
+ type: "handover.declined";
905
+ payload: {
906
+ handoverId: string;
907
+ revision: number;
908
+ reason?: string | undefined;
909
+ };
910
+ }, {
911
+ type: "handover.declined";
912
+ payload: {
913
+ handoverId: string;
914
+ revision: number;
915
+ reason?: string | undefined;
916
+ };
917
+ }>, z.ZodObject<{
918
+ type: z.ZodLiteral<"participant.joined">;
919
+ payload: z.ZodObject<{
920
+ participantId: z.ZodString;
921
+ displayName: z.ZodString;
922
+ kind: z.ZodEnum<["agent", "human"]>;
923
+ role: z.ZodEnum<["guest", "member", "controller"]>;
924
+ capabilities: z.ZodOptional<z.ZodObject<{
925
+ /** The adapter can deliver an unsolicited message into a running session. */
926
+ deliverUnsolicited: z.ZodDefault<z.ZodBoolean>;
927
+ /** The adapter can end the model's current turn on request. */
928
+ cancelTurn: z.ZodDefault<z.ZodBoolean>;
929
+ /** The adapter can stop a tool the session is currently running. */
930
+ cancelTool: z.ZodDefault<z.ZodBoolean>;
931
+ runtime: z.ZodOptional<z.ZodString>;
932
+ runtimeVersion: z.ZodOptional<z.ZodString>;
933
+ }, "strip", z.ZodTypeAny, {
934
+ deliverUnsolicited: boolean;
935
+ cancelTurn: boolean;
936
+ cancelTool: boolean;
937
+ runtime?: string | undefined;
938
+ runtimeVersion?: string | undefined;
939
+ }, {
940
+ deliverUnsolicited?: boolean | undefined;
941
+ cancelTurn?: boolean | undefined;
942
+ cancelTool?: boolean | undefined;
943
+ runtime?: string | undefined;
944
+ runtimeVersion?: string | undefined;
945
+ }>>;
946
+ }, "strip", z.ZodTypeAny, {
947
+ participantId: string;
948
+ displayName: string;
949
+ kind: "agent" | "human";
950
+ role: "controller" | "guest" | "member";
951
+ capabilities?: {
952
+ deliverUnsolicited: boolean;
953
+ cancelTurn: boolean;
954
+ cancelTool: boolean;
955
+ runtime?: string | undefined;
956
+ runtimeVersion?: string | undefined;
957
+ } | undefined;
958
+ }, {
959
+ participantId: string;
960
+ displayName: string;
961
+ kind: "agent" | "human";
962
+ role: "controller" | "guest" | "member";
963
+ capabilities?: {
964
+ deliverUnsolicited?: boolean | undefined;
965
+ cancelTurn?: boolean | undefined;
966
+ cancelTool?: boolean | undefined;
967
+ runtime?: string | undefined;
968
+ runtimeVersion?: string | undefined;
969
+ } | undefined;
970
+ }>;
971
+ }, "strip", z.ZodTypeAny, {
972
+ type: "participant.joined";
973
+ payload: {
974
+ participantId: string;
975
+ displayName: string;
976
+ kind: "agent" | "human";
977
+ role: "controller" | "guest" | "member";
978
+ capabilities?: {
979
+ deliverUnsolicited: boolean;
980
+ cancelTurn: boolean;
981
+ cancelTool: boolean;
982
+ runtime?: string | undefined;
983
+ runtimeVersion?: string | undefined;
984
+ } | undefined;
985
+ };
986
+ }, {
987
+ type: "participant.joined";
988
+ payload: {
989
+ participantId: string;
990
+ displayName: string;
991
+ kind: "agent" | "human";
992
+ role: "controller" | "guest" | "member";
993
+ capabilities?: {
994
+ deliverUnsolicited?: boolean | undefined;
995
+ cancelTurn?: boolean | undefined;
996
+ cancelTool?: boolean | undefined;
997
+ runtime?: string | undefined;
998
+ runtimeVersion?: string | undefined;
999
+ } | undefined;
1000
+ };
1001
+ }>, z.ZodObject<{
1002
+ type: z.ZodLiteral<"participant.renamed">;
1003
+ payload: z.ZodObject<{
1004
+ participantId: z.ZodString;
1005
+ previousName: z.ZodString;
1006
+ name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
1007
+ source: z.ZodEnum<["profile", "room"]>;
1008
+ }, "strip", z.ZodTypeAny, {
1009
+ name: string;
1010
+ source: "profile" | "room";
1011
+ participantId: string;
1012
+ previousName: string;
1013
+ }, {
1014
+ name: string;
1015
+ source: "profile" | "room";
1016
+ participantId: string;
1017
+ previousName: string;
1018
+ }>;
1019
+ }, "strip", z.ZodTypeAny, {
1020
+ type: "participant.renamed";
1021
+ payload: {
1022
+ name: string;
1023
+ source: "profile" | "room";
1024
+ participantId: string;
1025
+ previousName: string;
1026
+ };
1027
+ }, {
1028
+ type: "participant.renamed";
1029
+ payload: {
1030
+ name: string;
1031
+ source: "profile" | "room";
1032
+ participantId: string;
1033
+ previousName: string;
1034
+ };
1035
+ }>, z.ZodObject<{
1036
+ type: z.ZodLiteral<"participant.left">;
1037
+ payload: z.ZodObject<{
1038
+ participantId: z.ZodString;
1039
+ }, "strip", z.ZodTypeAny, {
1040
+ participantId: string;
1041
+ }, {
1042
+ participantId: string;
1043
+ }>;
1044
+ }, "strip", z.ZodTypeAny, {
1045
+ type: "participant.left";
1046
+ payload: {
1047
+ participantId: string;
1048
+ };
1049
+ }, {
1050
+ type: "participant.left";
1051
+ payload: {
1052
+ participantId: string;
1053
+ };
1054
+ }>, z.ZodObject<{
1055
+ type: z.ZodLiteral<"participant.revoked">;
1056
+ payload: z.ZodObject<{
1057
+ participantId: z.ZodString;
1058
+ }, "strip", z.ZodTypeAny, {
1059
+ participantId: string;
1060
+ }, {
1061
+ participantId: string;
1062
+ }>;
1063
+ }, "strip", z.ZodTypeAny, {
1064
+ type: "participant.revoked";
1065
+ payload: {
1066
+ participantId: string;
1067
+ };
1068
+ }, {
1069
+ type: "participant.revoked";
1070
+ payload: {
1071
+ participantId: string;
1072
+ };
1073
+ }>, z.ZodObject<{
1074
+ type: z.ZodLiteral<"control.pause">;
1075
+ payload: z.ZodObject<{
1076
+ targetParticipantId: z.ZodString;
1077
+ revision: z.ZodNumber;
1078
+ reason: z.ZodOptional<z.ZodString>;
1079
+ interrupt: z.ZodOptional<z.ZodBoolean>;
1080
+ }, "strip", z.ZodTypeAny, {
1081
+ revision: number;
1082
+ targetParticipantId: string;
1083
+ reason?: string | undefined;
1084
+ interrupt?: boolean | undefined;
1085
+ }, {
1086
+ revision: number;
1087
+ targetParticipantId: string;
1088
+ reason?: string | undefined;
1089
+ interrupt?: boolean | undefined;
1090
+ }>;
1091
+ }, "strip", z.ZodTypeAny, {
1092
+ type: "control.pause";
1093
+ payload: {
1094
+ revision: number;
1095
+ targetParticipantId: string;
1096
+ reason?: string | undefined;
1097
+ interrupt?: boolean | undefined;
1098
+ };
1099
+ }, {
1100
+ type: "control.pause";
1101
+ payload: {
1102
+ revision: number;
1103
+ targetParticipantId: string;
1104
+ reason?: string | undefined;
1105
+ interrupt?: boolean | undefined;
1106
+ };
1107
+ }>, z.ZodObject<{
1108
+ type: z.ZodLiteral<"control.resume">;
1109
+ payload: z.ZodObject<{
1110
+ targetParticipantId: z.ZodString;
1111
+ revision: z.ZodNumber;
1112
+ }, "strip", z.ZodTypeAny, {
1113
+ revision: number;
1114
+ targetParticipantId: string;
1115
+ }, {
1116
+ revision: number;
1117
+ targetParticipantId: string;
1118
+ }>;
1119
+ }, "strip", z.ZodTypeAny, {
1120
+ type: "control.resume";
1121
+ payload: {
1122
+ revision: number;
1123
+ targetParticipantId: string;
1124
+ };
1125
+ }, {
1126
+ type: "control.resume";
1127
+ payload: {
1128
+ revision: number;
1129
+ targetParticipantId: string;
1130
+ };
1131
+ }>, z.ZodObject<{
1132
+ type: z.ZodLiteral<"control.ack">;
1133
+ payload: z.ZodObject<{
1134
+ targetParticipantId: z.ZodString;
1135
+ revision: z.ZodNumber;
1136
+ outcome: z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>;
1137
+ detail: z.ZodOptional<z.ZodString>;
1138
+ }, "strip", z.ZodTypeAny, {
1139
+ revision: number;
1140
+ targetParticipantId: string;
1141
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1142
+ detail?: string | undefined;
1143
+ }, {
1144
+ revision: number;
1145
+ targetParticipantId: string;
1146
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1147
+ detail?: string | undefined;
1148
+ }>;
1149
+ }, "strip", z.ZodTypeAny, {
1150
+ type: "control.ack";
1151
+ payload: {
1152
+ revision: number;
1153
+ targetParticipantId: string;
1154
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1155
+ detail?: string | undefined;
1156
+ };
1157
+ }, {
1158
+ type: "control.ack";
1159
+ payload: {
1160
+ revision: number;
1161
+ targetParticipantId: string;
1162
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
1163
+ detail?: string | undefined;
1164
+ };
1165
+ }>, z.ZodObject<{
1166
+ type: z.ZodLiteral<"room.closed">;
1167
+ payload: z.ZodObject<{
1168
+ exportWindowEndsAt: z.ZodNumber;
1169
+ reason: z.ZodOptional<z.ZodEnum<["manual", "inactivity", "age", "agents_and_guests_left"]>>;
1170
+ }, "strip", z.ZodTypeAny, {
1171
+ exportWindowEndsAt: number;
1172
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1173
+ }, {
1174
+ exportWindowEndsAt: number;
1175
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1176
+ }>;
1177
+ }, "strip", z.ZodTypeAny, {
1178
+ type: "room.closed";
1179
+ payload: {
1180
+ exportWindowEndsAt: number;
1181
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1182
+ };
1183
+ }, {
1184
+ type: "room.closed";
1185
+ payload: {
1186
+ exportWindowEndsAt: number;
1187
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
1188
+ };
1189
+ }>, z.ZodObject<{
1190
+ type: z.ZodLiteral<"room.auto_close_changed">;
1191
+ payload: z.ZodObject<{
1192
+ autoClose: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
1193
+ mode: z.ZodLiteral<"off">;
1194
+ }, "strip", z.ZodTypeAny, {
1195
+ mode: "off";
1196
+ }, {
1197
+ mode: "off";
1198
+ }>, z.ZodObject<{
1199
+ mode: z.ZodLiteral<"inactivity">;
1200
+ afterMs: z.ZodNumber;
1201
+ }, "strip", z.ZodTypeAny, {
1202
+ mode: "inactivity";
1203
+ afterMs: number;
1204
+ }, {
1205
+ mode: "inactivity";
1206
+ afterMs: number;
1207
+ }>, z.ZodObject<{
1208
+ mode: z.ZodLiteral<"age">;
1209
+ afterMs: z.ZodNumber;
1210
+ }, "strip", z.ZodTypeAny, {
1211
+ mode: "age";
1212
+ afterMs: number;
1213
+ }, {
1214
+ mode: "age";
1215
+ afterMs: number;
1216
+ }>, z.ZodObject<{
1217
+ mode: z.ZodLiteral<"agents_and_guests_left">;
1218
+ }, "strip", z.ZodTypeAny, {
1219
+ mode: "agents_and_guests_left";
1220
+ }, {
1221
+ mode: "agents_and_guests_left";
1222
+ }>]>;
1223
+ previous: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
1224
+ mode: z.ZodLiteral<"off">;
1225
+ }, "strip", z.ZodTypeAny, {
1226
+ mode: "off";
1227
+ }, {
1228
+ mode: "off";
1229
+ }>, z.ZodObject<{
1230
+ mode: z.ZodLiteral<"inactivity">;
1231
+ afterMs: z.ZodNumber;
1232
+ }, "strip", z.ZodTypeAny, {
1233
+ mode: "inactivity";
1234
+ afterMs: number;
1235
+ }, {
1236
+ mode: "inactivity";
1237
+ afterMs: number;
1238
+ }>, z.ZodObject<{
1239
+ mode: z.ZodLiteral<"age">;
1240
+ afterMs: z.ZodNumber;
1241
+ }, "strip", z.ZodTypeAny, {
1242
+ mode: "age";
1243
+ afterMs: number;
1244
+ }, {
1245
+ mode: "age";
1246
+ afterMs: number;
1247
+ }>, z.ZodObject<{
1248
+ mode: z.ZodLiteral<"agents_and_guests_left">;
1249
+ }, "strip", z.ZodTypeAny, {
1250
+ mode: "agents_and_guests_left";
1251
+ }, {
1252
+ mode: "agents_and_guests_left";
1253
+ }>]>;
1254
+ }, "strip", z.ZodTypeAny, {
1255
+ autoClose: {
1256
+ mode: "off";
1257
+ } | {
1258
+ mode: "inactivity";
1259
+ afterMs: number;
1260
+ } | {
1261
+ mode: "age";
1262
+ afterMs: number;
1263
+ } | {
1264
+ mode: "agents_and_guests_left";
1265
+ };
1266
+ previous: {
1267
+ mode: "off";
1268
+ } | {
1269
+ mode: "inactivity";
1270
+ afterMs: number;
1271
+ } | {
1272
+ mode: "age";
1273
+ afterMs: number;
1274
+ } | {
1275
+ mode: "agents_and_guests_left";
1276
+ };
1277
+ }, {
1278
+ autoClose: {
1279
+ mode: "off";
1280
+ } | {
1281
+ mode: "inactivity";
1282
+ afterMs: number;
1283
+ } | {
1284
+ mode: "age";
1285
+ afterMs: number;
1286
+ } | {
1287
+ mode: "agents_and_guests_left";
1288
+ };
1289
+ previous: {
1290
+ mode: "off";
1291
+ } | {
1292
+ mode: "inactivity";
1293
+ afterMs: number;
1294
+ } | {
1295
+ mode: "age";
1296
+ afterMs: number;
1297
+ } | {
1298
+ mode: "agents_and_guests_left";
1299
+ };
1300
+ }>;
1301
+ }, "strip", z.ZodTypeAny, {
1302
+ type: "room.auto_close_changed";
1303
+ payload: {
1304
+ autoClose: {
1305
+ mode: "off";
1306
+ } | {
1307
+ mode: "inactivity";
1308
+ afterMs: number;
1309
+ } | {
1310
+ mode: "age";
1311
+ afterMs: number;
1312
+ } | {
1313
+ mode: "agents_and_guests_left";
1314
+ };
1315
+ previous: {
1316
+ mode: "off";
1317
+ } | {
1318
+ mode: "inactivity";
1319
+ afterMs: number;
1320
+ } | {
1321
+ mode: "age";
1322
+ afterMs: number;
1323
+ } | {
1324
+ mode: "agents_and_guests_left";
1325
+ };
1326
+ };
1327
+ }, {
1328
+ type: "room.auto_close_changed";
1329
+ payload: {
1330
+ autoClose: {
1331
+ mode: "off";
1332
+ } | {
1333
+ mode: "inactivity";
1334
+ afterMs: number;
1335
+ } | {
1336
+ mode: "age";
1337
+ afterMs: number;
1338
+ } | {
1339
+ mode: "agents_and_guests_left";
1340
+ };
1341
+ previous: {
1342
+ mode: "off";
1343
+ } | {
1344
+ mode: "inactivity";
1345
+ afterMs: number;
1346
+ } | {
1347
+ mode: "age";
1348
+ afterMs: number;
1349
+ } | {
1350
+ mode: "agents_and_guests_left";
1351
+ };
1352
+ };
1353
+ }>, z.ZodObject<{
1354
+ type: z.ZodLiteral<"room.renamed">;
1355
+ payload: z.ZodObject<{
1356
+ name: z.ZodString;
1357
+ previousName: z.ZodString;
1358
+ }, "strip", z.ZodTypeAny, {
1359
+ name: string;
1360
+ previousName: string;
1361
+ }, {
1362
+ name: string;
1363
+ previousName: string;
1364
+ }>;
1365
+ }, "strip", z.ZodTypeAny, {
1366
+ type: "room.renamed";
1367
+ payload: {
1368
+ name: string;
1369
+ previousName: string;
1370
+ };
1371
+ }, {
1372
+ type: "room.renamed";
1373
+ payload: {
1374
+ name: string;
1375
+ previousName: string;
1376
+ };
1377
+ }>, z.ZodObject<{
1378
+ type: z.ZodLiteral<"room.expiry_changed">;
1379
+ payload: z.ZodObject<{
1380
+ expiresAt: z.ZodNullable<z.ZodNumber>;
1381
+ previousExpiresAt: z.ZodNullable<z.ZodNumber>;
1382
+ }, "strip", z.ZodTypeAny, {
1383
+ expiresAt: number | null;
1384
+ previousExpiresAt: number | null;
1385
+ }, {
1386
+ expiresAt: number | null;
1387
+ previousExpiresAt: number | null;
1388
+ }>;
1389
+ }, "strip", z.ZodTypeAny, {
1390
+ type: "room.expiry_changed";
1391
+ payload: {
1392
+ expiresAt: number | null;
1393
+ previousExpiresAt: number | null;
1394
+ };
1395
+ }, {
1396
+ type: "room.expiry_changed";
1397
+ payload: {
1398
+ expiresAt: number | null;
1399
+ previousExpiresAt: number | null;
1400
+ };
1401
+ }>, z.ZodObject<{
1402
+ type: z.ZodLiteral<"room.access_changed">;
1403
+ payload: z.ZodObject<{
1404
+ joinPolicy: z.ZodEnum<["invite_only", "open_to_guests"]>;
1405
+ inviteRole: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
1406
+ }, "strip", z.ZodTypeAny, {
1407
+ joinPolicy: "invite_only" | "open_to_guests";
1408
+ inviteRole?: "guest" | "member" | undefined;
1409
+ }, {
1410
+ joinPolicy: "invite_only" | "open_to_guests";
1411
+ inviteRole?: "guest" | "member" | undefined;
1412
+ }>;
1413
+ }, "strip", z.ZodTypeAny, {
1414
+ type: "room.access_changed";
1415
+ payload: {
1416
+ joinPolicy: "invite_only" | "open_to_guests";
1417
+ inviteRole?: "guest" | "member" | undefined;
1418
+ };
1419
+ }, {
1420
+ type: "room.access_changed";
1421
+ payload: {
1422
+ joinPolicy: "invite_only" | "open_to_guests";
1423
+ inviteRole?: "guest" | "member" | undefined;
1424
+ };
1425
+ }>, z.ZodObject<{
1426
+ type: z.ZodLiteral<"room.local_join_changed">;
1427
+ payload: z.ZodObject<{
1428
+ localJoin: z.ZodBoolean;
1429
+ }, "strip", z.ZodTypeAny, {
1430
+ localJoin: boolean;
1431
+ }, {
1432
+ localJoin: boolean;
1433
+ }>;
1434
+ }, "strip", z.ZodTypeAny, {
1435
+ type: "room.local_join_changed";
1436
+ payload: {
1437
+ localJoin: boolean;
1438
+ };
1439
+ }, {
1440
+ type: "room.local_join_changed";
1441
+ payload: {
1442
+ localJoin: boolean;
1443
+ };
1444
+ }>, z.ZodObject<{
1445
+ type: z.ZodLiteral<"room.invitation_changed">;
1446
+ payload: z.ZodObject<{
1447
+ handle: z.ZodString;
1448
+ state: z.ZodEnum<["invited", "withdrawn"]>;
1449
+ role: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
1450
+ agents: z.ZodOptional<z.ZodNumber>;
1451
+ }, "strip", z.ZodTypeAny, {
1452
+ handle: string;
1453
+ state: "invited" | "withdrawn";
1454
+ role?: "guest" | "member" | undefined;
1455
+ agents?: number | undefined;
1456
+ }, {
1457
+ handle: string;
1458
+ state: "invited" | "withdrawn";
1459
+ role?: "guest" | "member" | undefined;
1460
+ agents?: number | undefined;
1461
+ }>;
1462
+ }, "strip", z.ZodTypeAny, {
1463
+ type: "room.invitation_changed";
1464
+ payload: {
1465
+ handle: string;
1466
+ state: "invited" | "withdrawn";
1467
+ role?: "guest" | "member" | undefined;
1468
+ agents?: number | undefined;
1469
+ };
1470
+ }, {
1471
+ type: "room.invitation_changed";
1472
+ payload: {
1473
+ handle: string;
1474
+ state: "invited" | "withdrawn";
1475
+ role?: "guest" | "member" | undefined;
1476
+ agents?: number | undefined;
1477
+ };
1478
+ }>, z.ZodObject<{
1479
+ type: z.ZodLiteral<"room.lock_changed">;
1480
+ payload: z.ZodObject<{
1481
+ locked: z.ZodBoolean;
1482
+ }, "strip", z.ZodTypeAny, {
1483
+ locked: boolean;
1484
+ }, {
1485
+ locked: boolean;
1486
+ }>;
1487
+ }, "strip", z.ZodTypeAny, {
1488
+ type: "room.lock_changed";
1489
+ payload: {
1490
+ locked: boolean;
1491
+ };
1492
+ }, {
1493
+ type: "room.lock_changed";
1494
+ payload: {
1495
+ locked: boolean;
1496
+ };
1497
+ }>, z.ZodObject<{
1498
+ type: z.ZodLiteral<"participant.mute_changed">;
1499
+ payload: z.ZodObject<{
1500
+ participantId: z.ZodString;
1501
+ muted: z.ZodBoolean;
1502
+ }, "strip", z.ZodTypeAny, {
1503
+ participantId: string;
1504
+ muted: boolean;
1505
+ }, {
1506
+ participantId: string;
1507
+ muted: boolean;
1508
+ }>;
1509
+ }, "strip", z.ZodTypeAny, {
1510
+ type: "participant.mute_changed";
1511
+ payload: {
1512
+ participantId: string;
1513
+ muted: boolean;
1514
+ };
1515
+ }, {
1516
+ type: "participant.mute_changed";
1517
+ payload: {
1518
+ participantId: string;
1519
+ muted: boolean;
1520
+ };
1521
+ }>, z.ZodObject<{
1522
+ type: z.ZodLiteral<"participant.role_changed">;
1523
+ payload: z.ZodObject<{
1524
+ participantId: z.ZodString;
1525
+ role: z.ZodEnum<["guest", "member", "controller"]>;
1526
+ previousRole: z.ZodEnum<["guest", "member", "controller"]>;
1527
+ }, "strip", z.ZodTypeAny, {
1528
+ participantId: string;
1529
+ role: "controller" | "guest" | "member";
1530
+ previousRole: "controller" | "guest" | "member";
1531
+ }, {
1532
+ participantId: string;
1533
+ role: "controller" | "guest" | "member";
1534
+ previousRole: "controller" | "guest" | "member";
1535
+ }>;
1536
+ }, "strip", z.ZodTypeAny, {
1537
+ type: "participant.role_changed";
1538
+ payload: {
1539
+ participantId: string;
1540
+ role: "controller" | "guest" | "member";
1541
+ previousRole: "controller" | "guest" | "member";
1542
+ };
1543
+ }, {
1544
+ type: "participant.role_changed";
1545
+ payload: {
1546
+ participantId: string;
1547
+ role: "controller" | "guest" | "member";
1548
+ previousRole: "controller" | "guest" | "member";
1549
+ };
1550
+ }>, z.ZodObject<{
1551
+ type: z.ZodLiteral<"conversation.turn_changed">;
1552
+ payload: z.ZodObject<{
1553
+ action: z.ZodEnum<["claimed", "working", "passed", "skipped", "cancelled", "mode"]>;
1554
+ requestIds: z.ZodArray<z.ZodString, "many">;
1555
+ participantIds: z.ZodArray<z.ZodString, "many">;
1556
+ mode: z.ZodEnum<["sequential", "parallel"]>;
1557
+ }, "strip", z.ZodTypeAny, {
1558
+ mode: "sequential" | "parallel";
1559
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1560
+ requestIds: string[];
1561
+ participantIds: string[];
1562
+ }, {
1563
+ mode: "sequential" | "parallel";
1564
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1565
+ requestIds: string[];
1566
+ participantIds: string[];
1567
+ }>;
1568
+ }, "strip", z.ZodTypeAny, {
1569
+ type: "conversation.turn_changed";
1570
+ payload: {
1571
+ mode: "sequential" | "parallel";
1572
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1573
+ requestIds: string[];
1574
+ participantIds: string[];
1575
+ };
1576
+ }, {
1577
+ type: "conversation.turn_changed";
1578
+ payload: {
1579
+ mode: "sequential" | "parallel";
1580
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
1581
+ requestIds: string[];
1582
+ participantIds: string[];
1583
+ };
1584
+ }>]>;
1585
+ export type EventBody = z.infer<typeof EventBody>;
1586
+ export type EventType = EventBody['type'];
1587
+ export declare const RoomEvent: z.ZodIntersection<z.ZodObject<{
1588
+ protocolVersion: z.ZodLiteral<1>;
1589
+ roomId: z.ZodString;
1590
+ seq: z.ZodNumber;
1591
+ eventId: z.ZodString;
1592
+ /** Null for events the server authored on its own behalf, such as expiry-driven closure. */
1593
+ senderId: z.ZodNullable<z.ZodString>;
1594
+ idempotencyKey: z.ZodNullable<z.ZodString>;
1595
+ /** A routing hint, not a private-message boundary: every member reads the whole transcript. */
1596
+ recipientId: z.ZodNullable<z.ZodString>;
1597
+ recipientIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1598
+ /** Preserves whether this group was addressed as all, including an untagged chat message. */
1599
+ allRecipients: z.ZodOptional<z.ZodBoolean>;
1600
+ replyTo: z.ZodNullable<z.ZodString>;
1601
+ /** A conversational follow-up; unlike replyTo, this does not complete a request. */
1602
+ quoteOf: z.ZodOptional<z.ZodString>;
1603
+ at: z.ZodNumber;
1604
+ }, "strip", z.ZodTypeAny, {
1605
+ at: number;
1606
+ eventId: string;
1607
+ protocolVersion: 1;
1608
+ roomId: string;
1609
+ seq: number;
1610
+ senderId: string | null;
1611
+ idempotencyKey: string | null;
1612
+ recipientId: string | null;
1613
+ replyTo: string | null;
1614
+ recipientIds?: string[] | undefined;
1615
+ allRecipients?: boolean | undefined;
1616
+ quoteOf?: string | undefined;
1617
+ }, {
1618
+ at: number;
1619
+ eventId: string;
1620
+ protocolVersion: 1;
1621
+ roomId: string;
1622
+ seq: number;
1623
+ senderId: string | null;
1624
+ idempotencyKey: string | null;
1625
+ recipientId: string | null;
1626
+ replyTo: string | null;
1627
+ recipientIds?: string[] | undefined;
1628
+ allRecipients?: boolean | undefined;
1629
+ quoteOf?: string | undefined;
1630
+ }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1631
+ type: z.ZodLiteral<"message">;
1632
+ payload: z.ZodObject<{
1633
+ text: z.ZodEffects<z.ZodString, string, string>;
1634
+ priority: z.ZodDefault<z.ZodEnum<["normal", "priority"]>>;
1635
+ responseStage: z.ZodOptional<z.ZodEnum<["progress", "final"]>>;
1636
+ }, "strip", z.ZodTypeAny, {
1637
+ text: string;
1638
+ priority: "normal" | "priority";
1639
+ responseStage?: "progress" | "final" | undefined;
1640
+ }, {
1641
+ text: string;
1642
+ priority?: "normal" | "priority" | undefined;
1643
+ responseStage?: "progress" | "final" | undefined;
1644
+ }>;
1645
+ }, "strip", z.ZodTypeAny, {
1646
+ type: "message";
1647
+ payload: {
1648
+ text: string;
1649
+ priority: "normal" | "priority";
1650
+ responseStage?: "progress" | "final" | undefined;
1651
+ };
1652
+ }, {
1653
+ type: "message";
1654
+ payload: {
1655
+ text: string;
1656
+ priority?: "normal" | "priority" | undefined;
1657
+ responseStage?: "progress" | "final" | undefined;
1658
+ };
1659
+ }>, z.ZodObject<{
1660
+ type: z.ZodLiteral<"message.received">;
1661
+ payload: z.ZodObject<{
1662
+ eventId: z.ZodString;
1663
+ stage: z.ZodOptional<z.ZodLiteral<"read">>;
1664
+ action: z.ZodOptional<z.ZodEnum<["working", "waiting", "no_action", "declined", "reply_pending", "done"]>>;
1665
+ reason: z.ZodOptional<z.ZodString>;
1666
+ responseEventId: z.ZodOptional<z.ZodString>;
1667
+ }, "strip", z.ZodTypeAny, {
1668
+ eventId: string;
1669
+ stage?: "read" | undefined;
1670
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
1671
+ reason?: string | undefined;
1672
+ responseEventId?: string | undefined;
1673
+ }, {
1674
+ eventId: string;
1675
+ stage?: "read" | undefined;
1676
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
1677
+ reason?: string | undefined;
1678
+ responseEventId?: string | undefined;
1679
+ }>;
1680
+ }, "strip", z.ZodTypeAny, {
1681
+ type: "message.received";
1682
+ payload: {
1683
+ eventId: string;
1684
+ stage?: "read" | undefined;
1685
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
1686
+ reason?: string | undefined;
1687
+ responseEventId?: string | undefined;
1688
+ };
1689
+ }, {
1690
+ type: "message.received";
1691
+ payload: {
1692
+ eventId: string;
1693
+ stage?: "read" | undefined;
1694
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
1695
+ reason?: string | undefined;
1696
+ responseEventId?: string | undefined;
1697
+ };
1698
+ }>, z.ZodObject<{
1699
+ type: z.ZodLiteral<"message.delivery_failed">;
1700
+ payload: z.ZodObject<{
1701
+ eventId: z.ZodString;
1702
+ reason: z.ZodString;
1703
+ stage: z.ZodOptional<z.ZodEnum<["delivery", "execution", "publishing"]>>;
1704
+ }, "strip", z.ZodTypeAny, {
1705
+ eventId: string;
1706
+ reason: string;
1707
+ stage?: "delivery" | "execution" | "publishing" | undefined;
1708
+ }, {
1709
+ eventId: string;
1710
+ reason: string;
1711
+ stage?: "delivery" | "execution" | "publishing" | undefined;
1712
+ }>;
1713
+ }, "strip", z.ZodTypeAny, {
1714
+ type: "message.delivery_failed";
1715
+ payload: {
1716
+ eventId: string;
1717
+ reason: string;
1718
+ stage?: "delivery" | "execution" | "publishing" | undefined;
1719
+ };
1720
+ }, {
1721
+ type: "message.delivery_failed";
1722
+ payload: {
1723
+ eventId: string;
1724
+ reason: string;
1725
+ stage?: "delivery" | "execution" | "publishing" | undefined;
1726
+ };
1727
+ }>, z.ZodObject<{
1728
+ type: z.ZodLiteral<"handover.offered">;
1729
+ payload: z.ZodObject<{
1730
+ handoverId: z.ZodString;
1731
+ revision: z.ZodNumber;
1732
+ document: z.ZodObject<{
1733
+ metadata: z.ZodObject<{
1734
+ goal: z.ZodString;
1735
+ recipient: z.ZodString;
1736
+ mode: z.ZodEnum<["sequential", "concurrent"]>;
1737
+ nextAction: z.ZodString;
1738
+ decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1739
+ blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1740
+ repository: z.ZodOptional<z.ZodObject<{
1741
+ remote: z.ZodOptional<z.ZodString>;
1742
+ branch: z.ZodString;
1743
+ commit: z.ZodString;
1744
+ worktreePath: z.ZodOptional<z.ZodString>;
1745
+ dirty: z.ZodBoolean;
1746
+ missingPaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1747
+ }, "strip", z.ZodTypeAny, {
1748
+ dirty: boolean;
1749
+ branch: string;
1750
+ commit: string;
1751
+ missingPaths: string[];
1752
+ remote?: string | undefined;
1753
+ worktreePath?: string | undefined;
1754
+ }, {
1755
+ dirty: boolean;
1756
+ branch: string;
1757
+ commit: string;
1758
+ remote?: string | undefined;
1759
+ worktreePath?: string | undefined;
1760
+ missingPaths?: string[] | undefined;
1761
+ }>>;
1762
+ tests: z.ZodOptional<z.ZodObject<{
1763
+ command: z.ZodString;
1764
+ result: z.ZodEnum<["passed", "failed", "not_run"]>;
1765
+ notes: z.ZodOptional<z.ZodString>;
1766
+ }, "strip", z.ZodTypeAny, {
1767
+ command: string;
1768
+ result: "passed" | "failed" | "not_run";
1769
+ notes?: string | undefined;
1770
+ }, {
1771
+ command: string;
1772
+ result: "passed" | "failed" | "not_run";
1773
+ notes?: string | undefined;
1774
+ }>>;
1775
+ }, "strip", z.ZodTypeAny, {
1776
+ mode: "sequential" | "concurrent";
1777
+ goal: string;
1778
+ recipient: string;
1779
+ nextAction: string;
1780
+ decisions: string[];
1781
+ blockers: string[];
1782
+ repository?: {
1783
+ dirty: boolean;
1784
+ branch: string;
1785
+ commit: string;
1786
+ missingPaths: string[];
1787
+ remote?: string | undefined;
1788
+ worktreePath?: string | undefined;
1789
+ } | undefined;
1790
+ tests?: {
1791
+ command: string;
1792
+ result: "passed" | "failed" | "not_run";
1793
+ notes?: string | undefined;
1794
+ } | undefined;
1795
+ }, {
1796
+ mode: "sequential" | "concurrent";
1797
+ goal: string;
1798
+ recipient: string;
1799
+ nextAction: string;
1800
+ decisions?: string[] | undefined;
1801
+ blockers?: string[] | undefined;
1802
+ repository?: {
1803
+ dirty: boolean;
1804
+ branch: string;
1805
+ commit: string;
1806
+ remote?: string | undefined;
1807
+ worktreePath?: string | undefined;
1808
+ missingPaths?: string[] | undefined;
1809
+ } | undefined;
1810
+ tests?: {
1811
+ command: string;
1812
+ result: "passed" | "failed" | "not_run";
1813
+ notes?: string | undefined;
1814
+ } | undefined;
1815
+ }>;
1816
+ body: z.ZodString;
1817
+ }, "strip", z.ZodTypeAny, {
1818
+ metadata: {
1819
+ mode: "sequential" | "concurrent";
1820
+ goal: string;
1821
+ recipient: string;
1822
+ nextAction: string;
1823
+ decisions: string[];
1824
+ blockers: string[];
1825
+ repository?: {
1826
+ dirty: boolean;
1827
+ branch: string;
1828
+ commit: string;
1829
+ missingPaths: string[];
1830
+ remote?: string | undefined;
1831
+ worktreePath?: string | undefined;
1832
+ } | undefined;
1833
+ tests?: {
1834
+ command: string;
1835
+ result: "passed" | "failed" | "not_run";
1836
+ notes?: string | undefined;
1837
+ } | undefined;
1838
+ };
1839
+ body: string;
1840
+ }, {
1841
+ metadata: {
1842
+ mode: "sequential" | "concurrent";
1843
+ goal: string;
1844
+ recipient: string;
1845
+ nextAction: string;
1846
+ decisions?: string[] | undefined;
1847
+ blockers?: string[] | undefined;
1848
+ repository?: {
1849
+ dirty: boolean;
1850
+ branch: string;
1851
+ commit: string;
1852
+ remote?: string | undefined;
1853
+ worktreePath?: string | undefined;
1854
+ missingPaths?: string[] | undefined;
1855
+ } | undefined;
1856
+ tests?: {
1857
+ command: string;
1858
+ result: "passed" | "failed" | "not_run";
1859
+ notes?: string | undefined;
1860
+ } | undefined;
1861
+ };
1862
+ body: string;
1863
+ }>;
1864
+ }, "strip", z.ZodTypeAny, {
1865
+ handoverId: string;
1866
+ revision: number;
1867
+ document: {
1868
+ metadata: {
1869
+ mode: "sequential" | "concurrent";
1870
+ goal: string;
1871
+ recipient: string;
1872
+ nextAction: string;
1873
+ decisions: string[];
1874
+ blockers: string[];
1875
+ repository?: {
1876
+ dirty: boolean;
1877
+ branch: string;
1878
+ commit: string;
1879
+ missingPaths: string[];
1880
+ remote?: string | undefined;
1881
+ worktreePath?: string | undefined;
1882
+ } | undefined;
1883
+ tests?: {
1884
+ command: string;
1885
+ result: "passed" | "failed" | "not_run";
1886
+ notes?: string | undefined;
1887
+ } | undefined;
1888
+ };
1889
+ body: string;
1890
+ };
1891
+ }, {
1892
+ handoverId: string;
1893
+ revision: number;
1894
+ document: {
1895
+ metadata: {
1896
+ mode: "sequential" | "concurrent";
1897
+ goal: string;
1898
+ recipient: string;
1899
+ nextAction: string;
1900
+ decisions?: string[] | undefined;
1901
+ blockers?: string[] | undefined;
1902
+ repository?: {
1903
+ dirty: boolean;
1904
+ branch: string;
1905
+ commit: string;
1906
+ remote?: string | undefined;
1907
+ worktreePath?: string | undefined;
1908
+ missingPaths?: string[] | undefined;
1909
+ } | undefined;
1910
+ tests?: {
1911
+ command: string;
1912
+ result: "passed" | "failed" | "not_run";
1913
+ notes?: string | undefined;
1914
+ } | undefined;
1915
+ };
1916
+ body: string;
1917
+ };
1918
+ }>;
1919
+ }, "strip", z.ZodTypeAny, {
1920
+ type: "handover.offered";
1921
+ payload: {
1922
+ handoverId: string;
1923
+ revision: number;
1924
+ document: {
1925
+ metadata: {
1926
+ mode: "sequential" | "concurrent";
1927
+ goal: string;
1928
+ recipient: string;
1929
+ nextAction: string;
1930
+ decisions: string[];
1931
+ blockers: string[];
1932
+ repository?: {
1933
+ dirty: boolean;
1934
+ branch: string;
1935
+ commit: string;
1936
+ missingPaths: string[];
1937
+ remote?: string | undefined;
1938
+ worktreePath?: string | undefined;
1939
+ } | undefined;
1940
+ tests?: {
1941
+ command: string;
1942
+ result: "passed" | "failed" | "not_run";
1943
+ notes?: string | undefined;
1944
+ } | undefined;
1945
+ };
1946
+ body: string;
1947
+ };
1948
+ };
1949
+ }, {
1950
+ type: "handover.offered";
1951
+ payload: {
1952
+ handoverId: string;
1953
+ revision: number;
1954
+ document: {
1955
+ metadata: {
1956
+ mode: "sequential" | "concurrent";
1957
+ goal: string;
1958
+ recipient: string;
1959
+ nextAction: string;
1960
+ decisions?: string[] | undefined;
1961
+ blockers?: string[] | undefined;
1962
+ repository?: {
1963
+ dirty: boolean;
1964
+ branch: string;
1965
+ commit: string;
1966
+ remote?: string | undefined;
1967
+ worktreePath?: string | undefined;
1968
+ missingPaths?: string[] | undefined;
1969
+ } | undefined;
1970
+ tests?: {
1971
+ command: string;
1972
+ result: "passed" | "failed" | "not_run";
1973
+ notes?: string | undefined;
1974
+ } | undefined;
1975
+ };
1976
+ body: string;
1977
+ };
1978
+ };
1979
+ }>, z.ZodObject<{
1980
+ type: z.ZodLiteral<"handover.accepted">;
1981
+ payload: z.ZodObject<{
1982
+ handoverId: z.ZodString;
1983
+ revision: z.ZodNumber;
1984
+ note: z.ZodOptional<z.ZodString>;
1985
+ }, "strip", z.ZodTypeAny, {
1986
+ handoverId: string;
1987
+ revision: number;
1988
+ note?: string | undefined;
1989
+ }, {
1990
+ handoverId: string;
1991
+ revision: number;
1992
+ note?: string | undefined;
1993
+ }>;
1994
+ }, "strip", z.ZodTypeAny, {
1995
+ type: "handover.accepted";
1996
+ payload: {
1997
+ handoverId: string;
1998
+ revision: number;
1999
+ note?: string | undefined;
2000
+ };
2001
+ }, {
2002
+ type: "handover.accepted";
2003
+ payload: {
2004
+ handoverId: string;
2005
+ revision: number;
2006
+ note?: string | undefined;
2007
+ };
2008
+ }>, z.ZodObject<{
2009
+ type: z.ZodLiteral<"handover.declined">;
2010
+ payload: z.ZodObject<{
2011
+ handoverId: z.ZodString;
2012
+ revision: z.ZodNumber;
2013
+ reason: z.ZodOptional<z.ZodString>;
2014
+ }, "strip", z.ZodTypeAny, {
2015
+ handoverId: string;
2016
+ revision: number;
2017
+ reason?: string | undefined;
2018
+ }, {
2019
+ handoverId: string;
2020
+ revision: number;
2021
+ reason?: string | undefined;
2022
+ }>;
2023
+ }, "strip", z.ZodTypeAny, {
2024
+ type: "handover.declined";
2025
+ payload: {
2026
+ handoverId: string;
2027
+ revision: number;
2028
+ reason?: string | undefined;
2029
+ };
2030
+ }, {
2031
+ type: "handover.declined";
2032
+ payload: {
2033
+ handoverId: string;
2034
+ revision: number;
2035
+ reason?: string | undefined;
2036
+ };
2037
+ }>, z.ZodObject<{
2038
+ type: z.ZodLiteral<"participant.joined">;
2039
+ payload: z.ZodObject<{
2040
+ participantId: z.ZodString;
2041
+ displayName: z.ZodString;
2042
+ kind: z.ZodEnum<["agent", "human"]>;
2043
+ role: z.ZodEnum<["guest", "member", "controller"]>;
2044
+ capabilities: z.ZodOptional<z.ZodObject<{
2045
+ /** The adapter can deliver an unsolicited message into a running session. */
2046
+ deliverUnsolicited: z.ZodDefault<z.ZodBoolean>;
2047
+ /** The adapter can end the model's current turn on request. */
2048
+ cancelTurn: z.ZodDefault<z.ZodBoolean>;
2049
+ /** The adapter can stop a tool the session is currently running. */
2050
+ cancelTool: z.ZodDefault<z.ZodBoolean>;
2051
+ runtime: z.ZodOptional<z.ZodString>;
2052
+ runtimeVersion: z.ZodOptional<z.ZodString>;
2053
+ }, "strip", z.ZodTypeAny, {
2054
+ deliverUnsolicited: boolean;
2055
+ cancelTurn: boolean;
2056
+ cancelTool: boolean;
2057
+ runtime?: string | undefined;
2058
+ runtimeVersion?: string | undefined;
2059
+ }, {
2060
+ deliverUnsolicited?: boolean | undefined;
2061
+ cancelTurn?: boolean | undefined;
2062
+ cancelTool?: boolean | undefined;
2063
+ runtime?: string | undefined;
2064
+ runtimeVersion?: string | undefined;
2065
+ }>>;
2066
+ }, "strip", z.ZodTypeAny, {
2067
+ participantId: string;
2068
+ displayName: string;
2069
+ kind: "agent" | "human";
2070
+ role: "controller" | "guest" | "member";
2071
+ capabilities?: {
2072
+ deliverUnsolicited: boolean;
2073
+ cancelTurn: boolean;
2074
+ cancelTool: boolean;
2075
+ runtime?: string | undefined;
2076
+ runtimeVersion?: string | undefined;
2077
+ } | undefined;
2078
+ }, {
2079
+ participantId: string;
2080
+ displayName: string;
2081
+ kind: "agent" | "human";
2082
+ role: "controller" | "guest" | "member";
2083
+ capabilities?: {
2084
+ deliverUnsolicited?: boolean | undefined;
2085
+ cancelTurn?: boolean | undefined;
2086
+ cancelTool?: boolean | undefined;
2087
+ runtime?: string | undefined;
2088
+ runtimeVersion?: string | undefined;
2089
+ } | undefined;
2090
+ }>;
2091
+ }, "strip", z.ZodTypeAny, {
2092
+ type: "participant.joined";
2093
+ payload: {
2094
+ participantId: string;
2095
+ displayName: string;
2096
+ kind: "agent" | "human";
2097
+ role: "controller" | "guest" | "member";
2098
+ capabilities?: {
2099
+ deliverUnsolicited: boolean;
2100
+ cancelTurn: boolean;
2101
+ cancelTool: boolean;
2102
+ runtime?: string | undefined;
2103
+ runtimeVersion?: string | undefined;
2104
+ } | undefined;
2105
+ };
2106
+ }, {
2107
+ type: "participant.joined";
2108
+ payload: {
2109
+ participantId: string;
2110
+ displayName: string;
2111
+ kind: "agent" | "human";
2112
+ role: "controller" | "guest" | "member";
2113
+ capabilities?: {
2114
+ deliverUnsolicited?: boolean | undefined;
2115
+ cancelTurn?: boolean | undefined;
2116
+ cancelTool?: boolean | undefined;
2117
+ runtime?: string | undefined;
2118
+ runtimeVersion?: string | undefined;
2119
+ } | undefined;
2120
+ };
2121
+ }>, z.ZodObject<{
2122
+ type: z.ZodLiteral<"participant.renamed">;
2123
+ payload: z.ZodObject<{
2124
+ participantId: z.ZodString;
2125
+ previousName: z.ZodString;
2126
+ name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
2127
+ source: z.ZodEnum<["profile", "room"]>;
2128
+ }, "strip", z.ZodTypeAny, {
2129
+ name: string;
2130
+ source: "profile" | "room";
2131
+ participantId: string;
2132
+ previousName: string;
2133
+ }, {
2134
+ name: string;
2135
+ source: "profile" | "room";
2136
+ participantId: string;
2137
+ previousName: string;
2138
+ }>;
2139
+ }, "strip", z.ZodTypeAny, {
2140
+ type: "participant.renamed";
2141
+ payload: {
2142
+ name: string;
2143
+ source: "profile" | "room";
2144
+ participantId: string;
2145
+ previousName: string;
2146
+ };
2147
+ }, {
2148
+ type: "participant.renamed";
2149
+ payload: {
2150
+ name: string;
2151
+ source: "profile" | "room";
2152
+ participantId: string;
2153
+ previousName: string;
2154
+ };
2155
+ }>, z.ZodObject<{
2156
+ type: z.ZodLiteral<"participant.left">;
2157
+ payload: z.ZodObject<{
2158
+ participantId: z.ZodString;
2159
+ }, "strip", z.ZodTypeAny, {
2160
+ participantId: string;
2161
+ }, {
2162
+ participantId: string;
2163
+ }>;
2164
+ }, "strip", z.ZodTypeAny, {
2165
+ type: "participant.left";
2166
+ payload: {
2167
+ participantId: string;
2168
+ };
2169
+ }, {
2170
+ type: "participant.left";
2171
+ payload: {
2172
+ participantId: string;
2173
+ };
2174
+ }>, z.ZodObject<{
2175
+ type: z.ZodLiteral<"participant.revoked">;
2176
+ payload: z.ZodObject<{
2177
+ participantId: z.ZodString;
2178
+ }, "strip", z.ZodTypeAny, {
2179
+ participantId: string;
2180
+ }, {
2181
+ participantId: string;
2182
+ }>;
2183
+ }, "strip", z.ZodTypeAny, {
2184
+ type: "participant.revoked";
2185
+ payload: {
2186
+ participantId: string;
2187
+ };
2188
+ }, {
2189
+ type: "participant.revoked";
2190
+ payload: {
2191
+ participantId: string;
2192
+ };
2193
+ }>, z.ZodObject<{
2194
+ type: z.ZodLiteral<"control.pause">;
2195
+ payload: z.ZodObject<{
2196
+ targetParticipantId: z.ZodString;
2197
+ revision: z.ZodNumber;
2198
+ reason: z.ZodOptional<z.ZodString>;
2199
+ interrupt: z.ZodOptional<z.ZodBoolean>;
2200
+ }, "strip", z.ZodTypeAny, {
2201
+ revision: number;
2202
+ targetParticipantId: string;
2203
+ reason?: string | undefined;
2204
+ interrupt?: boolean | undefined;
2205
+ }, {
2206
+ revision: number;
2207
+ targetParticipantId: string;
2208
+ reason?: string | undefined;
2209
+ interrupt?: boolean | undefined;
2210
+ }>;
2211
+ }, "strip", z.ZodTypeAny, {
2212
+ type: "control.pause";
2213
+ payload: {
2214
+ revision: number;
2215
+ targetParticipantId: string;
2216
+ reason?: string | undefined;
2217
+ interrupt?: boolean | undefined;
2218
+ };
2219
+ }, {
2220
+ type: "control.pause";
2221
+ payload: {
2222
+ revision: number;
2223
+ targetParticipantId: string;
2224
+ reason?: string | undefined;
2225
+ interrupt?: boolean | undefined;
2226
+ };
2227
+ }>, z.ZodObject<{
2228
+ type: z.ZodLiteral<"control.resume">;
2229
+ payload: z.ZodObject<{
2230
+ targetParticipantId: z.ZodString;
2231
+ revision: z.ZodNumber;
2232
+ }, "strip", z.ZodTypeAny, {
2233
+ revision: number;
2234
+ targetParticipantId: string;
2235
+ }, {
2236
+ revision: number;
2237
+ targetParticipantId: string;
2238
+ }>;
2239
+ }, "strip", z.ZodTypeAny, {
2240
+ type: "control.resume";
2241
+ payload: {
2242
+ revision: number;
2243
+ targetParticipantId: string;
2244
+ };
2245
+ }, {
2246
+ type: "control.resume";
2247
+ payload: {
2248
+ revision: number;
2249
+ targetParticipantId: string;
2250
+ };
2251
+ }>, z.ZodObject<{
2252
+ type: z.ZodLiteral<"control.ack">;
2253
+ payload: z.ZodObject<{
2254
+ targetParticipantId: z.ZodString;
2255
+ revision: z.ZodNumber;
2256
+ outcome: z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>;
2257
+ detail: z.ZodOptional<z.ZodString>;
2258
+ }, "strip", z.ZodTypeAny, {
2259
+ revision: number;
2260
+ targetParticipantId: string;
2261
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
2262
+ detail?: string | undefined;
2263
+ }, {
2264
+ revision: number;
2265
+ targetParticipantId: string;
2266
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
2267
+ detail?: string | undefined;
2268
+ }>;
2269
+ }, "strip", z.ZodTypeAny, {
2270
+ type: "control.ack";
2271
+ payload: {
2272
+ revision: number;
2273
+ targetParticipantId: string;
2274
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
2275
+ detail?: string | undefined;
2276
+ };
2277
+ }, {
2278
+ type: "control.ack";
2279
+ payload: {
2280
+ revision: number;
2281
+ targetParticipantId: string;
2282
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
2283
+ detail?: string | undefined;
2284
+ };
2285
+ }>, z.ZodObject<{
2286
+ type: z.ZodLiteral<"room.closed">;
2287
+ payload: z.ZodObject<{
2288
+ exportWindowEndsAt: z.ZodNumber;
2289
+ reason: z.ZodOptional<z.ZodEnum<["manual", "inactivity", "age", "agents_and_guests_left"]>>;
2290
+ }, "strip", z.ZodTypeAny, {
2291
+ exportWindowEndsAt: number;
2292
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
2293
+ }, {
2294
+ exportWindowEndsAt: number;
2295
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
2296
+ }>;
2297
+ }, "strip", z.ZodTypeAny, {
2298
+ type: "room.closed";
2299
+ payload: {
2300
+ exportWindowEndsAt: number;
2301
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
2302
+ };
2303
+ }, {
2304
+ type: "room.closed";
2305
+ payload: {
2306
+ exportWindowEndsAt: number;
2307
+ reason?: "inactivity" | "age" | "agents_and_guests_left" | "manual" | undefined;
2308
+ };
2309
+ }>, z.ZodObject<{
2310
+ type: z.ZodLiteral<"room.auto_close_changed">;
2311
+ payload: z.ZodObject<{
2312
+ autoClose: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2313
+ mode: z.ZodLiteral<"off">;
2314
+ }, "strip", z.ZodTypeAny, {
2315
+ mode: "off";
2316
+ }, {
2317
+ mode: "off";
2318
+ }>, z.ZodObject<{
2319
+ mode: z.ZodLiteral<"inactivity">;
2320
+ afterMs: z.ZodNumber;
2321
+ }, "strip", z.ZodTypeAny, {
2322
+ mode: "inactivity";
2323
+ afterMs: number;
2324
+ }, {
2325
+ mode: "inactivity";
2326
+ afterMs: number;
2327
+ }>, z.ZodObject<{
2328
+ mode: z.ZodLiteral<"age">;
2329
+ afterMs: z.ZodNumber;
2330
+ }, "strip", z.ZodTypeAny, {
2331
+ mode: "age";
2332
+ afterMs: number;
2333
+ }, {
2334
+ mode: "age";
2335
+ afterMs: number;
2336
+ }>, z.ZodObject<{
2337
+ mode: z.ZodLiteral<"agents_and_guests_left">;
2338
+ }, "strip", z.ZodTypeAny, {
2339
+ mode: "agents_and_guests_left";
2340
+ }, {
2341
+ mode: "agents_and_guests_left";
2342
+ }>]>;
2343
+ previous: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
2344
+ mode: z.ZodLiteral<"off">;
2345
+ }, "strip", z.ZodTypeAny, {
2346
+ mode: "off";
2347
+ }, {
2348
+ mode: "off";
2349
+ }>, z.ZodObject<{
2350
+ mode: z.ZodLiteral<"inactivity">;
2351
+ afterMs: z.ZodNumber;
2352
+ }, "strip", z.ZodTypeAny, {
2353
+ mode: "inactivity";
2354
+ afterMs: number;
2355
+ }, {
2356
+ mode: "inactivity";
2357
+ afterMs: number;
2358
+ }>, z.ZodObject<{
2359
+ mode: z.ZodLiteral<"age">;
2360
+ afterMs: z.ZodNumber;
2361
+ }, "strip", z.ZodTypeAny, {
2362
+ mode: "age";
2363
+ afterMs: number;
2364
+ }, {
2365
+ mode: "age";
2366
+ afterMs: number;
2367
+ }>, z.ZodObject<{
2368
+ mode: z.ZodLiteral<"agents_and_guests_left">;
2369
+ }, "strip", z.ZodTypeAny, {
2370
+ mode: "agents_and_guests_left";
2371
+ }, {
2372
+ mode: "agents_and_guests_left";
2373
+ }>]>;
2374
+ }, "strip", z.ZodTypeAny, {
2375
+ autoClose: {
2376
+ mode: "off";
2377
+ } | {
2378
+ mode: "inactivity";
2379
+ afterMs: number;
2380
+ } | {
2381
+ mode: "age";
2382
+ afterMs: number;
2383
+ } | {
2384
+ mode: "agents_and_guests_left";
2385
+ };
2386
+ previous: {
2387
+ mode: "off";
2388
+ } | {
2389
+ mode: "inactivity";
2390
+ afterMs: number;
2391
+ } | {
2392
+ mode: "age";
2393
+ afterMs: number;
2394
+ } | {
2395
+ mode: "agents_and_guests_left";
2396
+ };
2397
+ }, {
2398
+ autoClose: {
2399
+ mode: "off";
2400
+ } | {
2401
+ mode: "inactivity";
2402
+ afterMs: number;
2403
+ } | {
2404
+ mode: "age";
2405
+ afterMs: number;
2406
+ } | {
2407
+ mode: "agents_and_guests_left";
2408
+ };
2409
+ previous: {
2410
+ mode: "off";
2411
+ } | {
2412
+ mode: "inactivity";
2413
+ afterMs: number;
2414
+ } | {
2415
+ mode: "age";
2416
+ afterMs: number;
2417
+ } | {
2418
+ mode: "agents_and_guests_left";
2419
+ };
2420
+ }>;
2421
+ }, "strip", z.ZodTypeAny, {
2422
+ type: "room.auto_close_changed";
2423
+ payload: {
2424
+ autoClose: {
2425
+ mode: "off";
2426
+ } | {
2427
+ mode: "inactivity";
2428
+ afterMs: number;
2429
+ } | {
2430
+ mode: "age";
2431
+ afterMs: number;
2432
+ } | {
2433
+ mode: "agents_and_guests_left";
2434
+ };
2435
+ previous: {
2436
+ mode: "off";
2437
+ } | {
2438
+ mode: "inactivity";
2439
+ afterMs: number;
2440
+ } | {
2441
+ mode: "age";
2442
+ afterMs: number;
2443
+ } | {
2444
+ mode: "agents_and_guests_left";
2445
+ };
2446
+ };
2447
+ }, {
2448
+ type: "room.auto_close_changed";
2449
+ payload: {
2450
+ autoClose: {
2451
+ mode: "off";
2452
+ } | {
2453
+ mode: "inactivity";
2454
+ afterMs: number;
2455
+ } | {
2456
+ mode: "age";
2457
+ afterMs: number;
2458
+ } | {
2459
+ mode: "agents_and_guests_left";
2460
+ };
2461
+ previous: {
2462
+ mode: "off";
2463
+ } | {
2464
+ mode: "inactivity";
2465
+ afterMs: number;
2466
+ } | {
2467
+ mode: "age";
2468
+ afterMs: number;
2469
+ } | {
2470
+ mode: "agents_and_guests_left";
2471
+ };
2472
+ };
2473
+ }>, z.ZodObject<{
2474
+ type: z.ZodLiteral<"room.renamed">;
2475
+ payload: z.ZodObject<{
2476
+ name: z.ZodString;
2477
+ previousName: z.ZodString;
2478
+ }, "strip", z.ZodTypeAny, {
2479
+ name: string;
2480
+ previousName: string;
2481
+ }, {
2482
+ name: string;
2483
+ previousName: string;
2484
+ }>;
2485
+ }, "strip", z.ZodTypeAny, {
2486
+ type: "room.renamed";
2487
+ payload: {
2488
+ name: string;
2489
+ previousName: string;
2490
+ };
2491
+ }, {
2492
+ type: "room.renamed";
2493
+ payload: {
2494
+ name: string;
2495
+ previousName: string;
2496
+ };
2497
+ }>, z.ZodObject<{
2498
+ type: z.ZodLiteral<"room.expiry_changed">;
2499
+ payload: z.ZodObject<{
2500
+ expiresAt: z.ZodNullable<z.ZodNumber>;
2501
+ previousExpiresAt: z.ZodNullable<z.ZodNumber>;
2502
+ }, "strip", z.ZodTypeAny, {
2503
+ expiresAt: number | null;
2504
+ previousExpiresAt: number | null;
2505
+ }, {
2506
+ expiresAt: number | null;
2507
+ previousExpiresAt: number | null;
2508
+ }>;
2509
+ }, "strip", z.ZodTypeAny, {
2510
+ type: "room.expiry_changed";
2511
+ payload: {
2512
+ expiresAt: number | null;
2513
+ previousExpiresAt: number | null;
2514
+ };
2515
+ }, {
2516
+ type: "room.expiry_changed";
2517
+ payload: {
2518
+ expiresAt: number | null;
2519
+ previousExpiresAt: number | null;
2520
+ };
2521
+ }>, z.ZodObject<{
2522
+ type: z.ZodLiteral<"room.access_changed">;
2523
+ payload: z.ZodObject<{
2524
+ joinPolicy: z.ZodEnum<["invite_only", "open_to_guests"]>;
2525
+ inviteRole: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
2526
+ }, "strip", z.ZodTypeAny, {
2527
+ joinPolicy: "invite_only" | "open_to_guests";
2528
+ inviteRole?: "guest" | "member" | undefined;
2529
+ }, {
2530
+ joinPolicy: "invite_only" | "open_to_guests";
2531
+ inviteRole?: "guest" | "member" | undefined;
2532
+ }>;
2533
+ }, "strip", z.ZodTypeAny, {
2534
+ type: "room.access_changed";
2535
+ payload: {
2536
+ joinPolicy: "invite_only" | "open_to_guests";
2537
+ inviteRole?: "guest" | "member" | undefined;
2538
+ };
2539
+ }, {
2540
+ type: "room.access_changed";
2541
+ payload: {
2542
+ joinPolicy: "invite_only" | "open_to_guests";
2543
+ inviteRole?: "guest" | "member" | undefined;
2544
+ };
2545
+ }>, z.ZodObject<{
2546
+ type: z.ZodLiteral<"room.local_join_changed">;
2547
+ payload: z.ZodObject<{
2548
+ localJoin: z.ZodBoolean;
2549
+ }, "strip", z.ZodTypeAny, {
2550
+ localJoin: boolean;
2551
+ }, {
2552
+ localJoin: boolean;
2553
+ }>;
2554
+ }, "strip", z.ZodTypeAny, {
2555
+ type: "room.local_join_changed";
2556
+ payload: {
2557
+ localJoin: boolean;
2558
+ };
2559
+ }, {
2560
+ type: "room.local_join_changed";
2561
+ payload: {
2562
+ localJoin: boolean;
2563
+ };
2564
+ }>, z.ZodObject<{
2565
+ type: z.ZodLiteral<"room.invitation_changed">;
2566
+ payload: z.ZodObject<{
2567
+ handle: z.ZodString;
2568
+ state: z.ZodEnum<["invited", "withdrawn"]>;
2569
+ role: z.ZodOptional<z.ZodEnum<["member", "guest"]>>;
2570
+ agents: z.ZodOptional<z.ZodNumber>;
2571
+ }, "strip", z.ZodTypeAny, {
2572
+ handle: string;
2573
+ state: "invited" | "withdrawn";
2574
+ role?: "guest" | "member" | undefined;
2575
+ agents?: number | undefined;
2576
+ }, {
2577
+ handle: string;
2578
+ state: "invited" | "withdrawn";
2579
+ role?: "guest" | "member" | undefined;
2580
+ agents?: number | undefined;
2581
+ }>;
2582
+ }, "strip", z.ZodTypeAny, {
2583
+ type: "room.invitation_changed";
2584
+ payload: {
2585
+ handle: string;
2586
+ state: "invited" | "withdrawn";
2587
+ role?: "guest" | "member" | undefined;
2588
+ agents?: number | undefined;
2589
+ };
2590
+ }, {
2591
+ type: "room.invitation_changed";
2592
+ payload: {
2593
+ handle: string;
2594
+ state: "invited" | "withdrawn";
2595
+ role?: "guest" | "member" | undefined;
2596
+ agents?: number | undefined;
2597
+ };
2598
+ }>, z.ZodObject<{
2599
+ type: z.ZodLiteral<"room.lock_changed">;
2600
+ payload: z.ZodObject<{
2601
+ locked: z.ZodBoolean;
2602
+ }, "strip", z.ZodTypeAny, {
2603
+ locked: boolean;
2604
+ }, {
2605
+ locked: boolean;
2606
+ }>;
2607
+ }, "strip", z.ZodTypeAny, {
2608
+ type: "room.lock_changed";
2609
+ payload: {
2610
+ locked: boolean;
2611
+ };
2612
+ }, {
2613
+ type: "room.lock_changed";
2614
+ payload: {
2615
+ locked: boolean;
2616
+ };
2617
+ }>, z.ZodObject<{
2618
+ type: z.ZodLiteral<"participant.mute_changed">;
2619
+ payload: z.ZodObject<{
2620
+ participantId: z.ZodString;
2621
+ muted: z.ZodBoolean;
2622
+ }, "strip", z.ZodTypeAny, {
2623
+ participantId: string;
2624
+ muted: boolean;
2625
+ }, {
2626
+ participantId: string;
2627
+ muted: boolean;
2628
+ }>;
2629
+ }, "strip", z.ZodTypeAny, {
2630
+ type: "participant.mute_changed";
2631
+ payload: {
2632
+ participantId: string;
2633
+ muted: boolean;
2634
+ };
2635
+ }, {
2636
+ type: "participant.mute_changed";
2637
+ payload: {
2638
+ participantId: string;
2639
+ muted: boolean;
2640
+ };
2641
+ }>, z.ZodObject<{
2642
+ type: z.ZodLiteral<"participant.role_changed">;
2643
+ payload: z.ZodObject<{
2644
+ participantId: z.ZodString;
2645
+ role: z.ZodEnum<["guest", "member", "controller"]>;
2646
+ previousRole: z.ZodEnum<["guest", "member", "controller"]>;
2647
+ }, "strip", z.ZodTypeAny, {
2648
+ participantId: string;
2649
+ role: "controller" | "guest" | "member";
2650
+ previousRole: "controller" | "guest" | "member";
2651
+ }, {
2652
+ participantId: string;
2653
+ role: "controller" | "guest" | "member";
2654
+ previousRole: "controller" | "guest" | "member";
2655
+ }>;
2656
+ }, "strip", z.ZodTypeAny, {
2657
+ type: "participant.role_changed";
2658
+ payload: {
2659
+ participantId: string;
2660
+ role: "controller" | "guest" | "member";
2661
+ previousRole: "controller" | "guest" | "member";
2662
+ };
2663
+ }, {
2664
+ type: "participant.role_changed";
2665
+ payload: {
2666
+ participantId: string;
2667
+ role: "controller" | "guest" | "member";
2668
+ previousRole: "controller" | "guest" | "member";
2669
+ };
2670
+ }>, z.ZodObject<{
2671
+ type: z.ZodLiteral<"conversation.turn_changed">;
2672
+ payload: z.ZodObject<{
2673
+ action: z.ZodEnum<["claimed", "working", "passed", "skipped", "cancelled", "mode"]>;
2674
+ requestIds: z.ZodArray<z.ZodString, "many">;
2675
+ participantIds: z.ZodArray<z.ZodString, "many">;
2676
+ mode: z.ZodEnum<["sequential", "parallel"]>;
2677
+ }, "strip", z.ZodTypeAny, {
2678
+ mode: "sequential" | "parallel";
2679
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
2680
+ requestIds: string[];
2681
+ participantIds: string[];
2682
+ }, {
2683
+ mode: "sequential" | "parallel";
2684
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
2685
+ requestIds: string[];
2686
+ participantIds: string[];
2687
+ }>;
2688
+ }, "strip", z.ZodTypeAny, {
2689
+ type: "conversation.turn_changed";
2690
+ payload: {
2691
+ mode: "sequential" | "parallel";
2692
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
2693
+ requestIds: string[];
2694
+ participantIds: string[];
2695
+ };
2696
+ }, {
2697
+ type: "conversation.turn_changed";
2698
+ payload: {
2699
+ mode: "sequential" | "parallel";
2700
+ action: "mode" | "passed" | "working" | "claimed" | "skipped" | "cancelled";
2701
+ requestIds: string[];
2702
+ participantIds: string[];
2703
+ };
2704
+ }>]>>;
2705
+ export type RoomEvent = z.infer<typeof RoomEvent>;
2706
+ export declare const SendEventRequest: z.ZodIntersection<z.ZodObject<{
2707
+ idempotencyKey: z.ZodString;
2708
+ recipientId: z.ZodOptional<z.ZodString>;
2709
+ recipientIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2710
+ allRecipients: z.ZodOptional<z.ZodBoolean>;
2711
+ turnToken: z.ZodOptional<z.ZodString>;
2712
+ replyTo: z.ZodOptional<z.ZodString>;
2713
+ quoteOf: z.ZodOptional<z.ZodString>;
2714
+ }, "strip", z.ZodTypeAny, {
2715
+ idempotencyKey: string;
2716
+ recipientId?: string | undefined;
2717
+ recipientIds?: string[] | undefined;
2718
+ allRecipients?: boolean | undefined;
2719
+ replyTo?: string | undefined;
2720
+ quoteOf?: string | undefined;
2721
+ turnToken?: string | undefined;
2722
+ }, {
2723
+ idempotencyKey: string;
2724
+ recipientId?: string | undefined;
2725
+ recipientIds?: string[] | undefined;
2726
+ allRecipients?: boolean | undefined;
2727
+ replyTo?: string | undefined;
2728
+ quoteOf?: string | undefined;
2729
+ turnToken?: string | undefined;
2730
+ }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2731
+ type: z.ZodLiteral<"message">;
2732
+ payload: z.ZodObject<{
2733
+ text: z.ZodEffects<z.ZodString, string, string>;
2734
+ priority: z.ZodDefault<z.ZodEnum<["normal", "priority"]>>;
2735
+ responseStage: z.ZodOptional<z.ZodEnum<["progress", "final"]>>;
2736
+ }, "strip", z.ZodTypeAny, {
2737
+ text: string;
2738
+ priority: "normal" | "priority";
2739
+ responseStage?: "progress" | "final" | undefined;
2740
+ }, {
2741
+ text: string;
2742
+ priority?: "normal" | "priority" | undefined;
2743
+ responseStage?: "progress" | "final" | undefined;
2744
+ }>;
2745
+ }, "strip", z.ZodTypeAny, {
2746
+ type: "message";
2747
+ payload: {
2748
+ text: string;
2749
+ priority: "normal" | "priority";
2750
+ responseStage?: "progress" | "final" | undefined;
2751
+ };
2752
+ }, {
2753
+ type: "message";
2754
+ payload: {
2755
+ text: string;
2756
+ priority?: "normal" | "priority" | undefined;
2757
+ responseStage?: "progress" | "final" | undefined;
2758
+ };
2759
+ }>, z.ZodObject<{
2760
+ type: z.ZodLiteral<"message.received">;
2761
+ payload: z.ZodObject<{
2762
+ eventId: z.ZodString;
2763
+ stage: z.ZodOptional<z.ZodLiteral<"read">>;
2764
+ action: z.ZodOptional<z.ZodEnum<["working", "waiting", "no_action", "declined", "reply_pending", "done"]>>;
2765
+ reason: z.ZodOptional<z.ZodString>;
2766
+ responseEventId: z.ZodOptional<z.ZodString>;
2767
+ }, "strip", z.ZodTypeAny, {
2768
+ eventId: string;
2769
+ stage?: "read" | undefined;
2770
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
2771
+ reason?: string | undefined;
2772
+ responseEventId?: string | undefined;
2773
+ }, {
2774
+ eventId: string;
2775
+ stage?: "read" | undefined;
2776
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
2777
+ reason?: string | undefined;
2778
+ responseEventId?: string | undefined;
2779
+ }>;
2780
+ }, "strip", z.ZodTypeAny, {
2781
+ type: "message.received";
2782
+ payload: {
2783
+ eventId: string;
2784
+ stage?: "read" | undefined;
2785
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
2786
+ reason?: string | undefined;
2787
+ responseEventId?: string | undefined;
2788
+ };
2789
+ }, {
2790
+ type: "message.received";
2791
+ payload: {
2792
+ eventId: string;
2793
+ stage?: "read" | undefined;
2794
+ action?: "declined" | "working" | "waiting" | "no_action" | "reply_pending" | "done" | undefined;
2795
+ reason?: string | undefined;
2796
+ responseEventId?: string | undefined;
2797
+ };
2798
+ }>, z.ZodObject<{
2799
+ type: z.ZodLiteral<"message.delivery_failed">;
2800
+ payload: z.ZodObject<{
2801
+ eventId: z.ZodString;
2802
+ reason: z.ZodString;
2803
+ stage: z.ZodOptional<z.ZodEnum<["delivery", "execution", "publishing"]>>;
2804
+ }, "strip", z.ZodTypeAny, {
2805
+ eventId: string;
2806
+ reason: string;
2807
+ stage?: "delivery" | "execution" | "publishing" | undefined;
2808
+ }, {
2809
+ eventId: string;
2810
+ reason: string;
2811
+ stage?: "delivery" | "execution" | "publishing" | undefined;
2812
+ }>;
2813
+ }, "strip", z.ZodTypeAny, {
2814
+ type: "message.delivery_failed";
2815
+ payload: {
2816
+ eventId: string;
2817
+ reason: string;
2818
+ stage?: "delivery" | "execution" | "publishing" | undefined;
2819
+ };
2820
+ }, {
2821
+ type: "message.delivery_failed";
2822
+ payload: {
2823
+ eventId: string;
2824
+ reason: string;
2825
+ stage?: "delivery" | "execution" | "publishing" | undefined;
2826
+ };
2827
+ }>, z.ZodObject<{
2828
+ type: z.ZodLiteral<"handover.offered">;
2829
+ payload: z.ZodObject<{
2830
+ handoverId: z.ZodString;
2831
+ revision: z.ZodNumber;
2832
+ document: z.ZodObject<{
2833
+ metadata: z.ZodObject<{
2834
+ goal: z.ZodString;
2835
+ recipient: z.ZodString;
2836
+ mode: z.ZodEnum<["sequential", "concurrent"]>;
2837
+ nextAction: z.ZodString;
2838
+ decisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2839
+ blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2840
+ repository: z.ZodOptional<z.ZodObject<{
2841
+ remote: z.ZodOptional<z.ZodString>;
2842
+ branch: z.ZodString;
2843
+ commit: z.ZodString;
2844
+ worktreePath: z.ZodOptional<z.ZodString>;
2845
+ dirty: z.ZodBoolean;
2846
+ missingPaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2847
+ }, "strip", z.ZodTypeAny, {
2848
+ dirty: boolean;
2849
+ branch: string;
2850
+ commit: string;
2851
+ missingPaths: string[];
2852
+ remote?: string | undefined;
2853
+ worktreePath?: string | undefined;
2854
+ }, {
2855
+ dirty: boolean;
2856
+ branch: string;
2857
+ commit: string;
2858
+ remote?: string | undefined;
2859
+ worktreePath?: string | undefined;
2860
+ missingPaths?: string[] | undefined;
2861
+ }>>;
2862
+ tests: z.ZodOptional<z.ZodObject<{
2863
+ command: z.ZodString;
2864
+ result: z.ZodEnum<["passed", "failed", "not_run"]>;
2865
+ notes: z.ZodOptional<z.ZodString>;
2866
+ }, "strip", z.ZodTypeAny, {
2867
+ command: string;
2868
+ result: "passed" | "failed" | "not_run";
2869
+ notes?: string | undefined;
2870
+ }, {
2871
+ command: string;
2872
+ result: "passed" | "failed" | "not_run";
2873
+ notes?: string | undefined;
2874
+ }>>;
2875
+ }, "strip", z.ZodTypeAny, {
2876
+ mode: "sequential" | "concurrent";
2877
+ goal: string;
2878
+ recipient: string;
2879
+ nextAction: string;
2880
+ decisions: string[];
2881
+ blockers: string[];
2882
+ repository?: {
2883
+ dirty: boolean;
2884
+ branch: string;
2885
+ commit: string;
2886
+ missingPaths: string[];
2887
+ remote?: string | undefined;
2888
+ worktreePath?: string | undefined;
2889
+ } | undefined;
2890
+ tests?: {
2891
+ command: string;
2892
+ result: "passed" | "failed" | "not_run";
2893
+ notes?: string | undefined;
2894
+ } | undefined;
2895
+ }, {
2896
+ mode: "sequential" | "concurrent";
2897
+ goal: string;
2898
+ recipient: string;
2899
+ nextAction: string;
2900
+ decisions?: string[] | undefined;
2901
+ blockers?: string[] | undefined;
2902
+ repository?: {
2903
+ dirty: boolean;
2904
+ branch: string;
2905
+ commit: string;
2906
+ remote?: string | undefined;
2907
+ worktreePath?: string | undefined;
2908
+ missingPaths?: string[] | undefined;
2909
+ } | undefined;
2910
+ tests?: {
2911
+ command: string;
2912
+ result: "passed" | "failed" | "not_run";
2913
+ notes?: string | undefined;
2914
+ } | undefined;
2915
+ }>;
2916
+ body: z.ZodString;
2917
+ }, "strip", z.ZodTypeAny, {
2918
+ metadata: {
2919
+ mode: "sequential" | "concurrent";
2920
+ goal: string;
2921
+ recipient: string;
2922
+ nextAction: string;
2923
+ decisions: string[];
2924
+ blockers: string[];
2925
+ repository?: {
2926
+ dirty: boolean;
2927
+ branch: string;
2928
+ commit: string;
2929
+ missingPaths: string[];
2930
+ remote?: string | undefined;
2931
+ worktreePath?: string | undefined;
2932
+ } | undefined;
2933
+ tests?: {
2934
+ command: string;
2935
+ result: "passed" | "failed" | "not_run";
2936
+ notes?: string | undefined;
2937
+ } | undefined;
2938
+ };
2939
+ body: string;
2940
+ }, {
2941
+ metadata: {
2942
+ mode: "sequential" | "concurrent";
2943
+ goal: string;
2944
+ recipient: string;
2945
+ nextAction: string;
2946
+ decisions?: string[] | undefined;
2947
+ blockers?: string[] | undefined;
2948
+ repository?: {
2949
+ dirty: boolean;
2950
+ branch: string;
2951
+ commit: string;
2952
+ remote?: string | undefined;
2953
+ worktreePath?: string | undefined;
2954
+ missingPaths?: string[] | undefined;
2955
+ } | undefined;
2956
+ tests?: {
2957
+ command: string;
2958
+ result: "passed" | "failed" | "not_run";
2959
+ notes?: string | undefined;
2960
+ } | undefined;
2961
+ };
2962
+ body: string;
2963
+ }>;
2964
+ }, "strip", z.ZodTypeAny, {
2965
+ handoverId: string;
2966
+ revision: number;
2967
+ document: {
2968
+ metadata: {
2969
+ mode: "sequential" | "concurrent";
2970
+ goal: string;
2971
+ recipient: string;
2972
+ nextAction: string;
2973
+ decisions: string[];
2974
+ blockers: string[];
2975
+ repository?: {
2976
+ dirty: boolean;
2977
+ branch: string;
2978
+ commit: string;
2979
+ missingPaths: string[];
2980
+ remote?: string | undefined;
2981
+ worktreePath?: string | undefined;
2982
+ } | undefined;
2983
+ tests?: {
2984
+ command: string;
2985
+ result: "passed" | "failed" | "not_run";
2986
+ notes?: string | undefined;
2987
+ } | undefined;
2988
+ };
2989
+ body: string;
2990
+ };
2991
+ }, {
2992
+ handoverId: string;
2993
+ revision: number;
2994
+ document: {
2995
+ metadata: {
2996
+ mode: "sequential" | "concurrent";
2997
+ goal: string;
2998
+ recipient: string;
2999
+ nextAction: string;
3000
+ decisions?: string[] | undefined;
3001
+ blockers?: string[] | undefined;
3002
+ repository?: {
3003
+ dirty: boolean;
3004
+ branch: string;
3005
+ commit: string;
3006
+ remote?: string | undefined;
3007
+ worktreePath?: string | undefined;
3008
+ missingPaths?: string[] | undefined;
3009
+ } | undefined;
3010
+ tests?: {
3011
+ command: string;
3012
+ result: "passed" | "failed" | "not_run";
3013
+ notes?: string | undefined;
3014
+ } | undefined;
3015
+ };
3016
+ body: string;
3017
+ };
3018
+ }>;
3019
+ }, "strip", z.ZodTypeAny, {
3020
+ type: "handover.offered";
3021
+ payload: {
3022
+ handoverId: string;
3023
+ revision: number;
3024
+ document: {
3025
+ metadata: {
3026
+ mode: "sequential" | "concurrent";
3027
+ goal: string;
3028
+ recipient: string;
3029
+ nextAction: string;
3030
+ decisions: string[];
3031
+ blockers: string[];
3032
+ repository?: {
3033
+ dirty: boolean;
3034
+ branch: string;
3035
+ commit: string;
3036
+ missingPaths: string[];
3037
+ remote?: string | undefined;
3038
+ worktreePath?: string | undefined;
3039
+ } | undefined;
3040
+ tests?: {
3041
+ command: string;
3042
+ result: "passed" | "failed" | "not_run";
3043
+ notes?: string | undefined;
3044
+ } | undefined;
3045
+ };
3046
+ body: string;
3047
+ };
3048
+ };
3049
+ }, {
3050
+ type: "handover.offered";
3051
+ payload: {
3052
+ handoverId: string;
3053
+ revision: number;
3054
+ document: {
3055
+ metadata: {
3056
+ mode: "sequential" | "concurrent";
3057
+ goal: string;
3058
+ recipient: string;
3059
+ nextAction: string;
3060
+ decisions?: string[] | undefined;
3061
+ blockers?: string[] | undefined;
3062
+ repository?: {
3063
+ dirty: boolean;
3064
+ branch: string;
3065
+ commit: string;
3066
+ remote?: string | undefined;
3067
+ worktreePath?: string | undefined;
3068
+ missingPaths?: string[] | undefined;
3069
+ } | undefined;
3070
+ tests?: {
3071
+ command: string;
3072
+ result: "passed" | "failed" | "not_run";
3073
+ notes?: string | undefined;
3074
+ } | undefined;
3075
+ };
3076
+ body: string;
3077
+ };
3078
+ };
3079
+ }>, z.ZodObject<{
3080
+ type: z.ZodLiteral<"handover.accepted">;
3081
+ payload: z.ZodObject<{
3082
+ handoverId: z.ZodString;
3083
+ revision: z.ZodNumber;
3084
+ note: z.ZodOptional<z.ZodString>;
3085
+ }, "strip", z.ZodTypeAny, {
3086
+ handoverId: string;
3087
+ revision: number;
3088
+ note?: string | undefined;
3089
+ }, {
3090
+ handoverId: string;
3091
+ revision: number;
3092
+ note?: string | undefined;
3093
+ }>;
3094
+ }, "strip", z.ZodTypeAny, {
3095
+ type: "handover.accepted";
3096
+ payload: {
3097
+ handoverId: string;
3098
+ revision: number;
3099
+ note?: string | undefined;
3100
+ };
3101
+ }, {
3102
+ type: "handover.accepted";
3103
+ payload: {
3104
+ handoverId: string;
3105
+ revision: number;
3106
+ note?: string | undefined;
3107
+ };
3108
+ }>, z.ZodObject<{
3109
+ type: z.ZodLiteral<"handover.declined">;
3110
+ payload: z.ZodObject<{
3111
+ handoverId: z.ZodString;
3112
+ revision: z.ZodNumber;
3113
+ reason: z.ZodOptional<z.ZodString>;
3114
+ }, "strip", z.ZodTypeAny, {
3115
+ handoverId: string;
3116
+ revision: number;
3117
+ reason?: string | undefined;
3118
+ }, {
3119
+ handoverId: string;
3120
+ revision: number;
3121
+ reason?: string | undefined;
3122
+ }>;
3123
+ }, "strip", z.ZodTypeAny, {
3124
+ type: "handover.declined";
3125
+ payload: {
3126
+ handoverId: string;
3127
+ revision: number;
3128
+ reason?: string | undefined;
3129
+ };
3130
+ }, {
3131
+ type: "handover.declined";
3132
+ payload: {
3133
+ handoverId: string;
3134
+ revision: number;
3135
+ reason?: string | undefined;
3136
+ };
3137
+ }>, z.ZodObject<{
3138
+ type: z.ZodLiteral<"control.ack">;
3139
+ payload: z.ZodObject<{
3140
+ targetParticipantId: z.ZodString;
3141
+ revision: z.ZodNumber;
3142
+ outcome: z.ZodEnum<["pause_requested", "paused_between_turns", "current_turn_cancelled", "tool_cancellation_unknown", "resumed", "unsupported", "disconnected"]>;
3143
+ detail: z.ZodOptional<z.ZodString>;
3144
+ }, "strip", z.ZodTypeAny, {
3145
+ revision: number;
3146
+ targetParticipantId: string;
3147
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3148
+ detail?: string | undefined;
3149
+ }, {
3150
+ revision: number;
3151
+ targetParticipantId: string;
3152
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3153
+ detail?: string | undefined;
3154
+ }>;
3155
+ }, "strip", z.ZodTypeAny, {
3156
+ type: "control.ack";
3157
+ payload: {
3158
+ revision: number;
3159
+ targetParticipantId: string;
3160
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3161
+ detail?: string | undefined;
3162
+ };
3163
+ }, {
3164
+ type: "control.ack";
3165
+ payload: {
3166
+ revision: number;
3167
+ targetParticipantId: string;
3168
+ outcome: "pause_requested" | "paused_between_turns" | "current_turn_cancelled" | "tool_cancellation_unknown" | "resumed" | "unsupported" | "disconnected";
3169
+ detail?: string | undefined;
3170
+ };
3171
+ }>]>>;
3172
+ export type SendEventRequest = z.infer<typeof SendEventRequest>;
3173
+ export declare function isClientEventType(type: string): type is (typeof CLIENT_EVENT_TYPES)[number];
3174
+ /** Byte size the payload counts against room quota. */
3175
+ export declare function payloadBytes(event: Pick<RoomEvent, 'payload'>): number;
3176
+ export {};
3177
+ //# sourceMappingURL=events.d.ts.map