@joe-broadhead/messaging 0.7.0 → 0.7.1

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 (43) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/bin/messaging-mcp.js +649 -12
  3. package/dist/bin/messaging-relay.js +774 -20
  4. package/dist/bin/messaging.js +748 -15
  5. package/dist/bin/messagingd.js +785 -18
  6. package/dist/lib/modules/core/agent-tools.js +23 -4
  7. package/dist/lib/modules/core/conversation/context.js +80 -0
  8. package/dist/lib/modules/core/conversation/event.js +100 -0
  9. package/dist/lib/modules/core/conversation/ids.js +38 -0
  10. package/dist/lib/modules/core/conversation/link.js +35 -0
  11. package/dist/lib/modules/core/conversation/log.js +766 -0
  12. package/dist/lib/modules/core/conversation/ratchet.js +243 -0
  13. package/dist/lib/modules/core/conversation/seal.js +198 -0
  14. package/dist/lib/modules/core/index.js +10 -1
  15. package/dist/lib/modules/core/schema/common.js +56 -0
  16. package/dist/lib/modules/core/schema/conversation.js +292 -0
  17. package/dist/lib/modules/core/schema/errors.js +39 -0
  18. package/dist/lib/modules/core/schema/index.js +1 -0
  19. package/dist/lib/modules/core/testing.js +1 -0
  20. package/dist/lib/modules/core/version.js +1 -1
  21. package/dist/spec/messaging-v1.md +324 -6
  22. package/dist/types/core/agent-tools.d.ts +20 -2
  23. package/dist/types/core/conversation/context.d.ts +56 -0
  24. package/dist/types/core/conversation/event.d.ts +36 -0
  25. package/dist/types/core/conversation/ids.d.ts +18 -0
  26. package/dist/types/core/conversation/link.d.ts +16 -0
  27. package/dist/types/core/conversation/log.d.ts +142 -0
  28. package/dist/types/core/conversation/ratchet.d.ts +95 -0
  29. package/dist/types/core/conversation/seal.d.ts +47 -0
  30. package/dist/types/core/index.d.ts +8 -1
  31. package/dist/types/core/schema/common.d.ts +56 -0
  32. package/dist/types/core/schema/conversation.d.ts +1657 -0
  33. package/dist/types/core/schema/envelope.d.ts +6 -0
  34. package/dist/types/core/schema/errors.d.ts +38 -0
  35. package/dist/types/core/schema/index.d.ts +1 -0
  36. package/dist/types/core/schema/ipc/device.d.ts +6 -0
  37. package/dist/types/core/schema/ipc/shapes.d.ts +3 -0
  38. package/dist/types/core/schema/ipc/surfaces.d.ts +6 -0
  39. package/dist/types/core/schema/ipc.d.ts +15 -0
  40. package/dist/types/core/schema/relay.d.ts +12 -0
  41. package/dist/types/core/testing.d.ts +1 -0
  42. package/dist/types/core/version.d.ts +1 -1
  43. package/package.json +1 -1
@@ -0,0 +1,1657 @@
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
+ dm: "dm";
25
+ group: "group";
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
+ all: "all";
50
+ admins: "admins";
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
+ /** A participant record as an op states it. `device` and `respondTo` are for agent participants only. */
77
+ export declare const Seat: z.ZodObject<{
78
+ p: z.ZodString;
79
+ role: z.ZodEnum<{
80
+ admin: "admin";
81
+ member: "member";
82
+ owner: "owner";
83
+ guest: "guest";
84
+ }>;
85
+ device: z.ZodOptional<z.ZodString>;
86
+ respondTo: z.ZodOptional<z.ZodEnum<{
87
+ self: "self";
88
+ none: "none";
89
+ members: "members";
90
+ }>>;
91
+ }, z.core.$strict>;
92
+ export type Seat = z.infer<typeof Seat>;
93
+ export declare const ConvOp: z.ZodDiscriminatedUnion<[z.ZodObject<{
94
+ op: z.ZodLiteral<"create">;
95
+ kind: z.ZodEnum<{
96
+ self: "self";
97
+ channel: "channel";
98
+ dm: "dm";
99
+ group: "group";
100
+ }>;
101
+ visibility: z.ZodOptional<z.ZodEnum<{
102
+ public: "public";
103
+ private: "private";
104
+ }>>;
105
+ history: z.ZodEnum<{
106
+ none: "none";
107
+ shared: "shared";
108
+ }>;
109
+ retainDays: z.ZodNumber;
110
+ org: z.ZodOptional<z.ZodString>;
111
+ participants: z.ZodArray<z.ZodObject<{
112
+ p: z.ZodString;
113
+ role: z.ZodEnum<{
114
+ admin: "admin";
115
+ member: "member";
116
+ owner: "owner";
117
+ guest: "guest";
118
+ }>;
119
+ device: z.ZodOptional<z.ZodString>;
120
+ respondTo: z.ZodOptional<z.ZodEnum<{
121
+ self: "self";
122
+ none: "none";
123
+ members: "members";
124
+ }>>;
125
+ }, z.core.$strict>>;
126
+ post: z.ZodOptional<z.ZodEnum<{
127
+ all: "all";
128
+ admins: "admins";
129
+ }>>;
130
+ invite: z.ZodOptional<z.ZodEnum<{
131
+ all: "all";
132
+ admins: "admins";
133
+ }>>;
134
+ pins: z.ZodOptional<z.ZodEnum<{
135
+ all: "all";
136
+ admins: "admins";
137
+ }>>;
138
+ sealedMeta: z.ZodOptional<z.ZodString>;
139
+ }, z.core.$strict>, z.ZodObject<{
140
+ op: z.ZodLiteral<"add">;
141
+ participants: z.ZodArray<z.ZodObject<{
142
+ p: z.ZodString;
143
+ role: z.ZodEnum<{
144
+ admin: "admin";
145
+ member: "member";
146
+ owner: "owner";
147
+ guest: "guest";
148
+ }>;
149
+ device: z.ZodOptional<z.ZodString>;
150
+ respondTo: z.ZodOptional<z.ZodEnum<{
151
+ self: "self";
152
+ none: "none";
153
+ members: "members";
154
+ }>>;
155
+ }, z.core.$strict>>;
156
+ }, z.core.$strict>, z.ZodObject<{
157
+ op: z.ZodLiteral<"accept">;
158
+ }, z.core.$strict>, z.ZodObject<{
159
+ op: z.ZodLiteral<"join">;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ op: z.ZodLiteral<"leave">;
162
+ }, z.core.$strict>, z.ZodObject<{
163
+ op: z.ZodLiteral<"remove">;
164
+ participants: z.ZodArray<z.ZodString>;
165
+ }, z.core.$strict>, z.ZodObject<{
166
+ op: z.ZodLiteral<"role">;
167
+ p: z.ZodString;
168
+ role: z.ZodEnum<{
169
+ admin: "admin";
170
+ member: "member";
171
+ owner: "owner";
172
+ guest: "guest";
173
+ }>;
174
+ }, z.core.$strict>, z.ZodObject<{
175
+ op: z.ZodLiteral<"seat">;
176
+ p: z.ZodString;
177
+ device: z.ZodOptional<z.ZodString>;
178
+ respondTo: z.ZodOptional<z.ZodEnum<{
179
+ self: "self";
180
+ none: "none";
181
+ members: "members";
182
+ }>>;
183
+ }, z.core.$strict>, z.ZodObject<{
184
+ op: z.ZodLiteral<"settings">;
185
+ visibility: z.ZodOptional<z.ZodEnum<{
186
+ public: "public";
187
+ private: "private";
188
+ }>>;
189
+ history: z.ZodOptional<z.ZodEnum<{
190
+ none: "none";
191
+ shared: "shared";
192
+ }>>;
193
+ retainDays: z.ZodOptional<z.ZodNumber>;
194
+ post: z.ZodOptional<z.ZodEnum<{
195
+ all: "all";
196
+ admins: "admins";
197
+ }>>;
198
+ invite: z.ZodOptional<z.ZodEnum<{
199
+ all: "all";
200
+ admins: "admins";
201
+ }>>;
202
+ pins: z.ZodOptional<z.ZodEnum<{
203
+ all: "all";
204
+ admins: "admins";
205
+ }>>;
206
+ }, z.core.$strict>, z.ZodObject<{
207
+ op: z.ZodLiteral<"archive">;
208
+ on: z.ZodBoolean;
209
+ }, z.core.$strict>, z.ZodObject<{
210
+ op: z.ZodLiteral<"rekey">;
211
+ epoch: z.ZodNumber;
212
+ cause: z.ZodEnum<{
213
+ device: "device";
214
+ removed: "removed";
215
+ added: "added";
216
+ settings: "settings";
217
+ schedule: "schedule";
218
+ }>;
219
+ }, z.core.$strict>], "op">;
220
+ export type ConvOp = z.infer<typeof ConvOp>;
221
+ export type ConvOpName = ConvOp["op"];
222
+ /** The plaintext of `create.sealedMeta` and of a `meta` body's fields. */
223
+ export declare const ConvMeta: z.ZodObject<{
224
+ name: z.ZodOptional<z.ZodString>;
225
+ topic: z.ZodOptional<z.ZodString>;
226
+ purpose: z.ZodOptional<z.ZodString>;
227
+ }, z.core.$strict>;
228
+ export type ConvMeta = z.infer<typeof ConvMeta>;
229
+ export declare const Mention: z.ZodUnion<readonly [z.ZodObject<{
230
+ p: z.ZodString;
231
+ }, z.core.$strict>, z.ZodObject<{
232
+ all: z.ZodLiteral<"channel">;
233
+ }, z.core.$strict>, z.ZodObject<{
234
+ all: z.ZodLiteral<"here">;
235
+ }, z.core.$strict>]>;
236
+ export type Mention = z.infer<typeof Mention>;
237
+ /** A file in the relay's blob store, sealed under its own AES-256-GCM key. The shape only; files land later. */
238
+ export declare const Attachment: z.ZodObject<{
239
+ blob: z.ZodString;
240
+ key: z.ZodString;
241
+ nonce: z.ZodString;
242
+ sha256: z.ZodString;
243
+ bytes: z.ZodNumber;
244
+ mime: z.ZodString;
245
+ name: z.ZodString;
246
+ thumb: z.ZodOptional<z.ZodString>;
247
+ }, z.core.$strict>;
248
+ export type Attachment = z.infer<typeof Attachment>;
249
+ /** An outside channel a person may link as an alias of themselves. Telegram first, then Slack. */
250
+ export declare const LinkChannel: z.ZodEnum<{
251
+ telegram: "telegram";
252
+ slack: "slack";
253
+ }>;
254
+ export type LinkChannel = z.infer<typeof LinkChannel>;
255
+ /** What a linked channel may do: Jelly's `chat` and `view` action classes (spec §8.11), never more. */
256
+ export declare const LinkAuthority: z.ZodEnum<{
257
+ chat: "chat";
258
+ view: "view";
259
+ }>;
260
+ export type LinkAuthority = z.infer<typeof LinkAuthority>;
261
+ /** Who may mirror a conversation to a linked channel: nobody (the default), its owners and admins, or any member. */
262
+ export declare const BridgePolicy: z.ZodEnum<{
263
+ none: "none";
264
+ members: "members";
265
+ admins: "admins";
266
+ }>;
267
+ export type BridgePolicy = z.infer<typeof BridgePolicy>;
268
+ /** A line's provenance when its person wrote it from a linked channel. Signed and sealed with the event. */
269
+ export declare const Via: z.ZodObject<{
270
+ channel: z.ZodEnum<{
271
+ telegram: "telegram";
272
+ slack: "slack";
273
+ }>;
274
+ }, z.core.$strict>;
275
+ export type Via = z.infer<typeof Via>;
276
+ /**
277
+ * A person's linked channel, as a human-tier device records it in the person's `self` conversation (never the
278
+ * device log, which is public). `account` is the channel's own id for the person's account (Telegram `from.id`;
279
+ * Slack `team/user`); it exists only inside the sealed `self` conversation. The proof is the one-time code's digest
280
+ * and the six-digit code the person saw match on both sides. `revokedAt` ends it; the last writer wins by `seq`.
281
+ */
282
+ export declare const LinkRecord: z.ZodObject<{
283
+ id: z.ZodString;
284
+ channel: z.ZodEnum<{
285
+ telegram: "telegram";
286
+ slack: "slack";
287
+ }>;
288
+ account: z.ZodString;
289
+ host: z.ZodString;
290
+ proof: z.ZodObject<{
291
+ method: z.ZodLiteral<"code-sas">;
292
+ codeDigest: z.ZodString;
293
+ sas: z.ZodString;
294
+ }, z.core.$strict>;
295
+ authority: z.ZodArray<z.ZodEnum<{
296
+ chat: "chat";
297
+ view: "view";
298
+ }>>;
299
+ linkedAt: z.ZodNumber;
300
+ revokedAt: z.ZodOptional<z.ZodNumber>;
301
+ }, z.core.$strict>;
302
+ export type LinkRecord = z.infer<typeof LinkRecord>;
303
+ /**
304
+ * Who can read a piece of content, for the audience guard: a person, or a linked channel's provider as
305
+ * `ext:<channel>:<link id>`. Not on the wire; the guard's reader sets are typed with it.
306
+ */
307
+ export declare const ReaderId: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
308
+ export type ReaderId = z.infer<typeof ReaderId>;
309
+ export declare const ReaderSet: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
310
+ export type ReaderSet = z.infer<typeof ReaderSet>;
311
+ export declare const ReceiptStage: z.ZodEnum<{
312
+ delivered: "delivered";
313
+ handed_to_agent: "handed_to_agent";
314
+ read: "read";
315
+ }>;
316
+ export type ReceiptStage = z.infer<typeof ReceiptStage>;
317
+ /**
318
+ * A task as a thread (spec §16.3): `request` is the thread root, from the requester to an agent participant;
319
+ * `status` and `artifact` come from that agent; `cancel` and `followUp` from the requester.
320
+ */
321
+ export declare const TaskEventBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
322
+ k: z.ZodLiteral<"request">;
323
+ to: z.ZodString;
324
+ message: z.ZodObject<{
325
+ messageId: z.ZodString;
326
+ contextId: z.ZodOptional<z.ZodString>;
327
+ taskId: z.ZodOptional<z.ZodString>;
328
+ role: z.ZodEnum<{
329
+ ROLE_USER: "ROLE_USER";
330
+ ROLE_AGENT: "ROLE_AGENT";
331
+ }>;
332
+ parts: z.ZodArray<z.ZodObject<{
333
+ text: z.ZodOptional<z.ZodString>;
334
+ raw: z.ZodOptional<z.ZodString>;
335
+ url: z.ZodOptional<z.ZodString>;
336
+ data: z.ZodOptional<z.ZodUnknown>;
337
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
338
+ filename: z.ZodOptional<z.ZodString>;
339
+ mediaType: z.ZodOptional<z.ZodString>;
340
+ }, z.core.$strip>>;
341
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
342
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
343
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
344
+ }, z.core.$strip>;
345
+ delegation: z.ZodArray<z.ZodObject<{
346
+ realm: z.ZodString;
347
+ task: z.ZodString;
348
+ from: z.ZodString;
349
+ to: z.ZodString;
350
+ by: z.ZodString;
351
+ ts: z.ZodNumber;
352
+ exp: z.ZodNumber;
353
+ maxDepth: z.ZodNumber;
354
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
355
+ parent: z.ZodOptional<z.ZodString>;
356
+ sig: z.ZodString;
357
+ }, z.core.$loose>>;
358
+ }, z.core.$strict>, z.ZodObject<{
359
+ k: z.ZodLiteral<"status">;
360
+ root: z.ZodString;
361
+ update: z.ZodObject<{
362
+ taskId: z.ZodString;
363
+ contextId: z.ZodString;
364
+ status: z.ZodObject<{
365
+ state: z.ZodEnum<{
366
+ TASK_STATE_SUBMITTED: "TASK_STATE_SUBMITTED";
367
+ TASK_STATE_WORKING: "TASK_STATE_WORKING";
368
+ TASK_STATE_COMPLETED: "TASK_STATE_COMPLETED";
369
+ TASK_STATE_FAILED: "TASK_STATE_FAILED";
370
+ TASK_STATE_CANCELED: "TASK_STATE_CANCELED";
371
+ TASK_STATE_INPUT_REQUIRED: "TASK_STATE_INPUT_REQUIRED";
372
+ TASK_STATE_REJECTED: "TASK_STATE_REJECTED";
373
+ TASK_STATE_AUTH_REQUIRED: "TASK_STATE_AUTH_REQUIRED";
374
+ }>;
375
+ message: z.ZodOptional<z.ZodObject<{
376
+ messageId: z.ZodString;
377
+ contextId: z.ZodOptional<z.ZodString>;
378
+ taskId: z.ZodOptional<z.ZodString>;
379
+ role: z.ZodEnum<{
380
+ ROLE_USER: "ROLE_USER";
381
+ ROLE_AGENT: "ROLE_AGENT";
382
+ }>;
383
+ parts: z.ZodArray<z.ZodObject<{
384
+ text: z.ZodOptional<z.ZodString>;
385
+ raw: z.ZodOptional<z.ZodString>;
386
+ url: z.ZodOptional<z.ZodString>;
387
+ data: z.ZodOptional<z.ZodUnknown>;
388
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
389
+ filename: z.ZodOptional<z.ZodString>;
390
+ mediaType: z.ZodOptional<z.ZodString>;
391
+ }, z.core.$strip>>;
392
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
393
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
394
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
395
+ }, z.core.$strip>>;
396
+ timestamp: z.ZodOptional<z.ZodString>;
397
+ }, z.core.$strip>;
398
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
399
+ }, z.core.$strip>;
400
+ }, z.core.$strict>, z.ZodObject<{
401
+ k: z.ZodLiteral<"artifact">;
402
+ root: z.ZodString;
403
+ update: z.ZodObject<{
404
+ taskId: z.ZodString;
405
+ contextId: z.ZodString;
406
+ artifact: z.ZodObject<{
407
+ artifactId: z.ZodString;
408
+ name: z.ZodOptional<z.ZodString>;
409
+ description: z.ZodOptional<z.ZodString>;
410
+ parts: z.ZodArray<z.ZodObject<{
411
+ text: z.ZodOptional<z.ZodString>;
412
+ raw: z.ZodOptional<z.ZodString>;
413
+ url: z.ZodOptional<z.ZodString>;
414
+ data: z.ZodOptional<z.ZodUnknown>;
415
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
416
+ filename: z.ZodOptional<z.ZodString>;
417
+ mediaType: z.ZodOptional<z.ZodString>;
418
+ }, z.core.$strip>>;
419
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
420
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
421
+ }, z.core.$strip>;
422
+ append: z.ZodOptional<z.ZodBoolean>;
423
+ lastChunk: z.ZodOptional<z.ZodBoolean>;
424
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
425
+ }, z.core.$strip>;
426
+ }, z.core.$strict>, z.ZodObject<{
427
+ k: z.ZodLiteral<"cancel">;
428
+ root: z.ZodString;
429
+ reason: z.ZodOptional<z.ZodString>;
430
+ }, z.core.$strict>, z.ZodObject<{
431
+ k: z.ZodLiteral<"followUp">;
432
+ root: z.ZodString;
433
+ message: z.ZodObject<{
434
+ messageId: z.ZodString;
435
+ contextId: z.ZodOptional<z.ZodString>;
436
+ taskId: z.ZodOptional<z.ZodString>;
437
+ role: z.ZodEnum<{
438
+ ROLE_USER: "ROLE_USER";
439
+ ROLE_AGENT: "ROLE_AGENT";
440
+ }>;
441
+ parts: z.ZodArray<z.ZodObject<{
442
+ text: z.ZodOptional<z.ZodString>;
443
+ raw: z.ZodOptional<z.ZodString>;
444
+ url: z.ZodOptional<z.ZodString>;
445
+ data: z.ZodOptional<z.ZodUnknown>;
446
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
447
+ filename: z.ZodOptional<z.ZodString>;
448
+ mediaType: z.ZodOptional<z.ZodString>;
449
+ }, z.core.$strip>>;
450
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
451
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
452
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
453
+ }, z.core.$strip>;
454
+ }, z.core.$strict>], "k">;
455
+ export type TaskEventBody = z.infer<typeof TaskEventBody>;
456
+ export declare const ContextAccess: z.ZodEnum<{
457
+ ask: "ask";
458
+ allow: "allow";
459
+ off: "off";
460
+ }>;
461
+ export type ContextAccess = z.infer<typeof ContextAccess>;
462
+ export declare const ContextKind: z.ZodEnum<{
463
+ dm: "dm";
464
+ group: "group";
465
+ own: "own";
466
+ "channel.private": "channel.private";
467
+ "channel.public": "channel.public";
468
+ }>;
469
+ export type ContextKind = z.infer<typeof ContextKind>;
470
+ export declare const ContextScope: z.ZodUnion<readonly [z.ZodObject<{
471
+ cid: z.ZodString;
472
+ }, z.core.$strict>, z.ZodObject<{
473
+ kind: z.ZodEnum<{
474
+ dm: "dm";
475
+ group: "group";
476
+ own: "own";
477
+ "channel.private": "channel.private";
478
+ "channel.public": "channel.public";
479
+ }>;
480
+ }, z.core.$strict>]>;
481
+ export type ContextScope = z.infer<typeof ContextScope>;
482
+ /** One of a person's rules for which of their agents may mine which conversations (spec §16.8). */
483
+ export declare const ContextRule: z.ZodObject<{
484
+ agent: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
485
+ scope: z.ZodUnion<readonly [z.ZodObject<{
486
+ cid: z.ZodString;
487
+ }, z.core.$strict>, z.ZodObject<{
488
+ kind: z.ZodEnum<{
489
+ dm: "dm";
490
+ group: "group";
491
+ own: "own";
492
+ "channel.private": "channel.private";
493
+ "channel.public": "channel.public";
494
+ }>;
495
+ }, z.core.$strict>]>;
496
+ access: z.ZodEnum<{
497
+ ask: "ask";
498
+ allow: "allow";
499
+ off: "off";
500
+ }>;
501
+ lookbackDays: z.ZodOptional<z.ZodNumber>;
502
+ }, z.core.$strict>;
503
+ export type ContextRule = z.infer<typeof ContextRule>;
504
+ /** A person's whole rule set: at most one rule per (agent, scope). */
505
+ export declare const ContextRules: z.ZodArray<z.ZodObject<{
506
+ agent: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
507
+ scope: z.ZodUnion<readonly [z.ZodObject<{
508
+ cid: z.ZodString;
509
+ }, z.core.$strict>, z.ZodObject<{
510
+ kind: z.ZodEnum<{
511
+ dm: "dm";
512
+ group: "group";
513
+ own: "own";
514
+ "channel.private": "channel.private";
515
+ "channel.public": "channel.public";
516
+ }>;
517
+ }, z.core.$strict>]>;
518
+ access: z.ZodEnum<{
519
+ ask: "ask";
520
+ allow: "allow";
521
+ off: "off";
522
+ }>;
523
+ lookbackDays: z.ZodOptional<z.ZodNumber>;
524
+ }, z.core.$strict>>;
525
+ export type ContextRules = z.infer<typeof ContextRules>;
526
+ /** One sender chain at one index: `ck` is the chain key for message `idx` of `device`'s chain in `epoch`. */
527
+ export declare const KeyShare: z.ZodObject<{
528
+ epoch: z.ZodNumber;
529
+ device: z.ZodString;
530
+ idx: z.ZodNumber;
531
+ ck: z.ZodString;
532
+ }, z.core.$strict>;
533
+ export type KeyShare = z.infer<typeof KeyShare>;
534
+ /** The plaintext of one recipient's sealed share in a `keys` event. */
535
+ export declare const KeySharePayload: z.ZodObject<{
536
+ shares: z.ZodArray<z.ZodObject<{
537
+ epoch: z.ZodNumber;
538
+ device: z.ZodString;
539
+ idx: z.ZodNumber;
540
+ ck: z.ZodString;
541
+ }, z.core.$strict>>;
542
+ }, z.core.$strict>;
543
+ export type KeySharePayload = z.infer<typeof KeySharePayload>;
544
+ /** The `self` conversation's bodies (spec §16.3, "The self conversation"). The last writer wins by `seq`. */
545
+ export declare const SyncBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
546
+ s: z.ZodLiteral<"read">;
547
+ cid: z.ZodString;
548
+ upTo: z.ZodNumber;
549
+ thread: z.ZodOptional<z.ZodString>;
550
+ }, z.core.$strict>, z.ZodObject<{
551
+ s: z.ZodLiteral<"unread">;
552
+ cid: z.ZodString;
553
+ from: z.ZodNumber;
554
+ }, z.core.$strict>, z.ZodObject<{
555
+ s: z.ZodLiteral<"prefs">;
556
+ cid: z.ZodString;
557
+ notify: z.ZodEnum<{
558
+ none: "none";
559
+ all: "all";
560
+ mentions: "mentions";
561
+ }>;
562
+ muteUntil: z.ZodOptional<z.ZodNumber>;
563
+ receipts: z.ZodOptional<z.ZodBoolean>;
564
+ }, z.core.$strict>, z.ZodObject<{
565
+ s: z.ZodLiteral<"follow">;
566
+ cid: z.ZodString;
567
+ thread: z.ZodString;
568
+ on: z.ZodBoolean;
569
+ }, z.core.$strict>, z.ZodObject<{
570
+ s: z.ZodLiteral<"save">;
571
+ cid: z.ZodString;
572
+ target: z.ZodString;
573
+ on: z.ZodBoolean;
574
+ }, z.core.$strict>, z.ZodObject<{
575
+ s: z.ZodLiteral<"draft">;
576
+ cid: z.ZodString;
577
+ thread: z.ZodOptional<z.ZodString>;
578
+ text: z.ZodString;
579
+ }, z.core.$strict>, z.ZodObject<{
580
+ s: z.ZodLiteral<"joined">;
581
+ cid: z.ZodString;
582
+ on: z.ZodBoolean;
583
+ }, z.core.$strict>, z.ZodObject<{
584
+ s: z.ZodLiteral<"grant">;
585
+ grant: z.ZodRecord<z.ZodString, z.ZodUnknown>;
586
+ }, z.core.$strict>, z.ZodObject<{
587
+ s: z.ZodLiteral<"context">;
588
+ rules: z.ZodArray<z.ZodObject<{
589
+ agent: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
590
+ scope: z.ZodUnion<readonly [z.ZodObject<{
591
+ cid: z.ZodString;
592
+ }, z.core.$strict>, z.ZodObject<{
593
+ kind: z.ZodEnum<{
594
+ dm: "dm";
595
+ group: "group";
596
+ own: "own";
597
+ "channel.private": "channel.private";
598
+ "channel.public": "channel.public";
599
+ }>;
600
+ }, z.core.$strict>]>;
601
+ access: z.ZodEnum<{
602
+ ask: "ask";
603
+ allow: "allow";
604
+ off: "off";
605
+ }>;
606
+ lookbackDays: z.ZodOptional<z.ZodNumber>;
607
+ }, z.core.$strict>>;
608
+ }, z.core.$strict>, z.ZodObject<{
609
+ s: z.ZodLiteral<"localRetention">;
610
+ cid: z.ZodString;
611
+ days: z.ZodNumber;
612
+ }, z.core.$strict>, z.ZodObject<{
613
+ s: z.ZodLiteral<"keys">;
614
+ cid: z.ZodString;
615
+ shares: z.ZodArray<z.ZodObject<{
616
+ epoch: z.ZodNumber;
617
+ device: z.ZodString;
618
+ idx: z.ZodNumber;
619
+ ck: z.ZodString;
620
+ }, z.core.$strict>>;
621
+ }, z.core.$strict>, z.ZodObject<{
622
+ s: z.ZodLiteral<"link">;
623
+ link: z.ZodObject<{
624
+ id: z.ZodString;
625
+ channel: z.ZodEnum<{
626
+ telegram: "telegram";
627
+ slack: "slack";
628
+ }>;
629
+ account: z.ZodString;
630
+ host: z.ZodString;
631
+ proof: z.ZodObject<{
632
+ method: z.ZodLiteral<"code-sas">;
633
+ codeDigest: z.ZodString;
634
+ sas: z.ZodString;
635
+ }, z.core.$strict>;
636
+ authority: z.ZodArray<z.ZodEnum<{
637
+ chat: "chat";
638
+ view: "view";
639
+ }>>;
640
+ linkedAt: z.ZodNumber;
641
+ revokedAt: z.ZodOptional<z.ZodNumber>;
642
+ }, z.core.$strict>;
643
+ }, z.core.$strict>], "s">;
644
+ export type SyncBody = z.infer<typeof SyncBody>;
645
+ /** The plaintext of a `msg` event. */
646
+ export declare const MsgBody: z.ZodDiscriminatedUnion<[z.ZodObject<{
647
+ t: z.ZodLiteral<"line">;
648
+ text: z.ZodString;
649
+ format: z.ZodEnum<{
650
+ plain: "plain";
651
+ md: "md";
652
+ }>;
653
+ thread: z.ZodOptional<z.ZodString>;
654
+ broadcast: z.ZodOptional<z.ZodBoolean>;
655
+ mentions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
656
+ p: z.ZodString;
657
+ }, z.core.$strict>, z.ZodObject<{
658
+ all: z.ZodLiteral<"channel">;
659
+ }, z.core.$strict>, z.ZodObject<{
660
+ all: z.ZodLiteral<"here">;
661
+ }, z.core.$strict>]>>>;
662
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
663
+ blob: z.ZodString;
664
+ key: z.ZodString;
665
+ nonce: z.ZodString;
666
+ sha256: z.ZodString;
667
+ bytes: z.ZodNumber;
668
+ mime: z.ZodString;
669
+ name: z.ZodString;
670
+ thumb: z.ZodOptional<z.ZodString>;
671
+ }, z.core.$strict>>>;
672
+ parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
673
+ text: z.ZodOptional<z.ZodString>;
674
+ raw: z.ZodOptional<z.ZodString>;
675
+ url: z.ZodOptional<z.ZodString>;
676
+ data: z.ZodOptional<z.ZodUnknown>;
677
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
678
+ filename: z.ZodOptional<z.ZodString>;
679
+ mediaType: z.ZodOptional<z.ZodString>;
680
+ }, z.core.$strip>>>;
681
+ answers: z.ZodOptional<z.ZodString>;
682
+ grants: z.ZodOptional<z.ZodArray<z.ZodObject<{
683
+ realm: z.ZodString;
684
+ task: z.ZodString;
685
+ from: z.ZodString;
686
+ to: z.ZodString;
687
+ by: z.ZodString;
688
+ ts: z.ZodNumber;
689
+ exp: z.ZodNumber;
690
+ maxDepth: z.ZodNumber;
691
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
692
+ parent: z.ZodOptional<z.ZodString>;
693
+ sig: z.ZodString;
694
+ }, z.core.$loose>>>;
695
+ via: z.ZodOptional<z.ZodObject<{
696
+ channel: z.ZodEnum<{
697
+ telegram: "telegram";
698
+ slack: "slack";
699
+ }>;
700
+ }, z.core.$strict>>;
701
+ }, z.core.$strict>, z.ZodObject<{
702
+ t: z.ZodLiteral<"edit">;
703
+ target: z.ZodString;
704
+ text: z.ZodString;
705
+ mentions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
706
+ p: z.ZodString;
707
+ }, z.core.$strict>, z.ZodObject<{
708
+ all: z.ZodLiteral<"channel">;
709
+ }, z.core.$strict>, z.ZodObject<{
710
+ all: z.ZodLiteral<"here">;
711
+ }, z.core.$strict>]>>>;
712
+ }, z.core.$strict>, z.ZodObject<{
713
+ t: z.ZodLiteral<"delete">;
714
+ target: z.ZodString;
715
+ }, z.core.$strict>, z.ZodObject<{
716
+ t: z.ZodLiteral<"react">;
717
+ target: z.ZodString;
718
+ key: z.ZodString;
719
+ on: z.ZodBoolean;
720
+ }, z.core.$strict>, z.ZodObject<{
721
+ t: z.ZodLiteral<"pin">;
722
+ target: z.ZodString;
723
+ on: z.ZodBoolean;
724
+ }, z.core.$strict>, z.ZodObject<{
725
+ t: z.ZodLiteral<"task">;
726
+ task: z.ZodDiscriminatedUnion<[z.ZodObject<{
727
+ k: z.ZodLiteral<"request">;
728
+ to: z.ZodString;
729
+ message: z.ZodObject<{
730
+ messageId: z.ZodString;
731
+ contextId: z.ZodOptional<z.ZodString>;
732
+ taskId: z.ZodOptional<z.ZodString>;
733
+ role: z.ZodEnum<{
734
+ ROLE_USER: "ROLE_USER";
735
+ ROLE_AGENT: "ROLE_AGENT";
736
+ }>;
737
+ parts: z.ZodArray<z.ZodObject<{
738
+ text: z.ZodOptional<z.ZodString>;
739
+ raw: z.ZodOptional<z.ZodString>;
740
+ url: z.ZodOptional<z.ZodString>;
741
+ data: z.ZodOptional<z.ZodUnknown>;
742
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
743
+ filename: z.ZodOptional<z.ZodString>;
744
+ mediaType: z.ZodOptional<z.ZodString>;
745
+ }, z.core.$strip>>;
746
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
747
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
748
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
749
+ }, z.core.$strip>;
750
+ delegation: z.ZodArray<z.ZodObject<{
751
+ realm: z.ZodString;
752
+ task: z.ZodString;
753
+ from: z.ZodString;
754
+ to: z.ZodString;
755
+ by: z.ZodString;
756
+ ts: z.ZodNumber;
757
+ exp: z.ZodNumber;
758
+ maxDepth: z.ZodNumber;
759
+ scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
760
+ parent: z.ZodOptional<z.ZodString>;
761
+ sig: z.ZodString;
762
+ }, z.core.$loose>>;
763
+ }, z.core.$strict>, z.ZodObject<{
764
+ k: z.ZodLiteral<"status">;
765
+ root: z.ZodString;
766
+ update: z.ZodObject<{
767
+ taskId: z.ZodString;
768
+ contextId: z.ZodString;
769
+ status: z.ZodObject<{
770
+ state: z.ZodEnum<{
771
+ TASK_STATE_SUBMITTED: "TASK_STATE_SUBMITTED";
772
+ TASK_STATE_WORKING: "TASK_STATE_WORKING";
773
+ TASK_STATE_COMPLETED: "TASK_STATE_COMPLETED";
774
+ TASK_STATE_FAILED: "TASK_STATE_FAILED";
775
+ TASK_STATE_CANCELED: "TASK_STATE_CANCELED";
776
+ TASK_STATE_INPUT_REQUIRED: "TASK_STATE_INPUT_REQUIRED";
777
+ TASK_STATE_REJECTED: "TASK_STATE_REJECTED";
778
+ TASK_STATE_AUTH_REQUIRED: "TASK_STATE_AUTH_REQUIRED";
779
+ }>;
780
+ message: z.ZodOptional<z.ZodObject<{
781
+ messageId: z.ZodString;
782
+ contextId: z.ZodOptional<z.ZodString>;
783
+ taskId: z.ZodOptional<z.ZodString>;
784
+ role: z.ZodEnum<{
785
+ ROLE_USER: "ROLE_USER";
786
+ ROLE_AGENT: "ROLE_AGENT";
787
+ }>;
788
+ parts: z.ZodArray<z.ZodObject<{
789
+ text: z.ZodOptional<z.ZodString>;
790
+ raw: z.ZodOptional<z.ZodString>;
791
+ url: z.ZodOptional<z.ZodString>;
792
+ data: z.ZodOptional<z.ZodUnknown>;
793
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
794
+ filename: z.ZodOptional<z.ZodString>;
795
+ mediaType: z.ZodOptional<z.ZodString>;
796
+ }, z.core.$strip>>;
797
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
798
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
799
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
800
+ }, z.core.$strip>>;
801
+ timestamp: z.ZodOptional<z.ZodString>;
802
+ }, z.core.$strip>;
803
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
804
+ }, z.core.$strip>;
805
+ }, z.core.$strict>, z.ZodObject<{
806
+ k: z.ZodLiteral<"artifact">;
807
+ root: z.ZodString;
808
+ update: z.ZodObject<{
809
+ taskId: z.ZodString;
810
+ contextId: z.ZodString;
811
+ artifact: z.ZodObject<{
812
+ artifactId: z.ZodString;
813
+ name: z.ZodOptional<z.ZodString>;
814
+ description: z.ZodOptional<z.ZodString>;
815
+ parts: z.ZodArray<z.ZodObject<{
816
+ text: z.ZodOptional<z.ZodString>;
817
+ raw: z.ZodOptional<z.ZodString>;
818
+ url: z.ZodOptional<z.ZodString>;
819
+ data: z.ZodOptional<z.ZodUnknown>;
820
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
821
+ filename: z.ZodOptional<z.ZodString>;
822
+ mediaType: z.ZodOptional<z.ZodString>;
823
+ }, z.core.$strip>>;
824
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
825
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
826
+ }, z.core.$strip>;
827
+ append: z.ZodOptional<z.ZodBoolean>;
828
+ lastChunk: z.ZodOptional<z.ZodBoolean>;
829
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
830
+ }, z.core.$strip>;
831
+ }, z.core.$strict>, z.ZodObject<{
832
+ k: z.ZodLiteral<"cancel">;
833
+ root: z.ZodString;
834
+ reason: z.ZodOptional<z.ZodString>;
835
+ }, z.core.$strict>, z.ZodObject<{
836
+ k: z.ZodLiteral<"followUp">;
837
+ root: z.ZodString;
838
+ message: z.ZodObject<{
839
+ messageId: z.ZodString;
840
+ contextId: z.ZodOptional<z.ZodString>;
841
+ taskId: z.ZodOptional<z.ZodString>;
842
+ role: z.ZodEnum<{
843
+ ROLE_USER: "ROLE_USER";
844
+ ROLE_AGENT: "ROLE_AGENT";
845
+ }>;
846
+ parts: z.ZodArray<z.ZodObject<{
847
+ text: z.ZodOptional<z.ZodString>;
848
+ raw: z.ZodOptional<z.ZodString>;
849
+ url: z.ZodOptional<z.ZodString>;
850
+ data: z.ZodOptional<z.ZodUnknown>;
851
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
852
+ filename: z.ZodOptional<z.ZodString>;
853
+ mediaType: z.ZodOptional<z.ZodString>;
854
+ }, z.core.$strip>>;
855
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
856
+ extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
857
+ referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
858
+ }, z.core.$strip>;
859
+ }, z.core.$strict>], "k">;
860
+ }, z.core.$strict>, z.ZodObject<{
861
+ t: z.ZodLiteral<"receipt">;
862
+ target: z.ZodString;
863
+ stage: z.ZodEnum<{
864
+ delivered: "delivered";
865
+ handed_to_agent: "handed_to_agent";
866
+ read: "read";
867
+ }>;
868
+ }, z.core.$strict>, z.ZodObject<{
869
+ t: z.ZodLiteral<"meta">;
870
+ name: z.ZodOptional<z.ZodString>;
871
+ topic: z.ZodOptional<z.ZodString>;
872
+ purpose: z.ZodOptional<z.ZodString>;
873
+ }, z.core.$strict>, z.ZodObject<{
874
+ t: z.ZodLiteral<"policy">;
875
+ agentContext: z.ZodOptional<z.ZodEnum<{
876
+ none: "none";
877
+ members: "members";
878
+ seats: "seats";
879
+ }>>;
880
+ bridges: z.ZodOptional<z.ZodEnum<{
881
+ none: "none";
882
+ members: "members";
883
+ admins: "admins";
884
+ }>>;
885
+ }, z.core.$strict>, z.ZodObject<{
886
+ t: z.ZodLiteral<"sync">;
887
+ sync: z.ZodDiscriminatedUnion<[z.ZodObject<{
888
+ s: z.ZodLiteral<"read">;
889
+ cid: z.ZodString;
890
+ upTo: z.ZodNumber;
891
+ thread: z.ZodOptional<z.ZodString>;
892
+ }, z.core.$strict>, z.ZodObject<{
893
+ s: z.ZodLiteral<"unread">;
894
+ cid: z.ZodString;
895
+ from: z.ZodNumber;
896
+ }, z.core.$strict>, z.ZodObject<{
897
+ s: z.ZodLiteral<"prefs">;
898
+ cid: z.ZodString;
899
+ notify: z.ZodEnum<{
900
+ none: "none";
901
+ all: "all";
902
+ mentions: "mentions";
903
+ }>;
904
+ muteUntil: z.ZodOptional<z.ZodNumber>;
905
+ receipts: z.ZodOptional<z.ZodBoolean>;
906
+ }, z.core.$strict>, z.ZodObject<{
907
+ s: z.ZodLiteral<"follow">;
908
+ cid: z.ZodString;
909
+ thread: z.ZodString;
910
+ on: z.ZodBoolean;
911
+ }, z.core.$strict>, z.ZodObject<{
912
+ s: z.ZodLiteral<"save">;
913
+ cid: z.ZodString;
914
+ target: z.ZodString;
915
+ on: z.ZodBoolean;
916
+ }, z.core.$strict>, z.ZodObject<{
917
+ s: z.ZodLiteral<"draft">;
918
+ cid: z.ZodString;
919
+ thread: z.ZodOptional<z.ZodString>;
920
+ text: z.ZodString;
921
+ }, z.core.$strict>, z.ZodObject<{
922
+ s: z.ZodLiteral<"joined">;
923
+ cid: z.ZodString;
924
+ on: z.ZodBoolean;
925
+ }, z.core.$strict>, z.ZodObject<{
926
+ s: z.ZodLiteral<"grant">;
927
+ grant: z.ZodRecord<z.ZodString, z.ZodUnknown>;
928
+ }, z.core.$strict>, z.ZodObject<{
929
+ s: z.ZodLiteral<"context">;
930
+ rules: z.ZodArray<z.ZodObject<{
931
+ agent: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>;
932
+ scope: z.ZodUnion<readonly [z.ZodObject<{
933
+ cid: z.ZodString;
934
+ }, z.core.$strict>, z.ZodObject<{
935
+ kind: z.ZodEnum<{
936
+ dm: "dm";
937
+ group: "group";
938
+ own: "own";
939
+ "channel.private": "channel.private";
940
+ "channel.public": "channel.public";
941
+ }>;
942
+ }, z.core.$strict>]>;
943
+ access: z.ZodEnum<{
944
+ ask: "ask";
945
+ allow: "allow";
946
+ off: "off";
947
+ }>;
948
+ lookbackDays: z.ZodOptional<z.ZodNumber>;
949
+ }, z.core.$strict>>;
950
+ }, z.core.$strict>, z.ZodObject<{
951
+ s: z.ZodLiteral<"localRetention">;
952
+ cid: z.ZodString;
953
+ days: z.ZodNumber;
954
+ }, z.core.$strict>, z.ZodObject<{
955
+ s: z.ZodLiteral<"keys">;
956
+ cid: z.ZodString;
957
+ shares: z.ZodArray<z.ZodObject<{
958
+ epoch: z.ZodNumber;
959
+ device: z.ZodString;
960
+ idx: z.ZodNumber;
961
+ ck: z.ZodString;
962
+ }, z.core.$strict>>;
963
+ }, z.core.$strict>, z.ZodObject<{
964
+ s: z.ZodLiteral<"link">;
965
+ link: z.ZodObject<{
966
+ id: z.ZodString;
967
+ channel: z.ZodEnum<{
968
+ telegram: "telegram";
969
+ slack: "slack";
970
+ }>;
971
+ account: z.ZodString;
972
+ host: z.ZodString;
973
+ proof: z.ZodObject<{
974
+ method: z.ZodLiteral<"code-sas">;
975
+ codeDigest: z.ZodString;
976
+ sas: z.ZodString;
977
+ }, z.core.$strict>;
978
+ authority: z.ZodArray<z.ZodEnum<{
979
+ chat: "chat";
980
+ view: "view";
981
+ }>>;
982
+ linkedAt: z.ZodNumber;
983
+ revokedAt: z.ZodOptional<z.ZodNumber>;
984
+ }, z.core.$strict>;
985
+ }, z.core.$strict>], "s">;
986
+ }, z.core.$strict>], "t">;
987
+ export type MsgBody = z.infer<typeof MsgBody>;
988
+ export type MsgKind = MsgBody["t"];
989
+ /** A control op, in plaintext: the relay routes and checks authority by it. */
990
+ export declare const ConvOpEvent: z.ZodObject<{
991
+ class: z.ZodLiteral<"op">;
992
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
993
+ op: z.ZodLiteral<"create">;
994
+ kind: z.ZodEnum<{
995
+ self: "self";
996
+ channel: "channel";
997
+ dm: "dm";
998
+ group: "group";
999
+ }>;
1000
+ visibility: z.ZodOptional<z.ZodEnum<{
1001
+ public: "public";
1002
+ private: "private";
1003
+ }>>;
1004
+ history: z.ZodEnum<{
1005
+ none: "none";
1006
+ shared: "shared";
1007
+ }>;
1008
+ retainDays: z.ZodNumber;
1009
+ org: z.ZodOptional<z.ZodString>;
1010
+ participants: z.ZodArray<z.ZodObject<{
1011
+ p: z.ZodString;
1012
+ role: z.ZodEnum<{
1013
+ admin: "admin";
1014
+ member: "member";
1015
+ owner: "owner";
1016
+ guest: "guest";
1017
+ }>;
1018
+ device: z.ZodOptional<z.ZodString>;
1019
+ respondTo: z.ZodOptional<z.ZodEnum<{
1020
+ self: "self";
1021
+ none: "none";
1022
+ members: "members";
1023
+ }>>;
1024
+ }, z.core.$strict>>;
1025
+ post: z.ZodOptional<z.ZodEnum<{
1026
+ all: "all";
1027
+ admins: "admins";
1028
+ }>>;
1029
+ invite: z.ZodOptional<z.ZodEnum<{
1030
+ all: "all";
1031
+ admins: "admins";
1032
+ }>>;
1033
+ pins: z.ZodOptional<z.ZodEnum<{
1034
+ all: "all";
1035
+ admins: "admins";
1036
+ }>>;
1037
+ sealedMeta: z.ZodOptional<z.ZodString>;
1038
+ }, z.core.$strict>, z.ZodObject<{
1039
+ op: z.ZodLiteral<"add">;
1040
+ participants: z.ZodArray<z.ZodObject<{
1041
+ p: z.ZodString;
1042
+ role: z.ZodEnum<{
1043
+ admin: "admin";
1044
+ member: "member";
1045
+ owner: "owner";
1046
+ guest: "guest";
1047
+ }>;
1048
+ device: z.ZodOptional<z.ZodString>;
1049
+ respondTo: z.ZodOptional<z.ZodEnum<{
1050
+ self: "self";
1051
+ none: "none";
1052
+ members: "members";
1053
+ }>>;
1054
+ }, z.core.$strict>>;
1055
+ }, z.core.$strict>, z.ZodObject<{
1056
+ op: z.ZodLiteral<"accept">;
1057
+ }, z.core.$strict>, z.ZodObject<{
1058
+ op: z.ZodLiteral<"join">;
1059
+ }, z.core.$strict>, z.ZodObject<{
1060
+ op: z.ZodLiteral<"leave">;
1061
+ }, z.core.$strict>, z.ZodObject<{
1062
+ op: z.ZodLiteral<"remove">;
1063
+ participants: z.ZodArray<z.ZodString>;
1064
+ }, z.core.$strict>, z.ZodObject<{
1065
+ op: z.ZodLiteral<"role">;
1066
+ p: z.ZodString;
1067
+ role: z.ZodEnum<{
1068
+ admin: "admin";
1069
+ member: "member";
1070
+ owner: "owner";
1071
+ guest: "guest";
1072
+ }>;
1073
+ }, z.core.$strict>, z.ZodObject<{
1074
+ op: z.ZodLiteral<"seat">;
1075
+ p: z.ZodString;
1076
+ device: z.ZodOptional<z.ZodString>;
1077
+ respondTo: z.ZodOptional<z.ZodEnum<{
1078
+ self: "self";
1079
+ none: "none";
1080
+ members: "members";
1081
+ }>>;
1082
+ }, z.core.$strict>, z.ZodObject<{
1083
+ op: z.ZodLiteral<"settings">;
1084
+ visibility: z.ZodOptional<z.ZodEnum<{
1085
+ public: "public";
1086
+ private: "private";
1087
+ }>>;
1088
+ history: z.ZodOptional<z.ZodEnum<{
1089
+ none: "none";
1090
+ shared: "shared";
1091
+ }>>;
1092
+ retainDays: z.ZodOptional<z.ZodNumber>;
1093
+ post: z.ZodOptional<z.ZodEnum<{
1094
+ all: "all";
1095
+ admins: "admins";
1096
+ }>>;
1097
+ invite: z.ZodOptional<z.ZodEnum<{
1098
+ all: "all";
1099
+ admins: "admins";
1100
+ }>>;
1101
+ pins: z.ZodOptional<z.ZodEnum<{
1102
+ all: "all";
1103
+ admins: "admins";
1104
+ }>>;
1105
+ }, z.core.$strict>, z.ZodObject<{
1106
+ op: z.ZodLiteral<"archive">;
1107
+ on: z.ZodBoolean;
1108
+ }, z.core.$strict>, z.ZodObject<{
1109
+ op: z.ZodLiteral<"rekey">;
1110
+ epoch: z.ZodNumber;
1111
+ cause: z.ZodEnum<{
1112
+ device: "device";
1113
+ removed: "removed";
1114
+ added: "added";
1115
+ settings: "settings";
1116
+ schedule: "schedule";
1117
+ }>;
1118
+ }, z.core.$strict>], "op">;
1119
+ sig: z.ZodString;
1120
+ v: z.ZodLiteral<"messaging/1">;
1121
+ realm: z.ZodString;
1122
+ cid: z.ZodString;
1123
+ id: z.ZodString;
1124
+ by: z.ZodObject<{
1125
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1126
+ device: z.ZodString;
1127
+ agent: z.ZodOptional<z.ZodString>;
1128
+ }, z.core.$strict>;
1129
+ ts: z.ZodNumber;
1130
+ opHead: z.ZodObject<{
1131
+ seq: z.ZodNumber;
1132
+ hash: z.ZodString;
1133
+ }, z.core.$strict>;
1134
+ seen: z.ZodOptional<z.ZodObject<{
1135
+ seq: z.ZodNumber;
1136
+ hash: z.ZodString;
1137
+ }, z.core.$strict>>;
1138
+ }, z.core.$strict>;
1139
+ export type ConvOpEvent = z.infer<typeof ConvOpEvent>;
1140
+ /** base64url(nonce ‖ AES-256-GCM ciphertext ‖ tag) of JCS(`MsgBody`), sealed under one message key. */
1141
+ export declare const SealedBody: z.ZodString;
1142
+ /** Everything else, sealed under the author device's sender key at (`epoch`, `idx`). */
1143
+ export declare const ConvMsgEvent: z.ZodObject<{
1144
+ class: z.ZodLiteral<"msg">;
1145
+ epoch: z.ZodNumber;
1146
+ idx: z.ZodNumber;
1147
+ wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
1148
+ body: z.ZodString;
1149
+ sig: z.ZodString;
1150
+ v: z.ZodLiteral<"messaging/1">;
1151
+ realm: z.ZodString;
1152
+ cid: z.ZodString;
1153
+ id: z.ZodString;
1154
+ by: z.ZodObject<{
1155
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1156
+ device: z.ZodString;
1157
+ agent: z.ZodOptional<z.ZodString>;
1158
+ }, z.core.$strict>;
1159
+ ts: z.ZodNumber;
1160
+ opHead: z.ZodObject<{
1161
+ seq: z.ZodNumber;
1162
+ hash: z.ZodString;
1163
+ }, z.core.$strict>;
1164
+ seen: z.ZodOptional<z.ZodObject<{
1165
+ seq: z.ZodNumber;
1166
+ hash: z.ZodString;
1167
+ }, z.core.$strict>>;
1168
+ }, z.core.$strict>;
1169
+ export type ConvMsgEvent = z.infer<typeof ConvMsgEvent>;
1170
+ /** One recipient device's share, sealed to it under the envelope seal (spec §5, "Sealing"). */
1171
+ export declare const SealedShare: z.ZodObject<{
1172
+ to: z.ZodObject<{
1173
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1174
+ device: z.ZodString;
1175
+ }, z.core.$strict>;
1176
+ epk: z.ZodString;
1177
+ nonce: z.ZodString;
1178
+ ct: z.ZodString;
1179
+ }, z.core.$strict>;
1180
+ export type SealedShare = z.infer<typeof SealedShare>;
1181
+ export declare const KeysBody: z.ZodObject<{
1182
+ shares: z.ZodArray<z.ZodObject<{
1183
+ to: z.ZodObject<{
1184
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1185
+ device: z.ZodString;
1186
+ }, z.core.$strict>;
1187
+ epk: z.ZodString;
1188
+ nonce: z.ZodString;
1189
+ ct: z.ZodString;
1190
+ }, z.core.$strict>>;
1191
+ }, z.core.$strict>;
1192
+ export type KeysBody = z.infer<typeof KeysBody>;
1193
+ /** Sender-key and history shares, sealed pairwise; the relay serves each share only to its recipient. */
1194
+ export declare const ConvKeysEvent: z.ZodObject<{
1195
+ class: z.ZodLiteral<"keys">;
1196
+ body: z.ZodObject<{
1197
+ shares: z.ZodArray<z.ZodObject<{
1198
+ to: z.ZodObject<{
1199
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1200
+ device: z.ZodString;
1201
+ }, z.core.$strict>;
1202
+ epk: z.ZodString;
1203
+ nonce: z.ZodString;
1204
+ ct: z.ZodString;
1205
+ }, z.core.$strict>>;
1206
+ }, z.core.$strict>;
1207
+ sig: z.ZodString;
1208
+ v: z.ZodLiteral<"messaging/1">;
1209
+ realm: z.ZodString;
1210
+ cid: z.ZodString;
1211
+ id: z.ZodString;
1212
+ by: z.ZodObject<{
1213
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1214
+ device: z.ZodString;
1215
+ agent: z.ZodOptional<z.ZodString>;
1216
+ }, z.core.$strict>;
1217
+ ts: z.ZodNumber;
1218
+ opHead: z.ZodObject<{
1219
+ seq: z.ZodNumber;
1220
+ hash: z.ZodString;
1221
+ }, z.core.$strict>;
1222
+ seen: z.ZodOptional<z.ZodObject<{
1223
+ seq: z.ZodNumber;
1224
+ hash: z.ZodString;
1225
+ }, z.core.$strict>>;
1226
+ }, z.core.$strict>;
1227
+ export type ConvKeysEvent = z.infer<typeof ConvKeysEvent>;
1228
+ export declare const ConvEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
1229
+ class: z.ZodLiteral<"op">;
1230
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1231
+ op: z.ZodLiteral<"create">;
1232
+ kind: z.ZodEnum<{
1233
+ self: "self";
1234
+ channel: "channel";
1235
+ dm: "dm";
1236
+ group: "group";
1237
+ }>;
1238
+ visibility: z.ZodOptional<z.ZodEnum<{
1239
+ public: "public";
1240
+ private: "private";
1241
+ }>>;
1242
+ history: z.ZodEnum<{
1243
+ none: "none";
1244
+ shared: "shared";
1245
+ }>;
1246
+ retainDays: z.ZodNumber;
1247
+ org: z.ZodOptional<z.ZodString>;
1248
+ participants: z.ZodArray<z.ZodObject<{
1249
+ p: z.ZodString;
1250
+ role: z.ZodEnum<{
1251
+ admin: "admin";
1252
+ member: "member";
1253
+ owner: "owner";
1254
+ guest: "guest";
1255
+ }>;
1256
+ device: z.ZodOptional<z.ZodString>;
1257
+ respondTo: z.ZodOptional<z.ZodEnum<{
1258
+ self: "self";
1259
+ none: "none";
1260
+ members: "members";
1261
+ }>>;
1262
+ }, z.core.$strict>>;
1263
+ post: z.ZodOptional<z.ZodEnum<{
1264
+ all: "all";
1265
+ admins: "admins";
1266
+ }>>;
1267
+ invite: z.ZodOptional<z.ZodEnum<{
1268
+ all: "all";
1269
+ admins: "admins";
1270
+ }>>;
1271
+ pins: z.ZodOptional<z.ZodEnum<{
1272
+ all: "all";
1273
+ admins: "admins";
1274
+ }>>;
1275
+ sealedMeta: z.ZodOptional<z.ZodString>;
1276
+ }, z.core.$strict>, z.ZodObject<{
1277
+ op: z.ZodLiteral<"add">;
1278
+ participants: z.ZodArray<z.ZodObject<{
1279
+ p: z.ZodString;
1280
+ role: z.ZodEnum<{
1281
+ admin: "admin";
1282
+ member: "member";
1283
+ owner: "owner";
1284
+ guest: "guest";
1285
+ }>;
1286
+ device: z.ZodOptional<z.ZodString>;
1287
+ respondTo: z.ZodOptional<z.ZodEnum<{
1288
+ self: "self";
1289
+ none: "none";
1290
+ members: "members";
1291
+ }>>;
1292
+ }, z.core.$strict>>;
1293
+ }, z.core.$strict>, z.ZodObject<{
1294
+ op: z.ZodLiteral<"accept">;
1295
+ }, z.core.$strict>, z.ZodObject<{
1296
+ op: z.ZodLiteral<"join">;
1297
+ }, z.core.$strict>, z.ZodObject<{
1298
+ op: z.ZodLiteral<"leave">;
1299
+ }, z.core.$strict>, z.ZodObject<{
1300
+ op: z.ZodLiteral<"remove">;
1301
+ participants: z.ZodArray<z.ZodString>;
1302
+ }, z.core.$strict>, z.ZodObject<{
1303
+ op: z.ZodLiteral<"role">;
1304
+ p: z.ZodString;
1305
+ role: z.ZodEnum<{
1306
+ admin: "admin";
1307
+ member: "member";
1308
+ owner: "owner";
1309
+ guest: "guest";
1310
+ }>;
1311
+ }, z.core.$strict>, z.ZodObject<{
1312
+ op: z.ZodLiteral<"seat">;
1313
+ p: z.ZodString;
1314
+ device: z.ZodOptional<z.ZodString>;
1315
+ respondTo: z.ZodOptional<z.ZodEnum<{
1316
+ self: "self";
1317
+ none: "none";
1318
+ members: "members";
1319
+ }>>;
1320
+ }, z.core.$strict>, z.ZodObject<{
1321
+ op: z.ZodLiteral<"settings">;
1322
+ visibility: z.ZodOptional<z.ZodEnum<{
1323
+ public: "public";
1324
+ private: "private";
1325
+ }>>;
1326
+ history: z.ZodOptional<z.ZodEnum<{
1327
+ none: "none";
1328
+ shared: "shared";
1329
+ }>>;
1330
+ retainDays: z.ZodOptional<z.ZodNumber>;
1331
+ post: z.ZodOptional<z.ZodEnum<{
1332
+ all: "all";
1333
+ admins: "admins";
1334
+ }>>;
1335
+ invite: z.ZodOptional<z.ZodEnum<{
1336
+ all: "all";
1337
+ admins: "admins";
1338
+ }>>;
1339
+ pins: z.ZodOptional<z.ZodEnum<{
1340
+ all: "all";
1341
+ admins: "admins";
1342
+ }>>;
1343
+ }, z.core.$strict>, z.ZodObject<{
1344
+ op: z.ZodLiteral<"archive">;
1345
+ on: z.ZodBoolean;
1346
+ }, z.core.$strict>, z.ZodObject<{
1347
+ op: z.ZodLiteral<"rekey">;
1348
+ epoch: z.ZodNumber;
1349
+ cause: z.ZodEnum<{
1350
+ device: "device";
1351
+ removed: "removed";
1352
+ added: "added";
1353
+ settings: "settings";
1354
+ schedule: "schedule";
1355
+ }>;
1356
+ }, z.core.$strict>], "op">;
1357
+ sig: z.ZodString;
1358
+ v: z.ZodLiteral<"messaging/1">;
1359
+ realm: z.ZodString;
1360
+ cid: z.ZodString;
1361
+ id: z.ZodString;
1362
+ by: z.ZodObject<{
1363
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1364
+ device: z.ZodString;
1365
+ agent: z.ZodOptional<z.ZodString>;
1366
+ }, z.core.$strict>;
1367
+ ts: z.ZodNumber;
1368
+ opHead: z.ZodObject<{
1369
+ seq: z.ZodNumber;
1370
+ hash: z.ZodString;
1371
+ }, z.core.$strict>;
1372
+ seen: z.ZodOptional<z.ZodObject<{
1373
+ seq: z.ZodNumber;
1374
+ hash: z.ZodString;
1375
+ }, z.core.$strict>>;
1376
+ }, z.core.$strict>, z.ZodObject<{
1377
+ class: z.ZodLiteral<"msg">;
1378
+ epoch: z.ZodNumber;
1379
+ idx: z.ZodNumber;
1380
+ wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
1381
+ body: z.ZodString;
1382
+ sig: z.ZodString;
1383
+ v: z.ZodLiteral<"messaging/1">;
1384
+ realm: z.ZodString;
1385
+ cid: z.ZodString;
1386
+ id: z.ZodString;
1387
+ by: z.ZodObject<{
1388
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1389
+ device: z.ZodString;
1390
+ agent: z.ZodOptional<z.ZodString>;
1391
+ }, z.core.$strict>;
1392
+ ts: z.ZodNumber;
1393
+ opHead: z.ZodObject<{
1394
+ seq: z.ZodNumber;
1395
+ hash: z.ZodString;
1396
+ }, z.core.$strict>;
1397
+ seen: z.ZodOptional<z.ZodObject<{
1398
+ seq: z.ZodNumber;
1399
+ hash: z.ZodString;
1400
+ }, z.core.$strict>>;
1401
+ }, z.core.$strict>, z.ZodObject<{
1402
+ class: z.ZodLiteral<"keys">;
1403
+ body: z.ZodObject<{
1404
+ shares: z.ZodArray<z.ZodObject<{
1405
+ to: z.ZodObject<{
1406
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1407
+ device: z.ZodString;
1408
+ }, z.core.$strict>;
1409
+ epk: z.ZodString;
1410
+ nonce: z.ZodString;
1411
+ ct: z.ZodString;
1412
+ }, z.core.$strict>>;
1413
+ }, z.core.$strict>;
1414
+ sig: z.ZodString;
1415
+ v: z.ZodLiteral<"messaging/1">;
1416
+ realm: z.ZodString;
1417
+ cid: z.ZodString;
1418
+ id: z.ZodString;
1419
+ by: z.ZodObject<{
1420
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1421
+ device: z.ZodString;
1422
+ agent: z.ZodOptional<z.ZodString>;
1423
+ }, z.core.$strict>;
1424
+ ts: z.ZodNumber;
1425
+ opHead: z.ZodObject<{
1426
+ seq: z.ZodNumber;
1427
+ hash: z.ZodString;
1428
+ }, z.core.$strict>;
1429
+ seen: z.ZodOptional<z.ZodObject<{
1430
+ seq: z.ZodNumber;
1431
+ hash: z.ZodString;
1432
+ }, z.core.$strict>>;
1433
+ }, z.core.$strict>], "class">;
1434
+ export type ConvEvent = z.infer<typeof ConvEvent>;
1435
+ export type ConvEventClass = ConvEvent["class"];
1436
+ /** An event as its author signs it, without `sig`. */
1437
+ export type UnsignedConvEvent = ConvEvent extends infer E ? (E extends ConvEvent ? Omit<E, "sig"> : never) : never;
1438
+ /** An event's header: everything but `body` and `sig`. It is the AAD of a sealed body. */
1439
+ export type ConvEventHeader = ConvEvent extends infer E ? (E extends ConvEvent ? Omit<E, "body" | "sig"> : never) : never;
1440
+ /** An event as the relay stores and serves it. The relay does not sign it; members verify the chain. */
1441
+ export declare const ConvLogEntry: z.ZodObject<{
1442
+ seq: z.ZodNumber;
1443
+ prev: z.ZodString;
1444
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
1445
+ class: z.ZodLiteral<"op">;
1446
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
1447
+ op: z.ZodLiteral<"create">;
1448
+ kind: z.ZodEnum<{
1449
+ self: "self";
1450
+ channel: "channel";
1451
+ dm: "dm";
1452
+ group: "group";
1453
+ }>;
1454
+ visibility: z.ZodOptional<z.ZodEnum<{
1455
+ public: "public";
1456
+ private: "private";
1457
+ }>>;
1458
+ history: z.ZodEnum<{
1459
+ none: "none";
1460
+ shared: "shared";
1461
+ }>;
1462
+ retainDays: z.ZodNumber;
1463
+ org: z.ZodOptional<z.ZodString>;
1464
+ participants: z.ZodArray<z.ZodObject<{
1465
+ p: z.ZodString;
1466
+ role: z.ZodEnum<{
1467
+ admin: "admin";
1468
+ member: "member";
1469
+ owner: "owner";
1470
+ guest: "guest";
1471
+ }>;
1472
+ device: z.ZodOptional<z.ZodString>;
1473
+ respondTo: z.ZodOptional<z.ZodEnum<{
1474
+ self: "self";
1475
+ none: "none";
1476
+ members: "members";
1477
+ }>>;
1478
+ }, z.core.$strict>>;
1479
+ post: z.ZodOptional<z.ZodEnum<{
1480
+ all: "all";
1481
+ admins: "admins";
1482
+ }>>;
1483
+ invite: z.ZodOptional<z.ZodEnum<{
1484
+ all: "all";
1485
+ admins: "admins";
1486
+ }>>;
1487
+ pins: z.ZodOptional<z.ZodEnum<{
1488
+ all: "all";
1489
+ admins: "admins";
1490
+ }>>;
1491
+ sealedMeta: z.ZodOptional<z.ZodString>;
1492
+ }, z.core.$strict>, z.ZodObject<{
1493
+ op: z.ZodLiteral<"add">;
1494
+ participants: z.ZodArray<z.ZodObject<{
1495
+ p: z.ZodString;
1496
+ role: z.ZodEnum<{
1497
+ admin: "admin";
1498
+ member: "member";
1499
+ owner: "owner";
1500
+ guest: "guest";
1501
+ }>;
1502
+ device: z.ZodOptional<z.ZodString>;
1503
+ respondTo: z.ZodOptional<z.ZodEnum<{
1504
+ self: "self";
1505
+ none: "none";
1506
+ members: "members";
1507
+ }>>;
1508
+ }, z.core.$strict>>;
1509
+ }, z.core.$strict>, z.ZodObject<{
1510
+ op: z.ZodLiteral<"accept">;
1511
+ }, z.core.$strict>, z.ZodObject<{
1512
+ op: z.ZodLiteral<"join">;
1513
+ }, z.core.$strict>, z.ZodObject<{
1514
+ op: z.ZodLiteral<"leave">;
1515
+ }, z.core.$strict>, z.ZodObject<{
1516
+ op: z.ZodLiteral<"remove">;
1517
+ participants: z.ZodArray<z.ZodString>;
1518
+ }, z.core.$strict>, z.ZodObject<{
1519
+ op: z.ZodLiteral<"role">;
1520
+ p: z.ZodString;
1521
+ role: z.ZodEnum<{
1522
+ admin: "admin";
1523
+ member: "member";
1524
+ owner: "owner";
1525
+ guest: "guest";
1526
+ }>;
1527
+ }, z.core.$strict>, z.ZodObject<{
1528
+ op: z.ZodLiteral<"seat">;
1529
+ p: z.ZodString;
1530
+ device: z.ZodOptional<z.ZodString>;
1531
+ respondTo: z.ZodOptional<z.ZodEnum<{
1532
+ self: "self";
1533
+ none: "none";
1534
+ members: "members";
1535
+ }>>;
1536
+ }, z.core.$strict>, z.ZodObject<{
1537
+ op: z.ZodLiteral<"settings">;
1538
+ visibility: z.ZodOptional<z.ZodEnum<{
1539
+ public: "public";
1540
+ private: "private";
1541
+ }>>;
1542
+ history: z.ZodOptional<z.ZodEnum<{
1543
+ none: "none";
1544
+ shared: "shared";
1545
+ }>>;
1546
+ retainDays: z.ZodOptional<z.ZodNumber>;
1547
+ post: z.ZodOptional<z.ZodEnum<{
1548
+ all: "all";
1549
+ admins: "admins";
1550
+ }>>;
1551
+ invite: z.ZodOptional<z.ZodEnum<{
1552
+ all: "all";
1553
+ admins: "admins";
1554
+ }>>;
1555
+ pins: z.ZodOptional<z.ZodEnum<{
1556
+ all: "all";
1557
+ admins: "admins";
1558
+ }>>;
1559
+ }, z.core.$strict>, z.ZodObject<{
1560
+ op: z.ZodLiteral<"archive">;
1561
+ on: z.ZodBoolean;
1562
+ }, z.core.$strict>, z.ZodObject<{
1563
+ op: z.ZodLiteral<"rekey">;
1564
+ epoch: z.ZodNumber;
1565
+ cause: z.ZodEnum<{
1566
+ device: "device";
1567
+ removed: "removed";
1568
+ added: "added";
1569
+ settings: "settings";
1570
+ schedule: "schedule";
1571
+ }>;
1572
+ }, z.core.$strict>], "op">;
1573
+ sig: z.ZodString;
1574
+ v: z.ZodLiteral<"messaging/1">;
1575
+ realm: z.ZodString;
1576
+ cid: z.ZodString;
1577
+ id: z.ZodString;
1578
+ by: z.ZodObject<{
1579
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1580
+ device: z.ZodString;
1581
+ agent: z.ZodOptional<z.ZodString>;
1582
+ }, z.core.$strict>;
1583
+ ts: z.ZodNumber;
1584
+ opHead: z.ZodObject<{
1585
+ seq: z.ZodNumber;
1586
+ hash: z.ZodString;
1587
+ }, z.core.$strict>;
1588
+ seen: z.ZodOptional<z.ZodObject<{
1589
+ seq: z.ZodNumber;
1590
+ hash: z.ZodString;
1591
+ }, z.core.$strict>>;
1592
+ }, z.core.$strict>, z.ZodObject<{
1593
+ class: z.ZodLiteral<"msg">;
1594
+ epoch: z.ZodNumber;
1595
+ idx: z.ZodNumber;
1596
+ wake: z.ZodOptional<z.ZodArray<z.ZodString>>;
1597
+ body: z.ZodString;
1598
+ sig: z.ZodString;
1599
+ v: z.ZodLiteral<"messaging/1">;
1600
+ realm: z.ZodString;
1601
+ cid: z.ZodString;
1602
+ id: z.ZodString;
1603
+ by: z.ZodObject<{
1604
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1605
+ device: z.ZodString;
1606
+ agent: z.ZodOptional<z.ZodString>;
1607
+ }, z.core.$strict>;
1608
+ ts: z.ZodNumber;
1609
+ opHead: z.ZodObject<{
1610
+ seq: z.ZodNumber;
1611
+ hash: z.ZodString;
1612
+ }, z.core.$strict>;
1613
+ seen: z.ZodOptional<z.ZodObject<{
1614
+ seq: z.ZodNumber;
1615
+ hash: z.ZodString;
1616
+ }, z.core.$strict>>;
1617
+ }, z.core.$strict>, z.ZodObject<{
1618
+ class: z.ZodLiteral<"keys">;
1619
+ body: z.ZodObject<{
1620
+ shares: z.ZodArray<z.ZodObject<{
1621
+ to: z.ZodObject<{
1622
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1623
+ device: z.ZodString;
1624
+ }, z.core.$strict>;
1625
+ epk: z.ZodString;
1626
+ nonce: z.ZodString;
1627
+ ct: z.ZodString;
1628
+ }, z.core.$strict>>;
1629
+ }, z.core.$strict>;
1630
+ sig: z.ZodString;
1631
+ v: z.ZodLiteral<"messaging/1">;
1632
+ realm: z.ZodString;
1633
+ cid: z.ZodString;
1634
+ id: z.ZodString;
1635
+ by: z.ZodObject<{
1636
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
1637
+ device: z.ZodString;
1638
+ agent: z.ZodOptional<z.ZodString>;
1639
+ }, z.core.$strict>;
1640
+ ts: z.ZodNumber;
1641
+ opHead: z.ZodObject<{
1642
+ seq: z.ZodNumber;
1643
+ hash: z.ZodString;
1644
+ }, z.core.$strict>;
1645
+ seen: z.ZodOptional<z.ZodObject<{
1646
+ seq: z.ZodNumber;
1647
+ hash: z.ZodString;
1648
+ }, z.core.$strict>>;
1649
+ }, z.core.$strict>], "class">;
1650
+ }, z.core.$strict>;
1651
+ export type ConvLogEntry = z.infer<typeof ConvLogEntry>;
1652
+ /** A log position: a seq and h(seq). */
1653
+ export declare const ConvHead: z.ZodObject<{
1654
+ seq: z.ZodNumber;
1655
+ hash: z.ZodString;
1656
+ }, z.core.$strict>;
1657
+ export type ConvHead = z.infer<typeof ConvHead>;