@secure-exec/core 0.2.1 → 0.3.0-rc.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 +5 -5
- package/dist/binary.d.ts +4 -0
- package/dist/binary.js +25 -0
- package/dist/bytes.d.ts +2 -0
- package/dist/bytes.js +6 -0
- package/dist/callbacks.d.ts +41 -0
- package/dist/callbacks.js +94 -0
- package/dist/cargo.d.ts +2 -0
- package/dist/cargo.js +142 -0
- package/dist/correlation.d.ts +10 -0
- package/dist/correlation.js +49 -0
- package/dist/descriptors.d.ts +34 -0
- package/dist/descriptors.js +37 -0
- package/dist/event-buffer.d.ts +90 -0
- package/dist/event-buffer.js +313 -0
- package/dist/ext.d.ts +7 -0
- package/dist/ext.js +13 -0
- package/dist/filesystem.d.ts +41 -0
- package/dist/filesystem.js +70 -0
- package/dist/frame-payload-codec.d.ts +8 -0
- package/dist/frame-payload-codec.js +14 -0
- package/dist/frame-rpc.d.ts +38 -0
- package/dist/frame-rpc.js +73 -0
- package/dist/frame-stream.d.ts +27 -0
- package/dist/frame-stream.js +99 -0
- package/dist/framing.d.ts +7 -0
- package/dist/framing.js +22 -0
- package/dist/generated/AcpLimitsConfig.d.ts +4 -0
- package/dist/generated/AcpLimitsConfig.js +2 -0
- package/dist/generated/CreateVmConfig.d.ts +19 -0
- package/dist/generated/FsPermissionRule.d.ts +6 -0
- package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
- package/dist/generated/FsPermissionRuleSet.js +1 -0
- package/dist/generated/FsPermissionScope.d.ts +3 -0
- package/dist/generated/FsPermissionScope.js +1 -0
- package/dist/generated/HttpLimitsConfig.d.ts +3 -0
- package/dist/generated/HttpLimitsConfig.js +2 -0
- package/dist/generated/JsModuleResolution.d.ts +1 -0
- package/dist/generated/JsModuleResolution.js +2 -0
- package/dist/generated/JsRuntimeConfig.d.ts +26 -0
- package/dist/generated/JsRuntimeConfig.js +1 -0
- package/dist/generated/JsRuntimeLimitsConfig.d.ts +7 -0
- package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
- package/dist/generated/JsRuntimePlatform.d.ts +1 -0
- package/dist/generated/JsRuntimePlatform.js +2 -0
- package/dist/generated/MountPluginDescriptor.d.ts +4 -0
- package/dist/generated/MountPluginDescriptor.js +2 -0
- package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
- package/dist/generated/NativeRootFilesystemConfig.js +1 -0
- package/dist/generated/PatternPermissionRule.d.ts +6 -0
- package/dist/generated/PatternPermissionRule.js +1 -0
- package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
- package/dist/generated/PatternPermissionRuleSet.js +1 -0
- package/dist/generated/PatternPermissionScope.d.ts +3 -0
- package/dist/generated/PatternPermissionScope.js +1 -0
- package/dist/generated/PermissionMode.d.ts +1 -0
- package/dist/generated/PermissionMode.js +2 -0
- package/dist/generated/PermissionsPolicy.d.ts +10 -0
- package/dist/generated/PermissionsPolicy.js +1 -0
- package/dist/generated/PluginLimitsConfig.d.ts +4 -0
- package/dist/generated/PluginLimitsConfig.js +2 -0
- package/dist/generated/PythonLimitsConfig.d.ts +5 -0
- package/dist/generated/PythonLimitsConfig.js +2 -0
- package/dist/generated/ResourceLimitsConfig.d.ts +22 -0
- package/dist/generated/ResourceLimitsConfig.js +2 -0
- package/dist/generated/RootFilesystemConfig.d.ts +9 -0
- package/dist/generated/RootFilesystemConfig.js +1 -0
- package/dist/generated/RootFilesystemEntry.d.ts +13 -0
- package/dist/generated/RootFilesystemEntry.js +1 -0
- package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
- package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
- package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
- package/dist/generated/RootFilesystemEntryKind.js +2 -0
- package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
- package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
- package/dist/generated/RootFilesystemMode.d.ts +1 -0
- package/dist/generated/RootFilesystemMode.js +2 -0
- package/dist/generated/ToolLimitsConfig.d.ts +10 -0
- package/dist/generated/ToolLimitsConfig.js +2 -0
- package/dist/generated/VmDnsConfig.d.ts +6 -0
- package/dist/generated/VmDnsConfig.js +2 -0
- package/dist/generated/VmLimitsConfig.d.ts +18 -0
- package/dist/generated/VmLimitsConfig.js +1 -0
- package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
- package/dist/generated/VmListenPolicyConfig.js +2 -0
- package/dist/generated/WasmLimitsConfig.d.ts +5 -0
- package/dist/generated/WasmLimitsConfig.js +2 -0
- package/dist/generated-protocol.d.ts +1037 -0
- package/dist/generated-protocol.js +2887 -0
- package/dist/index.d.ts +24 -62
- package/dist/index.js +24 -53
- package/dist/json.d.ts +2 -0
- package/dist/json.js +20 -0
- package/dist/kernel-proxy.d.ts +149 -0
- package/dist/kernel-proxy.js +1733 -0
- package/dist/native-client.d.ts +41 -0
- package/dist/native-client.js +124 -0
- package/dist/node-runtime.d.ts +443 -0
- package/dist/node-runtime.js +569 -0
- package/dist/numbers.d.ts +1 -0
- package/dist/numbers.js +8 -0
- package/dist/ownership.d.ts +18 -0
- package/dist/ownership.js +77 -0
- package/dist/permissions.d.ts +29 -0
- package/dist/permissions.js +68 -0
- package/dist/process.d.ts +35 -0
- package/dist/process.js +125 -0
- package/dist/protocol-client.d.ts +46 -0
- package/dist/protocol-client.js +180 -0
- package/dist/protocol-frames.d.ts +68 -0
- package/dist/protocol-frames.js +139 -0
- package/dist/protocol-maps.d.ts +28 -0
- package/dist/protocol-maps.js +217 -0
- package/dist/protocol-schema.d.ts +10 -0
- package/dist/protocol-schema.js +11 -0
- package/dist/request-payloads.d.ts +137 -0
- package/dist/request-payloads.js +210 -0
- package/dist/response-payloads.d.ts +107 -0
- package/dist/response-payloads.js +161 -0
- package/dist/sidecar-client.d.ts +242 -0
- package/dist/sidecar-client.js +797 -0
- package/dist/state.d.ts +40 -0
- package/dist/state.js +44 -0
- package/dist/test-runtime.d.ts +526 -0
- package/dist/test-runtime.js +2119 -0
- package/dist/vm-config.d.ts +31 -0
- package/dist/vm-config.js +1 -0
- package/fixtures/alpine-defaults.json +520 -0
- package/fixtures/base-filesystem.json +528 -0
- package/package.json +193 -115
- package/LICENSE +0 -191
- package/dist/bridge-setup.d.ts +0 -6
- package/dist/bridge-setup.js +0 -9
- package/dist/esm-compiler.d.ts +0 -18
- package/dist/esm-compiler.js +0 -72
- package/dist/fs-helpers.d.ts +0 -23
- package/dist/fs-helpers.js +0 -41
- package/dist/generated/isolate-runtime.d.ts +0 -19
- package/dist/generated/isolate-runtime.js +0 -21
- package/dist/generated/polyfills.d.ts +0 -82
- package/dist/generated/polyfills.js +0 -82
- package/dist/isolate-runtime/apply-custom-global-policy.js +0 -53
- package/dist/isolate-runtime/apply-timing-mitigation-freeze.js +0 -130
- package/dist/isolate-runtime/apply-timing-mitigation-off.js +0 -14
- package/dist/isolate-runtime/bridge-attach.js +0 -29
- package/dist/isolate-runtime/bridge-initial-globals.js +0 -385
- package/dist/isolate-runtime/eval-script-result.js +0 -8
- package/dist/isolate-runtime/global-exposure-helpers.js +0 -36
- package/dist/isolate-runtime/init-commonjs-module-globals.js +0 -28
- package/dist/isolate-runtime/override-process-cwd.js +0 -8
- package/dist/isolate-runtime/override-process-env.js +0 -8
- package/dist/isolate-runtime/require-setup.js +0 -4153
- package/dist/isolate-runtime/set-commonjs-file-globals.js +0 -36
- package/dist/isolate-runtime/set-stdin-data.js +0 -10
- package/dist/isolate-runtime/setup-dynamic-import.js +0 -123
- package/dist/isolate-runtime/setup-fs-facade.js +0 -87
- package/dist/kernel/command-registry.d.ts +0 -44
- package/dist/kernel/command-registry.js +0 -114
- package/dist/kernel/device-backend.d.ts +0 -14
- package/dist/kernel/device-backend.js +0 -251
- package/dist/kernel/device-layer.d.ts +0 -12
- package/dist/kernel/device-layer.js +0 -271
- package/dist/kernel/dns-cache.d.ts +0 -29
- package/dist/kernel/dns-cache.js +0 -52
- package/dist/kernel/fd-table.d.ts +0 -84
- package/dist/kernel/fd-table.js +0 -278
- package/dist/kernel/file-lock.d.ts +0 -34
- package/dist/kernel/file-lock.js +0 -122
- package/dist/kernel/host-adapter.d.ts +0 -50
- package/dist/kernel/host-adapter.js +0 -8
- package/dist/kernel/index.d.ts +0 -36
- package/dist/kernel/index.js +0 -34
- package/dist/kernel/kernel.d.ts +0 -9
- package/dist/kernel/kernel.js +0 -1415
- package/dist/kernel/mount-table.d.ts +0 -75
- package/dist/kernel/mount-table.js +0 -353
- package/dist/kernel/permissions.d.ts +0 -36
- package/dist/kernel/permissions.js +0 -150
- package/dist/kernel/pipe-manager.d.ts +0 -64
- package/dist/kernel/pipe-manager.js +0 -267
- package/dist/kernel/proc-backend.d.ts +0 -30
- package/dist/kernel/proc-backend.js +0 -428
- package/dist/kernel/proc-layer.d.ts +0 -11
- package/dist/kernel/proc-layer.js +0 -507
- package/dist/kernel/process-table.d.ts +0 -126
- package/dist/kernel/process-table.js +0 -651
- package/dist/kernel/pty.d.ts +0 -109
- package/dist/kernel/pty.js +0 -552
- package/dist/kernel/socket-table.d.ts +0 -312
- package/dist/kernel/socket-table.js +0 -1188
- package/dist/kernel/timer-table.d.ts +0 -54
- package/dist/kernel/timer-table.js +0 -108
- package/dist/kernel/types.d.ts +0 -541
- package/dist/kernel/types.js +0 -98
- package/dist/kernel/user.d.ts +0 -29
- package/dist/kernel/user.js +0 -35
- package/dist/kernel/vfs.d.ts +0 -82
- package/dist/kernel/vfs.js +0 -25
- package/dist/kernel/wait.d.ts +0 -45
- package/dist/kernel/wait.js +0 -112
- package/dist/kernel/wstatus.d.ts +0 -21
- package/dist/kernel/wstatus.js +0 -33
- package/dist/module-resolver.d.ts +0 -29
- package/dist/module-resolver.js +0 -314
- package/dist/package-bundler.d.ts +0 -41
- package/dist/package-bundler.js +0 -497
- package/dist/runtime-driver.d.ts +0 -66
- package/dist/shared/api-types.d.ts +0 -83
- package/dist/shared/bridge-contract.d.ts +0 -772
- package/dist/shared/bridge-contract.js +0 -169
- package/dist/shared/console-formatter.d.ts +0 -22
- package/dist/shared/console-formatter.js +0 -161
- package/dist/shared/constants.d.ts +0 -3
- package/dist/shared/constants.js +0 -3
- package/dist/shared/errors.d.ts +0 -16
- package/dist/shared/errors.js +0 -21
- package/dist/shared/esm-utils.d.ts +0 -28
- package/dist/shared/esm-utils.js +0 -97
- package/dist/shared/global-exposure.d.ts +0 -38
- package/dist/shared/global-exposure.js +0 -876
- package/dist/shared/in-memory-fs.d.ts +0 -16
- package/dist/shared/in-memory-fs.js +0 -115
- package/dist/shared/permissions.d.ts +0 -36
- package/dist/shared/permissions.js +0 -314
- package/dist/shared/require-setup.d.ts +0 -6
- package/dist/shared/require-setup.js +0 -9
- package/dist/test/block-store-conformance.d.ts +0 -34
- package/dist/test/block-store-conformance.js +0 -251
- package/dist/test/metadata-store-conformance.d.ts +0 -37
- package/dist/test/metadata-store-conformance.js +0 -646
- package/dist/test/vfs-conformance.d.ts +0 -65
- package/dist/test/vfs-conformance.js +0 -842
- package/dist/types.d.ts +0 -98
- package/dist/types.js +0 -6
- package/dist/vfs/chunked-vfs.d.ts +0 -66
- package/dist/vfs/chunked-vfs.js +0 -1290
- package/dist/vfs/host-block-store.d.ts +0 -19
- package/dist/vfs/host-block-store.js +0 -97
- package/dist/vfs/memory-block-store.d.ts +0 -16
- package/dist/vfs/memory-block-store.js +0 -45
- package/dist/vfs/memory-metadata.d.ts +0 -75
- package/dist/vfs/memory-metadata.js +0 -528
- package/dist/vfs/sqlite-metadata.d.ts +0 -91
- package/dist/vfs/sqlite-metadata.js +0 -582
- package/dist/vfs/types.d.ts +0 -210
- package/dist/vfs/types.js +0 -8
- /package/dist/{runtime-driver.js → generated/CreateVmConfig.js} +0 -0
- /package/dist/{shared/api-types.js → generated/FsPermissionRule.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,62 +1,24 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export type { HostNetworkAdapter, HostSocket, HostListener, HostUdpSocket, DnsResult, } from "./kernel/host-adapter.js";
|
|
26
|
-
export { checkChildProcess } from "./kernel/permissions.js";
|
|
27
|
-
export { O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_TRUNC, O_APPEND, O_CLOEXEC, F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_DUPFD_CLOEXEC, FD_CLOEXEC, SEEK_SET, SEEK_CUR, SEEK_END, FILETYPE_UNKNOWN, FILETYPE_CHARACTER_DEVICE, FILETYPE_DIRECTORY, FILETYPE_REGULAR_FILE, FILETYPE_SYMBOLIC_LINK, FILETYPE_PIPE, SIGHUP, SIGINT, SIGQUIT, SIGKILL, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, SIGWINCH, WNOHANG, } from "./kernel/types.js";
|
|
28
|
-
export { encodeExitStatus, encodeSignalStatus, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, } from "./kernel/wstatus.js";
|
|
29
|
-
export type { CommandExecutor, NetworkAdapter, NetworkServerAddress, NetworkServerListenOptions, NetworkServerRequest, NetworkServerResponse, SpawnedProcess, } from "./types.js";
|
|
30
|
-
export type { DriverRuntimeConfig, NodeRuntimeDriver, NodeRuntimeDriverFactory, PythonRuntimeDriver, PythonRuntimeDriverFactory, ResourceBudgets, RuntimeDriver, RuntimeDriverFactory, RuntimeDriverOptions, SharedRuntimeDriver, SystemDriver, } from "./runtime-driver.js";
|
|
31
|
-
export type { ExecOptions, ExecResult, ExecutionStatus, OSConfig, ProcessConfig, PythonRunOptions, PythonRunResult, RunResult, StdioChannel, StdioEvent, StdioHook, TimingMitigation, } from "./shared/api-types.js";
|
|
32
|
-
export { TIMEOUT_EXIT_CODE, TIMEOUT_ERROR_MESSAGE, } from "./shared/constants.js";
|
|
33
|
-
export { createInMemoryFileSystem } from "./shared/in-memory-fs.js";
|
|
34
|
-
export { allowAll, allowAllChildProcess, allowAllEnv, allowAllFs, allowAllNetwork, createCommandExecutorStub, createFsStub, createNetworkStub, envAccessAllowed, filterEnv, wrapCommandExecutor, wrapFileSystem, wrapNetworkAdapter, } from "./shared/permissions.js";
|
|
35
|
-
export type { SystemError } from "./shared/errors.js";
|
|
36
|
-
export { createEaccesError, createEnosysError, createSystemError, } from "./shared/errors.js";
|
|
37
|
-
export { extractCjsNamedExports, extractDynamicImportSpecifiers, isESM, transformDynamicImport, wrapCJSForESM, wrapCJSForESMWithModulePath, } from "./shared/esm-utils.js";
|
|
38
|
-
export { getRequireSetupCode } from "./shared/require-setup.js";
|
|
39
|
-
export type { ConsoleSerializationBudget } from "./shared/console-formatter.js";
|
|
40
|
-
export { DEFAULT_CONSOLE_SERIALIZATION_BUDGET, formatConsoleArgs, getConsoleSetupCode, safeStringifyConsoleValue, } from "./shared/console-formatter.js";
|
|
41
|
-
export type { BridgeApplyRef, BridgeApplySyncPromiseRef, BridgeApplySyncRef, BridgeGlobalKey, ChildProcessKillBridgeRef, ChildProcessSpawnStartBridgeRef, ChildProcessSpawnSyncBridgeRef, ChildProcessStdinCloseBridgeRef, ChildProcessStdinWriteBridgeRef, CryptoRandomFillBridgeRef, CryptoRandomUuidBridgeRef, DynamicImportBridgeRef, FsChmodBridgeRef, FsChownBridgeRef, FsExistsBridgeRef, FsFacadeBridge, FsLinkBridgeRef, FsLstatBridgeRef, FsMkdirBridgeRef, FsReadDirBridgeRef, FsReadFileBinaryBridgeRef, FsReadFileBridgeRef, FsReadlinkBridgeRef, FsRenameBridgeRef, FsRmdirBridgeRef, FsStatBridgeRef, FsSymlinkBridgeRef, FsTruncateBridgeRef, FsUnlinkBridgeRef, FsUtimesBridgeRef, FsWriteFileBinaryBridgeRef, FsWriteFileBridgeRef, HostBridgeGlobalKey, LoadFileBridgeRef, LoadPolyfillBridgeRef, ModuleCacheBridgeRecord, NetworkDnsLookupRawBridgeRef, NetworkFetchRawBridgeRef, NetworkHttpRequestRawBridgeRef, NetworkHttpServerCloseRawBridgeRef, NetworkHttpServerListenRawBridgeRef, UpgradeSocketWriteRawBridgeRef, UpgradeSocketEndRawBridgeRef, UpgradeSocketDestroyRawBridgeRef, ProcessErrorBridgeRef, ProcessLogBridgeRef, RegisterHandleBridgeFn, RequireFromBridgeFn, ResolveModuleBridgeRef, RuntimeBridgeGlobalKey, ScheduleTimerBridgeRef, UnregisterHandleBridgeFn, ValueOf, } from "./shared/bridge-contract.js";
|
|
42
|
-
export { BRIDGE_GLOBAL_KEY_LIST, HOST_BRIDGE_GLOBAL_KEY_LIST, HOST_BRIDGE_GLOBAL_KEYS, RUNTIME_BRIDGE_GLOBAL_KEY_LIST, RUNTIME_BRIDGE_GLOBAL_KEYS, } from "./shared/bridge-contract.js";
|
|
43
|
-
export type { CustomGlobalClassification, CustomGlobalInventoryEntry, } from "./shared/global-exposure.js";
|
|
44
|
-
export { exposeCustomGlobal, exposeGlobalBinding, exposeMutableRuntimeStateGlobal, HARDENED_NODE_CUSTOM_GLOBALS, ISOLATE_GLOBAL_EXPOSURE_HELPER_SOURCE, MUTABLE_NODE_CUSTOM_GLOBALS, NODE_CUSTOM_GLOBAL_INVENTORY, } from "./shared/global-exposure.js";
|
|
45
|
-
export type { IsolateRuntimeSourceId } from "./generated/isolate-runtime.js";
|
|
46
|
-
export { getIsolateRuntimeSource, ISOLATE_RUNTIME_SOURCES, } from "./generated/isolate-runtime.js";
|
|
47
|
-
export { POLYFILL_CODE_MAP } from "./generated/polyfills.js";
|
|
48
|
-
export type { InodeType, CreateInodeAttrs, InodeMeta, DentryInfo, DentryStatInfo, FsMetadataStore, FsBlockStore, FsMetadataStoreVersioning, VersionMeta, VersionInfo, RetentionPolicy, } from "./vfs/types.js";
|
|
49
|
-
export { InMemoryMetadataStore } from "./vfs/memory-metadata.js";
|
|
50
|
-
export { InMemoryBlockStore } from "./vfs/memory-block-store.js";
|
|
51
|
-
export { SqliteMetadataStore } from "./vfs/sqlite-metadata.js";
|
|
52
|
-
export type { SqliteMetadataStoreOptions } from "./vfs/sqlite-metadata.js";
|
|
53
|
-
export { createChunkedVfs } from "./vfs/chunked-vfs.js";
|
|
54
|
-
export type { ChunkedVfsOptions, ChunkedVfsVersioning } from "./vfs/chunked-vfs.js";
|
|
55
|
-
export { HostBlockStore } from "./vfs/host-block-store.js";
|
|
56
|
-
export type { DirEntry, StatInfo } from "./fs-helpers.js";
|
|
57
|
-
export { exists, stat, rename, readDirWithTypes, mkdir } from "./fs-helpers.js";
|
|
58
|
-
export { BUILTIN_NAMED_EXPORTS, normalizeBuiltinSpecifier, getPathDir, } from "./module-resolver.js";
|
|
59
|
-
export { getStaticBuiltinWrapperSource, createBuiltinESMWrapper, getEmptyBuiltinESMWrapper, } from "./esm-compiler.js";
|
|
60
|
-
export type { ResolutionCache } from "./package-bundler.js";
|
|
61
|
-
export { createResolutionCache, resolveModule, loadFile, bundlePackage, } from "./package-bundler.js";
|
|
62
|
-
export { getInitialBridgeGlobalsSetupCode } from "./bridge-setup.js";
|
|
1
|
+
export * from "./binary.js";
|
|
2
|
+
export * from "./bytes.js";
|
|
3
|
+
export * from "./callbacks.js";
|
|
4
|
+
export * from "./correlation.js";
|
|
5
|
+
export * from "./descriptors.js";
|
|
6
|
+
export * from "./ext.js";
|
|
7
|
+
export * from "./frame-payload-codec.js";
|
|
8
|
+
export * from "./frame-rpc.js";
|
|
9
|
+
export * from "./frame-stream.js";
|
|
10
|
+
export * from "./filesystem.js";
|
|
11
|
+
export * from "./framing.js";
|
|
12
|
+
export * from "./json.js";
|
|
13
|
+
export * from "./native-client.js";
|
|
14
|
+
export * from "./node-runtime.js";
|
|
15
|
+
export * from "./numbers.js";
|
|
16
|
+
export * from "./permissions.js";
|
|
17
|
+
export * from "./process.js";
|
|
18
|
+
export * from "./protocol-client.js";
|
|
19
|
+
export * from "./protocol-frames.js";
|
|
20
|
+
export * from "./request-payloads.js";
|
|
21
|
+
export * from "./response-payloads.js";
|
|
22
|
+
export * from "./state.js";
|
|
23
|
+
export * as protocol from "./generated-protocol.js";
|
|
24
|
+
export * from "./generated-protocol.js";
|
package/dist/index.js
CHANGED
|
@@ -1,53 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
// POSIX wstatus encoding/decoding.
|
|
26
|
-
export { encodeExitStatus, encodeSignalStatus, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, } from "./kernel/wstatus.js";
|
|
27
|
-
// Shared constants.
|
|
28
|
-
export { TIMEOUT_EXIT_CODE, TIMEOUT_ERROR_MESSAGE, } from "./shared/constants.js";
|
|
29
|
-
// Shared utilities.
|
|
30
|
-
export { createInMemoryFileSystem } from "./shared/in-memory-fs.js";
|
|
31
|
-
export { allowAll, allowAllChildProcess, allowAllEnv, allowAllFs, allowAllNetwork, createCommandExecutorStub, createFsStub, createNetworkStub, envAccessAllowed, filterEnv, wrapCommandExecutor, wrapFileSystem, wrapNetworkAdapter, } from "./shared/permissions.js";
|
|
32
|
-
export { createEaccesError, createEnosysError, createSystemError, } from "./shared/errors.js";
|
|
33
|
-
export { extractCjsNamedExports, extractDynamicImportSpecifiers, isESM, transformDynamicImport, wrapCJSForESM, wrapCJSForESMWithModulePath, } from "./shared/esm-utils.js";
|
|
34
|
-
export { getRequireSetupCode } from "./shared/require-setup.js";
|
|
35
|
-
export { DEFAULT_CONSOLE_SERIALIZATION_BUDGET, formatConsoleArgs, getConsoleSetupCode, safeStringifyConsoleValue, } from "./shared/console-formatter.js";
|
|
36
|
-
export { BRIDGE_GLOBAL_KEY_LIST, HOST_BRIDGE_GLOBAL_KEY_LIST, HOST_BRIDGE_GLOBAL_KEYS, RUNTIME_BRIDGE_GLOBAL_KEY_LIST, RUNTIME_BRIDGE_GLOBAL_KEYS, } from "./shared/bridge-contract.js";
|
|
37
|
-
export { exposeCustomGlobal, exposeGlobalBinding, exposeMutableRuntimeStateGlobal, HARDENED_NODE_CUSTOM_GLOBALS, ISOLATE_GLOBAL_EXPOSURE_HELPER_SOURCE, MUTABLE_NODE_CUSTOM_GLOBALS, NODE_CUSTOM_GLOBAL_INVENTORY, } from "./shared/global-exposure.js";
|
|
38
|
-
export { getIsolateRuntimeSource, ISOLATE_RUNTIME_SOURCES, } from "./generated/isolate-runtime.js";
|
|
39
|
-
// Generated polyfills.
|
|
40
|
-
export { POLYFILL_CODE_MAP } from "./generated/polyfills.js";
|
|
41
|
-
export { InMemoryMetadataStore } from "./vfs/memory-metadata.js";
|
|
42
|
-
export { InMemoryBlockStore } from "./vfs/memory-block-store.js";
|
|
43
|
-
export { SqliteMetadataStore } from "./vfs/sqlite-metadata.js";
|
|
44
|
-
export { createChunkedVfs } from "./vfs/chunked-vfs.js";
|
|
45
|
-
export { HostBlockStore } from "./vfs/host-block-store.js";
|
|
46
|
-
export { exists, stat, rename, readDirWithTypes, mkdir } from "./fs-helpers.js";
|
|
47
|
-
// Module resolution.
|
|
48
|
-
export { BUILTIN_NAMED_EXPORTS, normalizeBuiltinSpecifier, getPathDir, } from "./module-resolver.js";
|
|
49
|
-
// ESM compiler.
|
|
50
|
-
export { getStaticBuiltinWrapperSource, createBuiltinESMWrapper, getEmptyBuiltinESMWrapper, } from "./esm-compiler.js";
|
|
51
|
-
export { createResolutionCache, resolveModule, loadFile, bundlePackage, } from "./package-bundler.js";
|
|
52
|
-
// Bridge setup.
|
|
53
|
-
export { getInitialBridgeGlobalsSetupCode } from "./bridge-setup.js";
|
|
1
|
+
export * from "./binary.js";
|
|
2
|
+
export * from "./bytes.js";
|
|
3
|
+
export * from "./callbacks.js";
|
|
4
|
+
export * from "./correlation.js";
|
|
5
|
+
export * from "./descriptors.js";
|
|
6
|
+
export * from "./ext.js";
|
|
7
|
+
export * from "./frame-payload-codec.js";
|
|
8
|
+
export * from "./frame-rpc.js";
|
|
9
|
+
export * from "./frame-stream.js";
|
|
10
|
+
export * from "./filesystem.js";
|
|
11
|
+
export * from "./framing.js";
|
|
12
|
+
export * from "./json.js";
|
|
13
|
+
export * from "./native-client.js";
|
|
14
|
+
export * from "./node-runtime.js";
|
|
15
|
+
export * from "./numbers.js";
|
|
16
|
+
export * from "./permissions.js";
|
|
17
|
+
export * from "./process.js";
|
|
18
|
+
export * from "./protocol-client.js";
|
|
19
|
+
export * from "./protocol-frames.js";
|
|
20
|
+
export * from "./request-payloads.js";
|
|
21
|
+
export * from "./response-payloads.js";
|
|
22
|
+
export * from "./state.js";
|
|
23
|
+
export * as protocol from "./generated-protocol.js";
|
|
24
|
+
export * from "./generated-protocol.js";
|
package/dist/json.d.ts
ADDED
package/dist/json.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function stringifyJsonUtf8(value, context) {
|
|
2
|
+
try {
|
|
3
|
+
const encoded = JSON.stringify(value);
|
|
4
|
+
if (encoded === undefined) {
|
|
5
|
+
throw new Error(`${context} must be JSON-serializable`);
|
|
6
|
+
}
|
|
7
|
+
return encoded;
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
throw new Error(`${context} must be JSON-serializable: ${error instanceof Error ? error.message : String(error)}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function parseJsonUtf8(value, context) {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(value);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
throw new Error(`invalid ${context} JSON payload: ${error instanceof Error ? error.message : String(error)}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { NativeMountPluginDescriptor } from "./descriptors.js";
|
|
2
|
+
import type { ConnectTerminalOptions, KernelExecOptions, KernelExecResult, KernelSpawnOptions, ManagedProcess, OpenShellOptions, ProcessInfo, ShellHandle, VirtualFileSystem, VirtualStat } from "./test-runtime.js";
|
|
3
|
+
import type { AuthenticatedSession, CreatedVm, NativeSidecarProcessClient, SidecarMountDescriptor, SidecarSignalHandlerRegistration } from "./sidecar-client.js";
|
|
4
|
+
export interface PlainMountConfig {
|
|
5
|
+
path: string;
|
|
6
|
+
driver: VirtualFileSystem;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface NativeMountConfig {
|
|
10
|
+
path: string;
|
|
11
|
+
plugin: NativeMountPluginDescriptor;
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function serializeMountConfigForSidecar(mount: PlainMountConfig | NativeMountConfig): SidecarMountDescriptor;
|
|
15
|
+
export declare function toSidecarSignalName(signal: number): string;
|
|
16
|
+
export interface LocalCompatMount {
|
|
17
|
+
path: string;
|
|
18
|
+
fs: VirtualFileSystem;
|
|
19
|
+
readOnly: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface KernelSocketSnapshot {
|
|
22
|
+
processId: string;
|
|
23
|
+
host?: string;
|
|
24
|
+
port?: number;
|
|
25
|
+
path?: string;
|
|
26
|
+
}
|
|
27
|
+
interface KernelSignalState {
|
|
28
|
+
handlers: Map<number, {
|
|
29
|
+
action: SidecarSignalHandlerRegistration["action"];
|
|
30
|
+
mask: Set<number>;
|
|
31
|
+
flags: number;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
interface NativeSidecarKernelProxyOptions {
|
|
35
|
+
client: NativeSidecarProcessClient;
|
|
36
|
+
session: AuthenticatedSession;
|
|
37
|
+
vm: CreatedVm;
|
|
38
|
+
env: Record<string, string>;
|
|
39
|
+
cwd: string;
|
|
40
|
+
defaultExecCwd?: string;
|
|
41
|
+
localMounts: LocalCompatMount[];
|
|
42
|
+
commandGuestPaths: ReadonlyMap<string, string>;
|
|
43
|
+
onWasmCommandResolved?: (command: string) => void;
|
|
44
|
+
onDispose?: () => Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
export declare class NativeSidecarKernelProxy {
|
|
47
|
+
readonly env: Record<string, string>;
|
|
48
|
+
readonly cwd: string;
|
|
49
|
+
readonly commands: ReadonlyMap<string, string>;
|
|
50
|
+
readonly vfs: VirtualFileSystem;
|
|
51
|
+
readonly processes: Map<number, ProcessInfo>;
|
|
52
|
+
private readonly defaultExecCwd;
|
|
53
|
+
private readonly client;
|
|
54
|
+
private readonly session;
|
|
55
|
+
private readonly vm;
|
|
56
|
+
private readonly localMounts;
|
|
57
|
+
private readonly commandDrivers;
|
|
58
|
+
private readonly onWasmCommandResolved;
|
|
59
|
+
private readonly onDispose;
|
|
60
|
+
private readonly trackedProcesses;
|
|
61
|
+
private readonly trackedProcessesById;
|
|
62
|
+
private readonly listenerLookups;
|
|
63
|
+
private readonly boundUdpLookups;
|
|
64
|
+
private readonly signalStates;
|
|
65
|
+
private readonly signalRefreshes;
|
|
66
|
+
private sidecarProcessSnapshot;
|
|
67
|
+
private processSnapshotRefresh;
|
|
68
|
+
private readonly observedProcessStartTimes;
|
|
69
|
+
private readonly rootView;
|
|
70
|
+
private zombieTimerCountValue;
|
|
71
|
+
private zombieTimerCountRefresh;
|
|
72
|
+
private disposed;
|
|
73
|
+
private pumpError;
|
|
74
|
+
private nextSyntheticPid;
|
|
75
|
+
private readonly eventPumpAbortController;
|
|
76
|
+
private readonly eventPump;
|
|
77
|
+
constructor(options: NativeSidecarKernelProxyOptions);
|
|
78
|
+
createRootView(): VirtualFileSystem;
|
|
79
|
+
get zombieTimerCount(): number;
|
|
80
|
+
registerCommandGuestPaths(commandGuestPaths: ReadonlyMap<string, string>): void;
|
|
81
|
+
dispose(): Promise<void>;
|
|
82
|
+
exec(command: string, options?: KernelExecOptions): Promise<KernelExecResult>;
|
|
83
|
+
spawn(command: string, args: string[], options?: KernelSpawnOptions): ManagedProcess;
|
|
84
|
+
openShell(options?: OpenShellOptions): ShellHandle;
|
|
85
|
+
connectTerminal(options?: ConnectTerminalOptions): Promise<number>;
|
|
86
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
87
|
+
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
88
|
+
mkdir(path: string, recursive?: boolean): Promise<void>;
|
|
89
|
+
exists(path: string): Promise<boolean>;
|
|
90
|
+
stat(path: string): Promise<VirtualStat>;
|
|
91
|
+
readdir(path: string): Promise<string[]>;
|
|
92
|
+
removeFile(path: string): Promise<void>;
|
|
93
|
+
removeDir(path: string): Promise<void>;
|
|
94
|
+
rename(oldPath: string, newPath: string): Promise<void>;
|
|
95
|
+
mountFs(path: string, driver: VirtualFileSystem, options?: {
|
|
96
|
+
readOnly?: boolean;
|
|
97
|
+
}): void;
|
|
98
|
+
unmountFs(path: string): void;
|
|
99
|
+
snapshotProcesses(): ProcessInfo[];
|
|
100
|
+
findListener(request: {
|
|
101
|
+
host?: string;
|
|
102
|
+
port?: number;
|
|
103
|
+
path?: string;
|
|
104
|
+
}): KernelSocketSnapshot | null;
|
|
105
|
+
findBoundUdp(request: {
|
|
106
|
+
host?: string;
|
|
107
|
+
port?: number;
|
|
108
|
+
}): KernelSocketSnapshot | null;
|
|
109
|
+
/**
|
|
110
|
+
* Drive an HTTP request to a guest-bound TCP port inside the VM and return
|
|
111
|
+
* the raw JSON response payload from the sidecar. The caller decodes the
|
|
112
|
+
* JSON into a structured response.
|
|
113
|
+
*/
|
|
114
|
+
vmFetch(request: {
|
|
115
|
+
port: number;
|
|
116
|
+
method: string;
|
|
117
|
+
path: string;
|
|
118
|
+
headersJson: string;
|
|
119
|
+
body?: string;
|
|
120
|
+
}): Promise<string>;
|
|
121
|
+
getSignalState(pid: number): KernelSignalState;
|
|
122
|
+
private refreshSocketLookup;
|
|
123
|
+
private refreshSignalState;
|
|
124
|
+
private refreshProcessSnapshot;
|
|
125
|
+
private refreshZombieTimerCount;
|
|
126
|
+
private drainTrailingProcessOutput;
|
|
127
|
+
private startTrackedProcess;
|
|
128
|
+
private runEventPump;
|
|
129
|
+
private finishProcess;
|
|
130
|
+
private waitForTrackedProcess;
|
|
131
|
+
private signalProcess;
|
|
132
|
+
private flushPendingStdin;
|
|
133
|
+
private closeTrackedStdin;
|
|
134
|
+
private handleBackgroundProcessError;
|
|
135
|
+
private recordCompletedProcessError;
|
|
136
|
+
private emitBackgroundProcessError;
|
|
137
|
+
private createFilesystemView;
|
|
138
|
+
private buildProcessSnapshot;
|
|
139
|
+
private dispatchRead;
|
|
140
|
+
private dispatchNativeRead;
|
|
141
|
+
private dispatchWrite;
|
|
142
|
+
private resolveLocalMount;
|
|
143
|
+
private assertGuestPathWritable;
|
|
144
|
+
private mountedChildNames;
|
|
145
|
+
private assertLocalWritable;
|
|
146
|
+
private updateTrackedProcessSnapshot;
|
|
147
|
+
}
|
|
148
|
+
export type { AuthenticatedSession, CreatedVm, GuestFilesystemStat, NativeSidecarSpawnOptions, RootFilesystemEntry, SidecarEventSelector, SidecarPermissionsPolicy, SidecarRegisteredHostCallbackDefinition, SidecarRequestFrame, SidecarRequestHandler, SidecarResponsePayload, SidecarSessionState, SidecarSignalHandlerRegistration, SidecarSocketStateEntry, } from "./sidecar-client.js";
|
|
149
|
+
export { NATIVE_SIDECAR_FRAME_TIMEOUT_MS, NativeSidecarProcessClient, SidecarEventBufferOverflow, SidecarProcessError, SidecarProcessExited, } from "./sidecar-client.js";
|