@agoric/swingset-vat 0.32.3-dev-3aa0690.0 → 0.32.3-dev-b5575d3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/swingset-vat",
3
- "version": "0.32.3-dev-3aa0690.0+3aa0690",
3
+ "version": "0.32.3-dev-b5575d3.0+b5575d3",
4
4
  "description": "Vat/Container Launcher",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -27,16 +27,16 @@
27
27
  "@types/yargs-parser": "^21.0.0"
28
28
  },
29
29
  "dependencies": {
30
- "@agoric/internal": "0.3.3-dev-3aa0690.0+3aa0690",
31
- "@agoric/kmarshal": "0.1.1-dev-3aa0690.0+3aa0690",
32
- "@agoric/store": "0.9.3-dev-3aa0690.0+3aa0690",
33
- "@agoric/swing-store": "0.9.2-dev-3aa0690.0+3aa0690",
34
- "@agoric/swingset-liveslots": "0.10.3-dev-3aa0690.0+3aa0690",
35
- "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-3aa0690.0+3aa0690",
36
- "@agoric/time": "0.3.3-dev-3aa0690.0+3aa0690",
37
- "@agoric/vat-data": "0.5.3-dev-3aa0690.0+3aa0690",
38
- "@agoric/xsnap": "0.14.3-dev-3aa0690.0+3aa0690",
39
- "@agoric/xsnap-lockdown": "0.14.1-dev-3aa0690.0+3aa0690",
30
+ "@agoric/internal": "0.3.3-dev-b5575d3.0+b5575d3",
31
+ "@agoric/kmarshal": "0.1.1-dev-b5575d3.0+b5575d3",
32
+ "@agoric/store": "0.9.3-dev-b5575d3.0+b5575d3",
33
+ "@agoric/swing-store": "0.9.2-dev-b5575d3.0+b5575d3",
34
+ "@agoric/swingset-liveslots": "0.10.3-dev-b5575d3.0+b5575d3",
35
+ "@agoric/swingset-xsnap-supervisor": "0.10.3-dev-b5575d3.0+b5575d3",
36
+ "@agoric/time": "0.3.3-dev-b5575d3.0+b5575d3",
37
+ "@agoric/vat-data": "0.5.3-dev-b5575d3.0+b5575d3",
38
+ "@agoric/xsnap": "0.14.3-dev-b5575d3.0+b5575d3",
39
+ "@agoric/xsnap-lockdown": "0.14.1-dev-b5575d3.0+b5575d3",
40
40
  "@endo/base64": "^1.0.7",
41
41
  "@endo/bundle-source": "^3.4.0",
42
42
  "@endo/captp": "^4.3.0",
@@ -101,7 +101,7 @@
101
101
  "access": "public"
102
102
  },
103
103
  "typeCoverage": {
104
- "atLeast": 75.7
104
+ "atLeast": 75.81
105
105
  },
106
- "gitHead": "3aa069075ed1b66c57c8b647c925e0c3cb3c0a25"
106
+ "gitHead": "b5575d34588db3f4b850fb86ef144dabe7abe99e"
107
107
  }
@@ -69,7 +69,7 @@ function makeDRTranslator(deviceID, kernelKeeper) {
69
69
  *
70
70
  * @param {string} deviceID
71
71
  * @param {string} deviceName
72
- * @param {*} kernelKeeper
72
+ * @param {KernelKeeper} kernelKeeper
73
73
  * @returns {(dsc: DeviceSyscallObject) => KernelSyscallObject}
74
74
  */
75
75
  export function makeDSTranslator(deviceID, deviceName, kernelKeeper) {
@@ -45,7 +45,7 @@ function parseAction(s) {
45
45
  }
46
46
 
47
47
  /**
48
- * @param {*} kernelKeeper
48
+ * @param {KernelKeeper} kernelKeeper
49
49
  * @returns {import('../types-internal.js').RunQueueEvent | undefined}
50
50
  */
51
51
  export function processGCActionSet(kernelKeeper) {
@@ -86,10 +86,9 @@ export function processGCActionSet(kernelKeeper) {
86
86
  const hasCList = vatKeeper.hasCListEntry(kref);
87
87
  const isReachable = hasCList ? vatKeeper.getReachableFlag(kref) : undefined;
88
88
  const exists = kernelKeeper.kernelObjectExists(kref);
89
- // @ts-expect-error xxx
90
89
  const { reachable, recognizable } = exists
91
90
  ? kernelKeeper.getObjectRefCount(kref)
92
- : {};
91
+ : { reachable: 0, recognizable: 0 };
93
92
 
94
93
  if (type === 'dropExport') {
95
94
  if (!exists) return false; // already, shouldn't happen
@@ -39,8 +39,10 @@ import { makeDeviceTranslators } from './deviceTranslator.js';
39
39
  import { notifyTermination } from './notifyTermination.js';
40
40
  import { makeVatAdminHooks } from './vat-admin-hooks.js';
41
41
 
42
- /** @import * as liveslots from '@agoric/swingset-liveslots' */
43
- /** @import {PolicyInputCleanupCounts} from '../types-external.js' */
42
+ /**
43
+ * @import {MeterConsumption, VatDeliveryObject, VatDeliveryResult, VatSyscallObject, VatSyscallResult} from '@agoric/swingset-liveslots';
44
+ * @import {PolicyInputCleanupCounts} from '../types-external.js';
45
+ */
44
46
 
45
47
  function abbreviateReplacer(_, arg) {
46
48
  if (typeof arg === 'bigint') {
@@ -56,7 +58,7 @@ function abbreviateReplacer(_, arg) {
56
58
  /**
57
59
  * Provide the kref of a vat's root object, as if it had been exported.
58
60
  *
59
- * @param {*} kernelKeeper Kernel keeper managing persistent kernel state.
61
+ * @param {KernelKeeper} kernelKeeper Kernel keeper managing persistent kernel state.
60
62
  * @param {string} vatID Vat ID of the vat whose root kref is sought.
61
63
  *
62
64
  * @returns {string} the kref of the root object of the given vat.
@@ -380,7 +382,6 @@ export default function buildKernel(
380
382
 
381
383
  /**
382
384
  *
383
- * @typedef { import('@agoric/swingset-liveslots').MeterConsumption } MeterConsumption
384
385
  * @typedef { import('../types-internal.js').MeterID } MeterID
385
386
  * @typedef { import('../types-internal.js').Dirt } Dirt
386
387
  *
@@ -416,7 +417,7 @@ export default function buildKernel(
416
417
  *
417
418
  * @param {VatID} vatID
418
419
  * @param {KernelDeliveryObject} kd
419
- * @param {liveslots.VatDeliveryObject} vd
420
+ * @param {VatDeliveryObject} vd
420
421
  */
421
422
  async function deliverAndLogToVat(vatID, kd, vd) {
422
423
  vatRequestedTermination = undefined;
@@ -426,7 +427,7 @@ export default function buildKernel(
426
427
  const vs = kernelSlog.provideVatSlogger(vatID).vatSlog;
427
428
  await null;
428
429
  try {
429
- /** @type { liveslots.VatDeliveryResult } */
430
+ /** @type { VatDeliveryResult } */
430
431
  const deliveryResult = await vatWarehouse.deliverToVat(vatID, kd, vd, vs);
431
432
  insistVatDeliveryResult(deliveryResult);
432
433
  // const [ ok, problem, usage ] = deliveryResult;
@@ -1542,8 +1543,8 @@ export default function buildKernel(
1542
1543
  // not
1543
1544
  /**
1544
1545
  *
1545
- * @param {liveslots.VatSyscallObject} vatSyscallObject
1546
- * @returns {liveslots.VatSyscallResult}
1546
+ * @param {VatSyscallObject} vatSyscallObject
1547
+ * @returns {VatSyscallResult}
1547
1548
  */
1548
1549
  function vatSyscallHandler(vatSyscallObject) {
1549
1550
  if (!vatWarehouse.lookup(vatID)) {
@@ -1558,7 +1559,7 @@ export default function buildKernel(
1558
1559
  let ksc;
1559
1560
  /** @type { KernelSyscallResult } */
1560
1561
  let kres = harden(['error', 'incomplete']);
1561
- /** @type { liveslots.VatSyscallResult } */
1562
+ /** @type { VatSyscallResult } */
1562
1563
  let vres = harden(['error', 'incomplete']);
1563
1564
 
1564
1565
  try {
@@ -178,6 +178,7 @@ export const CURRENT_SCHEMA_VERSION = 2;
178
178
  // * change `version` to `'2'`
179
179
  // * add `vats.terminated` with `[]` as initial value
180
180
 
181
+ /** @type {(s: string) => string[]} s */
181
182
  export function commaSplit(s) {
182
183
  if (s === '') {
183
184
  return [];
@@ -804,6 +805,7 @@ export default function makeKernelKeeper(
804
805
  p.decider = undefined;
805
806
  }
806
807
  p.policy = kvStore.get(`${kernelSlot}.policy`) || 'ignore';
808
+ // @ts-expect-error get() may fail
807
809
  p.subscribers = commaSplit(kvStore.get(`${kernelSlot}.subscribers`));
808
810
  p.queue = Array.from(
809
811
  getPrefixedValues(kvStore, `${kernelSlot}.queue.`),
@@ -815,6 +817,7 @@ export default function makeKernelKeeper(
815
817
  p.refCount = Number(kvStore.get(`${kernelSlot}.refCount`));
816
818
  p.data = {
817
819
  body: kvStore.get(`${kernelSlot}.data.body`),
820
+ // @ts-expect-error get() may fail
818
821
  slots: commaSplit(kvStore.get(`${kernelSlot}.data.slots`)),
819
822
  };
820
823
  for (const s of p.data.slots) {
@@ -1981,3 +1984,4 @@ export default function makeKernelKeeper(
1981
1984
  dump,
1982
1985
  });
1983
1986
  }
1987
+ /** @typedef {ReturnType<typeof makeKernelKeeper>} KernelKeeper */
@@ -124,7 +124,7 @@ export {};
124
124
  *
125
125
  * @typedef { { transcriptCount: number } } VatStats
126
126
  * @typedef { ReturnType<typeof import('./kernel/state/vatKeeper.js').makeVatKeeper> } VatKeeper
127
- * @typedef { ReturnType<typeof import('./kernel/state/kernelKeeper.js').default> } KernelKeeper
127
+ * @typedef { import('./kernel/state/kernelKeeper.js').KernelKeeper } KernelKeeper
128
128
  * @typedef { Awaited<ReturnType<typeof import('@agoric/xsnap').xsnap>> } XSnap
129
129
  * @typedef { (dr: VatDeliveryResult) => void } SlogFinishDelivery
130
130
  * @typedef { (ksr: KernelSyscallResult, vsr: VatSyscallResult) => void } SlogFinishSyscall