@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
@@ -6,9 +6,9 @@
6
6
  import { z } from "zod";
7
7
  export declare const EnvelopeType: z.ZodEnum<{
8
8
  message: "message";
9
- "task.cancel": "task.cancel";
10
9
  receipt: "receipt";
11
10
  presence: "presence";
11
+ "task.cancel": "task.cancel";
12
12
  "task.status": "task.status";
13
13
  "task.artifact": "task.artifact";
14
14
  }>;
@@ -66,9 +66,9 @@ export declare const Envelope: z.ZodObject<{
66
66
  realm: z.ZodString;
67
67
  type: z.ZodEnum<{
68
68
  message: "message";
69
- "task.cancel": "task.cancel";
70
69
  receipt: "receipt";
71
70
  presence: "presence";
71
+ "task.cancel": "task.cancel";
72
72
  "task.status": "task.status";
73
73
  "task.artifact": "task.artifact";
74
74
  }>;
@@ -111,44 +111,6 @@ export declare const Envelope: z.ZodObject<{
111
111
  sig: z.ZodString;
112
112
  }, z.core.$strip>;
113
113
  export type Envelope = z.infer<typeof Envelope>;
114
- /**
115
- * A channel change or post (spec §6.8), on a `kind: "message"` envelope sealed to a device with no recipient agent.
116
- * `create`: the full channel record with the person who created it, to every member device and to each later
117
- * invitee. `invite`: persons added, to the existing members. `leave`: the sender left. `remove`: persons removed by
118
- * the creator or an admin, to every member device. `post`: a line in the channel. `name` is always the channel's own
119
- * name. A DM line has no `conv` (spec §5, "Meaning").
120
- */
121
- export declare const ChannelConv: z.ZodDiscriminatedUnion<[z.ZodObject<{
122
- kind: z.ZodLiteral<"channel">;
123
- op: z.ZodLiteral<"create">;
124
- id: z.ZodString;
125
- name: z.ZodString;
126
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
127
- creator: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
128
- }, z.core.$strip>, z.ZodObject<{
129
- kind: z.ZodLiteral<"channel">;
130
- op: z.ZodLiteral<"invite">;
131
- id: z.ZodString;
132
- name: z.ZodString;
133
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
134
- }, z.core.$strip>, z.ZodObject<{
135
- kind: z.ZodLiteral<"channel">;
136
- op: z.ZodLiteral<"leave">;
137
- id: z.ZodString;
138
- name: z.ZodString;
139
- }, z.core.$strip>, z.ZodObject<{
140
- kind: z.ZodLiteral<"channel">;
141
- op: z.ZodLiteral<"remove">;
142
- id: z.ZodString;
143
- name: z.ZodString;
144
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
145
- }, z.core.$strip>, z.ZodObject<{
146
- kind: z.ZodLiteral<"channel">;
147
- op: z.ZodLiteral<"post">;
148
- id: z.ZodString;
149
- name: z.ZodString;
150
- }, z.core.$strip>], "op">;
151
- export type ChannelConv = z.infer<typeof ChannelConv>;
152
114
  /**
153
115
  * Sync between two devices of one person (spec §6.9, "Sync"): `grant` carries grants the person set or re-signed,
154
116
  * `snapshot` every current grant, for a device of the person that is new to the sender. The message carries exactly
@@ -168,6 +130,25 @@ export type SelfConv = z.infer<typeof SelfConv>;
168
130
  */
169
131
  export declare const RequestConv: z.ZodObject<{
170
132
  kind: z.ZodLiteral<"request">;
133
+ proof: z.ZodOptional<z.ZodObject<{
134
+ descriptor: z.ZodObject<{
135
+ id: z.ZodString;
136
+ issuedAt: z.ZodNumber;
137
+ expiresAt: z.ZodNumber;
138
+ commitment: z.ZodString;
139
+ by: z.ZodString;
140
+ sig: z.ZodString;
141
+ v: z.ZodLiteral<"messaging/1">;
142
+ realm: z.ZodString;
143
+ cid: z.ZodString;
144
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
145
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
146
+ }, z.core.$strict>;
147
+ opening: z.ZodObject<{
148
+ salt: z.ZodString;
149
+ text: z.ZodString;
150
+ }, z.core.$strict>;
151
+ }, z.core.$strict>>;
171
152
  }, z.core.$strip>;
172
153
  export type RequestConv = z.infer<typeof RequestConv>;
173
154
  /**
@@ -183,36 +164,7 @@ export declare const CardConv: z.ZodObject<{
183
164
  }, z.core.$strip>;
184
165
  export type CardConv = z.infer<typeof CardConv>;
185
166
  /** The conversation a `message` belongs to when its ends alone do not say (spec §5, "Meaning"). */
186
- export declare const Conv: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
187
- kind: z.ZodLiteral<"channel">;
188
- op: z.ZodLiteral<"create">;
189
- id: z.ZodString;
190
- name: z.ZodString;
191
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
192
- creator: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
193
- }, z.core.$strip>, z.ZodObject<{
194
- kind: z.ZodLiteral<"channel">;
195
- op: z.ZodLiteral<"invite">;
196
- id: z.ZodString;
197
- name: z.ZodString;
198
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
199
- }, z.core.$strip>, z.ZodObject<{
200
- kind: z.ZodLiteral<"channel">;
201
- op: z.ZodLiteral<"leave">;
202
- id: z.ZodString;
203
- name: z.ZodString;
204
- }, z.core.$strip>, z.ZodObject<{
205
- kind: z.ZodLiteral<"channel">;
206
- op: z.ZodLiteral<"remove">;
207
- id: z.ZodString;
208
- name: z.ZodString;
209
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
210
- }, z.core.$strip>, z.ZodObject<{
211
- kind: z.ZodLiteral<"channel">;
212
- op: z.ZodLiteral<"post">;
213
- id: z.ZodString;
214
- name: z.ZodString;
215
- }, z.core.$strip>], "op">, z.ZodObject<{
167
+ export declare const Conv: z.ZodDiscriminatedUnion<[z.ZodObject<{
216
168
  kind: z.ZodLiteral<"self">;
217
169
  what: z.ZodEnum<{
218
170
  grant: "grant";
@@ -220,6 +172,25 @@ export declare const Conv: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.Z
220
172
  }>;
221
173
  }, z.core.$strip>, z.ZodObject<{
222
174
  kind: z.ZodLiteral<"request">;
175
+ proof: z.ZodOptional<z.ZodObject<{
176
+ descriptor: z.ZodObject<{
177
+ id: z.ZodString;
178
+ issuedAt: z.ZodNumber;
179
+ expiresAt: z.ZodNumber;
180
+ commitment: z.ZodString;
181
+ by: z.ZodString;
182
+ sig: z.ZodString;
183
+ v: z.ZodLiteral<"messaging/1">;
184
+ realm: z.ZodString;
185
+ cid: z.ZodString;
186
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
187
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
188
+ }, z.core.$strict>;
189
+ opening: z.ZodObject<{
190
+ salt: z.ZodString;
191
+ text: z.ZodString;
192
+ }, z.core.$strict>;
193
+ }, z.core.$strict>>;
223
194
  }, z.core.$strip>, z.ZodObject<{
224
195
  kind: z.ZodLiteral<"card">;
225
196
  what: z.ZodEnum<{
@@ -273,36 +244,7 @@ export declare const MessagePayload: z.ZodObject<{
273
244
  parent: z.ZodOptional<z.ZodString>;
274
245
  sig: z.ZodString;
275
246
  }, z.core.$loose>>>;
276
- conv: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
277
- kind: z.ZodLiteral<"channel">;
278
- op: z.ZodLiteral<"create">;
279
- id: z.ZodString;
280
- name: z.ZodString;
281
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
282
- creator: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
283
- }, z.core.$strip>, z.ZodObject<{
284
- kind: z.ZodLiteral<"channel">;
285
- op: z.ZodLiteral<"invite">;
286
- id: z.ZodString;
287
- name: z.ZodString;
288
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
289
- }, z.core.$strip>, z.ZodObject<{
290
- kind: z.ZodLiteral<"channel">;
291
- op: z.ZodLiteral<"leave">;
292
- id: z.ZodString;
293
- name: z.ZodString;
294
- }, z.core.$strip>, z.ZodObject<{
295
- kind: z.ZodLiteral<"channel">;
296
- op: z.ZodLiteral<"remove">;
297
- id: z.ZodString;
298
- name: z.ZodString;
299
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
300
- }, z.core.$strip>, z.ZodObject<{
301
- kind: z.ZodLiteral<"channel">;
302
- op: z.ZodLiteral<"post">;
303
- id: z.ZodString;
304
- name: z.ZodString;
305
- }, z.core.$strip>], "op">, z.ZodObject<{
247
+ conv: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
306
248
  kind: z.ZodLiteral<"self">;
307
249
  what: z.ZodEnum<{
308
250
  grant: "grant";
@@ -310,6 +252,25 @@ export declare const MessagePayload: z.ZodObject<{
310
252
  }>;
311
253
  }, z.core.$strip>, z.ZodObject<{
312
254
  kind: z.ZodLiteral<"request">;
255
+ proof: z.ZodOptional<z.ZodObject<{
256
+ descriptor: z.ZodObject<{
257
+ id: z.ZodString;
258
+ issuedAt: z.ZodNumber;
259
+ expiresAt: z.ZodNumber;
260
+ commitment: z.ZodString;
261
+ by: z.ZodString;
262
+ sig: z.ZodString;
263
+ v: z.ZodLiteral<"messaging/1">;
264
+ realm: z.ZodString;
265
+ cid: z.ZodString;
266
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
267
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
268
+ }, z.core.$strict>;
269
+ opening: z.ZodObject<{
270
+ salt: z.ZodString;
271
+ text: z.ZodString;
272
+ }, z.core.$strict>;
273
+ }, z.core.$strict>>;
313
274
  }, z.core.$strip>, z.ZodObject<{
314
275
  kind: z.ZodLiteral<"card">;
315
276
  what: z.ZodEnum<{
@@ -413,6 +374,7 @@ export declare const ReceiptPayload: z.ZodObject<{
413
374
  refused: "refused";
414
375
  declined: "declined";
415
376
  request_required: "request_required";
377
+ peer_outdated: "peer_outdated";
416
378
  rate_limited: "rate_limited";
417
379
  loop_guard: "loop_guard";
418
380
  too_large: "too_large";
@@ -429,6 +391,8 @@ export declare const ReceiptPayload: z.ZodObject<{
429
391
  binding_invalid: "binding_invalid";
430
392
  jelly_unavailable: "jelly_unavailable";
431
393
  log_conflict: "log_conflict";
394
+ conv_conflict: "conv_conflict";
395
+ stale_epoch: "stale_epoch";
432
396
  device_limit: "device_limit";
433
397
  admission_required: "admission_required";
434
398
  admission_invalid: "admission_invalid";
@@ -443,6 +407,7 @@ export declare const ReceiptPayload: z.ZodObject<{
443
407
  ticket_invalid: "ticket_invalid";
444
408
  daemon_unavailable: "daemon_unavailable";
445
409
  daemon_mismatch: "daemon_mismatch";
410
+ store_refused: "store_refused";
446
411
  internal: "internal";
447
412
  }>>;
448
413
  note: z.ZodOptional<z.ZodString>;
@@ -534,36 +499,7 @@ export declare const PAYLOAD_BY_TYPE: {
534
499
  parent: z.ZodOptional<z.ZodString>;
535
500
  sig: z.ZodString;
536
501
  }, z.core.$loose>>>;
537
- conv: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
538
- kind: z.ZodLiteral<"channel">;
539
- op: z.ZodLiteral<"create">;
540
- id: z.ZodString;
541
- name: z.ZodString;
542
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
543
- creator: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
544
- }, z.core.$strip>, z.ZodObject<{
545
- kind: z.ZodLiteral<"channel">;
546
- op: z.ZodLiteral<"invite">;
547
- id: z.ZodString;
548
- name: z.ZodString;
549
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
550
- }, z.core.$strip>, z.ZodObject<{
551
- kind: z.ZodLiteral<"channel">;
552
- op: z.ZodLiteral<"leave">;
553
- id: z.ZodString;
554
- name: z.ZodString;
555
- }, z.core.$strip>, z.ZodObject<{
556
- kind: z.ZodLiteral<"channel">;
557
- op: z.ZodLiteral<"remove">;
558
- id: z.ZodString;
559
- name: z.ZodString;
560
- persons: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
561
- }, z.core.$strip>, z.ZodObject<{
562
- kind: z.ZodLiteral<"channel">;
563
- op: z.ZodLiteral<"post">;
564
- id: z.ZodString;
565
- name: z.ZodString;
566
- }, z.core.$strip>], "op">, z.ZodObject<{
502
+ conv: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
567
503
  kind: z.ZodLiteral<"self">;
568
504
  what: z.ZodEnum<{
569
505
  grant: "grant";
@@ -571,6 +507,25 @@ export declare const PAYLOAD_BY_TYPE: {
571
507
  }>;
572
508
  }, z.core.$strip>, z.ZodObject<{
573
509
  kind: z.ZodLiteral<"request">;
510
+ proof: z.ZodOptional<z.ZodObject<{
511
+ descriptor: z.ZodObject<{
512
+ id: z.ZodString;
513
+ issuedAt: z.ZodNumber;
514
+ expiresAt: z.ZodNumber;
515
+ commitment: z.ZodString;
516
+ by: z.ZodString;
517
+ sig: z.ZodString;
518
+ v: z.ZodLiteral<"messaging/1">;
519
+ realm: z.ZodString;
520
+ cid: z.ZodString;
521
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
522
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
523
+ }, z.core.$strict>;
524
+ opening: z.ZodObject<{
525
+ salt: z.ZodString;
526
+ text: z.ZodString;
527
+ }, z.core.$strict>;
528
+ }, z.core.$strict>>;
574
529
  }, z.core.$strip>, z.ZodObject<{
575
530
  kind: z.ZodLiteral<"card">;
576
531
  what: z.ZodEnum<{
@@ -666,6 +621,7 @@ export declare const PAYLOAD_BY_TYPE: {
666
621
  refused: "refused";
667
622
  declined: "declined";
668
623
  request_required: "request_required";
624
+ peer_outdated: "peer_outdated";
669
625
  rate_limited: "rate_limited";
670
626
  loop_guard: "loop_guard";
671
627
  too_large: "too_large";
@@ -682,6 +638,8 @@ export declare const PAYLOAD_BY_TYPE: {
682
638
  binding_invalid: "binding_invalid";
683
639
  jelly_unavailable: "jelly_unavailable";
684
640
  log_conflict: "log_conflict";
641
+ conv_conflict: "conv_conflict";
642
+ stale_epoch: "stale_epoch";
685
643
  device_limit: "device_limit";
686
644
  admission_required: "admission_required";
687
645
  admission_invalid: "admission_invalid";
@@ -696,6 +654,7 @@ export declare const PAYLOAD_BY_TYPE: {
696
654
  ticket_invalid: "ticket_invalid";
697
655
  daemon_unavailable: "daemon_unavailable";
698
656
  daemon_mismatch: "daemon_mismatch";
657
+ store_refused: "store_refused";
699
658
  internal: "internal";
700
659
  }>>;
701
660
  note: z.ZodOptional<z.ZodString>;
@@ -12,6 +12,7 @@ export declare const ErrorCode: z.ZodEnum<{
12
12
  refused: "refused";
13
13
  declined: "declined";
14
14
  request_required: "request_required";
15
+ peer_outdated: "peer_outdated";
15
16
  rate_limited: "rate_limited";
16
17
  loop_guard: "loop_guard";
17
18
  too_large: "too_large";
@@ -28,6 +29,8 @@ export declare const ErrorCode: z.ZodEnum<{
28
29
  binding_invalid: "binding_invalid";
29
30
  jelly_unavailable: "jelly_unavailable";
30
31
  log_conflict: "log_conflict";
32
+ conv_conflict: "conv_conflict";
33
+ stale_epoch: "stale_epoch";
31
34
  device_limit: "device_limit";
32
35
  admission_required: "admission_required";
33
36
  admission_invalid: "admission_invalid";
@@ -42,9 +45,28 @@ export declare const ErrorCode: z.ZodEnum<{
42
45
  ticket_invalid: "ticket_invalid";
43
46
  daemon_unavailable: "daemon_unavailable";
44
47
  daemon_mismatch: "daemon_mismatch";
48
+ store_refused: "store_refused";
45
49
  internal: "internal";
46
50
  }>;
47
51
  export type ErrorCode = z.infer<typeof ErrorCode>;
52
+ /**
53
+ * The exit status of a messagingd or messaging-relay that refuses its store and changes nothing (spec §8.8): `EX_CONFIG`
54
+ * of sysexits(3), for either reason. messagingd also prints one stderr line,
55
+ * `messagingd: store_refused: <reason>: <why and the remedy>`. A client matches this status, the code and the
56
+ * reason, never the wording.
57
+ */
58
+ export declare const STORE_REFUSED_EXIT = 78;
59
+ /**
60
+ * Why a store is refused (spec §8.8):
61
+ * - `pre-reset`: it records no store generation, or another one. Starting over (moving the home aside) is the remedy.
62
+ * - `newer`: its `min_reader` is above this reader's schema: a newer messagingd wrote it. Upgrading is the remedy;
63
+ * moving the home aside would set a newer home aside.
64
+ */
65
+ export declare const StoreRefusedReason: z.ZodEnum<{
66
+ "pre-reset": "pre-reset";
67
+ newer: "newer";
68
+ }>;
69
+ export type StoreRefusedReason = z.infer<typeof StoreRefusedReason>;
48
70
  export declare const ErrorBody: z.ZodObject<{
49
71
  code: z.ZodEnum<{
50
72
  expired: "expired";
@@ -58,6 +80,7 @@ export declare const ErrorBody: z.ZodObject<{
58
80
  refused: "refused";
59
81
  declined: "declined";
60
82
  request_required: "request_required";
83
+ peer_outdated: "peer_outdated";
61
84
  rate_limited: "rate_limited";
62
85
  loop_guard: "loop_guard";
63
86
  too_large: "too_large";
@@ -74,6 +97,8 @@ export declare const ErrorBody: z.ZodObject<{
74
97
  binding_invalid: "binding_invalid";
75
98
  jelly_unavailable: "jelly_unavailable";
76
99
  log_conflict: "log_conflict";
100
+ conv_conflict: "conv_conflict";
101
+ stale_epoch: "stale_epoch";
77
102
  device_limit: "device_limit";
78
103
  admission_required: "admission_required";
79
104
  admission_invalid: "admission_invalid";
@@ -88,6 +113,7 @@ export declare const ErrorBody: z.ZodObject<{
88
113
  ticket_invalid: "ticket_invalid";
89
114
  daemon_unavailable: "daemon_unavailable";
90
115
  daemon_mismatch: "daemon_mismatch";
116
+ store_refused: "store_refused";
91
117
  internal: "internal";
92
118
  }>;
93
119
  message: z.ZodString;
@@ -101,4 +127,18 @@ export declare class MessagingError extends Error {
101
127
  });
102
128
  toBody(): ErrorBody;
103
129
  }
130
+ /** `store_refused`, with its reason as a field: clients branch on `reason`, never on the message. */
131
+ export declare class StoreRefusedError extends MessagingError {
132
+ readonly reason: StoreRefusedReason;
133
+ constructor(reason: StoreRefusedReason, message: string, options?: {
134
+ cause?: unknown;
135
+ });
136
+ }
137
+ /** The stderr line of a messagingd that refuses its store: `messagingd: store_refused: <reason>: <text>`. */
138
+ export declare function storeRefusedLine(reason: StoreRefusedReason, text: string): string;
139
+ /**
140
+ * The reason on a messagingd refusal line, or undefined for any other line. Reads the tokens only; the text after
141
+ * them may change between releases.
142
+ */
143
+ export declare function storeRefusedReason(line: string): StoreRefusedReason | undefined;
104
144
  export declare function isMessagingError(value: unknown): value is MessagingError;
@@ -0,0 +1,51 @@
1
+ /** A bounded, sealed preview. Its signature is portable; the guest accepts exactly this op head and exposure. */
2
+ import { z } from "zod";
3
+ export declare const GuestInvitation: z.ZodObject<{
4
+ v: z.ZodLiteral<"messaging/1">;
5
+ realm: z.ZodString;
6
+ cid: z.ZodString;
7
+ id: z.ZodString;
8
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
9
+ inviter: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
10
+ by: z.ZodString;
11
+ head: z.ZodObject<{
12
+ seq: z.ZodNumber;
13
+ hash: z.ZodString;
14
+ }, z.core.$strict>;
15
+ issuedAt: z.ZodNumber;
16
+ expiresAt: z.ZodNumber;
17
+ kind: z.ZodEnum<{
18
+ channel: "channel";
19
+ group: "group";
20
+ }>;
21
+ history: z.ZodEnum<{
22
+ none: "none";
23
+ shared: "shared";
24
+ }>;
25
+ agentContext: z.ZodEnum<{
26
+ none: "none";
27
+ members: "members";
28
+ seats: "seats";
29
+ }>;
30
+ bridges: z.ZodEnum<{
31
+ none: "none";
32
+ members: "members";
33
+ admins: "admins";
34
+ }>;
35
+ audience: z.ZodArray<z.ZodObject<{
36
+ p: z.ZodString;
37
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
38
+ role: z.ZodEnum<{
39
+ admin: "admin";
40
+ member: "member";
41
+ owner: "owner";
42
+ guest: "guest";
43
+ }>;
44
+ state: z.ZodEnum<{
45
+ member: "member";
46
+ invited: "invited";
47
+ }>;
48
+ }, z.core.$strict>>;
49
+ sig: z.ZodString;
50
+ }, z.core.$strict>;
51
+ export type GuestInvitation = z.infer<typeof GuestInvitation>;
@@ -13,3 +13,9 @@ export * from "./directory-frames.js";
13
13
  export * from "./ipc.js";
14
14
  export * from "./ipc/device.js";
15
15
  export * from "./ipc/consent.js";
16
+ export * from "./conversation.js";
17
+ export * from "./conv-frames.js";
18
+ export * from "./contact-request.js";
19
+ export * from "./guest-invitation.js";
20
+ export * from "./ipc/conversation-views.js";
21
+ export * from "./ipc/conversations.js";