@serfab/cadre-core 1.16.0 → 1.18.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.
- package/README.md +4 -3
- package/dist/bootstrap-peer-store-file.js +1 -1
- package/dist/bootstrap-peer-store.d.ts +1 -1
- package/dist/bootstrap-peer-store.js +4 -4
- package/dist/cadre-invite-protocol.d.ts +81 -142
- package/dist/cadre-invite-protocol.js +168 -458
- package/dist/cadre-invite-protocol.js.map +1 -1
- package/dist/cadre-join-request.d.ts +15 -2
- package/dist/cadre-join-request.js +22 -3
- package/dist/cadre-join-request.js.map +1 -1
- package/dist/cadre-node.d.ts +1089 -475
- package/dist/cadre-node.js +2170 -1037
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-authorization.d.ts +36 -14
- package/dist/control-authorization.js +20 -3
- package/dist/control-authorization.js.map +1 -1
- package/dist/control-cohort.d.ts +88 -32
- package/dist/control-cohort.js +91 -33
- package/dist/control-cohort.js.map +1 -1
- package/dist/control-database.d.ts +856 -318
- package/dist/control-database.js +1422 -701
- package/dist/control-database.js.map +1 -1
- package/dist/control-formation-recorder.d.ts +46 -43
- package/dist/control-formation-recorder.js +77 -78
- package/dist/control-formation-recorder.js.map +1 -1
- package/dist/control-protocol-guard.d.ts +11 -4
- package/dist/control-protocol-guard.js +20 -5
- package/dist/control-protocol-guard.js.map +1 -1
- package/dist/control-schema-version.d.ts +97 -0
- package/dist/control-schema-version.js +225 -0
- package/dist/control-schema-version.js.map +1 -0
- package/dist/control-schema.d.ts +45 -5
- package/dist/control-schema.js +262 -78
- package/dist/control-schema.js.map +1 -1
- package/dist/control-write-retry.d.ts +45 -10
- package/dist/control-write-retry.js +92 -22
- package/dist/control-write-retry.js.map +1 -1
- package/dist/delegate-admission.d.ts +13 -0
- package/dist/delegate-admission.js +27 -0
- package/dist/delegate-admission.js.map +1 -1
- package/dist/ed25519-key.d.ts +10 -7
- package/dist/ed25519-key.js +23 -20
- package/dist/ed25519-key.js.map +1 -1
- package/dist/edge-node/config.d.ts +122 -0
- package/dist/edge-node/config.js +199 -0
- package/dist/edge-node/config.js.map +1 -0
- package/dist/edge-node/dissolve.d.ts +95 -0
- package/dist/edge-node/dissolve.js +184 -0
- package/dist/edge-node/dissolve.js.map +1 -0
- package/dist/edge-node/edge-join.d.ts +44 -0
- package/dist/edge-node/edge-join.js +227 -0
- package/dist/edge-node/edge-join.js.map +1 -0
- package/dist/edge-node/edge-node.d.ts +295 -0
- package/dist/edge-node/edge-node.js +704 -0
- package/dist/edge-node/edge-node.js.map +1 -0
- package/dist/edge-node/index.d.ts +18 -0
- package/dist/edge-node/index.js +18 -0
- package/dist/edge-node/index.js.map +1 -0
- package/dist/edge-node/join-credential.d.ts +11 -0
- package/dist/edge-node/join-credential.js +11 -0
- package/dist/edge-node/join-credential.js.map +1 -0
- package/dist/edge-node/lazy-raw-storage.d.ts +40 -0
- package/dist/edge-node/lazy-raw-storage.js +134 -0
- package/dist/edge-node/lazy-raw-storage.js.map +1 -0
- package/dist/edge-node/node-local.d.ts +60 -0
- package/dist/edge-node/node-local.js +58 -0
- package/dist/edge-node/node-local.js.map +1 -0
- package/dist/edge-node/options.d.ts +83 -0
- package/dist/edge-node/options.js +110 -0
- package/dist/edge-node/options.js.map +1 -0
- package/dist/edge-node/owner-grant.d.ts +41 -0
- package/dist/edge-node/owner-grant.js +38 -0
- package/dist/edge-node/owner-grant.js.map +1 -0
- package/dist/edge-node/platform.d.ts +140 -0
- package/dist/edge-node/platform.js +12 -0
- package/dist/edge-node/platform.js.map +1 -0
- package/dist/edge-node/strand-move.d.ts +115 -0
- package/dist/edge-node/strand-move.js +223 -0
- package/dist/edge-node/strand-move.js.map +1 -0
- package/dist/edge-node/strands.d.ts +28 -0
- package/dist/edge-node/strands.js +60 -0
- package/dist/edge-node/strands.js.map +1 -0
- package/dist/enrolled-machine-store.d.ts +3 -3
- package/dist/enrolled-machine-store.js +3 -3
- package/dist/formation-token.d.ts +48 -0
- package/dist/formation-token.js +26 -0
- package/dist/formation-token.js.map +1 -0
- package/dist/index.d.ts +27 -17
- package/dist/index.js +39 -17
- package/dist/index.js.map +1 -1
- package/dist/joined-strand-store.d.ts +29 -12
- package/dist/joined-strand-store.js +66 -27
- package/dist/joined-strand-store.js.map +1 -1
- package/dist/key-store.d.ts +9 -4
- package/dist/key-store.js +9 -4
- package/dist/key-store.js.map +1 -1
- package/dist/link-budget.d.ts +9 -7
- package/dist/link-budget.js +9 -7
- package/dist/link-budget.js.map +1 -1
- package/dist/machine-removal.d.ts +19 -39
- package/dist/machine-removal.js +24 -98
- package/dist/machine-removal.js.map +1 -1
- package/dist/member-redemption.d.ts +256 -0
- package/dist/member-redemption.js +490 -0
- package/dist/member-redemption.js.map +1 -0
- package/dist/membership-view.d.ts +91 -0
- package/dist/membership-view.js +110 -0
- package/dist/membership-view.js.map +1 -0
- package/dist/owner-anchor-sync.d.ts +4 -4
- package/dist/owner-anchor-sync.js +16 -15
- package/dist/owner-anchor-sync.js.map +1 -1
- package/dist/owner-grant-protocol.d.ts +251 -0
- package/dist/owner-grant-protocol.js +344 -0
- package/dist/owner-grant-protocol.js.map +1 -0
- package/dist/owner-key-export.d.ts +70 -0
- package/dist/owner-key-export.js +279 -0
- package/dist/owner-key-export.js.map +1 -0
- package/dist/owner-key-flows.d.ts +55 -0
- package/dist/owner-key-flows.js +60 -0
- package/dist/owner-key-flows.js.map +1 -0
- package/dist/owner-key-store.d.ts +31 -0
- package/dist/owner-key-store.js +81 -0
- package/dist/owner-key-store.js.map +1 -0
- package/dist/owner-keys.d.ts +78 -0
- package/dist/owner-keys.js +133 -0
- package/dist/owner-keys.js.map +1 -0
- package/dist/owner-signer.d.ts +54 -0
- package/dist/owner-signer.js +51 -0
- package/dist/owner-signer.js.map +1 -0
- package/dist/peer-addr-book.d.ts +10 -1
- package/dist/peer-addr-book.js +4 -3
- package/dist/peer-addr-book.js.map +1 -1
- package/dist/peer-authorization.d.ts +83 -18
- package/dist/peer-authorization.js +123 -53
- package/dist/peer-authorization.js.map +1 -1
- package/dist/peer-join-backfill.d.ts +89 -20
- package/dist/peer-join-backfill.js +265 -108
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/pending-join-runner.d.ts +48 -18
- package/dist/pending-join-runner.js +74 -56
- package/dist/pending-join-runner.js.map +1 -1
- package/dist/provider/rent-node.js +1 -1
- package/dist/provider/rent-node.js.map +1 -1
- package/dist/seed-bootstrap.d.ts +162 -133
- package/dist/seed-bootstrap.js +300 -283
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/seed-trust-policy.js +4 -4
- package/dist/strand-addr-protocol.d.ts +4 -1
- package/dist/strand-addr-protocol.js +8 -2
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-cohort.d.ts +3 -0
- package/dist/strand-cohort.js.map +1 -1
- package/dist/strand-database.d.ts +24 -2
- package/dist/strand-database.js +29 -6
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-first-sync-gate.d.ts +176 -88
- package/dist/strand-first-sync-gate.js +288 -121
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-formation-deadlines.d.ts +9 -9
- package/dist/strand-formation-deadlines.js +9 -9
- package/dist/strand-formation-manager.d.ts +23 -17
- package/dist/strand-formation-manager.js +46 -44
- package/dist/strand-formation-manager.js.map +1 -1
- package/dist/strand-formation-protocol.d.ts +5 -8
- package/dist/strand-formation-protocol.js +101 -16
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +27 -18
- package/dist/strand-instance-manager.js +119 -50
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-reconciler.d.ts +16 -13
- package/dist/strand-membership-reconciler.js +30 -22
- package/dist/strand-membership-reconciler.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +45 -22
- package/dist/strand-membership-writer.js +226 -131
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/strand-move.d.ts +6 -5
- package/dist/strand-move.js +36 -32
- package/dist/strand-move.js.map +1 -1
- package/dist/strand-peer-redial.js +2 -3
- package/dist/strand-peer-redial.js.map +1 -1
- package/dist/strand-revocation-enforcer.d.ts +134 -60
- package/dist/strand-revocation-enforcer.js +144 -71
- package/dist/strand-revocation-enforcer.js.map +1 -1
- package/dist/strand-solicitation.d.ts +50 -39
- package/dist/strand-solicitation.js +10 -3
- package/dist/strand-solicitation.js.map +1 -1
- package/dist/strand-watcher.d.ts +80 -13
- package/dist/strand-watcher.js +152 -48
- package/dist/strand-watcher.js.map +1 -1
- package/dist/table-change-watch.d.ts +63 -0
- package/dist/table-change-watch.js +209 -0
- package/dist/table-change-watch.js.map +1 -0
- package/dist/timeout-scheduler.d.ts +4 -3
- package/dist/timeout-scheduler.js +4 -3
- package/dist/timeout-scheduler.js.map +1 -1
- package/dist/types.d.ts +374 -150
- package/dist/types.js +4 -4
- package/dist/types.js.map +1 -1
- package/package.json +17 -8
- package/src/bootstrap-peer-store-file.ts +44 -44
- package/src/bootstrap-peer-store.ts +214 -214
- package/src/cadre-invite-protocol.ts +740 -1052
- package/src/cadre-join-request.ts +24 -3
- package/src/cadre-node.ts +2402 -1079
- package/src/control-authorization.ts +47 -14
- package/src/control-cohort.ts +204 -128
- package/src/control-database.ts +1749 -820
- package/src/control-formation-recorder.ts +359 -353
- package/src/control-protocol-guard.ts +23 -6
- package/src/control-schema-version.ts +301 -0
- package/src/control-schema.ts +273 -78
- package/src/control-write-retry.ts +641 -567
- package/src/delegate-admission.ts +351 -314
- package/src/ed25519-key.ts +174 -171
- package/src/edge-node/config.ts +277 -0
- package/src/edge-node/dissolve.ts +251 -0
- package/src/edge-node/edge-join.ts +319 -0
- package/src/edge-node/edge-node.ts +1045 -0
- package/src/edge-node/index.ts +59 -0
- package/src/edge-node/join-credential.ts +16 -0
- package/src/edge-node/lazy-raw-storage.ts +178 -0
- package/src/edge-node/node-local.ts +84 -0
- package/src/edge-node/options.ts +179 -0
- package/src/edge-node/owner-grant.ts +63 -0
- package/src/edge-node/platform.ts +151 -0
- package/src/edge-node/strand-move.ts +270 -0
- package/src/edge-node/strands.ts +72 -0
- package/src/enrolled-machine-store.ts +3 -3
- package/src/formation-token.ts +63 -0
- package/src/index.ts +899 -789
- package/src/joined-strand-store.ts +73 -28
- package/src/key-store.ts +10 -4
- package/src/link-budget.ts +9 -7
- package/src/machine-removal.ts +26 -111
- package/src/member-redemption.ts +649 -0
- package/src/membership-view.ts +144 -0
- package/src/owner-anchor-sync.ts +19 -18
- package/src/owner-grant-protocol.ts +547 -0
- package/src/owner-key-export.ts +348 -0
- package/src/owner-key-flows.ts +109 -0
- package/src/owner-key-store.ts +85 -0
- package/src/owner-keys.ts +178 -0
- package/src/owner-signer.ts +94 -0
- package/src/peer-addr-book.ts +4 -3
- package/src/peer-authorization.ts +558 -488
- package/src/peer-join-backfill.ts +971 -761
- package/src/pending-join-runner.ts +76 -53
- package/src/provider/rent-node.ts +1 -1
- package/src/seed-bootstrap.ts +343 -349
- package/src/seed-trust-policy.ts +4 -4
- package/src/strand-addr-protocol.ts +547 -538
- package/src/strand-cohort.ts +4 -0
- package/src/strand-database.ts +352 -319
- package/src/strand-first-sync-gate.ts +334 -133
- package/src/strand-formation-deadlines.ts +227 -227
- package/src/strand-formation-manager.ts +731 -725
- package/src/strand-formation-protocol.ts +122 -24
- package/src/strand-instance-manager.ts +2092 -2026
- package/src/strand-membership-reconciler.ts +33 -25
- package/src/strand-membership-writer.ts +2093 -1974
- package/src/strand-move.ts +50 -38
- package/src/strand-peer-redial.ts +2 -3
- package/src/strand-revocation-enforcer.ts +740 -654
- package/src/strand-solicitation.ts +61 -34
- package/src/strand-watcher.ts +175 -56
- package/src/table-change-watch.ts +285 -0
- package/src/timeout-scheduler.ts +29 -28
- package/src/types.ts +391 -152
package/src/index.ts
CHANGED
|
@@ -1,789 +1,899 @@
|
|
|
1
|
-
// Core types
|
|
2
|
-
export * from './types.js';
|
|
3
|
-
|
|
4
|
-
// Canonical JSON serialization (shared signing payload format)
|
|
5
|
-
export { canonicalJson } from './canonical-json.js';
|
|
6
|
-
|
|
7
|
-
// Main CadreNode class
|
|
8
|
-
export { CadreNode,
|
|
9
|
-
|
|
10
|
-
// Removing a machine from a cadre: the by-name refusal `CadreNode.removeMachine` throws
|
|
11
|
-
// (the listing, plan and result types are in types.ts)
|
|
12
|
-
export { MachineRemovalRefusedError } from './machine-removal.js';
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} from './
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
} from './
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
type
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
} from './strand-
|
|
184
|
-
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
//
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
//
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
//
|
|
220
|
-
export {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
type
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
type
|
|
230
|
-
type
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
//
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
type
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
export {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
type
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
} from './
|
|
263
|
-
|
|
264
|
-
//
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
type
|
|
276
|
-
type
|
|
277
|
-
type
|
|
278
|
-
type
|
|
279
|
-
type
|
|
280
|
-
type
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
//
|
|
286
|
-
//
|
|
287
|
-
export {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
type
|
|
293
|
-
type
|
|
294
|
-
type
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
//
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
type
|
|
344
|
-
type
|
|
345
|
-
type
|
|
346
|
-
type
|
|
347
|
-
type
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
} from './strand-
|
|
356
|
-
|
|
357
|
-
//
|
|
358
|
-
//
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
type
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
//
|
|
410
|
-
export {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
type
|
|
429
|
-
type
|
|
430
|
-
} from './
|
|
431
|
-
|
|
432
|
-
// Peer
|
|
433
|
-
export {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
//
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
//
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
type
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
type
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
//
|
|
608
|
-
//
|
|
609
|
-
// `
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
export {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
type
|
|
772
|
-
type
|
|
773
|
-
type
|
|
774
|
-
type
|
|
775
|
-
type
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
type
|
|
789
|
-
|
|
1
|
+
// Core types
|
|
2
|
+
export * from './types.js';
|
|
3
|
+
|
|
4
|
+
// Canonical JSON serialization (shared signing payload format)
|
|
5
|
+
export { canonicalJson } from './canonical-json.js';
|
|
6
|
+
|
|
7
|
+
// Main CadreNode class
|
|
8
|
+
export { CadreNode, CADRE_INVITATION_DEFAULT_TTL_MS, OWNER_GRANT_DEFAULT_TTL_MS } from './cadre-node.js';
|
|
9
|
+
|
|
10
|
+
// Removing a machine from a cadre: the by-name refusal `CadreNode.removeMachine` throws
|
|
11
|
+
// (the listing, plan and result types are in types.ts)
|
|
12
|
+
export { MachineRemovalRefusedError } from './machine-removal.js';
|
|
13
|
+
|
|
14
|
+
// Adding and removing an owner key: the by-name refusals `CadreNode.addOwner` and
|
|
15
|
+
// `CadreNode.removeOwner` throw (the listing, plan and result types are in types.ts)
|
|
16
|
+
export { OwnerKeyAddRefusedError, OwnerKeyRemovalRefusedError } from './owner-keys.js';
|
|
17
|
+
|
|
18
|
+
// Control database
|
|
19
|
+
export { ControlDatabase, parseNullableStoredDatetimeMs, MissingHostStrandError, InvitationExhaustedError, CadreInviteIssuerUnknownError, OwnerGrantIssuerUnknownError, IssuedRowNotHereYetError, buildAuthorizationMessage, registerPartyIdFunction, formationVouchMessage, formationConsentMessage, cadreInviteAddMessage, cadreInviteRedeemMessage, cadreInviteConsentMessage, ownerGrantAddMessage, ownerGrantRedeemMessage, ownerGrantConsentMessage, projectSeedPeers, REAPABLE_TABLES, type ReapableTable, type ControlDatabaseConfig, type ControlTable, type RevocableTable, type FormationUsageResult, type FormationInviteRow, type FoundingRows, type FoundingInvite, type MembershipChangeListener, type GuardedDeleteListener, type ControlWriteAbandonedListener, type RevokedRowRef, type ControlSign, type SelfRecordSigner, type CadrePeerRetouchMode, type CadrePeerRetouchOutcome, type OwnerGrantRedemptionFields } from './control-database.js';
|
|
20
|
+
|
|
21
|
+
// The control schema version a store is migrated to on start, and what `start()` throws, with a
|
|
22
|
+
// reason, when the store must not be migrated (docs/architecture.md → "Control schema versions and
|
|
23
|
+
// migrations")
|
|
24
|
+
export { CONTROL_SCHEMA_VERSION, CONTROL_SCHEMA_BASELINE_VERSION, CONTROL_SCHEMA_VERSION_TAG } from './control-schema.js';
|
|
25
|
+
export { ControlStoreIncompatibleError, type ControlStoreIncompatibility } from './control-schema-version.js';
|
|
26
|
+
|
|
27
|
+
// Bounded retry for transient control-write failures (classifier + loop behind
|
|
28
|
+
// ControlDatabase.lockedWithRetry; exported so the integration package can drive the
|
|
29
|
+
// classifier against real engine errors)
|
|
30
|
+
export {
|
|
31
|
+
CONTROL_WRITE_ATTEMPTS,
|
|
32
|
+
CONTROL_WRITE_RETRY_BUDGET_MS,
|
|
33
|
+
LOST_UPDATE_RETRY_POLICY,
|
|
34
|
+
SCHEMA_INIT_ATTEMPTS,
|
|
35
|
+
SCHEMA_INIT_RETRY_POLICY,
|
|
36
|
+
isRetriableControlWriteFailure,
|
|
37
|
+
isRetriableLostUpdateFailure,
|
|
38
|
+
isRetriableSchemaInitFailure,
|
|
39
|
+
retryControlWrite,
|
|
40
|
+
type ControlWriteRetryOptions
|
|
41
|
+
} from './control-write-retry.js';
|
|
42
|
+
|
|
43
|
+
// Bounded retry for transient control-read failures (classifier + policy behind
|
|
44
|
+
// ControlDatabase.readRows; the loop is shared with the write side via control-retry.ts)
|
|
45
|
+
export {
|
|
46
|
+
CONTROL_READ_ATTEMPTS,
|
|
47
|
+
CONTROL_READ_RETRY_DELAYS_MS,
|
|
48
|
+
CONTROL_READ_RETRY_BUDGET_MS,
|
|
49
|
+
isRetriableControlReadFailure,
|
|
50
|
+
retryControlRead,
|
|
51
|
+
type ControlReadRetryOptions
|
|
52
|
+
} from './control-read-retry.js';
|
|
53
|
+
|
|
54
|
+
// The bounded retry loop both control policies share. Only the abandonment record leaves
|
|
55
|
+
// this package: it is the payload of the `control:write-abandoned` node event, so an
|
|
56
|
+
// embedding app can type a handler for it.
|
|
57
|
+
export type {
|
|
58
|
+
ControlRetryAbandonment,
|
|
59
|
+
ControlRetryAbandonReason,
|
|
60
|
+
ControlRetryAbandonListener
|
|
61
|
+
} from './control-retry.js';
|
|
62
|
+
|
|
63
|
+
// Control-plane authorization field vector (the domain/action tagging every signer shares)
|
|
64
|
+
export { controlAuthorizationFields, unboundAuthorizationFields, cadreInviteRowFields, ownerGrantRowFields, type ControlDomain, type BoundControlDomain, type UnboundControlDomain, type ControlAction, type CadreInviteSignedFields, type OwnerGrantSignedFields } from './control-authorization.js';
|
|
65
|
+
|
|
66
|
+
// Ed25519 key bridge (libp2p Ed25519 -> base64url keypair)
|
|
67
|
+
export { ed25519KeyPairFromLibp2p, ed25519PublicKeyFromPrivate, ed25519PublicKeyB64FromPeerId, requireEd25519PublicKeyB64, requireEd25519PrivateKeyB64, type Ed25519KeyPair } from './ed25519-key.js';
|
|
68
|
+
|
|
69
|
+
// Pluggable key store (backend-agnostic identity/owner key material seam).
|
|
70
|
+
// Dependency-free: the interface, error, default slot id, and in-memory backend
|
|
71
|
+
// are safe in every (RN/browser/Node) entry graph. The Node FileKeyStore is a
|
|
72
|
+
// separate subpath module ('@serfab/cadre-core/key-store-file') so its node:fs
|
|
73
|
+
// import never lands here.
|
|
74
|
+
export {
|
|
75
|
+
InMemoryKeyStore,
|
|
76
|
+
KeyStoreAccessError,
|
|
77
|
+
DEFAULT_IDENTITY_KEY_ID,
|
|
78
|
+
DEFAULT_OWNER_KEY_ID,
|
|
79
|
+
type KeyStore,
|
|
80
|
+
type KeyId
|
|
81
|
+
} from './key-store.js';
|
|
82
|
+
|
|
83
|
+
// The filename-safe form of an id that every Node-only per-party file store names its file
|
|
84
|
+
// with (`<name>.<encoded party>.json`), for an embedder keeping its own file beside theirs.
|
|
85
|
+
export { encodeFileSafeComponent } from './file-safe-name.js';
|
|
86
|
+
|
|
87
|
+
// The KeyStore-backed identity rule, shared with embedding apps that need the
|
|
88
|
+
// node key BEFORE `CadreNode` exists.
|
|
89
|
+
export { loadOrCreateIdentityKey } from './identity-key.js';
|
|
90
|
+
|
|
91
|
+
// Owner keys (`docs/architecture.md` → Owner Keys): the one interface owner signatures go
|
|
92
|
+
// through, the key-store slot an owner key lives in apart from the identity slot, and the
|
|
93
|
+
// text form a key is exported and imported in. Cross-platform: pure JS crypto only.
|
|
94
|
+
export {
|
|
95
|
+
softwareOwnerSigner,
|
|
96
|
+
OwnerSigningDeclinedError,
|
|
97
|
+
type OwnerSigner,
|
|
98
|
+
type OwnerSign,
|
|
99
|
+
type OwnerSigningRequest
|
|
100
|
+
} from './owner-signer.js';
|
|
101
|
+
export {
|
|
102
|
+
createOwnerKey,
|
|
103
|
+
loadOwnerSigner,
|
|
104
|
+
importOwnerKey,
|
|
105
|
+
readOwnerPrivateKey,
|
|
106
|
+
OwnerKeySlotOccupiedError
|
|
107
|
+
} from './owner-key-store.js';
|
|
108
|
+
export {
|
|
109
|
+
encodeOwnerKeyExport,
|
|
110
|
+
decodeOwnerKeyExport,
|
|
111
|
+
unlockOwnerKeyExport,
|
|
112
|
+
OwnerKeyExportError,
|
|
113
|
+
OWNER_KEY_EXPORT_PREFIX,
|
|
114
|
+
LOCKED_OWNER_KEY_EXPORT_PREFIX,
|
|
115
|
+
OWNER_KEY_MAX_LABEL,
|
|
116
|
+
type OwnerKeyExportErrorCode,
|
|
117
|
+
type OwnerKeyExportContents,
|
|
118
|
+
type OwnerKeyExportInput,
|
|
119
|
+
type DecodedOwnerKeyExport
|
|
120
|
+
} from './owner-key-export.js';
|
|
121
|
+
export {
|
|
122
|
+
exportOwnerKey,
|
|
123
|
+
importOwnerKeyInto,
|
|
124
|
+
type ExportedOwnerKey,
|
|
125
|
+
type ImportedOwnerKey,
|
|
126
|
+
type OwnerKeyExportOptions
|
|
127
|
+
} from './owner-key-flows.js';
|
|
128
|
+
|
|
129
|
+
// Node-local trusted-owner anchor: the NON-replicated, per-party record of
|
|
130
|
+
// out-of-band-established owner keys (the trust anchor the replicated OwnerKey
|
|
131
|
+
// table cannot be). Cross-platform: interface + in-memory store only — the
|
|
132
|
+
// file-backed store is the Node-only subpath
|
|
133
|
+
// '@serfab/cadre-core/trusted-owner-store-file' (same isolation as
|
|
134
|
+
// key-store-file) so node:fs never lands in this graph.
|
|
135
|
+
export {
|
|
136
|
+
MemoryTrustedOwnerStore,
|
|
137
|
+
PersistentTrustedOwnerStore,
|
|
138
|
+
type TrustedOwnerStore,
|
|
139
|
+
type TrustSource
|
|
140
|
+
} from './trusted-owner-store.js';
|
|
141
|
+
|
|
142
|
+
// The one platform-specific piece of a persistent node-local store: a single
|
|
143
|
+
// durable text slot the embedding app supplies (IndexedDB / SecureStore /
|
|
144
|
+
// SQLite / a file). Everything else — envelope, load policy, snapshot write
|
|
145
|
+
// chain — is cross-platform in node-local-snapshot.ts.
|
|
146
|
+
export type { DurableSlot } from './node-local-snapshot.js';
|
|
147
|
+
|
|
148
|
+
// Node-local cold-start bootstrap-peer store: the dial targets retained from an
|
|
149
|
+
// applied seed so a node that could not connect on its first try keeps retrying
|
|
150
|
+
// across restarts. Same cross-platform split as the trusted-owner anchor above —
|
|
151
|
+
// interface + in-memory store here, Node-only file backend behind the subpath
|
|
152
|
+
// '@serfab/cadre-core/bootstrap-peer-store-file'.
|
|
153
|
+
export {
|
|
154
|
+
MemoryBootstrapPeerStore,
|
|
155
|
+
PersistentBootstrapPeerStore,
|
|
156
|
+
type BootstrapPeerStore,
|
|
157
|
+
type BootstrapPeerEntry
|
|
158
|
+
} from './bootstrap-peer-store.js';
|
|
159
|
+
|
|
160
|
+
// Node-local enrolled-machine count: the machines this party had enrolled the
|
|
161
|
+
// last time this node looked, remembered across restarts so the CONTROL node can
|
|
162
|
+
// declare a block-repair yardstick at bring-up — which is before the database
|
|
163
|
+
// holding the membership rows exists. Same cross-platform split as the two
|
|
164
|
+
// records above; Node-only file backend behind the subpath
|
|
165
|
+
// '@serfab/cadre-core/enrolled-machine-store-file'. Its load policy deliberately
|
|
166
|
+
// DIVERGES from theirs (an unreadable slot cold-starts rather than throwing) —
|
|
167
|
+
// see the module comment before unifying the three.
|
|
168
|
+
export {
|
|
169
|
+
MemoryEnrolledMachineStore,
|
|
170
|
+
PersistentEnrolledMachineStore,
|
|
171
|
+
type EnrolledMachineStore
|
|
172
|
+
} from './enrolled-machine-store.js';
|
|
173
|
+
|
|
174
|
+
// Node-local record of the strands this node joined from ANOTHER party and has not yet
|
|
175
|
+
// published party-wide, re-offered on every start as `strand:discovered`.
|
|
176
|
+
// Cross-platform: its durable form rides the KeyStore seam above (the record carries a
|
|
177
|
+
// closed strand's read secret), so there is no file-backed subpath.
|
|
178
|
+
export {
|
|
179
|
+
MemoryJoinedStrandStore,
|
|
180
|
+
KeyStoreJoinedStrandStore,
|
|
181
|
+
type JoinedStrandStore,
|
|
182
|
+
type JoinedStrandRecord
|
|
183
|
+
} from './joined-strand-store.js';
|
|
184
|
+
|
|
185
|
+
// Node-local strand network state: per strand, the state Optimystic's db-p2p saves for
|
|
186
|
+
// the strand node (its FRET routing table with each peer's signed address record), so a
|
|
187
|
+
// restarted strand node re-imports the peers it was talking to. Same cross-platform
|
|
188
|
+
// split as the bootstrap-peer store above — interface + in-memory + slot-backed stores
|
|
189
|
+
// here, Node-only file backend behind '@serfab/cadre-core/strand-network-state-file'.
|
|
190
|
+
export {
|
|
191
|
+
MemoryStrandNetworkStateStore,
|
|
192
|
+
PersistentStrandNetworkStateStore,
|
|
193
|
+
strandNetworkStatePersistence,
|
|
194
|
+
type StrandNetworkStateStore
|
|
195
|
+
} from './strand-network-state.js';
|
|
196
|
+
// The signed address records a running strand node's FRET table holds, as per-peer dial
|
|
197
|
+
// addresses: what the periodic refresh re-merges into the node's address book, and a
|
|
198
|
+
// diagnostic for "whom could this strand node redial right now?".
|
|
199
|
+
export { strandFretPeerAddrs, type FretAddrHost, type FretPeerAddrs } from './strand-fret-addrs.js';
|
|
200
|
+
|
|
201
|
+
// Storage scope keys — what `CadreNodeConfig.storage.provider` is called with. A
|
|
202
|
+
// strand's key is its strand id; the control database's key carries the party id,
|
|
203
|
+
// so two parties on one device never share a control store. Every key stays within
|
|
204
|
+
// `[a-z0-9._-]` — lowercase, so distinct keys stay distinct on a case-insensitive
|
|
205
|
+
// filesystem: the control key by lowercase hex encoding, a strand's by
|
|
206
|
+
// `assertStrandScopeKey`, which every strand launch runs.
|
|
207
|
+
export {
|
|
208
|
+
controlStorageScope,
|
|
209
|
+
isControlStorageScope,
|
|
210
|
+
isValidStrandScopeKey,
|
|
211
|
+
assertStrandScopeKey,
|
|
212
|
+
InvalidStrandIdError
|
|
213
|
+
} from './storage-scope.js';
|
|
214
|
+
|
|
215
|
+
// Strand database
|
|
216
|
+
export { StrandDatabase, type StrandDatabaseConfig } from './strand-database.js';
|
|
217
|
+
export type { StrandCommitDurability, StrandCommitHeld } from './strand-commit-durability.js';
|
|
218
|
+
|
|
219
|
+
// Strand management
|
|
220
|
+
export {
|
|
221
|
+
StrandWatcher,
|
|
222
|
+
type StrandWatcherCallbacks,
|
|
223
|
+
type StrandQueryable,
|
|
224
|
+
type SAppIdLookup,
|
|
225
|
+
type StrandRowWithApp
|
|
226
|
+
} from './strand-watcher.js';
|
|
227
|
+
export {
|
|
228
|
+
StrandInstanceManager,
|
|
229
|
+
type StartStrandConfig,
|
|
230
|
+
type ResumeStrandOverrides,
|
|
231
|
+
getStrandStoragePath,
|
|
232
|
+
isAwaitingFirstSync,
|
|
233
|
+
liveStrandStatus
|
|
234
|
+
} from './strand-instance-manager.js';
|
|
235
|
+
|
|
236
|
+
// The joining machine's first-sync write gate: a non-founder launch withholds its
|
|
237
|
+
// database (status 'syncing') until the strand's Header has arrived from a peer, so a
|
|
238
|
+
// write before the first sync can never fork the strand's tables.
|
|
239
|
+
export {
|
|
240
|
+
StrandAwaitingFirstSyncError,
|
|
241
|
+
DEFAULT_STRAND_FIRST_SYNC_TIMEOUT_MS,
|
|
242
|
+
DEFAULT_STRAND_FIRST_SYNC_BACKSTOP_MS,
|
|
243
|
+
type StrandFirstSyncConfig
|
|
244
|
+
} from './strand-first-sync-gate.js';
|
|
245
|
+
|
|
246
|
+
// Peer-join block catch-up (push this network's own blocks to each newly
|
|
247
|
+
// connected peer, so a late joiner physically holds pre-join blocks). Shared
|
|
248
|
+
// by the strand networks (ungated) and the control network (membership-gated).
|
|
249
|
+
export {
|
|
250
|
+
PeerJoinBackfill,
|
|
251
|
+
DEFAULT_PEER_JOIN_BACKFILL,
|
|
252
|
+
MAX_BLOCK_MESSAGE_BYTES,
|
|
253
|
+
PEER_JOIN_BACKFILL_WARN_AFTER_FAILURES,
|
|
254
|
+
type PeerJoinBackfillConfig,
|
|
255
|
+
type PeerJoinBackfillDeps,
|
|
256
|
+
type PeerJoinBackfillResult,
|
|
257
|
+
type PeerJoinBackfillPushClient
|
|
258
|
+
} from './peer-join-backfill.js';
|
|
259
|
+
|
|
260
|
+
// Operator opt-in to Optimystic change notifications on chosen strand nodes
|
|
261
|
+
// (`CadreNodeConfig.strandReactivity`).
|
|
262
|
+
export { strandCohortTopicOption, type StrandReactivityConfig } from './strand-reactivity.js';
|
|
263
|
+
|
|
264
|
+
// Closed-strand revoked-peer enforcement (deny the network nodes of removed
|
|
265
|
+
// members at the stream and connection layers, and hang up the sessions they
|
|
266
|
+
// already hold — see the module doc for the settled deny-list design, the
|
|
267
|
+
// teardown seam, and the fail directions).
|
|
268
|
+
export {
|
|
269
|
+
StrandRevocationEnforcer,
|
|
270
|
+
createRevocationConnectionGater,
|
|
271
|
+
readStrandRevocationRows,
|
|
272
|
+
DEFAULT_REVOCATION_BACKSTOP_MS,
|
|
273
|
+
REVOCATION_REFRESH_RETRY_MS,
|
|
274
|
+
REVOCATION_WIDE_STRAND_REFRESH_MS,
|
|
275
|
+
type StrandRevocationEnforcementConfig,
|
|
276
|
+
type StrandRevocationEnforcerDeps,
|
|
277
|
+
type StrandRevocationRows,
|
|
278
|
+
type StrandMemberPeerBinding,
|
|
279
|
+
type StrandRevocationJudge,
|
|
280
|
+
type StrandRevocationNetwork
|
|
281
|
+
} from './strand-revocation-enforcer.js';
|
|
282
|
+
|
|
283
|
+
// Closed-strand membership reconciliation: the bring-up loop that finishes a
|
|
284
|
+
// party's join on every machine — redeem the staged formation invitation, then
|
|
285
|
+
// write the durable machine→party MemberPeer binding — without ever blocking
|
|
286
|
+
// bring-up (see the module doc for the pass ladder and terminal states).
|
|
287
|
+
export {
|
|
288
|
+
StrandMembershipReconciler,
|
|
289
|
+
DEFAULT_MEMBERSHIP_RECONCILE_INTERVAL_MS,
|
|
290
|
+
IDLE_PASSES_BEFORE_ESCALATION,
|
|
291
|
+
INITIAL_JOIN_RETRY_INTERVAL_MS,
|
|
292
|
+
type StrandMembershipReconcilerDeps,
|
|
293
|
+
type StrandMembershipReconciliationConfig,
|
|
294
|
+
type PendingMembershipInviteSource
|
|
295
|
+
} from './strand-membership-reconciler.js';
|
|
296
|
+
|
|
297
|
+
// The timer seam the self-rescheduling loops share (membership retry ladder, the table
|
|
298
|
+
// change schedule the first-sync gate probes on) — injected by tests as a hand-cranked clock.
|
|
299
|
+
export { defaultTimeoutScheduler, type TimeoutScheduler } from './timeout-scheduler.js';
|
|
300
|
+
|
|
301
|
+
// Hibernation
|
|
302
|
+
export {
|
|
303
|
+
HibernationManager,
|
|
304
|
+
type HibernationCallbacks
|
|
305
|
+
} from './hibernation-manager.js';
|
|
306
|
+
|
|
307
|
+
// Arachnode (stub)
|
|
308
|
+
export {
|
|
309
|
+
ArachnodeStub,
|
|
310
|
+
createArachnodeStub,
|
|
311
|
+
type RingConfig
|
|
312
|
+
} from './arachnode-stub.js';
|
|
313
|
+
|
|
314
|
+
// Enrollment
|
|
315
|
+
export {
|
|
316
|
+
EnrollmentService,
|
|
317
|
+
type MemberVerifier,
|
|
318
|
+
type MemberRegistry
|
|
319
|
+
} from './enrollment.js';
|
|
320
|
+
|
|
321
|
+
// Strand Solicitation
|
|
322
|
+
export {
|
|
323
|
+
StrandSolicitationService,
|
|
324
|
+
createDefaultFormationResponseValidator,
|
|
325
|
+
type DisclosureValidator,
|
|
326
|
+
type FormationUsageRecorder,
|
|
327
|
+
type FormationUsageParams,
|
|
328
|
+
type AuthorizedFormationUsage,
|
|
329
|
+
type BoundHostStrand,
|
|
330
|
+
type ResolvedHostStrand,
|
|
331
|
+
type StrandProvisioner,
|
|
332
|
+
type FormationResponseValidator,
|
|
333
|
+
type StrandSolicitationServiceOptions
|
|
334
|
+
} from './strand-solicitation.js';
|
|
335
|
+
|
|
336
|
+
// Formation approval client: asks an invite's ValidationUrl hook whether ONE redemption
|
|
337
|
+
// may proceed, and checks the answer against the bytes the control database will verify.
|
|
338
|
+
export {
|
|
339
|
+
createHttpFormationApprover,
|
|
340
|
+
signFormationApproval,
|
|
341
|
+
verifyFormationApproval,
|
|
342
|
+
FormationApprovalError,
|
|
343
|
+
type FormationApprovalRequest,
|
|
344
|
+
type FormationVouchFields,
|
|
345
|
+
type FormationApproval,
|
|
346
|
+
type FormationApprover,
|
|
347
|
+
type FormationApprovalFailure
|
|
348
|
+
} from './formation-approval.js';
|
|
349
|
+
|
|
350
|
+
// DB-backed FormationUsageRecorder (reads/writes the real CadreControl tables)
|
|
351
|
+
export { ControlFormationUsageRecorder } from './control-formation-recorder.js';
|
|
352
|
+
|
|
353
|
+
// Closed-strand member key generation (ed25519 protobuf, base64) + the
|
|
354
|
+
// protobuf->base64url bridge that derives the founding Member/Manager key.
|
|
355
|
+
export { generateStrandMemberKey, strandMemberKeyPair } from './strand-member-key.js';
|
|
356
|
+
|
|
357
|
+
// Strand membership writer (founder bootstrap, invite issuance/consumption,
|
|
358
|
+
// manager-admit, member-peer registration, manager rotation, sealing — the sole
|
|
359
|
+
// manager permanently freezing admission — + shared signing primitives reused
|
|
360
|
+
// across the flows).
|
|
361
|
+
export {
|
|
362
|
+
signStrandPayload,
|
|
363
|
+
verifyStrandPayload,
|
|
364
|
+
signStrandApproval,
|
|
365
|
+
generateStrandStampId,
|
|
366
|
+
bootstrapFounderMembership,
|
|
367
|
+
PreSplitStrandIdentityError,
|
|
368
|
+
issueInvite,
|
|
369
|
+
consumeInvite,
|
|
370
|
+
burnInvite,
|
|
371
|
+
isStrandMember,
|
|
372
|
+
cancelInvite,
|
|
373
|
+
listOutstandingInvites,
|
|
374
|
+
addMemberByManager,
|
|
375
|
+
revokeMember,
|
|
376
|
+
leaveStrand,
|
|
377
|
+
registerMemberPeer,
|
|
378
|
+
listMemberPeers,
|
|
379
|
+
removeMemberPeer,
|
|
380
|
+
addManager,
|
|
381
|
+
admitManager,
|
|
382
|
+
removeManager,
|
|
383
|
+
sealStrand,
|
|
384
|
+
isStrandSealed,
|
|
385
|
+
StrandTransactionBusyError,
|
|
386
|
+
STRAND_ENGINE,
|
|
387
|
+
STRAND_ENGINE_VERSION,
|
|
388
|
+
type FounderBootstrapParams,
|
|
389
|
+
type IssueInviteParams,
|
|
390
|
+
type IssuedInvite,
|
|
391
|
+
type ConsumeInviteParams,
|
|
392
|
+
type CancelInviteParams,
|
|
393
|
+
type OutstandingInvite,
|
|
394
|
+
type AddMemberByManagerParams,
|
|
395
|
+
type RevokeMemberParams,
|
|
396
|
+
type LeaveStrandParams,
|
|
397
|
+
type RegisterMemberPeerParams,
|
|
398
|
+
type RemoveOwnPeerParams,
|
|
399
|
+
type RemoveMemberPeerByManagerParams,
|
|
400
|
+
type RemoveMemberPeerParams,
|
|
401
|
+
type AddManagerParams,
|
|
402
|
+
type AdmitManagerParams,
|
|
403
|
+
type RemoveManagerParams,
|
|
404
|
+
type SealStrandParams,
|
|
405
|
+
type StrandWriteOptions
|
|
406
|
+
} from './strand-membership-writer.js';
|
|
407
|
+
|
|
408
|
+
// Engine-canonical datetime helper (shared by control + strand signed-write flows
|
|
409
|
+
// so a signed timestamp byte-matches the datetime-coerced column the CHECK sees).
|
|
410
|
+
export { canonicalDatetime } from './canonical-datetime.js';
|
|
411
|
+
|
|
412
|
+
// Strand-DB-backed EnrollmentService backing: concrete MemberRegistry +
|
|
413
|
+
// MemberVerifier that write/read the real Strand.* membership tables.
|
|
414
|
+
export {
|
|
415
|
+
StrandMemberRegistry,
|
|
416
|
+
StrandMemberVerifier,
|
|
417
|
+
memberRegistrationPayload,
|
|
418
|
+
type StrandAdmission
|
|
419
|
+
} from './strand-member-registry.js';
|
|
420
|
+
|
|
421
|
+
// Seed Bootstrap
|
|
422
|
+
export {
|
|
423
|
+
SeedBootstrapService,
|
|
424
|
+
SEED_PROTOCOL,
|
|
425
|
+
mergeSeedPeers,
|
|
426
|
+
seedDialTargets,
|
|
427
|
+
seedDigest,
|
|
428
|
+
type SeedBootstrapConfig,
|
|
429
|
+
type SeedEventCallbacks
|
|
430
|
+
} from './seed-bootstrap.js';
|
|
431
|
+
|
|
432
|
+
// Peer Authorization (shared owner-signature digest + offline verifier)
|
|
433
|
+
export {
|
|
434
|
+
peerAuthorizationDigest,
|
|
435
|
+
cadrePeerVoucherDigest,
|
|
436
|
+
cadrePeerRemoveDigest,
|
|
437
|
+
deviceTokenAddDigest,
|
|
438
|
+
deviceTokenRemoveDigest,
|
|
439
|
+
formationConsentDigest,
|
|
440
|
+
cadreInviteAddDigest,
|
|
441
|
+
cadreInviteRedeemDigest,
|
|
442
|
+
cadreInviteConsentDigest,
|
|
443
|
+
ownerKeyAddDigest,
|
|
444
|
+
verifyPeerAuthorization,
|
|
445
|
+
verifyCadrePeerVoucher,
|
|
446
|
+
verifyOwnerKeyVoucher,
|
|
447
|
+
verifyRevocationSigner,
|
|
448
|
+
verifyFormationConsent,
|
|
449
|
+
verifyInvitationAdmission,
|
|
450
|
+
verifyCadreInviteRow,
|
|
451
|
+
verifyCadreInviteRedemption,
|
|
452
|
+
ownerGrantAddDigest,
|
|
453
|
+
ownerGrantRedeemDigest,
|
|
454
|
+
ownerGrantConsentDigest,
|
|
455
|
+
verifyOwnerGrantRow,
|
|
456
|
+
verifyOwnerGrantRedemption,
|
|
457
|
+
verifyOwnerGrantAdmission,
|
|
458
|
+
type DeviceTokenAuthorizedRow
|
|
459
|
+
} from './peer-authorization.js';
|
|
460
|
+
|
|
461
|
+
// How the trusted-owner anchor follows the replicated OwnerKey table along verifiable
|
|
462
|
+
// chains: the pure derivation rule `CadreNode.syncOwnerAnchor` applies on every membership
|
|
463
|
+
// refresh (owner-anchor-sync.ts).
|
|
464
|
+
export { deriveOwnerAnchor, type OwnerAnchorInputs, type OwnerAnchorDerivation } from './owner-anchor-sync.js';
|
|
465
|
+
|
|
466
|
+
// Strand Wake (control-network push-wake protocol)
|
|
467
|
+
export {
|
|
468
|
+
StrandWakeService,
|
|
469
|
+
dialWake,
|
|
470
|
+
WAKE_PROTOCOL,
|
|
471
|
+
DEFAULT_WAKE_DIAL_BUDGET_MS,
|
|
472
|
+
type StrandWakeServiceOptions,
|
|
473
|
+
type DialWakeOptions
|
|
474
|
+
} from './strand-wake-protocol.js';
|
|
475
|
+
|
|
476
|
+
// Strand Address (control-network strand-address RPC) — wire types come via
|
|
477
|
+
// `export * from './types.js'` (StrandAddrRequest / StrandAddrResponse / StrandAddrStatus).
|
|
478
|
+
export {
|
|
479
|
+
StrandAddrService,
|
|
480
|
+
collectStrandAddrs,
|
|
481
|
+
STRAND_ADDR_PROTOCOL,
|
|
482
|
+
type StrandAddrServiceOptions,
|
|
483
|
+
type StrandAddrPeer,
|
|
484
|
+
type CollectStrandAddrsOptions,
|
|
485
|
+
type StrandAddrOutcome,
|
|
486
|
+
type StrandAddrCollection
|
|
487
|
+
} from './strand-addr-protocol.js';
|
|
488
|
+
|
|
489
|
+
// Peer-address record (self-published, signed, freshness-stamped CadrePeer row)
|
|
490
|
+
export {
|
|
491
|
+
peerRecordSignedPayload,
|
|
492
|
+
signPeerRecord,
|
|
493
|
+
verifyPeerRecordSignature,
|
|
494
|
+
isPeerRecordFresh,
|
|
495
|
+
isSignalingAddr,
|
|
496
|
+
orderSignalingFirst,
|
|
497
|
+
currentMemberTrustPolicy,
|
|
498
|
+
DEFAULT_PEER_RECORD_MAX_AGE_MS,
|
|
499
|
+
DEFAULT_PEER_RECORD_HEARTBEAT_MS
|
|
500
|
+
} from './peer-record.js';
|
|
501
|
+
|
|
502
|
+
// Device-token record (self-published, signed FCM/APNs push token — CadrePeer sibling)
|
|
503
|
+
export {
|
|
504
|
+
deviceTokenSignedPayload,
|
|
505
|
+
signDeviceTokenRecord,
|
|
506
|
+
verifyDeviceTokenSignature,
|
|
507
|
+
isPushPlatform
|
|
508
|
+
} from './device-token.js';
|
|
509
|
+
|
|
510
|
+
// Strand-wake payload contract (canonical; shared by the server sender + RN receiver)
|
|
511
|
+
export { STRAND_WAKE_TYPE, type StrandWakePayload } from './strand-wake-payload.js';
|
|
512
|
+
|
|
513
|
+
// Platform push delivery — the cross-platform `PushNotifier` *contract* only.
|
|
514
|
+
// The FCM/APNs implementations (node:http2/node:crypto) and the
|
|
515
|
+
// `createPushNotifier` router that builds them live behind the Node-only subpath
|
|
516
|
+
// `@serfab/cadre-core/push-node` (`push-node.ts`), never in this graph. A Node
|
|
517
|
+
// host constructs a notifier from that subpath and injects the instance into
|
|
518
|
+
// `CadreNodeConfig.push.notifier`. These re-exports are type-only (erased at
|
|
519
|
+
// emit), so the RN/browser entry graph never pulls the Node modules in.
|
|
520
|
+
export type { PushNotifier, PushMessage, PushSendResult } from './push-notifier.js';
|
|
521
|
+
|
|
522
|
+
// Push-credential validation + log redaction. Dependency-free (type-only imports),
|
|
523
|
+
// so a provisioner (cadre-host / cadre-provider) can reject a partial credential
|
|
524
|
+
// set and produce a key-safe log view without pulling the FCM/APNs sender graph.
|
|
525
|
+
export { validatePushCredentials, redactPushCredentials, REDACTED } from './push-credentials.js';
|
|
526
|
+
|
|
527
|
+
// Server-side push-wake trigger policy + fan-out (who/when to wake). Cross-platform
|
|
528
|
+
// clean — it imports only the PushNotifier *type*, so exporting it as a runtime
|
|
529
|
+
// value pulls no node:http2/node:crypto edge into the RN/browser graph.
|
|
530
|
+
export {
|
|
531
|
+
PushFanoutService,
|
|
532
|
+
DEFAULT_PUSH_COOLDOWN_MS,
|
|
533
|
+
DEFAULT_PUSH_DEBOUNCE_MS,
|
|
534
|
+
type PushFanoutOptions,
|
|
535
|
+
type FanoutMember
|
|
536
|
+
} from './push-fanout.js';
|
|
537
|
+
|
|
538
|
+
// Control-cohort dial selection (backbone-preferential, bounded out-degree) +
|
|
539
|
+
// the backstop, redial and degree defaults the proactive reconcile routine reads.
|
|
540
|
+
export {
|
|
541
|
+
selectControlCohortDials,
|
|
542
|
+
DEFAULT_CONTROL_COHORT_RECONCILE_MS,
|
|
543
|
+
DEFAULT_CONTROL_COHORT_TARGET_DEGREE,
|
|
544
|
+
CONTROL_COHORT_REDIAL_MS,
|
|
545
|
+
type ControlCohortSelection,
|
|
546
|
+
type ControlCohortReconcileResult
|
|
547
|
+
} from './control-cohort.js';
|
|
548
|
+
|
|
549
|
+
// Dialing one peer from several candidate addresses, each under its own time
|
|
550
|
+
// limit, so an address that never answers cannot starve the rest. Each address is
|
|
551
|
+
// bound to the peer expected and dialed outside libp2p's dial queue (`dialAddr`),
|
|
552
|
+
// so another dial of the same peer in flight cannot capture the attempt.
|
|
553
|
+
export {
|
|
554
|
+
dialAddr,
|
|
555
|
+
withTrailingPeerId,
|
|
556
|
+
dialPeerAddrs,
|
|
557
|
+
SelfRelayOnlyError,
|
|
558
|
+
PeerUnreachableError,
|
|
559
|
+
tryAddrsInTurn,
|
|
560
|
+
directBeforeRelayed,
|
|
561
|
+
DEFAULT_CONTROL_COHORT_DIAL_TIMEOUT_MS,
|
|
562
|
+
DEFAULT_CONTROL_COHORT_PER_ADDRESS_DIAL_TIMEOUT_MS,
|
|
563
|
+
CONTROL_COHORT_DIAL_ADDRESS_ATTEMPTS,
|
|
564
|
+
DEFAULT_PEER_DIAL_BUDGET,
|
|
565
|
+
type PeerDialBudget,
|
|
566
|
+
type AddrDialer
|
|
567
|
+
} from './peer-dial.js';
|
|
568
|
+
|
|
569
|
+
// Dial and reservation budgets counted in link round trips rather than fixed milliseconds, so
|
|
570
|
+
// one declared assumption about the link moves them all — see `NetworkConfig.linkRoundTripMs`.
|
|
571
|
+
export {
|
|
572
|
+
DECLARED_LINK_ROUND_TRIP_MS,
|
|
573
|
+
CIRCUIT_DIAL_ROUND_TRIPS,
|
|
574
|
+
RELAY_DIAL_ROUND_TRIPS,
|
|
575
|
+
RELAYED_DIAL_ROUND_TRIPS,
|
|
576
|
+
RELAY_RESERVATION_ROUND_TRIPS,
|
|
577
|
+
CIRCUIT_REQUEST_ROUND_TRIPS,
|
|
578
|
+
RELAYED_REQUEST_ROUND_TRIPS,
|
|
579
|
+
PUSH_TRANSFER_ALLOWANCE_MS,
|
|
580
|
+
ADMISSION_DECISION_TIMEOUT_MS,
|
|
581
|
+
resolveLinkRoundTripMs,
|
|
582
|
+
relayedDialBudgetMs,
|
|
583
|
+
relayReservationBudgetMs,
|
|
584
|
+
circuitRequestBudgetMs,
|
|
585
|
+
relayedRequestBudgetMs,
|
|
586
|
+
peerJoinPushBudget,
|
|
587
|
+
type PeerJoinPushBudget,
|
|
588
|
+
DIAL_ADMISSION_DECISIONS,
|
|
589
|
+
optimysticDialLimits,
|
|
590
|
+
type OptimysticDialLimits
|
|
591
|
+
} from './link-budget.js';
|
|
592
|
+
|
|
593
|
+
// Seed trust policy (trust anchor for incoming seeds)
|
|
594
|
+
export {
|
|
595
|
+
anchoredTrustPolicy,
|
|
596
|
+
pinnedKeyTrustPolicy,
|
|
597
|
+
tofuTrustPolicy,
|
|
598
|
+
claimSecretTrustPolicy,
|
|
599
|
+
type SeedTrustPolicy,
|
|
600
|
+
type SeedTrustContext,
|
|
601
|
+
type SeedTrustDecision,
|
|
602
|
+
type ClaimSecretTrustPolicyOptions
|
|
603
|
+
} from './seed-trust-policy.js';
|
|
604
|
+
|
|
605
|
+
// Claim proof: how a brand-new node's first seed proves its sender holds the node's
|
|
606
|
+
// one-time claim secret. The owner side builds the proof over `seedDigest` (exported
|
|
607
|
+
// with the seed bootstrap above); `claimSecretTrustPolicy` verifies it.
|
|
608
|
+
// `ClaimRefusedError` is what `CadreNode.claimNode` throws when the node said no;
|
|
609
|
+
// `PeerUnreachableError` (exported with the peer dial above) when it was never reached.
|
|
610
|
+
export {
|
|
611
|
+
parseClaimSecret,
|
|
612
|
+
claimProof,
|
|
613
|
+
verifyClaimProof,
|
|
614
|
+
ClaimRefusedError,
|
|
615
|
+
CLAIM_SECRET_BYTES
|
|
616
|
+
} from './claim-proof.js';
|
|
617
|
+
|
|
618
|
+
// The claim payload: the node's peer id, addresses and claim secret as the text a host
|
|
619
|
+
// shows as a QR code and a phone scans (`CadreNode.claimNode` takes the decoded form).
|
|
620
|
+
export {
|
|
621
|
+
encodeNodeClaimPayload,
|
|
622
|
+
decodeNodeClaimPayload,
|
|
623
|
+
selectNodeClaimAddresses,
|
|
624
|
+
withClaimDestination,
|
|
625
|
+
destinationPeerIdOf,
|
|
626
|
+
classifyDialAddress,
|
|
627
|
+
NODE_CLAIM_PAYLOAD_PREFIX,
|
|
628
|
+
type NodeClaimPayload,
|
|
629
|
+
type NodeClaimAddressOptions,
|
|
630
|
+
type DialAddressKind
|
|
631
|
+
} from './node-claim-payload.js';
|
|
632
|
+
|
|
633
|
+
// Moving a party's strands into another party of the same owner, so an app's strands follow
|
|
634
|
+
// the app into the user's main cadre: the bundle one node exports from the party it leaves,
|
|
635
|
+
// its adoption by a node of the party it joined, and the check that the party it left holds
|
|
636
|
+
// nothing the joined one lacks before it is dissolved.
|
|
637
|
+
export {
|
|
638
|
+
exportStrandBundle,
|
|
639
|
+
adoptStrandBundle,
|
|
640
|
+
readStrandHoldings,
|
|
641
|
+
unheldBundleContent,
|
|
642
|
+
StrandMoveNotOwnerError,
|
|
643
|
+
StrandMoveSamePartyError,
|
|
644
|
+
type StrandHoldings,
|
|
645
|
+
type StrandBundle,
|
|
646
|
+
type StrandBundleEntry,
|
|
647
|
+
type FormationInviteEntry,
|
|
648
|
+
type StrandMoveReport,
|
|
649
|
+
type StrandMoveFailure
|
|
650
|
+
} from './strand-move.js';
|
|
651
|
+
|
|
652
|
+
// The join request: what an app that wants to join a cadre copies to the app that manages it,
|
|
653
|
+
// which mints an invitation targeted at the request's peer id. Both paste-text prefixes live here.
|
|
654
|
+
export {
|
|
655
|
+
encodeCadreJoinRequest,
|
|
656
|
+
decodeCadreJoinRequest,
|
|
657
|
+
requireCadreJoinReply,
|
|
658
|
+
CADRE_JOIN_REQUEST_PREFIX,
|
|
659
|
+
CADRE_INVITATION_PREFIX,
|
|
660
|
+
OWNER_KEY_EXPORT_STEM,
|
|
661
|
+
OWNER_GRANT_PREFIX,
|
|
662
|
+
CADRE_JOIN_REQUEST_MAX_APP_NAME,
|
|
663
|
+
type CadreJoinReply,
|
|
664
|
+
type CadreJoinRequest
|
|
665
|
+
} from './cadre-join-request.js';
|
|
666
|
+
|
|
667
|
+
// Renting a node from a hosting provider: the provider's descriptor, the app's side of the
|
|
668
|
+
// OAuth 2 + PKCE sign-in, the typed client for its container API, and `rentNode` /
|
|
669
|
+
// `finishRental`, which add the rented container to this node's cadre by invitation or by
|
|
670
|
+
// claim. Global `fetch` and `crypto.getRandomValues` only, so the whole set loads on React
|
|
671
|
+
// Native and in the browser (`docs/architecture.md` → "Renting a node from an app"). The
|
|
672
|
+
// barrel is the curated list; it is not repeated here.
|
|
673
|
+
export * from './provider/index.js';
|
|
674
|
+
|
|
675
|
+
// Schema Verification
|
|
676
|
+
export {
|
|
677
|
+
signSchema,
|
|
678
|
+
verifySchema,
|
|
679
|
+
assertSchemaSignature,
|
|
680
|
+
SchemaVerificationError
|
|
681
|
+
} from './schema-verification.js';
|
|
682
|
+
|
|
683
|
+
// Strand Formation transport (native cadre-core protocol)
|
|
684
|
+
export {
|
|
685
|
+
FormationListener,
|
|
686
|
+
dialFormation,
|
|
687
|
+
dialFormationByMachine,
|
|
688
|
+
isValidResponderCreatesResult,
|
|
689
|
+
isWellFormedMembershipInvite,
|
|
690
|
+
sanitizeStrandAddrs,
|
|
691
|
+
FORMATION_PROTOCOL,
|
|
692
|
+
type FormationParty,
|
|
693
|
+
type FormationContactMessage,
|
|
694
|
+
type FormationResultMessage,
|
|
695
|
+
type FormationProvisionResult,
|
|
696
|
+
type FormationStrandInfo,
|
|
697
|
+
type FormationDbConnectionInfo,
|
|
698
|
+
type FormationListenerOptions,
|
|
699
|
+
type FormationDialOptions,
|
|
700
|
+
type FormationDialResult,
|
|
701
|
+
type FormationRejection,
|
|
702
|
+
type ResponderProvisionOutcome
|
|
703
|
+
} from './strand-formation-protocol.js';
|
|
704
|
+
// A responder session's one read of its formation token, and the check made from it
|
|
705
|
+
export {
|
|
706
|
+
classifyTokenRead,
|
|
707
|
+
isTokenReadSpent,
|
|
708
|
+
type FormationInviteFacts,
|
|
709
|
+
type FormationTokenRead,
|
|
710
|
+
type FormationTokenCheck
|
|
711
|
+
} from './formation-token.js';
|
|
712
|
+
// How a formation dial fails: a typed refusal (with a fixed code) or no answer at all
|
|
713
|
+
export {
|
|
714
|
+
FormationRejectedError,
|
|
715
|
+
FormationUnreachableError,
|
|
716
|
+
FormationPostApprovalError,
|
|
717
|
+
FORMATION_REJECTION_RETRYABLE,
|
|
718
|
+
isFormationRejectionCode,
|
|
719
|
+
type FormationRejectionCode
|
|
720
|
+
} from './strand-formation-rejection.js';
|
|
721
|
+
export { formationDeadlines, type FormationDeadlines } from './strand-formation-deadlines.js';
|
|
722
|
+
// Cadre invitation redemption transport: the bundle an owner hands out, the wire messages, the
|
|
723
|
+
// member-side handler and the device-side dialer, and how a redemption fails
|
|
724
|
+
export {
|
|
725
|
+
CadreInviteHandler,
|
|
726
|
+
redeemAtMembers,
|
|
727
|
+
redeemInPasses,
|
|
728
|
+
signRedeemRequest,
|
|
729
|
+
verifyRedeemReply,
|
|
730
|
+
encodeCadreInvitation,
|
|
731
|
+
decodeCadreInvitation,
|
|
732
|
+
isWellFormedCadreInviteRow,
|
|
733
|
+
sanitizeAddrs,
|
|
734
|
+
CadreInviteRejectedError,
|
|
735
|
+
CadreInviteUnreachableError,
|
|
736
|
+
CadreInviteReplyInvalidError,
|
|
737
|
+
CADRE_INVITE_PROTOCOL,
|
|
738
|
+
CADRE_INVITE_REJECTION_RETRYABLE,
|
|
739
|
+
isCadreInviteRejectionCode,
|
|
740
|
+
type CadreInvitation,
|
|
741
|
+
type CadreInviteRedeemRequest,
|
|
742
|
+
type CadreInviteRedeemReply,
|
|
743
|
+
type CadreInviteAccepted,
|
|
744
|
+
type CadreInviteRejectionCode,
|
|
745
|
+
type CadreInviteAddressOutcome,
|
|
746
|
+
type CadreInviteHandlerOptions,
|
|
747
|
+
type CadreInviteStore,
|
|
748
|
+
type RedeemAtMembersOptions,
|
|
749
|
+
type RedeemInPassesOptions,
|
|
750
|
+
type RedeemSigner,
|
|
751
|
+
type RedeemSelfRecord,
|
|
752
|
+
type CadreInviteRedemption
|
|
753
|
+
} from './cadre-invite-protocol.js';
|
|
754
|
+
// Owner grant redemption transport: the bundle an owner hands out, the wire messages, the
|
|
755
|
+
// member-side handler and the holder-side dialer, and how a redemption fails
|
|
756
|
+
export {
|
|
757
|
+
OwnerGrantHandler,
|
|
758
|
+
redeemOwnerGrantAtMembers,
|
|
759
|
+
redeemOwnerGrantInPasses,
|
|
760
|
+
signOwnerGrantRequest,
|
|
761
|
+
verifyOwnerGrantReply,
|
|
762
|
+
encodeOwnerGrant,
|
|
763
|
+
decodeOwnerGrant,
|
|
764
|
+
isWellFormedOwnerGrantRow,
|
|
765
|
+
OwnerGrantRejectedError,
|
|
766
|
+
OwnerGrantUnreachableError,
|
|
767
|
+
OwnerGrantReplyInvalidError,
|
|
768
|
+
OWNER_GRANT_PROTOCOL,
|
|
769
|
+
OWNER_GRANT_REJECTION_RETRYABLE,
|
|
770
|
+
isOwnerGrantRejectionCode,
|
|
771
|
+
type OwnerGrantBundle,
|
|
772
|
+
type OwnerGrantRedeemRequest,
|
|
773
|
+
type OwnerGrantRedeemReply,
|
|
774
|
+
type OwnerGrantAccepted,
|
|
775
|
+
type OwnerGrantRejectionCode,
|
|
776
|
+
type OwnerGrantHandlerOptions,
|
|
777
|
+
type OwnerGrantStore,
|
|
778
|
+
type RedeemOwnerGrantAtMembersOptions,
|
|
779
|
+
type RedeemOwnerGrantInPassesOptions,
|
|
780
|
+
type OwnerGrantRedemption
|
|
781
|
+
} from './owner-grant-protocol.js';
|
|
782
|
+
// The exchange shape both redemption protocols are built on
|
|
783
|
+
export {
|
|
784
|
+
MemberRedemptionHandler,
|
|
785
|
+
dialRedemption,
|
|
786
|
+
dialRedemptionInPasses,
|
|
787
|
+
MAX_REDEMPTION_FRAME_BYTES,
|
|
788
|
+
type MemberRedemptionHandlerOptions,
|
|
789
|
+
type MemberRedemptionOptions,
|
|
790
|
+
type MemberRedemptionPassOptions,
|
|
791
|
+
type MemberRedemption,
|
|
792
|
+
type RedemptionAddressOutcome,
|
|
793
|
+
type RedemptionRejection,
|
|
794
|
+
type RedemptionRefusalFrame
|
|
795
|
+
} from './member-redemption.js';
|
|
796
|
+
// Which machines, and how many addresses of each, an invitation names; how far a cadre invitation reaches
|
|
797
|
+
export {
|
|
798
|
+
selectCadreInvitationMembers,
|
|
799
|
+
cadreInvitationReach,
|
|
800
|
+
CADRE_INVITATION_MAX_ADDRS,
|
|
801
|
+
CADRE_INVITATION_ADDRS_PER_SIBLING
|
|
802
|
+
} from './invitation-bootstrap.js';
|
|
803
|
+
// The pending-join retry loop behind CadreNode.requestJoin (PendingJoinStatus is in types.ts)
|
|
804
|
+
export { PENDING_JOIN_BACKSTOP_MS, PENDING_JOIN_MAX_BACKOFF_MS, MAX_PENDING_JOIN_MS } from './pending-join-runner.js';
|
|
805
|
+
|
|
806
|
+
// Strand Formation manager (drives the native transport)
|
|
807
|
+
export {
|
|
808
|
+
StrandFormationManager,
|
|
809
|
+
createStrandFormationManager,
|
|
810
|
+
MEMBERSHIP_INVITE_TTL_MS,
|
|
811
|
+
MEMBERSHIP_INVITE_UNAVAILABLE_REASON,
|
|
812
|
+
HOST_STRAND_MUST_BE_RECREATED_REASON,
|
|
813
|
+
type CadrePeerAddrsSource,
|
|
814
|
+
type MembershipInviteIssuer,
|
|
815
|
+
type StrandFormationManagerConfig,
|
|
816
|
+
type StrandFormationManagerOptions
|
|
817
|
+
} from './strand-formation-manager.js';
|
|
818
|
+
|
|
819
|
+
// Control-network per-stream protocol guard (which peers may open which protocol)
|
|
820
|
+
export {
|
|
821
|
+
controlProtocolClasses,
|
|
822
|
+
type ControlProtocolClass
|
|
823
|
+
} from './control-protocol-guard.js';
|
|
824
|
+
|
|
825
|
+
// Control-network inbound connection gate (membership defense-in-depth)
|
|
826
|
+
export {
|
|
827
|
+
createMembershipConnectionGater,
|
|
828
|
+
PROVISIONAL_ADMISSION_DEADLINE_MS,
|
|
829
|
+
PROVISIONAL_ADMISSION_CLOSE_TIMEOUT_MS,
|
|
830
|
+
MAX_UNAUTHORIZED_RELAY_RESERVATIONS,
|
|
831
|
+
UnauthorizedReservationBudget,
|
|
832
|
+
type InboundAdmissionPolicy,
|
|
833
|
+
type InboundConnectionVerdict
|
|
834
|
+
} from './membership-connection-gater.js';
|
|
835
|
+
|
|
836
|
+
// Thrown out of `CadreNode.start()` when a `network.relayAddrs` reservation does
|
|
837
|
+
// not land on its first attempt — the fail-fast posture of that config field now
|
|
838
|
+
// that the control node reserves AFTER control-database bring-up (relay-addrs.ts).
|
|
839
|
+
// `UnbindableListenAddressError` is the same posture for the OTHER half of the listen
|
|
840
|
+
// config: a `network.listenAddrs` entry whose transport the node will not have refuses
|
|
841
|
+
// start instead of being silently dropped by libp2p's transport manager.
|
|
842
|
+
//
|
|
843
|
+
// `resolveListenAddrs` and `strandNodeAddrs` are the derivations themselves — what a
|
|
844
|
+
// `NetworkConfig` actually turns into for the control node and for each strand node.
|
|
845
|
+
// Exported so an embedder that hand-writes a `network` block (the React Native and web
|
|
846
|
+
// reference apps) can assert on the resulting SHAPE rather than on its own field names,
|
|
847
|
+
// which is the difference between a test that proves reachability and one that proves a
|
|
848
|
+
// spelling.
|
|
849
|
+
export {
|
|
850
|
+
RelayReservationFailedError,
|
|
851
|
+
UnbindableListenAddressError,
|
|
852
|
+
RELAY_SEARCH_LISTEN_ADDR,
|
|
853
|
+
resolveListenAddrs
|
|
854
|
+
} from './relay-addrs.js';
|
|
855
|
+
export { strandNodeAddrs, type StrandNodeAddrs } from './strand-network-config.js';
|
|
856
|
+
// STUN for an embedder's WebRTC transport, derived from the relays it already uses: each
|
|
857
|
+
// Sereus relay also answers STUN (`ops/docs/ice-servers.md`).
|
|
858
|
+
export { RELAY_STUN_PORT, relayStunUrl, resolveStunServers, type StunServer } from './relay-stun.js';
|
|
859
|
+
// The circuit-relay SERVER a node runs, and with which init — one resolution shared by the
|
|
860
|
+
// control node and every strand node. Exported alongside the listen derivations above for the
|
|
861
|
+
// same reason: an embedder can assert on what its `network` block resolves to.
|
|
862
|
+
export {
|
|
863
|
+
resolveRelayServer,
|
|
864
|
+
PARTY_RELAY_MAX_RESERVATIONS,
|
|
865
|
+
PARTY_RELAY_RESERVATION_TTL_MS,
|
|
866
|
+
type ResolvedRelayServer,
|
|
867
|
+
type ResolvedRelayReservations
|
|
868
|
+
} from './relay-server.js';
|
|
869
|
+
|
|
870
|
+
// Relay reservation via the bare `/p2p-circuit` search listener — the one route
|
|
871
|
+
// every control node takes; `network.relayAddrs` is its fail-fast posture
|
|
872
|
+
// (see relay-reservation.ts)
|
|
873
|
+
export {
|
|
874
|
+
circuitMultiaddrs,
|
|
875
|
+
superviseRelayReservation,
|
|
876
|
+
DEFAULT_RELAY_RESERVE_TIMEOUT_MS,
|
|
877
|
+
DEFAULT_RELAY_RESERVE_POLL_MS,
|
|
878
|
+
DEFAULT_RELAY_CHECK_MS,
|
|
879
|
+
DEFAULT_RELAY_MIN_BACKOFF_MS,
|
|
880
|
+
DEFAULT_RELAY_MAX_BACKOFF_MS,
|
|
881
|
+
type RelayReservationStatus,
|
|
882
|
+
type RelayReservationState,
|
|
883
|
+
type RelayReserveOptions,
|
|
884
|
+
type RelayReservationSupervisor,
|
|
885
|
+
type RelayReservationSupervisorOptions
|
|
886
|
+
} from './relay-reservation.js';
|
|
887
|
+
|
|
888
|
+
// Connection-path diagnostics (relayed vs direct classification + summary)
|
|
889
|
+
export {
|
|
890
|
+
classifyTransport,
|
|
891
|
+
summarizeConnectionPaths,
|
|
892
|
+
emptyConnectionPathSummary,
|
|
893
|
+
DEFAULT_SETTLE_WINDOW_MS,
|
|
894
|
+
type ConnectionPathKind,
|
|
895
|
+
type ConnectionTransport,
|
|
896
|
+
type ConnectionPath,
|
|
897
|
+
type ConnectionPathSummary,
|
|
898
|
+
type ConnectionLike
|
|
899
|
+
} from './diagnostics/connection-path.js';
|