@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
package/dist/mcp/tools.js
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
import { isMemoryScope, isSystemScope } from "../policy/reserved-scopes.js";
|
|
1
2
|
/**
|
|
2
3
|
* MCP tool surface. Phase 1 / §4 of 260604-PLAN-vana-mcp-personal-server.md.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* Small, and only over scopes that the connection's grants cover. No
|
|
6
|
+
* grant-approval tools. No raw owner/admin status tools.
|
|
6
7
|
*
|
|
7
8
|
* Every tool that returns data first picks a covering grant from the
|
|
8
9
|
* connection's grant list, signs a Web3Signed request as the per-connection
|
|
9
10
|
* grantee, and uses the bounded sidecar read path — so reads are grant-gated,
|
|
10
11
|
* access-logged, and safe for large scopes.
|
|
12
|
+
*
|
|
13
|
+
* The one write tool, `remember`, saves only into a scope a `write:` grant
|
|
14
|
+
* entry covers, and goes through the delegated-write path a builder uses
|
|
15
|
+
* (see write-client.ts). A read grant never confers write access, and a
|
|
16
|
+
* `write:` entry never confers read access.
|
|
11
17
|
*/
|
|
12
18
|
import { z } from "zod";
|
|
19
|
+
import { MCP_SCOPE_ACCESS_REQUEST_LIMIT, } from "./types.js";
|
|
13
20
|
import { McpDataReadError } from "./read-client.js";
|
|
21
|
+
import { McpDataWriteError } from "./write-client.js";
|
|
22
|
+
import { isWriteScopeEntry, writeScopePatterns, WRITE_SCOPE_PREFIX, } from "../policy/data-write.js";
|
|
23
|
+
import { toMcpScopeAccessRequestView } from "./connection-api.js";
|
|
14
24
|
import { MiniSearchIndex } from "./search/index.js";
|
|
15
25
|
import { MAX_SELECTED_BLOCK_IDS } from "../storage/blocks/index.js";
|
|
16
26
|
import { rawScopeFileInputSchema, rawScopeMetadata, rawScopeResourceUri, } from "./resources.js";
|
|
27
|
+
/** Tool names the read path stamps onto access records. */
|
|
28
|
+
const READ_SCOPE_TOOL = "read_scope";
|
|
29
|
+
const SEARCH_PERSONAL_CONTEXT_TOOL = "search_personal_context";
|
|
17
30
|
const STRUCTURED_CONTENT_TEXT_LIMIT_BYTES = 64 * 1024;
|
|
18
31
|
const resultTextEncoder = new TextEncoder();
|
|
19
32
|
/**
|
|
@@ -41,23 +54,92 @@ function textResult(value, isError = false) {
|
|
|
41
54
|
...(isError ? { isError: true } : {}),
|
|
42
55
|
};
|
|
43
56
|
}
|
|
57
|
+
/** A grant entry that names readable data: not a system scope, not `write:`. */
|
|
58
|
+
function isReadableScopeEntry(scope) {
|
|
59
|
+
return !isSystemScope(scope) && !isWriteScopeEntry(scope);
|
|
60
|
+
}
|
|
44
61
|
function uniqueScopes(connection) {
|
|
45
62
|
const set = new Set();
|
|
46
63
|
for (const grant of connection.grants) {
|
|
47
|
-
for (const scope of grant.scopes)
|
|
64
|
+
for (const scope of grant.scopes) {
|
|
65
|
+
if (isReadableScopeEntry(scope))
|
|
66
|
+
set.add(scope);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return Array.from(set).sort();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A scope `remember` may save into under these grant entries: an exact
|
|
73
|
+
* `write:<scope>` entry. MCP writes never honor a `write:` wildcard, even one
|
|
74
|
+
* an older grant still carries, although builder writes do: a memory grant
|
|
75
|
+
* names the one scope the agent saves into.
|
|
76
|
+
*/
|
|
77
|
+
function exactWriteScopes(grantScopes) {
|
|
78
|
+
return writeScopePatterns(grantScopes).filter((scope) => !scope.includes("*") && !isSystemScope(scope));
|
|
79
|
+
}
|
|
80
|
+
/** Scopes the connection may save into, `write:` prefix stripped. */
|
|
81
|
+
function uniqueWritableScopes(connection) {
|
|
82
|
+
const set = new Set();
|
|
83
|
+
for (const grant of connection.grants) {
|
|
84
|
+
for (const scope of exactWriteScopes(grant.scopes))
|
|
48
85
|
set.add(scope);
|
|
49
86
|
}
|
|
50
87
|
return Array.from(set).sort();
|
|
51
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Every data scope (or pattern) the connection may read or write, `write:`
|
|
91
|
+
* prefix stripped. A host that copies data in before serving a connection
|
|
92
|
+
* (the enclave) must copy write targets too: `remember` rewrites the whole
|
|
93
|
+
* memory list from the local copy, so a missing copy would drop memories.
|
|
94
|
+
*/
|
|
95
|
+
export function connectionDataScopes(connection) {
|
|
96
|
+
const set = new Set();
|
|
97
|
+
for (const grant of connection.grants) {
|
|
98
|
+
for (const scope of grant.scopes) {
|
|
99
|
+
const target = isWriteScopeEntry(scope)
|
|
100
|
+
? scope.slice(WRITE_SCOPE_PREFIX.length)
|
|
101
|
+
: scope;
|
|
102
|
+
if (target)
|
|
103
|
+
set.add(target);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return Array.from(set).sort();
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Resolve a scope to a grant with an exact `write:` entry for it (see
|
|
110
|
+
* exactWriteScopes). The server-side write policy still runs on every save;
|
|
111
|
+
* this only narrows what the tool will attempt.
|
|
112
|
+
*/
|
|
113
|
+
export function resolveWriteGrantForScope(connection, scope) {
|
|
114
|
+
for (const grant of connection.grants) {
|
|
115
|
+
if (exactWriteScopes(grant.scopes).includes(scope)) {
|
|
116
|
+
return { grantId: grant.grantId, scopes: grant.scopes };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Whether the connection already holds `scope` as a scope request names it:
|
|
123
|
+
* a `write:` entry is covered only by write grants, anything else by reads.
|
|
124
|
+
*/
|
|
125
|
+
function connectionCoversRequestedScope(connection, scope) {
|
|
126
|
+
return isWriteScopeEntry(scope)
|
|
127
|
+
? Boolean(resolveWriteGrantForScope(connection, scope.slice(WRITE_SCOPE_PREFIX.length)))
|
|
128
|
+
: Boolean(resolveGrantForScope(connection, scope));
|
|
129
|
+
}
|
|
52
130
|
function uniqueSources(connection) {
|
|
53
131
|
const set = new Set();
|
|
54
132
|
for (const grant of connection.grants) {
|
|
133
|
+
if (!grant.scopes.some(isReadableScopeEntry))
|
|
134
|
+
continue;
|
|
55
135
|
const sourceId = typeof grant.sourceId === "string" ? grant.sourceId.trim() : "";
|
|
56
136
|
if (sourceId) {
|
|
57
137
|
set.add(sourceId);
|
|
58
138
|
continue;
|
|
59
139
|
}
|
|
60
140
|
for (const scope of grant.scopes) {
|
|
141
|
+
if (!isReadableScopeEntry(scope))
|
|
142
|
+
continue;
|
|
61
143
|
const [scopeSourceId] = scope.split(".");
|
|
62
144
|
if (scopeSourceId && scopeSourceId !== "*") {
|
|
63
145
|
set.add(scopeSourceId);
|
|
@@ -153,6 +235,28 @@ const SEARCH_REQUESTED_SCOPES_LIMIT = MAX_SEARCH_SCOPES * 2;
|
|
|
153
235
|
const SEARCH_SKIPPED_SCOPES_LIMIT = 50;
|
|
154
236
|
const SEARCH_PREVIEW_CHARS = 600;
|
|
155
237
|
const LIST_SCOPES_LIMIT = 200;
|
|
238
|
+
const scopeAccessRequestInputShape = {
|
|
239
|
+
scopes: z
|
|
240
|
+
.array(z.string().min(1).max(SEARCH_SCOPE_MAX_CHARS))
|
|
241
|
+
.min(1)
|
|
242
|
+
.max(MCP_SCOPE_ACCESS_REQUEST_LIMIT)
|
|
243
|
+
.describe("Exact scope ids to read, or write:<scope> to save into."),
|
|
244
|
+
reason: z
|
|
245
|
+
.string()
|
|
246
|
+
.max(500)
|
|
247
|
+
.optional()
|
|
248
|
+
.describe("Brief reason to show the user."),
|
|
249
|
+
};
|
|
250
|
+
export function parseScopeAccessRequestArguments(value) {
|
|
251
|
+
const parsed = z.object(scopeAccessRequestInputShape).safeParse(value);
|
|
252
|
+
if (!parsed.success)
|
|
253
|
+
return null;
|
|
254
|
+
const scopes = normalizeScopeListInput(parsed.data.scopes);
|
|
255
|
+
if (scopes.length === 0)
|
|
256
|
+
return null;
|
|
257
|
+
const reason = parsed.data.reason?.trim();
|
|
258
|
+
return { scopes, ...(reason ? { reason } : {}) };
|
|
259
|
+
}
|
|
156
260
|
// Size thresholds for sizeClass classification (raw envelope bytes)
|
|
157
261
|
const SIZE_CLASS_TINY_BYTES = 10_000;
|
|
158
262
|
const SIZE_CLASS_SMALL_BYTES = 100_000;
|
|
@@ -178,7 +282,9 @@ class OperationTimeoutError extends Error {
|
|
|
178
282
|
* tool surface never offers Claude a scope its grant won't actually pass
|
|
179
283
|
* server-side.
|
|
180
284
|
*/
|
|
181
|
-
function resolveGrantForScope(connection, scope) {
|
|
285
|
+
export function resolveGrantForScope(connection, scope) {
|
|
286
|
+
if (isSystemScope(scope))
|
|
287
|
+
return null;
|
|
182
288
|
for (const grant of connection.grants) {
|
|
183
289
|
for (const granted of grant.scopes) {
|
|
184
290
|
if (granted === scope) {
|
|
@@ -428,6 +534,7 @@ async function resolveSearchScopes({ connection, maxScopes, discoveryTimeoutMs,
|
|
|
428
534
|
const listed = await withTimeout(readClient.listScopes({
|
|
429
535
|
scopePrefix: prefix,
|
|
430
536
|
limit: LIST_SCOPES_LIMIT,
|
|
537
|
+
grantId: grant.grantId,
|
|
431
538
|
}), discoveryTimeoutMs, `list scopes for ${requested}`);
|
|
432
539
|
for (const summary of listed.scopes) {
|
|
433
540
|
if (resolveGrantForScope(connection, summary.scope)) {
|
|
@@ -519,33 +626,64 @@ const listGrantedScopes = {
|
|
|
519
626
|
reason,
|
|
520
627
|
};
|
|
521
628
|
}));
|
|
522
|
-
|
|
629
|
+
// Lets an agent that asked for more scopes see whether the owner has
|
|
630
|
+
// answered yet without re-recording the request.
|
|
631
|
+
const writableScopes = uniqueWritableScopes(connection);
|
|
632
|
+
return textResult({
|
|
633
|
+
scopes: scopeEntries,
|
|
634
|
+
...(writableScopes.length > 0 ? { writableScopes } : {}),
|
|
635
|
+
...(connection.scopeAccessRequest
|
|
636
|
+
? {
|
|
637
|
+
pendingScopeRequest: toMcpScopeAccessRequestView(connection.scopeAccessRequest),
|
|
638
|
+
}
|
|
639
|
+
: {}),
|
|
640
|
+
...(connection.scopeAccessDecision
|
|
641
|
+
? { lastScopeDecision: connection.scopeAccessDecision }
|
|
642
|
+
: {}),
|
|
643
|
+
});
|
|
523
644
|
},
|
|
524
645
|
};
|
|
525
646
|
const requestScopeAccess = {
|
|
526
647
|
name: "request_scope_access",
|
|
527
648
|
title: "Request scope access",
|
|
528
|
-
description: "
|
|
529
|
-
inputSchema:
|
|
530
|
-
|
|
531
|
-
.array(z.string().min(1).max(SEARCH_SCOPE_MAX_CHARS))
|
|
532
|
-
.min(1)
|
|
533
|
-
.max(SEARCH_REQUESTED_SCOPES_LIMIT)
|
|
534
|
-
.describe("Exact scope ids the MCP client wants to read."),
|
|
535
|
-
reason: z
|
|
536
|
-
.string()
|
|
537
|
-
.max(500)
|
|
538
|
-
.optional()
|
|
539
|
-
.describe("Brief reason to show the user."),
|
|
540
|
-
},
|
|
541
|
-
async handler(args, { connection }) {
|
|
649
|
+
description: "Record missing scopes on this MCP connection for explicit owner approval in Vana.",
|
|
650
|
+
inputSchema: scopeAccessRequestInputShape,
|
|
651
|
+
async handler(args, { connection, requestScopeAccess, scopeRequestApprovalUrl, serverOrigin }) {
|
|
542
652
|
const requestedScopes = normalizeScopeListInput(args.scopes);
|
|
543
|
-
|
|
544
|
-
|
|
653
|
+
// Read before recording: a new request must not hide the owner's last
|
|
654
|
+
// answer from the agent that is checking back.
|
|
655
|
+
const previousDecision = connection.scopeAccessDecision;
|
|
656
|
+
let effectiveConnection = connection;
|
|
657
|
+
let grantedRequestedScopes = requestedScopes.filter((scope) => connectionCoversRequestedScope(effectiveConnection, scope));
|
|
658
|
+
let missingScopes = requestedScopes.filter((scope) => !connectionCoversRequestedScope(connection, scope));
|
|
545
659
|
const reason = typeof args.reason === "string" ? args.reason.trim() : "";
|
|
546
660
|
const approvalRequired = missingScopes.length > 0;
|
|
661
|
+
const alreadyRecorded = approvalRequired &&
|
|
662
|
+
missingScopes.every((scope) => connection.scopeAccessRequest?.scopes.includes(scope));
|
|
663
|
+
let requestRecorded = alreadyRecorded;
|
|
664
|
+
let readToken;
|
|
665
|
+
if (approvalRequired && requestScopeAccess) {
|
|
666
|
+
const outcome = await requestScopeAccess({
|
|
667
|
+
scopes: missingScopes,
|
|
668
|
+
...(reason ? { reason } : {}),
|
|
669
|
+
});
|
|
670
|
+
effectiveConnection = outcome.connection;
|
|
671
|
+
requestRecorded = outcome.requestRecorded;
|
|
672
|
+
readToken = outcome.readToken;
|
|
673
|
+
grantedRequestedScopes = requestedScopes.filter((scope) => connectionCoversRequestedScope(effectiveConnection, scope));
|
|
674
|
+
missingScopes = requestedScopes.filter((scope) => !connectionCoversRequestedScope(effectiveConnection, scope));
|
|
675
|
+
}
|
|
676
|
+
const finalApprovalRequired = missingScopes.length > 0;
|
|
677
|
+
const recorded = finalApprovalRequired && requestRecorded;
|
|
678
|
+
const approvalUrl = recorded
|
|
679
|
+
? resolveScopeRequestApprovalUrl(scopeRequestApprovalUrl, connection.id, {
|
|
680
|
+
serverOrigin,
|
|
681
|
+
...(readToken ? { readToken } : {}),
|
|
682
|
+
})
|
|
683
|
+
: undefined;
|
|
684
|
+
const declinedScopes = previousDecision?.deniedScopes.filter((scope) => missingScopes.includes(scope)) ?? [];
|
|
547
685
|
return textResult({
|
|
548
|
-
approvalRequired,
|
|
686
|
+
approvalRequired: finalApprovalRequired,
|
|
549
687
|
client: {
|
|
550
688
|
id: connection.id,
|
|
551
689
|
displayName: connection.displayName,
|
|
@@ -554,16 +692,49 @@ const requestScopeAccess = {
|
|
|
554
692
|
requestedScopes,
|
|
555
693
|
grantedRequestedScopes,
|
|
556
694
|
missingScopes,
|
|
557
|
-
grantedScopes: uniqueScopes(
|
|
695
|
+
grantedScopes: uniqueScopes(effectiveConnection),
|
|
558
696
|
reason: reason || undefined,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
697
|
+
requestRecorded: recorded,
|
|
698
|
+
approvalUrl,
|
|
699
|
+
previousDecision,
|
|
700
|
+
nextAction: scopeRequestNextAction({
|
|
701
|
+
finalApprovalRequired,
|
|
702
|
+
recorded,
|
|
703
|
+
approvalUrl,
|
|
704
|
+
declinedScopes,
|
|
705
|
+
}),
|
|
562
706
|
});
|
|
563
707
|
},
|
|
564
708
|
};
|
|
709
|
+
function resolveScopeRequestApprovalUrl(hook, connectionId, context) {
|
|
710
|
+
if (!hook)
|
|
711
|
+
return undefined;
|
|
712
|
+
try {
|
|
713
|
+
const url = hook(connectionId, context);
|
|
714
|
+
return typeof url === "string" && url.trim() ? url.trim() : undefined;
|
|
715
|
+
}
|
|
716
|
+
catch {
|
|
717
|
+
// A broken host hook must not fail the request itself; fall back to Vana.
|
|
718
|
+
return undefined;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function scopeRequestNextAction(input) {
|
|
722
|
+
if (!input.finalApprovalRequired) {
|
|
723
|
+
return "No new grant is needed for the requested scopes.";
|
|
724
|
+
}
|
|
725
|
+
const declined = input.declinedScopes.length > 0
|
|
726
|
+
? `The owner previously declined ${input.declinedScopes.join(", ")}; only ask again if the user wants to. `
|
|
727
|
+
: "";
|
|
728
|
+
if (!input.recorded) {
|
|
729
|
+
return `${declined}Ask the user to open Vana's Personal Server page and add the missing scopes to this MCP client. This tool cannot grant access by itself.`;
|
|
730
|
+
}
|
|
731
|
+
if (input.approvalUrl) {
|
|
732
|
+
return `${declined}Show the user this link to review the request: ${input.approvalUrl} . Ask them to approve or decline it there and to tell you when they are done, then call list_granted_scopes to see what was granted. Access remains unchanged until the owner approves.`;
|
|
733
|
+
}
|
|
734
|
+
return `${declined}The request is waiting for owner approval in Vana. Access remains unchanged until the owner approves it.`;
|
|
735
|
+
}
|
|
565
736
|
const readScope = {
|
|
566
|
-
name:
|
|
737
|
+
name: READ_SCOPE_TOOL,
|
|
567
738
|
title: "Read scope",
|
|
568
739
|
description: "Read approved scope blocks. Pass blockIds to fetch exact blocks; otherwise page with nextCursor.",
|
|
569
740
|
inputSchema: {
|
|
@@ -642,6 +813,7 @@ const readScope = {
|
|
|
642
813
|
cursor,
|
|
643
814
|
maxBytes,
|
|
644
815
|
payment,
|
|
816
|
+
tool: READ_SCOPE_TOOL,
|
|
645
817
|
...(blockIds.length > 0 ? { blockIds } : {}),
|
|
646
818
|
}), timeoutMs, `read blocks for ${scope}`);
|
|
647
819
|
const nextCursor = result.nextCursor ?? null;
|
|
@@ -845,7 +1017,7 @@ function decodeSearchCursor(raw) {
|
|
|
845
1017
|
}
|
|
846
1018
|
}
|
|
847
1019
|
const searchPersonalContext = {
|
|
848
|
-
name:
|
|
1020
|
+
name: SEARCH_PERSONAL_CONTEXT_TOOL,
|
|
849
1021
|
title: "Search personal context",
|
|
850
1022
|
description: "Search approved scopes. Omit scopes for default sweep; name scopes for targeted search. Continue with nextSearchCursor. Free discovery/preview — it does not settle payments; chargeable scopes are returned in paymentRequiredScopes, fetch those via read_scope with a `payment` proof.",
|
|
851
1023
|
inputSchema: {
|
|
@@ -1010,6 +1182,7 @@ const searchPersonalContext = {
|
|
|
1010
1182
|
grantId: grant.grantId,
|
|
1011
1183
|
cursor,
|
|
1012
1184
|
maxBytes,
|
|
1185
|
+
tool: SEARCH_PERSONAL_CONTEXT_TOOL,
|
|
1013
1186
|
}), perScopeTimeoutMs, `read blocks for ${scope}`);
|
|
1014
1187
|
const pageText = blockPageSearchText(result.blocks);
|
|
1015
1188
|
const { documents, textById } = blockPageSearchDocuments(scope, result.blocks);
|
|
@@ -1334,6 +1507,316 @@ const getScopeFile = {
|
|
|
1334
1507
|
}
|
|
1335
1508
|
},
|
|
1336
1509
|
};
|
|
1510
|
+
const REMEMBER_TOOL = "remember";
|
|
1511
|
+
const FORGET_TOOL = "forget";
|
|
1512
|
+
const REMEMBER_TEXT_MAX_CHARS = 4_000;
|
|
1513
|
+
const REMEMBER_KEY_MAX_CHARS = 128;
|
|
1514
|
+
const MEMORY_ID_MAX_CHARS = 64;
|
|
1515
|
+
/**
|
|
1516
|
+
* Every save stores a new snapshot of the scope's record list, so the list is
|
|
1517
|
+
* bounded by size rather than count. Sync publishes only the newest snapshot of
|
|
1518
|
+
* a memory scope (see `isCoalescedScope` in sync/workers/upload.ts).
|
|
1519
|
+
*/
|
|
1520
|
+
export const MEMORY_SCOPE_MAX_BYTES = 20 * 1024 * 1024;
|
|
1521
|
+
class RememberRefusal extends Error {
|
|
1522
|
+
body;
|
|
1523
|
+
constructor(body) {
|
|
1524
|
+
super(String(body.message));
|
|
1525
|
+
this.body = body;
|
|
1526
|
+
this.name = "RememberRefusal";
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
/** A save that would only repeat a memory the scope already holds. */
|
|
1530
|
+
class DuplicateMemory extends Error {
|
|
1531
|
+
record;
|
|
1532
|
+
constructor(record) {
|
|
1533
|
+
super("duplicate memory");
|
|
1534
|
+
this.record = record;
|
|
1535
|
+
this.name = "DuplicateMemory";
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
function isPlainRecord(value) {
|
|
1539
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* The memory records of a stored body. A memory scope holds exactly
|
|
1543
|
+
* `{ records: [...] }` of memory rows, or the earlier `{ memories: [...] }`
|
|
1544
|
+
* list, which is converted here (ids kept). Anything else was written by
|
|
1545
|
+
* someone else and is never overwritten.
|
|
1546
|
+
*/
|
|
1547
|
+
function storedMemoryRecords(scope, data) {
|
|
1548
|
+
const keys = Object.keys(data);
|
|
1549
|
+
if (keys.length === 1 &&
|
|
1550
|
+
Array.isArray(data.records) &&
|
|
1551
|
+
data.records.every((row) => isPlainRecord(row) &&
|
|
1552
|
+
typeof row.id === "string" &&
|
|
1553
|
+
typeof row.content === "string")) {
|
|
1554
|
+
return data.records;
|
|
1555
|
+
}
|
|
1556
|
+
if (keys.length === 1 &&
|
|
1557
|
+
Array.isArray(data.memories) &&
|
|
1558
|
+
data.memories.every((item) => isPlainRecord(item) &&
|
|
1559
|
+
typeof item.id === "string" &&
|
|
1560
|
+
typeof item.text === "string")) {
|
|
1561
|
+
return data.memories.map((item) => {
|
|
1562
|
+
const at = typeof item.savedAt === "string" ? item.savedAt : "";
|
|
1563
|
+
return {
|
|
1564
|
+
id: item.id,
|
|
1565
|
+
content: item.text,
|
|
1566
|
+
created_at: at,
|
|
1567
|
+
updated_at: at,
|
|
1568
|
+
...(typeof item.key === "string" ? { key: item.key } : {}),
|
|
1569
|
+
written_by: null,
|
|
1570
|
+
};
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
throw new RememberRefusal({
|
|
1574
|
+
error: "scope_not_memory",
|
|
1575
|
+
scope,
|
|
1576
|
+
message: `Scope ${scope} holds data that is not a memory list; it will not be changed. Use another write scope.`,
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
/**
|
|
1580
|
+
* The scope a memory tool acts on and the grant that covers it, or the error
|
|
1581
|
+
* result to return. A call may omit `scope` when the connection can write to
|
|
1582
|
+
* exactly one scope.
|
|
1583
|
+
*/
|
|
1584
|
+
function resolveMemoryTarget(args, connection) {
|
|
1585
|
+
const writableScopes = uniqueWritableScopes(connection);
|
|
1586
|
+
const namedScope = typeof args.scope === "string" ? args.scope.trim() : "";
|
|
1587
|
+
const onlyScope = writableScopes.length === 1 && !writableScopes[0].includes("*")
|
|
1588
|
+
? writableScopes[0]
|
|
1589
|
+
: "";
|
|
1590
|
+
const scope = namedScope || onlyScope;
|
|
1591
|
+
if (!scope) {
|
|
1592
|
+
return {
|
|
1593
|
+
error: textResult({
|
|
1594
|
+
error: "scope_required",
|
|
1595
|
+
writableScopes,
|
|
1596
|
+
message: writableScopes.length === 0
|
|
1597
|
+
? 'This connection cannot save memories. Call request_scope_access with scopes ["write:memory.<app>"] and ask the user to approve it.'
|
|
1598
|
+
: "Name the scope; this connection can write to more than one.",
|
|
1599
|
+
}, true),
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
if (!isMemoryScope(scope)) {
|
|
1603
|
+
return {
|
|
1604
|
+
error: textResult({
|
|
1605
|
+
error: "scope_not_memory",
|
|
1606
|
+
scope,
|
|
1607
|
+
message: `Memories live in memory.<app> scopes; ${scope} is not one.`,
|
|
1608
|
+
}, true),
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
const grant = resolveWriteGrantForScope(connection, scope);
|
|
1612
|
+
if (!grant) {
|
|
1613
|
+
const requestScope = `${WRITE_SCOPE_PREFIX}${scope}`;
|
|
1614
|
+
return {
|
|
1615
|
+
error: textResult({
|
|
1616
|
+
error: "scope_not_granted",
|
|
1617
|
+
scope,
|
|
1618
|
+
requestScope,
|
|
1619
|
+
writableScopes,
|
|
1620
|
+
message: `This connection may not write to ${scope}. Call request_scope_access with scopes ["${requestScope}"] and ask the user to approve it.`,
|
|
1621
|
+
}, true),
|
|
1622
|
+
};
|
|
1623
|
+
}
|
|
1624
|
+
return { scope, grantId: grant.grantId };
|
|
1625
|
+
}
|
|
1626
|
+
const WRITE_UNAVAILABLE = textResult({
|
|
1627
|
+
error: "write_unavailable",
|
|
1628
|
+
message: "This Personal Server does not accept MCP writes.",
|
|
1629
|
+
}, true);
|
|
1630
|
+
/** Map a refused or failed memory write to the tool's error result. */
|
|
1631
|
+
function memoryWriteError(err, scope) {
|
|
1632
|
+
if (err instanceof RememberRefusal)
|
|
1633
|
+
return textResult(err.body, true);
|
|
1634
|
+
if (err instanceof McpDataWriteError) {
|
|
1635
|
+
const body = err.body;
|
|
1636
|
+
const detail = typeof body?.error === "object" && body.error !== null
|
|
1637
|
+
? body.error
|
|
1638
|
+
: { errorCode: body?.error, message: body?.message };
|
|
1639
|
+
return textResult({
|
|
1640
|
+
error: err.status === 401 || err.status === 403
|
|
1641
|
+
? "unauthorized"
|
|
1642
|
+
: err.status === 412
|
|
1643
|
+
? "write_conflict"
|
|
1644
|
+
: "write_failed",
|
|
1645
|
+
status: err.status,
|
|
1646
|
+
scope,
|
|
1647
|
+
...(detail.errorCode ? { errorCode: detail.errorCode } : {}),
|
|
1648
|
+
...(detail.message ? { message: detail.message } : {}),
|
|
1649
|
+
}, true);
|
|
1650
|
+
}
|
|
1651
|
+
throw err;
|
|
1652
|
+
}
|
|
1653
|
+
function memoryBody(records, scope) {
|
|
1654
|
+
const body = { records };
|
|
1655
|
+
if (new TextEncoder().encode(JSON.stringify(body)).byteLength >
|
|
1656
|
+
MEMORY_SCOPE_MAX_BYTES) {
|
|
1657
|
+
throw new RememberRefusal({
|
|
1658
|
+
error: "memory_full",
|
|
1659
|
+
scope,
|
|
1660
|
+
limitBytes: MEMORY_SCOPE_MAX_BYTES,
|
|
1661
|
+
message: `Scope ${scope} is full. Forget or replace memories to make room.`,
|
|
1662
|
+
});
|
|
1663
|
+
}
|
|
1664
|
+
return body;
|
|
1665
|
+
}
|
|
1666
|
+
const remember = {
|
|
1667
|
+
name: REMEMBER_TOOL,
|
|
1668
|
+
title: "Remember",
|
|
1669
|
+
description: "Save a fact, preference, goal or decision the user shares, without being asked, so any allowed agent can recall it. Tell the user briefly. Never save secrets, passwords, IDs or account numbers. Needs a write:<scope> grant (writableScopes).",
|
|
1670
|
+
inputSchema: {
|
|
1671
|
+
text: z
|
|
1672
|
+
.string()
|
|
1673
|
+
.min(1)
|
|
1674
|
+
.max(REMEMBER_TEXT_MAX_CHARS)
|
|
1675
|
+
.describe("Self-contained; readable without this chat."),
|
|
1676
|
+
scope: z
|
|
1677
|
+
.string()
|
|
1678
|
+
.min(1)
|
|
1679
|
+
.max(SEARCH_SCOPE_MAX_CHARS)
|
|
1680
|
+
.optional()
|
|
1681
|
+
.describe("e.g. memory.claude; optional with one writable scope."),
|
|
1682
|
+
key: z
|
|
1683
|
+
.string()
|
|
1684
|
+
.min(1)
|
|
1685
|
+
.max(REMEMBER_KEY_MAX_CHARS)
|
|
1686
|
+
.optional()
|
|
1687
|
+
.describe("Saving again with the same key replaces the memory."),
|
|
1688
|
+
},
|
|
1689
|
+
async handler(args, { connection, writeClient }) {
|
|
1690
|
+
const content = typeof args.text === "string" ? args.text.trim() : "";
|
|
1691
|
+
if (!content) {
|
|
1692
|
+
return textResult({ error: "invalid_arguments", message: "text must not be empty." }, true);
|
|
1693
|
+
}
|
|
1694
|
+
const key = typeof args.key === "string" && args.key.trim()
|
|
1695
|
+
? args.key.trim()
|
|
1696
|
+
: undefined;
|
|
1697
|
+
const target = resolveMemoryTarget(args, connection);
|
|
1698
|
+
if ("error" in target)
|
|
1699
|
+
return target.error;
|
|
1700
|
+
const { scope, grantId } = target;
|
|
1701
|
+
if (!writeClient)
|
|
1702
|
+
return WRITE_UNAVAILABLE;
|
|
1703
|
+
const now = new Date().toISOString();
|
|
1704
|
+
let saved;
|
|
1705
|
+
let replaced = false;
|
|
1706
|
+
let memoryCount = 0;
|
|
1707
|
+
try {
|
|
1708
|
+
await writeClient.updateScope({
|
|
1709
|
+
scope,
|
|
1710
|
+
grantId,
|
|
1711
|
+
update(current) {
|
|
1712
|
+
const records = current.data === null
|
|
1713
|
+
? []
|
|
1714
|
+
: storedMemoryRecords(scope, current.data);
|
|
1715
|
+
const previous = key
|
|
1716
|
+
? records.find((record) => record.key === key)
|
|
1717
|
+
: undefined;
|
|
1718
|
+
if (!key) {
|
|
1719
|
+
const same = records.find((record) => record.content === content);
|
|
1720
|
+
if (same)
|
|
1721
|
+
throw new DuplicateMemory(same);
|
|
1722
|
+
}
|
|
1723
|
+
replaced = previous !== undefined;
|
|
1724
|
+
saved = {
|
|
1725
|
+
id: previous?.id ?? crypto.randomUUID(),
|
|
1726
|
+
content,
|
|
1727
|
+
created_at: previous?.created_at ?? now,
|
|
1728
|
+
updated_at: now,
|
|
1729
|
+
...(key ? { key } : {}),
|
|
1730
|
+
written_by: connection.granteeAddress,
|
|
1731
|
+
};
|
|
1732
|
+
// Newest last: a replaced memory moves to the end, so list order is
|
|
1733
|
+
// the order the memories were last saved in.
|
|
1734
|
+
const next = [
|
|
1735
|
+
...records.filter((record) => record !== previous),
|
|
1736
|
+
saved,
|
|
1737
|
+
];
|
|
1738
|
+
memoryCount = next.length;
|
|
1739
|
+
return memoryBody(next, scope);
|
|
1740
|
+
},
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
catch (err) {
|
|
1744
|
+
if (err instanceof DuplicateMemory) {
|
|
1745
|
+
return textResult({
|
|
1746
|
+
saved: false,
|
|
1747
|
+
duplicate: true,
|
|
1748
|
+
scope,
|
|
1749
|
+
id: err.record.id,
|
|
1750
|
+
message: "This memory is already saved.",
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
return memoryWriteError(err, scope);
|
|
1754
|
+
}
|
|
1755
|
+
return textResult({
|
|
1756
|
+
saved: true,
|
|
1757
|
+
scope,
|
|
1758
|
+
id: saved.id,
|
|
1759
|
+
savedAt: saved.updated_at,
|
|
1760
|
+
...(key ? { key } : {}),
|
|
1761
|
+
replaced,
|
|
1762
|
+
memoryCount,
|
|
1763
|
+
});
|
|
1764
|
+
},
|
|
1765
|
+
};
|
|
1766
|
+
const forget = {
|
|
1767
|
+
name: FORGET_TOOL,
|
|
1768
|
+
title: "Forget",
|
|
1769
|
+
description: "Delete a saved memory by id or key. Needs a write:<scope> grant.",
|
|
1770
|
+
inputSchema: {
|
|
1771
|
+
id: z.string().min(1).max(MEMORY_ID_MAX_CHARS).optional(),
|
|
1772
|
+
key: z.string().min(1).max(REMEMBER_KEY_MAX_CHARS).optional(),
|
|
1773
|
+
scope: z.string().min(1).max(SEARCH_SCOPE_MAX_CHARS).optional(),
|
|
1774
|
+
},
|
|
1775
|
+
async handler(args, { connection, writeClient }) {
|
|
1776
|
+
const id = typeof args.id === "string" ? args.id.trim() : "";
|
|
1777
|
+
const key = typeof args.key === "string" ? args.key.trim() : "";
|
|
1778
|
+
if (!id && !key) {
|
|
1779
|
+
return textResult({ error: "invalid_arguments", message: "Pass id or key." }, true);
|
|
1780
|
+
}
|
|
1781
|
+
const target = resolveMemoryTarget(args, connection);
|
|
1782
|
+
if ("error" in target)
|
|
1783
|
+
return target.error;
|
|
1784
|
+
const { scope, grantId } = target;
|
|
1785
|
+
if (!writeClient)
|
|
1786
|
+
return WRITE_UNAVAILABLE;
|
|
1787
|
+
let forgotten = [];
|
|
1788
|
+
let memoryCount = 0;
|
|
1789
|
+
try {
|
|
1790
|
+
await writeClient.updateScope({
|
|
1791
|
+
scope,
|
|
1792
|
+
grantId,
|
|
1793
|
+
update(current) {
|
|
1794
|
+
const records = current.data === null
|
|
1795
|
+
? []
|
|
1796
|
+
: storedMemoryRecords(scope, current.data);
|
|
1797
|
+
// With both id and key, a record must match both.
|
|
1798
|
+
const matches = (record) => (!id || record.id === id) && (!key || record.key === key);
|
|
1799
|
+
const keep = records.filter((record) => !matches(record));
|
|
1800
|
+
if (keep.length === records.length) {
|
|
1801
|
+
throw new RememberRefusal({
|
|
1802
|
+
error: "not_found",
|
|
1803
|
+
scope,
|
|
1804
|
+
message: "No saved memory matches that id or key.",
|
|
1805
|
+
});
|
|
1806
|
+
}
|
|
1807
|
+
// Reset on every attempt: a 412 retry re-runs this callback.
|
|
1808
|
+
forgotten = records.filter(matches).map((record) => record.id);
|
|
1809
|
+
memoryCount = keep.length;
|
|
1810
|
+
return memoryBody(keep, scope);
|
|
1811
|
+
},
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
catch (err) {
|
|
1815
|
+
return memoryWriteError(err, scope);
|
|
1816
|
+
}
|
|
1817
|
+
return textResult({ forgotten: true, scope, ids: forgotten, memoryCount });
|
|
1818
|
+
},
|
|
1819
|
+
};
|
|
1337
1820
|
export const MCP_TOOLS = [
|
|
1338
1821
|
listGrantedSources,
|
|
1339
1822
|
listGrantedScopes,
|
|
@@ -1342,5 +1825,7 @@ export const MCP_TOOLS = [
|
|
|
1342
1825
|
listScopeBlocks,
|
|
1343
1826
|
getScopeFile,
|
|
1344
1827
|
searchPersonalContext,
|
|
1828
|
+
remember,
|
|
1829
|
+
forget,
|
|
1345
1830
|
];
|
|
1346
1831
|
//# sourceMappingURL=tools.js.map
|