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