nervur 0.20.0 → 0.20.2
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/README.md +229 -20
- package/dist/being/being.d.ts +1 -0
- package/dist/being/being.js +5 -1
- package/dist/being/faculty.d.ts +1 -0
- package/dist/being/faculty.js +13 -7
- package/dist/being/index.d.ts +1 -0
- package/dist/being/index.js +1 -0
- package/dist/being/kind.d.ts +4 -0
- package/dist/being/kind.js +28 -0
- package/dist/being/types.d.ts +3 -4
- package/dist/browser/index.d.ts +35 -0
- package/dist/browser/index.js +188 -0
- package/dist/browser/worker.d.ts +12 -0
- package/dist/browser/worker.js +40 -0
- package/dist/browser.d.ts +1 -0
- package/dist/browser.js +7 -0
- package/dist/cli/command.d.ts +13 -0
- package/dist/cli/command.js +237 -0
- package/dist/cli/harbor.d.ts +19 -0
- package/dist/cli/harbor.js +99 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +14 -0
- package/dist/contract/index.d.ts +16 -2
- package/dist/contract/index.js +13 -3
- package/dist/edge/index.d.ts +57 -0
- package/dist/edge/index.js +306 -0
- package/dist/edge.d.ts +1 -0
- package/dist/edge.js +8 -0
- package/dist/folder/index.d.ts +9 -4
- package/dist/folder/index.js +89 -84
- package/dist/harbor/carrying.d.ts +17 -0
- package/dist/harbor/carrying.js +38 -0
- package/dist/harbor/catalogue.d.ts +27 -0
- package/dist/harbor/catalogue.js +101 -0
- package/dist/harbor/dock.d.ts +32 -3
- package/dist/harbor/dock.js +98 -12
- package/dist/harbor/harbor.d.ts +27 -8
- package/dist/harbor/harbor.js +217 -26
- package/dist/harbor/index.d.ts +8 -2
- package/dist/harbor/index.js +8 -1
- package/dist/harbor/package.d.ts +12 -0
- package/dist/harbor/package.js +130 -0
- package/dist/harbor/probe.d.ts +18 -0
- package/dist/harbor/probe.js +15 -0
- package/dist/harbor/registry.d.ts +6 -3
- package/dist/harbor/registry.js +83 -7
- package/dist/harbor/relay.d.ts +15 -0
- package/dist/harbor/relay.js +387 -0
- package/dist/harbor/root-line.d.ts +9 -0
- package/dist/harbor/root-line.js +38 -0
- package/dist/harbor/terrain.d.ts +14 -1
- package/dist/harbor/terrain.js +19 -0
- package/dist/http/index.d.ts +4 -0
- package/dist/http/index.js +156 -0
- package/dist/http/websocket.d.ts +29 -0
- package/dist/http/websocket.js +133 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +12 -6
- package/dist/line/answer.d.ts +8 -0
- package/dist/line/answer.js +60 -0
- package/dist/line/frame.d.ts +34 -0
- package/dist/line/frame.js +81 -0
- package/dist/line/ground.d.ts +3 -0
- package/dist/line/ground.js +9 -0
- package/dist/line/index.d.ts +5 -0
- package/dist/line/index.js +9 -0
- package/dist/line/push.d.ts +7 -0
- package/dist/line/push.js +92 -0
- package/dist/line/web.d.ts +30 -0
- package/dist/line/web.js +181 -0
- package/dist/node/index.d.ts +32 -0
- package/dist/node/index.js +164 -0
- package/dist/node.d.ts +1 -0
- package/dist/node.js +7 -0
- package/dist/pointer/bodies.d.ts +11 -3
- package/dist/pointer/bodies.js +47 -18
- package/dist/pointer/index.d.ts +1 -1
- package/dist/pointer/index.js +1 -1
- package/dist/pointer/world.d.ts +12 -5
- package/dist/pointer/world.js +29 -14
- package/dist/quo/address.d.ts +19 -0
- package/dist/quo/address.js +84 -0
- package/dist/quo/door.d.ts +1 -1
- package/dist/quo/door.js +6 -4
- package/dist/quo/index.d.ts +1 -0
- package/dist/quo/index.js +1 -0
- package/dist/quo/invitation.d.ts +1 -0
- package/dist/quo/invitation.js +9 -5
- package/dist/quo/keys.js +1 -1
- package/dist/tcp/frame.d.ts +25 -0
- package/dist/tcp/frame.js +64 -0
- package/dist/tcp/index.d.ts +24 -0
- package/dist/tcp/index.js +260 -0
- package/dist/ward/index.d.ts +3 -2
- package/dist/ward/index.js +2 -1
- package/dist/ward/pilot.d.ts +8 -0
- package/dist/ward/pilot.js +50 -0
- package/dist/ward/stance.d.ts +4 -4
- package/dist/ward/stance.js +10 -7
- package/dist/ward/ward-being.d.ts +4 -1
- package/dist/ward/ward-being.js +8 -2
- package/dist/ward/ward.d.ts +11 -2
- package/dist/ward/ward.js +41 -5
- package/package.json +28 -2
- package/src/being/being.ts +5 -1
- package/src/being/faculty.ts +14 -7
- package/src/being/index.ts +1 -0
- package/src/being/kind.ts +30 -0
- package/src/being/types.ts +8 -6
- package/src/browser/index.ts +207 -0
- package/src/browser/worker.ts +66 -0
- package/src/browser.ts +9 -0
- package/src/cli/command.ts +224 -0
- package/src/cli/harbor.ts +103 -0
- package/src/cli/main.ts +13 -0
- package/src/contract/index.ts +42 -10
- package/src/edge/index.ts +359 -0
- package/src/edge.ts +10 -0
- package/src/folder/index.ts +87 -84
- package/src/harbor/carrying.ts +56 -0
- package/src/harbor/catalogue.ts +125 -0
- package/src/harbor/dock.ts +122 -15
- package/src/harbor/harbor.ts +240 -36
- package/src/harbor/index.ts +10 -3
- package/src/harbor/package.ts +147 -0
- package/src/harbor/probe.ts +34 -0
- package/src/harbor/registry.ts +73 -9
- package/src/harbor/relay.ts +399 -0
- package/src/harbor/root-line.ts +39 -0
- package/src/harbor/terrain.ts +31 -3
- package/src/http/index.ts +150 -0
- package/src/http/websocket.ts +124 -0
- package/src/index.ts +39 -6
- package/src/line/answer.ts +59 -0
- package/src/line/frame.ts +88 -0
- package/src/line/ground.ts +19 -0
- package/src/line/index.ts +9 -0
- package/src/line/push.ts +112 -0
- package/src/line/web.ts +227 -0
- package/src/node/index.ts +170 -0
- package/src/node.ts +9 -0
- package/src/pointer/bodies.ts +45 -16
- package/src/pointer/index.ts +1 -1
- package/src/pointer/world.ts +38 -19
- package/src/quo/address.ts +87 -0
- package/src/quo/door.ts +6 -4
- package/src/quo/index.ts +1 -0
- package/src/quo/invitation.ts +10 -6
- package/src/quo/keys.ts +1 -1
- package/src/stand/main.ts +1 -0
- package/src/stand/stand.ts +87 -6
- package/src/tcp/index.ts +284 -0
- package/src/ward/index.ts +3 -2
- package/src/ward/pilot.ts +50 -0
- package/src/ward/stance.ts +14 -8
- package/src/ward/ward-being.ts +9 -3
- package/src/ward/ward.ts +53 -6
package/dist/harbor/index.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
// The onion: a terrain,
|
|
2
|
+
// The onion: a terrain, the package, the dock, the catalogue and its
|
|
3
|
+
// registry, and the harbor.
|
|
4
|
+
export { Catalogue, CATALOGUE } from './catalogue.js';
|
|
3
5
|
export { BOX, Dock } from './dock.js';
|
|
6
|
+
export { CarrierFaculty, UNDIALED } from './carrying.js';
|
|
4
7
|
export { Harbor } from './harbor.js';
|
|
8
|
+
export { copyPackage, Package } from './package.js';
|
|
9
|
+
export { readRootRequest, rootLine } from './root-line.js';
|
|
10
|
+
export { addGround, grounds, probeGround } from './probe.js';
|
|
5
11
|
export { Registry } from './registry.js';
|
|
12
|
+
export { Push, PUSH, RELAY, RELAY_CLIENT, RELAY_HOLD, RELAY_REST, RELAY_WAIT, RELAYED } from './relay.js';
|
|
6
13
|
export { Terrain } from './terrain.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Entropy, Memory, Rows } from '../contract/index.ts';
|
|
2
|
+
export declare const copyPackage: (from: Memory, to: Memory) => Promise<string[]>;
|
|
3
|
+
export declare class Package {
|
|
4
|
+
#private;
|
|
5
|
+
readonly memory: Memory;
|
|
6
|
+
readonly entropy: Entropy;
|
|
7
|
+
private constructor();
|
|
8
|
+
static open(memory: Memory, entropy: Entropy, seed: Uint8Array): Promise<Package>;
|
|
9
|
+
derive(info: string[], length: number): Promise<Uint8Array>;
|
|
10
|
+
place(name: string): Promise<string>;
|
|
11
|
+
rows(name: string): Promise<Rows>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// The package: a harbor's memory, sealed under the harbor's seed. The
|
|
3
|
+
// terrain keeps its bytes and reads neither a ward's name, nor a being's
|
|
4
|
+
// key, nor anything a row holds.
|
|
5
|
+
//
|
|
6
|
+
// key HKDF-SHA-256 of the seed under `nervur-package`
|
|
7
|
+
// place 16 bytes under ["place", ward], as hex
|
|
8
|
+
// entry 16 bytes under ["entry", ward, row], as hex
|
|
9
|
+
// seal 32 bytes under ["seal", ward]
|
|
10
|
+
// entry bytes nonce (12) || AES-256-GCM( JSON { row, value } ),
|
|
11
|
+
// the entry's name as additional data
|
|
12
|
+
//
|
|
13
|
+
// A row is the head, under the empty name, or one being, under her key. An
|
|
14
|
+
// entry that does not open refuses the whole ward, so nothing unpacks from
|
|
15
|
+
// bytes the package did not seal.
|
|
16
|
+
import { concat, decrypt, encrypt, hex, hkdf, utf8 } from '../crypto/index.js';
|
|
17
|
+
import { HEAD_ROW } from '../ward/index.js';
|
|
18
|
+
// Every place of one memory, written into another, and the places
|
|
19
|
+
// carried. The bytes are the package's own, sealed under a seed neither
|
|
20
|
+
// memory holds, so a harbor opened on the second memory under that seed
|
|
21
|
+
// stands what the first one stood. A place the second memory already
|
|
22
|
+
// holds is written over.
|
|
23
|
+
export const copyPackage = async (from, to) => {
|
|
24
|
+
const places = await from.places();
|
|
25
|
+
for (const place of places)
|
|
26
|
+
await to.write(place, await from.read(place));
|
|
27
|
+
return places;
|
|
28
|
+
};
|
|
29
|
+
const NONCE = 12;
|
|
30
|
+
const LABEL = utf8('nervur-package');
|
|
31
|
+
class PackageRows {
|
|
32
|
+
rows;
|
|
33
|
+
#ward;
|
|
34
|
+
#told = new Set();
|
|
35
|
+
#line = Promise.resolve(true);
|
|
36
|
+
constructor(ward, rows) {
|
|
37
|
+
this.#ward = ward;
|
|
38
|
+
this.rows = rows;
|
|
39
|
+
}
|
|
40
|
+
told(row) {
|
|
41
|
+
this.#told.add(row);
|
|
42
|
+
}
|
|
43
|
+
// Every row told since the last keep, sealed and written as one keep, one
|
|
44
|
+
// keep at a time.
|
|
45
|
+
kept() {
|
|
46
|
+
const rows = [...this.#told];
|
|
47
|
+
this.#told.clear();
|
|
48
|
+
this.#line = this.#line.then(() => this.#write(rows)).catch(() => false);
|
|
49
|
+
return this.#line;
|
|
50
|
+
}
|
|
51
|
+
async #write(told) {
|
|
52
|
+
const beings = (this.rows.beings ?? {});
|
|
53
|
+
const entries = new Map();
|
|
54
|
+
for (const row of told) {
|
|
55
|
+
const value = row === HEAD_ROW ? (this.rows.ward ?? null) : Object.hasOwn(beings, row) ? beings[row] : undefined;
|
|
56
|
+
entries.set(await this.#ward.entry(row), value === undefined ? null : await this.#ward.seal(row, value));
|
|
57
|
+
}
|
|
58
|
+
await this.#ward.write(entries);
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
class Ward {
|
|
63
|
+
#pack;
|
|
64
|
+
#name;
|
|
65
|
+
#seal;
|
|
66
|
+
place;
|
|
67
|
+
constructor(pack, name, seal, place) {
|
|
68
|
+
this.#pack = pack;
|
|
69
|
+
this.#name = name;
|
|
70
|
+
this.#seal = seal;
|
|
71
|
+
this.place = place;
|
|
72
|
+
}
|
|
73
|
+
entry(row) {
|
|
74
|
+
return this.#pack.derive(['entry', this.#name, row], 16).then(hex);
|
|
75
|
+
}
|
|
76
|
+
async seal(row, value) {
|
|
77
|
+
const nonce = this.#pack.entropy.draw(NONCE);
|
|
78
|
+
const text = utf8(JSON.stringify({ row, value }));
|
|
79
|
+
return concat(nonce, await encrypt(this.#seal, nonce, utf8(await this.entry(row)), text));
|
|
80
|
+
}
|
|
81
|
+
// The name is the additional data, so an entry moved under another name
|
|
82
|
+
// does not open either.
|
|
83
|
+
async open(name, bytes) {
|
|
84
|
+
const text = bytes.length > NONCE ? await decrypt(this.#seal, bytes.subarray(0, NONCE), utf8(name), bytes.subarray(NONCE)) : null;
|
|
85
|
+
if (text === null)
|
|
86
|
+
throw new Error('an entry the package did not seal');
|
|
87
|
+
return JSON.parse(new TextDecoder().decode(text));
|
|
88
|
+
}
|
|
89
|
+
write(entries) {
|
|
90
|
+
return this.#pack.memory.write(this.place, entries);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export class Package {
|
|
94
|
+
memory;
|
|
95
|
+
entropy;
|
|
96
|
+
#key;
|
|
97
|
+
constructor(memory, entropy, key) {
|
|
98
|
+
this.memory = memory;
|
|
99
|
+
this.entropy = entropy;
|
|
100
|
+
this.#key = key;
|
|
101
|
+
}
|
|
102
|
+
static async open(memory, entropy, seed) {
|
|
103
|
+
return new Package(memory, entropy, await hkdf(seed, LABEL, 32));
|
|
104
|
+
}
|
|
105
|
+
derive(info, length) {
|
|
106
|
+
return hkdf(this.#key, utf8(JSON.stringify(info)), length);
|
|
107
|
+
}
|
|
108
|
+
// The place a ward's rows live in.
|
|
109
|
+
place(name) {
|
|
110
|
+
return this.derive(['place', name], 16).then(hex);
|
|
111
|
+
}
|
|
112
|
+
// One ward's rows, as the package kept them.
|
|
113
|
+
async rows(name) {
|
|
114
|
+
const ward = new Ward(this, name, await this.derive(['seal', name], 32), hex(await this.derive(['place', name], 16)));
|
|
115
|
+
const rows = {};
|
|
116
|
+
const beings = {};
|
|
117
|
+
let any = false;
|
|
118
|
+
for (const [entry, bytes] of await this.memory.read(ward.place)) {
|
|
119
|
+
const { row, value } = await ward.open(entry, bytes);
|
|
120
|
+
any = true;
|
|
121
|
+
if (row === HEAD_ROW)
|
|
122
|
+
rows.ward = value;
|
|
123
|
+
else
|
|
124
|
+
beings[row] = value;
|
|
125
|
+
}
|
|
126
|
+
if (any)
|
|
127
|
+
rows.beings = beings;
|
|
128
|
+
return new PackageRows(ward, rows);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Module } from '../contract/index.ts';
|
|
2
|
+
import type { Terrain } from './terrain.ts';
|
|
3
|
+
export type Probing = {
|
|
4
|
+
readonly modules?: readonly Module[];
|
|
5
|
+
readonly where?: string;
|
|
6
|
+
readonly given?: unknown;
|
|
7
|
+
};
|
|
8
|
+
export type GroundProbe = {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
fits(probing: Probing): boolean;
|
|
11
|
+
terrain(probing: Probing): Terrain;
|
|
12
|
+
};
|
|
13
|
+
export declare const addGround: (probe: GroundProbe) => void;
|
|
14
|
+
export declare const grounds: () => string[];
|
|
15
|
+
export declare const probeGround: (probing: Probing, probes?: readonly GroundProbe[]) => {
|
|
16
|
+
ground: string;
|
|
17
|
+
terrain: Terrain;
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const known = [];
|
|
2
|
+
// A ground this process can stand on, known once by its name.
|
|
3
|
+
export const addGround = (probe) => {
|
|
4
|
+
if (!known.some((k) => k.name === probe.name))
|
|
5
|
+
known.push(probe);
|
|
6
|
+
};
|
|
7
|
+
// The grounds known, in the order they are tried.
|
|
8
|
+
export const grounds = () => known.map((k) => k.name).reverse();
|
|
9
|
+
// The terrain of the first ground that fits, and its name.
|
|
10
|
+
export const probeGround = (probing, probes = known) => {
|
|
11
|
+
for (const probe of [...probes].reverse())
|
|
12
|
+
if (probe.fits(probing))
|
|
13
|
+
return { ground: probe.name, terrain: probe.terrain(probing) };
|
|
14
|
+
throw new Error('no ground fits here');
|
|
15
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BeingClass } from '../being/index.ts';
|
|
2
|
+
import type { Module } from '../contract/index.ts';
|
|
2
3
|
import type { Catalogue } from '../ward/index.ts';
|
|
3
4
|
export declare class Registry implements Catalogue {
|
|
4
5
|
#private;
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
6
|
+
constructor(kit: readonly BeingClass[], modules: readonly Module[]);
|
|
7
|
+
static refusal(kit: readonly BeingClass[], modules: readonly Module[]): string | null;
|
|
8
|
+
classOf(kind: string): BeingClass | undefined;
|
|
9
|
+
kindsOf(module: string): string[];
|
|
7
10
|
}
|
package/dist/harbor/registry.js
CHANGED
|
@@ -1,13 +1,89 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// The catalogue's index: every kind the harbor runs, from the kit's own
|
|
3
|
+
// classes and the modules the catalogue loaded. It resolves a kind a row
|
|
4
|
+
// keeps, and decides nothing about what stands. It refuses any set of
|
|
5
|
+
// modules two readings could split:
|
|
6
|
+
//
|
|
7
|
+
// a module whose name is no kind, or is the kit's, or two of one name
|
|
8
|
+
// a class with no kind of its own, or one outside its module's domain
|
|
9
|
+
// two classes of one kind, or one kind in two modules
|
|
10
|
+
// a contract with no kind of its own, or one kind for two contracts
|
|
11
|
+
// a kind that is a class and a contract
|
|
12
|
+
//
|
|
13
|
+
// A module's domain is its name's first two segments: `com.acme.shop`
|
|
14
|
+
// stands classes under `com.acme.` alone. A contract may be any domain's,
|
|
15
|
+
// so a faculty fulfils a contract another module declares. Two harbors hold
|
|
16
|
+
// two registries, and nothing between them names a class.
|
|
17
|
+
import { Faculty, isKind, KIT, kindOf } from '../being/index.js';
|
|
18
|
+
const domainOf = (name) => `${name.split('.').slice(0, 2).join('.')}.`;
|
|
1
19
|
export class Registry {
|
|
2
20
|
#classes = new Map();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
21
|
+
#modules = new Map();
|
|
22
|
+
// `kit` holds the kit's own classes, which alone may be of its kinds.
|
|
23
|
+
constructor(kit, modules) {
|
|
24
|
+
const contracts = new Map();
|
|
25
|
+
const owners = new Map();
|
|
26
|
+
const add = (C, kind) => {
|
|
27
|
+
if (this.#classes.has(kind) && this.#classes.get(kind) !== C)
|
|
28
|
+
throw new Error(`two classes are of kind ${kind}`);
|
|
29
|
+
this.#classes.set(kind, C);
|
|
30
|
+
};
|
|
31
|
+
for (const C of kit)
|
|
32
|
+
add(C, kindOf(C));
|
|
33
|
+
for (const m of modules) {
|
|
34
|
+
if (!isKind(m.module) || m.module.startsWith(KIT))
|
|
35
|
+
throw new Error(`module ${String(m.module)} is no name a module may take`);
|
|
36
|
+
if (this.#modules.has(m.module))
|
|
37
|
+
throw new Error(`two modules are named ${m.module}`);
|
|
38
|
+
if (typeof m.version !== 'string' || m.version === '')
|
|
39
|
+
throw new Error(`module ${m.module} declares no version`);
|
|
40
|
+
const kinds = [];
|
|
41
|
+
for (const C of m.classes) {
|
|
42
|
+
if (typeof C !== 'function')
|
|
43
|
+
throw new Error(`module ${m.module} holds something that is no class`);
|
|
44
|
+
const kind = kindOf(C);
|
|
45
|
+
if (!kind.startsWith(domainOf(m.module)))
|
|
46
|
+
throw new Error(`kind ${kind} is outside module ${m.module}`);
|
|
47
|
+
const owner = owners.get(kind);
|
|
48
|
+
if (owner !== undefined && owner !== m.module)
|
|
49
|
+
throw new Error(`kind ${kind} is in modules ${owner} and ${m.module}`);
|
|
50
|
+
owners.set(kind, m.module);
|
|
51
|
+
add(C, kind);
|
|
52
|
+
kinds.push(kind);
|
|
53
|
+
if (!Faculty.fulfils(C))
|
|
54
|
+
continue;
|
|
55
|
+
for (let c = Object.getPrototypeOf(C); c !== Faculty; c = Object.getPrototypeOf(c)) {
|
|
56
|
+
const contract = kindOf(c);
|
|
57
|
+
if (contract.startsWith(KIT))
|
|
58
|
+
throw new Error(`kind ${contract} is the kit's`);
|
|
59
|
+
if (contracts.has(contract) && contracts.get(contract) !== c)
|
|
60
|
+
throw new Error(`two contracts are of kind ${contract}`);
|
|
61
|
+
contracts.set(contract, c);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
this.#modules.set(m.module, kinds);
|
|
8
65
|
}
|
|
66
|
+
for (const kind of contracts.keys()) {
|
|
67
|
+
if (this.#classes.has(kind))
|
|
68
|
+
throw new Error(`kind ${kind} is a class and a contract`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Why a registry of these modules would be refused, or null.
|
|
72
|
+
static refusal(kit, modules) {
|
|
73
|
+
try {
|
|
74
|
+
const registry = new Registry(kit, modules);
|
|
75
|
+
void registry;
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
return e.message;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
classOf(kind) {
|
|
83
|
+
return this.#classes.get(kind);
|
|
9
84
|
}
|
|
10
|
-
|
|
11
|
-
|
|
85
|
+
// The kinds a module stands, or none.
|
|
86
|
+
kindsOf(module) {
|
|
87
|
+
return [...(this.#modules.get(module) ?? [])];
|
|
12
88
|
}
|
|
13
89
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Faculty, type BeingClass } from '../being/index.ts';
|
|
2
|
+
import type { Clock } from '../contract/index.ts';
|
|
3
|
+
import { type Ground } from './carrying.ts';
|
|
4
|
+
export declare const RELAY = "org.nervur.relay";
|
|
5
|
+
export declare const RELAY_CLIENT = "org.nervur.relay-client";
|
|
6
|
+
export declare const PUSH = "org.nervur.push";
|
|
7
|
+
export declare const RELAY_WAIT = 30000;
|
|
8
|
+
export declare const RELAY_HOLD = 20000;
|
|
9
|
+
export declare const RELAY_REST = 1000;
|
|
10
|
+
export declare const RELAYED = 262144;
|
|
11
|
+
export declare abstract class Push extends Faculty {
|
|
12
|
+
static readonly kind: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const relayFaculty: (clock: Clock) => BeingClass;
|
|
15
|
+
export declare const relayClient: (ground: Ground, clock: Clock) => BeingClass;
|