@ai-ecoverse/slicc-kernel 1.125.12 → 1.126.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/README.md +14 -3
- package/dist/index.js.map +2 -2
- package/dist/kernel-worker.js +242 -38
- package/dist/kernel-worker.js.map +4 -4
- package/dist/meta.js.map +2 -2
- package/dist/node-process-worker.js +90 -25
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +242 -38
- package/dist/node.js.map +4 -4
- package/dist/process-worker.js +90 -25
- package/dist/process-worker.js.map +3 -3
- package/dist/types/fs/meta.d.ts +6 -0
- package/dist/types/fs/opfs.d.ts +8 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/kernel/net/tls-client.d.ts +4 -0
- package/dist/types/kernel/net/tls-uplink.d.ts +2 -1
- package/dist/types/kernel/sealed-session.d.ts +44 -0
- package/dist/types/kernel/sealed.d.ts +3 -0
- package/dist/types/process/js/js-context.d.ts +15 -3
- package/dist/types/process/js/js-io.d.ts +3 -0
- package/dist/types/process/js/js-net.d.ts +1 -0
- package/dist/types/process/js/js-sync.d.ts +5 -3
- package/dist/types/process/js/js-tty.d.ts +11 -1
- package/package.json +2 -2
package/dist/types/fs/meta.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ export interface MetaEntry {
|
|
|
18
18
|
writes?: number;
|
|
19
19
|
epoch?: number;
|
|
20
20
|
vacated?: true;
|
|
21
|
+
rename?: {
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
at: number;
|
|
25
|
+
replace?: true;
|
|
26
|
+
};
|
|
21
27
|
}
|
|
22
28
|
export type MetaChange = (entry: MetaEntry | undefined) => MetaEntry | undefined;
|
|
23
29
|
export interface MetaUpdate {
|
package/dist/types/fs/opfs.d.ts
CHANGED
|
@@ -157,11 +157,19 @@ export declare class OpfsFs implements KernelFs {
|
|
|
157
157
|
link(from: string, to: string, follow?: boolean): Promise<void>;
|
|
158
158
|
rename(from: string, to: string): Promise<void>;
|
|
159
159
|
private moveTo;
|
|
160
|
+
private readonly renamingDirs;
|
|
161
|
+
private intents;
|
|
162
|
+
private intend;
|
|
163
|
+
private rollBack;
|
|
164
|
+
private finishRenames;
|
|
165
|
+
settledRename(path: unknown): Promise<void>;
|
|
166
|
+
private renameAt;
|
|
160
167
|
private replacingTarget;
|
|
161
168
|
private modified;
|
|
162
169
|
private explicitTimes;
|
|
163
170
|
private restamp;
|
|
164
171
|
private place;
|
|
172
|
+
private fileMoves;
|
|
165
173
|
private copy;
|
|
166
174
|
symlink(target: string, path: string, owner?: NewOwner): Promise<void>;
|
|
167
175
|
realpath(path: string, follow: boolean): Promise<string>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export { serveHostfsPort } from './mount/hostfs.js';
|
|
|
34
34
|
export type { MountEntry, MountSpec } from './mount/mount-fs.js';
|
|
35
35
|
export type { ProcessMountPolicy, ProcessMountRequest } from './mount/syscall.js';
|
|
36
36
|
export type { JsChild, JsExited, JsSpawnOptions, JsStdio } from './process/js/js-children.js';
|
|
37
|
-
export type { JsCrontabAnswer, JsCrontabCall, JsFdStatus, JsFdType, JsFile, JsOpenOptions, JsProgramContext, JsSignal, JsSudoAnswer, } from './process/js/js-context.js';
|
|
37
|
+
export type { JsCrontabAnswer, JsCrontabCall, JsFdStatus, JsFdType, JsFile, JsOpenOptions, JsProgramContext, JsSelected, JsSelectSets, JsSignal, JsSudoAnswer, JsWriteOptions, } from './process/js/js-context.js';
|
|
38
38
|
export type { JsStatFs } from './process/js/js-io.js';
|
|
39
39
|
export type { JsAddress, JsConnection, JsConnectOptions, JsListener, JsListenOptions, JsNet, JsResolveOptions, JsTlsCipher, JsTlsOptions, JsTlsSession, } from './process/js/js-net.js';
|
|
40
40
|
export type { JsRunOptions, JsRunResult, JsRunStdio } from './process/js/js-run.js';
|
|
@@ -15,6 +15,8 @@ export interface TlsClientInfo {
|
|
|
15
15
|
hostnameChecked?: boolean;
|
|
16
16
|
hostnameMatches?: boolean;
|
|
17
17
|
chainError?: string;
|
|
18
|
+
verified: boolean;
|
|
19
|
+
handshakeAt: number;
|
|
18
20
|
}
|
|
19
21
|
export interface TlsClientOptions {
|
|
20
22
|
engine: TlsEngine;
|
|
@@ -26,9 +28,11 @@ export interface TlsClientOptions {
|
|
|
26
28
|
checkHostname?: boolean;
|
|
27
29
|
session?: TlsSession;
|
|
28
30
|
clientCertificate?: boolean;
|
|
31
|
+
bundled?: boolean;
|
|
29
32
|
}
|
|
30
33
|
export declare function clientFlags(o: TlsClientOptions): number;
|
|
31
34
|
export declare function openSession(o: TlsClientOptions): TlsSession;
|
|
35
|
+
export declare function verdictOf(o: TlsClientOptions, session: TlsSession): boolean;
|
|
32
36
|
export declare function tlsClient(conn: UplinkConn, o: TlsClientOptions, taken?: Uint8Array): Promise<{
|
|
33
37
|
conn: UplinkConn;
|
|
34
38
|
info: TlsClientInfo;
|
|
@@ -28,7 +28,8 @@ export interface SecureProcess {
|
|
|
28
28
|
export declare function serverName(name: string): string;
|
|
29
29
|
export interface SecureSession {
|
|
30
30
|
path: 'kernel';
|
|
31
|
-
substitutes:
|
|
31
|
+
substitutes: boolean;
|
|
32
|
+
verified: boolean;
|
|
32
33
|
protocol: TlsClientInfo['protocol'];
|
|
33
34
|
alpnProtocol: string | false;
|
|
34
35
|
authorized: boolean;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { SealedCaller } from './sealed.js';
|
|
2
|
+
export declare const SESSION_WINDOW_MS = 60000;
|
|
3
|
+
export declare const SESSION_PLACEHOLDERS = 16;
|
|
4
|
+
export declare const SESSION_PLACEHOLDER: RegExp;
|
|
5
|
+
export type SessionProtocol = 'http1' | 'smtp' | 'pg';
|
|
6
|
+
export interface SessionHead {
|
|
7
|
+
method: string;
|
|
8
|
+
path: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SessionFields {
|
|
11
|
+
stamp: SealedCaller;
|
|
12
|
+
session: string;
|
|
13
|
+
host: string;
|
|
14
|
+
port: number;
|
|
15
|
+
protocol: SessionProtocol;
|
|
16
|
+
position: string;
|
|
17
|
+
verified: boolean;
|
|
18
|
+
handshakeAt: number;
|
|
19
|
+
exit: string;
|
|
20
|
+
placeholders: string[];
|
|
21
|
+
head?: SessionHead;
|
|
22
|
+
}
|
|
23
|
+
export declare function boundHost(servername: string): string;
|
|
24
|
+
export declare function sessionAskable(f: SessionFields, now: number): boolean;
|
|
25
|
+
export declare function sessionRequest(f: SessionFields): {
|
|
26
|
+
v: 1;
|
|
27
|
+
op: string;
|
|
28
|
+
caller: SealedCaller;
|
|
29
|
+
stamp: SealedCaller;
|
|
30
|
+
session: string;
|
|
31
|
+
host: string;
|
|
32
|
+
port: number;
|
|
33
|
+
protocol: SessionProtocol;
|
|
34
|
+
position: string;
|
|
35
|
+
verified: boolean;
|
|
36
|
+
handshakeAt: number;
|
|
37
|
+
exit: string;
|
|
38
|
+
placeholders: string[];
|
|
39
|
+
head?: {
|
|
40
|
+
method: string;
|
|
41
|
+
path: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
};
|
|
44
|
+
export declare function sessionValues(reply: unknown, asked: readonly string[]): Record<string, string> | undefined;
|
|
@@ -2,6 +2,7 @@ import type { UsersMode } from '../fs/types.js';
|
|
|
2
2
|
import type { Cred } from './cred.js';
|
|
3
3
|
import { TicketBook } from './exec-ticket.js';
|
|
4
4
|
import { type OpenAccess, OpenFile, type PollState } from './fd-table.js';
|
|
5
|
+
import { type SessionFields } from './sealed-session.js';
|
|
5
6
|
export declare const SEALED_PATH = "/dev/sealed";
|
|
6
7
|
export declare const SEALED_MAX_BYTES: number;
|
|
7
8
|
export declare const SEALED_TIMEOUT_MS = 10000;
|
|
@@ -69,6 +70,8 @@ export declare class SealedBroker {
|
|
|
69
70
|
ppid: number;
|
|
70
71
|
}, cred: Readonly<Cred>, tag: string | undefined): Promise<SealedCaller>;
|
|
71
72
|
consume(fields: ConsumeFields): Promise<Swap | undefined>;
|
|
73
|
+
sessionMaterialize(fields: SessionFields, now?: number): Promise<Record<string, string> | undefined>;
|
|
74
|
+
private ask;
|
|
72
75
|
open(access?: OpenAccess): OpenFile;
|
|
73
76
|
}
|
|
74
77
|
export type { SealedChannel };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type SyncFsBridgeStat } from '../../realm/sync-fs-wire.js';
|
|
2
2
|
import { type JsChild, type JsExited, type JsSpawnOptions, type JsWaitOptions } from './js-children.js';
|
|
3
|
-
import { type JsFdType, type JsOpenOptions, type JsStatFs } from './js-io.js';
|
|
3
|
+
import { type JsFdType, type JsOpenOptions, type JsStatFs, type JsWriteOptions } from './js-io.js';
|
|
4
4
|
import { type JsKernel } from './js-kernel.js';
|
|
5
5
|
import { type JsNet } from './js-net.js';
|
|
6
6
|
import { type JsSyncContext, type SyncCall } from './js-sync.js';
|
|
7
7
|
import { type JsTty } from './js-tty.js';
|
|
8
8
|
import { type JsWatcher, type JsWatchListener, type JsWatchOptions } from './js-watch.js';
|
|
9
9
|
import { type JsWebSocket, type JsWebSocketOptions } from './js-websocket.js';
|
|
10
|
-
export type { JsFdType, JsOpenOptions } from './js-io.js';
|
|
10
|
+
export type { JsFdType, JsOpenOptions, JsWriteOptions } from './js-io.js';
|
|
11
11
|
export interface JsFile {
|
|
12
12
|
readonly fd: number;
|
|
13
13
|
readonly path: string;
|
|
@@ -39,10 +39,13 @@ export interface JsProgramContext {
|
|
|
39
39
|
readonly stdout: WritableStream<Uint8Array>;
|
|
40
40
|
readonly stderr: WritableStream<Uint8Array>;
|
|
41
41
|
read(fd: number, max?: number): Promise<Uint8Array>;
|
|
42
|
-
write(fd: number, data: Uint8Array | string): Promise<
|
|
42
|
+
write(fd: number, data: Uint8Array | string, options?: JsWriteOptions): Promise<number>;
|
|
43
43
|
close(fd: number): Promise<void>;
|
|
44
44
|
socketpair(): Promise<[number, number]>;
|
|
45
45
|
pipe(): Promise<[number, number]>;
|
|
46
|
+
select(sets: JsSelectSets, options?: {
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
}): Promise<JsSelected>;
|
|
46
49
|
fdStatus(fd: number): Promise<JsFdStatus>;
|
|
47
50
|
isatty(fd: number): Promise<boolean>;
|
|
48
51
|
open(path: string, options?: JsOpenOptions): Promise<JsFile>;
|
|
@@ -90,6 +93,15 @@ export interface JsProgramContext {
|
|
|
90
93
|
onUncaught(listener: JsStrayListener): () => void;
|
|
91
94
|
onUnhandledRejection(listener: JsStrayListener): () => void;
|
|
92
95
|
}
|
|
96
|
+
export interface JsSelectSets {
|
|
97
|
+
read?: readonly number[];
|
|
98
|
+
write?: readonly number[];
|
|
99
|
+
timeoutMs?: number;
|
|
100
|
+
}
|
|
101
|
+
export interface JsSelected {
|
|
102
|
+
read: number[];
|
|
103
|
+
write: number[];
|
|
104
|
+
}
|
|
93
105
|
export interface JsCrontabCall {
|
|
94
106
|
action: 'list' | 'remove' | 'install';
|
|
95
107
|
user?: string;
|
|
@@ -11,6 +11,9 @@ export interface JsOpenOptions {
|
|
|
11
11
|
nonblock?: boolean;
|
|
12
12
|
signal?: AbortSignal;
|
|
13
13
|
}
|
|
14
|
+
export interface JsWriteOptions {
|
|
15
|
+
nonblock?: boolean;
|
|
16
|
+
}
|
|
14
17
|
export type JsFdType = 'file' | 'pipe' | 'tty' | 'socket' | 'device' | 'directory';
|
|
15
18
|
export interface FdInfo {
|
|
16
19
|
tty?: boolean;
|
|
@@ -6,6 +6,7 @@ export interface JsAddress {
|
|
|
6
6
|
export interface JsTlsSession {
|
|
7
7
|
readonly path: 'transport' | 'kernel';
|
|
8
8
|
readonly substitutes: boolean;
|
|
9
|
+
readonly verified?: boolean;
|
|
9
10
|
readonly protocol: 'transport' | 'TLSv1.2' | 'TLSv1.3';
|
|
10
11
|
readonly alpnProtocol: string | false;
|
|
11
12
|
readonly authorized: boolean;
|
|
@@ -3,9 +3,10 @@ import { type SyncFsBridgeStat, type SyncFsResult } from '../../realm/sync-fs-wi
|
|
|
3
3
|
import { type SyncSabTransport } from '../../realm/sync-sab-bridge.js';
|
|
4
4
|
import type { SyncSabRequestBody } from '../../realm/sync-sab-wire.js';
|
|
5
5
|
import type { JsChild, JsSpawnOptions } from './js-children.js';
|
|
6
|
-
import { type FdInfo, type JsOpenOptions, type JsStatFs } from './js-io.js';
|
|
6
|
+
import { type FdInfo, type JsOpenOptions, type JsStatFs, type JsWriteOptions } from './js-io.js';
|
|
7
7
|
import { type JsKernel } from './js-kernel.js';
|
|
8
8
|
import type { JsRunOptions, JsRunResult } from './js-run.js';
|
|
9
|
+
import type { JsSyncTty } from './js-tty.js';
|
|
9
10
|
import type { JsWatcher, JsWatchListener, JsWatchOptions } from './js-watch.js';
|
|
10
11
|
export type SyncCall = (req: SyncSabRequestBody) => SyncFsResult;
|
|
11
12
|
export interface JsSyncFile {
|
|
@@ -31,6 +32,7 @@ export interface JsSyncContext {
|
|
|
31
32
|
readonly kernel: {
|
|
32
33
|
readonly version: string;
|
|
33
34
|
};
|
|
35
|
+
tty: JsSyncTty;
|
|
34
36
|
run(options: JsRunOptions): JsRunResult;
|
|
35
37
|
spawn(options: JsSpawnOptions): JsChild;
|
|
36
38
|
exit(status?: number): never;
|
|
@@ -39,7 +41,7 @@ export interface JsSyncContext {
|
|
|
39
41
|
umask(mask?: number): number;
|
|
40
42
|
setcred(change: Partial<JsCred>): JsCred;
|
|
41
43
|
read(fd: number, max?: number): Uint8Array;
|
|
42
|
-
write(fd: number, data: Uint8Array | string):
|
|
44
|
+
write(fd: number, data: Uint8Array | string, options?: JsWriteOptions): number;
|
|
43
45
|
close(fd: number): void;
|
|
44
46
|
socketpair(): [number, number];
|
|
45
47
|
pipe(): [number, number];
|
|
@@ -89,6 +91,6 @@ export declare class JsSyncKernel {
|
|
|
89
91
|
bytes(req: SyncSabRequestBody): Uint8Array;
|
|
90
92
|
blocking(req: SyncSabRequestBody): SyncFsResult;
|
|
91
93
|
}
|
|
92
|
-
export declare function syncOps(kernel: JsSyncKernel, shared: SyncShared): Omit<JsSyncContext, 'run' | 'spawn' | 'exit' | 'kill' | 'cred' | 'setcred' | 'kernel' | 'umask' | 'fs'> & {
|
|
94
|
+
export declare function syncOps(kernel: JsSyncKernel, shared: SyncShared): Omit<JsSyncContext, 'run' | 'spawn' | 'exit' | 'kill' | 'cred' | 'setcred' | 'kernel' | 'umask' | 'fs' | 'tty'> & {
|
|
93
95
|
fs: Omit<JsSyncContext['fs'], 'watch'>;
|
|
94
96
|
};
|
|
@@ -10,6 +10,14 @@ export interface JsTtySize {
|
|
|
10
10
|
columns: number;
|
|
11
11
|
rows: number;
|
|
12
12
|
}
|
|
13
|
+
export interface JsSyncTty {
|
|
14
|
+
getAttr(fd: number): JsTermios;
|
|
15
|
+
setAttr(fd: number, termios: JsTermios): void;
|
|
16
|
+
setRaw(fd: number, raw: boolean): void;
|
|
17
|
+
}
|
|
18
|
+
interface SyncTtyKernel {
|
|
19
|
+
json(req: Parameters<JsKernel['json']>[0]): unknown;
|
|
20
|
+
}
|
|
13
21
|
export interface JsTty {
|
|
14
22
|
getAttr(fd: number): Promise<JsTermios>;
|
|
15
23
|
setAttr(fd: number, termios: JsTermios): Promise<void>;
|
|
@@ -19,8 +27,9 @@ export interface JsTty {
|
|
|
19
27
|
setForeground(fd: number, pgrp: number): Promise<void>;
|
|
20
28
|
}
|
|
21
29
|
export declare function rawOf(termios: JsTermios): JsTermios;
|
|
22
|
-
export declare function ttyOps(kernel: JsKernel): {
|
|
30
|
+
export declare function ttyOps(kernel: JsKernel, syncKernel?: SyncTtyKernel): {
|
|
23
31
|
tty: JsTty;
|
|
32
|
+
syncTty: JsSyncTty;
|
|
24
33
|
restore(): Promise<void>;
|
|
25
34
|
modes(): Array<{
|
|
26
35
|
terminal: string;
|
|
@@ -28,3 +37,4 @@ export declare function ttyOps(kernel: JsKernel): {
|
|
|
28
37
|
termios: JsTermios;
|
|
29
38
|
}>;
|
|
30
39
|
};
|
|
40
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-kernel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.126.1",
|
|
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",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@ai-ecoverse/slicc-scrub": "1.0.0",
|
|
69
69
|
"@ai-ecoverse/slicc-shared-web": "1.24.2",
|
|
70
70
|
"@ai-ecoverse/wasi-cargo": "0.99.0-3",
|
|
71
|
-
"@ai-ecoverse/wasi-pnpm": "12.9.1-
|
|
71
|
+
"@ai-ecoverse/wasi-pnpm": "12.9.1-11",
|
|
72
72
|
"@ai-ecoverse/wasi-ripgrep": "15.2.0-5",
|
|
73
73
|
"@ai-ecoverse/wasi-rustc": "1.98.1-5",
|
|
74
74
|
"@ai-ecoverse/wasi-zig": "0.16.0-16",
|