@cello-protocol/daemon 0.0.225 → 0.0.227

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 (891) hide show
  1. package/package.json +5 -5
  2. package/dist/agent-admin-handlers.d.ts +0 -56
  3. package/dist/agent-admin-handlers.d.ts.map +0 -1
  4. package/dist/agent-admin-handlers.js +0 -73
  5. package/dist/agent-admin-handlers.js.map +0 -1
  6. package/dist/agent-handlers.d.ts +0 -72
  7. package/dist/agent-handlers.d.ts.map +0 -1
  8. package/dist/agent-handlers.js +0 -604
  9. package/dist/agent-handlers.js.map +0 -1
  10. package/dist/agent-id-migration.d.ts +0 -70
  11. package/dist/agent-id-migration.d.ts.map +0 -1
  12. package/dist/agent-id-migration.js +0 -468
  13. package/dist/agent-id-migration.js.map +0 -1
  14. package/dist/agent-loader.d.ts +0 -37
  15. package/dist/agent-loader.d.ts.map +0 -1
  16. package/dist/agent-loader.js +0 -37
  17. package/dist/agent-loader.js.map +0 -1
  18. package/dist/agent-selection-root.d.ts +0 -29
  19. package/dist/agent-selection-root.d.ts.map +0 -1
  20. package/dist/agent-selection-root.js +0 -126
  21. package/dist/agent-selection-root.js.map +0 -1
  22. package/dist/agent-selection.d.ts +0 -73
  23. package/dist/agent-selection.d.ts.map +0 -1
  24. package/dist/agent-selection.js +0 -80
  25. package/dist/agent-selection.js.map +0 -1
  26. package/dist/agent-settings-keys.d.ts +0 -52
  27. package/dist/agent-settings-keys.d.ts.map +0 -1
  28. package/dist/agent-settings-keys.js +0 -114
  29. package/dist/agent-settings-keys.js.map +0 -1
  30. package/dist/agent-state.d.ts +0 -67
  31. package/dist/agent-state.d.ts.map +0 -1
  32. package/dist/agent-state.js +0 -66
  33. package/dist/agent-state.js.map +0 -1
  34. package/dist/assignment-verify.d.ts +0 -90
  35. package/dist/assignment-verify.d.ts.map +0 -1
  36. package/dist/assignment-verify.js +0 -301
  37. package/dist/assignment-verify.js.map +0 -1
  38. package/dist/attendance-wiring.d.ts +0 -23
  39. package/dist/attendance-wiring.d.ts.map +0 -1
  40. package/dist/attendance-wiring.js +0 -248
  41. package/dist/attendance-wiring.js.map +0 -1
  42. package/dist/attestation-body.d.ts +0 -47
  43. package/dist/attestation-body.d.ts.map +0 -1
  44. package/dist/attestation-body.js +0 -71
  45. package/dist/attestation-body.js.map +0 -1
  46. package/dist/authorship-verification.d.ts +0 -91
  47. package/dist/authorship-verification.d.ts.map +0 -1
  48. package/dist/authorship-verification.js +0 -532
  49. package/dist/authorship-verification.js.map +0 -1
  50. package/dist/away-detection.d.ts +0 -139
  51. package/dist/away-detection.d.ts.map +0 -1
  52. package/dist/away-detection.js +0 -186
  53. package/dist/away-detection.js.map +0 -1
  54. package/dist/away-inbox-oneshot.d.ts +0 -40
  55. package/dist/away-inbox-oneshot.d.ts.map +0 -1
  56. package/dist/away-inbox-oneshot.js +0 -311
  57. package/dist/away-inbox-oneshot.js.map +0 -1
  58. package/dist/backup-restore-handlers.d.ts +0 -10
  59. package/dist/backup-restore-handlers.d.ts.map +0 -1
  60. package/dist/backup-restore-handlers.js +0 -82
  61. package/dist/backup-restore-handlers.js.map +0 -1
  62. package/dist/backup-restore.d.ts +0 -102
  63. package/dist/backup-restore.d.ts.map +0 -1
  64. package/dist/backup-restore.js +0 -341
  65. package/dist/backup-restore.js.map +0 -1
  66. package/dist/bin/cello-daemon.d.ts +0 -13
  67. package/dist/bin/cello-daemon.d.ts.map +0 -1
  68. package/dist/bin/cello-daemon.js.map +0 -1
  69. package/dist/boot-agents.d.ts +0 -64
  70. package/dist/boot-agents.d.ts.map +0 -1
  71. package/dist/boot-agents.js +0 -241
  72. package/dist/boot-agents.js.map +0 -1
  73. package/dist/boot-connection-state.d.ts +0 -38
  74. package/dist/boot-connection-state.d.ts.map +0 -1
  75. package/dist/boot-connection-state.js +0 -95
  76. package/dist/boot-connection-state.js.map +0 -1
  77. package/dist/boot-core.d.ts +0 -36
  78. package/dist/boot-core.d.ts.map +0 -1
  79. package/dist/boot-core.js +0 -293
  80. package/dist/boot-core.js.map +0 -1
  81. package/dist/boot-parked-content.d.ts +0 -34
  82. package/dist/boot-parked-content.d.ts.map +0 -1
  83. package/dist/boot-parked-content.js +0 -528
  84. package/dist/boot-parked-content.js.map +0 -1
  85. package/dist/boot-sweeps.d.ts +0 -22
  86. package/dist/boot-sweeps.d.ts.map +0 -1
  87. package/dist/boot-sweeps.js +0 -51
  88. package/dist/boot-sweeps.js.map +0 -1
  89. package/dist/bundled-consortium-manifest.d.ts +0 -47
  90. package/dist/bundled-consortium-manifest.d.ts.map +0 -1
  91. package/dist/bundled-consortium-manifest.js +0 -116
  92. package/dist/bundled-consortium-manifest.js.map +0 -1
  93. package/dist/cbor-blob-migration.d.ts +0 -8
  94. package/dist/cbor-blob-migration.d.ts.map +0 -1
  95. package/dist/cbor-blob-migration.js +0 -116
  96. package/dist/cbor-blob-migration.js.map +0 -1
  97. package/dist/challenge-verifier.d.ts +0 -12
  98. package/dist/challenge-verifier.d.ts.map +0 -1
  99. package/dist/challenge-verifier.js +0 -11
  100. package/dist/challenge-verifier.js.map +0 -1
  101. package/dist/close-commitment.d.ts +0 -67
  102. package/dist/close-commitment.d.ts.map +0 -1
  103. package/dist/close-commitment.js +0 -78
  104. package/dist/close-commitment.js.map +0 -1
  105. package/dist/close-session-handler.d.ts +0 -94
  106. package/dist/close-session-handler.d.ts.map +0 -1
  107. package/dist/close-session-handler.js +0 -1418
  108. package/dist/close-session-handler.js.map +0 -1
  109. package/dist/co-attendance.d.ts +0 -29
  110. package/dist/co-attendance.d.ts.map +0 -1
  111. package/dist/co-attendance.js +0 -32
  112. package/dist/co-attendance.js.map +0 -1
  113. package/dist/column-birth.d.ts +0 -40
  114. package/dist/column-birth.d.ts.map +0 -1
  115. package/dist/column-birth.js +0 -61
  116. package/dist/column-birth.js.map +0 -1
  117. package/dist/connect-or-start.d.ts +0 -25
  118. package/dist/connect-or-start.d.ts.map +0 -1
  119. package/dist/connect-or-start.js +0 -175
  120. package/dist/connect-or-start.js.map +0 -1
  121. package/dist/connection-agents.d.ts +0 -16
  122. package/dist/connection-agents.d.ts.map +0 -1
  123. package/dist/connection-agents.js +0 -68
  124. package/dist/connection-agents.js.map +0 -1
  125. package/dist/consent-migration.d.ts +0 -49
  126. package/dist/consent-migration.d.ts.map +0 -1
  127. package/dist/consent-migration.js +0 -128
  128. package/dist/consent-migration.js.map +0 -1
  129. package/dist/consortium-bootstrap.d.ts +0 -138
  130. package/dist/consortium-bootstrap.d.ts.map +0 -1
  131. package/dist/consortium-bootstrap.js +0 -339
  132. package/dist/consortium-bootstrap.js.map +0 -1
  133. package/dist/consortium-fingerprint.d.ts +0 -115
  134. package/dist/consortium-fingerprint.d.ts.map +0 -1
  135. package/dist/consortium-fingerprint.js +0 -175
  136. package/dist/consortium-fingerprint.js.map +0 -1
  137. package/dist/contact-handlers.d.ts +0 -59
  138. package/dist/contact-handlers.d.ts.map +0 -1
  139. package/dist/contact-handlers.js +0 -343
  140. package/dist/contact-handlers.js.map +0 -1
  141. package/dist/contact-pubkey-case.d.ts +0 -65
  142. package/dist/contact-pubkey-case.d.ts.map +0 -1
  143. package/dist/contact-pubkey-case.js +0 -136
  144. package/dist/contact-pubkey-case.js.map +0 -1
  145. package/dist/contacts-tier-migration.d.ts +0 -90
  146. package/dist/contacts-tier-migration.d.ts.map +0 -1
  147. package/dist/contacts-tier-migration.js +0 -150
  148. package/dist/contacts-tier-migration.js.map +0 -1
  149. package/dist/content-encryption-status.d.ts +0 -111
  150. package/dist/content-encryption-status.d.ts.map +0 -1
  151. package/dist/content-encryption-status.js +0 -158
  152. package/dist/content-encryption-status.js.map +0 -1
  153. package/dist/content-park-client.d.ts +0 -90
  154. package/dist/content-park-client.d.ts.map +0 -1
  155. package/dist/content-park-client.js +0 -362
  156. package/dist/content-park-client.js.map +0 -1
  157. package/dist/content-park.d.ts +0 -52
  158. package/dist/content-park.d.ts.map +0 -1
  159. package/dist/content-park.js +0 -1309
  160. package/dist/content-park.js.map +0 -1
  161. package/dist/cross-node-negotiation.d.ts +0 -44
  162. package/dist/cross-node-negotiation.d.ts.map +0 -1
  163. package/dist/cross-node-negotiation.js +0 -34
  164. package/dist/cross-node-negotiation.js.map +0 -1
  165. package/dist/daemon-handle.d.ts +0 -57
  166. package/dist/daemon-handle.d.ts.map +0 -1
  167. package/dist/daemon-handle.js +0 -2
  168. package/dist/daemon-handle.js.map +0 -1
  169. package/dist/daemon-status-report.d.ts +0 -50
  170. package/dist/daemon-status-report.d.ts.map +0 -1
  171. package/dist/daemon-status-report.js +0 -81
  172. package/dist/daemon-status-report.js.map +0 -1
  173. package/dist/daemon.d.ts +0 -45
  174. package/dist/daemon.d.ts.map +0 -1
  175. package/dist/daemon.js +0 -1177
  176. package/dist/daemon.js.map +0 -1
  177. package/dist/db-identity-store.d.ts +0 -159
  178. package/dist/db-identity-store.d.ts.map +0 -1
  179. package/dist/db-identity-store.js +0 -502
  180. package/dist/db-identity-store.js.map +0 -1
  181. package/dist/delivery-open-registry.d.ts +0 -92
  182. package/dist/delivery-open-registry.d.ts.map +0 -1
  183. package/dist/delivery-open-registry.js +0 -121
  184. package/dist/delivery-open-registry.js.map +0 -1
  185. package/dist/delivery-session-suspects.d.ts +0 -56
  186. package/dist/delivery-session-suspects.d.ts.map +0 -1
  187. package/dist/delivery-session-suspects.js +0 -94
  188. package/dist/delivery-session-suspects.js.map +0 -1
  189. package/dist/directory-auth-posture.d.ts +0 -87
  190. package/dist/directory-auth-posture.d.ts.map +0 -1
  191. package/dist/directory-auth-posture.js +0 -134
  192. package/dist/directory-auth-posture.js.map +0 -1
  193. package/dist/directory-bootstrap.d.ts +0 -310
  194. package/dist/directory-bootstrap.d.ts.map +0 -1
  195. package/dist/directory-bootstrap.js +0 -557
  196. package/dist/directory-bootstrap.js.map +0 -1
  197. package/dist/directory-connect.d.ts +0 -27
  198. package/dist/directory-connect.d.ts.map +0 -1
  199. package/dist/directory-connect.js +0 -106
  200. package/dist/directory-connect.js.map +0 -1
  201. package/dist/disconnect-cleanup.d.ts +0 -51
  202. package/dist/disconnect-cleanup.d.ts.map +0 -1
  203. package/dist/disconnect-cleanup.js +0 -72
  204. package/dist/disconnect-cleanup.js.map +0 -1
  205. package/dist/document-amendment-store.d.ts +0 -120
  206. package/dist/document-amendment-store.d.ts.map +0 -1
  207. package/dist/document-amendment-store.js +0 -266
  208. package/dist/document-amendment-store.js.map +0 -1
  209. package/dist/document-delivery-transport.d.ts +0 -168
  210. package/dist/document-delivery-transport.d.ts.map +0 -1
  211. package/dist/document-delivery-transport.js +0 -206
  212. package/dist/document-delivery-transport.js.map +0 -1
  213. package/dist/document-engine.d.ts +0 -134
  214. package/dist/document-engine.d.ts.map +0 -1
  215. package/dist/document-engine.js +0 -282
  216. package/dist/document-engine.js.map +0 -1
  217. package/dist/document-flag.d.ts +0 -58
  218. package/dist/document-flag.d.ts.map +0 -1
  219. package/dist/document-flag.js +0 -70
  220. package/dist/document-flag.js.map +0 -1
  221. package/dist/document-frame-router.d.ts +0 -245
  222. package/dist/document-frame-router.d.ts.map +0 -1
  223. package/dist/document-frame-router.js +0 -397
  224. package/dist/document-frame-router.js.map +0 -1
  225. package/dist/document-gate-wiring.d.ts +0 -61
  226. package/dist/document-gate-wiring.d.ts.map +0 -1
  227. package/dist/document-gate-wiring.js +0 -125
  228. package/dist/document-gate-wiring.js.map +0 -1
  229. package/dist/document-gate.d.ts +0 -149
  230. package/dist/document-gate.d.ts.map +0 -1
  231. package/dist/document-gate.js +0 -509
  232. package/dist/document-gate.js.map +0 -1
  233. package/dist/document-handlers.d.ts +0 -47
  234. package/dist/document-handlers.d.ts.map +0 -1
  235. package/dist/document-handlers.js +0 -2203
  236. package/dist/document-handlers.js.map +0 -1
  237. package/dist/document-handshake.d.ts +0 -176
  238. package/dist/document-handshake.d.ts.map +0 -1
  239. package/dist/document-handshake.js +0 -452
  240. package/dist/document-handshake.js.map +0 -1
  241. package/dist/document-inbound.d.ts +0 -162
  242. package/dist/document-inbound.d.ts.map +0 -1
  243. package/dist/document-inbound.js +0 -530
  244. package/dist/document-inbound.js.map +0 -1
  245. package/dist/document-json.d.ts +0 -120
  246. package/dist/document-json.d.ts.map +0 -1
  247. package/dist/document-json.js +0 -191
  248. package/dist/document-json.js.map +0 -1
  249. package/dist/document-layer.d.ts +0 -215
  250. package/dist/document-layer.d.ts.map +0 -1
  251. package/dist/document-layer.js +0 -1025
  252. package/dist/document-layer.js.map +0 -1
  253. package/dist/document-lifecycle.d.ts +0 -52
  254. package/dist/document-lifecycle.d.ts.map +0 -1
  255. package/dist/document-lifecycle.js +0 -134
  256. package/dist/document-lifecycle.js.map +0 -1
  257. package/dist/document-live-docs.d.ts +0 -58
  258. package/dist/document-live-docs.d.ts.map +0 -1
  259. package/dist/document-live-docs.js +0 -126
  260. package/dist/document-live-docs.js.map +0 -1
  261. package/dist/document-notify.d.ts +0 -228
  262. package/dist/document-notify.d.ts.map +0 -1
  263. package/dist/document-notify.js +0 -580
  264. package/dist/document-notify.js.map +0 -1
  265. package/dist/document-profile.d.ts +0 -61
  266. package/dist/document-profile.d.ts.map +0 -1
  267. package/dist/document-profile.js +0 -112
  268. package/dist/document-profile.js.map +0 -1
  269. package/dist/document-publish.d.ts +0 -87
  270. package/dist/document-publish.d.ts.map +0 -1
  271. package/dist/document-publish.js +0 -173
  272. package/dist/document-publish.js.map +0 -1
  273. package/dist/document-reachability.d.ts +0 -42
  274. package/dist/document-reachability.d.ts.map +0 -1
  275. package/dist/document-reachability.js +0 -80
  276. package/dist/document-reachability.js.map +0 -1
  277. package/dist/document-reconcile-engine.d.ts +0 -66
  278. package/dist/document-reconcile-engine.d.ts.map +0 -1
  279. package/dist/document-reconcile-engine.js +0 -225
  280. package/dist/document-reconcile-engine.js.map +0 -1
  281. package/dist/document-reconcile-scheduler.d.ts +0 -163
  282. package/dist/document-reconcile-scheduler.d.ts.map +0 -1
  283. package/dist/document-reconcile-scheduler.js +0 -303
  284. package/dist/document-reconcile-scheduler.js.map +0 -1
  285. package/dist/document-rejection.d.ts +0 -251
  286. package/dist/document-rejection.d.ts.map +0 -1
  287. package/dist/document-rejection.js +0 -435
  288. package/dist/document-rejection.js.map +0 -1
  289. package/dist/document-screen.d.ts +0 -114
  290. package/dist/document-screen.d.ts.map +0 -1
  291. package/dist/document-screen.js +0 -223
  292. package/dist/document-screen.js.map +0 -1
  293. package/dist/document-store.d.ts +0 -372
  294. package/dist/document-store.d.ts.map +0 -1
  295. package/dist/document-store.js +0 -931
  296. package/dist/document-store.js.map +0 -1
  297. package/dist/document-surface.d.ts +0 -32
  298. package/dist/document-surface.d.ts.map +0 -1
  299. package/dist/document-surface.js +0 -151
  300. package/dist/document-surface.js.map +0 -1
  301. package/dist/document-types.d.ts +0 -94
  302. package/dist/document-types.d.ts.map +0 -1
  303. package/dist/document-types.js +0 -90
  304. package/dist/document-types.js.map +0 -1
  305. package/dist/document-watch.d.ts +0 -69
  306. package/dist/document-watch.d.ts.map +0 -1
  307. package/dist/document-watch.js +0 -108
  308. package/dist/document-watch.js.map +0 -1
  309. package/dist/document-wiring.d.ts +0 -53
  310. package/dist/document-wiring.d.ts.map +0 -1
  311. package/dist/document-wiring.js +0 -323
  312. package/dist/document-wiring.js.map +0 -1
  313. package/dist/document-write-guard.d.ts +0 -66
  314. package/dist/document-write-guard.d.ts.map +0 -1
  315. package/dist/document-write-guard.js +0 -98
  316. package/dist/document-write-guard.js.map +0 -1
  317. package/dist/document-write-path.d.ts +0 -94
  318. package/dist/document-write-path.d.ts.map +0 -1
  319. package/dist/document-write-path.js +0 -530
  320. package/dist/document-write-path.js.map +0 -1
  321. package/dist/error-message.d.ts +0 -7
  322. package/dist/error-message.d.ts.map +0 -1
  323. package/dist/error-message.js +0 -19
  324. package/dist/error-message.js.map +0 -1
  325. package/dist/file-manifest-provider.d.ts +0 -37
  326. package/dist/file-manifest-provider.d.ts.map +0 -1
  327. package/dist/file-manifest-provider.js +0 -105
  328. package/dist/file-manifest-provider.js.map +0 -1
  329. package/dist/frame-values.d.ts +0 -3
  330. package/dist/frame-values.d.ts.map +0 -1
  331. package/dist/frame-values.js +0 -84
  332. package/dist/frame-values.js.map +0 -1
  333. package/dist/frontier-mismatch.d.ts +0 -73
  334. package/dist/frontier-mismatch.d.ts.map +0 -1
  335. package/dist/frontier-mismatch.js +0 -89
  336. package/dist/frontier-mismatch.js.map +0 -1
  337. package/dist/gateway-config-handlers.d.ts +0 -26
  338. package/dist/gateway-config-handlers.d.ts.map +0 -1
  339. package/dist/gateway-config-handlers.js +0 -429
  340. package/dist/gateway-config-handlers.js.map +0 -1
  341. package/dist/held-content.d.ts +0 -145
  342. package/dist/held-content.d.ts.map +0 -1
  343. package/dist/held-content.js +0 -389
  344. package/dist/held-content.js.map +0 -1
  345. package/dist/http-manifest-poll.d.ts +0 -67
  346. package/dist/http-manifest-poll.d.ts.map +0 -1
  347. package/dist/http-manifest-poll.js +0 -150
  348. package/dist/http-manifest-poll.js.map +0 -1
  349. package/dist/identity-migration.d.ts +0 -40
  350. package/dist/identity-migration.d.ts.map +0 -1
  351. package/dist/identity-migration.js +0 -461
  352. package/dist/identity-migration.js.map +0 -1
  353. package/dist/inbound-refusals.d.ts +0 -283
  354. package/dist/inbound-refusals.d.ts.map +0 -1
  355. package/dist/inbound-refusals.js +0 -919
  356. package/dist/inbound-refusals.js.map +0 -1
  357. package/dist/inbound-seal-request.d.ts +0 -32
  358. package/dist/inbound-seal-request.d.ts.map +0 -1
  359. package/dist/inbound-seal-request.js +0 -228
  360. package/dist/inbound-seal-request.js.map +0 -1
  361. package/dist/inbound-sessions.d.ts +0 -291
  362. package/dist/inbound-sessions.d.ts.map +0 -1
  363. package/dist/inbound-sessions.js +0 -1609
  364. package/dist/inbound-sessions.js.map +0 -1
  365. package/dist/inclusion-proof-handlers.d.ts +0 -43
  366. package/dist/inclusion-proof-handlers.d.ts.map +0 -1
  367. package/dist/inclusion-proof-handlers.js +0 -565
  368. package/dist/inclusion-proof-handlers.js.map +0 -1
  369. package/dist/inclusion-proof.d.ts +0 -151
  370. package/dist/inclusion-proof.d.ts.map +0 -1
  371. package/dist/inclusion-proof.js +0 -228
  372. package/dist/inclusion-proof.js.map +0 -1
  373. package/dist/index.d.ts +0 -32
  374. package/dist/index.d.ts.map +0 -1
  375. package/dist/index.js.map +0 -1
  376. package/dist/initiate-session-handler.d.ts +0 -55
  377. package/dist/initiate-session-handler.d.ts.map +0 -1
  378. package/dist/initiate-session-handler.js +0 -310
  379. package/dist/initiate-session-handler.js.map +0 -1
  380. package/dist/ipc-client.d.ts +0 -31
  381. package/dist/ipc-client.d.ts.map +0 -1
  382. package/dist/ipc-client.js +0 -113
  383. package/dist/ipc-client.js.map +0 -1
  384. package/dist/ipc-server.d.ts +0 -63
  385. package/dist/ipc-server.d.ts.map +0 -1
  386. package/dist/ipc-server.js +0 -429
  387. package/dist/ipc-server.js.map +0 -1
  388. package/dist/ipc-surface.d.ts +0 -44
  389. package/dist/ipc-surface.d.ts.map +0 -1
  390. package/dist/ipc-surface.js +0 -107
  391. package/dist/ipc-surface.js.map +0 -1
  392. package/dist/line-lcs.d.ts +0 -51
  393. package/dist/line-lcs.d.ts.map +0 -1
  394. package/dist/line-lcs.js +0 -71
  395. package/dist/line-lcs.js.map +0 -1
  396. package/dist/lock-file.d.ts +0 -39
  397. package/dist/lock-file.d.ts.map +0 -1
  398. package/dist/lock-file.js +0 -120
  399. package/dist/lock-file.js.map +0 -1
  400. package/dist/log-collapse.d.ts +0 -66
  401. package/dist/log-collapse.d.ts.map +0 -1
  402. package/dist/log-collapse.js +0 -244
  403. package/dist/log-collapse.js.map +0 -1
  404. package/dist/log-rotate.d.ts +0 -67
  405. package/dist/log-rotate.d.ts.map +0 -1
  406. package/dist/log-rotate.js +0 -134
  407. package/dist/log-rotate.js.map +0 -1
  408. package/dist/manifest-deps.d.ts +0 -25
  409. package/dist/manifest-deps.d.ts.map +0 -1
  410. package/dist/manifest-deps.js +0 -151
  411. package/dist/manifest-deps.js.map +0 -1
  412. package/dist/manifest-poll-scheduler.d.ts +0 -31
  413. package/dist/manifest-poll-scheduler.d.ts.map +0 -1
  414. package/dist/manifest-poll-scheduler.js +0 -59
  415. package/dist/manifest-poll-scheduler.js.map +0 -1
  416. package/dist/manifest-validity.d.ts +0 -153
  417. package/dist/manifest-validity.d.ts.map +0 -1
  418. package/dist/manifest-validity.js +0 -268
  419. package/dist/manifest-validity.js.map +0 -1
  420. package/dist/manifest-version-store-db.d.ts +0 -24
  421. package/dist/manifest-version-store-db.d.ts.map +0 -1
  422. package/dist/manifest-version-store-db.js +0 -58
  423. package/dist/manifest-version-store-db.js.map +0 -1
  424. package/dist/manifest-version-store.d.ts +0 -16
  425. package/dist/manifest-version-store.d.ts.map +0 -1
  426. package/dist/manifest-version-store.js +0 -15
  427. package/dist/manifest-version-store.js.map +0 -1
  428. package/dist/network-directory-node.d.ts +0 -136
  429. package/dist/network-directory-node.d.ts.map +0 -1
  430. package/dist/network-directory-node.js +0 -810
  431. package/dist/network-directory-node.js.map +0 -1
  432. package/dist/nonce-dedup.d.ts +0 -68
  433. package/dist/nonce-dedup.d.ts.map +0 -1
  434. package/dist/nonce-dedup.js +0 -205
  435. package/dist/nonce-dedup.js.map +0 -1
  436. package/dist/notification-dispatcher.d.ts +0 -92
  437. package/dist/notification-dispatcher.d.ts.map +0 -1
  438. package/dist/notification-dispatcher.js +0 -210
  439. package/dist/notification-dispatcher.js.map +0 -1
  440. package/dist/notification-handlers.d.ts +0 -53
  441. package/dist/notification-handlers.d.ts.map +0 -1
  442. package/dist/notification-handlers.js +0 -461
  443. package/dist/notification-handlers.js.map +0 -1
  444. package/dist/onboarding-guidance.d.ts +0 -79
  445. package/dist/onboarding-guidance.d.ts.map +0 -1
  446. package/dist/onboarding-guidance.js +0 -95
  447. package/dist/onboarding-guidance.js.map +0 -1
  448. package/dist/operator-guidance.d.ts +0 -25
  449. package/dist/operator-guidance.d.ts.map +0 -1
  450. package/dist/operator-guidance.js +0 -50
  451. package/dist/operator-guidance.js.map +0 -1
  452. package/dist/orphan-triage.d.ts +0 -130
  453. package/dist/orphan-triage.d.ts.map +0 -1
  454. package/dist/orphan-triage.js +0 -207
  455. package/dist/orphan-triage.js.map +0 -1
  456. package/dist/outbound-sessions.d.ts +0 -126
  457. package/dist/outbound-sessions.d.ts.map +0 -1
  458. package/dist/outbound-sessions.js +0 -1052
  459. package/dist/outbound-sessions.js.map +0 -1
  460. package/dist/park-envelope.d.ts +0 -329
  461. package/dist/park-envelope.d.ts.map +0 -1
  462. package/dist/park-envelope.js +0 -509
  463. package/dist/park-envelope.js.map +0 -1
  464. package/dist/park-recovery.d.ts +0 -273
  465. package/dist/park-recovery.d.ts.map +0 -1
  466. package/dist/park-recovery.js +0 -717
  467. package/dist/park-recovery.js.map +0 -1
  468. package/dist/park-refusals.d.ts +0 -147
  469. package/dist/park-refusals.d.ts.map +0 -1
  470. package/dist/park-refusals.js +0 -331
  471. package/dist/park-refusals.js.map +0 -1
  472. package/dist/quarantine-framing.d.ts +0 -92
  473. package/dist/quarantine-framing.d.ts.map +0 -1
  474. package/dist/quarantine-framing.js +0 -111
  475. package/dist/quarantine-framing.js.map +0 -1
  476. package/dist/reconnect-drain.d.ts +0 -22
  477. package/dist/reconnect-drain.d.ts.map +0 -1
  478. package/dist/reconnect-drain.js +0 -65
  479. package/dist/reconnect-drain.js.map +0 -1
  480. package/dist/recovered-position.d.ts +0 -14
  481. package/dist/recovered-position.d.ts.map +0 -1
  482. package/dist/recovered-position.js +0 -59
  483. package/dist/recovered-position.js.map +0 -1
  484. package/dist/refusal-notices.d.ts +0 -196
  485. package/dist/refusal-notices.d.ts.map +0 -1
  486. package/dist/refusal-notices.js +0 -516
  487. package/dist/refusal-notices.js.map +0 -1
  488. package/dist/refusal-reasons.d.ts +0 -245
  489. package/dist/refusal-reasons.d.ts.map +0 -1
  490. package/dist/refusal-reasons.js +0 -363
  491. package/dist/refusal-reasons.js.map +0 -1
  492. package/dist/register-handler.d.ts +0 -36
  493. package/dist/register-handler.d.ts.map +0 -1
  494. package/dist/register-handler.js +0 -285
  495. package/dist/register-handler.js.map +0 -1
  496. package/dist/registration-context.d.ts +0 -72
  497. package/dist/registration-context.d.ts.map +0 -1
  498. package/dist/registration-context.js +0 -126
  499. package/dist/registration-context.js.map +0 -1
  500. package/dist/registration-manager.d.ts +0 -94
  501. package/dist/registration-manager.d.ts.map +0 -1
  502. package/dist/registration-manager.js +0 -585
  503. package/dist/registration-manager.js.map +0 -1
  504. package/dist/registration-persistence.d.ts +0 -183
  505. package/dist/registration-persistence.d.ts.map +0 -1
  506. package/dist/registration-persistence.js +0 -263
  507. package/dist/registration-persistence.js.map +0 -1
  508. package/dist/registry-poll.d.ts +0 -52
  509. package/dist/registry-poll.d.ts.map +0 -1
  510. package/dist/registry-poll.js +0 -140
  511. package/dist/registry-poll.js.map +0 -1
  512. package/dist/registry-version-store-db.d.ts +0 -22
  513. package/dist/registry-version-store-db.d.ts.map +0 -1
  514. package/dist/registry-version-store-db.js +0 -50
  515. package/dist/registry-version-store-db.js.map +0 -1
  516. package/dist/relay-endpoints.d.ts +0 -18
  517. package/dist/relay-endpoints.d.ts.map +0 -1
  518. package/dist/relay-endpoints.js +0 -9
  519. package/dist/relay-endpoints.js.map +0 -1
  520. package/dist/relay-only.d.ts +0 -140
  521. package/dist/relay-only.d.ts.map +0 -1
  522. package/dist/relay-only.js +0 -193
  523. package/dist/relay-only.js.map +0 -1
  524. package/dist/relay-receipt-store.d.ts +0 -155
  525. package/dist/relay-receipt-store.d.ts.map +0 -1
  526. package/dist/relay-receipt-store.js +0 -284
  527. package/dist/relay-receipt-store.js.map +0 -1
  528. package/dist/relay-reconnect.d.ts +0 -32
  529. package/dist/relay-reconnect.d.ts.map +0 -1
  530. package/dist/relay-reconnect.js +0 -29
  531. package/dist/relay-reconnect.js.map +0 -1
  532. package/dist/reply-lag.d.ts +0 -11
  533. package/dist/reply-lag.d.ts.map +0 -1
  534. package/dist/reply-lag.js +0 -46
  535. package/dist/reply-lag.js.map +0 -1
  536. package/dist/resolve-named-agent.d.ts +0 -49
  537. package/dist/resolve-named-agent.d.ts.map +0 -1
  538. package/dist/resolve-named-agent.js +0 -77
  539. package/dist/resolve-named-agent.js.map +0 -1
  540. package/dist/restart-seal-resolver.d.ts +0 -110
  541. package/dist/restart-seal-resolver.d.ts.map +0 -1
  542. package/dist/restart-seal-resolver.js +0 -353
  543. package/dist/restart-seal-resolver.js.map +0 -1
  544. package/dist/resume-last-seen.d.ts +0 -15
  545. package/dist/resume-last-seen.d.ts.map +0 -1
  546. package/dist/resume-last-seen.js +0 -44
  547. package/dist/resume-last-seen.js.map +0 -1
  548. package/dist/retry-queue.d.ts +0 -203
  549. package/dist/retry-queue.d.ts.map +0 -1
  550. package/dist/retry-queue.js +0 -701
  551. package/dist/retry-queue.js.map +0 -1
  552. package/dist/roster-freshness.d.ts +0 -160
  553. package/dist/roster-freshness.d.ts.map +0 -1
  554. package/dist/roster-freshness.js +0 -250
  555. package/dist/roster-freshness.js.map +0 -1
  556. package/dist/screening-status.d.ts +0 -15
  557. package/dist/screening-status.d.ts.map +0 -1
  558. package/dist/screening-status.js +0 -65
  559. package/dist/screening-status.js.map +0 -1
  560. package/dist/seal-carried-close.d.ts +0 -37
  561. package/dist/seal-carried-close.d.ts.map +0 -1
  562. package/dist/seal-carried-close.js +0 -179
  563. package/dist/seal-carried-close.js.map +0 -1
  564. package/dist/seal-certificate-pull.d.ts +0 -79
  565. package/dist/seal-certificate-pull.d.ts.map +0 -1
  566. package/dist/seal-certificate-pull.js +0 -186
  567. package/dist/seal-certificate-pull.js.map +0 -1
  568. package/dist/seal-certified-root-check.d.ts +0 -37
  569. package/dist/seal-certified-root-check.d.ts.map +0 -1
  570. package/dist/seal-certified-root-check.js +0 -127
  571. package/dist/seal-certified-root-check.js.map +0 -1
  572. package/dist/seal-coordinator.d.ts +0 -118
  573. package/dist/seal-coordinator.d.ts.map +0 -1
  574. package/dist/seal-coordinator.js +0 -927
  575. package/dist/seal-coordinator.js.map +0 -1
  576. package/dist/seal-escalation.d.ts +0 -80
  577. package/dist/seal-escalation.d.ts.map +0 -1
  578. package/dist/seal-escalation.js +0 -283
  579. package/dist/seal-escalation.js.map +0 -1
  580. package/dist/seal-evidence-root-check.d.ts +0 -70
  581. package/dist/seal-evidence-root-check.d.ts.map +0 -1
  582. package/dist/seal-evidence-root-check.js +0 -199
  583. package/dist/seal-evidence-root-check.js.map +0 -1
  584. package/dist/seal-failure-store.d.ts +0 -129
  585. package/dist/seal-failure-store.d.ts.map +0 -1
  586. package/dist/seal-failure-store.js +0 -173
  587. package/dist/seal-failure-store.js.map +0 -1
  588. package/dist/seal-flows.d.ts +0 -107
  589. package/dist/seal-flows.d.ts.map +0 -1
  590. package/dist/seal-flows.js +0 -638
  591. package/dist/seal-flows.js.map +0 -1
  592. package/dist/seal-frontier-verify.d.ts +0 -103
  593. package/dist/seal-frontier-verify.d.ts.map +0 -1
  594. package/dist/seal-frontier-verify.js +0 -143
  595. package/dist/seal-frontier-verify.js.map +0 -1
  596. package/dist/seal-leaf.d.ts +0 -58
  597. package/dist/seal-leaf.d.ts.map +0 -1
  598. package/dist/seal-leaf.js +0 -112
  599. package/dist/seal-leaf.js.map +0 -1
  600. package/dist/seal-legibility-tbs.d.ts +0 -25
  601. package/dist/seal-legibility-tbs.d.ts.map +0 -1
  602. package/dist/seal-legibility-tbs.js +0 -77
  603. package/dist/seal-legibility-tbs.js.map +0 -1
  604. package/dist/seal-local-terminus.d.ts +0 -41
  605. package/dist/seal-local-terminus.d.ts.map +0 -1
  606. package/dist/seal-local-terminus.js +0 -170
  607. package/dist/seal-local-terminus.js.map +0 -1
  608. package/dist/seal-receipt-upgrade.d.ts +0 -30
  609. package/dist/seal-receipt-upgrade.d.ts.map +0 -1
  610. package/dist/seal-receipt-upgrade.js +0 -49
  611. package/dist/seal-receipt-upgrade.js.map +0 -1
  612. package/dist/seal-relay-silence.d.ts +0 -51
  613. package/dist/seal-relay-silence.d.ts.map +0 -1
  614. package/dist/seal-relay-silence.js +0 -76
  615. package/dist/seal-relay-silence.js.map +0 -1
  616. package/dist/seal-settle.d.ts +0 -38
  617. package/dist/seal-settle.d.ts.map +0 -1
  618. package/dist/seal-settle.js +0 -33
  619. package/dist/seal-settle.js.map +0 -1
  620. package/dist/seal-upgrade.d.ts +0 -107
  621. package/dist/seal-upgrade.d.ts.map +0 -1
  622. package/dist/seal-upgrade.js +0 -200
  623. package/dist/seal-upgrade.js.map +0 -1
  624. package/dist/sealed-conversation.d.ts +0 -36
  625. package/dist/sealed-conversation.d.ts.map +0 -1
  626. package/dist/sealed-conversation.js +0 -171
  627. package/dist/sealed-conversation.js.map +0 -1
  628. package/dist/sealed-leaf-set.d.ts +0 -92
  629. package/dist/sealed-leaf-set.d.ts.map +0 -1
  630. package/dist/sealed-leaf-set.js +0 -122
  631. package/dist/sealed-leaf-set.js.map +0 -1
  632. package/dist/send-claims.d.ts +0 -56
  633. package/dist/send-claims.d.ts.map +0 -1
  634. package/dist/send-claims.js +0 -50
  635. package/dist/send-claims.js.map +0 -1
  636. package/dist/session-assignment-parser.d.ts +0 -98
  637. package/dist/session-assignment-parser.d.ts.map +0 -1
  638. package/dist/session-assignment-parser.js +0 -325
  639. package/dist/session-assignment-parser.js.map +0 -1
  640. package/dist/session-category.d.ts +0 -19
  641. package/dist/session-category.d.ts.map +0 -1
  642. package/dist/session-category.js +0 -14
  643. package/dist/session-category.js.map +0 -1
  644. package/dist/session-ceremony.d.ts +0 -297
  645. package/dist/session-ceremony.d.ts.map +0 -1
  646. package/dist/session-ceremony.js +0 -964
  647. package/dist/session-ceremony.js.map +0 -1
  648. package/dist/session-closed.d.ts +0 -79
  649. package/dist/session-closed.d.ts.map +0 -1
  650. package/dist/session-closed.js +0 -189
  651. package/dist/session-closed.js.map +0 -1
  652. package/dist/session-connection-gater.d.ts +0 -148
  653. package/dist/session-connection-gater.d.ts.map +0 -1
  654. package/dist/session-connection-gater.js +0 -332
  655. package/dist/session-connection-gater.js.map +0 -1
  656. package/dist/session-content-context.d.ts +0 -162
  657. package/dist/session-content-context.d.ts.map +0 -1
  658. package/dist/session-content-context.js +0 -2
  659. package/dist/session-content-context.js.map +0 -1
  660. package/dist/session-content-handlers.d.ts +0 -82
  661. package/dist/session-content-handlers.d.ts.map +0 -1
  662. package/dist/session-content-handlers.js +0 -1382
  663. package/dist/session-content-handlers.js.map +0 -1
  664. package/dist/session-content-ingest.d.ts +0 -206
  665. package/dist/session-content-ingest.d.ts.map +0 -1
  666. package/dist/session-content-ingest.js +0 -2167
  667. package/dist/session-content-ingest.js.map +0 -1
  668. package/dist/session-content-send.d.ts +0 -191
  669. package/dist/session-content-send.d.ts.map +0 -1
  670. package/dist/session-content-send.js +0 -1360
  671. package/dist/session-content-send.js.map +0 -1
  672. package/dist/session-delivery-acks.d.ts +0 -169
  673. package/dist/session-delivery-acks.d.ts.map +0 -1
  674. package/dist/session-delivery-acks.js +0 -569
  675. package/dist/session-delivery-acks.js.map +0 -1
  676. package/dist/session-ephemerals.d.ts +0 -279
  677. package/dist/session-ephemerals.d.ts.map +0 -1
  678. package/dist/session-ephemerals.js +0 -591
  679. package/dist/session-ephemerals.js.map +0 -1
  680. package/dist/session-leaf-records.d.ts +0 -159
  681. package/dist/session-leaf-records.d.ts.map +0 -1
  682. package/dist/session-leaf-records.js +0 -408
  683. package/dist/session-leaf-records.js.map +0 -1
  684. package/dist/session-lifecycle.d.ts +0 -303
  685. package/dist/session-lifecycle.d.ts.map +0 -1
  686. package/dist/session-lifecycle.js +0 -1679
  687. package/dist/session-lifecycle.js.map +0 -1
  688. package/dist/session-liveness.d.ts +0 -135
  689. package/dist/session-liveness.d.ts.map +0 -1
  690. package/dist/session-liveness.js +0 -347
  691. package/dist/session-liveness.js.map +0 -1
  692. package/dist/session-name.d.ts +0 -35
  693. package/dist/session-name.d.ts.map +0 -1
  694. package/dist/session-name.js +0 -60
  695. package/dist/session-name.js.map +0 -1
  696. package/dist/session-node-factory.d.ts +0 -18
  697. package/dist/session-node-factory.d.ts.map +0 -1
  698. package/dist/session-node-factory.js +0 -182
  699. package/dist/session-node-factory.js.map +0 -1
  700. package/dist/session-node-manager.d.ts +0 -875
  701. package/dist/session-node-manager.d.ts.map +0 -1
  702. package/dist/session-node-manager.js +0 -2995
  703. package/dist/session-node-manager.js.map +0 -1
  704. package/dist/session-node-types.d.ts +0 -1057
  705. package/dist/session-node-types.d.ts.map +0 -1
  706. package/dist/session-node-types.js +0 -657
  707. package/dist/session-node-types.js.map +0 -1
  708. package/dist/session-notify.d.ts +0 -46
  709. package/dist/session-notify.d.ts.map +0 -1
  710. package/dist/session-notify.js +0 -116
  711. package/dist/session-notify.js.map +0 -1
  712. package/dist/session-own-chain-store.d.ts +0 -65
  713. package/dist/session-own-chain-store.d.ts.map +0 -1
  714. package/dist/session-own-chain-store.js +0 -75
  715. package/dist/session-own-chain-store.js.map +0 -1
  716. package/dist/session-queries.d.ts +0 -476
  717. package/dist/session-queries.d.ts.map +0 -1
  718. package/dist/session-queries.js +0 -1007
  719. package/dist/session-queries.js.map +0 -1
  720. package/dist/session-read-handlers.d.ts +0 -87
  721. package/dist/session-read-handlers.d.ts.map +0 -1
  722. package/dist/session-read-handlers.js +0 -682
  723. package/dist/session-read-handlers.js.map +0 -1
  724. package/dist/session-records.d.ts +0 -341
  725. package/dist/session-records.d.ts.map +0 -1
  726. package/dist/session-records.js +0 -858
  727. package/dist/session-records.js.map +0 -1
  728. package/dist/session-relay-client.d.ts +0 -659
  729. package/dist/session-relay-client.d.ts.map +0 -1
  730. package/dist/session-relay-client.js +0 -2876
  731. package/dist/session-relay-client.js.map +0 -1
  732. package/dist/session-relay.d.ts +0 -397
  733. package/dist/session-relay.d.ts.map +0 -1
  734. package/dist/session-relay.js +0 -1636
  735. package/dist/session-relay.js.map +0 -1
  736. package/dist/session-salt-agreement.d.ts +0 -331
  737. package/dist/session-salt-agreement.d.ts.map +0 -1
  738. package/dist/session-salt-agreement.js +0 -472
  739. package/dist/session-salt-agreement.js.map +0 -1
  740. package/dist/session-salts.d.ts +0 -432
  741. package/dist/session-salts.d.ts.map +0 -1
  742. package/dist/session-salts.js +0 -1540
  743. package/dist/session-salts.js.map +0 -1
  744. package/dist/session-schema.d.ts +0 -30
  745. package/dist/session-schema.d.ts.map +0 -1
  746. package/dist/session-schema.js +0 -877
  747. package/dist/session-schema.js.map +0 -1
  748. package/dist/session-seal-leaf-store.d.ts +0 -70
  749. package/dist/session-seal-leaf-store.d.ts.map +0 -1
  750. package/dist/session-seal-leaf-store.js +0 -105
  751. package/dist/session-seal-leaf-store.js.map +0 -1
  752. package/dist/session-seal.d.ts +0 -334
  753. package/dist/session-seal.d.ts.map +0 -1
  754. package/dist/session-seal.js +0 -1017
  755. package/dist/session-seal.js.map +0 -1
  756. package/dist/session-terminal-refusal.d.ts +0 -65
  757. package/dist/session-terminal-refusal.d.ts.map +0 -1
  758. package/dist/session-terminal-refusal.js +0 -87
  759. package/dist/session-terminal-refusal.js.map +0 -1
  760. package/dist/session-tree.d.ts +0 -110
  761. package/dist/session-tree.d.ts.map +0 -1
  762. package/dist/session-tree.js +0 -144
  763. package/dist/session-tree.js.map +0 -1
  764. package/dist/session-views.d.ts +0 -47
  765. package/dist/session-views.d.ts.map +0 -1
  766. package/dist/session-views.js +0 -278
  767. package/dist/session-views.js.map +0 -1
  768. package/dist/signal-handlers.d.ts +0 -63
  769. package/dist/signal-handlers.d.ts.map +0 -1
  770. package/dist/signal-handlers.js +0 -980
  771. package/dist/signal-handlers.js.map +0 -1
  772. package/dist/signal-requirement-policy.d.ts +0 -51
  773. package/dist/signal-requirement-policy.d.ts.map +0 -1
  774. package/dist/signal-requirement-policy.js +0 -89
  775. package/dist/signal-requirement-policy.js.map +0 -1
  776. package/dist/signal-revocability.d.ts +0 -49
  777. package/dist/signal-revocability.d.ts.map +0 -1
  778. package/dist/signal-revocability.js +0 -93
  779. package/dist/signal-revocability.js.map +0 -1
  780. package/dist/signal-submission.d.ts +0 -181
  781. package/dist/signal-submission.d.ts.map +0 -1
  782. package/dist/signal-submission.js +0 -368
  783. package/dist/signal-submission.js.map +0 -1
  784. package/dist/signaling-connect.d.ts +0 -118
  785. package/dist/signaling-connect.d.ts.map +0 -1
  786. package/dist/signaling-connect.js +0 -538
  787. package/dist/signaling-connect.js.map +0 -1
  788. package/dist/signaling-wiring.d.ts +0 -105
  789. package/dist/signaling-wiring.d.ts.map +0 -1
  790. package/dist/signaling-wiring.js +0 -393
  791. package/dist/signaling-wiring.js.map +0 -1
  792. package/dist/singleton-lock.d.ts +0 -85
  793. package/dist/singleton-lock.d.ts.map +0 -1
  794. package/dist/singleton-lock.js +0 -219
  795. package/dist/singleton-lock.js.map +0 -1
  796. package/dist/sqlcipher-db.d.ts +0 -139
  797. package/dist/sqlcipher-db.d.ts.map +0 -1
  798. package/dist/sqlcipher-db.js +0 -357
  799. package/dist/sqlcipher-db.js.map +0 -1
  800. package/dist/standing-receivers.d.ts +0 -319
  801. package/dist/standing-receivers.d.ts.map +0 -1
  802. package/dist/standing-receivers.js +0 -1295
  803. package/dist/standing-receivers.js.map +0 -1
  804. package/dist/start-agent.d.ts +0 -64
  805. package/dist/start-agent.d.ts.map +0 -1
  806. package/dist/start-agent.js +0 -136
  807. package/dist/start-agent.js.map +0 -1
  808. package/dist/status-handler.d.ts +0 -54
  809. package/dist/status-handler.d.ts.map +0 -1
  810. package/dist/status-handler.js +0 -61
  811. package/dist/status-handler.js.map +0 -1
  812. package/dist/submission-retry.d.ts +0 -208
  813. package/dist/submission-retry.d.ts.map +0 -1
  814. package/dist/submission-retry.js +0 -506
  815. package/dist/submission-retry.js.map +0 -1
  816. package/dist/telegram-bot-client.d.ts +0 -34
  817. package/dist/telegram-bot-client.d.ts.map +0 -1
  818. package/dist/telegram-bot-client.js +0 -36
  819. package/dist/telegram-bot-client.js.map +0 -1
  820. package/dist/telegram-doorbell.d.ts +0 -38
  821. package/dist/telegram-doorbell.d.ts.map +0 -1
  822. package/dist/telegram-doorbell.js +0 -140
  823. package/dist/telegram-doorbell.js.map +0 -1
  824. package/dist/test-handlers.d.ts +0 -62
  825. package/dist/test-handlers.d.ts.map +0 -1
  826. package/dist/test-handlers.js +0 -240
  827. package/dist/test-handlers.js.map +0 -1
  828. package/dist/testing.d.ts +0 -10
  829. package/dist/testing.d.ts.map +0 -1
  830. package/dist/testing.js +0 -10
  831. package/dist/testing.js.map +0 -1
  832. package/dist/transport-composition.d.ts +0 -31
  833. package/dist/transport-composition.d.ts.map +0 -1
  834. package/dist/transport-composition.js +0 -55
  835. package/dist/transport-composition.js.map +0 -1
  836. package/dist/transport-selector.d.ts +0 -202
  837. package/dist/transport-selector.d.ts.map +0 -1
  838. package/dist/transport-selector.js +0 -196
  839. package/dist/transport-selector.js.map +0 -1
  840. package/dist/trust-signal-pickup-listener.d.ts +0 -43
  841. package/dist/trust-signal-pickup-listener.d.ts.map +0 -1
  842. package/dist/trust-signal-pickup-listener.js +0 -48
  843. package/dist/trust-signal-pickup-listener.js.map +0 -1
  844. package/dist/trust-signal-store.d.ts +0 -406
  845. package/dist/trust-signal-store.d.ts.map +0 -1
  846. package/dist/trust-signal-store.js +0 -939
  847. package/dist/trust-signal-store.js.map +0 -1
  848. package/dist/trust-signal-sweep-tick.d.ts +0 -60
  849. package/dist/trust-signal-sweep-tick.d.ts.map +0 -1
  850. package/dist/trust-signal-sweep-tick.js +0 -101
  851. package/dist/trust-signal-sweep-tick.js.map +0 -1
  852. package/dist/trust-signal-sweep.d.ts +0 -94
  853. package/dist/trust-signal-sweep.d.ts.map +0 -1
  854. package/dist/trust-signal-sweep.js +0 -147
  855. package/dist/trust-signal-sweep.js.map +0 -1
  856. package/dist/type-registry.d.ts +0 -42
  857. package/dist/type-registry.d.ts.map +0 -1
  858. package/dist/type-registry.js +0 -37
  859. package/dist/type-registry.js.map +0 -1
  860. package/dist/types.d.ts +0 -746
  861. package/dist/types.d.ts.map +0 -1
  862. package/dist/types.js +0 -20
  863. package/dist/types.js.map +0 -1
  864. package/dist/unresolved-nodes-report.d.ts +0 -14
  865. package/dist/unresolved-nodes-report.d.ts.map +0 -1
  866. package/dist/unresolved-nodes-report.js +0 -96
  867. package/dist/unresolved-nodes-report.js.map +0 -1
  868. package/dist/vocabulary.d.ts +0 -150
  869. package/dist/vocabulary.d.ts.map +0 -1
  870. package/dist/vocabulary.js +0 -386
  871. package/dist/vocabulary.js.map +0 -1
  872. package/dist/who-label.d.ts +0 -28
  873. package/dist/who-label.d.ts.map +0 -1
  874. package/dist/who-label.js +0 -31
  875. package/dist/who-label.js.map +0 -1
  876. package/dist/who-resolver.d.ts +0 -15
  877. package/dist/who-resolver.d.ts.map +0 -1
  878. package/dist/who-resolver.js +0 -47
  879. package/dist/who-resolver.js.map +0 -1
  880. package/dist/wire-content-hash.d.ts +0 -93
  881. package/dist/wire-content-hash.d.ts.map +0 -1
  882. package/dist/wire-content-hash.js +0 -116
  883. package/dist/wire-content-hash.js.map +0 -1
  884. package/dist/withheld-content.d.ts +0 -13
  885. package/dist/withheld-content.d.ts.map +0 -1
  886. package/dist/withheld-content.js +0 -46
  887. package/dist/withheld-content.js.map +0 -1
  888. package/dist/witness-alerts.d.ts +0 -40
  889. package/dist/witness-alerts.d.ts.map +0 -1
  890. package/dist/witness-alerts.js +0 -102
  891. package/dist/witness-alerts.js.map +0 -1
@@ -1,1295 +0,0 @@
1
- import { NodeAutoNatService } from "@cello-protocol/transport";
2
- import { SessionConnectionGater } from "./session-connection-gater.js";
3
- import { relayOnlyState, publishableEndpoint } from "./relay-only.js";
4
- import { extractErrorMessage } from "./error-message.js";
5
- import { randomBytes, randomUUID } from "node:crypto";
6
- import { relayPeerIdOf, heldRelayIdsOf, SR_RESERVATION_MAX_RETRIES, REVIVE_RESERVATION_CANDIDATES, REVIVE_RESERVATION_TIMEOUT_MS, RELEASE_TELL_BUDGET_MS, OFFER_RESERVATION_GRACE_MS, clientSideAskFault, holdsCircuit, stopWhenSettled, } from "./session-node-types.js";
7
- import { STANDING_RECEIVER_AGENT_NAME } from "./types.js";
8
- export class StandingReceivers {
9
- #ctx;
10
- /**
11
- * The dialer an inbound session offer named, per agent.
12
- *
13
- * ⚠️ OWNED HERE, not shared by reference like the other maps — because unlike them it has NO
14
- * reader left in the manager. It was passed across with the rest on the first pass; a review
15
- * measured that every read had moved with the four `*OfferedDialer` methods, so the by-reference
16
- * argument that is correct for the other nine does not apply to it.
17
- */
18
- #offeredDialer = new Map();
19
- constructor(ctx) {
20
- this.#ctx = ctx;
21
- }
22
- /** A getter so the moved reads still say `this.#db` and narrow exactly as they did. */
23
- get #db() {
24
- return this.#ctx.db();
25
- }
26
- async #startReceiverNode(agentName, sessionId, gater, candidateCircuitAddrs, correlationId) {
27
- /**
28
- * 054-SRSPLIT — **ONE NODE. IT STARTS ON TCP, THEN TAKES ITS RESERVATIONS IN PLACE.**
29
- *
30
- * This used to be a walk of throwaway PROBE nodes — one built per relay to find out whether that
31
- * relay would grant, torn down, and then a FINAL node rebuilt carrying every granted address in
32
- * its constructor. The probes existed for exactly one reason: a circuit listener was fixed at
33
- * node creation, so the only way to ask a relay anything was to build a node to ask with.
34
- *
35
- * `listenOnCircuit` (unit 1) removed that constraint, and this is the simplification it unlocks:
36
- * build the receiver ONCE, and for each relay prove and ask on the node that will keep it.
37
- *
38
- * ⚠️ **AND IT CLOSES THE DEFECT UNIT 1 LEFT STANDING, which was recorded here rather than
39
- * fixed.** The final node was built with `circuitRelayListenAddrs`, so libp2p asked at start on
40
- * a fresh connection that had proved nothing on itself. It worked only because the relay
41
- * remembers a proof for `PROVEN_PEER_MEMORY_MS` — two minutes, in the OTHER repo — and when that
42
- * memory had expired the original refused-ask collision came back for the one node that IS the
43
- * agent's front door. There is no constructor-time ask left, so that dependency is gone, and
44
- * `spread.grant_not_bound` — the event that existed to catch the proof expiring between the walk
45
- * and the rebuild — has nothing left to report.
46
- *
47
- * ⚠️ **ONE SEED, and it still matters** (032-RELAYSPREAD). The agent is ONE identity and must be
48
- * dialable at ONE peer id through any of its circuits. That is now structural rather than
49
- * maintained: there is one node, so there is one key, and a second identity has nowhere to come
50
- * from. The old hazard this note used to carry — an abandoned probe still starting on the
51
- * receiver's seed — cannot occur, because no probe is built.
52
- */
53
- const receiverSeed = randomBytes(32);
54
- /**
55
- * Relay peers are allowed OUTBOUND before the node starts. Unchanged and load-bearing: our own
56
- * gater would otherwise refuse our own dial, and refreshes must keep working after
57
- * `setAllowedPeer()` narrows the inbound gate to a session counterparty (DOD-M15-ASSIGN-1).
58
- * The gater still admits NOBODY inbound here.
59
- */
60
- for (const addr of candidateCircuitAddrs) {
61
- const relayPeerId = relayPeerIdOf(addr);
62
- if (relayPeerId)
63
- gater.setAllowedOutboundPeer(relayPeerId);
64
- }
65
- const node = await this.createAgentNode(agentName, {
66
- sessionId,
67
- connectionGater: gater,
68
- nodeType: "standing_receiver",
69
- // NO `circuitRelayListenAddrs` — nothing is asked for at start. See the note above.
70
- transportPrivateKey: receiverSeed,
71
- });
72
- await node.start();
73
- /**
74
- * ⚠️ **THE WALK IS GONE — 055-ONDEMAND, and this is the capacity change itself.**
75
- *
76
- * The receiver used to visit every relay it had ever heard of and hold a slot on each, for the
77
- * life of the login, against the chance that somebody called. Demand was `agents × relays`, so
78
- * the tenth relay added a tenth of the fleet's demand and one relay's worth of capacity, and
79
- * the ratio `agents / slots-per-relay` never improved however many relays were run.
80
- *
81
- * **An idle agent now holds ZERO.** A reservation is taken when an offer arrives, on the relay
82
- * the directory names (`takeReservationForSession`), and given back at the seal. Demand becomes
83
- * `live sessions × 1`.
84
- *
85
- * **What makes that safe, and it is the reason this is not a reachability regression:**
86
- * - The relay's MAILBOX consults no reservation. Deposit authenticates the depositor by their
87
- * Noise peer id; pull is a signature challenge on the recipient and is an OUTBOUND dial. So
88
- * store-and-forward keeps working with nothing held.
89
- * - The WITNESS is a separate dial on the relay's own protocol. Nothing about the seal, the
90
- * hash chain or the transcript depended on a reservation.
91
- * - A cold call to a LOGGED-OUT agent was already refused with nothing queued, so no
92
- * capability is lost — there was never an answering machine to lose.
93
- *
94
- * The candidate list is still passed in and still used: it is what the offer path reserves
95
- * against when it needs to, and what `cello_status` reports as relays this agent could use.
96
- */
97
- this.#ctx.logger.info("session.standing_receiver.idle", {
98
- agentName,
99
- relaysAvailable: candidateCircuitAddrs.length,
100
- correlationId,
101
- impact: "this agent holds no relay reservation while idle, by design. One is taken on the " +
102
- "relay the directory names when a session is offered, and given back at the seal.",
103
- });
104
- return { node, seed: receiverSeed };
105
- }
106
- /**
107
- * 054-SRSPLIT — **TAKE ONE RESERVATION, ON A NODE THAT IS ALREADY RUNNING.**
108
- *
109
- * The whole relay handshake for one relay: prove over `/cello/relay/1.0.0` on a connection we
110
- * open, then ask libp2p's own transport manager to listen on the circuit. The relay grants on the
111
- * first ask because it marks `slot.provenForReservation` per CONNECTION at auth time and libp2p's
112
- * reservation store reuses the open connection rather than dialling a new one (measured live
113
- * 2026-09-08; `DOD-M15-RELAYPROVE-ORDER-1`).
114
- *
115
- * ⚠️ **THE NODE IS NOT STOPPED BETWEEN THE PROOF AND THE ASK.** The relay marks the CONNECTION,
116
- * not the peer id, so closing it throws away the very thing that makes the ask succeed.
117
- */
118
- /**
119
- * 055-ONDEMAND — **take a reservation for a SESSION, on the relay the directory named.**
120
- *
121
- * The public face of `#takeReservation` for the offer path. An idle agent holds nothing, so this
122
- * is what makes it dialable, and it lasts only as long as the session that asked for it.
123
- *
124
- * Returns whether one was granted. A `false` is a degradation, not a failure: the counterparty
125
- * can still reach this agent directly, or through the relay's store-and-forward. The one caller
126
- * that must treat it as fatal is relay-only mode, which does so at its own guard.
127
- */
128
- /**
129
- * 055-ONDEMAND — the abandoned-offer timers, keyed `agent::sessionIdHex`. See `#armOfferRelease`.
130
- */
131
- #offerReleaseTimers = new Map();
132
- /**
133
- * ⚠️ **AN OFFER THAT GOES QUIET MUST NOT KEEP A SLOT — `DOD-M15-OFFER-EXPIRY-1`, RELOCATED.**
134
- *
135
- * The story predicted this exactly: the permanently-open door units 2 and 3 removed does not take
136
- * the defect with it, it moves it somewhere more expensive. The responder reserves the moment an
137
- * offer arrives; an initiator that never dials — it aborted, the directory faulted — would leave a
138
- * slot held on a SHARED relay until its TTL, two hours by default. That is a cost on the exact
139
- * resource this whole story exists to conserve, and "released at seal" cannot cover it because
140
- * there is no seal.
141
- *
142
- * ⚠️ **THE BUDGET IS NOT THE DIRECTORY'S 2-SECOND ACCEPT CLOCK, and picking that would be worse
143
- * than not doing this at all.** The accept is only the start: the assignment still has to be
144
- * FROST-signed by a threshold of directory nodes and delivered to both parties before either
145
- * builds a session. Releasing on 2 s would take the slot out from under a session that was about
146
- * to begin — turning a rare abandoned offer into a common broken one.
147
- *
148
- * No cancellation plumbing: the timer ASKS whether the session started. A session that began and
149
- * has already sealed is also not live, and that case has already released through the seal path,
150
- * where the teardown releases from the session's own node.
151
- */
152
- #armOfferRelease(agentName, sessionIdHex, circuitAddr, correlationId) {
153
- const key = `${agentName}::${sessionIdHex}`;
154
- const existing = this.#offerReleaseTimers.get(key);
155
- if (existing !== undefined)
156
- clearTimeout(existing);
157
- const timer = setTimeout(() => {
158
- this.#offerReleaseTimers.delete(key);
159
- if (this.#ctx.shuttingDown())
160
- return;
161
- if (this.#ctx.sessionIsLive(agentName, sessionIdHex))
162
- return; // it started; the seal owns it now
163
- this.#ctx.logger.warn("session.reservation.offer_abandoned", {
164
- agentName,
165
- sessionIdHex,
166
- circuitAddr,
167
- heldForMs: OFFER_RESERVATION_GRACE_MS,
168
- correlationId,
169
- impact: "a relay slot was taken to answer an offer that never became a session — the " +
170
- "initiator did not dial. Given back rather than held until the relay's TTL, which is " +
171
- "two hours and is a cost on every other agent that relay serves.",
172
- });
173
- /**
174
- * ⚠️ THE RECEIVER'S OWN NODE, and at this point that is the right one: the offer never became a
175
- * session, so nothing was promoted and the circuit is still on the standing receiver. (Had it
176
- * been promoted, `sessionIsLive` above would have returned and we would not be here.)
177
- */
178
- const sr = this.#ctx.standingReceivers.get(agentName);
179
- if (sr) {
180
- void this.releaseSessionReservation(agentName, sr.node, sessionIdHex, correlationId)
181
- .catch(() => { });
182
- }
183
- }, OFFER_RESERVATION_GRACE_MS);
184
- timer.unref?.();
185
- this.#offerReleaseTimers.set(key, timer);
186
- }
187
- /**
188
- * 055-ONDEMAND — re-take a circuit on a node that already exists, for a live session that lost it.
189
- *
190
- * ⚠️ **IT PROVES OVER THE DELIVERY PATH TOO.** `DOD-M15-RELAYAUTH-1` applies identically here: a
191
- * holder that has not proven key possession has its reservation revoked inside the relay's grace
192
- * window, about fifteen seconds. The first version of the re-take called the low-level ask
193
- * directly and skipped it, so a re-taken circuit would have been revoked almost immediately while
194
- * the log said "granted" — the same defect this unit already fixed one function up.
195
- */
196
- async retakeReservationOn(agentName, node, circuitAddr, correlationId) {
197
- const relayPeerId = relayPeerIdOf(circuitAddr);
198
- const outcome = await this.#takeReservation(agentName, node, circuitAddr, correlationId);
199
- if (outcome !== "granted")
200
- return false;
201
- /**
202
- * ⚠️ **THE OTHER HALF OF `reservation_lost` — 056-SLOTDEAD, review F4.**
203
- *
204
- * The loss trigger fires the moment a reservation goes, which is exactly when the relay link is
205
- * down, so the pull it starts is aimed at a relay that cannot answer. Without something on the
206
- * recovery, content the counterparty parked during the outage waits for the slow periodic
207
- * backstop while the relay is healthy and this agent is connected to it again.
208
- *
209
- * **This path, and not the two that look like it.** The watchdog's `gained` branch was the
210
- * first attempt and never fired — a take records the new circuit on the receiver itself, so by
211
- * the next tick there is nothing left for the watchdog to see as gained; a test caught it, which
212
- * is the only reason it is not still in the tree looking correct. `takeReservationForSession`
213
- * was the second, and it double-drains: on a first login it fires moments after the install
214
- * drain, for the same empty mailbox.
215
- *
216
- * A re-take is unambiguous. It happens only when a session that HAD a circuit lost it, which is
217
- * exactly the outage whose recovery this is.
218
- */
219
- this.#ctx.park.fireParkedDrain(agentName, "reservation_regained");
220
- if (relayPeerId) {
221
- void this.#ctx.authenticateStandingReceiver(agentName, node, relayPeerId, circuitAddr, correlationId)
222
- .catch((err) => {
223
- this.#ctx.logger.warn("session.standing_receiver.relay_auth.failed", {
224
- agentName, relayPeerId, correlationId,
225
- error: extractErrorMessage(err),
226
- impact: "a live session re-took a circuit but did not prove key possession over the " +
227
- "delivery path, so the relay may revoke it inside its grace window.",
228
- });
229
- });
230
- }
231
- return true;
232
- }
233
- async takeReservationForSession(agentName, circuitAddr, correlationId,
234
- /**
235
- * ⚠️ **PRESENT ONLY ON THE OFFER PATH, AND THAT IS WHAT ARMS THE ABANDONED-OFFER RELEASE.**
236
- *
237
- * The first version reused `correlationId` for this, because the offer handler happens to pass
238
- * the session id as its correlation id. Two meanings in one parameter is how a value ends up
239
- * being trusted for something it was never chosen for: the watchdog's re-take passes a genuine
240
- * correlation id, and it would have armed a timer keyed on a string that is not a session.
241
- *
242
- * Absent for the re-take path, which is by definition for a session that is already live.
243
- */
244
- offerSessionIdHex) {
245
- const sr = this.#ctx.standingReceivers.get(agentName);
246
- if (!sr) {
247
- this.#ctx.logger.warn("session.reservation.on_demand.no_receiver", {
248
- agentName,
249
- circuitAddr,
250
- correlationId,
251
- impact: "there is no standing receiver to hold a reservation, so this agent cannot be " +
252
- "dialled for this session; it is reachable through the relay's store-and-forward only.",
253
- });
254
- return false;
255
- }
256
- // The relay must be dialable BEFORE we dial it — our own gater refuses otherwise, which is the
257
- // same ordering the login walk uses and the one that cost a whole debugging session when it
258
- // was missing.
259
- const relayPeerId = relayPeerIdOf(circuitAddr);
260
- if (relayPeerId)
261
- sr.gater.setAllowedOutboundPeer(relayPeerId);
262
- const outcome = await this.#takeReservation(agentName, sr.node, circuitAddr, correlationId);
263
- /**
264
- * ⚠️ **THE RECEIVER'S RECORD OF WHAT IT HOLDS MUST FOLLOW, or two things go quietly wrong.**
265
- * `relayPeerIds` is what the reservation watchdog compares against to decide a reservation was
266
- * LOST, and what `cello_status` reports as reachability. Left at its build-time value — empty,
267
- * now that nothing is taken at login — the watchdog would see a held circuit it never recorded
268
- * and `cello_status` would call a reachable agent unreachable.
269
- *
270
- * Read from the NODE rather than appended to, and deduped by relay: libp2p announces one
271
- * address per relay listen address, so a five-address relay would otherwise count five times.
272
- */
273
- const heldNow = heldRelayIdsOf(sr.node);
274
- this.#ctx.standingReceivers.set(agentName, { ...sr, relayPeerIds: heldNow });
275
- /**
276
- * ⚠️ **A RELAY THAT GRANTED MUST BE ADMITTED INBOUND, OR THE RESERVATION BUYS NOTHING.**
277
- *
278
- * The gater's inbound carve-out is the security-sensitive half of a reservation: only relays
279
- * whose own grant is confirmed earn it, so a directory that merely NAMES a relay cannot dial us
280
- * through it. That set was built once from what the login walk held — empty now — so an
281
- * on-demand reservation would have been taken, announced, and then refused by OUR OWN gater
282
- * when the counterparty dialled through it.
283
- *
284
- * Recomputed from what the node HOLDS, never from what was asked: being named by the directory
285
- * must not buy a foothold, and under on-demand the directory is what names the relay.
286
- */
287
- sr.gater.setReservedRelayPeers(heldNow);
288
- /**
289
- * ⚠️ **DOD-M15-RELAYAUTH-1 STILL APPLIES, AND IT NO LONGER FIRES ON ITS OWN.**
290
- *
291
- * That auth is a SECOND proof, over the DELIVERY path, and it is what keeps the relay from
292
- * revoking a reservation whose holder has not proven key possession to it — the grace window is
293
- * about fifteen seconds. It used to run in the receiver build, over the circuits the login walk
294
- * had just collected. Nothing is collected there any more, so without this line an on-demand
295
- * reservation would be taken and then quietly revoked mid-session, and the agent would go
296
- * unreachable while every log said the reservation was granted.
297
- *
298
- * Best-effort and unawaited, exactly as it is in the build path: a failure here costs the
299
- * relay's own grace-window revoke, which the watchdog already treats as an ordinary loss.
300
- */
301
- if (outcome === "granted" && offerSessionIdHex !== undefined) {
302
- this.#armOfferRelease(agentName, offerSessionIdHex, circuitAddr, correlationId);
303
- }
304
- if (outcome === "granted" && relayPeerId) {
305
- void this.#ctx.authenticateStandingReceiver(agentName, sr.node, relayPeerId, circuitAddr, correlationId)
306
- .catch((err) => {
307
- this.#ctx.logger.warn("session.standing_receiver.relay_auth.failed", {
308
- agentName, relayPeerId, correlationId,
309
- error: extractErrorMessage(err),
310
- impact: "this agent has a reservation the relay may revoke within its grace window, " +
311
- "because key possession was not proven over the delivery path.",
312
- });
313
- });
314
- }
315
- return outcome === "granted";
316
- }
317
- /**
318
- * 055-ONDEMAND — **GIVE THIS SESSION'S SLOT BACK, FROM THE NODE THAT ACTUALLY HOLDS IT.**
319
- *
320
- * ⚠️ **THE FIRST VERSION LOOKED THE NODE UP BY AGENT NAME AND ALWAYS FOUND THE WRONG ONE.** When a
321
- * session opens, the standing receiver is PROMOTED: `session-lifecycle` deletes it from
322
- * `standingReceivers`, moves that exact node into `activeNodes`, and builds a fresh empty receiver
323
- * behind it. So by seal time `standingReceivers.get(agentName)` is the new idle node, holding
324
- * nothing — the release read `[]`, returned immediately, and told the relay nothing. The slot the
325
- * offer took lived on the promoted node and died with it, invisible to the relay, held for the
326
- * full TTL. **A release that always no-ops is worse than none: it logs success.**
327
- *
328
- * ⚠️ **AND THE CROSS-SESSION RECOMPUTE THE ORDER ASKED FOR IS UNNECESSARY, which is the good news
329
- * in the correction.** libp2p's shared `reservationStore` is shared *within one node*. Each live
330
- * session owns its OWN node, so sealing one cannot clear another session's refresh timers. There
331
- * is nothing to recompute: this node is being torn down anyway, so tell its relays and drop its
332
- * circuits. Re-deriving that removed a whole class of drift rather than managing it.
333
- */
334
- async releaseSessionReservation(agentName, node, sessionId, correlationId) {
335
- const held = heldRelayIdsOf(node);
336
- if (held.length === 0)
337
- return;
338
- for (const relayPeerId of held) {
339
- /**
340
- * ⚠️ BOUNDED, BECAUSE THIS RUNS INSIDE A TEARDOWN. Telling a relay means dialling it, and an
341
- * unreachable one would otherwise hold the seal open for as long as its dial takes. Measured
342
- * the hard way: unbounded, this hung fourteen unrelated suites at 237s each. A seal waiting on
343
- * a courtesy is worse than a slot held until its TTL.
344
- */
345
- await Promise.race([
346
- this.#ctx.tellRelayReleased(agentName, relayPeerId, node, correlationId),
347
- new Promise((r) => setTimeout(r, RELEASE_TELL_BUDGET_MS).unref?.()),
348
- ]);
349
- }
350
- // Local half. The node is going away regardless; this stops it announcing a route it no longer
351
- // holds for whatever is left of its life.
352
- try {
353
- await node.releaseAllCircuits();
354
- }
355
- catch (err) {
356
- this.#ctx.logger.debug("session.reservation.release.local_failed", {
357
- agentName, sessionId, correlationId, error: extractErrorMessage(err),
358
- // The node is being torn down either way, so this costs nothing beyond a few more seconds
359
- // of announcing a route that is already gone at the relay. Deliberately NOT claiming the
360
- // watchdog repairs it (review MEDIUM-11): this unit removed the rebuild that used to.
361
- impact: "the session's node keeps announcing a circuit it has released, until it stops.",
362
- });
363
- }
364
- this.#ctx.logger.info("session.reservation.released", {
365
- agentName,
366
- sessionId,
367
- releasedRelays: held,
368
- correlationId,
369
- impact: "the slot this session borrowed is back in the relay's table, rather than held until " +
370
- "its two-hour TTL.",
371
- });
372
- }
373
- async #takeReservation(agentName, node, circuitAddr, correlationId) {
374
- const verdict = await this.#ctx.proveToRelay(agentName, circuitAddr, node, correlationId, true);
375
- if (verdict === "refused_this_agent" || verdict === "refused_try_another_relay") {
376
- const reason = verdict === "refused_this_agent" ? "relay_refused_this_agent" : "relay_proof_refused";
377
- this.#ctx.srLastRejectionReason.set(agentName, reason);
378
- this.#ctx.logger.warn("session.standing_receiver.relay.rejected", {
379
- agentName,
380
- circuitAddr,
381
- reason,
382
- correlationId,
383
- impact: verdict === "refused_this_agent"
384
- ? "the relay refused this AGENT rather than being unwilling or unwell, so every other " +
385
- "relay would refuse it identically. Stopped here; cello_status carries the cause."
386
- : "this relay would not take the agent's proof. Moving to the next relay.",
387
- });
388
- return verdict === "refused_this_agent" ? "refused_this_agent" : "declined";
389
- }
390
- /**
391
- * ⚠️ **A PROOF THAT REACHED NO VERDICT IS NOT A REFUSAL** — `unavailable` means the relay never
392
- * answered (no client wired, or unreachable), and NOT every relay gates reservations. Refusing
393
- * to ask because our own proof path was unavailable would lose the ability to reserve with an
394
- * ungated relay entirely. The boundary is enforced in `proveToRelay`, which returns
395
- * `unavailable` for exactly this (review HIGH-1 on unit 1).
396
- */
397
- if (verdict === "unavailable") {
398
- this.#ctx.logger.warn("session.standing_receiver.prove.no_verdict", {
399
- agentName,
400
- circuitAddr,
401
- correlationId,
402
- impact: "no proof verdict was obtained from this relay. Asking for the reservation anyway: " +
403
- "a relay that does not gate them grants it, and one that does refuses an ask that cost a " +
404
- "single dial.",
405
- });
406
- }
407
- let askFault;
408
- let error = "";
409
- let timer;
410
- const timedOut = Symbol("listen_timeout");
411
- let outcome = timedOut;
412
- try {
413
- /**
414
- * ⚠️ **AN ABANDONED ASK NOW LANDS ON A NODE THAT LIVES ON** — review MEDIUM-5, and it is the
415
- * mirror image of the hazard the old probe teardown existed for.
416
- *
417
- * When a probe timed out it was destroyed, so a grant arriving late died with it. There is
418
- * one long-lived node now: a late grant ADDS a circuit address after the walk has counted
419
- * what it holds, so the receiver would advertise a relay that is in neither `sr.relayPeerIds`
420
- * nor the gater's reserved set — the ledger and the advertised addresses disagreeing, which
421
- * is what the watchdog then churns on.
422
- *
423
- * So a late grant is GIVEN BACK rather than kept. Releasing costs a dial; keeping it costs a
424
- * disagreement no operator can see, and a slot on a relay we already decided against.
425
- */
426
- const askP = node.listenOnCircuit(circuitAddr).then(() => "asked");
427
- void askP.catch(() => { });
428
- outcome = await Promise.race([
429
- askP,
430
- new Promise((resolve) => {
431
- timer = setTimeout(() => resolve(timedOut), this.#ctx.srReservationTimeoutMs);
432
- }),
433
- ]);
434
- if (outcome === timedOut) {
435
- void askP.then(() => {
436
- this.#ctx.logger.warn("session.standing_receiver.reservation.late_grant_released", {
437
- agentName,
438
- circuitAddr,
439
- correlationId,
440
- impact: "this relay answered after the walk had moved on, so its circuit was not " +
441
- "counted or advertised. Given back rather than held: a slot nobody knows about is " +
442
- "one the relay cannot reuse and this agent cannot rely on. ⚠️ This drops EVERY " +
443
- "circuit — libp2p's reservation store is shared across listeners and cannot " +
444
- "release one — so the receiver is rebuilt by the watchdog, which is the correct " +
445
- "outcome: a walk whose result is already wrong should be redone, not patched.",
446
- });
447
- return node.releaseAllCircuits().catch(() => false);
448
- }, () => { });
449
- }
450
- }
451
- catch (err) {
452
- error = extractErrorMessage(err);
453
- // A fault of OURS keeps its own name rather than being re-derived from the relay connection,
454
- // which is intact and irrelevant when the ask never left this process (review HIGH-2).
455
- askFault = clientSideAskFault(err);
456
- }
457
- finally {
458
- if (timer !== undefined)
459
- clearTimeout(timer);
460
- }
461
- // The only proof that counts: an ANNOUNCED circuit address on this relay. `listen()` resolving
462
- // is not enough — a relay at its slot cap completes the handshake and grants nothing.
463
- const relayPeerId = relayPeerIdOf(circuitAddr);
464
- if (outcome === "asked" && node.listenAddresses().some((a) => a.split("/").includes("p2p-circuit") && (relayPeerId === null || a.includes(`/p2p/${relayPeerId}/`)))) {
465
- return "granted";
466
- }
467
- /**
468
- * ⚠️ **THE CONNECTION CHECK APPLIES TO BOTH OUTCOMES** — review MEDIUM-6.
469
- *
470
- * "Asked" does not mean the relay answered: a relay that is down yields no circuit address,
471
- * indistinguishable here from one that answered and granted nothing. An open connection is what
472
- * separates them, and we have one to ask.
473
- *
474
- * The first version of this rewrite applied that check only to the `asked` branch, so a HUNG
475
- * ask short-circuited to `reservation_did_not_complete_in_time` — latency — when the relay was
476
- * simply gone. That is a name for where the failure surfaced, not for what went wrong, in a
477
- * unit whose headline is that behaviour does not change.
478
- */
479
- const connectedToRelay = node.getConnections().some((c) => c.peerId === relayPeerId);
480
- const reason = askFault !== undefined
481
- ? askFault
482
- : !connectedToRelay
483
- ? "relay_unreachable"
484
- : outcome === "asked"
485
- ? "relay_granted_no_reservation"
486
- : "reservation_did_not_complete_in_time";
487
- this.#ctx.srLastRejectionReason.set(agentName, reason);
488
- this.#ctx.logger.warn("session.standing_receiver.relay.rejected", {
489
- agentName,
490
- circuitAddr,
491
- reason,
492
- ...(error !== "" ? { error } : {}),
493
- correlationId,
494
- });
495
- return "declined";
496
- }
497
- /** One standing-receiver create attempt (extracted for the M8B F14 retry loop). */
498
- async #tryCreateStandingReceiver(agentName, correlationId) {
499
- const sessionId = `standing_receiver_${randomUUID()}`;
500
- const gater = new SessionConnectionGater({
501
- sessionId,
502
- // No named peer: admits NOBODY inbound until a session offer names the dialer, while leaving
503
- // this node's own outbound errands open (DOD-M15-ASSIGN-1). It does NOT mean "open".
504
- allowedPeerId: null,
505
- logger: this.#ctx.logger,
506
- });
507
- // DOD-NAT-REACHABILITY-1: reserve with the agent's known relays. The relay
508
- // peers are allowed OUTBOUND on the gater up front, so reservation refreshes
509
- // keep working after the receiver is claimed and setAllowedPeer() narrows
510
- // the inbound gate to the session counterparty.
511
- const reservations = this.#ctx.reservationCircuitAddrs(agentName);
512
- for (const relayPeerId of reservations.relayPeerIds) {
513
- gater.setAllowedOutboundPeer(relayPeerId);
514
- }
515
- let node;
516
- /**
517
- * DOD-M12B-SESSION-SEED-1 — the transport identity of this receiver.
518
- *
519
- * Minted ONCE inside `#startReceiverNode` and returned with the node, not minted here. It is
520
- * one seed for the whole walk (032-RELAYSPREAD): the receiver reserves with every relay that
521
- * grants, and an agent must be dialable at ONE peer id through any of its circuits, so every
522
- * reservation has to belong to the same key. What makes that safe is DOD-M15-ASSIGN-1 — the
523
- * gater above admits NOBODY inbound — not the teardown, which bounds how long a rejected
524
- * candidate lives rather than preventing it from overlapping. See the seed note in
525
- * `#startReceiverNode` for the full argument.
526
- *
527
- * FRESH EVERY TIME, which is the privacy property rather than an implementation detail. A
528
- * receiver serves at most one session (it is promoted into the session at handoff and replaced),
529
- * so no identifier is ever shared between two sessions and the 2026-04-11 rationale —
530
- * unlinkability of an agent's sessions to a passive observer — survives intact.
531
- */
532
- let seed;
533
- try {
534
- ({ node, seed } = await this.#startReceiverNode(agentName, sessionId, gater, reservations.addrs, correlationId));
535
- }
536
- catch (err) {
537
- // extractErrorMessage, NOT String(err): the transport throws structured
538
- // plain objects ({ reason, message }), and String() destroys both into
539
- // "[object Object]" — the loud failure must carry its cause.
540
- const error = extractErrorMessage(err);
541
- this.#ctx.logger.error("session.node.create.failed", {
542
- sessionId,
543
- agentName: `${STANDING_RECEIVER_AGENT_NAME}:${agentName}`,
544
- error,
545
- correlationId,
546
- });
547
- return { outcome: "failed", error };
548
- }
549
- // M2: gracefulShutdown may have begun while this node was starting (ensure runs un-awaited).
550
- // Don't install an orphan bound to a TCP port — stop it and bail.
551
- if (this.#ctx.shuttingDown()) {
552
- try {
553
- await node.stop();
554
- }
555
- catch { /* best-effort */ }
556
- return { outcome: "aborted" };
557
- }
558
- // L1: the agent may have gone offline (cello_set_agent_offline → removeStandingReceiverForAgent)
559
- // while this ensure was parked on start(). Removal found no map entry to delete, so the
560
- // tombstone is how we learn of it — tear the fresh node down rather than install an SR for
561
- // an offline agent.
562
- if (this.#ctx.standingReceiverRemoving.has(agentName)) {
563
- this.#ctx.standingReceiverRemoving.delete(agentName);
564
- try {
565
- await node.stop();
566
- }
567
- catch { /* best-effort */ }
568
- return { outcome: "aborted" };
569
- }
570
- // CELLO-M7-TRANSPORT-001: wrap in a NodeAutoNatService so its dialability drives session-
571
- // address advertisement and the transport.autonat.* events fire.
572
- const autoNat = new NodeAutoNatService({
573
- node,
574
- logger: this.#ctx.logger,
575
- nodeType: "standing_receiver",
576
- probers: this.#ctx.autoNatProbers(),
577
- });
578
- autoNat.emitInitialResult();
579
- /**
580
- * ⚠️ **A RECEIVER IS INSTALLED HOLDING NOTHING, AND THAT IS NOW A CONSTANT — 056-SLOTDEAD.**
581
- *
582
- * This block used to derive what the node had come up holding: `heldRelayIdsOf(node)`, the
583
- * matching circuit addresses, the count for the reachability line, and the gater's inbound
584
- * carve-out. Every one of those read the result of the login walk. `#startReceiverNode` returns
585
- * a TCP-only node now (055-ONDEMAND), so all four were computing `[]` — reachable, referenced,
586
- * and unable to produce a different answer on any input.
587
- *
588
- * The distinction the deleted comment was defending — a CANDIDATE is a relay we asked, a HELD
589
- * address is one that answered — is still the rule, and it still lives in `heldRelayIdsOf`. It
590
- * is enforced where a reservation is actually taken (`takeReservationForSession`) and where one
591
- * is checked (the watchdog), which is where it belongs. Nothing is held here to check.
592
- *
593
- * The gater is left as constructed: its reserved set starts empty, and `takeReservationForSession`
594
- * widens it for the one relay that grants. Setting it to `[]` here only restated that.
595
- */
596
- this.#ctx.standingReceivers.set(agentName, {
597
- node,
598
- gater,
599
- autoNat,
600
- seed,
601
- relayPeerIds: [],
602
- });
603
- this.#ctx.logger.info("session.node.created", {
604
- sessionId,
605
- agentName: `${STANDING_RECEIVER_AGENT_NAME}:${agentName}`,
606
- sessionPeerId: node.getPeerId(),
607
- correlationId,
608
- });
609
- /**
610
- * ⚠️ **DOD-M15-RELAYAUTH-1'S INSTALL-TIME PROOF IS GONE — 056-SLOTDEAD, and it could not have
611
- * run since 055-ONDEMAND.**
612
- *
613
- * It read: *"authenticate to the reservation relay NOW, not when a session first needs one"* —
614
- * because the relay revokes a reservation whose holder has not proven key possession to it, and
615
- * a login-time slot had to survive that grace window with no session in sight. It looped over
616
- * the relays this receiver held. It holds none, so the loop's body never executed.
617
- *
618
- * **The requirement it served is not gone; it moved, and it moved to the stronger place.** A
619
- * reservation is now taken by `takeReservationForSession`, which proves FIRST and asks second on
620
- * the same connection (`DOD-M15-RELAYPROVE-ORDER-1`). "Proven before the slot exists" is
621
- * structural there, rather than a second best-effort call racing a grace window.
622
- */
623
- /**
624
- * DOD-NAT-REACHABILITY-1 observability: what did this receiver come up able to use?
625
- *
626
- * ⚠️ **`reservationsHeld` WAS DROPPED, NOT RENAMED — 056-SLOTDEAD.** It carried
627
- * `heldRelayIdsOf(node).length` and was the one number in this line an operator would act on.
628
- * Since 055-ONDEMAND a receiver is installed holding nothing by design, so it reported `0` on
629
- * every healthy login for every agent — a measurement that had become a constant while still
630
- * reading as a measurement. That is worse than not reporting it: the number an operator trusts
631
- * to mean "this agent is deaf" now means nothing at all.
632
- *
633
- * `relaysOffered` stays and is still a real count: how many relays are in the candidate list
634
- * (deduped by relay peer id in `reservationCircuitAddrs`, so it counts relays, not addresses).
635
- * **Zero of them is the condition worth seeing here** — an agent with no candidate cannot take a
636
- * slot when an offer arrives, and will refuse the call.
637
- *
638
- * What an agent actually holds is reported where it is now decided: `session.offer.reservation`
639
- * at the moment a slot is asked for, and `getStandingReceiverReachability` for `cello_status`.
640
- */
641
- this.#ctx.logger.info("session.standing_receiver.reachability", {
642
- agentName,
643
- relaysOffered: reservations.addrs.length,
644
- correlationId,
645
- });
646
- /**
647
- * ⚠️ **`reservation.none` IS NOT EMITTED AT BUILD ANY MORE — 055-ONDEMAND.**
648
- *
649
- * It means *"this agent is offered relays and holds none, so nobody behind NAT can dial it"* —
650
- * a warn that fired 481 times over 17 days and drove a whole retry story. Under on-demand,
651
- * holding none at build is the DESIGN: a slot is taken when an offer arrives and given back at
652
- * the seal. Leaving the warn here would fire it on every healthy login for every agent, which
653
- * is not a smaller version of the old problem but a worse one — an alarm that is wrong every
654
- * time trains its reader to ignore the one time it is right.
655
- *
656
- * The condition it named still has a home. `session.offer.reservation` reports `granted: false`
657
- * when an offer could not get a circuit — the moment it actually costs someone something — and
658
- * the watchdog's re-take path reports a live session that lost one.
659
- *
660
- * ⚠️ **AND ITS DEBUG-LEVEL REPLACEMENT WENT TOO — 056-SLOTDEAD, review F10.** A
661
- * `session.standing_receiver.idle_no_reservation` line survived here, guarded on
662
- * `reservations.addrs.length > 0 && circuitAddrs === 0`. The second term was always true once
663
- * the login walk was deleted, so the guard was really just "this agent has candidates" and the
664
- * line fired on every healthy install for every agent — a second event, under a name that reads
665
- * as a fault, asserting the same by-design state the `idle` line above already reports with its
666
- * `relaysAvailable` count. Two lines per install saying "normal" is how a log stops being read.
667
- */
668
- // DOD-PARK-DRAIN-1: this agent has a receiver again — drain whatever parked while it did not.
669
- // The defect this closes was a trigger hooked to the wrong connection: content parks when the
670
- // RELAY link dies, and the drain was waiting on DIRECTORY SIGNALING to reconnect — which it
671
- // never had to, having never dropped.
672
- //
673
- // 056-SLOTDEAD: this used to be the ONE place every path converged on, because a lost
674
- // reservation rebuilt the receiver and arrived back here. The rebuilds are gone, so this now
675
- // covers the INSTALL only, and the loss has its own trigger (`reservation_lost`) at the point
676
- // the loss is noticed.
677
- this.#ctx.park.fireParkedDrain(agentName, "standing_receiver_ready");
678
- return { outcome: "installed" };
679
- }
680
- /**
681
- * DOD-LOOP-1: ensure the given agent has a standing receiver node (idempotent). Created when an
682
- * agent comes online (cello_start_agent) and replaced after it is handed off to a session. The
683
- * `#standingReceiverCreating` guard prevents two concurrent ensure() calls (e.g. the
684
- * cello_start_agent hook racing a consume-site retry) from building two nodes for one agent.
685
- *
686
- * M8B F14: a create failure no longer strands the agent deaf. Each ensure runs a BOUNDED
687
- * retry loop (`standingReceiverRetryDelaysMs`, default 1s/5s/15s) — covering the fixed-port
688
- * race where the consumed receiver still holds the port until its session node is torn down —
689
- * and when every attempt fails, fires the alarm-worthy `session.standing_receiver.dead`
690
- * (error level), distinct from the per-attempt `session.node.create.failed`. Re-arm is also
691
- * kicked from destroySessionNode/retireSessionNode (the moment the port frees) and from the
692
- * inbound accept path (ensure on demand), so one failure can never leave the agent deaf forever.
693
- */
694
- async ensureStandingReceiver(agentName, correlationId = randomUUID()) {
695
- if (this.#ctx.standingReceivers.has(agentName) || this.#ctx.standingReceiverCreating.has(agentName))
696
- return;
697
- if (this.#ctx.shuttingDown())
698
- return;
699
- // A fresh ensure request supersedes any pending removal (agent toggled offline→online).
700
- this.#ctx.standingReceiverRemoving.delete(agentName);
701
- this.#ctx.standingReceiverCreating.add(agentName);
702
- try {
703
- let lastError = "";
704
- for (let attempt = 0; attempt <= this.#ctx.srRetryDelaysMs.length; attempt++) {
705
- if (attempt > 0) {
706
- await new Promise((r) => setTimeout(r, this.#ctx.srRetryDelaysMs[attempt - 1]));
707
- }
708
- if (this.#ctx.shuttingDown())
709
- return;
710
- // L1 tombstone: the agent went offline while we were creating / backing off.
711
- if (this.#ctx.standingReceiverRemoving.has(agentName)) {
712
- this.#ctx.standingReceiverRemoving.delete(agentName);
713
- return;
714
- }
715
- const result = await this.#tryCreateStandingReceiver(agentName, correlationId);
716
- if (result.outcome !== "failed")
717
- return; // installed, or cleanly aborted (shutdown/offline)
718
- lastError = result.error;
719
- }
720
- // M8B F14 (fix 4): an agent that WANTS a receiver has none after every attempt — the
721
- // deaf-agent state. Fail LOUD so it is alarm-visible instead of a quiet degradation.
722
- this.#ctx.logger.error("session.standing_receiver.dead", {
723
- agentName,
724
- reason: lastError,
725
- attempts: this.#ctx.srRetryDelaysMs.length + 1,
726
- correlationId,
727
- });
728
- }
729
- finally {
730
- this.#ctx.standingReceiverCreating.delete(agentName);
731
- }
732
- }
733
- /**
734
- * DOD-M12B-SESSION-SEED-1 — build a revived session node that is REACHABLE, without ever hanging.
735
- *
736
- * MEASURED 2026-08-18, live, three ways:
737
- * - handed 2 relay addrs at once, no deadline: `start()` never completes (10,002ms and counting)
738
- * - handed none: `start()` in 1ms, but NOBODY can dial the node —
739
- * the counterparty's re-dial fails
740
- * `counterparty_dial_failed` and every message in
741
- * both directions has to go the relay park route
742
- * - this: one candidate at a time, each raced against its
743
- * own deadline, plain node as the floor
744
- *
745
- * The middle option is what shipped for one test run and it made the session half-dead: revived,
746
- * `active`, and unreachable. The first is what shipped before that and it hung. Neither is a
747
- * choice between "fast" and "reliable" — the per-candidate race is how `#startReceiverNode` has
748
- * always done it, and it is the shape that works in production every day.
749
- *
750
- * A FAILED CANDIDATE IS TORN DOWN AT SETTLEMENT. The first version awaited `stop()` immediately
751
- * and claimed that made seed reuse safe; it did not — `libp2p.stop()` returns at once unless the
752
- * node is `'started'`, and during the timeout window it is `'starting'` (review HIGH-3, verified
753
- * against libp2p 3.3.2). The teardown is now chained onto the candidate's OWN start promise, so it
754
- * runs whenever that settles, however late.
755
- *
756
- * A BRIEF OVERLAP IS THEREFORE POSSIBLE and is stated rather than denied: a candidate that grants
757
- * at 4s comes up on this session's peer id and is stopped immediately after. What is guaranteed is
758
- * that it dies, not that it never lives. The receiver path avoids even that by minting a seed per
759
- * candidate; here the identity is fixed, which is the whole point of a revival, so that option
760
- * does not exist.
761
- *
762
- * The floor is a plain node: a session that is usable over the relay park route beats no session.
763
- */
764
- async buildRevivedNode(sessionId, gater, seed, candidateAddrs, agentName) {
765
- for (const circuitAddr of candidateAddrs.slice(0, REVIVE_RESERVATION_CANDIDATES)) {
766
- /**
767
- * DOD-M15-RELAYSLOTS-1 — **A REVIVAL PROVES ITSELF TOO.**
768
- *
769
- * Review HIGH-3. The relay refuses a reservation to a peer that has not shown it belongs to
770
- * a registered agent, and it remembers a proof for two minutes. A revival is almost never
771
- * inside that window — the receiver last proved this peer id when the session was created,
772
- * possibly days ago — so without this loop every revived session was refused by every
773
- * candidate and came up on the plain floor: alive, `active`, and dialable by nobody, with
774
- * every message in both directions forced through the relay park route.
775
- *
776
- * ⚠️ DOD-M15-RELAYPROVE-ORDER-1 — **ONE ATTEMPT NOW, exactly as `#startReceiverNode` does
777
- * it.** This used to be two: ask, be refused, prove, ask again, justified by *"a reservation
778
- * taken by hand on the same connection as the proof yields no dialable address."* That
779
- * described taking the slot over a raw HOP stream; asking libp2p's own transport manager
780
- * after the proof makes the reservation libp2p's own, and it announces the address. Measured
781
- * live 2026-09-08. So the candidate comes up with no circuit address, proves, and asks once.
782
- *
783
- * The seed is fixed here — that is what a revival IS — so this node carries the identity the
784
- * relay records, and it must STAY UP between the proof and the ask: the relay marks the
785
- * CONNECTION proven, and stopping the node closes it.
786
- */
787
- let revivedNode;
788
- let terminalRefusal = false;
789
- {
790
- const candidate = await this.createAgentNode(agentName, {
791
- sessionId,
792
- connectionGater: gater,
793
- nodeType: "session",
794
- inboundReachable: true,
795
- transportPrivateKey: seed,
796
- // NO `circuitRelayListenAddrs` — libp2p must not ask before the proof below has landed.
797
- });
798
- // KEEP THE START PROMISE. Review HIGH-3: `libp2p.stop()` opens with
799
- // `if (this.status !== 'started') return`, and during the whole timeout window the status is
800
- // `'starting'` — so awaiting `stop()` on a timed-out candidate stopped nothing and waited for
801
- // nothing. The abandoned `start()` stayed in flight, and if the relay answered late the node
802
- // went live holding THIS SESSION'S peer id, sharing the gater (so it admits the counterparty)
803
- // with no content handler registered, and with no reference left to stop it. Verified against
804
- // libp2p 3.3.2 rather than assumed.
805
- const startP = candidate.start();
806
- let startError;
807
- const started = await Promise.race([
808
- startP.then(() => true),
809
- new Promise((res) => setTimeout(() => res(false), REVIVE_RESERVATION_TIMEOUT_MS).unref?.()),
810
- ]).catch((err) => { startError = err; return false; });
811
- /**
812
- * PROVE, THEN ASK — the same order as `#startReceiverNode`, for the same reason.
813
- *
814
- * `started` gates it because `libp2p.stop()` opens with `if (this.status !== 'started')
815
- * return`, so a timed-out candidate cannot be torn down here; that case falls through to the
816
- * settlement-chained teardown below, which is the only thing that reliably kills a
817
- * still-starting node.
818
- *
819
- * ⚠️ THE CANDIDATE IS NOT STOPPED BETWEEN THE PROOF AND THE ASK. It used to be, because the
820
- * ask came from a rebuilt node. The relay marks the CONNECTION proven, so stopping here
821
- * would throw away the very thing that makes the next line succeed.
822
- */
823
- let proofDeclined = false;
824
- /**
825
- * The ask's own promise, when one was made. The teardown below has to wait on THIS as well as
826
- * on `start()`: the node whose reservation is still in flight is the one that can come up
827
- * late holding this session's peer id, and `stop()` on a node mid-ask is the same no-op the
828
- * start-promise note describes.
829
- */
830
- let listenP;
831
- /** Set when the ask failed for a fault of OURS, so it is not re-described as the relay's. */
832
- let askFault;
833
- if (started) {
834
- const verdict = await this.#ctx.proveToRelay(agentName, circuitAddr, candidate, sessionId, false);
835
- // A VERDICT DECLINES; NO VERDICT DOES NOT. `unavailable` means the relay never answered —
836
- // no client wired, or unreachable — and not every relay gates reservations, so the ask
837
- // still goes ahead. Same rule and same reasoning as `#startReceiverNode`.
838
- if (verdict === "refused_this_agent" || verdict === "refused_try_another_relay") {
839
- proofDeclined = true;
840
- // The agent-level refusal is about this AGENT, so the remaining candidates answer
841
- // identically.
842
- if (verdict === "refused_this_agent")
843
- terminalRefusal = true;
844
- this.#ctx.logger.warn("session.revive.reservation.declined", {
845
- agentName,
846
- sessionId,
847
- circuitAddr,
848
- reason: verdict === "refused_this_agent" ? "relay_refused_this_agent" : "relay_proof_refused",
849
- impact: verdict === "refused_this_agent"
850
- ? "the relay refused this agent rather than being unwilling or unwell, so every " +
851
- "other relay refuses it the same way. The session comes up reachable only via " +
852
- "the relay park route; cello_status carries the cause."
853
- : "this relay would not take the agent's proof. Trying the next relay.",
854
- });
855
- try {
856
- await candidate.stop();
857
- }
858
- catch { /* best-effort */ }
859
- }
860
- else {
861
- /**
862
- * ASK — once, on the connection the proof was made on.
863
- *
864
- * ⚠️ **RACED AGAINST THE SAME DEADLINE `start()` USED TO CARRY, AND IT HAS TO BE.** The
865
- * measured production failure this whole loop exists for — 10,002ms and still waiting —
866
- * was a relay that never answered a reservation. That used to park `start()`, because a
867
- * circuit address in the constructor made start the moment libp2p asked. The ask is here
868
- * now, so a bare await here is the same hang with a new address: the revival never
869
- * returns and every send on that session is refused forever.
870
- *
871
- * A throw is not fatal — the grant check below is the only thing that decides, and it
872
- * reads the announced addresses.
873
- */
874
- // Wrapped, not bare: a node that cannot take the ask at all throws SYNCHRONOUSLY, and
875
- // `.catch()` on the race never sees that — it would escape the revival entirely.
876
- const asked = await (async () => {
877
- listenP = candidate.listenOnCircuit(circuitAddr);
878
- return Promise.race([
879
- listenP.then(() => true),
880
- new Promise((res) => setTimeout(() => res(false), REVIVE_RESERVATION_TIMEOUT_MS).unref?.()),
881
- ]);
882
- })().catch((err) => {
883
- startError = err;
884
- // Review HIGH-2, same rule as the receiver walk: a fault of OURS keeps its own name.
885
- askFault = clientSideAskFault(err);
886
- return false;
887
- });
888
- if (!asked && askFault === undefined) {
889
- this.#ctx.logger.warn("session.revive.reservation.ask_timeout", {
890
- agentName,
891
- sessionId,
892
- circuitAddr,
893
- budgetMs: REVIVE_RESERVATION_TIMEOUT_MS,
894
- impact: "this relay took the proof and then never answered the reservation. Abandoned " +
895
- "on the deadline and trying the next relay — a relay that does not answer must not " +
896
- "be able to hold a session down.",
897
- });
898
- }
899
- }
900
- }
901
- if (!proofDeclined && started && holdsCircuit(candidate)) {
902
- this.#ctx.logger.info("session.revive.reservation.granted", { agentName, sessionId });
903
- revivedNode = candidate;
904
- break;
905
- }
906
- if (!proofDeclined) {
907
- // Started but granted nothing, or never started. Either way this node is not the one.
908
- //
909
- // Review MEDIUM-5: name WHICH of the three causes this was, the way `#startReceiverNode` does.
910
- // "declined" alone stood for a relay that is full, a relay that is unreachable, and a relay
911
- // that is merely slow — three different problems with three different responses, and the
912
- // thrown error was discarded entirely.
913
- const declineReason = askFault !== undefined
914
- // A client-side fault, checked FIRST: everything below infers a cause from the relay, and
915
- // the relay had nothing to do with an ask that never left this process (review HIGH-2).
916
- ? askFault
917
- : !started
918
- ? startError !== undefined
919
- ? "relay_unreachable"
920
- : "reservation_did_not_complete_in_time"
921
- : // Started, proved, asked — and the ask is where a slow relay now shows up. An ask still in
922
- // flight is "did not complete in time"; one that returned with nothing is a relay that
923
- // answered and granted nothing.
924
- listenP !== undefined && !holdsCircuit(candidate)
925
- ? "relay_granted_no_reservation"
926
- : "reservation_did_not_complete_in_time";
927
- const isLast = circuitAddr === candidateAddrs.slice(0, REVIVE_RESERVATION_CANDIDATES).at(-1);
928
- this.#ctx.logger.warn("session.revive.reservation.declined", {
929
- agentName,
930
- sessionId,
931
- circuitAddr,
932
- reason: declineReason,
933
- ...(startError !== undefined ? { error: extractErrorMessage(startError) } : {}),
934
- impact: isLast
935
- ? "no relay granted; the session comes up reachable only via the relay park route"
936
- : "trying the next relay",
937
- });
938
- /**
939
- * Teardown at SETTLEMENT, not now: a `stop()` issued while the node is still starting is a
940
- * no-op (see above), so the only way to guarantee this node dies is to wait for its own work
941
- * to finish first. Not awaited, so a hung relay cannot hold the revival up — the point is that
942
- * the teardown eventually happens, not that it happens before the next candidate.
943
- *
944
- * ⚠️ **BOTH PROMISES, and the second one is new.** The abandoned candidate's outstanding work
945
- * used to be `start()`, because that is where the reservation was taken. It is the ASK now, so
946
- * waiting only on `start()` tears the node down while its reservation is still in flight —
947
- * and a late grant then brings a node up on THIS SESSION'S peer id, sharing the gater, with no
948
- * content handler and nothing holding a reference to kill it. That is the open endpoint
949
- * review HIGH-3 exists to prevent, reintroduced through a different promise.
950
- */
951
- stopWhenSettled(candidate, [startP, listenP], REVIVE_RESERVATION_TIMEOUT_MS * 2);
952
- }
953
- }
954
- if (revivedNode)
955
- return revivedNode;
956
- if (terminalRefusal)
957
- break;
958
- }
959
- // THE FLOOR. No reservation, so the counterparty cannot dial us directly — but their messages
960
- // park at the relay and drain, which is how every message in the 2026-08-18 test arrived. A
961
- // session usable one way beats a session that never comes back.
962
- const plain = await this.createAgentNode(agentName, {
963
- sessionId,
964
- connectionGater: gater,
965
- nodeType: "session",
966
- inboundReachable: true,
967
- transportPrivateKey: seed,
968
- });
969
- await plain.start();
970
- if (candidateAddrs.length > 0) {
971
- this.#ctx.logger.warn("session.revive.reservation.none", {
972
- agentName,
973
- sessionId,
974
- candidates: candidateAddrs.length,
975
- impact: "the revived session holds no circuit address — the counterparty cannot dial it, so "
976
- + "delivery in both directions depends on relay store-and-forward until it is rebuilt",
977
- });
978
- }
979
- return plain;
980
- }
981
- /**
982
- * DOD-M15-RELAYONLY-1: build a transport node for THIS AGENT, with its privacy posture applied.
983
- *
984
- * ⚠️ THE CHOKE POINT FOR NODE CREATION, and it exists for the same reason as the one around
985
- * `getStandingReceiverInfo`. Five call sites construct nodes; passing `relayOnly` at each would be
986
- * a hand-kept list, and the SIXTH — added next month by someone who has never read this line —
987
- * would build a node that hole-punches its way to a direct connection for an operator who asked
988
- * never to be directly reachable. Here, a new caller inherits the posture instead of being told.
989
- *
990
- * `unknown` counts as ON, matching the publish and dial halves: a node that declines to hole-punch
991
- * is reachable over the relay, while a disclosed address cannot be recalled.
992
- */
993
- // ⚠️ NOT `async`. This wrapper sits in the standing-receiver startup path, and making it async
994
- // added ONE extra microtask hop before the receiver was installed in `#standingReceivers` — which
995
- // was enough for `createSessionNode` to run first and answer `standing_receiver_unavailable`. Two
996
- // tests in `msg-021-session-seed` caught it. Returning the factory's promise directly keeps the
997
- // await count identical to the call it replaced. **This is a real fragility in the install path,
998
- // not a quirk of the tests:** anything that adds a tick here re-breaks it.
999
- createAgentNode(agentName, config) {
1000
- // ⚠️ THE POSTURE READ MUST NEVER COST US A NODE. This sits in the standing-receiver startup
1001
- // path, whose caller treats a throw as "no receiver" and leaves the agent deaf to all inbound —
1002
- // surfacing to the operator as `standing_receiver_unavailable`, which names the transport for a
1003
- // fault in a settings lookup. `relayOnlyState` already absorbs a throwing GETTER; this absorbs
1004
- // everything else, including a resolution failure for an agent row that is not there yet.
1005
- //
1006
- // The fallback is ON, not off: an agent whose posture we cannot read gets the private-but-
1007
- // reachable node, because a node that declines to hole-punch still works over the relay while a
1008
- // disclosed address cannot be recalled.
1009
- let relayOnly = true;
1010
- try {
1011
- relayOnly = relayOnlyState((key) => this.#ctx.records.getSetting(agentName, key), this.#db !== null) !== "off";
1012
- }
1013
- catch (err) {
1014
- this.#ctx.logger.warn("settings.relay_only.unreadable", {
1015
- agentName,
1016
- reason: extractErrorMessage(err),
1017
- impact: "could not read this agent's relay-only posture, so the node is built WITHOUT the hole-punch",
1018
- });
1019
- }
1020
- return this.#ctx.factory.createNode({ ...config, relayOnly });
1021
- }
1022
- /**
1023
- * DOD-PARK-DRAIN-1 (review F6): why there is no standing-receiver node to dial from — named
1024
- * precisely, because `standing_receiver_unavailable` is the exit-point label that stood in for
1025
- * four different causes and misnamed this very incident 102 times.
1026
- *
1027
- * Only meaningful once `getStandingReceiverNode()` has returned null, which means NO agent on
1028
- * this daemon has a ready receiver — the dial node is not agent-scoped.
1029
- */
1030
- standingReceiverAbsenceReason(agentName) {
1031
- if (this.#ctx.shuttingDown())
1032
- return "daemon_shutting_down";
1033
- if (this.#ctx.standingReceiverCreating.has(agentName))
1034
- return "standing_receiver_creating";
1035
- if (!this.#ctx.agentsWantingReceiver.has(agentName))
1036
- return "agent_offline";
1037
- return "no_standing_receiver";
1038
- }
1039
- getStandingReceiverInfo(agentName) {
1040
- // DOD-LOOP-1: the initiator advertises ITS OWN agent's standing receiver, which it then reuses
1041
- // as the session node — so the advertised endpoint matches the node the counterparty dials.
1042
- const sr = this.#ctx.standingReceivers.get(agentName);
1043
- if (!sr)
1044
- return null;
1045
- // DOD-M15-RELAYONLY-1: THE CHOKE POINT. Every path that publishes this agent's session
1046
- // addresses draws from here — `initiator_session_addrs` on the way out, and
1047
- // `counterparty_session_addrs` when answering an offer — and this method has no other kind of
1048
- // consumer: its whole purpose is to be advertised, as the docstring above says.
1049
- //
1050
- // The suppression lives HERE rather than at those call sites deliberately. Call-site gating
1051
- // would be a hand-kept list, and a fourth publish path added later would leak the operator's IP
1052
- // while every test stayed green. At the choke point a new caller inherits the protection
1053
- // instead of having to be told about it.
1054
- const endpoint = { peerId: sr.node.getPeerId(), addrs: sr.node.listenAddresses() };
1055
- // ⚠️ TRI-STATE, not a boolean, and the third state is the one that matters. `getSetting` answers
1056
- // `null` both for "unset" and for "there is no database", and reading the second as OFF fails
1057
- // TOWARD DISCLOSURE: the standing receiver outlives the DB during shutdown, so an offer arriving
1058
- // in that window would publish the operator's real addresses with relay-only switched on.
1059
- // `relayOnlyState` also absorbs a THROW — `#requireAgentId` throws for a retired agent, and this
1060
- // method is called from the offer ceremony inside a floating async with no catch, where the
1061
- // throw becomes an unhandled rejection and the offer vanishes with no local log.
1062
- // ⚠️ `!== null`, NOT `!== undefined`. The field is declared `DaemonDatabase | null` and is only
1063
- // ever assigned on open or set to `null` on close — **it is never `undefined` at any point in
1064
- // its lifetime**, so the first version of this line was a compile-time-constant `true` that
1065
- // TypeScript had no reason to complain about, and the whole `"unknown"` branch was unreachable
1066
- // dead code. The fix for the disclosure window silently did nothing, which is worse than not
1067
- // having written it: the DoD said the window was closed and it was wide open.
1068
- const state = relayOnlyState((key) => this.#ctx.records.getSetting(agentName, key), this.#db !== null);
1069
- if (state === "unknown") {
1070
- this.#ctx.logger.warn("settings.relay_only.unreadable", {
1071
- agentName,
1072
- impact: "cannot tell whether relay-only is on, so ONLY this agent's relay-circuit addresses are " +
1073
- "published — never a direct one. Publishing a real address is irreversible and a narrowed " +
1074
- "route is not, so this errs toward reachability loss rather than disclosure",
1075
- });
1076
- }
1077
- // ONE filter, not two. The `unknown` branch used to build its own filtered object inline, which
1078
- // put a second implementation inside the very method whose design rationale is that there is
1079
- // exactly one — and the bypass guard could not see it.
1080
- return publishableEndpoint(endpoint, state !== "off");
1081
- }
1082
- /** DOD-LOOP-1: whether the given agent has a standing receiver ready (any agent if omitted). */
1083
- getStandingReceiverReady(agentName) {
1084
- if (agentName !== undefined)
1085
- return this.#ctx.standingReceivers.has(agentName);
1086
- return this.#ctx.standingReceivers.size > 0;
1087
- }
1088
- /**
1089
- * The standing receiver's libp2p node — a general-purpose node usable for OUTBOUND dials that
1090
- * are not session-scoped (e.g. the content-park deposit/pull to the relay, MSG-001-3b). Its
1091
- * gater admits nobody INBOUND until a session names them (DOD-M15-ASSIGN-1), but leaves these
1092
- * outbound errands open. Returns null until the receiver is ready.
1093
- */
1094
- getStandingReceiverNode(agentName) {
1095
- // With an agentName: that agent's own standing-receiver node (needed when the dial must
1096
- // originate from a SPECIFIC agent — e.g. the startup content-park re-park, where the
1097
- // depositor is the original sender). Without one: any ready standing receiver (outbound
1098
- // content-park deposit/pull to the relay — not session-scoped, and OUTBOUND, which is the
1099
- // half of the gater that is open; inbound admits nobody until a dialer is named).
1100
- if (agentName !== undefined)
1101
- return this.#ctx.standingReceivers.get(agentName)?.node ?? null;
1102
- return this.#anyStandingReceiver()?.node ?? null;
1103
- }
1104
- /**
1105
- * First ready standing receiver (any agent) — for agent-agnostic OUTBOUND use. Its gater admits
1106
- * nobody INBOUND until a session names them (DOD-M15-ASSIGN-1); outbound stays open, which is the
1107
- * property these callers depend on.
1108
- */
1109
- #anyStandingReceiver() {
1110
- for (const sr of this.#ctx.standingReceivers.values())
1111
- return sr;
1112
- return null;
1113
- }
1114
- /**
1115
- * DOD-M12B-RESERVATION-RETRY-1 — whether a NAT'd peer can actually DIAL this agent.
1116
- *
1117
- * `standing_receiver_ready` answers "is there a receiver?", which is true for a plain TCP node
1118
- * that no relay would give a circuit reservation to. Behind NAT that node is reachable by nobody,
1119
- * and the difference was visible only in the log — where it was visible 481 times and nobody
1120
- * acted. `"retrying"` and `"unreachable"` are the states an operator can do something about.
1121
- *
1122
- * reserved — holds a circuit reservation; a NAT'd peer can dial it.
1123
- * retrying — no reservation yet, still re-asking on a backoff.
1124
- * unreachable — no circuit reservation and the automatic re-attempts are spent, so only peers
1125
- * that can connect DIRECTLY will get in. It is not permanent: a directory
1126
- * reconnect carrying a DIFFERENT relay pool re-arms the budget, because a relay we
1127
- * have never tried is new information.
1128
- * absent — no receiver at all (the agent is not online).
1129
- */
1130
- getStandingReceiverReachability(agentName) {
1131
- const sr = this.#ctx.standingReceivers.get(agentName);
1132
- if (!sr)
1133
- return "absent";
1134
- // AT LEAST ONE. Holding two circuits and losing one leaves the agent perfectly dialable, so it
1135
- // is not "retrying" — reporting it as such sends an operator hunting a fault that is not there.
1136
- if (sr.relayPeerIds.length > 0)
1137
- return "reserved";
1138
- /**
1139
- * ⚠️ **A LIVE SESSION'S CIRCUIT COUNTS — 055-ONDEMAND, and without this the field measures the
1140
- * wrong node.**
1141
- *
1142
- * The standing receiver holds nothing while idle, by design. A session's circuit lives on the
1143
- * SESSION's node: the receiver was promoted into it and replaced. Reading only the receiver
1144
- * therefore reported `retrying` for an agent in a perfectly healthy conversation — a fault where
1145
- * there is none, on the surface an operator checks first.
1146
- */
1147
- if (this.#ctx.anyLiveSessionHoldsCircuit(agentName))
1148
- return "reserved";
1149
- const retry = this.#ctx.srReservationRetry.get(agentName);
1150
- if (retry === undefined) {
1151
- /**
1152
- * ⚠️ **IDLE AND READY — DOD-M15-IDLE-READY-1, AND `retrying` HERE WAS NOT MERELY THE WRONG
1153
- * WORD.**
1154
- *
1155
- * Reaching this line means: a receiver exists, it holds no circuit, no live session holds one
1156
- * either, and **nothing has ever asked for one** — no retry state was recorded. Before
1157
- * 055-ONDEMAND that combination was rare and meant a real problem: an agent that wanted a slot
1158
- * at login and could not get one. An agent takes a slot when somebody calls now, so this is
1159
- * the ordinary resting state of every healthy idle agent on the fleet.
1160
- *
1161
- * Leaving it as `retrying` cost the field its only job. `retrying` said "we want a slot, we
1162
- * cannot get one, we are still trying" — and once every healthy agent says it, an agent that
1163
- * genuinely cannot get a slot is indistinguishable from one that is perfectly fine. A status
1164
- * that reads the same whether or not anything is wrong is not a status. Observed on two live
1165
- * agents the same afternoon: `reserved` on the published build, `retrying` on this one, with
1166
- * nothing different about whether anyone could reach them.
1167
- *
1168
- * ⚠️ **AND IT IS NOT `reserved`, which was the tempting one-liner.** `reserved` is a claim an
1169
- * operator acts on — a slot is held, so a counterparty behind a home router can dial in right
1170
- * now. That is false for an idle agent. Two different facts, so two different words.
1171
- */
1172
- return "ready";
1173
- }
1174
- return retry.attempts > SR_RESERVATION_MAX_RETRIES ? "unreachable" : "retrying";
1175
- }
1176
- /**
1177
- * CELLO-M7-TRANSPORT-001: the AutoNAT service wrapping the current standing
1178
- * receiver node, or null if the standing receiver is not ready. The composition
1179
- * root uses this as the daemon's runtime IAutoNatService — its getDialability()
1180
- * drives the SessionAssignment advertised address (AC-004/AC-019), and it is the
1181
- * source of the transport.autonat.result / transport.autonat.unavailable events.
1182
- */
1183
- getStandingReceiverAutoNat() {
1184
- // DOD-LOOP-1: the daemon-level autonat source is any ready standing receiver; null until one
1185
- // exists (the composition root falls back to LocalAutoNatStub). Per-session advertised dialability
1186
- // comes from the initiating agent's own SR via getStandingReceiverInfo, not this daemon-level value.
1187
- return this.#anyStandingReceiver()?.autoNat ?? null;
1188
- }
1189
- /**
1190
- * Which peer this agent's standing receiver is currently admitting INBOUND — `null` for nobody.
1191
- *
1192
- * Read-only, and it answers a question the daemon otherwise cannot: *"whose dial would this
1193
- * receiver accept right now?"* The gate is narrowed and re-closed from several paths (an offer
1194
- * arrives, an assignment is refused, a session is promoted), and until now the only way to know
1195
- * where it had ended up was to reproduce the sequence in your head.
1196
- *
1197
- * Added for `DOD-M15-RESPONDER-VERIFY-1`, where a refusal for one session was closing the gate a
1198
- * DIFFERENT session had narrowed — a defect with no observable symptom short of the second
1199
- * session's initiator being refused with "nothing invited it".
1200
- */
1201
- getStandingReceiverAllowedPeer(agentName) {
1202
- return this.#ctx.standingReceivers.get(agentName)?.gater.getAllowedPeerId() ?? null;
1203
- }
1204
- /**
1205
- * DOD-M15-ASSIGN-1 — name the one peer allowed to dial this agent's standing receiver, at the
1206
- * moment the directory's `session_offer` says who is coming.
1207
- *
1208
- * This is what makes the receiver's deny-by-default safe. The offer names
1209
- * `initiator_session_peer_id`, and the responder answers it by advertising its OWN address in
1210
- * `session_offer_accept`. Narrowing here — BEFORE that answer goes out — means the door opens to
1211
- * exactly one peer at the same instant the address that reaches them is published, and never
1212
- * before. The initiator cannot know where to dial until the accept it triggers has been sent.
1213
- *
1214
- * Returns WHICH failure it was, never a bare false (review F6). The caller reports a distinct
1215
- * reason per cause: "no receiver" and "the directory named nobody" are different subsystems, and
1216
- * collapsing them sent the operator to the directory for a local problem. This method never
1217
- * widens the gate to compensate.
1218
- *
1219
- * Narrows INBOUND ONLY. The receiver is still the daemon's general-purpose dialer at this point
1220
- * — no assignment exists yet — so revoking its outbound latitude here would break content
1221
- * parking and restart-seal submission (review F2).
1222
- */
1223
- admitOfferedDialer(agentName, initiatorSessionPeerId, sessionIdHex) {
1224
- const sr = this.#ctx.standingReceivers.get(agentName);
1225
- if (!sr)
1226
- return "no_receiver";
1227
- if (initiatorSessionPeerId === "")
1228
- return "no_peer_named";
1229
- sr.gater.admitInboundPeer(initiatorSessionPeerId);
1230
- this.#offeredDialer.set(this.#ctx.sessionKey(agentName, sessionIdHex), initiatorSessionPeerId);
1231
- return "narrowed";
1232
- }
1233
- /**
1234
- * What the UNSIGNED offer claimed, so the SIGNED assignment can be checked against it.
1235
- *
1236
- * DOD-M15-OFFER-SIGNED-1. Decision 2 rules that the listening socket is "gated on the
1237
- * assignment", and the gate is narrowed from `session_offer` — a frame carrying no signature —
1238
- * because that is the only thing that arrives early enough. Timing forced the offer; it does not
1239
- * excuse trusting it.
1240
- *
1241
- * Keeping what the offer said turns the two frames into a CHECK ON EACH OTHER. The assignment is
1242
- * FROST-signed by the initiator's own threshold group, which no single directory can produce, and
1243
- * it names the same peer id. A directory that says one peer in the offer and another in the
1244
- * assignment is naming two different dialers for one session — which a truthful directory never
1245
- * does, and which is exactly the move a compromised one would make to slip a peer past the gate
1246
- * before the signed document arrives.
1247
- */
1248
- getOfferedDialer(agentName, sessionIdHex) {
1249
- return this.#offeredDialer.get(this.#ctx.sessionKey(agentName, sessionIdHex)) ?? null;
1250
- }
1251
- /** Forget the offered dialer for ONE session — called on BOTH the claim and the refusal paths. */
1252
- clearOfferedDialer(agentName, sessionIdHex) {
1253
- this.#offeredDialer.delete(this.#ctx.sessionKey(agentName, sessionIdHex));
1254
- }
1255
- /**
1256
- * RE-CLOSE the standing receiver — but ONLY if this session is still the one holding it.
1257
- *
1258
- * DOD-M15-OFFER-SIGNED-1 review F4, then N1. The first version closed the gate unconditionally,
1259
- * and that was worse than the defect it fixed: an agent has ONE standing receiver with ONE allowed
1260
- * peer, so a refusal for session P closed the gate that offer Q had narrowed. Q's initiator —
1261
- * invited, legitimate — was then refused with *"nothing invited it"*, which this daemon had.
1262
- *
1263
- * That is the same cross-session interference F1 was written to remove, moved one method along,
1264
- * and triggerable the same way: one bogus offer/assignment pair collapses a concurrent real
1265
- * session.
1266
- *
1267
- * So the gate is closed only when it still names the peer THIS session opened it to. If a later
1268
- * offer has already re-narrowed it, that offer owns the receiver and its narrowing stands.
1269
- *
1270
- * NO EVICTION SWEEP, deliberately (N4). The sweep evicts by "not the allowed peer", and
1271
- * `getConnections()` returns OUTBOUND connections too — including the content-park and
1272
- * restart-seal dials this node makes as the daemon's general-purpose dialer, whose targets are on
1273
- * no allowlist by construction. Sweeping here hung those up, and the failure surfaced as
1274
- * `relay_unavailable`: a transport label for a local decision, which is the exact substitution
1275
- * that comment was written to prevent. The load-bearing control is `DOD-M15-FRAME-1`'s frame gate,
1276
- * which refuses what an unauthorised peer sends; closing the door is enough here.
1277
- */
1278
- revokeOfferedDialer(agentName, sessionIdHex, offeredPeerId) {
1279
- this.clearOfferedDialer(agentName, sessionIdHex);
1280
- const sr = this.#ctx.standingReceivers.get(agentName);
1281
- if (!sr || offeredPeerId === null)
1282
- return;
1283
- if (sr.gater.getAllowedPeerId() !== offeredPeerId) {
1284
- // A later offer already owns the receiver. Closing it would refuse THAT session's initiator.
1285
- this.#ctx.logger.debug("session.gate.revoke.skipped", {
1286
- agentName,
1287
- sessionId: sessionIdHex,
1288
- reason: "a later offer has re-narrowed this receiver; its narrowing stands",
1289
- });
1290
- return;
1291
- }
1292
- sr.gater.closeInbound();
1293
- }
1294
- }
1295
- //# sourceMappingURL=standing-receivers.js.map