Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@
"extends": [
"plugin:@endo/internal"
]
},
"dependencies": {
"@endo/harden": "workspace:^"
}
}
1 change: 1 addition & 0 deletions packages/benchmark/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import '@endo/init';
import { harden } from '@endo/harden';
import { passStyleOf } from '@endo/pass-style';
import { test, benchmark } from '../src/benchmark.js';

Expand Down
6 changes: 5 additions & 1 deletion packages/bundle-source/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bundle Source
# `@endo/bundle-source`

This package creates source bundles from ES Modules, compatible with Endo
applications, Agoric contracts, and SwingSet vats.
Expand Down Expand Up @@ -285,3 +285,7 @@ So, to extract the source-similar program for visual inspection:
jq -r .__syncModuleProgram module.js > module.source.js
```

## Compatibility

This package works with without [HardenedJS](https://hardenedjs.org) by using
[`@endo/harden`](https://github.com/endojs/endo/tree/master/packages/harden).
1 change: 1 addition & 0 deletions packages/bundle-source/cache.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
import { harden } from '@endo/harden';
import { makePromiseKit } from '@endo/promise-kit';
import { makeReadPowers } from '@endo/compartment-mapper/node-powers.js';

Expand Down
1 change: 1 addition & 0 deletions packages/bundle-source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@endo/base64": "workspace:^",
"@endo/compartment-mapper": "workspace:^",
"@endo/evasive-transform": "workspace:^",
"@endo/harden": "workspace:^",
"@endo/init": "workspace:^",
"@endo/promise-kit": "workspace:^",
"@endo/where": "workspace:^",
Expand Down
3 changes: 3 additions & 0 deletions packages/bundle-source/src/fs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// @ts-check

import { harden } from '@endo/harden';

let mutex = Promise.resolve(undefined);

/**
Expand Down
1 change: 1 addition & 0 deletions packages/bundle-source/src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import url from 'url';
import fs from 'fs';
import os from 'os';

import { harden } from '@endo/harden';
import { makeFunctor } from '@endo/compartment-mapper/functor.js';
import { makeReadPowers } from '@endo/compartment-mapper/node-powers.js';

Expand Down
1 change: 1 addition & 0 deletions packages/bundle-source/src/zip-base64.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import url from 'url';
import fs from 'fs';
import os from 'os';

import { harden } from '@endo/harden';
import { mapNodeModules } from '@endo/compartment-mapper/node-modules.js';
import { makeAndHashArchiveFromMap } from '@endo/compartment-mapper/archive-lite.js';
import { encodeBase64 } from '@endo/base64';
Expand Down
5 changes: 5 additions & 0 deletions packages/captp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ the guest unblocks.
The Loopback implementation provides partial support for TrapCaps, except it
cannot unwrap promises. Loopback TrapHandlers must return synchronously, or an
exception will be thrown.

## Compatibility

This package works with without [HardenedJS](https://hardenedjs.org) by using
[`@endo/harden`](https://github.com/endojs/endo/tree/master/packages/harden).
7 changes: 7 additions & 0 deletions packages/captp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,19 @@
"@endo/init": "workspace:^",
"@endo/ses-ava": "workspace:^",
"ava": "^6.4.1",
"babel-eslint": "^10.1.0",
"c8": "^7.14.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.29.1",
"typescript": "~5.9.2"
},
"dependencies": {
"@endo/errors": "workspace:^",
"@endo/eventual-send": "workspace:^",
"@endo/harden": "workspace:^",
"@endo/marshal": "workspace:^",
"@endo/nat": "workspace:^",
"@endo/pass-style": "workspace:^",
Expand Down
1 change: 1 addition & 0 deletions packages/captp/src/atomics.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { harden } from '@endo/harden';
import { X, Fail } from '@endo/errors';

// This is a pathological minimum, but exercised by the unit test.
Expand Down
3 changes: 1 addition & 2 deletions packages/captp/src/captp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// This logic was mostly adapted from an earlier version of Agoric's liveSlots.js with a
// good dose of https://github.com/capnproto/capnproto/blob/master/c++/src/capnp/rpc.capnp
import { harden } from '@endo/harden';
import { Remotable, Far, makeMarshal, QCLASS } from '@endo/marshal';
import { E, HandledPromise } from '@endo/eventual-send';
import { isPromise, makePromiseKit } from '@endo/promise-kit';
Expand Down Expand Up @@ -385,7 +386,6 @@ export const makeCapTP = (
epoch,
questionID,
target,
// @ts-expect-error Type 'unknown' is not assignable to type 'Passable<PassableCap, Error>'.
method: serialize(harden([null, args])),
});
return promise;
Expand All @@ -402,7 +402,6 @@ export const makeCapTP = (
epoch,
questionID,
target,
// @ts-expect-error Type 'unknown' is not assignable to type 'Passable<PassableCap, Error>'.
method: serialize(harden([prop, args])),
});
return promise;
Expand Down
1 change: 1 addition & 0 deletions packages/captp/src/loopback.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { harden } from '@endo/harden';
import { Far } from '@endo/marshal';
import { E, makeCapTP } from './captp.js';
import { nearTrapImpl } from './trap.js';
Expand Down
2 changes: 2 additions & 0 deletions packages/captp/src/trap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Lifted mostly from `@endo/eventual-send/src/E.js`.

import { harden } from '@endo/harden';

const { freeze } = Object;

/**
Expand Down
7 changes: 6 additions & 1 deletion packages/check-bundle/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# check-bundle
# `@endo/check-bundle`

`checkBundle` verifies the integrity of a bundle, inspects all of its internal hashes and its one external hash.
`checkBundle` verifies the internal consistency, completeness, coherence, and conciseness (no extra files) of the bundle.
Expand All @@ -11,3 +11,8 @@ await checkBundle(bundle);
```

This must be run in an Endo environment. To run on Node.js, import `@endo/init` before importing `@endo/import-bundle`.

## Compatibility

This package works with without [HardenedJS](https://hardenedjs.org) by using
[`@endo/harden`](https://github.com/endojs/endo/tree/master/packages/harden).
1 change: 1 addition & 0 deletions packages/check-bundle/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
import * as fs from 'fs';
import * as crypto from 'crypto';
import { harden } from '@endo/harden';
import { checkBundle as powerlessCheckBundle } from './lite.js';
import { parseLocatedJson } from './src/json.js';

Expand Down
3 changes: 2 additions & 1 deletion packages/check-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"dependencies": {
"@endo/base64": "workspace:^",
"@endo/compartment-mapper": "workspace:^",
"@endo/errors": "workspace:^"
"@endo/errors": "workspace:^",
"@endo/harden": "workspace:^"
},
"devDependencies": {
"@endo/bundle-source": "workspace:^",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@endo/eventual-send": "workspace:^",
"@endo/exo": "workspace:^",
"@endo/far": "workspace:^",
"@endo/harden": "workspace:^",
"@endo/import-bundle": "workspace:^",
"@endo/init": "workspace:^",
"@endo/lockdown": "workspace:^",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/commands/run.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global globalThis, process */
import url from 'url';
import os from 'os';
import { harden } from '@endo/harden';
import { E, Far } from '@endo/far';
import { makeExo } from '@endo/exo';
import { M } from '@endo/patterns';
Expand Down
5 changes: 5 additions & 0 deletions packages/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ Currently there are no `src/something.js` files. The only source files that woul
Generally each utility also has its own test file. (An exception is that `make-iterator.js` is indirectly but adequately tested by `test-make-array-iterator.js`).

See the doc-comments within the source file of each utility for documentation of that utility. Sometimes the associated test files also serve as informative examples.

## Compatibility

This package works with without [HardenedJS](https://hardenedjs.org) by using
[`@endo/harden`](https://github.com/endojs/endo/tree/master/packages/harden).
1 change: 1 addition & 0 deletions packages/common/apply-labeling-error.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { hideAndHardenFunction } from '@endo/errors';
import { harden } from '@endo/harden';
import { E } from '@endo/eventual-send';
import { isPromise } from '@endo/promise-kit';
import { throwLabeled } from './throw-labeled.js';
Expand Down
1 change: 1 addition & 0 deletions packages/common/from-unique-entries.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { harden } from '@endo/harden';
import { q, Fail } from '@endo/errors';

const { fromEntries } = Object;
Expand Down
2 changes: 2 additions & 0 deletions packages/common/ident-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* @returns {boolean}
*/

import { harden } from '@endo/harden';

/**
* In the `assertFoo`/`isFoo`/`checkFoo` pattern, `checkFoo` has a `check`
* parameter of type `Checker`. `assertFoo` calls `checkFoo` passes
Expand Down
2 changes: 2 additions & 0 deletions packages/common/list-difference.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { harden } from '@endo/harden';

/**
* Return a list of all the elements present in the `leftList` and not
* in the `rightList`. Return in the order of their appearance in `leftList`.
Expand Down
1 change: 1 addition & 0 deletions packages/common/make-array-iterator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { harden } from '@endo/harden';
import { makeIterator } from './make-iterator.js';

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/common/make-iterator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { harden } from '@endo/harden';

/**
* Makes a one-shot iterable iterator from a provided `next` function.
*
Expand Down
2 changes: 2 additions & 0 deletions packages/common/object-map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { harden } from '@endo/harden';

const { entries, fromEntries } = Object;

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/common/object-meta-assign.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { harden } from '@endo/harden';

const { getOwnPropertyDescriptors, defineProperties } = Object;

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/common/object-meta-map.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { harden } from '@endo/harden';

const { getOwnPropertyDescriptors, create, fromEntries } = Object;
const { ownKeys } = Reflect;

Expand Down
1 change: 1 addition & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"dependencies": {
"@endo/errors": "workspace:^",
"@endo/eventual-send": "workspace:^",
"@endo/harden": "workspace:^",
"@endo/promise-kit": "workspace:^"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/common/throw-labeled.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
annotateError,
hideAndHardenFunction,
} from '@endo/errors';
import { harden } from '@endo/harden';

/**
* Given an error `innerErr` and a `label`, throws a similar
Expand Down
7 changes: 6 additions & 1 deletion packages/compartment-mapper/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compartment mapper
# `@endo/compartment-mapper`

The compartment mapper builds _compartment maps_ for Node.js style
applications, finding their dependencies and describing how to create
Expand Down Expand Up @@ -771,3 +771,8 @@ The shape of the `policy` object is based on `policy.json` from LavaMoat. MetaMa
[import attributes]: https://nodejs.org/docs/latest/api/esm.html#import-attributes
[package entry points]: https://nodejs.org/api/esm.html#esm_package_entry_points
[`require.resolve()`]: https://nodejs.org/docs/latest/api/modules.html#requireresolverequest-options

# Compatibility

This package works with without [HardenedJS](https://hardenedjs.org) by using
[`@endo/harden`](https://github.com/endojs/endo/tree/master/packages/harden).
1 change: 1 addition & 0 deletions packages/compartment-mapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
},
"dependencies": {
"@endo/cjs-module-analyzer": "workspace:^",
"@endo/harden": "workspace:^",
"@endo/module-source": "workspace:^",
"@endo/path-compare": "workspace:^",
"@endo/trampoline": "workspace:^",
Expand Down
2 changes: 2 additions & 0 deletions packages/compartment-mapper/test/_parse-jsonp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @module Provides joke language support for importing JSONP modules. */

import { harden } from '@endo/harden';

/**
* @import {ParseFn, ParserImplementation} from '../src/types.js'
*/
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@endo/eventual-send": "workspace:^",
"@endo/exo": "workspace:^",
"@endo/far": "workspace:^",
"@endo/harden": "workspace:^",
"@endo/import-bundle": "workspace:^",
"@endo/init": "workspace:^",
"@endo/lockdown": "workspace:^",
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/src/context.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check

import { harden } from '@endo/harden';
import { makePromiseKit } from '@endo/promise-kit';

/** @import { PromiseKit } from '@endo/promise-kit' */
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/src/daemon-node-powers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
/* eslint-disable no-void */

import { harden } from '@endo/harden';
import { makePromiseKit } from '@endo/promise-kit';
import { makePipe } from '@endo/stream';
import { makeNodeReader, makeNodeWriter } from '@endo/stream-node';
Expand Down
9 changes: 5 additions & 4 deletions packages/daemon/src/daemon.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
/* global setTimeout, clearTimeout */

import { harden } from '@endo/harden';
import { makeExo } from '@endo/exo';
import { E, Far } from '@endo/far';
import { makeMarshal } from '@endo/marshal';
Expand Down Expand Up @@ -797,7 +798,7 @@ const makeDaemonCore = async (

/** @type {DaemonCore['provideController']} */
const provideController = id => {
let controller = controllerForId.get(id);
const controller = controllerForId.get(id);
if (controller !== undefined) {
return controller;
}
Expand All @@ -810,16 +811,16 @@ const makeDaemonCore = async (
// eslint-disable-next-line no-use-before-define
const context = makeContext(id);
promise.catch(context.cancel);
controller = harden({
const newController = harden({
context,
value: promise,
});
controllerForId.set(id, controller);
controllerForId.set(id, newController);

// The controller must be in place before we evaluate the formula.
resolve(evaluateFormulaForId(id, context));

return controller;
return newController;
};

/**
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/src/directory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check

import { harden } from '@endo/harden';
import { E } from '@endo/far';
import { makeExo } from '@endo/exo';
import { q } from '@endo/errors';
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/src/mail.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check

import { harden } from '@endo/harden';
import { E } from '@endo/eventual-send';
import { makeExo } from '@endo/exo';
import { makePromiseKit } from '@endo/promise-kit';
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/src/networks/tcp-netstring.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
import net from 'net';

import { harden } from '@endo/harden';
import { E, Far } from '@endo/far';
import { mapWriter, mapReader } from '@endo/stream';
import { makeNetstringReader, makeNetstringWriter } from '@endo/netstring';
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/src/pet-sitter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check

import { harden } from '@endo/harden';
import { q } from '@endo/errors';
import { isPetName } from './pet-name.js';
import { parseId } from './formula-identifier.js';
Expand Down
1 change: 1 addition & 0 deletions packages/daemon/src/pet-store.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check

import { harden } from '@endo/harden';
import { q } from '@endo/errors';
import { makeChangeTopic } from './pubsub.js';
import { parseId, assertValidId, isValidNumber } from './formula-identifier.js';
Expand Down
Loading
Loading