@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
|
@@ -0,0 +1,759 @@
|
|
|
1
|
+
import { ANTHROPIC_CONNECTOR_ID, CLAUDE_SOURCE_ID, } from "../legacy-projection/bindings.js";
|
|
2
|
+
import { hasAlternateLegacyProfile, LEGACY_SCOPE_BINDINGS, legacyBindingsForProfile, legacyScopeToPdppSelection, projectPdppRecordsToLegacyPayload, } from "../legacy-projection/index.js";
|
|
3
|
+
import { declaredBlobField, declaredBlobReference, decodeDeclaredBlob, decodeDeclaredRecordsForProjection, DeclaredTextError, } from "../legacy-projection/declared-text.js";
|
|
4
|
+
import { claudeBlobReference, ClaudeSourceRecordError, decodeClaudeSourceRecord, mergeClaudeSourceRecords, } from "../legacy-projection/claude-source-record.js";
|
|
5
|
+
import { CursorExpiredError, InvalidCursorError, } from "./pdpp-records/portable.js";
|
|
6
|
+
/**
|
|
7
|
+
* Read-time legacy view over canonical PDPP records.
|
|
8
|
+
*
|
|
9
|
+
* Reads ONE legacy scope from exactly one selected connection and returns the
|
|
10
|
+
* legacy `DataFileEnvelope`. Nothing is stored: every call recomputes the body
|
|
11
|
+
* from the live rows, so a repaired source is visible on the next read. The
|
|
12
|
+
* reader only calls read methods on the store.
|
|
13
|
+
*
|
|
14
|
+
* Out of scope here: manual/unbound scope files (no binding => `unbound_scope`),
|
|
15
|
+
* auth/grants, and the sync `DataStoragePort` listing surface.
|
|
16
|
+
*/
|
|
17
|
+
/** Bump when a change to this module (or the pure projector) can change bytes. */
|
|
18
|
+
export const CANONICAL_LEGACY_VIEW_CONTRACT = "canonical-legacy-view/9";
|
|
19
|
+
const DEFAULT_PAGE_SIZE = 500;
|
|
20
|
+
const MAX_BLOB_READ_BYTES = 64 * 1024 * 1024;
|
|
21
|
+
const SOURCE_ID_PREFIX = "https://registry.pdpp.dev/sources/";
|
|
22
|
+
const CONNECTOR_ID_PREFIX = "https://registry.pdpp.dev/connectors/";
|
|
23
|
+
/**
|
|
24
|
+
* Pick the single connection for a source. Several matches is an error, never
|
|
25
|
+
* a union: a legacy body is one account's data.
|
|
26
|
+
*/
|
|
27
|
+
export function resolveCanonicalConnection(store, query) {
|
|
28
|
+
const matches = store
|
|
29
|
+
.listConnections(query.sourceId)
|
|
30
|
+
.filter((binding) => binding.deletedAt === null &&
|
|
31
|
+
binding.method !== null &&
|
|
32
|
+
(query.method === undefined || binding.method === query.method) &&
|
|
33
|
+
(query.instance === undefined || binding.instance === query.instance));
|
|
34
|
+
const [only] = matches;
|
|
35
|
+
if (matches.length === 1 && only?.method) {
|
|
36
|
+
return {
|
|
37
|
+
ok: true,
|
|
38
|
+
selection: {
|
|
39
|
+
instance: only.instance,
|
|
40
|
+
sourceId: query.sourceId,
|
|
41
|
+
method: only.method,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
ok: false,
|
|
47
|
+
status: "unavailable",
|
|
48
|
+
reason: matches.length === 0 ? "no_connection" : "ambiguous_connection",
|
|
49
|
+
candidates: matches.length,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export async function readCanonicalLegacyScope(input) {
|
|
53
|
+
const { store, scope, selection } = input;
|
|
54
|
+
const pageSize = Math.max(1, Math.floor(input.pageSize ?? DEFAULT_PAGE_SIZE));
|
|
55
|
+
const byMethod = input.profileBy === "method";
|
|
56
|
+
const profileKey = byMethod
|
|
57
|
+
? profileKeyForMethod(selection.method)
|
|
58
|
+
: profileKeyForSource(selection.sourceId);
|
|
59
|
+
const lookup = legacyScopeToPdppSelection(scope, { profileKey });
|
|
60
|
+
const binding = bindingFor(scope, profileKey);
|
|
61
|
+
if (!lookup.ok || !binding) {
|
|
62
|
+
return unavailable({
|
|
63
|
+
reason: "unbound_scope",
|
|
64
|
+
lookup: lookup.ok ? { kind: "unknown_scope", scope } : lookup.error,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if ((binding.pdppSource === ANTHROPIC_CONNECTOR_ID &&
|
|
68
|
+
selection.sourceId !== CLAUDE_SOURCE_ID) ||
|
|
69
|
+
(byMethod
|
|
70
|
+
? legacyConnectorKey(binding.pdppSource) !== selection.method
|
|
71
|
+
: canonicalSourceId(binding.pdppSource) !== selection.sourceId)) {
|
|
72
|
+
return unavailable({ reason: "scope_source_mismatch", scope });
|
|
73
|
+
}
|
|
74
|
+
const streams = lookup.selection.streams;
|
|
75
|
+
const snapshot = store.readSnapshot(() => input.confirmSelection && !input.confirmSelection()
|
|
76
|
+
? {
|
|
77
|
+
ok: false,
|
|
78
|
+
result: inconsistent("the connection selection changed"),
|
|
79
|
+
}
|
|
80
|
+
: collectSnapshot(store, selection, streams, binding.rowOrder === "arrival", pageSize, Number.isSafeInteger(input.blobByteBudget) &&
|
|
81
|
+
(input.blobByteBudget ?? -1) >= 0
|
|
82
|
+
? Math.min(MAX_BLOB_READ_BYTES, input.blobByteBudget)
|
|
83
|
+
: MAX_BLOB_READ_BYTES, input.requireCompletionReceipts === true, input.allowUnprovenEmptyStreams === true, new Set(binding.ancillaryBlobStreams), input.declarations));
|
|
84
|
+
if (!snapshot.ok)
|
|
85
|
+
return snapshot.result;
|
|
86
|
+
return projectSnapshot({
|
|
87
|
+
scope,
|
|
88
|
+
selection,
|
|
89
|
+
streams,
|
|
90
|
+
binding,
|
|
91
|
+
profileKey,
|
|
92
|
+
includeStreamTimes: input.includeStreamTimes === true,
|
|
93
|
+
requireClaudeRawBlobs: input.requireClaudeRawBlobs === true,
|
|
94
|
+
...snapshot,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/** Everything the view needs from the store, read inside one snapshot. */
|
|
98
|
+
function collectSnapshot(store, selection, streams, arrivalOrder, pageSize, blobByteBudget, requireCompletionReceipts, allowUnprovenEmptyStreams, ancillaryBlobStreams, declarations) {
|
|
99
|
+
const { instance } = selection;
|
|
100
|
+
const binding = store.getInstanceBinding(instance);
|
|
101
|
+
const rejected = checkConnection(binding, selection);
|
|
102
|
+
if (rejected)
|
|
103
|
+
return { ok: false, result: unavailable(rejected) };
|
|
104
|
+
const listing = store.listStreams([instance]);
|
|
105
|
+
const streamSchemas = {};
|
|
106
|
+
for (const stream of streams) {
|
|
107
|
+
const schema = declarations?.forInstance(instance, stream)?.schema;
|
|
108
|
+
if (schema)
|
|
109
|
+
streamSchemas[stream] = structuredClone(schema);
|
|
110
|
+
}
|
|
111
|
+
const rowsByStream = new Map();
|
|
112
|
+
const orderGaps = [];
|
|
113
|
+
try {
|
|
114
|
+
for (const stream of streams) {
|
|
115
|
+
const rows = readAllRows(store, instance, stream, pageSize);
|
|
116
|
+
if (typeof rows === "string") {
|
|
117
|
+
return { ok: false, result: inconsistent(rows) };
|
|
118
|
+
}
|
|
119
|
+
// Inside one snapshot the listing and the pages must agree.
|
|
120
|
+
if (rows.length !== countFor(listing, stream)) {
|
|
121
|
+
return {
|
|
122
|
+
ok: false,
|
|
123
|
+
result: inconsistent(`${stream} pages disagree with the listing`),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const ordered = arrivalOrder
|
|
127
|
+
? inArrivalOrder(rows, store.listArrivalOrder(instance, stream))
|
|
128
|
+
: rows;
|
|
129
|
+
if (!ordered)
|
|
130
|
+
orderGaps.push(stream);
|
|
131
|
+
rowsByStream.set(stream, ordered ?? rows);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
if (error instanceof CursorExpiredError ||
|
|
136
|
+
error instanceof InvalidCursorError) {
|
|
137
|
+
return { ok: false, result: inconsistent("store cursor rejected") };
|
|
138
|
+
}
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
const completions = new Map();
|
|
142
|
+
for (const receipt of store.listStreamCompletions(instance)) {
|
|
143
|
+
if (streams.includes(receipt.stream) &&
|
|
144
|
+
receipt.method === binding.method &&
|
|
145
|
+
receipt.generation === binding.generation &&
|
|
146
|
+
receipt.liveCount === rowsByStream.get(receipt.stream)?.length) {
|
|
147
|
+
completions.set(receipt.stream, receipt);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// Refuse missing source evidence before reading even one blob body.
|
|
151
|
+
// Binding, rows, receipts, metadata and the later copies share this snapshot.
|
|
152
|
+
if (completions.size === 0 &&
|
|
153
|
+
listing.every((entry) => entry.recordCount === 0)) {
|
|
154
|
+
return { ok: false, result: unavailable({ reason: "no_synced_data" }) };
|
|
155
|
+
}
|
|
156
|
+
const unprovenStreams = streams.filter((stream) => !completions.has(stream) &&
|
|
157
|
+
(requireCompletionReceipts ||
|
|
158
|
+
(!allowUnprovenEmptyStreams &&
|
|
159
|
+
(rowsByStream.get(stream)?.length ?? 0) === 0)));
|
|
160
|
+
if (unprovenStreams.length > 0) {
|
|
161
|
+
return {
|
|
162
|
+
ok: false,
|
|
163
|
+
result: unavailable({
|
|
164
|
+
reason: "stream_completion_unknown",
|
|
165
|
+
streams: unprovenStreams,
|
|
166
|
+
}),
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
// Preflight all unique references/metadata before copying ANY body. A legal
|
|
170
|
+
// per-blob size does not bound fan-in; excluded raw fields still cost bytes.
|
|
171
|
+
const blobContents = new Map();
|
|
172
|
+
let requiredBytes = 0;
|
|
173
|
+
const declaredBlobIds = new Set();
|
|
174
|
+
for (const stream of streams) {
|
|
175
|
+
// The binding projects these rows from their typed fields alone.
|
|
176
|
+
if (ancillaryBlobStreams.has(stream))
|
|
177
|
+
continue;
|
|
178
|
+
const blobBacked = (rowsByStream.get(stream) ?? []).filter(hasBlobRef);
|
|
179
|
+
if (blobBacked.length === 0)
|
|
180
|
+
continue;
|
|
181
|
+
const projectedField = declaredBlobField(streamSchemas[stream]);
|
|
182
|
+
if (!projectedField &&
|
|
183
|
+
(selection.sourceId !== CLAUDE_SOURCE_ID ||
|
|
184
|
+
(stream !== "conversations" && stream !== "projects"))) {
|
|
185
|
+
return {
|
|
186
|
+
ok: false,
|
|
187
|
+
result: unavailable({
|
|
188
|
+
reason: "blob_backed_records_unsupported",
|
|
189
|
+
stream,
|
|
190
|
+
recordCount: blobBacked.length,
|
|
191
|
+
blocker: "This scope/stream has no verified mapping from blob bytes to its legacy fields.",
|
|
192
|
+
}),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
for (const row of blobBacked) {
|
|
196
|
+
let ref;
|
|
197
|
+
try {
|
|
198
|
+
ref = projectedField
|
|
199
|
+
? declaredBlobReference(row.data, projectedField)
|
|
200
|
+
: claudeBlobReference(row.data);
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
if (!projectedField && !(error instanceof ClaudeSourceRecordError))
|
|
204
|
+
throw error;
|
|
205
|
+
return {
|
|
206
|
+
ok: false,
|
|
207
|
+
result: unavailable({
|
|
208
|
+
reason: "blob_backed_record_invalid",
|
|
209
|
+
detail: projectedField
|
|
210
|
+
? "invalid_blob_reference"
|
|
211
|
+
: error.message,
|
|
212
|
+
}),
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
if (projectedField)
|
|
216
|
+
declaredBlobIds.add(ref.blobId);
|
|
217
|
+
const prior = blobContents.get(ref.blobId);
|
|
218
|
+
let meta;
|
|
219
|
+
try {
|
|
220
|
+
meta = prior?.meta ?? store.getBlobMeta?.(ref.blobId);
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
if (!projectedField)
|
|
224
|
+
throw error;
|
|
225
|
+
return {
|
|
226
|
+
ok: false,
|
|
227
|
+
result: unavailable({ reason: "missing_raw_blob", recordCount: 1 }),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (!meta && projectedField) {
|
|
231
|
+
return {
|
|
232
|
+
ok: false,
|
|
233
|
+
result: unavailable({ reason: "missing_raw_blob", recordCount: 1 }),
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
if (!meta)
|
|
237
|
+
return {
|
|
238
|
+
ok: false,
|
|
239
|
+
result: unavailable({
|
|
240
|
+
reason: "blob_backed_record_invalid",
|
|
241
|
+
detail: "blob_missing_or_corrupt",
|
|
242
|
+
}),
|
|
243
|
+
};
|
|
244
|
+
if (meta.blobId !== ref.blobId ||
|
|
245
|
+
meta.mimeType !== "application/json" ||
|
|
246
|
+
meta.sizeBytes !== ref.size ||
|
|
247
|
+
meta.sha256 !== ref.sha256) {
|
|
248
|
+
return {
|
|
249
|
+
ok: false,
|
|
250
|
+
result: unavailable({
|
|
251
|
+
reason: "blob_backed_record_invalid",
|
|
252
|
+
detail: "blob_metadata_mismatch",
|
|
253
|
+
}),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
if (prior)
|
|
257
|
+
continue;
|
|
258
|
+
const sum = requiredBytes + ref.size;
|
|
259
|
+
// Never accumulate an inexact integer, even for a refused request.
|
|
260
|
+
if (!Number.isSafeInteger(sum)) {
|
|
261
|
+
return {
|
|
262
|
+
ok: false,
|
|
263
|
+
result: unavailable({
|
|
264
|
+
reason: "blob_read_budget_exceeded",
|
|
265
|
+
maxBytes: blobByteBudget,
|
|
266
|
+
}),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
requiredBytes = sum;
|
|
270
|
+
blobContents.set(ref.blobId, { meta: { ...meta }, bytes: undefined });
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (requiredBytes > blobByteBudget) {
|
|
274
|
+
return {
|
|
275
|
+
ok: false,
|
|
276
|
+
result: unavailable({
|
|
277
|
+
reason: "blob_read_budget_exceeded",
|
|
278
|
+
requiredBytes,
|
|
279
|
+
maxBytes: blobByteBudget,
|
|
280
|
+
}),
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
for (const [blobId, contents] of blobContents) {
|
|
284
|
+
let bytes;
|
|
285
|
+
try {
|
|
286
|
+
bytes = store.getBlobBytes?.(blobId);
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
if (!declaredBlobIds.has(blobId))
|
|
290
|
+
throw error;
|
|
291
|
+
return {
|
|
292
|
+
ok: false,
|
|
293
|
+
result: unavailable({ reason: "missing_raw_blob", recordCount: 1 }),
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
if (!bytes && declaredBlobIds.has(blobId)) {
|
|
297
|
+
return {
|
|
298
|
+
ok: false,
|
|
299
|
+
result: unavailable({ reason: "missing_raw_blob", recordCount: 1 }),
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
if (!bytes)
|
|
303
|
+
return {
|
|
304
|
+
ok: false,
|
|
305
|
+
result: unavailable({
|
|
306
|
+
reason: "blob_backed_record_invalid",
|
|
307
|
+
detail: "blob_missing_or_corrupt",
|
|
308
|
+
}),
|
|
309
|
+
};
|
|
310
|
+
if (bytes.byteLength !== contents.meta?.sizeBytes) {
|
|
311
|
+
return {
|
|
312
|
+
ok: false,
|
|
313
|
+
result: unavailable({
|
|
314
|
+
reason: "blob_backed_record_invalid",
|
|
315
|
+
detail: "blob_metadata_mismatch",
|
|
316
|
+
}),
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
contents.bytes = bytes.slice();
|
|
320
|
+
}
|
|
321
|
+
return {
|
|
322
|
+
ok: true,
|
|
323
|
+
generation: binding.generation,
|
|
324
|
+
listing,
|
|
325
|
+
rowsByStream,
|
|
326
|
+
orderGaps,
|
|
327
|
+
completions,
|
|
328
|
+
blobContents,
|
|
329
|
+
streamSchemas,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* `rows` in the order their keys last arrived, or null when a row has no
|
|
334
|
+
* arrival to place it by. Zero or one row has only one order.
|
|
335
|
+
*/
|
|
336
|
+
function inArrivalOrder(rows, arrival) {
|
|
337
|
+
if (rows.length < 2)
|
|
338
|
+
return rows;
|
|
339
|
+
const position = new Map(arrival.map((key, index) => [key, index]));
|
|
340
|
+
const placed = rows.map((row) => ({ row, at: position.get(row.recordKey) }));
|
|
341
|
+
if (placed.some(({ at }) => at === undefined))
|
|
342
|
+
return null;
|
|
343
|
+
return placed.sort((a, b) => (a.at ?? 0) - (b.at ?? 0)).map(({ row }) => row);
|
|
344
|
+
}
|
|
345
|
+
async function projectSnapshot(input) {
|
|
346
|
+
const { scope, selection, streams, binding, profileKey, rowsByStream, orderGaps, completions, } = input;
|
|
347
|
+
const listingBefore = input.listing;
|
|
348
|
+
const sourceRowCounts = Object.fromEntries(streams.map((stream) => [stream, rowsByStream.get(stream)?.length ?? 0]));
|
|
349
|
+
const expanded = [];
|
|
350
|
+
const canExpandClaude = selection.sourceId === CLAUDE_SOURCE_ID &&
|
|
351
|
+
selection.method === "anthropic" &&
|
|
352
|
+
(scope === "claude.conversations" || scope === "claude.projects");
|
|
353
|
+
if (canExpandClaude && input.requireClaudeRawBlobs) {
|
|
354
|
+
const parentStream = scope === "claude.conversations" ? "conversations" : "projects";
|
|
355
|
+
const missingRawBlobCount = (rowsByStream.get(parentStream) ?? []).filter((row) => !hasBlobRef(row)).length;
|
|
356
|
+
if (missingRawBlobCount > 0) {
|
|
357
|
+
return unavailable({
|
|
358
|
+
reason: "missing_raw_blob",
|
|
359
|
+
recordCount: missingRawBlobCount,
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
for (const stream of streams) {
|
|
364
|
+
if (binding.ancillaryBlobStreams?.includes(stream))
|
|
365
|
+
continue;
|
|
366
|
+
const blobBacked = (rowsByStream.get(stream) ?? []).filter(hasBlobRef);
|
|
367
|
+
if (canExpandClaude &&
|
|
368
|
+
!declaredBlobField(input.streamSchemas[stream]) &&
|
|
369
|
+
(stream === "conversations" || stream === "projects")) {
|
|
370
|
+
try {
|
|
371
|
+
for (const row of blobBacked) {
|
|
372
|
+
const ref = claudeBlobReference(row.data);
|
|
373
|
+
expanded.push(...(await decodeClaudeSourceRecord(row, input.blobContents.get(ref.blobId) ?? {
|
|
374
|
+
meta: undefined,
|
|
375
|
+
bytes: undefined,
|
|
376
|
+
})));
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
catch (error) {
|
|
380
|
+
if (!(error instanceof ClaudeSourceRecordError))
|
|
381
|
+
throw error;
|
|
382
|
+
return unavailable({
|
|
383
|
+
reason: "blob_backed_record_invalid",
|
|
384
|
+
detail: error.message,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
if (blobBacked.length > 0 &&
|
|
390
|
+
!declaredBlobField(input.streamSchemas[stream])) {
|
|
391
|
+
return unavailable({
|
|
392
|
+
reason: "blob_backed_records_unsupported",
|
|
393
|
+
stream,
|
|
394
|
+
recordCount: blobBacked.length,
|
|
395
|
+
blocker: "This scope/stream has no verified mapping from blob bytes to its legacy fields.",
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
const collectedAt = latestCollectedAt(rowsByStream, completions, listingBefore);
|
|
400
|
+
if (collectedAt === null)
|
|
401
|
+
return unavailable({ reason: "invalid_collected_at" });
|
|
402
|
+
let records = streams.flatMap((stream) => (rowsByStream.get(stream) ?? []).map((row) => ({ stream, data: row.data })));
|
|
403
|
+
// Decode inline fields before inserting raw blob text; a JSON-string blob
|
|
404
|
+
// is already source text and must never be decoded a second time.
|
|
405
|
+
let decodeDiagnostics = [];
|
|
406
|
+
try {
|
|
407
|
+
const decoded = decodeDeclaredRecordsForProjection(records, input.streamSchemas, scope, true);
|
|
408
|
+
records = decoded.records;
|
|
409
|
+
decodeDiagnostics = decoded.diagnostics;
|
|
410
|
+
}
|
|
411
|
+
catch (error) {
|
|
412
|
+
if (!(error instanceof DeclaredTextError))
|
|
413
|
+
throw error;
|
|
414
|
+
return rejection(error.projectionError(scope), sourceRowCounts);
|
|
415
|
+
}
|
|
416
|
+
for (let i = 0; i < records.length; i++) {
|
|
417
|
+
const record = records[i];
|
|
418
|
+
const field = declaredBlobField(input.streamSchemas[record.stream]);
|
|
419
|
+
if (!field || !Object.hasOwn(record.data, "blob_ref"))
|
|
420
|
+
continue;
|
|
421
|
+
try {
|
|
422
|
+
const ref = declaredBlobReference(record.data, field);
|
|
423
|
+
records[i] = {
|
|
424
|
+
...record,
|
|
425
|
+
data: await decodeDeclaredBlob(record.data, field, input.blobContents.get(ref.blobId) ?? {
|
|
426
|
+
meta: undefined,
|
|
427
|
+
bytes: undefined,
|
|
428
|
+
}),
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
catch {
|
|
432
|
+
return unavailable({
|
|
433
|
+
reason: "blob_backed_record_invalid",
|
|
434
|
+
detail: "invalid_declared_blob",
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (expanded.length > 0) {
|
|
439
|
+
try {
|
|
440
|
+
records = mergeClaudeSourceRecords(records.filter((record) => !Object.hasOwn(record.data, "blob_ref")), expanded);
|
|
441
|
+
}
|
|
442
|
+
catch (error) {
|
|
443
|
+
if (!(error instanceof ClaudeSourceRecordError))
|
|
444
|
+
throw error;
|
|
445
|
+
return unavailable({
|
|
446
|
+
reason: "blob_backed_record_invalid",
|
|
447
|
+
detail: error.message,
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
const projected = projectPdppRecordsToLegacyPayload(scope, records, {
|
|
452
|
+
fetchedStreams: streams,
|
|
453
|
+
...(profileKey ? { profileKey } : {}),
|
|
454
|
+
now: collectedAt,
|
|
455
|
+
// Rows of an arrival-ordered scope go in as read. Without proof of that
|
|
456
|
+
// order the view falls back to key order and reports the gap below.
|
|
457
|
+
orderByPrimaryKey: binding.rowOrder !== "arrival" || orderGaps.length > 0,
|
|
458
|
+
});
|
|
459
|
+
if (!projected.ok) {
|
|
460
|
+
return rejection(projected.error, sourceRowCounts);
|
|
461
|
+
}
|
|
462
|
+
const omissions = [];
|
|
463
|
+
const partialRows = [];
|
|
464
|
+
const unproven = orderGaps.map((stream) => ({
|
|
465
|
+
stream,
|
|
466
|
+
aspect: "record_order",
|
|
467
|
+
reason: "some rows were stored before the store kept arrival order; they are served in primary-key order",
|
|
468
|
+
}));
|
|
469
|
+
for (const diagnostic of [
|
|
470
|
+
...decodeDiagnostics,
|
|
471
|
+
...(projected.diagnostics ?? []),
|
|
472
|
+
]) {
|
|
473
|
+
if (diagnostic.kind === "records_dropped" ||
|
|
474
|
+
diagnostic.kind === "records_partial") {
|
|
475
|
+
(diagnostic.kind === "records_dropped" ? omissions : partialRows).push({
|
|
476
|
+
stream: diagnostic.stream,
|
|
477
|
+
count: diagnostic.count,
|
|
478
|
+
reasons: diagnostic.reasons,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
// Valid peers may deliver with omissions. If NOTHING of the item stream
|
|
483
|
+
// survived, a "successful empty" would read as an empty history.
|
|
484
|
+
const itemStream = streams[0];
|
|
485
|
+
const sourceRows = itemStream ? (sourceRowCounts[itemStream] ?? 0) : 0;
|
|
486
|
+
const itemOmissions = omissions.filter((entry) => entry.stream === itemStream);
|
|
487
|
+
const itemDropped = itemOmissions.reduce((sum, entry) => sum + entry.count, 0);
|
|
488
|
+
if (itemStream && sourceRows > 0 && itemDropped >= sourceRows) {
|
|
489
|
+
return {
|
|
490
|
+
ok: false,
|
|
491
|
+
status: "incomplete",
|
|
492
|
+
reason: "all_rows_rejected",
|
|
493
|
+
stream: itemStream,
|
|
494
|
+
sourceRows,
|
|
495
|
+
dropped: itemDropped,
|
|
496
|
+
reasons: [...new Set(itemOmissions.flatMap((entry) => entry.reasons))],
|
|
497
|
+
sourceRowCounts,
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
const revision = await viewRevision({
|
|
501
|
+
scope,
|
|
502
|
+
selection,
|
|
503
|
+
binding,
|
|
504
|
+
profileKey,
|
|
505
|
+
generation: input.generation,
|
|
506
|
+
streams,
|
|
507
|
+
rowsByStream,
|
|
508
|
+
orderGaps,
|
|
509
|
+
completions,
|
|
510
|
+
listing: listingBefore,
|
|
511
|
+
streamSchemas: input.streamSchemas,
|
|
512
|
+
});
|
|
513
|
+
return {
|
|
514
|
+
ok: true,
|
|
515
|
+
...(projected.projectionOmissions
|
|
516
|
+
? { projectionOmissions: projected.projectionOmissions }
|
|
517
|
+
: {}),
|
|
518
|
+
envelope: {
|
|
519
|
+
version: "1.0",
|
|
520
|
+
scope,
|
|
521
|
+
collectedAt,
|
|
522
|
+
data: projected.payload,
|
|
523
|
+
},
|
|
524
|
+
...(input.includeStreamTimes
|
|
525
|
+
? {
|
|
526
|
+
streamCollectionTimes: Object.fromEntries(streams.map((stream) => {
|
|
527
|
+
const receipt = completions.get(stream);
|
|
528
|
+
if (receipt)
|
|
529
|
+
return [stream, receipt.sourceCollectedAt];
|
|
530
|
+
const rows = rowsByStream.get(stream) ?? [];
|
|
531
|
+
const times = rows.map((row) => Date.parse(row.emittedAt));
|
|
532
|
+
if (times.length === 0 ||
|
|
533
|
+
times.some((time) => !Number.isFinite(time))) {
|
|
534
|
+
return [stream, null];
|
|
535
|
+
}
|
|
536
|
+
return [
|
|
537
|
+
stream,
|
|
538
|
+
new Date(times.reduce((oldest, time) => Math.min(oldest, time), Number.POSITIVE_INFINITY)).toISOString(),
|
|
539
|
+
];
|
|
540
|
+
})),
|
|
541
|
+
streamCompletionTimes: Object.fromEntries(streams.map((stream) => [
|
|
542
|
+
stream,
|
|
543
|
+
completions.get(stream)?.sourceCollectedAt ?? null,
|
|
544
|
+
])),
|
|
545
|
+
}
|
|
546
|
+
: {}),
|
|
547
|
+
revision,
|
|
548
|
+
complete: omissions.length === 0 &&
|
|
549
|
+
partialRows.length === 0 &&
|
|
550
|
+
unproven.length === 0,
|
|
551
|
+
diagnostics: {
|
|
552
|
+
sourceRowCounts,
|
|
553
|
+
omissions,
|
|
554
|
+
partialRows,
|
|
555
|
+
...(unproven.length > 0 ? { unproven } : {}),
|
|
556
|
+
},
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
function inconsistent(detail) {
|
|
560
|
+
return unavailable({ reason: "store_inconsistent_read", detail });
|
|
561
|
+
}
|
|
562
|
+
/** All live rows of one stream, or a detail string if the pages are not one clean listing. */
|
|
563
|
+
function readAllRows(store, instance, stream, limit) {
|
|
564
|
+
const rows = [];
|
|
565
|
+
const seen = new Set();
|
|
566
|
+
let cursor;
|
|
567
|
+
let horizon;
|
|
568
|
+
let first = true;
|
|
569
|
+
for (;;) {
|
|
570
|
+
const page = store.listRecords(stream, {
|
|
571
|
+
instanceIds: [instance],
|
|
572
|
+
limit,
|
|
573
|
+
cursor,
|
|
574
|
+
order: "asc",
|
|
575
|
+
});
|
|
576
|
+
if (first)
|
|
577
|
+
horizon = page.horizon;
|
|
578
|
+
else if (page.horizon !== horizon)
|
|
579
|
+
return `${stream} page horizon moved`;
|
|
580
|
+
first = false;
|
|
581
|
+
for (const row of page.data) {
|
|
582
|
+
const identity = `${row.instance}\u0000${row.recordKey}`;
|
|
583
|
+
if (row.instance !== instance ||
|
|
584
|
+
row.stream !== stream ||
|
|
585
|
+
seen.has(identity)) {
|
|
586
|
+
return `${stream} returned a foreign or repeated row`;
|
|
587
|
+
}
|
|
588
|
+
seen.add(identity);
|
|
589
|
+
rows.push(row);
|
|
590
|
+
}
|
|
591
|
+
if (!page.hasMore)
|
|
592
|
+
return rows;
|
|
593
|
+
if (!page.nextCursor || page.nextCursor === cursor) {
|
|
594
|
+
return `${stream} cursor did not advance`;
|
|
595
|
+
}
|
|
596
|
+
cursor = page.nextCursor;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
function checkConnection(binding, selection) {
|
|
600
|
+
const detail = (value) => ({ reason: "connection_unavailable", detail: value });
|
|
601
|
+
if (binding.sourceId === null)
|
|
602
|
+
return detail("not_registered");
|
|
603
|
+
if (binding.deletedAt !== null)
|
|
604
|
+
return detail("deleted");
|
|
605
|
+
if (binding.sourceId !== selection.sourceId)
|
|
606
|
+
return detail("source_mismatch");
|
|
607
|
+
if (binding.method !== selection.method)
|
|
608
|
+
return detail("method_mismatch");
|
|
609
|
+
return null;
|
|
610
|
+
}
|
|
611
|
+
function rejection(error, sourceRowCounts) {
|
|
612
|
+
if (error.kind === "unknown_scope" || error.kind === "unsupported_profile") {
|
|
613
|
+
return unavailable({
|
|
614
|
+
reason: "unbound_scope",
|
|
615
|
+
lookup: error,
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
return {
|
|
619
|
+
ok: false,
|
|
620
|
+
status: "incomplete",
|
|
621
|
+
reason: "projection_rejected",
|
|
622
|
+
error,
|
|
623
|
+
sourceRowCounts,
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
function unavailable(failure) {
|
|
627
|
+
return {
|
|
628
|
+
ok: false,
|
|
629
|
+
status: "unavailable",
|
|
630
|
+
...failure,
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
function hasBlobRef(row) {
|
|
634
|
+
return Object.hasOwn(row.data, "blob_ref");
|
|
635
|
+
}
|
|
636
|
+
function countFor(listing, stream) {
|
|
637
|
+
return listing.find((entry) => entry.stream === stream)?.recordCount ?? 0;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Newest collection time over the bound streams. A stream with a valid
|
|
641
|
+
* receipt was collected at its producer `sourceCollectedAt`, even when an
|
|
642
|
+
* unchanged replace left older rows. A stream without one falls back to its
|
|
643
|
+
* rows' `emittedAt` (the importer stamps it from the original envelope
|
|
644
|
+
* `collectedAt`). With neither, the newest stream horizon of the connection.
|
|
645
|
+
* Never the wall clock.
|
|
646
|
+
*/
|
|
647
|
+
function latestCollectedAt(rowsByStream, completions, listing) {
|
|
648
|
+
const stamps = [];
|
|
649
|
+
for (const [stream, rows] of rowsByStream) {
|
|
650
|
+
const receipt = completions.get(stream);
|
|
651
|
+
if (receipt)
|
|
652
|
+
stamps.push(receipt.sourceCollectedAt);
|
|
653
|
+
else
|
|
654
|
+
for (const row of rows)
|
|
655
|
+
stamps.push(row.emittedAt);
|
|
656
|
+
}
|
|
657
|
+
if (stamps.length === 0) {
|
|
658
|
+
for (const entry of listing) {
|
|
659
|
+
if (entry.lastUpdated !== null)
|
|
660
|
+
stamps.push(entry.lastUpdated);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
let newest = Number.NEGATIVE_INFINITY;
|
|
664
|
+
for (const stamp of stamps) {
|
|
665
|
+
const ms = Date.parse(stamp);
|
|
666
|
+
if (Number.isNaN(ms))
|
|
667
|
+
return null;
|
|
668
|
+
newest = Math.max(newest, ms);
|
|
669
|
+
}
|
|
670
|
+
return Number.isFinite(newest) ? new Date(newest).toISOString() : null;
|
|
671
|
+
}
|
|
672
|
+
async function viewRevision(input) {
|
|
673
|
+
const horizons = [];
|
|
674
|
+
for (const stream of input.streams) {
|
|
675
|
+
const rows = input.rowsByStream.get(stream) ?? [];
|
|
676
|
+
horizons.push({
|
|
677
|
+
stream,
|
|
678
|
+
count: rows.length,
|
|
679
|
+
lastUpdated: input.listing.find((entry) => entry.stream === stream)?.lastUpdated ??
|
|
680
|
+
null,
|
|
681
|
+
rows: await sha256Hex(rows
|
|
682
|
+
.map((row) => `${row.recordKey}\u0000${row.version}\u0000${row.emittedAt}`)
|
|
683
|
+
.join("\n")),
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
const digest = await sha256Hex(JSON.stringify({
|
|
687
|
+
contract: CANONICAL_LEGACY_VIEW_CONTRACT,
|
|
688
|
+
streamSchemas: input.streamSchemas,
|
|
689
|
+
scope: input.scope,
|
|
690
|
+
instance: input.selection.instance,
|
|
691
|
+
sourceId: input.selection.sourceId,
|
|
692
|
+
method: input.selection.method,
|
|
693
|
+
generation: input.generation,
|
|
694
|
+
profileKey: input.profileKey ?? null,
|
|
695
|
+
declaration: {
|
|
696
|
+
pdppSource: input.binding.pdppSource,
|
|
697
|
+
streams: input.binding.pdppStreams,
|
|
698
|
+
primaryKey: input.binding.primaryKey,
|
|
699
|
+
fieldsRead: input.binding.fieldsRead,
|
|
700
|
+
provenance: input.binding.provenance,
|
|
701
|
+
},
|
|
702
|
+
// Rows hash in served order, so a re-delivery that moves a key moves
|
|
703
|
+
// the revision even though no row version changed.
|
|
704
|
+
horizons,
|
|
705
|
+
orderGaps: input.orderGaps,
|
|
706
|
+
// Not `writeSeq`: the write clock is shared by all connections, so an
|
|
707
|
+
// unchanged replay after another account's write would move it.
|
|
708
|
+
completions: input.streams.flatMap((stream) => {
|
|
709
|
+
const receipt = input.completions.get(stream);
|
|
710
|
+
return receipt
|
|
711
|
+
? [
|
|
712
|
+
{
|
|
713
|
+
stream,
|
|
714
|
+
method: receipt.method,
|
|
715
|
+
generation: receipt.generation,
|
|
716
|
+
sourceCollectedAt: receipt.sourceCollectedAt,
|
|
717
|
+
liveCount: receipt.liveCount,
|
|
718
|
+
},
|
|
719
|
+
]
|
|
720
|
+
: [];
|
|
721
|
+
}),
|
|
722
|
+
}));
|
|
723
|
+
return `v1:${digest}`;
|
|
724
|
+
}
|
|
725
|
+
async function sha256Hex(text) {
|
|
726
|
+
const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text));
|
|
727
|
+
return Array.from(new Uint8Array(bytes), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
728
|
+
}
|
|
729
|
+
function bindingFor(scope, profileKey) {
|
|
730
|
+
return profileKey
|
|
731
|
+
? legacyBindingsForProfile(profileKey).get(scope)
|
|
732
|
+
: LEGACY_SCOPE_BINDINGS.get(scope);
|
|
733
|
+
}
|
|
734
|
+
/** Alternate declaration profiles are keyed by the source's last segment. */
|
|
735
|
+
function profileKeyForSource(sourceId) {
|
|
736
|
+
const key = sourceId.slice(sourceId.lastIndexOf("/") + 1);
|
|
737
|
+
return hasAlternateLegacyProfile(key) ? key : undefined;
|
|
738
|
+
}
|
|
739
|
+
/** A method id names its alternate profile directly; others use the default. */
|
|
740
|
+
function profileKeyForMethod(method) {
|
|
741
|
+
return hasAlternateLegacyProfile(method) ? method : undefined;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* The connector key a binding was reviewed for: the last segment of its
|
|
745
|
+
* `pdppSource`. It is a profile name, not a store source id.
|
|
746
|
+
*/
|
|
747
|
+
export function legacyConnectorKey(pdppSource) {
|
|
748
|
+
return pdppSource.slice(pdppSource.lastIndexOf("/") + 1);
|
|
749
|
+
}
|
|
750
|
+
/** Most connector keys match their public source; Anthropic collects Claude. */
|
|
751
|
+
function canonicalSourceId(pdppSource) {
|
|
752
|
+
if (pdppSource === ANTHROPIC_CONNECTOR_ID ||
|
|
753
|
+
pdppSource === "https://registry.pdpp.dev/connectors/anthropic-live")
|
|
754
|
+
return CLAUDE_SOURCE_ID;
|
|
755
|
+
return pdppSource.startsWith(CONNECTOR_ID_PREFIX)
|
|
756
|
+
? SOURCE_ID_PREFIX + pdppSource.slice(CONNECTOR_ID_PREFIX.length)
|
|
757
|
+
: pdppSource;
|
|
758
|
+
}
|
|
759
|
+
//# sourceMappingURL=canonical-legacy-projection.js.map
|