@real-life/trust-protocol 0.4.0 → 0.5.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 (88) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +47 -25
  3. package/dist/adapters/vti-mediator.d.ts +18 -3
  4. package/dist/adapters/vti-mediator.d.ts.map +1 -1
  5. package/dist/adapters/vti-mediator.js +51 -13
  6. package/dist/adapters/vti-mediator.js.map +1 -1
  7. package/dist/codec.d.ts +9 -1
  8. package/dist/codec.d.ts.map +1 -1
  9. package/dist/codec.js +107 -23
  10. package/dist/codec.js.map +1 -1
  11. package/dist/engine.d.ts +15 -3
  12. package/dist/engine.d.ts.map +1 -1
  13. package/dist/engine.js +130 -16
  14. package/dist/engine.js.map +1 -1
  15. package/dist/entropy.d.ts +1 -1
  16. package/dist/entropy.d.ts.map +1 -1
  17. package/dist/entropy.js +1 -1
  18. package/dist/entropy.js.map +1 -1
  19. package/dist/events.d.ts +21 -0
  20. package/dist/events.d.ts.map +1 -1
  21. package/dist/events.js.map +1 -1
  22. package/dist/holder-api.d.ts +29 -1
  23. package/dist/holder-api.d.ts.map +1 -1
  24. package/dist/holder-api.js +12 -2
  25. package/dist/holder-api.js.map +1 -1
  26. package/dist/holder-state-v2.d.ts +858 -0
  27. package/dist/holder-state-v2.d.ts.map +1 -0
  28. package/dist/holder-state-v2.js +2 -0
  29. package/dist/holder-state-v2.js.map +1 -0
  30. package/dist/index.d.ts +2 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +10 -6
  33. package/dist/index.js.map +1 -1
  34. package/dist/internal.d.ts +2 -1
  35. package/dist/internal.d.ts.map +1 -1
  36. package/dist/internal.js +1 -1
  37. package/dist/internal.js.map +1 -1
  38. package/dist/introduction/holder.d.ts.map +1 -1
  39. package/dist/introduction/holder.js +7 -0
  40. package/dist/introduction/holder.js.map +1 -1
  41. package/dist/invariants.d.ts.map +1 -1
  42. package/dist/invariants.js +70 -0
  43. package/dist/invariants.js.map +1 -1
  44. package/dist/membership/holder.d.ts +3 -5
  45. package/dist/membership/holder.d.ts.map +1 -1
  46. package/dist/membership/holder.js +165 -88
  47. package/dist/membership/holder.js.map +1 -1
  48. package/dist/membership.d.ts +31 -0
  49. package/dist/membership.d.ts.map +1 -1
  50. package/dist/membership.js +25 -2
  51. package/dist/membership.js.map +1 -1
  52. package/dist/message/holder.d.ts +49 -0
  53. package/dist/message/holder.d.ts.map +1 -0
  54. package/dist/message/holder.js +290 -0
  55. package/dist/message/holder.js.map +1 -0
  56. package/dist/message.d.ts +43 -0
  57. package/dist/message.d.ts.map +1 -0
  58. package/dist/message.js +51 -0
  59. package/dist/message.js.map +1 -0
  60. package/dist/receive.d.ts +4 -3
  61. package/dist/receive.d.ts.map +1 -1
  62. package/dist/receive.js +23 -4
  63. package/dist/receive.js.map +1 -1
  64. package/dist/results.d.ts +17 -2
  65. package/dist/results.d.ts.map +1 -1
  66. package/dist/results.js.map +1 -1
  67. package/dist/schemas.d.ts.map +1 -1
  68. package/dist/schemas.js +9 -6
  69. package/dist/schemas.js.map +1 -1
  70. package/dist/state.d.ts +66 -5
  71. package/dist/state.d.ts.map +1 -1
  72. package/dist/state.js +2 -1
  73. package/dist/state.js.map +1 -1
  74. package/dist/trust/continuity.d.ts.map +1 -1
  75. package/dist/trust/continuity.js +7 -1
  76. package/dist/trust/continuity.js.map +1 -1
  77. package/dist/trust/entries.d.ts.map +1 -1
  78. package/dist/trust/entries.js +103 -2
  79. package/dist/trust/entries.js.map +1 -1
  80. package/dist/views.d.ts +34 -2
  81. package/dist/views.d.ts.map +1 -1
  82. package/dist/views.js +19 -1
  83. package/dist/views.js.map +1 -1
  84. package/dist/wire.d.ts +47 -6
  85. package/dist/wire.d.ts.map +1 -1
  86. package/dist/wire.js.map +1 -1
  87. package/package.json +6 -2
  88. package/schemas/holder-state-v2.schema.json +4123 -0
@@ -0,0 +1,858 @@
1
+ import type { Json } from './core.js';
2
+ /** NON-NORMATIVE. The stored state of an @real-life/trust-protocol holder at codec 2 (lib/src/codec.ts): the library's storage format, not a protocol artifact. lib/src/holder-state-v2.ts is generated from it (scripts/build-holder-state-types.mjs). Not expressible here and checked by the codec alone: a record's id equals its key (contacts, relationships, groups, duties, rotations, prompts, acts, roster, invitations, records, introductions, offers, challenges, the inbox), an envelope's rkid equals its recipient's keyAgreement, and a set of strings (joining.surfaced, joining.declined, messages.blocked, messages.ready) is sorted. */
3
+ export type HolderStateV2 = {
4
+ codec: 2;
5
+ commitSeq: DecV2;
6
+ lastWhen: MillisV2;
7
+ register: {
8
+ labels: string[];
9
+ pairNonces: Record<string, string>;
10
+ carriers: Record<string, {
11
+ nonce: string;
12
+ generation: DecV2;
13
+ }[]>;
14
+ devices: {
15
+ names: string[];
16
+ revoked: string[];
17
+ };
18
+ community: ({
19
+ genesis: string;
20
+ head: DecV2;
21
+ }) | (null);
22
+ lineage: {
23
+ [k: string]: Json;
24
+ }[];
25
+ };
26
+ addresses: {
27
+ keys: Record<string, {
28
+ label: string;
29
+ lastShown: MillisV2;
30
+ retiredAt?: MillisV2;
31
+ }>;
32
+ tombstones: string[];
33
+ };
34
+ contacts: Record<string, ContactV2>;
35
+ relationships: Record<string, RelationshipV2>;
36
+ entryOrder: {
37
+ nextPos: DecV2;
38
+ heads: string[];
39
+ };
40
+ groups: Record<string, GroupV2>;
41
+ profile: {
42
+ body: Json;
43
+ revision: DecV2;
44
+ };
45
+ effects: Record<string, {
46
+ ack: (StoredAckV2) | (null);
47
+ expiresAt: MillisV2;
48
+ }>;
49
+ outbox: Record<string, OutboxItemV2>;
50
+ duties: Record<string, DutyV2>;
51
+ rotations: Record<string, RotationV2>;
52
+ prompts: Record<string, PromptV2>;
53
+ acts: Record<string, ActRecordV2>;
54
+ encounter: {
55
+ challenges: Record<string, {
56
+ value: string;
57
+ tCh: MillisV2;
58
+ label: string;
59
+ card: {
60
+ [k: string]: Json;
61
+ };
62
+ }>;
63
+ records: Record<string, EnactmentRecordV2>;
64
+ introductions: Record<string, IntroActV2>;
65
+ offers: Record<string, {
66
+ id: string;
67
+ mediatorContactId: string;
68
+ pin: string;
69
+ target: string;
70
+ at: MillisV2;
71
+ label?: string;
72
+ }>;
73
+ designators: Record<string, string>;
74
+ declarations: Record<string, {
75
+ issuer: string;
76
+ role: string;
77
+ revision: DecV2;
78
+ constants: Record<string, string>;
79
+ at: MillisV2;
80
+ }>;
81
+ };
82
+ joining: {
83
+ preludes: Record<string, {
84
+ group: string;
85
+ inviter: string;
86
+ contactId: string;
87
+ rkid: string;
88
+ memberLabel: string;
89
+ at: MillisV2;
90
+ }>;
91
+ invites: Record<string, {
92
+ credDigest: string;
93
+ group: string;
94
+ name: string;
95
+ /** the contact of the relationship its prelude binding attributed it to (RLTP-MT-3100); absent for an invitation attributed to none */
96
+ contactId?: string;
97
+ rkid?: string;
98
+ memberLabel: string;
99
+ invite: {
100
+ [k: string]: Json;
101
+ };
102
+ promptId: string;
103
+ validUntil: MillisV2;
104
+ status: "open" | "accepted" | "declined" | "joined";
105
+ at: MillisV2;
106
+ acceptDigest?: string;
107
+ }>;
108
+ /** the credential digest of every invitation surfaced, for the life of the holder (RLTP-MT-3130); sorted */
109
+ surfaced: string[];
110
+ /** the register of declined invitations (Message Tasks 6.4): credential digests, holder-wide, for the life of the holder; sorted */
111
+ declined: string[];
112
+ };
113
+ /** Message Tasks 0.1 on the holder (message/holder.ts); the time mark of RLTP-MSG-4060 is lastWhen */
114
+ messages: {
115
+ /** the relationships under a block (Message Tasks 6.1), by relationship id; sorted */
116
+ blocked: string[];
117
+ /** per relationship id: acceptance times inside the last 24 hours (Message Tasks 4.2) */
118
+ rates: Record<string, {
119
+ invites: MillisV2[];
120
+ messages: MillisV2[];
121
+ }>;
122
+ /** the own pair labels of the ready tuples (Message Tasks 5.1); sorted */
123
+ ready: string[];
124
+ /** the completion record (Message Tasks 4.4), per own pair label: mid → bodyDigest and sentAt */
125
+ records: Record<string, Record<string, {
126
+ bodyDigest: string;
127
+ sentAt: MillisV2;
128
+ }>>;
129
+ /** the inbox (Message Tasks 4.5), by the accepted document digest */
130
+ inbox: Record<string, {
131
+ id: string;
132
+ tuple: string;
133
+ mid: string;
134
+ body: {
135
+ [k: string]: Json;
136
+ };
137
+ receivedAt: MillisV2;
138
+ displayAt: MillisV2;
139
+ }>;
140
+ };
141
+ };
142
+ /** a counter as a canonical decimal string */
143
+ export type DecV2 = string;
144
+ /** milliseconds since the epoch, a safe non-negative integer */
145
+ export type MillisV2 = number;
146
+ export type SettingV2 = "default" | "on" | "off";
147
+ export type TrustClassV2 = "star" | "groupStar" | "anchorMapping" | "sealedGroupStar" | "profile";
148
+ export type RecipientV2 = {
149
+ contactId: string;
150
+ rkid: string;
151
+ keyAgreement: string;
152
+ anchor?: string;
153
+ via?: string;
154
+ };
155
+ export type EnvelopeV2 = {
156
+ rkid: string;
157
+ epk: string;
158
+ nonce: string;
159
+ ciphertext: string;
160
+ };
161
+ export type AssemblyV2 = {
162
+ salt: DecV2;
163
+ chunks: {
164
+ [k: string]: Json;
165
+ };
166
+ };
167
+ export type StarPairV2 = {
168
+ member: string;
169
+ head: string;
170
+ };
171
+ export type GroupStarItemV2 = ({
172
+ group: string;
173
+ mode: "digest";
174
+ }) | ({
175
+ group: string;
176
+ mode: "sealed";
177
+ member: string;
178
+ memberOp: string;
179
+ });
180
+ export type StarOutInflightV2 = {
181
+ view: StarPairV2[];
182
+ viewDigest: string;
183
+ digests: string[];
184
+ acked: string[];
185
+ };
186
+ /** the sender side of one reconciled sequence (5.4); snapshot and snapshotDigest are null together */
187
+ export type StarOutV2 = {
188
+ lastSalt: DecV2;
189
+ exhausted: boolean;
190
+ hwm: DecV2;
191
+ snapshot: (StarPairV2[]) | (null);
192
+ snapshotDigest: (string) | (null);
193
+ inflight: Record<string, StarOutInflightV2>;
194
+ };
195
+ export type StarInV2 = {
196
+ hwm: DecV2;
197
+ lowerBound: DecV2;
198
+ assembly: (AssemblyV2) | (null);
199
+ accepted: ({
200
+ salt: DecV2;
201
+ blinded: string[];
202
+ matches: string[];
203
+ }) | (null);
204
+ };
205
+ export type GroupStarOutInflightV2 = {
206
+ view: GroupStarItemV2[];
207
+ viewDigest: string;
208
+ digests: string[];
209
+ acked: string[];
210
+ };
211
+ /** the sender side of one reconciled sequence (5.4); snapshot and snapshotDigest are null together */
212
+ export type GroupStarOutV2 = {
213
+ lastSalt: DecV2;
214
+ exhausted: boolean;
215
+ hwm: DecV2;
216
+ snapshot: (GroupStarItemV2[]) | (null);
217
+ snapshotDigest: (string) | (null);
218
+ inflight: Record<string, GroupStarOutInflightV2>;
219
+ };
220
+ export type GroupStarInV2 = {
221
+ hwm: DecV2;
222
+ lowerBound: DecV2;
223
+ assembly: (AssemblyV2) | (null);
224
+ accepted: ({
225
+ salt: DecV2;
226
+ entries: {
227
+ d: string;
228
+ c: string;
229
+ }[];
230
+ groups: string[];
231
+ }) | (null);
232
+ };
233
+ export type ContinuityDueV2 = ({
234
+ kind: "choice";
235
+ prior: string;
236
+ alts: string[];
237
+ }) | ({
238
+ kind: "report" | "align";
239
+ prior: string;
240
+ });
241
+ export type LogHeadV2 = ({
242
+ genesis: string;
243
+ empty: true;
244
+ }) | ({
245
+ genesis: string;
246
+ entryId: string;
247
+ gen: number;
248
+ next: string;
249
+ commit: string;
250
+ });
251
+ /** one enactment's tuple of a relationship (Trust 6.4) */
252
+ export type TupleV2 = {
253
+ ownPairLabel: string;
254
+ counterpartAnchor: string;
255
+ counterpartKeyAgreement: string;
256
+ rkid: string;
257
+ entryId: string;
258
+ priorCandidates: {
259
+ ownPairLabel: string;
260
+ counterpartAnchor: string;
261
+ replaces?: string[];
262
+ }[];
263
+ starOut: StarOutV2;
264
+ starIn: StarInV2;
265
+ groupStarOut: GroupStarOutV2;
266
+ groupStarIn: GroupStarInV2;
267
+ probeOut: {
268
+ seq: DecV2;
269
+ inflight: Record<string, {
270
+ digests: string[];
271
+ acked: string[];
272
+ }>;
273
+ done: boolean;
274
+ };
275
+ probeIn: {
276
+ hwm: DecV2;
277
+ lowerBound: DecV2;
278
+ assembly: (AssemblyV2) | (null);
279
+ };
280
+ continuityOut: {
281
+ rev: DecV2;
282
+ body: Json;
283
+ proof: Json;
284
+ sent: string[];
285
+ align: boolean;
286
+ chosen: (string) | (null);
287
+ reported: (string) | (null);
288
+ aligned: boolean;
289
+ due: (ContinuityDueV2) | (null);
290
+ };
291
+ continuityIn: {
292
+ rev: DecV2;
293
+ body: Json;
294
+ recordPrior: (string) | (null);
295
+ };
296
+ mappingOut: {
297
+ rev: DecV2;
298
+ body: Json;
299
+ underAnchor: (string) | (null);
300
+ };
301
+ mappingIn: {
302
+ rev: DecV2;
303
+ body: Json;
304
+ self: (string) | (null);
305
+ card: Json;
306
+ };
307
+ profileOut: {
308
+ rev: DecV2;
309
+ };
310
+ profileIn: {
311
+ rev: DecV2;
312
+ body: Json;
313
+ verifiedSeq: DecV2;
314
+ };
315
+ deactivated: boolean;
316
+ };
317
+ export type RelationshipV2 = {
318
+ id: string;
319
+ contactId: string;
320
+ tuples: TupleV2[];
321
+ activeHead: string;
322
+ earliestAnchor: (string) | (null);
323
+ links: {
324
+ prev: string;
325
+ next: string;
326
+ }[];
327
+ bindings: Record<string, string[]>;
328
+ heldCounterpartHead: (string) | (null);
329
+ memory: {
330
+ [k: string]: Json;
331
+ };
332
+ provenance: {
333
+ kind: "ceremony" | "introduced";
334
+ at: MillisV2;
335
+ via?: string;
336
+ viaPin?: string;
337
+ };
338
+ chainedInto: (string) | (null);
339
+ firstVerified: (DecV2) | (null);
340
+ };
341
+ /** one entry of the deliverable set (Trust 2120, 2140); its id equals its key */
342
+ export type ContactV2 = {
343
+ id: string;
344
+ pos: (DecV2) | (null);
345
+ status: "none" | "admitted" | "pending";
346
+ aliases: string[];
347
+ relIds: string[];
348
+ anchorHead: (string) | (null);
349
+ settings: {
350
+ star: SettingV2;
351
+ groupStar: SettingV2;
352
+ anchorMapping: SettingV2;
353
+ sealedGroupStar: SettingV2;
354
+ profile: SettingV2;
355
+ };
356
+ groupSettings: Record<string, SettingV2>;
357
+ };
358
+ export type OutboxStepV2 = ({
359
+ status: "submitted";
360
+ at: MillisV2;
361
+ attempt: number;
362
+ }) | ({
363
+ status: "awaiting-transport";
364
+ at: MillisV2;
365
+ reason: "offline" | "transport-unreachable" | "carrier-refused-retriable";
366
+ }) | ({
367
+ status: "accepted";
368
+ at: MillisV2;
369
+ }) | ({
370
+ status: "delivered";
371
+ at: MillisV2;
372
+ late: boolean;
373
+ }) | ({
374
+ status: "failed";
375
+ at: MillisV2;
376
+ reason: "unroutable" | "oversize" | "expired-by-adapter-policy" | "task-expired";
377
+ }) | ({
378
+ status: "failed";
379
+ at: MillisV2;
380
+ reason: "rejected-by-receiver";
381
+ code: "malformedRequest" | "unsupportedType" | "proofRequired" | "proofInvalid" | "wrongRecipient" | "identityMismatch";
382
+ });
383
+ /** an issued document; its envelope's rkid equals recipient.keyAgreement (not expressible here, checked by the codec) */
384
+ export type OutboxItemV2 = {
385
+ type: string;
386
+ threadId: string;
387
+ recipient: RecipientV2;
388
+ envelope: EnvelopeV2;
389
+ attempt: number;
390
+ history: OutboxStepV2[];
391
+ nextAttemptAt?: MillisV2;
392
+ /** the sender lifetime its type declares (Delivery RLTP-DEL-7020) */
393
+ expiresAt?: MillisV2;
394
+ };
395
+ export type StoredAckV2 = {
396
+ digest: string;
397
+ envelope: EnvelopeV2;
398
+ threadId: string;
399
+ recipient: RecipientV2;
400
+ at: MillisV2;
401
+ attempt: number;
402
+ sent: boolean;
403
+ nextAttemptAt?: MillisV2;
404
+ sentBy?: "report" | "horizon";
405
+ };
406
+ export type ReissueMappingDutyV2 = {
407
+ kind: "reissue-mapping";
408
+ v: 1;
409
+ id: string;
410
+ contactId: string;
411
+ relId: string;
412
+ awaitHead: (string) | (null);
413
+ dueAt?: MillisV2;
414
+ };
415
+ export type ClassOnDutyV2 = {
416
+ kind: "class-on";
417
+ v: 1;
418
+ id: string;
419
+ contactId: string;
420
+ relId: string;
421
+ cls: TrustClassV2;
422
+ dueAt?: MillisV2;
423
+ };
424
+ export type ProfileDutyV2 = {
425
+ kind: "profile";
426
+ v: 1;
427
+ id: string;
428
+ contactId: string;
429
+ relId: string;
430
+ rev: DecV2;
431
+ dueAt?: MillisV2;
432
+ };
433
+ export type ContinuityDutyV2 = {
434
+ kind: "continuity";
435
+ v: 1;
436
+ id: string;
437
+ relId: string;
438
+ tuple: string;
439
+ step: "probe" | "mapping";
440
+ dueAt?: MillisV2;
441
+ attempt?: number;
442
+ lastAt?: MillisV2;
443
+ };
444
+ export type MergeDutyV2 = {
445
+ kind: "merge";
446
+ v: 1;
447
+ id: string;
448
+ entryIds: string[];
449
+ relId: string;
450
+ witness: {
451
+ heads: Record<string, string>;
452
+ superseded: Record<string, string[]>;
453
+ };
454
+ dueAt?: MillisV2;
455
+ };
456
+ export type RotationDutyV2 = {
457
+ kind: "rotation";
458
+ v: 1;
459
+ id: string;
460
+ rotationId: string;
461
+ dueAt?: MillisV2;
462
+ attempt?: number;
463
+ lastAt?: MillisV2;
464
+ };
465
+ export type IntroAckDutyV2 = {
466
+ kind: "intro-ack";
467
+ v: 1;
468
+ id: string;
469
+ act: string;
470
+ dueAt?: MillisV2;
471
+ };
472
+ /** a duty of a kind or version this library does not handle: kept as it is */
473
+ export type UnknownDutyV2 = {
474
+ kind: string;
475
+ v: number;
476
+ id: string;
477
+ [k: string]: Json;
478
+ };
479
+ export type DutyV2 = (ReissueMappingDutyV2) | (ClassOnDutyV2) | (ProfileDutyV2) | (ContinuityDutyV2) | (MergeDutyV2) | (RotationDutyV2) | (IntroAckDutyV2) | (UnknownDutyV2);
480
+ /** a journaled event (events.ts) */
481
+ export type EventV2 = ({
482
+ type: "contact.added";
483
+ eventId: string;
484
+ commitSeq: DecV2;
485
+ contactId: string;
486
+ actId?: string;
487
+ }) | ({
488
+ type: "contact.verified";
489
+ eventId: string;
490
+ commitSeq: DecV2;
491
+ contactId: string;
492
+ relationshipId: string;
493
+ actId?: string;
494
+ }) | ({
495
+ type: "contact.chained";
496
+ eventId: string;
497
+ commitSeq: DecV2;
498
+ contactId: string;
499
+ from: string;
500
+ into: string;
501
+ actId?: string;
502
+ }) | ({
503
+ type: "contact.merged";
504
+ eventId: string;
505
+ commitSeq: DecV2;
506
+ contactId: string;
507
+ merged: string[];
508
+ actId?: string;
509
+ }) | ({
510
+ type: "contact.split";
511
+ eventId: string;
512
+ commitSeq: DecV2;
513
+ contactId: string;
514
+ leaver: string;
515
+ relationshipId: string;
516
+ actId?: string;
517
+ }) | ({
518
+ type: "contact.departed";
519
+ eventId: string;
520
+ commitSeq: DecV2;
521
+ contactId: string;
522
+ relationshipIds: string[];
523
+ removed: boolean;
524
+ actId?: string;
525
+ }) | ({
526
+ type: "trust.given";
527
+ eventId: string;
528
+ commitSeq: DecV2;
529
+ contactId: string;
530
+ actId?: string;
531
+ }) | ({
532
+ type: "trust.received";
533
+ eventId: string;
534
+ commitSeq: DecV2;
535
+ contactId: string;
536
+ actId?: string;
537
+ }) | ({
538
+ type: "trust.paused";
539
+ eventId: string;
540
+ commitSeq: DecV2;
541
+ contactId: string;
542
+ paused: boolean;
543
+ actId?: string;
544
+ }) | ({
545
+ type: "group.joined";
546
+ eventId: string;
547
+ commitSeq: DecV2;
548
+ groupId: string;
549
+ actId?: string;
550
+ }) | ({
551
+ type: "prompt.opened";
552
+ eventId: string;
553
+ commitSeq: DecV2;
554
+ promptId: string;
555
+ kind: "encounter-confirm" | "group-invite" | "introduction";
556
+ actId?: string;
557
+ }) | ({
558
+ type: "prompt.decided";
559
+ eventId: string;
560
+ commitSeq: DecV2;
561
+ promptId: string;
562
+ kind: "encounter-confirm" | "group-invite" | "introduction";
563
+ choice: "accept" | "decline";
564
+ actId?: string;
565
+ }) | ({
566
+ type: "delivery.status";
567
+ eventId: string;
568
+ commitSeq: DecV2;
569
+ digest: string;
570
+ threadId: string;
571
+ status: "submitted" | "accepted" | "delivered" | "failed";
572
+ actId?: string;
573
+ late?: boolean;
574
+ }) | ({
575
+ type: "profile.updated";
576
+ eventId: string;
577
+ commitSeq: DecV2;
578
+ contactId: (string) | (null);
579
+ actId?: string;
580
+ }) | ({
581
+ type: "anchor.rotated";
582
+ eventId: string;
583
+ commitSeq: DecV2;
584
+ generation: DecV2;
585
+ actId?: string;
586
+ }) | ({
587
+ type: "device.added";
588
+ eventId: string;
589
+ commitSeq: DecV2;
590
+ name: string;
591
+ actId?: string;
592
+ }) | ({
593
+ type: "device.revoked";
594
+ eventId: string;
595
+ commitSeq: DecV2;
596
+ name: string;
597
+ actId?: string;
598
+ }) | ({
599
+ type: "duty.unsupported";
600
+ eventId: string;
601
+ commitSeq: DecV2;
602
+ dutyId: string;
603
+ kind: string;
604
+ v: number;
605
+ actId?: string;
606
+ }) | ({
607
+ type: "star.accepted";
608
+ eventId: string;
609
+ commitSeq: DecV2;
610
+ contactId: string;
611
+ relationshipId: string;
612
+ salt: DecV2;
613
+ actId?: string;
614
+ }) | ({
615
+ type: "groupStar.accepted";
616
+ eventId: string;
617
+ commitSeq: DecV2;
618
+ contactId: string;
619
+ relationshipId: string;
620
+ salt: DecV2;
621
+ actId?: string;
622
+ }) | ({
623
+ type: "encounter.shown";
624
+ eventId: string;
625
+ commitSeq: DecV2;
626
+ challenge: string;
627
+ card: {
628
+ [k: string]: Json;
629
+ };
630
+ actId?: string;
631
+ }) | ({
632
+ type: "encounter.scanned";
633
+ eventId: string;
634
+ commitSeq: DecV2;
635
+ contactId: string;
636
+ card: {
637
+ [k: string]: Json;
638
+ };
639
+ actId?: string;
640
+ }) | ({
641
+ type: "encounter.recorded";
642
+ eventId: string;
643
+ commitSeq: DecV2;
644
+ contactId: string;
645
+ relationshipId: string;
646
+ role: "scanner" | "displayer";
647
+ actId?: string;
648
+ }) | ({
649
+ type: "encounter.accepted";
650
+ eventId: string;
651
+ commitSeq: DecV2;
652
+ contactId: string;
653
+ relationshipId: string;
654
+ mutual: boolean;
655
+ actId?: string;
656
+ }) | ({
657
+ type: "group.founded";
658
+ eventId: string;
659
+ commitSeq: DecV2;
660
+ groupId: string;
661
+ actId?: string;
662
+ }) | ({
663
+ type: "group.admitted";
664
+ eventId: string;
665
+ commitSeq: DecV2;
666
+ groupId: string;
667
+ member: string;
668
+ actId?: string;
669
+ }) | ({
670
+ type: "group.vouched";
671
+ eventId: string;
672
+ commitSeq: DecV2;
673
+ groupId: string;
674
+ member: string;
675
+ actId?: string;
676
+ }) | ({
677
+ type: "contact.blocked";
678
+ eventId: string;
679
+ commitSeq: DecV2;
680
+ contactId: string;
681
+ blocked: boolean;
682
+ actId?: string;
683
+ }) | ({
684
+ type: "message.sent";
685
+ eventId: string;
686
+ commitSeq: DecV2;
687
+ contactId: string;
688
+ mid: string;
689
+ digest: string;
690
+ actId?: string;
691
+ }) | ({
692
+ type: "message.received";
693
+ eventId: string;
694
+ commitSeq: DecV2;
695
+ contactId: string;
696
+ inboxId: string;
697
+ actId?: string;
698
+ });
699
+ export type RosterEntryV2 = {
700
+ anchor: string;
701
+ op: string;
702
+ keyAgreement: string;
703
+ addedAt: MillisV2;
704
+ name?: string;
705
+ contactId?: string;
706
+ rkid?: string;
707
+ };
708
+ export type OpenInvitationV2 = {
709
+ invitee: string;
710
+ keyAgreement: string;
711
+ contactId: string;
712
+ rkid: string;
713
+ threadId: string;
714
+ credDigest: string;
715
+ invite: {
716
+ [k: string]: Json;
717
+ };
718
+ validUntil: MillisV2;
719
+ };
720
+ export type EvidenceV2 = {
721
+ invite: {
722
+ [k: string]: Json;
723
+ };
724
+ accept: {
725
+ [k: string]: Json;
726
+ };
727
+ vouches: {
728
+ [k: string]: Json;
729
+ }[];
730
+ at: MillisV2;
731
+ };
732
+ /** a group the holder is in; a listed group carries memberAnchor and memberOp (Trust 5400) */
733
+ export type GroupV2 = {
734
+ id: string;
735
+ name: string;
736
+ memberLabel: string;
737
+ rules: {
738
+ vouchThreshold: DecV2;
739
+ };
740
+ listed: boolean;
741
+ roster: Record<string, RosterEntryV2>;
742
+ invitations: Record<string, OpenInvitationV2>;
743
+ evidence: Record<string, EvidenceV2>;
744
+ preludes: Record<string, {
745
+ contactId: string;
746
+ rkid: string;
747
+ at: MillisV2;
748
+ }>;
749
+ did?: string;
750
+ genesis?: {
751
+ [k: string]: Json;
752
+ };
753
+ memberAnchor?: string;
754
+ memberOp?: string;
755
+ acceptDigest?: string;
756
+ };
757
+ export type HeldCredentialV2 = {
758
+ digest: string;
759
+ credential: {
760
+ [k: string]: Json;
761
+ };
762
+ };
763
+ export type EnactmentRecordV2 = {
764
+ ceremony: string;
765
+ own: string;
766
+ tCh: MillisV2;
767
+ peer: string;
768
+ counterpart: string;
769
+ card: {
770
+ [k: string]: Json;
771
+ };
772
+ bind: string;
773
+ at: MillisV2;
774
+ label: string;
775
+ relId: string;
776
+ role: "scanner" | "displayer";
777
+ out: (HeldCredentialV2) | (null);
778
+ in: (HeldCredentialV2) | (null);
779
+ thread: (string) | (null);
780
+ bundleDigest: (string) | (null);
781
+ threads: Record<string, string>;
782
+ sentCard: ({
783
+ [k: string]: Json;
784
+ }) | (null);
785
+ counterPending: boolean;
786
+ };
787
+ export type IntroActV2 = {
788
+ key: string;
789
+ act: string;
790
+ role: "requester" | "mediator" | "target";
791
+ status: "sent" | "acked" | "completed" | "failed" | "received" | "forwarded" | "consented" | "refused";
792
+ issuedAt: MillisV2;
793
+ request: {
794
+ [k: string]: Json;
795
+ };
796
+ requestCard: {
797
+ [k: string]: Json;
798
+ };
799
+ reply: ({
800
+ [k: string]: Json;
801
+ }) | (null);
802
+ replyCard: ({
803
+ [k: string]: Json;
804
+ }) | (null);
805
+ pins: {
806
+ requester?: string;
807
+ target?: string;
808
+ mediator?: string;
809
+ };
810
+ threads: {
811
+ request: string;
812
+ forward?: string;
813
+ };
814
+ at: MillisV2;
815
+ ackDelayMs: number;
816
+ ownLabel: (string) | (null);
817
+ ack: ({
818
+ [k: string]: Json;
819
+ }) | (null);
820
+ replyForwarded: boolean;
821
+ vouchersSent: boolean;
822
+ pendingVoucher: ({
823
+ [k: string]: Json;
824
+ }) | (null);
825
+ voucher: ({
826
+ [k: string]: Json;
827
+ }) | (null);
828
+ vouched: boolean;
829
+ promptId: (string) | (null);
830
+ peerName?: string;
831
+ };
832
+ export type RotationV2 = {
833
+ id: string;
834
+ from: DecV2;
835
+ to: DecV2;
836
+ step: "register" | "log" | "duties";
837
+ startedAt: MillisV2;
838
+ entry: Json;
839
+ overHead: LogHeadV2;
840
+ awaitHead: Record<string, (string) | (null)>;
841
+ };
842
+ export type PromptV2 = {
843
+ id: string;
844
+ kind: "encounter-confirm" | "group-invite" | "introduction";
845
+ openedAt: MillisV2;
846
+ contactId?: string;
847
+ groupId?: string;
848
+ expiresAt?: MillisV2;
849
+ };
850
+ export type ActRecordV2 = {
851
+ actId: string;
852
+ inputHash: string;
853
+ commitSeq: DecV2;
854
+ outboundDigests: string[];
855
+ events: EventV2[];
856
+ at: MillisV2;
857
+ };
858
+ //# sourceMappingURL=holder-state-v2.d.ts.map