From 3a4a8a6ccb2bfda21b2181c5c5930554204ef794 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 2 Mar 2021 09:50:23 +0100 Subject: [PATCH] Much good progress --- actor.ts | 77 ++++++++---- box-protocol.ts | 7 ++ box.ts | 32 +++++ client.ts | 25 ++++ dataspace.ts | 9 +- main.ts | 137 ++++++++------------ package.json | 1 + protocol.ts | 31 +++++ relay.ts | 322 ++++++++++++++++++++++++++++++++++++++++++++++++ t.ts | 7 ++ wload.ts | 54 ++++++++ 11 files changed, 592 insertions(+), 110 deletions(-) create mode 100644 box-protocol.ts create mode 100644 box.ts create mode 100644 client.ts create mode 100644 protocol.ts create mode 100644 relay.ts create mode 100644 t.ts create mode 100644 wload.ts diff --git a/actor.ts b/actor.ts index ea88300..28cf806 100644 --- a/actor.ts +++ b/actor.ts @@ -1,13 +1,11 @@ -import { - Dictionary, - IdentitySet, - Record, - Value, - is, -} from 'preserves'; +import { Dictionary, IdentitySet, Record, Tuple, Value, is, preserves } from 'preserves'; //--------------------------------------------------------------------------- +if ('stackTraceLimit' in Error) { + Error.stackTraceLimit = Infinity; +} + export type Assertion = Value; export type Handle = number; export type ExitReason = null | { ok: true } | { ok: false, err: Error }; @@ -69,7 +67,7 @@ export const Lit = Record.makeConstructor<{value: Assertion}, Ref>()( export const _PCompound = Symbol.for('compound'); export const PCompound = - Record.makeConstructor<{ctor: ConstructorSpec, members: Dictionary}, Ref>()( + Record.makeConstructor<{ctor: ConstructorSpec, members: Dictionary}, Ref>()( _PCompound, ['ctor', 'members']); export type Pattern = @@ -78,7 +76,7 @@ export type Pattern = | Record | Record | Record - | Record], Ref>; + | Record], Ref>; export const _TRef = Symbol.for('ref'); export const TRef = Record.makeConstructor<{name: string}, Ref>()( @@ -86,13 +84,13 @@ export const TRef = Record.makeConstructor<{name: string}, Ref>()( export const _TCompound = Symbol.for('compound'); export const TCompound = - Record.makeConstructor<{ctor: ConstructorSpec, members: Dictionary