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