@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,858 @@
|
|
|
1
|
+
import { normalizeContactPubkey } from "./contact-pubkey-case.js";
|
|
2
|
+
import { TIER, normalizeTier, isKnownTierValue, tierBoundsFor } from "./contacts-tier-migration.js";
|
|
3
|
+
import { boundSettingKey, settableTierName, isValidSettingKey } from "./agent-settings-keys.js";
|
|
4
|
+
import { MONIKER_RE, validateMoniker } from "@cello-protocol/protocol-types";
|
|
5
|
+
import { UNREAD_RECEIVED_WHERE, TERMINAL_STATUSES } from "./session-node-types.js";
|
|
6
|
+
import { quarantineRedaction } from "./quarantine-framing.js";
|
|
7
|
+
import { extractErrorMessage } from "./error-message.js";
|
|
8
|
+
import { storeDeliveryAck, storeGivenDeliveryAck, sentContentHashExists } from "./session-delivery-acks.js";
|
|
9
|
+
import { recordLastAck } from "./resume-last-seen.js";
|
|
10
|
+
export class SessionRecords {
|
|
11
|
+
#ctx;
|
|
12
|
+
constructor(ctx) {
|
|
13
|
+
this.#ctx = ctx;
|
|
14
|
+
}
|
|
15
|
+
/** See `SessionRecordsContext.db` — a getter so the moved queries are unchanged. */
|
|
16
|
+
get #db() {
|
|
17
|
+
return this.#ctx.db();
|
|
18
|
+
}
|
|
19
|
+
#diverged = new Set();
|
|
20
|
+
/** M8C-CONTACT-1: is this pubkey a known contact of this agent? */
|
|
21
|
+
isContact(agentName, pubkey) {
|
|
22
|
+
if (!this.#db)
|
|
23
|
+
return false;
|
|
24
|
+
const row = this.#db.prepare("SELECT 1 FROM contacts WHERE agent_id = ? AND pubkey = ?").get(this.#ctx.requireAgentId(agentName), normalizeContactPubkey(pubkey));
|
|
25
|
+
return row !== undefined;
|
|
26
|
+
}
|
|
27
|
+
/** DOD-TIER-1: the reachability tier for a counterparty of this agent. The RESULT is total — an
|
|
28
|
+
* absent contact row (undefined), a NULL `tier`, or a corrupt out-of-range value all resolve to
|
|
29
|
+
* UNKNOWN via `normalizeTier`, so the return is always in 0..4 and guards the JS `null >= 0`/`0 ||
|
|
30
|
+
* 1`/`grid[99]` traps. It is a SECURITY read (Step 2 gates inbound bounds on it), so it FAILS
|
|
31
|
+
* CLOSED, never open: an uninitialized DB throws (same contract as addContact) rather than
|
|
32
|
+
* silently returning UNKNOWN and admitting a BLOCKED sender; an unresolvable/retired agent name
|
|
33
|
+
* throws via #requireAgentId. Both are invariant violations a caller must surface, not swallow. */
|
|
34
|
+
getTier(agentName, pubkey) {
|
|
35
|
+
// Fail CLOSED: a read that decides whether to admit a sender must not degrade to "unclassified"
|
|
36
|
+
// when it cannot reach the ACL — that would admit a blocked contact. Throw as addContact does.
|
|
37
|
+
if (!this.#db)
|
|
38
|
+
throw new Error(`getTier('${agentName}'): database not initialized`);
|
|
39
|
+
const row = this.#db
|
|
40
|
+
.prepare("SELECT tier FROM contacts WHERE agent_id = ? AND pubkey = ?")
|
|
41
|
+
.get(this.#ctx.requireAgentId(agentName), normalizeContactPubkey(pubkey));
|
|
42
|
+
if (row && row.tier !== null && !isKnownTierValue(row.tier)) {
|
|
43
|
+
// A stored tier outside 0..4 is corruption — surface it. normalizeTier still maps it to the
|
|
44
|
+
// tighter UNKNOWN so the caller is safe, but a silent map would hide a broken row.
|
|
45
|
+
this.#ctx.logger.warn("contact.tier.corrupt", { agentName, pubkey, storedTier: row.tier });
|
|
46
|
+
}
|
|
47
|
+
return normalizeTier(row?.tier);
|
|
48
|
+
}
|
|
49
|
+
/** DOD-TIER-BOUNDS-SETTINGS: the effective bound for (agent, tier, field) — a per-agent SETTINGS
|
|
50
|
+
* override if one is set and valid, else the hardcoded grid default (DEFAULT_TIER_BOUNDS). With no
|
|
51
|
+
* settings this is byte-identical to Step 2 (the daemon runs on defaults alone). A stored value
|
|
52
|
+
* that is somehow non-positive/non-finite (should be impossible — validated at SET time) falls back
|
|
53
|
+
* to the grid default rather than removing the bound (INV-TIER-BOUND, defensive). BLOCKED is never
|
|
54
|
+
* settable — it always returns the fixed grid value (0). */
|
|
55
|
+
resolveTierBound(agentName, tier, field) {
|
|
56
|
+
const gridDefault = field === "max_sessions"
|
|
57
|
+
? tierBoundsFor(tier).maxSessionsPerSender
|
|
58
|
+
: tierBoundsFor(tier).maxBytesPerSession;
|
|
59
|
+
const name = settableTierName(tier);
|
|
60
|
+
if (name === null)
|
|
61
|
+
return gridDefault; // BLOCKED or out-of-range — fixed, not overridable
|
|
62
|
+
const raw = this.getSetting(agentName, boundSettingKey(name, field));
|
|
63
|
+
if (raw === null)
|
|
64
|
+
return gridDefault; // unset → default
|
|
65
|
+
const parsed = Number(raw);
|
|
66
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
67
|
+
// Should be impossible (validated at SET time) → a config-integrity failure. Surface it: this
|
|
68
|
+
// reverts a possibly-TIGHTENED bound to the looser default, so a silent revert would hide a real
|
|
69
|
+
// problem. Still fail SAFE (grid default, never unbounded — INV-TIER-BOUND).
|
|
70
|
+
this.#ctx.logger.warn("settings.bound.corrupt", { agentName, tier, field, raw });
|
|
71
|
+
return gridDefault;
|
|
72
|
+
}
|
|
73
|
+
return parsed;
|
|
74
|
+
}
|
|
75
|
+
/** M8C-CONTACT-1: pin a contact at add time — idempotent (re-adding an existing contact is a
|
|
76
|
+
* no-op, never refreshes added_at; identity does not get re-resolved). MONIKER-3 AC2: an
|
|
77
|
+
* optional pet name; a NEW non-null moniker on re-add updates it, absence leaves it untouched.
|
|
78
|
+
* THROWS on an invalid moniker — callers validate first; this is the can-never-be-stored
|
|
79
|
+
* backstop (same contract as DbIdentityStore.setMoniker).
|
|
80
|
+
*
|
|
81
|
+
* DOD-TIER-1/4: a NEW row is stamped `tier` (never NULL) and an optional `provenance`
|
|
82
|
+
* ('accepted' | 'initiated' | null). The `tier` defaults to the least-privilege UNKNOWN floor —
|
|
83
|
+
* a caller GRANTS trust by passing a higher tier explicitly. Every production creation path is a
|
|
84
|
+
* deliberate operator action and passes KNOWN (initiate, engage/reply, explicit cello_contact_add
|
|
85
|
+
* — DEC-AB-1). INSERT OR IGNORE means an EXISTING contact is untouched — tier and provenance pin
|
|
86
|
+
* at first add, exactly as `added_at`/`moniker` already do; re-adding never downgrades a contact
|
|
87
|
+
* the operator has since promoted. Raising the tier later is `cello_contact_set_tier`'s job. */
|
|
88
|
+
addContact(agentName, pubkey, moniker, provenance, tier = TIER.UNKNOWN) {
|
|
89
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
90
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
91
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
92
|
+
if (!pubkey)
|
|
93
|
+
return;
|
|
94
|
+
// Review F1: a missing DB handle must FAIL the write loudly — returning silently here let
|
|
95
|
+
// the handler log contact.added and report ok:true for a row that never landed.
|
|
96
|
+
if (!this.#db)
|
|
97
|
+
throw new Error(`addContact('${agentName}'): database not initialized`);
|
|
98
|
+
if (moniker !== undefined && moniker !== null && validateMoniker(moniker) === null) {
|
|
99
|
+
throw new Error(`invalid contact moniker for agent '${agentName}': must match ${MONIKER_RE.source}`);
|
|
100
|
+
}
|
|
101
|
+
// DOD-TIER-4 (review F3): the stored tier must be a known 0..4 constant — a can-never-be-stored
|
|
102
|
+
// backstop mirroring the moniker validation above. All callers pass a TIER constant; this catches
|
|
103
|
+
// a future caller (or a bad refactor) that would otherwise persist a corrupt tier the read side
|
|
104
|
+
// must then defensively normalize.
|
|
105
|
+
if (!isKnownTierValue(tier)) {
|
|
106
|
+
throw new Error(`invalid contact tier for agent '${agentName}': ${tier} (must be 0..4)`);
|
|
107
|
+
}
|
|
108
|
+
const agentId = this.#ctx.requireAgentId(agentName);
|
|
109
|
+
this.#db
|
|
110
|
+
.prepare("INSERT OR IGNORE INTO contacts (agent_id, pubkey, added_at, tier, provenance) VALUES (?, ?, ?, ?, ?)")
|
|
111
|
+
.run(agentId, pubkey, Date.now(), tier, provenance ?? null);
|
|
112
|
+
if (moniker !== undefined && moniker !== null) {
|
|
113
|
+
this.#db
|
|
114
|
+
.prepare("UPDATE contacts SET moniker = ? WHERE agent_id = ? AND pubkey = ?")
|
|
115
|
+
.run(moniker, agentId, pubkey);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/** MONIKER-3 AC3: rename (string) or clear (null) an EXISTING contact's pet name. Returns false
|
|
119
|
+
* when no such contact — fail-loud at the caller, never a silent no-op success. Same
|
|
120
|
+
* validate-throw backstop as addContact. */
|
|
121
|
+
setContactMoniker(agentName, pubkey, moniker) {
|
|
122
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
123
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
124
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
125
|
+
// Review F2: false means exactly "no such contact" — a null DB handle throws instead, so the
|
|
126
|
+
// operator is never sent chasing a nonexistent missing-contact problem.
|
|
127
|
+
if (!this.#db)
|
|
128
|
+
throw new Error(`setContactMoniker('${agentName}'): database not initialized`);
|
|
129
|
+
if (moniker !== null && validateMoniker(moniker) === null) {
|
|
130
|
+
throw new Error(`invalid contact moniker for agent '${agentName}': must match ${MONIKER_RE.source}`);
|
|
131
|
+
}
|
|
132
|
+
const res = this.#db
|
|
133
|
+
.prepare("UPDATE contacts SET moniker = ? WHERE agent_id = ? AND pubkey = ?")
|
|
134
|
+
.run(moniker, this.#ctx.requireAgentId(agentName), pubkey);
|
|
135
|
+
// DOD-RENAME-1: setting the local pet name IS the operator acting on a rename — resolve any
|
|
136
|
+
// pending notice for this contact (whether they adopted the offered name or chose their own).
|
|
137
|
+
if (res.changes > 0)
|
|
138
|
+
this.clearRenameNotice(agentName, pubkey);
|
|
139
|
+
return res.changes > 0;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* M10B / DOD-END-SURFACE-1 — decide whether ONE signal is presented to ONE counterparty.
|
|
143
|
+
*
|
|
144
|
+
* `present: null` CLEARS the choice, which is not the same as `false`: cleared means "no opinion,
|
|
145
|
+
* use the signal's own default", while false means "specifically not this person". Collapsing
|
|
146
|
+
* them would make an operator unable to undo an omission without knowing what the default was.
|
|
147
|
+
*
|
|
148
|
+
* Deliberately does NOT require an existing contact row, unlike the tier/moniker/away setters. A
|
|
149
|
+
* decision about what to disclose is meaningful before a relationship is established — indeed
|
|
150
|
+
* that is when it matters most — and refusing here would force the operator to add someone as a
|
|
151
|
+
* contact in order to withhold something from them.
|
|
152
|
+
*/
|
|
153
|
+
setContactSignalPref(agentName, pubkey, signalHash, present) {
|
|
154
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
155
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
156
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
157
|
+
if (!this.#db)
|
|
158
|
+
throw new Error(`setContactSignalPref('${agentName}'): database not initialized`);
|
|
159
|
+
const agentId = this.#ctx.requireAgentId(agentName);
|
|
160
|
+
if (present === null) {
|
|
161
|
+
this.#db
|
|
162
|
+
.prepare("DELETE FROM contact_signal_prefs WHERE agent_id = ? AND contact_pubkey = ? AND signal_hash = ?")
|
|
163
|
+
.run(agentId, pubkey, signalHash);
|
|
164
|
+
this.#ctx.logger.info("signal.presentation.pref.cleared", { agentName, pubkey: pubkey.slice(0, 16), signalHash: signalHash.slice(0, 16) });
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this.#db
|
|
168
|
+
.prepare(`INSERT INTO contact_signal_prefs (agent_id, contact_pubkey, signal_hash, present, set_at)
|
|
169
|
+
VALUES (?, ?, ?, ?, ?)
|
|
170
|
+
ON CONFLICT(agent_id, contact_pubkey, signal_hash) DO UPDATE SET present = excluded.present, set_at = excluded.set_at`)
|
|
171
|
+
.run(agentId, pubkey, signalHash, present ? 1 : 0, Date.now());
|
|
172
|
+
this.#ctx.logger.info("signal.presentation.pref.set", {
|
|
173
|
+
agentName, pubkey: pubkey.slice(0, 16), signalHash: signalHash.slice(0, 16), present,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The explicit per-counterparty choices for this contact: signal hash → present.
|
|
178
|
+
*
|
|
179
|
+
* A signal ABSENT from this map has no choice recorded and falls back to its own
|
|
180
|
+
* `default_present`. Returns an EMPTY map on an uninitialised DB rather than throwing, because
|
|
181
|
+
* this is a preference read on the presentation path and losing preferences must not break a
|
|
182
|
+
* session — but note the direction that failure takes: with no preferences, `default_present`
|
|
183
|
+
* decides, and consent still gates everything upstream in SQL. It can therefore only fall back to
|
|
184
|
+
* the operator's standing default, never to disclosing something consent has not cleared.
|
|
185
|
+
*/
|
|
186
|
+
getContactSignalPrefs(agentName, pubkey) {
|
|
187
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
188
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
189
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
190
|
+
if (!this.#db)
|
|
191
|
+
return new Map();
|
|
192
|
+
const rows = this.#db
|
|
193
|
+
.prepare("SELECT signal_hash, present FROM contact_signal_prefs WHERE agent_id = ? AND contact_pubkey = ?")
|
|
194
|
+
.all(this.#ctx.requireAgentId(agentName), pubkey);
|
|
195
|
+
return new Map(rows.map((r) => [r.signal_hash, r.present !== 0]));
|
|
196
|
+
}
|
|
197
|
+
/** DOD-AWAY-TIER-1: set (or clear, with null) a contact's per-contact away message. Returns false
|
|
198
|
+
* when no such contact — fail-loud at the caller (same contract as setContactMoniker/setContactTier). */
|
|
199
|
+
setContactAwayMessage(agentName, pubkey, message) {
|
|
200
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
201
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
202
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
203
|
+
if (!this.#db)
|
|
204
|
+
throw new Error(`setContactAwayMessage('${agentName}'): database not initialized`);
|
|
205
|
+
const res = this.#db
|
|
206
|
+
.prepare("UPDATE contacts SET away_message = ? WHERE agent_id = ? AND pubkey = ?")
|
|
207
|
+
.run(message, this.#ctx.requireAgentId(agentName), pubkey);
|
|
208
|
+
return res.changes > 0;
|
|
209
|
+
}
|
|
210
|
+
/** DOD-CONTACT-VIEW-1: set an EXISTING contact's reachability tier. Returns false when no such
|
|
211
|
+
* contact — fail-loud at the caller, never a silent no-op success (same contract as
|
|
212
|
+
* setContactMoniker). The caller validates the tier is a known constant BEFORE calling; this
|
|
213
|
+
* stores whatever it is handed (the handler is the validation boundary). */
|
|
214
|
+
setContactTier(agentName, pubkey, tier) {
|
|
215
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
216
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
217
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
218
|
+
if (!this.#db)
|
|
219
|
+
throw new Error(`setContactTier('${agentName}'): database not initialized`);
|
|
220
|
+
const res = this.#db
|
|
221
|
+
.prepare("UPDATE contacts SET tier = ? WHERE agent_id = ? AND pubkey = ?")
|
|
222
|
+
.run(tier, this.#ctx.requireAgentId(agentName), pubkey);
|
|
223
|
+
return res.changes > 0;
|
|
224
|
+
}
|
|
225
|
+
/** DOD-RENAME-1 (Option C): record a self-declared name a peer offered, at the moment the offer is
|
|
226
|
+
* SEEN. The stored local pet name (contacts.moniker) is SACROSANCT — this only ever touches
|
|
227
|
+
* last_offered_moniker and the notice queue, never the moniker (AC2). A rename NOTICE is queued
|
|
228
|
+
* only when the peer is a contact the operator has PERSONALLY NAMED (moniker non-null), a name was
|
|
229
|
+
* seen BEFORE (last_offered_moniker non-null), and the new offer DIFFERS (AC3). The first-ever
|
|
230
|
+
* offer just records the baseline (no notice); a repeat of the same name is idempotent (AC4).
|
|
231
|
+
* Called only when a moniker WAS offered (caller-guarded), so silence never clears the baseline
|
|
232
|
+
* (AC5). Limitation: last_offered_moniker updates only on the RECEIVING side of an offer, so rename
|
|
233
|
+
* detection works only for peers who INITIATE to you — a property, not a bug. */
|
|
234
|
+
recordOfferedMoniker(agentName, pubkey, offered) {
|
|
235
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
236
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
237
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
238
|
+
// Fail CLOSED like getTier/setContactTier: a silent skip here would drop a rename baseline update
|
|
239
|
+
// (and any notice) while the daemon reports healthy — the inbound path always has an open DB.
|
|
240
|
+
if (!this.#db)
|
|
241
|
+
throw new Error(`recordOfferedMoniker('${agentName}'): database not initialized`);
|
|
242
|
+
const agentId = this.#ctx.requireAgentId(agentName);
|
|
243
|
+
const row = this.#db
|
|
244
|
+
.prepare("SELECT last_offered_moniker, moniker FROM contacts WHERE agent_id = ? AND pubkey = ?")
|
|
245
|
+
.get(agentId, pubkey);
|
|
246
|
+
if (!row)
|
|
247
|
+
return; // not a contact — no row to hold a baseline or a notice
|
|
248
|
+
if (offered === row.last_offered_moniker)
|
|
249
|
+
return; // idempotent — same name already seen (AC4)
|
|
250
|
+
// A genuine change from a previously-seen name, for a contact the operator has named → notice.
|
|
251
|
+
if (row.last_offered_moniker !== null && row.moniker !== null) {
|
|
252
|
+
this.#db
|
|
253
|
+
.prepare("INSERT OR REPLACE INTO contact_rename_notices (agent_id, pubkey, offered_name, noticed_at) VALUES (?, ?, ?, ?)")
|
|
254
|
+
.run(agentId, pubkey, offered, Date.now());
|
|
255
|
+
// Observability: log the FACT, never the attacker-chosen name (same rule as moniker.rejected).
|
|
256
|
+
this.#ctx.logger.info("contact.rename.noticed", { agentName, pubkey });
|
|
257
|
+
}
|
|
258
|
+
this.#db
|
|
259
|
+
.prepare("UPDATE contacts SET last_offered_moniker = ? WHERE agent_id = ? AND pubkey = ?")
|
|
260
|
+
.run(offered, agentId, pubkey);
|
|
261
|
+
}
|
|
262
|
+
/** M8C-CONTACT-1: known stays known until explicitly removed. */
|
|
263
|
+
removeContact(agentName, pubkey) {
|
|
264
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
265
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
266
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
267
|
+
if (!this.#db)
|
|
268
|
+
return false;
|
|
269
|
+
const res = this.#db.prepare("DELETE FROM contacts WHERE agent_id = ? AND pubkey = ?").run(this.#ctx.requireAgentId(agentName), pubkey);
|
|
270
|
+
// DOD-RENAME-1: a removed contact has no pending rename to resolve.
|
|
271
|
+
if (res.changes > 0)
|
|
272
|
+
this.clearRenameNotice(agentName, pubkey);
|
|
273
|
+
/**
|
|
274
|
+
* OUTSIDE the `changes > 0` guard — review N2, and inside it the F2 fix did nothing for the
|
|
275
|
+
* case that matters.
|
|
276
|
+
*
|
|
277
|
+
* The pin is written on every ACCEPTED INBOUND session. A contact row is written only on an
|
|
278
|
+
* outbound initiate, an explicit add, a reply, or a trust-signal presentation — and an inbound
|
|
279
|
+
* requester is deliberately NOT auto-added. So a counterparty you never replied to (away-mode
|
|
280
|
+
* auto-ack is exactly this) has a pin and no contact row.
|
|
281
|
+
*
|
|
282
|
+
* Guarded, `cello_contact_remove` for them returned `{ ok: true, removed: false }`, cleared
|
|
283
|
+
* nothing, and the identity refusal stayed permanent — the original lockout, now wearing an
|
|
284
|
+
* `ok: true`, which is harder to notice than the original.
|
|
285
|
+
*/
|
|
286
|
+
const pinsCleared = this.clearPinnedCounterpartyPrimary(agentName, pubkey);
|
|
287
|
+
return res.changes > 0 || pinsCleared > 0;
|
|
288
|
+
}
|
|
289
|
+
/** MONIKER-4: the operator's pet name for a pubkey (whoLabel's top tier), or null. Read-only
|
|
290
|
+
* and tolerant of a not-yet-open DB (a missing label degrades the doorbell, never blocks it). */
|
|
291
|
+
getContactMoniker(agentName, pubkey) {
|
|
292
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
293
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
294
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
295
|
+
if (!this.#db) {
|
|
296
|
+
// Review F2: the last fully-silent branch in the resolution chain — the label degrades to
|
|
297
|
+
// fingerprint, which is correct, but say so rather than returning null wordlessly.
|
|
298
|
+
this.#ctx.logger.debug("moniker.local.db_unavailable", { agentName, pubkey });
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
const row = this.#db
|
|
302
|
+
.prepare("SELECT moniker FROM contacts WHERE agent_id = ? AND pubkey = ?")
|
|
303
|
+
.get(this.#ctx.requireAgentId(agentName), pubkey);
|
|
304
|
+
return row?.moniker ?? null;
|
|
305
|
+
}
|
|
306
|
+
/** M8C-CONTACT-1 + DOD-CONTACT-VIEW-1: list an agent's contacts, oldest-added first, each with its
|
|
307
|
+
* pet name (MONIKER-3), tier + provenance (the address-book metadata), and a READ-side LEFT JOIN
|
|
308
|
+
* against `sessions` for how many SEALED sessions were shared and when they last spoke (MAX
|
|
309
|
+
* updated_at). No new stored data — a pure read. A contact with no sessions shows 0 / null (never),
|
|
310
|
+
* not an error. The JOIN is scoped by agent_id so one agent's sessions never bleed into another's. */
|
|
311
|
+
listContacts(agentName) {
|
|
312
|
+
if (!this.#db)
|
|
313
|
+
return [];
|
|
314
|
+
return this.#db
|
|
315
|
+
.prepare(`SELECT c.pubkey, c.added_at, c.moniker, c.tier, c.provenance,
|
|
316
|
+
COUNT(CASE WHEN s.status = 'sealed' THEN 1 END) AS sealed_count,
|
|
317
|
+
MAX(s.updated_at) AS last_spoke
|
|
318
|
+
FROM contacts c
|
|
319
|
+
LEFT JOIN sessions s ON s.agent_id = c.agent_id AND s.counterparty_pubkey = c.pubkey
|
|
320
|
+
WHERE c.agent_id = ?
|
|
321
|
+
GROUP BY c.pubkey, c.added_at, c.moniker, c.tier, c.provenance
|
|
322
|
+
ORDER BY c.added_at ASC`)
|
|
323
|
+
.all(this.#ctx.requireAgentId(agentName));
|
|
324
|
+
}
|
|
325
|
+
/** DOD-RENAME-1: clear a pending rename notice — the operator acted (adopted a name or removed the
|
|
326
|
+
* contact). Idempotent (no notice → no-op). Fail-closed on a missing DB, like the writes above. */
|
|
327
|
+
clearRenameNotice(agentName, pubkey) {
|
|
328
|
+
// A public key is bytes; its hex case is not part of its identity. Normalized HERE so the
|
|
329
|
+
// query below cannot see two spellings of one contact — see `contact-pubkey-case.ts`.
|
|
330
|
+
pubkey = normalizeContactPubkey(pubkey);
|
|
331
|
+
if (!this.#db)
|
|
332
|
+
throw new Error(`clearRenameNotice('${agentName}'): database not initialized`);
|
|
333
|
+
this.#db
|
|
334
|
+
.prepare("DELETE FROM contact_rename_notices WHERE agent_id = ? AND pubkey = ?")
|
|
335
|
+
.run(this.#ctx.requireAgentId(agentName), pubkey);
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Forget the pinned threshold group key for a counterparty, so the next session re-pins.
|
|
339
|
+
*
|
|
340
|
+
* DOD-M15-OFFER-SIGNED-1 review F2 — WITHOUT THIS THE REFUSAL WAS PERMANENT. The identity-change
|
|
341
|
+
* check refuses a counterparty whose group key differs from the one recorded in an earlier
|
|
342
|
+
* session, and its guidance told the operator to confirm out of band and then remove the contact
|
|
343
|
+
* so the new identity is pinned afresh. `removeContact` deleted a row in `contacts`; the pin lives
|
|
344
|
+
* in `sessions.counterparty_primary_pubkey`, and nothing in the daemon ever cleared it.
|
|
345
|
+
*
|
|
346
|
+
* So an operator who did exactly as instructed — called their counterparty, confirmed the
|
|
347
|
+
* re-registration was genuine, removed the contact, retried — got the identical refusal, with no
|
|
348
|
+
* way out short of editing the database. A security control that cannot be reset by the person it
|
|
349
|
+
* protects is a lockout, and the printed remedy made it worse by reading as though it worked.
|
|
350
|
+
*
|
|
351
|
+
* Nulls the column rather than deleting the session rows: those rows are the transcript record,
|
|
352
|
+
* and a re-pin is not a reason to lose them.
|
|
353
|
+
*/
|
|
354
|
+
clearPinnedCounterpartyPrimary(agentName, counterpartyPubkeyHex) {
|
|
355
|
+
if (!this.#db)
|
|
356
|
+
return 0;
|
|
357
|
+
const res = this.#db
|
|
358
|
+
.prepare(
|
|
359
|
+
// NO `updated_at` BUMP — review N6. `CAP_COUNTS` counts an interrupted session only while
|
|
360
|
+
// `updated_at` is inside the staleness window, so touching it here reset the clock on every
|
|
361
|
+
// stale session with that counterparty, re-inflating their per-sender cap — while removing
|
|
362
|
+
// the contact simultaneously dropped them to UNKNOWN tier, which LOWERS it. The operator
|
|
363
|
+
// follows the printed remedy and their counterparty's next session is refused for cap,
|
|
364
|
+
// through a reason string deliberately identical to every other refusal. A second lockout
|
|
365
|
+
// that says nothing. Nothing needs the timestamp: every candidate row ends up NULL.
|
|
366
|
+
"UPDATE sessions SET counterparty_primary_pubkey = NULL WHERE agent_id = ? AND counterparty_pubkey = ?")
|
|
367
|
+
.run(this.#ctx.requireAgentId(agentName), counterpartyPubkeyHex);
|
|
368
|
+
return Number(res.changes);
|
|
369
|
+
}
|
|
370
|
+
/** M8C-TGDOOR-1: the daemon-wide Telegram bot settings, or null if never configured. */
|
|
371
|
+
getTelegramSettings() {
|
|
372
|
+
if (!this.#db)
|
|
373
|
+
return null;
|
|
374
|
+
const row = this.#db
|
|
375
|
+
.prepare("SELECT bot_token, allowlisted_chat_id FROM telegram_settings WHERE id = 1")
|
|
376
|
+
.get();
|
|
377
|
+
return row ? { botToken: row.bot_token, allowlistedChatId: row.allowlisted_chat_id } : null;
|
|
378
|
+
}
|
|
379
|
+
/** M8C-TGDOOR-1: persist (or replace) the singleton Telegram settings row. */
|
|
380
|
+
setTelegramSettings(botToken, allowlistedChatId) {
|
|
381
|
+
if (!this.#db)
|
|
382
|
+
return;
|
|
383
|
+
this.#db
|
|
384
|
+
.prepare(`INSERT INTO telegram_settings (id, bot_token, allowlisted_chat_id, updated_at) VALUES (1, ?, ?, ?)
|
|
385
|
+
ON CONFLICT(id) DO UPDATE SET bot_token = excluded.bot_token, allowlisted_chat_id = excluded.allowlisted_chat_id, updated_at = excluded.updated_at`)
|
|
386
|
+
.run(botToken, allowlistedChatId, Date.now());
|
|
387
|
+
}
|
|
388
|
+
/** DOD-SETTINGS-1: read a per-agent setting, or null if unset. The get-with-default is the CALLER's
|
|
389
|
+
* job (an unset key falls back to the hardcoded grid/system default — the daemon runs correctly on
|
|
390
|
+
* defaults alone, AC3). Returns null on a missing DB (settings are always optional). */
|
|
391
|
+
getSetting(agentName, key) {
|
|
392
|
+
if (!this.#db)
|
|
393
|
+
return null;
|
|
394
|
+
const row = this.#db
|
|
395
|
+
.prepare("SELECT value FROM agent_settings WHERE agent_id = ? AND key = ?")
|
|
396
|
+
.get(this.#ctx.requireAgentId(agentName), key);
|
|
397
|
+
return row?.value ?? null;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* DOD-SETTINGS-1: DELETE a per-agent setting so the built-in default applies again.
|
|
401
|
+
*
|
|
402
|
+
* Deleting is NOT storing "". `getSetting` returns null for both, but the away-text resolver walks
|
|
403
|
+
* per-contact → per-tier → agent-default → system default, and an empty string is a VALUE that
|
|
404
|
+
* wins that walk and blanks the reply. Unsetting is the only way back to the default, and until
|
|
405
|
+
* this existed there was no way back at all: `cello_settings_set` accepted a string, refused an
|
|
406
|
+
* empty one, and told the caller to "pass null to clear" — a null it coerced to undefined and
|
|
407
|
+
* rejected as missing_params. Following that guidance from the CLI set the literal text "null",
|
|
408
|
+
* so an operator trying to remove their away message ended up broadcasting the word "null" to
|
|
409
|
+
* every caller.
|
|
410
|
+
*
|
|
411
|
+
* Returns whether a row was actually removed, so the handler can report what it did rather than
|
|
412
|
+
* claiming a clear it never performed.
|
|
413
|
+
*/
|
|
414
|
+
deleteSetting(agentName, key) {
|
|
415
|
+
if (!this.#db)
|
|
416
|
+
throw new Error(`deleteSetting('${agentName}'): database not initialized`);
|
|
417
|
+
// Same dual-layer key check as setSetting — an unknown key here means a caller hand-typed one,
|
|
418
|
+
// and silently reporting "cleared" for a key that never existed would be the same class of lie.
|
|
419
|
+
if (!isValidSettingKey(key))
|
|
420
|
+
throw new Error(`invalid_key: '${key}' is not a known setting`);
|
|
421
|
+
const res = this.#db
|
|
422
|
+
.prepare("DELETE FROM agent_settings WHERE agent_id = ? AND key = ?")
|
|
423
|
+
.run(this.#ctx.requireAgentId(agentName), key);
|
|
424
|
+
return res.changes > 0;
|
|
425
|
+
}
|
|
426
|
+
/** DOD-SETTINGS-1: write a per-agent setting (upsert). Key VALIDATION is the handler's boundary
|
|
427
|
+
* (isValidSettingKey); value validation for typed settings (finite bounds, etc.) belongs to the
|
|
428
|
+
* specific consumer. Throws on a missing DB — a write that silently no-ops would be a lie. */
|
|
429
|
+
setSetting(agentName, key, value) {
|
|
430
|
+
if (!this.#db)
|
|
431
|
+
throw new Error(`setSetting('${agentName}'): database not initialized`);
|
|
432
|
+
// Store-level backstop (review F2): the handler validates the key, but the dual-layer convention
|
|
433
|
+
// (cf. MONIKER-1) means an unknown key can NEVER be stored — an internal caller that hand-typed a
|
|
434
|
+
// key instead of using the builders would otherwise persist a setting that never takes effect.
|
|
435
|
+
if (!isValidSettingKey(key))
|
|
436
|
+
throw new Error(`invalid_key: '${key}' is not a known setting`);
|
|
437
|
+
this.#db
|
|
438
|
+
.prepare(`INSERT INTO agent_settings (agent_id, key, value, updated_at) VALUES (?, ?, ?, ?)
|
|
439
|
+
ON CONFLICT(agent_id, key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at`)
|
|
440
|
+
.run(this.#ctx.requireAgentId(agentName), key, value, Date.now());
|
|
441
|
+
}
|
|
442
|
+
/** DOD-SETTINGS-1: all explicitly-set settings for an agent (the ones that OVERRIDE a default),
|
|
443
|
+
* key-sorted. Unset keys are absent — the operator sees only what they changed. */
|
|
444
|
+
getAllSettings(agentName) {
|
|
445
|
+
if (!this.#db)
|
|
446
|
+
return [];
|
|
447
|
+
return this.#db
|
|
448
|
+
.prepare("SELECT key, value FROM agent_settings WHERE agent_id = ? ORDER BY key ASC")
|
|
449
|
+
.all(this.#ctx.requireAgentId(agentName));
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Review F7: a relay sent a witness alert this build could not read or could not verify.
|
|
453
|
+
*
|
|
454
|
+
* Recorded so a version skew that silently kills the witness layer is visible to the operator
|
|
455
|
+
* instead of living only in a log file. Carries no session and no party by construction.
|
|
456
|
+
*/
|
|
457
|
+
recordRelayWitnessUnreadable(agentName, relayPeerId, why) {
|
|
458
|
+
const byRelay = this.#ctx.witnessUnreadable.get(agentName) ?? new Map();
|
|
459
|
+
const prior = byRelay.get(relayPeerId);
|
|
460
|
+
byRelay.set(relayPeerId, { why, count: (prior?.count ?? 0) + 1 });
|
|
461
|
+
this.#ctx.witnessUnreadable.set(agentName, byRelay);
|
|
462
|
+
this.#ctx.logger.error("session.witness.unreadable.recorded", {
|
|
463
|
+
agentName, relayPeerId, why,
|
|
464
|
+
impact: "this agent's witness layer is not working against that relay — no observation it " +
|
|
465
|
+
"sends can be read, and nothing has been concluded about any participant",
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
/** Relays whose witness alerts this build could not read, for the agent's inbox. */
|
|
469
|
+
getWitnessUnreadable(agentName) {
|
|
470
|
+
return [...(this.#ctx.witnessUnreadable.get(agentName) ?? new Map()).entries()]
|
|
471
|
+
.map(([relayPeerId, v]) => ({ relayPeerId, why: v.why, count: v.count }));
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* DOD-LOG-1 / PERSIST-002 (AC-010): append one readable message to the durable transcript, keyed
|
|
475
|
+
* by the canonical leaf `sequence` so it joins to the committed hash chain. The blob is stored as
|
|
476
|
+
* plaintext bytes: the whole DB is SQLCipher-encrypted at rest, so there is no per-column cipher.
|
|
477
|
+
* Idempotent on replay (INSERT OR IGNORE). Never throws into the caller's content path — but it
|
|
478
|
+
* REPORTS: returns false when the row did not land, so a caller for whom the row is a delivery
|
|
479
|
+
* precondition can fail instead of proceeding (review F2). Before Tier 1 the return value would
|
|
480
|
+
* have been pointless, because `cello_receive` served content from the in-memory buffer and the
|
|
481
|
+
* lost row only cost the unread count. Delivery reads the transcript now, so a swallowed received
|
|
482
|
+
* row is TOTAL content loss and the caller has to know.
|
|
483
|
+
*/
|
|
484
|
+
recordTranscriptMessage(agentName, sessionId, sequence,
|
|
485
|
+
/**
|
|
486
|
+
* DOD-M15-REFUSEDEVIDENCE-1 adds `'quarantined'` — received and REFUSED, kept as evidence and
|
|
487
|
+
* never delivered. It goes through THIS writer rather than a second one so that the attribution
|
|
488
|
+
* rule, the blob handling and the write-failure logging cannot drift between a delivered message
|
|
489
|
+
* and a refused one. One store, one writer.
|
|
490
|
+
*/
|
|
491
|
+
direction, plaintext, correlationId,
|
|
492
|
+
/**
|
|
493
|
+
* DOD-M15-SEALWIRE-1 bullet 5: the VERIFIED authorship proof, when there is one.
|
|
494
|
+
*
|
|
495
|
+
* Optional because there legitimately is not always one — the ordering decode can fail SOFT and
|
|
496
|
+
* the message is still ingested via hash-dedup. Optional is NOT the same as unremarked: absence
|
|
497
|
+
* is written into the row as `attribution = 'local_session_state'`, so a reader can tell a row
|
|
498
|
+
* whose author was proven from one whose author was assumed. That distinction is the bullet.
|
|
499
|
+
*/
|
|
500
|
+
authorship,
|
|
501
|
+
/** Required on a `'quarantined'` row and meaningless on any other: WHY it was refused. */
|
|
502
|
+
quarantineReason,
|
|
503
|
+
/**
|
|
504
|
+
* DOD-M15-REFUSEDEVIDENCE-1: the sender's key when there is one but no verified signature to go
|
|
505
|
+
* with it. A refused frame often has an identified sender and an unusable proof — a tampered
|
|
506
|
+
* message is still FROM someone — and dropping the key because the signature failed would throw
|
|
507
|
+
* away the half of the attribution that survived.
|
|
508
|
+
*/
|
|
509
|
+
senderPubkeyHexOverride) {
|
|
510
|
+
if (!this.#db)
|
|
511
|
+
return false;
|
|
512
|
+
try {
|
|
513
|
+
const agentId = this.#ctx.requireAgentId(agentName);
|
|
514
|
+
const blob = Buffer.from(plaintext);
|
|
515
|
+
this.#db
|
|
516
|
+
.prepare(`INSERT OR IGNORE INTO transcript
|
|
517
|
+
(agent_id, session_id, sequence, direction, blob, created_at, sender_pubkey, sender_sig, attribution, quarantine_reason)
|
|
518
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`)
|
|
519
|
+
.run(agentId, sessionId, sequence, direction, blob, Date.now(), authorship
|
|
520
|
+
? Buffer.from(authorship.senderPubkey).toString("hex")
|
|
521
|
+
: senderPubkeyHexOverride ?? null, authorship ? Buffer.from(authorship.senderSig) : null,
|
|
522
|
+
/**
|
|
523
|
+
* THREE values, not two — caught by CELLO_Coder_1 reviewing the first version, and it was
|
|
524
|
+
* the same defect this column exists to prevent, surviving one layer up in the enum.
|
|
525
|
+
*
|
|
526
|
+
* `local_session_state` covered two OPPOSITE rows: one this agent AUTHORED (provenance
|
|
527
|
+
* fully known, merely not third-party-provable) and one RECEIVED on the soft fallback
|
|
528
|
+
* (provenance unknown — something arrived on a socket and was trusted). A reader shown the
|
|
529
|
+
* transcript later could not separate "he wrote this himself" from "nobody checked".
|
|
530
|
+
* Structurally identical rows with different trustworthiness is exactly what I refused to
|
|
531
|
+
* ship when I rejected a nullable signature column.
|
|
532
|
+
*
|
|
533
|
+
* No plumbing needed: `direction` already carries the answer at write time.
|
|
534
|
+
*/
|
|
535
|
+
/**
|
|
536
|
+
* DIRECTION FIRST — DOD-M15-SEALWIRE-1 bullet 5, sent half.
|
|
537
|
+
*
|
|
538
|
+
* This used to read `authorship ? "verified_signature" : …`, which was right while only
|
|
539
|
+
* RECEIVED rows could carry a signature. Now a SENT row carries one too — our own, over
|
|
540
|
+
* the Structure-1 bytes we put on the wire — and labelling that `verified_signature` would
|
|
541
|
+
* be false in the way this column exists to prevent: **we did not verify it, we produced
|
|
542
|
+
* it.** Nobody checked a counterparty's key; there was no counterparty in the act.
|
|
543
|
+
*
|
|
544
|
+
* So the three values keep meaning three different things:
|
|
545
|
+
* `self_authored` — this agent wrote it. Now PROVABLE when a signature is stored.
|
|
546
|
+
* `verified_signature` — someone else wrote it and we checked their key against it.
|
|
547
|
+
* `local_session_state`— someone else wrote it and nobody checked anything.
|
|
548
|
+
*/
|
|
549
|
+
direction === "sent" ? "self_authored" : authorship ? "verified_signature" : "local_session_state", quarantineReason ?? null);
|
|
550
|
+
this.#ctx.logger.info("transcript.message.recorded", { sessionId, agentName, sequence, direction, correlationId });
|
|
551
|
+
return true;
|
|
552
|
+
}
|
|
553
|
+
catch (err) {
|
|
554
|
+
// M8C-INBOX-1 (reviewer F2): a RECEIVED-row write failure is not cosmetic — since INBOX-1 the
|
|
555
|
+
// transcript is the AUTHORITY for unread (getUnreadSummary).
|
|
556
|
+
//
|
|
557
|
+
// UPDATED for DOD-COATTEND-1 (review F2). This comment used to end "...while cello_receive
|
|
558
|
+
// still delivers it live from the in-memory buffer (masking the loss)", and that mitigation
|
|
559
|
+
// was the whole reason a swallowed write was survivable. Tier 1 DELETED it: delivery reads
|
|
560
|
+
// the transcript now, so a lost received row is not an undercount, it is the message never
|
|
561
|
+
// reaching ANY session while the doorbell rings and the leaf sits in the hash chain. The
|
|
562
|
+
// sentence is corrected rather than kept, because as written it reassured a reader about a
|
|
563
|
+
// safety net that no longer exists. Sent-row failures stay a warning (they only affect the
|
|
564
|
+
// durable readable transcript, not delivery).
|
|
565
|
+
// A QUARANTINED row that fails to write is an ERROR for the same reason a received one is,
|
|
566
|
+
// and a different one: nothing else holds these bytes. The message was refused, so it was
|
|
567
|
+
// never delivered and never acked in a way that brings it back — a failed write here is the
|
|
568
|
+
// evidence gap this unit exists to close, reopened by a disk fault.
|
|
569
|
+
const level = direction === "sent" ? "warn" : "error";
|
|
570
|
+
this.#ctx.logger[level]("transcript.message.record.failed", {
|
|
571
|
+
sessionId, agentName, sequence, direction,
|
|
572
|
+
reason: extractErrorMessage(err),
|
|
573
|
+
correlationId,
|
|
574
|
+
...(direction === "received" ? { impact: "content_undeliverable_message_lost" } : {}),
|
|
575
|
+
...(direction === "quarantined" ? { impact: "refused_message_not_retained_no_other_copy_exists" } : {}),
|
|
576
|
+
});
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* DOD-M15-DELIVERYACK-1 — keep the counterparty's signature that their machine received a message.
|
|
582
|
+
*
|
|
583
|
+
* A thin forward, because this class is what holds the database handle and the write itself
|
|
584
|
+
* belongs beside the read and the five rules in `session-delivery-acks.ts`. Called ONLY after
|
|
585
|
+
* `verifyDeliveryAck` succeeded against the session's recorded counterparty key.
|
|
586
|
+
*/
|
|
587
|
+
recordDeliveryAck(agentName, sessionId, contentHashHex, signerPubkeyHex, signature, correlationId) {
|
|
588
|
+
if (!this.#db)
|
|
589
|
+
return false;
|
|
590
|
+
return storeDeliveryAck(this.#db, this.#ctx.logger, {
|
|
591
|
+
agentId: this.#ctx.requireAgentId(agentName),
|
|
592
|
+
agentName, sessionId, contentHashHex, signerPubkeyHex, signature, correlationId,
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
/** Durably record the acknowledgement the live path just made, so a resumed session starts from it. */
|
|
596
|
+
recordLastAck(agentName, sessionId, relaySeq, contentHash) {
|
|
597
|
+
if (!this.#db)
|
|
598
|
+
return;
|
|
599
|
+
try {
|
|
600
|
+
recordLastAck(this.#db, { agentId: this.#ctx.requireAgentId(agentName), sessionId, seq: relaySeq, hash: contentHash });
|
|
601
|
+
}
|
|
602
|
+
catch (err) {
|
|
603
|
+
this.#ctx.logger.error("session.last_ack.record.failed", {
|
|
604
|
+
agentName, sessionId, relaySeq, reason: extractErrorMessage(err),
|
|
605
|
+
impact: "if this daemon restarts before the session closes, the close may be refused as stale",
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/** Keep this side's own signed acknowledgement for a received message, for the seal answer. */
|
|
610
|
+
recordGivenDeliveryAck(agentName, sessionId, contentHashHex, signature, correlationId) {
|
|
611
|
+
if (!this.#db)
|
|
612
|
+
return;
|
|
613
|
+
const agentId = this.#ctx.requireAgentId(agentName);
|
|
614
|
+
const signerPubkeyHex = this.#db.prepare("SELECT k_local_pubkey FROM agents WHERE agent_id = ?").get(agentId)?.k_local_pubkey;
|
|
615
|
+
if (!signerPubkeyHex) {
|
|
616
|
+
this.#ctx.logger.error("content.delivery.ack.given.record.failed", {
|
|
617
|
+
agentName, sessionId, contentHash: contentHashHex, correlationId, reason: "agent_pubkey_unresolved",
|
|
618
|
+
impact: "the acknowledgement went out, but this side kept no copy, so its seal answer shows this message without one",
|
|
619
|
+
guidance: "This is a LOCAL fault: the agent row carries no identity key. Check cello_status for this agent.",
|
|
620
|
+
});
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
storeGivenDeliveryAck(this.#db, this.#ctx.logger, {
|
|
624
|
+
agentId, agentName, sessionId, contentHashHex, signerPubkeyHex, signature, correlationId,
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* DOD-M15-DELIVERYACK-1 rule 2 — did this side put these exact bytes on the wire in this session?
|
|
629
|
+
*
|
|
630
|
+
* The DURABLE half of the bind. A sent-direction transcript row joined to its leaf is written by
|
|
631
|
+
* our own send path and survives both the time-to-fallback timer and a daemon restart, which is
|
|
632
|
+
* what lets an acknowledgement for a message that had to be parked and recovered still count.
|
|
633
|
+
* Nothing a counterparty sends can create a row here.
|
|
634
|
+
*/
|
|
635
|
+
hasSentContentHash(agentName, sessionId, contentHashHex) {
|
|
636
|
+
if (!this.#db)
|
|
637
|
+
return false;
|
|
638
|
+
// One implementation, two routes: the direct stream reaches it through here, and the parked
|
|
639
|
+
// route reaches the same function from the mailbox drain, which holds a database handle and no
|
|
640
|
+
// manager. A second copy of a bind check is a second thing to keep in step.
|
|
641
|
+
return sentContentHashExists(this.#db, this.#ctx.requireAgentId(agentName), sessionId, contentHashHex);
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* DOD-LOG-1: read a session's durable transcript back (after a restart), decrypted and ordered by
|
|
645
|
+
* canonical sequence then direction. A blob that fails to decrypt (tamper/wrong key) is skipped
|
|
646
|
+
* with a loud log rather than crashing the read.
|
|
647
|
+
*/
|
|
648
|
+
readTranscript(agentName, sessionId) {
|
|
649
|
+
if (!this.#db)
|
|
650
|
+
return { messages: [], undecryptable: 0 };
|
|
651
|
+
const rows = this.#db
|
|
652
|
+
.prepare(`SELECT sequence, direction, blob, created_at, quarantine_reason FROM transcript
|
|
653
|
+
WHERE agent_id = ? AND session_id = ? ORDER BY sequence ASC, direction ASC`)
|
|
654
|
+
.all(this.#ctx.requireAgentId(agentName), sessionId);
|
|
655
|
+
const messages = [];
|
|
656
|
+
// PERSIST-002 (AC-010): the blob is plaintext (whole-DB SQLCipher at rest), so there is no
|
|
657
|
+
// per-row decrypt step that can fail — `undecryptable` stays 0 and is kept only for callers that
|
|
658
|
+
// already read the field.
|
|
659
|
+
for (const r of rows) {
|
|
660
|
+
const blob = r.blob instanceof Uint8Array ? r.blob : new Uint8Array(r.blob);
|
|
661
|
+
/**
|
|
662
|
+
* DOD-M15-REFUSEDEVIDENCE-1 — THE READ IS REDACTED, THE STORAGE IS NOT.
|
|
663
|
+
*
|
|
664
|
+
* The entry stays at its position, because a hole where a message was is the evidence gap
|
|
665
|
+
* this unit exists to close, one level up: the operator must be able to see that something
|
|
666
|
+
* arrived here and was refused. What is withheld is the TEXT, and `text` carries the
|
|
667
|
+
* withholding statement rather than being omitted — every existing renderer of this array
|
|
668
|
+
* prints `text`, so a missing field would print nothing and an unfiltered one would print the
|
|
669
|
+
* payload. The statement is the fail-safe value for both.
|
|
670
|
+
*
|
|
671
|
+
* ⚠️ THREE-WAY, not `!== "sent" ? "received"`. The old expression labelled anything that was
|
|
672
|
+
* not `sent` as `received`, which would have handed a refused message to every reader as a
|
|
673
|
+
* delivered one — with its text.
|
|
674
|
+
*/
|
|
675
|
+
const direction = r.direction === "sent" ? "sent" : r.direction === "quarantined" ? "quarantined" : "received";
|
|
676
|
+
if (direction === "quarantined") {
|
|
677
|
+
// No `?? "refused"` default — review F11. See `readQuarantined` for why a generic label for
|
|
678
|
+
// an impossible state is worse than an empty one.
|
|
679
|
+
const reason = r.quarantine_reason;
|
|
680
|
+
const redaction = quarantineRedaction(reason, sessionId, r.sequence);
|
|
681
|
+
messages.push({
|
|
682
|
+
sequence: r.sequence, direction, createdAt: r.created_at,
|
|
683
|
+
text: redaction.text,
|
|
684
|
+
// The key ENDS in `guidance` so `vocabulary.ts` rewrites the verb for a CLI reader — see
|
|
685
|
+
// the note on `quarantineRedaction`.
|
|
686
|
+
withheld_guidance: redaction.guidance,
|
|
687
|
+
refusalReason: reason,
|
|
688
|
+
withheld: true,
|
|
689
|
+
});
|
|
690
|
+
continue;
|
|
691
|
+
}
|
|
692
|
+
messages.push({ sequence: r.sequence, direction, text: new TextDecoder().decode(blob), createdAt: r.created_at });
|
|
693
|
+
}
|
|
694
|
+
return { messages, undecryptable: 0 };
|
|
695
|
+
}
|
|
696
|
+
/** INBOX-1 (N2): per-session unread summary for an agent — sessions that have RECEIVED transcript
|
|
697
|
+
* messages beyond the read watermark, excluding terminal sessions (sealed, abandoned,
|
|
698
|
+
* seal_interrupted_pending) which belong in getEndedUnread instead.
|
|
699
|
+
* Sessions with no sessions row are treated as non-terminal (LEFT JOIN).
|
|
700
|
+
* Content-free (counts + ids + last seq, never message text); a COUNT/MAX query, no decrypt. */
|
|
701
|
+
getUnreadSummary(agentName) {
|
|
702
|
+
if (!this.#db)
|
|
703
|
+
return [];
|
|
704
|
+
const rows = this.#db
|
|
705
|
+
.prepare(`SELECT t.session_id AS session_id,
|
|
706
|
+
COUNT(*) AS unread_count,
|
|
707
|
+
MAX(t.sequence) AS last_seq
|
|
708
|
+
FROM transcript t
|
|
709
|
+
LEFT JOIN message_watermarks w
|
|
710
|
+
ON w.agent_id = t.agent_id AND w.session_id = t.session_id
|
|
711
|
+
LEFT JOIN sessions s
|
|
712
|
+
ON s.agent_id = t.agent_id AND s.session_id = t.session_id
|
|
713
|
+
WHERE t.agent_id = ?
|
|
714
|
+
AND ${UNREAD_RECEIVED_WHERE}
|
|
715
|
+
AND (s.status IS NULL OR s.status NOT IN ${TERMINAL_STATUSES})
|
|
716
|
+
GROUP BY t.session_id
|
|
717
|
+
HAVING unread_count > 0
|
|
718
|
+
ORDER BY t.session_id ASC`)
|
|
719
|
+
.all(this.#ctx.requireAgentId(agentName));
|
|
720
|
+
return rows;
|
|
721
|
+
}
|
|
722
|
+
/** DOD-SEALED-INBOX-1: terminal sessions with unread received messages that have not been
|
|
723
|
+
* dismissed. These are answering-machine style messages left in an ENDED session — the operator
|
|
724
|
+
* can read them via cello_transcript but cannot advance the watermark via cello_receive.
|
|
725
|
+
* Only returned when read_at IS NULL (not yet dismissed).
|
|
726
|
+
*
|
|
727
|
+
* DOD-SEALED-INBOX-2: named `getEndedUnread`, not `getSealedUnread`, and it SELECTS `s.status`.
|
|
728
|
+
* All four #TERMINAL_STATUSES belong here — that part was always right — but only `sealed` is
|
|
729
|
+
* NOTARIZED. The old name and the caller's hardcoded `session_state: "sealed"` asserted a
|
|
730
|
+
* cryptographic receipt for `abandoned`, `interrupted` and `seal_interrupted_pending` sessions,
|
|
731
|
+
* which have none. Callers must render the row's own status; there is nothing to infer from
|
|
732
|
+
* membership in this list beyond "it ended". */
|
|
733
|
+
getEndedUnread(agentName) {
|
|
734
|
+
if (!this.#db)
|
|
735
|
+
return [];
|
|
736
|
+
const rows = this.#db
|
|
737
|
+
.prepare(
|
|
738
|
+
// M12-P17 (review F2): return the ACTUAL status. `#TERMINAL_STATUSES` spans four states and
|
|
739
|
+
// they are NOT equivalent — an `interrupted` session is not committed, still accepts
|
|
740
|
+
// appends, and may have a counterparty waiting to seal. Stamping "sealed" over all four
|
|
741
|
+
// told an agent that live work was dead history: symptom B inverted.
|
|
742
|
+
`SELECT t.session_id AS session_id,
|
|
743
|
+
COUNT(*) AS unread_count,
|
|
744
|
+
MAX(t.sequence) AS last_seq,
|
|
745
|
+
s.status AS status
|
|
746
|
+
FROM transcript t
|
|
747
|
+
LEFT JOIN message_watermarks w
|
|
748
|
+
ON w.agent_id = t.agent_id AND w.session_id = t.session_id
|
|
749
|
+
JOIN sessions s
|
|
750
|
+
ON s.agent_id = t.agent_id AND s.session_id = t.session_id
|
|
751
|
+
WHERE t.agent_id = ?
|
|
752
|
+
AND ${UNREAD_RECEIVED_WHERE}
|
|
753
|
+
AND s.status IN ${TERMINAL_STATUSES}
|
|
754
|
+
AND s.read_at IS NULL
|
|
755
|
+
GROUP BY t.session_id
|
|
756
|
+
HAVING unread_count > 0
|
|
757
|
+
ORDER BY t.session_id ASC`)
|
|
758
|
+
.all(this.#ctx.requireAgentId(agentName));
|
|
759
|
+
return rows;
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* DOD-CURSOR-DURABLE-1: how many RECEIVED messages in THIS session the agent has not read —
|
|
763
|
+
* the durable half of the read-before-write gate. Same predicate as getUnreadSummary (shared
|
|
764
|
+
* constant above), scoped to one session.
|
|
765
|
+
*
|
|
766
|
+
* This is DURABLE and PER-AGENT, where the send gate's other authority (the connection cursor) is
|
|
767
|
+
* in-memory and per-connection. It is what lets a stateless client — the `cello` CLI, one process
|
|
768
|
+
* per command — prove it has read the counterparty, which a dead socket's cursor never can.
|
|
769
|
+
*
|
|
770
|
+
* FAILS CLOSED: an uninitialized DB returns a positive count (treated as "unread"), never 0. A 0
|
|
771
|
+
* here unblocks a send; guessing 0 from a broken DB would silently defeat the gate.
|
|
772
|
+
*/
|
|
773
|
+
getUnreadReceivedCount(agentName, sessionId) {
|
|
774
|
+
if (!this.#db)
|
|
775
|
+
return 1; // fail closed — never unblock a send because the DB is unavailable
|
|
776
|
+
const row = this.#db
|
|
777
|
+
.prepare(`SELECT COUNT(*) AS unread_count
|
|
778
|
+
FROM transcript t
|
|
779
|
+
LEFT JOIN message_watermarks w
|
|
780
|
+
ON w.agent_id = t.agent_id AND w.session_id = t.session_id
|
|
781
|
+
WHERE t.agent_id = ?
|
|
782
|
+
AND t.session_id = ?
|
|
783
|
+
AND ${UNREAD_RECEIVED_WHERE}`)
|
|
784
|
+
.get(this.#ctx.requireAgentId(agentName), sessionId);
|
|
785
|
+
// Absent row → "I cannot count", which is NOT "you are caught up". Answer the same way the
|
|
786
|
+
// #db guard above does. Unreachable today (SELECT COUNT(*) with no GROUP BY always yields a
|
|
787
|
+
// row), but a fail-OPEN default inside a fail-CLOSED gate is a defect that only needs the query
|
|
788
|
+
// to change once. The two branches must never disagree about what "unknown" means.
|
|
789
|
+
return row ? row.unread_count : 1;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Rehydrate `#diverged` from `sessions.diverged_at` — `DOD-M15-DIVERGE-DURABLE-1`.
|
|
793
|
+
*
|
|
794
|
+
* The Set stays as the hot read (the seal gate consults it per close), and the column is the
|
|
795
|
+
* truth. Loaded once at boot rather than queried per read so the gate's cost does not change.
|
|
796
|
+
*/
|
|
797
|
+
loadDivergedFromDb() {
|
|
798
|
+
if (!this.#db)
|
|
799
|
+
return;
|
|
800
|
+
const rows = this.#db
|
|
801
|
+
.prepare(`SELECT s.session_id AS sid, a.agent_name AS agent
|
|
802
|
+
FROM sessions s JOIN agents a ON a.agent_id = s.agent_id
|
|
803
|
+
WHERE s.diverged_at IS NOT NULL`)
|
|
804
|
+
.all();
|
|
805
|
+
for (const r of rows)
|
|
806
|
+
this.#diverged.add(this.#ctx.sessionKey(r.agent, r.sid));
|
|
807
|
+
if (rows.length > 0) {
|
|
808
|
+
this.#ctx.logger.info("session.diverged.restored", {
|
|
809
|
+
count: rows.length,
|
|
810
|
+
impact: "these sessions provably cannot seal bilaterally and are refused at the seal gate — before " +
|
|
811
|
+
"this was durable, a restart made them read as healthy",
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Record that this session's tree and the relay's counter have provably parted.
|
|
817
|
+
*
|
|
818
|
+
* Idempotent, and deliberately does NOT touch `updated_at`: that column drives the inbox's
|
|
819
|
+
* last-spoke ordering, and divergence is not activity.
|
|
820
|
+
*/
|
|
821
|
+
markSessionDiverged(agentName, sessionId) {
|
|
822
|
+
this.#diverged.add(this.#ctx.sessionKey(agentName, sessionId));
|
|
823
|
+
if (!this.#db)
|
|
824
|
+
return;
|
|
825
|
+
/**
|
|
826
|
+
* KEYED ON (agent_id, session_id) — review F3, and the loopback case makes it concrete.
|
|
827
|
+
*
|
|
828
|
+
* This was `WHERE session_id = ?` alone. The table's PK is composite for a documented reason
|
|
829
|
+
* (`DOD-LOOP-1`, on the CREATE TABLE above): **two of one operator's agents can hold both ends
|
|
830
|
+
* of the SAME session_id on ONE daemon**, so `sessions` holds two rows. Unkeyed, marking one
|
|
831
|
+
* side diverged marked BOTH, and the clear below wiped BOTH — so side B sealing its half
|
|
832
|
+
* erased side A's divergence, and after a restart A's seal gate read healthy and signed a close
|
|
833
|
+
* that could only be refused. The line's own defect, produced by the line's own clear.
|
|
834
|
+
*
|
|
835
|
+
* Every other per-session UPDATE in this file keys on both columns; these two were the
|
|
836
|
+
* exceptions.
|
|
837
|
+
*/
|
|
838
|
+
this.#db
|
|
839
|
+
.prepare("UPDATE sessions SET diverged_at = ? WHERE agent_id = ? AND session_id = ? AND diverged_at IS NULL")
|
|
840
|
+
.run(Date.now(), this.#ctx.requireAgentId(agentName), sessionId);
|
|
841
|
+
}
|
|
842
|
+
/** Whether this session has provably parted from the relay's ordering. */
|
|
843
|
+
isSessionDiverged(agentName, sessionId) {
|
|
844
|
+
return this.#diverged.has(this.#ctx.sessionKey(agentName, sessionId));
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Drop the in-memory divergence memo for a session.
|
|
848
|
+
*
|
|
849
|
+
* Called when the session reaches a TERMINAL status: no future close can be refused at that
|
|
850
|
+
* point, so the flag has nothing left to protect. The DURABLE row is cleared by the caller —
|
|
851
|
+
* otherwise a sealed session comes back after a restart still carrying a refusal for a close that
|
|
852
|
+
* can no longer happen.
|
|
853
|
+
*/
|
|
854
|
+
clearDivergedMemo(agentName, sessionId) {
|
|
855
|
+
this.#diverged.delete(this.#ctx.sessionKey(agentName, sessionId));
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
//# sourceMappingURL=session-records.js.map
|