@ai-ecoverse/slicc-kernel 1.171.0 → 1.172.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 +23 -7
- package/dist/driver-worker.js +4 -2
- package/dist/driver-worker.js.map +2 -2
- package/dist/index.js +223 -37
- package/dist/index.js.map +4 -4
- package/dist/kernel-worker.js +507 -196
- 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/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/node.d.ts +12 -4
- package/dist/types/sealed-relay.d.ts +12 -2
- package/dist/types/serve.d.ts +8 -1
- 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,4 +1,5 @@
|
|
|
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';
|
|
3
4
|
import { type ProtectInit } from './fs/protect.js';
|
|
4
5
|
import { type UsersMode } from './fs/types.js';
|
|
@@ -42,6 +43,7 @@ export interface InitRequest {
|
|
|
42
43
|
protect?: ProtectInit;
|
|
43
44
|
denials?: boolean;
|
|
44
45
|
sealed?: boolean;
|
|
46
|
+
sealedFetch?: boolean;
|
|
45
47
|
clipboard?: boolean;
|
|
46
48
|
requests?: Record<string, EmbedderKindPolicy>;
|
|
47
49
|
approve?: boolean;
|
|
@@ -148,6 +150,7 @@ export type AttestRequest = {
|
|
|
148
150
|
id: number;
|
|
149
151
|
op: 'attest';
|
|
150
152
|
path: string;
|
|
153
|
+
options?: AttestOptions;
|
|
151
154
|
} | {
|
|
152
155
|
id: number;
|
|
153
156
|
op: 'chmod';
|
|
@@ -172,7 +175,11 @@ export interface FileChanged {
|
|
|
172
175
|
path: string;
|
|
173
176
|
};
|
|
174
177
|
}
|
|
175
|
-
export type KernelRequest =
|
|
178
|
+
export type KernelRequest = {
|
|
179
|
+
id: number;
|
|
180
|
+
op: 'sealed-placeholders';
|
|
181
|
+
list: readonly string[];
|
|
182
|
+
} | AttestRequest | InitRequest | RunRequest | OpenTerminalRequest | TerminalRequest | ConnectRequest | UsersRequest | MountRequest | DialRequest | RoutesRequest | TraitsRequest;
|
|
176
183
|
type WithoutId<T> = T extends unknown ? Omit<T, 'id'> : never;
|
|
177
184
|
export type KernelCall = WithoutId<KernelRequest>;
|
|
178
185
|
export declare function inOpfs(deps: ServeDeps, root: FileSystemDirectoryHandle): Promise<boolean>;
|
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.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",
|
|
@@ -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",
|