@endo/ocapnA tentative implementation of the OCapN (Object Capability Network) protocol for Hardened JavaScript. The OCapN specification remains a moving target and this package provides few guarantees of future compatibility. This is a testbed for building specification consensus and early discovery of specification questions.
OCapN is a protocol for secure distributed object programming. It enables networked programming with the convenience of calling methods on remote objects, much like local asynchronous programming.
This package provides:
@endo/captp package for a
minimal CapTP implementation.For more information about the protocol, see ocapn.org.
This package is a work in progress and is not yet published to npm. The API is subject to change.
Syrup is a binary serialization format tentatively used by OCapN for encoding messages. This package includes a partial implementation that is strictly canonical and limited to forms needed to express the passable value model.
Supported types:
| Syrup Type | JavaScript Type | Encoding |
|---|---|---|
| Boolean | true, false |
t, f |
| Integer | bigint |
0+, 1-, etc. |
| Double | number |
D + 8 bytes IEEE 754 |
| Bytestring | Uint8Array |
3:cat |
| String | string |
3"cat |
| List | Array (frozen) |
[ ... ] |
| Dictionary | Object (frozen) |
{ ... } |
Look to the Syrup codec README for implementation details and limitations.
The package is organized in layers, from high to low:
src/client/): Session management, handoffs, sturdy referencessrc/captp/): Message dispatch and slot managementsrc/codecs/): Syrup encoding, descriptors, and operationssrc/netlayers/): Network and transport abstraction@endo/captp: A minimal CapTP implementation using
JSON encoding, suitable for simpler use cases.@endo/marshal: Serialization of passable objects.@endo/eventual-send: The E() proxy for
asynchronous message passing.@endo/ocapn-noise: Cryptographic utilities
for an OCapN network based on Noise Protocol.