@ai-ecoverse/slicc-kernel 1.171.0 → 1.172.2
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 +25 -8
- package/dist/driver-worker.js +4 -2
- package/dist/driver-worker.js.map +2 -2
- package/dist/index.js +260 -42
- package/dist/index.js.map +4 -4
- package/dist/kernel-worker.js +602 -230
- package/dist/kernel-worker.js.map +4 -4
- package/dist/node-driver-worker.js +4 -2
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.cjs +1 -1
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +462 -233
- package/dist/node.js.map +4 -4
- package/dist/process-worker.js +1 -1
- package/dist/testing.js +498 -3
- package/dist/testing.js.map +4 -4
- package/dist/types/fs/attest.d.ts +12 -2
- package/dist/types/fs/portable.d.ts +11 -0
- package/dist/types/fs/roots.d.ts +1 -1
- package/dist/types/index.d.ts +12 -4
- package/dist/types/kernel/net/http-syscalls.d.ts +3 -1
- package/dist/types/kernel/net/loopback-transport.d.ts +1 -1
- package/dist/types/kernel/net/placeholder-floor.d.ts +9 -3
- package/dist/types/kernel/net/remote-transport.d.ts +4 -1
- package/dist/types/kernel/net/sealed-fetch.d.ts +27 -0
- package/dist/types/kernel/net/transport.d.ts +2 -1
- package/dist/types/kernel/socket.d.ts +4 -1
- package/dist/types/launcher.d.ts +12 -2
- package/dist/types/mount/media.d.ts +3 -1
- package/dist/types/node.d.ts +12 -4
- package/dist/types/sealed-relay.d.ts +12 -2
- package/dist/types/serve.d.ts +14 -5
- package/dist/types/testing.d.ts +3 -0
- package/dist/types/transport.d.ts +2 -1
- package/package.json +2 -2
package/dist/types/node.d.ts
CHANGED
|
@@ -2,15 +2,16 @@ import { type MessagePort, type Worker } from 'node:worker_threads';
|
|
|
2
2
|
import type { CdpHook } from './cdp/types.js';
|
|
3
3
|
import type { CronClock } from './cron/clock.js';
|
|
4
4
|
import type { FacadeSpecs } from './facade/types.js';
|
|
5
|
+
import type { Attestation, AttestTombstone } from './fs/attest.js';
|
|
5
6
|
import type { DenialHook } from './fs/dac.js';
|
|
6
7
|
import type { Protection } from './fs/protect.js';
|
|
7
8
|
import { type UsersMode } from './fs/types.js';
|
|
8
|
-
import type { ConnectOptions, KernelGroups, KernelIntegrity, KernelUsers, RunOptions, RunResult, Terminal, TerminalOptions } from './index.js';
|
|
9
|
+
import type { ConnectOptions, KernelGroups, KernelIntegrity, KernelSealed, KernelUsers, RunOptions, RunResult, Terminal, TerminalOptions } from './index.js';
|
|
9
10
|
import type { ClipboardHook } from './kernel/clipboard.js';
|
|
10
11
|
import { type EmbedderHook } from './kernel/embedder.js';
|
|
11
12
|
import type { RouteTable } from './kernel/net/routes.js';
|
|
13
|
+
import { type SealedOption } from './kernel/net/sealed-fetch.js';
|
|
12
14
|
import type { NetworkUplink } from './kernel/net/uplink.js';
|
|
13
|
-
import type { SealedHook } from './kernel/sealed.js';
|
|
14
15
|
import type { FetchLike, HostfsGrantHook } from './mount/hostfs.js';
|
|
15
16
|
import type { MountEntry, MountSpec } from './mount/mount-fs.js';
|
|
16
17
|
import type { ProcessMountPolicy } from './mount/syscall.js';
|
|
@@ -21,10 +22,12 @@ import { type NetworkTransport } from './transport.js';
|
|
|
21
22
|
export type { CdpConnection, CdpHook, CdpRequest } from './cdp/types.js';
|
|
22
23
|
export { type AttachOptions, attachKernel, type ClientEnded, type ClientFetchRequest, type ClientFs, type ClientRunOptions, type ClientRunResult, type ClientTerminal, type ClientTerminalOptions, KernelCallError, type KernelClient, KernelGoneError, type ProcessEntry, type SpawnedProcess, type SpawnOptions, type WatchChange, } from './client/attach.js';
|
|
23
24
|
export type { FacadeConnection, FacadeHook, FacadeInfo, FacadeSpec, FacadeSpecs, } from './facade/types.js';
|
|
25
|
+
export type { Attestation, AttestedDir, AttestOptions, AttestTombstone } from './fs/attest.js';
|
|
24
26
|
export type { Denial, DenialHook } from './fs/dac.js';
|
|
25
|
-
export type { ConnectOptions, Ended, KernelGroups, KernelIntegrity, KernelUsers, NetworkUplink, ResolveAnswer, ResolveFamily, RouteTable, RunOptions, RunResult, Terminal, TerminalOptions, TerminalSignal, } from './index.js';
|
|
27
|
+
export type { ConnectOptions, Ended, KernelGroups, KernelIntegrity, KernelSealed, KernelUsers, NetworkUplink, ResolveAnswer, ResolveFamily, RouteTable, RunOptions, RunResult, Terminal, TerminalOptions, TerminalSignal, } from './index.js';
|
|
26
28
|
export type { ClipboardHook, ClipboardStamp } from './kernel/clipboard.js';
|
|
27
29
|
export type { EmbedderHook, EmbedderKindPolicy, EmbedderReply, EmbedderRequest, EmbedderStamp, } from './kernel/embedder.js';
|
|
30
|
+
export { SEALED_FETCH_VERSION, type SealedFetchHook, type SealedFetchRequest, type SealedOption, } from './kernel/net/sealed-fetch.js';
|
|
28
31
|
export type { SealedAbortReason, SealedCaller, SealedHook, SealedRequest, } from './kernel/sealed.js';
|
|
29
32
|
export type { ConnectorStamp } from './kernel/socket.js';
|
|
30
33
|
export type { HostfsEvent, HostfsGrant, HostfsGrantHook, HostfsPortGrant, HostfsTransport, } from './mount/hostfs.js';
|
|
@@ -58,7 +61,7 @@ export interface NodeKernelOptions {
|
|
|
58
61
|
hostname?: string;
|
|
59
62
|
users?: UsersMode;
|
|
60
63
|
onDenial?: DenialHook;
|
|
61
|
-
sealed?:
|
|
64
|
+
sealed?: SealedOption;
|
|
62
65
|
clipboard?: ClipboardHook;
|
|
63
66
|
requests?: EmbedderHook;
|
|
64
67
|
approve?: ApproveHook;
|
|
@@ -84,6 +87,11 @@ export interface NodeKernel {
|
|
|
84
87
|
readFile(path: string): Promise<Uint8Array>;
|
|
85
88
|
chmod(path: string, mode: number): Promise<void>;
|
|
86
89
|
readonly integrity: KernelIntegrity;
|
|
90
|
+
readonly sealed: KernelSealed;
|
|
91
|
+
attest(path: string): Promise<Attestation>;
|
|
92
|
+
attest(path: string, options: {
|
|
93
|
+
absent: 'allow';
|
|
94
|
+
}): Promise<Attestation | AttestTombstone>;
|
|
87
95
|
connect(options?: ConnectOptions): Promise<MessagePort>;
|
|
88
96
|
readonly users: KernelUsers;
|
|
89
97
|
readonly groups: KernelGroups;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type SealedFetchHook, type SealedFetchRequest } from './kernel/net/sealed-fetch.js';
|
|
1
2
|
import type { SealedHook, SealedRequest } from './kernel/sealed.js';
|
|
2
3
|
export interface SealedPort {
|
|
3
|
-
postMessage(message: unknown): void;
|
|
4
|
+
postMessage(message: unknown, transfer?: Transferable[]): void;
|
|
4
5
|
}
|
|
5
6
|
export interface SealedAsk {
|
|
6
7
|
id: number;
|
|
@@ -15,12 +16,21 @@ export interface SealedAbort {
|
|
|
15
16
|
id: number;
|
|
16
17
|
reason: unknown;
|
|
17
18
|
}
|
|
19
|
+
type WireRequest = Omit<SealedFetchRequest, 'bodyStream'> & {
|
|
20
|
+
streamed?: true;
|
|
21
|
+
};
|
|
22
|
+
export interface SealedFetchAsk {
|
|
23
|
+
req: WireRequest;
|
|
24
|
+
port: MessagePort;
|
|
25
|
+
}
|
|
18
26
|
export declare function sealedAsker(port: SealedPort): {
|
|
19
27
|
hook: SealedHook;
|
|
28
|
+
fetch: SealedFetchHook;
|
|
20
29
|
answer(reply: SealedReply): void;
|
|
21
30
|
};
|
|
22
31
|
export interface SealedAnswerer {
|
|
23
32
|
handle(data: unknown): boolean;
|
|
24
33
|
close(): void;
|
|
25
34
|
}
|
|
26
|
-
export declare function sealedAnswerer(port: SealedPort, hook: SealedHook | undefined): SealedAnswerer;
|
|
35
|
+
export declare function sealedAnswerer(port: SealedPort, hook: SealedHook | undefined, fetchHook?: SealedFetchHook): SealedAnswerer;
|
|
36
|
+
export {};
|
package/dist/types/serve.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type LockManagerLike } from './client/protocol.js';
|
|
2
|
+
import type { AttestOptions } from './fs/attest.js';
|
|
2
3
|
import { type MetaStore } from './fs/meta.js';
|
|
4
|
+
import { type Portable } from './fs/portable.js';
|
|
3
5
|
import { type ProtectInit } from './fs/protect.js';
|
|
4
6
|
import { type UsersMode } from './fs/types.js';
|
|
5
7
|
import type { EmbedderKindPolicy } from './kernel/embedder.js';
|
|
@@ -7,7 +9,7 @@ import type { WasmWorkerLike } from './kernel/host.js';
|
|
|
7
9
|
import type { RouteTable } from './kernel/net/routes.js';
|
|
8
10
|
import type { RealmTransportTraits } from './kernel/net/transport.js';
|
|
9
11
|
import { type UplinkTraits } from './kernel/net/uplink.js';
|
|
10
|
-
import { type ModuleUrlMaker, type RunOptions, type TerminalOptions } from './launcher.js';
|
|
12
|
+
import { type ModuleUrlMaker, type PendingMedium, type RunOptions, type TerminalOptions } from './launcher.js';
|
|
11
13
|
import type { MediumHandle } from './mount/fsa.js';
|
|
12
14
|
import type { HostfsGrant, HostfsPortGrant } from './mount/hostfs.js';
|
|
13
15
|
import type { MediaStore } from './mount/media.js';
|
|
@@ -21,6 +23,7 @@ export interface InitRequest {
|
|
|
21
23
|
id: number;
|
|
22
24
|
op: 'init';
|
|
23
25
|
root?: FileSystemDirectoryHandle;
|
|
26
|
+
rootPath?: string[];
|
|
24
27
|
modules?: string;
|
|
25
28
|
commands?: {
|
|
26
29
|
append?: readonly string[];
|
|
@@ -42,6 +45,7 @@ export interface InitRequest {
|
|
|
42
45
|
protect?: ProtectInit;
|
|
43
46
|
denials?: boolean;
|
|
44
47
|
sealed?: boolean;
|
|
48
|
+
sealedFetch?: boolean;
|
|
45
49
|
clipboard?: boolean;
|
|
46
50
|
requests?: Record<string, EmbedderKindPolicy>;
|
|
47
51
|
approve?: boolean;
|
|
@@ -131,13 +135,12 @@ export type MountRequest = {
|
|
|
131
135
|
} | {
|
|
132
136
|
id: number;
|
|
133
137
|
op: 'mounts';
|
|
134
|
-
} | {
|
|
138
|
+
} | ({
|
|
135
139
|
id: number;
|
|
136
140
|
op: 'insert';
|
|
137
141
|
target: string;
|
|
138
142
|
source?: string;
|
|
139
|
-
|
|
140
|
-
};
|
|
143
|
+
} & Portable<MediumHandle>);
|
|
141
144
|
export interface DialRequest {
|
|
142
145
|
id: number;
|
|
143
146
|
op: 'dial';
|
|
@@ -148,6 +151,7 @@ export type AttestRequest = {
|
|
|
148
151
|
id: number;
|
|
149
152
|
op: 'attest';
|
|
150
153
|
path: string;
|
|
154
|
+
options?: AttestOptions;
|
|
151
155
|
} | {
|
|
152
156
|
id: number;
|
|
153
157
|
op: 'chmod';
|
|
@@ -172,10 +176,15 @@ export interface FileChanged {
|
|
|
172
176
|
path: string;
|
|
173
177
|
};
|
|
174
178
|
}
|
|
175
|
-
export type KernelRequest =
|
|
179
|
+
export type KernelRequest = {
|
|
180
|
+
id: number;
|
|
181
|
+
op: 'sealed-placeholders';
|
|
182
|
+
list: readonly string[];
|
|
183
|
+
} | AttestRequest | InitRequest | RunRequest | OpenTerminalRequest | TerminalRequest | ConnectRequest | UsersRequest | MountRequest | DialRequest | RoutesRequest | TraitsRequest;
|
|
176
184
|
type WithoutId<T> = T extends unknown ? Omit<T, 'id'> : never;
|
|
177
185
|
export type KernelCall = WithoutId<KernelRequest>;
|
|
178
186
|
export declare function inOpfs(deps: ServeDeps, root: FileSystemDirectoryHandle): Promise<boolean>;
|
|
187
|
+
export declare function crossable(medium: PendingMedium): PendingMedium;
|
|
179
188
|
export interface ServeDeps {
|
|
180
189
|
rootId?: (root: FileSystemDirectoryHandle) => Promise<string>;
|
|
181
190
|
storage: () => Promise<FileSystemDirectoryHandle>;
|
package/dist/types/testing.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { RouteTable } from './kernel/net/routes.js';
|
|
2
2
|
import { type NetworkUplink, type ResolveAnswer, type ResolveFamily, type UplinkConn, type UplinkDatagram, type UplinkDial, type UplinkMessage, type UplinkUdp, type UplinkUdpOpen, type UplinkUnreachable } from './kernel/net/uplink.js';
|
|
3
3
|
export { type CronClock, type FakeCronClock, fakeCronClock } from './cron/clock.js';
|
|
4
|
+
export { placeholderFloor } from './kernel/net/placeholder-floor.js';
|
|
5
|
+
export { sealedFetcher } from './kernel/net/sealed-fetch.js';
|
|
4
6
|
export { setTestSyscallHook, type TestSyscall, type TestSyscallHook, } from './kernel/test-hooks.js';
|
|
7
|
+
export { sealedAnswerer, sealedAsker } from './sealed-relay.js';
|
|
5
8
|
export type { NetworkUplink, ResolveAnswer, ResolveFamily, RouteTable, UplinkConn, UplinkDatagram, UplinkDial, UplinkMessage, UplinkUdp, UplinkUdpOpen, UplinkUnreachable, };
|
|
6
9
|
export type FakeDatagramPeer = (bytes: Uint8Array) => Uint8Array | readonly Uint8Array[] | {
|
|
7
10
|
error: string;
|
|
@@ -21,6 +21,7 @@ export interface TransportServer {
|
|
|
21
21
|
answer(call: TransportCall): void;
|
|
22
22
|
close(): void;
|
|
23
23
|
}
|
|
24
|
-
export declare function serveTransport(peer: TransportPeer, transport: RealmTransport, { closeWaitMs }?: {
|
|
24
|
+
export declare function serveTransport(peer: TransportPeer, transport: RealmTransport, { closeWaitMs, attributed, }?: {
|
|
25
25
|
closeWaitMs?: number;
|
|
26
|
+
attributed?: boolean;
|
|
26
27
|
}): TransportServer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-kernel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.172.2",
|
|
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",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@ai-ecoverse/wasm-tar": "1.35.0-9",
|
|
90
90
|
"@ai-ecoverse/wasm-tls-engine": "4.2.0-12",
|
|
91
91
|
"@ai-ecoverse/wasm-util-linux": "2.42.4-7",
|
|
92
|
-
"@biomejs/biome": "2.6.
|
|
92
|
+
"@biomejs/biome": "2.6.3",
|
|
93
93
|
"@types/node": "26.6.5",
|
|
94
94
|
"acorn": "8.19.0",
|
|
95
95
|
"esbuild": "0.28.2",
|