@real-life/trust-protocol 0.3.2 → 0.5.0

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