@agoric/swingset-xsnap-supervisor 0.10.3-other-dev-8f8782b.0 → 0.10.3-other-dev-fbe72e7.0.fbe72e7

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.
@@ -1 +1 @@
1
- e0d2dafc7e981947b42118e8c950837109683bae56f7b4f5bffa1b67e5c1e768
1
+ 4751467ce397e39f6445d34eab978d5f7d317f41dba9952b4c6fbbfd49fb9894
@@ -4,10 +4,10 @@ import {
4
4
  } from '@agoric/swingset-liveslots';
5
5
 
6
6
  /**
7
- * @typedef {import('@agoric/swingset-liveslots').VatDeliveryObject} VatDeliveryObject
8
- * @typedef {import('@agoric/swingset-liveslots').VatDeliveryResult} VatDeliveryResult
9
- * @typedef {import('@agoric/swingset-liveslots').VatSyscallObject} VatSyscallObject
10
- * @typedef {import('@agoric/swingset-liveslots').VatSyscallHandler} VatSyscallHandler
7
+ * @import {VatDeliveryObject} from '@agoric/swingset-liveslots'
8
+ * @import {VatDeliveryResult} from '@agoric/swingset-liveslots'
9
+ * @import {VatSyscallObject} from '@agoric/swingset-liveslots'
10
+ * @import {VatSyscallHandler} from '@agoric/swingset-liveslots'
11
11
  * @typedef {import('@endo/marshal').CapData<string>} SwingSetCapData
12
12
  * @typedef { (delivery: VatDeliveryObject) => (VatDeliveryResult | Promise<VatDeliveryResult>) } VatDispatcherSyncAsync
13
13
  * @typedef { (delivery: VatDeliveryObject) => Promise<VatDeliveryResult> } VatDispatcher
@@ -1,12 +1,12 @@
1
1
  /* global globalThis WeakRef FinalizationRegistry */
2
- import { assert, Fail } from '@agoric/assert';
2
+ import { assert, Fail } from '@endo/errors';
3
3
  import { importBundle } from '@endo/import-bundle';
4
4
  import {
5
5
  makeLiveSlots,
6
6
  insistVatDeliveryObject,
7
7
  insistVatSyscallResult,
8
8
  } from '@agoric/swingset-liveslots';
9
- // import '../../types-ambient.js';
9
+
10
10
  // grumble... waitUntilQuiescent is exported and closes over ambient authority
11
11
  import { waitUntilQuiescent } from './waitUntilQuiescent.js';
12
12
  import { makeGcAndFinalize } from './gc-and-finalize.js';
@@ -18,13 +18,13 @@ import {
18
18
  } from './supervisor-helper.js';
19
19
 
20
20
  /**
21
- * @typedef {import('@agoric/swingset-liveslots').VatDeliveryObject} VatDeliveryObject
22
- * @typedef {import('@agoric/swingset-liveslots').VatDeliveryResult} VatDeliveryResult
23
- * @typedef {import('@agoric/swingset-liveslots').VatSyscallObject} VatSyscallObject
24
- * @typedef {import('@agoric/swingset-liveslots').VatSyscallResult} VatSyscallResult
25
- * @typedef {import('@agoric/swingset-liveslots').VatSyscallHandler} VatSyscallHandler
26
- * @typedef {import('@agoric/swingset-liveslots').LiveSlotsOptions} LiveSlotsOptions
27
- * @typedef {import('@agoric/swingset-liveslots').MeterControl} MeterControl
21
+ * @import {VatDeliveryObject} from '@agoric/swingset-liveslots'
22
+ * @import {VatDeliveryResult} from '@agoric/swingset-liveslots'
23
+ * @import {VatSyscallObject} from '@agoric/swingset-liveslots'
24
+ * @import {VatSyscallResult} from '@agoric/swingset-liveslots'
25
+ * @import {VatSyscallHandler} from '@agoric/swingset-liveslots'
26
+ * @import {LiveSlotsOptions} from '@agoric/swingset-liveslots'
27
+ * @import {MeterControl} from '@agoric/swingset-liveslots'
28
28
  */
29
29
 
30
30
  const encoder = new TextEncoder();
@@ -32,7 +32,6 @@ const decoder = new TextDecoder();
32
32
 
33
33
  // eslint-disable-next-line no-unused-vars
34
34
  function workerLog(first, ...args) {
35
- // eslint-disable-next-line
36
35
  // console.log(`---worker: ${first}`, ...args);
37
36
  }
38
37
 
@@ -101,11 +100,11 @@ const meterControl = makeMeterControl();
101
100
  /**
102
101
  * Wrap byte-level protocols with tagged array codec.
103
102
  *
104
- * @param {(cmd: ArrayBuffer) => ArrayBuffer} issueCommand as from xsnap
103
+ * @param {(cmd: ArrayBufferLike) => ArrayBuffer} issueCommand as from xsnap
105
104
  * @typedef { [unknown, ...unknown[]] } Tagged tagged array
106
105
  */
107
106
  function managerPort(issueCommand) {
108
- /** @type { (item: Tagged) => ArrayBuffer } */
107
+ /** @type { (item: Tagged) => ArrayBufferLike } */
109
108
  const encode = item => {
110
109
  let txt;
111
110
  try {
@@ -256,7 +255,8 @@ function makeWorker(port) {
256
255
 
257
256
  const workerEndowments = {
258
257
  console: makeVatConsole(makeLogMaker('vat')),
259
- assert,
258
+ // See https://github.com/Agoric/agoric-sdk/issues/9515
259
+ assert: globalThis.assert,
260
260
  // bootstrap provides HandledPromise
261
261
  HandledPromise: globalThis.HandledPromise,
262
262
  TextEncoder,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/swingset-xsnap-supervisor",
3
- "version": "0.10.3-other-dev-8f8782b.0+8f8782b",
3
+ "version": "0.10.3-other-dev-fbe72e7.0.fbe72e7",
4
4
  "description": "Supervisor/Liveslots bundle for swingset xsnap workers",
5
5
  "author": "Agoric",
6
6
  "license": "Apache-2.0",
@@ -14,23 +14,28 @@
14
14
  "build:bundle": "node scripts/build-bundle.js",
15
15
  "build": "yarn build:bundle",
16
16
  "clean": "rm -rf dist",
17
- "lint": "run-s --continue-on-error lint:*",
17
+ "lint": "yarn run -T run-s --continue-on-error 'lint:*'",
18
18
  "lint:js": "eslint 'lib/**/*.js' 'src/**/*.js' 'scripts/**/*.js' 'test/**/*.js'",
19
- "lint:types": "tsc -p jsconfig.json",
19
+ "lint:types": "yarn run -T tsc",
20
20
  "lint-fix": "eslint --fix 'lib/**/*.js' 'src/**/*.js' 'scripts/**/*.js' 'test/**/*.js'",
21
21
  "test": "ava",
22
- "test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
22
+ "test:c8": "c8 --all ${C8_OPTIONS:-} ava",
23
23
  "test:xs": "exit 0"
24
24
  },
25
+ "peerDependencies": {
26
+ "@agoric/swingset-liveslots": "*",
27
+ "@endo/errors": "^1.2.13",
28
+ "@endo/import-bundle": "^1.5.2",
29
+ "@endo/promise-kit": "^1.1.13"
30
+ },
25
31
  "devDependencies": {
26
- "@agoric/assert": "0.6.1-other-dev-8f8782b.0+8f8782b",
27
- "@agoric/swingset-liveslots": "0.10.3-other-dev-8f8782b.0+8f8782b",
28
- "@endo/bundle-source": "2.5.2-upstream-rollup",
29
- "@endo/import-bundle": "0.3.4",
30
- "@endo/init": "0.5.56",
31
- "@endo/marshal": "0.8.5",
32
- "ava": "^5.2.0",
33
- "c8": "^7.13.0"
32
+ "@agoric/swingset-liveslots": "0.10.3-other-dev-fbe72e7.0.fbe72e7",
33
+ "@endo/bundle-source": "^4.1.2",
34
+ "@endo/import-bundle": "^1.5.2",
35
+ "@endo/init": "^1.1.12",
36
+ "@endo/marshal": "^1.8.0",
37
+ "ava": "^5.3.0",
38
+ "c8": "^10.1.3"
34
39
  },
35
40
  "files": [
36
41
  "LICENSE*",
@@ -43,10 +48,19 @@
43
48
  },
44
49
  "ava": {
45
50
  "files": [
46
- "test/**/test-*.js"
51
+ "test/**/*.test.*"
52
+ ],
53
+ "require": [
54
+ "@endo/init/debug.js"
47
55
  ],
48
56
  "timeout": "2m",
49
57
  "workerThreads": false
50
58
  },
51
- "gitHead": "8f8782bc52393e9d4fc82523ecf31cab429b11b3"
59
+ "typeCoverage": {
60
+ "atLeast": 84.6
61
+ },
62
+ "engines": {
63
+ "node": "^20.9 || ^22.11"
64
+ },
65
+ "gitHead": "fbe72e72107f9997f788674e668c660d92ec4492"
52
66
  }
package/CHANGELOG.md DELETED
@@ -1,41 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ### [0.10.3-u11.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-xsnap-supervisor@0.10.2...@agoric/swingset-xsnap-supervisor@0.10.3-u11.0) (2023-08-24)
7
-
8
- **Note:** Version bump only for package @agoric/swingset-xsnap-supervisor
9
-
10
-
11
-
12
-
13
-
14
- ### [0.10.2](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-xsnap-supervisor@0.10.1...@agoric/swingset-xsnap-supervisor@0.10.2) (2023-06-02)
15
-
16
- **Note:** Version bump only for package @agoric/swingset-xsnap-supervisor
17
-
18
-
19
-
20
-
21
-
22
- ### [0.10.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-xsnap-supervisor@0.10.0...@agoric/swingset-xsnap-supervisor@0.10.1) (2023-05-24)
23
-
24
- **Note:** Version bump only for package @agoric/swingset-xsnap-supervisor
25
-
26
-
27
-
28
-
29
-
30
- ## 0.10.0 (2023-05-19)
31
-
32
-
33
- ### Features
34
-
35
- * add APIs for tracking/debugging undesired object retention (aka "leaks") ([0a7221b](https://github.com/Agoric/agoric-sdk/commit/0a7221b3c04f3b2894c30346fa2ea6fb0130c046)), closes [#7318](https://github.com/Agoric/agoric-sdk/issues/7318)
36
- * extract swingset-xsnap-supervisor out to a separate package ([0024f01](https://github.com/Agoric/agoric-sdk/commit/0024f0128ff658c93468069b6fa5cc3bebfbdc78)), closes [#6596](https://github.com/Agoric/agoric-sdk/issues/6596)
37
-
38
-
39
- ### Bug Fixes
40
-
41
- * don't retain a vat's raw bundle string after use ([1dda5ef](https://github.com/Agoric/agoric-sdk/commit/1dda5ef23e8fa624942a580487b3c94595eae5c3)), closes [#6981](https://github.com/Agoric/agoric-sdk/issues/6981)
package/lib/capdata.js DELETED
@@ -1,20 +0,0 @@
1
- import { Fail } from '@agoric/assert';
2
-
3
- /* eslint-disable jsdoc/require-returns-check */
4
- /**
5
- * Assert function to ensure that something expected to be a capdata object
6
- * actually is. A capdata object should have a .body property that's a string
7
- * and a .slots property that's an array of strings.
8
- *
9
- * @param {any} capdata The object to be tested
10
- * @throws {Error} if, upon inspection, the parameter does not satisfy the above
11
- * criteria.
12
- * @returns {asserts capdata is import('@endo/marshal').CapData<string>}
13
- */
14
- export function insistCapData(capdata) {
15
- typeof capdata.body === 'string' ||
16
- Fail`capdata has non-string .body ${capdata.body}`;
17
- Array.isArray(capdata.slots) ||
18
- Fail`capdata has non-Array slots ${capdata.slots}`;
19
- // TODO check that the .slots array elements are actually strings
20
- }