@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/module-resolver.js
DELETED
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Canonical source moved to @secure-exec/nodejs (US-003).
|
|
3
|
-
* This copy is retained for backward compatibility during phased migration.
|
|
4
|
-
* Will be removed in US-005 when kernel merges into core.
|
|
5
|
-
*
|
|
6
|
-
* Module classification and resolution helpers.
|
|
7
|
-
*
|
|
8
|
-
* Node built-ins are split into three tiers:
|
|
9
|
-
* - Bridge modules: fully polyfilled by the bridge (fs, process, http, etc.)
|
|
10
|
-
* - Deferred core modules: known but not yet bridge-supported; surfaced via
|
|
11
|
-
* deferred stubs in require paths and polyfills/wrappers in ESM paths
|
|
12
|
-
* - Unsupported core modules: known but intentionally unimplemented
|
|
13
|
-
*
|
|
14
|
-
* Everything else falls through to node-stdlib-browser polyfills or node_modules.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Static set of Node.js stdlib module names that have browser polyfills
|
|
18
|
-
* available via node-stdlib-browser. Hardcoded to avoid importing
|
|
19
|
-
* node-stdlib-browser at runtime (its ESM entry crashes on missing
|
|
20
|
-
* mock/empty.js in published builds).
|
|
21
|
-
*/
|
|
22
|
-
const STDLIB_BROWSER_MODULES = new Set([
|
|
23
|
-
"assert",
|
|
24
|
-
"buffer",
|
|
25
|
-
"child_process",
|
|
26
|
-
"cluster",
|
|
27
|
-
"console",
|
|
28
|
-
"constants",
|
|
29
|
-
"crypto",
|
|
30
|
-
"dgram",
|
|
31
|
-
"dns",
|
|
32
|
-
"domain",
|
|
33
|
-
"events",
|
|
34
|
-
"fs",
|
|
35
|
-
"http",
|
|
36
|
-
"https",
|
|
37
|
-
"http2",
|
|
38
|
-
"module",
|
|
39
|
-
"net",
|
|
40
|
-
"os",
|
|
41
|
-
"path",
|
|
42
|
-
"punycode",
|
|
43
|
-
"process",
|
|
44
|
-
"querystring",
|
|
45
|
-
"readline",
|
|
46
|
-
"repl",
|
|
47
|
-
"stream",
|
|
48
|
-
"_stream_duplex",
|
|
49
|
-
"_stream_passthrough",
|
|
50
|
-
"_stream_readable",
|
|
51
|
-
"_stream_transform",
|
|
52
|
-
"_stream_writable",
|
|
53
|
-
"string_decoder",
|
|
54
|
-
"sys",
|
|
55
|
-
"timers/promises",
|
|
56
|
-
"timers",
|
|
57
|
-
"tls",
|
|
58
|
-
"tty",
|
|
59
|
-
"url",
|
|
60
|
-
"util",
|
|
61
|
-
"vm",
|
|
62
|
-
"zlib",
|
|
63
|
-
]);
|
|
64
|
-
/** Check if a module has a polyfill available via node-stdlib-browser. */
|
|
65
|
-
function hasPolyfill(moduleName) {
|
|
66
|
-
const name = moduleName.replace(/^node:/, "");
|
|
67
|
-
return STDLIB_BROWSER_MODULES.has(name);
|
|
68
|
-
}
|
|
69
|
-
/** Modules with full bridge implementations injected into the isolate. */
|
|
70
|
-
const BRIDGE_MODULES = [
|
|
71
|
-
"fs",
|
|
72
|
-
"fs/promises",
|
|
73
|
-
"module",
|
|
74
|
-
"os",
|
|
75
|
-
"http",
|
|
76
|
-
"https",
|
|
77
|
-
"http2",
|
|
78
|
-
"dns",
|
|
79
|
-
"child_process",
|
|
80
|
-
"process",
|
|
81
|
-
"v8",
|
|
82
|
-
];
|
|
83
|
-
/**
|
|
84
|
-
* Recognized built-ins that lack bridge support.
|
|
85
|
-
* Runtime handling differs by path (require stubs vs ESM/polyfill handling).
|
|
86
|
-
*/
|
|
87
|
-
const DEFERRED_CORE_MODULES = [
|
|
88
|
-
"net",
|
|
89
|
-
"tls",
|
|
90
|
-
"readline",
|
|
91
|
-
"perf_hooks",
|
|
92
|
-
"async_hooks",
|
|
93
|
-
"worker_threads",
|
|
94
|
-
"diagnostics_channel",
|
|
95
|
-
];
|
|
96
|
-
/** Built-ins that are intentionally unimplemented (throw on use). */
|
|
97
|
-
const UNSUPPORTED_CORE_MODULES = [
|
|
98
|
-
"dgram",
|
|
99
|
-
"cluster",
|
|
100
|
-
"wasi",
|
|
101
|
-
"inspector",
|
|
102
|
-
"repl",
|
|
103
|
-
"trace_events",
|
|
104
|
-
"domain",
|
|
105
|
-
];
|
|
106
|
-
const KNOWN_BUILTIN_MODULES = new Set([
|
|
107
|
-
...BRIDGE_MODULES,
|
|
108
|
-
...DEFERRED_CORE_MODULES,
|
|
109
|
-
...UNSUPPORTED_CORE_MODULES,
|
|
110
|
-
"assert",
|
|
111
|
-
"buffer",
|
|
112
|
-
"constants",
|
|
113
|
-
"crypto",
|
|
114
|
-
"events",
|
|
115
|
-
"path",
|
|
116
|
-
"querystring",
|
|
117
|
-
"stream",
|
|
118
|
-
"stream/web",
|
|
119
|
-
"string_decoder",
|
|
120
|
-
"timers",
|
|
121
|
-
"tty",
|
|
122
|
-
"url",
|
|
123
|
-
"util",
|
|
124
|
-
"vm",
|
|
125
|
-
"zlib",
|
|
126
|
-
]);
|
|
127
|
-
/**
|
|
128
|
-
* Known named exports for each built-in module. Used by the ESM wrapper
|
|
129
|
-
* generator to create `export const X = _builtin.X;` re-exports so that
|
|
130
|
-
* `import { readFile } from 'fs'` works inside the isolate.
|
|
131
|
-
*/
|
|
132
|
-
export const BUILTIN_NAMED_EXPORTS = {
|
|
133
|
-
fs: [
|
|
134
|
-
"promises",
|
|
135
|
-
"readFileSync",
|
|
136
|
-
"writeFileSync",
|
|
137
|
-
"appendFileSync",
|
|
138
|
-
"existsSync",
|
|
139
|
-
"statSync",
|
|
140
|
-
"mkdirSync",
|
|
141
|
-
"readdirSync",
|
|
142
|
-
"createReadStream",
|
|
143
|
-
"createWriteStream",
|
|
144
|
-
],
|
|
145
|
-
"fs/promises": [
|
|
146
|
-
"access",
|
|
147
|
-
"readFile",
|
|
148
|
-
"writeFile",
|
|
149
|
-
"appendFile",
|
|
150
|
-
"copyFile",
|
|
151
|
-
"cp",
|
|
152
|
-
"open",
|
|
153
|
-
"opendir",
|
|
154
|
-
"mkdir",
|
|
155
|
-
"mkdtemp",
|
|
156
|
-
"readdir",
|
|
157
|
-
"rename",
|
|
158
|
-
"stat",
|
|
159
|
-
"lstat",
|
|
160
|
-
"chmod",
|
|
161
|
-
"chown",
|
|
162
|
-
"utimes",
|
|
163
|
-
"truncate",
|
|
164
|
-
"unlink",
|
|
165
|
-
"rm",
|
|
166
|
-
"rmdir",
|
|
167
|
-
"realpath",
|
|
168
|
-
"readlink",
|
|
169
|
-
"symlink",
|
|
170
|
-
"link",
|
|
171
|
-
],
|
|
172
|
-
module: [
|
|
173
|
-
"createRequire",
|
|
174
|
-
"Module",
|
|
175
|
-
"isBuiltin",
|
|
176
|
-
"builtinModules",
|
|
177
|
-
"SourceMap",
|
|
178
|
-
"syncBuiltinESMExports",
|
|
179
|
-
],
|
|
180
|
-
os: [
|
|
181
|
-
"arch",
|
|
182
|
-
"platform",
|
|
183
|
-
"tmpdir",
|
|
184
|
-
"homedir",
|
|
185
|
-
"hostname",
|
|
186
|
-
"type",
|
|
187
|
-
"release",
|
|
188
|
-
"constants",
|
|
189
|
-
],
|
|
190
|
-
http: [
|
|
191
|
-
"request",
|
|
192
|
-
"get",
|
|
193
|
-
"createServer",
|
|
194
|
-
"Server",
|
|
195
|
-
"IncomingMessage",
|
|
196
|
-
"ServerResponse",
|
|
197
|
-
"Agent",
|
|
198
|
-
"METHODS",
|
|
199
|
-
"STATUS_CODES",
|
|
200
|
-
],
|
|
201
|
-
https: ["request", "get", "createServer", "Agent", "globalAgent"],
|
|
202
|
-
dns: ["lookup", "resolve", "resolve4", "resolve6", "promises"],
|
|
203
|
-
child_process: [
|
|
204
|
-
"spawn",
|
|
205
|
-
"spawnSync",
|
|
206
|
-
"exec",
|
|
207
|
-
"execSync",
|
|
208
|
-
"execFile",
|
|
209
|
-
"execFileSync",
|
|
210
|
-
"fork",
|
|
211
|
-
],
|
|
212
|
-
process: [
|
|
213
|
-
"argv",
|
|
214
|
-
"env",
|
|
215
|
-
"cwd",
|
|
216
|
-
"chdir",
|
|
217
|
-
"exit",
|
|
218
|
-
"pid",
|
|
219
|
-
"platform",
|
|
220
|
-
"version",
|
|
221
|
-
"versions",
|
|
222
|
-
"stdout",
|
|
223
|
-
"stderr",
|
|
224
|
-
"stdin",
|
|
225
|
-
"nextTick",
|
|
226
|
-
],
|
|
227
|
-
path: [
|
|
228
|
-
"sep",
|
|
229
|
-
"delimiter",
|
|
230
|
-
"basename",
|
|
231
|
-
"dirname",
|
|
232
|
-
"extname",
|
|
233
|
-
"format",
|
|
234
|
-
"isAbsolute",
|
|
235
|
-
"join",
|
|
236
|
-
"normalize",
|
|
237
|
-
"parse",
|
|
238
|
-
"relative",
|
|
239
|
-
"resolve",
|
|
240
|
-
],
|
|
241
|
-
async_hooks: [
|
|
242
|
-
"AsyncLocalStorage",
|
|
243
|
-
"AsyncResource",
|
|
244
|
-
"createHook",
|
|
245
|
-
"executionAsyncId",
|
|
246
|
-
"triggerAsyncId",
|
|
247
|
-
],
|
|
248
|
-
perf_hooks: [
|
|
249
|
-
"performance",
|
|
250
|
-
"PerformanceObserver",
|
|
251
|
-
"PerformanceEntry",
|
|
252
|
-
"monitorEventLoopDelay",
|
|
253
|
-
"createHistogram",
|
|
254
|
-
"constants",
|
|
255
|
-
],
|
|
256
|
-
diagnostics_channel: [
|
|
257
|
-
"channel",
|
|
258
|
-
"hasSubscribers",
|
|
259
|
-
"tracingChannel",
|
|
260
|
-
"Channel",
|
|
261
|
-
],
|
|
262
|
-
stream: [
|
|
263
|
-
"Readable",
|
|
264
|
-
"Writable",
|
|
265
|
-
"Duplex",
|
|
266
|
-
"Transform",
|
|
267
|
-
"PassThrough",
|
|
268
|
-
"Stream",
|
|
269
|
-
"pipeline",
|
|
270
|
-
"finished",
|
|
271
|
-
"promises",
|
|
272
|
-
"addAbortSignal",
|
|
273
|
-
"compose",
|
|
274
|
-
],
|
|
275
|
-
"stream/web": [
|
|
276
|
-
"ReadableStream",
|
|
277
|
-
"ReadableStreamDefaultReader",
|
|
278
|
-
"ReadableStreamBYOBReader",
|
|
279
|
-
"ReadableStreamBYOBRequest",
|
|
280
|
-
"ReadableByteStreamController",
|
|
281
|
-
"ReadableStreamDefaultController",
|
|
282
|
-
"TransformStream",
|
|
283
|
-
"TransformStreamDefaultController",
|
|
284
|
-
"WritableStream",
|
|
285
|
-
"WritableStreamDefaultWriter",
|
|
286
|
-
"WritableStreamDefaultController",
|
|
287
|
-
"ByteLengthQueuingStrategy",
|
|
288
|
-
"CountQueuingStrategy",
|
|
289
|
-
"TextEncoderStream",
|
|
290
|
-
"TextDecoderStream",
|
|
291
|
-
"CompressionStream",
|
|
292
|
-
"DecompressionStream",
|
|
293
|
-
],
|
|
294
|
-
};
|
|
295
|
-
/**
|
|
296
|
-
* Normalize a module specifier to its canonical form if it's a known built-in.
|
|
297
|
-
* Returns null for non-builtin specifiers.
|
|
298
|
-
* Preserves the `node:` prefix when present, strips it otherwise.
|
|
299
|
-
*/
|
|
300
|
-
export function normalizeBuiltinSpecifier(request) {
|
|
301
|
-
const moduleName = request.replace(/^node:/, "");
|
|
302
|
-
if (KNOWN_BUILTIN_MODULES.has(moduleName) || hasPolyfill(moduleName)) {
|
|
303
|
-
return request.startsWith("node:") ? `node:${moduleName}` : moduleName;
|
|
304
|
-
}
|
|
305
|
-
return null;
|
|
306
|
-
}
|
|
307
|
-
/** Extract the directory portion of a path (lightweight dirname without node:path). */
|
|
308
|
-
export function getPathDir(path) {
|
|
309
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
310
|
-
const lastSlash = normalizedPath.lastIndexOf("/");
|
|
311
|
-
if (lastSlash <= 0)
|
|
312
|
-
return "/";
|
|
313
|
-
return normalizedPath.slice(0, lastSlash);
|
|
314
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Canonical source moved to @secure-exec/nodejs (US-003).
|
|
3
|
-
* This copy is retained for backward compatibility during phased migration.
|
|
4
|
-
* Will be removed in US-005 when kernel merges into core.
|
|
5
|
-
*/
|
|
6
|
-
import type { VirtualFileSystem } from "./kernel/vfs.js";
|
|
7
|
-
type ResolveMode = "require" | "import";
|
|
8
|
-
interface PackageJson {
|
|
9
|
-
main?: string;
|
|
10
|
-
type?: "module" | "commonjs";
|
|
11
|
-
exports?: unknown;
|
|
12
|
-
imports?: unknown;
|
|
13
|
-
}
|
|
14
|
-
/** Caches for module resolution to avoid redundant VFS probes. */
|
|
15
|
-
export interface ResolutionCache {
|
|
16
|
-
/** Top-level resolution results keyed by `request\0fromDir\0mode` */
|
|
17
|
-
resolveResults: Map<string, string | null>;
|
|
18
|
-
/** Parsed package.json content by path */
|
|
19
|
-
packageJsonResults: Map<string, PackageJson | null>;
|
|
20
|
-
/** File existence by path */
|
|
21
|
-
existsResults: Map<string, boolean>;
|
|
22
|
-
/** Stat results by path (null = ENOENT) */
|
|
23
|
-
statResults: Map<string, {
|
|
24
|
-
isDirectory: boolean;
|
|
25
|
-
} | null>;
|
|
26
|
-
}
|
|
27
|
-
export declare function createResolutionCache(): ResolutionCache;
|
|
28
|
-
/**
|
|
29
|
-
* Resolve a module request to an absolute path in the virtual filesystem
|
|
30
|
-
*/
|
|
31
|
-
export declare function resolveModule(request: string, fromDir: string, fs: VirtualFileSystem, mode?: ResolveMode, cache?: ResolutionCache): Promise<string | null>;
|
|
32
|
-
/**
|
|
33
|
-
* Load a file's content from the virtual filesystem
|
|
34
|
-
*/
|
|
35
|
-
export declare function loadFile(path: string, fs: VirtualFileSystem): Promise<string | null>;
|
|
36
|
-
/**
|
|
37
|
-
* Legacy function - bundle a package from node_modules (simple approach)
|
|
38
|
-
* This is kept for backwards compatibility but the new dynamic resolution is preferred
|
|
39
|
-
*/
|
|
40
|
-
export declare function bundlePackage(packageName: string, fs: VirtualFileSystem): Promise<string | null>;
|
|
41
|
-
export {};
|