@opendatalabs/personal-server-ts-core 0.0.1-canary.052d47e → 0.0.1-canary.0620a9a
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/index.d.ts +192 -8
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1227 -153
- package/dist/api/index.js.map +1 -1
- 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/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/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 +70 -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 +320 -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.map +1 -1
- package/dist/contracts/sync.js +1 -0
- 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 +68 -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 +86 -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/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/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 +38 -0
- package/dist/legacy-projection/index.d.ts.map +1 -0
- package/dist/legacy-projection/index.js +231 -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/mcp/approval-url.d.ts +68 -0
- package/dist/mcp/approval-url.d.ts.map +1 -0
- package/dist/mcp/approval-url.js +95 -0
- package/dist/mcp/approval-url.js.map +1 -0
- package/dist/mcp/connection-api.d.ts +187 -3
- package/dist/mcp/connection-api.d.ts.map +1 -1
- package/dist/mcp/connection-api.js +600 -26
- package/dist/mcp/connection-api.js.map +1 -1
- package/dist/mcp/grantee.d.ts +1 -1
- package/dist/mcp/grantee.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +4 -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 +5 -1
- package/dist/mcp/read-client.d.ts.map +1 -1
- package/dist/mcp/read-client.js +18 -4
- package/dist/mcp/read-client.js.map +1 -1
- package/dist/mcp/resources.d.ts.map +1 -1
- package/dist/mcp/resources.js +3 -0
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/server.d.ts +30 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +172 -17
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +1 -1
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +17 -3
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/store.d.ts +10 -1
- package/dist/mcp/store.d.ts.map +1 -1
- package/dist/mcp/store.js +72 -0
- 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 +92 -3
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +513 -28
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/types.d.ts +103 -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 +315 -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 +16 -0
- package/dist/policy/reserved-scopes.js.map +1 -0
- package/dist/ports/index.d.ts +266 -5
- 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 +109 -0
- package/dist/publication/publish.d.ts.map +1 -0
- package/dist/publication/publish.js +263 -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 +71 -0
- package/dist/schemas/server-config.d.ts.map +1 -1
- package/dist/schemas/server-config.js +151 -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 +21 -1
- 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/sdk.d.ts +2 -1
- package/dist/storage/adapters/sdk.d.ts.map +1 -1
- package/dist/storage/adapters/sdk.js +21 -3
- package/dist/storage/adapters/sdk.js.map +1 -1
- package/dist/storage/adapters/vana-audience.d.ts +24 -0
- package/dist/storage/adapters/vana-audience.d.ts.map +1 -0
- package/dist/storage/adapters/vana-audience.js +87 -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 +69 -23
- 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 +30 -3
- 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 +206 -0
- package/dist/storage/legacy-scope-view.d.ts.map +1 -0
- package/dist/storage/legacy-scope-view.js +1061 -0
- package/dist/storage/legacy-scope-view.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 +202 -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 +31 -0
- package/dist/stream-sync/artifacts.d.ts.map +1 -0
- package/dist/stream-sync/artifacts.js +106 -0
- package/dist/stream-sync/artifacts.js.map +1 -0
- package/dist/stream-sync/blobs.d.ts +11 -0
- package/dist/stream-sync/blobs.d.ts.map +1 -0
- package/dist/stream-sync/blobs.js +34 -0
- package/dist/stream-sync/blobs.js.map +1 -0
- package/dist/stream-sync/crypto.d.ts +21 -0
- package/dist/stream-sync/crypto.d.ts.map +1 -0
- package/dist/stream-sync/crypto.js +45 -0
- package/dist/stream-sync/crypto.js.map +1 -0
- package/dist/stream-sync/home.d.ts +46 -0
- package/dist/stream-sync/home.d.ts.map +1 -0
- package/dist/stream-sync/home.js +37 -0
- package/dist/stream-sync/home.js.map +1 -0
- package/dist/stream-sync/index.d.ts +14 -0
- package/dist/stream-sync/index.d.ts.map +1 -0
- package/dist/stream-sync/index.js +14 -0
- package/dist/stream-sync/index.js.map +1 -0
- package/dist/stream-sync/intake.d.ts +165 -0
- package/dist/stream-sync/intake.d.ts.map +1 -0
- package/dist/stream-sync/intake.js +467 -0
- package/dist/stream-sync/intake.js.map +1 -0
- package/dist/stream-sync/io-barrier.d.ts +39 -0
- package/dist/stream-sync/io-barrier.d.ts.map +1 -0
- package/dist/stream-sync/io-barrier.js +130 -0
- package/dist/stream-sync/io-barrier.js.map +1 -0
- package/dist/stream-sync/memory-files.d.ts +6 -0
- package/dist/stream-sync/memory-files.d.ts.map +1 -0
- package/dist/stream-sync/memory-files.js +50 -0
- package/dist/stream-sync/memory-files.js.map +1 -0
- package/dist/stream-sync/ports.d.ts +134 -0
- package/dist/stream-sync/ports.d.ts.map +1 -0
- package/dist/stream-sync/ports.js +26 -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 +212 -0
- package/dist/stream-sync/publish-plan.js.map +1 -0
- package/dist/stream-sync/registry.d.ts +19 -0
- package/dist/stream-sync/registry.d.ts.map +1 -0
- package/dist/stream-sync/registry.js +125 -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/spool.d.ts +69 -0
- package/dist/stream-sync/spool.d.ts.map +1 -0
- package/dist/stream-sync/spool.js +197 -0
- package/dist/stream-sync/spool.js.map +1 -0
- package/dist/stream-sync/writer-overlay.d.ts +19 -0
- package/dist/stream-sync/writer-overlay.d.ts.map +1 -0
- package/dist/stream-sync/writer-overlay.js +55 -0
- package/dist/stream-sync/writer-overlay.js.map +1 -0
- package/dist/stream-sync/writer.d.ts +404 -0
- package/dist/stream-sync/writer.d.ts.map +1 -0
- package/dist/stream-sync/writer.js +1994 -0
- package/dist/stream-sync/writer.js.map +1 -0
- package/dist/stream-sync-read/fold.d.ts +69 -0
- package/dist/stream-sync-read/fold.d.ts.map +1 -0
- package/dist/stream-sync-read/fold.js +83 -0
- package/dist/stream-sync-read/fold.js.map +1 -0
- package/dist/stream-sync-read/importer.d.ts +81 -0
- package/dist/stream-sync-read/importer.d.ts.map +1 -0
- package/dist/stream-sync-read/importer.js +226 -0
- package/dist/stream-sync-read/importer.js.map +1 -0
- package/dist/stream-sync-read/index.d.ts +8 -0
- package/dist/stream-sync-read/index.d.ts.map +1 -0
- package/dist/stream-sync-read/index.js +5 -0
- package/dist/stream-sync-read/index.js.map +1 -0
- package/dist/stream-sync-read/keys.d.ts +16 -0
- package/dist/stream-sync-read/keys.d.ts.map +1 -0
- package/dist/stream-sync-read/keys.js +48 -0
- package/dist/stream-sync-read/keys.js.map +1 -0
- package/dist/stream-sync-read/lines.d.ts +37 -0
- package/dist/stream-sync-read/lines.d.ts.map +1 -0
- package/dist/stream-sync-read/lines.js +98 -0
- package/dist/stream-sync-read/lines.js.map +1 -0
- package/dist/stream-sync-read/memory-files.d.ts +6 -0
- package/dist/stream-sync-read/memory-files.d.ts.map +1 -0
- package/dist/stream-sync-read/memory-files.js +34 -0
- package/dist/stream-sync-read/memory-files.js.map +1 -0
- package/dist/stream-sync-read/mirror.d.ts +80 -0
- package/dist/stream-sync-read/mirror.d.ts.map +1 -0
- package/dist/stream-sync-read/mirror.js +189 -0
- package/dist/stream-sync-read/mirror.js.map +1 -0
- package/dist/stream-sync-read/ports.d.ts +155 -0
- package/dist/stream-sync-read/ports.d.ts.map +1 -0
- package/dist/stream-sync-read/ports.js +9 -0
- package/dist/stream-sync-read/ports.js.map +1 -0
- package/dist/stream-sync-read/projection.d.ts +47 -0
- package/dist/stream-sync-read/projection.d.ts.map +1 -0
- package/dist/stream-sync-read/projection.js +338 -0
- package/dist/stream-sync-read/projection.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-fixture.d.ts +94 -0
- package/dist/stream-sync-read/service-fixture.d.ts.map +1 -0
- package/dist/stream-sync-read/service-fixture.js +227 -0
- package/dist/stream-sync-read/service-fixture.js.map +1 -0
- package/dist/stream-sync-read/service.d.ts +260 -0
- package/dist/stream-sync-read/service.d.ts.map +1 -0
- package/dist/stream-sync-read/service.js +975 -0
- package/dist/stream-sync-read/service.js.map +1 -0
- package/dist/stream-sync-read/testing.d.ts +54 -0
- package/dist/stream-sync-read/testing.d.ts.map +1 -0
- package/dist/stream-sync-read/testing.js +80 -0
- package/dist/stream-sync-read/testing.js.map +1 -0
- package/dist/stream-sync-read/view-store.d.ts +98 -0
- package/dist/stream-sync-read/view-store.d.ts.map +1 -0
- package/dist/stream-sync-read/view-store.js +278 -0
- package/dist/stream-sync-read/view-store.js.map +1 -0
- package/dist/stream-sync-read/writer-rig.d.ts +122 -0
- package/dist/stream-sync-read/writer-rig.d.ts.map +1 -0
- package/dist/stream-sync-read/writer-rig.js +301 -0
- package/dist/stream-sync-read/writer-rig.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/sync-manager.d.ts +21 -1
- package/dist/sync/engine/sync-manager.d.ts.map +1 -1
- package/dist/sync/engine/sync-manager.js +140 -11
- package/dist/sync/engine/sync-manager.js.map +1 -1
- package/dist/sync/index.d.ts +6 -2
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +7 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/pdpp-import.d.ts +192 -0
- package/dist/sync/pdpp-import.d.ts.map +1 -0
- package/dist/sync/pdpp-import.js +441 -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 +10 -0
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/workers/delete.d.ts +54 -5
- package/dist/sync/workers/delete.d.ts.map +1 -1
- package/dist/sync/workers/delete.js +594 -170
- package/dist/sync/workers/delete.js.map +1 -1
- package/dist/sync/workers/download.d.ts +42 -1
- package/dist/sync/workers/download.d.ts.map +1 -1
- package/dist/sync/workers/download.js +344 -24
- 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 +27 -6
- package/dist/sync/workers/upload.d.ts.map +1 -1
- package/dist/sync/workers/upload.js +169 -274
- package/dist/sync/workers/upload.js.map +1 -1
- package/dist/test-utils/memory-storage.d.ts +1 -1
- package/dist/test-utils/memory-storage.d.ts.map +1 -1
- package/dist/test-utils/memory-storage.js +83 -17
- 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/package.json +103 -3
|
@@ -0,0 +1,755 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serve legacy scope bodies from stored PDPP records.
|
|
3
|
+
*
|
|
4
|
+
* PDPP connectors store one envelope per stream, body `{records: [row, …]}`,
|
|
5
|
+
* under `<source>.<stream>`. Apps that predate PDPP read legacy bodies such
|
|
6
|
+
* as `chatgpt.conversations` = `{conversations, total}`. `withLegacyProjection`
|
|
7
|
+
* wraps the raw storage port: when the latest stored body of a projected
|
|
8
|
+
* scope is `{records}`, reads return the legacy body projected from that
|
|
9
|
+
* stream and its sibling streams. Legacy-shaped bodies are served as stored;
|
|
10
|
+
* raw bodies that cannot be projected fail the served read. Writes, listings
|
|
11
|
+
* and the sync-facing methods pass through.
|
|
12
|
+
*
|
|
13
|
+
* Give the wrapped ("served") port to every reader of data: the HTTP data
|
|
14
|
+
* route, MCP, derivatives and the job worker. Give the raw port to sync
|
|
15
|
+
* upload/download, so canonical bytes (and their hashes) never change.
|
|
16
|
+
*/
|
|
17
|
+
import { alternateLegacyBindingsForScope, LEGACY_SCOPE_BINDINGS, projectPdppRecordsToLegacyPayload, } from "../legacy-projection/index.js";
|
|
18
|
+
import { ProtocolError } from "../errors/catalog.js";
|
|
19
|
+
import { isBinaryEnvelope } from "../contracts/binary.js";
|
|
20
|
+
import { buildDataBlocksAsync } from "./blocks/build.js";
|
|
21
|
+
import { readBuiltScopeBlocks } from "./blocks/page.js";
|
|
22
|
+
import { previewEnvelopeValue } from "./preview.js";
|
|
23
|
+
/** Keys the server stamps into `data`; they are not part of the body. */
|
|
24
|
+
const SERVER_STAMP_KEYS = new Set([
|
|
25
|
+
"$writtenBy",
|
|
26
|
+
"$lineage",
|
|
27
|
+
]);
|
|
28
|
+
export function classifyStoredBody(scope, data) {
|
|
29
|
+
if (!isRecordsBody(data))
|
|
30
|
+
return "legacy";
|
|
31
|
+
return isProjectedScope(scope) && !data.records.some(isTaggedRecord)
|
|
32
|
+
? "pdpp-projected"
|
|
33
|
+
: "pdpp-unprojected";
|
|
34
|
+
}
|
|
35
|
+
const SERVED = Symbol.for("personal-server-ts.legacy-projection.served");
|
|
36
|
+
/** A served port's own projected view of one stored version, for supersede. */
|
|
37
|
+
const PROJECTED_VIEW = Symbol.for("personal-server-ts.legacy-projection.projected-view");
|
|
38
|
+
/** How many stored versions' body forms one served port remembers. */
|
|
39
|
+
const FORM_CACHE_SIZE = 64;
|
|
40
|
+
const textEncoder = new TextEncoder();
|
|
41
|
+
/**
|
|
42
|
+
* Wrap a raw storage port so reads of projected scopes return legacy bodies.
|
|
43
|
+
* Wrapping an already wrapped port returns it unchanged.
|
|
44
|
+
*/
|
|
45
|
+
export function withLegacyProjection(raw, options = {}) {
|
|
46
|
+
if (raw[SERVED])
|
|
47
|
+
return raw;
|
|
48
|
+
// One entry, keyed by the versions of every input. It saves re-projecting
|
|
49
|
+
// on repeated reads of the same data; it is not a persistent cache.
|
|
50
|
+
let memo = null;
|
|
51
|
+
// Classification is safe to reuse only for the same immutable stored
|
|
52
|
+
// version. The requested version is classified before the projection cache.
|
|
53
|
+
const forms = new Map();
|
|
54
|
+
const rememberForm = (key, value) => {
|
|
55
|
+
forms.set(key, value);
|
|
56
|
+
if (forms.size > FORM_CACHE_SIZE) {
|
|
57
|
+
forms.delete(forms.keys().next().value);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
function failProjection(scope, collectedAt, error) {
|
|
61
|
+
options.onIssue?.({ kind: "projection_failed", scope, collectedAt, error });
|
|
62
|
+
throw new ProtocolError(409, "LEGACY_PROJECTION_UNAVAILABLE", `Cannot serve the legacy view for scope "${scope}"`, {
|
|
63
|
+
scope,
|
|
64
|
+
collectedAt,
|
|
65
|
+
reason: "reason" in error ? error.reason : error.kind,
|
|
66
|
+
projectionError: error.kind,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The projected view of a stored version, or null when it is served as
|
|
71
|
+
* stored. `own` is the stored envelope when it had to be read to decide.
|
|
72
|
+
*/
|
|
73
|
+
async function resolve(scope, collectedAt) {
|
|
74
|
+
if (!isProjectedScope(scope))
|
|
75
|
+
return { view: null };
|
|
76
|
+
const requestedEntry = raw.findEntry({ scope, at: collectedAt });
|
|
77
|
+
const ownVersion = requestedEntry
|
|
78
|
+
? `${requestedEntry.id}@${requestedEntry.collectedAt}`
|
|
79
|
+
: `unindexed@${collectedAt}`;
|
|
80
|
+
const formKey = JSON.stringify([scope, ownVersion]);
|
|
81
|
+
let cached = forms.get(formKey);
|
|
82
|
+
let own;
|
|
83
|
+
if (!cached) {
|
|
84
|
+
own = await raw.readEnvelope(scope, collectedAt);
|
|
85
|
+
const form = classifyStoredBody(scope, own.data);
|
|
86
|
+
cached = {
|
|
87
|
+
form,
|
|
88
|
+
...(form === "pdpp-projected"
|
|
89
|
+
? {
|
|
90
|
+
selected: selectProjectionBinding(scope, own.data.records),
|
|
91
|
+
}
|
|
92
|
+
: {}),
|
|
93
|
+
};
|
|
94
|
+
rememberForm(formKey, cached);
|
|
95
|
+
}
|
|
96
|
+
if (cached.form === "legacy")
|
|
97
|
+
return { view: null, own };
|
|
98
|
+
if (cached.form === "pdpp-unprojected") {
|
|
99
|
+
failProjection(scope, collectedAt, {
|
|
100
|
+
kind: "incomplete_scope",
|
|
101
|
+
scope,
|
|
102
|
+
reason: "Stored records are not rows of one stream",
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (!cached.selected) {
|
|
106
|
+
failProjection(scope, collectedAt, {
|
|
107
|
+
kind: "incomplete_scope",
|
|
108
|
+
scope,
|
|
109
|
+
reason: "Stored records do not identify one compatible connector profile",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const { binding, profileKey } = cached.selected;
|
|
113
|
+
const source = scope.slice(0, scope.indexOf("."));
|
|
114
|
+
// The latest version joins the latest siblings, whatever order one run
|
|
115
|
+
// wrote its streams in. A historical version joins, of the sibling
|
|
116
|
+
// versions written before the next version of `scope`, the one nearest
|
|
117
|
+
// in time: the one its own run wrote, before or after it.
|
|
118
|
+
const supersededAt = nextVersionTime(raw, scope, collectedAt);
|
|
119
|
+
const inputs = binding.pdppStreams.map((stream) => {
|
|
120
|
+
const canonicalScope = `${source}.${stream}`;
|
|
121
|
+
// For a single-stream alias, prefer the exact requested version when
|
|
122
|
+
// it exists. This keeps alias writes, body classification and cursors
|
|
123
|
+
// tied to the version the caller asked to read.
|
|
124
|
+
let storedScope = binding.pdppStreams.length === 1 && requestedEntry
|
|
125
|
+
? scope
|
|
126
|
+
: canonicalScope;
|
|
127
|
+
let entry = storedScope === scope
|
|
128
|
+
? requestedEntry
|
|
129
|
+
: supersededAt === undefined
|
|
130
|
+
? raw.findEntry({ scope: storedScope })
|
|
131
|
+
: nearestBefore(raw, storedScope, collectedAt, supersededAt);
|
|
132
|
+
// Some PDPP streams have a legacy scope alias (for example,
|
|
133
|
+
// youtube.history -> youtube.watch_history). Lite stores the stream
|
|
134
|
+
// envelope under that alias, so use it as the single stream input when
|
|
135
|
+
// no canonical stream-scope entry exists.
|
|
136
|
+
if (!entry && binding.pdppStreams.length === 1 && storedScope !== scope) {
|
|
137
|
+
storedScope = scope;
|
|
138
|
+
entry = requestedEntry;
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
stream,
|
|
142
|
+
storedScope,
|
|
143
|
+
collectedAt: storedScope === scope ? collectedAt : entry?.collectedAt,
|
|
144
|
+
// The index row id changes when a version is deleted and written
|
|
145
|
+
// again under the same collectedAt, so it identifies the content.
|
|
146
|
+
version: entry ? `${entry.id}@${entry.collectedAt}` : null,
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
const key = JSON.stringify([
|
|
150
|
+
scope,
|
|
151
|
+
ownVersion,
|
|
152
|
+
profileKey,
|
|
153
|
+
inputs.map(({ storedScope, version }) => [storedScope, version]),
|
|
154
|
+
]);
|
|
155
|
+
if (memo?.key === key)
|
|
156
|
+
return { view: memo.value, own };
|
|
157
|
+
own ??= await raw.readEnvelope(scope, collectedAt);
|
|
158
|
+
const value = await project(scope, collectedAt, own, inputs, binding, profileKey);
|
|
159
|
+
if (value)
|
|
160
|
+
value.view = key;
|
|
161
|
+
memo = { key, value };
|
|
162
|
+
return { view: value, own };
|
|
163
|
+
}
|
|
164
|
+
async function projected(scope, collectedAt) {
|
|
165
|
+
return (await resolve(scope, collectedAt)).view;
|
|
166
|
+
}
|
|
167
|
+
async function projectedForSupersede(scope, collectedAt) {
|
|
168
|
+
try {
|
|
169
|
+
return await projected(scope, collectedAt);
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
if (error instanceof ProtocolError &&
|
|
173
|
+
error.errorCode === "LEGACY_PROJECTION_UNAVAILABLE") {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async function project(scope, collectedAt, own, inputs, binding, profileKey) {
|
|
180
|
+
const records = [];
|
|
181
|
+
const fetchedStreams = [];
|
|
182
|
+
// The projection time is the newest input version, so the same stored
|
|
183
|
+
// data always projects to the same bytes.
|
|
184
|
+
let now = collectedAt;
|
|
185
|
+
for (const input of inputs) {
|
|
186
|
+
if (!input.collectedAt)
|
|
187
|
+
continue;
|
|
188
|
+
const envelope = input.storedScope === scope
|
|
189
|
+
? own
|
|
190
|
+
: await raw.readEnvelope(input.storedScope, input.collectedAt);
|
|
191
|
+
if (classifyStoredBody(input.storedScope, envelope.data) === "legacy") {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const rows = envelope.data
|
|
195
|
+
.records;
|
|
196
|
+
if (rows.some(isTaggedRecord))
|
|
197
|
+
continue;
|
|
198
|
+
fetchedStreams.push(input.stream);
|
|
199
|
+
if (Date.parse(input.collectedAt) > Date.parse(now)) {
|
|
200
|
+
now = input.collectedAt;
|
|
201
|
+
}
|
|
202
|
+
for (const row of rows) {
|
|
203
|
+
records.push({ stream: input.stream, data: row });
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (!recordsMatchBindingSource(records, binding, alternateLegacyBindingsForScope(scope).size > 0 &&
|
|
207
|
+
!(UNTAGGED_ORIGINAL_SCOPES.has(scope) && profileKey === undefined))) {
|
|
208
|
+
failProjection(scope, collectedAt, {
|
|
209
|
+
kind: "incomplete_scope",
|
|
210
|
+
scope,
|
|
211
|
+
reason: "Joined streams have conflicting connector identities",
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
// Connector identity is storage metadata, not part of an app's legacy row.
|
|
215
|
+
const projectionRecords = records.map((record) => {
|
|
216
|
+
const data = { ...record.data };
|
|
217
|
+
delete data.$pdpp;
|
|
218
|
+
return { ...record, data };
|
|
219
|
+
});
|
|
220
|
+
const result = projectPdppRecordsToLegacyPayload(scope, projectionRecords, {
|
|
221
|
+
fetchedStreams,
|
|
222
|
+
now,
|
|
223
|
+
...(profileKey ? { profileKey } : {}),
|
|
224
|
+
orderByPrimaryKey: binding.rowOrder !== "arrival",
|
|
225
|
+
allowMissingJoinStreams: true,
|
|
226
|
+
});
|
|
227
|
+
if (!result.ok) {
|
|
228
|
+
failProjection(scope, collectedAt, result.error);
|
|
229
|
+
}
|
|
230
|
+
if (result.diagnostics?.length) {
|
|
231
|
+
options.onIssue?.({
|
|
232
|
+
kind: "projection_diagnostics",
|
|
233
|
+
scope,
|
|
234
|
+
collectedAt,
|
|
235
|
+
diagnostics: result.diagnostics,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
// Server stamps signed the stored records, not this view, so they are
|
|
239
|
+
// not carried over. `?view=stored` returns them with the stored body.
|
|
240
|
+
const envelope = { ...own, data: result.payload };
|
|
241
|
+
return {
|
|
242
|
+
envelope,
|
|
243
|
+
bytes: textEncoder.encode(JSON.stringify(envelope)),
|
|
244
|
+
...(result.diagnostics?.length
|
|
245
|
+
? { diagnostics: result.diagnostics }
|
|
246
|
+
: {}),
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
async function builtBlocks(scope, view) {
|
|
250
|
+
view.built ??= await buildDataBlocksAsync({
|
|
251
|
+
scope,
|
|
252
|
+
collectedAt: view.envelope.collectedAt,
|
|
253
|
+
...(typeof view.envelope.schemaId === "string"
|
|
254
|
+
? { schemaId: view.envelope.schemaId }
|
|
255
|
+
: {}),
|
|
256
|
+
content: view.envelope,
|
|
257
|
+
});
|
|
258
|
+
return view.built;
|
|
259
|
+
}
|
|
260
|
+
const overrides = {
|
|
261
|
+
[SERVED]: true,
|
|
262
|
+
[PROJECTED_VIEW]: projectedForSupersede,
|
|
263
|
+
async readEnvelope(scope, collectedAt) {
|
|
264
|
+
const { view, own } = await resolve(scope, collectedAt);
|
|
265
|
+
return view?.envelope ?? own ?? raw.readEnvelope(scope, collectedAt);
|
|
266
|
+
},
|
|
267
|
+
readStoredEnvelope(scope, collectedAt) {
|
|
268
|
+
return raw.readEnvelope(scope, collectedAt);
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
if (raw.readEnvelopeBytes) {
|
|
272
|
+
const rawBytes = raw.readEnvelopeBytes.bind(raw);
|
|
273
|
+
overrides.readEnvelopeBytes = async (scope, collectedAt) => (await projected(scope, collectedAt))?.bytes ??
|
|
274
|
+
rawBytes(scope, collectedAt);
|
|
275
|
+
}
|
|
276
|
+
if (raw.readEnvelopeStream) {
|
|
277
|
+
const rawStream = raw.readEnvelopeStream.bind(raw);
|
|
278
|
+
overrides.readEnvelopeStream = async (scope, collectedAt) => {
|
|
279
|
+
const view = await projected(scope, collectedAt);
|
|
280
|
+
if (!view)
|
|
281
|
+
return rawStream(scope, collectedAt);
|
|
282
|
+
const bytes = view.bytes;
|
|
283
|
+
return new ReadableStream({
|
|
284
|
+
start(controller) {
|
|
285
|
+
controller.enqueue(bytes);
|
|
286
|
+
controller.close();
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
if (raw.readEnvelopePreview) {
|
|
292
|
+
const rawPreview = raw.readEnvelopePreview.bind(raw);
|
|
293
|
+
overrides.readEnvelopePreview = async (scope, collectedAt, previewOpts) => {
|
|
294
|
+
const view = await projected(scope, collectedAt);
|
|
295
|
+
return view
|
|
296
|
+
? previewEnvelopeValue(view.envelope, previewOpts.maxBytes)
|
|
297
|
+
: rawPreview(scope, collectedAt, previewOpts);
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
if (raw.readScopeBlocks) {
|
|
301
|
+
const rawBlocks = raw.readScopeBlocks.bind(raw);
|
|
302
|
+
overrides.readScopeBlocks = async (scope, collectedAt, blockOpts) => {
|
|
303
|
+
const view = await projected(scope, collectedAt);
|
|
304
|
+
return view
|
|
305
|
+
? readBuiltScopeBlocks(await builtBlocks(scope, view), {
|
|
306
|
+
...blockOpts,
|
|
307
|
+
cursorView: view.view,
|
|
308
|
+
})
|
|
309
|
+
: rawBlocks(scope, collectedAt, blockOpts);
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
if (raw.readBlockManifest) {
|
|
313
|
+
const rawManifest = raw.readBlockManifest.bind(raw);
|
|
314
|
+
overrides.readBlockManifest = async (scope, collectedAt) => {
|
|
315
|
+
const view = await projected(scope, collectedAt);
|
|
316
|
+
return view
|
|
317
|
+
? (await builtBlocks(scope, view)).manifest
|
|
318
|
+
: rawManifest(scope, collectedAt);
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
// Inventory inherits raw metadata readiness. Projection belongs to reads.
|
|
322
|
+
if (raw.canReadScopeBlocks) {
|
|
323
|
+
const rawCan = raw.canReadScopeBlocks.bind(raw);
|
|
324
|
+
overrides.canReadScopeBlocks = async (scope, collectedAt) => (await rawCan(scope, collectedAt)) ||
|
|
325
|
+
(await projected(scope, collectedAt)) !== null;
|
|
326
|
+
}
|
|
327
|
+
return new Proxy(raw, {
|
|
328
|
+
get(target, property) {
|
|
329
|
+
if (Object.prototype.hasOwnProperty.call(overrides, property)) {
|
|
330
|
+
return overrides[property];
|
|
331
|
+
}
|
|
332
|
+
const value = Reflect.get(target, property, target);
|
|
333
|
+
return typeof value === "function" ? value.bind(target) : value;
|
|
334
|
+
},
|
|
335
|
+
has(target, property) {
|
|
336
|
+
return (Object.prototype.hasOwnProperty.call(overrides, property) ||
|
|
337
|
+
Reflect.has(target, property));
|
|
338
|
+
},
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* The projected legacy scopes whose served body is built from `scope`'s
|
|
343
|
+
* stored stream, other than `scope` itself: `chatgpt.messages` →
|
|
344
|
+
* `["chatgpt.conversations"]`. Anything that caches a read of a projected
|
|
345
|
+
* scope must treat a change to these streams as a change to it.
|
|
346
|
+
*/
|
|
347
|
+
export function legacyScopesProjectedFrom(scope) {
|
|
348
|
+
const dot = scope.indexOf(".");
|
|
349
|
+
if (dot <= 0)
|
|
350
|
+
return [];
|
|
351
|
+
const source = scope.slice(0, dot);
|
|
352
|
+
const stream = scope.slice(dot + 1);
|
|
353
|
+
return [...LEGACY_SCOPE_BINDINGS.values()]
|
|
354
|
+
.filter((binding) => binding.scope !== scope &&
|
|
355
|
+
binding.scope.startsWith(`${source}.`) &&
|
|
356
|
+
isProjectedScope(binding.scope) &&
|
|
357
|
+
binding.pdppStreams.includes(stream))
|
|
358
|
+
.map((binding) => binding.scope);
|
|
359
|
+
}
|
|
360
|
+
function isProjectedScope(scope) {
|
|
361
|
+
return LEGACY_SCOPE_BINDINGS.has(scope);
|
|
362
|
+
}
|
|
363
|
+
/** Scopes whose untagged stored rows keep the original binding. */
|
|
364
|
+
const UNTAGGED_ORIGINAL_SCOPES = new Set([
|
|
365
|
+
"claude.conversations",
|
|
366
|
+
"strava.activities",
|
|
367
|
+
]);
|
|
368
|
+
function selectProjectionBinding(scope, rows) {
|
|
369
|
+
const original = LEGACY_SCOPE_BINDINGS.get(scope);
|
|
370
|
+
const alternates = alternateLegacyBindingsForScope(scope);
|
|
371
|
+
const identities = rows.map(recordSourceId);
|
|
372
|
+
if (identities.includes(null))
|
|
373
|
+
return null;
|
|
374
|
+
// Before live-session admission, stored Claude export rows did not require
|
|
375
|
+
// identity tags. Keep that persisted contract tied to the original binding,
|
|
376
|
+
// whose account_profile join is still required. Never infer a live profile.
|
|
377
|
+
// Strava rows predate strava-browser too; both of its profiles are the
|
|
378
|
+
// same identity projection, so the original binding serves them unchanged.
|
|
379
|
+
if (UNTAGGED_ORIGINAL_SCOPES.has(scope) &&
|
|
380
|
+
identities.every((identity) => identity === undefined)) {
|
|
381
|
+
return { binding: original };
|
|
382
|
+
}
|
|
383
|
+
if (alternates.size > 0 && identities.includes(undefined))
|
|
384
|
+
return null;
|
|
385
|
+
const sources = new Set(identities.filter((id) => !!id));
|
|
386
|
+
if (sources.size > 1)
|
|
387
|
+
return null;
|
|
388
|
+
if (sources.size === 0) {
|
|
389
|
+
return alternates.size === 0 ? { binding: original } : null;
|
|
390
|
+
}
|
|
391
|
+
const sourceId = [...sources][0];
|
|
392
|
+
const connectorKey = sourceId.slice(sourceId.lastIndexOf("/") + 1);
|
|
393
|
+
const alternate = alternates.get(connectorKey);
|
|
394
|
+
if (alternate && sourceIdForBinding(alternate) === sourceId) {
|
|
395
|
+
return { binding: alternate, profileKey: connectorKey };
|
|
396
|
+
}
|
|
397
|
+
return sourceIdForBinding(original) === sourceId
|
|
398
|
+
? { binding: original }
|
|
399
|
+
: null;
|
|
400
|
+
}
|
|
401
|
+
function recordSourceId(data) {
|
|
402
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
if (!("$pdpp" in data))
|
|
406
|
+
return undefined;
|
|
407
|
+
const metadata = data.$pdpp;
|
|
408
|
+
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) {
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
411
|
+
const sourceId = metadata.sourceId;
|
|
412
|
+
return typeof sourceId === "string" && sourceId ? sourceId : null;
|
|
413
|
+
}
|
|
414
|
+
function sourceIdForBinding(binding) {
|
|
415
|
+
return binding.pdppSource.replace("/connectors/", "/sources/");
|
|
416
|
+
}
|
|
417
|
+
function recordsMatchBindingSource(records, binding, requireIdentity) {
|
|
418
|
+
const expected = sourceIdForBinding(binding);
|
|
419
|
+
return records.every(({ data }) => {
|
|
420
|
+
const actual = recordSourceId(data);
|
|
421
|
+
return actual === expected || (!requireIdentity && actual === undefined);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
const VERSION_PAGE_SIZE = 100;
|
|
425
|
+
/** Versions of `scope`, newest first, until `stop` returns true. */
|
|
426
|
+
function walkVersions(raw, scope, stop) {
|
|
427
|
+
for (let offset = 0;; offset += VERSION_PAGE_SIZE) {
|
|
428
|
+
const page = raw.listVersions(scope, { limit: VERSION_PAGE_SIZE, offset });
|
|
429
|
+
const found = page.find(stop);
|
|
430
|
+
if (found || page.length < VERSION_PAGE_SIZE)
|
|
431
|
+
return found;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* When the version of `scope` after the one at `collectedAt` was collected,
|
|
436
|
+
* or undefined when that version is the latest (or not indexed).
|
|
437
|
+
*/
|
|
438
|
+
function nextVersionTime(raw, scope, collectedAt) {
|
|
439
|
+
const at = Date.parse(collectedAt);
|
|
440
|
+
const latest = raw.findEntry({ scope });
|
|
441
|
+
if (!latest || !(Date.parse(latest.collectedAt) > at))
|
|
442
|
+
return undefined;
|
|
443
|
+
let next = Date.parse(latest.collectedAt);
|
|
444
|
+
walkVersions(raw, scope, (entry) => {
|
|
445
|
+
const time = Date.parse(entry.collectedAt);
|
|
446
|
+
if (time > at)
|
|
447
|
+
next = time;
|
|
448
|
+
return !(time > at);
|
|
449
|
+
});
|
|
450
|
+
return next;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* The version of `scope` collected nearest to `collectedAt`, among those
|
|
454
|
+
* collected before `bound` (epoch ms).
|
|
455
|
+
*/
|
|
456
|
+
function nearestBefore(raw, scope, collectedAt, bound) {
|
|
457
|
+
const at = Date.parse(collectedAt);
|
|
458
|
+
// Newest first: remember the last version after `at`, stop at the first
|
|
459
|
+
// one at or before it, and take whichever of the two is nearer.
|
|
460
|
+
let after;
|
|
461
|
+
const notAfter = walkVersions(raw, scope, (entry) => {
|
|
462
|
+
const time = Date.parse(entry.collectedAt);
|
|
463
|
+
if (time > at) {
|
|
464
|
+
if (time < bound)
|
|
465
|
+
after = entry;
|
|
466
|
+
return false;
|
|
467
|
+
}
|
|
468
|
+
return true;
|
|
469
|
+
});
|
|
470
|
+
if (!after || !notAfter)
|
|
471
|
+
return after ?? notAfter;
|
|
472
|
+
return Date.parse(after.collectedAt) - at <
|
|
473
|
+
at - Date.parse(notAfter.collectedAt)
|
|
474
|
+
? after
|
|
475
|
+
: notAfter;
|
|
476
|
+
}
|
|
477
|
+
/** A `{stream, data}` row: a record tagged with its stream, not a stream row. */
|
|
478
|
+
function isTaggedRecord(row) {
|
|
479
|
+
if (row === null || typeof row !== "object" || Array.isArray(row)) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
const { stream, data } = row;
|
|
483
|
+
return (typeof stream === "string" &&
|
|
484
|
+
data !== null &&
|
|
485
|
+
typeof data === "object" &&
|
|
486
|
+
!Array.isArray(data));
|
|
487
|
+
}
|
|
488
|
+
function isRecordsBody(data) {
|
|
489
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
const keys = Object.keys(data).filter((key) => !SERVER_STAMP_KEYS.has(key));
|
|
493
|
+
return (keys.length === 1 &&
|
|
494
|
+
keys[0] === "records" &&
|
|
495
|
+
Array.isArray(data.records));
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* After a `{records}` version of a projected scope is committed, delete the
|
|
499
|
+
* scope's older owner-written legacy versions: the new version serves the
|
|
500
|
+
* same legacy view, so they are a second copy. This explicit supersede path
|
|
501
|
+
* remains available only for the original ChatGPT and Claude sources. Other
|
|
502
|
+
* bound sources retain legacy versions and replace them only in the read view.
|
|
503
|
+
*
|
|
504
|
+
* It deletes nothing unless `storage` is a served port (see
|
|
505
|
+
* `withLegacyProjection`) whose projection of the new version is complete:
|
|
506
|
+
* no join stream missing and no row left out. It also deletes nothing when
|
|
507
|
+
* the projection holds fewer items than a legacy version, or lacks
|
|
508
|
+
* any item identity that version holds, so an empty or time-windowed run cannot
|
|
509
|
+
* replace a full history. For Claude scopes it also deletes nothing when an
|
|
510
|
+
* item holds fewer nested messages or documents than the legacy item. A legacy version must carry the scope's legacy
|
|
511
|
+
* collection key (`conversations` for `chatgpt.conversations`); PDPP
|
|
512
|
+
* versions, other bodies, binary uploads, versions a builder wrote
|
|
513
|
+
* (`$writtenBy`) and newer versions are kept.
|
|
514
|
+
*
|
|
515
|
+
* Local only: the deletes are not sent to the gateway. Copies that sync
|
|
516
|
+
* already uploaded, and copies other replicas already downloaded, remain.
|
|
517
|
+
*/
|
|
518
|
+
export async function supersedeLegacyVersions(storage, scope, committedAt) {
|
|
519
|
+
const refuse = (refused) => ({
|
|
520
|
+
superseded: [],
|
|
521
|
+
refused,
|
|
522
|
+
});
|
|
523
|
+
if (scope.startsWith("youtube.")) {
|
|
524
|
+
return refuse("YouTube legacy versions are retained for read-time projection");
|
|
525
|
+
}
|
|
526
|
+
if (isProjectedScope(scope) &&
|
|
527
|
+
!scope.startsWith("chatgpt.") &&
|
|
528
|
+
!scope.startsWith("claude.")) {
|
|
529
|
+
return refuse("Legacy versions are retained for read-time projection");
|
|
530
|
+
}
|
|
531
|
+
const readStored = (storage.readStoredEnvelope ?? storage.readEnvelope).bind(storage);
|
|
532
|
+
const committed = await readStored(scope, committedAt);
|
|
533
|
+
if (classifyStoredBody(scope, committed.data) !== "pdpp-projected") {
|
|
534
|
+
return refuse("the new version is not PDPP records of a projected scope");
|
|
535
|
+
}
|
|
536
|
+
const projectedView = storage[PROJECTED_VIEW];
|
|
537
|
+
const view = projectedView ? await projectedView(scope, committedAt) : null;
|
|
538
|
+
if (!view)
|
|
539
|
+
return refuse("the new version cannot be projected");
|
|
540
|
+
if (view.diagnostics?.length) {
|
|
541
|
+
const kinds = [...new Set(view.diagnostics.map((d) => d.kind))];
|
|
542
|
+
return refuse(`the projection is partial (${kinds.join(", ")})`);
|
|
543
|
+
}
|
|
544
|
+
const collection = legacyCollectionKey(scope);
|
|
545
|
+
if (!collection) {
|
|
546
|
+
return refuse(`the legacy collection for ${scope} is unsupported`);
|
|
547
|
+
}
|
|
548
|
+
const projectedItems = view.envelope.data[collection];
|
|
549
|
+
const projectedCount = projectedItems.length;
|
|
550
|
+
const committedMs = Date.parse(committedAt);
|
|
551
|
+
const older = [];
|
|
552
|
+
const pageSize = 100;
|
|
553
|
+
for (let offset = 0;; offset += pageSize) {
|
|
554
|
+
const page = storage.listVersions(scope, { limit: pageSize, offset });
|
|
555
|
+
for (const entry of page) {
|
|
556
|
+
// Compare instants, not strings: "…00.500Z" sorts before "…00Z".
|
|
557
|
+
if (Date.parse(entry.collectedAt) < committedMs) {
|
|
558
|
+
older.push(entry.collectedAt);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
if (page.length < pageSize)
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
const legacy = [];
|
|
565
|
+
for (const collectedAt of older) {
|
|
566
|
+
const envelope = await readStored(scope, collectedAt);
|
|
567
|
+
// A binary upload under the scope is not a legacy body.
|
|
568
|
+
if (isBinaryEnvelope(envelope))
|
|
569
|
+
continue;
|
|
570
|
+
const items = legacyCollection(scope, envelope.data);
|
|
571
|
+
if (items === null)
|
|
572
|
+
continue;
|
|
573
|
+
legacy.push({
|
|
574
|
+
collectedAt,
|
|
575
|
+
count: items.length,
|
|
576
|
+
items,
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
const newest = legacy.reduce((best, version) => !best || Date.parse(version.collectedAt) > Date.parse(best.collectedAt)
|
|
580
|
+
? version
|
|
581
|
+
: best, undefined);
|
|
582
|
+
const projectedCounts = new Map();
|
|
583
|
+
for (const item of projectedItems) {
|
|
584
|
+
const identity = itemIdentity(scope, item);
|
|
585
|
+
if (!identity)
|
|
586
|
+
continue;
|
|
587
|
+
projectedCounts.set(identity, (projectedCounts.get(identity) ?? 0) + 1);
|
|
588
|
+
}
|
|
589
|
+
for (const version of legacy) {
|
|
590
|
+
const versionLabel = version === newest ? "the newest legacy version" : "a legacy version";
|
|
591
|
+
if (projectedCount < version.count) {
|
|
592
|
+
return refuse(`the projection has ${projectedCount} ${collection}; ${versionLabel} has ${version.count}`);
|
|
593
|
+
}
|
|
594
|
+
const requiredCounts = new Map();
|
|
595
|
+
for (const item of version.items) {
|
|
596
|
+
const identity = itemIdentity(scope, item);
|
|
597
|
+
if (!identity) {
|
|
598
|
+
return refuse(`a legacy ${collection} item has no provable identity`);
|
|
599
|
+
}
|
|
600
|
+
requiredCounts.set(identity, (requiredCounts.get(identity) ?? 0) + 1);
|
|
601
|
+
}
|
|
602
|
+
const missing = [...requiredCounts].reduce((count, [identity, required]) => count + Math.max(0, required - (projectedCounts.get(identity) ?? 0)), 0);
|
|
603
|
+
if (missing > 0) {
|
|
604
|
+
return refuse(`the projection lacks ${missing} of the ${collection} in ${versionLabel}`);
|
|
605
|
+
}
|
|
606
|
+
const shortfall = nestedShortfall(scope, version.items, projectedItems);
|
|
607
|
+
if (shortfall)
|
|
608
|
+
return refuse(shortfall);
|
|
609
|
+
}
|
|
610
|
+
const superseded = [];
|
|
611
|
+
for (const { collectedAt } of legacy) {
|
|
612
|
+
if (await storage.deleteVersion(scope, collectedAt)) {
|
|
613
|
+
superseded.push(collectedAt);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return { superseded };
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Nested rows a Claude item holds, per scope. The PDPP rows carry no source
|
|
620
|
+
* count the binding can check them against (a conversation's `message_count`
|
|
621
|
+
* is optional; a project has none), so the projection cannot vouch for them.
|
|
622
|
+
* Compare them with the legacy item instead. ChatGPT is not listed: its
|
|
623
|
+
* binding checks the source count itself, and a shorter current branch there
|
|
624
|
+
* is a reviewed difference.
|
|
625
|
+
*
|
|
626
|
+
* A project also keeps its source `raw_docs`. A raw doc with a uuid must be
|
|
627
|
+
* a projected doc; one without a uuid survives only in `raw_docs`, so it
|
|
628
|
+
* counts as a projected doc too.
|
|
629
|
+
*/
|
|
630
|
+
const NESTED_ITEMS = {
|
|
631
|
+
"claude.conversations": (item) => ({
|
|
632
|
+
held: arrayLength(field(item, "messages")),
|
|
633
|
+
selfShort: false,
|
|
634
|
+
}),
|
|
635
|
+
"youtube.playlistItems": (item) => ({
|
|
636
|
+
held: arrayLength(field(item, "items")),
|
|
637
|
+
selfShort: false,
|
|
638
|
+
}),
|
|
639
|
+
"claude.projects": (item) => {
|
|
640
|
+
const detail = field(item, "detail");
|
|
641
|
+
const rawDocs = field(detail, "raw_docs");
|
|
642
|
+
const raw = Array.isArray(rawDocs) ? rawDocs : [];
|
|
643
|
+
const withId = raw.filter((doc) => typeof field(doc, "uuid") === "string");
|
|
644
|
+
const docs = arrayLength(field(detail, "docs"));
|
|
645
|
+
return {
|
|
646
|
+
held: docs + raw.length - withId.length,
|
|
647
|
+
selfShort: docs < withId.length,
|
|
648
|
+
};
|
|
649
|
+
},
|
|
650
|
+
};
|
|
651
|
+
function field(value, key) {
|
|
652
|
+
return value !== null && typeof value === "object"
|
|
653
|
+
? value[key]
|
|
654
|
+
: undefined;
|
|
655
|
+
}
|
|
656
|
+
function arrayLength(value) {
|
|
657
|
+
return Array.isArray(value) ? value.length : 0;
|
|
658
|
+
}
|
|
659
|
+
/** Why the projection holds fewer nested rows than it should, if so. */
|
|
660
|
+
function nestedShortfall(scope, legacyItems, projectedItems) {
|
|
661
|
+
const nested = NESTED_ITEMS[scope];
|
|
662
|
+
if (!nested)
|
|
663
|
+
return undefined;
|
|
664
|
+
const heldByIdentity = (items) => {
|
|
665
|
+
const held = new Map();
|
|
666
|
+
for (const item of items) {
|
|
667
|
+
const identity = itemIdentity(scope, item);
|
|
668
|
+
if (!identity)
|
|
669
|
+
continue;
|
|
670
|
+
const values = held.get(identity) ?? [];
|
|
671
|
+
values.push(nested(item).held);
|
|
672
|
+
held.set(identity, values);
|
|
673
|
+
}
|
|
674
|
+
for (const values of held.values())
|
|
675
|
+
values.sort((left, right) => right - left);
|
|
676
|
+
return held;
|
|
677
|
+
};
|
|
678
|
+
const legacyHeld = heldByIdentity(legacyItems);
|
|
679
|
+
const projectedHeld = heldByIdentity(projectedItems);
|
|
680
|
+
let short = 0;
|
|
681
|
+
for (const [identity, required] of legacyHeld) {
|
|
682
|
+
const available = projectedHeld.get(identity) ?? [];
|
|
683
|
+
short += required.filter((count, index) => (available[index] ?? 0) < count).length;
|
|
684
|
+
}
|
|
685
|
+
// A project whose own source lists docs the projection lacks.
|
|
686
|
+
const incomplete = projectedItems.filter((item) => nested(item).selfShort);
|
|
687
|
+
const count = short + incomplete.length;
|
|
688
|
+
return count > 0
|
|
689
|
+
? `the projection holds fewer nested rows than the source or a legacy version for ${count} of the ${legacyCollectionKey(scope)}`
|
|
690
|
+
: undefined;
|
|
691
|
+
}
|
|
692
|
+
const LEGACY_COLLECTION_KEYS = {
|
|
693
|
+
"youtube.profile": null,
|
|
694
|
+
"youtube.history": "history",
|
|
695
|
+
"youtube.subscriptions": "subscriptions",
|
|
696
|
+
"youtube.playlists": "playlists",
|
|
697
|
+
"youtube.playlistItems": "playlists",
|
|
698
|
+
"youtube.likes": "likedVideos",
|
|
699
|
+
"youtube.watchLater": "watchLater",
|
|
700
|
+
};
|
|
701
|
+
/** The array a legacy body holds, or null for singleton/unsupported shapes. */
|
|
702
|
+
function legacyCollectionKey(scope) {
|
|
703
|
+
return scope in LEGACY_COLLECTION_KEYS
|
|
704
|
+
? LEGACY_COLLECTION_KEYS[scope]
|
|
705
|
+
: scope.slice(scope.indexOf(".") + 1);
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* The items of an owner-written legacy body of `scope`, or null when the
|
|
709
|
+
* body is not one: it must hold the scope's collection array, must not be
|
|
710
|
+
* PDPP records, and must not carry a builder's `$writtenBy` stamp.
|
|
711
|
+
*/
|
|
712
|
+
function legacyCollection(scope, data) {
|
|
713
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) {
|
|
714
|
+
return null;
|
|
715
|
+
}
|
|
716
|
+
if (isRecordsBody(data) || "$writtenBy" in data)
|
|
717
|
+
return null;
|
|
718
|
+
const collection = legacyCollectionKey(scope);
|
|
719
|
+
if (!collection)
|
|
720
|
+
return null;
|
|
721
|
+
const items = data[collection];
|
|
722
|
+
return Array.isArray(items) ? items : null;
|
|
723
|
+
}
|
|
724
|
+
/** Stable identity fields for scopes whose legacy keys differ from `id`. */
|
|
725
|
+
const IDENTITY_FIELDS = {
|
|
726
|
+
"youtube.history": ["videoId", "videoUrl"],
|
|
727
|
+
"youtube.subscriptions": ["channelId", "channelUrl"],
|
|
728
|
+
"youtube.playlists": ["playlistId", "url"],
|
|
729
|
+
"youtube.playlistItems": ["playlistId"],
|
|
730
|
+
"youtube.likes": ["videoId", "videoUrl"],
|
|
731
|
+
"youtube.watchLater": ["videoId", "videoUrl"],
|
|
732
|
+
};
|
|
733
|
+
/** Stable identity used to prove that a projection covers a legacy item. */
|
|
734
|
+
function itemIdentity(scope, item) {
|
|
735
|
+
for (const key of IDENTITY_FIELDS[scope] ?? []) {
|
|
736
|
+
const value = field(item, key);
|
|
737
|
+
if (typeof value === "string" && value.length > 0) {
|
|
738
|
+
return `${key}:${value}`;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
const id = itemId(item);
|
|
742
|
+
return id === undefined ? undefined : `id:${id}`;
|
|
743
|
+
}
|
|
744
|
+
/** A legacy item's `id` (or `uuid`), when it has a string one. */
|
|
745
|
+
function itemId(item) {
|
|
746
|
+
if (item === null || typeof item !== "object")
|
|
747
|
+
return undefined;
|
|
748
|
+
const { id, uuid } = item;
|
|
749
|
+
return typeof id === "string"
|
|
750
|
+
? id
|
|
751
|
+
: typeof uuid === "string"
|
|
752
|
+
? uuid
|
|
753
|
+
: undefined;
|
|
754
|
+
}
|
|
755
|
+
//# sourceMappingURL=legacy-projection.js.map
|