@secure-exec/core 0.1.1-rc.3 → 0.2.0-rc.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/dist/esm-compiler.d.ts +5 -1
- package/dist/esm-compiler.js +5 -1
- package/dist/fs-helpers.d.ts +1 -1
- package/dist/generated/isolate-runtime.d.ts +15 -15
- package/dist/generated/isolate-runtime.js +15 -15
- package/dist/index.d.ts +24 -5
- package/dist/index.js +23 -3
- package/dist/isolate-runtime/apply-custom-global-policy.js +3 -3
- package/dist/isolate-runtime/apply-timing-mitigation-freeze.js +2 -2
- package/dist/isolate-runtime/apply-timing-mitigation-off.js +2 -2
- package/dist/isolate-runtime/bridge-attach.js +2 -2
- package/dist/isolate-runtime/bridge-initial-globals.js +145 -6
- package/dist/isolate-runtime/eval-script-result.js +1 -1
- package/dist/isolate-runtime/global-exposure-helpers.js +2 -2
- package/dist/isolate-runtime/init-commonjs-module-globals.js +2 -2
- package/dist/isolate-runtime/override-process-cwd.js +1 -1
- package/dist/isolate-runtime/override-process-env.js +1 -1
- package/dist/isolate-runtime/require-setup.js +2868 -494
- package/dist/isolate-runtime/set-commonjs-file-globals.js +2 -2
- package/dist/isolate-runtime/set-stdin-data.js +1 -1
- package/dist/isolate-runtime/setup-dynamic-import.js +78 -19
- package/dist/isolate-runtime/setup-fs-facade.js +62 -23
- package/dist/kernel/command-registry.d.ts +44 -0
- package/dist/kernel/command-registry.js +114 -0
- package/dist/kernel/device-layer.d.ts +12 -0
- package/dist/kernel/device-layer.js +262 -0
- package/dist/kernel/dns-cache.d.ts +29 -0
- package/dist/kernel/dns-cache.js +52 -0
- package/dist/kernel/fd-table.d.ts +84 -0
- package/dist/kernel/fd-table.js +278 -0
- package/dist/kernel/file-lock.d.ts +34 -0
- package/dist/kernel/file-lock.js +122 -0
- package/dist/kernel/host-adapter.d.ts +50 -0
- package/dist/kernel/host-adapter.js +8 -0
- package/dist/kernel/index.d.ts +36 -0
- package/dist/kernel/index.js +34 -0
- package/dist/kernel/inode-table.d.ts +43 -0
- package/dist/kernel/inode-table.js +85 -0
- package/dist/kernel/kernel.d.ts +9 -0
- package/dist/kernel/kernel.js +1393 -0
- package/dist/kernel/permissions.d.ts +27 -0
- package/dist/kernel/permissions.js +118 -0
- package/dist/kernel/pipe-manager.d.ts +64 -0
- package/dist/kernel/pipe-manager.js +267 -0
- package/dist/kernel/proc-layer.d.ts +11 -0
- package/dist/kernel/proc-layer.js +501 -0
- package/dist/kernel/process-table.d.ts +124 -0
- package/dist/kernel/process-table.js +631 -0
- package/dist/kernel/pty.d.ts +108 -0
- package/dist/kernel/pty.js +541 -0
- package/dist/kernel/socket-table.d.ts +312 -0
- package/dist/kernel/socket-table.js +1188 -0
- package/dist/kernel/timer-table.d.ts +54 -0
- package/dist/kernel/timer-table.js +108 -0
- package/dist/kernel/types.d.ts +500 -0
- package/dist/kernel/types.js +89 -0
- package/dist/kernel/user.d.ts +29 -0
- package/dist/kernel/user.js +35 -0
- package/dist/kernel/vfs.d.ts +54 -0
- package/dist/kernel/vfs.js +8 -0
- package/dist/kernel/wait.d.ts +45 -0
- package/dist/kernel/wait.js +112 -0
- package/dist/kernel/wstatus.d.ts +21 -0
- package/dist/kernel/wstatus.js +33 -0
- package/dist/module-resolver.d.ts +4 -0
- package/dist/module-resolver.js +4 -0
- package/dist/package-bundler.d.ts +6 -1
- package/dist/runtime-driver.d.ts +3 -1
- package/dist/shared/bridge-contract.d.ts +349 -22
- package/dist/shared/bridge-contract.js +62 -5
- package/dist/shared/console-formatter.js +8 -4
- package/dist/shared/global-exposure.js +364 -19
- package/dist/shared/in-memory-fs.d.ts +33 -11
- package/dist/shared/in-memory-fs.js +439 -130
- package/dist/shared/permissions.d.ts +4 -6
- package/dist/shared/permissions.js +19 -39
- package/dist/types.d.ts +8 -159
- package/dist/types.js +5 -0
- package/package.json +12 -22
- package/dist/bridge/active-handles.d.ts +0 -22
- package/dist/bridge/active-handles.js +0 -55
- package/dist/bridge/child-process.d.ts +0 -99
- package/dist/bridge/child-process.js +0 -670
- package/dist/bridge/fs.d.ts +0 -281
- package/dist/bridge/fs.js +0 -2235
- package/dist/bridge/index.d.ts +0 -10
- package/dist/bridge/index.js +0 -41
- package/dist/bridge/module.d.ts +0 -75
- package/dist/bridge/module.js +0 -308
- package/dist/bridge/network.d.ts +0 -350
- package/dist/bridge/network.js +0 -2050
- package/dist/bridge/os.d.ts +0 -13
- package/dist/bridge/os.js +0 -256
- package/dist/bridge/polyfills.d.ts +0 -2
- package/dist/bridge/polyfills.js +0 -11
- package/dist/bridge/process.d.ts +0 -89
- package/dist/bridge/process.js +0 -1015
- package/dist/bridge.js +0 -12496
- package/dist/python-runtime.d.ts +0 -16
- package/dist/python-runtime.js +0 -45
- package/dist/runtime.d.ts +0 -31
- package/dist/runtime.js +0 -69
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { InodeTable } from "../kernel/inode-table.js";
|
|
2
|
+
import type { VirtualDirEntry, VirtualFileSystem, VirtualStat } from "../kernel/vfs.js";
|
|
2
3
|
/**
|
|
3
|
-
* A fully in-memory VirtualFileSystem backed by Maps.
|
|
4
|
+
* A fully in-memory VirtualFileSystem backed by inode-aware Maps.
|
|
4
5
|
* Used as the default filesystem for the browser sandbox and for tests.
|
|
5
6
|
* Paths are always POSIX-style (forward slashes, rooted at "/").
|
|
6
7
|
*/
|
|
7
8
|
export declare class InMemoryFileSystem implements VirtualFileSystem {
|
|
9
|
+
private inodeTable;
|
|
8
10
|
private files;
|
|
11
|
+
private fileContents;
|
|
9
12
|
private dirs;
|
|
10
13
|
private symlinks;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
constructor(inodeTable?: InodeTable);
|
|
15
|
+
setInodeTable(inodeTable: InodeTable): void;
|
|
16
|
+
getInodeForPath(path: string): number | null;
|
|
17
|
+
readFileByInode(ino: number): Uint8Array;
|
|
18
|
+
writeFileByInode(ino: number, content: Uint8Array): void;
|
|
19
|
+
preadByInode(ino: number, offset: number, length: number): Uint8Array;
|
|
20
|
+
statByInode(ino: number): VirtualStat;
|
|
21
|
+
deleteInodeData(ino: number): void;
|
|
15
22
|
private listDirEntries;
|
|
16
23
|
readFile(path: string): Promise<Uint8Array>;
|
|
17
24
|
readTextFile(path: string): Promise<string>;
|
|
18
25
|
readDir(path: string): Promise<string[]>;
|
|
19
|
-
readDirWithTypes(path: string): Promise<
|
|
20
|
-
name: string;
|
|
21
|
-
isDirectory: boolean;
|
|
22
|
-
}>>;
|
|
26
|
+
readDirWithTypes(path: string): Promise<VirtualDirEntry[]>;
|
|
23
27
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
28
|
+
prepareOpenSync(path: string, flags: number): boolean;
|
|
24
29
|
createDir(path: string): Promise<void>;
|
|
25
|
-
mkdir(path: string
|
|
30
|
+
mkdir(path: string, _options?: {
|
|
31
|
+
recursive?: boolean;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
private resolveIfSymlink;
|
|
26
34
|
private resolveSymlink;
|
|
35
|
+
private statForInode;
|
|
27
36
|
private statEntry;
|
|
28
37
|
exists(path: string): Promise<boolean>;
|
|
29
38
|
stat(path: string): Promise<VirtualStat>;
|
|
@@ -37,6 +46,19 @@ export declare class InMemoryFileSystem implements VirtualFileSystem {
|
|
|
37
46
|
chmod(path: string, mode: number): Promise<void>;
|
|
38
47
|
chown(path: string, uid: number, gid: number): Promise<void>;
|
|
39
48
|
utimes(path: string, atime: number, mtime: number): Promise<void>;
|
|
49
|
+
realpath(path: string): Promise<string>;
|
|
50
|
+
pread(path: string, offset: number, length: number): Promise<Uint8Array>;
|
|
40
51
|
truncate(path: string, length: number): Promise<void>;
|
|
52
|
+
private reindexInodes;
|
|
53
|
+
private cloneInode;
|
|
54
|
+
private allocateFileInode;
|
|
55
|
+
private allocateDirectoryInode;
|
|
56
|
+
private allocateSymlinkInode;
|
|
57
|
+
private updateFileMetadata;
|
|
58
|
+
private requirePathInode;
|
|
59
|
+
private requireFileInode;
|
|
60
|
+
private requireInode;
|
|
61
|
+
private ensureDirectory;
|
|
62
|
+
private adjustParentDirectoryLinkCount;
|
|
41
63
|
}
|
|
42
64
|
export declare function createInMemoryFileSystem(): InMemoryFileSystem;
|