@agoric/vat-data
Advanced tools
Comparing version 0.5.3-dev-9553675.0 to 0.5.3-dev-9555ae0.0
{ | ||
"name": "@agoric/vat-data", | ||
"version": "0.5.3-dev-9553675.0+9553675", | ||
"version": "0.5.3-dev-9555ae0.0+9555ae0", | ||
"description": "Safe access to VatData global", | ||
@@ -11,3 +11,2 @@ "type": "module", | ||
"test": "ava", | ||
"test:c8": "exit 0", | ||
"test:xs": "exit 0", | ||
@@ -23,16 +22,15 @@ "lint-fix": "yarn lint:eslint --fix", | ||
"dependencies": { | ||
"@agoric/assert": "0.6.1-dev-9553675.0+9553675", | ||
"@agoric/base-zone": "0.1.1-dev-9553675.0+9553675", | ||
"@agoric/store": "0.9.3-dev-9553675.0+9553675", | ||
"@agoric/swingset-liveslots": "0.10.3-dev-9553675.0+9553675", | ||
"@agoric/vow": "0.1.1-dev-9553675.0+9553675", | ||
"@endo/exo": "^1.5.0", | ||
"@endo/patterns": "^1.4.0" | ||
"@agoric/base-zone": "0.1.1-dev-9555ae0.0+9555ae0", | ||
"@agoric/store": "0.9.3-dev-9555ae0.0+9555ae0", | ||
"@agoric/swingset-liveslots": "0.10.3-dev-9555ae0.0+9555ae0", | ||
"@endo/errors": "^1.2.9", | ||
"@endo/exo": "^1.5.8", | ||
"@endo/patterns": "^1.4.8" | ||
}, | ||
"devDependencies": { | ||
"@endo/far": "^1.1.2", | ||
"@endo/init": "^1.1.2", | ||
"@endo/ses-ava": "^1.2.2", | ||
"@endo/far": "^1.1.10", | ||
"@endo/init": "^1.1.8", | ||
"@endo/ses-ava": "^1.2.9", | ||
"ava": "^5.3.0", | ||
"tsd": "^0.30.7" | ||
"tsd": "^0.31.1" | ||
}, | ||
@@ -44,3 +42,2 @@ "ava": { | ||
"files": [ | ||
"test/**/test-*.*", | ||
"test/**/*.test.*" | ||
@@ -56,5 +53,5 @@ ] | ||
"typeCoverage": { | ||
"atLeast": 98.74 | ||
"atLeast": 99.33 | ||
}, | ||
"gitHead": "9553675cd136d389c427e024fc4da78558344779" | ||
"gitHead": "9555ae03e9761b77c876197ef70c96380eeae5b4" | ||
} |
@@ -13,7 +13,18 @@ // @jessie-check | ||
// Some feedback if the init function is async | ||
/** | ||
* Make a version of the argument function that takes a kind context but | ||
* ignores it. | ||
* @typedef {(...args: any[]) => any} InitState | ||
*/ | ||
/** | ||
* @template {InitState} I | ||
* @typedef {ReturnType<I> extends Promise<any> ? never : ReturnType<I>} StateResult | ||
*/ | ||
/** | ||
* Make a version of the argument function that takes a kind context but ignores | ||
* it. | ||
* | ||
* @type {<T extends Function>(fn: T) => import('@agoric/swingset-liveslots').PlusContext<never, T>} | ||
* @type {<T extends (...args: any) => any>( | ||
* fn: T, | ||
* ) => import('@agoric/swingset-liveslots').PlusContext<never, T>} | ||
*/ | ||
@@ -86,3 +97,3 @@ export const ignoreContext = | ||
/** | ||
* @template {(...args: any) => any} I init state function | ||
* @template {InitState} I init state function | ||
* @template T behavior | ||
@@ -92,9 +103,10 @@ * @param {string} tag | ||
* @param {I} init | ||
* @param {T & ThisType<{ | ||
* self: T, | ||
* state: ReturnType<I> | ||
* }>} methods | ||
* @param {T & | ||
* ThisType<{ | ||
* self: T; | ||
* state: StateResult<I>; | ||
* }>} methods | ||
* @param {DefineKindOptions<{ | ||
* self: T, | ||
* state: ReturnType<I> | ||
* self: T; | ||
* state: StateResult<I>; | ||
* }>} [options] | ||
@@ -113,3 +125,3 @@ * @returns {(...args: Parameters<I>) => import('@endo/exo').Guarded<T>} | ||
/** | ||
* @template {(...args: any) => any} I init state function | ||
* @template {InitState} I init state function | ||
* @template {Record<string, Record<PropertyKey, CallableFunction>>} T facets | ||
@@ -119,9 +131,10 @@ * @param {string} tag | ||
* @param {I} init | ||
* @param {T & ThisType<{ | ||
* facets: import('@endo/exo').GuardedKit<T>, | ||
* state: ReturnType<I> | ||
* }> } facets | ||
* @param {T & | ||
* ThisType<{ | ||
* facets: import('@endo/exo').GuardedKit<T>; | ||
* state: StateResult<I>; | ||
* }>} facets | ||
* @param {DefineKindOptions<{ | ||
* facets: T, | ||
* state: ReturnType<I> | ||
* facets: T; | ||
* state: StateResult<I>; | ||
* }>} [options] | ||
@@ -146,3 +159,3 @@ * @returns {(...args: Parameters<I>) => import('@endo/exo').GuardedKit<T>} | ||
/** | ||
* @template {(...args: any) => any} I init state function | ||
* @template {InitState} I init state function | ||
* @template {Record<PropertyKey, CallableFunction>} T methods | ||
@@ -152,9 +165,10 @@ * @param {DurableKindHandle} kindHandle | ||
* @param {I} init | ||
* @param {T & ThisType<{ | ||
* self: T, | ||
* state: ReturnType<I> | ||
* }>} methods | ||
* @param {T & | ||
* ThisType<{ | ||
* self: T; | ||
* state: StateResult<I>; | ||
* }>} methods | ||
* @param {DefineKindOptions<{ | ||
* self: T, | ||
* state: ReturnType<I> | ||
* self: T; | ||
* state: StateResult<I>; | ||
* }>} [options] | ||
@@ -179,3 +193,3 @@ * @returns {(...args: Parameters<I>) => import('@endo/exo').Guarded<T>} | ||
/** | ||
* @template {(...args: any) => any} I init state function | ||
* @template {InitState} I init state function | ||
* @template {Record<string, Record<PropertyKey, CallableFunction>>} T facets | ||
@@ -185,9 +199,10 @@ * @param {DurableKindHandle} kindHandle | ||
* @param {I} init | ||
* @param {T & ThisType<{ | ||
* facets: import('@endo/exo').GuardedKit<T>, | ||
* state: ReturnType<I> | ||
* }> } facets | ||
* @param {T & | ||
* ThisType<{ | ||
* facets: import('@endo/exo').GuardedKit<T>; | ||
* state: StateResult<I>; | ||
* }>} facets | ||
* @param {DefineKindOptions<{ | ||
* facets: T, | ||
* state: ReturnType<I> | ||
* facets: T; | ||
* state: StateResult<I>; | ||
* }>} [options] | ||
@@ -212,3 +227,3 @@ * @returns {(...args: Parameters<I>) => import('@endo/exo').GuardedKit<T>} | ||
/** | ||
* @template {(...args: any) => any} I init state function | ||
* @template {InitState} I init state function | ||
* @template {Record<PropertyKey, CallableFunction>} T methods | ||
@@ -219,9 +234,10 @@ * @param {Baggage} baggage | ||
* @param {I} init | ||
* @param {T & ThisType<{ | ||
* self: RemotableObject & T, | ||
* state: ReturnType<I> | ||
* }>} methods | ||
* @param {T & | ||
* ThisType<{ | ||
* self: RemotableObject & T; | ||
* state: StateResult<I>; | ||
* }>} methods | ||
* @param {DefineKindOptions<{ | ||
* self: T, | ||
* state: ReturnType<I> | ||
* self: T; | ||
* state: StateResult<I>; | ||
* }>} [options] | ||
@@ -248,3 +264,3 @@ * @returns {(...args: Parameters<I>) => import('@endo/exo').Guarded<T>} | ||
/** | ||
* @template {(...args: any) => any} I init state function | ||
* @template {InitState} I init state function | ||
* @template {Record<string, Record<PropertyKey, CallableFunction>>} T facets | ||
@@ -255,9 +271,10 @@ * @param {Baggage} baggage | ||
* @param {I} init | ||
* @param {T & ThisType<{ | ||
* facets: import('@endo/exo').GuardedKit<T>, | ||
* state: ReturnType<I> | ||
* }> } facets | ||
* @param {T & | ||
* ThisType<{ | ||
* facets: import('@endo/exo').GuardedKit<T>; | ||
* state: StateResult<I>; | ||
* }>} facets | ||
* @param {DefineKindOptions<{ | ||
* facets: T, | ||
* state: ReturnType<I> | ||
* facets: T; | ||
* state: StateResult<I>; | ||
* }>} [options] | ||
@@ -288,3 +305,6 @@ * @returns {(...args: Parameters<I>) => import('@endo/exo').GuardedKit<T>} | ||
* @param {InterfaceGuard | undefined} interfaceGuard | ||
* @param {M} methods | ||
* @param {M & | ||
* ThisType<{ | ||
* self: RemotableObject & M; | ||
* }>} methods | ||
* @param {DefineKindOptions<{ self: M }>} [options] | ||
@@ -314,4 +334,4 @@ * @returns {import('@endo/exo').Guarded<M>} | ||
/** | ||
* @deprecated Use prepareExo instead. | ||
* @template {Record<PropertyKey, CallableFunction>} M methods | ||
* @deprecated Use prepareExo instead. | ||
* @param {Baggage} baggage | ||
@@ -318,0 +338,0 @@ * @param {string} kindName |
// @jessie-check | ||
/// <reference types="ses"/> | ||
/// <reference types="ses" /> | ||
export { | ||
@@ -46,6 +46,10 @@ M, | ||
// TODO re-export these | ||
/** @template T @typedef {import('@agoric/swingset-liveslots').DefineKindOptions<T>} DefineKindOptions */ | ||
/** | ||
* @template T @typedef | ||
* {import('@agoric/swingset-liveslots').DefineKindOptions<T>} | ||
* DefineKindOptions | ||
*/ | ||
// Copy this type because aliasing it by `import('@agoric/swingset-liveslots').Baggage` | ||
// causes this error in typedoc: Expected a symbol for node with kind Identifier | ||
/** @typedef {MapStore<string, any>} Baggage */ | ||
/** @typedef {import('@agoric/swingset-liveslots').MapStore<string, any>} Baggage */ | ||
@@ -52,0 +56,0 @@ // //////////////////////////// deprecated ///////////////////////////////////// |
@@ -1,2 +0,1 @@ | ||
/* eslint-disable no-use-before-define */ | ||
import { expectType } from 'tsd'; | ||
@@ -9,3 +8,3 @@ import type { | ||
} from '@agoric/swingset-liveslots'; | ||
import { VirtualObjectManager } from '@agoric/swingset-liveslots/src/virtualObjectManager.js'; | ||
import type { VirtualObjectManager } from '@agoric/swingset-liveslots/src/virtualObjectManager.js'; | ||
import { | ||
@@ -12,0 +11,0 @@ defineKind, |
/* global globalThis */ | ||
import { Fail } from '@agoric/assert'; | ||
import { Fail } from '@endo/errors'; | ||
import { provideLazy } from '@agoric/store'; | ||
@@ -60,3 +60,4 @@ | ||
/** | ||
* When making a multi-facet kind, it's common to pick one facet to expose. E.g., | ||
* When making a multi-facet kind, it's common to pick one facet to expose. | ||
* E.g., | ||
* | ||
@@ -93,25 +94,24 @@ * const makeFoo = (a, b, c, d) => makeFooBase(a, b, c, d).self; | ||
/** | ||
* Unlike `provideLazy`, `provide` should be called at most once | ||
* within any vat incarnation with a given `baggage`,`key` pair. | ||
* Unlike `provideLazy`, `provide` should be called at most once within any vat | ||
* incarnation with a given `baggage`,`key` pair. | ||
* | ||
* `provide` should only to be used to populate baggage, | ||
* where the total number of calls to `provide` must be | ||
* low cardinality, since we keep the bookkeeping to detect collisions | ||
* in normal language-heap memory. All the other baggage-oriented | ||
* `provide*` and `prepare*` functions call `provide`, | ||
* and so impose the same constraints. This is consistent with | ||
* our expected durability patterns: What we store in baggage are | ||
* * kindHandles, which are per kind, which must be low cardinality | ||
* * data "variables" for reestablishing the lexical scope, especially | ||
* of singletons | ||
* * named non-baggage collections at the leaves of the baggage tree. | ||
* `provide` should only be used to populate baggage, where the total number of | ||
* calls to `provide` must be low cardinality, since we keep the bookkeeping to | ||
* detect collisions in normal language-heap memory. All the other | ||
* baggage-oriented `provide*` and `prepare*` functions call `provide`, and so | ||
* impose the same constraints. This is consistent with our expected durability | ||
* patterns: What we store in baggage are | ||
* | ||
* What is expected to be high cardinality are the instances of the kinds, | ||
* and the members of the non-bagggage collections. | ||
* - kindHandles, which are per kind, which must be low cardinality | ||
* - data "variables" for reestablishing the lexical scope, especially of | ||
* singletons | ||
* - named non-baggage collections at the leaves of the baggage tree. | ||
* | ||
* TODO https://github.com/Agoric/agoric-sdk/pull/5875 : | ||
* Implement development-time instrumentation to detect when | ||
* `provide` violates the above prescription, and is called more | ||
* than once in the same vat incarnation with the same | ||
* baggage,key pair. | ||
* What is expected to be high cardinality are the instances of the kinds, and | ||
* the members of the non-bagggage collections. | ||
* | ||
* TODO https://github.com/Agoric/agoric-sdk/pull/5875 : Implement | ||
* development-time instrumentation to detect when `provide` violates the above | ||
* prescription, and is called more than once in the same vat incarnation with | ||
* the same baggage,key pair. | ||
*/ | ||
@@ -121,5 +121,9 @@ | ||
// XXX cast because provideLazy is `any` due to broken type import | ||
/** @type {<K, V>(baggage: Baggage, key: K, makeValue: (key: K) => V) => V} */ ( | ||
provideLazy | ||
); | ||
/** | ||
* @type {<K, V>( | ||
* baggage: Baggage, | ||
* key: K, | ||
* makeValue: (key: K) => V, | ||
* ) => V} | ||
*/ (provideLazy); | ||
@@ -126,0 +130,0 @@ // TODO: Find a good home for this function used by @agoric/vat-data and testing code |
@@ -5,3 +5,2 @@ { | ||
// XXX to resolve the swingset-liveslots types | ||
"maxNodeModuleJsDepth": 1, | ||
// "strict": true, // disabled for compat with >0 module depth | ||
@@ -8,0 +7,0 @@ // "noImplicitAny": false, // for compat with peer packages using ambient types |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
61289
6
1354
20
+ Added@endo/errors@^1.2.9
Updated@agoric/swingset-liveslots@0.10.3-dev-9555ae0.0+9555ae0
Updated@endo/exo@^1.5.8
Updated@endo/patterns@^1.4.8