@ai-ecoverse/slicc-kernel 1.124.11 → 1.124.13

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.
@@ -16,6 +16,7 @@ export interface UnlinkHolder {
16
16
  isKept(path: string): boolean;
17
17
  keep(path: string, file: KeptFile): void;
18
18
  unkeep(path: string, file: KeptFile): void;
19
+ moving?(path: string): () => void;
19
20
  }
20
21
  export interface UnlinkOwner {
21
22
  readonly id: string;
@@ -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, JsTlsOptions, JsTlsSession, } from './process/js/js-net.js';
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';
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,6 @@
1
+ export interface TlsCipher {
2
+ name: string;
3
+ standardName: string;
4
+ version: 'TLSv1.0' | 'TLSv1.2' | 'TLSv1.3';
5
+ }
6
+ export declare function cipherOf(id: number, protocol: TlsCipher['version']): TlsCipher;
@@ -1,4 +1,5 @@
1
- import { type TlsEngine, type TlsStore } from './tls-engine.js';
1
+ import { type TlsCipher } from './tls-ciphers.js';
2
+ import { type TlsEngine, type TlsSession, type TlsStore } from './tls-engine.js';
2
3
  import type { UplinkConn } from './uplink.js';
3
4
  export declare function verifyCode(flags: number): string | undefined;
4
5
  export interface TlsClientInfo {
@@ -8,6 +9,11 @@ export interface TlsClientInfo {
8
9
  authorizationError?: string;
9
10
  authorizationText?: string;
10
11
  peerCertificates: Uint8Array[];
12
+ cipher?: TlsCipher;
13
+ clientCertificate?: boolean;
14
+ sni?: boolean;
15
+ hostnameChecked?: boolean;
16
+ hostnameMatches?: boolean;
11
17
  }
12
18
  export interface TlsClientOptions {
13
19
  engine: TlsEngine;
@@ -15,7 +21,13 @@ export interface TlsClientOptions {
15
21
  servername: string;
16
22
  alpn: readonly string[];
17
23
  insecure: boolean;
24
+ sni?: boolean;
25
+ checkHostname?: boolean;
26
+ session?: TlsSession;
27
+ clientCertificate?: boolean;
18
28
  }
29
+ export declare function clientFlags(o: TlsClientOptions): number;
30
+ export declare function openSession(o: TlsClientOptions): TlsSession;
19
31
  export declare function tlsClient(conn: UplinkConn, o: TlsClientOptions, taken?: Uint8Array): Promise<{
20
32
  conn: UplinkConn;
21
33
  info: TlsClientInfo;
@@ -1,16 +1,21 @@
1
1
  type TlsExport = 'malloc' | 'free' | 'tls_last_error' | 'tls_strerror' | 'tls_leaf_new' | 'tls_leaf_spki' | 'tls_leaf_add_cert' | 'tls_leaf_free' | 'tls_session_new' | 'tls_feed' | 'tls_feed_eof' | 'tls_in_room' | 'tls_read' | 'tls_write' | 'tls_out_size' | 'tls_out_take' | 'tls_close' | 'tls_alpn_http11' | 'tls_session_free';
2
2
  type TlsClientExport = 'tls_ca_new' | 'tls_ca_add_der' | 'tls_ca_add_bundle' | 'tls_ca_free' | 'tls_client_new' | 'tls_handshake' | 'tls_verify_result' | 'tls_verify_info' | 'tls_alpn' | 'tls_version' | 'tls_peer_count' | 'tls_peer_der';
3
+ type TlsSessionExport = 'tls_client_cert' | 'tls_ciphersuite' | 'tls_name_mismatch';
3
4
  export type TlsEngineModule = {
4
5
  readonly HEAPU8: Uint8Array;
5
6
  } & {
6
7
  readonly [K in TlsExport as `_${K}`]: (...args: number[]) => number;
7
8
  } & {
8
9
  readonly [K in TlsClientExport as `_${K}`]?: (...args: number[]) => number;
10
+ } & {
11
+ readonly [K in TlsSessionExport as `_${K}`]?: (...args: number[]) => number;
9
12
  };
10
13
  type TlsClientModule = TlsEngineModule & {
11
14
  readonly [K in TlsClientExport as `_${K}`]: (...args: number[]) => number;
12
15
  };
13
16
  export declare const TLS_CLIENT_INSECURE_SKIP_VERIFY = 1;
17
+ export declare const TLS_CLIENT_NO_SNI = 2;
18
+ export declare const TLS_CLIENT_VERIFY_CHAIN_ONLY = 4;
14
19
  export declare class TlsError extends Error {
15
20
  readonly code: number;
16
21
  constructor(code: number, message: string);
@@ -25,7 +30,9 @@ export declare class TlsEngine {
25
30
  leaf(): TlsLeaf;
26
31
  session(leaf: TlsLeaf, host: string): TlsSession;
27
32
  withBytes<T>(bytes: Uint8Array, fn: (ptr: number) => T): T;
33
+ withSecret<T>(bytes: Uint8Array, fn: (ptr: number) => T): T;
28
34
  intoScratch(fn: (ptr: number, max: number) => number): number | Uint8Array;
35
+ get sessionControls(): boolean;
29
36
  get client(): TlsClientModule | undefined;
30
37
  private clientModule;
31
38
  store(): TlsStore;
@@ -67,6 +74,9 @@ export declare class TlsSession {
67
74
  get verifyResult(): number;
68
75
  get version(): number;
69
76
  get alpn(): string | undefined;
77
+ ownCert(chain: Uint8Array, key: Uint8Array, pass: Uint8Array): void;
78
+ get ciphersuite(): number;
79
+ get nameMismatch(): boolean;
70
80
  peerChain(): Uint8Array[];
71
81
  }
72
82
  export declare function loadTlsEngine(load: () => Promise<TlsEngineModule>): Promise<TlsEngine>;
@@ -1,6 +1,6 @@
1
1
  import type { KernelSocket, LoopbackNet } from '../socket.js';
2
2
  import { type TlsClientInfo } from './tls-client.js';
3
- import type { TlsEngine } from './tls-engine.js';
3
+ import { type TlsEngine } from './tls-engine.js';
4
4
  import type { ResolveFamily } from './uplink.js';
5
5
  export interface TlsClientSupport {
6
6
  engine: () => Promise<TlsEngine>;
@@ -11,6 +11,14 @@ export interface SecureRequest {
11
11
  alpn?: string[];
12
12
  ca?: true | string[];
13
13
  insecure?: boolean;
14
+ sni?: false;
15
+ checkHostname?: false;
16
+ clientCert?: ClientCertRequest;
17
+ }
18
+ export interface ClientCertRequest {
19
+ chain: string[];
20
+ key: string;
21
+ passphrase?: string;
14
22
  }
15
23
  export interface SecureProcess {
16
24
  net: LoopbackNet;
@@ -28,6 +36,11 @@ export interface SecureSession {
28
36
  authorizationText?: string;
29
37
  servername: string;
30
38
  peerCertificates: string[];
39
+ cipher?: TlsClientInfo['cipher'];
40
+ clientCertificate?: boolean;
41
+ sni?: boolean;
42
+ hostnameChecked?: boolean;
43
+ hostnameMatches?: boolean;
31
44
  }
32
45
  export declare function supportOf(net: LoopbackNet): TlsClientSupport;
33
46
  export declare function uplinkAddress(proc: SecureProcess, host: string): Promise<string>;
@@ -8,4 +8,4 @@ export declare function hostPort(text: string): {
8
8
  host: string;
9
9
  port: number;
10
10
  } | undefined;
11
- export declare function uplinkLink(conn: UplinkConn, onReset: () => void): UplinkLink;
11
+ export declare function uplinkLink(conn: UplinkConn, onReset: (err: unknown) => void): UplinkLink;
@@ -1,5 +1,6 @@
1
1
  import type { SyncFsResult } from '../realm/sync-fs-wire.js';
2
2
  import { type FdTable } from './fd-table.js';
3
+ import { type ClientCertRequest } from './net/tls-uplink.js';
3
4
  import type { ResolveFamily } from './net/uplink.js';
4
5
  import { type ConnectorStamp, type LoopbackNet, type PeerCred, type SockAddr, type SocketDomain } from './socket.js';
5
6
  import { type SocketNames } from './socket-nodes.js';
@@ -65,6 +66,9 @@ export type SocketSyscall = {
65
66
  alpn?: string[];
66
67
  ca?: true | string[];
67
68
  insecure?: boolean;
69
+ sni?: false;
70
+ checkHostname?: false;
71
+ clientCert?: ClientCertRequest;
68
72
  path?: 'kernel' | 'transport';
69
73
  } | {
70
74
  op: 'sock-tls-upgrade';
@@ -73,6 +77,9 @@ export type SocketSyscall = {
73
77
  alpn?: string[];
74
78
  ca?: true | string[];
75
79
  insecure?: boolean;
80
+ sni?: false;
81
+ checkHostname?: false;
82
+ clientCert?: ClientCertRequest;
76
83
  } | {
77
84
  op: 'sock-recvfrom';
78
85
  fd: number;
@@ -69,6 +69,7 @@ export declare class VfsNode {
69
69
  revoke(): void;
70
70
  private prepare;
71
71
  keep(): Promise<void>;
72
+ readonly moving: Set<Promise<void>>;
72
73
  load(): Promise<Uint8Array>;
73
74
  holds(): boolean;
74
75
  reread(): void;
@@ -136,6 +137,7 @@ export declare class VfsNodes implements UnlinkHolder {
136
137
  owns(): boolean;
137
138
  isKept(): boolean;
138
139
  keep(path: string, file: KeptFile): void;
140
+ moving(path: string): () => void;
139
141
  unkeep(path: string, file: KeptFile): void;
140
142
  rewritten(path: string): void;
141
143
  flush(path: string): Promise<void>;
@@ -6,6 +6,7 @@ import type { JsSyncFile } from './js-sync.js';
6
6
  export type DevStep<T> = Generator<SyncSabRequestBody, T, unknown>;
7
7
  export declare const DEV_READ_MAX: number;
8
8
  export declare function inDev(abs: string): boolean;
9
+ export declare function devFdStat(fd: number): DevStep<SyncFsBridgeStat>;
9
10
  export declare function devStat(abs: string, follow: boolean): DevStep<SyncFsBridgeStat>;
10
11
  export declare function devExists(abs: string): DevStep<boolean>;
11
12
  export declare function devReadlink(abs: string): DevStep<string>;
@@ -12,6 +12,16 @@ export interface JsTlsSession {
12
12
  readonly authorizationError?: string;
13
13
  readonly servername: string;
14
14
  readonly peerCertificates?: readonly Uint8Array[];
15
+ readonly cipher?: JsTlsCipher;
16
+ readonly clientCertificate?: boolean;
17
+ readonly sni?: boolean;
18
+ readonly hostnameChecked?: boolean;
19
+ readonly hostnameMatches?: boolean;
20
+ }
21
+ export interface JsTlsCipher {
22
+ readonly name: string;
23
+ readonly standardName: string;
24
+ readonly version: 'TLSv1.0' | 'TLSv1.2' | 'TLSv1.3';
15
25
  }
16
26
  export interface JsTlsOptions {
17
27
  servername?: string;
@@ -19,6 +29,12 @@ export interface JsTlsOptions {
19
29
  rejectUnauthorized?: boolean;
20
30
  ca?: unknown;
21
31
  path?: 'kernel' | 'transport';
32
+ cert?: unknown;
33
+ key?: unknown;
34
+ passphrase?: string;
35
+ pfx?: unknown;
36
+ sni?: boolean;
37
+ checkHostname?: boolean;
22
38
  }
23
39
  export interface JsConnection {
24
40
  readonly fd: number;
@@ -93,5 +93,5 @@ export declare function kernelAccess(imports: WebAssembly.Imports, fs: () => Pro
93
93
  export declare function kernelLink(imports: WebAssembly.Imports, fs: () => ProcessFs | undefined, memory: () => WebAssembly.Memory | undefined, glue?: KernelImports): void;
94
94
  export declare function devCreations(imports: WebAssembly.Imports, fs: () => ProcessFs | undefined, memory: () => WebAssembly.Memory | undefined, glue?: KernelImports): void;
95
95
  export declare function kernelUname(imports: WebAssembly.Imports, hostname: string, memory: () => WebAssembly.Memory | undefined, glue?: KernelImports): void;
96
- export declare function linuxDevices(Fs: ProcessFs): void;
96
+ export declare function linuxDevices(Fs: ProcessFs, owners?: boolean): void;
97
97
  export {};
@@ -104,6 +104,7 @@ export declare class WasiHost {
104
104
  private sized;
105
105
  private statOrphanable;
106
106
  private synthetic;
107
+ private devChar;
107
108
  private resolveForDev;
108
109
  private writeSiginfo;
109
110
  private fdAlias;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.124.11",
3
+ "version": "1.124.13",
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.23.3",
70
70
  "@ai-ecoverse/wasi-cargo": "0.99.0-3",
71
- "@ai-ecoverse/wasi-pnpm": "12.9.1-9",
71
+ "@ai-ecoverse/wasi-pnpm": "12.9.1-10",
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",
@@ -81,7 +81,7 @@
81
81
  "@ai-ecoverse/wasm-procps": "4.0.7-3",
82
82
  "@ai-ecoverse/wasm-sqlite3": "3.54.0-5",
83
83
  "@ai-ecoverse/wasm-tar": "1.35.0-7",
84
- "@ai-ecoverse/wasm-tls-engine": "4.2.0-2",
84
+ "@ai-ecoverse/wasm-tls-engine": "4.2.0-3",
85
85
  "@ai-ecoverse/wasm-tree": "2.3.2-4",
86
86
  "@ai-ecoverse/wasm-util-linux": "2.42.4-3",
87
87
  "@biomejs/biome": "2.5.15",