@scelar/nodepod 1.0.4 → 1.0.5
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/{child_process-lxSKECHq.cjs → child_process-B9qsOKHs.cjs} +7434 -7434
- package/dist/{child_process-lxSKECHq.cjs.map → child_process-B9qsOKHs.cjs.map} +1 -1
- package/dist/{child_process-53fMkug_.js → child_process-PY34i_6n.js} +8233 -8233
- package/dist/{child_process-53fMkug_.js.map → child_process-PY34i_6n.js.map} +1 -1
- package/dist/{index-C-TQIrdG.cjs → index-CyhVjVJU.cjs} +38383 -38005
- package/dist/index-CyhVjVJU.cjs.map +1 -0
- package/dist/{index-B8lyh_ti.js → index-D8Hn2kWU.js} +36455 -36065
- package/dist/index-D8Hn2kWU.js.map +1 -0
- package/dist/index.cjs +67 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +88 -86
- package/dist/index.mjs +61 -59
- package/dist/memory-handler.d.ts +57 -0
- package/dist/memory-volume.d.ts +157 -147
- package/dist/packages/installer.d.ts +44 -41
- package/dist/persistence/idb-cache.d.ts +7 -0
- package/dist/script-engine.d.ts +84 -81
- package/dist/sdk/nodepod-process.d.ts +29 -28
- package/dist/sdk/nodepod.d.ts +59 -40
- package/dist/sdk/types.d.ts +64 -59
- package/package.json +97 -97
- package/src/index.ts +2 -0
- package/src/memory-handler.ts +168 -0
- package/src/memory-volume.ts +72 -8
- package/src/packages/installer.ts +49 -1
- package/src/packages/version-resolver.ts +421 -421
- package/src/persistence/idb-cache.ts +107 -0
- package/src/polyfills/events.ts +6 -2
- package/src/polyfills/stream.ts +1 -0
- package/src/polyfills/wasi.ts +1306 -1306
- package/src/polyfills/zlib.ts +881 -881
- package/src/script-engine.ts +3722 -3694
- package/src/sdk/nodepod-process.ts +94 -86
- package/src/sdk/nodepod.ts +52 -6
- package/src/sdk/types.ts +82 -77
- package/src/threading/process-manager.ts +11 -0
- package/src/threading/worker-protocol.ts +358 -358
- package/dist/index-B8lyh_ti.js.map +0 -1
- package/dist/index-C-TQIrdG.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,65 +1,67 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.DependencyInstaller = index.DependencyInstaller;
|
|
10
|
-
exports.IframeSandbox = index.IframeSandbox;
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
50
|
-
exports.
|
|
51
|
-
exports.
|
|
52
|
-
exports.
|
|
53
|
-
exports.
|
|
54
|
-
exports.
|
|
55
|
-
exports.
|
|
56
|
-
exports.
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
exports.
|
|
61
|
-
exports.
|
|
62
|
-
exports.
|
|
63
|
-
exports.
|
|
64
|
-
exports.
|
|
65
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-CyhVjVJU.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.DependencyInstaller = index.DependencyInstaller;
|
|
10
|
+
exports.IframeSandbox = index.IframeSandbox;
|
|
11
|
+
exports.LRUCache = index.LRUCache;
|
|
12
|
+
exports.MemoryHandler = index.MemoryHandler;
|
|
13
|
+
exports.MemoryVolume = index.MemoryVolume;
|
|
14
|
+
exports.Nodepod = index.Nodepod;
|
|
15
|
+
exports.NodepodFS = index.NodepodFS;
|
|
16
|
+
exports.NodepodProcess = index.NodepodProcess;
|
|
17
|
+
exports.NodepodTerminal = index.NodepodTerminal;
|
|
18
|
+
exports.ProcessHandle = index.ProcessHandle;
|
|
19
|
+
exports.ProcessManager = index.ProcessManager;
|
|
20
|
+
exports.ProcessWorkerAdapter = index.ProcessWorkerAdapter;
|
|
21
|
+
exports.RequestProxy = index.RequestProxy;
|
|
22
|
+
exports.SANDBOX_DEPLOYMENT_GUIDE = index.SANDBOX_DEPLOYMENT_GUIDE;
|
|
23
|
+
exports.ScriptEngine = index.ScriptEngine;
|
|
24
|
+
exports.SharedVFSController = index.SharedVFSController;
|
|
25
|
+
exports.SharedVFSReader = index.SharedVFSReader;
|
|
26
|
+
exports.SyncChannelController = index.SyncChannelController;
|
|
27
|
+
exports.SyncChannelWorker = index.SyncChannelWorker;
|
|
28
|
+
exports.VFSBridge = index.VFSBridge;
|
|
29
|
+
exports.WorkerSandbox = index.WorkerSandbox;
|
|
30
|
+
exports.WorkerVFS = index.WorkerVFS;
|
|
31
|
+
exports.assert = index.assert;
|
|
32
|
+
exports.buildFileSystemBridge = index.buildFileSystemBridge;
|
|
33
|
+
exports.buildProcessEnv = index.buildProcessEnv;
|
|
34
|
+
exports.chokidar = index.watcherPolyfill;
|
|
35
|
+
exports.createProcessContext = index.createProcessContext;
|
|
36
|
+
exports.createWorkspace = index.createWorkspace;
|
|
37
|
+
exports.default = index.createWorkspace;
|
|
38
|
+
exports.esbuild = index.esbuildPolyfill;
|
|
39
|
+
exports.events = index.events;
|
|
40
|
+
exports.executeCode = index.executeCode;
|
|
41
|
+
exports.fsevents = index.macEventsPolyfill;
|
|
42
|
+
exports.generateSandboxDeployment = index.generateSandboxDeployment;
|
|
43
|
+
exports.getActiveContext = index.getActiveContext;
|
|
44
|
+
exports.getProxyInstance = index.getProxyInstance;
|
|
45
|
+
exports.getSandboxHostingConfig = index.getSandboxHostingConfig;
|
|
46
|
+
exports.getSandboxPageHtml = index.getSandboxPageHtml;
|
|
47
|
+
exports.http = index.httpPolyfill;
|
|
48
|
+
exports.install = index.install;
|
|
49
|
+
exports.isSharedArrayBufferAvailable = index.isSharedArrayBufferAvailable;
|
|
50
|
+
exports.module = index.module;
|
|
51
|
+
exports.net = index.tcpPolyfill;
|
|
52
|
+
exports.npm = index.installer;
|
|
53
|
+
exports.path = index.pathPolyfill;
|
|
54
|
+
exports.perf_hooks = index.perfPolyfill;
|
|
55
|
+
exports.querystring = index.qsPolyfill;
|
|
56
|
+
exports.readdirp = index.scannerPolyfill;
|
|
57
|
+
exports.resetProxy = index.resetProxy;
|
|
58
|
+
exports.rollup = index.rollupPolyfill;
|
|
59
|
+
exports.setActiveContext = index.setActiveContext;
|
|
60
|
+
exports.spawnEngine = index.spawnEngine;
|
|
61
|
+
exports.spawnProcessWorkerEngine = index.spawnProcessWorkerEngine;
|
|
62
|
+
exports.stream = index.stream;
|
|
63
|
+
exports.url = index.urlPolyfill;
|
|
64
|
+
exports.util = index.helpersPolyfill;
|
|
65
|
+
exports.worker_threads = index.threadPoolPolyfill;
|
|
66
|
+
exports.ws = index.wsPolyfill;
|
|
67
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,86 +1,88 @@
|
|
|
1
|
-
export { MemoryVolume } from "./memory-volume";
|
|
2
|
-
export type { VolumeNode, FileStat, FileWatchHandle, WatchCallback, WatchEventKind, SystemError, } from "./memory-volume";
|
|
3
|
-
export { ScriptEngine, executeCode } from "./script-engine";
|
|
4
|
-
export type { ModuleRecord, EngineOptions, ResolverFn } from "./script-engine";
|
|
5
|
-
export { spawnEngine, WorkerSandbox, IframeSandbox, spawnProcessWorkerEngine, ProcessWorkerAdapter } from "./engine-factory";
|
|
6
|
-
export type { IScriptEngine, ExecutionOutcome, SpawnEngineConfig, EngineConfig, VolumeSnapshot, } from "./engine-types";
|
|
7
|
-
export { generateSandboxDeployment, getSandboxPageHtml, getSandboxHostingConfig, SANDBOX_DEPLOYMENT_GUIDE, } from "./isolation-helpers";
|
|
8
|
-
export { buildFileSystemBridge } from "./polyfills/fs";
|
|
9
|
-
export type { FsBridge } from "./polyfills/fs";
|
|
10
|
-
export { buildProcessEnv } from "./polyfills/process";
|
|
11
|
-
export type { ProcessObject, ProcessEnvVars } from "./polyfills/process";
|
|
12
|
-
export * as path from "./polyfills/path";
|
|
13
|
-
export * as http from "./polyfills/http";
|
|
14
|
-
export * as net from "./polyfills/net";
|
|
15
|
-
export * as events from "./polyfills/events";
|
|
16
|
-
export * as stream from "./polyfills/stream";
|
|
17
|
-
export * as url from "./polyfills/url";
|
|
18
|
-
export * as querystring from "./polyfills/querystring";
|
|
19
|
-
export * as util from "./polyfills/util";
|
|
20
|
-
export * as npm from "./packages/installer";
|
|
21
|
-
export { DependencyInstaller, install } from "./packages/installer";
|
|
22
|
-
export { RequestProxy, getProxyInstance, resetProxy } from "./request-proxy";
|
|
23
|
-
export type { ProxyOptions, ServiceWorkerConfig } from "./request-proxy";
|
|
24
|
-
export * as chokidar from "./polyfills/chokidar";
|
|
25
|
-
export * as ws from "./polyfills/ws";
|
|
26
|
-
export * as fsevents from "./polyfills/fsevents";
|
|
27
|
-
export * as readdirp from "./polyfills/readdirp";
|
|
28
|
-
export * as module from "./polyfills/module";
|
|
29
|
-
export * as perf_hooks from "./polyfills/perf_hooks";
|
|
30
|
-
export * as worker_threads from "./polyfills/worker_threads";
|
|
31
|
-
export * as esbuild from "./polyfills/esbuild";
|
|
32
|
-
export * as rollup from "./polyfills/rollup";
|
|
33
|
-
export * as assert from "./polyfills/assert";
|
|
34
|
-
import { MemoryVolume } from "./memory-volume";
|
|
35
|
-
import { ScriptEngine, EngineOptions } from "./script-engine";
|
|
36
|
-
import { DependencyInstaller } from "./packages/installer";
|
|
37
|
-
import { RequestProxy } from "./request-proxy";
|
|
38
|
-
export interface CommandResult {
|
|
39
|
-
stdout: string;
|
|
40
|
-
stderr: string;
|
|
41
|
-
exitCode: number;
|
|
42
|
-
}
|
|
43
|
-
export interface CommandOptions {
|
|
44
|
-
cwd?: string;
|
|
45
|
-
onStdout?: (data: string) => void;
|
|
46
|
-
onStderr?: (data: string) => void;
|
|
47
|
-
signal?: AbortSignal;
|
|
48
|
-
}
|
|
49
|
-
export interface WorkspaceConfig extends EngineOptions {
|
|
50
|
-
baseUrl?: string;
|
|
51
|
-
onServerReady?: (port: number, url: string) => void;
|
|
52
|
-
}
|
|
53
|
-
export declare function createWorkspace(config?: WorkspaceConfig): {
|
|
54
|
-
volume: MemoryVolume;
|
|
55
|
-
engine: ScriptEngine;
|
|
56
|
-
packages: DependencyInstaller;
|
|
57
|
-
proxy: RequestProxy;
|
|
58
|
-
execute: (code: string, filename?: string) => {
|
|
59
|
-
exports: unknown;
|
|
60
|
-
};
|
|
61
|
-
runFile: (filename: string) => {
|
|
62
|
-
exports: unknown;
|
|
63
|
-
};
|
|
64
|
-
run: (command: string, options?: CommandOptions) => Promise<CommandResult>;
|
|
65
|
-
sendInput: (data: string) => Promise<void>;
|
|
66
|
-
createREPL: () => {
|
|
67
|
-
eval: (code: string) => unknown;
|
|
68
|
-
};
|
|
69
|
-
on: (event: string, listener: (...args: unknown[]) => void) => void;
|
|
70
|
-
};
|
|
71
|
-
export default createWorkspace;
|
|
72
|
-
export { Nodepod } from "./sdk/nodepod";
|
|
73
|
-
export { NodepodTerminal } from "./sdk/nodepod-terminal";
|
|
74
|
-
export { NodepodProcess } from "./sdk/nodepod-process";
|
|
75
|
-
export { NodepodFS } from "./sdk/nodepod-fs";
|
|
76
|
-
export type { NodepodOptions, TerminalOptions, TerminalTheme, StatResult, Snapshot, SpawnOptions, } from "./sdk/types";
|
|
77
|
-
export {
|
|
78
|
-
export {
|
|
79
|
-
export
|
|
80
|
-
export {
|
|
81
|
-
export {
|
|
82
|
-
export {
|
|
83
|
-
export {
|
|
84
|
-
export {
|
|
85
|
-
export
|
|
86
|
-
export
|
|
1
|
+
export { MemoryVolume } from "./memory-volume";
|
|
2
|
+
export type { VolumeNode, FileStat, FileWatchHandle, WatchCallback, WatchEventKind, SystemError, } from "./memory-volume";
|
|
3
|
+
export { ScriptEngine, executeCode } from "./script-engine";
|
|
4
|
+
export type { ModuleRecord, EngineOptions, ResolverFn } from "./script-engine";
|
|
5
|
+
export { spawnEngine, WorkerSandbox, IframeSandbox, spawnProcessWorkerEngine, ProcessWorkerAdapter } from "./engine-factory";
|
|
6
|
+
export type { IScriptEngine, ExecutionOutcome, SpawnEngineConfig, EngineConfig, VolumeSnapshot, } from "./engine-types";
|
|
7
|
+
export { generateSandboxDeployment, getSandboxPageHtml, getSandboxHostingConfig, SANDBOX_DEPLOYMENT_GUIDE, } from "./isolation-helpers";
|
|
8
|
+
export { buildFileSystemBridge } from "./polyfills/fs";
|
|
9
|
+
export type { FsBridge } from "./polyfills/fs";
|
|
10
|
+
export { buildProcessEnv } from "./polyfills/process";
|
|
11
|
+
export type { ProcessObject, ProcessEnvVars } from "./polyfills/process";
|
|
12
|
+
export * as path from "./polyfills/path";
|
|
13
|
+
export * as http from "./polyfills/http";
|
|
14
|
+
export * as net from "./polyfills/net";
|
|
15
|
+
export * as events from "./polyfills/events";
|
|
16
|
+
export * as stream from "./polyfills/stream";
|
|
17
|
+
export * as url from "./polyfills/url";
|
|
18
|
+
export * as querystring from "./polyfills/querystring";
|
|
19
|
+
export * as util from "./polyfills/util";
|
|
20
|
+
export * as npm from "./packages/installer";
|
|
21
|
+
export { DependencyInstaller, install } from "./packages/installer";
|
|
22
|
+
export { RequestProxy, getProxyInstance, resetProxy } from "./request-proxy";
|
|
23
|
+
export type { ProxyOptions, ServiceWorkerConfig } from "./request-proxy";
|
|
24
|
+
export * as chokidar from "./polyfills/chokidar";
|
|
25
|
+
export * as ws from "./polyfills/ws";
|
|
26
|
+
export * as fsevents from "./polyfills/fsevents";
|
|
27
|
+
export * as readdirp from "./polyfills/readdirp";
|
|
28
|
+
export * as module from "./polyfills/module";
|
|
29
|
+
export * as perf_hooks from "./polyfills/perf_hooks";
|
|
30
|
+
export * as worker_threads from "./polyfills/worker_threads";
|
|
31
|
+
export * as esbuild from "./polyfills/esbuild";
|
|
32
|
+
export * as rollup from "./polyfills/rollup";
|
|
33
|
+
export * as assert from "./polyfills/assert";
|
|
34
|
+
import { MemoryVolume } from "./memory-volume";
|
|
35
|
+
import { ScriptEngine, EngineOptions } from "./script-engine";
|
|
36
|
+
import { DependencyInstaller } from "./packages/installer";
|
|
37
|
+
import { RequestProxy } from "./request-proxy";
|
|
38
|
+
export interface CommandResult {
|
|
39
|
+
stdout: string;
|
|
40
|
+
stderr: string;
|
|
41
|
+
exitCode: number;
|
|
42
|
+
}
|
|
43
|
+
export interface CommandOptions {
|
|
44
|
+
cwd?: string;
|
|
45
|
+
onStdout?: (data: string) => void;
|
|
46
|
+
onStderr?: (data: string) => void;
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
}
|
|
49
|
+
export interface WorkspaceConfig extends EngineOptions {
|
|
50
|
+
baseUrl?: string;
|
|
51
|
+
onServerReady?: (port: number, url: string) => void;
|
|
52
|
+
}
|
|
53
|
+
export declare function createWorkspace(config?: WorkspaceConfig): {
|
|
54
|
+
volume: MemoryVolume;
|
|
55
|
+
engine: ScriptEngine;
|
|
56
|
+
packages: DependencyInstaller;
|
|
57
|
+
proxy: RequestProxy;
|
|
58
|
+
execute: (code: string, filename?: string) => {
|
|
59
|
+
exports: unknown;
|
|
60
|
+
};
|
|
61
|
+
runFile: (filename: string) => {
|
|
62
|
+
exports: unknown;
|
|
63
|
+
};
|
|
64
|
+
run: (command: string, options?: CommandOptions) => Promise<CommandResult>;
|
|
65
|
+
sendInput: (data: string) => Promise<void>;
|
|
66
|
+
createREPL: () => {
|
|
67
|
+
eval: (code: string) => unknown;
|
|
68
|
+
};
|
|
69
|
+
on: (event: string, listener: (...args: unknown[]) => void) => void;
|
|
70
|
+
};
|
|
71
|
+
export default createWorkspace;
|
|
72
|
+
export { Nodepod } from "./sdk/nodepod";
|
|
73
|
+
export { NodepodTerminal } from "./sdk/nodepod-terminal";
|
|
74
|
+
export { NodepodProcess } from "./sdk/nodepod-process";
|
|
75
|
+
export { NodepodFS } from "./sdk/nodepod-fs";
|
|
76
|
+
export type { NodepodOptions, TerminalOptions, TerminalTheme, StatResult, Snapshot, SpawnOptions, } from "./sdk/types";
|
|
77
|
+
export { MemoryHandler, LRUCache } from "./memory-handler";
|
|
78
|
+
export type { MemoryHandlerOptions } from "./memory-handler";
|
|
79
|
+
export { ProcessManager } from "./threading/process-manager";
|
|
80
|
+
export { ProcessHandle } from "./threading/process-handle";
|
|
81
|
+
export type { ProcessState } from "./threading/process-handle";
|
|
82
|
+
export { VFSBridge } from "./threading/vfs-bridge";
|
|
83
|
+
export { WorkerVFS } from "./threading/worker-vfs";
|
|
84
|
+
export { SyncChannelController, SyncChannelWorker } from "./threading/sync-channel";
|
|
85
|
+
export { SharedVFSController, SharedVFSReader, isSharedArrayBufferAvailable } from "./threading/shared-vfs";
|
|
86
|
+
export { createProcessContext, getActiveContext, setActiveContext } from "./threading/process-context";
|
|
87
|
+
export type { ProcessContext, ProcessWriter, ProcessReader, OpenFileEntry } from "./threading/process-context";
|
|
88
|
+
export type { VFSBinarySnapshot, VFSSnapshotEntry, SpawnConfig, ProcessInfo, MainToWorkerMessage, WorkerToMainMessage, } from "./threading/worker-protocol";
|
package/dist/index.mjs
CHANGED
|
@@ -1,59 +1,61 @@
|
|
|
1
|
-
import { p, I, q, s, t, v, w,
|
|
2
|
-
export {
|
|
3
|
-
p as DependencyInstaller,
|
|
4
|
-
I as IframeSandbox,
|
|
5
|
-
q as
|
|
6
|
-
s as
|
|
7
|
-
t as
|
|
8
|
-
v as
|
|
9
|
-
w as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
z as
|
|
14
|
-
A as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
G as
|
|
19
|
-
H as
|
|
20
|
-
J as
|
|
21
|
-
K as
|
|
22
|
-
O as
|
|
23
|
-
Q as
|
|
24
|
-
U as
|
|
25
|
-
X as
|
|
26
|
-
Z as
|
|
27
|
-
_ as
|
|
28
|
-
$ as
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
a2 as
|
|
33
|
-
a3 as
|
|
34
|
-
a4 as
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
a7 as
|
|
39
|
-
a8 as
|
|
40
|
-
a9 as
|
|
41
|
-
aa as
|
|
42
|
-
ab as
|
|
43
|
-
ac as
|
|
44
|
-
ad as
|
|
45
|
-
ae as
|
|
46
|
-
af as
|
|
47
|
-
ag as
|
|
48
|
-
ah as
|
|
49
|
-
ai as
|
|
50
|
-
aj as
|
|
51
|
-
ak as
|
|
52
|
-
al as
|
|
53
|
-
am as
|
|
54
|
-
an as
|
|
55
|
-
ao as
|
|
56
|
-
ap as
|
|
57
|
-
aq as
|
|
58
|
-
ar as
|
|
59
|
-
|
|
1
|
+
import { p, I, q, s, t, v, w, x, y, P, z, A, C, F, S, G, H, J, K, O, Q, U, X, Z, _, $, a0, a1, a1 as a12, a2, a3, a4, a5, a6, l, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at } from "./index-D8Hn2kWU.js";
|
|
2
|
+
export {
|
|
3
|
+
p as DependencyInstaller,
|
|
4
|
+
I as IframeSandbox,
|
|
5
|
+
q as LRUCache,
|
|
6
|
+
s as MemoryHandler,
|
|
7
|
+
t as MemoryVolume,
|
|
8
|
+
v as Nodepod,
|
|
9
|
+
w as NodepodFS,
|
|
10
|
+
x as NodepodProcess,
|
|
11
|
+
y as NodepodTerminal,
|
|
12
|
+
P as ProcessHandle,
|
|
13
|
+
z as ProcessManager,
|
|
14
|
+
A as ProcessWorkerAdapter,
|
|
15
|
+
C as RequestProxy,
|
|
16
|
+
F as SANDBOX_DEPLOYMENT_GUIDE,
|
|
17
|
+
S as ScriptEngine,
|
|
18
|
+
G as SharedVFSController,
|
|
19
|
+
H as SharedVFSReader,
|
|
20
|
+
J as SyncChannelController,
|
|
21
|
+
K as SyncChannelWorker,
|
|
22
|
+
O as VFSBridge,
|
|
23
|
+
Q as WorkerSandbox,
|
|
24
|
+
U as WorkerVFS,
|
|
25
|
+
X as assert,
|
|
26
|
+
Z as buildFileSystemBridge,
|
|
27
|
+
_ as buildProcessEnv,
|
|
28
|
+
$ as chokidar,
|
|
29
|
+
a0 as createProcessContext,
|
|
30
|
+
a1 as createWorkspace,
|
|
31
|
+
a12 as default,
|
|
32
|
+
a2 as esbuild,
|
|
33
|
+
a3 as events,
|
|
34
|
+
a4 as executeCode,
|
|
35
|
+
a5 as fsevents,
|
|
36
|
+
a6 as generateSandboxDeployment,
|
|
37
|
+
l as getActiveContext,
|
|
38
|
+
a7 as getProxyInstance,
|
|
39
|
+
a8 as getSandboxHostingConfig,
|
|
40
|
+
a9 as getSandboxPageHtml,
|
|
41
|
+
aa as http,
|
|
42
|
+
ab as install,
|
|
43
|
+
ac as isSharedArrayBufferAvailable,
|
|
44
|
+
ad as module,
|
|
45
|
+
ae as net,
|
|
46
|
+
af as npm,
|
|
47
|
+
ag as path,
|
|
48
|
+
ah as perf_hooks,
|
|
49
|
+
ai as querystring,
|
|
50
|
+
aj as readdirp,
|
|
51
|
+
ak as resetProxy,
|
|
52
|
+
al as rollup,
|
|
53
|
+
am as setActiveContext,
|
|
54
|
+
an as spawnEngine,
|
|
55
|
+
ao as spawnProcessWorkerEngine,
|
|
56
|
+
ap as stream,
|
|
57
|
+
aq as url,
|
|
58
|
+
ar as util,
|
|
59
|
+
as as worker_threads,
|
|
60
|
+
at as ws
|
|
61
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { FileStat } from './memory-volume';
|
|
2
|
+
export declare class LRUCache<K, V> {
|
|
3
|
+
private _map;
|
|
4
|
+
private _capacity;
|
|
5
|
+
constructor(capacity: number);
|
|
6
|
+
get(key: K): V | undefined;
|
|
7
|
+
set(key: K, value: V): void;
|
|
8
|
+
has(key: K): boolean;
|
|
9
|
+
delete(key: K): boolean;
|
|
10
|
+
clear(): void;
|
|
11
|
+
get size(): number;
|
|
12
|
+
keys(): IterableIterator<K>;
|
|
13
|
+
values(): IterableIterator<V>;
|
|
14
|
+
}
|
|
15
|
+
export interface MemoryHandlerOptions {
|
|
16
|
+
/** LRU capacity for path normalization cache. Default: 2048 */
|
|
17
|
+
pathNormCacheSize?: number;
|
|
18
|
+
/** LRU capacity for stat result cache. Default: 512 */
|
|
19
|
+
statCacheSize?: number;
|
|
20
|
+
/** LRU capacity for module resolve cache. Default: 4096 */
|
|
21
|
+
resolveCacheSize?: number;
|
|
22
|
+
/** LRU capacity for package.json manifest cache. Default: 256 */
|
|
23
|
+
manifestCacheSize?: number;
|
|
24
|
+
/** LRU capacity for source transform cache. Default: 512 */
|
|
25
|
+
transformCacheSize?: number;
|
|
26
|
+
/** Max modules before trimming node_modules entries. Default: 512 */
|
|
27
|
+
moduleSoftCacheSize?: number;
|
|
28
|
+
/** Heap usage threshold in MB to trigger pressure callbacks. Default: 350 */
|
|
29
|
+
heapWarnThresholdMB?: number;
|
|
30
|
+
/** Monitoring poll interval in ms. Default: 30000 */
|
|
31
|
+
monitorIntervalMs?: number;
|
|
32
|
+
/** Max process stdout/stderr accumulation in bytes. Default: 4194304 (4MB) */
|
|
33
|
+
maxProcessOutputBytes?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare class MemoryHandler {
|
|
36
|
+
readonly options: Required<MemoryHandlerOptions>;
|
|
37
|
+
readonly pathNormCache: LRUCache<string, string>;
|
|
38
|
+
readonly statCache: LRUCache<string, FileStat>;
|
|
39
|
+
readonly transformCache: LRUCache<string, string>;
|
|
40
|
+
private _monitorTimer;
|
|
41
|
+
private _pressureCallbacks;
|
|
42
|
+
private _destroyed;
|
|
43
|
+
constructor(opts?: MemoryHandlerOptions);
|
|
44
|
+
/** Invalidate a cached stat entry (call on file write/delete). */
|
|
45
|
+
invalidateStat(normalizedPath: string): void;
|
|
46
|
+
/** Register a callback to be invoked when heap pressure is detected. Returns unsubscribe fn. */
|
|
47
|
+
onPressure(cb: () => void): () => void;
|
|
48
|
+
/** Start periodic heap monitoring. */
|
|
49
|
+
startMonitoring(): void;
|
|
50
|
+
/** Stop monitoring. */
|
|
51
|
+
stopMonitoring(): void;
|
|
52
|
+
/** Clear all owned caches. */
|
|
53
|
+
flush(): void;
|
|
54
|
+
/** Full cleanup — stop monitoring, flush caches. */
|
|
55
|
+
destroy(): void;
|
|
56
|
+
private _checkHeap;
|
|
57
|
+
}
|