@joe-broadhead/messaging 0.7.1 → 0.9.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 (94) hide show
  1. package/CHANGELOG.md +364 -2
  2. package/dist/bin/messaging-mcp.js +5498 -4338
  3. package/dist/bin/messaging-relay.js +8626 -5540
  4. package/dist/bin/messaging.js +4492 -3158
  5. package/dist/bin/messagingd.js +19672 -12412
  6. package/dist/lib/modules/core/agent/operations.js +19 -327
  7. package/dist/lib/modules/core/agent/present.js +20 -55
  8. package/dist/lib/modules/core/agent-tools.js +35 -139
  9. package/dist/lib/modules/core/consent.js +54 -14
  10. package/dist/lib/modules/core/contact-card.js +3 -3
  11. package/dist/lib/modules/core/conversation/event.js +29 -4
  12. package/dist/lib/modules/core/conversation/guest-invitation.js +42 -0
  13. package/dist/lib/modules/core/conversation/log.js +287 -65
  14. package/dist/lib/modules/core/conversation/request-log.js +158 -0
  15. package/dist/lib/modules/core/conversation/request-seal.js +41 -0
  16. package/dist/lib/modules/core/conversation/requests.js +87 -0
  17. package/dist/lib/modules/core/conversation/seal.js +90 -37
  18. package/dist/lib/modules/core/conversation-agent-tools.js +69 -0
  19. package/dist/lib/modules/core/federation/directory-proof.js +83 -0
  20. package/dist/lib/modules/core/federation/proof-state.js +167 -0
  21. package/dist/lib/modules/core/federation/roster-proof.js +74 -0
  22. package/dist/lib/modules/core/index.js +9 -4
  23. package/dist/lib/modules/core/jelly-host.js +8 -5
  24. package/dist/lib/modules/core/schema/common.js +33 -5
  25. package/dist/lib/modules/core/schema/consent.js +23 -5
  26. package/dist/lib/modules/core/schema/contact-request.js +22 -0
  27. package/dist/lib/modules/core/schema/conv-frames.js +101 -0
  28. package/dist/lib/modules/core/schema/conversation.js +67 -33
  29. package/dist/lib/modules/core/schema/directory-frames.js +8 -3
  30. package/dist/lib/modules/core/schema/envelope.js +8 -24
  31. package/dist/lib/modules/core/schema/errors.js +7 -5
  32. package/dist/lib/modules/core/schema/guest-invitation.js +13 -0
  33. package/dist/lib/modules/core/schema/index.js +5 -0
  34. package/dist/lib/modules/core/schema/ipc/consent.js +97 -18
  35. package/dist/lib/modules/core/schema/ipc/conversation-views.js +87 -0
  36. package/dist/lib/modules/core/schema/ipc/conversations.js +132 -0
  37. package/dist/lib/modules/core/schema/ipc/device.js +9 -0
  38. package/dist/lib/modules/core/schema/ipc/jelly.js +17 -45
  39. package/dist/lib/modules/core/schema/ipc/shapes.js +74 -73
  40. package/dist/lib/modules/core/schema/ipc/surfaces.js +12 -195
  41. package/dist/lib/modules/core/schema/ipc/tasks.js +31 -0
  42. package/dist/lib/modules/core/schema/ipc.js +68 -46
  43. package/dist/lib/modules/core/testing.js +1 -1
  44. package/dist/lib/modules/core/version.js +1 -1
  45. package/dist/lib/modules/ipc/client.js +10 -2
  46. package/dist/lib/modules/ipc/server.js +14 -5
  47. package/dist/lib/modules/ipc/testing.js +13 -23
  48. package/dist/spec/messaging-v1.md +854 -445
  49. package/dist/third-party-notices.md +1 -1
  50. package/dist/third-party.json +1 -1
  51. package/dist/types/core/agent/operations.d.ts +5 -52
  52. package/dist/types/core/agent/present.d.ts +6 -21
  53. package/dist/types/core/agent-tools.d.ts +295 -442
  54. package/dist/types/core/consent.d.ts +30 -7
  55. package/dist/types/core/contact-card.d.ts +3 -3
  56. package/dist/types/core/conversation/event.d.ts +6 -6
  57. package/dist/types/core/conversation/guest-invitation.d.ts +8 -0
  58. package/dist/types/core/conversation/log.d.ts +28 -13
  59. package/dist/types/core/conversation/request-log.d.ts +24 -0
  60. package/dist/types/core/conversation/request-seal.d.ts +6 -0
  61. package/dist/types/core/conversation/requests.d.ts +14 -0
  62. package/dist/types/core/conversation/seal.d.ts +32 -9
  63. package/dist/types/core/conversation-agent-tools.d.ts +939 -0
  64. package/dist/types/core/federation/directory-proof.d.ts +8 -0
  65. package/dist/types/core/federation/proof-state.d.ts +114 -0
  66. package/dist/types/core/federation/roster-proof.d.ts +7 -0
  67. package/dist/types/core/index.d.ts +11 -6
  68. package/dist/types/core/jelly-host.d.ts +1 -1
  69. package/dist/types/core/schema/common.d.ts +33 -6
  70. package/dist/types/core/schema/consent.d.ts +29 -8
  71. package/dist/types/core/schema/contact-request.d.ts +264 -0
  72. package/dist/types/core/schema/conv-frames.d.ts +1204 -0
  73. package/dist/types/core/schema/conversation.d.ts +1410 -264
  74. package/dist/types/core/schema/directory-frames.d.ts +8 -3
  75. package/dist/types/core/schema/envelope.d.ts +85 -130
  76. package/dist/types/core/schema/errors.d.ts +5 -1
  77. package/dist/types/core/schema/guest-invitation.d.ts +51 -0
  78. package/dist/types/core/schema/index.d.ts +5 -0
  79. package/dist/types/core/schema/ipc/consent.d.ts +464 -62
  80. package/dist/types/core/schema/ipc/conversation-views.d.ts +1199 -0
  81. package/dist/types/core/schema/ipc/conversations.d.ts +4355 -0
  82. package/dist/types/core/schema/ipc/device.d.ts +10 -0
  83. package/dist/types/core/schema/ipc/jelly.d.ts +16 -111
  84. package/dist/types/core/schema/ipc/shapes.d.ts +211 -95
  85. package/dist/types/core/schema/ipc/surfaces.d.ts +26 -427
  86. package/dist/types/core/schema/ipc/tasks.d.ts +210 -0
  87. package/dist/types/core/schema/ipc.d.ts +3859 -890
  88. package/dist/types/core/schema/relay.d.ts +12 -4
  89. package/dist/types/core/testing.d.ts +1 -1
  90. package/dist/types/core/version.d.ts +1 -1
  91. package/dist/types/ipc/client.d.ts +4 -1
  92. package/dist/types/ipc/server.d.ts +16 -1
  93. package/dist/types/ipc/testing.d.ts +21 -8
  94. package/package.json +1 -1
@@ -21,8 +21,8 @@ export type ConvId = z.infer<typeof ConvId>;
21
21
  export declare const ConvKind: z.ZodEnum<{
22
22
  self: "self";
23
23
  channel: "channel";
24
- dm: "dm";
25
24
  group: "group";
25
+ dm: "dm";
26
26
  }>;
27
27
  export type ConvKind = z.infer<typeof ConvKind>;
28
28
  /** Channels only; every other kind is private. */
@@ -46,8 +46,8 @@ export declare const ConvRole: z.ZodEnum<{
46
46
  export type ConvRole = z.infer<typeof ConvRole>;
47
47
  /** Who may do a thing in a group or channel. */
48
48
  export declare const Permit: z.ZodEnum<{
49
- all: "all";
50
49
  admins: "admins";
50
+ all: "all";
51
51
  }>;
52
52
  export type Permit = z.infer<typeof Permit>;
53
53
  /** Which mentions wake a seated agent: its own person's, any member's (under consent), or none. */
@@ -73,6 +73,34 @@ export declare const RekeyCause: z.ZodEnum<{
73
73
  schedule: "schedule";
74
74
  }>;
75
75
  export type RekeyCause = z.infer<typeof RekeyCause>;
76
+ /** An outside channel a person may link as an alias of themselves. Telegram first, then Slack. */
77
+ export declare const LinkChannel: z.ZodEnum<{
78
+ telegram: "telegram";
79
+ slack: "slack";
80
+ }>;
81
+ export type LinkChannel = z.infer<typeof LinkChannel>;
82
+ /** What a linked channel may do: Jelly's `chat` and `view` action classes (spec §8.11), never more. */
83
+ export declare const LinkAuthority: z.ZodEnum<{
84
+ chat: "chat";
85
+ view: "view";
86
+ }>;
87
+ export type LinkAuthority = z.infer<typeof LinkAuthority>;
88
+ /** Who may mirror a conversation to a linked channel: nobody (the default), its owners and admins, or any member. */
89
+ export declare const BridgePolicy: z.ZodEnum<{
90
+ none: "none";
91
+ members: "members";
92
+ admins: "admins";
93
+ }>;
94
+ export type BridgePolicy = z.infer<typeof BridgePolicy>;
95
+ /** The kinds of a `self` conversation's `setting` op: the person's settings, which never expire (spec §16.3). */
96
+ export declare const SettingKind: z.ZodEnum<{
97
+ link: "link";
98
+ prefs: "prefs";
99
+ grant: "grant";
100
+ context: "context";
101
+ localRetention: "localRetention";
102
+ }>;
103
+ export type SettingKind = z.infer<typeof SettingKind>;
76
104
  /** A participant record as an op states it. `device` and `respondTo` are for agent participants only. */
77
105
  export declare const Seat: z.ZodObject<{
78
106
  p: z.ZodString;
@@ -95,8 +123,8 @@ export declare const ConvOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
95
123
  kind: z.ZodEnum<{
96
124
  self: "self";
97
125
  channel: "channel";
98
- dm: "dm";
99
126
  group: "group";
127
+ dm: "dm";
100
128
  }>;
101
129
  visibility: z.ZodOptional<z.ZodEnum<{
102
130
  public: "public";
@@ -124,18 +152,19 @@ export declare const ConvOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
124
152
  }>>;
125
153
  }, z.core.$strict>>;
126
154
  post: z.ZodOptional<z.ZodEnum<{
127
- all: "all";
128
155
  admins: "admins";
156
+ all: "all";
129
157
  }>>;
130
158
  invite: z.ZodOptional<z.ZodEnum<{
131
- all: "all";
132
159
  admins: "admins";
160
+ all: "all";
133
161
  }>>;
134
162
  pins: z.ZodOptional<z.ZodEnum<{
135
- all: "all";
136
163
  admins: "admins";
164
+ all: "all";
137
165
  }>>;
138
166
  sealedMeta: z.ZodOptional<z.ZodString>;
167
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
139
168
  }, z.core.$strict>, z.ZodObject<{
140
169
  op: z.ZodLiteral<"add">;
141
170
  participants: z.ZodArray<z.ZodObject<{
@@ -155,6 +184,112 @@ export declare const ConvOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
155
184
  }, z.core.$strict>>;
156
185
  }, z.core.$strict>, z.ZodObject<{
157
186
  op: z.ZodLiteral<"accept">;
187
+ invitation: z.ZodOptional<z.ZodObject<{
188
+ v: z.ZodLiteral<"messaging/1">;
189
+ realm: z.ZodString;
190
+ cid: z.ZodString;
191
+ id: z.ZodString;
192
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
193
+ inviter: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
194
+ by: z.ZodString;
195
+ head: z.ZodObject<{
196
+ seq: z.ZodNumber;
197
+ hash: z.ZodString;
198
+ }, z.core.$strict>;
199
+ issuedAt: z.ZodNumber;
200
+ expiresAt: z.ZodNumber;
201
+ kind: z.ZodEnum<{
202
+ channel: "channel";
203
+ group: "group";
204
+ }>;
205
+ history: z.ZodEnum<{
206
+ none: "none";
207
+ shared: "shared";
208
+ }>;
209
+ agentContext: z.ZodEnum<{
210
+ none: "none";
211
+ members: "members";
212
+ seats: "seats";
213
+ }>;
214
+ bridges: z.ZodEnum<{
215
+ none: "none";
216
+ members: "members";
217
+ admins: "admins";
218
+ }>;
219
+ audience: z.ZodArray<z.ZodObject<{
220
+ p: z.ZodString;
221
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
222
+ role: z.ZodEnum<{
223
+ admin: "admin";
224
+ member: "member";
225
+ owner: "owner";
226
+ guest: "guest";
227
+ }>;
228
+ state: z.ZodEnum<{
229
+ member: "member";
230
+ invited: "invited";
231
+ }>;
232
+ }, z.core.$strict>>;
233
+ sig: z.ZodString;
234
+ }, z.core.$strict>>;
235
+ }, z.core.$strict>, z.ZodObject<{
236
+ op: z.ZodLiteral<"activate">;
237
+ proof: z.ZodUnion<readonly [z.ZodObject<{
238
+ descriptor: z.ZodObject<{
239
+ id: z.ZodString;
240
+ issuedAt: z.ZodNumber;
241
+ expiresAt: z.ZodNumber;
242
+ commitment: z.ZodString;
243
+ by: z.ZodString;
244
+ sig: z.ZodString;
245
+ v: z.ZodLiteral<"messaging/1">;
246
+ realm: z.ZodString;
247
+ cid: z.ZodString;
248
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
249
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
250
+ }, z.core.$strict>;
251
+ decision: z.ZodObject<{
252
+ id: z.ZodString;
253
+ descriptor: z.ZodString;
254
+ answer: z.ZodEnum<{
255
+ accept: "accept";
256
+ decline: "decline";
257
+ }>;
258
+ at: z.ZodNumber;
259
+ by: z.ZodString;
260
+ sig: z.ZodString;
261
+ v: z.ZodLiteral<"messaging/1">;
262
+ realm: z.ZodString;
263
+ cid: z.ZodString;
264
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
265
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
266
+ }, z.core.$strict>;
267
+ }, z.core.$strict>, z.ZodObject<{
268
+ contacts: z.ZodTuple<[z.ZodObject<{
269
+ at: z.ZodNumber;
270
+ by: z.ZodString;
271
+ sig: z.ZodString;
272
+ v: z.ZodLiteral<"messaging/1">;
273
+ realm: z.ZodString;
274
+ cid: z.ZodString;
275
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
276
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
277
+ }, z.core.$strict>, z.ZodObject<{
278
+ at: z.ZodNumber;
279
+ by: z.ZodString;
280
+ sig: z.ZodString;
281
+ v: z.ZodLiteral<"messaging/1">;
282
+ realm: z.ZodString;
283
+ cid: z.ZodString;
284
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
285
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
286
+ }, z.core.$strict>], null>;
287
+ }, z.core.$strict>]>;
288
+ }, z.core.$strict>, z.ZodObject<{
289
+ op: z.ZodLiteral<"request.complete">;
290
+ request: z.ZodString;
291
+ seq: z.ZodNumber;
292
+ digest: z.ZodString;
158
293
  }, z.core.$strict>, z.ZodObject<{
159
294
  op: z.ZodLiteral<"join">;
160
295
  }, z.core.$strict>, z.ZodObject<{
@@ -192,16 +327,16 @@ export declare const ConvOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
192
327
  }>>;
193
328
  retainDays: z.ZodOptional<z.ZodNumber>;
194
329
  post: z.ZodOptional<z.ZodEnum<{
195
- all: "all";
196
330
  admins: "admins";
331
+ all: "all";
197
332
  }>>;
198
333
  invite: z.ZodOptional<z.ZodEnum<{
199
- all: "all";
200
334
  admins: "admins";
335
+ all: "all";
201
336
  }>>;
202
337
  pins: z.ZodOptional<z.ZodEnum<{
203
- all: "all";
204
338
  admins: "admins";
339
+ all: "all";
205
340
  }>>;
206
341
  }, z.core.$strict>, z.ZodObject<{
207
342
  op: z.ZodLiteral<"archive">;
@@ -216,6 +351,37 @@ export declare const ConvOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
216
351
  settings: "settings";
217
352
  schedule: "schedule";
218
353
  }>;
354
+ device: z.ZodOptional<z.ZodString>;
355
+ until: z.ZodOptional<z.ZodNumber>;
356
+ }, z.core.$strict>, z.ZodObject<{
357
+ op: z.ZodLiteral<"policy">;
358
+ agentContext: z.ZodOptional<z.ZodEnum<{
359
+ none: "none";
360
+ members: "members";
361
+ seats: "seats";
362
+ }>>;
363
+ bridges: z.ZodOptional<z.ZodEnum<{
364
+ none: "none";
365
+ members: "members";
366
+ admins: "admins";
367
+ }>>;
368
+ }, z.core.$strict>, z.ZodObject<{
369
+ op: z.ZodLiteral<"meta">;
370
+ epoch: z.ZodNumber;
371
+ idx: z.ZodNumber;
372
+ sealed: z.ZodString;
373
+ }, z.core.$strict>, z.ZodObject<{
374
+ op: z.ZodLiteral<"setting">;
375
+ kind: z.ZodEnum<{
376
+ link: "link";
377
+ prefs: "prefs";
378
+ grant: "grant";
379
+ context: "context";
380
+ localRetention: "localRetention";
381
+ }>;
382
+ epoch: z.ZodNumber;
383
+ idx: z.ZodNumber;
384
+ sealed: z.ZodString;
219
385
  }, z.core.$strict>], "op">;
220
386
  export type ConvOp = z.infer<typeof ConvOp>;
221
387
  export type ConvOpName = ConvOp["op"];
@@ -246,25 +412,6 @@ export declare const Attachment: z.ZodObject<{
246
412
  thumb: z.ZodOptional<z.ZodString>;
247
413
  }, z.core.$strict>;
248
414
  export type Attachment = z.infer<typeof Attachment>;
249
- /** An outside channel a person may link as an alias of themselves. Telegram first, then Slack. */
250
- export declare const LinkChannel: z.ZodEnum<{
251
- telegram: "telegram";
252
- slack: "slack";
253
- }>;
254
- export type LinkChannel = z.infer<typeof LinkChannel>;
255
- /** What a linked channel may do: Jelly's `chat` and `view` action classes (spec §8.11), never more. */
256
- export declare const LinkAuthority: z.ZodEnum<{
257
- chat: "chat";
258
- view: "view";
259
- }>;
260
- export type LinkAuthority = z.infer<typeof LinkAuthority>;
261
- /** Who may mirror a conversation to a linked channel: nobody (the default), its owners and admins, or any member. */
262
- export declare const BridgePolicy: z.ZodEnum<{
263
- none: "none";
264
- members: "members";
265
- admins: "admins";
266
- }>;
267
- export type BridgePolicy = z.infer<typeof BridgePolicy>;
268
415
  /** A line's provenance when its person wrote it from a linked channel. Signed and sealed with the event. */
269
416
  export declare const Via: z.ZodObject<{
270
417
  channel: z.ZodEnum<{
@@ -454,14 +601,14 @@ export declare const TaskEventBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
454
601
  }, z.core.$strict>], "k">;
455
602
  export type TaskEventBody = z.infer<typeof TaskEventBody>;
456
603
  export declare const ContextAccess: z.ZodEnum<{
457
- ask: "ask";
458
604
  allow: "allow";
605
+ ask: "ask";
459
606
  off: "off";
460
607
  }>;
461
608
  export type ContextAccess = z.infer<typeof ContextAccess>;
462
609
  export declare const ContextKind: z.ZodEnum<{
463
- dm: "dm";
464
610
  group: "group";
611
+ dm: "dm";
465
612
  own: "own";
466
613
  "channel.private": "channel.private";
467
614
  "channel.public": "channel.public";
@@ -471,8 +618,8 @@ export declare const ContextScope: z.ZodUnion<readonly [z.ZodObject<{
471
618
  cid: z.ZodString;
472
619
  }, z.core.$strict>, z.ZodObject<{
473
620
  kind: z.ZodEnum<{
474
- dm: "dm";
475
621
  group: "group";
622
+ dm: "dm";
476
623
  own: "own";
477
624
  "channel.private": "channel.private";
478
625
  "channel.public": "channel.public";
@@ -486,16 +633,16 @@ export declare const ContextRule: z.ZodObject<{
486
633
  cid: z.ZodString;
487
634
  }, z.core.$strict>, z.ZodObject<{
488
635
  kind: z.ZodEnum<{
489
- dm: "dm";
490
636
  group: "group";
637
+ dm: "dm";
491
638
  own: "own";
492
639
  "channel.private": "channel.private";
493
640
  "channel.public": "channel.public";
494
641
  }>;
495
642
  }, z.core.$strict>]>;
496
643
  access: z.ZodEnum<{
497
- ask: "ask";
498
644
  allow: "allow";
645
+ ask: "ask";
499
646
  off: "off";
500
647
  }>;
501
648
  lookbackDays: z.ZodOptional<z.ZodNumber>;
@@ -508,16 +655,16 @@ export declare const ContextRules: z.ZodArray<z.ZodObject<{
508
655
  cid: z.ZodString;
509
656
  }, z.core.$strict>, z.ZodObject<{
510
657
  kind: z.ZodEnum<{
511
- dm: "dm";
512
658
  group: "group";
659
+ dm: "dm";
513
660
  own: "own";
514
661
  "channel.private": "channel.private";
515
662
  "channel.public": "channel.public";
516
663
  }>;
517
664
  }, z.core.$strict>]>;
518
665
  access: z.ZodEnum<{
519
- ask: "ask";
520
666
  allow: "allow";
667
+ ask: "ask";
521
668
  off: "off";
522
669
  }>;
523
670
  lookbackDays: z.ZodOptional<z.ZodNumber>;
@@ -541,7 +688,10 @@ export declare const KeySharePayload: z.ZodObject<{
541
688
  }, z.core.$strict>>;
542
689
  }, z.core.$strict>;
543
690
  export type KeySharePayload = z.infer<typeof KeySharePayload>;
544
- /** The `self` conversation's bodies (spec §16.3, "The self conversation"). The last writer wins by `seq`. */
691
+ /**
692
+ * The `self` conversation's passing state (spec §16.3, "The self conversation"), in `sync` message bodies: it expires
693
+ * with the conversation's retention. The last writer wins by `seq`.
694
+ */
545
695
  export declare const SyncBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
546
696
  s: z.ZodLiteral<"read">;
547
697
  cid: z.ZodString;
@@ -551,16 +701,6 @@ export declare const SyncBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
551
701
  s: z.ZodLiteral<"unread">;
552
702
  cid: z.ZodString;
553
703
  from: z.ZodNumber;
554
- }, z.core.$strict>, z.ZodObject<{
555
- s: z.ZodLiteral<"prefs">;
556
- cid: z.ZodString;
557
- notify: z.ZodEnum<{
558
- none: "none";
559
- all: "all";
560
- mentions: "mentions";
561
- }>;
562
- muteUntil: z.ZodOptional<z.ZodNumber>;
563
- receipts: z.ZodOptional<z.ZodBoolean>;
564
704
  }, z.core.$strict>, z.ZodObject<{
565
705
  s: z.ZodLiteral<"follow">;
566
706
  cid: z.ZodString;
@@ -580,6 +720,31 @@ export declare const SyncBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
580
720
  s: z.ZodLiteral<"joined">;
581
721
  cid: z.ZodString;
582
722
  on: z.ZodBoolean;
723
+ }, z.core.$strict>, z.ZodObject<{
724
+ s: z.ZodLiteral<"keys">;
725
+ cid: z.ZodString;
726
+ shares: z.ZodArray<z.ZodObject<{
727
+ epoch: z.ZodNumber;
728
+ device: z.ZodString;
729
+ idx: z.ZodNumber;
730
+ ck: z.ZodString;
731
+ }, z.core.$strict>>;
732
+ }, z.core.$strict>], "s">;
733
+ export type SyncBody = z.infer<typeof SyncBody>;
734
+ /**
735
+ * The person's settings, each sealed in a `setting` op of their `self` conversation (spec §16.3): ops never expire,
736
+ * so a setting outlives the retention. `s` is the op's `kind`. The last writer wins by `seq`.
737
+ */
738
+ export declare const SettingBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
739
+ s: z.ZodLiteral<"prefs">;
740
+ cid: z.ZodString;
741
+ notify: z.ZodEnum<{
742
+ none: "none";
743
+ all: "all";
744
+ mentions: "mentions";
745
+ }>;
746
+ muteUntil: z.ZodOptional<z.ZodNumber>;
747
+ receipts: z.ZodOptional<z.ZodBoolean>;
583
748
  }, z.core.$strict>, z.ZodObject<{
584
749
  s: z.ZodLiteral<"grant">;
585
750
  grant: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -591,16 +756,16 @@ export declare const SyncBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
591
756
  cid: z.ZodString;
592
757
  }, z.core.$strict>, z.ZodObject<{
593
758
  kind: z.ZodEnum<{
594
- dm: "dm";
595
759
  group: "group";
760
+ dm: "dm";
596
761
  own: "own";
597
762
  "channel.private": "channel.private";
598
763
  "channel.public": "channel.public";
599
764
  }>;
600
765
  }, z.core.$strict>]>;
601
766
  access: z.ZodEnum<{
602
- ask: "ask";
603
767
  allow: "allow";
768
+ ask: "ask";
604
769
  off: "off";
605
770
  }>;
606
771
  lookbackDays: z.ZodOptional<z.ZodNumber>;
@@ -609,15 +774,6 @@ export declare const SyncBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
609
774
  s: z.ZodLiteral<"localRetention">;
610
775
  cid: z.ZodString;
611
776
  days: z.ZodNumber;
612
- }, z.core.$strict>, z.ZodObject<{
613
- s: z.ZodLiteral<"keys">;
614
- cid: z.ZodString;
615
- shares: z.ZodArray<z.ZodObject<{
616
- epoch: z.ZodNumber;
617
- device: z.ZodString;
618
- idx: z.ZodNumber;
619
- ck: z.ZodString;
620
- }, z.core.$strict>>;
621
777
  }, z.core.$strict>, z.ZodObject<{
622
778
  s: z.ZodLiteral<"link">;
623
779
  link: z.ZodObject<{
@@ -641,7 +797,7 @@ export declare const SyncBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
641
797
  revokedAt: z.ZodOptional<z.ZodNumber>;
642
798
  }, z.core.$strict>;
643
799
  }, z.core.$strict>], "s">;
644
- export type SyncBody = z.infer<typeof SyncBody>;
800
+ export type SettingBody = z.infer<typeof SettingBody>;
645
801
  /** The plaintext of a `msg` event. */
646
802
  export declare const MsgBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
647
803
  t: z.ZodLiteral<"line">;
@@ -865,23 +1021,6 @@ export declare const MsgBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
865
1021
  handed_to_agent: "handed_to_agent";
866
1022
  read: "read";
867
1023
  }>;
868
- }, z.core.$strict>, z.ZodObject<{
869
- t: z.ZodLiteral<"meta">;
870
- name: z.ZodOptional<z.ZodString>;
871
- topic: z.ZodOptional<z.ZodString>;
872
- purpose: z.ZodOptional<z.ZodString>;
873
- }, z.core.$strict>, z.ZodObject<{
874
- t: z.ZodLiteral<"policy">;
875
- agentContext: z.ZodOptional<z.ZodEnum<{
876
- none: "none";
877
- members: "members";
878
- seats: "seats";
879
- }>>;
880
- bridges: z.ZodOptional<z.ZodEnum<{
881
- none: "none";
882
- members: "members";
883
- admins: "admins";
884
- }>>;
885
1024
  }, z.core.$strict>, z.ZodObject<{
886
1025
  t: z.ZodLiteral<"sync">;
887
1026
  sync: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -893,16 +1032,6 @@ export declare const MsgBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
893
1032
  s: z.ZodLiteral<"unread">;
894
1033
  cid: z.ZodString;
895
1034
  from: z.ZodNumber;
896
- }, z.core.$strict>, z.ZodObject<{
897
- s: z.ZodLiteral<"prefs">;
898
- cid: z.ZodString;
899
- notify: z.ZodEnum<{
900
- none: "none";
901
- all: "all";
902
- mentions: "mentions";
903
- }>;
904
- muteUntil: z.ZodOptional<z.ZodNumber>;
905
- receipts: z.ZodOptional<z.ZodBoolean>;
906
1035
  }, z.core.$strict>, z.ZodObject<{
907
1036
  s: z.ZodLiteral<"follow">;
908
1037
  cid: z.ZodString;
@@ -922,35 +1051,6 @@ export declare const MsgBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
922
1051
  s: z.ZodLiteral<"joined">;
923
1052
  cid: z.ZodString;
924
1053
  on: z.ZodBoolean;
925
- }, z.core.$strict>, z.ZodObject<{
926
- s: z.ZodLiteral<"grant">;
927
- grant: z.ZodRecord<z.ZodString, z.ZodUnknown>;
928
- }, z.core.$strict>, z.ZodObject<{
929
- s: z.ZodLiteral<"context">;
930
- rules: z.ZodArray<z.ZodObject<{
931
- agent: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
932
- scope: z.ZodUnion<readonly [z.ZodObject<{
933
- cid: z.ZodString;
934
- }, z.core.$strict>, z.ZodObject<{
935
- kind: z.ZodEnum<{
936
- dm: "dm";
937
- group: "group";
938
- own: "own";
939
- "channel.private": "channel.private";
940
- "channel.public": "channel.public";
941
- }>;
942
- }, z.core.$strict>]>;
943
- access: z.ZodEnum<{
944
- ask: "ask";
945
- allow: "allow";
946
- off: "off";
947
- }>;
948
- lookbackDays: z.ZodOptional<z.ZodNumber>;
949
- }, z.core.$strict>>;
950
- }, z.core.$strict>, z.ZodObject<{
951
- s: z.ZodLiteral<"localRetention">;
952
- cid: z.ZodString;
953
- days: z.ZodNumber;
954
1054
  }, z.core.$strict>, z.ZodObject<{
955
1055
  s: z.ZodLiteral<"keys">;
956
1056
  cid: z.ZodString;
@@ -960,28 +1060,6 @@ export declare const MsgBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
960
1060
  idx: z.ZodNumber;
961
1061
  ck: z.ZodString;
962
1062
  }, z.core.$strict>>;
963
- }, z.core.$strict>, z.ZodObject<{
964
- s: z.ZodLiteral<"link">;
965
- link: z.ZodObject<{
966
- id: z.ZodString;
967
- channel: z.ZodEnum<{
968
- telegram: "telegram";
969
- slack: "slack";
970
- }>;
971
- account: z.ZodString;
972
- host: z.ZodString;
973
- proof: z.ZodObject<{
974
- method: z.ZodLiteral<"code-sas">;
975
- codeDigest: z.ZodString;
976
- sas: z.ZodString;
977
- }, z.core.$strict>;
978
- authority: z.ZodArray<z.ZodEnum<{
979
- chat: "chat";
980
- view: "view";
981
- }>>;
982
- linkedAt: z.ZodNumber;
983
- revokedAt: z.ZodOptional<z.ZodNumber>;
984
- }, z.core.$strict>;
985
1063
  }, z.core.$strict>], "s">;
986
1064
  }, z.core.$strict>], "t">;
987
1065
  export type MsgBody = z.infer<typeof MsgBody>;
@@ -994,8 +1072,8 @@ export declare const ConvOpEvent: z.ZodObject<{
994
1072
  kind: z.ZodEnum<{
995
1073
  self: "self";
996
1074
  channel: "channel";
997
- dm: "dm";
998
1075
  group: "group";
1076
+ dm: "dm";
999
1077
  }>;
1000
1078
  visibility: z.ZodOptional<z.ZodEnum<{
1001
1079
  public: "public";
@@ -1023,18 +1101,19 @@ export declare const ConvOpEvent: z.ZodObject<{
1023
1101
  }>>;
1024
1102
  }, z.core.$strict>>;
1025
1103
  post: z.ZodOptional<z.ZodEnum<{
1026
- all: "all";
1027
1104
  admins: "admins";
1105
+ all: "all";
1028
1106
  }>>;
1029
1107
  invite: z.ZodOptional<z.ZodEnum<{
1030
- all: "all";
1031
1108
  admins: "admins";
1109
+ all: "all";
1032
1110
  }>>;
1033
1111
  pins: z.ZodOptional<z.ZodEnum<{
1034
- all: "all";
1035
1112
  admins: "admins";
1113
+ all: "all";
1036
1114
  }>>;
1037
1115
  sealedMeta: z.ZodOptional<z.ZodString>;
1116
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
1038
1117
  }, z.core.$strict>, z.ZodObject<{
1039
1118
  op: z.ZodLiteral<"add">;
1040
1119
  participants: z.ZodArray<z.ZodObject<{
@@ -1054,13 +1133,119 @@ export declare const ConvOpEvent: z.ZodObject<{
1054
1133
  }, z.core.$strict>>;
1055
1134
  }, z.core.$strict>, z.ZodObject<{
1056
1135
  op: z.ZodLiteral<"accept">;
1057
- }, z.core.$strict>, z.ZodObject<{
1058
- op: z.ZodLiteral<"join">;
1059
- }, z.core.$strict>, z.ZodObject<{
1060
- op: z.ZodLiteral<"leave">;
1061
- }, z.core.$strict>, z.ZodObject<{
1062
- op: z.ZodLiteral<"remove">;
1063
- participants: z.ZodArray<z.ZodString>;
1136
+ invitation: z.ZodOptional<z.ZodObject<{
1137
+ v: z.ZodLiteral<"messaging/1">;
1138
+ realm: z.ZodString;
1139
+ cid: z.ZodString;
1140
+ id: z.ZodString;
1141
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1142
+ inviter: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1143
+ by: z.ZodString;
1144
+ head: z.ZodObject<{
1145
+ seq: z.ZodNumber;
1146
+ hash: z.ZodString;
1147
+ }, z.core.$strict>;
1148
+ issuedAt: z.ZodNumber;
1149
+ expiresAt: z.ZodNumber;
1150
+ kind: z.ZodEnum<{
1151
+ channel: "channel";
1152
+ group: "group";
1153
+ }>;
1154
+ history: z.ZodEnum<{
1155
+ none: "none";
1156
+ shared: "shared";
1157
+ }>;
1158
+ agentContext: z.ZodEnum<{
1159
+ none: "none";
1160
+ members: "members";
1161
+ seats: "seats";
1162
+ }>;
1163
+ bridges: z.ZodEnum<{
1164
+ none: "none";
1165
+ members: "members";
1166
+ admins: "admins";
1167
+ }>;
1168
+ audience: z.ZodArray<z.ZodObject<{
1169
+ p: z.ZodString;
1170
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1171
+ role: z.ZodEnum<{
1172
+ admin: "admin";
1173
+ member: "member";
1174
+ owner: "owner";
1175
+ guest: "guest";
1176
+ }>;
1177
+ state: z.ZodEnum<{
1178
+ member: "member";
1179
+ invited: "invited";
1180
+ }>;
1181
+ }, z.core.$strict>>;
1182
+ sig: z.ZodString;
1183
+ }, z.core.$strict>>;
1184
+ }, z.core.$strict>, z.ZodObject<{
1185
+ op: z.ZodLiteral<"activate">;
1186
+ proof: z.ZodUnion<readonly [z.ZodObject<{
1187
+ descriptor: z.ZodObject<{
1188
+ id: z.ZodString;
1189
+ issuedAt: z.ZodNumber;
1190
+ expiresAt: z.ZodNumber;
1191
+ commitment: z.ZodString;
1192
+ by: z.ZodString;
1193
+ sig: z.ZodString;
1194
+ v: z.ZodLiteral<"messaging/1">;
1195
+ realm: z.ZodString;
1196
+ cid: z.ZodString;
1197
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1198
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1199
+ }, z.core.$strict>;
1200
+ decision: z.ZodObject<{
1201
+ id: z.ZodString;
1202
+ descriptor: z.ZodString;
1203
+ answer: z.ZodEnum<{
1204
+ accept: "accept";
1205
+ decline: "decline";
1206
+ }>;
1207
+ at: z.ZodNumber;
1208
+ by: z.ZodString;
1209
+ sig: z.ZodString;
1210
+ v: z.ZodLiteral<"messaging/1">;
1211
+ realm: z.ZodString;
1212
+ cid: z.ZodString;
1213
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1214
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1215
+ }, z.core.$strict>;
1216
+ }, z.core.$strict>, z.ZodObject<{
1217
+ contacts: z.ZodTuple<[z.ZodObject<{
1218
+ at: z.ZodNumber;
1219
+ by: z.ZodString;
1220
+ sig: z.ZodString;
1221
+ v: z.ZodLiteral<"messaging/1">;
1222
+ realm: z.ZodString;
1223
+ cid: z.ZodString;
1224
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1225
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1226
+ }, z.core.$strict>, z.ZodObject<{
1227
+ at: z.ZodNumber;
1228
+ by: z.ZodString;
1229
+ sig: z.ZodString;
1230
+ v: z.ZodLiteral<"messaging/1">;
1231
+ realm: z.ZodString;
1232
+ cid: z.ZodString;
1233
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1234
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1235
+ }, z.core.$strict>], null>;
1236
+ }, z.core.$strict>]>;
1237
+ }, z.core.$strict>, z.ZodObject<{
1238
+ op: z.ZodLiteral<"request.complete">;
1239
+ request: z.ZodString;
1240
+ seq: z.ZodNumber;
1241
+ digest: z.ZodString;
1242
+ }, z.core.$strict>, z.ZodObject<{
1243
+ op: z.ZodLiteral<"join">;
1244
+ }, z.core.$strict>, z.ZodObject<{
1245
+ op: z.ZodLiteral<"leave">;
1246
+ }, z.core.$strict>, z.ZodObject<{
1247
+ op: z.ZodLiteral<"remove">;
1248
+ participants: z.ZodArray<z.ZodString>;
1064
1249
  }, z.core.$strict>, z.ZodObject<{
1065
1250
  op: z.ZodLiteral<"role">;
1066
1251
  p: z.ZodString;
@@ -1091,16 +1276,16 @@ export declare const ConvOpEvent: z.ZodObject<{
1091
1276
  }>>;
1092
1277
  retainDays: z.ZodOptional<z.ZodNumber>;
1093
1278
  post: z.ZodOptional<z.ZodEnum<{
1094
- all: "all";
1095
1279
  admins: "admins";
1280
+ all: "all";
1096
1281
  }>>;
1097
1282
  invite: z.ZodOptional<z.ZodEnum<{
1098
- all: "all";
1099
1283
  admins: "admins";
1284
+ all: "all";
1100
1285
  }>>;
1101
1286
  pins: z.ZodOptional<z.ZodEnum<{
1102
- all: "all";
1103
1287
  admins: "admins";
1288
+ all: "all";
1104
1289
  }>>;
1105
1290
  }, z.core.$strict>, z.ZodObject<{
1106
1291
  op: z.ZodLiteral<"archive">;
@@ -1115,6 +1300,37 @@ export declare const ConvOpEvent: z.ZodObject<{
1115
1300
  settings: "settings";
1116
1301
  schedule: "schedule";
1117
1302
  }>;
1303
+ device: z.ZodOptional<z.ZodString>;
1304
+ until: z.ZodOptional<z.ZodNumber>;
1305
+ }, z.core.$strict>, z.ZodObject<{
1306
+ op: z.ZodLiteral<"policy">;
1307
+ agentContext: z.ZodOptional<z.ZodEnum<{
1308
+ none: "none";
1309
+ members: "members";
1310
+ seats: "seats";
1311
+ }>>;
1312
+ bridges: z.ZodOptional<z.ZodEnum<{
1313
+ none: "none";
1314
+ members: "members";
1315
+ admins: "admins";
1316
+ }>>;
1317
+ }, z.core.$strict>, z.ZodObject<{
1318
+ op: z.ZodLiteral<"meta">;
1319
+ epoch: z.ZodNumber;
1320
+ idx: z.ZodNumber;
1321
+ sealed: z.ZodString;
1322
+ }, z.core.$strict>, z.ZodObject<{
1323
+ op: z.ZodLiteral<"setting">;
1324
+ kind: z.ZodEnum<{
1325
+ link: "link";
1326
+ prefs: "prefs";
1327
+ grant: "grant";
1328
+ context: "context";
1329
+ localRetention: "localRetention";
1330
+ }>;
1331
+ epoch: z.ZodNumber;
1332
+ idx: z.ZodNumber;
1333
+ sealed: z.ZodString;
1118
1334
  }, z.core.$strict>], "op">;
1119
1335
  sig: z.ZodString;
1120
1336
  v: z.ZodLiteral<"messaging/1">;
@@ -1145,6 +1361,7 @@ export declare const ConvMsgEvent: z.ZodObject<{
1145
1361
  epoch: z.ZodNumber;
1146
1362
  idx: z.ZodNumber;
1147
1363
  wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
1364
+ request: z.ZodOptional<z.ZodString>;
1148
1365
  body: z.ZodString;
1149
1366
  sig: z.ZodString;
1150
1367
  v: z.ZodLiteral<"messaging/1">;
@@ -1178,8 +1395,24 @@ export declare const SealedShare: z.ZodObject<{
1178
1395
  ct: z.ZodString;
1179
1396
  }, z.core.$strict>;
1180
1397
  export type SealedShare = z.infer<typeof SealedShare>;
1398
+ /** A `keys` event's body: one share, to one recipient device. */
1181
1399
  export declare const KeysBody: z.ZodObject<{
1182
- shares: z.ZodArray<z.ZodObject<{
1400
+ to: z.ZodObject<{
1401
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1402
+ device: z.ZodString;
1403
+ }, z.core.$strict>;
1404
+ epk: z.ZodString;
1405
+ nonce: z.ZodString;
1406
+ ct: z.ZodString;
1407
+ }, z.core.$strict>;
1408
+ export type KeysBody = z.infer<typeof KeysBody>;
1409
+ /**
1410
+ * A sender-key or history share to one recipient device (spec §16.6). It is signed like every event but is not an
1411
+ * entry of the log: the relay keeps it for its recipient alone and serves it to no one else (`ConvShareEntry`).
1412
+ */
1413
+ export declare const ConvKeysEvent: z.ZodObject<{
1414
+ class: z.ZodLiteral<"keys">;
1415
+ body: z.ZodObject<{
1183
1416
  to: z.ZodObject<{
1184
1417
  person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1185
1418
  device: z.ZodString;
@@ -1187,22 +1420,6 @@ export declare const KeysBody: z.ZodObject<{
1187
1420
  epk: z.ZodString;
1188
1421
  nonce: z.ZodString;
1189
1422
  ct: z.ZodString;
1190
- }, z.core.$strict>>;
1191
- }, z.core.$strict>;
1192
- export type KeysBody = z.infer<typeof KeysBody>;
1193
- /** Sender-key and history shares, sealed pairwise; the relay serves each share only to its recipient. */
1194
- export declare const ConvKeysEvent: z.ZodObject<{
1195
- class: z.ZodLiteral<"keys">;
1196
- body: z.ZodObject<{
1197
- shares: z.ZodArray<z.ZodObject<{
1198
- to: z.ZodObject<{
1199
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1200
- device: z.ZodString;
1201
- }, z.core.$strict>;
1202
- epk: z.ZodString;
1203
- nonce: z.ZodString;
1204
- ct: z.ZodString;
1205
- }, z.core.$strict>>;
1206
1423
  }, z.core.$strict>;
1207
1424
  sig: z.ZodString;
1208
1425
  v: z.ZodLiteral<"messaging/1">;
@@ -1225,6 +1442,7 @@ export declare const ConvKeysEvent: z.ZodObject<{
1225
1442
  }, z.core.$strict>>;
1226
1443
  }, z.core.$strict>;
1227
1444
  export type ConvKeysEvent = z.infer<typeof ConvKeysEvent>;
1445
+ /** The events of the log: ops and messages. */
1228
1446
  export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1229
1447
  class: z.ZodLiteral<"op">;
1230
1448
  body: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1232,8 +1450,8 @@ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1232
1450
  kind: z.ZodEnum<{
1233
1451
  self: "self";
1234
1452
  channel: "channel";
1235
- dm: "dm";
1236
1453
  group: "group";
1454
+ dm: "dm";
1237
1455
  }>;
1238
1456
  visibility: z.ZodOptional<z.ZodEnum<{
1239
1457
  public: "public";
@@ -1261,18 +1479,19 @@ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1261
1479
  }>>;
1262
1480
  }, z.core.$strict>>;
1263
1481
  post: z.ZodOptional<z.ZodEnum<{
1264
- all: "all";
1265
1482
  admins: "admins";
1483
+ all: "all";
1266
1484
  }>>;
1267
1485
  invite: z.ZodOptional<z.ZodEnum<{
1268
- all: "all";
1269
1486
  admins: "admins";
1487
+ all: "all";
1270
1488
  }>>;
1271
1489
  pins: z.ZodOptional<z.ZodEnum<{
1272
- all: "all";
1273
1490
  admins: "admins";
1491
+ all: "all";
1274
1492
  }>>;
1275
1493
  sealedMeta: z.ZodOptional<z.ZodString>;
1494
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
1276
1495
  }, z.core.$strict>, z.ZodObject<{
1277
1496
  op: z.ZodLiteral<"add">;
1278
1497
  participants: z.ZodArray<z.ZodObject<{
@@ -1292,6 +1511,112 @@ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1292
1511
  }, z.core.$strict>>;
1293
1512
  }, z.core.$strict>, z.ZodObject<{
1294
1513
  op: z.ZodLiteral<"accept">;
1514
+ invitation: z.ZodOptional<z.ZodObject<{
1515
+ v: z.ZodLiteral<"messaging/1">;
1516
+ realm: z.ZodString;
1517
+ cid: z.ZodString;
1518
+ id: z.ZodString;
1519
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1520
+ inviter: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1521
+ by: z.ZodString;
1522
+ head: z.ZodObject<{
1523
+ seq: z.ZodNumber;
1524
+ hash: z.ZodString;
1525
+ }, z.core.$strict>;
1526
+ issuedAt: z.ZodNumber;
1527
+ expiresAt: z.ZodNumber;
1528
+ kind: z.ZodEnum<{
1529
+ channel: "channel";
1530
+ group: "group";
1531
+ }>;
1532
+ history: z.ZodEnum<{
1533
+ none: "none";
1534
+ shared: "shared";
1535
+ }>;
1536
+ agentContext: z.ZodEnum<{
1537
+ none: "none";
1538
+ members: "members";
1539
+ seats: "seats";
1540
+ }>;
1541
+ bridges: z.ZodEnum<{
1542
+ none: "none";
1543
+ members: "members";
1544
+ admins: "admins";
1545
+ }>;
1546
+ audience: z.ZodArray<z.ZodObject<{
1547
+ p: z.ZodString;
1548
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1549
+ role: z.ZodEnum<{
1550
+ admin: "admin";
1551
+ member: "member";
1552
+ owner: "owner";
1553
+ guest: "guest";
1554
+ }>;
1555
+ state: z.ZodEnum<{
1556
+ member: "member";
1557
+ invited: "invited";
1558
+ }>;
1559
+ }, z.core.$strict>>;
1560
+ sig: z.ZodString;
1561
+ }, z.core.$strict>>;
1562
+ }, z.core.$strict>, z.ZodObject<{
1563
+ op: z.ZodLiteral<"activate">;
1564
+ proof: z.ZodUnion<readonly [z.ZodObject<{
1565
+ descriptor: z.ZodObject<{
1566
+ id: z.ZodString;
1567
+ issuedAt: z.ZodNumber;
1568
+ expiresAt: z.ZodNumber;
1569
+ commitment: z.ZodString;
1570
+ by: z.ZodString;
1571
+ sig: z.ZodString;
1572
+ v: z.ZodLiteral<"messaging/1">;
1573
+ realm: z.ZodString;
1574
+ cid: z.ZodString;
1575
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1576
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1577
+ }, z.core.$strict>;
1578
+ decision: z.ZodObject<{
1579
+ id: z.ZodString;
1580
+ descriptor: z.ZodString;
1581
+ answer: z.ZodEnum<{
1582
+ accept: "accept";
1583
+ decline: "decline";
1584
+ }>;
1585
+ at: z.ZodNumber;
1586
+ by: z.ZodString;
1587
+ sig: z.ZodString;
1588
+ v: z.ZodLiteral<"messaging/1">;
1589
+ realm: z.ZodString;
1590
+ cid: z.ZodString;
1591
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1592
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1593
+ }, z.core.$strict>;
1594
+ }, z.core.$strict>, z.ZodObject<{
1595
+ contacts: z.ZodTuple<[z.ZodObject<{
1596
+ at: z.ZodNumber;
1597
+ by: z.ZodString;
1598
+ sig: z.ZodString;
1599
+ v: z.ZodLiteral<"messaging/1">;
1600
+ realm: z.ZodString;
1601
+ cid: z.ZodString;
1602
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1603
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1604
+ }, z.core.$strict>, z.ZodObject<{
1605
+ at: z.ZodNumber;
1606
+ by: z.ZodString;
1607
+ sig: z.ZodString;
1608
+ v: z.ZodLiteral<"messaging/1">;
1609
+ realm: z.ZodString;
1610
+ cid: z.ZodString;
1611
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1612
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1613
+ }, z.core.$strict>], null>;
1614
+ }, z.core.$strict>]>;
1615
+ }, z.core.$strict>, z.ZodObject<{
1616
+ op: z.ZodLiteral<"request.complete">;
1617
+ request: z.ZodString;
1618
+ seq: z.ZodNumber;
1619
+ digest: z.ZodString;
1295
1620
  }, z.core.$strict>, z.ZodObject<{
1296
1621
  op: z.ZodLiteral<"join">;
1297
1622
  }, z.core.$strict>, z.ZodObject<{
@@ -1329,16 +1654,16 @@ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1329
1654
  }>>;
1330
1655
  retainDays: z.ZodOptional<z.ZodNumber>;
1331
1656
  post: z.ZodOptional<z.ZodEnum<{
1332
- all: "all";
1333
1657
  admins: "admins";
1658
+ all: "all";
1334
1659
  }>>;
1335
1660
  invite: z.ZodOptional<z.ZodEnum<{
1336
- all: "all";
1337
1661
  admins: "admins";
1662
+ all: "all";
1338
1663
  }>>;
1339
1664
  pins: z.ZodOptional<z.ZodEnum<{
1340
- all: "all";
1341
1665
  admins: "admins";
1666
+ all: "all";
1342
1667
  }>>;
1343
1668
  }, z.core.$strict>, z.ZodObject<{
1344
1669
  op: z.ZodLiteral<"archive">;
@@ -1353,6 +1678,37 @@ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1353
1678
  settings: "settings";
1354
1679
  schedule: "schedule";
1355
1680
  }>;
1681
+ device: z.ZodOptional<z.ZodString>;
1682
+ until: z.ZodOptional<z.ZodNumber>;
1683
+ }, z.core.$strict>, z.ZodObject<{
1684
+ op: z.ZodLiteral<"policy">;
1685
+ agentContext: z.ZodOptional<z.ZodEnum<{
1686
+ none: "none";
1687
+ members: "members";
1688
+ seats: "seats";
1689
+ }>>;
1690
+ bridges: z.ZodOptional<z.ZodEnum<{
1691
+ none: "none";
1692
+ members: "members";
1693
+ admins: "admins";
1694
+ }>>;
1695
+ }, z.core.$strict>, z.ZodObject<{
1696
+ op: z.ZodLiteral<"meta">;
1697
+ epoch: z.ZodNumber;
1698
+ idx: z.ZodNumber;
1699
+ sealed: z.ZodString;
1700
+ }, z.core.$strict>, z.ZodObject<{
1701
+ op: z.ZodLiteral<"setting">;
1702
+ kind: z.ZodEnum<{
1703
+ link: "link";
1704
+ prefs: "prefs";
1705
+ grant: "grant";
1706
+ context: "context";
1707
+ localRetention: "localRetention";
1708
+ }>;
1709
+ epoch: z.ZodNumber;
1710
+ idx: z.ZodNumber;
1711
+ sealed: z.ZodString;
1356
1712
  }, z.core.$strict>], "op">;
1357
1713
  sig: z.ZodString;
1358
1714
  v: z.ZodLiteral<"messaging/1">;
@@ -1378,6 +1734,7 @@ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1378
1734
  epoch: z.ZodNumber;
1379
1735
  idx: z.ZodNumber;
1380
1736
  wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
1737
+ request: z.ZodOptional<z.ZodString>;
1381
1738
  body: z.ZodString;
1382
1739
  sig: z.ZodString;
1383
1740
  v: z.ZodLiteral<"messaging/1">;
@@ -1398,97 +1755,740 @@ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1398
1755
  seq: z.ZodNumber;
1399
1756
  hash: z.ZodString;
1400
1757
  }, z.core.$strict>>;
1401
- }, z.core.$strict>, z.ZodObject<{
1402
- class: z.ZodLiteral<"keys">;
1403
- body: z.ZodObject<{
1404
- shares: z.ZodArray<z.ZodObject<{
1405
- to: z.ZodObject<{
1406
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1407
- device: z.ZodString;
1408
- }, z.core.$strict>;
1409
- epk: z.ZodString;
1410
- nonce: z.ZodString;
1411
- ct: z.ZodString;
1412
- }, z.core.$strict>>;
1413
- }, z.core.$strict>;
1414
- sig: z.ZodString;
1415
- v: z.ZodLiteral<"messaging/1">;
1416
- realm: z.ZodString;
1417
- cid: z.ZodString;
1418
- id: z.ZodString;
1419
- by: z.ZodObject<{
1420
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1421
- device: z.ZodString;
1422
- agent: z.ZodOptional<z.ZodString>;
1423
- }, z.core.$strict>;
1424
- ts: z.ZodNumber;
1425
- opHead: z.ZodObject<{
1426
- seq: z.ZodNumber;
1427
- hash: z.ZodString;
1428
- }, z.core.$strict>;
1429
- seen: z.ZodOptional<z.ZodObject<{
1430
- seq: z.ZodNumber;
1431
- hash: z.ZodString;
1432
- }, z.core.$strict>>;
1433
1758
  }, z.core.$strict>], "class">;
1434
1759
  export type ConvEvent = z.infer<typeof ConvEvent>;
1435
1760
  export type ConvEventClass = ConvEvent["class"];
1436
- /** An event as its author signs it, without `sig`. */
1437
- export type UnsignedConvEvent = ConvEvent extends infer E ? (E extends ConvEvent ? Omit<E, "sig"> : never) : never;
1438
- /** An event's header: everything but `body` and `sig`. It is the AAD of a sealed body. */
1439
- export type ConvEventHeader = ConvEvent extends infer E ? (E extends ConvEvent ? Omit<E, "body" | "sig"> : never) : never;
1440
- /** An event as the relay stores and serves it. The relay does not sign it; members verify the chain. */
1441
- export declare const ConvLogEntry: z.ZodObject<{
1442
- seq: z.ZodNumber;
1443
- prev: z.ZodString;
1444
- event: z.ZodDiscriminatedUnion<[z.ZodObject<{
1445
- class: z.ZodLiteral<"op">;
1446
- body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1447
- op: z.ZodLiteral<"create">;
1448
- kind: z.ZodEnum<{
1449
- self: "self";
1450
- channel: "channel";
1451
- dm: "dm";
1452
- group: "group";
1453
- }>;
1454
- visibility: z.ZodOptional<z.ZodEnum<{
1455
- public: "public";
1456
- private: "private";
1457
- }>>;
1458
- history: z.ZodEnum<{
1459
- none: "none";
1460
- shared: "shared";
1461
- }>;
1462
- retainDays: z.ZodNumber;
1463
- org: z.ZodOptional<z.ZodString>;
1464
- participants: z.ZodArray<z.ZodObject<{
1465
- p: z.ZodString;
1466
- role: z.ZodEnum<{
1467
- admin: "admin";
1468
- member: "member";
1469
- owner: "owner";
1470
- guest: "guest";
1471
- }>;
1472
- device: z.ZodOptional<z.ZodString>;
1473
- respondTo: z.ZodOptional<z.ZodEnum<{
1474
- self: "self";
1475
- none: "none";
1476
- members: "members";
1761
+ /** Every signed conversation event: the log's, and key shares. */
1762
+ export declare const ConvAnyEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1763
+ class: z.ZodLiteral<"op">;
1764
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1765
+ op: z.ZodLiteral<"create">;
1766
+ kind: z.ZodEnum<{
1767
+ self: "self";
1768
+ channel: "channel";
1769
+ group: "group";
1770
+ dm: "dm";
1771
+ }>;
1772
+ visibility: z.ZodOptional<z.ZodEnum<{
1773
+ public: "public";
1774
+ private: "private";
1775
+ }>>;
1776
+ history: z.ZodEnum<{
1777
+ none: "none";
1778
+ shared: "shared";
1779
+ }>;
1780
+ retainDays: z.ZodNumber;
1781
+ org: z.ZodOptional<z.ZodString>;
1782
+ participants: z.ZodArray<z.ZodObject<{
1783
+ p: z.ZodString;
1784
+ role: z.ZodEnum<{
1785
+ admin: "admin";
1786
+ member: "member";
1787
+ owner: "owner";
1788
+ guest: "guest";
1789
+ }>;
1790
+ device: z.ZodOptional<z.ZodString>;
1791
+ respondTo: z.ZodOptional<z.ZodEnum<{
1792
+ self: "self";
1793
+ none: "none";
1794
+ members: "members";
1795
+ }>>;
1796
+ }, z.core.$strict>>;
1797
+ post: z.ZodOptional<z.ZodEnum<{
1798
+ admins: "admins";
1799
+ all: "all";
1800
+ }>>;
1801
+ invite: z.ZodOptional<z.ZodEnum<{
1802
+ admins: "admins";
1803
+ all: "all";
1804
+ }>>;
1805
+ pins: z.ZodOptional<z.ZodEnum<{
1806
+ admins: "admins";
1807
+ all: "all";
1808
+ }>>;
1809
+ sealedMeta: z.ZodOptional<z.ZodString>;
1810
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
1811
+ }, z.core.$strict>, z.ZodObject<{
1812
+ op: z.ZodLiteral<"add">;
1813
+ participants: z.ZodArray<z.ZodObject<{
1814
+ p: z.ZodString;
1815
+ role: z.ZodEnum<{
1816
+ admin: "admin";
1817
+ member: "member";
1818
+ owner: "owner";
1819
+ guest: "guest";
1820
+ }>;
1821
+ device: z.ZodOptional<z.ZodString>;
1822
+ respondTo: z.ZodOptional<z.ZodEnum<{
1823
+ self: "self";
1824
+ none: "none";
1825
+ members: "members";
1826
+ }>>;
1827
+ }, z.core.$strict>>;
1828
+ }, z.core.$strict>, z.ZodObject<{
1829
+ op: z.ZodLiteral<"accept">;
1830
+ invitation: z.ZodOptional<z.ZodObject<{
1831
+ v: z.ZodLiteral<"messaging/1">;
1832
+ realm: z.ZodString;
1833
+ cid: z.ZodString;
1834
+ id: z.ZodString;
1835
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1836
+ inviter: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1837
+ by: z.ZodString;
1838
+ head: z.ZodObject<{
1839
+ seq: z.ZodNumber;
1840
+ hash: z.ZodString;
1841
+ }, z.core.$strict>;
1842
+ issuedAt: z.ZodNumber;
1843
+ expiresAt: z.ZodNumber;
1844
+ kind: z.ZodEnum<{
1845
+ channel: "channel";
1846
+ group: "group";
1847
+ }>;
1848
+ history: z.ZodEnum<{
1849
+ none: "none";
1850
+ shared: "shared";
1851
+ }>;
1852
+ agentContext: z.ZodEnum<{
1853
+ none: "none";
1854
+ members: "members";
1855
+ seats: "seats";
1856
+ }>;
1857
+ bridges: z.ZodEnum<{
1858
+ none: "none";
1859
+ members: "members";
1860
+ admins: "admins";
1861
+ }>;
1862
+ audience: z.ZodArray<z.ZodObject<{
1863
+ p: z.ZodString;
1864
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1865
+ role: z.ZodEnum<{
1866
+ admin: "admin";
1867
+ member: "member";
1868
+ owner: "owner";
1869
+ guest: "guest";
1870
+ }>;
1871
+ state: z.ZodEnum<{
1872
+ member: "member";
1873
+ invited: "invited";
1874
+ }>;
1875
+ }, z.core.$strict>>;
1876
+ sig: z.ZodString;
1877
+ }, z.core.$strict>>;
1878
+ }, z.core.$strict>, z.ZodObject<{
1879
+ op: z.ZodLiteral<"activate">;
1880
+ proof: z.ZodUnion<readonly [z.ZodObject<{
1881
+ descriptor: z.ZodObject<{
1882
+ id: z.ZodString;
1883
+ issuedAt: z.ZodNumber;
1884
+ expiresAt: z.ZodNumber;
1885
+ commitment: z.ZodString;
1886
+ by: z.ZodString;
1887
+ sig: z.ZodString;
1888
+ v: z.ZodLiteral<"messaging/1">;
1889
+ realm: z.ZodString;
1890
+ cid: z.ZodString;
1891
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1892
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1893
+ }, z.core.$strict>;
1894
+ decision: z.ZodObject<{
1895
+ id: z.ZodString;
1896
+ descriptor: z.ZodString;
1897
+ answer: z.ZodEnum<{
1898
+ accept: "accept";
1899
+ decline: "decline";
1900
+ }>;
1901
+ at: z.ZodNumber;
1902
+ by: z.ZodString;
1903
+ sig: z.ZodString;
1904
+ v: z.ZodLiteral<"messaging/1">;
1905
+ realm: z.ZodString;
1906
+ cid: z.ZodString;
1907
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1908
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1909
+ }, z.core.$strict>;
1910
+ }, z.core.$strict>, z.ZodObject<{
1911
+ contacts: z.ZodTuple<[z.ZodObject<{
1912
+ at: z.ZodNumber;
1913
+ by: z.ZodString;
1914
+ sig: z.ZodString;
1915
+ v: z.ZodLiteral<"messaging/1">;
1916
+ realm: z.ZodString;
1917
+ cid: z.ZodString;
1918
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1919
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1920
+ }, z.core.$strict>, z.ZodObject<{
1921
+ at: z.ZodNumber;
1922
+ by: z.ZodString;
1923
+ sig: z.ZodString;
1924
+ v: z.ZodLiteral<"messaging/1">;
1925
+ realm: z.ZodString;
1926
+ cid: z.ZodString;
1927
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1928
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1929
+ }, z.core.$strict>], null>;
1930
+ }, z.core.$strict>]>;
1931
+ }, z.core.$strict>, z.ZodObject<{
1932
+ op: z.ZodLiteral<"request.complete">;
1933
+ request: z.ZodString;
1934
+ seq: z.ZodNumber;
1935
+ digest: z.ZodString;
1936
+ }, z.core.$strict>, z.ZodObject<{
1937
+ op: z.ZodLiteral<"join">;
1938
+ }, z.core.$strict>, z.ZodObject<{
1939
+ op: z.ZodLiteral<"leave">;
1940
+ }, z.core.$strict>, z.ZodObject<{
1941
+ op: z.ZodLiteral<"remove">;
1942
+ participants: z.ZodArray<z.ZodString>;
1943
+ }, z.core.$strict>, z.ZodObject<{
1944
+ op: z.ZodLiteral<"role">;
1945
+ p: z.ZodString;
1946
+ role: z.ZodEnum<{
1947
+ admin: "admin";
1948
+ member: "member";
1949
+ owner: "owner";
1950
+ guest: "guest";
1951
+ }>;
1952
+ }, z.core.$strict>, z.ZodObject<{
1953
+ op: z.ZodLiteral<"seat">;
1954
+ p: z.ZodString;
1955
+ device: z.ZodOptional<z.ZodString>;
1956
+ respondTo: z.ZodOptional<z.ZodEnum<{
1957
+ self: "self";
1958
+ none: "none";
1959
+ members: "members";
1960
+ }>>;
1961
+ }, z.core.$strict>, z.ZodObject<{
1962
+ op: z.ZodLiteral<"settings">;
1963
+ visibility: z.ZodOptional<z.ZodEnum<{
1964
+ public: "public";
1965
+ private: "private";
1966
+ }>>;
1967
+ history: z.ZodOptional<z.ZodEnum<{
1968
+ none: "none";
1969
+ shared: "shared";
1970
+ }>>;
1971
+ retainDays: z.ZodOptional<z.ZodNumber>;
1972
+ post: z.ZodOptional<z.ZodEnum<{
1973
+ admins: "admins";
1974
+ all: "all";
1975
+ }>>;
1976
+ invite: z.ZodOptional<z.ZodEnum<{
1977
+ admins: "admins";
1978
+ all: "all";
1979
+ }>>;
1980
+ pins: z.ZodOptional<z.ZodEnum<{
1981
+ admins: "admins";
1982
+ all: "all";
1983
+ }>>;
1984
+ }, z.core.$strict>, z.ZodObject<{
1985
+ op: z.ZodLiteral<"archive">;
1986
+ on: z.ZodBoolean;
1987
+ }, z.core.$strict>, z.ZodObject<{
1988
+ op: z.ZodLiteral<"rekey">;
1989
+ epoch: z.ZodNumber;
1990
+ cause: z.ZodEnum<{
1991
+ device: "device";
1992
+ removed: "removed";
1993
+ added: "added";
1994
+ settings: "settings";
1995
+ schedule: "schedule";
1996
+ }>;
1997
+ device: z.ZodOptional<z.ZodString>;
1998
+ until: z.ZodOptional<z.ZodNumber>;
1999
+ }, z.core.$strict>, z.ZodObject<{
2000
+ op: z.ZodLiteral<"policy">;
2001
+ agentContext: z.ZodOptional<z.ZodEnum<{
2002
+ none: "none";
2003
+ members: "members";
2004
+ seats: "seats";
2005
+ }>>;
2006
+ bridges: z.ZodOptional<z.ZodEnum<{
2007
+ none: "none";
2008
+ members: "members";
2009
+ admins: "admins";
2010
+ }>>;
2011
+ }, z.core.$strict>, z.ZodObject<{
2012
+ op: z.ZodLiteral<"meta">;
2013
+ epoch: z.ZodNumber;
2014
+ idx: z.ZodNumber;
2015
+ sealed: z.ZodString;
2016
+ }, z.core.$strict>, z.ZodObject<{
2017
+ op: z.ZodLiteral<"setting">;
2018
+ kind: z.ZodEnum<{
2019
+ link: "link";
2020
+ prefs: "prefs";
2021
+ grant: "grant";
2022
+ context: "context";
2023
+ localRetention: "localRetention";
2024
+ }>;
2025
+ epoch: z.ZodNumber;
2026
+ idx: z.ZodNumber;
2027
+ sealed: z.ZodString;
2028
+ }, z.core.$strict>], "op">;
2029
+ sig: z.ZodString;
2030
+ v: z.ZodLiteral<"messaging/1">;
2031
+ realm: z.ZodString;
2032
+ cid: z.ZodString;
2033
+ id: z.ZodString;
2034
+ by: z.ZodObject<{
2035
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2036
+ device: z.ZodString;
2037
+ agent: z.ZodOptional<z.ZodString>;
2038
+ }, z.core.$strict>;
2039
+ ts: z.ZodNumber;
2040
+ opHead: z.ZodObject<{
2041
+ seq: z.ZodNumber;
2042
+ hash: z.ZodString;
2043
+ }, z.core.$strict>;
2044
+ seen: z.ZodOptional<z.ZodObject<{
2045
+ seq: z.ZodNumber;
2046
+ hash: z.ZodString;
2047
+ }, z.core.$strict>>;
2048
+ }, z.core.$strict>, z.ZodObject<{
2049
+ class: z.ZodLiteral<"msg">;
2050
+ epoch: z.ZodNumber;
2051
+ idx: z.ZodNumber;
2052
+ wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
2053
+ request: z.ZodOptional<z.ZodString>;
2054
+ body: z.ZodString;
2055
+ sig: z.ZodString;
2056
+ v: z.ZodLiteral<"messaging/1">;
2057
+ realm: z.ZodString;
2058
+ cid: z.ZodString;
2059
+ id: z.ZodString;
2060
+ by: z.ZodObject<{
2061
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2062
+ device: z.ZodString;
2063
+ agent: z.ZodOptional<z.ZodString>;
2064
+ }, z.core.$strict>;
2065
+ ts: z.ZodNumber;
2066
+ opHead: z.ZodObject<{
2067
+ seq: z.ZodNumber;
2068
+ hash: z.ZodString;
2069
+ }, z.core.$strict>;
2070
+ seen: z.ZodOptional<z.ZodObject<{
2071
+ seq: z.ZodNumber;
2072
+ hash: z.ZodString;
2073
+ }, z.core.$strict>>;
2074
+ }, z.core.$strict>, z.ZodObject<{
2075
+ class: z.ZodLiteral<"keys">;
2076
+ body: z.ZodObject<{
2077
+ to: z.ZodObject<{
2078
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2079
+ device: z.ZodString;
2080
+ }, z.core.$strict>;
2081
+ epk: z.ZodString;
2082
+ nonce: z.ZodString;
2083
+ ct: z.ZodString;
2084
+ }, z.core.$strict>;
2085
+ sig: z.ZodString;
2086
+ v: z.ZodLiteral<"messaging/1">;
2087
+ realm: z.ZodString;
2088
+ cid: z.ZodString;
2089
+ id: z.ZodString;
2090
+ by: z.ZodObject<{
2091
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2092
+ device: z.ZodString;
2093
+ agent: z.ZodOptional<z.ZodString>;
2094
+ }, z.core.$strict>;
2095
+ ts: z.ZodNumber;
2096
+ opHead: z.ZodObject<{
2097
+ seq: z.ZodNumber;
2098
+ hash: z.ZodString;
2099
+ }, z.core.$strict>;
2100
+ seen: z.ZodOptional<z.ZodObject<{
2101
+ seq: z.ZodNumber;
2102
+ hash: z.ZodString;
2103
+ }, z.core.$strict>>;
2104
+ }, z.core.$strict>], "class">;
2105
+ export type ConvAnyEvent = z.infer<typeof ConvAnyEvent>;
2106
+ /** An event as its author signs it, without `sig`. */
2107
+ export type UnsignedConvEvent = ConvAnyEvent extends infer E ? (E extends ConvAnyEvent ? Omit<E, "sig"> : never) : never;
2108
+ /** An event's header: everything but `body` and `sig`. It is the AAD of a sealed body. */
2109
+ export type ConvEventHeader = ConvAnyEvent extends infer E ? (E extends ConvAnyEvent ? Omit<E, "body" | "sig"> : never) : never;
2110
+ /** An event as the relay stores and serves it. The relay does not sign it; members verify the chain. */
2111
+ export declare const ConvLogEntry: z.ZodObject<{
2112
+ seq: z.ZodNumber;
2113
+ prev: z.ZodString;
2114
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
2115
+ class: z.ZodLiteral<"op">;
2116
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
2117
+ op: z.ZodLiteral<"create">;
2118
+ kind: z.ZodEnum<{
2119
+ self: "self";
2120
+ channel: "channel";
2121
+ group: "group";
2122
+ dm: "dm";
2123
+ }>;
2124
+ visibility: z.ZodOptional<z.ZodEnum<{
2125
+ public: "public";
2126
+ private: "private";
2127
+ }>>;
2128
+ history: z.ZodEnum<{
2129
+ none: "none";
2130
+ shared: "shared";
2131
+ }>;
2132
+ retainDays: z.ZodNumber;
2133
+ org: z.ZodOptional<z.ZodString>;
2134
+ participants: z.ZodArray<z.ZodObject<{
2135
+ p: z.ZodString;
2136
+ role: z.ZodEnum<{
2137
+ admin: "admin";
2138
+ member: "member";
2139
+ owner: "owner";
2140
+ guest: "guest";
2141
+ }>;
2142
+ device: z.ZodOptional<z.ZodString>;
2143
+ respondTo: z.ZodOptional<z.ZodEnum<{
2144
+ self: "self";
2145
+ none: "none";
2146
+ members: "members";
1477
2147
  }>>;
1478
2148
  }, z.core.$strict>>;
1479
2149
  post: z.ZodOptional<z.ZodEnum<{
1480
- all: "all";
1481
2150
  admins: "admins";
2151
+ all: "all";
2152
+ }>>;
2153
+ invite: z.ZodOptional<z.ZodEnum<{
2154
+ admins: "admins";
2155
+ all: "all";
2156
+ }>>;
2157
+ pins: z.ZodOptional<z.ZodEnum<{
2158
+ admins: "admins";
2159
+ all: "all";
2160
+ }>>;
2161
+ sealedMeta: z.ZodOptional<z.ZodString>;
2162
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
2163
+ }, z.core.$strict>, z.ZodObject<{
2164
+ op: z.ZodLiteral<"add">;
2165
+ participants: z.ZodArray<z.ZodObject<{
2166
+ p: z.ZodString;
2167
+ role: z.ZodEnum<{
2168
+ admin: "admin";
2169
+ member: "member";
2170
+ owner: "owner";
2171
+ guest: "guest";
2172
+ }>;
2173
+ device: z.ZodOptional<z.ZodString>;
2174
+ respondTo: z.ZodOptional<z.ZodEnum<{
2175
+ self: "self";
2176
+ none: "none";
2177
+ members: "members";
2178
+ }>>;
2179
+ }, z.core.$strict>>;
2180
+ }, z.core.$strict>, z.ZodObject<{
2181
+ op: z.ZodLiteral<"accept">;
2182
+ invitation: z.ZodOptional<z.ZodObject<{
2183
+ v: z.ZodLiteral<"messaging/1">;
2184
+ realm: z.ZodString;
2185
+ cid: z.ZodString;
2186
+ id: z.ZodString;
2187
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2188
+ inviter: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2189
+ by: z.ZodString;
2190
+ head: z.ZodObject<{
2191
+ seq: z.ZodNumber;
2192
+ hash: z.ZodString;
2193
+ }, z.core.$strict>;
2194
+ issuedAt: z.ZodNumber;
2195
+ expiresAt: z.ZodNumber;
2196
+ kind: z.ZodEnum<{
2197
+ channel: "channel";
2198
+ group: "group";
2199
+ }>;
2200
+ history: z.ZodEnum<{
2201
+ none: "none";
2202
+ shared: "shared";
2203
+ }>;
2204
+ agentContext: z.ZodEnum<{
2205
+ none: "none";
2206
+ members: "members";
2207
+ seats: "seats";
2208
+ }>;
2209
+ bridges: z.ZodEnum<{
2210
+ none: "none";
2211
+ members: "members";
2212
+ admins: "admins";
2213
+ }>;
2214
+ audience: z.ZodArray<z.ZodObject<{
2215
+ p: z.ZodString;
2216
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2217
+ role: z.ZodEnum<{
2218
+ admin: "admin";
2219
+ member: "member";
2220
+ owner: "owner";
2221
+ guest: "guest";
2222
+ }>;
2223
+ state: z.ZodEnum<{
2224
+ member: "member";
2225
+ invited: "invited";
2226
+ }>;
2227
+ }, z.core.$strict>>;
2228
+ sig: z.ZodString;
2229
+ }, z.core.$strict>>;
2230
+ }, z.core.$strict>, z.ZodObject<{
2231
+ op: z.ZodLiteral<"activate">;
2232
+ proof: z.ZodUnion<readonly [z.ZodObject<{
2233
+ descriptor: z.ZodObject<{
2234
+ id: z.ZodString;
2235
+ issuedAt: z.ZodNumber;
2236
+ expiresAt: z.ZodNumber;
2237
+ commitment: z.ZodString;
2238
+ by: z.ZodString;
2239
+ sig: z.ZodString;
2240
+ v: z.ZodLiteral<"messaging/1">;
2241
+ realm: z.ZodString;
2242
+ cid: z.ZodString;
2243
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2244
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2245
+ }, z.core.$strict>;
2246
+ decision: z.ZodObject<{
2247
+ id: z.ZodString;
2248
+ descriptor: z.ZodString;
2249
+ answer: z.ZodEnum<{
2250
+ accept: "accept";
2251
+ decline: "decline";
2252
+ }>;
2253
+ at: z.ZodNumber;
2254
+ by: z.ZodString;
2255
+ sig: z.ZodString;
2256
+ v: z.ZodLiteral<"messaging/1">;
2257
+ realm: z.ZodString;
2258
+ cid: z.ZodString;
2259
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2260
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2261
+ }, z.core.$strict>;
2262
+ }, z.core.$strict>, z.ZodObject<{
2263
+ contacts: z.ZodTuple<[z.ZodObject<{
2264
+ at: z.ZodNumber;
2265
+ by: z.ZodString;
2266
+ sig: z.ZodString;
2267
+ v: z.ZodLiteral<"messaging/1">;
2268
+ realm: z.ZodString;
2269
+ cid: z.ZodString;
2270
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2271
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2272
+ }, z.core.$strict>, z.ZodObject<{
2273
+ at: z.ZodNumber;
2274
+ by: z.ZodString;
2275
+ sig: z.ZodString;
2276
+ v: z.ZodLiteral<"messaging/1">;
2277
+ realm: z.ZodString;
2278
+ cid: z.ZodString;
2279
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2280
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2281
+ }, z.core.$strict>], null>;
2282
+ }, z.core.$strict>]>;
2283
+ }, z.core.$strict>, z.ZodObject<{
2284
+ op: z.ZodLiteral<"request.complete">;
2285
+ request: z.ZodString;
2286
+ seq: z.ZodNumber;
2287
+ digest: z.ZodString;
2288
+ }, z.core.$strict>, z.ZodObject<{
2289
+ op: z.ZodLiteral<"join">;
2290
+ }, z.core.$strict>, z.ZodObject<{
2291
+ op: z.ZodLiteral<"leave">;
2292
+ }, z.core.$strict>, z.ZodObject<{
2293
+ op: z.ZodLiteral<"remove">;
2294
+ participants: z.ZodArray<z.ZodString>;
2295
+ }, z.core.$strict>, z.ZodObject<{
2296
+ op: z.ZodLiteral<"role">;
2297
+ p: z.ZodString;
2298
+ role: z.ZodEnum<{
2299
+ admin: "admin";
2300
+ member: "member";
2301
+ owner: "owner";
2302
+ guest: "guest";
2303
+ }>;
2304
+ }, z.core.$strict>, z.ZodObject<{
2305
+ op: z.ZodLiteral<"seat">;
2306
+ p: z.ZodString;
2307
+ device: z.ZodOptional<z.ZodString>;
2308
+ respondTo: z.ZodOptional<z.ZodEnum<{
2309
+ self: "self";
2310
+ none: "none";
2311
+ members: "members";
2312
+ }>>;
2313
+ }, z.core.$strict>, z.ZodObject<{
2314
+ op: z.ZodLiteral<"settings">;
2315
+ visibility: z.ZodOptional<z.ZodEnum<{
2316
+ public: "public";
2317
+ private: "private";
2318
+ }>>;
2319
+ history: z.ZodOptional<z.ZodEnum<{
2320
+ none: "none";
2321
+ shared: "shared";
2322
+ }>>;
2323
+ retainDays: z.ZodOptional<z.ZodNumber>;
2324
+ post: z.ZodOptional<z.ZodEnum<{
2325
+ admins: "admins";
2326
+ all: "all";
1482
2327
  }>>;
1483
2328
  invite: z.ZodOptional<z.ZodEnum<{
1484
- all: "all";
1485
2329
  admins: "admins";
2330
+ all: "all";
1486
2331
  }>>;
1487
2332
  pins: z.ZodOptional<z.ZodEnum<{
2333
+ admins: "admins";
2334
+ all: "all";
2335
+ }>>;
2336
+ }, z.core.$strict>, z.ZodObject<{
2337
+ op: z.ZodLiteral<"archive">;
2338
+ on: z.ZodBoolean;
2339
+ }, z.core.$strict>, z.ZodObject<{
2340
+ op: z.ZodLiteral<"rekey">;
2341
+ epoch: z.ZodNumber;
2342
+ cause: z.ZodEnum<{
2343
+ device: "device";
2344
+ removed: "removed";
2345
+ added: "added";
2346
+ settings: "settings";
2347
+ schedule: "schedule";
2348
+ }>;
2349
+ device: z.ZodOptional<z.ZodString>;
2350
+ until: z.ZodOptional<z.ZodNumber>;
2351
+ }, z.core.$strict>, z.ZodObject<{
2352
+ op: z.ZodLiteral<"policy">;
2353
+ agentContext: z.ZodOptional<z.ZodEnum<{
2354
+ none: "none";
2355
+ members: "members";
2356
+ seats: "seats";
2357
+ }>>;
2358
+ bridges: z.ZodOptional<z.ZodEnum<{
2359
+ none: "none";
2360
+ members: "members";
2361
+ admins: "admins";
2362
+ }>>;
2363
+ }, z.core.$strict>, z.ZodObject<{
2364
+ op: z.ZodLiteral<"meta">;
2365
+ epoch: z.ZodNumber;
2366
+ idx: z.ZodNumber;
2367
+ sealed: z.ZodString;
2368
+ }, z.core.$strict>, z.ZodObject<{
2369
+ op: z.ZodLiteral<"setting">;
2370
+ kind: z.ZodEnum<{
2371
+ link: "link";
2372
+ prefs: "prefs";
2373
+ grant: "grant";
2374
+ context: "context";
2375
+ localRetention: "localRetention";
2376
+ }>;
2377
+ epoch: z.ZodNumber;
2378
+ idx: z.ZodNumber;
2379
+ sealed: z.ZodString;
2380
+ }, z.core.$strict>], "op">;
2381
+ sig: z.ZodString;
2382
+ v: z.ZodLiteral<"messaging/1">;
2383
+ realm: z.ZodString;
2384
+ cid: z.ZodString;
2385
+ id: z.ZodString;
2386
+ by: z.ZodObject<{
2387
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2388
+ device: z.ZodString;
2389
+ agent: z.ZodOptional<z.ZodString>;
2390
+ }, z.core.$strict>;
2391
+ ts: z.ZodNumber;
2392
+ opHead: z.ZodObject<{
2393
+ seq: z.ZodNumber;
2394
+ hash: z.ZodString;
2395
+ }, z.core.$strict>;
2396
+ seen: z.ZodOptional<z.ZodObject<{
2397
+ seq: z.ZodNumber;
2398
+ hash: z.ZodString;
2399
+ }, z.core.$strict>>;
2400
+ }, z.core.$strict>, z.ZodObject<{
2401
+ class: z.ZodLiteral<"msg">;
2402
+ epoch: z.ZodNumber;
2403
+ idx: z.ZodNumber;
2404
+ wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
2405
+ request: z.ZodOptional<z.ZodString>;
2406
+ body: z.ZodString;
2407
+ sig: z.ZodString;
2408
+ v: z.ZodLiteral<"messaging/1">;
2409
+ realm: z.ZodString;
2410
+ cid: z.ZodString;
2411
+ id: z.ZodString;
2412
+ by: z.ZodObject<{
2413
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2414
+ device: z.ZodString;
2415
+ agent: z.ZodOptional<z.ZodString>;
2416
+ }, z.core.$strict>;
2417
+ ts: z.ZodNumber;
2418
+ opHead: z.ZodObject<{
2419
+ seq: z.ZodNumber;
2420
+ hash: z.ZodString;
2421
+ }, z.core.$strict>;
2422
+ seen: z.ZodOptional<z.ZodObject<{
2423
+ seq: z.ZodNumber;
2424
+ hash: z.ZodString;
2425
+ }, z.core.$strict>>;
2426
+ }, z.core.$strict>], "class">;
2427
+ }, z.core.$strict>;
2428
+ export type ConvLogEntry = z.infer<typeof ConvLogEntry>;
2429
+ /**
2430
+ * A `msg` entry whose body the relay pruned after the retention (spec §16.4): its seq, its prev and the digest
2431
+ * SHA-256(JCS(event)), so the chain stays verifiable (`ConvLog.applyExpired`). An op is never served this way.
2432
+ */
2433
+ export declare const ConvExpiredEntry: z.ZodObject<{
2434
+ seq: z.ZodNumber;
2435
+ prev: z.ZodString;
2436
+ digest: z.ZodString;
2437
+ }, z.core.$strict>;
2438
+ export type ConvExpiredEntry = z.infer<typeof ConvExpiredEntry>;
2439
+ /** What `conv.fetch` serves for one seq: the entry, or its digest once expired. */
2440
+ export declare const ConvServedEntry: z.ZodUnion<readonly [z.ZodObject<{
2441
+ seq: z.ZodNumber;
2442
+ prev: z.ZodString;
2443
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
2444
+ class: z.ZodLiteral<"op">;
2445
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
2446
+ op: z.ZodLiteral<"create">;
2447
+ kind: z.ZodEnum<{
2448
+ self: "self";
2449
+ channel: "channel";
2450
+ group: "group";
2451
+ dm: "dm";
2452
+ }>;
2453
+ visibility: z.ZodOptional<z.ZodEnum<{
2454
+ public: "public";
2455
+ private: "private";
2456
+ }>>;
2457
+ history: z.ZodEnum<{
2458
+ none: "none";
2459
+ shared: "shared";
2460
+ }>;
2461
+ retainDays: z.ZodNumber;
2462
+ org: z.ZodOptional<z.ZodString>;
2463
+ participants: z.ZodArray<z.ZodObject<{
2464
+ p: z.ZodString;
2465
+ role: z.ZodEnum<{
2466
+ admin: "admin";
2467
+ member: "member";
2468
+ owner: "owner";
2469
+ guest: "guest";
2470
+ }>;
2471
+ device: z.ZodOptional<z.ZodString>;
2472
+ respondTo: z.ZodOptional<z.ZodEnum<{
2473
+ self: "self";
2474
+ none: "none";
2475
+ members: "members";
2476
+ }>>;
2477
+ }, z.core.$strict>>;
2478
+ post: z.ZodOptional<z.ZodEnum<{
2479
+ admins: "admins";
2480
+ all: "all";
2481
+ }>>;
2482
+ invite: z.ZodOptional<z.ZodEnum<{
2483
+ admins: "admins";
1488
2484
  all: "all";
2485
+ }>>;
2486
+ pins: z.ZodOptional<z.ZodEnum<{
1489
2487
  admins: "admins";
2488
+ all: "all";
1490
2489
  }>>;
1491
2490
  sealedMeta: z.ZodOptional<z.ZodString>;
2491
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
1492
2492
  }, z.core.$strict>, z.ZodObject<{
1493
2493
  op: z.ZodLiteral<"add">;
1494
2494
  participants: z.ZodArray<z.ZodObject<{
@@ -1508,6 +2508,112 @@ export declare const ConvLogEntry: z.ZodObject<{
1508
2508
  }, z.core.$strict>>;
1509
2509
  }, z.core.$strict>, z.ZodObject<{
1510
2510
  op: z.ZodLiteral<"accept">;
2511
+ invitation: z.ZodOptional<z.ZodObject<{
2512
+ v: z.ZodLiteral<"messaging/1">;
2513
+ realm: z.ZodString;
2514
+ cid: z.ZodString;
2515
+ id: z.ZodString;
2516
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2517
+ inviter: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2518
+ by: z.ZodString;
2519
+ head: z.ZodObject<{
2520
+ seq: z.ZodNumber;
2521
+ hash: z.ZodString;
2522
+ }, z.core.$strict>;
2523
+ issuedAt: z.ZodNumber;
2524
+ expiresAt: z.ZodNumber;
2525
+ kind: z.ZodEnum<{
2526
+ channel: "channel";
2527
+ group: "group";
2528
+ }>;
2529
+ history: z.ZodEnum<{
2530
+ none: "none";
2531
+ shared: "shared";
2532
+ }>;
2533
+ agentContext: z.ZodEnum<{
2534
+ none: "none";
2535
+ members: "members";
2536
+ seats: "seats";
2537
+ }>;
2538
+ bridges: z.ZodEnum<{
2539
+ none: "none";
2540
+ members: "members";
2541
+ admins: "admins";
2542
+ }>;
2543
+ audience: z.ZodArray<z.ZodObject<{
2544
+ p: z.ZodString;
2545
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2546
+ role: z.ZodEnum<{
2547
+ admin: "admin";
2548
+ member: "member";
2549
+ owner: "owner";
2550
+ guest: "guest";
2551
+ }>;
2552
+ state: z.ZodEnum<{
2553
+ member: "member";
2554
+ invited: "invited";
2555
+ }>;
2556
+ }, z.core.$strict>>;
2557
+ sig: z.ZodString;
2558
+ }, z.core.$strict>>;
2559
+ }, z.core.$strict>, z.ZodObject<{
2560
+ op: z.ZodLiteral<"activate">;
2561
+ proof: z.ZodUnion<readonly [z.ZodObject<{
2562
+ descriptor: z.ZodObject<{
2563
+ id: z.ZodString;
2564
+ issuedAt: z.ZodNumber;
2565
+ expiresAt: z.ZodNumber;
2566
+ commitment: z.ZodString;
2567
+ by: z.ZodString;
2568
+ sig: z.ZodString;
2569
+ v: z.ZodLiteral<"messaging/1">;
2570
+ realm: z.ZodString;
2571
+ cid: z.ZodString;
2572
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2573
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2574
+ }, z.core.$strict>;
2575
+ decision: z.ZodObject<{
2576
+ id: z.ZodString;
2577
+ descriptor: z.ZodString;
2578
+ answer: z.ZodEnum<{
2579
+ accept: "accept";
2580
+ decline: "decline";
2581
+ }>;
2582
+ at: z.ZodNumber;
2583
+ by: z.ZodString;
2584
+ sig: z.ZodString;
2585
+ v: z.ZodLiteral<"messaging/1">;
2586
+ realm: z.ZodString;
2587
+ cid: z.ZodString;
2588
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2589
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2590
+ }, z.core.$strict>;
2591
+ }, z.core.$strict>, z.ZodObject<{
2592
+ contacts: z.ZodTuple<[z.ZodObject<{
2593
+ at: z.ZodNumber;
2594
+ by: z.ZodString;
2595
+ sig: z.ZodString;
2596
+ v: z.ZodLiteral<"messaging/1">;
2597
+ realm: z.ZodString;
2598
+ cid: z.ZodString;
2599
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2600
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2601
+ }, z.core.$strict>, z.ZodObject<{
2602
+ at: z.ZodNumber;
2603
+ by: z.ZodString;
2604
+ sig: z.ZodString;
2605
+ v: z.ZodLiteral<"messaging/1">;
2606
+ realm: z.ZodString;
2607
+ cid: z.ZodString;
2608
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2609
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2610
+ }, z.core.$strict>], null>;
2611
+ }, z.core.$strict>]>;
2612
+ }, z.core.$strict>, z.ZodObject<{
2613
+ op: z.ZodLiteral<"request.complete">;
2614
+ request: z.ZodString;
2615
+ seq: z.ZodNumber;
2616
+ digest: z.ZodString;
1511
2617
  }, z.core.$strict>, z.ZodObject<{
1512
2618
  op: z.ZodLiteral<"join">;
1513
2619
  }, z.core.$strict>, z.ZodObject<{
@@ -1545,16 +2651,16 @@ export declare const ConvLogEntry: z.ZodObject<{
1545
2651
  }>>;
1546
2652
  retainDays: z.ZodOptional<z.ZodNumber>;
1547
2653
  post: z.ZodOptional<z.ZodEnum<{
1548
- all: "all";
1549
2654
  admins: "admins";
2655
+ all: "all";
1550
2656
  }>>;
1551
2657
  invite: z.ZodOptional<z.ZodEnum<{
1552
- all: "all";
1553
2658
  admins: "admins";
2659
+ all: "all";
1554
2660
  }>>;
1555
2661
  pins: z.ZodOptional<z.ZodEnum<{
1556
- all: "all";
1557
2662
  admins: "admins";
2663
+ all: "all";
1558
2664
  }>>;
1559
2665
  }, z.core.$strict>, z.ZodObject<{
1560
2666
  op: z.ZodLiteral<"archive">;
@@ -1569,6 +2675,37 @@ export declare const ConvLogEntry: z.ZodObject<{
1569
2675
  settings: "settings";
1570
2676
  schedule: "schedule";
1571
2677
  }>;
2678
+ device: z.ZodOptional<z.ZodString>;
2679
+ until: z.ZodOptional<z.ZodNumber>;
2680
+ }, z.core.$strict>, z.ZodObject<{
2681
+ op: z.ZodLiteral<"policy">;
2682
+ agentContext: z.ZodOptional<z.ZodEnum<{
2683
+ none: "none";
2684
+ members: "members";
2685
+ seats: "seats";
2686
+ }>>;
2687
+ bridges: z.ZodOptional<z.ZodEnum<{
2688
+ none: "none";
2689
+ members: "members";
2690
+ admins: "admins";
2691
+ }>>;
2692
+ }, z.core.$strict>, z.ZodObject<{
2693
+ op: z.ZodLiteral<"meta">;
2694
+ epoch: z.ZodNumber;
2695
+ idx: z.ZodNumber;
2696
+ sealed: z.ZodString;
2697
+ }, z.core.$strict>, z.ZodObject<{
2698
+ op: z.ZodLiteral<"setting">;
2699
+ kind: z.ZodEnum<{
2700
+ link: "link";
2701
+ prefs: "prefs";
2702
+ grant: "grant";
2703
+ context: "context";
2704
+ localRetention: "localRetention";
2705
+ }>;
2706
+ epoch: z.ZodNumber;
2707
+ idx: z.ZodNumber;
2708
+ sealed: z.ZodString;
1572
2709
  }, z.core.$strict>], "op">;
1573
2710
  sig: z.ZodString;
1574
2711
  v: z.ZodLiteral<"messaging/1">;
@@ -1594,6 +2731,7 @@ export declare const ConvLogEntry: z.ZodObject<{
1594
2731
  epoch: z.ZodNumber;
1595
2732
  idx: z.ZodNumber;
1596
2733
  wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
2734
+ request: z.ZodOptional<z.ZodString>;
1597
2735
  body: z.ZodString;
1598
2736
  sig: z.ZodString;
1599
2737
  v: z.ZodLiteral<"messaging/1">;
@@ -1614,18 +2752,26 @@ export declare const ConvLogEntry: z.ZodObject<{
1614
2752
  seq: z.ZodNumber;
1615
2753
  hash: z.ZodString;
1616
2754
  }, z.core.$strict>>;
1617
- }, z.core.$strict>, z.ZodObject<{
2755
+ }, z.core.$strict>], "class">;
2756
+ }, z.core.$strict>, z.ZodObject<{
2757
+ seq: z.ZodNumber;
2758
+ prev: z.ZodString;
2759
+ digest: z.ZodString;
2760
+ }, z.core.$strict>]>;
2761
+ export type ConvServedEntry = z.infer<typeof ConvServedEntry>;
2762
+ /** A key share as the relay serves it to its recipient: `n` orders the recipient's shares of one conversation. */
2763
+ export declare const ConvShareEntry: z.ZodObject<{
2764
+ n: z.ZodNumber;
2765
+ event: z.ZodObject<{
1618
2766
  class: z.ZodLiteral<"keys">;
1619
2767
  body: z.ZodObject<{
1620
- shares: z.ZodArray<z.ZodObject<{
1621
- to: z.ZodObject<{
1622
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1623
- device: z.ZodString;
1624
- }, z.core.$strict>;
1625
- epk: z.ZodString;
1626
- nonce: z.ZodString;
1627
- ct: z.ZodString;
1628
- }, z.core.$strict>>;
2768
+ to: z.ZodObject<{
2769
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2770
+ device: z.ZodString;
2771
+ }, z.core.$strict>;
2772
+ epk: z.ZodString;
2773
+ nonce: z.ZodString;
2774
+ ct: z.ZodString;
1629
2775
  }, z.core.$strict>;
1630
2776
  sig: z.ZodString;
1631
2777
  v: z.ZodLiteral<"messaging/1">;
@@ -1646,9 +2792,9 @@ export declare const ConvLogEntry: z.ZodObject<{
1646
2792
  seq: z.ZodNumber;
1647
2793
  hash: z.ZodString;
1648
2794
  }, z.core.$strict>>;
1649
- }, z.core.$strict>], "class">;
2795
+ }, z.core.$strict>;
1650
2796
  }, z.core.$strict>;
1651
- export type ConvLogEntry = z.infer<typeof ConvLogEntry>;
2797
+ export type ConvShareEntry = z.infer<typeof ConvShareEntry>;
1652
2798
  /** A log position: a seq and h(seq). */
1653
2799
  export declare const ConvHead: z.ZodObject<{
1654
2800
  seq: z.ZodNumber;