@webpodjs/sdk 0.2.7 → 0.3.0
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 +93 -15
- package/dist/agent/backend.d.ts +18 -1
- package/dist/agent/backend.js +275 -76
- package/dist/agent/backend.js.map +1 -1
- package/dist/agent/fs.d.ts +2 -2
- package/dist/agent/fs.js +3 -2
- package/dist/agent/fs.js.map +1 -1
- package/dist/agent/protocol.d.ts +40 -1
- package/dist/agent/protocol.js +39 -3
- package/dist/agent/protocol.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/exec/client.js +21 -6
- package/dist/exec/client.js.map +1 -1
- package/dist/exec/frame.js +5 -0
- package/dist/exec/frame.js.map +1 -1
- package/dist/fs/tar.d.ts +1 -1
- package/dist/fs/tar.js +8 -2
- package/dist/fs/tar.js.map +1 -1
- package/dist/fs/workspace.js +61 -30
- package/dist/fs/workspace.js.map +1 -1
- package/dist/host/backend.d.ts +11 -0
- package/dist/host/backend.js +68 -12
- package/dist/host/backend.js.map +1 -1
- package/dist/host/controller.d.ts +2 -0
- package/dist/host/controller.js +11 -4
- package/dist/host/controller.js.map +1 -1
- package/dist/host/devices.d.ts +19 -2
- package/dist/host/devices.js +37 -3
- package/dist/host/devices.js.map +1 -1
- package/dist/host-exec/controller.d.ts +153 -4
- package/dist/host-exec/controller.js +974 -66
- package/dist/host-exec/controller.js.map +1 -1
- package/dist/host-exec/protocol.d.ts +330 -4
- package/dist/host-exec/protocol.js +34 -0
- package/dist/host-exec/protocol.js.map +1 -1
- package/dist/host-exec/route.js +74 -13
- package/dist/host-exec/route.js.map +1 -1
- package/dist/host-exec/shim.d.ts +2 -2
- package/dist/host-exec/shim.js +69 -12
- package/dist/host-exec/shim.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/net/client.d.ts +5 -1
- package/dist/net/client.js +8 -4
- package/dist/net/client.js.map +1 -1
- package/dist/net/options.d.ts +14 -0
- package/dist/net/options.js +1 -1
- package/dist/net/options.js.map +1 -1
- package/dist/net/preview.d.ts +15 -1
- package/dist/net/preview.js +24 -4
- package/dist/net/preview.js.map +1 -1
- package/dist/output.d.ts +23 -0
- package/dist/output.js +161 -0
- package/dist/output.js.map +1 -0
- package/dist/pod.d.ts +21 -7
- package/dist/pod.js +165 -29
- package/dist/pod.js.map +1 -1
- package/dist/preview-relay.js +24 -7
- package/dist/preview-relay.js.map +1 -1
- package/dist/preview-serviceworker.js +71 -8
- package/dist/preview-serviceworker.js.map +1 -1
- package/dist/tools.d.ts +77 -0
- package/dist/tools.js +47 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +62 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* pool), then started once. A top-level process reports on the Worker itself; a child of another
|
|
7
7
|
* host process on the MessagePort it was started with (its owner: the parent Worker, or the
|
|
8
8
|
* controller for spawnSync and guest children).
|
|
9
|
+
*
|
|
10
|
+
* A wasm child (ChildSpec runner "wasi", T244) is a Worker of host-exec's dist/wasi-worker.js instead: the same boot and
|
|
11
|
+
* start (start's wasm: the module), no node in it.
|
|
9
12
|
*/
|
|
10
13
|
/** One 9P session of the FS Worker's workspace (T80, amber #2342). */
|
|
11
14
|
export interface HostSessionRef {
|
|
@@ -55,8 +58,20 @@ export interface BootMessage {
|
|
|
55
58
|
wasmModules?: Record<string, WebAssembly.Module>;
|
|
56
59
|
/** spawnSync and listen results (see SYNC_HEADER). */
|
|
57
60
|
ctl: SharedArrayBuffer;
|
|
58
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Int32 [0]: the next pid, shared by every process of the pod (children take theirs with Atomics.add); [1]: the
|
|
63
|
+
* controller's session, a random number not 0 (host-exec's file locks: an owner of another session is gone).
|
|
64
|
+
*/
|
|
59
65
|
pids: SharedArrayBuffer;
|
|
66
|
+
/** The CPUs the process reports (os.cpus(), os.availableParallelism(), navigator.hardwareConcurrency). */
|
|
67
|
+
cpus?: number;
|
|
68
|
+
/** The guest's network interfaces besides loopback (IPv4), as the process reports them (os.networkInterfaces()). */
|
|
69
|
+
ifaces?: {
|
|
70
|
+
name: string;
|
|
71
|
+
address: string;
|
|
72
|
+
netmask: string;
|
|
73
|
+
mac: string;
|
|
74
|
+
}[];
|
|
60
75
|
/** Read-only tree mounted at "/" (npm-tree.bin format). */
|
|
61
76
|
tree?: SharedArrayBuffer | ArrayBuffer;
|
|
62
77
|
/** node-lib.json's UTF-8 bytes, one copy for every Worker (else the Worker fetches it). */
|
|
@@ -76,6 +91,17 @@ export interface BootMessage {
|
|
|
76
91
|
tid: number;
|
|
77
92
|
name: string;
|
|
78
93
|
};
|
|
94
|
+
/** The controller starts wasm children on dist/wasi-worker.js (ChildSpec runner "wasi"): the route may pick them. */
|
|
95
|
+
wasi?: boolean;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* An fd of 3 and up a host process gives its child (spawn's stdio, both ways as libuv's socketpair): `sab` the pipe
|
|
99
|
+
* of what the child reads there (see pipe.ts); what it writes goes to its port as out messages with `fd`, its close as
|
|
100
|
+
* fd-end.
|
|
101
|
+
*/
|
|
102
|
+
export interface FdPipe {
|
|
103
|
+
fd: number;
|
|
104
|
+
sab: SharedArrayBuffer;
|
|
79
105
|
}
|
|
80
106
|
export interface StartMessage {
|
|
81
107
|
type: "start";
|
|
@@ -91,10 +117,17 @@ export interface StartMessage {
|
|
|
91
117
|
stdin: SharedArrayBuffer | null;
|
|
92
118
|
/** Owner of a child process; absent for a top-level one. */
|
|
93
119
|
port?: MessagePort;
|
|
120
|
+
/** A wasi Worker's program: its module's path (argv is the program's, argv[0] included). */
|
|
121
|
+
wasm?: string;
|
|
122
|
+
/** A wasi Worker's program: the MB its tool's manifest declares (memoryMB, T258), reserved before it starts, and for whom. */
|
|
123
|
+
memoryMB?: number;
|
|
124
|
+
what?: string;
|
|
94
125
|
/** Fallback tables' patterns: node children whose script they name run in the guest (spawn-route.js listedIn). */
|
|
95
126
|
guest?: string[];
|
|
96
127
|
/** A child with an IPC channel (fork): its fd (NODE_CHANNEL_FD), carried on `port` as ipc / ipc-end messages. */
|
|
97
128
|
ipc?: number;
|
|
129
|
+
/** A child's fds 3 and up (spawn's stdio): what it writes there goes to `port` as out messages with that fd. */
|
|
130
|
+
fds?: FdPipe[];
|
|
98
131
|
/** The guest shim's processes: which of fds 0-2 are terminals, and its size. */
|
|
99
132
|
tty?: [boolean, boolean, boolean];
|
|
100
133
|
size?: {
|
|
@@ -103,6 +136,13 @@ export interface StartMessage {
|
|
|
103
136
|
};
|
|
104
137
|
/** Each read of an empty stdin pipe reports stdin-want (stdin is handed over as it is read). */
|
|
105
138
|
stdinDemand?: boolean;
|
|
139
|
+
/** A detached child: its exit (or fallback) is reported here too (detached-exit), for when its owner is gone. */
|
|
140
|
+
detached?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* The bytes of its out messages (stdout, stderr, fds 3 and up) its owner took (OutCredit): its writes wait while it is
|
|
143
|
+
* OUT_WINDOW ahead, as on a pipe that is full (T287). Without it nothing waits.
|
|
144
|
+
*/
|
|
145
|
+
outCredit?: SharedArrayBuffer;
|
|
106
146
|
/** A thread: its environment port (node's internal port to the parent), the process's thread ids and prefix. */
|
|
107
147
|
thread?: {
|
|
108
148
|
envPort: MessagePort;
|
|
@@ -111,7 +151,29 @@ export interface StartMessage {
|
|
|
111
151
|
threadIds: SharedArrayBuffer;
|
|
112
152
|
bcPrefix: string;
|
|
113
153
|
shareEnv?: SharedArrayBuffer;
|
|
154
|
+
nodeOptions?: string;
|
|
114
155
|
};
|
|
156
|
+
/** The controller relays its ports' messages to its process's other threads (relay). */
|
|
157
|
+
relay?: boolean;
|
|
158
|
+
/** A WASIX program's wasm thread (a wasi Worker, wasix-thread): its program comes on `port` from the process. */
|
|
159
|
+
wasixThread?: boolean;
|
|
160
|
+
/** The signal dispositions its WASIX parent gave it (ChildSpec.signals): a WASIX program's proc_signals_get. */
|
|
161
|
+
signals?: {
|
|
162
|
+
sig: number;
|
|
163
|
+
disp: number;
|
|
164
|
+
}[];
|
|
165
|
+
/**
|
|
166
|
+
* Files of the guest's root put over the read-only tree as it starts (host-exec's ro-tree.js add): the pod's CA, its
|
|
167
|
+
* system bundle and the agent's hash directory as the guest has them (T330: a WASIX program's TLS, curl's), on one
|
|
168
|
+
* SharedArrayBuffer for every process.
|
|
169
|
+
*/
|
|
170
|
+
rootFiles?: RootFile[];
|
|
171
|
+
}
|
|
172
|
+
/** A file of the guest's root (StartMessage.rootFiles): its absolute path, mode (S_IFREG and the bits) and bytes; or a link (S_IFLNK), its target's. */
|
|
173
|
+
export interface RootFile {
|
|
174
|
+
path: string;
|
|
175
|
+
mode: number;
|
|
176
|
+
data: Uint8Array;
|
|
115
177
|
}
|
|
116
178
|
/** After start (the guest shim's processes): a signal for its handlers, the terminal's size, a stream without reader. */
|
|
117
179
|
export type ControlMessage = {
|
|
@@ -124,13 +186,33 @@ export type ControlMessage = {
|
|
|
124
186
|
} | {
|
|
125
187
|
type: "out-closed";
|
|
126
188
|
fd: 1 | 2;
|
|
189
|
+
}
|
|
190
|
+
/** A node child of the process that another process's kill (kill-pid) ended: its exit by that signal. */
|
|
191
|
+
| {
|
|
192
|
+
type: "child-exit";
|
|
193
|
+
pid: number;
|
|
194
|
+
signal: string;
|
|
195
|
+
}
|
|
196
|
+
/** A port's message another thread of its process relayed (relay); one of its own back, no thread has its end. */
|
|
197
|
+
| {
|
|
198
|
+
type: "relay" | "relay-bounced";
|
|
199
|
+
msg: unknown;
|
|
200
|
+
}
|
|
201
|
+
/** What the Worker's memory is (T289): answered with a mem message of the same id, at any time (before its start too). */
|
|
202
|
+
| {
|
|
203
|
+
type: "mem";
|
|
204
|
+
id: number;
|
|
205
|
+
}
|
|
206
|
+
/** A thread that ended, before it is terminated: answered (drained) once what came before is done. */
|
|
207
|
+
| {
|
|
208
|
+
type: "drain";
|
|
127
209
|
};
|
|
128
210
|
export type PageToWorker = BootMessage | StartMessage | ControlMessage;
|
|
129
211
|
/** A child process a host process starts; `runner` is the route its spawn-route.js chose. */
|
|
130
212
|
export interface ChildSpec {
|
|
131
213
|
pid: number;
|
|
132
214
|
ppid: number;
|
|
133
|
-
runner: "node" | "guest";
|
|
215
|
+
runner: "node" | "wasi" | "guest";
|
|
134
216
|
file: string;
|
|
135
217
|
argv: string[];
|
|
136
218
|
env: Record<string, string>;
|
|
@@ -140,8 +222,31 @@ export interface ChildSpec {
|
|
|
140
222
|
stdin?: SharedArrayBuffer | null;
|
|
141
223
|
/** node children: the fd of an IPC channel to the parent (fork), on the child's port. */
|
|
142
224
|
ipc?: number;
|
|
225
|
+
/** node children: fds 3 and up (spawn's stdio), each with the pipe of what comes in on it (see FdPipe). */
|
|
226
|
+
fds?: FdPipe[];
|
|
227
|
+
/** wasi children: the module's path. */
|
|
228
|
+
wasm?: string;
|
|
229
|
+
/** wasi children: the memory their tool's manifest declares (T258), and what they are (its reserve's words). */
|
|
230
|
+
memoryMB?: number;
|
|
231
|
+
what?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Its stdin is its parent's, which comes on demand (T361: the guest shim's, StartMessage.stdinDemand): it asks for it
|
|
234
|
+
* too (stdin-want), on its port (its owner passes it on) or, a spawnSync child, to the controller.
|
|
235
|
+
*/
|
|
236
|
+
stdinDemand?: boolean;
|
|
237
|
+
/** A WASIX parent's dispositions for it (T326: proc_spawn's; disp 1 ignore), as its start passes them on. */
|
|
238
|
+
signals?: {
|
|
239
|
+
sig: number;
|
|
240
|
+
disp: number;
|
|
241
|
+
}[];
|
|
143
242
|
/** Why a guest child is not a host one (the Worker's route). */
|
|
144
243
|
reason?: string;
|
|
244
|
+
/** spawn's detached: the child does not end with its parent (it is adopted, as by init). */
|
|
245
|
+
detached?: boolean;
|
|
246
|
+
/** node children: StartMessage.outCredit, which the owner (this spec's process) advances. */
|
|
247
|
+
outCredit?: SharedArrayBuffer;
|
|
248
|
+
/** guest children: the owner acknowledges their out messages (out-ack), and the controller sends OUT_WINDOW ahead. */
|
|
249
|
+
outAcks?: boolean;
|
|
145
250
|
}
|
|
146
251
|
/** A cross-thread port's two mailboxes, as its thread's end sees them. */
|
|
147
252
|
export interface ThreadBoxes {
|
|
@@ -159,6 +264,8 @@ export interface ThreadSpec {
|
|
|
159
264
|
/** null: SHARE_ENV (shareEnv). */
|
|
160
265
|
env: Record<string, string> | null;
|
|
161
266
|
execArgv: string[];
|
|
267
|
+
/** The thread's NODE_OPTIONS, as node's Worker takes them (its env's, else its process's, else its parent's own). */
|
|
268
|
+
nodeOptions?: string;
|
|
162
269
|
cwd: string;
|
|
163
270
|
envPort: MessagePort;
|
|
164
271
|
/** The environment port's mailboxes (receiveMessageOnPort while the thread cannot take realm messages). */
|
|
@@ -204,10 +311,42 @@ export type WorkerToPage = {
|
|
|
204
311
|
} & ChildSpec) | {
|
|
205
312
|
type: "reap";
|
|
206
313
|
pid: number;
|
|
314
|
+
}
|
|
315
|
+
/** A detached child ended (StartMessage.detached): what its owner got on its port, for when the owner is gone. */
|
|
316
|
+
| {
|
|
317
|
+
type: "detached-exit";
|
|
207
318
|
} | {
|
|
208
319
|
type: "kill";
|
|
209
320
|
pid: number;
|
|
210
321
|
signal?: string;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* process.kill of a pid that is not the process's own child, blocking on ctl for a KillResult: signal (a name; null
|
|
325
|
+
* for 0, the check) and its number. The guest's kill(2) checks the uid the controller started the process with.
|
|
326
|
+
*/
|
|
327
|
+
| {
|
|
328
|
+
type: "kill-pid";
|
|
329
|
+
pid: number;
|
|
330
|
+
signal: string | null;
|
|
331
|
+
signum: number;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* A program the host has not got (spawn-route: not found on the host): which of the paths its PATH gives (in order)
|
|
335
|
+
* the guest has one it can run of, blocking on ctl for a WhichResult. None: the spawn is ENOENT, as node's.
|
|
336
|
+
*/
|
|
337
|
+
| {
|
|
338
|
+
type: "guest-which";
|
|
339
|
+
candidates: string[];
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* The process will hold mb MB more than a node process (a tool's manifest memoryMB, T258: Pyodide's 220), blocking
|
|
343
|
+
* on ctl for a ReserveResult: granted within hostExec.memoryBudgetMB, or an error after hostExec.memoryWaitMs.
|
|
344
|
+
* `what` names it in that error. Only when the boot said `memory`.
|
|
345
|
+
*/
|
|
346
|
+
| {
|
|
347
|
+
type: "reserve";
|
|
348
|
+
mb: number;
|
|
349
|
+
what?: string;
|
|
211
350
|
} | {
|
|
212
351
|
type: "error";
|
|
213
352
|
message: string;
|
|
@@ -233,6 +372,12 @@ export type WorkerToPage = {
|
|
|
233
372
|
| {
|
|
234
373
|
type: "stdin-want";
|
|
235
374
|
bytes: number;
|
|
375
|
+
}
|
|
376
|
+
/** The answer to a mem message (host-exec's src/mem-report.js). */
|
|
377
|
+
| {
|
|
378
|
+
type: "mem";
|
|
379
|
+
id: number;
|
|
380
|
+
report: HostMemWorkerReport;
|
|
236
381
|
} | {
|
|
237
382
|
type: "trace";
|
|
238
383
|
pid: number;
|
|
@@ -272,12 +417,126 @@ export type WorkerToPage = {
|
|
|
272
417
|
type: "unix-close";
|
|
273
418
|
cid: number;
|
|
274
419
|
}
|
|
275
|
-
/**
|
|
420
|
+
/**
|
|
421
|
+
* UDP between host processes (host-exec's src/udp-socket.js, T270): a socket bound where host processes reach it (the
|
|
422
|
+
* wildcard or the loopback; port 0: an ephemeral one), blocking on ctl for a UdpBindResult; its close; a datagram to
|
|
423
|
+
* the socket bound at address:port (the pod's loopback), handed over as a UdpToWorker.
|
|
424
|
+
*/
|
|
425
|
+
| {
|
|
426
|
+
type: "udp-bind";
|
|
427
|
+
family: 4 | 6;
|
|
428
|
+
address: string;
|
|
429
|
+
port: number;
|
|
430
|
+
reuse: boolean;
|
|
431
|
+
v6only: boolean;
|
|
432
|
+
} | {
|
|
433
|
+
type: "udp-close";
|
|
434
|
+
sid: number;
|
|
435
|
+
} | {
|
|
436
|
+
type: "udp-send";
|
|
437
|
+
sid: number;
|
|
438
|
+
family: 4 | 6;
|
|
439
|
+
address: string;
|
|
440
|
+
port: number;
|
|
441
|
+
data: Uint8Array;
|
|
442
|
+
}
|
|
443
|
+
/** worker_threads: start a thread; it ended (its exit, terminate(): terminated, its parent waits until it stopped). */
|
|
276
444
|
| ({
|
|
277
445
|
type: "thread";
|
|
278
|
-
} & ThreadSpec)
|
|
446
|
+
} & ThreadSpec)
|
|
447
|
+
/** (terminated: by terminate() or its process's end, not by itself) */
|
|
448
|
+
| {
|
|
279
449
|
type: "thread-end";
|
|
280
450
|
tid: number;
|
|
451
|
+
terminated?: boolean;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* A port's message (and what it transfers: realm ports) for thread tid (0: the main one) of its process; -1, or where
|
|
455
|
+
* that one is gone or ending: the one its msg.box's header says has the port's end (controller.ts #relay).
|
|
456
|
+
*/
|
|
457
|
+
| {
|
|
458
|
+
type: "relay";
|
|
459
|
+
tid: number;
|
|
460
|
+
msg: unknown;
|
|
461
|
+
transfer: Transferable[];
|
|
462
|
+
}
|
|
463
|
+
/** A thread's answer to drain. */
|
|
464
|
+
| {
|
|
465
|
+
type: "drained";
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* A WASIX program's process (a wasi Worker, host-exec's wasi-worker.js, T315): start its wasm thread, a wasi Worker
|
|
469
|
+
* with the process's pid and sessions of its own, which ends with it (or at thread-end); `port` goes to its start.
|
|
470
|
+
*/
|
|
471
|
+
| {
|
|
472
|
+
type: "wasix-thread";
|
|
473
|
+
tid: number;
|
|
474
|
+
port: MessagePort;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* WebCrypto calls the page runs while the process blocks on ctl for their CryptoResult (host-exec's impl-crypto.js:
|
|
478
|
+
* what node does synchronously, createSign, crypto.sign, generateKeyPairSync, publicEncrypt, ...).
|
|
479
|
+
*/
|
|
480
|
+
| {
|
|
481
|
+
type: "crypto";
|
|
482
|
+
calls: WebCryptoCall[];
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* One of host-exec's files next to the Worker (HOST_ASSETS) that a binding needs synchronously, which the Worker
|
|
486
|
+
* cannot fetch itself (its CSP is connect-src 'none'): the page fetches it while the process blocks on ctl for an
|
|
487
|
+
* AssetResult, the bytes after it.
|
|
488
|
+
*/
|
|
489
|
+
| {
|
|
490
|
+
type: "asset";
|
|
491
|
+
name: string;
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* host-node.js's chunks (host-exec's src/lazy.js, its dist/host-node-chunks.json): parts of it a process loads when it
|
|
495
|
+
* first needs one (pako, coverage, the dlopen bindings), which the controller fetches ahead once the pod is idle.
|
|
496
|
+
*/
|
|
497
|
+
export declare const HOST_CHUNKS: readonly string[];
|
|
498
|
+
/** The files an asset message may ask for: wasm builds a process loads when it first needs one (node:sqlite's, zlib's brotli and zstd), host-node.js's chunks. */
|
|
499
|
+
export declare const HOST_ASSETS: readonly string[];
|
|
500
|
+
/** An asset message's answer in ctl, in the layout of a SyncResult: its bytes as the one segment, or why there are none. */
|
|
501
|
+
export type AssetResult = {
|
|
502
|
+
size: number;
|
|
503
|
+
} | {
|
|
504
|
+
error: string;
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* A SubtleCrypto call (importKey, exportKey, generateKey, sign, verify, encrypt, decrypt, deriveBits); an argument
|
|
508
|
+
* { ref: i, part? } is call i's result (a CryptoKey, or a key pair's publicKey / privateKey).
|
|
509
|
+
*/
|
|
510
|
+
export interface WebCryptoCall {
|
|
511
|
+
op: string;
|
|
512
|
+
args: unknown[];
|
|
513
|
+
}
|
|
514
|
+
/** A crypto message's answer in ctl: each call's result (ArrayBuffers as { b64 }, JWKs, booleans; CryptoKeys null), or the first error. */
|
|
515
|
+
export type CryptoResult = {
|
|
516
|
+
results: unknown[];
|
|
517
|
+
} | {
|
|
518
|
+
error: {
|
|
519
|
+
name: string;
|
|
520
|
+
message: string;
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
/** A udp-bind's answer in ctl: the socket and its port, or an errno (EADDRINUSE, EADDRNOTAVAIL). */
|
|
524
|
+
export type UdpBindResult = {
|
|
525
|
+
sid: number;
|
|
526
|
+
port: number;
|
|
527
|
+
} | {
|
|
528
|
+
error: number;
|
|
529
|
+
};
|
|
530
|
+
/** To a host process: a datagram for its socket sid, from a host process's socket. */
|
|
531
|
+
export type UdpToWorker = {
|
|
532
|
+
type: "udp-message";
|
|
533
|
+
sid: number;
|
|
534
|
+
data: Uint8Array;
|
|
535
|
+
from: {
|
|
536
|
+
address: string;
|
|
537
|
+
family: 4 | 6;
|
|
538
|
+
port: number;
|
|
539
|
+
};
|
|
281
540
|
};
|
|
282
541
|
/** A unix-listen's answer in ctl. */
|
|
283
542
|
export type UnixListenResult = {
|
|
@@ -311,12 +570,32 @@ export type UnixToWorker = {
|
|
|
311
570
|
export type OwnerToGuestChild = {
|
|
312
571
|
type: "stdin";
|
|
313
572
|
data: Uint8Array;
|
|
573
|
+
ack?: boolean;
|
|
314
574
|
} | {
|
|
315
575
|
type: "stdin-end";
|
|
316
576
|
} | {
|
|
317
577
|
type: "kill";
|
|
318
578
|
signal: string;
|
|
579
|
+
} | {
|
|
580
|
+
type: "out-ack";
|
|
581
|
+
bytes: number;
|
|
319
582
|
};
|
|
583
|
+
/** On a guest child's port, to an owner that acknowledges its output (ChildSpec.outAcks): stdin writes marked ack are. */
|
|
584
|
+
export type GuestChildAcks = {
|
|
585
|
+
type: "acks";
|
|
586
|
+
} | {
|
|
587
|
+
type: "stdin-ack";
|
|
588
|
+
};
|
|
589
|
+
/**
|
|
590
|
+
* StartMessage.outCredit (T287): Int32 [0] the bytes of out messages the owner took (wrapping), [1] 1 once nobody takes
|
|
591
|
+
* them any more (a detached child's owner gone): the process's writes wait while OUT_WINDOW bytes are not taken.
|
|
592
|
+
*/
|
|
593
|
+
export declare const OUT_WINDOW: number;
|
|
594
|
+
export declare function outCredit(): SharedArrayBuffer;
|
|
595
|
+
/** The owner took bytes of a process's out messages (StartMessage.outCredit). */
|
|
596
|
+
export declare function outTaken(credit: SharedArrayBuffer | undefined, bytes: number): void;
|
|
597
|
+
/** Nobody takes a process's out messages any more: its writes do not wait. */
|
|
598
|
+
export declare function outUntaken(credit: SharedArrayBuffer | undefined): void;
|
|
320
599
|
/**
|
|
321
600
|
* spawnSync result in BootMessage.ctl: Int32 [0] set to 1 when done, [1] bytes used; from byte 8
|
|
322
601
|
* [u32 json length][json SyncResult][segments], each segment's bytes in order.
|
|
@@ -329,6 +608,21 @@ export type ListenResult = {
|
|
|
329
608
|
} | {
|
|
330
609
|
error: number;
|
|
331
610
|
};
|
|
611
|
+
/** kill-pid's answer, as kill(2)'s: errno 0, or ESRCH (no such process), EPERM, EINVAL. */
|
|
612
|
+
export type KillResult = {
|
|
613
|
+
errno: number;
|
|
614
|
+
};
|
|
615
|
+
/** guest-which's answer: whether the guest has one of the candidates (a file with an x bit). */
|
|
616
|
+
export type WhichResult = {
|
|
617
|
+
found: boolean;
|
|
618
|
+
};
|
|
619
|
+
/** A reserve's answer: granted (over: alone above the budget), or why not. */
|
|
620
|
+
export type ReserveResult = {
|
|
621
|
+
granted: true;
|
|
622
|
+
over?: boolean;
|
|
623
|
+
} | {
|
|
624
|
+
error: string;
|
|
625
|
+
};
|
|
332
626
|
export interface SyncResult {
|
|
333
627
|
pid: number;
|
|
334
628
|
status: number | null;
|
|
@@ -338,3 +632,35 @@ export interface SyncResult {
|
|
|
338
632
|
/** [kind, length]: kind 1 / 2 the pipes, -1 / -2 output the parent writes to its own fd. */
|
|
339
633
|
segs: [number, number][];
|
|
340
634
|
}
|
|
635
|
+
/** A WebAssembly.Memory alive in a host Worker (bytes; initial and maximum as its limits say, null where unknown). */
|
|
636
|
+
export interface HostMemWasm {
|
|
637
|
+
/** The package (or script) that made it, else that of the module using it; null when the stack does not tell (WebKit). */
|
|
638
|
+
label: string | null;
|
|
639
|
+
/** Made by new WebAssembly.Memory, a module's own (an instance's export), or imported (another Worker made it). */
|
|
640
|
+
origin: "new" | "instance" | "import";
|
|
641
|
+
shared: boolean;
|
|
642
|
+
initial: number | null;
|
|
643
|
+
maximum: number | null;
|
|
644
|
+
/** Its buffer's byteLength now. */
|
|
645
|
+
bytes: number;
|
|
646
|
+
}
|
|
647
|
+
/** A host Worker's memory (T289): whose it is, its JS heap where the engine tells it (Chromium), its wasm Memories. */
|
|
648
|
+
export interface HostMemWorkerReport {
|
|
649
|
+
/** A pre-warmed Worker that started nothing yet. */
|
|
650
|
+
warm?: boolean;
|
|
651
|
+
pid?: number;
|
|
652
|
+
ppid?: number;
|
|
653
|
+
argv?: string[];
|
|
654
|
+
/** A worker_threads thread: its threadId and name. */
|
|
655
|
+
tid?: number;
|
|
656
|
+
name?: string;
|
|
657
|
+
uptimeMs: number;
|
|
658
|
+
heap: {
|
|
659
|
+
used: number;
|
|
660
|
+
total: number;
|
|
661
|
+
limit: number;
|
|
662
|
+
} | null;
|
|
663
|
+
memories: HostMemWasm[];
|
|
664
|
+
/** Its Web Workers (napi-rs substitutes' threads, light threads), not terminated. */
|
|
665
|
+
webWorkers: number;
|
|
666
|
+
}
|
|
@@ -6,8 +6,42 @@
|
|
|
6
6
|
* pool), then started once. A top-level process reports on the Worker itself; a child of another
|
|
7
7
|
* host process on the MessagePort it was started with (its owner: the parent Worker, or the
|
|
8
8
|
* controller for spawnSync and guest children).
|
|
9
|
+
*
|
|
10
|
+
* A wasm child (ChildSpec runner "wasi", T244) is a Worker of host-exec's dist/wasi-worker.js instead: the same boot and
|
|
11
|
+
* start (start's wasm: the module), no node in it.
|
|
9
12
|
*/
|
|
10
13
|
export const PROTOCOL = 1;
|
|
14
|
+
/**
|
|
15
|
+
* host-node.js's chunks (host-exec's src/lazy.js, its dist/host-node-chunks.json): parts of it a process loads when it
|
|
16
|
+
* first needs one (pako, coverage, the dlopen bindings), which the controller fetches ahead once the pod is idle.
|
|
17
|
+
*/
|
|
18
|
+
export const HOST_CHUNKS = ["host-node-pako.js", "host-node-better-sqlite3.js", "host-node-node-sqlite3.js", "host-node-lmdb.js", "host-node-parcel.js", "host-node-sharp.js", "host-node-password-hash.js", "host-node-extract-zip.js", "host-node-prisma-engine.js", "host-node-coverage.js"];
|
|
19
|
+
/** The files an asset message may ask for: wasm builds a process loads when it first needs one (node:sqlite's, zlib's brotli and zstd), host-node.js's chunks. */
|
|
20
|
+
export const HOST_ASSETS = ["sqlite3.wasm", "brotli.wasm", "zstd.wasm", ...HOST_CHUNKS];
|
|
21
|
+
/**
|
|
22
|
+
* StartMessage.outCredit (T287): Int32 [0] the bytes of out messages the owner took (wrapping), [1] 1 once nobody takes
|
|
23
|
+
* them any more (a detached child's owner gone): the process's writes wait while OUT_WINDOW bytes are not taken.
|
|
24
|
+
*/
|
|
25
|
+
export const OUT_WINDOW = 1 << 20;
|
|
26
|
+
export function outCredit() {
|
|
27
|
+
return new SharedArrayBuffer(8);
|
|
28
|
+
}
|
|
29
|
+
/** The owner took bytes of a process's out messages (StartMessage.outCredit). */
|
|
30
|
+
export function outTaken(credit, bytes) {
|
|
31
|
+
if (!credit || !bytes)
|
|
32
|
+
return;
|
|
33
|
+
const i = new Int32Array(credit);
|
|
34
|
+
Atomics.add(i, 0, bytes);
|
|
35
|
+
Atomics.notify(i, 0);
|
|
36
|
+
}
|
|
37
|
+
/** Nobody takes a process's out messages any more: its writes do not wait. */
|
|
38
|
+
export function outUntaken(credit) {
|
|
39
|
+
if (!credit)
|
|
40
|
+
return;
|
|
41
|
+
const i = new Int32Array(credit);
|
|
42
|
+
Atomics.store(i, 1, 1);
|
|
43
|
+
Atomics.notify(i, 0);
|
|
44
|
+
}
|
|
11
45
|
/**
|
|
12
46
|
* spawnSync result in BootMessage.ctl: Int32 [0] set to 1 when done, [1] bytes used; from byte 8
|
|
13
47
|
* [u32 json length][json SyncResult][segments], each segment's bytes in order.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/host-exec/protocol.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/host-exec/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAyCH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC;AA2R1B;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAsB,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,uBAAuB,CAAC,CAAC;AAEnT,kKAAkK;AAClK,MAAM,CAAC,MAAM,WAAW,GAAsB,CAAC,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC,CAAC;AAyC3G;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,CAAC;AAClC,MAAM,UAAU,SAAS;IACvB,OAAO,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AACD,iFAAiF;AACjF,MAAM,UAAU,QAAQ,CAAC,MAAqC,EAAE,KAAa;IAC3E,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO;IAC9B,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACzB,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,CAAC;AACD,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,MAAqC;IAC9D,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvB,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC"}
|
package/dist/host-exec/route.js
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The node options host mode runs with: the shim's allowlist (crates/webpod-agent/src/shim.rs plan()), as
|
|
3
|
+
* host-exec's spawn-route.js has it for a host process's children. Any other option (--inspect, --check, ...)
|
|
4
|
+
* runs the process in the guest instead of being ignored on the host. With a value (`--opt v` or
|
|
5
|
+
* `--opt=v`), without, or `--opt=v` only.
|
|
6
|
+
*/
|
|
7
|
+
const WITH_VALUE = new Set(["-e", "--eval", "-p", "--print", "-r", "--require", "--import", "--experimental-loader", "--loader", "--input-type", "-C", "--conditions", "--title", "--disable-warning", "--unhandled-rejections", "--dns-result-order", "--experimental-default-type", "--redirect-warnings", "--env-file", "--env-file-if-exists",
|
|
8
|
+
// node:test's runner (--test) and what it passes on to its children; watch mode (--watch) (T181)
|
|
9
|
+
"--test-reporter", "--test-reporter-destination", "--test-name-pattern", "--test-skip-pattern", "--test-concurrency", "--test-timeout", "--test-shard", "--test-coverage-include", "--test-coverage-exclude", "--test-coverage-branches", "--test-coverage-functions", "--test-coverage-lines", "--experimental-test-isolation", "--watch-path", "--watch-kill-signal"]);
|
|
10
|
+
const FLAGS = new Set(["--enable-source-maps", "--no-warnings", "--trace-warnings", "--no-deprecation", "--trace-deprecation", "--throw-deprecation", "--pending-deprecation", "--trace-uncaught", "--preserve-symlinks", "--preserve-symlinks-main", "--experimental-require-module", "--no-experimental-require-module", "--experimental-detect-module", "--no-experimental-detect-module", "--experimental-import-meta-resolve", "--no-maglev", "--no-sparkplug",
|
|
11
|
+
"--test", "--test-only", "--test-force-exit", "--test-update-snapshots", "--experimental-test-coverage", "--experimental-test-snapshots", "--experimental-test-module-mocks", "--watch", "--watch-preserve-output"]);
|
|
12
|
+
const WITH_EQUALS = new Set(["--invocation-count-for-turbofan", "--invocation-count-for-osr", "--max-old-space-size", "--max-semi-space-size", "--stack-size"]);
|
|
13
|
+
/** Options that print and exit (host-exec's boot prints them as node does), on the command line only (not NODE_OPTIONS). */
|
|
14
|
+
const INFO = new Set(["-v", "--version", "-h", "--help", "--completion-bash"]);
|
|
15
|
+
/** NODE_OPTIONS' words as node splits them: at spaces, a double-quoted part one word, a backslash in it escaping the next character. */
|
|
16
|
+
function nodeOptionsWords(text) {
|
|
17
|
+
const words = [];
|
|
18
|
+
let quoted = false;
|
|
19
|
+
let fresh = true;
|
|
20
|
+
for (let i = 0; i < text.length; i++) {
|
|
21
|
+
let c = text[i];
|
|
22
|
+
if (c === "\\" && quoted && i + 1 < text.length)
|
|
23
|
+
c = text[++i];
|
|
24
|
+
else if (c === " " && !quoted) {
|
|
25
|
+
fresh = true;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
else if (c === '"') {
|
|
29
|
+
quoted = !quoted;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (fresh) {
|
|
33
|
+
words.push(c);
|
|
34
|
+
fresh = false;
|
|
35
|
+
}
|
|
36
|
+
else
|
|
37
|
+
words[words.length - 1] += c;
|
|
38
|
+
}
|
|
39
|
+
return words;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The option of argv (node's own, before the script) or NODE_OPTIONS that sends node to the guest, as the reason. In
|
|
43
|
+
* argv a word that is no option is the script. In NODE_OPTIONS node stops at one and ignores the rest; this passes over
|
|
44
|
+
* it and checks the rest, so that in doubt the process runs in the guest.
|
|
45
|
+
*/
|
|
46
|
+
function guestNodeOption(args, nodeOptions) {
|
|
47
|
+
const check = (opts, inEnv) => {
|
|
48
|
+
for (let i = 0; i < opts.length; i++) {
|
|
49
|
+
const a = opts[i];
|
|
50
|
+
if (inEnv && (!a.startsWith("-") || a === "-"))
|
|
51
|
+
continue;
|
|
52
|
+
if (a === "--" || !a.startsWith("-") || a === "-")
|
|
53
|
+
return null;
|
|
54
|
+
const eq = a.indexOf("=");
|
|
55
|
+
let name = eq > 0 ? a.slice(0, eq) : a;
|
|
56
|
+
if (name === "-pe")
|
|
57
|
+
name = "-e";
|
|
58
|
+
if (WITH_VALUE.has(name)) {
|
|
59
|
+
if (eq < 0)
|
|
60
|
+
i++;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (eq < 0 ? FLAGS.has(name) || (!inEnv && INFO.has(name)) : WITH_EQUALS.has(name))
|
|
64
|
+
continue;
|
|
65
|
+
return `node option ${name}${inEnv ? " (NODE_OPTIONS)" : ""}`;
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
return (nodeOptions ? check(nodeOptionsWords(nodeOptions), true) : null) ?? check(args, false);
|
|
70
|
+
}
|
|
3
71
|
const inside = (path, dir) => path === dir || path.startsWith(dir.endsWith("/") ? dir : `${dir}/`);
|
|
4
72
|
/**
|
|
5
73
|
* Where a process the app starts (`pod.spawn`) runs, once at its start (e4-integration.md §3.1);
|
|
@@ -21,17 +89,10 @@ export function routeTopLevel(req, ctx) {
|
|
|
21
89
|
const cwd = req.cwd ?? ctx.workspace;
|
|
22
90
|
if (!cwd.startsWith("/") || ![ctx.workspace, ...(ctx.shares ?? [])].some((d) => inside(cwd, d)))
|
|
23
91
|
return guest(`cwd outside ${ctx.workspace}`);
|
|
24
|
-
// node's own options come before the script (or -e / -p); npm's argv has none of node's.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
break;
|
|
29
|
-
if (GUEST_OPTIONS.test(a))
|
|
30
|
-
return guest(`node option ${a.split("=")[0]}`);
|
|
31
|
-
if (a === "-e" || a === "-p" || a === "--eval" || a === "--print" || a === "-r" || a === "--require" || a === "--")
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
92
|
+
// node's own options come before the script (or -e / -p); npm's argv has none of node's, NODE_OPTIONS may.
|
|
93
|
+
const option = guestNodeOption(name === "node" ? req.args : [], req.env?.NODE_OPTIONS);
|
|
94
|
+
if (option)
|
|
95
|
+
return guest(option);
|
|
35
96
|
return { runner: "host", argv: [ctx.execPath, ...prefix, ...req.args], cwd };
|
|
36
97
|
}
|
|
37
98
|
//# sourceMappingURL=route.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/host-exec/route.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/host-exec/route.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,YAAY,EAAE,sBAAsB;IAC/U,iGAAiG;IACjG,iBAAiB,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,cAAc,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAC3W,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,+BAA+B,E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20
20
|
_done(id: number): void;
|
|
21
|
-
/** @internal Records the entry in $HOME/.cache/webpod/host-exec-fallback.json, which the shim reads. */
|
|
22
|
-
_learn(m: HostSpawnMsg,
|
|
21
|
+
/** @internal Records the entry's package in $HOME/.cache/webpod/host-exec-fallback.json, which the shim reads. */
|
|
22
|
+
_learn(m: HostSpawnMsg, entry: string): void;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* The directories the read-only tree serves, for HostExecInfo's mounts: each package it holds (a node_modules
|