@joe-broadhead/messaging 0.7.0 → 0.8.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 (97) hide show
  1. package/CHANGELOG.md +259 -2
  2. package/dist/bin/messaging-mcp.js +5484 -3858
  3. package/dist/bin/messaging-relay.js +4728 -1136
  4. package/dist/bin/messaging.js +4616 -2807
  5. package/dist/bin/messagingd.js +16451 -9444
  6. package/dist/lib/modules/core/agent/operations.js +19 -327
  7. package/dist/lib/modules/core/agent/present.js +15 -55
  8. package/dist/lib/modules/core/agent-tools.js +46 -143
  9. package/dist/lib/modules/core/consent.js +1 -1
  10. package/dist/lib/modules/core/conversation/context.js +80 -0
  11. package/dist/lib/modules/core/conversation/event.js +125 -0
  12. package/dist/lib/modules/core/conversation/guest-invitation.js +42 -0
  13. package/dist/lib/modules/core/conversation/ids.js +38 -0
  14. package/dist/lib/modules/core/conversation/link.js +35 -0
  15. package/dist/lib/modules/core/conversation/log.js +988 -0
  16. package/dist/lib/modules/core/conversation/ratchet.js +243 -0
  17. package/dist/lib/modules/core/conversation/request-log.js +158 -0
  18. package/dist/lib/modules/core/conversation/request-seal.js +41 -0
  19. package/dist/lib/modules/core/conversation/requests.js +87 -0
  20. package/dist/lib/modules/core/conversation/seal.js +251 -0
  21. package/dist/lib/modules/core/conversation-agent-tools.js +69 -0
  22. package/dist/lib/modules/core/federation/directory-proof.js +83 -0
  23. package/dist/lib/modules/core/federation/proof-state.js +167 -0
  24. package/dist/lib/modules/core/federation/roster-proof.js +74 -0
  25. package/dist/lib/modules/core/index.js +16 -2
  26. package/dist/lib/modules/core/jelly-host.js +5 -5
  27. package/dist/lib/modules/core/schema/common.js +85 -3
  28. package/dist/lib/modules/core/schema/consent.js +5 -4
  29. package/dist/lib/modules/core/schema/contact-request.js +22 -0
  30. package/dist/lib/modules/core/schema/conv-frames.js +94 -0
  31. package/dist/lib/modules/core/schema/conversation.js +326 -0
  32. package/dist/lib/modules/core/schema/envelope.js +8 -24
  33. package/dist/lib/modules/core/schema/errors.js +42 -2
  34. package/dist/lib/modules/core/schema/guest-invitation.js +13 -0
  35. package/dist/lib/modules/core/schema/index.js +6 -0
  36. package/dist/lib/modules/core/schema/ipc/consent.js +13 -9
  37. package/dist/lib/modules/core/schema/ipc/conversation-views.js +80 -0
  38. package/dist/lib/modules/core/schema/ipc/conversations.js +128 -0
  39. package/dist/lib/modules/core/schema/ipc/device.js +2 -0
  40. package/dist/lib/modules/core/schema/ipc/jelly.js +3 -38
  41. package/dist/lib/modules/core/schema/ipc/shapes.js +14 -72
  42. package/dist/lib/modules/core/schema/ipc/surfaces.js +12 -195
  43. package/dist/lib/modules/core/schema/ipc/tasks.js +31 -0
  44. package/dist/lib/modules/core/schema/ipc.js +18 -44
  45. package/dist/lib/modules/core/testing.js +1 -0
  46. package/dist/lib/modules/core/version.js +1 -1
  47. package/dist/lib/modules/ipc/client.js +10 -2
  48. package/dist/lib/modules/ipc/server.js +14 -5
  49. package/dist/lib/modules/ipc/testing.js +13 -23
  50. package/dist/spec/messaging-v1.md +835 -380
  51. package/dist/third-party-notices.md +1 -1
  52. package/dist/third-party.json +1 -1
  53. package/dist/types/core/agent/operations.d.ts +5 -52
  54. package/dist/types/core/agent/present.d.ts +6 -21
  55. package/dist/types/core/agent-tools.d.ts +277 -438
  56. package/dist/types/core/conversation/context.d.ts +56 -0
  57. package/dist/types/core/conversation/event.d.ts +36 -0
  58. package/dist/types/core/conversation/guest-invitation.d.ts +8 -0
  59. package/dist/types/core/conversation/ids.d.ts +18 -0
  60. package/dist/types/core/conversation/link.d.ts +16 -0
  61. package/dist/types/core/conversation/log.d.ts +157 -0
  62. package/dist/types/core/conversation/ratchet.d.ts +95 -0
  63. package/dist/types/core/conversation/request-log.d.ts +24 -0
  64. package/dist/types/core/conversation/request-seal.d.ts +6 -0
  65. package/dist/types/core/conversation/requests.d.ts +14 -0
  66. package/dist/types/core/conversation/seal.d.ts +70 -0
  67. package/dist/types/core/conversation-agent-tools.d.ts +918 -0
  68. package/dist/types/core/federation/directory-proof.d.ts +8 -0
  69. package/dist/types/core/federation/proof-state.d.ts +114 -0
  70. package/dist/types/core/federation/roster-proof.d.ts +7 -0
  71. package/dist/types/core/index.d.ts +15 -3
  72. package/dist/types/core/jelly-host.d.ts +1 -1
  73. package/dist/types/core/schema/common.d.ts +85 -4
  74. package/dist/types/core/schema/consent.d.ts +7 -7
  75. package/dist/types/core/schema/contact-request.d.ts +264 -0
  76. package/dist/types/core/schema/conv-frames.d.ts +1200 -0
  77. package/dist/types/core/schema/conversation.d.ts +2803 -0
  78. package/dist/types/core/schema/envelope.d.ts +89 -130
  79. package/dist/types/core/schema/errors.d.ts +40 -0
  80. package/dist/types/core/schema/guest-invitation.d.ts +51 -0
  81. package/dist/types/core/schema/index.d.ts +6 -0
  82. package/dist/types/core/schema/ipc/consent.d.ts +89 -49
  83. package/dist/types/core/schema/ipc/conversation-views.d.ts +1023 -0
  84. package/dist/types/core/schema/ipc/conversations.d.ts +3987 -0
  85. package/dist/types/core/schema/ipc/device.d.ts +10 -0
  86. package/dist/types/core/schema/ipc/jelly.d.ts +2 -105
  87. package/dist/types/core/schema/ipc/shapes.d.ts +16 -95
  88. package/dist/types/core/schema/ipc/surfaces.d.ts +28 -424
  89. package/dist/types/core/schema/ipc/tasks.d.ts +208 -0
  90. package/dist/types/core/schema/ipc.d.ts +2684 -523
  91. package/dist/types/core/schema/relay.d.ts +20 -4
  92. package/dist/types/core/testing.d.ts +1 -0
  93. package/dist/types/core/version.d.ts +1 -1
  94. package/dist/types/ipc/client.d.ts +4 -1
  95. package/dist/types/ipc/server.d.ts +10 -1
  96. package/dist/types/ipc/testing.d.ts +21 -8
  97. package/package.json +1 -1
@@ -0,0 +1,2803 @@
1
+ /**
2
+ * Conversations (spec §16): one log per conversation, sequenced by the relay, hash-chained and signed per event;
3
+ * sender keys for message bodies; pairwise sealed key shares; a person's `self` conversation; and the person's
4
+ * context rules for their agents. Every object is strict: an unknown member fails the schema.
5
+ *
6
+ * sig = Ed25519(by.device, DOMAIN.convEvent + JCS(event without sig))
7
+ * h(0) = SHA-256(DOMAIN.convGenesis + JCS(cid))
8
+ * h(seq) = SHA-256(h(seq − 1) ‖ SHA-256(JCS(event))), over the raw 32-byte digests
9
+ * dm id = "d_" + base32lower(SHA-256(DOMAIN.dm + JCS([a, b] sorted)))[0..26]
10
+ * self id= "s_" + base32lower(SHA-256(DOMAIN.self + JCS(person)))[0..26]
11
+ *
12
+ * The authority rules over these shapes are `ConvLog.apply`'s (spec §16.7).
13
+ */
14
+ import { z } from "zod";
15
+ /** A person, or one agent of a person (`person/agent`). Every agent belongs to one person. */
16
+ export declare const ParticipantId: z.ZodString;
17
+ export type ParticipantId = z.infer<typeof ParticipantId>;
18
+ /** `d_…` a dm (derived), `s_…` a person's `self` conversation (derived), `c_` + ULID a group or channel. */
19
+ export declare const ConvId: z.ZodString;
20
+ export type ConvId = z.infer<typeof ConvId>;
21
+ export declare const ConvKind: z.ZodEnum<{
22
+ self: "self";
23
+ channel: "channel";
24
+ group: "group";
25
+ dm: "dm";
26
+ }>;
27
+ export type ConvKind = z.infer<typeof ConvKind>;
28
+ /** Channels only; every other kind is private. */
29
+ export declare const Visibility: z.ZodEnum<{
30
+ public: "public";
31
+ private: "private";
32
+ }>;
33
+ export type Visibility = z.infer<typeof Visibility>;
34
+ /** What a late joiner may read: `shared` gets earlier chain keys, `none` reads from its add onwards. */
35
+ export declare const HistoryPolicy: z.ZodEnum<{
36
+ none: "none";
37
+ shared: "shared";
38
+ }>;
39
+ export type HistoryPolicy = z.infer<typeof HistoryPolicy>;
40
+ export declare const ConvRole: z.ZodEnum<{
41
+ admin: "admin";
42
+ member: "member";
43
+ owner: "owner";
44
+ guest: "guest";
45
+ }>;
46
+ export type ConvRole = z.infer<typeof ConvRole>;
47
+ /** Who may do a thing in a group or channel. */
48
+ export declare const Permit: z.ZodEnum<{
49
+ admins: "admins";
50
+ all: "all";
51
+ }>;
52
+ export type Permit = z.infer<typeof Permit>;
53
+ /** Which mentions wake a seated agent: its own person's, any member's (under consent), or none. */
54
+ export declare const RespondTo: z.ZodEnum<{
55
+ self: "self";
56
+ none: "none";
57
+ members: "members";
58
+ }>;
59
+ export type RespondTo = z.infer<typeof RespondTo>;
60
+ /** A conversation's policy for members' agents mining it as context (spec §16.8). */
61
+ export declare const AgentContext: z.ZodEnum<{
62
+ none: "none";
63
+ members: "members";
64
+ seats: "seats";
65
+ }>;
66
+ export type AgentContext = z.infer<typeof AgentContext>;
67
+ /** Why a sender epoch ends. */
68
+ export declare const RekeyCause: z.ZodEnum<{
69
+ device: "device";
70
+ removed: "removed";
71
+ added: "added";
72
+ settings: "settings";
73
+ schedule: "schedule";
74
+ }>;
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>;
104
+ /** A participant record as an op states it. `device` and `respondTo` are for agent participants only. */
105
+ export declare const Seat: z.ZodObject<{
106
+ p: z.ZodString;
107
+ role: z.ZodEnum<{
108
+ admin: "admin";
109
+ member: "member";
110
+ owner: "owner";
111
+ guest: "guest";
112
+ }>;
113
+ device: z.ZodOptional<z.ZodString>;
114
+ respondTo: z.ZodOptional<z.ZodEnum<{
115
+ self: "self";
116
+ none: "none";
117
+ members: "members";
118
+ }>>;
119
+ }, z.core.$strict>;
120
+ export type Seat = z.infer<typeof Seat>;
121
+ export declare const ConvOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
122
+ op: z.ZodLiteral<"create">;
123
+ kind: z.ZodEnum<{
124
+ self: "self";
125
+ channel: "channel";
126
+ group: "group";
127
+ dm: "dm";
128
+ }>;
129
+ visibility: z.ZodOptional<z.ZodEnum<{
130
+ public: "public";
131
+ private: "private";
132
+ }>>;
133
+ history: z.ZodEnum<{
134
+ none: "none";
135
+ shared: "shared";
136
+ }>;
137
+ retainDays: z.ZodNumber;
138
+ org: z.ZodOptional<z.ZodString>;
139
+ participants: z.ZodArray<z.ZodObject<{
140
+ p: z.ZodString;
141
+ role: z.ZodEnum<{
142
+ admin: "admin";
143
+ member: "member";
144
+ owner: "owner";
145
+ guest: "guest";
146
+ }>;
147
+ device: z.ZodOptional<z.ZodString>;
148
+ respondTo: z.ZodOptional<z.ZodEnum<{
149
+ self: "self";
150
+ none: "none";
151
+ members: "members";
152
+ }>>;
153
+ }, z.core.$strict>>;
154
+ post: z.ZodOptional<z.ZodEnum<{
155
+ admins: "admins";
156
+ all: "all";
157
+ }>>;
158
+ invite: z.ZodOptional<z.ZodEnum<{
159
+ admins: "admins";
160
+ all: "all";
161
+ }>>;
162
+ pins: z.ZodOptional<z.ZodEnum<{
163
+ admins: "admins";
164
+ all: "all";
165
+ }>>;
166
+ sealedMeta: z.ZodOptional<z.ZodString>;
167
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
168
+ }, z.core.$strict>, z.ZodObject<{
169
+ op: z.ZodLiteral<"add">;
170
+ participants: z.ZodArray<z.ZodObject<{
171
+ p: z.ZodString;
172
+ role: z.ZodEnum<{
173
+ admin: "admin";
174
+ member: "member";
175
+ owner: "owner";
176
+ guest: "guest";
177
+ }>;
178
+ device: z.ZodOptional<z.ZodString>;
179
+ respondTo: z.ZodOptional<z.ZodEnum<{
180
+ self: "self";
181
+ none: "none";
182
+ members: "members";
183
+ }>>;
184
+ }, z.core.$strict>>;
185
+ }, z.core.$strict>, z.ZodObject<{
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;
293
+ }, z.core.$strict>, z.ZodObject<{
294
+ op: z.ZodLiteral<"join">;
295
+ }, z.core.$strict>, z.ZodObject<{
296
+ op: z.ZodLiteral<"leave">;
297
+ }, z.core.$strict>, z.ZodObject<{
298
+ op: z.ZodLiteral<"remove">;
299
+ participants: z.ZodArray<z.ZodString>;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ op: z.ZodLiteral<"role">;
302
+ p: z.ZodString;
303
+ role: z.ZodEnum<{
304
+ admin: "admin";
305
+ member: "member";
306
+ owner: "owner";
307
+ guest: "guest";
308
+ }>;
309
+ }, z.core.$strict>, z.ZodObject<{
310
+ op: z.ZodLiteral<"seat">;
311
+ p: z.ZodString;
312
+ device: z.ZodOptional<z.ZodString>;
313
+ respondTo: z.ZodOptional<z.ZodEnum<{
314
+ self: "self";
315
+ none: "none";
316
+ members: "members";
317
+ }>>;
318
+ }, z.core.$strict>, z.ZodObject<{
319
+ op: z.ZodLiteral<"settings">;
320
+ visibility: z.ZodOptional<z.ZodEnum<{
321
+ public: "public";
322
+ private: "private";
323
+ }>>;
324
+ history: z.ZodOptional<z.ZodEnum<{
325
+ none: "none";
326
+ shared: "shared";
327
+ }>>;
328
+ retainDays: z.ZodOptional<z.ZodNumber>;
329
+ post: z.ZodOptional<z.ZodEnum<{
330
+ admins: "admins";
331
+ all: "all";
332
+ }>>;
333
+ invite: z.ZodOptional<z.ZodEnum<{
334
+ admins: "admins";
335
+ all: "all";
336
+ }>>;
337
+ pins: z.ZodOptional<z.ZodEnum<{
338
+ admins: "admins";
339
+ all: "all";
340
+ }>>;
341
+ }, z.core.$strict>, z.ZodObject<{
342
+ op: z.ZodLiteral<"archive">;
343
+ on: z.ZodBoolean;
344
+ }, z.core.$strict>, z.ZodObject<{
345
+ op: z.ZodLiteral<"rekey">;
346
+ epoch: z.ZodNumber;
347
+ cause: z.ZodEnum<{
348
+ device: "device";
349
+ removed: "removed";
350
+ added: "added";
351
+ settings: "settings";
352
+ schedule: "schedule";
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;
385
+ }, z.core.$strict>], "op">;
386
+ export type ConvOp = z.infer<typeof ConvOp>;
387
+ export type ConvOpName = ConvOp["op"];
388
+ /** The plaintext of `create.sealedMeta` and of a `meta` body's fields. */
389
+ export declare const ConvMeta: z.ZodObject<{
390
+ name: z.ZodOptional<z.ZodString>;
391
+ topic: z.ZodOptional<z.ZodString>;
392
+ purpose: z.ZodOptional<z.ZodString>;
393
+ }, z.core.$strict>;
394
+ export type ConvMeta = z.infer<typeof ConvMeta>;
395
+ export declare const Mention: z.ZodUnion<readonly [z.ZodObject<{
396
+ p: z.ZodString;
397
+ }, z.core.$strict>, z.ZodObject<{
398
+ all: z.ZodLiteral<"channel">;
399
+ }, z.core.$strict>, z.ZodObject<{
400
+ all: z.ZodLiteral<"here">;
401
+ }, z.core.$strict>]>;
402
+ export type Mention = z.infer<typeof Mention>;
403
+ /** A file in the relay's blob store, sealed under its own AES-256-GCM key. The shape only; files land later. */
404
+ export declare const Attachment: z.ZodObject<{
405
+ blob: z.ZodString;
406
+ key: z.ZodString;
407
+ nonce: z.ZodString;
408
+ sha256: z.ZodString;
409
+ bytes: z.ZodNumber;
410
+ mime: z.ZodString;
411
+ name: z.ZodString;
412
+ thumb: z.ZodOptional<z.ZodString>;
413
+ }, z.core.$strict>;
414
+ export type Attachment = z.infer<typeof Attachment>;
415
+ /** A line's provenance when its person wrote it from a linked channel. Signed and sealed with the event. */
416
+ export declare const Via: z.ZodObject<{
417
+ channel: z.ZodEnum<{
418
+ telegram: "telegram";
419
+ slack: "slack";
420
+ }>;
421
+ }, z.core.$strict>;
422
+ export type Via = z.infer<typeof Via>;
423
+ /**
424
+ * A person's linked channel, as a human-tier device records it in the person's `self` conversation (never the
425
+ * device log, which is public). `account` is the channel's own id for the person's account (Telegram `from.id`;
426
+ * Slack `team/user`); it exists only inside the sealed `self` conversation. The proof is the one-time code's digest
427
+ * and the six-digit code the person saw match on both sides. `revokedAt` ends it; the last writer wins by `seq`.
428
+ */
429
+ export declare const LinkRecord: z.ZodObject<{
430
+ id: z.ZodString;
431
+ channel: z.ZodEnum<{
432
+ telegram: "telegram";
433
+ slack: "slack";
434
+ }>;
435
+ account: z.ZodString;
436
+ host: z.ZodString;
437
+ proof: z.ZodObject<{
438
+ method: z.ZodLiteral<"code-sas">;
439
+ codeDigest: z.ZodString;
440
+ sas: z.ZodString;
441
+ }, z.core.$strict>;
442
+ authority: z.ZodArray<z.ZodEnum<{
443
+ chat: "chat";
444
+ view: "view";
445
+ }>>;
446
+ linkedAt: z.ZodNumber;
447
+ revokedAt: z.ZodOptional<z.ZodNumber>;
448
+ }, z.core.$strict>;
449
+ export type LinkRecord = z.infer<typeof LinkRecord>;
450
+ /**
451
+ * Who can read a piece of content, for the audience guard: a person, or a linked channel's provider as
452
+ * `ext:<channel>:<link id>`. Not on the wire; the guard's reader sets are typed with it.
453
+ */
454
+ export declare const ReaderId: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
455
+ export type ReaderId = z.infer<typeof ReaderId>;
456
+ export declare const ReaderSet: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
457
+ export type ReaderSet = z.infer<typeof ReaderSet>;
458
+ export declare const ReceiptStage: z.ZodEnum<{
459
+ delivered: "delivered";
460
+ handed_to_agent: "handed_to_agent";
461
+ read: "read";
462
+ }>;
463
+ export type ReceiptStage = z.infer<typeof ReceiptStage>;
464
+ /**
465
+ * A task as a thread (spec §16.3): `request` is the thread root, from the requester to an agent participant;
466
+ * `status` and `artifact` come from that agent; `cancel` and `followUp` from the requester.
467
+ */
468
+ export declare const TaskEventBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
469
+ k: z.ZodLiteral<"request">;
470
+ to: z.ZodString;
471
+ message: z.ZodObject<{
472
+ messageId: z.ZodString;
473
+ contextId: z.ZodOptional<z.ZodString>;
474
+ taskId: z.ZodOptional<z.ZodString>;
475
+ role: z.ZodEnum<{
476
+ ROLE_USER: "ROLE_USER";
477
+ ROLE_AGENT: "ROLE_AGENT";
478
+ }>;
479
+ parts: z.ZodArray<z.ZodObject<{
480
+ text: z.ZodOptional<z.ZodString>;
481
+ raw: z.ZodOptional<z.ZodString>;
482
+ url: z.ZodOptional<z.ZodString>;
483
+ data: z.ZodOptional<z.ZodUnknown>;
484
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
485
+ filename: z.ZodOptional<z.ZodString>;
486
+ mediaType: z.ZodOptional<z.ZodString>;
487
+ }, z.core.$strip>>;
488
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
489
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
490
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
491
+ }, z.core.$strip>;
492
+ delegation: z.ZodArray<z.ZodObject<{
493
+ realm: z.ZodString;
494
+ task: z.ZodString;
495
+ from: z.ZodString;
496
+ to: z.ZodString;
497
+ by: z.ZodString;
498
+ ts: z.ZodNumber;
499
+ exp: z.ZodNumber;
500
+ maxDepth: z.ZodNumber;
501
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
502
+ parent: z.ZodOptional<z.ZodString>;
503
+ sig: z.ZodString;
504
+ }, z.core.$loose>>;
505
+ }, z.core.$strict>, z.ZodObject<{
506
+ k: z.ZodLiteral<"status">;
507
+ root: z.ZodString;
508
+ update: z.ZodObject<{
509
+ taskId: z.ZodString;
510
+ contextId: z.ZodString;
511
+ status: z.ZodObject<{
512
+ state: z.ZodEnum<{
513
+ TASK_STATE_SUBMITTED: "TASK_STATE_SUBMITTED";
514
+ TASK_STATE_WORKING: "TASK_STATE_WORKING";
515
+ TASK_STATE_COMPLETED: "TASK_STATE_COMPLETED";
516
+ TASK_STATE_FAILED: "TASK_STATE_FAILED";
517
+ TASK_STATE_CANCELED: "TASK_STATE_CANCELED";
518
+ TASK_STATE_INPUT_REQUIRED: "TASK_STATE_INPUT_REQUIRED";
519
+ TASK_STATE_REJECTED: "TASK_STATE_REJECTED";
520
+ TASK_STATE_AUTH_REQUIRED: "TASK_STATE_AUTH_REQUIRED";
521
+ }>;
522
+ message: z.ZodOptional<z.ZodObject<{
523
+ messageId: z.ZodString;
524
+ contextId: z.ZodOptional<z.ZodString>;
525
+ taskId: z.ZodOptional<z.ZodString>;
526
+ role: z.ZodEnum<{
527
+ ROLE_USER: "ROLE_USER";
528
+ ROLE_AGENT: "ROLE_AGENT";
529
+ }>;
530
+ parts: z.ZodArray<z.ZodObject<{
531
+ text: z.ZodOptional<z.ZodString>;
532
+ raw: z.ZodOptional<z.ZodString>;
533
+ url: z.ZodOptional<z.ZodString>;
534
+ data: z.ZodOptional<z.ZodUnknown>;
535
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
536
+ filename: z.ZodOptional<z.ZodString>;
537
+ mediaType: z.ZodOptional<z.ZodString>;
538
+ }, z.core.$strip>>;
539
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
540
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
541
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
542
+ }, z.core.$strip>>;
543
+ timestamp: z.ZodOptional<z.ZodString>;
544
+ }, z.core.$strip>;
545
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
546
+ }, z.core.$strip>;
547
+ }, z.core.$strict>, z.ZodObject<{
548
+ k: z.ZodLiteral<"artifact">;
549
+ root: z.ZodString;
550
+ update: z.ZodObject<{
551
+ taskId: z.ZodString;
552
+ contextId: z.ZodString;
553
+ artifact: z.ZodObject<{
554
+ artifactId: z.ZodString;
555
+ name: z.ZodOptional<z.ZodString>;
556
+ description: z.ZodOptional<z.ZodString>;
557
+ parts: z.ZodArray<z.ZodObject<{
558
+ text: z.ZodOptional<z.ZodString>;
559
+ raw: z.ZodOptional<z.ZodString>;
560
+ url: z.ZodOptional<z.ZodString>;
561
+ data: z.ZodOptional<z.ZodUnknown>;
562
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
563
+ filename: z.ZodOptional<z.ZodString>;
564
+ mediaType: z.ZodOptional<z.ZodString>;
565
+ }, z.core.$strip>>;
566
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
567
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
568
+ }, z.core.$strip>;
569
+ append: z.ZodOptional<z.ZodBoolean>;
570
+ lastChunk: z.ZodOptional<z.ZodBoolean>;
571
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
572
+ }, z.core.$strip>;
573
+ }, z.core.$strict>, z.ZodObject<{
574
+ k: z.ZodLiteral<"cancel">;
575
+ root: z.ZodString;
576
+ reason: z.ZodOptional<z.ZodString>;
577
+ }, z.core.$strict>, z.ZodObject<{
578
+ k: z.ZodLiteral<"followUp">;
579
+ root: z.ZodString;
580
+ message: z.ZodObject<{
581
+ messageId: z.ZodString;
582
+ contextId: z.ZodOptional<z.ZodString>;
583
+ taskId: z.ZodOptional<z.ZodString>;
584
+ role: z.ZodEnum<{
585
+ ROLE_USER: "ROLE_USER";
586
+ ROLE_AGENT: "ROLE_AGENT";
587
+ }>;
588
+ parts: z.ZodArray<z.ZodObject<{
589
+ text: z.ZodOptional<z.ZodString>;
590
+ raw: z.ZodOptional<z.ZodString>;
591
+ url: z.ZodOptional<z.ZodString>;
592
+ data: z.ZodOptional<z.ZodUnknown>;
593
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
594
+ filename: z.ZodOptional<z.ZodString>;
595
+ mediaType: z.ZodOptional<z.ZodString>;
596
+ }, z.core.$strip>>;
597
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
598
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
599
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
600
+ }, z.core.$strip>;
601
+ }, z.core.$strict>], "k">;
602
+ export type TaskEventBody = z.infer<typeof TaskEventBody>;
603
+ export declare const ContextAccess: z.ZodEnum<{
604
+ allow: "allow";
605
+ ask: "ask";
606
+ off: "off";
607
+ }>;
608
+ export type ContextAccess = z.infer<typeof ContextAccess>;
609
+ export declare const ContextKind: z.ZodEnum<{
610
+ group: "group";
611
+ dm: "dm";
612
+ own: "own";
613
+ "channel.private": "channel.private";
614
+ "channel.public": "channel.public";
615
+ }>;
616
+ export type ContextKind = z.infer<typeof ContextKind>;
617
+ export declare const ContextScope: z.ZodUnion<readonly [z.ZodObject<{
618
+ cid: z.ZodString;
619
+ }, z.core.$strict>, z.ZodObject<{
620
+ kind: z.ZodEnum<{
621
+ group: "group";
622
+ dm: "dm";
623
+ own: "own";
624
+ "channel.private": "channel.private";
625
+ "channel.public": "channel.public";
626
+ }>;
627
+ }, z.core.$strict>]>;
628
+ export type ContextScope = z.infer<typeof ContextScope>;
629
+ /** One of a person's rules for which of their agents may mine which conversations (spec §16.8). */
630
+ export declare const ContextRule: z.ZodObject<{
631
+ agent: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
632
+ scope: z.ZodUnion<readonly [z.ZodObject<{
633
+ cid: z.ZodString;
634
+ }, z.core.$strict>, z.ZodObject<{
635
+ kind: z.ZodEnum<{
636
+ group: "group";
637
+ dm: "dm";
638
+ own: "own";
639
+ "channel.private": "channel.private";
640
+ "channel.public": "channel.public";
641
+ }>;
642
+ }, z.core.$strict>]>;
643
+ access: z.ZodEnum<{
644
+ allow: "allow";
645
+ ask: "ask";
646
+ off: "off";
647
+ }>;
648
+ lookbackDays: z.ZodOptional<z.ZodNumber>;
649
+ }, z.core.$strict>;
650
+ export type ContextRule = z.infer<typeof ContextRule>;
651
+ /** A person's whole rule set: at most one rule per (agent, scope). */
652
+ export declare const ContextRules: z.ZodArray<z.ZodObject<{
653
+ agent: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
654
+ scope: z.ZodUnion<readonly [z.ZodObject<{
655
+ cid: z.ZodString;
656
+ }, z.core.$strict>, z.ZodObject<{
657
+ kind: z.ZodEnum<{
658
+ group: "group";
659
+ dm: "dm";
660
+ own: "own";
661
+ "channel.private": "channel.private";
662
+ "channel.public": "channel.public";
663
+ }>;
664
+ }, z.core.$strict>]>;
665
+ access: z.ZodEnum<{
666
+ allow: "allow";
667
+ ask: "ask";
668
+ off: "off";
669
+ }>;
670
+ lookbackDays: z.ZodOptional<z.ZodNumber>;
671
+ }, z.core.$strict>>;
672
+ export type ContextRules = z.infer<typeof ContextRules>;
673
+ /** One sender chain at one index: `ck` is the chain key for message `idx` of `device`'s chain in `epoch`. */
674
+ export declare const KeyShare: z.ZodObject<{
675
+ epoch: z.ZodNumber;
676
+ device: z.ZodString;
677
+ idx: z.ZodNumber;
678
+ ck: z.ZodString;
679
+ }, z.core.$strict>;
680
+ export type KeyShare = z.infer<typeof KeyShare>;
681
+ /** The plaintext of one recipient's sealed share in a `keys` event. */
682
+ export declare const KeySharePayload: z.ZodObject<{
683
+ shares: z.ZodArray<z.ZodObject<{
684
+ epoch: z.ZodNumber;
685
+ device: z.ZodString;
686
+ idx: z.ZodNumber;
687
+ ck: z.ZodString;
688
+ }, z.core.$strict>>;
689
+ }, z.core.$strict>;
690
+ export type KeySharePayload = z.infer<typeof KeySharePayload>;
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
+ */
695
+ export declare const SyncBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
696
+ s: z.ZodLiteral<"read">;
697
+ cid: z.ZodString;
698
+ upTo: z.ZodNumber;
699
+ thread: z.ZodOptional<z.ZodString>;
700
+ }, z.core.$strict>, z.ZodObject<{
701
+ s: z.ZodLiteral<"unread">;
702
+ cid: z.ZodString;
703
+ from: z.ZodNumber;
704
+ }, z.core.$strict>, z.ZodObject<{
705
+ s: z.ZodLiteral<"follow">;
706
+ cid: z.ZodString;
707
+ thread: z.ZodString;
708
+ on: z.ZodBoolean;
709
+ }, z.core.$strict>, z.ZodObject<{
710
+ s: z.ZodLiteral<"save">;
711
+ cid: z.ZodString;
712
+ target: z.ZodString;
713
+ on: z.ZodBoolean;
714
+ }, z.core.$strict>, z.ZodObject<{
715
+ s: z.ZodLiteral<"draft">;
716
+ cid: z.ZodString;
717
+ thread: z.ZodOptional<z.ZodString>;
718
+ text: z.ZodString;
719
+ }, z.core.$strict>, z.ZodObject<{
720
+ s: z.ZodLiteral<"joined">;
721
+ cid: z.ZodString;
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>;
748
+ }, z.core.$strict>, z.ZodObject<{
749
+ s: z.ZodLiteral<"grant">;
750
+ grant: z.ZodRecord<z.ZodString, z.ZodUnknown>;
751
+ }, z.core.$strict>, z.ZodObject<{
752
+ s: z.ZodLiteral<"context">;
753
+ rules: z.ZodArray<z.ZodObject<{
754
+ agent: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
755
+ scope: z.ZodUnion<readonly [z.ZodObject<{
756
+ cid: z.ZodString;
757
+ }, z.core.$strict>, z.ZodObject<{
758
+ kind: z.ZodEnum<{
759
+ group: "group";
760
+ dm: "dm";
761
+ own: "own";
762
+ "channel.private": "channel.private";
763
+ "channel.public": "channel.public";
764
+ }>;
765
+ }, z.core.$strict>]>;
766
+ access: z.ZodEnum<{
767
+ allow: "allow";
768
+ ask: "ask";
769
+ off: "off";
770
+ }>;
771
+ lookbackDays: z.ZodOptional<z.ZodNumber>;
772
+ }, z.core.$strict>>;
773
+ }, z.core.$strict>, z.ZodObject<{
774
+ s: z.ZodLiteral<"localRetention">;
775
+ cid: z.ZodString;
776
+ days: z.ZodNumber;
777
+ }, z.core.$strict>, z.ZodObject<{
778
+ s: z.ZodLiteral<"link">;
779
+ link: z.ZodObject<{
780
+ id: z.ZodString;
781
+ channel: z.ZodEnum<{
782
+ telegram: "telegram";
783
+ slack: "slack";
784
+ }>;
785
+ account: z.ZodString;
786
+ host: z.ZodString;
787
+ proof: z.ZodObject<{
788
+ method: z.ZodLiteral<"code-sas">;
789
+ codeDigest: z.ZodString;
790
+ sas: z.ZodString;
791
+ }, z.core.$strict>;
792
+ authority: z.ZodArray<z.ZodEnum<{
793
+ chat: "chat";
794
+ view: "view";
795
+ }>>;
796
+ linkedAt: z.ZodNumber;
797
+ revokedAt: z.ZodOptional<z.ZodNumber>;
798
+ }, z.core.$strict>;
799
+ }, z.core.$strict>], "s">;
800
+ export type SettingBody = z.infer<typeof SettingBody>;
801
+ /** The plaintext of a `msg` event. */
802
+ export declare const MsgBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
803
+ t: z.ZodLiteral<"line">;
804
+ text: z.ZodString;
805
+ format: z.ZodEnum<{
806
+ plain: "plain";
807
+ md: "md";
808
+ }>;
809
+ thread: z.ZodOptional<z.ZodString>;
810
+ broadcast: z.ZodOptional<z.ZodBoolean>;
811
+ mentions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
812
+ p: z.ZodString;
813
+ }, z.core.$strict>, z.ZodObject<{
814
+ all: z.ZodLiteral<"channel">;
815
+ }, z.core.$strict>, z.ZodObject<{
816
+ all: z.ZodLiteral<"here">;
817
+ }, z.core.$strict>]>>>;
818
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
819
+ blob: z.ZodString;
820
+ key: z.ZodString;
821
+ nonce: z.ZodString;
822
+ sha256: z.ZodString;
823
+ bytes: z.ZodNumber;
824
+ mime: z.ZodString;
825
+ name: z.ZodString;
826
+ thumb: z.ZodOptional<z.ZodString>;
827
+ }, z.core.$strict>>>;
828
+ parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
829
+ text: z.ZodOptional<z.ZodString>;
830
+ raw: z.ZodOptional<z.ZodString>;
831
+ url: z.ZodOptional<z.ZodString>;
832
+ data: z.ZodOptional<z.ZodUnknown>;
833
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
834
+ filename: z.ZodOptional<z.ZodString>;
835
+ mediaType: z.ZodOptional<z.ZodString>;
836
+ }, z.core.$strip>>>;
837
+ answers: z.ZodOptional<z.ZodString>;
838
+ grants: z.ZodOptional<z.ZodArray<z.ZodObject<{
839
+ realm: z.ZodString;
840
+ task: z.ZodString;
841
+ from: z.ZodString;
842
+ to: z.ZodString;
843
+ by: z.ZodString;
844
+ ts: z.ZodNumber;
845
+ exp: z.ZodNumber;
846
+ maxDepth: z.ZodNumber;
847
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
848
+ parent: z.ZodOptional<z.ZodString>;
849
+ sig: z.ZodString;
850
+ }, z.core.$loose>>>;
851
+ via: z.ZodOptional<z.ZodObject<{
852
+ channel: z.ZodEnum<{
853
+ telegram: "telegram";
854
+ slack: "slack";
855
+ }>;
856
+ }, z.core.$strict>>;
857
+ }, z.core.$strict>, z.ZodObject<{
858
+ t: z.ZodLiteral<"edit">;
859
+ target: z.ZodString;
860
+ text: z.ZodString;
861
+ mentions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
862
+ p: z.ZodString;
863
+ }, z.core.$strict>, z.ZodObject<{
864
+ all: z.ZodLiteral<"channel">;
865
+ }, z.core.$strict>, z.ZodObject<{
866
+ all: z.ZodLiteral<"here">;
867
+ }, z.core.$strict>]>>>;
868
+ }, z.core.$strict>, z.ZodObject<{
869
+ t: z.ZodLiteral<"delete">;
870
+ target: z.ZodString;
871
+ }, z.core.$strict>, z.ZodObject<{
872
+ t: z.ZodLiteral<"react">;
873
+ target: z.ZodString;
874
+ key: z.ZodString;
875
+ on: z.ZodBoolean;
876
+ }, z.core.$strict>, z.ZodObject<{
877
+ t: z.ZodLiteral<"pin">;
878
+ target: z.ZodString;
879
+ on: z.ZodBoolean;
880
+ }, z.core.$strict>, z.ZodObject<{
881
+ t: z.ZodLiteral<"task">;
882
+ task: z.ZodDiscriminatedUnion<[z.ZodObject<{
883
+ k: z.ZodLiteral<"request">;
884
+ to: z.ZodString;
885
+ message: z.ZodObject<{
886
+ messageId: z.ZodString;
887
+ contextId: z.ZodOptional<z.ZodString>;
888
+ taskId: z.ZodOptional<z.ZodString>;
889
+ role: z.ZodEnum<{
890
+ ROLE_USER: "ROLE_USER";
891
+ ROLE_AGENT: "ROLE_AGENT";
892
+ }>;
893
+ parts: z.ZodArray<z.ZodObject<{
894
+ text: z.ZodOptional<z.ZodString>;
895
+ raw: z.ZodOptional<z.ZodString>;
896
+ url: z.ZodOptional<z.ZodString>;
897
+ data: z.ZodOptional<z.ZodUnknown>;
898
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
899
+ filename: z.ZodOptional<z.ZodString>;
900
+ mediaType: z.ZodOptional<z.ZodString>;
901
+ }, z.core.$strip>>;
902
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
903
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
904
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
905
+ }, z.core.$strip>;
906
+ delegation: z.ZodArray<z.ZodObject<{
907
+ realm: z.ZodString;
908
+ task: z.ZodString;
909
+ from: z.ZodString;
910
+ to: z.ZodString;
911
+ by: z.ZodString;
912
+ ts: z.ZodNumber;
913
+ exp: z.ZodNumber;
914
+ maxDepth: z.ZodNumber;
915
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
916
+ parent: z.ZodOptional<z.ZodString>;
917
+ sig: z.ZodString;
918
+ }, z.core.$loose>>;
919
+ }, z.core.$strict>, z.ZodObject<{
920
+ k: z.ZodLiteral<"status">;
921
+ root: z.ZodString;
922
+ update: z.ZodObject<{
923
+ taskId: z.ZodString;
924
+ contextId: z.ZodString;
925
+ status: z.ZodObject<{
926
+ state: z.ZodEnum<{
927
+ TASK_STATE_SUBMITTED: "TASK_STATE_SUBMITTED";
928
+ TASK_STATE_WORKING: "TASK_STATE_WORKING";
929
+ TASK_STATE_COMPLETED: "TASK_STATE_COMPLETED";
930
+ TASK_STATE_FAILED: "TASK_STATE_FAILED";
931
+ TASK_STATE_CANCELED: "TASK_STATE_CANCELED";
932
+ TASK_STATE_INPUT_REQUIRED: "TASK_STATE_INPUT_REQUIRED";
933
+ TASK_STATE_REJECTED: "TASK_STATE_REJECTED";
934
+ TASK_STATE_AUTH_REQUIRED: "TASK_STATE_AUTH_REQUIRED";
935
+ }>;
936
+ message: z.ZodOptional<z.ZodObject<{
937
+ messageId: z.ZodString;
938
+ contextId: z.ZodOptional<z.ZodString>;
939
+ taskId: z.ZodOptional<z.ZodString>;
940
+ role: z.ZodEnum<{
941
+ ROLE_USER: "ROLE_USER";
942
+ ROLE_AGENT: "ROLE_AGENT";
943
+ }>;
944
+ parts: z.ZodArray<z.ZodObject<{
945
+ text: z.ZodOptional<z.ZodString>;
946
+ raw: z.ZodOptional<z.ZodString>;
947
+ url: z.ZodOptional<z.ZodString>;
948
+ data: z.ZodOptional<z.ZodUnknown>;
949
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
950
+ filename: z.ZodOptional<z.ZodString>;
951
+ mediaType: z.ZodOptional<z.ZodString>;
952
+ }, z.core.$strip>>;
953
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
954
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
955
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
956
+ }, z.core.$strip>>;
957
+ timestamp: z.ZodOptional<z.ZodString>;
958
+ }, z.core.$strip>;
959
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
960
+ }, z.core.$strip>;
961
+ }, z.core.$strict>, z.ZodObject<{
962
+ k: z.ZodLiteral<"artifact">;
963
+ root: z.ZodString;
964
+ update: z.ZodObject<{
965
+ taskId: z.ZodString;
966
+ contextId: z.ZodString;
967
+ artifact: z.ZodObject<{
968
+ artifactId: z.ZodString;
969
+ name: z.ZodOptional<z.ZodString>;
970
+ description: z.ZodOptional<z.ZodString>;
971
+ parts: z.ZodArray<z.ZodObject<{
972
+ text: z.ZodOptional<z.ZodString>;
973
+ raw: z.ZodOptional<z.ZodString>;
974
+ url: z.ZodOptional<z.ZodString>;
975
+ data: z.ZodOptional<z.ZodUnknown>;
976
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
977
+ filename: z.ZodOptional<z.ZodString>;
978
+ mediaType: z.ZodOptional<z.ZodString>;
979
+ }, z.core.$strip>>;
980
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
981
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
982
+ }, z.core.$strip>;
983
+ append: z.ZodOptional<z.ZodBoolean>;
984
+ lastChunk: z.ZodOptional<z.ZodBoolean>;
985
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
986
+ }, z.core.$strip>;
987
+ }, z.core.$strict>, z.ZodObject<{
988
+ k: z.ZodLiteral<"cancel">;
989
+ root: z.ZodString;
990
+ reason: z.ZodOptional<z.ZodString>;
991
+ }, z.core.$strict>, z.ZodObject<{
992
+ k: z.ZodLiteral<"followUp">;
993
+ root: z.ZodString;
994
+ message: z.ZodObject<{
995
+ messageId: z.ZodString;
996
+ contextId: z.ZodOptional<z.ZodString>;
997
+ taskId: z.ZodOptional<z.ZodString>;
998
+ role: z.ZodEnum<{
999
+ ROLE_USER: "ROLE_USER";
1000
+ ROLE_AGENT: "ROLE_AGENT";
1001
+ }>;
1002
+ parts: z.ZodArray<z.ZodObject<{
1003
+ text: z.ZodOptional<z.ZodString>;
1004
+ raw: z.ZodOptional<z.ZodString>;
1005
+ url: z.ZodOptional<z.ZodString>;
1006
+ data: z.ZodOptional<z.ZodUnknown>;
1007
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1008
+ filename: z.ZodOptional<z.ZodString>;
1009
+ mediaType: z.ZodOptional<z.ZodString>;
1010
+ }, z.core.$strip>>;
1011
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1012
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
1013
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1014
+ }, z.core.$strip>;
1015
+ }, z.core.$strict>], "k">;
1016
+ }, z.core.$strict>, z.ZodObject<{
1017
+ t: z.ZodLiteral<"receipt">;
1018
+ target: z.ZodString;
1019
+ stage: z.ZodEnum<{
1020
+ delivered: "delivered";
1021
+ handed_to_agent: "handed_to_agent";
1022
+ read: "read";
1023
+ }>;
1024
+ }, z.core.$strict>, z.ZodObject<{
1025
+ t: z.ZodLiteral<"sync">;
1026
+ sync: z.ZodDiscriminatedUnion<[z.ZodObject<{
1027
+ s: z.ZodLiteral<"read">;
1028
+ cid: z.ZodString;
1029
+ upTo: z.ZodNumber;
1030
+ thread: z.ZodOptional<z.ZodString>;
1031
+ }, z.core.$strict>, z.ZodObject<{
1032
+ s: z.ZodLiteral<"unread">;
1033
+ cid: z.ZodString;
1034
+ from: z.ZodNumber;
1035
+ }, z.core.$strict>, z.ZodObject<{
1036
+ s: z.ZodLiteral<"follow">;
1037
+ cid: z.ZodString;
1038
+ thread: z.ZodString;
1039
+ on: z.ZodBoolean;
1040
+ }, z.core.$strict>, z.ZodObject<{
1041
+ s: z.ZodLiteral<"save">;
1042
+ cid: z.ZodString;
1043
+ target: z.ZodString;
1044
+ on: z.ZodBoolean;
1045
+ }, z.core.$strict>, z.ZodObject<{
1046
+ s: z.ZodLiteral<"draft">;
1047
+ cid: z.ZodString;
1048
+ thread: z.ZodOptional<z.ZodString>;
1049
+ text: z.ZodString;
1050
+ }, z.core.$strict>, z.ZodObject<{
1051
+ s: z.ZodLiteral<"joined">;
1052
+ cid: z.ZodString;
1053
+ on: z.ZodBoolean;
1054
+ }, z.core.$strict>, z.ZodObject<{
1055
+ s: z.ZodLiteral<"keys">;
1056
+ cid: z.ZodString;
1057
+ shares: z.ZodArray<z.ZodObject<{
1058
+ epoch: z.ZodNumber;
1059
+ device: z.ZodString;
1060
+ idx: z.ZodNumber;
1061
+ ck: z.ZodString;
1062
+ }, z.core.$strict>>;
1063
+ }, z.core.$strict>], "s">;
1064
+ }, z.core.$strict>], "t">;
1065
+ export type MsgBody = z.infer<typeof MsgBody>;
1066
+ export type MsgKind = MsgBody["t"];
1067
+ /** A control op, in plaintext: the relay routes and checks authority by it. */
1068
+ export declare const ConvOpEvent: z.ZodObject<{
1069
+ class: z.ZodLiteral<"op">;
1070
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1071
+ op: z.ZodLiteral<"create">;
1072
+ kind: z.ZodEnum<{
1073
+ self: "self";
1074
+ channel: "channel";
1075
+ group: "group";
1076
+ dm: "dm";
1077
+ }>;
1078
+ visibility: z.ZodOptional<z.ZodEnum<{
1079
+ public: "public";
1080
+ private: "private";
1081
+ }>>;
1082
+ history: z.ZodEnum<{
1083
+ none: "none";
1084
+ shared: "shared";
1085
+ }>;
1086
+ retainDays: z.ZodNumber;
1087
+ org: z.ZodOptional<z.ZodString>;
1088
+ participants: z.ZodArray<z.ZodObject<{
1089
+ p: z.ZodString;
1090
+ role: z.ZodEnum<{
1091
+ admin: "admin";
1092
+ member: "member";
1093
+ owner: "owner";
1094
+ guest: "guest";
1095
+ }>;
1096
+ device: z.ZodOptional<z.ZodString>;
1097
+ respondTo: z.ZodOptional<z.ZodEnum<{
1098
+ self: "self";
1099
+ none: "none";
1100
+ members: "members";
1101
+ }>>;
1102
+ }, z.core.$strict>>;
1103
+ post: z.ZodOptional<z.ZodEnum<{
1104
+ admins: "admins";
1105
+ all: "all";
1106
+ }>>;
1107
+ invite: z.ZodOptional<z.ZodEnum<{
1108
+ admins: "admins";
1109
+ all: "all";
1110
+ }>>;
1111
+ pins: z.ZodOptional<z.ZodEnum<{
1112
+ admins: "admins";
1113
+ all: "all";
1114
+ }>>;
1115
+ sealedMeta: z.ZodOptional<z.ZodString>;
1116
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
1117
+ }, z.core.$strict>, z.ZodObject<{
1118
+ op: z.ZodLiteral<"add">;
1119
+ participants: z.ZodArray<z.ZodObject<{
1120
+ p: z.ZodString;
1121
+ role: z.ZodEnum<{
1122
+ admin: "admin";
1123
+ member: "member";
1124
+ owner: "owner";
1125
+ guest: "guest";
1126
+ }>;
1127
+ device: z.ZodOptional<z.ZodString>;
1128
+ respondTo: z.ZodOptional<z.ZodEnum<{
1129
+ self: "self";
1130
+ none: "none";
1131
+ members: "members";
1132
+ }>>;
1133
+ }, z.core.$strict>>;
1134
+ }, z.core.$strict>, z.ZodObject<{
1135
+ op: z.ZodLiteral<"accept">;
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>;
1249
+ }, z.core.$strict>, z.ZodObject<{
1250
+ op: z.ZodLiteral<"role">;
1251
+ p: z.ZodString;
1252
+ role: z.ZodEnum<{
1253
+ admin: "admin";
1254
+ member: "member";
1255
+ owner: "owner";
1256
+ guest: "guest";
1257
+ }>;
1258
+ }, z.core.$strict>, z.ZodObject<{
1259
+ op: z.ZodLiteral<"seat">;
1260
+ p: z.ZodString;
1261
+ device: z.ZodOptional<z.ZodString>;
1262
+ respondTo: z.ZodOptional<z.ZodEnum<{
1263
+ self: "self";
1264
+ none: "none";
1265
+ members: "members";
1266
+ }>>;
1267
+ }, z.core.$strict>, z.ZodObject<{
1268
+ op: z.ZodLiteral<"settings">;
1269
+ visibility: z.ZodOptional<z.ZodEnum<{
1270
+ public: "public";
1271
+ private: "private";
1272
+ }>>;
1273
+ history: z.ZodOptional<z.ZodEnum<{
1274
+ none: "none";
1275
+ shared: "shared";
1276
+ }>>;
1277
+ retainDays: z.ZodOptional<z.ZodNumber>;
1278
+ post: z.ZodOptional<z.ZodEnum<{
1279
+ admins: "admins";
1280
+ all: "all";
1281
+ }>>;
1282
+ invite: z.ZodOptional<z.ZodEnum<{
1283
+ admins: "admins";
1284
+ all: "all";
1285
+ }>>;
1286
+ pins: z.ZodOptional<z.ZodEnum<{
1287
+ admins: "admins";
1288
+ all: "all";
1289
+ }>>;
1290
+ }, z.core.$strict>, z.ZodObject<{
1291
+ op: z.ZodLiteral<"archive">;
1292
+ on: z.ZodBoolean;
1293
+ }, z.core.$strict>, z.ZodObject<{
1294
+ op: z.ZodLiteral<"rekey">;
1295
+ epoch: z.ZodNumber;
1296
+ cause: z.ZodEnum<{
1297
+ device: "device";
1298
+ removed: "removed";
1299
+ added: "added";
1300
+ settings: "settings";
1301
+ schedule: "schedule";
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;
1334
+ }, z.core.$strict>], "op">;
1335
+ sig: z.ZodString;
1336
+ v: z.ZodLiteral<"messaging/1">;
1337
+ realm: z.ZodString;
1338
+ cid: z.ZodString;
1339
+ id: z.ZodString;
1340
+ by: z.ZodObject<{
1341
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1342
+ device: z.ZodString;
1343
+ agent: z.ZodOptional<z.ZodString>;
1344
+ }, z.core.$strict>;
1345
+ ts: z.ZodNumber;
1346
+ opHead: z.ZodObject<{
1347
+ seq: z.ZodNumber;
1348
+ hash: z.ZodString;
1349
+ }, z.core.$strict>;
1350
+ seen: z.ZodOptional<z.ZodObject<{
1351
+ seq: z.ZodNumber;
1352
+ hash: z.ZodString;
1353
+ }, z.core.$strict>>;
1354
+ }, z.core.$strict>;
1355
+ export type ConvOpEvent = z.infer<typeof ConvOpEvent>;
1356
+ /** base64url(nonce ‖ AES-256-GCM ciphertext ‖ tag) of JCS(`MsgBody`), sealed under one message key. */
1357
+ export declare const SealedBody: z.ZodString;
1358
+ /** Everything else, sealed under the author device's sender key at (`epoch`, `idx`). */
1359
+ export declare const ConvMsgEvent: z.ZodObject<{
1360
+ class: z.ZodLiteral<"msg">;
1361
+ epoch: z.ZodNumber;
1362
+ idx: z.ZodNumber;
1363
+ wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
1364
+ request: z.ZodOptional<z.ZodString>;
1365
+ body: z.ZodString;
1366
+ sig: z.ZodString;
1367
+ v: z.ZodLiteral<"messaging/1">;
1368
+ realm: z.ZodString;
1369
+ cid: z.ZodString;
1370
+ id: z.ZodString;
1371
+ by: z.ZodObject<{
1372
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1373
+ device: z.ZodString;
1374
+ agent: z.ZodOptional<z.ZodString>;
1375
+ }, z.core.$strict>;
1376
+ ts: z.ZodNumber;
1377
+ opHead: z.ZodObject<{
1378
+ seq: z.ZodNumber;
1379
+ hash: z.ZodString;
1380
+ }, z.core.$strict>;
1381
+ seen: z.ZodOptional<z.ZodObject<{
1382
+ seq: z.ZodNumber;
1383
+ hash: z.ZodString;
1384
+ }, z.core.$strict>>;
1385
+ }, z.core.$strict>;
1386
+ export type ConvMsgEvent = z.infer<typeof ConvMsgEvent>;
1387
+ /** One recipient device's share, sealed to it under the envelope seal (spec §5, "Sealing"). */
1388
+ export declare const SealedShare: z.ZodObject<{
1389
+ to: z.ZodObject<{
1390
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1391
+ device: z.ZodString;
1392
+ }, z.core.$strict>;
1393
+ epk: z.ZodString;
1394
+ nonce: z.ZodString;
1395
+ ct: z.ZodString;
1396
+ }, z.core.$strict>;
1397
+ export type SealedShare = z.infer<typeof SealedShare>;
1398
+ /** A `keys` event's body: one share, to one recipient device. */
1399
+ export declare const KeysBody: 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<{
1416
+ to: z.ZodObject<{
1417
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1418
+ device: z.ZodString;
1419
+ }, z.core.$strict>;
1420
+ epk: z.ZodString;
1421
+ nonce: z.ZodString;
1422
+ ct: z.ZodString;
1423
+ }, z.core.$strict>;
1424
+ sig: z.ZodString;
1425
+ v: z.ZodLiteral<"messaging/1">;
1426
+ realm: z.ZodString;
1427
+ cid: z.ZodString;
1428
+ id: z.ZodString;
1429
+ by: z.ZodObject<{
1430
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1431
+ device: z.ZodString;
1432
+ agent: z.ZodOptional<z.ZodString>;
1433
+ }, z.core.$strict>;
1434
+ ts: z.ZodNumber;
1435
+ opHead: z.ZodObject<{
1436
+ seq: z.ZodNumber;
1437
+ hash: z.ZodString;
1438
+ }, z.core.$strict>;
1439
+ seen: z.ZodOptional<z.ZodObject<{
1440
+ seq: z.ZodNumber;
1441
+ hash: z.ZodString;
1442
+ }, z.core.$strict>>;
1443
+ }, z.core.$strict>;
1444
+ export type ConvKeysEvent = z.infer<typeof ConvKeysEvent>;
1445
+ /** The events of the log: ops and messages. */
1446
+ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1447
+ class: z.ZodLiteral<"op">;
1448
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1449
+ op: z.ZodLiteral<"create">;
1450
+ kind: z.ZodEnum<{
1451
+ self: "self";
1452
+ channel: "channel";
1453
+ group: "group";
1454
+ dm: "dm";
1455
+ }>;
1456
+ visibility: z.ZodOptional<z.ZodEnum<{
1457
+ public: "public";
1458
+ private: "private";
1459
+ }>>;
1460
+ history: z.ZodEnum<{
1461
+ none: "none";
1462
+ shared: "shared";
1463
+ }>;
1464
+ retainDays: z.ZodNumber;
1465
+ org: z.ZodOptional<z.ZodString>;
1466
+ participants: z.ZodArray<z.ZodObject<{
1467
+ p: z.ZodString;
1468
+ role: z.ZodEnum<{
1469
+ admin: "admin";
1470
+ member: "member";
1471
+ owner: "owner";
1472
+ guest: "guest";
1473
+ }>;
1474
+ device: z.ZodOptional<z.ZodString>;
1475
+ respondTo: z.ZodOptional<z.ZodEnum<{
1476
+ self: "self";
1477
+ none: "none";
1478
+ members: "members";
1479
+ }>>;
1480
+ }, z.core.$strict>>;
1481
+ post: z.ZodOptional<z.ZodEnum<{
1482
+ admins: "admins";
1483
+ all: "all";
1484
+ }>>;
1485
+ invite: z.ZodOptional<z.ZodEnum<{
1486
+ admins: "admins";
1487
+ all: "all";
1488
+ }>>;
1489
+ pins: z.ZodOptional<z.ZodEnum<{
1490
+ admins: "admins";
1491
+ all: "all";
1492
+ }>>;
1493
+ sealedMeta: z.ZodOptional<z.ZodString>;
1494
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
1495
+ }, z.core.$strict>, z.ZodObject<{
1496
+ op: z.ZodLiteral<"add">;
1497
+ participants: z.ZodArray<z.ZodObject<{
1498
+ p: z.ZodString;
1499
+ role: z.ZodEnum<{
1500
+ admin: "admin";
1501
+ member: "member";
1502
+ owner: "owner";
1503
+ guest: "guest";
1504
+ }>;
1505
+ device: z.ZodOptional<z.ZodString>;
1506
+ respondTo: z.ZodOptional<z.ZodEnum<{
1507
+ self: "self";
1508
+ none: "none";
1509
+ members: "members";
1510
+ }>>;
1511
+ }, z.core.$strict>>;
1512
+ }, z.core.$strict>, z.ZodObject<{
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;
1620
+ }, z.core.$strict>, z.ZodObject<{
1621
+ op: z.ZodLiteral<"join">;
1622
+ }, z.core.$strict>, z.ZodObject<{
1623
+ op: z.ZodLiteral<"leave">;
1624
+ }, z.core.$strict>, z.ZodObject<{
1625
+ op: z.ZodLiteral<"remove">;
1626
+ participants: z.ZodArray<z.ZodString>;
1627
+ }, z.core.$strict>, z.ZodObject<{
1628
+ op: z.ZodLiteral<"role">;
1629
+ p: z.ZodString;
1630
+ role: z.ZodEnum<{
1631
+ admin: "admin";
1632
+ member: "member";
1633
+ owner: "owner";
1634
+ guest: "guest";
1635
+ }>;
1636
+ }, z.core.$strict>, z.ZodObject<{
1637
+ op: z.ZodLiteral<"seat">;
1638
+ p: z.ZodString;
1639
+ device: z.ZodOptional<z.ZodString>;
1640
+ respondTo: z.ZodOptional<z.ZodEnum<{
1641
+ self: "self";
1642
+ none: "none";
1643
+ members: "members";
1644
+ }>>;
1645
+ }, z.core.$strict>, z.ZodObject<{
1646
+ op: z.ZodLiteral<"settings">;
1647
+ visibility: z.ZodOptional<z.ZodEnum<{
1648
+ public: "public";
1649
+ private: "private";
1650
+ }>>;
1651
+ history: z.ZodOptional<z.ZodEnum<{
1652
+ none: "none";
1653
+ shared: "shared";
1654
+ }>>;
1655
+ retainDays: z.ZodOptional<z.ZodNumber>;
1656
+ post: z.ZodOptional<z.ZodEnum<{
1657
+ admins: "admins";
1658
+ all: "all";
1659
+ }>>;
1660
+ invite: z.ZodOptional<z.ZodEnum<{
1661
+ admins: "admins";
1662
+ all: "all";
1663
+ }>>;
1664
+ pins: z.ZodOptional<z.ZodEnum<{
1665
+ admins: "admins";
1666
+ all: "all";
1667
+ }>>;
1668
+ }, z.core.$strict>, z.ZodObject<{
1669
+ op: z.ZodLiteral<"archive">;
1670
+ on: z.ZodBoolean;
1671
+ }, z.core.$strict>, z.ZodObject<{
1672
+ op: z.ZodLiteral<"rekey">;
1673
+ epoch: z.ZodNumber;
1674
+ cause: z.ZodEnum<{
1675
+ device: "device";
1676
+ removed: "removed";
1677
+ added: "added";
1678
+ settings: "settings";
1679
+ schedule: "schedule";
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;
1712
+ }, z.core.$strict>], "op">;
1713
+ sig: z.ZodString;
1714
+ v: z.ZodLiteral<"messaging/1">;
1715
+ realm: z.ZodString;
1716
+ cid: z.ZodString;
1717
+ id: z.ZodString;
1718
+ by: z.ZodObject<{
1719
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1720
+ device: z.ZodString;
1721
+ agent: z.ZodOptional<z.ZodString>;
1722
+ }, z.core.$strict>;
1723
+ ts: z.ZodNumber;
1724
+ opHead: z.ZodObject<{
1725
+ seq: z.ZodNumber;
1726
+ hash: z.ZodString;
1727
+ }, z.core.$strict>;
1728
+ seen: z.ZodOptional<z.ZodObject<{
1729
+ seq: z.ZodNumber;
1730
+ hash: z.ZodString;
1731
+ }, z.core.$strict>>;
1732
+ }, z.core.$strict>, z.ZodObject<{
1733
+ class: z.ZodLiteral<"msg">;
1734
+ epoch: z.ZodNumber;
1735
+ idx: z.ZodNumber;
1736
+ wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
1737
+ request: z.ZodOptional<z.ZodString>;
1738
+ body: z.ZodString;
1739
+ sig: z.ZodString;
1740
+ v: z.ZodLiteral<"messaging/1">;
1741
+ realm: z.ZodString;
1742
+ cid: z.ZodString;
1743
+ id: z.ZodString;
1744
+ by: z.ZodObject<{
1745
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1746
+ device: z.ZodString;
1747
+ agent: z.ZodOptional<z.ZodString>;
1748
+ }, z.core.$strict>;
1749
+ ts: z.ZodNumber;
1750
+ opHead: z.ZodObject<{
1751
+ seq: z.ZodNumber;
1752
+ hash: z.ZodString;
1753
+ }, z.core.$strict>;
1754
+ seen: z.ZodOptional<z.ZodObject<{
1755
+ seq: z.ZodNumber;
1756
+ hash: z.ZodString;
1757
+ }, z.core.$strict>>;
1758
+ }, z.core.$strict>], "class">;
1759
+ export type ConvEvent = z.infer<typeof ConvEvent>;
1760
+ export type ConvEventClass = ConvEvent["class"];
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";
2147
+ }>>;
2148
+ }, z.core.$strict>>;
2149
+ post: z.ZodOptional<z.ZodEnum<{
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";
2327
+ }>>;
2328
+ invite: z.ZodOptional<z.ZodEnum<{
2329
+ admins: "admins";
2330
+ all: "all";
2331
+ }>>;
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";
2484
+ all: "all";
2485
+ }>>;
2486
+ pins: z.ZodOptional<z.ZodEnum<{
2487
+ admins: "admins";
2488
+ all: "all";
2489
+ }>>;
2490
+ sealedMeta: z.ZodOptional<z.ZodString>;
2491
+ admission: z.ZodOptional<z.ZodLiteral<"request">>;
2492
+ }, z.core.$strict>, z.ZodObject<{
2493
+ op: z.ZodLiteral<"add">;
2494
+ participants: z.ZodArray<z.ZodObject<{
2495
+ p: z.ZodString;
2496
+ role: z.ZodEnum<{
2497
+ admin: "admin";
2498
+ member: "member";
2499
+ owner: "owner";
2500
+ guest: "guest";
2501
+ }>;
2502
+ device: z.ZodOptional<z.ZodString>;
2503
+ respondTo: z.ZodOptional<z.ZodEnum<{
2504
+ self: "self";
2505
+ none: "none";
2506
+ members: "members";
2507
+ }>>;
2508
+ }, z.core.$strict>>;
2509
+ }, z.core.$strict>, z.ZodObject<{
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;
2617
+ }, z.core.$strict>, z.ZodObject<{
2618
+ op: z.ZodLiteral<"join">;
2619
+ }, z.core.$strict>, z.ZodObject<{
2620
+ op: z.ZodLiteral<"leave">;
2621
+ }, z.core.$strict>, z.ZodObject<{
2622
+ op: z.ZodLiteral<"remove">;
2623
+ participants: z.ZodArray<z.ZodString>;
2624
+ }, z.core.$strict>, z.ZodObject<{
2625
+ op: z.ZodLiteral<"role">;
2626
+ p: z.ZodString;
2627
+ role: z.ZodEnum<{
2628
+ admin: "admin";
2629
+ member: "member";
2630
+ owner: "owner";
2631
+ guest: "guest";
2632
+ }>;
2633
+ }, z.core.$strict>, z.ZodObject<{
2634
+ op: z.ZodLiteral<"seat">;
2635
+ p: z.ZodString;
2636
+ device: z.ZodOptional<z.ZodString>;
2637
+ respondTo: z.ZodOptional<z.ZodEnum<{
2638
+ self: "self";
2639
+ none: "none";
2640
+ members: "members";
2641
+ }>>;
2642
+ }, z.core.$strict>, z.ZodObject<{
2643
+ op: z.ZodLiteral<"settings">;
2644
+ visibility: z.ZodOptional<z.ZodEnum<{
2645
+ public: "public";
2646
+ private: "private";
2647
+ }>>;
2648
+ history: z.ZodOptional<z.ZodEnum<{
2649
+ none: "none";
2650
+ shared: "shared";
2651
+ }>>;
2652
+ retainDays: z.ZodOptional<z.ZodNumber>;
2653
+ post: z.ZodOptional<z.ZodEnum<{
2654
+ admins: "admins";
2655
+ all: "all";
2656
+ }>>;
2657
+ invite: z.ZodOptional<z.ZodEnum<{
2658
+ admins: "admins";
2659
+ all: "all";
2660
+ }>>;
2661
+ pins: z.ZodOptional<z.ZodEnum<{
2662
+ admins: "admins";
2663
+ all: "all";
2664
+ }>>;
2665
+ }, z.core.$strict>, z.ZodObject<{
2666
+ op: z.ZodLiteral<"archive">;
2667
+ on: z.ZodBoolean;
2668
+ }, z.core.$strict>, z.ZodObject<{
2669
+ op: z.ZodLiteral<"rekey">;
2670
+ epoch: z.ZodNumber;
2671
+ cause: z.ZodEnum<{
2672
+ device: "device";
2673
+ removed: "removed";
2674
+ added: "added";
2675
+ settings: "settings";
2676
+ schedule: "schedule";
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;
2709
+ }, z.core.$strict>], "op">;
2710
+ sig: z.ZodString;
2711
+ v: z.ZodLiteral<"messaging/1">;
2712
+ realm: z.ZodString;
2713
+ cid: z.ZodString;
2714
+ id: z.ZodString;
2715
+ by: z.ZodObject<{
2716
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2717
+ device: z.ZodString;
2718
+ agent: z.ZodOptional<z.ZodString>;
2719
+ }, z.core.$strict>;
2720
+ ts: z.ZodNumber;
2721
+ opHead: z.ZodObject<{
2722
+ seq: z.ZodNumber;
2723
+ hash: z.ZodString;
2724
+ }, z.core.$strict>;
2725
+ seen: z.ZodOptional<z.ZodObject<{
2726
+ seq: z.ZodNumber;
2727
+ hash: z.ZodString;
2728
+ }, z.core.$strict>>;
2729
+ }, z.core.$strict>, z.ZodObject<{
2730
+ class: z.ZodLiteral<"msg">;
2731
+ epoch: z.ZodNumber;
2732
+ idx: z.ZodNumber;
2733
+ wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
2734
+ request: z.ZodOptional<z.ZodString>;
2735
+ body: z.ZodString;
2736
+ sig: z.ZodString;
2737
+ v: z.ZodLiteral<"messaging/1">;
2738
+ realm: z.ZodString;
2739
+ cid: z.ZodString;
2740
+ id: z.ZodString;
2741
+ by: z.ZodObject<{
2742
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2743
+ device: z.ZodString;
2744
+ agent: z.ZodOptional<z.ZodString>;
2745
+ }, z.core.$strict>;
2746
+ ts: z.ZodNumber;
2747
+ opHead: z.ZodObject<{
2748
+ seq: z.ZodNumber;
2749
+ hash: z.ZodString;
2750
+ }, z.core.$strict>;
2751
+ seen: z.ZodOptional<z.ZodObject<{
2752
+ seq: z.ZodNumber;
2753
+ hash: z.ZodString;
2754
+ }, z.core.$strict>>;
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<{
2766
+ class: z.ZodLiteral<"keys">;
2767
+ body: z.ZodObject<{
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;
2775
+ }, z.core.$strict>;
2776
+ sig: z.ZodString;
2777
+ v: z.ZodLiteral<"messaging/1">;
2778
+ realm: z.ZodString;
2779
+ cid: z.ZodString;
2780
+ id: z.ZodString;
2781
+ by: z.ZodObject<{
2782
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
2783
+ device: z.ZodString;
2784
+ agent: z.ZodOptional<z.ZodString>;
2785
+ }, z.core.$strict>;
2786
+ ts: z.ZodNumber;
2787
+ opHead: z.ZodObject<{
2788
+ seq: z.ZodNumber;
2789
+ hash: z.ZodString;
2790
+ }, z.core.$strict>;
2791
+ seen: z.ZodOptional<z.ZodObject<{
2792
+ seq: z.ZodNumber;
2793
+ hash: z.ZodString;
2794
+ }, z.core.$strict>>;
2795
+ }, z.core.$strict>;
2796
+ }, z.core.$strict>;
2797
+ export type ConvShareEntry = z.infer<typeof ConvShareEntry>;
2798
+ /** A log position: a seq and h(seq). */
2799
+ export declare const ConvHead: z.ZodObject<{
2800
+ seq: z.ZodNumber;
2801
+ hash: z.ZodString;
2802
+ }, z.core.$strict>;
2803
+ export type ConvHead = z.infer<typeof ConvHead>;