@ai-ecoverse/slicc-kernel 1.114.0 → 1.116.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 +27 -0
- package/dist/index.js.map +2 -2
- package/dist/kernel-worker.js +309 -44
- package/dist/kernel-worker.js.map +4 -4
- package/dist/meta.js.map +2 -2
- package/dist/node-process-worker.js +108 -13
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +309 -44
- package/dist/node.js.map +4 -4
- package/dist/process-worker.js +111 -16
- package/dist/process-worker.js.map +3 -3
- package/dist/types/fs/meta.d.ts +1 -0
- package/dist/types/fs/types.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/kernel/fd-table.d.ts +1 -0
- package/dist/types/kernel/fifo.d.ts +13 -0
- package/dist/types/kernel/host.d.ts +2 -0
- package/dist/types/kernel/net/http1.d.ts +1 -0
- package/dist/types/kernel/net/proxy-service.d.ts +1 -0
- package/dist/types/kernel/process.d.ts +4 -0
- package/dist/types/kernel/protocol.d.ts +2 -0
- package/dist/types/kernel/socket-syscalls.d.ts +7 -0
- package/dist/types/kernel/socket.d.ts +3 -0
- package/dist/types/launcher.d.ts +1 -0
- package/dist/types/process/js/js-net.d.ts +14 -0
- package/dist/types/process/kernel-streams.d.ts +3 -0
- package/dist/types/process/process-fds.d.ts +1 -0
- package/dist/types/process/wasi/wasi-fds.d.ts +3 -0
- package/dist/types/realm/live-vfs-fs.d.ts +1 -0
- package/dist/types/realm/sync-fs-dispatch.d.ts +1 -0
- package/dist/types/realm/sync-fs-wire.d.ts +3 -1
- package/package.json +2 -1
package/dist/types/fs/meta.d.ts
CHANGED
package/dist/types/fs/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export interface FsStat {
|
|
|
3
3
|
isDirectory: boolean;
|
|
4
4
|
isSymbolicLink: boolean;
|
|
5
5
|
isSocket?: boolean;
|
|
6
|
+
isFifo?: boolean;
|
|
6
7
|
size: number;
|
|
7
8
|
mode: number;
|
|
8
9
|
mtime: Date;
|
|
@@ -35,6 +36,7 @@ export interface NewOwner extends Owner {
|
|
|
35
36
|
mode?: number;
|
|
36
37
|
parents?: number;
|
|
37
38
|
socket?: boolean;
|
|
39
|
+
fifo?: boolean;
|
|
38
40
|
}
|
|
39
41
|
export interface OwnerChange {
|
|
40
42
|
uid?: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type { ProcessMountPolicy, ProcessMountRequest } from './mount/syscall.js
|
|
|
36
36
|
export type { JsChild, JsExited, JsSpawnOptions, JsStdio } from './process/js/js-children.js';
|
|
37
37
|
export type { JsCrontabAnswer, JsCrontabCall, JsFdStatus, JsFdType, JsFile, JsOpenOptions, JsProgramContext, JsSignal, JsSudoAnswer, } from './process/js/js-context.js';
|
|
38
38
|
export type { JsStatFs } from './process/js/js-io.js';
|
|
39
|
-
export type { JsAddress, JsConnection, JsConnectOptions, JsListener, JsListenOptions, JsNet, JsResolveOptions, } from './process/js/js-net.js';
|
|
39
|
+
export type { JsAddress, JsConnection, JsConnectOptions, JsListener, JsListenOptions, JsNet, JsResolveOptions, JsTlsOptions, JsTlsSession, } from './process/js/js-net.js';
|
|
40
40
|
export type { JsRunOptions, JsRunResult, JsRunStdio } from './process/js/js-run.js';
|
|
41
41
|
export type { JsCred, JsSyncContext, JsSyncFile } from './process/js/js-sync.js';
|
|
42
42
|
export type { JsTermios, JsTty, JsTtySize } from './process/js/js-tty.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type OpenAccess, OpenFile } from './fd-table.js';
|
|
2
|
+
export declare class FifoTable {
|
|
3
|
+
private readonly fifos;
|
|
4
|
+
size(): number;
|
|
5
|
+
open(key: string, path: string, access: OpenAccess, nonblock: boolean, signal: AbortSignal): Promise<OpenFile>;
|
|
6
|
+
private entry;
|
|
7
|
+
private count;
|
|
8
|
+
private notify;
|
|
9
|
+
private changed;
|
|
10
|
+
private release;
|
|
11
|
+
private drop;
|
|
12
|
+
private end;
|
|
13
|
+
}
|
|
@@ -8,6 +8,7 @@ import type { ClipboardBroker } from './clipboard.js';
|
|
|
8
8
|
import { type CpuTimes } from './cpu-clock.js';
|
|
9
9
|
import { type Cred } from './cred.js';
|
|
10
10
|
import { type FdTable, type OpenFile } from './fd-table.js';
|
|
11
|
+
import type { FifoTable } from './fifo.js';
|
|
11
12
|
import type { JobTable } from './jobs.js';
|
|
12
13
|
import type { LockTable } from './locks.js';
|
|
13
14
|
import type { HttpHandles } from './net/http-syscalls.js';
|
|
@@ -85,6 +86,7 @@ export interface SpawnWasmOptions {
|
|
|
85
86
|
net?: LoopbackNet;
|
|
86
87
|
http?: HttpHandles;
|
|
87
88
|
locks?: LockTable;
|
|
89
|
+
fifos?: FifoTable;
|
|
88
90
|
sems?: SemTable;
|
|
89
91
|
onReap?: (pid: number) => void;
|
|
90
92
|
resolver?: Resolver;
|
|
@@ -15,6 +15,7 @@ export declare class Incoming {
|
|
|
15
15
|
get buffered(): number;
|
|
16
16
|
private fill;
|
|
17
17
|
private take;
|
|
18
|
+
firstLine(max: number, signal?: AbortSignal): Promise<string>;
|
|
18
19
|
peek(signal?: AbortSignal): Promise<number | undefined>;
|
|
19
20
|
some(max: number, signal?: AbortSignal): Promise<Uint8Array>;
|
|
20
21
|
head(limit: number, signal?: AbortSignal): Promise<Uint8Array | null>;
|
|
@@ -11,6 +11,7 @@ import type { ClipboardBroker } from './clipboard.js';
|
|
|
11
11
|
import { type Cred, type CredChange } from './cred.js';
|
|
12
12
|
import { type EpollSyscall } from './epoll.js';
|
|
13
13
|
import { type DeviceAccess, type FdTable, type HeldMeta, type KernelFdKind, type OpenFile } from './fd-table.js';
|
|
14
|
+
import type { FifoTable } from './fifo.js';
|
|
14
15
|
import { type HostSyscall } from './host-ops.js';
|
|
15
16
|
import type { JobTable } from './jobs.js';
|
|
16
17
|
import type { LockTable } from './locks.js';
|
|
@@ -61,6 +62,7 @@ export type WasmSyscall = {
|
|
|
61
62
|
existing?: boolean;
|
|
62
63
|
pin?: VersionPin;
|
|
63
64
|
handle?: number;
|
|
65
|
+
fifo?: boolean;
|
|
64
66
|
} | {
|
|
65
67
|
op: 'fd-pread';
|
|
66
68
|
fd: number;
|
|
@@ -398,6 +400,7 @@ export interface WasmProcessOptions {
|
|
|
398
400
|
net?: LoopbackNet;
|
|
399
401
|
http?: HttpHandles;
|
|
400
402
|
locks?: LockTable;
|
|
403
|
+
fifos?: FifoTable;
|
|
401
404
|
sems?: SemTable;
|
|
402
405
|
resolver?: Resolver;
|
|
403
406
|
}
|
|
@@ -482,6 +485,7 @@ export declare class WasmProcess {
|
|
|
482
485
|
private clipboardComplaint;
|
|
483
486
|
private write;
|
|
484
487
|
private openVfs;
|
|
488
|
+
private openFifo;
|
|
485
489
|
private openDevice;
|
|
486
490
|
private identified;
|
|
487
491
|
private writesAt;
|
|
@@ -55,6 +55,7 @@ export interface KernelStreamEntry {
|
|
|
55
55
|
flags?: number;
|
|
56
56
|
cloexec?: boolean;
|
|
57
57
|
desc?: number;
|
|
58
|
+
fifo?: string;
|
|
58
59
|
}
|
|
59
60
|
export type ForkStream = KernelStreamEntry | {
|
|
60
61
|
fd: number;
|
|
@@ -68,6 +69,7 @@ export interface InheritedFd {
|
|
|
68
69
|
flags?: number;
|
|
69
70
|
cloexec?: boolean;
|
|
70
71
|
desc?: number;
|
|
72
|
+
fifo?: string;
|
|
71
73
|
}
|
|
72
74
|
export interface WasmProcessInitMsg {
|
|
73
75
|
type: typeof WASM_PROCESS_INIT;
|
|
@@ -57,6 +57,13 @@ export type SocketSyscall = {
|
|
|
57
57
|
body: Uint8Array;
|
|
58
58
|
addr?: SockAddr;
|
|
59
59
|
nonblock: boolean;
|
|
60
|
+
} | {
|
|
61
|
+
op: 'sock-tls';
|
|
62
|
+
host: string;
|
|
63
|
+
port: number;
|
|
64
|
+
servername?: string;
|
|
65
|
+
alpn?: string[];
|
|
66
|
+
ca?: boolean;
|
|
60
67
|
} | {
|
|
61
68
|
op: 'sock-recvfrom';
|
|
62
69
|
fd: number;
|
|
@@ -105,6 +105,9 @@ export declare class LoopbackNet {
|
|
|
105
105
|
private readonly facades;
|
|
106
106
|
private nextEphemeral;
|
|
107
107
|
private route;
|
|
108
|
+
private origins;
|
|
109
|
+
useOrigins(serve: (conn: KernelSocket, origin: string) => Promise<void>): void;
|
|
110
|
+
serveOrigin(conn: KernelSocket, origin: string): void;
|
|
108
111
|
useUplink(route: UplinkRoute): void;
|
|
109
112
|
uplinkFor(host: string): UplinkRoute | undefined;
|
|
110
113
|
destination(host: string): Destination;
|
package/dist/types/launcher.d.ts
CHANGED
|
@@ -3,8 +3,21 @@ export interface JsAddress {
|
|
|
3
3
|
host: string;
|
|
4
4
|
port: number;
|
|
5
5
|
}
|
|
6
|
+
export interface JsTlsSession {
|
|
7
|
+
readonly protocol: 'transport';
|
|
8
|
+
readonly alpnProtocol: string;
|
|
9
|
+
readonly authorized: true;
|
|
10
|
+
readonly servername: string;
|
|
11
|
+
}
|
|
12
|
+
export interface JsTlsOptions {
|
|
13
|
+
servername?: string;
|
|
14
|
+
alpn?: string[];
|
|
15
|
+
rejectUnauthorized?: boolean;
|
|
16
|
+
ca?: unknown;
|
|
17
|
+
}
|
|
6
18
|
export interface JsConnection {
|
|
7
19
|
readonly fd: number;
|
|
20
|
+
readonly tls?: JsTlsSession;
|
|
8
21
|
readonly local: JsAddress;
|
|
9
22
|
readonly remote: JsAddress;
|
|
10
23
|
readonly readable: ReadableStream<Uint8Array>;
|
|
@@ -29,6 +42,7 @@ export interface JsConnectOptions {
|
|
|
29
42
|
host?: string;
|
|
30
43
|
port: number;
|
|
31
44
|
signal?: AbortSignal;
|
|
45
|
+
tls?: JsTlsOptions;
|
|
32
46
|
}
|
|
33
47
|
export interface JsResolveOptions {
|
|
34
48
|
family?: 0 | 4 | 6;
|
|
@@ -34,6 +34,7 @@ export interface ProcessSys {
|
|
|
34
34
|
size: number;
|
|
35
35
|
};
|
|
36
36
|
handle?: number;
|
|
37
|
+
fifo?: boolean;
|
|
37
38
|
}): number;
|
|
38
39
|
seek(fd: number, offset: number, whence: number): number;
|
|
39
40
|
flush(fd: number): void;
|
|
@@ -82,6 +83,7 @@ export interface ProcessStream {
|
|
|
82
83
|
sliccKernelFile?: boolean;
|
|
83
84
|
sliccCloexec?: boolean;
|
|
84
85
|
sliccKernelSocket?: boolean;
|
|
86
|
+
sliccKernelFifo?: string;
|
|
85
87
|
path?: string;
|
|
86
88
|
flags: number;
|
|
87
89
|
position: number;
|
|
@@ -147,6 +149,7 @@ export declare class KernelStreams {
|
|
|
147
149
|
private readonly options;
|
|
148
150
|
constructor(Fs: ProcessFs, sys: ProcessSys, options?: KernelStreamOptions);
|
|
149
151
|
attach(stream: ProcessStream, kfd: number, terminal?: boolean): void;
|
|
152
|
+
attachFifo(stream: ProcessStream, path: string): void;
|
|
150
153
|
attachSocket(stream: ProcessStream, kfd: number): void;
|
|
151
154
|
socketStream(flags: number): ProcessStream;
|
|
152
155
|
nameTerminal(stream: ProcessStream): void;
|
|
@@ -78,6 +78,7 @@ export declare function useFileMmap(Fs: ProcessFs, deps: MmapDeps): void;
|
|
|
78
78
|
export declare function wasmMemory(instance: WebAssembly.Instance, imports: WebAssembly.Imports): WebAssembly.Memory | undefined;
|
|
79
79
|
export declare function fdOfPath(path: string, cwd: string): number | undefined;
|
|
80
80
|
export declare function useZeroDevices(Fs: ProcessFs): void;
|
|
81
|
+
export declare function useFifoOpens(Fs: ProcessFs, attach?: (stream: ProcessStream, path: string) => void): void;
|
|
81
82
|
export declare function useDevRemoval(Fs: ProcessFs): void;
|
|
82
83
|
export declare function useDevFd(Fs: ProcessFs): void;
|
|
83
84
|
export declare function pinRootKind(): void;
|
|
@@ -123,6 +123,9 @@ export declare class WasiFds {
|
|
|
123
123
|
private file;
|
|
124
124
|
private freshBuffer;
|
|
125
125
|
private kernelFile;
|
|
126
|
+
private kernelFifo;
|
|
127
|
+
restartable: (() => boolean) | undefined;
|
|
128
|
+
private restarting;
|
|
126
129
|
private createNew;
|
|
127
130
|
private isLink;
|
|
128
131
|
private statOrMissing;
|
|
@@ -105,6 +105,7 @@ export interface LiveFsApi {
|
|
|
105
105
|
sliccTouch?: boolean;
|
|
106
106
|
sliccReading?: LiveFsNode | undefined;
|
|
107
107
|
sliccCred?: LiveCred;
|
|
108
|
+
sliccOpenFifo?(stream: LiveFsStream, path: string): void;
|
|
108
109
|
nameTable?: (LiveFsNode | null)[] | null;
|
|
109
110
|
hashRemoveNode?(node: LiveFsNode): void;
|
|
110
111
|
lookupNode?(parent: LiveFsNode, name: string): LiveFsNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChangeView } from '../fs/changes.js';
|
|
2
|
-
export declare const SYNC_FS_OPS: readonly ['read', 'write', 'exists', 'stat', 'lstat', 'readdir', 'readdir-stat', 'mkdir', 'rm', 'rename', 'link', 'unlink', 'rmdir', 'symlink', 'readlink', 'chmod', 'utimes', 'lutimes', 'statfs', 'hold', 'create', 'kept', 'pread', 'pwrite', 'append', 'truncate', 'chown', 'lchown', 'access'];
|
|
2
|
+
export declare const SYNC_FS_OPS: readonly ['read', 'write', 'exists', 'stat', 'lstat', 'readdir', 'readdir-stat', 'mkdir', 'rm', 'rename', 'link', 'unlink', 'rmdir', 'symlink', 'readlink', 'chmod', 'utimes', 'lutimes', 'statfs', 'hold', 'create', 'mkfifo', 'kept', 'pread', 'pwrite', 'append', 'truncate', 'chown', 'lchown', 'access'];
|
|
3
3
|
export type AccessKind = 'open' | 'access' | 'eaccess' | 'follow';
|
|
4
4
|
export declare const HOLD_READ = 4;
|
|
5
5
|
export declare const HOLD_WRITE = 8;
|
|
@@ -48,6 +48,7 @@ export interface SyncFsBridgeStat {
|
|
|
48
48
|
isDirectory: boolean;
|
|
49
49
|
isSymbolicLink?: boolean;
|
|
50
50
|
isSocket?: boolean;
|
|
51
|
+
isFifo?: boolean;
|
|
51
52
|
size: number;
|
|
52
53
|
mode?: number;
|
|
53
54
|
mtimeMs?: number;
|
|
@@ -101,6 +102,7 @@ export interface SyncFsPosixBridge {
|
|
|
101
102
|
hold?(path: string, held: boolean, open?: boolean, handle?: number, want?: number): number | undefined;
|
|
102
103
|
access?(path: string, mode: number, kind?: AccessKind, nofollow?: boolean): void;
|
|
103
104
|
create?(path: string, mode?: number, opening?: boolean): void;
|
|
105
|
+
mkfifo?(path: string, mode: number): void;
|
|
104
106
|
chown?(path: string, ...rest: ChownArgs): void;
|
|
105
107
|
owners?: boolean;
|
|
106
108
|
links?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-kernel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.116.0",
|
|
4
4
|
"description": "SLICC's wasm-realm kernel: run Emscripten programs in the browser against OPFS, with fork, spawn, pipes and waitpid",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"@ai-ecoverse/wasm-coreutils": "9.12.0-9",
|
|
78
78
|
"@ai-ecoverse/wasm-curl": "8.22.0-5",
|
|
79
79
|
"@ai-ecoverse/wasm-git": "2.55.0-15",
|
|
80
|
+
"@ai-ecoverse/wasm-gmake": "4.4.1-5",
|
|
80
81
|
"@ai-ecoverse/wasm-procps": "4.0.7-3",
|
|
81
82
|
"@ai-ecoverse/wasm-sqlite3": "3.54.0-5",
|
|
82
83
|
"@ai-ecoverse/wasm-tar": "1.35.0-7",
|