@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,177 @@
|
|
|
1
|
+
import { canonicalJson, } from "@opendatalabs/personal-server-ts-stream-sync";
|
|
2
|
+
import { rawEndInvalid, validateRawEnd } from "./raw-end.js";
|
|
3
|
+
export const EMPTY_RAW_RECORDS = {
|
|
4
|
+
liveCount: 0,
|
|
5
|
+
deletedCount: 0,
|
|
6
|
+
everDeleted: false,
|
|
7
|
+
upsertEvents: 0,
|
|
8
|
+
deleteEvents: 0,
|
|
9
|
+
};
|
|
10
|
+
/** V1 machine-code fallback. Human messages are never policy inputs. */
|
|
11
|
+
const RETRYABLE_CODES_V1 = new Set([
|
|
12
|
+
"timeout",
|
|
13
|
+
"rate_limited",
|
|
14
|
+
"temporarily_unavailable",
|
|
15
|
+
]);
|
|
16
|
+
function machineCode(error) {
|
|
17
|
+
return error.code ?? error.reason;
|
|
18
|
+
}
|
|
19
|
+
function isGap(error) {
|
|
20
|
+
return error.kind === "detail_gap" || error.kind === "detail_gap_recovered";
|
|
21
|
+
}
|
|
22
|
+
function retryable(error) {
|
|
23
|
+
const hint = error.recoveryHint;
|
|
24
|
+
const structured = typeof hint === "object" ? hint : undefined;
|
|
25
|
+
// Preserve the native gap field; never fabricate a recoveryHint for it.
|
|
26
|
+
if (error.retryable === false || structured?.retryable === false)
|
|
27
|
+
return false;
|
|
28
|
+
if (error.retryable === true || structured?.retryable === true)
|
|
29
|
+
return true;
|
|
30
|
+
if (isGap(error))
|
|
31
|
+
return true;
|
|
32
|
+
return (hint === "retry_by_runtime" ||
|
|
33
|
+
structured?.action === "retry_by_runtime" ||
|
|
34
|
+
RETRYABLE_CODES_V1.has(machineCode(error) ?? ""));
|
|
35
|
+
}
|
|
36
|
+
/** The connector claims complete enumeration; core counts its durable final keys.
|
|
37
|
+
* Only an explicit report under a full-read/full-inventory declaration can prove
|
|
38
|
+
* replacement. Equal counts alone outside that claim never authorize it.
|
|
39
|
+
*/
|
|
40
|
+
function wholeProof(report, evidence) {
|
|
41
|
+
if (report === null || typeof report !== "object" || Array.isArray(report))
|
|
42
|
+
return false;
|
|
43
|
+
const { considered, covered, gap_keys: gaps, } = report;
|
|
44
|
+
return (!("keys" in report) &&
|
|
45
|
+
Number.isSafeInteger(considered) &&
|
|
46
|
+
considered === covered &&
|
|
47
|
+
considered === evidence.liveCount + evidence.deletedCount &&
|
|
48
|
+
(gaps === undefined || (Array.isArray(gaps) && gaps.length === 0)) &&
|
|
49
|
+
validDetailReport(report) &&
|
|
50
|
+
!reportHasGap(report));
|
|
51
|
+
}
|
|
52
|
+
function validDetailReport(report) {
|
|
53
|
+
if (report === undefined)
|
|
54
|
+
return true;
|
|
55
|
+
if (report === null || typeof report !== "object" || Array.isArray(report))
|
|
56
|
+
return false;
|
|
57
|
+
const r = report;
|
|
58
|
+
return (typeof r.considered === "number" &&
|
|
59
|
+
Number.isSafeInteger(r.considered) &&
|
|
60
|
+
r.considered >= 0 &&
|
|
61
|
+
typeof r.covered === "number" &&
|
|
62
|
+
Number.isSafeInteger(r.covered) &&
|
|
63
|
+
r.covered >= 0 &&
|
|
64
|
+
r.covered <= r.considered &&
|
|
65
|
+
["required_keys", "hydrated_keys", "gap_keys"].every((field) => r[field] === undefined || Array.isArray(r[field])));
|
|
66
|
+
}
|
|
67
|
+
/** A report can expose a gap even if the connector omitted its gap event. */
|
|
68
|
+
function reportHasGap(report) {
|
|
69
|
+
if (report === undefined || !validDetailReport(report))
|
|
70
|
+
return false;
|
|
71
|
+
const r = report;
|
|
72
|
+
// Preserve the short circuit for count gaps and absent required keys.
|
|
73
|
+
if (r.considered !== r.covered ||
|
|
74
|
+
(Array.isArray(r.gap_keys) && r.gap_keys.length > 0))
|
|
75
|
+
return true;
|
|
76
|
+
if (!Array.isArray(r.required_keys) || r.required_keys.length === 0)
|
|
77
|
+
return false;
|
|
78
|
+
const hydrated = new Set((Array.isArray(r.hydrated_keys) ? r.hydrated_keys : []).map((key) => canonicalJson(key)));
|
|
79
|
+
return r.required_keys.some((key) => !hydrated.has(canonicalJson(key)));
|
|
80
|
+
}
|
|
81
|
+
/** Validate, bind to START selection, and derive record facts from durably captured batches. */
|
|
82
|
+
export function normalizeRawEnd(body, begin, durable) {
|
|
83
|
+
const raw = validateRawEnd(body);
|
|
84
|
+
if (new Set(begin.selectedStreams).size !== begin.selectedStreams.length ||
|
|
85
|
+
raw.selectedStreams.length !== begin.selectedStreams.length ||
|
|
86
|
+
raw.selectedStreams.some((s) => !begin.selectedStreams.includes(s) ||
|
|
87
|
+
!Object.prototype.hasOwnProperty.call(begin.streams, s)))
|
|
88
|
+
rawEndInvalid("selection differs from begin");
|
|
89
|
+
for (const stream of Object.keys(durable))
|
|
90
|
+
if (!raw.selectedStreams.includes(stream))
|
|
91
|
+
rawEndInvalid("unselected durable records");
|
|
92
|
+
// Protocol RECORD totals include deletes and repeated upserts before folding.
|
|
93
|
+
if (raw.done.recordsEmitted !== undefined) {
|
|
94
|
+
const emitted = Object.values(durable).reduce((total, evidence) => total + evidence.upsertEvents + evidence.deleteEvents, 0);
|
|
95
|
+
if (!Number.isSafeInteger(emitted) || raw.done.recordsEmitted !== emitted)
|
|
96
|
+
rawEndInvalid("DONE record count contradicts durable batches");
|
|
97
|
+
}
|
|
98
|
+
const streams = Object.create(null);
|
|
99
|
+
const proven = [];
|
|
100
|
+
// Collection-failure SKIPs are complete evidence, not a capped diagnostic
|
|
101
|
+
// sample. Every one must be attributable to the selected set. A run-scoped
|
|
102
|
+
// failure withdraws certification; unknown streams were already rejected.
|
|
103
|
+
const failureSkips = raw.errors.filter((e) => e.kind === "skip_result" && machineCode(e) === "stream_collection_failed");
|
|
104
|
+
const certified = raw.done.status === "failed" &&
|
|
105
|
+
raw.done.error?.code === "stream_collection_failed" &&
|
|
106
|
+
failureSkips.length > 0 &&
|
|
107
|
+
failureSkips.every((e) => e.scope.kind === "stream");
|
|
108
|
+
const failed = certified
|
|
109
|
+
? [
|
|
110
|
+
...new Set(failureSkips.flatMap((e) => e.scope.kind === "stream" ? [e.scope.stream] : [])),
|
|
111
|
+
]
|
|
112
|
+
: [];
|
|
113
|
+
const finish = raw.done.status === "succeeded"
|
|
114
|
+
? "completed"
|
|
115
|
+
: certified
|
|
116
|
+
? "certified_failed_done"
|
|
117
|
+
: "failed_done_upsert_only";
|
|
118
|
+
for (const stream of raw.selectedStreams) {
|
|
119
|
+
const captured = Object.hasOwn(durable, stream)
|
|
120
|
+
? durable[stream]
|
|
121
|
+
: EMPTY_RAW_RECORDS;
|
|
122
|
+
const detailCoverage = Object.hasOwn(raw.detailCoverage, stream)
|
|
123
|
+
? raw.detailCoverage[stream]
|
|
124
|
+
: undefined;
|
|
125
|
+
const errors = raw.errors.filter((e) => e.scope.kind === "run" || e.scope.stream === stream);
|
|
126
|
+
const skips = errors.filter((e) => !isGap(e));
|
|
127
|
+
const gaps = errors.filter(isGap);
|
|
128
|
+
const proof = raw.wholeStreamEvidence.find((p) => p.stream === stream);
|
|
129
|
+
const declaration = begin.streams[stream];
|
|
130
|
+
const validProof = proof !== undefined &&
|
|
131
|
+
declaration.mode === "full_refresh" &&
|
|
132
|
+
declaration.fullRead === true &&
|
|
133
|
+
declaration.coverageStrategy === "full_inventory" &&
|
|
134
|
+
wholeProof(proof.report, captured);
|
|
135
|
+
const observation = {
|
|
136
|
+
liveRecord: captured.liveCount > 0,
|
|
137
|
+
explicitDelete: captured.everDeleted,
|
|
138
|
+
retryableSkip: skips.some(retryable),
|
|
139
|
+
otherSkip: skips.some((e) => !retryable(e)),
|
|
140
|
+
preflightExclusion: raw.preflightExcludedStreams.includes(stream),
|
|
141
|
+
detailGap: gaps.length === 0
|
|
142
|
+
? reportHasGap(detailCoverage)
|
|
143
|
+
? "retryable"
|
|
144
|
+
: "none"
|
|
145
|
+
: gaps.some((e) => !retryable(e))
|
|
146
|
+
? "fatal"
|
|
147
|
+
: "retryable",
|
|
148
|
+
invalidDetailCoverage: !validDetailReport(detailCoverage) ||
|
|
149
|
+
raw.invalidDetailCoverageStreams.includes(stream) ||
|
|
150
|
+
(proof !== undefined && !validProof),
|
|
151
|
+
failedInDone: failed.includes(stream),
|
|
152
|
+
...(detailCoverage === undefined ? {} : { detailCoverage }),
|
|
153
|
+
...(raw.covered === undefined
|
|
154
|
+
? {}
|
|
155
|
+
: { sourceAnswered: raw.covered.includes(stream) }),
|
|
156
|
+
};
|
|
157
|
+
streams[stream] = observation;
|
|
158
|
+
if (validProof &&
|
|
159
|
+
!observation.retryableSkip &&
|
|
160
|
+
!observation.otherSkip &&
|
|
161
|
+
!observation.preflightExclusion &&
|
|
162
|
+
observation.detailGap === "none" &&
|
|
163
|
+
!observation.invalidDetailCoverage &&
|
|
164
|
+
!observation.failedInDone &&
|
|
165
|
+
observation.sourceAnswered !== false &&
|
|
166
|
+
finish !== "failed_done_upsert_only")
|
|
167
|
+
proven.push(stream);
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
finish,
|
|
171
|
+
streams,
|
|
172
|
+
checkpoints: raw.checkpoints,
|
|
173
|
+
lastBatch: raw.lastBatch,
|
|
174
|
+
provenFullStreams: proven.sort(),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=normalize-raw-end.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-raw-end.js","sourceRoot":"","sources":["../../src/stream-sync/normalize-raw-end.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,GAEd,MAAM,8CAA8C,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAoB,MAAM,cAAc,CAAC;AAqB/E,MAAM,CAAC,MAAM,iBAAiB,GAA0B;IACtD,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;IACf,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;CAChB,CAAC;AACF,wEAAwE;AACxE,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,SAAS;IACT,cAAc;IACd,yBAAyB;CAC1B,CAAC,CAAC;AACH,SAAS,WAAW,CAAC,KAAkB;IACrC,OAAO,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC;AACpC,CAAC;AACD,SAAS,KAAK,CAAC,KAAkB;IAC/B,OAAO,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,sBAAsB,CAAC;AAC9E,CAAC;AACD,SAAS,SAAS,CAAC,KAAkB;IACnC,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC;IAChC,MAAM,UAAU,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/D,wEAAwE;IACxE,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,IAAI,UAAU,EAAE,SAAS,KAAK,KAAK;QAC9D,OAAO,KAAK,CAAC;IACf,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,IAAI,UAAU,EAAE,SAAS,KAAK,IAAI;QAA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B,CAAC,WAAW,CAAC,kBAAkB;YAC/B,WAAW,CAAC,SAAS,KAAK,MAAM;YAChC,CAAC,WAAW,CAAC,qBAAqB;YAClC,CAAC,WAAW,CAAC,YAAY;YACzB,WAAW,CAAC,cAAc,KAAK,KAAK;YACpC,MAAM,KAAK,yBAAyB;YAEpC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IACD,OAAO;QACL,MAAM;QACN,OAAO;QACP,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,iBAAiB,EAAE,MAAM,CAAC,IAAI,EAAE;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host ports for whole-file stream sync (design revision 4.1, §2.3, §2.8).
|
|
3
|
+
*
|
|
4
|
+
* The pure rules live in `@opendatalabs/personal-server-ts-stream-sync`.
|
|
5
|
+
* This module names the I/O a host provides to the publish driver: the
|
|
6
|
+
* registry, blob storage, durable files for the spool and outbox, and the
|
|
7
|
+
* AddData signer. Every adapter is injected, so the full server (Node files)
|
|
8
|
+
* and PS-Lite (IndexedDB) run the same driver.
|
|
9
|
+
*/
|
|
10
|
+
import type { ControlRead } from "@opendatalabs/personal-server-ts-stream-sync";
|
|
11
|
+
import type { SendGovernor } from "./storage-retry.js";
|
|
12
|
+
/** The network a gateway deployment names: `vana:<chainId>:<origin>`. */
|
|
13
|
+
export declare function streamSyncNetwork(gateway: {
|
|
14
|
+
readonly chainId: number;
|
|
15
|
+
readonly url: string;
|
|
16
|
+
}): string;
|
|
17
|
+
/** Receipt contract retained for PS-3 seed staging, independent of the retired writer. */
|
|
18
|
+
export type SeedReceipt = "merged";
|
|
19
|
+
/** The body of an exclusive `POST /v1/data`, persisted byte-for-byte. */
|
|
20
|
+
export interface SignedRegistryPost {
|
|
21
|
+
readonly ownerAddress: string;
|
|
22
|
+
readonly scope: string;
|
|
23
|
+
readonly dataHash: `0x${string}`;
|
|
24
|
+
readonly metadataHash: `0x${string}`;
|
|
25
|
+
readonly expectedVersion: string;
|
|
26
|
+
readonly signature: `0x${string}`;
|
|
27
|
+
}
|
|
28
|
+
export type RegistryPostResult =
|
|
29
|
+
/** 2xx: written, or the identical row was already there (`replayed`). */
|
|
30
|
+
{
|
|
31
|
+
readonly kind: "committed";
|
|
32
|
+
}
|
|
33
|
+
/** 409: another row holds this version or a higher one. */
|
|
34
|
+
| {
|
|
35
|
+
readonly kind: "conflict";
|
|
36
|
+
readonly latestVersion: string | null;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A condition on another row of the owner, checked by the gateway in the same
|
|
40
|
+
* transaction as the write: the row's head version is `expectedVersion` and,
|
|
41
|
+
* with `notDeleted`, it is not a tombstone. The gateway checks it, so a delete
|
|
42
|
+
* cannot land between the client's check and the write.
|
|
43
|
+
*/
|
|
44
|
+
export interface RegistryRequirement {
|
|
45
|
+
readonly scope: string;
|
|
46
|
+
readonly expectedVersion: string;
|
|
47
|
+
readonly notDeleted: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The row's head data hash. A version alone does not tell a refresh of the
|
|
50
|
+
* same version from the row the caller saw; the hash does.
|
|
51
|
+
*/
|
|
52
|
+
readonly expectedDataHash?: `0x${string}`;
|
|
53
|
+
}
|
|
54
|
+
/** The first condition that failed. Nothing was written. */
|
|
55
|
+
export interface RegistryRequirementFailure {
|
|
56
|
+
readonly scope: string;
|
|
57
|
+
/** Why it failed, when the gateway says. */
|
|
58
|
+
readonly reason?: "absent" | "deleted" | "version-mismatch" | "data-hash-mismatch";
|
|
59
|
+
/** Head version the gateway holds for the row; `null` when it has none. */
|
|
60
|
+
readonly latestVersion: string | null;
|
|
61
|
+
readonly deleted: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** A single write that carries conditions on other rows. */
|
|
64
|
+
export interface ConditionalRegistryPost extends SignedRegistryPost {
|
|
65
|
+
readonly requires: readonly RegistryRequirement[];
|
|
66
|
+
}
|
|
67
|
+
export type ConditionalPostResult = RegistryPostResult | {
|
|
68
|
+
readonly kind: "precondition_failed";
|
|
69
|
+
readonly failure: RegistryRequirementFailure;
|
|
70
|
+
};
|
|
71
|
+
/** One signed row of a batch; the owner and the conditions are the batch's. */
|
|
72
|
+
export type SignedBatchRow = Omit<SignedRegistryPost, "ownerAddress"> & {
|
|
73
|
+
/**
|
|
74
|
+
* The data hash of the row this one replaces, as the snapshot saw it. The
|
|
75
|
+
* gateway refuses the row when the head's hash differs. Absent for a first
|
|
76
|
+
* version.
|
|
77
|
+
*/
|
|
78
|
+
readonly expectedHeadDataHash?: `0x${string}`;
|
|
79
|
+
/** First create only. An identical signed replay still succeeds. */
|
|
80
|
+
readonly expectedHeadAbsent?: boolean;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Several writes of one owner in one request: one all-or-nothing transaction.
|
|
84
|
+
* Every row is stored, or nothing is written. The conditions are judged on the
|
|
85
|
+
* state the request commits, so a condition may name a row the request writes;
|
|
86
|
+
* they are judged on every request, a replay included. `rows` may be empty
|
|
87
|
+
* when `requires` is not: nothing is written and the answer says whether every
|
|
88
|
+
* condition holds.
|
|
89
|
+
*/
|
|
90
|
+
export interface SignedRegistryBatch {
|
|
91
|
+
readonly ownerAddress: string;
|
|
92
|
+
readonly rows: readonly SignedBatchRow[];
|
|
93
|
+
readonly requires: readonly RegistryRequirement[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* What the gateway says one batch request may hold (its `Batch-Policy`
|
|
97
|
+
* response header). `rows` and `requires` are item counts, and both can be full
|
|
98
|
+
* in one request; `bytes` is the size of that full request of the largest
|
|
99
|
+
* legal items, so a request within the counts is within `bytes`. The gateway
|
|
100
|
+
* derives them from its backend's limits.
|
|
101
|
+
*/
|
|
102
|
+
export interface RegistryBatchPolicy {
|
|
103
|
+
readonly rows: number;
|
|
104
|
+
readonly requires: number;
|
|
105
|
+
readonly bytes: number;
|
|
106
|
+
/**
|
|
107
|
+
* Only when the gateway sends it. A batch that writes stream rows of a
|
|
108
|
+
* connection fences that connection's log row, which the batch does not
|
|
109
|
+
* write; the gateway locks one entry per row and one per distinct such log
|
|
110
|
+
* row. A batch with at least one of them holds at most `lockedScopes` rows
|
|
111
|
+
* plus distinct fenced log rows. Without a fence `rows` is the only limit.
|
|
112
|
+
*/
|
|
113
|
+
readonly lockedScopes?: number;
|
|
114
|
+
}
|
|
115
|
+
/** One row of a refused batch (409 `conflict`): nothing of the request was written. */
|
|
116
|
+
export type RegistryBatchRow =
|
|
117
|
+
/** 201: the version was already stored (a replay); it stays stored. */
|
|
118
|
+
{
|
|
119
|
+
readonly kind: "committed";
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* 409: this row lost, so the request was refused. The gateway holds this
|
|
123
|
+
* version or a later one; the winner's version and data hash come with it. A
|
|
124
|
+
* row whose hash is the winner's is already published (a resend).
|
|
125
|
+
*/
|
|
126
|
+
| {
|
|
127
|
+
readonly kind: "conflict";
|
|
128
|
+
readonly latestVersion: string | null;
|
|
129
|
+
readonly latestDataHash: string | null;
|
|
130
|
+
}
|
|
131
|
+
/** 424: not written, because another row lost. */
|
|
132
|
+
| {
|
|
133
|
+
readonly kind: "not_written";
|
|
134
|
+
};
|
|
135
|
+
export type RegistryBatchResult =
|
|
136
|
+
/** 200: every row is stored (written now, or a replay). */
|
|
137
|
+
{
|
|
138
|
+
readonly kind: "committed";
|
|
139
|
+
}
|
|
140
|
+
/** 409 `conflict`: a row lost; nothing was written. One entry per request row, in order. */
|
|
141
|
+
| {
|
|
142
|
+
readonly kind: "refused";
|
|
143
|
+
readonly rows: readonly RegistryBatchRow[];
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* A condition failed. Nothing was written, for any row. `failure` is `null`
|
|
147
|
+
* when the gateway did not say which condition or why: the caller reads the
|
|
148
|
+
* row to find out.
|
|
149
|
+
*/
|
|
150
|
+
| {
|
|
151
|
+
readonly kind: "precondition_failed";
|
|
152
|
+
readonly failure: RegistryRequirementFailure | null;
|
|
153
|
+
};
|
|
154
|
+
/** Neither committed nor refused: resend the persisted request unchanged. */
|
|
155
|
+
export declare class AmbiguousRegistryReplyError extends Error {
|
|
156
|
+
constructor(message: string);
|
|
157
|
+
}
|
|
158
|
+
/** The gateway asked the client to pause; this is not a feed reset. */
|
|
159
|
+
export declare class RegistryOverloadError extends Error {
|
|
160
|
+
readonly retryAfterMs: number;
|
|
161
|
+
constructor(retryAfterMs: number);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The registry could not be reached or did not answer: a network failure, a
|
|
165
|
+
* timeout or a 5xx. Nothing says the request was refused or that the data is
|
|
166
|
+
* wrong, so a caller may go on offline. It is the only registry error a caller
|
|
167
|
+
* may treat that way.
|
|
168
|
+
*/
|
|
169
|
+
export declare class RegistryUnavailableError extends Error {
|
|
170
|
+
constructor(message: string, options?: {
|
|
171
|
+
cause?: unknown;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* An apply met an unavailable registry before its first local write, and no
|
|
176
|
+
* earlier apply of the connection is left half done: it could not learn
|
|
177
|
+
* anything new, and the local data is as complete as the last full apply left
|
|
178
|
+
* it. That is the only unavailability a caller may treat as "offline". Apply
|
|
179
|
+
* has no rollback: an unavailable error after its first write is thrown as the
|
|
180
|
+
* plain `RegistryUnavailableError`, the writes already committed (a purge, a
|
|
181
|
+
* reset, a stream replaced or tombstoned) stay, and `connections.apply_partial`
|
|
182
|
+
* keeps later applies from reading as "before the first write".
|
|
183
|
+
*/
|
|
184
|
+
export declare class RegistryUnavailableBeforeWriteError extends RegistryUnavailableError {
|
|
185
|
+
constructor(cause: RegistryUnavailableError);
|
|
186
|
+
}
|
|
187
|
+
/** The registry refused the request for good (4xx other than 409). */
|
|
188
|
+
/**
|
|
189
|
+
* The gateway has no change route: it predates the change push. The caller
|
|
190
|
+
* keeps its timed probe and asks again after a bounded wait, since a gateway
|
|
191
|
+
* that is upgraded gains the route. The client does not remember the answer.
|
|
192
|
+
*/
|
|
193
|
+
export declare class ChangeFeedAbsentError extends Error {
|
|
194
|
+
constructor(message: string);
|
|
195
|
+
}
|
|
196
|
+
/** The answer to one held change request. */
|
|
197
|
+
export interface RegistryChangeAnswer {
|
|
198
|
+
/**
|
|
199
|
+
* The owner's registry sequence now: a decimal string, compared for
|
|
200
|
+
* inequality only (it is not a count of what changed, and a restored
|
|
201
|
+
* database may lower it).
|
|
202
|
+
*/
|
|
203
|
+
readonly seq: string;
|
|
204
|
+
/** `seq` differs from the cursor the request carried (or it carried none). */
|
|
205
|
+
readonly changed: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* What changed after the request's `since`, read in one snapshot at `seq`.
|
|
208
|
+
* Present on, and only on, a changed answer to a request that sent `since`
|
|
209
|
+
* (a gateway that cannot read the delta answers `reset`). A changed answer
|
|
210
|
+
* to such a request without a readable delta fails the request.
|
|
211
|
+
*/
|
|
212
|
+
readonly delta?: RegistryChangeDelta;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The registry rows that changed in `(since, seq]`, as of one snapshot at
|
|
216
|
+
* `seq`. The gateway numbers changes in commit order, per owner, with no gap,
|
|
217
|
+
* so a reader that has applied everything up to `since` and applies these
|
|
218
|
+
* rows holds the registry as of `seq`.
|
|
219
|
+
*
|
|
220
|
+
* `reset`: the gateway cannot say (the cursor is below the records it keeps,
|
|
221
|
+
* above its counter, or more than one listing page behind): list everything.
|
|
222
|
+
* `gone`: ids of rows the gateway removed (only a failed registration's
|
|
223
|
+
* rollback does), which no scope names. `serversChanged`: the owner's server
|
|
224
|
+
* registrations changed.
|
|
225
|
+
*/
|
|
226
|
+
export type RegistryChangeDelta = {
|
|
227
|
+
readonly since: string;
|
|
228
|
+
readonly seq: string;
|
|
229
|
+
readonly reset: true;
|
|
230
|
+
} | {
|
|
231
|
+
readonly since: string;
|
|
232
|
+
readonly seq: string;
|
|
233
|
+
readonly reset: false;
|
|
234
|
+
readonly rows: readonly {
|
|
235
|
+
readonly scope: string;
|
|
236
|
+
readonly read: ControlRead;
|
|
237
|
+
}[];
|
|
238
|
+
readonly gone: readonly string[];
|
|
239
|
+
readonly serversChanged: boolean;
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* What applying a change delta did. `cycle`: the delta holds something only a
|
|
243
|
+
* full cycle handles (a new or reconnected lifetime, an unsupported row or a
|
|
244
|
+
* deleted log row of a live connection, a row of a connection this device
|
|
245
|
+
* does not hold, a removed row, a server change, a reset, a partial apply
|
|
246
|
+
* standing on any connection), or the apply did not reach the delta's
|
|
247
|
+
* position, or the publisher still has eligible work; nothing is settled and
|
|
248
|
+
* the caller runs a cycle. `applied`: the device has applied through the
|
|
249
|
+
* delta's `seq`, run the publisher, and checked its local eligibility queries
|
|
250
|
+
* for remaining work. A reached version or aggregate receipt is insufficient.
|
|
251
|
+
*/
|
|
252
|
+
export type DeltaApplyResult = {
|
|
253
|
+
readonly outcome: "applied";
|
|
254
|
+
/** Connections whose log moved (a row of this device's own commit does not). */
|
|
255
|
+
readonly connections: number;
|
|
256
|
+
/** Connections the delta's control tombstones deleted here. */
|
|
257
|
+
readonly deleted: number;
|
|
258
|
+
/** Segment and snapshot GETs, and the time spent in them. */
|
|
259
|
+
readonly blobGets: number;
|
|
260
|
+
readonly blobMs: number;
|
|
261
|
+
/** The whole apply, blob GETs included. */
|
|
262
|
+
readonly applyMs: number;
|
|
263
|
+
} | {
|
|
264
|
+
readonly outcome: "cycle";
|
|
265
|
+
readonly reason: string;
|
|
266
|
+
};
|
|
267
|
+
export declare class RegistryRefusedError extends Error {
|
|
268
|
+
readonly status: number;
|
|
269
|
+
constructor(message: string, status: number);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* The gateway serves no batch contract: `POST /v1/data/batch` answered 404 or
|
|
273
|
+
* 405, or the route advertises no `Batch-Policy`. Stream sync needs it: a
|
|
274
|
+
* connection delete and a log publish each commit in one batch, and there is
|
|
275
|
+
* no per-row path to fall back to. `answer` says what the gateway answered.
|
|
276
|
+
*/
|
|
277
|
+
export declare class RegistryBatchRouteMissingError extends Error {
|
|
278
|
+
readonly answer: string;
|
|
279
|
+
constructor(answer: string);
|
|
280
|
+
}
|
|
281
|
+
export interface StreamSyncRegistry {
|
|
282
|
+
/** Authoritative read: `GET /v1/data/:id?includeDeleted=true`. */
|
|
283
|
+
read(scope: string, signal?: AbortSignal): Promise<ControlRead>;
|
|
284
|
+
/** `POST /v1/data` with `exclusive: true`. Throws `AmbiguousRegistryReplyError`. */
|
|
285
|
+
post(request: SignedRegistryPost, signal?: AbortSignal): Promise<RegistryPostResult>;
|
|
286
|
+
/**
|
|
287
|
+
* `POST /v1/data` with `requires`. A gateway that does not know `requires`
|
|
288
|
+
* ignores it and writes anyway, and the answer does not say so, so a caller
|
|
289
|
+
* may use this only against a gateway known to enforce it.
|
|
290
|
+
*/
|
|
291
|
+
postConditional?(request: ConditionalRegistryPost): Promise<ConditionalPostResult>;
|
|
292
|
+
/**
|
|
293
|
+
* `POST /v1/data/batch`: every row and every condition in one all-or-nothing
|
|
294
|
+
* request. Throws `RegistryBatchRouteMissingError` when the gateway has no
|
|
295
|
+
* batch route. Throws `AmbiguousRegistryReplyError`: resend the same
|
|
296
|
+
* request; a row that already landed answers as committed (a replay).
|
|
297
|
+
*/
|
|
298
|
+
postBatch?(request: SignedRegistryBatch, signal?: AbortSignal): Promise<RegistryBatchResult>;
|
|
299
|
+
/**
|
|
300
|
+
* The policy the gateway advertised on its last batch answer or policy
|
|
301
|
+
* read, or `undefined` when it has advertised none yet.
|
|
302
|
+
*/
|
|
303
|
+
batchPolicy?(): RegistryBatchPolicy | undefined;
|
|
304
|
+
/**
|
|
305
|
+
* The gateway's batch policy: the one already known, else asked once per
|
|
306
|
+
* process (`OPTIONS /v1/data/batch`; concurrent callers share the request).
|
|
307
|
+
* `undefined`: the gateway answered and advertises none (no batch route, or
|
|
308
|
+
* a route without the header). Throws `AmbiguousRegistryReplyError` when
|
|
309
|
+
* the request got no answer; the next call asks again.
|
|
310
|
+
*/
|
|
311
|
+
readBatchPolicy?(signal?: AbortSignal): Promise<RegistryBatchPolicy | undefined>;
|
|
312
|
+
/**
|
|
313
|
+
* Every control scope row of the owner (`pdpp.<c>~<ns>`), deleted or not.
|
|
314
|
+
* Used for the per-session control listing (§2.4 `controls`).
|
|
315
|
+
*
|
|
316
|
+
* Each listed row is as fresh as a read of it begun after the call: a
|
|
317
|
+
* listing is never a copy taken before it. (A row may move after, as after
|
|
318
|
+
* any read.) A connection delete takes its pins from it.
|
|
319
|
+
*/
|
|
320
|
+
listControlRows(signal?: AbortSignal): Promise<readonly {
|
|
321
|
+
readonly scope: string;
|
|
322
|
+
readonly read: ControlRead;
|
|
323
|
+
}[]>;
|
|
324
|
+
/**
|
|
325
|
+
* Every stream scope row of `connector` in any namespace, deleted or not,
|
|
326
|
+
* whichever device or connector version wrote it. A connection delete
|
|
327
|
+
* finds the streams to erase here, not in local state.
|
|
328
|
+
*/
|
|
329
|
+
listStreamRows(connector: string): Promise<readonly {
|
|
330
|
+
readonly scope: string;
|
|
331
|
+
readonly read: ControlRead;
|
|
332
|
+
}[]>;
|
|
333
|
+
/**
|
|
334
|
+
* Every row of the owner, control and stream, deleted or not, in one
|
|
335
|
+
* listing. A sync cycle takes it once and reads each connection's control
|
|
336
|
+
* and log rows from it, so the cycle's listings do not depend on when its
|
|
337
|
+
* applies run. The rows are a hint taken before the applies: an apply that
|
|
338
|
+
* holds a newer log position than the listing reads the row again.
|
|
339
|
+
*/
|
|
340
|
+
listOwnerRows(): Promise<readonly {
|
|
341
|
+
readonly scope: string;
|
|
342
|
+
readonly read: ControlRead;
|
|
343
|
+
}[]>;
|
|
344
|
+
/**
|
|
345
|
+
* One request: a marker of the owner's newest registry change, whatever the
|
|
346
|
+
* number of rows (the gateway's change feed, newest first, one row). A
|
|
347
|
+
* different marker means a row was written, tombstoned or revived since the
|
|
348
|
+
* last read. An EQUAL marker does not prove that nothing changed: it
|
|
349
|
+
* fingerprints one row, so a change that leaves that row alone (another row
|
|
350
|
+
* stamped in the same millisecond) is invisible. `null`: the owner has no
|
|
351
|
+
* rows. `undefined`: this gateway sends no change time, so the caller cannot
|
|
352
|
+
* tell. Throws when the read fails. A hint to start a pull early, never an
|
|
353
|
+
* authority: the timer's cycle (or the push's position, see
|
|
354
|
+
* `waitForChange`) is what guarantees completeness, and a pull still reads
|
|
355
|
+
* the rows it applies. `signal` ends a read that
|
|
356
|
+
* stalls: a probe is optional work, so no caller may wait on it unbounded.
|
|
357
|
+
*/
|
|
358
|
+
probeChange?(signal?: AbortSignal): Promise<string | null | undefined>;
|
|
359
|
+
/**
|
|
360
|
+
* One held request: answers when the owner's registry sequence differs from
|
|
361
|
+
* `after` (a cursor from an earlier answer; none asks for the current one),
|
|
362
|
+
* or after about `waitMs` with `changed: false`. It carries the owner's
|
|
363
|
+
* sequence, which is a position: it changes whenever anything a client can
|
|
364
|
+
* see changed. A caller that gets `changed` pulls with its ordinary reads,
|
|
365
|
+
* or applies the answer's delta when it holds everything up to its `since`,
|
|
366
|
+
* and one that gets nothing (a lost answer, a dropped
|
|
367
|
+
* connection) is repaired by the next pull. A caller may skip pulls while
|
|
368
|
+
* the same position stands (see `ChangePush`). Throws `ChangeFeedAbsentError`
|
|
369
|
+
* when the gateway has no such route, and any other error on a failed read.
|
|
370
|
+
* `signal` ends the request. `since`: the position up to which the caller
|
|
371
|
+
* holds the registry; a changed answer may then carry the rows changed after
|
|
372
|
+
* it (`RegistryChangeAnswer.delta`).
|
|
373
|
+
*/
|
|
374
|
+
waitForChange?(after: string | undefined, waitMs: number, signal: AbortSignal, since: string | undefined): Promise<RegistryChangeAnswer>;
|
|
375
|
+
}
|
|
376
|
+
/** Encrypted blob storage, keyed `<physical scope>/<blob name>`. */
|
|
377
|
+
export interface StreamSyncBlobs {
|
|
378
|
+
/**
|
|
379
|
+
* The store's send governor: the memory budget a transfer reserves from
|
|
380
|
+
* before it encodes a part, and a window that reports what the gate did
|
|
381
|
+
* during one publish. It is required, because nothing else bounds the parts
|
|
382
|
+
* a stream holds in memory while their PUTs are pending. An in-memory test
|
|
383
|
+
* store gets one too (`createMemoryStreamSyncBlobs`).
|
|
384
|
+
*/
|
|
385
|
+
readonly governor: Pick<SendGovernor, "reserve" | "window" | "limitBytes">;
|
|
386
|
+
/**
|
|
387
|
+
* `beforeAttempt` runs immediately before each request that sends the bytes,
|
|
388
|
+
* after every wait for a turn or a retry delay; a throw stops the upload and
|
|
389
|
+
* reaches the caller. A request already sent cannot be recalled.
|
|
390
|
+
*/
|
|
391
|
+
put(key: string, bytes: Uint8Array, beforeAttempt?: () => void): Promise<void>;
|
|
392
|
+
/** `null` when the blob does not exist. */
|
|
393
|
+
get(key: string): Promise<Uint8Array | null>;
|
|
394
|
+
/**
|
|
395
|
+
* Whether the blob exists. The Vana adapter uses HEAD and reads no body; the
|
|
396
|
+
* SDK fallback downloads the blob. Only a definitive
|
|
397
|
+
* "not found" answers `false`; any other failure throws, never reads as
|
|
398
|
+
* present or absent.
|
|
399
|
+
*/
|
|
400
|
+
exists(key: string): Promise<boolean>;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Durable files for the spool, the outbox and local state. Paths are
|
|
404
|
+
* `/`-separated and relative to the adapter's root.
|
|
405
|
+
*/
|
|
406
|
+
export interface StreamSyncFiles {
|
|
407
|
+
/** Atomically replace a file. Durable when the promise resolves. */
|
|
408
|
+
write(path: string, bytes: Uint8Array): Promise<void>;
|
|
409
|
+
/** The whole file, or `null` when it does not exist. */
|
|
410
|
+
read(path: string): Promise<Uint8Array | null>;
|
|
411
|
+
/**
|
|
412
|
+
* Append to files, creating them. The bytes are visible to later reads at
|
|
413
|
+
* once but are durable only after `sync` of a prefix that covers the path:
|
|
414
|
+
* spool intake appends many times and syncs once (§2.6).
|
|
415
|
+
*/
|
|
416
|
+
appendMany(entries: readonly {
|
|
417
|
+
readonly path: string;
|
|
418
|
+
readonly bytes: Uint8Array;
|
|
419
|
+
}[]): Promise<void>;
|
|
420
|
+
/**
|
|
421
|
+
* Make every earlier append under `prefix/` durable, and the files'
|
|
422
|
+
* directory entries with them. A host may release resources it holds for
|
|
423
|
+
* those files (open handles).
|
|
424
|
+
*/
|
|
425
|
+
sync(prefix: string): Promise<void>;
|
|
426
|
+
/** The file in chunks of bounded size; nothing when it does not exist. */
|
|
427
|
+
readChunks(path: string): AsyncIterable<Uint8Array>;
|
|
428
|
+
/** Size in bytes; 0 when the file does not exist. */
|
|
429
|
+
size(path: string): Promise<number>;
|
|
430
|
+
/** Paths of the files under `prefix/`, recursively. */
|
|
431
|
+
list(prefix: string): Promise<string[]>;
|
|
432
|
+
/** Remove a file or every file under `prefix/`. */
|
|
433
|
+
remove(prefix: string): Promise<void>;
|
|
434
|
+
}
|
|
435
|
+
/** Owner-key operations. `masterKey` never enters the driver. */
|
|
436
|
+
export interface StreamSyncKeyPorts {
|
|
437
|
+
/** HMAC-SHA256 keyed with `K_ns` (§2.1). */
|
|
438
|
+
namespaceHmac(message: Uint8Array): Promise<Uint8Array>;
|
|
439
|
+
/** Per-object encryption with the per-scope key of `scope` (heads). */
|
|
440
|
+
encrypt(scope: string, clear: Uint8Array): Promise<Uint8Array>;
|
|
441
|
+
/** Format-2 part encryption: the age STREAM AEAD over 64 KiB chunks. */
|
|
442
|
+
encryptPart(scope: string, clear: Uint8Array): Promise<Uint8Array>;
|
|
443
|
+
/** Opens a head, a format-1 part (OpenPGP) or a format-2 part (STREAM). */
|
|
444
|
+
decrypt(scope: string, cipher: Uint8Array): Promise<Uint8Array>;
|
|
445
|
+
}
|
|
446
|
+
export interface StreamSyncSigner {
|
|
447
|
+
signAddData(message: {
|
|
448
|
+
ownerAddress: `0x${string}`;
|
|
449
|
+
scope: string;
|
|
450
|
+
dataHash: `0x${string}`;
|
|
451
|
+
metadataHash: `0x${string}`;
|
|
452
|
+
expectedVersion: bigint;
|
|
453
|
+
}): Promise<`0x${string}`>;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Desktop seed source (§2.9): this install's retained snapshot rows of a
|
|
457
|
+
* connector, from Desktop runs of the same connector on the same install.
|
|
458
|
+
*/
|
|
459
|
+
export interface StreamSyncSeedSource {
|
|
460
|
+
/** Stable id of this install, used in receipts. */
|
|
461
|
+
readonly installId: string;
|
|
462
|
+
/** Retained streams of the connector with their primary key and profile. */
|
|
463
|
+
streams(connector: string): Promise<readonly {
|
|
464
|
+
readonly stream: string;
|
|
465
|
+
/**
|
|
466
|
+
* Identity of the staged upload this stream comes from. It changes when
|
|
467
|
+
* the host stages a new upload for the stream, so a delete can skip the
|
|
468
|
+
* upload it saw and still merge a later one.
|
|
469
|
+
*/
|
|
470
|
+
readonly upload: string;
|
|
471
|
+
readonly primaryKey: readonly string[];
|
|
472
|
+
readonly profile: {
|
|
473
|
+
readonly key: string | null;
|
|
474
|
+
readonly version: string;
|
|
475
|
+
};
|
|
476
|
+
}[]>;
|
|
477
|
+
/** The retained records of one stream. */
|
|
478
|
+
records(connector: string, stream: string): AsyncIterable<Record<string, unknown>>;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Named points where a test can stop the driver to model a crash. A fault
|
|
482
|
+
* throws; the driver instance is then abandoned and a new one resumes from
|
|
483
|
+
* the files.
|
|
484
|
+
*/
|
|
485
|
+
export type StreamSyncFaultPoint = "after_control_write" | "after_parts_upload" | "after_head_upload" | "after_request_persisted" | "after_post_reply" | "after_commit_recorded" | "after_checkpoint_saved";
|
|
486
|
+
//# sourceMappingURL=ports.d.ts.map
|