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