@serfab/cadre-core 1.4.0 → 1.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.
- package/dist/cadre-node.d.ts +38 -15
- package/dist/cadre-node.js +77 -29
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-database.d.ts +24 -10
- package/dist/control-database.js +48 -16
- package/dist/control-database.js.map +1 -1
- package/dist/control-read-retry.d.ts +12 -0
- package/dist/control-read-retry.js +12 -0
- package/dist/control-read-retry.js.map +1 -1
- package/dist/control-write-retry.d.ts +5 -4
- package/dist/control-write-retry.js +24 -7
- package/dist/control-write-retry.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/link-budget.d.ts +182 -0
- package/dist/link-budget.js +195 -0
- package/dist/link-budget.js.map +1 -0
- package/dist/peer-dial.d.ts +36 -17
- package/dist/peer-dial.js +37 -17
- package/dist/peer-dial.js.map +1 -1
- package/dist/peer-join-backfill.d.ts +58 -4
- package/dist/peer-join-backfill.js +165 -20
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/relay-reservation.d.ts +59 -11
- package/dist/relay-reservation.js +169 -43
- package/dist/relay-reservation.js.map +1 -1
- package/dist/seed-bootstrap.js +2 -1
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/strand-first-sync-gate.d.ts +43 -5
- package/dist/strand-first-sync-gate.js +55 -7
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +27 -2
- package/dist/strand-instance-manager.js +56 -13
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-reconciler.d.ts +200 -45
- package/dist/strand-membership-reconciler.js +302 -86
- package/dist/strand-membership-reconciler.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +3 -2
- package/dist/strand-membership-writer.js +67 -90
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/strand-network-config.d.ts +2 -2
- package/dist/strand-network-config.js +2 -2
- package/dist/types.d.ts +96 -9
- package/dist/types.js +14 -4
- package/dist/types.js.map +1 -1
- package/package.json +8 -8
- package/src/cadre-node.ts +7445 -7397
- package/src/control-database.ts +48 -16
- package/src/control-read-retry.ts +214 -202
- package/src/control-write-retry.ts +24 -7
- package/src/index.ts +581 -563
- package/src/link-budget.ts +217 -0
- package/src/peer-dial.ts +39 -17
- package/src/peer-join-backfill.ts +192 -23
- package/src/relay-reservation.ts +1119 -951
- package/src/seed-bootstrap.ts +2 -1
- package/src/strand-first-sync-gate.ts +55 -7
- package/src/strand-instance-manager.ts +1516 -1458
- package/src/strand-membership-reconciler.ts +334 -92
- package/src/strand-membership-writer.ts +1962 -1987
- package/src/strand-network-config.ts +2 -2
- package/src/types.ts +95 -8
package/src/index.ts
CHANGED
|
@@ -1,563 +1,581 @@
|
|
|
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 } from './cadre-node.js';
|
|
9
|
-
|
|
10
|
-
// Control database
|
|
11
|
-
export { ControlDatabase, MissingHostStrandError, buildAuthorizationMessage, formationVouchMessage, formationConsentMessage, REAPABLE_TABLES, type ReapableTable, type ControlDatabaseConfig, type ControlTable, type RevocableTable, type FormationUsageResult, type MembershipChangeListener, type GuardedDeleteListener, type ControlWriteAbandonedListener, type RevokedRowRef } from './control-database.js';
|
|
12
|
-
|
|
13
|
-
// Bounded retry for transient control-write failures (classifier + loop behind
|
|
14
|
-
// ControlDatabase.lockedWithRetry; exported so the integration package can drive the
|
|
15
|
-
// classifier against real engine errors)
|
|
16
|
-
export {
|
|
17
|
-
CONTROL_WRITE_ATTEMPTS,
|
|
18
|
-
CONTROL_WRITE_RETRY_BUDGET_MS,
|
|
19
|
-
SCHEMA_INIT_ATTEMPTS,
|
|
20
|
-
SCHEMA_INIT_RETRY_POLICY,
|
|
21
|
-
isRetriableControlWriteFailure,
|
|
22
|
-
isRetriableSchemaInitFailure,
|
|
23
|
-
retryControlWrite,
|
|
24
|
-
type ControlWriteRetryOptions
|
|
25
|
-
} from './control-write-retry.js';
|
|
26
|
-
|
|
27
|
-
// Bounded retry for transient control-read failures (classifier + policy behind
|
|
28
|
-
// ControlDatabase.readRows; the loop is shared with the write side via control-retry.ts)
|
|
29
|
-
export {
|
|
30
|
-
CONTROL_READ_ATTEMPTS,
|
|
31
|
-
CONTROL_READ_RETRY_DELAYS_MS,
|
|
32
|
-
CONTROL_READ_RETRY_BUDGET_MS,
|
|
33
|
-
isRetriableControlReadFailure,
|
|
34
|
-
retryControlRead,
|
|
35
|
-
type ControlReadRetryOptions
|
|
36
|
-
} from './control-read-retry.js';
|
|
37
|
-
|
|
38
|
-
// The bounded retry loop both control policies share. Only the abandonment record leaves
|
|
39
|
-
// this package: it is the payload of the `control:write-abandoned` node event, so an
|
|
40
|
-
// embedding app can type a handler for it.
|
|
41
|
-
export type {
|
|
42
|
-
ControlRetryAbandonment,
|
|
43
|
-
ControlRetryAbandonReason,
|
|
44
|
-
ControlRetryAbandonListener
|
|
45
|
-
} from './control-retry.js';
|
|
46
|
-
|
|
47
|
-
// Control-plane authorization field vector (the domain/action tagging every signer shares)
|
|
48
|
-
export { controlAuthorizationFields, type ControlDomain, type ControlAction } from './control-authorization.js';
|
|
49
|
-
|
|
50
|
-
// Ed25519 key bridge (libp2p Ed25519 -> base64url keypair)
|
|
51
|
-
export { ed25519KeyPairFromLibp2p, ed25519PublicKeyFromPrivate, requireEd25519PublicKeyB64, type Ed25519KeyPair } from './ed25519-key.js';
|
|
52
|
-
|
|
53
|
-
// Pluggable key store (backend-agnostic identity/owner key material seam).
|
|
54
|
-
// Dependency-free: the interface, error, default slot id, and in-memory backend
|
|
55
|
-
// are safe in every (RN/browser/Node) entry graph. The Node FileKeyStore is a
|
|
56
|
-
// separate subpath module ('@serfab/cadre-core/key-store-file') so its node:fs
|
|
57
|
-
// import never lands here.
|
|
58
|
-
export {
|
|
59
|
-
InMemoryKeyStore,
|
|
60
|
-
KeyStoreAccessError,
|
|
61
|
-
DEFAULT_IDENTITY_KEY_ID,
|
|
62
|
-
type KeyStore,
|
|
63
|
-
type KeyId
|
|
64
|
-
} from './key-store.js';
|
|
65
|
-
|
|
66
|
-
// The KeyStore-backed identity rule, shared with embedding apps that need the
|
|
67
|
-
// node key BEFORE `CadreNode` exists (RN resolves it to sign its ICE-manifest
|
|
68
|
-
// request), plus the generic "prove you hold this node key" signer built on it.
|
|
69
|
-
export {
|
|
70
|
-
loadOrCreateIdentityKey,
|
|
71
|
-
peerKeySigner,
|
|
72
|
-
type PeerKeySigner
|
|
73
|
-
} from './identity-key.js';
|
|
74
|
-
|
|
75
|
-
// Node-local trusted-owner anchor: the NON-replicated, per-party record of
|
|
76
|
-
// out-of-band-established owner keys (the trust anchor the replicated OwnerKey
|
|
77
|
-
// table cannot be). Cross-platform: interface + in-memory store only — the
|
|
78
|
-
// file-backed store is the Node-only subpath
|
|
79
|
-
// '@serfab/cadre-core/trusted-owner-store-file' (same isolation as
|
|
80
|
-
// key-store-file) so node:fs never lands in this graph.
|
|
81
|
-
export {
|
|
82
|
-
MemoryTrustedOwnerStore,
|
|
83
|
-
PersistentTrustedOwnerStore,
|
|
84
|
-
type TrustedOwnerStore,
|
|
85
|
-
type TrustSource
|
|
86
|
-
} from './trusted-owner-store.js';
|
|
87
|
-
|
|
88
|
-
// The one platform-specific piece of a persistent node-local store: a single
|
|
89
|
-
// durable text slot the embedding app supplies (IndexedDB / SecureStore /
|
|
90
|
-
// SQLite / a file). Everything else — envelope, load policy, snapshot write
|
|
91
|
-
// chain — is cross-platform in node-local-snapshot.ts.
|
|
92
|
-
export type { DurableSlot } from './node-local-snapshot.js';
|
|
93
|
-
|
|
94
|
-
// Node-local cold-start bootstrap-peer store: the dial targets retained from an
|
|
95
|
-
// applied seed so a node that could not connect on its first try keeps retrying
|
|
96
|
-
// across restarts. Same cross-platform split as the trusted-owner anchor above —
|
|
97
|
-
// interface + in-memory store here, Node-only file backend behind the subpath
|
|
98
|
-
// '@serfab/cadre-core/bootstrap-peer-store-file'.
|
|
99
|
-
export {
|
|
100
|
-
MemoryBootstrapPeerStore,
|
|
101
|
-
PersistentBootstrapPeerStore,
|
|
102
|
-
type BootstrapPeerStore,
|
|
103
|
-
type BootstrapPeerEntry
|
|
104
|
-
} from './bootstrap-peer-store.js';
|
|
105
|
-
|
|
106
|
-
// Node-local enrolled-machine count: the machines this party had enrolled the
|
|
107
|
-
// last time this node looked, remembered across restarts so the CONTROL node can
|
|
108
|
-
// declare a block-repair yardstick at bring-up — which is before the database
|
|
109
|
-
// holding the membership rows exists. Same cross-platform split as the two
|
|
110
|
-
// records above; Node-only file backend behind the subpath
|
|
111
|
-
// '@serfab/cadre-core/enrolled-machine-store-file'. Its load policy deliberately
|
|
112
|
-
// DIVERGES from theirs (an unreadable slot cold-starts rather than throwing) —
|
|
113
|
-
// see the module comment before unifying the three.
|
|
114
|
-
export {
|
|
115
|
-
MemoryEnrolledMachineStore,
|
|
116
|
-
PersistentEnrolledMachineStore,
|
|
117
|
-
type EnrolledMachineStore
|
|
118
|
-
} from './enrolled-machine-store.js';
|
|
119
|
-
|
|
120
|
-
// Storage scope keys — what `CadreNodeConfig.storage.provider` is called with. A
|
|
121
|
-
// strand's key is its strand id; the control database's key carries the party id,
|
|
122
|
-
// so two parties on one device never share a control store. Every key stays within
|
|
123
|
-
// `[A-Za-z0-9._-]`: the control key by base64url encoding, a strand's by
|
|
124
|
-
// `assertStrandScopeKey`, which every strand launch runs.
|
|
125
|
-
export {
|
|
126
|
-
controlStorageScope,
|
|
127
|
-
isControlStorageScope,
|
|
128
|
-
isValidStrandScopeKey,
|
|
129
|
-
assertStrandScopeKey,
|
|
130
|
-
InvalidStrandIdError
|
|
131
|
-
} from './storage-scope.js';
|
|
132
|
-
|
|
133
|
-
// Strand database
|
|
134
|
-
export { StrandDatabase, type StrandDatabaseConfig } from './strand-database.js';
|
|
135
|
-
|
|
136
|
-
// Strand management
|
|
137
|
-
export {
|
|
138
|
-
StrandWatcher,
|
|
139
|
-
type StrandWatcherCallbacks,
|
|
140
|
-
type StrandQueryable,
|
|
141
|
-
type SAppIdLookup,
|
|
142
|
-
type StrandRowWithApp
|
|
143
|
-
} from './strand-watcher.js';
|
|
144
|
-
export {
|
|
145
|
-
StrandInstanceManager,
|
|
146
|
-
type StartStrandConfig,
|
|
147
|
-
type ResumeStrandOverrides,
|
|
148
|
-
getStrandStoragePath,
|
|
149
|
-
isAwaitingFirstSync,
|
|
150
|
-
liveStrandStatus
|
|
151
|
-
} from './strand-instance-manager.js';
|
|
152
|
-
|
|
153
|
-
// The joining machine's first-sync write gate: a non-founder launch withholds its
|
|
154
|
-
// database (status 'syncing') until the strand's Header has arrived from a peer, so a
|
|
155
|
-
// write before the first sync can never fork the strand's tables.
|
|
156
|
-
export {
|
|
157
|
-
StrandAwaitingFirstSyncError,
|
|
158
|
-
DEFAULT_STRAND_FIRST_SYNC_TIMEOUT_MS,
|
|
159
|
-
DEFAULT_STRAND_FIRST_SYNC_POLL_MS,
|
|
160
|
-
strandHeaderHeld,
|
|
161
|
-
appTablesReadable,
|
|
162
|
-
strandFirstSyncComplete,
|
|
163
|
-
type StrandFirstSyncConfig
|
|
164
|
-
} from './strand-first-sync-gate.js';
|
|
165
|
-
|
|
166
|
-
// Peer-join block catch-up (push this network's own blocks to each newly
|
|
167
|
-
// connected peer, so a late joiner physically holds pre-join blocks). Shared
|
|
168
|
-
// by the strand networks (ungated) and the control network (membership-gated).
|
|
169
|
-
export {
|
|
170
|
-
PeerJoinBackfill,
|
|
171
|
-
DEFAULT_PEER_JOIN_BACKFILL,
|
|
172
|
-
MAX_BLOCK_MESSAGE_BYTES,
|
|
173
|
-
|
|
174
|
-
type
|
|
175
|
-
type
|
|
176
|
-
type
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
//
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
type
|
|
190
|
-
type
|
|
191
|
-
type
|
|
192
|
-
type
|
|
193
|
-
type
|
|
194
|
-
type
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
//
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
type
|
|
207
|
-
type
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
//
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
type
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
type
|
|
240
|
-
type
|
|
241
|
-
type
|
|
242
|
-
type
|
|
243
|
-
type
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
//
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
type
|
|
255
|
-
type
|
|
256
|
-
type
|
|
257
|
-
type
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
//
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
//
|
|
269
|
-
// manager
|
|
270
|
-
//
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
type
|
|
300
|
-
type
|
|
301
|
-
type
|
|
302
|
-
type
|
|
303
|
-
type
|
|
304
|
-
type
|
|
305
|
-
type
|
|
306
|
-
type
|
|
307
|
-
type
|
|
308
|
-
type
|
|
309
|
-
type
|
|
310
|
-
type
|
|
311
|
-
type
|
|
312
|
-
type
|
|
313
|
-
type
|
|
314
|
-
type
|
|
315
|
-
type
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
//
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
//
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
type
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
type
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
//
|
|
366
|
-
export
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
type
|
|
372
|
-
type
|
|
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
|
-
//
|
|
402
|
-
//
|
|
403
|
-
//
|
|
404
|
-
//
|
|
405
|
-
//
|
|
406
|
-
//
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
//
|
|
411
|
-
//
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
//
|
|
416
|
-
//
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
type
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
//
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
type
|
|
433
|
-
|
|
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
|
-
} from './
|
|
465
|
-
|
|
466
|
-
//
|
|
467
|
-
export {
|
|
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
|
-
type
|
|
494
|
-
type
|
|
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
|
-
} from './
|
|
550
|
-
|
|
551
|
-
//
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
type
|
|
563
|
-
|
|
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 } from './cadre-node.js';
|
|
9
|
+
|
|
10
|
+
// Control database
|
|
11
|
+
export { ControlDatabase, MissingHostStrandError, buildAuthorizationMessage, formationVouchMessage, formationConsentMessage, REAPABLE_TABLES, type ReapableTable, type ControlDatabaseConfig, type ControlTable, type RevocableTable, type FormationUsageResult, type MembershipChangeListener, type GuardedDeleteListener, type ControlWriteAbandonedListener, type RevokedRowRef } from './control-database.js';
|
|
12
|
+
|
|
13
|
+
// Bounded retry for transient control-write failures (classifier + loop behind
|
|
14
|
+
// ControlDatabase.lockedWithRetry; exported so the integration package can drive the
|
|
15
|
+
// classifier against real engine errors)
|
|
16
|
+
export {
|
|
17
|
+
CONTROL_WRITE_ATTEMPTS,
|
|
18
|
+
CONTROL_WRITE_RETRY_BUDGET_MS,
|
|
19
|
+
SCHEMA_INIT_ATTEMPTS,
|
|
20
|
+
SCHEMA_INIT_RETRY_POLICY,
|
|
21
|
+
isRetriableControlWriteFailure,
|
|
22
|
+
isRetriableSchemaInitFailure,
|
|
23
|
+
retryControlWrite,
|
|
24
|
+
type ControlWriteRetryOptions
|
|
25
|
+
} from './control-write-retry.js';
|
|
26
|
+
|
|
27
|
+
// Bounded retry for transient control-read failures (classifier + policy behind
|
|
28
|
+
// ControlDatabase.readRows; the loop is shared with the write side via control-retry.ts)
|
|
29
|
+
export {
|
|
30
|
+
CONTROL_READ_ATTEMPTS,
|
|
31
|
+
CONTROL_READ_RETRY_DELAYS_MS,
|
|
32
|
+
CONTROL_READ_RETRY_BUDGET_MS,
|
|
33
|
+
isRetriableControlReadFailure,
|
|
34
|
+
retryControlRead,
|
|
35
|
+
type ControlReadRetryOptions
|
|
36
|
+
} from './control-read-retry.js';
|
|
37
|
+
|
|
38
|
+
// The bounded retry loop both control policies share. Only the abandonment record leaves
|
|
39
|
+
// this package: it is the payload of the `control:write-abandoned` node event, so an
|
|
40
|
+
// embedding app can type a handler for it.
|
|
41
|
+
export type {
|
|
42
|
+
ControlRetryAbandonment,
|
|
43
|
+
ControlRetryAbandonReason,
|
|
44
|
+
ControlRetryAbandonListener
|
|
45
|
+
} from './control-retry.js';
|
|
46
|
+
|
|
47
|
+
// Control-plane authorization field vector (the domain/action tagging every signer shares)
|
|
48
|
+
export { controlAuthorizationFields, type ControlDomain, type ControlAction } from './control-authorization.js';
|
|
49
|
+
|
|
50
|
+
// Ed25519 key bridge (libp2p Ed25519 -> base64url keypair)
|
|
51
|
+
export { ed25519KeyPairFromLibp2p, ed25519PublicKeyFromPrivate, requireEd25519PublicKeyB64, type Ed25519KeyPair } from './ed25519-key.js';
|
|
52
|
+
|
|
53
|
+
// Pluggable key store (backend-agnostic identity/owner key material seam).
|
|
54
|
+
// Dependency-free: the interface, error, default slot id, and in-memory backend
|
|
55
|
+
// are safe in every (RN/browser/Node) entry graph. The Node FileKeyStore is a
|
|
56
|
+
// separate subpath module ('@serfab/cadre-core/key-store-file') so its node:fs
|
|
57
|
+
// import never lands here.
|
|
58
|
+
export {
|
|
59
|
+
InMemoryKeyStore,
|
|
60
|
+
KeyStoreAccessError,
|
|
61
|
+
DEFAULT_IDENTITY_KEY_ID,
|
|
62
|
+
type KeyStore,
|
|
63
|
+
type KeyId
|
|
64
|
+
} from './key-store.js';
|
|
65
|
+
|
|
66
|
+
// The KeyStore-backed identity rule, shared with embedding apps that need the
|
|
67
|
+
// node key BEFORE `CadreNode` exists (RN resolves it to sign its ICE-manifest
|
|
68
|
+
// request), plus the generic "prove you hold this node key" signer built on it.
|
|
69
|
+
export {
|
|
70
|
+
loadOrCreateIdentityKey,
|
|
71
|
+
peerKeySigner,
|
|
72
|
+
type PeerKeySigner
|
|
73
|
+
} from './identity-key.js';
|
|
74
|
+
|
|
75
|
+
// Node-local trusted-owner anchor: the NON-replicated, per-party record of
|
|
76
|
+
// out-of-band-established owner keys (the trust anchor the replicated OwnerKey
|
|
77
|
+
// table cannot be). Cross-platform: interface + in-memory store only — the
|
|
78
|
+
// file-backed store is the Node-only subpath
|
|
79
|
+
// '@serfab/cadre-core/trusted-owner-store-file' (same isolation as
|
|
80
|
+
// key-store-file) so node:fs never lands in this graph.
|
|
81
|
+
export {
|
|
82
|
+
MemoryTrustedOwnerStore,
|
|
83
|
+
PersistentTrustedOwnerStore,
|
|
84
|
+
type TrustedOwnerStore,
|
|
85
|
+
type TrustSource
|
|
86
|
+
} from './trusted-owner-store.js';
|
|
87
|
+
|
|
88
|
+
// The one platform-specific piece of a persistent node-local store: a single
|
|
89
|
+
// durable text slot the embedding app supplies (IndexedDB / SecureStore /
|
|
90
|
+
// SQLite / a file). Everything else — envelope, load policy, snapshot write
|
|
91
|
+
// chain — is cross-platform in node-local-snapshot.ts.
|
|
92
|
+
export type { DurableSlot } from './node-local-snapshot.js';
|
|
93
|
+
|
|
94
|
+
// Node-local cold-start bootstrap-peer store: the dial targets retained from an
|
|
95
|
+
// applied seed so a node that could not connect on its first try keeps retrying
|
|
96
|
+
// across restarts. Same cross-platform split as the trusted-owner anchor above —
|
|
97
|
+
// interface + in-memory store here, Node-only file backend behind the subpath
|
|
98
|
+
// '@serfab/cadre-core/bootstrap-peer-store-file'.
|
|
99
|
+
export {
|
|
100
|
+
MemoryBootstrapPeerStore,
|
|
101
|
+
PersistentBootstrapPeerStore,
|
|
102
|
+
type BootstrapPeerStore,
|
|
103
|
+
type BootstrapPeerEntry
|
|
104
|
+
} from './bootstrap-peer-store.js';
|
|
105
|
+
|
|
106
|
+
// Node-local enrolled-machine count: the machines this party had enrolled the
|
|
107
|
+
// last time this node looked, remembered across restarts so the CONTROL node can
|
|
108
|
+
// declare a block-repair yardstick at bring-up — which is before the database
|
|
109
|
+
// holding the membership rows exists. Same cross-platform split as the two
|
|
110
|
+
// records above; Node-only file backend behind the subpath
|
|
111
|
+
// '@serfab/cadre-core/enrolled-machine-store-file'. Its load policy deliberately
|
|
112
|
+
// DIVERGES from theirs (an unreadable slot cold-starts rather than throwing) —
|
|
113
|
+
// see the module comment before unifying the three.
|
|
114
|
+
export {
|
|
115
|
+
MemoryEnrolledMachineStore,
|
|
116
|
+
PersistentEnrolledMachineStore,
|
|
117
|
+
type EnrolledMachineStore
|
|
118
|
+
} from './enrolled-machine-store.js';
|
|
119
|
+
|
|
120
|
+
// Storage scope keys — what `CadreNodeConfig.storage.provider` is called with. A
|
|
121
|
+
// strand's key is its strand id; the control database's key carries the party id,
|
|
122
|
+
// so two parties on one device never share a control store. Every key stays within
|
|
123
|
+
// `[A-Za-z0-9._-]`: the control key by base64url encoding, a strand's by
|
|
124
|
+
// `assertStrandScopeKey`, which every strand launch runs.
|
|
125
|
+
export {
|
|
126
|
+
controlStorageScope,
|
|
127
|
+
isControlStorageScope,
|
|
128
|
+
isValidStrandScopeKey,
|
|
129
|
+
assertStrandScopeKey,
|
|
130
|
+
InvalidStrandIdError
|
|
131
|
+
} from './storage-scope.js';
|
|
132
|
+
|
|
133
|
+
// Strand database
|
|
134
|
+
export { StrandDatabase, type StrandDatabaseConfig } from './strand-database.js';
|
|
135
|
+
|
|
136
|
+
// Strand management
|
|
137
|
+
export {
|
|
138
|
+
StrandWatcher,
|
|
139
|
+
type StrandWatcherCallbacks,
|
|
140
|
+
type StrandQueryable,
|
|
141
|
+
type SAppIdLookup,
|
|
142
|
+
type StrandRowWithApp
|
|
143
|
+
} from './strand-watcher.js';
|
|
144
|
+
export {
|
|
145
|
+
StrandInstanceManager,
|
|
146
|
+
type StartStrandConfig,
|
|
147
|
+
type ResumeStrandOverrides,
|
|
148
|
+
getStrandStoragePath,
|
|
149
|
+
isAwaitingFirstSync,
|
|
150
|
+
liveStrandStatus
|
|
151
|
+
} from './strand-instance-manager.js';
|
|
152
|
+
|
|
153
|
+
// The joining machine's first-sync write gate: a non-founder launch withholds its
|
|
154
|
+
// database (status 'syncing') until the strand's Header has arrived from a peer, so a
|
|
155
|
+
// write before the first sync can never fork the strand's tables.
|
|
156
|
+
export {
|
|
157
|
+
StrandAwaitingFirstSyncError,
|
|
158
|
+
DEFAULT_STRAND_FIRST_SYNC_TIMEOUT_MS,
|
|
159
|
+
DEFAULT_STRAND_FIRST_SYNC_POLL_MS,
|
|
160
|
+
strandHeaderHeld,
|
|
161
|
+
appTablesReadable,
|
|
162
|
+
strandFirstSyncComplete,
|
|
163
|
+
type StrandFirstSyncConfig
|
|
164
|
+
} from './strand-first-sync-gate.js';
|
|
165
|
+
|
|
166
|
+
// Peer-join block catch-up (push this network's own blocks to each newly
|
|
167
|
+
// connected peer, so a late joiner physically holds pre-join blocks). Shared
|
|
168
|
+
// by the strand networks (ungated) and the control network (membership-gated).
|
|
169
|
+
export {
|
|
170
|
+
PeerJoinBackfill,
|
|
171
|
+
DEFAULT_PEER_JOIN_BACKFILL,
|
|
172
|
+
MAX_BLOCK_MESSAGE_BYTES,
|
|
173
|
+
PEER_JOIN_BACKFILL_WARN_AFTER_FAILURES,
|
|
174
|
+
type PeerJoinBackfillConfig,
|
|
175
|
+
type PeerJoinBackfillDeps,
|
|
176
|
+
type PeerJoinBackfillResult,
|
|
177
|
+
type PeerJoinBackfillPushClient
|
|
178
|
+
} from './peer-join-backfill.js';
|
|
179
|
+
|
|
180
|
+
// Closed-strand revoked-peer enforcement (deny the network nodes of removed
|
|
181
|
+
// members at the stream and connection layers, and hang up the sessions they
|
|
182
|
+
// already hold — see the module doc for the settled deny-list design, the
|
|
183
|
+
// teardown seam, and the fail directions).
|
|
184
|
+
export {
|
|
185
|
+
StrandRevocationEnforcer,
|
|
186
|
+
createRevocationConnectionGater,
|
|
187
|
+
readStrandRevocationRows,
|
|
188
|
+
DEFAULT_REVOCATION_POLL_INTERVAL_MS,
|
|
189
|
+
type StrandRevocationEnforcementConfig,
|
|
190
|
+
type StrandRevocationEnforcerDeps,
|
|
191
|
+
type StrandRevocationRows,
|
|
192
|
+
type StrandMemberPeerBinding,
|
|
193
|
+
type StrandRevocationJudge,
|
|
194
|
+
type StrandRevocationNetwork,
|
|
195
|
+
type RevocationRefreshScheduler
|
|
196
|
+
} from './strand-revocation-enforcer.js';
|
|
197
|
+
|
|
198
|
+
// Closed-strand membership reconciliation: the bring-up loop that finishes a
|
|
199
|
+
// party's join on every machine — redeem the staged formation invitation, then
|
|
200
|
+
// write the durable machine→party MemberPeer binding — without ever blocking
|
|
201
|
+
// bring-up (see the module doc for the pass ladder and terminal states).
|
|
202
|
+
export {
|
|
203
|
+
StrandMembershipReconciler,
|
|
204
|
+
IDLE_PASSES_BEFORE_ESCALATION,
|
|
205
|
+
INITIAL_JOIN_RETRY_INTERVAL_MS,
|
|
206
|
+
type StrandMembershipReconcilerDeps,
|
|
207
|
+
type StrandMembershipReconciliationConfig,
|
|
208
|
+
type PendingMembershipInviteSource
|
|
209
|
+
} from './strand-membership-reconciler.js';
|
|
210
|
+
|
|
211
|
+
// The timer seam the self-rescheduling strand bring-up loops share (first-sync gate
|
|
212
|
+
// probe loop, membership retry ladder) — injected by tests as a hand-cranked clock.
|
|
213
|
+
export { defaultTimeoutScheduler, type TimeoutScheduler } from './timeout-scheduler.js';
|
|
214
|
+
|
|
215
|
+
// Hibernation
|
|
216
|
+
export {
|
|
217
|
+
HibernationManager,
|
|
218
|
+
type HibernationCallbacks
|
|
219
|
+
} from './hibernation-manager.js';
|
|
220
|
+
|
|
221
|
+
// Arachnode (stub)
|
|
222
|
+
export {
|
|
223
|
+
ArachnodeStub,
|
|
224
|
+
createArachnodeStub,
|
|
225
|
+
type RingConfig
|
|
226
|
+
} from './arachnode-stub.js';
|
|
227
|
+
|
|
228
|
+
// Enrollment
|
|
229
|
+
export {
|
|
230
|
+
EnrollmentService,
|
|
231
|
+
type MemberVerifier,
|
|
232
|
+
type MemberRegistry
|
|
233
|
+
} from './enrollment.js';
|
|
234
|
+
|
|
235
|
+
// Strand Solicitation
|
|
236
|
+
export {
|
|
237
|
+
StrandSolicitationService,
|
|
238
|
+
createDefaultFormationResponseValidator,
|
|
239
|
+
type DisclosureValidator,
|
|
240
|
+
type FormationUsageRecorder,
|
|
241
|
+
type ResolvedHostStrand,
|
|
242
|
+
type StrandProvisioner,
|
|
243
|
+
type FormationResponseValidator,
|
|
244
|
+
type StrandSolicitationServiceOptions
|
|
245
|
+
} from './strand-solicitation.js';
|
|
246
|
+
|
|
247
|
+
// Formation approval client: asks an invite's ValidationUrl hook whether ONE redemption
|
|
248
|
+
// may proceed, and checks the answer against the bytes the control database will verify.
|
|
249
|
+
export {
|
|
250
|
+
createHttpFormationApprover,
|
|
251
|
+
signFormationApproval,
|
|
252
|
+
verifyFormationApproval,
|
|
253
|
+
FormationApprovalError,
|
|
254
|
+
type FormationApprovalRequest,
|
|
255
|
+
type FormationVouchFields,
|
|
256
|
+
type FormationApproval,
|
|
257
|
+
type FormationApprover,
|
|
258
|
+
type FormationApprovalFailure
|
|
259
|
+
} from './formation-approval.js';
|
|
260
|
+
|
|
261
|
+
// DB-backed FormationUsageRecorder (reads/writes the real CadreControl tables)
|
|
262
|
+
export { ControlFormationUsageRecorder } from './control-formation-recorder.js';
|
|
263
|
+
|
|
264
|
+
// Closed-strand member key generation (ed25519 protobuf, base64) + the
|
|
265
|
+
// protobuf->base64url bridge that derives the founding Member/Manager key.
|
|
266
|
+
export { generateStrandMemberKey, strandMemberKeyPair } from './strand-member-key.js';
|
|
267
|
+
|
|
268
|
+
// Strand membership writer (founder bootstrap, invite issuance/consumption,
|
|
269
|
+
// manager-admit, member-peer registration, manager rotation, sealing — the sole
|
|
270
|
+
// manager permanently freezing admission — + shared signing primitives reused
|
|
271
|
+
// across the flows).
|
|
272
|
+
export {
|
|
273
|
+
signStrandPayload,
|
|
274
|
+
verifyStrandPayload,
|
|
275
|
+
signStrandApproval,
|
|
276
|
+
generateStrandStampId,
|
|
277
|
+
bootstrapFounderMembership,
|
|
278
|
+
PreSplitStrandIdentityError,
|
|
279
|
+
issueInvite,
|
|
280
|
+
consumeInvite,
|
|
281
|
+
burnInvite,
|
|
282
|
+
isStrandMember,
|
|
283
|
+
cancelInvite,
|
|
284
|
+
listOutstandingInvites,
|
|
285
|
+
addMemberByManager,
|
|
286
|
+
revokeMember,
|
|
287
|
+
leaveStrand,
|
|
288
|
+
registerMemberPeer,
|
|
289
|
+
listMemberPeers,
|
|
290
|
+
removeMemberPeer,
|
|
291
|
+
addManager,
|
|
292
|
+
admitManager,
|
|
293
|
+
removeManager,
|
|
294
|
+
sealStrand,
|
|
295
|
+
isStrandSealed,
|
|
296
|
+
StrandTransactionBusyError,
|
|
297
|
+
STRAND_ENGINE,
|
|
298
|
+
STRAND_ENGINE_VERSION,
|
|
299
|
+
type FounderBootstrapParams,
|
|
300
|
+
type IssueInviteParams,
|
|
301
|
+
type IssuedInvite,
|
|
302
|
+
type ConsumeInviteParams,
|
|
303
|
+
type CancelInviteParams,
|
|
304
|
+
type OutstandingInvite,
|
|
305
|
+
type AddMemberByManagerParams,
|
|
306
|
+
type RevokeMemberParams,
|
|
307
|
+
type LeaveStrandParams,
|
|
308
|
+
type RegisterMemberPeerParams,
|
|
309
|
+
type RemoveOwnPeerParams,
|
|
310
|
+
type RemoveMemberPeerByManagerParams,
|
|
311
|
+
type RemoveMemberPeerParams,
|
|
312
|
+
type AddManagerParams,
|
|
313
|
+
type AdmitManagerParams,
|
|
314
|
+
type RemoveManagerParams,
|
|
315
|
+
type SealStrandParams,
|
|
316
|
+
type StrandWriteOptions
|
|
317
|
+
} from './strand-membership-writer.js';
|
|
318
|
+
|
|
319
|
+
// Engine-canonical datetime helper (shared by control + strand signed-write flows
|
|
320
|
+
// so a signed timestamp byte-matches the datetime-coerced column the CHECK sees).
|
|
321
|
+
export { canonicalDatetime } from './canonical-datetime.js';
|
|
322
|
+
|
|
323
|
+
// Strand-DB-backed EnrollmentService backing: concrete MemberRegistry +
|
|
324
|
+
// MemberVerifier that write/read the real Strand.* membership tables.
|
|
325
|
+
export {
|
|
326
|
+
StrandMemberRegistry,
|
|
327
|
+
StrandMemberVerifier,
|
|
328
|
+
memberRegistrationPayload,
|
|
329
|
+
type StrandAdmission
|
|
330
|
+
} from './strand-member-registry.js';
|
|
331
|
+
|
|
332
|
+
// Seed Bootstrap
|
|
333
|
+
export {
|
|
334
|
+
SeedBootstrapService,
|
|
335
|
+
SEED_PROTOCOL,
|
|
336
|
+
ed25519PublicKeyB64FromPeerId,
|
|
337
|
+
type SeedBootstrapConfig,
|
|
338
|
+
type SeedEventCallbacks
|
|
339
|
+
} from './seed-bootstrap.js';
|
|
340
|
+
|
|
341
|
+
// Peer Authorization (shared owner-signature digest + offline verifier)
|
|
342
|
+
export {
|
|
343
|
+
peerAuthorizationDigest,
|
|
344
|
+
cadrePeerVoucherDigest,
|
|
345
|
+
cadrePeerRemoveDigest,
|
|
346
|
+
deviceTokenAddDigest,
|
|
347
|
+
deviceTokenRemoveDigest,
|
|
348
|
+
formationConsentDigest,
|
|
349
|
+
verifyPeerAuthorization,
|
|
350
|
+
verifyCadrePeerVoucher,
|
|
351
|
+
verifyFormationConsent,
|
|
352
|
+
type DeviceTokenAuthorizedRow
|
|
353
|
+
} from './peer-authorization.js';
|
|
354
|
+
|
|
355
|
+
// Strand Wake (control-network push-wake protocol)
|
|
356
|
+
export {
|
|
357
|
+
StrandWakeService,
|
|
358
|
+
dialWake,
|
|
359
|
+
WAKE_PROTOCOL,
|
|
360
|
+
DEFAULT_WAKE_DIAL_BUDGET_MS,
|
|
361
|
+
type StrandWakeServiceOptions,
|
|
362
|
+
type DialWakeOptions
|
|
363
|
+
} from './strand-wake-protocol.js';
|
|
364
|
+
|
|
365
|
+
// Strand Address (control-network strand-address RPC) — wire types come via
|
|
366
|
+
// `export * from './types.js'` (StrandAddrRequest / StrandAddrResponse).
|
|
367
|
+
export {
|
|
368
|
+
StrandAddrService,
|
|
369
|
+
collectStrandAddrs,
|
|
370
|
+
STRAND_ADDR_PROTOCOL,
|
|
371
|
+
type StrandAddrServiceOptions,
|
|
372
|
+
type StrandAddrPeer,
|
|
373
|
+
type CollectStrandAddrsOptions
|
|
374
|
+
} from './strand-addr-protocol.js';
|
|
375
|
+
|
|
376
|
+
// Peer-address record (self-published, signed, freshness-stamped CadrePeer row)
|
|
377
|
+
export {
|
|
378
|
+
peerRecordSignedPayload,
|
|
379
|
+
signPeerRecord,
|
|
380
|
+
verifyPeerRecordSignature,
|
|
381
|
+
isPeerRecordFresh,
|
|
382
|
+
isSignalingAddr,
|
|
383
|
+
orderSignalingFirst,
|
|
384
|
+
withTrailingPeerId,
|
|
385
|
+
currentMemberTrustPolicy,
|
|
386
|
+
DEFAULT_PEER_RECORD_MAX_AGE_MS,
|
|
387
|
+
DEFAULT_PEER_RECORD_HEARTBEAT_MS
|
|
388
|
+
} from './peer-record.js';
|
|
389
|
+
|
|
390
|
+
// Device-token record (self-published, signed FCM/APNs push token — CadrePeer sibling)
|
|
391
|
+
export {
|
|
392
|
+
deviceTokenSignedPayload,
|
|
393
|
+
signDeviceTokenRecord,
|
|
394
|
+
verifyDeviceTokenSignature,
|
|
395
|
+
isPushPlatform
|
|
396
|
+
} from './device-token.js';
|
|
397
|
+
|
|
398
|
+
// Strand-wake payload contract (canonical; shared by the server sender + RN receiver)
|
|
399
|
+
export { STRAND_WAKE_TYPE, type StrandWakePayload } from './strand-wake-payload.js';
|
|
400
|
+
|
|
401
|
+
// Platform push delivery — the cross-platform `PushNotifier` *contract* only.
|
|
402
|
+
// The FCM/APNs implementations (node:http2/node:crypto) and the
|
|
403
|
+
// `createPushNotifier` router that builds them live behind the Node-only subpath
|
|
404
|
+
// `@serfab/cadre-core/push-node` (`push-node.ts`), never in this graph. A Node
|
|
405
|
+
// host constructs a notifier from that subpath and injects the instance into
|
|
406
|
+
// `CadreNodeConfig.push.notifier`. These re-exports are type-only (erased at
|
|
407
|
+
// emit), so the RN/browser entry graph never pulls the Node modules in.
|
|
408
|
+
export type { PushNotifier, PushMessage, PushSendResult } from './push-notifier.js';
|
|
409
|
+
|
|
410
|
+
// Push-credential validation + log redaction. Dependency-free (type-only imports),
|
|
411
|
+
// so a provisioner (cadre-host / cadre-provider) can reject a partial credential
|
|
412
|
+
// set and produce a key-safe log view without pulling the FCM/APNs sender graph.
|
|
413
|
+
export { validatePushCredentials, redactPushCredentials, REDACTED } from './push-credentials.js';
|
|
414
|
+
|
|
415
|
+
// Server-side push-wake trigger policy + fan-out (who/when to wake). Cross-platform
|
|
416
|
+
// clean — it imports only the PushNotifier *type*, so exporting it as a runtime
|
|
417
|
+
// value pulls no node:http2/node:crypto edge into the RN/browser graph.
|
|
418
|
+
export {
|
|
419
|
+
PushFanoutService,
|
|
420
|
+
DEFAULT_PUSH_COOLDOWN_MS,
|
|
421
|
+
DEFAULT_PUSH_DEBOUNCE_MS,
|
|
422
|
+
type PushFanoutOptions,
|
|
423
|
+
type FanoutMember
|
|
424
|
+
} from './push-fanout.js';
|
|
425
|
+
|
|
426
|
+
// Control-cohort dial selection (backbone-preferential, bounded out-degree) +
|
|
427
|
+
// the cadence/degree defaults the proactive reconcile routine reads.
|
|
428
|
+
export {
|
|
429
|
+
selectControlCohortDials,
|
|
430
|
+
DEFAULT_CONTROL_COHORT_RECONCILE_MS,
|
|
431
|
+
DEFAULT_CONTROL_COHORT_TARGET_DEGREE,
|
|
432
|
+
type ControlCohortSelection,
|
|
433
|
+
type ControlCohortReconcileResult
|
|
434
|
+
} from './control-cohort.js';
|
|
435
|
+
|
|
436
|
+
// Dialing one peer from several candidate addresses, each under its own time
|
|
437
|
+
// limit, so an address that never answers cannot starve the rest.
|
|
438
|
+
export {
|
|
439
|
+
dialPeerAddrs,
|
|
440
|
+
tryAddrsInTurn,
|
|
441
|
+
directBeforeRelayed,
|
|
442
|
+
DEFAULT_CONTROL_COHORT_DIAL_TIMEOUT_MS,
|
|
443
|
+
DEFAULT_CONTROL_COHORT_PER_ADDRESS_DIAL_TIMEOUT_MS,
|
|
444
|
+
CONTROL_COHORT_DIAL_ADDRESS_ATTEMPTS,
|
|
445
|
+
DEFAULT_PEER_DIAL_BUDGET,
|
|
446
|
+
type PeerDialBudget,
|
|
447
|
+
type AddrDialer
|
|
448
|
+
} from './peer-dial.js';
|
|
449
|
+
|
|
450
|
+
// Dial and reservation budgets counted in link round trips rather than fixed milliseconds, so
|
|
451
|
+
// one declared assumption about the link moves them all — see `NetworkConfig.linkRoundTripMs`.
|
|
452
|
+
export {
|
|
453
|
+
DECLARED_LINK_ROUND_TRIP_MS,
|
|
454
|
+
RELAYED_DIAL_ROUND_TRIPS,
|
|
455
|
+
RELAY_RESERVATION_ROUND_TRIPS,
|
|
456
|
+
CIRCUIT_REQUEST_ROUND_TRIPS,
|
|
457
|
+
PUSH_TRANSFER_ALLOWANCE_MS,
|
|
458
|
+
resolveLinkRoundTripMs,
|
|
459
|
+
relayedDialBudgetMs,
|
|
460
|
+
relayReservationBudgetMs,
|
|
461
|
+
circuitRequestBudgetMs,
|
|
462
|
+
peerJoinPushBudget,
|
|
463
|
+
type PeerJoinPushBudget
|
|
464
|
+
} from './link-budget.js';
|
|
465
|
+
|
|
466
|
+
// Seed trust policy (trust anchor for incoming seeds)
|
|
467
|
+
export {
|
|
468
|
+
anchoredTrustPolicy,
|
|
469
|
+
pinnedKeyTrustPolicy,
|
|
470
|
+
tofuTrustPolicy,
|
|
471
|
+
type SeedTrustPolicy,
|
|
472
|
+
type SeedTrustContext,
|
|
473
|
+
type SeedTrustDecision
|
|
474
|
+
} from './seed-trust-policy.js';
|
|
475
|
+
|
|
476
|
+
// Schema Verification
|
|
477
|
+
export {
|
|
478
|
+
signSchema,
|
|
479
|
+
verifySchema,
|
|
480
|
+
assertSchemaSignature,
|
|
481
|
+
SchemaVerificationError
|
|
482
|
+
} from './schema-verification.js';
|
|
483
|
+
|
|
484
|
+
// Strand Formation transport (native cadre-core protocol)
|
|
485
|
+
export {
|
|
486
|
+
FormationListener,
|
|
487
|
+
dialFormation,
|
|
488
|
+
isValidResponderCreatesResult,
|
|
489
|
+
isWellFormedMembershipInvite,
|
|
490
|
+
sanitizeStrandAddrs,
|
|
491
|
+
FORMATION_PROTOCOL,
|
|
492
|
+
type FormationParty,
|
|
493
|
+
type FormationContactMessage,
|
|
494
|
+
type FormationResultMessage,
|
|
495
|
+
type FormationProvisionResult,
|
|
496
|
+
type FormationStrandInfo,
|
|
497
|
+
type FormationDbConnectionInfo,
|
|
498
|
+
type FormationListenerOptions,
|
|
499
|
+
type FormationDialOptions,
|
|
500
|
+
type FormationDialResult,
|
|
501
|
+
type ResponderProvisionOutcome
|
|
502
|
+
} from './strand-formation-protocol.js';
|
|
503
|
+
|
|
504
|
+
// Strand Formation manager (drives the native transport)
|
|
505
|
+
export {
|
|
506
|
+
StrandFormationManager,
|
|
507
|
+
createStrandFormationManager,
|
|
508
|
+
MEMBERSHIP_INVITE_TTL_MS,
|
|
509
|
+
MEMBERSHIP_INVITE_UNAVAILABLE_REASON,
|
|
510
|
+
HOST_STRAND_MUST_BE_RECREATED_REASON,
|
|
511
|
+
type StrandFormationManagerConfig,
|
|
512
|
+
type StrandFormationManagerOptions
|
|
513
|
+
} from './strand-formation-manager.js';
|
|
514
|
+
|
|
515
|
+
// Control-network inbound connection gate (membership defense-in-depth)
|
|
516
|
+
export {
|
|
517
|
+
createMembershipConnectionGater,
|
|
518
|
+
STRANGER_OPEN_PROTOCOLS,
|
|
519
|
+
DEFAULT_ENROLLMENT_WINDOW_MS,
|
|
520
|
+
ADMISSION_DECISION_TIMEOUT_MS,
|
|
521
|
+
RELAY_ADMISSION_RESERVE_DEADLINE_MS,
|
|
522
|
+
RELAY_ADMISSION_CLOSE_TIMEOUT_MS,
|
|
523
|
+
MAX_UNAUTHORIZED_RELAY_RESERVATIONS,
|
|
524
|
+
UNAUTHORIZED_RESERVATION_TTL_MS,
|
|
525
|
+
UnauthorizedReservationBudget,
|
|
526
|
+
type InboundAdmissionPolicy,
|
|
527
|
+
type InboundConnectionVerdict
|
|
528
|
+
} from './membership-connection-gater.js';
|
|
529
|
+
|
|
530
|
+
// Thrown out of `CadreNode.start()` when a `network.relayAddrs` reservation does
|
|
531
|
+
// not land on its first attempt — the fail-fast posture of that config field now
|
|
532
|
+
// that the control node reserves AFTER control-database bring-up (relay-addrs.ts).
|
|
533
|
+
// `UnbindableListenAddressError` is the same posture for the OTHER half of the listen
|
|
534
|
+
// config: a `network.listenAddrs` entry whose transport the node will not have refuses
|
|
535
|
+
// start instead of being silently dropped by libp2p's transport manager.
|
|
536
|
+
//
|
|
537
|
+
// `resolveListenAddrs` and `strandNodeAddrs` are the derivations themselves — what a
|
|
538
|
+
// `NetworkConfig` actually turns into for the control node and for each strand node.
|
|
539
|
+
// Exported so an embedder that hand-writes a `network` block (the React Native and web
|
|
540
|
+
// reference apps) can assert on the resulting SHAPE rather than on its own field names,
|
|
541
|
+
// which is the difference between a test that proves reachability and one that proves a
|
|
542
|
+
// spelling.
|
|
543
|
+
export {
|
|
544
|
+
RelayReservationFailedError,
|
|
545
|
+
UnbindableListenAddressError,
|
|
546
|
+
RELAY_SEARCH_LISTEN_ADDR,
|
|
547
|
+
resolveListenAddrs
|
|
548
|
+
} from './relay-addrs.js';
|
|
549
|
+
export { strandNodeAddrs, type StrandNodeAddrs } from './strand-network-config.js';
|
|
550
|
+
|
|
551
|
+
// Relay reservation via the bare `/p2p-circuit` search listener — the one route
|
|
552
|
+
// every control node takes; `network.relayAddrs` is its fail-fast posture
|
|
553
|
+
// (see relay-reservation.ts)
|
|
554
|
+
export {
|
|
555
|
+
circuitMultiaddrs,
|
|
556
|
+
superviseRelayReservation,
|
|
557
|
+
DEFAULT_RELAY_RESERVE_TIMEOUT_MS,
|
|
558
|
+
DEFAULT_RELAY_RESERVE_POLL_MS,
|
|
559
|
+
DEFAULT_RELAY_CHECK_MS,
|
|
560
|
+
DEFAULT_RELAY_MIN_BACKOFF_MS,
|
|
561
|
+
DEFAULT_RELAY_MAX_BACKOFF_MS,
|
|
562
|
+
type RelayReservationStatus,
|
|
563
|
+
type RelayReservationState,
|
|
564
|
+
type RelayReserveOptions,
|
|
565
|
+
type RelayReservationSupervisor,
|
|
566
|
+
type RelayReservationSupervisorOptions
|
|
567
|
+
} from './relay-reservation.js';
|
|
568
|
+
|
|
569
|
+
// Connection-path diagnostics (relayed vs direct classification + summary)
|
|
570
|
+
export {
|
|
571
|
+
classifyTransport,
|
|
572
|
+
classifyConnectionPath,
|
|
573
|
+
summarizeConnectionPaths,
|
|
574
|
+
emptyConnectionPathSummary,
|
|
575
|
+
DEFAULT_SETTLE_WINDOW_MS,
|
|
576
|
+
type ConnectionPathKind,
|
|
577
|
+
type ConnectionTransport,
|
|
578
|
+
type ConnectionPath,
|
|
579
|
+
type ConnectionPathSummary,
|
|
580
|
+
type ConnectionLike
|
|
581
|
+
} from './diagnostics/connection-path.js';
|