@nervur.org/installer-node 0.0.0-stage → 0.37.1
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/LICENSE +105 -0
- package/README.md +158 -2
- package/SECURITY.md +8 -0
- package/bin/nervur.js +5 -0
- package/cargo/emscripten-module.wasm +0 -0
- package/cargo/manifest.json +1 -0
- package/cargo/sqlite3.wasm +0 -0
- package/cargo/table-i-i.wasm +0 -0
- package/cargo/table-i-ii.wasm +0 -0
- package/cargo/table-i-iii.wasm +0 -0
- package/cargo/table-i-iiii.wasm +0 -0
- package/cargo/table-i-iiiii.wasm +0 -0
- package/cargo/table-i-iiij.wasm +0 -0
- package/cargo/table-i-ij.wasm +0 -0
- package/cargo/table-v-ii.wasm +0 -0
- package/cargo/table-v-iii.wasm +0 -0
- package/cargo/worker.js +30756 -0
- package/organs/console/node/guard.d.ts +10 -0
- package/organs/console/node/guard.js +52 -0
- package/organs/console/node/index.d.ts +4 -0
- package/organs/console/node/index.js +5 -0
- package/organs/console/node/line.d.ts +16 -0
- package/organs/console/node/line.js +150 -0
- package/organs/console/node/main.js +51 -0
- package/organs/console/node/program.d.ts +1 -0
- package/organs/console/node/program.js +5 -0
- package/organs/console/node/proof.d.ts +15 -0
- package/organs/console/node/proof.js +84 -0
- package/organs/console/node/socket.d.ts +15 -0
- package/organs/console/node/socket.js +99 -0
- package/organs/disk/index.d.ts +1 -0
- package/organs/disk/index.js +2 -0
- package/organs/disk/node/files.js +162 -0
- package/organs/disk/node/main.js +20 -0
- package/organs/disk/node/program.d.ts +1 -0
- package/organs/disk/node/program.js +5 -0
- package/organs/disk/organ.d.ts +5 -0
- package/organs/disk/organ.js +69 -0
- package/organs/network/node/fill.d.ts +21 -0
- package/organs/network/node/fill.js +195 -0
- package/organs/network/node/flows.js +66 -0
- package/organs/network/node/half.js +260 -0
- package/organs/network/node/lines.d.ts +29 -0
- package/organs/network/node/lines.js +236 -0
- package/organs/network/node/link.d.ts +24 -0
- package/organs/network/node/link.js +215 -0
- package/organs/network/node/main.js +41 -0
- package/organs/network/node/moved.d.ts +2 -0
- package/organs/network/node/moved.js +20 -0
- package/organs/network/node/near.d.ts +63 -0
- package/organs/network/node/near.js +263 -0
- package/organs/network/node/program.d.ts +1 -0
- package/organs/network/node/program.js +5 -0
- package/organs/network/node/schemes.d.ts +1 -0
- package/organs/network/node/schemes.js +2 -0
- package/organs/network/node/sent.d.ts +13 -0
- package/organs/network/node/sent.js +101 -0
- package/organs/network/node/served.d.ts +19 -0
- package/organs/network/node/served.js +237 -0
- package/organs/screen/node/client.js +3 -0
- package/organs/screen/node/follow.js +266 -0
- package/organs/screen/node/frames.js +26 -0
- package/organs/screen/node/held.js +27 -0
- package/organs/screen/node/http.js +179 -0
- package/organs/screen/node/lay.js +116 -0
- package/organs/screen/node/leave.js +27 -0
- package/organs/screen/node/linked.js +69 -0
- package/organs/screen/node/listen.js +61 -0
- package/organs/screen/node/look.js +121 -0
- package/organs/screen/node/loop.js +154 -0
- package/organs/screen/node/main.js +74 -0
- package/organs/screen/node/mirror.js +112 -0
- package/organs/screen/node/notice.js +44 -0
- package/organs/screen/node/presser.js +11 -0
- package/organs/screen/node/presses.js +108 -0
- package/organs/screen/node/program.d.ts +1 -0
- package/organs/screen/node/program.js +5 -0
- package/organs/screen/node/shown.js +205 -0
- package/organs/screen/node/standing.js +29 -0
- package/organs/screen/node/state.js +80 -0
- package/organs/screen/node/tell.js +47 -0
- package/organs/screen/node/uid.js +65 -0
- package/organs/screen/node/worn.js +23 -0
- package/organs/shell/index.d.ts +1 -0
- package/organs/shell/index.js +2 -0
- package/organs/shell/node/main.js +26 -0
- package/organs/shell/node/output.js +70 -0
- package/organs/shell/node/pressure.js +14 -0
- package/organs/shell/node/program.d.ts +1 -0
- package/organs/shell/node/program.js +5 -0
- package/organs/shell/node/runs.js +220 -0
- package/organs/shell/node/told.js +70 -0
- package/organs/shell/organ.d.ts +5 -0
- package/organs/shell/organ.js +59 -0
- package/package.json +43 -4
- package/src/command/act.d.ts +31 -0
- package/src/command/act.js +256 -0
- package/src/command/answers.d.ts +3 -0
- package/src/command/answers.js +232 -0
- package/src/command/args.d.ts +14 -0
- package/src/command/args.js +220 -0
- package/src/command/arrive.d.ts +2 -0
- package/src/command/arrive.js +21 -0
- package/src/command/asked.d.ts +18 -0
- package/src/command/asked.js +49 -0
- package/src/command/backup.d.ts +18 -0
- package/src/command/backup.js +261 -0
- package/src/command/before.d.ts +41 -0
- package/src/command/before.js +237 -0
- package/src/command/born.d.ts +27 -0
- package/src/command/born.js +103 -0
- package/src/command/bridge.d.ts +19 -0
- package/src/command/bridge.js +152 -0
- package/src/command/chain.d.ts +9 -0
- package/src/command/chain.js +48 -0
- package/src/command/channel.d.ts +29 -0
- package/src/command/channel.js +263 -0
- package/src/command/choices.d.ts +35 -0
- package/src/command/choices.js +173 -0
- package/src/command/claim.d.ts +12 -0
- package/src/command/claim.js +46 -0
- package/src/command/commands.d.ts +16 -0
- package/src/command/commands.js +257 -0
- package/src/command/ends.d.ts +16 -0
- package/src/command/ends.js +78 -0
- package/src/command/follow.d.ts +12 -0
- package/src/command/follow.js +66 -0
- package/src/command/given.d.ts +39 -0
- package/src/command/given.js +53 -0
- package/src/command/held.d.ts +15 -0
- package/src/command/held.js +56 -0
- package/src/command/index.d.ts +1 -0
- package/src/command/index.js +203 -0
- package/src/command/jailer.d.ts +28 -0
- package/src/command/jailer.js +135 -0
- package/src/command/laid.d.ts +6 -0
- package/src/command/laid.js +31 -0
- package/src/command/left.d.ts +9 -0
- package/src/command/left.js +34 -0
- package/src/command/line.d.ts +7 -0
- package/src/command/line.js +39 -0
- package/src/command/link.d.ts +30 -0
- package/src/command/link.js +123 -0
- package/src/command/lobes.d.ts +1 -0
- package/src/command/lobes.js +10 -0
- package/src/command/locks.d.ts +17 -0
- package/src/command/locks.js +76 -0
- package/src/command/mcp/calls.d.ts +27 -0
- package/src/command/mcp/calls.js +155 -0
- package/src/command/mcp/notices.d.ts +22 -0
- package/src/command/mcp/notices.js +203 -0
- package/src/command/mcp/resources.d.ts +31 -0
- package/src/command/mcp/resources.js +108 -0
- package/src/command/mcp/server.d.ts +19 -0
- package/src/command/mcp/server.js +149 -0
- package/src/command/mcp/tools.d.ts +39 -0
- package/src/command/mcp/tools.js +131 -0
- package/src/command/mcp.d.ts +8 -0
- package/src/command/mcp.js +39 -0
- package/src/command/noticed.d.ts +11 -0
- package/src/command/noticed.js +55 -0
- package/src/command/older.d.ts +11 -0
- package/src/command/older.js +45 -0
- package/src/command/open.d.ts +24 -0
- package/src/command/open.js +107 -0
- package/src/command/passphrase.d.ts +6 -0
- package/src/command/passphrase.js +82 -0
- package/src/command/reclaim.d.ts +7 -0
- package/src/command/reclaim.js +47 -0
- package/src/command/refused.d.ts +4 -0
- package/src/command/refused.js +27 -0
- package/src/command/release.d.ts +27 -0
- package/src/command/release.js +153 -0
- package/src/command/repo.d.ts +31 -0
- package/src/command/repo.js +133 -0
- package/src/command/rewrap.d.ts +16 -0
- package/src/command/rewrap.js +175 -0
- package/src/command/runtime.d.ts +25 -0
- package/src/command/runtime.js +175 -0
- package/src/command/salvage.d.ts +4 -0
- package/src/command/salvage.js +42 -0
- package/src/command/screen.d.ts +14 -0
- package/src/command/screen.js +62 -0
- package/src/command/spawn.d.ts +23 -0
- package/src/command/spawn.js +213 -0
- package/src/command/start.d.ts +34 -0
- package/src/command/start.js +246 -0
- package/src/command/state.d.ts +5 -0
- package/src/command/state.js +39 -0
- package/src/command/token.d.ts +1 -0
- package/src/command/token.js +9 -0
- package/src/command/trial.d.ts +17 -0
- package/src/command/trial.js +92 -0
- package/src/command/vouch.d.ts +1 -0
- package/src/command/vouch.js +15 -0
- package/src/command/windows-processes.d.ts +2 -0
- package/src/command/windows-processes.js +22 -0
- package/src/command/wipe.d.ts +9 -0
- package/src/command/wipe.js +105 -0
- package/src/command/words.d.ts +5 -0
- package/src/command/words.js +53 -0
- package/src/door/claim.d.ts +5 -0
- package/src/door/claim.js +21 -0
- package/src/door/claimed.d.ts +7 -0
- package/src/door/claimed.js +110 -0
- package/src/door/configuration.d.ts +40 -0
- package/src/door/configuration.js +206 -0
- package/src/door/design.d.ts +13 -0
- package/src/door/design.js +71 -0
- package/src/door/digests.d.ts +7 -0
- package/src/door/digests.js +36 -0
- package/src/door/distribution.d.ts +25 -0
- package/src/door/distribution.js +88 -0
- package/src/door/door.d.ts +41 -0
- package/src/door/door.js +219 -0
- package/src/door/dressed.d.ts +34 -0
- package/src/door/dressed.js +182 -0
- package/src/door/faculties.d.ts +29 -0
- package/src/door/faculties.js +88 -0
- package/src/door/longest.d.ts +6 -0
- package/src/door/longest.js +25 -0
- package/src/fills/account-only.d.ts +3 -0
- package/src/fills/account-only.js +24 -0
- package/src/fills/boot-key.d.ts +21 -0
- package/src/fills/boot-key.js +70 -0
- package/src/fills/boot-move.d.ts +25 -0
- package/src/fills/boot-move.js +86 -0
- package/src/fills/bridge.d.ts +13 -0
- package/src/fills/bridge.js +86 -0
- package/src/fills/chance.d.ts +2 -0
- package/src/fills/chance.js +7 -0
- package/src/fills/crypto.d.ts +2 -0
- package/src/fills/crypto.js +94 -0
- package/src/fills/flushed.d.ts +9 -0
- package/src/fills/flushed.js +80 -0
- package/src/fills/hardware.d.ts +18 -0
- package/src/fills/hardware.js +70 -0
- package/src/fills/held.d.ts +31 -0
- package/src/fills/held.js +171 -0
- package/src/fills/keepers.d.ts +23 -0
- package/src/fills/keepers.js +151 -0
- package/src/fills/keyring.d.ts +19 -0
- package/src/fills/keyring.js +131 -0
- package/src/fills/pages.d.ts +3 -0
- package/src/fills/pages.js +260 -0
- package/src/fills/reserve.d.ts +11 -0
- package/src/fills/reserve.js +72 -0
- package/src/fills/time.d.ts +2 -0
- package/src/fills/time.js +29 -0
- package/src/fills/unlocker.d.ts +6 -0
- package/src/fills/unlocker.js +26 -0
- package/src/fills/vitals.d.ts +8 -0
- package/src/fills/vitals.js +100 -0
- package/src/fills/windows-start.d.ts +2 -0
- package/src/fills/windows-start.js +21 -0
- package/src/halves/build.d.ts +10 -0
- package/src/halves/build.js +219 -0
- package/src/halves/end.d.ts +17 -0
- package/src/halves/end.js +157 -0
- package/src/halves/genome.d.ts +3 -0
- package/src/halves/genome.js +21 -0
- package/src/halves/handler.d.ts +8 -0
- package/src/halves/handler.js +40 -0
- package/src/halves/index.d.ts +5 -0
- package/src/halves/index.js +6 -0
- package/src/halves/laid.d.ts +12 -0
- package/src/halves/laid.js +103 -0
- package/src/halves/lent.d.ts +6 -0
- package/src/halves/lent.js +147 -0
- package/src/halves/native.d.ts +12 -0
- package/src/halves/native.js +53 -0
- package/src/halves/statements.d.ts +23 -0
- package/src/halves/statements.js +165 -0
- package/src/halves/tokens.d.ts +22 -0
- package/src/halves/tokens.js +135 -0
- package/src/link/link.d.ts +4 -0
- package/src/link/link.js +4 -0
- package/src/link/placeholder.d.ts +1 -0
- package/src/link/placeholder.js +21 -0
- package/src/link/steps.d.ts +52 -0
- package/src/link/steps.js +118 -0
- package/src/lobes/calls.d.ts +76 -0
- package/src/lobes/calls.js +61 -0
- package/src/lobes/channel.d.ts +76 -0
- package/src/lobes/channel.js +202 -0
- package/src/lobes/index.d.ts +1 -0
- package/src/lobes/index.js +2 -0
- package/src/lobes/lobes.d.ts +15 -0
- package/src/lobes/lobes.js +244 -0
- package/src/lobes/main.js +107 -0
- package/src/lobes/thread.d.ts +22 -0
- package/src/lobes/thread.js +270 -0
- package/src/organism/act.d.ts +8 -0
- package/src/organism/act.js +63 -0
- package/src/organism/beat.d.ts +5 -0
- package/src/organism/beat.js +45 -0
- package/src/organism/compiled.d.ts +2 -0
- package/src/organism/compiled.js +24 -0
- package/src/organism/folder.d.ts +88 -0
- package/src/organism/folder.js +259 -0
- package/src/organism/main.d.ts +1 -0
- package/src/organism/main.js +11 -0
- package/src/organism/organism.d.ts +1 -0
- package/src/organism/organism.js +219 -0
- package/src/organism/said.d.ts +12 -0
- package/src/organism/said.js +30 -0
- package/src/organism/told.d.ts +5 -0
- package/src/organism/told.js +110 -0
- package/src/organism/unlock.d.ts +8 -0
- package/src/organism/unlock.js +95 -0
- package/src/organism/upgrade.d.ts +24 -0
- package/src/organism/upgrade.js +145 -0
- package/src/organism/via.d.ts +7 -0
- package/src/organism/via.js +20 -0
- package/src/service/body.d.ts +8 -0
- package/src/service/body.js +34 -0
- package/src/service/handler.d.ts +20 -0
- package/src/service/handler.js +128 -0
- package/src/service/index.d.ts +4 -0
- package/src/service/index.js +16 -0
- package/src/service/manager.d.ts +18 -0
- package/src/service/manager.js +185 -0
- package/src/service/service.d.ts +24 -0
- package/src/service/service.js +200 -0
- package/src/service/swap.d.ts +12 -0
- package/src/service/swap.js +74 -0
- package/src/service/watchdog.d.ts +6 -0
- package/src/service/watchdog.js +31 -0
- package/src/tcp/crowd.d.ts +18 -0
- package/src/tcp/crowd.js +85 -0
- package/src/tcp/dial.d.ts +23 -0
- package/src/tcp/dial.js +102 -0
- package/src/tcp/frame.d.ts +23 -0
- package/src/tcp/frame.js +159 -0
- package/src/tcp/listen.d.ts +50 -0
- package/src/tcp/listen.js +207 -0
- package/src/tcp/source.d.ts +2 -0
- package/src/tcp/source.js +26 -0
- package/src/version/index.d.ts +1 -0
- package/src/version/index.js +2 -0
- package/src/version/version.d.ts +1 -0
- package/src/version/version.js +2 -0
- package/src/work/first.d.ts +11 -0
- package/src/work/first.js +91 -0
- package/src/work/index.d.ts +2 -0
- package/src/work/index.js +15 -0
- package/src/work/work.d.ts +20 -0
- package/src/work/work.js +136 -0
- package/src/ws/dial.d.ts +7 -0
- package/src/ws/dial.js +252 -0
- package/src/ws/dialing.d.ts +50 -0
- package/src/ws/dialing.js +72 -0
- package/src/ws/frame.d.ts +32 -0
- package/src/ws/frame.js +124 -0
- package/src/ws/handshake.d.ts +4 -0
- package/src/ws/handshake.js +27 -0
- package/src/ws/line.d.ts +45 -0
- package/src/ws/line.js +250 -0
- package/src/ws/listen.d.ts +42 -0
- package/src/ws/listen.js +272 -0
- package/src/ws/rfc6455.d.ts +18 -0
- package/src/ws/rfc6455.js +187 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// SPDX-License-Identifier: FSL-1.1-ALv2
|
|
2
|
+
import { bootKeyFileOf, drawnBootKey } from '../fills/boot-key.js';
|
|
3
|
+
import { movedBoot, nodeFiles, } from '../fills/boot-move.js';
|
|
4
|
+
import {
|
|
5
|
+
custodyOf,
|
|
6
|
+
fingerprintHere,
|
|
7
|
+
endCustodyOf,
|
|
8
|
+
hostHands,
|
|
9
|
+
humanEnds,
|
|
10
|
+
layFingerprint,
|
|
11
|
+
priceOf,
|
|
12
|
+
terminalOf,
|
|
13
|
+
|
|
14
|
+
} from '../fills/held.js';
|
|
15
|
+
import { KEEPER_SPAN } from '../fills/keepers.js';
|
|
16
|
+
import { bootKeyOf, saltOf } from '../fills/unlocker.js';
|
|
17
|
+
import { folderText, readFolder, } from '../organism/folder.js';
|
|
18
|
+
import { passphraseTwice } from './commands.js';
|
|
19
|
+
import { organismOf, } from './given.js';
|
|
20
|
+
import { bootKeyIn, doorHere, stoppedHere } from './held.js';
|
|
21
|
+
import { startedOn } from './start.js';
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const nextOf = async (given , laid ) => {
|
|
27
|
+
if (!humanEnds(laid)) return drawnBootKey();
|
|
28
|
+
given.print('The new passphrase opens the organism from then on.');
|
|
29
|
+
const passphrase = await passphraseTwice(given.asker, given.short);
|
|
30
|
+
if (typeof passphrase !== 'string') return passphrase;
|
|
31
|
+
if (!('salt' in laid) || laid.salt === undefined) return { why: 'the folder holds no salt for its passphrase' };
|
|
32
|
+
return bootKeyOf(passphrase, laid.salt);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const keyAfter = (changed , next , old ) =>
|
|
36
|
+
changed === null ? next : old;
|
|
37
|
+
|
|
38
|
+
export const rewrapEnded = (started , changed ) => {
|
|
39
|
+
if (started !== null) return started;
|
|
40
|
+
return changed === null ? null : { why: `the boot key is not changed: ${changed.why}` };
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const rewrapSaid = (bootMode , home ) => {
|
|
44
|
+
if (bootMode === 'file')
|
|
45
|
+
return `The boot key is changed: ${bootKeyFileOf(home)} holds the new one, which alone opens the organism.`;
|
|
46
|
+
return bootMode === 'present'
|
|
47
|
+
? 'The boot key is changed: the new passphrase alone opens the organism.'
|
|
48
|
+
: `The boot key is changed: the ${bootMode} mode holds the new one, which alone opens the organism.`;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const laidIn = (laid , mode , salt , end ) => {
|
|
52
|
+
if (mode === 'present') return { ...laid, bootMode: 'present', salt };
|
|
53
|
+
const { salt: _gone, ...rest } = { ...laid, salt };
|
|
54
|
+
if (mode === 'remote') {
|
|
55
|
+
const ending = end ?? 'present';
|
|
56
|
+
return ending === 'present'
|
|
57
|
+
? { ...rest, bootMode: 'remote', end: ending, salt }
|
|
58
|
+
: { ...rest, bootMode: 'remote', end: ending };
|
|
59
|
+
}
|
|
60
|
+
return { ...rest, bootMode: mode };
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const keepersGiven = async (
|
|
64
|
+
given ,
|
|
65
|
+
hands ,
|
|
66
|
+
home ,
|
|
67
|
+
moved ,
|
|
68
|
+
key ,
|
|
69
|
+
) => {
|
|
70
|
+
if (moved.bootMode !== 'remote') return null;
|
|
71
|
+
const fingerprint = fingerprintHere(moved, home);
|
|
72
|
+
const keepers = hands.keepers(home, moved.keeperSpan ?? KEEPER_SPAN);
|
|
73
|
+
for (const invitation of given.keepers) {
|
|
74
|
+
const added = await keepers.added(invitation, key, fingerprint);
|
|
75
|
+
if (added !== null) return added;
|
|
76
|
+
}
|
|
77
|
+
layFingerprint(home, fingerprint);
|
|
78
|
+
return null;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const hostRefuses = (moved , hands ) => {
|
|
82
|
+
const end = terminalOf(moved);
|
|
83
|
+
if (end === 'keyring' && 'why' in hands.keyring) return hands.keyring;
|
|
84
|
+
return end === 'hardware' && 'why' in hands.board ? hands.board : null;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const bootMoved = async (
|
|
88
|
+
given ,
|
|
89
|
+
home ,
|
|
90
|
+
laid ,
|
|
91
|
+
mode ,
|
|
92
|
+
files = nodeFiles,
|
|
93
|
+
) => {
|
|
94
|
+
const old = await bootKeyIn(given, home, laid);
|
|
95
|
+
if ('why' in old) return old;
|
|
96
|
+
const salt = saltOf();
|
|
97
|
+
const moved = laidIn(laid, mode, salt, given.end);
|
|
98
|
+
const hands = given.hands ?? hostHands();
|
|
99
|
+
const passphrase = humanEnds(moved) ? await passphraseTwice(given.asker, given.short) : null;
|
|
100
|
+
if (passphrase !== null && typeof passphrase !== 'string') return passphrase;
|
|
101
|
+
const next = passphrase === null ? drawnBootKey() : await bootKeyOf(passphrase, salt);
|
|
102
|
+
const custody = moved.bootMode === 'file' || moved.bootMode === 'present' ? null : endCustodyOf(home, moved, hands);
|
|
103
|
+
const refused = hostRefuses(moved, hands);
|
|
104
|
+
if (refused !== null) return refused;
|
|
105
|
+
const halted = await stoppedHere(home);
|
|
106
|
+
if (halted !== null) return halted;
|
|
107
|
+
const opened = await doorHere(given, home, laid, { kind: 'boot' }, old.key);
|
|
108
|
+
if ('why' in opened) return (await startedOn(home, humanEnds(laid) ? old.key : null)) ?? opened;
|
|
109
|
+
let open = true;
|
|
110
|
+
const shut = async () => {
|
|
111
|
+
if (open) await opened.door.stop();
|
|
112
|
+
open = false;
|
|
113
|
+
};
|
|
114
|
+
const keep = custody === null ? {} : { keep: (one ) => custody.keep(one) };
|
|
115
|
+
const changed = await movedBoot(
|
|
116
|
+
files,
|
|
117
|
+
home,
|
|
118
|
+
{ key: next, folder: folderText(moved), mode: mode === 'file' ? 'file' : 'present', ...keep },
|
|
119
|
+
async () => {
|
|
120
|
+
const taken = await opened.door.rewrap(next);
|
|
121
|
+
await shut();
|
|
122
|
+
return taken;
|
|
123
|
+
},
|
|
124
|
+
).finally(shut);
|
|
125
|
+
if (changed !== null) {
|
|
126
|
+
const started = await startedOn(home, humanEnds(laid) ? old.key : null);
|
|
127
|
+
return started ?? { why: `the boot mode is not moved: ${changed.why}` };
|
|
128
|
+
}
|
|
129
|
+
const added = await keepersGiven(given, hands, home, moved, next);
|
|
130
|
+
if (added !== null) return added;
|
|
131
|
+
const key = humanEnds(moved) ? next : null;
|
|
132
|
+
const started = await startedOn(home, key);
|
|
133
|
+
if (started !== null) return started;
|
|
134
|
+
given.print(custody === null ? rewrapSaid(mode, home) : `${rewrapSaid(mode, home)} ${priceOf(home, moved)}`);
|
|
135
|
+
return { key, laid: moved };
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const changedBy = async (
|
|
139
|
+
given ,
|
|
140
|
+
files ,
|
|
141
|
+
way ,
|
|
142
|
+
) => {
|
|
143
|
+
const home = organismOf(given.home);
|
|
144
|
+
const folder = readFolder(home);
|
|
145
|
+
if ('why' in folder) return folder;
|
|
146
|
+
const { laid } = folder;
|
|
147
|
+
const old = await bootKeyIn(given, home, laid);
|
|
148
|
+
if ('why' in old) return old;
|
|
149
|
+
const next = await nextOf(given, laid);
|
|
150
|
+
if ('why' in next) return next;
|
|
151
|
+
const halted = await stoppedHere(home);
|
|
152
|
+
if (halted !== null) return halted;
|
|
153
|
+
const opened = await doorHere(given, home, laid, { kind: 'boot' }, old.key);
|
|
154
|
+
const custody =
|
|
155
|
+
laid.bootMode === 'file' || laid.bootMode === 'present' ? null : custodyOf(home, laid, given.hands ?? hostHands());
|
|
156
|
+
const taken = async (door ) => {
|
|
157
|
+
if (laid.bootMode === 'file') return movedBoot(files, home, { key: next, mode: 'file' }, () => way(door, next));
|
|
158
|
+
return custody === null
|
|
159
|
+
? way(door, next)
|
|
160
|
+
: movedBoot(files, home, { key: next, mode: 'present', keep: (one) => custody.keep(one) }, () => way(door, next));
|
|
161
|
+
};
|
|
162
|
+
const changed = 'why' in opened ? opened : await taken(opened.door).finally(() => opened.door.stop());
|
|
163
|
+
const key = keyAfter(changed, next, old.key);
|
|
164
|
+
const started = await startedOn(home, humanEnds(laid) ? key : null);
|
|
165
|
+
const ended = rewrapEnded(started, changed);
|
|
166
|
+
if (ended !== null) return ended;
|
|
167
|
+
given.print(rewrapSaid(laid.bootMode, home));
|
|
168
|
+
return null;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const rewrap = (given , files = nodeFiles) =>
|
|
172
|
+
changedBy(given, files, (door, next) => door.rewrap(next));
|
|
173
|
+
|
|
174
|
+
export const rekey = (given , files = nodeFiles) =>
|
|
175
|
+
changedBy(given, files, (door, next) => door.rekey(next, given.cipher ?? undefined));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type Why = {
|
|
2
|
+
readonly why: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const MARK = ".nervur-node";
|
|
5
|
+
export declare const READY = ".nervur-node.ready";
|
|
6
|
+
export declare const PINS: string;
|
|
7
|
+
export type Pins = {
|
|
8
|
+
readonly version: string;
|
|
9
|
+
readonly digests: Readonly<Record<string, string>>;
|
|
10
|
+
};
|
|
11
|
+
export type NodeReach = {
|
|
12
|
+
readonly execPath: string;
|
|
13
|
+
readonly version: string;
|
|
14
|
+
readonly platform: NodeJS.Platform;
|
|
15
|
+
readonly arch: string;
|
|
16
|
+
readonly site: string;
|
|
17
|
+
readonly fetched: (url: string) => Promise<Uint8Array | Why>;
|
|
18
|
+
};
|
|
19
|
+
export declare const NODE: NodeReach;
|
|
20
|
+
export declare const scriptRoot: (reach: NodeReach) => string | null;
|
|
21
|
+
export declare const pinsIn: (folder: string) => Pins | null | Why;
|
|
22
|
+
export declare const nodeMoved: (root: string, windows: boolean) => void;
|
|
23
|
+
export declare const nodeFinished: (reach?: NodeReach) => null | Why;
|
|
24
|
+
export declare const nodeLaid: (folder: string, reach?: NodeReach) => Promise<null | Why>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// SPDX-License-Identifier: FSL-1.1-ALv2
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { existsSync, lstatSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { readFile } from 'node:fs/promises';
|
|
6
|
+
import { dirname, join } from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { isFields, readText } from '@nervur.org/genome/standard';
|
|
9
|
+
import { foldersLaid, movedWhole, treeFlushed } from '../fills/flushed.js';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const MARK = '.nervur-node';
|
|
14
|
+
const TAKING = `${MARK}.taking`;
|
|
15
|
+
export const READY = `${MARK}.ready`;
|
|
16
|
+
const GONE = `${MARK}.gone`;
|
|
17
|
+
|
|
18
|
+
export const PINS = join('install', 'node.json');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
const VERSION = /^\d+\.\d+\.\d+$/u;
|
|
34
|
+
const DIGEST = /^[0-9a-f]{64}$/u;
|
|
35
|
+
|
|
36
|
+
const fetched = async (url ) => {
|
|
37
|
+
try {
|
|
38
|
+
if (url.startsWith('file:')) return new Uint8Array(await readFile(fileURLToPath(url)));
|
|
39
|
+
const answer = await fetch(url);
|
|
40
|
+
return answer.ok ? new Uint8Array(await answer.arrayBuffer()) : { why: `it answered ${answer.status}` };
|
|
41
|
+
} catch (thrown) {
|
|
42
|
+
return { why: thrown instanceof Error ? thrown.message : String(thrown) };
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const named = process.env['NERVUR_NODE'];
|
|
47
|
+
|
|
48
|
+
export const NODE = {
|
|
49
|
+
execPath: process.execPath,
|
|
50
|
+
version: process.version,
|
|
51
|
+
platform: process.platform,
|
|
52
|
+
arch: process.arch,
|
|
53
|
+
site: (named === undefined || named === '' ? 'https://nodejs.org/dist' : named).replace(/\/+$/u, ''),
|
|
54
|
+
fetched,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const onWindows = (reach ) => reach.platform === 'win32';
|
|
58
|
+
|
|
59
|
+
export const scriptRoot = (reach ) => {
|
|
60
|
+
const root = onWindows(reach) ? dirname(reach.execPath) : dirname(dirname(reach.execPath));
|
|
61
|
+
return existsSync(join(root, MARK)) ? root : null;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const pinsIn = (folder ) => {
|
|
65
|
+
const file = join(folder, PINS);
|
|
66
|
+
if (!existsSync(file)) return null;
|
|
67
|
+
const read = readText(readFileSync(file, 'utf8'));
|
|
68
|
+
const data = 'data' in read ? read.data : null;
|
|
69
|
+
const version = isFields(data) ? data['version'] : undefined;
|
|
70
|
+
const digests = isFields(data) ? data['digests'] : undefined;
|
|
71
|
+
if (typeof version !== 'string' || !VERSION.test(version) || !isFields(digests))
|
|
72
|
+
return { why: `${file} pins no Node: nothing changed` };
|
|
73
|
+
const each = Object.entries(digests).flatMap(([build, digest]) =>
|
|
74
|
+
typeof digest === 'string' && DIGEST.test(digest) ? [[build, digest] ] : [],
|
|
75
|
+
);
|
|
76
|
+
return { version, digests: Object.fromEntries(each) };
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const partsOf = (ready , root , within ) =>
|
|
80
|
+
readdirSync(join(ready, within)).flatMap((name) => {
|
|
81
|
+
const part = join(within, name);
|
|
82
|
+
const shared =
|
|
83
|
+
lstatSync(join(ready, part)).isDirectory() &&
|
|
84
|
+
!existsSync(join(ready, part, 'package.json')) &&
|
|
85
|
+
lstatSync(join(root, part), { throwIfNoEntry: false })?.isDirectory() === true;
|
|
86
|
+
return shared ? partsOf(ready, root, part) : [part];
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const goneLeft = (root , windows ) => {
|
|
90
|
+
try {
|
|
91
|
+
rmSync(join(root, GONE), { recursive: true, force: true });
|
|
92
|
+
} catch (thrown) {
|
|
93
|
+
if (!windows) throw thrown;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const partLaid = (root , part , windows ) => {
|
|
98
|
+
const at = join(root, part);
|
|
99
|
+
const stands = lstatSync(at, { throwIfNoEntry: false });
|
|
100
|
+
if (stands !== undefined && (windows || stands.isDirectory())) {
|
|
101
|
+
const aside = join(root, GONE, part);
|
|
102
|
+
foldersLaid(dirname(aside), 0o700);
|
|
103
|
+
movedWhole(at, aside);
|
|
104
|
+
}
|
|
105
|
+
foldersLaid(dirname(at), 0o755);
|
|
106
|
+
movedWhole(join(root, READY, part), at);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const nodeMoved = (root , windows ) => {
|
|
110
|
+
rmSync(join(root, TAKING), { recursive: true, force: true });
|
|
111
|
+
goneLeft(root, windows);
|
|
112
|
+
const ready = join(root, READY);
|
|
113
|
+
if (!existsSync(ready)) return;
|
|
114
|
+
const program = windows ? 'node.exe' : join('bin', 'node');
|
|
115
|
+
const last = (part ) => (part === program ? 1 : 0);
|
|
116
|
+
for (const part of partsOf(ready, root, '').toSorted((one, other) => last(one) - last(other)))
|
|
117
|
+
partLaid(root, part, windows);
|
|
118
|
+
rmSync(ready, { recursive: true, force: true });
|
|
119
|
+
goneLeft(root, windows);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const nodeFinished = (reach = NODE) => {
|
|
123
|
+
const root = scriptRoot(reach);
|
|
124
|
+
if (root === null) return null;
|
|
125
|
+
try {
|
|
126
|
+
nodeMoved(root, onWindows(reach));
|
|
127
|
+
return null;
|
|
128
|
+
} catch (thrown) {
|
|
129
|
+
return {
|
|
130
|
+
why: `the Node at ${root} is not moved whole: ${thrown instanceof Error ? thrown.message : String(thrown)}`,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const unpacked = (root , name , bytes , windows ) => {
|
|
136
|
+
const taking = join(root, TAKING);
|
|
137
|
+
foldersLaid(taking, 0o755);
|
|
138
|
+
const archive = join(taking, name);
|
|
139
|
+
writeFileSync(archive, bytes);
|
|
140
|
+
try {
|
|
141
|
+
execFileSync('tar', [windows ? '-xf' : '-xzpf', archive, '-C', taking, '--strip-components=1'], {
|
|
142
|
+
stdio: 'ignore',
|
|
143
|
+
});
|
|
144
|
+
} catch {
|
|
145
|
+
rmSync(taking, { recursive: true, force: true });
|
|
146
|
+
return { why: `${name} could not be unpacked: nothing changed` };
|
|
147
|
+
}
|
|
148
|
+
for (const left of [archive, join(taking, 'include'), join(taking, 'share')])
|
|
149
|
+
rmSync(left, { recursive: true, force: true });
|
|
150
|
+
treeFlushed(taking);
|
|
151
|
+
movedWhole(taking, join(root, READY));
|
|
152
|
+
return null;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const sha256 = (bytes ) => createHash('sha256').update(bytes).digest('hex');
|
|
156
|
+
|
|
157
|
+
export const nodeLaid = async (folder , reach = NODE) => {
|
|
158
|
+
const root = scriptRoot(reach);
|
|
159
|
+
if (root === null) return null;
|
|
160
|
+
const pins = pinsIn(folder);
|
|
161
|
+
if (pins === null || 'why' in pins) return pins;
|
|
162
|
+
if (reach.version === `v${pins.version}`) return null;
|
|
163
|
+
const build = `${onWindows(reach) ? 'win' : reach.platform}-${reach.arch}`;
|
|
164
|
+
const name = `node-v${pins.version}-${build}.${onWindows(reach) ? 'zip' : 'tar.gz'}`;
|
|
165
|
+
const digest = pins.digests[build];
|
|
166
|
+
if (digest === undefined) return { why: `the release pins no Node for ${build}: nothing changed` };
|
|
167
|
+
const bytes = await reach.fetched(`${reach.site}/v${pins.version}/${name}`);
|
|
168
|
+
if (!(bytes instanceof Uint8Array)) return { why: `${reach.site} gave no ${name}, ${bytes.why}: nothing changed` };
|
|
169
|
+
if (sha256(bytes) !== digest)
|
|
170
|
+
return { why: `the Node from ${reach.site} is not the one the release pins, ${digest}: nothing changed` };
|
|
171
|
+
const finished = nodeFinished(reach);
|
|
172
|
+
if (finished !== null) return finished;
|
|
173
|
+
const laid = unpacked(root, name, bytes, onWindows(reach));
|
|
174
|
+
return laid ?? nodeFinished(reach);
|
|
175
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Salvaged } from '@nervur.org/genome';
|
|
2
|
+
import { type Given, type Outcome } from './given.js';
|
|
3
|
+
export declare const saidOf: ({ rows, unread, lost, log, behind, hurt }: Salvaged, file: string) => readonly string[];
|
|
4
|
+
export declare const salvage: (given: Given) => Promise<Outcome>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// SPDX-License-Identifier: FSL-1.1-ALv2
|
|
2
|
+
import { chmodSync, copyFileSync, existsSync, rmSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { SALVAGED, } from '@nervur.org/genome';
|
|
5
|
+
import { salvageAt, storeOf } from '../door/door.js';
|
|
6
|
+
import { readFolder } from '../organism/folder.js';
|
|
7
|
+
import { organismOf, } from './given.js';
|
|
8
|
+
import { bootKeyIn, stoppedHere } from './held.js';
|
|
9
|
+
|
|
10
|
+
export const saidOf = ({ rows, unread, lost, log, behind, hurt } , file ) => [
|
|
11
|
+
`${rows} rows still open, in ${file}, read by your account alone. The store stands as it stood.`,
|
|
12
|
+
...(unread.length === 0
|
|
13
|
+
? []
|
|
14
|
+
: [`Left out, as they read not: ${unread.map(({ lobe, key }) => `${lobe} ${key}`).join(', ')}.`]),
|
|
15
|
+
...(lost.length === 0 ? [] : [`A page that reads not may have held rows of: ${lost.join(', ')}.`]),
|
|
16
|
+
...(log
|
|
17
|
+
? [`The log read short${behind > 0 ? ` by ${behind} commits` : ''}: what is here is older than the last answer.`]
|
|
18
|
+
: []),
|
|
19
|
+
hurt
|
|
20
|
+
? "The brain's rows are hurt, so no organism stands on this: nervur restore refuses it, and a lobe's cells stand in it as raw data, in the public form, for any reader with the key."
|
|
21
|
+
: 'nervur restore lays it where no store stands, as an older backup: every relation given is dropped, to give again.',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export const salvage = async (given ) => {
|
|
25
|
+
const home = organismOf(given.home);
|
|
26
|
+
const folder = readFolder(home);
|
|
27
|
+
if ('why' in folder) return folder;
|
|
28
|
+
const file = given.words[1] ?? `salvaged-${Date.now()}.backup`;
|
|
29
|
+
if (existsSync(file)) return { why: `${file} stands already, and a backup is never written over a file` };
|
|
30
|
+
const key = await bootKeyIn(given, home, folder.laid);
|
|
31
|
+
if ('why' in key) return key;
|
|
32
|
+
const ended = await stoppedHere(home);
|
|
33
|
+
if (ended !== null) return ended;
|
|
34
|
+
const made = await salvageAt(home, key.key);
|
|
35
|
+
if ('why' in made) return { why: `nothing is salvaged: ${made.why}` };
|
|
36
|
+
const beside = join(storeOf(home), SALVAGED);
|
|
37
|
+
copyFileSync(beside, file);
|
|
38
|
+
chmodSync(file, 0o600);
|
|
39
|
+
rmSync(beside);
|
|
40
|
+
for (const line of saidOf(made, file)) given.print(line);
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Fields } from '@nervur.org/genome/standard';
|
|
2
|
+
import { type Laid } from '../organism/folder.js';
|
|
3
|
+
import { type Given, type Outcome } from './given.js';
|
|
4
|
+
export declare const addressOf: (laid: Laid, home: string, platform: NodeJS.Platform) => {
|
|
5
|
+
readonly address: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly why: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const screenOf: (state: Fields) => {
|
|
10
|
+
readonly address: string;
|
|
11
|
+
} | {
|
|
12
|
+
readonly why: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const screen: ({ home, answer }: Given) => Promise<Outcome>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// SPDX-License-Identifier: FSL-1.1-ALv2
|
|
2
|
+
import { SCREEN } from '@nervur.org/genome';
|
|
3
|
+
import { dataText, isFields, } from '@nervur.org/genome/standard';
|
|
4
|
+
import { configurationOf } from '../door/configuration.js';
|
|
5
|
+
import { readFolder, } from '../organism/folder.js';
|
|
6
|
+
import { stateAt } from './asked.js';
|
|
7
|
+
import { organismOf, } from './given.js';
|
|
8
|
+
import { runningOf } from './spawn.js';
|
|
9
|
+
|
|
10
|
+
const ANY = 'the screen listens on any free port, which only the organism knows';
|
|
11
|
+
|
|
12
|
+
const surfaceOf = (reach ) => {
|
|
13
|
+
const port = isFields(reach) ? reach['port'] : undefined;
|
|
14
|
+
return typeof port === 'number' && port > 0 ? { address: `http://127.0.0.1:${port}/` } : { why: ANY };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const addressOf = (
|
|
18
|
+
laid ,
|
|
19
|
+
home ,
|
|
20
|
+
platform ,
|
|
21
|
+
) => {
|
|
22
|
+
const reach = configurationOf(laid, home, platform).installerOrgans?.[SCREEN.id]?.reach;
|
|
23
|
+
return reach === undefined
|
|
24
|
+
? {
|
|
25
|
+
why: 'this host holds no screen: a person sits at a desktop, and a server is seen through the relations of an organism that has one',
|
|
26
|
+
}
|
|
27
|
+
: surfaceOf(reach);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const screenOf = (state ) => {
|
|
31
|
+
const organs = Array.isArray(state['organs']) ? state['organs'] : [];
|
|
32
|
+
const organ = organs.find((one) => isFields(one) && one['id'] === SCREEN.id);
|
|
33
|
+
if (!isFields(organ)) return { why: 'this organism holds no screen' };
|
|
34
|
+
const nodes = Array.isArray(state['nodes']) ? state['nodes'] : [];
|
|
35
|
+
const statuses = nodes.flatMap((node) =>
|
|
36
|
+
isFields(node) && Array.isArray(node['wires'])
|
|
37
|
+
? node['wires'].flatMap((wire) =>
|
|
38
|
+
isFields(wire) && wire['termination'] === SCREEN.id && typeof wire['status'] === 'string'
|
|
39
|
+
? [wire['status']]
|
|
40
|
+
: [],
|
|
41
|
+
)
|
|
42
|
+
: [],
|
|
43
|
+
);
|
|
44
|
+
if (statuses.includes('connected')) return surfaceOf(organ['reach'] ?? null);
|
|
45
|
+
const why = typeof organ['why'] === 'string' ? `: ${organ['why']}` : '';
|
|
46
|
+
return { why: `this home's screen is not available, ${statuses[0] ?? 'no lobe stands on it'}${why}` };
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const screen = async ({ home, answer } ) => {
|
|
50
|
+
const organism = organismOf(home);
|
|
51
|
+
const read = readFolder(organism);
|
|
52
|
+
if ('why' in read) return read;
|
|
53
|
+
const running = runningOf(organism) !== null;
|
|
54
|
+
let found ;
|
|
55
|
+
if (running) {
|
|
56
|
+
const state = await stateAt(organism);
|
|
57
|
+
found = 'why' in state ? state : screenOf(state.data);
|
|
58
|
+
} else found = addressOf(read.laid, organism, process.platform);
|
|
59
|
+
if ('why' in found) return found;
|
|
60
|
+
answer(dataText({ address: found.address, running }));
|
|
61
|
+
return null;
|
|
62
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Readable } from 'node:stream';
|
|
2
|
+
import { type Moves } from '../organism/said.js';
|
|
3
|
+
import type { Processes, Told } from './release.js';
|
|
4
|
+
export declare const endedUnasked: (code: number | null, signal: NodeJS.Signals | null, log: string) => string;
|
|
5
|
+
export declare const LOADING: number;
|
|
6
|
+
export declare const processesTold: () => readonly Told[] | null;
|
|
7
|
+
export declare const alive: (pid: number) => boolean;
|
|
8
|
+
export declare const HOST_PROCESSES: Processes;
|
|
9
|
+
export declare const startsOn: (home: string) => readonly number[];
|
|
10
|
+
export declare const runningOf: (home: string) => number | null;
|
|
11
|
+
export declare const notRunningWhy: (organism: string) => string;
|
|
12
|
+
export declare const runsAtBoot: (home: string) => boolean;
|
|
13
|
+
export declare const startOrganism: (home: string, kind: 'first-install' | 'boot' | 'trial', key: Uint8Array | null, moves?: (said: Moves) => void) => Promise<null | {
|
|
14
|
+
readonly why: string;
|
|
15
|
+
}>;
|
|
16
|
+
export type Starting = {
|
|
17
|
+
readonly stdout: Readable;
|
|
18
|
+
readonly on: (event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void) => unknown;
|
|
19
|
+
readonly unref: () => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const heardFrom: (child: Starting, home: string, moves: (said: Moves) => void) => Promise<null | {
|
|
22
|
+
readonly why: string;
|
|
23
|
+
}>;
|