@cello-protocol/daemon 0.0.227 → 0.0.229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-admin-handlers.d.ts +56 -0
- package/dist/agent-admin-handlers.d.ts.map +1 -0
- package/dist/agent-admin-handlers.js +73 -0
- package/dist/agent-admin-handlers.js.map +1 -0
- package/dist/agent-handlers.d.ts +72 -0
- package/dist/agent-handlers.d.ts.map +1 -0
- package/dist/agent-handlers.js +604 -0
- package/dist/agent-handlers.js.map +1 -0
- package/dist/agent-id-migration.d.ts +70 -0
- package/dist/agent-id-migration.d.ts.map +1 -0
- package/dist/agent-id-migration.js +468 -0
- package/dist/agent-id-migration.js.map +1 -0
- package/dist/agent-loader.d.ts +37 -0
- package/dist/agent-loader.d.ts.map +1 -0
- package/dist/agent-loader.js +37 -0
- package/dist/agent-loader.js.map +1 -0
- package/dist/agent-selection-root.d.ts +29 -0
- package/dist/agent-selection-root.d.ts.map +1 -0
- package/dist/agent-selection-root.js +126 -0
- package/dist/agent-selection-root.js.map +1 -0
- package/dist/agent-selection.d.ts +73 -0
- package/dist/agent-selection.d.ts.map +1 -0
- package/dist/agent-selection.js +80 -0
- package/dist/agent-selection.js.map +1 -0
- package/dist/agent-settings-keys.d.ts +52 -0
- package/dist/agent-settings-keys.d.ts.map +1 -0
- package/dist/agent-settings-keys.js +114 -0
- package/dist/agent-settings-keys.js.map +1 -0
- package/dist/agent-state.d.ts +67 -0
- package/dist/agent-state.d.ts.map +1 -0
- package/dist/agent-state.js +66 -0
- package/dist/agent-state.js.map +1 -0
- package/dist/assignment-verify.d.ts +90 -0
- package/dist/assignment-verify.d.ts.map +1 -0
- package/dist/assignment-verify.js +301 -0
- package/dist/assignment-verify.js.map +1 -0
- package/dist/attendance-wiring.d.ts +23 -0
- package/dist/attendance-wiring.d.ts.map +1 -0
- package/dist/attendance-wiring.js +248 -0
- package/dist/attendance-wiring.js.map +1 -0
- package/dist/attestation-body.d.ts +47 -0
- package/dist/attestation-body.d.ts.map +1 -0
- package/dist/attestation-body.js +71 -0
- package/dist/attestation-body.js.map +1 -0
- package/dist/authorship-verification.d.ts +91 -0
- package/dist/authorship-verification.d.ts.map +1 -0
- package/dist/authorship-verification.js +532 -0
- package/dist/authorship-verification.js.map +1 -0
- package/dist/away-detection.d.ts +139 -0
- package/dist/away-detection.d.ts.map +1 -0
- package/dist/away-detection.js +186 -0
- package/dist/away-detection.js.map +1 -0
- package/dist/away-inbox-oneshot.d.ts +40 -0
- package/dist/away-inbox-oneshot.d.ts.map +1 -0
- package/dist/away-inbox-oneshot.js +311 -0
- package/dist/away-inbox-oneshot.js.map +1 -0
- package/dist/backup-restore-handlers.d.ts +10 -0
- package/dist/backup-restore-handlers.d.ts.map +1 -0
- package/dist/backup-restore-handlers.js +82 -0
- package/dist/backup-restore-handlers.js.map +1 -0
- package/dist/backup-restore.d.ts +102 -0
- package/dist/backup-restore.d.ts.map +1 -0
- package/dist/backup-restore.js +341 -0
- package/dist/backup-restore.js.map +1 -0
- package/dist/bin/cello-daemon.d.ts +13 -0
- package/dist/bin/cello-daemon.d.ts.map +1 -0
- package/dist/bin/cello-daemon.js.map +1 -0
- package/dist/boot-agents.d.ts +64 -0
- package/dist/boot-agents.d.ts.map +1 -0
- package/dist/boot-agents.js +241 -0
- package/dist/boot-agents.js.map +1 -0
- package/dist/boot-connection-state.d.ts +38 -0
- package/dist/boot-connection-state.d.ts.map +1 -0
- package/dist/boot-connection-state.js +95 -0
- package/dist/boot-connection-state.js.map +1 -0
- package/dist/boot-core.d.ts +36 -0
- package/dist/boot-core.d.ts.map +1 -0
- package/dist/boot-core.js +293 -0
- package/dist/boot-core.js.map +1 -0
- package/dist/boot-parked-content.d.ts +34 -0
- package/dist/boot-parked-content.d.ts.map +1 -0
- package/dist/boot-parked-content.js +528 -0
- package/dist/boot-parked-content.js.map +1 -0
- package/dist/boot-sweeps.d.ts +22 -0
- package/dist/boot-sweeps.d.ts.map +1 -0
- package/dist/boot-sweeps.js +51 -0
- package/dist/boot-sweeps.js.map +1 -0
- package/dist/bundled-consortium-manifest.d.ts +47 -0
- package/dist/bundled-consortium-manifest.d.ts.map +1 -0
- package/dist/bundled-consortium-manifest.js +116 -0
- package/dist/bundled-consortium-manifest.js.map +1 -0
- package/dist/cbor-blob-migration.d.ts +8 -0
- package/dist/cbor-blob-migration.d.ts.map +1 -0
- package/dist/cbor-blob-migration.js +116 -0
- package/dist/cbor-blob-migration.js.map +1 -0
- package/dist/challenge-verifier.d.ts +12 -0
- package/dist/challenge-verifier.d.ts.map +1 -0
- package/dist/challenge-verifier.js +11 -0
- package/dist/challenge-verifier.js.map +1 -0
- package/dist/channel-log-store.d.ts +80 -0
- package/dist/channel-log-store.d.ts.map +1 -0
- package/dist/channel-log-store.js +290 -0
- package/dist/channel-log-store.js.map +1 -0
- package/dist/close-commitment.d.ts +67 -0
- package/dist/close-commitment.d.ts.map +1 -0
- package/dist/close-commitment.js +78 -0
- package/dist/close-commitment.js.map +1 -0
- package/dist/close-session-handler.d.ts +94 -0
- package/dist/close-session-handler.d.ts.map +1 -0
- package/dist/close-session-handler.js +1418 -0
- package/dist/close-session-handler.js.map +1 -0
- package/dist/co-attendance.d.ts +29 -0
- package/dist/co-attendance.d.ts.map +1 -0
- package/dist/co-attendance.js +32 -0
- package/dist/co-attendance.js.map +1 -0
- package/dist/column-birth.d.ts +40 -0
- package/dist/column-birth.d.ts.map +1 -0
- package/dist/column-birth.js +61 -0
- package/dist/column-birth.js.map +1 -0
- package/dist/connect-or-start.d.ts +25 -0
- package/dist/connect-or-start.d.ts.map +1 -0
- package/dist/connect-or-start.js +175 -0
- package/dist/connect-or-start.js.map +1 -0
- package/dist/connection-agents.d.ts +16 -0
- package/dist/connection-agents.d.ts.map +1 -0
- package/dist/connection-agents.js +68 -0
- package/dist/connection-agents.js.map +1 -0
- package/dist/consent-migration.d.ts +49 -0
- package/dist/consent-migration.d.ts.map +1 -0
- package/dist/consent-migration.js +128 -0
- package/dist/consent-migration.js.map +1 -0
- package/dist/consortium-bootstrap.d.ts +138 -0
- package/dist/consortium-bootstrap.d.ts.map +1 -0
- package/dist/consortium-bootstrap.js +339 -0
- package/dist/consortium-bootstrap.js.map +1 -0
- package/dist/consortium-fingerprint.d.ts +115 -0
- package/dist/consortium-fingerprint.d.ts.map +1 -0
- package/dist/consortium-fingerprint.js +175 -0
- package/dist/consortium-fingerprint.js.map +1 -0
- package/dist/contact-handlers.d.ts +59 -0
- package/dist/contact-handlers.d.ts.map +1 -0
- package/dist/contact-handlers.js +343 -0
- package/dist/contact-handlers.js.map +1 -0
- package/dist/contact-pubkey-case.d.ts +65 -0
- package/dist/contact-pubkey-case.d.ts.map +1 -0
- package/dist/contact-pubkey-case.js +136 -0
- package/dist/contact-pubkey-case.js.map +1 -0
- package/dist/contacts-tier-migration.d.ts +90 -0
- package/dist/contacts-tier-migration.d.ts.map +1 -0
- package/dist/contacts-tier-migration.js +150 -0
- package/dist/contacts-tier-migration.js.map +1 -0
- package/dist/content-encryption-status.d.ts +111 -0
- package/dist/content-encryption-status.d.ts.map +1 -0
- package/dist/content-encryption-status.js +158 -0
- package/dist/content-encryption-status.js.map +1 -0
- package/dist/content-park-client.d.ts +90 -0
- package/dist/content-park-client.d.ts.map +1 -0
- package/dist/content-park-client.js +362 -0
- package/dist/content-park-client.js.map +1 -0
- package/dist/content-park.d.ts +52 -0
- package/dist/content-park.d.ts.map +1 -0
- package/dist/content-park.js +1309 -0
- package/dist/content-park.js.map +1 -0
- package/dist/cross-node-negotiation.d.ts +44 -0
- package/dist/cross-node-negotiation.d.ts.map +1 -0
- package/dist/cross-node-negotiation.js +34 -0
- package/dist/cross-node-negotiation.js.map +1 -0
- package/dist/daemon-handle.d.ts +57 -0
- package/dist/daemon-handle.d.ts.map +1 -0
- package/dist/daemon-handle.js +2 -0
- package/dist/daemon-handle.js.map +1 -0
- package/dist/daemon-status-report.d.ts +50 -0
- package/dist/daemon-status-report.d.ts.map +1 -0
- package/dist/daemon-status-report.js +81 -0
- package/dist/daemon-status-report.js.map +1 -0
- package/dist/daemon.d.ts +45 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +1177 -0
- package/dist/daemon.js.map +1 -0
- package/dist/db-identity-store.d.ts +159 -0
- package/dist/db-identity-store.d.ts.map +1 -0
- package/dist/db-identity-store.js +502 -0
- package/dist/db-identity-store.js.map +1 -0
- package/dist/delivery-open-registry.d.ts +92 -0
- package/dist/delivery-open-registry.d.ts.map +1 -0
- package/dist/delivery-open-registry.js +121 -0
- package/dist/delivery-open-registry.js.map +1 -0
- package/dist/delivery-session-suspects.d.ts +56 -0
- package/dist/delivery-session-suspects.d.ts.map +1 -0
- package/dist/delivery-session-suspects.js +94 -0
- package/dist/delivery-session-suspects.js.map +1 -0
- package/dist/directory-auth-posture.d.ts +87 -0
- package/dist/directory-auth-posture.d.ts.map +1 -0
- package/dist/directory-auth-posture.js +134 -0
- package/dist/directory-auth-posture.js.map +1 -0
- package/dist/directory-bootstrap.d.ts +310 -0
- package/dist/directory-bootstrap.d.ts.map +1 -0
- package/dist/directory-bootstrap.js +557 -0
- package/dist/directory-bootstrap.js.map +1 -0
- package/dist/directory-connect.d.ts +27 -0
- package/dist/directory-connect.d.ts.map +1 -0
- package/dist/directory-connect.js +106 -0
- package/dist/directory-connect.js.map +1 -0
- package/dist/disconnect-cleanup.d.ts +51 -0
- package/dist/disconnect-cleanup.d.ts.map +1 -0
- package/dist/disconnect-cleanup.js +72 -0
- package/dist/disconnect-cleanup.js.map +1 -0
- package/dist/document-amendment-store.d.ts +120 -0
- package/dist/document-amendment-store.d.ts.map +1 -0
- package/dist/document-amendment-store.js +266 -0
- package/dist/document-amendment-store.js.map +1 -0
- package/dist/document-delivery-transport.d.ts +168 -0
- package/dist/document-delivery-transport.d.ts.map +1 -0
- package/dist/document-delivery-transport.js +206 -0
- package/dist/document-delivery-transport.js.map +1 -0
- package/dist/document-engine.d.ts +134 -0
- package/dist/document-engine.d.ts.map +1 -0
- package/dist/document-engine.js +282 -0
- package/dist/document-engine.js.map +1 -0
- package/dist/document-flag.d.ts +58 -0
- package/dist/document-flag.d.ts.map +1 -0
- package/dist/document-flag.js +70 -0
- package/dist/document-flag.js.map +1 -0
- package/dist/document-frame-router.d.ts +245 -0
- package/dist/document-frame-router.d.ts.map +1 -0
- package/dist/document-frame-router.js +397 -0
- package/dist/document-frame-router.js.map +1 -0
- package/dist/document-gate-wiring.d.ts +61 -0
- package/dist/document-gate-wiring.d.ts.map +1 -0
- package/dist/document-gate-wiring.js +125 -0
- package/dist/document-gate-wiring.js.map +1 -0
- package/dist/document-gate.d.ts +149 -0
- package/dist/document-gate.d.ts.map +1 -0
- package/dist/document-gate.js +509 -0
- package/dist/document-gate.js.map +1 -0
- package/dist/document-handlers.d.ts +47 -0
- package/dist/document-handlers.d.ts.map +1 -0
- package/dist/document-handlers.js +2203 -0
- package/dist/document-handlers.js.map +1 -0
- package/dist/document-handshake.d.ts +176 -0
- package/dist/document-handshake.d.ts.map +1 -0
- package/dist/document-handshake.js +452 -0
- package/dist/document-handshake.js.map +1 -0
- package/dist/document-inbound.d.ts +162 -0
- package/dist/document-inbound.d.ts.map +1 -0
- package/dist/document-inbound.js +530 -0
- package/dist/document-inbound.js.map +1 -0
- package/dist/document-json.d.ts +120 -0
- package/dist/document-json.d.ts.map +1 -0
- package/dist/document-json.js +191 -0
- package/dist/document-json.js.map +1 -0
- package/dist/document-layer.d.ts +215 -0
- package/dist/document-layer.d.ts.map +1 -0
- package/dist/document-layer.js +1025 -0
- package/dist/document-layer.js.map +1 -0
- package/dist/document-lifecycle.d.ts +52 -0
- package/dist/document-lifecycle.d.ts.map +1 -0
- package/dist/document-lifecycle.js +134 -0
- package/dist/document-lifecycle.js.map +1 -0
- package/dist/document-live-docs.d.ts +58 -0
- package/dist/document-live-docs.d.ts.map +1 -0
- package/dist/document-live-docs.js +126 -0
- package/dist/document-live-docs.js.map +1 -0
- package/dist/document-notify.d.ts +228 -0
- package/dist/document-notify.d.ts.map +1 -0
- package/dist/document-notify.js +580 -0
- package/dist/document-notify.js.map +1 -0
- package/dist/document-profile.d.ts +61 -0
- package/dist/document-profile.d.ts.map +1 -0
- package/dist/document-profile.js +112 -0
- package/dist/document-profile.js.map +1 -0
- package/dist/document-publish.d.ts +87 -0
- package/dist/document-publish.d.ts.map +1 -0
- package/dist/document-publish.js +173 -0
- package/dist/document-publish.js.map +1 -0
- package/dist/document-reachability.d.ts +42 -0
- package/dist/document-reachability.d.ts.map +1 -0
- package/dist/document-reachability.js +80 -0
- package/dist/document-reachability.js.map +1 -0
- package/dist/document-reconcile-engine.d.ts +66 -0
- package/dist/document-reconcile-engine.d.ts.map +1 -0
- package/dist/document-reconcile-engine.js +225 -0
- package/dist/document-reconcile-engine.js.map +1 -0
- package/dist/document-reconcile-scheduler.d.ts +163 -0
- package/dist/document-reconcile-scheduler.d.ts.map +1 -0
- package/dist/document-reconcile-scheduler.js +303 -0
- package/dist/document-reconcile-scheduler.js.map +1 -0
- package/dist/document-rejection.d.ts +251 -0
- package/dist/document-rejection.d.ts.map +1 -0
- package/dist/document-rejection.js +435 -0
- package/dist/document-rejection.js.map +1 -0
- package/dist/document-screen.d.ts +114 -0
- package/dist/document-screen.d.ts.map +1 -0
- package/dist/document-screen.js +223 -0
- package/dist/document-screen.js.map +1 -0
- package/dist/document-store.d.ts +372 -0
- package/dist/document-store.d.ts.map +1 -0
- package/dist/document-store.js +931 -0
- package/dist/document-store.js.map +1 -0
- package/dist/document-surface.d.ts +32 -0
- package/dist/document-surface.d.ts.map +1 -0
- package/dist/document-surface.js +151 -0
- package/dist/document-surface.js.map +1 -0
- package/dist/document-types.d.ts +94 -0
- package/dist/document-types.d.ts.map +1 -0
- package/dist/document-types.js +90 -0
- package/dist/document-types.js.map +1 -0
- package/dist/document-watch.d.ts +69 -0
- package/dist/document-watch.d.ts.map +1 -0
- package/dist/document-watch.js +108 -0
- package/dist/document-watch.js.map +1 -0
- package/dist/document-wiring.d.ts +53 -0
- package/dist/document-wiring.d.ts.map +1 -0
- package/dist/document-wiring.js +323 -0
- package/dist/document-wiring.js.map +1 -0
- package/dist/document-write-guard.d.ts +66 -0
- package/dist/document-write-guard.d.ts.map +1 -0
- package/dist/document-write-guard.js +98 -0
- package/dist/document-write-guard.js.map +1 -0
- package/dist/document-write-path.d.ts +94 -0
- package/dist/document-write-path.d.ts.map +1 -0
- package/dist/document-write-path.js +530 -0
- package/dist/document-write-path.js.map +1 -0
- package/dist/error-message.d.ts +7 -0
- package/dist/error-message.d.ts.map +1 -0
- package/dist/error-message.js +19 -0
- package/dist/error-message.js.map +1 -0
- package/dist/file-manifest-provider.d.ts +37 -0
- package/dist/file-manifest-provider.d.ts.map +1 -0
- package/dist/file-manifest-provider.js +105 -0
- package/dist/file-manifest-provider.js.map +1 -0
- package/dist/frame-values.d.ts +3 -0
- package/dist/frame-values.d.ts.map +1 -0
- package/dist/frame-values.js +84 -0
- package/dist/frame-values.js.map +1 -0
- package/dist/frontier-mismatch.d.ts +73 -0
- package/dist/frontier-mismatch.d.ts.map +1 -0
- package/dist/frontier-mismatch.js +89 -0
- package/dist/frontier-mismatch.js.map +1 -0
- package/dist/gateway-config-handlers.d.ts +26 -0
- package/dist/gateway-config-handlers.d.ts.map +1 -0
- package/dist/gateway-config-handlers.js +454 -0
- package/dist/gateway-config-handlers.js.map +1 -0
- package/dist/held-content.d.ts +145 -0
- package/dist/held-content.d.ts.map +1 -0
- package/dist/held-content.js +389 -0
- package/dist/held-content.js.map +1 -0
- package/dist/http-manifest-poll.d.ts +67 -0
- package/dist/http-manifest-poll.d.ts.map +1 -0
- package/dist/http-manifest-poll.js +150 -0
- package/dist/http-manifest-poll.js.map +1 -0
- package/dist/identity-migration.d.ts +40 -0
- package/dist/identity-migration.d.ts.map +1 -0
- package/dist/identity-migration.js +461 -0
- package/dist/identity-migration.js.map +1 -0
- package/dist/inbound-refusals.d.ts +283 -0
- package/dist/inbound-refusals.d.ts.map +1 -0
- package/dist/inbound-refusals.js +919 -0
- package/dist/inbound-refusals.js.map +1 -0
- package/dist/inbound-seal-request.d.ts +32 -0
- package/dist/inbound-seal-request.d.ts.map +1 -0
- package/dist/inbound-seal-request.js +228 -0
- package/dist/inbound-seal-request.js.map +1 -0
- package/dist/inbound-sessions.d.ts +291 -0
- package/dist/inbound-sessions.d.ts.map +1 -0
- package/dist/inbound-sessions.js +1609 -0
- package/dist/inbound-sessions.js.map +1 -0
- package/dist/inclusion-proof-handlers.d.ts +43 -0
- package/dist/inclusion-proof-handlers.d.ts.map +1 -0
- package/dist/inclusion-proof-handlers.js +565 -0
- package/dist/inclusion-proof-handlers.js.map +1 -0
- package/dist/inclusion-proof.d.ts +151 -0
- package/dist/inclusion-proof.d.ts.map +1 -0
- package/dist/inclusion-proof.js +228 -0
- package/dist/inclusion-proof.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/initiate-session-handler.d.ts +55 -0
- package/dist/initiate-session-handler.d.ts.map +1 -0
- package/dist/initiate-session-handler.js +310 -0
- package/dist/initiate-session-handler.js.map +1 -0
- package/dist/ipc-client.d.ts +31 -0
- package/dist/ipc-client.d.ts.map +1 -0
- package/dist/ipc-client.js +113 -0
- package/dist/ipc-client.js.map +1 -0
- package/dist/ipc-server.d.ts +63 -0
- package/dist/ipc-server.d.ts.map +1 -0
- package/dist/ipc-server.js +429 -0
- package/dist/ipc-server.js.map +1 -0
- package/dist/ipc-surface.d.ts +44 -0
- package/dist/ipc-surface.d.ts.map +1 -0
- package/dist/ipc-surface.js +107 -0
- package/dist/ipc-surface.js.map +1 -0
- package/dist/line-lcs.d.ts +51 -0
- package/dist/line-lcs.d.ts.map +1 -0
- package/dist/line-lcs.js +71 -0
- package/dist/line-lcs.js.map +1 -0
- package/dist/lock-file.d.ts +39 -0
- package/dist/lock-file.d.ts.map +1 -0
- package/dist/lock-file.js +120 -0
- package/dist/lock-file.js.map +1 -0
- package/dist/log-collapse.d.ts +66 -0
- package/dist/log-collapse.d.ts.map +1 -0
- package/dist/log-collapse.js +244 -0
- package/dist/log-collapse.js.map +1 -0
- package/dist/log-rotate.d.ts +67 -0
- package/dist/log-rotate.d.ts.map +1 -0
- package/dist/log-rotate.js +134 -0
- package/dist/log-rotate.js.map +1 -0
- package/dist/manifest-deps.d.ts +25 -0
- package/dist/manifest-deps.d.ts.map +1 -0
- package/dist/manifest-deps.js +151 -0
- package/dist/manifest-deps.js.map +1 -0
- package/dist/manifest-poll-scheduler.d.ts +31 -0
- package/dist/manifest-poll-scheduler.d.ts.map +1 -0
- package/dist/manifest-poll-scheduler.js +59 -0
- package/dist/manifest-poll-scheduler.js.map +1 -0
- package/dist/manifest-validity.d.ts +153 -0
- package/dist/manifest-validity.d.ts.map +1 -0
- package/dist/manifest-validity.js +268 -0
- package/dist/manifest-validity.js.map +1 -0
- package/dist/manifest-version-store-db.d.ts +24 -0
- package/dist/manifest-version-store-db.d.ts.map +1 -0
- package/dist/manifest-version-store-db.js +58 -0
- package/dist/manifest-version-store-db.js.map +1 -0
- package/dist/manifest-version-store.d.ts +16 -0
- package/dist/manifest-version-store.d.ts.map +1 -0
- package/dist/manifest-version-store.js +15 -0
- package/dist/manifest-version-store.js.map +1 -0
- package/dist/network-directory-node.d.ts +136 -0
- package/dist/network-directory-node.d.ts.map +1 -0
- package/dist/network-directory-node.js +810 -0
- package/dist/network-directory-node.js.map +1 -0
- package/dist/nonce-dedup.d.ts +68 -0
- package/dist/nonce-dedup.d.ts.map +1 -0
- package/dist/nonce-dedup.js +205 -0
- package/dist/nonce-dedup.js.map +1 -0
- package/dist/notification-dispatcher.d.ts +92 -0
- package/dist/notification-dispatcher.d.ts.map +1 -0
- package/dist/notification-dispatcher.js +210 -0
- package/dist/notification-dispatcher.js.map +1 -0
- package/dist/notification-handlers.d.ts +53 -0
- package/dist/notification-handlers.d.ts.map +1 -0
- package/dist/notification-handlers.js +461 -0
- package/dist/notification-handlers.js.map +1 -0
- package/dist/onboarding-guidance.d.ts +79 -0
- package/dist/onboarding-guidance.d.ts.map +1 -0
- package/dist/onboarding-guidance.js +95 -0
- package/dist/onboarding-guidance.js.map +1 -0
- package/dist/operator-guidance.d.ts +25 -0
- package/dist/operator-guidance.d.ts.map +1 -0
- package/dist/operator-guidance.js +50 -0
- package/dist/operator-guidance.js.map +1 -0
- package/dist/orphan-triage.d.ts +130 -0
- package/dist/orphan-triage.d.ts.map +1 -0
- package/dist/orphan-triage.js +207 -0
- package/dist/orphan-triage.js.map +1 -0
- package/dist/outbound-sessions.d.ts +126 -0
- package/dist/outbound-sessions.d.ts.map +1 -0
- package/dist/outbound-sessions.js +1052 -0
- package/dist/outbound-sessions.js.map +1 -0
- package/dist/park-envelope.d.ts +329 -0
- package/dist/park-envelope.d.ts.map +1 -0
- package/dist/park-envelope.js +509 -0
- package/dist/park-envelope.js.map +1 -0
- package/dist/park-recovery.d.ts +273 -0
- package/dist/park-recovery.d.ts.map +1 -0
- package/dist/park-recovery.js +717 -0
- package/dist/park-recovery.js.map +1 -0
- package/dist/park-refusals.d.ts +147 -0
- package/dist/park-refusals.d.ts.map +1 -0
- package/dist/park-refusals.js +331 -0
- package/dist/park-refusals.js.map +1 -0
- package/dist/quarantine-framing.d.ts +92 -0
- package/dist/quarantine-framing.d.ts.map +1 -0
- package/dist/quarantine-framing.js +111 -0
- package/dist/quarantine-framing.js.map +1 -0
- package/dist/reconnect-drain.d.ts +22 -0
- package/dist/reconnect-drain.d.ts.map +1 -0
- package/dist/reconnect-drain.js +65 -0
- package/dist/reconnect-drain.js.map +1 -0
- package/dist/recovered-position.d.ts +14 -0
- package/dist/recovered-position.d.ts.map +1 -0
- package/dist/recovered-position.js +59 -0
- package/dist/recovered-position.js.map +1 -0
- package/dist/refusal-notices.d.ts +196 -0
- package/dist/refusal-notices.d.ts.map +1 -0
- package/dist/refusal-notices.js +516 -0
- package/dist/refusal-notices.js.map +1 -0
- package/dist/refusal-reasons.d.ts +245 -0
- package/dist/refusal-reasons.d.ts.map +1 -0
- package/dist/refusal-reasons.js +363 -0
- package/dist/refusal-reasons.js.map +1 -0
- package/dist/register-handler.d.ts +36 -0
- package/dist/register-handler.d.ts.map +1 -0
- package/dist/register-handler.js +285 -0
- package/dist/register-handler.js.map +1 -0
- package/dist/registration-context.d.ts +72 -0
- package/dist/registration-context.d.ts.map +1 -0
- package/dist/registration-context.js +126 -0
- package/dist/registration-context.js.map +1 -0
- package/dist/registration-manager.d.ts +94 -0
- package/dist/registration-manager.d.ts.map +1 -0
- package/dist/registration-manager.js +585 -0
- package/dist/registration-manager.js.map +1 -0
- package/dist/registration-persistence.d.ts +183 -0
- package/dist/registration-persistence.d.ts.map +1 -0
- package/dist/registration-persistence.js +263 -0
- package/dist/registration-persistence.js.map +1 -0
- package/dist/registry-poll.d.ts +52 -0
- package/dist/registry-poll.d.ts.map +1 -0
- package/dist/registry-poll.js +140 -0
- package/dist/registry-poll.js.map +1 -0
- package/dist/registry-version-store-db.d.ts +22 -0
- package/dist/registry-version-store-db.d.ts.map +1 -0
- package/dist/registry-version-store-db.js +50 -0
- package/dist/registry-version-store-db.js.map +1 -0
- package/dist/relay-endpoints.d.ts +18 -0
- package/dist/relay-endpoints.d.ts.map +1 -0
- package/dist/relay-endpoints.js +9 -0
- package/dist/relay-endpoints.js.map +1 -0
- package/dist/relay-only.d.ts +140 -0
- package/dist/relay-only.d.ts.map +1 -0
- package/dist/relay-only.js +193 -0
- package/dist/relay-only.js.map +1 -0
- package/dist/relay-receipt-store.d.ts +155 -0
- package/dist/relay-receipt-store.d.ts.map +1 -0
- package/dist/relay-receipt-store.js +284 -0
- package/dist/relay-receipt-store.js.map +1 -0
- package/dist/relay-reconnect.d.ts +32 -0
- package/dist/relay-reconnect.d.ts.map +1 -0
- package/dist/relay-reconnect.js +29 -0
- package/dist/relay-reconnect.js.map +1 -0
- package/dist/reply-lag.d.ts +11 -0
- package/dist/reply-lag.d.ts.map +1 -0
- package/dist/reply-lag.js +46 -0
- package/dist/reply-lag.js.map +1 -0
- package/dist/resolve-named-agent.d.ts +49 -0
- package/dist/resolve-named-agent.d.ts.map +1 -0
- package/dist/resolve-named-agent.js +77 -0
- package/dist/resolve-named-agent.js.map +1 -0
- package/dist/restart-seal-resolver.d.ts +110 -0
- package/dist/restart-seal-resolver.d.ts.map +1 -0
- package/dist/restart-seal-resolver.js +353 -0
- package/dist/restart-seal-resolver.js.map +1 -0
- package/dist/resume-last-seen.d.ts +15 -0
- package/dist/resume-last-seen.d.ts.map +1 -0
- package/dist/resume-last-seen.js +44 -0
- package/dist/resume-last-seen.js.map +1 -0
- package/dist/retry-queue.d.ts +203 -0
- package/dist/retry-queue.d.ts.map +1 -0
- package/dist/retry-queue.js +701 -0
- package/dist/retry-queue.js.map +1 -0
- package/dist/roster-freshness.d.ts +160 -0
- package/dist/roster-freshness.d.ts.map +1 -0
- package/dist/roster-freshness.js +250 -0
- package/dist/roster-freshness.js.map +1 -0
- package/dist/screening-status.d.ts +15 -0
- package/dist/screening-status.d.ts.map +1 -0
- package/dist/screening-status.js +65 -0
- package/dist/screening-status.js.map +1 -0
- package/dist/seal-carried-close.d.ts +37 -0
- package/dist/seal-carried-close.d.ts.map +1 -0
- package/dist/seal-carried-close.js +179 -0
- package/dist/seal-carried-close.js.map +1 -0
- package/dist/seal-certificate-pull.d.ts +79 -0
- package/dist/seal-certificate-pull.d.ts.map +1 -0
- package/dist/seal-certificate-pull.js +186 -0
- package/dist/seal-certificate-pull.js.map +1 -0
- package/dist/seal-certified-root-check.d.ts +37 -0
- package/dist/seal-certified-root-check.d.ts.map +1 -0
- package/dist/seal-certified-root-check.js +127 -0
- package/dist/seal-certified-root-check.js.map +1 -0
- package/dist/seal-coordinator.d.ts +118 -0
- package/dist/seal-coordinator.d.ts.map +1 -0
- package/dist/seal-coordinator.js +927 -0
- package/dist/seal-coordinator.js.map +1 -0
- package/dist/seal-escalation.d.ts +80 -0
- package/dist/seal-escalation.d.ts.map +1 -0
- package/dist/seal-escalation.js +283 -0
- package/dist/seal-escalation.js.map +1 -0
- package/dist/seal-evidence-root-check.d.ts +70 -0
- package/dist/seal-evidence-root-check.d.ts.map +1 -0
- package/dist/seal-evidence-root-check.js +199 -0
- package/dist/seal-evidence-root-check.js.map +1 -0
- package/dist/seal-failure-store.d.ts +139 -0
- package/dist/seal-failure-store.d.ts.map +1 -0
- package/dist/seal-failure-store.js +207 -0
- package/dist/seal-failure-store.js.map +1 -0
- package/dist/seal-flows.d.ts +107 -0
- package/dist/seal-flows.d.ts.map +1 -0
- package/dist/seal-flows.js +638 -0
- package/dist/seal-flows.js.map +1 -0
- package/dist/seal-frontier-verify.d.ts +103 -0
- package/dist/seal-frontier-verify.d.ts.map +1 -0
- package/dist/seal-frontier-verify.js +143 -0
- package/dist/seal-frontier-verify.js.map +1 -0
- package/dist/seal-leaf.d.ts +58 -0
- package/dist/seal-leaf.d.ts.map +1 -0
- package/dist/seal-leaf.js +112 -0
- package/dist/seal-leaf.js.map +1 -0
- package/dist/seal-legibility-tbs.d.ts +25 -0
- package/dist/seal-legibility-tbs.d.ts.map +1 -0
- package/dist/seal-legibility-tbs.js +77 -0
- package/dist/seal-legibility-tbs.js.map +1 -0
- package/dist/seal-local-terminus.d.ts +41 -0
- package/dist/seal-local-terminus.d.ts.map +1 -0
- package/dist/seal-local-terminus.js +170 -0
- package/dist/seal-local-terminus.js.map +1 -0
- package/dist/seal-receipt-upgrade.d.ts +30 -0
- package/dist/seal-receipt-upgrade.d.ts.map +1 -0
- package/dist/seal-receipt-upgrade.js +49 -0
- package/dist/seal-receipt-upgrade.js.map +1 -0
- package/dist/seal-relay-silence.d.ts +51 -0
- package/dist/seal-relay-silence.d.ts.map +1 -0
- package/dist/seal-relay-silence.js +76 -0
- package/dist/seal-relay-silence.js.map +1 -0
- package/dist/seal-settle.d.ts +38 -0
- package/dist/seal-settle.d.ts.map +1 -0
- package/dist/seal-settle.js +33 -0
- package/dist/seal-settle.js.map +1 -0
- package/dist/seal-upgrade.d.ts +107 -0
- package/dist/seal-upgrade.d.ts.map +1 -0
- package/dist/seal-upgrade.js +200 -0
- package/dist/seal-upgrade.js.map +1 -0
- package/dist/sealed-conversation.d.ts +36 -0
- package/dist/sealed-conversation.d.ts.map +1 -0
- package/dist/sealed-conversation.js +171 -0
- package/dist/sealed-conversation.js.map +1 -0
- package/dist/sealed-leaf-set.d.ts +92 -0
- package/dist/sealed-leaf-set.d.ts.map +1 -0
- package/dist/sealed-leaf-set.js +122 -0
- package/dist/sealed-leaf-set.js.map +1 -0
- package/dist/send-claims.d.ts +56 -0
- package/dist/send-claims.d.ts.map +1 -0
- package/dist/send-claims.js +50 -0
- package/dist/send-claims.js.map +1 -0
- package/dist/session-assignment-parser.d.ts +104 -0
- package/dist/session-assignment-parser.d.ts.map +1 -0
- package/dist/session-assignment-parser.js +345 -0
- package/dist/session-assignment-parser.js.map +1 -0
- package/dist/session-category.d.ts +19 -0
- package/dist/session-category.d.ts.map +1 -0
- package/dist/session-category.js +14 -0
- package/dist/session-category.js.map +1 -0
- package/dist/session-ceremony.d.ts +297 -0
- package/dist/session-ceremony.d.ts.map +1 -0
- package/dist/session-ceremony.js +964 -0
- package/dist/session-ceremony.js.map +1 -0
- package/dist/session-closed.d.ts +79 -0
- package/dist/session-closed.d.ts.map +1 -0
- package/dist/session-closed.js +189 -0
- package/dist/session-closed.js.map +1 -0
- package/dist/session-connection-gater.d.ts +148 -0
- package/dist/session-connection-gater.d.ts.map +1 -0
- package/dist/session-connection-gater.js +332 -0
- package/dist/session-connection-gater.js.map +1 -0
- package/dist/session-content-context.d.ts +162 -0
- package/dist/session-content-context.d.ts.map +1 -0
- package/dist/session-content-context.js +2 -0
- package/dist/session-content-context.js.map +1 -0
- package/dist/session-content-handlers.d.ts +82 -0
- package/dist/session-content-handlers.d.ts.map +1 -0
- package/dist/session-content-handlers.js +1382 -0
- package/dist/session-content-handlers.js.map +1 -0
- package/dist/session-content-ingest.d.ts +206 -0
- package/dist/session-content-ingest.d.ts.map +1 -0
- package/dist/session-content-ingest.js +2167 -0
- package/dist/session-content-ingest.js.map +1 -0
- package/dist/session-content-send.d.ts +191 -0
- package/dist/session-content-send.d.ts.map +1 -0
- package/dist/session-content-send.js +1360 -0
- package/dist/session-content-send.js.map +1 -0
- package/dist/session-delivery-acks.d.ts +169 -0
- package/dist/session-delivery-acks.d.ts.map +1 -0
- package/dist/session-delivery-acks.js +569 -0
- package/dist/session-delivery-acks.js.map +1 -0
- package/dist/session-ephemerals.d.ts +279 -0
- package/dist/session-ephemerals.d.ts.map +1 -0
- package/dist/session-ephemerals.js +591 -0
- package/dist/session-ephemerals.js.map +1 -0
- package/dist/session-leaf-records.d.ts +159 -0
- package/dist/session-leaf-records.d.ts.map +1 -0
- package/dist/session-leaf-records.js +408 -0
- package/dist/session-leaf-records.js.map +1 -0
- package/dist/session-lifecycle.d.ts +303 -0
- package/dist/session-lifecycle.d.ts.map +1 -0
- package/dist/session-lifecycle.js +1679 -0
- package/dist/session-lifecycle.js.map +1 -0
- package/dist/session-liveness.d.ts +135 -0
- package/dist/session-liveness.d.ts.map +1 -0
- package/dist/session-liveness.js +347 -0
- package/dist/session-liveness.js.map +1 -0
- package/dist/session-name.d.ts +35 -0
- package/dist/session-name.d.ts.map +1 -0
- package/dist/session-name.js +60 -0
- package/dist/session-name.js.map +1 -0
- package/dist/session-node-factory.d.ts +18 -0
- package/dist/session-node-factory.d.ts.map +1 -0
- package/dist/session-node-factory.js +182 -0
- package/dist/session-node-factory.js.map +1 -0
- package/dist/session-node-manager.d.ts +877 -0
- package/dist/session-node-manager.d.ts.map +1 -0
- package/dist/session-node-manager.js +2998 -0
- package/dist/session-node-manager.js.map +1 -0
- package/dist/session-node-types.d.ts +1057 -0
- package/dist/session-node-types.d.ts.map +1 -0
- package/dist/session-node-types.js +657 -0
- package/dist/session-node-types.js.map +1 -0
- package/dist/session-notify.d.ts +46 -0
- package/dist/session-notify.d.ts.map +1 -0
- package/dist/session-notify.js +116 -0
- package/dist/session-notify.js.map +1 -0
- package/dist/session-own-chain-store.d.ts +65 -0
- package/dist/session-own-chain-store.d.ts.map +1 -0
- package/dist/session-own-chain-store.js +75 -0
- package/dist/session-own-chain-store.js.map +1 -0
- package/dist/session-queries.d.ts +476 -0
- package/dist/session-queries.d.ts.map +1 -0
- package/dist/session-queries.js +1007 -0
- package/dist/session-queries.js.map +1 -0
- package/dist/session-read-handlers.d.ts +87 -0
- package/dist/session-read-handlers.d.ts.map +1 -0
- package/dist/session-read-handlers.js +689 -0
- package/dist/session-read-handlers.js.map +1 -0
- package/dist/session-records.d.ts +341 -0
- package/dist/session-records.d.ts.map +1 -0
- package/dist/session-records.js +858 -0
- package/dist/session-records.js.map +1 -0
- package/dist/session-relay-client.d.ts +659 -0
- package/dist/session-relay-client.d.ts.map +1 -0
- package/dist/session-relay-client.js +2876 -0
- package/dist/session-relay-client.js.map +1 -0
- package/dist/session-relay.d.ts +397 -0
- package/dist/session-relay.d.ts.map +1 -0
- package/dist/session-relay.js +1636 -0
- package/dist/session-relay.js.map +1 -0
- package/dist/session-salt-agreement.d.ts +331 -0
- package/dist/session-salt-agreement.d.ts.map +1 -0
- package/dist/session-salt-agreement.js +472 -0
- package/dist/session-salt-agreement.js.map +1 -0
- package/dist/session-salts.d.ts +432 -0
- package/dist/session-salts.d.ts.map +1 -0
- package/dist/session-salts.js +1540 -0
- package/dist/session-salts.js.map +1 -0
- package/dist/session-schema.d.ts +30 -0
- package/dist/session-schema.d.ts.map +1 -0
- package/dist/session-schema.js +877 -0
- package/dist/session-schema.js.map +1 -0
- package/dist/session-seal-leaf-store.d.ts +70 -0
- package/dist/session-seal-leaf-store.d.ts.map +1 -0
- package/dist/session-seal-leaf-store.js +105 -0
- package/dist/session-seal-leaf-store.js.map +1 -0
- package/dist/session-seal.d.ts +334 -0
- package/dist/session-seal.d.ts.map +1 -0
- package/dist/session-seal.js +1017 -0
- package/dist/session-seal.js.map +1 -0
- package/dist/session-terminal-refusal.d.ts +65 -0
- package/dist/session-terminal-refusal.d.ts.map +1 -0
- package/dist/session-terminal-refusal.js +87 -0
- package/dist/session-terminal-refusal.js.map +1 -0
- package/dist/session-tree.d.ts +110 -0
- package/dist/session-tree.d.ts.map +1 -0
- package/dist/session-tree.js +144 -0
- package/dist/session-tree.js.map +1 -0
- package/dist/session-views.d.ts +47 -0
- package/dist/session-views.d.ts.map +1 -0
- package/dist/session-views.js +278 -0
- package/dist/session-views.js.map +1 -0
- package/dist/signal-handlers.d.ts +63 -0
- package/dist/signal-handlers.d.ts.map +1 -0
- package/dist/signal-handlers.js +980 -0
- package/dist/signal-handlers.js.map +1 -0
- package/dist/signal-requirement-policy.d.ts +51 -0
- package/dist/signal-requirement-policy.d.ts.map +1 -0
- package/dist/signal-requirement-policy.js +89 -0
- package/dist/signal-requirement-policy.js.map +1 -0
- package/dist/signal-revocability.d.ts +49 -0
- package/dist/signal-revocability.d.ts.map +1 -0
- package/dist/signal-revocability.js +93 -0
- package/dist/signal-revocability.js.map +1 -0
- package/dist/signal-submission.d.ts +181 -0
- package/dist/signal-submission.d.ts.map +1 -0
- package/dist/signal-submission.js +368 -0
- package/dist/signal-submission.js.map +1 -0
- package/dist/signaling-connect.d.ts +118 -0
- package/dist/signaling-connect.d.ts.map +1 -0
- package/dist/signaling-connect.js +538 -0
- package/dist/signaling-connect.js.map +1 -0
- package/dist/signaling-wiring.d.ts +105 -0
- package/dist/signaling-wiring.d.ts.map +1 -0
- package/dist/signaling-wiring.js +393 -0
- package/dist/signaling-wiring.js.map +1 -0
- package/dist/singleton-lock.d.ts +85 -0
- package/dist/singleton-lock.d.ts.map +1 -0
- package/dist/singleton-lock.js +219 -0
- package/dist/singleton-lock.js.map +1 -0
- package/dist/sqlcipher-db.d.ts +139 -0
- package/dist/sqlcipher-db.d.ts.map +1 -0
- package/dist/sqlcipher-db.js +357 -0
- package/dist/sqlcipher-db.js.map +1 -0
- package/dist/standing-receivers.d.ts +319 -0
- package/dist/standing-receivers.d.ts.map +1 -0
- package/dist/standing-receivers.js +1295 -0
- package/dist/standing-receivers.js.map +1 -0
- package/dist/start-agent.d.ts +64 -0
- package/dist/start-agent.d.ts.map +1 -0
- package/dist/start-agent.js +136 -0
- package/dist/start-agent.js.map +1 -0
- package/dist/status-handler.d.ts +54 -0
- package/dist/status-handler.d.ts.map +1 -0
- package/dist/status-handler.js +61 -0
- package/dist/status-handler.js.map +1 -0
- package/dist/submission-retry.d.ts +208 -0
- package/dist/submission-retry.d.ts.map +1 -0
- package/dist/submission-retry.js +506 -0
- package/dist/submission-retry.js.map +1 -0
- package/dist/telegram-bot-client.d.ts +34 -0
- package/dist/telegram-bot-client.d.ts.map +1 -0
- package/dist/telegram-bot-client.js +36 -0
- package/dist/telegram-bot-client.js.map +1 -0
- package/dist/telegram-doorbell.d.ts +38 -0
- package/dist/telegram-doorbell.d.ts.map +1 -0
- package/dist/telegram-doorbell.js +140 -0
- package/dist/telegram-doorbell.js.map +1 -0
- package/dist/test-handlers.d.ts +62 -0
- package/dist/test-handlers.d.ts.map +1 -0
- package/dist/test-handlers.js +240 -0
- package/dist/test-handlers.js.map +1 -0
- package/dist/testing.d.ts +10 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +10 -0
- package/dist/testing.js.map +1 -0
- package/dist/transport-composition.d.ts +31 -0
- package/dist/transport-composition.d.ts.map +1 -0
- package/dist/transport-composition.js +55 -0
- package/dist/transport-composition.js.map +1 -0
- package/dist/transport-selector.d.ts +202 -0
- package/dist/transport-selector.d.ts.map +1 -0
- package/dist/transport-selector.js +196 -0
- package/dist/transport-selector.js.map +1 -0
- package/dist/trust-signal-pickup-listener.d.ts +43 -0
- package/dist/trust-signal-pickup-listener.d.ts.map +1 -0
- package/dist/trust-signal-pickup-listener.js +48 -0
- package/dist/trust-signal-pickup-listener.js.map +1 -0
- package/dist/trust-signal-store.d.ts +406 -0
- package/dist/trust-signal-store.d.ts.map +1 -0
- package/dist/trust-signal-store.js +939 -0
- package/dist/trust-signal-store.js.map +1 -0
- package/dist/trust-signal-sweep-tick.d.ts +60 -0
- package/dist/trust-signal-sweep-tick.d.ts.map +1 -0
- package/dist/trust-signal-sweep-tick.js +101 -0
- package/dist/trust-signal-sweep-tick.js.map +1 -0
- package/dist/trust-signal-sweep.d.ts +94 -0
- package/dist/trust-signal-sweep.d.ts.map +1 -0
- package/dist/trust-signal-sweep.js +147 -0
- package/dist/trust-signal-sweep.js.map +1 -0
- package/dist/type-registry.d.ts +42 -0
- package/dist/type-registry.d.ts.map +1 -0
- package/dist/type-registry.js +37 -0
- package/dist/type-registry.js.map +1 -0
- package/dist/types.d.ts +746 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +20 -0
- package/dist/types.js.map +1 -0
- package/dist/unresolved-nodes-report.d.ts +14 -0
- package/dist/unresolved-nodes-report.d.ts.map +1 -0
- package/dist/unresolved-nodes-report.js +96 -0
- package/dist/unresolved-nodes-report.js.map +1 -0
- package/dist/vocabulary.d.ts +150 -0
- package/dist/vocabulary.d.ts.map +1 -0
- package/dist/vocabulary.js +386 -0
- package/dist/vocabulary.js.map +1 -0
- package/dist/who-label.d.ts +28 -0
- package/dist/who-label.d.ts.map +1 -0
- package/dist/who-label.js +31 -0
- package/dist/who-label.js.map +1 -0
- package/dist/who-resolver.d.ts +15 -0
- package/dist/who-resolver.d.ts.map +1 -0
- package/dist/who-resolver.js +47 -0
- package/dist/who-resolver.js.map +1 -0
- package/dist/wire-content-hash.d.ts +93 -0
- package/dist/wire-content-hash.d.ts.map +1 -0
- package/dist/wire-content-hash.js +116 -0
- package/dist/wire-content-hash.js.map +1 -0
- package/dist/withheld-content.d.ts +13 -0
- package/dist/withheld-content.d.ts.map +1 -0
- package/dist/withheld-content.js +46 -0
- package/dist/withheld-content.js.map +1 -0
- package/dist/witness-alerts.d.ts +40 -0
- package/dist/witness-alerts.d.ts.map +1 -0
- package/dist/witness-alerts.js +102 -0
- package/dist/witness-alerts.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,1295 @@
|
|
|
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
|