@opendatalabs/personal-server-ts-core 1.37.0 → 1.38.1
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/contracts/host-contract.json +115 -0
- package/contracts/raw-end.json +2360 -0
- package/contracts/replace-conformance.json +729 -0
- package/contracts/routes.json +349 -0
- package/contracts/run-finish-plan.json +3238 -0
- package/contracts/run-saved.json +1308 -0
- package/contracts/scope-delete-receipt.json +616 -0
- package/dist/api/account-storage-mode.d.ts +77 -0
- package/dist/api/account-storage-mode.d.ts.map +1 -0
- package/dist/api/account-storage-mode.js +72 -0
- package/dist/api/account-storage-mode.js.map +1 -0
- package/dist/api/index.d.ts +139 -3
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +973 -191
- package/dist/api/index.js.map +1 -1
- package/dist/api/legacy-write-gate.d.ts +51 -0
- package/dist/api/legacy-write-gate.d.ts.map +1 -0
- package/dist/api/legacy-write-gate.js +88 -0
- package/dist/api/legacy-write-gate.js.map +1 -0
- package/dist/api/owner-connector-delete.d.ts +103 -0
- package/dist/api/owner-connector-delete.d.ts.map +1 -0
- package/dist/api/owner-connector-delete.js +158 -0
- package/dist/api/owner-connector-delete.js.map +1 -0
- package/dist/api/pdpp-record-query.d.ts +25 -0
- package/dist/api/pdpp-record-query.d.ts.map +1 -0
- package/dist/api/pdpp-record-query.js +72 -0
- package/dist/api/pdpp-record-query.js.map +1 -0
- package/dist/api/pdpp-records-list.d.ts +133 -0
- package/dist/api/pdpp-records-list.d.ts.map +1 -0
- package/dist/api/pdpp-records-list.js +380 -0
- package/dist/api/pdpp-records-list.js.map +1 -0
- package/dist/api/scope-delete-verdict.d.ts +107 -0
- package/dist/api/scope-delete-verdict.d.ts.map +1 -0
- package/dist/api/scope-delete-verdict.js +92 -0
- package/dist/api/scope-delete-verdict.js.map +1 -0
- package/dist/api/switched-delete-refusal.d.ts +16 -0
- package/dist/api/switched-delete-refusal.d.ts.map +1 -0
- package/dist/api/switched-delete-refusal.js +30 -0
- package/dist/api/switched-delete-refusal.js.map +1 -0
- package/dist/client.d.ts +29 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +34 -2
- package/dist/client.js.map +1 -1
- package/dist/contracts/access-logs.d.ts +1 -0
- package/dist/contracts/access-logs.d.ts.map +1 -1
- package/dist/contracts/access-logs.js +7 -1
- package/dist/contracts/access-logs.js.map +1 -1
- package/dist/contracts/data.d.ts +12 -0
- package/dist/contracts/data.d.ts.map +1 -1
- package/dist/contracts/data.js +30 -1
- package/dist/contracts/data.js.map +1 -1
- package/dist/contracts/grants.d.ts.map +1 -1
- package/dist/contracts/grants.js +9 -0
- package/dist/contracts/grants.js.map +1 -1
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +1 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/sync.d.ts +9 -1
- package/dist/contracts/sync.d.ts.map +1 -1
- package/dist/contracts/sync.js +6 -2
- package/dist/contracts/sync.js.map +1 -1
- package/dist/derivatives/compute.d.ts.map +1 -1
- package/dist/derivatives/compute.js +19 -0
- package/dist/derivatives/compute.js.map +1 -1
- package/dist/encoding/base64url.d.ts +6 -0
- package/dist/encoding/base64url.d.ts.map +1 -0
- package/dist/encoding/base64url.js +29 -0
- package/dist/encoding/base64url.js.map +1 -0
- package/dist/errors/pdpp-catalog.d.ts +1 -1
- package/dist/errors/pdpp-catalog.d.ts.map +1 -1
- package/dist/errors/pdpp-catalog.js +6 -0
- package/dist/errors/pdpp-catalog.js.map +1 -1
- package/dist/keys/index.d.ts +1 -0
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +1 -0
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/owner-master-key.d.ts +37 -0
- package/dist/keys/owner-master-key.d.ts.map +1 -0
- package/dist/keys/owner-master-key.js +45 -0
- package/dist/keys/owner-master-key.js.map +1 -0
- package/dist/legacy-projection/bindings.d.ts.map +1 -1
- package/dist/legacy-projection/bindings.js +10 -4
- package/dist/legacy-projection/bindings.js.map +1 -1
- package/dist/legacy-projection/erase-connector.d.ts +18 -0
- package/dist/legacy-projection/erase-connector.d.ts.map +1 -0
- package/dist/legacy-projection/erase-connector.js +29 -0
- package/dist/legacy-projection/erase-connector.js.map +1 -0
- package/dist/legacy-projection/index.d.ts +17 -0
- package/dist/legacy-projection/index.d.ts.map +1 -1
- package/dist/legacy-projection/index.js +41 -0
- package/dist/legacy-projection/index.js.map +1 -1
- package/dist/legacy-projection/types.d.ts +12 -2
- package/dist/legacy-projection/types.d.ts.map +1 -1
- package/dist/lineage/gateway.d.ts +3 -1
- package/dist/lineage/gateway.d.ts.map +1 -1
- package/dist/lineage/gateway.js +2 -1
- package/dist/lineage/gateway.js.map +1 -1
- package/dist/localdb/admit.d.ts +138 -0
- package/dist/localdb/admit.d.ts.map +1 -0
- package/dist/localdb/admit.js +344 -0
- package/dist/localdb/admit.js.map +1 -0
- package/dist/localdb/apply-meter.d.ts +14 -0
- package/dist/localdb/apply-meter.d.ts.map +1 -0
- package/dist/localdb/apply-meter.js +31 -0
- package/dist/localdb/apply-meter.js.map +1 -0
- package/dist/localdb/apply-progress.d.ts +10 -0
- package/dist/localdb/apply-progress.d.ts.map +1 -0
- package/dist/localdb/apply-progress.js +39 -0
- package/dist/localdb/apply-progress.js.map +1 -0
- package/dist/localdb/apply.d.ts +17 -0
- package/dist/localdb/apply.d.ts.map +1 -0
- package/dist/localdb/apply.js +291 -0
- package/dist/localdb/apply.js.map +1 -0
- package/dist/localdb/batch-commit.d.ts +70 -0
- package/dist/localdb/batch-commit.d.ts.map +1 -0
- package/dist/localdb/batch-commit.js +91 -0
- package/dist/localdb/batch-commit.js.map +1 -0
- package/dist/localdb/batch-contract.d.ts +19 -0
- package/dist/localdb/batch-contract.d.ts.map +1 -0
- package/dist/localdb/batch-contract.js +24 -0
- package/dist/localdb/batch-contract.js.map +1 -0
- package/dist/localdb/blobs.d.ts +71 -0
- package/dist/localdb/blobs.d.ts.map +1 -0
- package/dist/localdb/blobs.js +306 -0
- package/dist/localdb/blobs.js.map +1 -0
- package/dist/localdb/bootstrap-copy.d.ts +6 -0
- package/dist/localdb/bootstrap-copy.d.ts.map +1 -0
- package/dist/localdb/bootstrap-copy.js +79 -0
- package/dist/localdb/bootstrap-copy.js.map +1 -0
- package/dist/localdb/bootstrap-keys.d.ts +33 -0
- package/dist/localdb/bootstrap-keys.d.ts.map +1 -0
- package/dist/localdb/bootstrap-keys.js +89 -0
- package/dist/localdb/bootstrap-keys.js.map +1 -0
- package/dist/localdb/bootstrap-swap.d.ts +17 -0
- package/dist/localdb/bootstrap-swap.d.ts.map +1 -0
- package/dist/localdb/bootstrap-swap.js +78 -0
- package/dist/localdb/bootstrap-swap.js.map +1 -0
- package/dist/localdb/bootstrap.d.ts +55 -0
- package/dist/localdb/bootstrap.d.ts.map +1 -0
- package/dist/localdb/bootstrap.js +195 -0
- package/dist/localdb/bootstrap.js.map +1 -0
- package/dist/localdb/complete-read.d.ts +77 -0
- package/dist/localdb/complete-read.d.ts.map +1 -0
- package/dist/localdb/complete-read.js +136 -0
- package/dist/localdb/complete-read.js.map +1 -0
- package/dist/localdb/connection-link.d.ts +12 -0
- package/dist/localdb/connection-link.d.ts.map +1 -0
- package/dist/localdb/connection-link.js +79 -0
- package/dist/localdb/connection-link.js.map +1 -0
- package/dist/localdb/cursor.d.ts +61 -0
- package/dist/localdb/cursor.d.ts.map +1 -0
- package/dist/localdb/cursor.js +178 -0
- package/dist/localdb/cursor.js.map +1 -0
- package/dist/localdb/cycle.d.ts +69 -0
- package/dist/localdb/cycle.d.ts.map +1 -0
- package/dist/localdb/cycle.js +189 -0
- package/dist/localdb/cycle.js.map +1 -0
- package/dist/localdb/delete-batch.d.ts +29 -0
- package/dist/localdb/delete-batch.d.ts.map +1 -0
- package/dist/localdb/delete-batch.js +84 -0
- package/dist/localdb/delete-batch.js.map +1 -0
- package/dist/localdb/delete-lifetime.d.ts +24 -0
- package/dist/localdb/delete-lifetime.d.ts.map +1 -0
- package/dist/localdb/delete-lifetime.js +83 -0
- package/dist/localdb/delete-lifetime.js.map +1 -0
- package/dist/localdb/delete.d.ts +88 -0
- package/dist/localdb/delete.d.ts.map +1 -0
- package/dist/localdb/delete.js +521 -0
- package/dist/localdb/delete.js.map +1 -0
- package/dist/localdb/delta-apply.d.ts +4 -0
- package/dist/localdb/delta-apply.d.ts.map +1 -0
- package/dist/localdb/delta-apply.js +253 -0
- package/dist/localdb/delta-apply.js.map +1 -0
- package/dist/localdb/deps.d.ts +87 -0
- package/dist/localdb/deps.d.ts.map +1 -0
- package/dist/localdb/deps.js +10 -0
- package/dist/localdb/deps.js.map +1 -0
- package/dist/localdb/driver.d.ts +51 -0
- package/dist/localdb/driver.d.ts.map +1 -0
- package/dist/localdb/driver.js +3 -0
- package/dist/localdb/driver.js.map +1 -0
- package/dist/localdb/fence.d.ts +31 -0
- package/dist/localdb/fence.d.ts.map +1 -0
- package/dist/localdb/fence.js +69 -0
- package/dist/localdb/fence.js.map +1 -0
- package/dist/localdb/history.d.ts +76 -0
- package/dist/localdb/history.d.ts.map +1 -0
- package/dist/localdb/history.js +256 -0
- package/dist/localdb/history.js.map +1 -0
- package/dist/localdb/import-fingerprint.d.ts +8 -0
- package/dist/localdb/import-fingerprint.d.ts.map +1 -0
- package/dist/localdb/import-fingerprint.js +35 -0
- package/dist/localdb/import-fingerprint.js.map +1 -0
- package/dist/localdb/import-ledger.d.ts +27 -0
- package/dist/localdb/import-ledger.d.ts.map +1 -0
- package/dist/localdb/import-ledger.js +197 -0
- package/dist/localdb/import-ledger.js.map +1 -0
- package/dist/localdb/import-readback.d.ts +8 -0
- package/dist/localdb/import-readback.d.ts.map +1 -0
- package/dist/localdb/import-readback.js +69 -0
- package/dist/localdb/import-readback.js.map +1 -0
- package/dist/localdb/import-snapshot.d.ts +21 -0
- package/dist/localdb/import-snapshot.d.ts.map +1 -0
- package/dist/localdb/import-snapshot.js +94 -0
- package/dist/localdb/import-snapshot.js.map +1 -0
- package/dist/localdb/index.d.ts +42 -0
- package/dist/localdb/index.d.ts.map +1 -0
- package/dist/localdb/index.js +40 -0
- package/dist/localdb/index.js.map +1 -0
- package/dist/localdb/legacy-import-types.d.ts +112 -0
- package/dist/localdb/legacy-import-types.d.ts.map +1 -0
- package/dist/localdb/legacy-import-types.js +2 -0
- package/dist/localdb/legacy-import-types.js.map +1 -0
- package/dist/localdb/legacy-import.d.ts +67 -0
- package/dist/localdb/legacy-import.d.ts.map +1 -0
- package/dist/localdb/legacy-import.js +320 -0
- package/dist/localdb/legacy-import.js.map +1 -0
- package/dist/localdb/legacy-retire.d.ts +26 -0
- package/dist/localdb/legacy-retire.d.ts.map +1 -0
- package/dist/localdb/legacy-retire.js +93 -0
- package/dist/localdb/legacy-retire.js.map +1 -0
- package/dist/localdb/lifetime.d.ts +29 -0
- package/dist/localdb/lifetime.d.ts.map +1 -0
- package/dist/localdb/lifetime.js +64 -0
- package/dist/localdb/lifetime.js.map +1 -0
- package/dist/localdb/listing.d.ts +70 -0
- package/dist/localdb/listing.d.ts.map +1 -0
- package/dist/localdb/listing.js +345 -0
- package/dist/localdb/listing.js.map +1 -0
- package/dist/localdb/log-apply.d.ts +46 -0
- package/dist/localdb/log-apply.d.ts.map +1 -0
- package/dist/localdb/log-apply.js +827 -0
- package/dist/localdb/log-apply.js.map +1 -0
- package/dist/localdb/log-batch.d.ts +204 -0
- package/dist/localdb/log-batch.d.ts.map +1 -0
- package/dist/localdb/log-batch.js +418 -0
- package/dist/localdb/log-batch.js.map +1 -0
- package/dist/localdb/log-bodies.d.ts +27 -0
- package/dist/localdb/log-bodies.d.ts.map +1 -0
- package/dist/localdb/log-bodies.js +142 -0
- package/dist/localdb/log-bodies.js.map +1 -0
- package/dist/localdb/log-bootstrap-stage.d.ts +5 -0
- package/dist/localdb/log-bootstrap-stage.d.ts.map +1 -0
- package/dist/localdb/log-bootstrap-stage.js +60 -0
- package/dist/localdb/log-bootstrap-stage.js.map +1 -0
- package/dist/localdb/log-bootstrap.d.ts +23 -0
- package/dist/localdb/log-bootstrap.d.ts.map +1 -0
- package/dist/localdb/log-bootstrap.js +399 -0
- package/dist/localdb/log-bootstrap.js.map +1 -0
- package/dist/localdb/log-compact.d.ts +28 -0
- package/dist/localdb/log-compact.d.ts.map +1 -0
- package/dist/localdb/log-compact.js +83 -0
- package/dist/localdb/log-compact.js.map +1 -0
- package/dist/localdb/log-keyed.d.ts +118 -0
- package/dist/localdb/log-keyed.d.ts.map +1 -0
- package/dist/localdb/log-keyed.js +640 -0
- package/dist/localdb/log-keyed.js.map +1 -0
- package/dist/localdb/log-progressive.d.ts +18 -0
- package/dist/localdb/log-progressive.d.ts.map +1 -0
- package/dist/localdb/log-progressive.js +58 -0
- package/dist/localdb/log-progressive.js.map +1 -0
- package/dist/localdb/log-publish-phases.d.ts +31 -0
- package/dist/localdb/log-publish-phases.d.ts.map +1 -0
- package/dist/localdb/log-publish-phases.js +40 -0
- package/dist/localdb/log-publish-phases.js.map +1 -0
- package/dist/localdb/log-publish.d.ts +16 -0
- package/dist/localdb/log-publish.d.ts.map +1 -0
- package/dist/localdb/log-publish.js +1745 -0
- package/dist/localdb/log-publish.js.map +1 -0
- package/dist/localdb/log-rebase.d.ts +12 -0
- package/dist/localdb/log-rebase.d.ts.map +1 -0
- package/dist/localdb/log-rebase.js +74 -0
- package/dist/localdb/log-rebase.js.map +1 -0
- package/dist/localdb/log-recommit.d.ts +15 -0
- package/dist/localdb/log-recommit.d.ts.map +1 -0
- package/dist/localdb/log-recommit.js +88 -0
- package/dist/localdb/log-recommit.js.map +1 -0
- package/dist/localdb/log-seed.d.ts +25 -0
- package/dist/localdb/log-seed.d.ts.map +1 -0
- package/dist/localdb/log-seed.js +129 -0
- package/dist/localdb/log-seed.js.map +1 -0
- package/dist/localdb/log-state.d.ts +34 -0
- package/dist/localdb/log-state.d.ts.map +1 -0
- package/dist/localdb/log-state.js +79 -0
- package/dist/localdb/log-state.js.map +1 -0
- package/dist/localdb/merge.d.ts +122 -0
- package/dist/localdb/merge.d.ts.map +1 -0
- package/dist/localdb/merge.js +339 -0
- package/dist/localdb/merge.js.map +1 -0
- package/dist/localdb/migrate.d.ts +10 -0
- package/dist/localdb/migrate.d.ts.map +1 -0
- package/dist/localdb/migrate.js +27 -0
- package/dist/localdb/migrate.js.map +1 -0
- package/dist/localdb/name.d.ts +10 -0
- package/dist/localdb/name.d.ts.map +1 -0
- package/dist/localdb/name.js +15 -0
- package/dist/localdb/name.js.map +1 -0
- package/dist/localdb/open.d.ts +33 -0
- package/dist/localdb/open.d.ts.map +1 -0
- package/dist/localdb/open.js +46 -0
- package/dist/localdb/open.js.map +1 -0
- package/dist/localdb/part-layout.d.ts +6 -0
- package/dist/localdb/part-layout.d.ts.map +1 -0
- package/dist/localdb/part-layout.js +6 -0
- package/dist/localdb/part-layout.js.map +1 -0
- package/dist/localdb/part-readahead.d.ts +87 -0
- package/dist/localdb/part-readahead.d.ts.map +1 -0
- package/dist/localdb/part-readahead.js +130 -0
- package/dist/localdb/part-readahead.js.map +1 -0
- package/dist/localdb/partial-load.d.ts +42 -0
- package/dist/localdb/partial-load.d.ts.map +1 -0
- package/dist/localdb/partial-load.js +120 -0
- package/dist/localdb/partial-load.js.map +1 -0
- package/dist/localdb/partial-read.d.ts +64 -0
- package/dist/localdb/partial-read.d.ts.map +1 -0
- package/dist/localdb/partial-read.js +110 -0
- package/dist/localdb/partial-read.js.map +1 -0
- package/dist/localdb/plan-inputs.d.ts +31 -0
- package/dist/localdb/plan-inputs.d.ts.map +1 -0
- package/dist/localdb/plan-inputs.js +26 -0
- package/dist/localdb/plan-inputs.js.map +1 -0
- package/dist/localdb/publication-work.d.ts +20 -0
- package/dist/localdb/publication-work.d.ts.map +1 -0
- package/dist/localdb/publication-work.js +60 -0
- package/dist/localdb/publication-work.js.map +1 -0
- package/dist/localdb/publish-meter.d.ts +32 -0
- package/dist/localdb/publish-meter.d.ts.map +1 -0
- package/dist/localdb/publish-meter.js +36 -0
- package/dist/localdb/publish-meter.js.map +1 -0
- package/dist/localdb/publish.d.ts +153 -0
- package/dist/localdb/publish.d.ts.map +1 -0
- package/dist/localdb/publish.js +329 -0
- package/dist/localdb/publish.js.map +1 -0
- package/dist/localdb/purge.d.ts +40 -0
- package/dist/localdb/purge.d.ts.map +1 -0
- package/dist/localdb/purge.js +159 -0
- package/dist/localdb/purge.js.map +1 -0
- package/dist/localdb/query.d.ts +77 -0
- package/dist/localdb/query.d.ts.map +1 -0
- package/dist/localdb/query.js +330 -0
- package/dist/localdb/query.js.map +1 -0
- package/dist/localdb/queue.d.ts +10 -0
- package/dist/localdb/queue.d.ts.map +1 -0
- package/dist/localdb/queue.js +31 -0
- package/dist/localdb/queue.js.map +1 -0
- package/dist/localdb/raw-end-evidence.d.ts +16 -0
- package/dist/localdb/raw-end-evidence.d.ts.map +1 -0
- package/dist/localdb/raw-end-evidence.js +27 -0
- package/dist/localdb/raw-end-evidence.js.map +1 -0
- package/dist/localdb/read-selection.d.ts +182 -0
- package/dist/localdb/read-selection.d.ts.map +1 -0
- package/dist/localdb/read-selection.js +290 -0
- package/dist/localdb/read-selection.js.map +1 -0
- package/dist/localdb/registered-read.d.ts +15 -0
- package/dist/localdb/registered-read.d.ts.map +1 -0
- package/dist/localdb/registered-read.js +62 -0
- package/dist/localdb/registered-read.js.map +1 -0
- package/dist/localdb/replace.d.ts +33 -0
- package/dist/localdb/replace.d.ts.map +1 -0
- package/dist/localdb/replace.js +22 -0
- package/dist/localdb/replace.js.map +1 -0
- package/dist/localdb/requirements.d.ts +35 -0
- package/dist/localdb/requirements.d.ts.map +1 -0
- package/dist/localdb/requirements.js +66 -0
- package/dist/localdb/requirements.js.map +1 -0
- package/dist/localdb/resolve.d.ts +69 -0
- package/dist/localdb/resolve.d.ts.map +1 -0
- package/dist/localdb/resolve.js +436 -0
- package/dist/localdb/resolve.js.map +1 -0
- package/dist/localdb/run-end.d.ts +35 -0
- package/dist/localdb/run-end.d.ts.map +1 -0
- package/dist/localdb/run-end.js +520 -0
- package/dist/localdb/run-end.js.map +1 -0
- package/dist/localdb/run-intake.d.ts +17 -0
- package/dist/localdb/run-intake.d.ts.map +1 -0
- package/dist/localdb/run-intake.js +662 -0
- package/dist/localdb/run-intake.js.map +1 -0
- package/dist/localdb/run-receipts.d.ts +19 -0
- package/dist/localdb/run-receipts.d.ts.map +1 -0
- package/dist/localdb/run-receipts.js +151 -0
- package/dist/localdb/run-receipts.js.map +1 -0
- package/dist/localdb/schema.d.ts +7 -0
- package/dist/localdb/schema.d.ts.map +1 -0
- package/dist/localdb/schema.js +686 -0
- package/dist/localdb/schema.js.map +1 -0
- package/dist/localdb/seed.d.ts +39 -0
- package/dist/localdb/seed.d.ts.map +1 -0
- package/dist/localdb/seed.js +188 -0
- package/dist/localdb/seed.js.map +1 -0
- package/dist/localdb/slot.d.ts +9 -0
- package/dist/localdb/slot.d.ts.map +1 -0
- package/dist/localdb/slot.js +15 -0
- package/dist/localdb/slot.js.map +1 -0
- package/dist/localdb/stream-digest.d.ts +35 -0
- package/dist/localdb/stream-digest.d.ts.map +1 -0
- package/dist/localdb/stream-digest.js +50 -0
- package/dist/localdb/stream-digest.js.map +1 -0
- package/dist/localdb/sync.d.ts +75 -0
- package/dist/localdb/sync.d.ts.map +1 -0
- package/dist/localdb/sync.js +339 -0
- package/dist/localdb/sync.js.map +1 -0
- package/dist/localdb/system-stream-descriptor.d.ts +22 -0
- package/dist/localdb/system-stream-descriptor.d.ts.map +1 -0
- package/dist/localdb/system-stream-descriptor.js +24 -0
- package/dist/localdb/system-stream-descriptor.js.map +1 -0
- package/dist/localdb/system-stream-page.d.ts +15 -0
- package/dist/localdb/system-stream-page.d.ts.map +1 -0
- package/dist/localdb/system-stream-page.js +98 -0
- package/dist/localdb/system-stream-page.js.map +1 -0
- package/dist/localdb/system-streams.d.ts +35 -0
- package/dist/localdb/system-streams.d.ts.map +1 -0
- package/dist/localdb/system-streams.js +350 -0
- package/dist/localdb/system-streams.js.map +1 -0
- package/dist/localdb/transfer-memory.d.ts +17 -0
- package/dist/localdb/transfer-memory.d.ts.map +1 -0
- package/dist/localdb/transfer-memory.js +17 -0
- package/dist/localdb/transfer-memory.js.map +1 -0
- package/dist/localdb/unwrite.d.ts +28 -0
- package/dist/localdb/unwrite.d.ts.map +1 -0
- package/dist/localdb/unwrite.js +62 -0
- package/dist/localdb/unwrite.js.map +1 -0
- package/dist/localdb/update-required.d.ts +10 -0
- package/dist/localdb/update-required.d.ts.map +1 -0
- package/dist/localdb/update-required.js +27 -0
- package/dist/localdb/update-required.js.map +1 -0
- package/dist/localdb/view-changes.d.ts +58 -0
- package/dist/localdb/view-changes.d.ts.map +1 -0
- package/dist/localdb/view-changes.js +174 -0
- package/dist/localdb/view-changes.js.map +1 -0
- package/dist/logging/access-log.d.ts +2 -2
- package/dist/logging/access-log.d.ts.map +1 -1
- package/dist/logging/access-reader.d.ts +4 -1
- package/dist/logging/access-reader.d.ts.map +1 -1
- package/dist/logging/activity-stream.d.ts +37 -0
- package/dist/logging/activity-stream.d.ts.map +1 -0
- package/dist/logging/activity-stream.js +86 -0
- package/dist/logging/activity-stream.js.map +1 -0
- package/dist/mcp/approval-url.d.ts +32 -0
- package/dist/mcp/approval-url.d.ts.map +1 -1
- package/dist/mcp/approval-url.js +76 -0
- package/dist/mcp/approval-url.js.map +1 -1
- package/dist/mcp/connection-api.d.ts +54 -27
- package/dist/mcp/connection-api.d.ts.map +1 -1
- package/dist/mcp/connection-api.js +267 -77
- package/dist/mcp/connection-api.js.map +1 -1
- package/dist/mcp/grant-registration.d.ts +15 -0
- package/dist/mcp/grant-registration.d.ts.map +1 -0
- package/dist/mcp/grant-registration.js +44 -0
- package/dist/mcp/grant-registration.js.map +1 -0
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/read-client.d.ts +32 -10
- package/dist/mcp/read-client.d.ts.map +1 -1
- package/dist/mcp/read-client.js +299 -15
- package/dist/mcp/read-client.js.map +1 -1
- package/dist/mcp/resources.d.ts +3 -1
- package/dist/mcp/resources.d.ts.map +1 -1
- package/dist/mcp/resources.js +11 -2
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/server.d.ts +17 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +54 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +2 -0
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +41 -8
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/store.d.ts +14 -1
- package/dist/mcp/store.d.ts.map +1 -1
- package/dist/mcp/store.js +31 -2
- package/dist/mcp/store.js.map +1 -1
- package/dist/mcp/tools.d.ts +62 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +186 -64
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/types.d.ts +3 -1
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/oura/index.d.ts +1 -1
- package/dist/oura/index.d.ts.map +1 -1
- package/dist/oura/index.js +15 -0
- package/dist/oura/index.js.map +1 -1
- package/dist/payment/x402.d.ts +6 -3
- package/dist/payment/x402.d.ts.map +1 -1
- package/dist/payment/x402.js +35 -0
- package/dist/payment/x402.js.map +1 -1
- package/dist/pdpp/pkce.d.ts +1 -22
- package/dist/pdpp/pkce.d.ts.map +1 -1
- package/dist/pdpp/pkce.js +3 -2
- package/dist/pdpp/pkce.js.map +1 -1
- package/dist/policy/reserved-scopes.d.ts +3 -0
- package/dist/policy/reserved-scopes.d.ts.map +1 -1
- package/dist/policy/reserved-scopes.js +12 -1
- package/dist/policy/reserved-scopes.js.map +1 -1
- package/dist/ports/index.d.ts +61 -9
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js.map +1 -1
- package/dist/publication/publish.d.ts +31 -1
- package/dist/publication/publish.d.ts.map +1 -1
- package/dist/publication/publish.js +30 -14
- package/dist/publication/publish.js.map +1 -1
- package/dist/replication/copies.d.ts +1 -1
- package/dist/replication/dpv2.d.ts.map +1 -1
- package/dist/replication/dpv2.js +33 -0
- package/dist/replication/dpv2.js.map +1 -1
- package/dist/schemas/server-config.d.ts +16 -0
- package/dist/schemas/server-config.d.ts.map +1 -1
- package/dist/schemas/server-config.js +49 -0
- package/dist/schemas/server-config.js.map +1 -1
- package/dist/storage/adapters/interface.d.ts +12 -2
- package/dist/storage/adapters/interface.d.ts.map +1 -1
- package/dist/storage/adapters/interface.js.map +1 -1
- package/dist/storage/adapters/rate-limit-policy.d.ts +71 -0
- package/dist/storage/adapters/rate-limit-policy.d.ts.map +1 -0
- package/dist/storage/adapters/rate-limit-policy.js +107 -0
- package/dist/storage/adapters/rate-limit-policy.js.map +1 -0
- package/dist/storage/adapters/sdk.d.ts +7 -0
- package/dist/storage/adapters/sdk.d.ts.map +1 -1
- package/dist/storage/adapters/sdk.js +12 -6
- package/dist/storage/adapters/sdk.js.map +1 -1
- package/dist/storage/adapters/throttle.d.ts +30 -0
- package/dist/storage/adapters/throttle.d.ts.map +1 -0
- package/dist/storage/adapters/throttle.js +94 -0
- package/dist/storage/adapters/throttle.js.map +1 -0
- package/dist/storage/adapters/vana-audience.d.ts +4 -1
- package/dist/storage/adapters/vana-audience.d.ts.map +1 -1
- package/dist/storage/adapters/vana-audience.js +23 -11
- package/dist/storage/adapters/vana-audience.js.map +1 -1
- package/dist/storage/adapters/vana.d.ts +5 -0
- package/dist/storage/adapters/vana.d.ts.map +1 -1
- package/dist/storage/adapters/vana.js +82 -18
- package/dist/storage/adapters/vana.js.map +1 -1
- package/dist/storage/blocks/cursor.d.ts.map +1 -1
- package/dist/storage/blocks/cursor.js +3 -13
- package/dist/storage/blocks/cursor.js.map +1 -1
- package/dist/storage/canonical-legacy-projection.d.ts +13 -1
- package/dist/storage/canonical-legacy-projection.d.ts.map +1 -1
- package/dist/storage/canonical-legacy-projection.js +92 -24
- package/dist/storage/canonical-legacy-projection.js.map +1 -1
- package/dist/storage/hierarchy/paths.d.ts.map +1 -1
- package/dist/storage/hierarchy/paths.js +9 -2
- package/dist/storage/hierarchy/paths.js.map +1 -1
- package/dist/storage/index/manager.d.ts +19 -5
- package/dist/storage/index/manager.d.ts.map +1 -1
- package/dist/storage/legacy-scope-view.d.ts +4 -6
- package/dist/storage/legacy-scope-view.d.ts.map +1 -1
- package/dist/storage/legacy-scope-view.js +50 -57
- package/dist/storage/legacy-scope-view.js.map +1 -1
- package/dist/storage/legacy-write-seal.d.ts +73 -0
- package/dist/storage/legacy-write-seal.d.ts.map +1 -0
- package/dist/storage/legacy-write-seal.js +74 -0
- package/dist/storage/legacy-write-seal.js.map +1 -0
- package/dist/storage/pdpp-records/cursor.d.ts.map +1 -1
- package/dist/storage/pdpp-records/cursor.js +3 -29
- package/dist/storage/pdpp-records/cursor.js.map +1 -1
- package/dist/storage/pdpp-records/declaration-witness.d.ts.map +1 -1
- package/dist/storage/pdpp-records/declaration-witness.js +4 -3
- package/dist/storage/pdpp-records/declaration-witness.js.map +1 -1
- package/dist/storage/pdpp-records/types.d.ts +2 -0
- package/dist/storage/pdpp-records/types.d.ts.map +1 -1
- package/dist/storage/pdpp-records/types.js.map +1 -1
- package/dist/stream-sync/artifacts.d.ts +38 -0
- package/dist/stream-sync/artifacts.d.ts.map +1 -0
- package/dist/stream-sync/artifacts.js +179 -0
- package/dist/stream-sync/artifacts.js.map +1 -0
- package/dist/stream-sync/blobs.d.ts +18 -0
- package/dist/stream-sync/blobs.d.ts.map +1 -0
- package/dist/stream-sync/blobs.js +83 -0
- package/dist/stream-sync/blobs.js.map +1 -0
- package/dist/stream-sync/crypto-port.d.ts +30 -0
- package/dist/stream-sync/crypto-port.d.ts.map +1 -0
- package/dist/stream-sync/crypto-port.js +29 -0
- package/dist/stream-sync/crypto-port.js.map +1 -0
- package/dist/stream-sync/crypto.d.ts +27 -0
- package/dist/stream-sync/crypto.d.ts.map +1 -0
- package/dist/stream-sync/crypto.js +67 -0
- package/dist/stream-sync/crypto.js.map +1 -0
- package/dist/stream-sync/delete-metadata.d.ts +23 -0
- package/dist/stream-sync/delete-metadata.d.ts.map +1 -0
- package/dist/stream-sync/delete-metadata.js +40 -0
- package/dist/stream-sync/delete-metadata.js.map +1 -0
- package/dist/stream-sync/design-flags.d.ts +31 -0
- package/dist/stream-sync/design-flags.d.ts.map +1 -0
- package/dist/stream-sync/design-flags.js +44 -0
- package/dist/stream-sync/design-flags.js.map +1 -0
- package/dist/stream-sync/host-contract.d.ts +50 -0
- package/dist/stream-sync/host-contract.d.ts.map +1 -0
- package/dist/stream-sync/host-contract.js +80 -0
- package/dist/stream-sync/host-contract.js.map +1 -0
- package/dist/stream-sync/index.d.ts +19 -0
- package/dist/stream-sync/index.d.ts.map +1 -0
- package/dist/stream-sync/index.js +19 -0
- package/dist/stream-sync/index.js.map +1 -0
- package/dist/stream-sync/intake.d.ts +319 -0
- package/dist/stream-sync/intake.d.ts.map +1 -0
- package/dist/stream-sync/intake.js +62 -0
- package/dist/stream-sync/intake.js.map +1 -0
- package/dist/stream-sync/memory-registry.d.ts +85 -0
- package/dist/stream-sync/memory-registry.d.ts.map +1 -0
- package/dist/stream-sync/memory-registry.js +293 -0
- package/dist/stream-sync/memory-registry.js.map +1 -0
- package/dist/stream-sync/normalize-raw-end.d.ts +25 -0
- package/dist/stream-sync/normalize-raw-end.d.ts.map +1 -0
- package/dist/stream-sync/normalize-raw-end.js +177 -0
- package/dist/stream-sync/normalize-raw-end.js.map +1 -0
- package/dist/stream-sync/ports.d.ts +486 -0
- package/dist/stream-sync/ports.d.ts.map +1 -0
- package/dist/stream-sync/ports.js +91 -0
- package/dist/stream-sync/ports.js.map +1 -0
- package/dist/stream-sync/publish-plan.d.ts +129 -0
- package/dist/stream-sync/publish-plan.d.ts.map +1 -0
- package/dist/stream-sync/publish-plan.js +134 -0
- package/dist/stream-sync/publish-plan.js.map +1 -0
- package/dist/stream-sync/raw-end.d.ts +59 -0
- package/dist/stream-sync/raw-end.d.ts.map +1 -0
- package/dist/stream-sync/raw-end.js +113 -0
- package/dist/stream-sync/raw-end.js.map +1 -0
- package/dist/stream-sync/registry.d.ts +31 -0
- package/dist/stream-sync/registry.d.ts.map +1 -0
- package/dist/stream-sync/registry.js +645 -0
- package/dist/stream-sync/registry.js.map +1 -0
- package/dist/stream-sync/run-finish-plan.d.ts +61 -0
- package/dist/stream-sync/run-finish-plan.d.ts.map +1 -0
- package/dist/stream-sync/run-finish-plan.js +373 -0
- package/dist/stream-sync/run-finish-plan.js.map +1 -0
- package/dist/stream-sync/run-saved.d.ts +51 -0
- package/dist/stream-sync/run-saved.d.ts.map +1 -0
- package/dist/stream-sync/run-saved.js +83 -0
- package/dist/stream-sync/run-saved.js.map +1 -0
- package/dist/stream-sync/scope-routing.d.ts +17 -0
- package/dist/stream-sync/scope-routing.d.ts.map +1 -0
- package/dist/stream-sync/scope-routing.js +24 -0
- package/dist/stream-sync/scope-routing.js.map +1 -0
- package/dist/stream-sync/seed-staging.d.ts +85 -0
- package/dist/stream-sync/seed-staging.d.ts.map +1 -0
- package/dist/stream-sync/seed-staging.js +325 -0
- package/dist/stream-sync/seed-staging.js.map +1 -0
- package/dist/stream-sync/semver.d.ts +3 -0
- package/dist/stream-sync/semver.d.ts.map +1 -0
- package/dist/stream-sync/semver.js +49 -0
- package/dist/stream-sync/semver.js.map +1 -0
- package/dist/stream-sync/send-gate.d.ts +149 -0
- package/dist/stream-sync/send-gate.d.ts.map +1 -0
- package/dist/stream-sync/send-gate.js +382 -0
- package/dist/stream-sync/send-gate.js.map +1 -0
- package/dist/stream-sync/storage-retry.d.ts +216 -0
- package/dist/stream-sync/storage-retry.d.ts.map +1 -0
- package/dist/stream-sync/storage-retry.js +315 -0
- package/dist/stream-sync/storage-retry.js.map +1 -0
- package/dist/stream-sync/stream-aead.d.ts +33 -0
- package/dist/stream-sync/stream-aead.d.ts.map +1 -0
- package/dist/stream-sync/stream-aead.js +183 -0
- package/dist/stream-sync/stream-aead.js.map +1 -0
- package/dist/stream-sync/timer.d.ts +3 -0
- package/dist/stream-sync/timer.d.ts.map +1 -0
- package/dist/stream-sync/timer.js +3 -0
- package/dist/stream-sync/timer.js.map +1 -0
- package/dist/stream-sync-read/index.d.ts +4 -0
- package/dist/stream-sync-read/index.d.ts.map +1 -0
- package/dist/stream-sync-read/index.js +3 -0
- package/dist/stream-sync-read/index.js.map +1 -0
- package/dist/stream-sync-read/routing.d.ts +27 -0
- package/dist/stream-sync-read/routing.d.ts.map +1 -0
- package/dist/stream-sync-read/routing.js +49 -0
- package/dist/stream-sync-read/routing.js.map +1 -0
- package/dist/stream-sync-read/service.d.ts +281 -0
- package/dist/stream-sync-read/service.d.ts.map +1 -0
- package/dist/stream-sync-read/service.js +18 -0
- package/dist/stream-sync-read/service.js.map +1 -0
- package/dist/sync/account-mode/authority.d.ts +121 -0
- package/dist/sync/account-mode/authority.d.ts.map +1 -0
- package/dist/sync/account-mode/authority.js +446 -0
- package/dist/sync/account-mode/authority.js.map +1 -0
- package/dist/sync/account-mode/evidence-wire.d.ts +42 -0
- package/dist/sync/account-mode/evidence-wire.d.ts.map +1 -0
- package/dist/sync/account-mode/evidence-wire.js +76 -0
- package/dist/sync/account-mode/evidence-wire.js.map +1 -0
- package/dist/sync/account-mode/import-waker.d.ts +36 -0
- package/dist/sync/account-mode/import-waker.d.ts.map +1 -0
- package/dist/sync/account-mode/import-waker.js +55 -0
- package/dist/sync/account-mode/import-waker.js.map +1 -0
- package/dist/sync/account-mode/index.d.ts +10 -0
- package/dist/sync/account-mode/index.d.ts.map +1 -0
- package/dist/sync/account-mode/index.js +10 -0
- package/dist/sync/account-mode/index.js.map +1 -0
- package/dist/sync/account-mode/port.d.ts +11 -0
- package/dist/sync/account-mode/port.d.ts.map +1 -0
- package/dist/sync/account-mode/port.js +21 -0
- package/dist/sync/account-mode/port.js.map +1 -0
- package/dist/sync/account-mode/record.d.ts +54 -0
- package/dist/sync/account-mode/record.d.ts.map +1 -0
- package/dist/sync/account-mode/record.js +62 -0
- package/dist/sync/account-mode/record.js.map +1 -0
- package/dist/sync/account-mode/rw-lock.d.ts +14 -0
- package/dist/sync/account-mode/rw-lock.d.ts.map +1 -0
- package/dist/sync/account-mode/rw-lock.js +59 -0
- package/dist/sync/account-mode/rw-lock.js.map +1 -0
- package/dist/sync/cancellable-gateway.d.ts +25 -0
- package/dist/sync/cancellable-gateway.d.ts.map +1 -0
- package/dist/sync/cancellable-gateway.js +64 -0
- package/dist/sync/cancellable-gateway.js.map +1 -0
- package/dist/sync/engine/change-probe.d.ts +49 -0
- package/dist/sync/engine/change-probe.d.ts.map +1 -0
- package/dist/sync/engine/change-probe.js +84 -0
- package/dist/sync/engine/change-probe.js.map +1 -0
- package/dist/sync/engine/change-push.d.ts +56 -0
- package/dist/sync/engine/change-push.d.ts.map +1 -0
- package/dist/sync/engine/change-push.js +176 -0
- package/dist/sync/engine/change-push.js.map +1 -0
- package/dist/sync/engine/sync-manager.d.ts +208 -1
- package/dist/sync/engine/sync-manager.d.ts.map +1 -1
- package/dist/sync/engine/sync-manager.js +1005 -34
- package/dist/sync/engine/sync-manager.js.map +1 -1
- package/dist/sync/index.d.ts +6 -2
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +5 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/pdpp-import.d.ts +12 -2
- package/dist/sync/pdpp-import.d.ts.map +1 -1
- package/dist/sync/pdpp-import.js +32 -7
- package/dist/sync/pdpp-import.js.map +1 -1
- package/dist/sync/tombstone-resubmits.d.ts +7 -4
- package/dist/sync/tombstone-resubmits.d.ts.map +1 -1
- package/dist/sync/tombstone-resubmits.js.map +1 -1
- package/dist/sync/types.d.ts +29 -0
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/upload-attempts.d.ts +244 -0
- package/dist/sync/upload-attempts.d.ts.map +1 -0
- package/dist/sync/upload-attempts.js +548 -0
- package/dist/sync/upload-attempts.js.map +1 -0
- package/dist/sync/upload-state.d.ts +163 -0
- package/dist/sync/upload-state.d.ts.map +1 -0
- package/dist/sync/upload-state.js +239 -0
- package/dist/sync/upload-state.js.map +1 -0
- package/dist/sync/workers/delete.d.ts +33 -1
- package/dist/sync/workers/delete.d.ts.map +1 -1
- package/dist/sync/workers/delete.js +83 -11
- package/dist/sync/workers/delete.js.map +1 -1
- package/dist/sync/workers/download.d.ts +3 -0
- package/dist/sync/workers/download.d.ts.map +1 -1
- package/dist/sync/workers/download.js +67 -12
- package/dist/sync/workers/download.js.map +1 -1
- package/dist/sync/workers/upload.d.ts +70 -2
- package/dist/sync/workers/upload.d.ts.map +1 -1
- package/dist/sync/workers/upload.js +354 -23
- package/dist/sync/workers/upload.js.map +1 -1
- package/dist/test-support/memory-oracle.calibration.d.ts +16 -0
- package/dist/test-support/memory-oracle.calibration.d.ts.map +1 -0
- package/dist/test-support/memory-oracle.calibration.js +43 -0
- package/dist/test-support/memory-oracle.calibration.js.map +1 -0
- package/dist/test-support/memory-oracle.d.ts +82 -0
- package/dist/test-support/memory-oracle.d.ts.map +1 -0
- package/dist/test-support/memory-oracle.js +104 -0
- package/dist/test-support/memory-oracle.js.map +1 -0
- package/dist/test-utils/account-mode.d.ts +36 -0
- package/dist/test-utils/account-mode.d.ts.map +1 -0
- package/dist/test-utils/account-mode.js +78 -0
- package/dist/test-utils/account-mode.js.map +1 -0
- package/dist/test-utils/index.d.ts +3 -0
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +3 -0
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/legacy-write-seal.d.ts +16 -0
- package/dist/test-utils/legacy-write-seal.d.ts.map +1 -0
- package/dist/test-utils/legacy-write-seal.js +20 -0
- package/dist/test-utils/legacy-write-seal.js.map +1 -0
- package/dist/test-utils/live-grants.d.ts +24 -0
- package/dist/test-utils/live-grants.d.ts.map +1 -0
- package/dist/test-utils/live-grants.js +6 -0
- package/dist/test-utils/live-grants.js.map +1 -0
- package/dist/test-utils/memory-storage.d.ts +17 -1
- package/dist/test-utils/memory-storage.d.ts.map +1 -1
- package/dist/test-utils/memory-storage.js +94 -46
- package/dist/test-utils/memory-storage.js.map +1 -1
- package/dist/test-utils/run-end.d.ts +27 -0
- package/dist/test-utils/run-end.d.ts.map +1 -0
- package/dist/test-utils/run-end.js +44 -0
- package/dist/test-utils/run-end.js.map +1 -0
- package/dist/test-utils/wallet.d.ts +0 -4
- package/dist/test-utils/wallet.d.ts.map +1 -1
- package/dist/test-utils/wallet.js +3 -12
- package/dist/test-utils/wallet.js.map +1 -1
- package/dist/write/attribution.d.ts.map +1 -1
- package/dist/write/attribution.js +2 -4
- package/dist/write/attribution.js.map +1 -1
- package/dist-test/localdb/conformance.d.ts +13 -0
- package/dist-test/localdb/conformance.d.ts.map +1 -0
- package/dist-test/localdb/conformance.js +372 -0
- package/dist-test/localdb/conformance.js.map +1 -0
- package/dist-test/tsconfig.tsbuildinfo +1 -0
- package/package.json +60 -5
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { createRegistryChangePush, } from "./change-push.js";
|
|
2
|
+
/**
|
|
3
|
+
* Period of the timed registry probe.
|
|
4
|
+
*
|
|
5
|
+
* Two measured limits bound it (D4-SYNC-TRIGGERS, 2026-11-14):
|
|
6
|
+
*
|
|
7
|
+
* - Cost floor. One idle cycle of one connection of six streams makes 29
|
|
8
|
+
* registry requests (3 listings, 26 reads; `idle-cycle-requests.test.ts`),
|
|
9
|
+
* and the timer makes one per 60 s on every open device. The probe ADDS to
|
|
10
|
+
* that: 60 s / P requests a minute (12 at 5 s). Below 60 s / 29 = 2.1 s the
|
|
11
|
+
* probe alone would out-request the idle cycle it supplements. More
|
|
12
|
+
* connections raise the cycle's cost (1 + 28 per connection), so the floor
|
|
13
|
+
* only falls. The probe is not a saving; it buys latency.
|
|
14
|
+
* - Latency. A change waits half a period on average. The remaining path is
|
|
15
|
+
* the writer's publish (about 4.5 s) plus this device's apply (1 to 4 s), so
|
|
16
|
+
* waiting P/2 = 2.5 s keeps the added wait below the work it follows.
|
|
17
|
+
*
|
|
18
|
+
* 5 s sits inside both bounds. Hosts may change it; 0 switches the probe off.
|
|
19
|
+
* The probe runs only while the held push request cannot announce changes
|
|
20
|
+
* (absent, failing, or answering without a position); a healthy push makes it
|
|
21
|
+
* redundant and the manager skips it.
|
|
22
|
+
*/
|
|
23
|
+
export const DEFAULT_CHANGE_PROBE_MS = 5_000;
|
|
24
|
+
/**
|
|
25
|
+
* A probe read that has not answered after this long failed. A probe is
|
|
26
|
+
* optional: a read that never settles must not hold a pull in flight, so the
|
|
27
|
+
* ordinary timed path and every later poke stay free. It matches the push
|
|
28
|
+
* request's grace (`REQUEST_GRACE_MS`), the same "this connection is dead" bar.
|
|
29
|
+
*/
|
|
30
|
+
export const PROBE_TIMEOUT_MS = 10_000;
|
|
31
|
+
/** The manager's probe over a registry that can answer one; none otherwise. */
|
|
32
|
+
export function createRegistryChangeProbe(registry, options = {}) {
|
|
33
|
+
const intervalMs = Number.isFinite(options.intervalMs)
|
|
34
|
+
? options.intervalMs
|
|
35
|
+
: DEFAULT_CHANGE_PROBE_MS;
|
|
36
|
+
const probeChange = registry.probeChange?.bind(registry);
|
|
37
|
+
if (!probeChange || !(intervalMs > 0))
|
|
38
|
+
return undefined;
|
|
39
|
+
const push = createRegistryChangePush(registry, options.push);
|
|
40
|
+
return {
|
|
41
|
+
read: (lifecycle) => readWithDeadline(probeChange, lifecycle),
|
|
42
|
+
intervalMs,
|
|
43
|
+
...(push && { push }),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One probe read that ends. It ends on the first of: the registry's answer,
|
|
48
|
+
* the deadline, or the manager's lifecycle signal (a hide or a stop). Deadline
|
|
49
|
+
* and lifecycle abort the request so it frees its connection, and both settle
|
|
50
|
+
* the read at once even when the registry ignores the signal. Every way out
|
|
51
|
+
* clears the deadline timer and the lifecycle listener, and a late answer from
|
|
52
|
+
* the registry finds the read already settled.
|
|
53
|
+
*/
|
|
54
|
+
function readWithDeadline(probeChange, lifecycle) {
|
|
55
|
+
const asError = (reason) => reason instanceof Error ? reason : new Error("registry change probe ended");
|
|
56
|
+
if (lifecycle.aborted)
|
|
57
|
+
return Promise.reject(asError(lifecycle.reason));
|
|
58
|
+
const controller = new AbortController();
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
let settled = false;
|
|
61
|
+
const finish = (settle) => {
|
|
62
|
+
if (settled)
|
|
63
|
+
return;
|
|
64
|
+
settled = true;
|
|
65
|
+
clearTimeout(timer);
|
|
66
|
+
lifecycle.removeEventListener("abort", onLifecycle);
|
|
67
|
+
settle();
|
|
68
|
+
};
|
|
69
|
+
const fail = (error) => {
|
|
70
|
+
controller.abort(error);
|
|
71
|
+
finish(() => reject(error));
|
|
72
|
+
};
|
|
73
|
+
const onLifecycle = () => fail(asError(lifecycle.reason));
|
|
74
|
+
const timer = setTimeout(() => fail(new Error("registry change probe got no answer")), PROBE_TIMEOUT_MS);
|
|
75
|
+
lifecycle.addEventListener("abort", onLifecycle, { once: true });
|
|
76
|
+
try {
|
|
77
|
+
probeChange(controller.signal).then((marker) => finish(() => resolve(marker)), (error) => finish(() => reject(error)));
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
finish(() => reject(error));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=change-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-probe.js","sourceRoot":"","sources":["../../../src/sync/engine/change-probe.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,GAEzB,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAiBvC,+EAA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js";
|
|
3
|
+
export { ChangeFeedAbsentError };
|
|
4
|
+
/**
|
|
5
|
+
* How long one held request waits at the gateway before it answers "nothing
|
|
6
|
+
* yet". Each answer starts the next request, so an idle client makes one
|
|
7
|
+
* request per this period: 25 s is 0.04 req/s, against 0.2 req/s for the 5 s
|
|
8
|
+
* probe it relieves. It stays under common proxy idle limits (30 to 60 s), and
|
|
9
|
+
* the gateway refuses a wait above 55 s.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CHANGE_PUSH_WAIT_MS = 25000;
|
|
12
|
+
/**
|
|
13
|
+
* The wait before retry number `failures` + 1 (0 for the first retry): 1 s
|
|
14
|
+
* doubling to 30 s, spread over half to one and a half of the step so a fleet
|
|
15
|
+
* that lost the same dependency together does not return together. The push
|
|
16
|
+
* uses it for its transport; the manager uses it to space retries of a failing
|
|
17
|
+
* cycle, so a failure has one back-off schedule.
|
|
18
|
+
*/
|
|
19
|
+
export declare function changePushBackoffMs(failures: number, random?: () => number): number;
|
|
20
|
+
export interface RegistryChangePushOptions {
|
|
21
|
+
/** Default true; false: no push, the timed probe alone (as before). */
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Default {@link CHANGE_PUSH_WAIT_MS}, also for a value that is not a finite
|
|
25
|
+
* positive number: a held request of NaN or Infinity seconds is no period.
|
|
26
|
+
*/
|
|
27
|
+
waitMs?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A subscription to the gateway's "the registry moved" signal.
|
|
31
|
+
*
|
|
32
|
+
* It keeps one held request open. Each answer carries the registry's
|
|
33
|
+
* sequence, the registry's position; the next request sends it back, so the
|
|
34
|
+
* gateway compares two numbers and a poke that was lost on the wire is found
|
|
35
|
+
* by the next request. An answer that ends the wait with nothing new carries
|
|
36
|
+
* the gateway's current sequence too, read when the wait ended. The position is
|
|
37
|
+
* not data: the manager reads the registry itself and trusts the position only
|
|
38
|
+
* to say that nothing moved since a cycle that started under it, so a wake that
|
|
39
|
+
* was lost is found at the next answer. It does four things:
|
|
40
|
+
*
|
|
41
|
+
* - every answer reports its sequence as the position (`onPosition`), before
|
|
42
|
+
* anything else, so the cycle a poke starts samples the position it follows;
|
|
43
|
+
* - an answer that says `changed` is a poke (`onChange`): the manager pulls,
|
|
44
|
+
* or applies the answer's delta. Each held request sends the position the
|
|
45
|
+
* manager holds the registry up to (`since`), so the gateway can answer
|
|
46
|
+
* with what changed after it;
|
|
47
|
+
* - the first answer after any failure is a poke too, whether or not the
|
|
48
|
+
* sequence moved, so a poke lost with the connection costs one pull. A
|
|
49
|
+
* failed attempt is not a poke: with every answer lost, only the manager's
|
|
50
|
+
* timer cycle (and its probe) finds the change;
|
|
51
|
+
* - `onHealth(false)` on any failure or silence, `onHealth(true)` on the next
|
|
52
|
+
* answer: only while healthy does the manager skip its timer cycle and
|
|
53
|
+
* probe.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createRegistryChangePush(registry: Pick<StreamSyncRegistry, "waitForChange">, options?: RegistryChangePushOptions): ChangePush | undefined;
|
|
56
|
+
//# sourceMappingURL=change-push.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-push.d.ts","sourceRoot":"","sources":["../../../src/sync/engine/change-push.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EAErB,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAY1C;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,MAAM,MAAoB,GACjC,MAAM,CAGR;AAED,MAAM,WAAW,yBAAyB;IACxC,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,EACnD,OAAO,GAAE,yBAA8B,GACtC,UAAU,GAAG,SAAS,CA2HxB"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { NODE_MAX_TIMER_DELAY_MS } from "../../stream-sync/timer.js";
|
|
2
|
+
import { ChangeFeedAbsentError, RegistryOverloadError, } from "../../stream-sync/ports.js";
|
|
3
|
+
export { ChangeFeedAbsentError };
|
|
4
|
+
/**
|
|
5
|
+
* How long one held request waits at the gateway before it answers "nothing
|
|
6
|
+
* yet". Each answer starts the next request, so an idle client makes one
|
|
7
|
+
* request per this period: 25 s is 0.04 req/s, against 0.2 req/s for the 5 s
|
|
8
|
+
* probe it relieves. It stays under common proxy idle limits (30 to 60 s), and
|
|
9
|
+
* the gateway refuses a wait above 55 s.
|
|
10
|
+
*/
|
|
11
|
+
export const CHANGE_PUSH_WAIT_MS = 25_000;
|
|
12
|
+
/**
|
|
13
|
+
* Longer than the wait by this much, a request with no answer is declared
|
|
14
|
+
* dead (a half-open connection never errors). The cost of a dead request is
|
|
15
|
+
* bounded by this: the push says it is unhealthy and the 5 s probe returns.
|
|
16
|
+
*/
|
|
17
|
+
const REQUEST_GRACE_MS = 10_000;
|
|
18
|
+
const BACKOFF_MIN_MS = 1_000;
|
|
19
|
+
const BACKOFF_MAX_MS = 30_000;
|
|
20
|
+
/**
|
|
21
|
+
* The wait before retry number `failures` + 1 (0 for the first retry): 1 s
|
|
22
|
+
* doubling to 30 s, spread over half to one and a half of the step so a fleet
|
|
23
|
+
* that lost the same dependency together does not return together. The push
|
|
24
|
+
* uses it for its transport; the manager uses it to space retries of a failing
|
|
25
|
+
* cycle, so a failure has one back-off schedule.
|
|
26
|
+
*/
|
|
27
|
+
export function changePushBackoffMs(failures, random = Math.random) {
|
|
28
|
+
const base = BACKOFF_MIN_MS * 2 ** Math.min(failures, 5);
|
|
29
|
+
return Math.min(BACKOFF_MAX_MS, base * (0.5 + random()));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A subscription to the gateway's "the registry moved" signal.
|
|
33
|
+
*
|
|
34
|
+
* It keeps one held request open. Each answer carries the registry's
|
|
35
|
+
* sequence, the registry's position; the next request sends it back, so the
|
|
36
|
+
* gateway compares two numbers and a poke that was lost on the wire is found
|
|
37
|
+
* by the next request. An answer that ends the wait with nothing new carries
|
|
38
|
+
* the gateway's current sequence too, read when the wait ended. The position is
|
|
39
|
+
* not data: the manager reads the registry itself and trusts the position only
|
|
40
|
+
* to say that nothing moved since a cycle that started under it, so a wake that
|
|
41
|
+
* was lost is found at the next answer. It does four things:
|
|
42
|
+
*
|
|
43
|
+
* - every answer reports its sequence as the position (`onPosition`), before
|
|
44
|
+
* anything else, so the cycle a poke starts samples the position it follows;
|
|
45
|
+
* - an answer that says `changed` is a poke (`onChange`): the manager pulls,
|
|
46
|
+
* or applies the answer's delta. Each held request sends the position the
|
|
47
|
+
* manager holds the registry up to (`since`), so the gateway can answer
|
|
48
|
+
* with what changed after it;
|
|
49
|
+
* - the first answer after any failure is a poke too, whether or not the
|
|
50
|
+
* sequence moved, so a poke lost with the connection costs one pull. A
|
|
51
|
+
* failed attempt is not a poke: with every answer lost, only the manager's
|
|
52
|
+
* timer cycle (and its probe) finds the change;
|
|
53
|
+
* - `onHealth(false)` on any failure or silence, `onHealth(true)` on the next
|
|
54
|
+
* answer: only while healthy does the manager skip its timer cycle and
|
|
55
|
+
* probe.
|
|
56
|
+
*/
|
|
57
|
+
export function createRegistryChangePush(registry, options = {}) {
|
|
58
|
+
const waitForChange = registry.waitForChange?.bind(registry);
|
|
59
|
+
if (!waitForChange || options.enabled === false)
|
|
60
|
+
return undefined;
|
|
61
|
+
const waitMs = Number.isFinite(options.waitMs) && options.waitMs > 0
|
|
62
|
+
? options.waitMs
|
|
63
|
+
: CHANGE_PUSH_WAIT_MS;
|
|
64
|
+
return {
|
|
65
|
+
subscribe(handlers) {
|
|
66
|
+
const lifetime = new AbortController();
|
|
67
|
+
let cursor;
|
|
68
|
+
let healthy = false;
|
|
69
|
+
let afterFailure = false;
|
|
70
|
+
let failures = 0;
|
|
71
|
+
const setHealth = (next) => {
|
|
72
|
+
if (healthy === next || lifetime.signal.aborted)
|
|
73
|
+
return;
|
|
74
|
+
healthy = next;
|
|
75
|
+
handlers.onHealth(next);
|
|
76
|
+
};
|
|
77
|
+
// The abort listener goes away on both ways out. An outage sleeps once
|
|
78
|
+
// per attempt; a listener left behind by each sleep is a leak that grows
|
|
79
|
+
// with the subscription's age.
|
|
80
|
+
const sleep = async (ms) => {
|
|
81
|
+
const deadline = Date.now() + ms;
|
|
82
|
+
while (!lifetime.signal.aborted && Date.now() < deadline) {
|
|
83
|
+
await new Promise((resolve) => {
|
|
84
|
+
const done = () => {
|
|
85
|
+
clearTimeout(timer);
|
|
86
|
+
lifetime.signal.removeEventListener("abort", done);
|
|
87
|
+
resolve();
|
|
88
|
+
};
|
|
89
|
+
const timer = setTimeout(done, Math.min(deadline - Date.now(), NODE_MAX_TIMER_DELAY_MS));
|
|
90
|
+
lifetime.signal.addEventListener("abort", done, { once: true });
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
async function once() {
|
|
95
|
+
const request = new AbortController();
|
|
96
|
+
let timer;
|
|
97
|
+
let onStop;
|
|
98
|
+
// The request ends on the first of: the registry's answer, the
|
|
99
|
+
// deadline, or the subscription's end. The last two settle it at once
|
|
100
|
+
// and clear the deadline timer in the same turn, even when the
|
|
101
|
+
// registry ignores the abort; a late answer then finds nobody waiting.
|
|
102
|
+
const ended = new Promise((_resolve, reject) => {
|
|
103
|
+
timer = setTimeout(() => {
|
|
104
|
+
const error = new Error("change request got no answer");
|
|
105
|
+
request.abort(error);
|
|
106
|
+
reject(error);
|
|
107
|
+
}, waitMs + REQUEST_GRACE_MS);
|
|
108
|
+
onStop = () => {
|
|
109
|
+
clearTimeout(timer);
|
|
110
|
+
request.abort(lifetime.signal.reason);
|
|
111
|
+
reject(lifetime.signal.reason);
|
|
112
|
+
};
|
|
113
|
+
lifetime.signal.addEventListener("abort", onStop, { once: true });
|
|
114
|
+
});
|
|
115
|
+
try {
|
|
116
|
+
const wait = waitForChange(cursor, waitMs, request.signal, cursor === undefined ? undefined : handlers.since());
|
|
117
|
+
wait.catch(() => { }); // a late failure after the race is not ours
|
|
118
|
+
const answer = await Promise.race([wait, ended]);
|
|
119
|
+
if (lifetime.signal.aborted)
|
|
120
|
+
return "failed";
|
|
121
|
+
cursor = answer.seq;
|
|
122
|
+
failures = 0;
|
|
123
|
+
setHealth(true);
|
|
124
|
+
// The position first: the cycle a poke starts samples it.
|
|
125
|
+
handlers.onPosition(answer.seq);
|
|
126
|
+
if (answer.changed || afterFailure) {
|
|
127
|
+
afterFailure = false;
|
|
128
|
+
handlers.onChange(answer.changed ? answer.delta : undefined);
|
|
129
|
+
}
|
|
130
|
+
return "answer";
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
if (error instanceof RegistryOverloadError)
|
|
134
|
+
return error.retryAfterMs;
|
|
135
|
+
if (error instanceof ChangeFeedAbsentError)
|
|
136
|
+
return "absent";
|
|
137
|
+
return "failed";
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
clearTimeout(timer);
|
|
141
|
+
lifetime.signal.removeEventListener("abort", onStop);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
void (async () => {
|
|
145
|
+
while (!lifetime.signal.aborted) {
|
|
146
|
+
const outcome = await once();
|
|
147
|
+
if (lifetime.signal.aborted)
|
|
148
|
+
return;
|
|
149
|
+
if (typeof outcome === "number") {
|
|
150
|
+
await sleep(outcome);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (outcome === "absent") {
|
|
154
|
+
// No route: stay unhealthy, so the manager's timer and probe keep
|
|
155
|
+
// watching, and ask again after one held period. An absent route
|
|
156
|
+
// then costs at most the one request per period a present route
|
|
157
|
+
// costs, and a gateway that gains the route is found within a
|
|
158
|
+
// period, with no restart.
|
|
159
|
+
setHealth(false);
|
|
160
|
+
await sleep(waitMs);
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (outcome === "failed") {
|
|
164
|
+
setHealth(false);
|
|
165
|
+
afterFailure = true;
|
|
166
|
+
const wait = changePushBackoffMs(failures);
|
|
167
|
+
failures += 1;
|
|
168
|
+
await sleep(wait);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
})();
|
|
172
|
+
return () => lifetime.abort(new Error("change push stopped"));
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=change-push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-push.js","sourceRoot":"","sources":["../../../src/sync/engine/change-push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GAEtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAE1C;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC,MAAM,cAAc,GAAG,KAAK,CAAC;AAC7B,MAAM,cAAc,GAAG,MAAM,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAgB,EAChB,SAAuB,IAAI,CAAC,MAAM;IAElC,MAAM,IAAI,GAAG,cAAc,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,GAAG,CAAC,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,11 +1,122 @@
|
|
|
1
|
+
import type { OwnedAccountStorageMode } from "../../api/account-storage-mode.js";
|
|
1
2
|
import type { UploadWorkerDeps } from "../workers/upload.js";
|
|
2
3
|
import type { DownloadWorkerDeps } from "../workers/download.js";
|
|
3
4
|
import type { SyncStatus } from "../types.js";
|
|
5
|
+
import { type UploadAttemptStore } from "../upload-attempts.js";
|
|
4
6
|
import { type DeleteScopeResult } from "../workers/delete.js";
|
|
7
|
+
import type { DeltaApplyResult, RegistryChangeDelta } from "../../stream-sync/ports.js";
|
|
5
8
|
import type { DeleteDataPort, PendingBlobDeletionStore, TombstoneFinalityPort } from "../../ports/index.js";
|
|
9
|
+
import type { LegacyWriteSeal } from "../../storage/legacy-write-seal.js";
|
|
10
|
+
/**
|
|
11
|
+
* A cheap read of "did anything in the owner's registry change?": one request,
|
|
12
|
+
* whatever the number of rows. The marker is opaque and only compared for
|
|
13
|
+
* equality; `null` is an empty registry; `undefined` is "cannot tell" (the
|
|
14
|
+
* gateway sent nothing to compare). A read that throws is a failed probe.
|
|
15
|
+
*
|
|
16
|
+
* The marker is a HINT, not a proof of "nothing changed". It fingerprints one
|
|
17
|
+
* row, so a change that leaves that row alone (two rows stamped in the same
|
|
18
|
+
* millisecond, a lower row changed under an unchanged top row) is invisible to
|
|
19
|
+
* it. A manager therefore uses it only to start a cycle early. It never uses
|
|
20
|
+
* it to skip a cycle. A failed or "cannot tell" probe never starts a cycle by
|
|
21
|
+
* itself (see `requestPull`). What may skip the timer's cycle is the push's
|
|
22
|
+
* position, which the gateway makes exact (see {@link ChangePush}).
|
|
23
|
+
*/
|
|
24
|
+
export interface ChangeProbe {
|
|
25
|
+
/**
|
|
26
|
+
* One read. `lifecycle` is the manager's: it aborts on a pause and on a stop,
|
|
27
|
+
* and the read must then end at once (reject, abort its request, clear its
|
|
28
|
+
* timers) whether or not the registry honours the signal.
|
|
29
|
+
*/
|
|
30
|
+
read(lifecycle: AbortSignal): Promise<string | null | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Period of the timed probe in milliseconds. Signals (`requestPull`) probe
|
|
33
|
+
* at once and do not wait for it. See D4-SYNC-TRIGGERS for how the host
|
|
34
|
+
* derives it from the cost of one idle cycle.
|
|
35
|
+
*/
|
|
36
|
+
intervalMs: number;
|
|
37
|
+
/**
|
|
38
|
+
* A server push that tells the manager when to pull. While it is healthy and
|
|
39
|
+
* its position is the one the last clean cycle started under, the timer's
|
|
40
|
+
* cycle and the timed probe are skipped; otherwise nothing differs.
|
|
41
|
+
*/
|
|
42
|
+
push?: ChangePush;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A server push that says where the registry is. Its position is the gateway's
|
|
46
|
+
* exact sequence for the owner: it changes whenever anything a client can see
|
|
47
|
+
* changed. A poke can still be lost, doubled or late, and the marker the probe
|
|
48
|
+
* compares fingerprints one row, so neither decides alone.
|
|
49
|
+
*
|
|
50
|
+
* A poke runs a cycle at once. It does not go through the marker comparison,
|
|
51
|
+
* and it does not wait for the probe: a probe that never answers cannot hold
|
|
52
|
+
* it up. A failed attempt is not a poke.
|
|
53
|
+
*
|
|
54
|
+
* The position lets the manager skip work. A cycle reads the registry after
|
|
55
|
+
* the position it started under, so when the push is healthy and its position
|
|
56
|
+
* is still the one the last clean cycle started under, that cycle already
|
|
57
|
+
* holds everything the registry has, and the timer's cycle and the probe would
|
|
58
|
+
* only repeat it. Both resume the moment the push is not healthy, the position
|
|
59
|
+
* moved, or the last cycle was not clean. Every answer of the held request,
|
|
60
|
+
* an empty one at the end of its wait included, carries the current position.
|
|
61
|
+
* An answer whose position moved also says `changed`, so a wake that was lost
|
|
62
|
+
* on the way is found by the next answer: `onChange` runs a cycle at once.
|
|
63
|
+
* `onPosition` only records the position. A moved position that arrives
|
|
64
|
+
* without `onChange` ends the skip, and the next timer tick or probe runs the
|
|
65
|
+
* cycle.
|
|
66
|
+
*
|
|
67
|
+
* A clean cycle threw nothing, was not blocked and left no work behind (see
|
|
68
|
+
* `connectionsOwingWork`). A legacy (unswitched) cycle is never clean: its retries
|
|
69
|
+
* run on the clock, and no position announces them. While the push is healthy
|
|
70
|
+
* and the last cycle was clean, an idle device costs one held request per
|
|
71
|
+
* period. That holds only for what the gateway's position covers: the data
|
|
72
|
+
* rows and the server registration the cycle reads.
|
|
73
|
+
*/
|
|
74
|
+
export interface ChangePush {
|
|
75
|
+
/**
|
|
76
|
+
* Start a subscription; the returned function ends it. `onPosition(p)` is
|
|
77
|
+
* the registry's position as of an answer; it comes before the `onChange` of
|
|
78
|
+
* the same answer. `onChange` means the registry's sequence moved since the
|
|
79
|
+
* last answer, or the first answer after a failure came back: run a cycle.
|
|
80
|
+
* Its `delta`, when the gateway sent one, is what changed after the `since`
|
|
81
|
+
* the request carried. Both are called on a successful answer only; a
|
|
82
|
+
* failed attempt calls nothing. `onHealth(true)`: the channel answered
|
|
83
|
+
* lately, so positions can be trusted; `onHealth(false)`: it failed or went
|
|
84
|
+
* quiet, so do not rely on one. `since()` is read as each held request is
|
|
85
|
+
* sent: the position the manager holds the registry up to once its work in
|
|
86
|
+
* flight ends, if any. A pass that has started or is queued counts: the
|
|
87
|
+
* request asks for what follows the position that pass settles at, so a
|
|
88
|
+
* change that lands during it comes back as a delta.
|
|
89
|
+
*/
|
|
90
|
+
subscribe(handlers: {
|
|
91
|
+
onChange(delta: RegistryChangeDelta | undefined): void;
|
|
92
|
+
onHealth(healthy: boolean): void;
|
|
93
|
+
onPosition(position: string): void;
|
|
94
|
+
since(): string | undefined;
|
|
95
|
+
}): () => void;
|
|
96
|
+
}
|
|
6
97
|
export interface SyncManagerOptions {
|
|
98
|
+
/** Personal Server hosts always supply their owner-bound Account mode. */
|
|
99
|
+
accountStorageMode?: Pick<OwnedAccountStorageMode, "read">;
|
|
100
|
+
localSync?: {
|
|
101
|
+
hasPendingPublication?(): Promise<boolean>;
|
|
102
|
+
cycle(scope?: {
|
|
103
|
+
readonly connections: readonly string[];
|
|
104
|
+
}): Promise<unknown>;
|
|
105
|
+
/**
|
|
106
|
+
* Apply a change delta without the cycle's registry reads, when it can
|
|
107
|
+
* (`applyRegistryDelta`).
|
|
108
|
+
*/
|
|
109
|
+
applyDelta(delta: RegistryChangeDelta): Promise<DeltaApplyResult>;
|
|
110
|
+
};
|
|
7
111
|
/** Polling interval in milliseconds (default: 60_000 = 1 minute) */
|
|
8
112
|
pollInterval?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Starts a cycle when the registry changed, between the timer's cycles. The
|
|
115
|
+
* timer's cycle is never gated on the marker: a probe that fails or misses a
|
|
116
|
+
* change (see {@link ChangeProbe}) costs at most one poll interval. Only a
|
|
117
|
+
* healthy push whose position has not moved lets the timer skip.
|
|
118
|
+
*/
|
|
119
|
+
changeProbe?: ChangeProbe;
|
|
9
120
|
/** Max upload batch size per cycle (default: 50) */
|
|
10
121
|
uploadBatchSize?: number;
|
|
11
122
|
/** Debounce for immediate sync after local ingest (default: 500ms) */
|
|
@@ -17,6 +128,13 @@ export interface SyncManagerOptions {
|
|
|
17
128
|
* `deleteScope` is local-only and reports `durable: false`.
|
|
18
129
|
*/
|
|
19
130
|
deleteData?: DeleteDataPort | null;
|
|
131
|
+
/**
|
|
132
|
+
* Durable host storage for upload-attempt markers. With it, an upload that
|
|
133
|
+
* kills the process is counted across restarts and host rebuilds, and the
|
|
134
|
+
* entry is quarantined after repeated crashes. Without it the markers live
|
|
135
|
+
* in memory and protect nothing across a restart.
|
|
136
|
+
*/
|
|
137
|
+
uploadAttemptStore?: UploadAttemptStore;
|
|
20
138
|
/** Durable retry marker for blob deletions that failed after the tombstone. */
|
|
21
139
|
pendingBlobDeletions?: PendingBlobDeletionStore;
|
|
22
140
|
/**
|
|
@@ -28,6 +146,17 @@ export interface SyncManagerOptions {
|
|
|
28
146
|
transferMode?: "upload-download" | "download-only";
|
|
29
147
|
/** Exact owner scopes to hydrate before the first full download cycle. */
|
|
30
148
|
hydrateScopes?: string[];
|
|
149
|
+
/**
|
|
150
|
+
* A host's whole-file publisher hook (default absent). When `write` is
|
|
151
|
+
* true, each upload cycle runs the publisher after the legacy upload. When
|
|
152
|
+
* it is false or absent, nothing changes. No server config key sets it.
|
|
153
|
+
*/
|
|
154
|
+
streamSync?: {
|
|
155
|
+
readonly write: boolean;
|
|
156
|
+
readonly publisher: {
|
|
157
|
+
cycle(): Promise<unknown>;
|
|
158
|
+
};
|
|
159
|
+
} | null;
|
|
31
160
|
}
|
|
32
161
|
export type SyncCanRunResult = {
|
|
33
162
|
ok: true;
|
|
@@ -43,19 +172,97 @@ export interface SyncManager {
|
|
|
43
172
|
stop(): Promise<void>;
|
|
44
173
|
/** Trigger an immediate sync cycle (skips wait) */
|
|
45
174
|
trigger(): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* A signal that remote state may have changed: a tab or window came back, the
|
|
177
|
+
* network returned, a probe period passed. With a `changeProbe`, one cheap
|
|
178
|
+
* registry read decides: a cycle runs only when the registry moved since the
|
|
179
|
+
* last cycle this method ran. Without one, it requests a cycle. Requests
|
|
180
|
+
* coalesce (one probe in flight, one cycle running, one follow-up for any
|
|
181
|
+
* number of requests during it) and never reset the timer. Does nothing
|
|
182
|
+
* while stopped. Rejects when the cycle it ran rejects.
|
|
183
|
+
*/
|
|
184
|
+
requestPull(): Promise<void>;
|
|
46
185
|
/** Get current sync status */
|
|
47
186
|
getStatus(): SyncStatus;
|
|
187
|
+
/**
|
|
188
|
+
* Calls `listener` with the new `getStatus()` value after each change of it:
|
|
189
|
+
* a cycle starting or ending, a pass finishing, an error, a blocked or
|
|
190
|
+
* unblocked state, scopes hydrated, the pending count moving, the manager
|
|
191
|
+
* starting or stopping. A change is found by comparing the whole status with
|
|
192
|
+
* the last one delivered at each of those points, so a point that changed
|
|
193
|
+
* nothing is silent, and a subscriber is never told twice for one value.
|
|
194
|
+
*
|
|
195
|
+
* Listeners run after the state change, one at a time and never nested: a
|
|
196
|
+
* change made while they run (for instance by a `trigger` they call) is
|
|
197
|
+
* delivered after they return, once, and only if the value still differs. A
|
|
198
|
+
* listener that throws is logged and skipped. `getStatus` only reads, so a
|
|
199
|
+
* listener that calls it cannot cause an event. No timer is involved.
|
|
200
|
+
*
|
|
201
|
+
* A subscription belongs to the subscriber, not to a run: it works before
|
|
202
|
+
* `start`, and `stop` leaves it registered (the stop itself is delivered as
|
|
203
|
+
* `running: false`), so a manager that starts again is heard again. With no
|
|
204
|
+
* subscriber the manager reads nothing extra; the first subscriber's value is
|
|
205
|
+
* the baseline and is not delivered. Returns the unsubscribe.
|
|
206
|
+
*
|
|
207
|
+
* Do not call `trigger` on every event. Each cycle changes `lastSync`, so
|
|
208
|
+
* each cycle ends with an event that would start the next one, and nothing
|
|
209
|
+
* here bounds that loop: delivery is never nested and coalesces events, but
|
|
210
|
+
* it does not stop a listener that always triggers. Trigger only on a change
|
|
211
|
+
* the listener acts on, such as the first `lastSync`.
|
|
212
|
+
*
|
|
213
|
+
* Disposal: the manager does not close with its host. Unsubscribe before the
|
|
214
|
+
* storage or the stream database the status reads is closed (in Lite,
|
|
215
|
+
* before `closeStreamSync`), because a stop, or a cycle that is still ending,
|
|
216
|
+
* can deliver one more event after the host has begun to close.
|
|
217
|
+
*/
|
|
218
|
+
subscribeStatus(listener: (status: SyncStatus) => void): () => void;
|
|
48
219
|
/** Download exact owner scopes without advancing the registry cursor. */
|
|
49
220
|
hydrateScopes(scopes: string[]): Promise<void>;
|
|
221
|
+
/**
|
|
222
|
+
* Owner retry: lift the quarantine of uploads that crashed the process, for
|
|
223
|
+
* one scope or all. The next cycle attempts them again.
|
|
224
|
+
*/
|
|
225
|
+
retryQuarantinedUploads(scope?: string): Promise<void>;
|
|
50
226
|
/** Signal that new data has been ingested (next cycle picks it up) */
|
|
51
227
|
notifyNewData(): void;
|
|
228
|
+
/**
|
|
229
|
+
* A run or an import committed its rows: the data is complete, and nothing
|
|
230
|
+
* more is coming that a wait could gather. Starts the cycle now; a cycle in
|
|
231
|
+
* flight runs once more after it. `notifyNewData` instead waits out the
|
|
232
|
+
* debounce, for callers that signal one record at a time.
|
|
233
|
+
*/
|
|
234
|
+
notifyRecordsCommitted(): void;
|
|
235
|
+
/**
|
|
236
|
+
* The host says no one is looking (a hidden Web tab). The manager holds no
|
|
237
|
+
* request and no timer until `resume`: it aborts the held push request and
|
|
238
|
+
* clears the push's cooldown, the failure retry, the poll, the probe and the
|
|
239
|
+
* ingest-debounce timers, and forgets the push's health and the failure
|
|
240
|
+
* streak. A cycle already running finishes. Work that came in meanwhile (a
|
|
241
|
+
* follow-up it owes, a local ingest) is remembered, not run. Pulls and
|
|
242
|
+
* signals do nothing while paused; `trigger` still runs. Does nothing when
|
|
243
|
+
* stopped or already paused.
|
|
244
|
+
*/
|
|
245
|
+
pause(): void;
|
|
246
|
+
/**
|
|
247
|
+
* The host says someone is looking again. Restarts the timers and starts
|
|
248
|
+
* exactly one push subscription, and runs one cycle if work was owed while
|
|
249
|
+
* paused. A signal that follows (`requestPull`) still does its own probe.
|
|
250
|
+
* Does nothing when stopped or not paused.
|
|
251
|
+
*/
|
|
252
|
+
resume(): void;
|
|
52
253
|
/**
|
|
53
254
|
* Durable scope deletion: gateway tombstone, then storage blobs, then the
|
|
54
255
|
* local copy (see workers/delete.ts for why that order is the only safe
|
|
55
256
|
* one). Resolves with a per-step result; a gateway failure leaves the
|
|
56
257
|
* local copy in place and is reported as `steps.gateway.status = "failed"`.
|
|
258
|
+
*
|
|
259
|
+
* `within` is the legacy-write seal's `commit`. When given, the delete runs
|
|
260
|
+
* inside it (and a refusal rejects with `LegacyWriteRefusedError` before
|
|
261
|
+
* anything is sent or removed). It is entered AFTER this manager's mutation
|
|
262
|
+
* queue: a sync cycle holds the queue and asks the seal, so the seal must be
|
|
263
|
+
* the innermost lock or a waiting On deadlocks the two.
|
|
57
264
|
*/
|
|
58
|
-
deleteScope(scope: string): Promise<DeleteScopeResult>;
|
|
265
|
+
deleteScope(scope: string, within?: LegacyWriteSeal["commit"]): Promise<DeleteScopeResult>;
|
|
59
266
|
/** Whether the sync manager is currently running */
|
|
60
267
|
readonly running: boolean;
|
|
61
268
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-manager.d.ts","sourceRoot":"","sources":["../../../src/sync/engine/sync-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAgC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-manager.d.ts","sourceRoot":"","sources":["../../../src/sync/engine/sync-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAgC,MAAM,aAAa,CAAC;AAG5E,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,IAAI,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACjE;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CA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