@opendatalabs/personal-server-ts-core 0.0.1-canary.052d47e → 0.0.1-canary.05cdd81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/additions/budget.d.ts +34 -0
- package/dist/additions/budget.d.ts.map +1 -0
- package/dist/additions/budget.js +144 -0
- package/dist/additions/budget.js.map +1 -0
- package/dist/additions/durable.d.ts +94 -0
- package/dist/additions/durable.d.ts.map +1 -0
- package/dist/additions/durable.js +823 -0
- package/dist/additions/durable.js.map +1 -0
- package/dist/additions/first-added.d.ts +204 -0
- package/dist/additions/first-added.d.ts.map +1 -0
- package/dist/additions/first-added.js +598 -0
- package/dist/additions/first-added.js.map +1 -0
- package/dist/additions/index.d.ts +9 -0
- package/dist/additions/index.d.ts.map +1 -0
- package/dist/additions/index.js +9 -0
- package/dist/additions/index.js.map +1 -0
- package/dist/additions/ledger-store.d.ts +69 -0
- package/dist/additions/ledger-store.d.ts.map +1 -0
- package/dist/additions/ledger-store.js +407 -0
- package/dist/additions/ledger-store.js.map +1 -0
- package/dist/additions/record-rules.d.ts +54 -0
- package/dist/additions/record-rules.d.ts.map +1 -0
- package/dist/additions/record-rules.js +198 -0
- package/dist/additions/record-rules.js.map +1 -0
- package/dist/additions/scope-lock.d.ts +14 -0
- package/dist/additions/scope-lock.d.ts.map +1 -0
- package/dist/additions/scope-lock.js +32 -0
- package/dist/additions/scope-lock.js.map +1 -0
- package/dist/additions/summary.d.ts +143 -0
- package/dist/additions/summary.d.ts.map +1 -0
- package/dist/additions/summary.js +279 -0
- package/dist/additions/summary.js.map +1 -0
- package/dist/additions/version-inventory.d.ts +86 -0
- package/dist/additions/version-inventory.d.ts.map +1 -0
- package/dist/additions/version-inventory.js +244 -0
- package/dist/additions/version-inventory.js.map +1 -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 +320 -10
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1758 -181
- 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/oura-collection-requirements.d.ts +16 -0
- package/dist/api/oura-collection-requirements.d.ts.map +1 -0
- package/dist/api/oura-collection-requirements.js +70 -0
- package/dist/api/oura-collection-requirements.js.map +1 -0
- package/dist/api/owner-connector-delete.d.ts +79 -0
- package/dist/api/owner-connector-delete.d.ts.map +1 -0
- package/dist/api/owner-connector-delete.js +109 -0
- package/dist/api/owner-connector-delete.js.map +1 -0
- package/dist/api/raw-envelope.d.ts +3 -0
- package/dist/api/raw-envelope.d.ts.map +1 -0
- package/dist/api/raw-envelope.js +215 -0
- package/dist/api/raw-envelope.js.map +1 -0
- package/dist/api/scope-upload-batches.d.ts +18 -0
- package/dist/api/scope-upload-batches.d.ts.map +1 -0
- package/dist/api/scope-upload-batches.js +71 -0
- package/dist/api/scope-upload-batches.js.map +1 -0
- package/dist/api/scope-uploads.d.ts +112 -0
- package/dist/api/scope-uploads.d.ts.map +1 -0
- package/dist/api/scope-uploads.js +369 -0
- package/dist/api/scope-uploads.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/auth/index.d.ts +3 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +3 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/proof-id.d.ts +8 -0
- package/dist/auth/proof-id.d.ts.map +1 -0
- package/dist/auth/proof-id.js +29 -0
- package/dist/auth/proof-id.js.map +1 -0
- package/dist/auth/request.d.ts +24 -0
- package/dist/auth/request.d.ts.map +1 -1
- package/dist/auth/request.js +99 -4
- package/dist/auth/request.js.map +1 -1
- package/dist/client.d.ts +78 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/client.js.map +1 -1
- package/dist/contracts/auth-device.d.ts +10 -0
- package/dist/contracts/auth-device.d.ts.map +1 -1
- package/dist/contracts/auth-device.js +2 -0
- package/dist/contracts/auth-device.js.map +1 -1
- package/dist/contracts/data.d.ts +102 -8
- package/dist/contracts/data.d.ts.map +1 -1
- package/dist/contracts/data.js +326 -47
- package/dist/contracts/data.js.map +1 -1
- package/dist/contracts/grants.d.ts.map +1 -1
- package/dist/contracts/grants.js +7 -0
- package/dist/contracts/grants.js.map +1 -1
- package/dist/contracts/index.d.ts +4 -2
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +3 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/oura-collection-requirements.d.ts +17 -0
- package/dist/contracts/oura-collection-requirements.d.ts.map +1 -0
- package/dist/contracts/oura-collection-requirements.js +49 -0
- package/dist/contracts/oura-collection-requirements.js.map +1 -0
- package/dist/contracts/sync.d.ts +9 -1
- package/dist/contracts/sync.d.ts.map +1 -1
- package/dist/contracts/sync.js +7 -2
- package/dist/contracts/sync.js.map +1 -1
- package/dist/derivatives/answer-shape.d.ts +83 -0
- package/dist/derivatives/answer-shape.d.ts.map +1 -0
- package/dist/derivatives/answer-shape.js +320 -0
- package/dist/derivatives/answer-shape.js.map +1 -0
- package/dist/derivatives/api.d.ts +1 -1
- package/dist/derivatives/api.d.ts.map +1 -1
- package/dist/derivatives/api.js +8 -0
- package/dist/derivatives/api.js.map +1 -1
- package/dist/derivatives/compute.d.ts +9 -3
- package/dist/derivatives/compute.d.ts.map +1 -1
- package/dist/derivatives/compute.js +87 -6
- package/dist/derivatives/compute.js.map +1 -1
- package/dist/derivatives/index.d.ts +2 -1
- package/dist/derivatives/index.d.ts.map +1 -1
- package/dist/derivatives/index.js +2 -1
- package/dist/derivatives/index.js.map +1 -1
- package/dist/derivatives/prompt.d.ts +35 -0
- package/dist/derivatives/prompt.d.ts.map +1 -1
- package/dist/derivatives/prompt.js +96 -8
- package/dist/derivatives/prompt.js.map +1 -1
- package/dist/derivatives/registration.d.ts +6 -9
- package/dist/derivatives/registration.d.ts.map +1 -1
- package/dist/derivatives/registration.js +14 -6
- package/dist/derivatives/registration.js.map +1 -1
- package/dist/derivatives/scheduler.d.ts +39 -9
- package/dist/derivatives/scheduler.d.ts.map +1 -1
- package/dist/derivatives/scheduler.js +99 -8
- package/dist/derivatives/scheduler.js.map +1 -1
- package/dist/derivatives/store.d.ts.map +1 -1
- package/dist/derivatives/store.js +2 -0
- package/dist/derivatives/store.js.map +1 -1
- package/dist/derivatives/types.d.ts +13 -3
- package/dist/derivatives/types.d.ts.map +1 -1
- package/dist/derivatives/types.js +2 -0
- package/dist/derivatives/types.js.map +1 -1
- package/dist/errors/pdpp-catalog.d.ts +36 -0
- package/dist/errors/pdpp-catalog.d.ts.map +1 -0
- package/dist/errors/pdpp-catalog.js +92 -0
- package/dist/errors/pdpp-catalog.js.map +1 -0
- package/dist/grants/index.d.ts +2 -0
- package/dist/grants/index.d.ts.map +1 -1
- package/dist/grants/index.js +4 -0
- package/dist/grants/index.js.map +1 -1
- package/dist/grants/pdpp-binding-store.d.ts +89 -0
- package/dist/grants/pdpp-binding-store.d.ts.map +1 -0
- package/dist/grants/pdpp-binding-store.js +112 -0
- package/dist/grants/pdpp-binding-store.js.map +1 -0
- package/dist/grants/pdpp-binding.d.ts +169 -0
- package/dist/grants/pdpp-binding.d.ts.map +1 -0
- package/dist/grants/pdpp-binding.js +236 -0
- package/dist/grants/pdpp-binding.js.map +1 -0
- 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 +31 -0
- package/dist/legacy-projection/bindings.d.ts.map +1 -0
- package/dist/legacy-projection/bindings.js +4512 -0
- package/dist/legacy-projection/bindings.js.map +1 -0
- package/dist/legacy-projection/claude-source-record.d.ts +22 -0
- package/dist/legacy-projection/claude-source-record.d.ts.map +1 -0
- package/dist/legacy-projection/claude-source-record.js +360 -0
- package/dist/legacy-projection/claude-source-record.js.map +1 -0
- package/dist/legacy-projection/declared-text.d.ts +41 -0
- package/dist/legacy-projection/declared-text.d.ts.map +1 -0
- package/dist/legacy-projection/declared-text.js +199 -0
- package/dist/legacy-projection/declared-text.js.map +1 -0
- 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/github-browser-bindings.d.ts +3 -0
- package/dist/legacy-projection/github-browser-bindings.d.ts.map +1 -0
- package/dist/legacy-projection/github-browser-bindings.js +212 -0
- package/dist/legacy-projection/github-browser-bindings.js.map +1 -0
- package/dist/legacy-projection/github-legacy-fields.d.ts +6 -0
- package/dist/legacy-projection/github-legacy-fields.d.ts.map +1 -0
- package/dist/legacy-projection/github-legacy-fields.js +202 -0
- package/dist/legacy-projection/github-legacy-fields.js.map +1 -0
- package/dist/legacy-projection/index.d.ts +48 -0
- package/dist/legacy-projection/index.d.ts.map +1 -0
- package/dist/legacy-projection/index.js +255 -0
- package/dist/legacy-projection/index.js.map +1 -0
- package/dist/legacy-projection/meta-040-bindings.d.ts +3 -0
- package/dist/legacy-projection/meta-040-bindings.d.ts.map +1 -0
- package/dist/legacy-projection/meta-040-bindings.js +112 -0
- package/dist/legacy-projection/meta-040-bindings.js.map +1 -0
- package/dist/legacy-projection/oura-browser-bindings.d.ts +5 -0
- package/dist/legacy-projection/oura-browser-bindings.d.ts.map +1 -0
- package/dist/legacy-projection/oura-browser-bindings.js +141 -0
- package/dist/legacy-projection/oura-browser-bindings.js.map +1 -0
- package/dist/legacy-projection/provenance.d.ts +57 -0
- package/dist/legacy-projection/provenance.d.ts.map +1 -0
- package/dist/legacy-projection/provenance.js +2 -0
- package/dist/legacy-projection/provenance.js.map +1 -0
- package/dist/legacy-projection/strava-browser-bindings.d.ts +3 -0
- package/dist/legacy-projection/strava-browser-bindings.d.ts.map +1 -0
- package/dist/legacy-projection/strava-browser-bindings.js +32 -0
- package/dist/legacy-projection/strava-browser-bindings.js.map +1 -0
- package/dist/legacy-projection/test-debris.d.ts +2 -0
- package/dist/legacy-projection/test-debris.d.ts.map +1 -0
- package/dist/legacy-projection/test-debris.js +49 -0
- package/dist/legacy-projection/test-debris.js.map +1 -0
- package/dist/legacy-projection/types.d.ts +235 -0
- package/dist/legacy-projection/types.d.ts.map +1 -0
- package/dist/legacy-projection/types.js +2 -0
- package/dist/legacy-projection/types.js.map +1 -0
- 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/apply.d.ts +13 -0
- package/dist/localdb/apply.d.ts.map +1 -0
- package/dist/localdb/apply.js +565 -0
- package/dist/localdb/apply.js.map +1 -0
- package/dist/localdb/batch-commit.d.ts +67 -0
- package/dist/localdb/batch-commit.d.ts.map +1 -0
- package/dist/localdb/batch-commit.js +121 -0
- package/dist/localdb/batch-commit.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.d.ts +20 -0
- package/dist/localdb/bootstrap.d.ts.map +1 -0
- package/dist/localdb/bootstrap.js +157 -0
- package/dist/localdb/bootstrap.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 +72 -0
- package/dist/localdb/connection-link.js.map +1 -0
- package/dist/localdb/cycle.d.ts +32 -0
- package/dist/localdb/cycle.d.ts.map +1 -0
- package/dist/localdb/cycle.js +46 -0
- package/dist/localdb/cycle.js.map +1 -0
- package/dist/localdb/delete-batch.d.ts +51 -0
- package/dist/localdb/delete-batch.d.ts.map +1 -0
- package/dist/localdb/delete-batch.js +132 -0
- package/dist/localdb/delete-batch.js.map +1 -0
- package/dist/localdb/delete.d.ts +81 -0
- package/dist/localdb/delete.d.ts.map +1 -0
- package/dist/localdb/delete.js +736 -0
- package/dist/localdb/delete.js.map +1 -0
- package/dist/localdb/deps.d.ts +54 -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 +67 -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/encode.d.ts +217 -0
- package/dist/localdb/encode.d.ts.map +1 -0
- package/dist/localdb/encode.js +502 -0
- package/dist/localdb/encode.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 +74 -0
- package/dist/localdb/history.d.ts.map +1 -0
- package/dist/localdb/history.js +266 -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 +39 -0
- package/dist/localdb/index.d.ts.map +1 -0
- package/dist/localdb/index.js +36 -0
- package/dist/localdb/index.js.map +1 -0
- package/dist/localdb/legacy-import-types.d.ts +110 -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 +36 -0
- package/dist/localdb/legacy-import.d.ts.map +1 -0
- package/dist/localdb/legacy-import.js +288 -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-boundary.d.ts +49 -0
- package/dist/localdb/lifetime-boundary.d.ts.map +1 -0
- package/dist/localdb/lifetime-boundary.js +74 -0
- package/dist/localdb/lifetime-boundary.js.map +1 -0
- package/dist/localdb/listing.d.ts +51 -0
- package/dist/localdb/listing.d.ts.map +1 -0
- package/dist/localdb/listing.js +231 -0
- package/dist/localdb/listing.js.map +1 -0
- package/dist/localdb/merge.d.ts +95 -0
- package/dist/localdb/merge.d.ts.map +1 -0
- package/dist/localdb/merge.js +282 -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 +3 -0
- package/dist/localdb/name.d.ts.map +1 -0
- package/dist/localdb/name.js +8 -0
- package/dist/localdb/name.js.map +1 -0
- package/dist/localdb/older-versions.d.ts +49 -0
- package/dist/localdb/older-versions.d.ts.map +1 -0
- package/dist/localdb/older-versions.js +172 -0
- package/dist/localdb/older-versions.js.map +1 -0
- package/dist/localdb/open.d.ts +19 -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 +74 -0
- package/dist/localdb/part-layout.d.ts.map +1 -0
- package/dist/localdb/part-layout.js +203 -0
- package/dist/localdb/part-layout.js.map +1 -0
- package/dist/localdb/publish-meter.d.ts +45 -0
- package/dist/localdb/publish-meter.d.ts.map +1 -0
- package/dist/localdb/publish-meter.js +62 -0
- package/dist/localdb/publish-meter.js.map +1 -0
- package/dist/localdb/publish.d.ts +47 -0
- package/dist/localdb/publish.d.ts.map +1 -0
- package/dist/localdb/publish.js +2100 -0
- package/dist/localdb/publish.js.map +1 -0
- package/dist/localdb/purge.d.ts +23 -0
- package/dist/localdb/purge.d.ts.map +1 -0
- package/dist/localdb/purge.js +75 -0
- package/dist/localdb/purge.js.map +1 -0
- package/dist/localdb/query.d.ts +69 -0
- package/dist/localdb/query.d.ts.map +1 -0
- package/dist/localdb/query.js +306 -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/read-selection.d.ts +103 -0
- package/dist/localdb/read-selection.d.ts.map +1 -0
- package/dist/localdb/read-selection.js +141 -0
- package/dist/localdb/read-selection.js.map +1 -0
- package/dist/localdb/registry-view.d.ts +65 -0
- package/dist/localdb/registry-view.d.ts.map +1 -0
- package/dist/localdb/registry-view.js +73 -0
- package/dist/localdb/registry-view.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 +43 -0
- package/dist/localdb/resolve.d.ts.map +1 -0
- package/dist/localdb/resolve.js +265 -0
- package/dist/localdb/resolve.js.map +1 -0
- package/dist/localdb/run-end.d.ts +19 -0
- package/dist/localdb/run-end.d.ts.map +1 -0
- package/dist/localdb/run-end.js +283 -0
- package/dist/localdb/run-end.js.map +1 -0
- package/dist/localdb/run-intake.d.ts +16 -0
- package/dist/localdb/run-intake.d.ts.map +1 -0
- package/dist/localdb/run-intake.js +441 -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 +312 -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/sync.d.ts +53 -0
- package/dist/localdb/sync.d.ts.map +1 -0
- package/dist/localdb/sync.js +211 -0
- package/dist/localdb/sync.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 +22 -0
- package/dist/localdb/unwrite.d.ts.map +1 -0
- package/dist/localdb/unwrite.js +46 -0
- package/dist/localdb/unwrite.js.map +1 -0
- package/dist/localdb/upload-wave.d.ts +34 -0
- package/dist/localdb/upload-wave.d.ts.map +1 -0
- package/dist/localdb/upload-wave.js +30 -0
- package/dist/localdb/upload-wave.js.map +1 -0
- package/dist/localdb/verified-heads.d.ts +13 -0
- package/dist/localdb/verified-heads.d.ts.map +1 -0
- package/dist/localdb/verified-heads.js +56 -0
- package/dist/localdb/verified-heads.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/mcp/approval-url.d.ts +100 -0
- package/dist/mcp/approval-url.d.ts.map +1 -0
- package/dist/mcp/approval-url.js +171 -0
- package/dist/mcp/approval-url.js.map +1 -0
- package/dist/mcp/connection-api.d.ts +239 -3
- package/dist/mcp/connection-api.d.ts.map +1 -1
- package/dist/mcp/connection-api.js +792 -27
- 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/grantee.d.ts +1 -1
- package/dist/mcp/grantee.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/oauth-redirect.d.ts +14 -0
- package/dist/mcp/oauth-redirect.d.ts.map +1 -0
- package/dist/mcp/oauth-redirect.js +51 -0
- package/dist/mcp/oauth-redirect.js.map +1 -0
- package/dist/mcp/read-client.d.ts +27 -3
- package/dist/mcp/read-client.d.ts.map +1 -1
- package/dist/mcp/read-client.js +325 -19
- 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 +14 -2
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/server.d.ts +47 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +219 -17
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +3 -1
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +58 -11
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/store.d.ts +23 -1
- package/dist/mcp/store.d.ts.map +1 -1
- package/dist/mcp/store.js +102 -1
- package/dist/mcp/store.js.map +1 -1
- package/dist/mcp/token-expiry.d.ts +48 -0
- package/dist/mcp/token-expiry.d.ts.map +1 -0
- package/dist/mcp/token-expiry.js +69 -0
- package/dist/mcp/token-expiry.js.map +1 -0
- package/dist/mcp/tools.d.ts +154 -3
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +660 -39
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/types.d.ts +105 -4
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js +13 -1
- package/dist/mcp/types.js.map +1 -1
- package/dist/mcp/write-client.d.ts +81 -0
- package/dist/mcp/write-client.d.ts.map +1 -0
- package/dist/mcp/write-client.js +140 -0
- package/dist/mcp/write-client.js.map +1 -0
- package/dist/oura/history-policy.d.ts +12 -0
- package/dist/oura/history-policy.d.ts.map +1 -0
- package/dist/oura/history-policy.js +54 -0
- package/dist/oura/history-policy.js.map +1 -0
- package/dist/oura/index.d.ts +51 -0
- package/dist/oura/index.d.ts.map +1 -0
- package/dist/oura/index.js +330 -0
- package/dist/oura/index.js.map +1 -0
- package/dist/payment/own-app.d.ts +8 -0
- package/dist/payment/own-app.d.ts.map +1 -0
- package/dist/payment/own-app.js +47 -0
- package/dist/payment/own-app.js.map +1 -0
- package/dist/pdpp/approval.d.ts +271 -0
- package/dist/pdpp/approval.d.ts.map +1 -0
- package/dist/pdpp/approval.js +486 -0
- package/dist/pdpp/approval.js.map +1 -0
- package/dist/pdpp/client-identity.d.ts +88 -0
- package/dist/pdpp/client-identity.d.ts.map +1 -0
- package/dist/pdpp/client-identity.js +196 -0
- package/dist/pdpp/client-identity.js.map +1 -0
- package/dist/pdpp/client-metadata.d.ts +95 -0
- package/dist/pdpp/client-metadata.d.ts.map +1 -0
- package/dist/pdpp/client-metadata.js +96 -0
- package/dist/pdpp/client-metadata.js.map +1 -0
- package/dist/pdpp/commitments.d.ts +75 -0
- package/dist/pdpp/commitments.d.ts.map +1 -0
- package/dist/pdpp/commitments.js +113 -0
- package/dist/pdpp/commitments.js.map +1 -0
- package/dist/pdpp/declaration-limits.d.ts +7 -0
- package/dist/pdpp/declaration-limits.d.ts.map +1 -0
- package/dist/pdpp/declaration-limits.js +7 -0
- package/dist/pdpp/declaration-limits.js.map +1 -0
- package/dist/pdpp/declaration.d.ts +119 -0
- package/dist/pdpp/declaration.d.ts.map +1 -0
- package/dist/pdpp/declaration.js +837 -0
- package/dist/pdpp/declaration.js.map +1 -0
- package/dist/pdpp/index.d.ts +38 -0
- package/dist/pdpp/index.d.ts.map +1 -0
- package/dist/pdpp/index.js +24 -0
- package/dist/pdpp/index.js.map +1 -0
- package/dist/pdpp/issuance.d.ts +126 -0
- package/dist/pdpp/issuance.d.ts.map +1 -0
- package/dist/pdpp/issuance.js +184 -0
- package/dist/pdpp/issuance.js.map +1 -0
- package/dist/pdpp/pkce.d.ts +53 -0
- package/dist/pdpp/pkce.d.ts.map +1 -0
- package/dist/pdpp/pkce.js +109 -0
- package/dist/pdpp/pkce.js.map +1 -0
- package/dist/pdpp/redirect.d.ts +60 -0
- package/dist/pdpp/redirect.d.ts.map +1 -0
- package/dist/pdpp/redirect.js +125 -0
- package/dist/pdpp/redirect.js.map +1 -0
- package/dist/pdpp/resolve.d.ts +120 -0
- package/dist/pdpp/resolve.d.ts.map +1 -0
- package/dist/pdpp/resolve.js +491 -0
- package/dist/pdpp/resolve.js.map +1 -0
- package/dist/pdpp/review.d.ts +280 -0
- package/dist/pdpp/review.d.ts.map +1 -0
- package/dist/pdpp/review.js +205 -0
- package/dist/pdpp/review.js.map +1 -0
- package/dist/pdpp/selection.d.ts +79 -0
- package/dist/pdpp/selection.d.ts.map +1 -0
- package/dist/pdpp/selection.js +493 -0
- package/dist/pdpp/selection.js.map +1 -0
- package/dist/pdpp/store.d.ts +228 -0
- package/dist/pdpp/store.d.ts.map +1 -0
- package/dist/pdpp/store.js +542 -0
- package/dist/pdpp/store.js.map +1 -0
- package/dist/pdpp/time.d.ts +39 -0
- package/dist/pdpp/time.d.ts.map +1 -0
- package/dist/pdpp/time.js +173 -0
- package/dist/pdpp/time.js.map +1 -0
- package/dist/pdpp/tokens.d.ts +181 -0
- package/dist/pdpp/tokens.d.ts.map +1 -0
- package/dist/pdpp/tokens.js +421 -0
- package/dist/pdpp/tokens.js.map +1 -0
- package/dist/pdpp/types.d.ts +457 -0
- package/dist/pdpp/types.d.ts.map +1 -0
- package/dist/pdpp/types.js +68 -0
- package/dist/pdpp/types.js.map +1 -0
- package/dist/pdpp-version.d.ts +28 -0
- package/dist/pdpp-version.d.ts.map +1 -0
- package/dist/pdpp-version.js +28 -0
- package/dist/pdpp-version.js.map +1 -0
- package/dist/policy/data-read.d.ts +52 -1
- package/dist/policy/data-read.d.ts.map +1 -1
- package/dist/policy/data-read.js +157 -3
- package/dist/policy/data-read.js.map +1 -1
- package/dist/policy/data-write.d.ts.map +1 -1
- package/dist/policy/data-write.js +18 -1
- package/dist/policy/data-write.js.map +1 -1
- package/dist/policy/index.d.ts +2 -1
- package/dist/policy/index.d.ts.map +1 -1
- package/dist/policy/index.js +2 -1
- package/dist/policy/index.js.map +1 -1
- package/dist/policy/reserved-scopes.d.ts +10 -0
- package/dist/policy/reserved-scopes.d.ts.map +1 -0
- package/dist/policy/reserved-scopes.js +19 -0
- package/dist/policy/reserved-scopes.js.map +1 -0
- package/dist/ports/index.d.ts +323 -10
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/pdpp-auth.d.ts +119 -0
- package/dist/ports/pdpp-auth.d.ts.map +1 -0
- package/dist/ports/pdpp-auth.js +46 -0
- package/dist/ports/pdpp-auth.js.map +1 -0
- package/dist/ports/pdpp-auth.test-utils.d.ts +9 -0
- package/dist/ports/pdpp-auth.test-utils.d.ts.map +1 -0
- package/dist/ports/pdpp-auth.test-utils.js +18 -0
- package/dist/ports/pdpp-auth.test-utils.js.map +1 -0
- package/dist/publication/publish.d.ts +137 -0
- package/dist/publication/publish.d.ts.map +1 -0
- package/dist/publication/publish.js +278 -0
- package/dist/publication/publish.js.map +1 -0
- package/dist/replication/completion.d.ts +20 -0
- package/dist/replication/completion.d.ts.map +1 -0
- package/dist/replication/completion.js +73 -0
- package/dist/replication/completion.js.map +1 -0
- package/dist/replication/coordinator-state.d.ts +29 -0
- package/dist/replication/coordinator-state.d.ts.map +1 -0
- package/dist/replication/coordinator-state.js +88 -0
- package/dist/replication/coordinator-state.js.map +1 -0
- package/dist/replication/coordinator-state.test-utils.d.ts +32 -0
- package/dist/replication/coordinator-state.test-utils.d.ts.map +1 -0
- package/dist/replication/coordinator-state.test-utils.js +113 -0
- package/dist/replication/coordinator-state.test-utils.js.map +1 -0
- package/dist/replication/coordinator.d.ts +264 -0
- package/dist/replication/coordinator.d.ts.map +1 -0
- package/dist/replication/coordinator.js +499 -0
- package/dist/replication/coordinator.js.map +1 -0
- package/dist/replication/copies.d.ts +126 -0
- package/dist/replication/copies.d.ts.map +1 -0
- package/dist/replication/copies.js +437 -0
- package/dist/replication/copies.js.map +1 -0
- package/dist/replication/copy-promotion.d.ts +132 -0
- package/dist/replication/copy-promotion.d.ts.map +1 -0
- package/dist/replication/copy-promotion.js +126 -0
- package/dist/replication/copy-promotion.js.map +1 -0
- package/dist/replication/door.d.ts +33 -0
- package/dist/replication/door.d.ts.map +1 -0
- package/dist/replication/door.js +10 -0
- package/dist/replication/door.js.map +1 -0
- package/dist/replication/dpv2.d.ts +141 -0
- package/dist/replication/dpv2.d.ts.map +1 -0
- package/dist/replication/dpv2.js +320 -0
- package/dist/replication/dpv2.js.map +1 -0
- package/dist/replication/effects.d.ts +68 -0
- package/dist/replication/effects.d.ts.map +1 -0
- package/dist/replication/effects.js +89 -0
- package/dist/replication/effects.js.map +1 -0
- package/dist/replication/engine.d.ts +378 -0
- package/dist/replication/engine.d.ts.map +1 -0
- package/dist/replication/engine.js +3197 -0
- package/dist/replication/engine.js.map +1 -0
- package/dist/replication/envelope.d.ts +481 -0
- package/dist/replication/envelope.d.ts.map +1 -0
- package/dist/replication/envelope.js +192 -0
- package/dist/replication/envelope.js.map +1 -0
- package/dist/replication/evidence.d.ts +118 -0
- package/dist/replication/evidence.d.ts.map +1 -0
- package/dist/replication/evidence.js +198 -0
- package/dist/replication/evidence.js.map +1 -0
- package/dist/replication/finality.d.ts +16 -0
- package/dist/replication/finality.d.ts.map +1 -0
- package/dist/replication/finality.js +11 -0
- package/dist/replication/finality.js.map +1 -0
- package/dist/replication/fixtures.d.ts +16 -0
- package/dist/replication/fixtures.d.ts.map +1 -0
- package/dist/replication/fixtures.js +47 -0
- package/dist/replication/fixtures.js.map +1 -0
- package/dist/replication/host-config.d.ts +52 -0
- package/dist/replication/host-config.d.ts.map +1 -0
- package/dist/replication/host-config.js +111 -0
- package/dist/replication/host-config.js.map +1 -0
- package/dist/replication/host-driver.d.ts +95 -0
- package/dist/replication/host-driver.d.ts.map +1 -0
- package/dist/replication/host-driver.js +202 -0
- package/dist/replication/host-driver.js.map +1 -0
- package/dist/replication/host-ports.d.ts +48 -0
- package/dist/replication/host-ports.d.ts.map +1 -0
- package/dist/replication/host-ports.js +69 -0
- package/dist/replication/host-ports.js.map +1 -0
- package/dist/replication/identity.d.ts +13 -0
- package/dist/replication/identity.d.ts.map +1 -0
- package/dist/replication/identity.js +22 -0
- package/dist/replication/identity.js.map +1 -0
- package/dist/replication/limits.d.ts +124 -0
- package/dist/replication/limits.d.ts.map +1 -0
- package/dist/replication/limits.js +182 -0
- package/dist/replication/limits.js.map +1 -0
- package/dist/replication/merge-plan.d.ts +92 -0
- package/dist/replication/merge-plan.d.ts.map +1 -0
- package/dist/replication/merge-plan.js +229 -0
- package/dist/replication/merge-plan.js.map +1 -0
- package/dist/replication/namespace.d.ts +4 -0
- package/dist/replication/namespace.d.ts.map +1 -0
- package/dist/replication/namespace.js +7 -0
- package/dist/replication/namespace.js.map +1 -0
- package/dist/replication/outcome.d.ts +178 -0
- package/dist/replication/outcome.d.ts.map +1 -0
- package/dist/replication/outcome.js +83 -0
- package/dist/replication/outcome.js.map +1 -0
- package/dist/replication/payload.d.ts +39 -0
- package/dist/replication/payload.d.ts.map +1 -0
- package/dist/replication/payload.js +137 -0
- package/dist/replication/payload.js.map +1 -0
- package/dist/replication/preparation.d.ts +42 -0
- package/dist/replication/preparation.d.ts.map +1 -0
- package/dist/replication/preparation.js +118 -0
- package/dist/replication/preparation.js.map +1 -0
- package/dist/replication/rebaseline.d.ts +33 -0
- package/dist/replication/rebaseline.d.ts.map +1 -0
- package/dist/replication/rebaseline.js +40 -0
- package/dist/replication/rebaseline.js.map +1 -0
- package/dist/replication/rebinding.d.ts +43 -0
- package/dist/replication/rebinding.d.ts.map +1 -0
- package/dist/replication/rebinding.js +52 -0
- package/dist/replication/rebinding.js.map +1 -0
- package/dist/replication/receive.d.ts +57 -0
- package/dist/replication/receive.d.ts.map +1 -0
- package/dist/replication/receive.js +114 -0
- package/dist/replication/receive.js.map +1 -0
- package/dist/replication/record-reducer.d.ts +16 -0
- package/dist/replication/record-reducer.d.ts.map +1 -0
- package/dist/replication/record-reducer.js +52 -0
- package/dist/replication/record-reducer.js.map +1 -0
- package/dist/replication/revision.d.ts +24 -0
- package/dist/replication/revision.d.ts.map +1 -0
- package/dist/replication/revision.js +35 -0
- package/dist/replication/revision.js.map +1 -0
- package/dist/replication/roster.d.ts +53 -0
- package/dist/replication/roster.d.ts.map +1 -0
- package/dist/replication/roster.js +115 -0
- package/dist/replication/roster.js.map +1 -0
- package/dist/replication/schedule.d.ts +73 -0
- package/dist/replication/schedule.d.ts.map +1 -0
- package/dist/replication/schedule.js +182 -0
- package/dist/replication/schedule.js.map +1 -0
- package/dist/replication/stream.d.ts +73 -0
- package/dist/replication/stream.d.ts.map +1 -0
- package/dist/replication/stream.js +542 -0
- package/dist/replication/stream.js.map +1 -0
- package/dist/replication/transport.d.ts +236 -0
- package/dist/replication/transport.d.ts.map +1 -0
- package/dist/replication/transport.js +440 -0
- package/dist/replication/transport.js.map +1 -0
- package/dist/replication/visibility-engine.d.ts +337 -0
- package/dist/replication/visibility-engine.d.ts.map +1 -0
- package/dist/replication/visibility-engine.js +602 -0
- package/dist/replication/visibility-engine.js.map +1 -0
- package/dist/replication/visibility-policy.d.ts +26 -0
- package/dist/replication/visibility-policy.d.ts.map +1 -0
- package/dist/replication/visibility-policy.js +33 -0
- package/dist/replication/visibility-policy.js.map +1 -0
- package/dist/replication/writer-identity-store.d.ts +100 -0
- package/dist/replication/writer-identity-store.d.ts.map +1 -0
- package/dist/replication/writer-identity-store.js +218 -0
- package/dist/replication/writer-identity-store.js.map +1 -0
- package/dist/replication/writer-identity.d.ts +252 -0
- package/dist/replication/writer-identity.d.ts.map +1 -0
- package/dist/replication/writer-identity.js +281 -0
- package/dist/replication/writer-identity.js.map +1 -0
- package/dist/replication/writer-identity.test-utils.d.ts +24 -0
- package/dist/replication/writer-identity.test-utils.d.ts.map +1 -0
- package/dist/replication/writer-identity.test-utils.js +86 -0
- package/dist/replication/writer-identity.test-utils.js.map +1 -0
- package/dist/schemas/server-config.d.ts +81 -0
- package/dist/schemas/server-config.d.ts.map +1 -1
- package/dist/schemas/server-config.js +179 -0
- package/dist/schemas/server-config.js.map +1 -1
- package/dist/signing/request-signer.d.ts +2 -0
- package/dist/signing/request-signer.d.ts.map +1 -1
- package/dist/signing/request-signer.js +1 -0
- package/dist/signing/request-signer.js.map +1 -1
- package/dist/storage/adapters/index.d.ts +3 -1
- package/dist/storage/adapters/index.d.ts.map +1 -1
- package/dist/storage/adapters/index.js +2 -0
- package/dist/storage/adapters/index.js.map +1 -1
- package/dist/storage/adapters/interface.d.ts +33 -3
- package/dist/storage/adapters/interface.d.ts.map +1 -1
- package/dist/storage/adapters/interface.js +13 -1
- package/dist/storage/adapters/interface.js.map +1 -1
- package/dist/storage/adapters/rate-limit-policy.d.ts +66 -0
- package/dist/storage/adapters/rate-limit-policy.d.ts.map +1 -0
- package/dist/storage/adapters/rate-limit-policy.js +103 -0
- package/dist/storage/adapters/rate-limit-policy.js.map +1 -0
- package/dist/storage/adapters/sdk.d.ts +9 -1
- package/dist/storage/adapters/sdk.d.ts.map +1 -1
- package/dist/storage/adapters/sdk.js +32 -8
- 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 +27 -0
- package/dist/storage/adapters/vana-audience.d.ts.map +1 -0
- package/dist/storage/adapters/vana-audience.js +99 -0
- package/dist/storage/adapters/vana-audience.js.map +1 -0
- package/dist/storage/adapters/vana.d.ts +5 -3
- package/dist/storage/adapters/vana.d.ts.map +1 -1
- package/dist/storage/adapters/vana.js +128 -18
- package/dist/storage/adapters/vana.js.map +1 -1
- package/dist/storage/blocks/cursor.d.ts +5 -1
- package/dist/storage/blocks/cursor.d.ts.map +1 -1
- package/dist/storage/blocks/cursor.js +13 -1
- package/dist/storage/blocks/cursor.js.map +1 -1
- package/dist/storage/blocks/page.d.ts +18 -0
- package/dist/storage/blocks/page.d.ts.map +1 -0
- package/dist/storage/blocks/page.js +113 -0
- package/dist/storage/blocks/page.js.map +1 -0
- package/dist/storage/canonical-legacy-projection.d.ts +262 -0
- package/dist/storage/canonical-legacy-projection.d.ts.map +1 -0
- package/dist/storage/canonical-legacy-projection.js +759 -0
- package/dist/storage/canonical-legacy-projection.js.map +1 -0
- 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 +46 -5
- package/dist/storage/index/manager.d.ts.map +1 -1
- package/dist/storage/index/schema.d.ts +1 -1
- package/dist/storage/index/schema.js +1 -1
- package/dist/storage/index/types.d.ts +7 -1
- package/dist/storage/index/types.d.ts.map +1 -1
- package/dist/storage/legacy-projection.d.ts +88 -0
- package/dist/storage/legacy-projection.d.ts.map +1 -0
- package/dist/storage/legacy-projection.js +755 -0
- package/dist/storage/legacy-projection.js.map +1 -0
- package/dist/storage/legacy-scope-coverage-exceptions.d.ts +13 -0
- package/dist/storage/legacy-scope-coverage-exceptions.d.ts.map +1 -0
- package/dist/storage/legacy-scope-coverage-exceptions.js +14 -0
- package/dist/storage/legacy-scope-coverage-exceptions.js.map +1 -0
- package/dist/storage/legacy-scope-coverage.d.ts +53 -0
- package/dist/storage/legacy-scope-coverage.d.ts.map +1 -0
- package/dist/storage/legacy-scope-coverage.js +416 -0
- package/dist/storage/legacy-scope-coverage.js.map +1 -0
- package/dist/storage/legacy-scope-entity-keys.d.ts +17 -0
- package/dist/storage/legacy-scope-entity-keys.d.ts.map +1 -0
- package/dist/storage/legacy-scope-entity-keys.js +109 -0
- package/dist/storage/legacy-scope-entity-keys.js.map +1 -0
- package/dist/storage/legacy-scope-view.d.ts +201 -0
- package/dist/storage/legacy-scope-view.d.ts.map +1 -0
- package/dist/storage/legacy-scope-view.js +1044 -0
- package/dist/storage/legacy-scope-view.js.map +1 -0
- 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 +71 -0
- package/dist/storage/legacy-write-seal.js.map +1 -0
- package/dist/storage/pdpp-records/completion.d.ts +91 -0
- package/dist/storage/pdpp-records/completion.d.ts.map +1 -0
- package/dist/storage/pdpp-records/completion.js +170 -0
- package/dist/storage/pdpp-records/completion.js.map +1 -0
- package/dist/storage/pdpp-records/cursor.d.ts +86 -0
- package/dist/storage/pdpp-records/cursor.d.ts.map +1 -0
- package/dist/storage/pdpp-records/cursor.js +56 -0
- package/dist/storage/pdpp-records/cursor.js.map +1 -0
- package/dist/storage/pdpp-records/declaration-witness.d.ts +58 -0
- package/dist/storage/pdpp-records/declaration-witness.d.ts.map +1 -0
- package/dist/storage/pdpp-records/declaration-witness.js +230 -0
- package/dist/storage/pdpp-records/declaration-witness.js.map +1 -0
- package/dist/storage/pdpp-records/enforcement.d.ts +39 -0
- package/dist/storage/pdpp-records/enforcement.d.ts.map +1 -0
- package/dist/storage/pdpp-records/enforcement.js +143 -0
- package/dist/storage/pdpp-records/enforcement.js.map +1 -0
- package/dist/storage/pdpp-records/index.d.ts +7 -0
- package/dist/storage/pdpp-records/index.d.ts.map +1 -0
- package/dist/storage/pdpp-records/index.js +6 -0
- package/dist/storage/pdpp-records/index.js.map +1 -0
- package/dist/storage/pdpp-records/ingest-plan.d.ts +39 -0
- package/dist/storage/pdpp-records/ingest-plan.d.ts.map +1 -0
- package/dist/storage/pdpp-records/ingest-plan.js +103 -0
- package/dist/storage/pdpp-records/ingest-plan.js.map +1 -0
- package/dist/storage/pdpp-records/interface.d.ts +111 -0
- package/dist/storage/pdpp-records/interface.d.ts.map +1 -0
- package/dist/storage/pdpp-records/interface.js +2 -0
- package/dist/storage/pdpp-records/interface.js.map +1 -0
- package/dist/storage/pdpp-records/list-page.d.ts +35 -0
- package/dist/storage/pdpp-records/list-page.d.ts.map +1 -0
- package/dist/storage/pdpp-records/list-page.js +106 -0
- package/dist/storage/pdpp-records/list-page.js.map +1 -0
- package/dist/storage/pdpp-records/memory-store.d.ts +9 -0
- package/dist/storage/pdpp-records/memory-store.d.ts.map +1 -0
- package/dist/storage/pdpp-records/memory-store.js +462 -0
- package/dist/storage/pdpp-records/memory-store.js.map +1 -0
- package/dist/storage/pdpp-records/portable.d.ts +12 -0
- package/dist/storage/pdpp-records/portable.d.ts.map +1 -0
- package/dist/storage/pdpp-records/portable.js +11 -0
- package/dist/storage/pdpp-records/portable.js.map +1 -0
- package/dist/storage/pdpp-records/read-port.d.ts +44 -0
- package/dist/storage/pdpp-records/read-port.d.ts.map +1 -0
- package/dist/storage/pdpp-records/read-port.js +22 -0
- package/dist/storage/pdpp-records/read-port.js.map +1 -0
- package/dist/storage/pdpp-records/record-key.d.ts +52 -0
- package/dist/storage/pdpp-records/record-key.d.ts.map +1 -0
- package/dist/storage/pdpp-records/record-key.js +97 -0
- package/dist/storage/pdpp-records/record-key.js.map +1 -0
- package/dist/storage/pdpp-records/replication-journal.d.ts +20 -0
- package/dist/storage/pdpp-records/replication-journal.d.ts.map +1 -0
- package/dist/storage/pdpp-records/replication-journal.js +2 -0
- package/dist/storage/pdpp-records/replication-journal.js.map +1 -0
- package/dist/storage/pdpp-records/schema.d.ts +41 -0
- package/dist/storage/pdpp-records/schema.d.ts.map +1 -0
- package/dist/storage/pdpp-records/schema.js +153 -0
- package/dist/storage/pdpp-records/schema.js.map +1 -0
- package/dist/storage/pdpp-records/stream-declaration.d.ts +86 -0
- package/dist/storage/pdpp-records/stream-declaration.d.ts.map +1 -0
- package/dist/storage/pdpp-records/stream-declaration.js +48 -0
- package/dist/storage/pdpp-records/stream-declaration.js.map +1 -0
- package/dist/storage/pdpp-records/sync-selection.d.ts +4 -0
- package/dist/storage/pdpp-records/sync-selection.d.ts.map +1 -0
- package/dist/storage/pdpp-records/sync-selection.js +37 -0
- package/dist/storage/pdpp-records/sync-selection.js.map +1 -0
- package/dist/storage/pdpp-records/types.d.ts +204 -0
- package/dist/storage/pdpp-records/types.d.ts.map +1 -0
- package/dist/storage/pdpp-records/types.js +38 -0
- package/dist/storage/pdpp-records/types.js.map +1 -0
- 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 +141 -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 +20 -0
- package/dist/stream-sync/crypto-port.d.ts.map +1 -0
- package/dist/stream-sync/crypto-port.js +19 -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/index.d.ts +13 -0
- package/dist/stream-sync/index.d.ts.map +1 -0
- package/dist/stream-sync/index.js +13 -0
- package/dist/stream-sync/index.js.map +1 -0
- package/dist/stream-sync/intake.d.ts +185 -0
- package/dist/stream-sync/intake.d.ts.map +1 -0
- package/dist/stream-sync/intake.js +36 -0
- package/dist/stream-sync/intake.js.map +1 -0
- package/dist/stream-sync/memory-registry.d.ts +58 -0
- package/dist/stream-sync/memory-registry.d.ts.map +1 -0
- package/dist/stream-sync/memory-registry.js +119 -0
- package/dist/stream-sync/memory-registry.js.map +1 -0
- package/dist/stream-sync/ports.d.ts +363 -0
- package/dist/stream-sync/ports.d.ts.map +1 -0
- package/dist/stream-sync/ports.js +68 -0
- package/dist/stream-sync/ports.js.map +1 -0
- package/dist/stream-sync/publish-plan.d.ts +157 -0
- package/dist/stream-sync/publish-plan.d.ts.map +1 -0
- package/dist/stream-sync/publish-plan.js +217 -0
- package/dist/stream-sync/publish-plan.js.map +1 -0
- package/dist/stream-sync/registry.d.ts +24 -0
- package/dist/stream-sync/registry.d.ts.map +1 -0
- package/dist/stream-sync/registry.js +389 -0
- package/dist/stream-sync/registry.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/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 +210 -0
- package/dist/stream-sync/storage-retry.d.ts.map +1 -0
- package/dist/stream-sync/storage-retry.js +314 -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-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 +196 -0
- package/dist/stream-sync-read/service.d.ts.map +1 -0
- package/dist/stream-sync-read/service.js +17 -0
- package/dist/stream-sync-read/service.js.map +1 -0
- package/dist/sync/account-mode/authority.d.ts +56 -0
- package/dist/sync/account-mode/authority.d.ts.map +1 -0
- package/dist/sync/account-mode/authority.js +145 -0
- package/dist/sync/account-mode/authority.js.map +1 -0
- package/dist/sync/account-mode/evidence-wire.d.ts +23 -0
- package/dist/sync/account-mode/evidence-wire.d.ts.map +1 -0
- package/dist/sync/account-mode/evidence-wire.js +37 -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 +52 -0
- package/dist/sync/account-mode/record.d.ts.map +1 -0
- package/dist/sync/account-mode/record.js +60 -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/data-point-feed.d.ts +3 -0
- package/dist/sync/data-point-feed.d.ts.map +1 -1
- package/dist/sync/data-point-feed.js +20 -1
- package/dist/sync/data-point-feed.js.map +1 -1
- package/dist/sync/delete-data-port.d.ts +19 -0
- package/dist/sync/delete-data-port.d.ts.map +1 -1
- package/dist/sync/delete-data-port.js +42 -9
- package/dist/sync/delete-data-port.js.map +1 -1
- package/dist/sync/engine/change-probe.d.ts +42 -0
- package/dist/sync/engine/change-probe.d.ts.map +1 -0
- package/dist/sync/engine/change-probe.js +79 -0
- package/dist/sync/engine/change-probe.js.map +1 -0
- package/dist/sync/engine/change-push.d.ts +53 -0
- package/dist/sync/engine/change-push.d.ts.map +1 -0
- package/dist/sync/engine/change-push.js +153 -0
- package/dist/sync/engine/change-push.js.map +1 -0
- package/dist/sync/engine/sync-manager.d.ts +181 -2
- package/dist/sync/engine/sync-manager.d.ts.map +1 -1
- package/dist/sync/engine/sync-manager.js +642 -19
- package/dist/sync/engine/sync-manager.js.map +1 -1
- package/dist/sync/index.d.ts +11 -3
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +11 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/pdpp-import.d.ts +202 -0
- package/dist/sync/pdpp-import.d.ts.map +1 -0
- package/dist/sync/pdpp-import.js +466 -0
- package/dist/sync/pdpp-import.js.map +1 -0
- package/dist/sync/pending-blob-deletions.d.ts +18 -2
- package/dist/sync/pending-blob-deletions.d.ts.map +1 -1
- package/dist/sync/pending-blob-deletions.js +97 -23
- package/dist/sync/pending-blob-deletions.js.map +1 -1
- package/dist/sync/scope-deletions.d.ts +12 -0
- package/dist/sync/scope-deletions.d.ts.map +1 -1
- package/dist/sync/scope-deletions.js +99 -25
- package/dist/sync/scope-deletions.js.map +1 -1
- package/dist/sync/tombstone-finality.d.ts +36 -0
- package/dist/sync/tombstone-finality.d.ts.map +1 -0
- package/dist/sync/tombstone-finality.js +142 -0
- package/dist/sync/tombstone-finality.js.map +1 -0
- package/dist/sync/tombstone-resubmits.d.ts +61 -0
- package/dist/sync/tombstone-resubmits.d.ts.map +1 -0
- package/dist/sync/tombstone-resubmits.js +85 -0
- package/dist/sync/tombstone-resubmits.js.map +1 -0
- package/dist/sync/types.d.ts +26 -0
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/upload-attempts.d.ts +218 -0
- package/dist/sync/upload-attempts.d.ts.map +1 -0
- package/dist/sync/upload-attempts.js +500 -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 +63 -6
- package/dist/sync/workers/delete.d.ts.map +1 -1
- package/dist/sync/workers/delete.js +621 -168
- package/dist/sync/workers/delete.js.map +1 -1
- package/dist/sync/workers/download.d.ts +27 -1
- package/dist/sync/workers/download.d.ts.map +1 -1
- package/dist/sync/workers/download.js +368 -27
- package/dist/sync/workers/download.js.map +1 -1
- package/dist/sync/workers/lost-data-points.d.ts +38 -0
- package/dist/sync/workers/lost-data-points.d.ts.map +1 -0
- package/dist/sync/workers/lost-data-points.js +72 -0
- package/dist/sync/workers/lost-data-points.js.map +1 -0
- package/dist/sync/workers/upload.d.ts +97 -8
- package/dist/sync/workers/upload.d.ts.map +1 -1
- package/dist/sync/workers/upload.js +498 -277
- 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 +77 -0
- package/dist/test-utils/account-mode.js.map +1 -0
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +2 -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 +18 -2
- package/dist/test-utils/memory-storage.d.ts.map +1 -1
- package/dist/test-utils/memory-storage.js +156 -42
- package/dist/test-utils/memory-storage.js.map +1 -1
- package/dist/write/attribution.d.ts.map +1 -1
- package/dist/write/attribution.js +8 -4
- package/dist/write/attribution.js.map +1 -1
- package/dist/write/route.d.ts.map +1 -1
- package/dist/write/route.js +9 -10
- package/dist/write/route.js.map +1 -1
- package/dist/write/session.d.ts.map +1 -1
- package/dist/write/session.js +13 -0
- package/dist/write/session.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 +292 -0
- package/dist-test/localdb/conformance.js.map +1 -0
- package/dist-test/tsconfig.tsbuildinfo +1 -0
- package/package.json +131 -5
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { isMemoryScope } from "../../policy/reserved-scopes.js";
|
|
2
|
+
import { isReplicaScope } from "../../replication/namespace.js";
|
|
3
|
+
import { publishVersion, } from "../../publication/publish.js";
|
|
4
|
+
export { parseGatewayNextVersion } from "../../publication/publish.js";
|
|
5
|
+
import { LegacyWriteRefusedError } from "../../api/legacy-write-gate.js";
|
|
3
6
|
import { computeDataPointId } from "../data-point-id.js";
|
|
4
7
|
import { deletionTimestamp, isEntryCoveredByTombstone, tombstoneVersion, } from "../scope-deletions.js";
|
|
5
|
-
import {
|
|
8
|
+
import { MAX_UPLOAD_BODY_BYTES, createUploadStateTracker, exceedsUploadCap, isUsableUploadSize, } from "../upload-state.js";
|
|
9
|
+
import { DEFAULT_ABANDON_GRACE_MS, uploadAttemptKey, UploadAttemptStorageFailedError, } from "../upload-attempts.js";
|
|
6
10
|
export { computeDataPointId } from "../data-point-id.js";
|
|
7
11
|
export { isEntryCoveredByTombstone } from "../scope-deletions.js";
|
|
12
|
+
/** An upload attempt that ran past its deadline and was aborted. */
|
|
13
|
+
export class UploadDeadlineError extends Error {
|
|
14
|
+
deadlineMs;
|
|
15
|
+
constructor(deadlineMs) {
|
|
16
|
+
super(`Upload attempt passed its ${deadlineMs} ms deadline and was aborted`);
|
|
17
|
+
this.deadlineMs = deadlineMs;
|
|
18
|
+
this.name = "UploadDeadlineError";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** One attempt's budget. Long enough for a slow link, short of forever. */
|
|
22
|
+
export const DEFAULT_UPLOAD_ATTEMPT_DEADLINE_MS = 10 * 60_000;
|
|
23
|
+
/** Default most unsynced rows read per cycle (index rows only, no bodies). */
|
|
24
|
+
export const UPLOAD_SCAN_BUDGET = 2000;
|
|
8
25
|
/**
|
|
9
26
|
* Thrown when an unsynced entry's local payload file is gone, so the entry was
|
|
10
27
|
* dropped from the index rather than uploaded. `uploadAll` treats it as a
|
|
@@ -29,40 +46,48 @@ export class DeletedScopeEntryError extends Error {
|
|
|
29
46
|
this.name = "DeletedScopeEntryError";
|
|
30
47
|
}
|
|
31
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Thrown before anything is read when an unsynced entry's upload body would
|
|
51
|
+
* pass `MAX_UPLOAD_BODY_BYTES`. The entry stays local and readable; it can
|
|
52
|
+
* never sync, so retrying it is wasted work.
|
|
53
|
+
*/
|
|
54
|
+
export class UploadTooLargeError extends Error {
|
|
55
|
+
path;
|
|
56
|
+
sizeBytes;
|
|
57
|
+
constructor(path, sizeBytes) {
|
|
58
|
+
super(`Too large to sync: ${path} is ${sizeBytes} bytes and an upload body is limited to ${MAX_UPLOAD_BODY_BYTES} bytes`);
|
|
59
|
+
this.path = path;
|
|
60
|
+
this.sizeBytes = sizeBytes;
|
|
61
|
+
this.name = "UploadTooLargeError";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Thrown before anything is read when an unsynced entry's stored size is
|
|
66
|
+
* missing or not a positive finite number. The cap cannot be checked, so the
|
|
67
|
+
* entry is held back (fail closed) and stays local.
|
|
68
|
+
*/
|
|
69
|
+
export class UploadUnsizableError extends Error {
|
|
70
|
+
path;
|
|
71
|
+
sizeBytes;
|
|
72
|
+
constructor(path, sizeBytes) {
|
|
73
|
+
super(`No usable stored size for ${path}: ${String(sizeBytes)}`);
|
|
74
|
+
this.path = path;
|
|
75
|
+
this.sizeBytes = sizeBytes;
|
|
76
|
+
this.name = "UploadUnsizableError";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
32
79
|
/**
|
|
33
80
|
* Drop an unsynced entry the gateway tombstone covers and signal it as a
|
|
34
81
|
* self-heal. Returns without effect when the entry was ingested with
|
|
35
82
|
* knowledge of the tombstone (`afterTombstoneVersion`): a legitimate re-add.
|
|
36
83
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* is deleted too, so abandoning the entry never leaves owner-decryptable
|
|
40
|
-
* deleted data in storage. If the delete fails the scope is queued for the
|
|
41
|
-
* exact-key cleanup the sync cycle retries.
|
|
84
|
+
* Remote cleanup belongs to the deletion pipeline. Registry refusal does
|
|
85
|
+
* not grant this publisher authority to delete a potentially committed blob.
|
|
42
86
|
*/
|
|
43
|
-
async function dropIfCoveredByDeletion(deps, entry, tombstone, deletedAt
|
|
87
|
+
async function dropIfCoveredByDeletion(deps, entry, tombstone, deletedAt) {
|
|
44
88
|
const version = tombstoneVersion(tombstone);
|
|
45
89
|
if (!isEntryCoveredByTombstone(entry, { version }))
|
|
46
90
|
return;
|
|
47
|
-
if (uploaded) {
|
|
48
|
-
try {
|
|
49
|
-
await deps.storageAdapter.delete(uploaded.url);
|
|
50
|
-
}
|
|
51
|
-
catch (err) {
|
|
52
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
53
|
-
if (deps.pendingBlobDeletions) {
|
|
54
|
-
await deps.pendingBlobDeletions.add([
|
|
55
|
-
{ scope: entry.scope, version: String(entry.version) },
|
|
56
|
-
]);
|
|
57
|
-
}
|
|
58
|
-
deps.logger.warn({
|
|
59
|
-
scope: entry.scope,
|
|
60
|
-
url: uploaded.url,
|
|
61
|
-
error: message,
|
|
62
|
-
queuedForCleanup: Boolean(deps.pendingBlobDeletions),
|
|
63
|
-
}, "Could not delete the ciphertext uploaded for an entry the tombstone covers");
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
91
|
await deps.storage.deleteVersion(entry.scope, entry.collectedAt);
|
|
67
92
|
deps.logger.warn({
|
|
68
93
|
path: entry.path,
|
|
@@ -95,8 +120,19 @@ function isMissingPayloadError(err) {
|
|
|
95
120
|
* 6. Register DPv2 data point on-chain (AddData) if not already
|
|
96
121
|
* 7. Persist the gateway-assigned dataPointId (marks the entry synced)
|
|
97
122
|
*/
|
|
98
|
-
export async function uploadOne(deps, entry) {
|
|
123
|
+
export async function uploadOne(deps, entry, options) {
|
|
124
|
+
const signal = options?.signal;
|
|
125
|
+
if (isReplicaScope(entry.scope))
|
|
126
|
+
throw new Error("replica scopes require immutable transport");
|
|
99
127
|
const { storage, storageAdapter, gateway, signer, masterKey, serverOwner, logger, } = deps;
|
|
128
|
+
// Decide from the stored size alone, before anything is read, parsed or
|
|
129
|
+
// encrypted: a body over the request limit can never be accepted.
|
|
130
|
+
if (!entry.dataPointId) {
|
|
131
|
+
if (!isUsableUploadSize(entry.sizeBytes))
|
|
132
|
+
throw new UploadUnsizableError(entry.path, entry.sizeBytes);
|
|
133
|
+
if (exceedsUploadCap(entry.sizeBytes))
|
|
134
|
+
throw new UploadTooLargeError(entry.path, entry.sizeBytes);
|
|
135
|
+
}
|
|
100
136
|
// 1. Read local data file
|
|
101
137
|
let envelope;
|
|
102
138
|
try {
|
|
@@ -118,229 +154,74 @@ export async function uploadOne(deps, entry) {
|
|
|
118
154
|
}
|
|
119
155
|
throw err;
|
|
120
156
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
// would resurrect the scope. An entry ingested after the deletion is a
|
|
125
|
-
// real re-add and goes up at a version strictly after the tombstone.
|
|
126
|
-
let registerVersion = BigInt(entry.version);
|
|
127
|
-
if (!entry.dataPointId && deps.dataPointFeed) {
|
|
128
|
-
const remote = await deps.dataPointFeed.getDataPoint({
|
|
157
|
+
signal?.throwIfAborted();
|
|
158
|
+
const readHead = async () => deps.dataPointFeed
|
|
159
|
+
? deps.dataPointFeed.getDataPoint({
|
|
129
160
|
ownerAddress: serverOwner,
|
|
130
161
|
scope: entry.scope,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
162
|
+
signal,
|
|
163
|
+
})
|
|
164
|
+
: gateway.getDataPoint(computeDataPointId(serverOwner, entry.scope));
|
|
165
|
+
const checkHead = async (remote) => {
|
|
166
|
+
const deletedAt = remote?.deletedAt ??
|
|
167
|
+
(remote?.addedAt
|
|
168
|
+
? deletionTimestamp({ ...remote, addedAt: remote.addedAt })
|
|
169
|
+
: null);
|
|
170
|
+
if (remote && deletedAt !== null)
|
|
134
171
|
await dropIfCoveredByDeletion(deps, entry, remote, deletedAt);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
172
|
+
};
|
|
173
|
+
const initialHead = !entry.dataPointId && deps.dataPointFeed ? await readHead() : undefined;
|
|
174
|
+
await checkHead(initialHead ?? null);
|
|
175
|
+
const proof = entry.dataPointId
|
|
176
|
+
? {
|
|
177
|
+
dataPointId: entry.dataPointId,
|
|
178
|
+
url: storageAdapter.urlForKey(`${entry.scope}/${entry.version}`),
|
|
179
|
+
version: BigInt(entry.version),
|
|
180
|
+
sizeBytes: entry.sizeBytes,
|
|
138
181
|
}
|
|
182
|
+
: await publishVersion({
|
|
183
|
+
ownerAddress: serverOwner,
|
|
184
|
+
envelope,
|
|
185
|
+
preferredVersion: BigInt(entry.version),
|
|
186
|
+
masterKey,
|
|
187
|
+
storageAdapter,
|
|
188
|
+
gateway,
|
|
189
|
+
signer,
|
|
190
|
+
lineageGateway: deps.lineageGateway,
|
|
191
|
+
fencedPublication: deps.fencedPublication,
|
|
192
|
+
// Each remote legacy write (blob upload, registration) is sealed.
|
|
193
|
+
legacyWriteSeal: storage.legacyWriteSeal,
|
|
194
|
+
signal,
|
|
195
|
+
head: initialHead,
|
|
196
|
+
readHead,
|
|
197
|
+
checkHead,
|
|
198
|
+
acknowledgedDeletionVersion: entry.afterTombstoneVersion == null
|
|
199
|
+
? undefined
|
|
200
|
+
: BigInt(entry.afterTombstoneVersion),
|
|
201
|
+
// The marker is written at ingest, after the owner deleted the scope
|
|
202
|
+
// and imported it again: a deliberate re-add, not a recovery.
|
|
203
|
+
deletionAcknowledgedAtIngest: entry.afterTombstoneVersion != null,
|
|
204
|
+
});
|
|
205
|
+
const { dataPointId, url, sizeBytes } = proof;
|
|
206
|
+
// Past the deadline the registration may have landed, but the local rows are
|
|
207
|
+
// left alone: the retry finds the registered head and adopts it.
|
|
208
|
+
signal?.throwIfAborted();
|
|
209
|
+
if (!entry.dataPointId) {
|
|
210
|
+
// The path may have been replaced by a new row while this one uploaded;
|
|
211
|
+
// the acknowledgement names the row it uploaded (`entry.id`) and changes
|
|
212
|
+
// nothing on a different one, which stays unsynced for its own upload.
|
|
213
|
+
const acknowledged = proof.version === BigInt(entry.version) ||
|
|
214
|
+
(await storage.updateEntryVersion(entry.path, Number(proof.version), entry.id));
|
|
215
|
+
if (acknowledged &&
|
|
216
|
+
(await storage.updateDataPointId(entry.path, dataPointId, entry.id)))
|
|
217
|
+
deps.scopeDeletions?.markLive(entry.scope);
|
|
139
218
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
// 4. Compute the on-chain commitments.
|
|
147
|
-
// dataHash = keccak256 of the plaintext envelope JSON. Commits to the
|
|
148
|
-
// canonical content, not the ciphertext — OpenPGP
|
|
149
|
-
// password-based encryption embeds random salts so
|
|
150
|
-
// re-encrypting the same plaintext yields different bytes;
|
|
151
|
-
// hashing the plaintext keeps the on-chain commitment
|
|
152
|
-
// reproducible across replicas serving the same version.
|
|
153
|
-
// metadataHash = keccak256 of canonical-JSON({scope, collectedAt,
|
|
154
|
-
// sizeBytes}). Commits to the off-chain metadata that
|
|
155
|
-
// describes this version without leaking the payload. DPv2
|
|
156
|
-
// is scope-addressed with no schema concept — the gateway
|
|
157
|
-
// neither records nor registers schemas — so no schemaId is
|
|
158
|
-
// looked up or committed.
|
|
159
|
-
const dataHash = keccak256(plaintext);
|
|
160
|
-
const metadataHash = keccak256(stringToHex(JSON.stringify({
|
|
161
|
-
scope: entry.scope,
|
|
162
|
-
collectedAt: entry.collectedAt,
|
|
163
|
-
sizeBytes: encrypted.byteLength,
|
|
164
|
-
})));
|
|
165
|
-
// 5. Upload ciphertext to storage backend FIRST, version-keyed so the
|
|
166
|
-
// download worker can reconstruct the URL from a DataPointRecord's
|
|
167
|
-
// (scope, expectedVersion) — DataPointRecords carry no URL. We upload
|
|
168
|
-
// before registering so the on-chain data point (the synced marker) is
|
|
169
|
-
// never stamped ahead of a blob that failed to land.
|
|
170
|
-
const storageKey = `${entry.scope}/${registerVersion}`;
|
|
171
|
-
let url = await storageAdapter.upload(storageKey, encrypted);
|
|
172
|
-
// 6. DPv2 data-point registration (idempotent — skipped when a prior run
|
|
173
|
-
// already persisted a dataPointId on this entry). registerDataPoint stamps
|
|
174
|
-
// the synced marker that excludes this entry from findUnsynced next time.
|
|
175
|
-
let dataPointId;
|
|
176
|
-
if (entry.dataPointId) {
|
|
177
|
-
dataPointId = entry.dataPointId;
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
const registerAt = async (version) => {
|
|
181
|
-
const addDataSignature = await signer.signAddData({
|
|
182
|
-
ownerAddress: serverOwner,
|
|
183
|
-
scope: entry.scope,
|
|
184
|
-
dataHash,
|
|
185
|
-
metadataHash,
|
|
186
|
-
expectedVersion: version,
|
|
187
|
-
});
|
|
188
|
-
const registration = {
|
|
189
|
-
ownerAddress: serverOwner,
|
|
190
|
-
scope: entry.scope,
|
|
191
|
-
dataHash,
|
|
192
|
-
metadataHash,
|
|
193
|
-
expectedVersion: String(version),
|
|
194
|
-
signature: addDataSignature,
|
|
195
|
-
};
|
|
196
|
-
// A derivative carries its validated `$lineage` inside the envelope;
|
|
197
|
-
// the gateway stores the same sources next to this (dataPointId,
|
|
198
|
-
// version) so lineage can be walked without the plaintext. The
|
|
199
|
-
// AddData signature is unchanged (dataHash already commits to the
|
|
200
|
-
// plaintext, `$lineage` included); the plaintext list the gateway
|
|
201
|
-
// keeps is covered by a separate LineageAttestation signature bound
|
|
202
|
-
// to this version and dataHash, so a replayed registration cannot
|
|
203
|
-
// swap it (see lineage/attestation.ts).
|
|
204
|
-
const lineage = readStoredLineage(envelope.data);
|
|
205
|
-
// An empty `$lineage` is an explicit root statement and is registered
|
|
206
|
-
// as such (attested empty list); only an ABSENT `$lineage` makes no
|
|
207
|
-
// statement and goes through the plain client.
|
|
208
|
-
let dataPointResult;
|
|
209
|
-
if (lineage) {
|
|
210
|
-
if (!deps.lineageGateway) {
|
|
211
|
-
throw new Error(`Cannot register derivative ${entry.path} (scope=${entry.scope}): lineage registration needs a gateway URL (lineageGateway is not configured)`);
|
|
212
|
-
}
|
|
213
|
-
const lineageSignature = await signer.signLineageAttestation({
|
|
214
|
-
ownerAddress: serverOwner,
|
|
215
|
-
scope: entry.scope,
|
|
216
|
-
expectedVersion: version,
|
|
217
|
-
dataHash,
|
|
218
|
-
sources: lineage.sources,
|
|
219
|
-
});
|
|
220
|
-
dataPointResult = await deps.lineageGateway.registerDataPoint({
|
|
221
|
-
...registration,
|
|
222
|
-
lineage: lineage.sources,
|
|
223
|
-
lineageSignature,
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
dataPointResult = await gateway.registerDataPoint(registration);
|
|
228
|
-
}
|
|
229
|
-
const id = dataPointResult.dataPointId ?? null;
|
|
230
|
-
if (!id) {
|
|
231
|
-
throw new Error(`Gateway registerDataPoint did not return a dataPointId for ${entry.path} (scope=${entry.scope}, version=${version})`);
|
|
232
|
-
}
|
|
233
|
-
return id;
|
|
234
|
-
};
|
|
235
|
-
try {
|
|
236
|
-
dataPointId = await registerAt(registerVersion);
|
|
237
|
-
if (registerVersion !== BigInt(entry.version)) {
|
|
238
|
-
// Re-add after a deletion: the row must follow the registered
|
|
239
|
-
// version (the blob key embeds it).
|
|
240
|
-
await storage.updateEntryVersion(entry.path, Number(registerVersion));
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
catch (err) {
|
|
244
|
-
if (!isStaleVersionConflict(err))
|
|
245
|
-
throw err;
|
|
246
|
-
// The registry's version for this (owner, scope) is ahead of the local
|
|
247
|
-
// index: pre-DPv2 rows were backfilled to version 1, and other replicas
|
|
248
|
-
// (PS Lite in the browser) advance the same per-scope sequence. The
|
|
249
|
-
// gateway 409s precisely so the client can re-sign against the live
|
|
250
|
-
// version — retrying the same version every cycle head-blocks the
|
|
251
|
-
// scope's whole upload queue.
|
|
252
|
-
// Prefer the deletion-aware feed: the SDK client throws on a 410 for
|
|
253
|
-
// a tombstoned point, which would wedge this entry forever.
|
|
254
|
-
const record = deps.dataPointFeed
|
|
255
|
-
? await deps.dataPointFeed.getDataPoint({
|
|
256
|
-
ownerAddress: serverOwner,
|
|
257
|
-
scope: entry.scope,
|
|
258
|
-
})
|
|
259
|
-
: await gateway.getDataPoint(computeDataPointId(serverOwner, entry.scope));
|
|
260
|
-
// The 409 may be a tombstone that landed after the deletion guard in
|
|
261
|
-
// step 1b ran (a delete on another replica racing this upload). Apply
|
|
262
|
-
// the same rule again before rebasing: a covered entry is dropped, a
|
|
263
|
-
// genuine re-add rebases past the tombstone below.
|
|
264
|
-
const conflictDeletedAt = record ? deletionTimestamp(record) : null;
|
|
265
|
-
if (record && conflictDeletedAt !== null) {
|
|
266
|
-
await dropIfCoveredByDeletion(deps, entry, record, conflictDeletedAt, {
|
|
267
|
-
url,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
if (record && record.dataHash.toLowerCase() === dataHash.toLowerCase()) {
|
|
271
|
-
// Identical content is already registered (this entry, or a replica's
|
|
272
|
-
// copy of it) — adopt the registered data point rather than minting a
|
|
273
|
-
// new version of the same bytes.
|
|
274
|
-
dataPointId = record.id;
|
|
275
|
-
// Align the local row with the adopted registry version — downstream
|
|
276
|
-
// consumers sign from the row's version (e.g. x402 RecordDataAccess),
|
|
277
|
-
// so a stale local version would emit records the registry rejects.
|
|
278
|
-
const adoptedVersion = Number(record.expectedVersion);
|
|
279
|
-
if (adoptedVersion !== entry.version) {
|
|
280
|
-
// Cross-replica adopt: "the registrant already uploaded the blob
|
|
281
|
-
// under the registered version key" is an assumption, not a fact —
|
|
282
|
-
// a replica that crashed between register and upload leaves a
|
|
283
|
-
// registry row whose bytes 404 for every consumer (readers
|
|
284
|
-
// reconstruct the URL from the record's (scope, expectedVersion);
|
|
285
|
-
// records carry no URL). Verify, and heal from our identical
|
|
286
|
-
// plaintext (dataHash matched, so our ciphertext decrypts to the
|
|
287
|
-
// registered content).
|
|
288
|
-
const adoptedKey = `${entry.scope}/${adoptedVersion}`;
|
|
289
|
-
const adoptedBlobExists = await storageAdapter.exists(storageAdapter.urlForKey(adoptedKey));
|
|
290
|
-
if (!adoptedBlobExists) {
|
|
291
|
-
logger.warn({ scope: entry.scope, version: adoptedVersion, dataPointId }, "Adopted registry version has no blob in storage; re-uploading from local content");
|
|
292
|
-
url = await storageAdapter.upload(adoptedKey, encrypted);
|
|
293
|
-
}
|
|
294
|
-
await storage.updateEntryVersion(entry.path, adoptedVersion);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
// Rebase onto the gateway's live next-valid version. Two independent
|
|
299
|
-
// signals for what that is:
|
|
300
|
-
// • the registry row — a replica racing AHEAD advances it past the
|
|
301
|
-
// version this error was raised against;
|
|
302
|
-
// • the 409 message itself — authoritative when the registry
|
|
303
|
-
// regressed BEHIND the local index (a moksha/DataRegistry reset,
|
|
304
|
-
// or duplicate re-snapshots pushing the local counter ahead), and
|
|
305
|
-
// the only signal at all when the reset left no row for
|
|
306
|
-
// getDataPoint to return (BUI-715).
|
|
307
|
-
// Take the max so the scope converges from either direction; when
|
|
308
|
-
// neither signal is available there is nothing to rebase onto, so
|
|
309
|
-
// surface the conflict rather than guess.
|
|
310
|
-
const recordNext = record ? Number(record.expectedVersion) + 1 : 0;
|
|
311
|
-
const errorNext = parseGatewayNextVersion(err.message) ?? 0;
|
|
312
|
-
const target = Math.max(recordNext, errorNext);
|
|
313
|
-
if (target <= 0)
|
|
314
|
-
throw err;
|
|
315
|
-
const rebased = BigInt(target);
|
|
316
|
-
// Known limitation (BUI-715 follow-up): when the registry regressed
|
|
317
|
-
// BELOW the local index, `target` can land on a version this scope
|
|
318
|
-
// already has an (older, now-defunct) synced row for. We realign only
|
|
319
|
-
// this entry, so the scope's other stale rows stay bound to gateway
|
|
320
|
-
// versions the reset dropped until their next sync cycle re-registers
|
|
321
|
-
// them. That is transient and fail-safe — readers resolve blobs from
|
|
322
|
-
// the gateway record (consistent with what we just re-registered), and
|
|
323
|
-
// x402 signed from a stale local version is rejected by the gateway
|
|
324
|
-
// rather than serving wrong bytes. A full scope reconcile (clear +
|
|
325
|
-
// renumber every row for the scope from the gateway's version) is
|
|
326
|
-
// tracked separately; head-block recovery is the fix that matters here.
|
|
327
|
-
// The blob key embeds the version (replicas reconstruct URLs from the
|
|
328
|
-
// registry record), so the rebased version needs its own blob; the one
|
|
329
|
-
// written under the stale key above is orphaned, which storage
|
|
330
|
-
// tolerates.
|
|
331
|
-
url = await storageAdapter.upload(`${entry.scope}/${rebased}`, encrypted);
|
|
332
|
-
// A concurrent replica can still win the race to `rebased`; the next
|
|
333
|
-
// sync cycle re-reads the registry and rebases again, so this stays
|
|
334
|
-
// convergent without looping here.
|
|
335
|
-
dataPointId = await registerAt(rebased);
|
|
336
|
-
await storage.updateEntryVersion(entry.path, Number(rebased));
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
// 7. Stamp the dataPointId on the local index entry — marks it synced.
|
|
340
|
-
await storage.updateDataPointId(entry.path, dataPointId);
|
|
341
|
-
// The registry now holds a live row for the scope (fresh registration or
|
|
342
|
-
// an adopted one): reads must stop treating it as deleted.
|
|
343
|
-
deps.scopeDeletions?.markLive(entry.scope);
|
|
219
|
+
if (deps.additions) {
|
|
220
|
+
await deps.additions.recordUpload({
|
|
221
|
+
scope: entry.scope,
|
|
222
|
+
collectedAt: envelope.collectedAt,
|
|
223
|
+
data: envelope.data,
|
|
224
|
+
}, { envelope, encryptedSize: sizeBytes });
|
|
344
225
|
}
|
|
345
226
|
logger.info({
|
|
346
227
|
path: entry.path,
|
|
@@ -351,62 +232,402 @@ export async function uploadOne(deps, entry) {
|
|
|
351
232
|
}, "Uploaded and registered DPv2 data point");
|
|
352
233
|
return { path: entry.path, url, dataPointId };
|
|
353
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Agent-memory scopes (see `isMemoryScope`): every save stores a full snapshot,
|
|
237
|
+
* so publishing each intermediate one would cost a registration per save.
|
|
238
|
+
*/
|
|
239
|
+
export function isCoalescedScope(scope) {
|
|
240
|
+
return isMemoryScope(scope);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* A coalesced scope is published once its newest snapshot has been quiet this
|
|
244
|
+
* long (saves have stopped) ...
|
|
245
|
+
*/
|
|
246
|
+
export const COALESCE_QUIET_MS = 2 * 60_000;
|
|
247
|
+
/** ... or once its oldest unpublished snapshot has waited this long. */
|
|
248
|
+
export const COALESCE_MAX_WAIT_MS = 10 * 60_000;
|
|
249
|
+
const at = (entry) => Date.parse(entry.collectedAt);
|
|
250
|
+
const identityOf = (entry) => ({
|
|
251
|
+
id: entry.id,
|
|
252
|
+
sizeBytes: entry.sizeBytes,
|
|
253
|
+
});
|
|
254
|
+
const VERSION_PAGE = 200;
|
|
255
|
+
/**
|
|
256
|
+
* One plan per coalesced scope in the batch. The head is the scope's latest
|
|
257
|
+
* local version (`findEntry`), not the batch's latest. Only the head is ever
|
|
258
|
+
* published: readers serve the latest version, which is a full state, so an
|
|
259
|
+
* older unpublished snapshot is never what anyone sees and publishing it would
|
|
260
|
+
* roll the scope back.
|
|
261
|
+
*/
|
|
262
|
+
function coalescePlan(deps, entries, nowMs) {
|
|
263
|
+
// One pass, one small aggregate per scope: the batch's newest row and the
|
|
264
|
+
// oldest time. Nothing is copied per row, so the cost is linear in the
|
|
265
|
+
// entries however many versions one scope holds.
|
|
266
|
+
const aggregates = new Map();
|
|
267
|
+
for (const entry of entries) {
|
|
268
|
+
if (!isCoalescedScope(entry.scope))
|
|
269
|
+
continue;
|
|
270
|
+
const known = aggregates.get(entry.scope);
|
|
271
|
+
if (!known) {
|
|
272
|
+
aggregates.set(entry.scope, { batchHead: entry, oldestMs: at(entry) });
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
if (at(entry) > at(known.batchHead))
|
|
276
|
+
known.batchHead = entry;
|
|
277
|
+
if (at(entry) < known.oldestMs)
|
|
278
|
+
known.oldestMs = at(entry);
|
|
279
|
+
}
|
|
280
|
+
const plans = new Map();
|
|
281
|
+
for (const [scope, { batchHead, oldestMs }] of aggregates) {
|
|
282
|
+
const latest = deps.storage.findEntry?.({ scope });
|
|
283
|
+
const head = latest && at(latest) >= at(batchHead) ? latest : batchHead;
|
|
284
|
+
const oldest = Math.min(oldestMs, at(head));
|
|
285
|
+
const deferred = head.dataPointId === null &&
|
|
286
|
+
nowMs - at(head) < COALESCE_QUIET_MS &&
|
|
287
|
+
nowMs - oldest < COALESCE_MAX_WAIT_MS;
|
|
288
|
+
plans.set(scope, { head, deferred });
|
|
289
|
+
}
|
|
290
|
+
return plans;
|
|
291
|
+
}
|
|
292
|
+
/** Every unpublished version of `head`'s scope older than `head`. */
|
|
293
|
+
function olderUnsynced(deps, head) {
|
|
294
|
+
const older = [];
|
|
295
|
+
for (let offset = 0;; offset += VERSION_PAGE) {
|
|
296
|
+
const page = deps.storage.listVersions(head.scope, {
|
|
297
|
+
limit: VERSION_PAGE,
|
|
298
|
+
offset,
|
|
299
|
+
});
|
|
300
|
+
for (const entry of page) {
|
|
301
|
+
if (entry.id !== head.id &&
|
|
302
|
+
entry.dataPointId === null &&
|
|
303
|
+
at(entry) < at(head)) {
|
|
304
|
+
older.push(entry);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (page.length < VERSION_PAGE)
|
|
308
|
+
return older;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Erase the older unsynced snapshots of a coalesced scope once its newest
|
|
313
|
+
* snapshot is published. Fenced to the exact rows selected, so a row that
|
|
314
|
+
* changed since is left alone. A failed erase is logged; the row stays and is
|
|
315
|
+
* superseded again on the next pass.
|
|
316
|
+
*/
|
|
317
|
+
async function eraseSuperseded(deps, entries) {
|
|
318
|
+
for (const entry of entries) {
|
|
319
|
+
try {
|
|
320
|
+
await deps.storage.deleteVersion(entry.scope, entry.collectedAt, {
|
|
321
|
+
id: entry.id,
|
|
322
|
+
path: entry.path,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
catch (err) {
|
|
326
|
+
deps.logger.warn({
|
|
327
|
+
path: entry.path,
|
|
328
|
+
scope: entry.scope,
|
|
329
|
+
error: err instanceof Error ? err.message : String(err),
|
|
330
|
+
}, "Failed to erase a superseded memory snapshot");
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Note an entry whose stored size means it can never be uploaded (too large,
|
|
336
|
+
* or no usable size), log it once, and say so. Reads nothing but the row.
|
|
337
|
+
*/
|
|
338
|
+
function holdBackTerminal(deps, state, target) {
|
|
339
|
+
if (target.dataPointId !== null)
|
|
340
|
+
return false;
|
|
341
|
+
const at = {
|
|
342
|
+
scope: target.scope,
|
|
343
|
+
path: target.path,
|
|
344
|
+
identity: identityOf(target),
|
|
345
|
+
};
|
|
346
|
+
if (!isUsableUploadSize(target.sizeBytes)) {
|
|
347
|
+
if (state.markUnsizable(at)) {
|
|
348
|
+
deps.logger.warn({ ...at, sizeBytes: String(target.sizeBytes) }, "Entry has no usable size; it stays local and is not uploaded");
|
|
349
|
+
}
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
if (!exceedsUploadCap(target.sizeBytes))
|
|
353
|
+
return false;
|
|
354
|
+
if (state.markTooLarge(at, target.sizeBytes)) {
|
|
355
|
+
deps.logger.warn({
|
|
356
|
+
...at,
|
|
357
|
+
sizeBytes: target.sizeBytes,
|
|
358
|
+
maxBodyBytes: MAX_UPLOAD_BODY_BYTES,
|
|
359
|
+
}, "Entry is too large to sync; it stays local and is not uploaded");
|
|
360
|
+
}
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Start `attempt` with an AbortSignal that fires at the deadline. `result`
|
|
365
|
+
* rejects with `UploadDeadlineError` at the deadline even when `attempt` never
|
|
366
|
+
* settles, so the worker can move on. `stopped` resolves, with the attempt's
|
|
367
|
+
* error or `undefined`, only when `attempt` has truly stopped.
|
|
368
|
+
*/
|
|
369
|
+
function startAttempt(deadlineMs, attempt) {
|
|
370
|
+
const controller = new AbortController();
|
|
371
|
+
const running = attempt(controller.signal);
|
|
372
|
+
const stopped = running.then(() => undefined, (error) => error ?? new Error("Upload attempt failed"));
|
|
373
|
+
let timer;
|
|
374
|
+
const expired = new Promise((_, reject) => {
|
|
375
|
+
timer = setTimeout(() => {
|
|
376
|
+
const error = new UploadDeadlineError(deadlineMs);
|
|
377
|
+
controller.abort(error);
|
|
378
|
+
reject(error);
|
|
379
|
+
}, deadlineMs);
|
|
380
|
+
});
|
|
381
|
+
const result = Promise.race([running, expired]).finally(() => clearTimeout(timer));
|
|
382
|
+
return { result, stopped };
|
|
383
|
+
}
|
|
354
384
|
/**
|
|
355
385
|
* Process all unsynced entries (dataPointId === null).
|
|
356
386
|
* Processes sequentially to avoid overwhelming storage backend.
|
|
357
387
|
* Returns array of results (skips failures, logs errors).
|
|
388
|
+
*
|
|
389
|
+
* Coalesced scopes (see `isCoalescedScope`) publish only their newest
|
|
390
|
+
* unsynced snapshot in the batch, after a quiet window; the older ones are
|
|
391
|
+
* erased after it lands.
|
|
358
392
|
*/
|
|
359
393
|
export async function uploadAll(deps, options) {
|
|
360
394
|
const batchSize = options?.batchSize ?? 50;
|
|
361
|
-
const
|
|
395
|
+
const clock = () => (options?.now ?? (() => new Date()))().getTime();
|
|
396
|
+
// Unsynced index rows only, no bodies. Entries that cannot be attempted now
|
|
397
|
+
// must not occupy the batch, or they hide every entry behind them, so the
|
|
398
|
+
// batch is chosen below from everything listed, not from a limited page.
|
|
399
|
+
// A host with keyset paging lists one window of at most `scanBudget` rows
|
|
400
|
+
// per cycle, resuming where the last cycle stopped, so a huge backlog costs
|
|
401
|
+
// a bounded amount per cycle and is still swept in full. Any other host is
|
|
402
|
+
// listed whole.
|
|
403
|
+
const state = deps.uploadState ?? createUploadStateTracker();
|
|
404
|
+
const attempts = deps.uploadAttempts;
|
|
405
|
+
// Leftover markers are attempts that never settled; count them before
|
|
406
|
+
// choosing what to upload.
|
|
407
|
+
if (attempts && !(await attempts.recover())) {
|
|
408
|
+
// Another manager owns the markers. Uploading from here would make a live
|
|
409
|
+
// attempt look like a crash, or overwrite its markers.
|
|
410
|
+
deps.logger.warn({}, "Upload attempt markers are owned by another sync manager; not uploading");
|
|
411
|
+
return [];
|
|
412
|
+
}
|
|
413
|
+
// Paging needs both methods: the page method alone has no fence, so a
|
|
414
|
+
// growing tail could keep the sweep from ever wrapping. Such a host is
|
|
415
|
+
// listed whole.
|
|
416
|
+
const paged = deps.storage.maxUnsyncedId
|
|
417
|
+
? deps.storage.findUnsyncedPage
|
|
418
|
+
: undefined;
|
|
419
|
+
const scanBudget = options?.scanBudget ?? UPLOAD_SCAN_BUDGET;
|
|
420
|
+
const scanAfter = paged ? state.scanCursor() : 0;
|
|
421
|
+
// A sweep covers the rows present when it began: its upper id is fixed at
|
|
422
|
+
// the start. Rows that arrive above it wait for the next sweep, so a tail
|
|
423
|
+
// that keeps growing cannot stop the sweep from wrapping back to earlier
|
|
424
|
+
// rows (a failed upload that is due again would never be revisited).
|
|
425
|
+
if (paged && scanAfter === 0 && state.scanFence() === null) {
|
|
426
|
+
const max = deps.storage.maxUnsyncedId?.() ?? Number.POSITIVE_INFINITY;
|
|
427
|
+
state.setScanFence(max);
|
|
428
|
+
// No unsynced row is above the fresh maximum, so state recorded for ids
|
|
429
|
+
// beyond it belongs to rows that are gone (a remote deletion removes rows
|
|
430
|
+
// without the sync manager). Only a new sweep may say this: an older
|
|
431
|
+
// sweep's fence can sit below live state.
|
|
432
|
+
if (Number.isFinite(max)) {
|
|
433
|
+
state.reconcile([], {
|
|
434
|
+
afterId: max,
|
|
435
|
+
throughId: Number.POSITIVE_INFINITY,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
const scanFence = paged ? (state.scanFence() ?? Number.POSITIVE_INFINITY) : 0;
|
|
440
|
+
const listed = paged
|
|
441
|
+
? paged.call(deps.storage, { afterId: scanAfter, limit: scanBudget })
|
|
442
|
+
: deps.storage.findUnsynced();
|
|
443
|
+
const entries = paged ? listed.filter((e) => e.id <= scanFence) : listed;
|
|
444
|
+
// The window is full only if it filled the budget and stayed inside the
|
|
445
|
+
// fence; otherwise the sweep has listed everything up to its fence.
|
|
446
|
+
const windowFull = paged !== undefined &&
|
|
447
|
+
listed.length >= scanBudget &&
|
|
448
|
+
entries.length === listed.length;
|
|
449
|
+
// Tracked state is dropped for rows that are gone or were rewritten. After a
|
|
450
|
+
// partial window only the id range actually listed counts, so backoff of
|
|
451
|
+
// rows beyond it survives; a window that reached the end covers the rest.
|
|
452
|
+
const scanned = paged
|
|
453
|
+
? {
|
|
454
|
+
afterId: scanAfter,
|
|
455
|
+
throughId: windowFull
|
|
456
|
+
? Number(entries[entries.length - 1]?.id)
|
|
457
|
+
: scanFence,
|
|
458
|
+
}
|
|
459
|
+
: undefined;
|
|
460
|
+
state.reconcile(entries, scanned);
|
|
461
|
+
// Markers of rows that are gone or rewritten go the same way.
|
|
462
|
+
await attempts?.reconcile(entries, scanned);
|
|
463
|
+
const plans = coalescePlan(deps, entries, clock());
|
|
362
464
|
const results = [];
|
|
465
|
+
/** Erase superseded snapshots and forget their upload state. */
|
|
466
|
+
const supersede = async (head) => {
|
|
467
|
+
const older = olderUnsynced(deps, head);
|
|
468
|
+
await eraseSuperseded(deps, older);
|
|
469
|
+
for (const entry of older)
|
|
470
|
+
state.clear(entry.path);
|
|
471
|
+
};
|
|
472
|
+
const batch = [];
|
|
473
|
+
const planned = new Set();
|
|
474
|
+
const selectedAt = clock();
|
|
475
|
+
// Last listed row the selection looked at; the next window resumes after it.
|
|
476
|
+
let lastLookedAt = scanAfter;
|
|
477
|
+
let selectionStopped = false;
|
|
363
478
|
for (const entry of entries) {
|
|
479
|
+
if (batch.length >= batchSize) {
|
|
480
|
+
selectionStopped = true;
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
lastLookedAt = Number(entry.id);
|
|
484
|
+
const plan = plans.get(entry.scope);
|
|
485
|
+
if (plan) {
|
|
486
|
+
if (planned.has(entry.scope))
|
|
487
|
+
continue;
|
|
488
|
+
planned.add(entry.scope);
|
|
489
|
+
if (plan.deferred)
|
|
490
|
+
continue;
|
|
491
|
+
if (plan.head.dataPointId === null) {
|
|
492
|
+
if (!state.shouldAttempt(plan.head.path, selectedAt))
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
else if (!state.shouldAttempt(entry.path, selectedAt))
|
|
497
|
+
continue;
|
|
498
|
+
// Entries that can never upload are classified here, from the index row
|
|
499
|
+
// alone, so they cost no batch slot even the first time they are seen.
|
|
500
|
+
if (holdBackTerminal(deps, state, plan ? plan.head : entry))
|
|
501
|
+
continue;
|
|
502
|
+
// An entry whose attempts killed the process is skipped, not retried: it
|
|
503
|
+
// would starve every entry behind it after each restart.
|
|
504
|
+
const candidate = plan ? plan.head : entry;
|
|
505
|
+
// An earlier attempt past its deadline may still be unwinding: never run a
|
|
506
|
+
// second attempt on the same entry version beside it.
|
|
507
|
+
if (attempts?.isLive(uploadAttemptKey(deps.serverOwner, candidate)))
|
|
508
|
+
continue;
|
|
509
|
+
const crashed = attempts
|
|
510
|
+
?.quarantined()
|
|
511
|
+
.find((record) => record.key === uploadAttemptKey(deps.serverOwner, candidate));
|
|
512
|
+
if (crashed) {
|
|
513
|
+
state.markCrashed({
|
|
514
|
+
scope: crashed.scope,
|
|
515
|
+
path: crashed.path,
|
|
516
|
+
identity: identityOf(candidate),
|
|
517
|
+
}, crashed.interrupted, selectedAt);
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
520
|
+
batch.push({ entry, plan });
|
|
521
|
+
}
|
|
522
|
+
if (paged) {
|
|
523
|
+
// Stopped early: resume right after the last row looked at. Looked at all
|
|
524
|
+
// of a full window: continue past it. Reached the end of the sweep's
|
|
525
|
+
// fence: start over with a new fence.
|
|
526
|
+
const resumes = selectionStopped || windowFull;
|
|
527
|
+
state.setScanCursor(resumes ? lastLookedAt : 0);
|
|
528
|
+
if (!resumes)
|
|
529
|
+
state.setScanFence(null);
|
|
530
|
+
}
|
|
531
|
+
for (const { entry, plan } of batch) {
|
|
532
|
+
if (plan && plan.head.dataPointId !== null) {
|
|
533
|
+
// The latest version is already published: older unpublished
|
|
534
|
+
// snapshots are superseded, never published.
|
|
535
|
+
await supersede(plan.head);
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
const target = plan ? plan.head : entry;
|
|
539
|
+
// Earlier entries may have taken minutes: judge this one at its own time.
|
|
540
|
+
if (!state.shouldAttempt(target.path, clock()))
|
|
541
|
+
continue;
|
|
542
|
+
// A first attempt at an entry is new data: it releases the scope's
|
|
543
|
+
// stopped entries to try again.
|
|
544
|
+
if (!state.has(target.path))
|
|
545
|
+
state.releaseStopped(target.scope);
|
|
546
|
+
// Set once the attempt exists; resolves when it has truly stopped and its
|
|
547
|
+
// marker is cleared.
|
|
548
|
+
let markerCleared;
|
|
549
|
+
let abandoned = false;
|
|
364
550
|
try {
|
|
365
|
-
|
|
551
|
+
// Durable before any body is built: if this attempt kills the process,
|
|
552
|
+
// the next boot finds the marker and counts it.
|
|
553
|
+
const token = attempts ? await attempts.begin(target) : undefined;
|
|
554
|
+
const deadlineMs = options?.attemptDeadlineMs ?? DEFAULT_UPLOAD_ATTEMPT_DEADLINE_MS;
|
|
555
|
+
const running = startAttempt(deadlineMs, (signal) => uploadOne(deps, target, { signal }));
|
|
556
|
+
// The marker is cleared when the attempt has actually stopped, not when
|
|
557
|
+
// the deadline gave up on it: abandoned work that dies with the process
|
|
558
|
+
// must still count. A caught failure keeps the interrupted count.
|
|
559
|
+
markerCleared = running.stopped
|
|
560
|
+
.then((error) => attempts?.settle(token, error === undefined ||
|
|
561
|
+
error instanceof OrphanedEntryError ||
|
|
562
|
+
error instanceof DeletedScopeEntryError ||
|
|
563
|
+
error instanceof LegacyWriteRefusedError
|
|
564
|
+
? "success"
|
|
565
|
+
: "failure"))
|
|
566
|
+
.catch((err) => {
|
|
567
|
+
deps.logger.warn({
|
|
568
|
+
path: target.path,
|
|
569
|
+
error: err instanceof Error ? err.message : String(err),
|
|
570
|
+
}, "Could not clear an upload attempt marker");
|
|
571
|
+
});
|
|
572
|
+
const result = await running.result;
|
|
366
573
|
results.push(result);
|
|
574
|
+
state.clear(target.path);
|
|
575
|
+
if (plan)
|
|
576
|
+
await supersede(plan.head);
|
|
367
577
|
}
|
|
368
578
|
catch (err) {
|
|
579
|
+
// A marker that cannot be repaired stops the pass, not just this entry.
|
|
580
|
+
if (err instanceof UploadAttemptStorageFailedError)
|
|
581
|
+
throw err;
|
|
582
|
+
abandoned = err instanceof UploadDeadlineError;
|
|
369
583
|
// A dropped orphan is a self-heal, not a failure: the row is already
|
|
370
584
|
// gone, there is nothing to retry, and surfacing it would keep the
|
|
371
585
|
// scope showing a scary error (and fail settle-waits) for a file the
|
|
372
586
|
// user deleted on purpose. Already logged in uploadOne; swallow here.
|
|
373
587
|
if (err instanceof OrphanedEntryError ||
|
|
374
588
|
err instanceof DeletedScopeEntryError) {
|
|
589
|
+
state.clear(target.path);
|
|
375
590
|
continue;
|
|
376
591
|
}
|
|
592
|
+
// The account no longer accepts legacy writes (switched) or has not said
|
|
593
|
+
// yet (unknown). Nothing is wrong with this entry: it is not a failure,
|
|
594
|
+
// spends no retry budget, and the rest of the pass would be refused too.
|
|
595
|
+
if (err instanceof LegacyWriteRefusedError) {
|
|
596
|
+
deps.logger.info({ path: target.path, scope: target.scope, verdict: err.verdict }, "Stopped uploading: legacy writes are not open for this account");
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
377
599
|
const error = err;
|
|
600
|
+
state.recordFailure({
|
|
601
|
+
scope: target.scope,
|
|
602
|
+
path: target.path,
|
|
603
|
+
identity: identityOf(target),
|
|
604
|
+
}, error.message, clock());
|
|
378
605
|
options?.onError?.(entry, error);
|
|
379
606
|
deps.logger.error({ path: entry.path, scope: entry.scope, error: error.message }, "Failed to upload entry");
|
|
607
|
+
if (!state.shouldAttempt(target.path, Number.MAX_SAFE_INTEGER)) {
|
|
608
|
+
deps.logger.warn({ path: target.path, scope: target.scope }, "Stopped retrying the upload of an entry after repeated failures");
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
finally {
|
|
612
|
+
if (!abandoned)
|
|
613
|
+
await markerCleared;
|
|
614
|
+
else {
|
|
615
|
+
// Give the aborted work a short moment to unwind. If it has not
|
|
616
|
+
// stopped, its marker stays and the entry is not retried until it does.
|
|
617
|
+
const grace = options?.abandonGraceMs ?? DEFAULT_ABANDON_GRACE_MS;
|
|
618
|
+
let timer;
|
|
619
|
+
await Promise.race([
|
|
620
|
+
markerCleared,
|
|
621
|
+
new Promise((resolve) => {
|
|
622
|
+
timer = setTimeout(resolve, grace);
|
|
623
|
+
}),
|
|
624
|
+
]);
|
|
625
|
+
clearTimeout(timer);
|
|
626
|
+
if (attempts?.isLive(uploadAttemptKey(deps.serverOwner, target)))
|
|
627
|
+
deps.logger.warn({ path: target.path, scope: target.scope }, "Upload attempt is still running after its deadline; its marker is kept");
|
|
628
|
+
}
|
|
380
629
|
}
|
|
381
630
|
}
|
|
382
631
|
return results;
|
|
383
632
|
}
|
|
384
|
-
function uint8ToHex(bytes) {
|
|
385
|
-
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
386
|
-
}
|
|
387
|
-
// The gateway rejects a registration whose expectedVersion is not strictly
|
|
388
|
-
// greater than its stored value with a 409; the SDK client surfaces it as
|
|
389
|
-
// `Gateway error: 409 <detail>`. Anything else is not a version conflict.
|
|
390
|
-
function isStaleVersionConflict(err) {
|
|
391
|
-
return err instanceof Error && /Gateway error: 409\b/.test(err.message);
|
|
392
|
-
}
|
|
393
|
-
// Extract the gateway's authoritative next-valid version from a 409 body so a
|
|
394
|
-
// rebase can target it directly instead of only inferring from a registry row
|
|
395
|
-
// (which is absent after a reset that dropped the scope's row entirely).
|
|
396
|
-
// Handles the current "Gap in version sequence … next valid version is N"
|
|
397
|
-
// phrasing (and its "effective max (M" form) as well as the older "Stale
|
|
398
|
-
// expectedVersion … must be strictly greater than the stored value N" one.
|
|
399
|
-
// Returns null when no version can be parsed.
|
|
400
|
-
export function parseGatewayNextVersion(message) {
|
|
401
|
-
const nextValid = message.match(/next valid version is (\d+)/i);
|
|
402
|
-
if (nextValid)
|
|
403
|
-
return Number(nextValid[1]);
|
|
404
|
-
const effectiveMax = message.match(/effective max \((\d+)/i);
|
|
405
|
-
if (effectiveMax)
|
|
406
|
-
return Number(effectiveMax[1]) + 1;
|
|
407
|
-
const storedValue = message.match(/strictly greater than the stored value (\d+)/i);
|
|
408
|
-
if (storedValue)
|
|
409
|
-
return Number(storedValue[1]) + 1;
|
|
410
|
-
return null;
|
|
411
|
-
}
|
|
412
633
|
//# sourceMappingURL=upload.js.map
|