@serfab/cadre-core 1.14.0 → 1.15.0

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