@secure-exec/core 0.1.1-rc.2 → 0.2.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.
Files changed (102) hide show
  1. package/dist/esm-compiler.d.ts +5 -1
  2. package/dist/esm-compiler.js +5 -1
  3. package/dist/fs-helpers.d.ts +1 -1
  4. package/dist/generated/isolate-runtime.d.ts +15 -15
  5. package/dist/generated/isolate-runtime.js +15 -15
  6. package/dist/index.d.ts +25 -6
  7. package/dist/index.js +23 -3
  8. package/dist/isolate-runtime/apply-custom-global-policy.js +3 -3
  9. package/dist/isolate-runtime/apply-timing-mitigation-freeze.js +10 -8
  10. package/dist/isolate-runtime/apply-timing-mitigation-off.js +2 -2
  11. package/dist/isolate-runtime/bridge-attach.js +2 -2
  12. package/dist/isolate-runtime/bridge-initial-globals.js +3 -3
  13. package/dist/isolate-runtime/eval-script-result.js +1 -1
  14. package/dist/isolate-runtime/global-exposure-helpers.js +2 -2
  15. package/dist/isolate-runtime/init-commonjs-module-globals.js +2 -2
  16. package/dist/isolate-runtime/override-process-cwd.js +1 -1
  17. package/dist/isolate-runtime/override-process-env.js +1 -1
  18. package/dist/isolate-runtime/require-setup.js +2236 -19
  19. package/dist/isolate-runtime/set-commonjs-file-globals.js +2 -2
  20. package/dist/isolate-runtime/set-stdin-data.js +1 -1
  21. package/dist/isolate-runtime/setup-dynamic-import.js +47 -15
  22. package/dist/isolate-runtime/setup-fs-facade.js +2 -2
  23. package/dist/kernel/command-registry.d.ts +44 -0
  24. package/dist/kernel/command-registry.js +114 -0
  25. package/dist/kernel/device-layer.d.ts +12 -0
  26. package/dist/kernel/device-layer.js +262 -0
  27. package/dist/kernel/dns-cache.d.ts +29 -0
  28. package/dist/kernel/dns-cache.js +52 -0
  29. package/dist/kernel/fd-table.d.ts +84 -0
  30. package/dist/kernel/fd-table.js +278 -0
  31. package/dist/kernel/file-lock.d.ts +34 -0
  32. package/dist/kernel/file-lock.js +123 -0
  33. package/dist/kernel/host-adapter.d.ts +50 -0
  34. package/dist/kernel/host-adapter.js +8 -0
  35. package/dist/kernel/index.d.ts +36 -0
  36. package/dist/kernel/index.js +34 -0
  37. package/dist/kernel/inode-table.d.ts +43 -0
  38. package/dist/kernel/inode-table.js +85 -0
  39. package/dist/kernel/kernel.d.ts +9 -0
  40. package/dist/kernel/kernel.js +1396 -0
  41. package/dist/kernel/permissions.d.ts +27 -0
  42. package/dist/kernel/permissions.js +118 -0
  43. package/dist/kernel/pipe-manager.d.ts +64 -0
  44. package/dist/kernel/pipe-manager.js +267 -0
  45. package/dist/kernel/proc-layer.d.ts +11 -0
  46. package/dist/kernel/proc-layer.js +501 -0
  47. package/dist/kernel/process-table.d.ts +124 -0
  48. package/dist/kernel/process-table.js +631 -0
  49. package/dist/kernel/pty.d.ts +108 -0
  50. package/dist/kernel/pty.js +541 -0
  51. package/dist/kernel/socket-table.d.ts +305 -0
  52. package/dist/kernel/socket-table.js +1124 -0
  53. package/dist/kernel/timer-table.d.ts +54 -0
  54. package/dist/kernel/timer-table.js +108 -0
  55. package/dist/kernel/types.d.ts +500 -0
  56. package/dist/kernel/types.js +89 -0
  57. package/dist/kernel/user.d.ts +29 -0
  58. package/dist/kernel/user.js +35 -0
  59. package/dist/kernel/vfs.d.ts +54 -0
  60. package/dist/kernel/vfs.js +8 -0
  61. package/dist/kernel/wait.d.ts +45 -0
  62. package/dist/kernel/wait.js +112 -0
  63. package/dist/kernel/wstatus.d.ts +21 -0
  64. package/dist/kernel/wstatus.js +33 -0
  65. package/dist/module-resolver.d.ts +4 -0
  66. package/dist/module-resolver.js +4 -0
  67. package/dist/package-bundler.d.ts +6 -1
  68. package/dist/runtime-driver.d.ts +3 -1
  69. package/dist/shared/bridge-contract.d.ts +529 -94
  70. package/dist/shared/bridge-contract.js +86 -3
  71. package/dist/shared/console-formatter.js +4 -0
  72. package/dist/shared/global-exposure.js +345 -0
  73. package/dist/shared/in-memory-fs.d.ts +30 -11
  74. package/dist/shared/in-memory-fs.js +383 -109
  75. package/dist/shared/permissions.d.ts +4 -6
  76. package/dist/shared/permissions.js +24 -28
  77. package/dist/types.d.ts +20 -130
  78. package/dist/types.js +5 -0
  79. package/package.json +12 -22
  80. package/dist/bridge/active-handles.d.ts +0 -22
  81. package/dist/bridge/active-handles.js +0 -55
  82. package/dist/bridge/child-process.d.ts +0 -99
  83. package/dist/bridge/child-process.js +0 -656
  84. package/dist/bridge/fs.d.ts +0 -281
  85. package/dist/bridge/fs.js +0 -2231
  86. package/dist/bridge/index.d.ts +0 -10
  87. package/dist/bridge/index.js +0 -41
  88. package/dist/bridge/module.d.ts +0 -75
  89. package/dist/bridge/module.js +0 -299
  90. package/dist/bridge/network.d.ts +0 -250
  91. package/dist/bridge/network.js +0 -1433
  92. package/dist/bridge/os.d.ts +0 -13
  93. package/dist/bridge/os.js +0 -256
  94. package/dist/bridge/polyfills.d.ts +0 -2
  95. package/dist/bridge/polyfills.js +0 -11
  96. package/dist/bridge/process.d.ts +0 -89
  97. package/dist/bridge/process.js +0 -994
  98. package/dist/bridge.js +0 -11766
  99. package/dist/python-runtime.d.ts +0 -16
  100. package/dist/python-runtime.js +0 -45
  101. package/dist/runtime.d.ts +0 -31
  102. package/dist/runtime.js +0 -69
@@ -1,13 +1,16 @@
1
1
  /**
2
+ * @deprecated Canonical source moved to @secure-exec/nodejs (US-002).
3
+ * This copy is retained for backward compatibility during phased migration.
4
+ * Will be removed in US-005 when kernel merges into core.
5
+ *
2
6
  * Bridge contract: typed declarations for the globals shared between the
3
7
  * host (Node.js) and the isolate (sandbox V8 context).
4
8
  *
5
9
  * Two categories:
6
- * - Host bridge globals: set by the host before bridge code runs (fs fns, timers, etc.)
10
+ * - Host bridge globals: set by the host before bridge code runs (fs refs, timers, etc.)
7
11
  * - Runtime bridge globals: installed by the bridge bundle itself (active handles, modules, etc.)
8
12
  *
9
- * Each type alias is a plain function signature. The Rust V8 runtime registers
10
- * these as real JS functions on the global; bridge code calls them directly.
13
+ * The typed `Ref` aliases describe the bridge calling convention for each global.
11
14
  */
12
15
  function valuesOf(object) {
13
16
  return Object.values(object);
@@ -21,6 +24,27 @@ export const HOST_BRIDGE_GLOBAL_KEYS = {
21
24
  scheduleTimer: "_scheduleTimer",
22
25
  cryptoRandomFill: "_cryptoRandomFill",
23
26
  cryptoRandomUuid: "_cryptoRandomUUID",
27
+ cryptoHashDigest: "_cryptoHashDigest",
28
+ cryptoHmacDigest: "_cryptoHmacDigest",
29
+ cryptoPbkdf2: "_cryptoPbkdf2",
30
+ cryptoScrypt: "_cryptoScrypt",
31
+ cryptoCipheriv: "_cryptoCipheriv",
32
+ cryptoDecipheriv: "_cryptoDecipheriv",
33
+ cryptoCipherivCreate: "_cryptoCipherivCreate",
34
+ cryptoCipherivUpdate: "_cryptoCipherivUpdate",
35
+ cryptoCipherivFinal: "_cryptoCipherivFinal",
36
+ cryptoSign: "_cryptoSign",
37
+ cryptoVerify: "_cryptoVerify",
38
+ cryptoAsymmetricOp: "_cryptoAsymmetricOp",
39
+ cryptoCreateKeyObject: "_cryptoCreateKeyObject",
40
+ cryptoGenerateKeyPairSync: "_cryptoGenerateKeyPairSync",
41
+ cryptoGenerateKeySync: "_cryptoGenerateKeySync",
42
+ cryptoGeneratePrimeSync: "_cryptoGeneratePrimeSync",
43
+ cryptoDiffieHellman: "_cryptoDiffieHellman",
44
+ cryptoDiffieHellmanGroup: "_cryptoDiffieHellmanGroup",
45
+ cryptoDiffieHellmanSessionCreate: "_cryptoDiffieHellmanSessionCreate",
46
+ cryptoDiffieHellmanSessionCall: "_cryptoDiffieHellmanSessionCall",
47
+ cryptoSubtle: "_cryptoSubtle",
24
48
  fsReadFile: "_fsReadFile",
25
49
  fsWriteFile: "_fsWriteFile",
26
50
  fsReadFileBinary: "_fsReadFileBinary",
@@ -50,6 +74,57 @@ export const HOST_BRIDGE_GLOBAL_KEYS = {
50
74
  networkHttpRequestRaw: "_networkHttpRequestRaw",
51
75
  networkHttpServerListenRaw: "_networkHttpServerListenRaw",
52
76
  networkHttpServerCloseRaw: "_networkHttpServerCloseRaw",
77
+ networkHttpServerRespondRaw: "_networkHttpServerRespondRaw",
78
+ networkHttpServerWaitRaw: "_networkHttpServerWaitRaw",
79
+ networkHttp2ServerListenRaw: "_networkHttp2ServerListenRaw",
80
+ networkHttp2ServerCloseRaw: "_networkHttp2ServerCloseRaw",
81
+ networkHttp2ServerWaitRaw: "_networkHttp2ServerWaitRaw",
82
+ networkHttp2SessionConnectRaw: "_networkHttp2SessionConnectRaw",
83
+ networkHttp2SessionRequestRaw: "_networkHttp2SessionRequestRaw",
84
+ networkHttp2SessionSettingsRaw: "_networkHttp2SessionSettingsRaw",
85
+ networkHttp2SessionSetLocalWindowSizeRaw: "_networkHttp2SessionSetLocalWindowSizeRaw",
86
+ networkHttp2SessionGoawayRaw: "_networkHttp2SessionGoawayRaw",
87
+ networkHttp2SessionCloseRaw: "_networkHttp2SessionCloseRaw",
88
+ networkHttp2SessionDestroyRaw: "_networkHttp2SessionDestroyRaw",
89
+ networkHttp2SessionWaitRaw: "_networkHttp2SessionWaitRaw",
90
+ networkHttp2ServerPollRaw: "_networkHttp2ServerPollRaw",
91
+ networkHttp2SessionPollRaw: "_networkHttp2SessionPollRaw",
92
+ networkHttp2StreamRespondRaw: "_networkHttp2StreamRespondRaw",
93
+ networkHttp2StreamPushStreamRaw: "_networkHttp2StreamPushStreamRaw",
94
+ networkHttp2StreamWriteRaw: "_networkHttp2StreamWriteRaw",
95
+ networkHttp2StreamEndRaw: "_networkHttp2StreamEndRaw",
96
+ networkHttp2StreamPauseRaw: "_networkHttp2StreamPauseRaw",
97
+ networkHttp2StreamResumeRaw: "_networkHttp2StreamResumeRaw",
98
+ networkHttp2StreamRespondWithFileRaw: "_networkHttp2StreamRespondWithFileRaw",
99
+ networkHttp2ServerRespondRaw: "_networkHttp2ServerRespondRaw",
100
+ upgradeSocketWriteRaw: "_upgradeSocketWriteRaw",
101
+ upgradeSocketEndRaw: "_upgradeSocketEndRaw",
102
+ upgradeSocketDestroyRaw: "_upgradeSocketDestroyRaw",
103
+ netSocketConnectRaw: "_netSocketConnectRaw",
104
+ netSocketWaitConnectRaw: "_netSocketWaitConnectRaw",
105
+ netSocketReadRaw: "_netSocketReadRaw",
106
+ netSocketSetNoDelayRaw: "_netSocketSetNoDelayRaw",
107
+ netSocketSetKeepAliveRaw: "_netSocketSetKeepAliveRaw",
108
+ netSocketWriteRaw: "_netSocketWriteRaw",
109
+ netSocketEndRaw: "_netSocketEndRaw",
110
+ netSocketDestroyRaw: "_netSocketDestroyRaw",
111
+ netSocketUpgradeTlsRaw: "_netSocketUpgradeTlsRaw",
112
+ netSocketGetTlsClientHelloRaw: "_netSocketGetTlsClientHelloRaw",
113
+ netSocketTlsQueryRaw: "_netSocketTlsQueryRaw",
114
+ tlsGetCiphersRaw: "_tlsGetCiphersRaw",
115
+ netServerListenRaw: "_netServerListenRaw",
116
+ netServerAcceptRaw: "_netServerAcceptRaw",
117
+ netServerCloseRaw: "_netServerCloseRaw",
118
+ dgramSocketCreateRaw: "_dgramSocketCreateRaw",
119
+ dgramSocketBindRaw: "_dgramSocketBindRaw",
120
+ dgramSocketRecvRaw: "_dgramSocketRecvRaw",
121
+ dgramSocketSendRaw: "_dgramSocketSendRaw",
122
+ dgramSocketCloseRaw: "_dgramSocketCloseRaw",
123
+ dgramSocketAddressRaw: "_dgramSocketAddressRaw",
124
+ dgramSocketSetBufferSizeRaw: "_dgramSocketSetBufferSizeRaw",
125
+ dgramSocketGetBufferSizeRaw: "_dgramSocketGetBufferSizeRaw",
126
+ resolveModuleSync: "_resolveModuleSync",
127
+ loadFileSync: "_loadFileSync",
53
128
  ptySetRawMode: "_ptySetRawMode",
54
129
  processConfig: "_processConfig",
55
130
  osConfig: "_osConfig",
@@ -70,7 +145,15 @@ export const RUNTIME_BRIDGE_GLOBAL_KEYS = {
70
145
  httpsModule: "_httpsModule",
71
146
  http2Module: "_http2Module",
72
147
  dnsModule: "_dnsModule",
148
+ dgramModule: "_dgramModule",
73
149
  httpServerDispatch: "_httpServerDispatch",
150
+ httpServerUpgradeDispatch: "_httpServerUpgradeDispatch",
151
+ httpServerConnectDispatch: "_httpServerConnectDispatch",
152
+ http2Dispatch: "_http2Dispatch",
153
+ timerDispatch: "_timerDispatch",
154
+ upgradeSocketData: "_upgradeSocketData",
155
+ upgradeSocketEnd: "_upgradeSocketEnd",
156
+ netSocketDispatch: "_netSocketDispatch",
74
157
  fsFacade: "_fs",
75
158
  requireFrom: "_requireFrom",
76
159
  moduleCache: "_moduleCache",
@@ -152,6 +152,10 @@ export function getConsoleSetupCode(budget = DEFAULT_CONSOLE_SERIALIZATION_BUDGE
152
152
  error: (...args) => _error(formatConsoleArgs(args, __consoleBudget)),
153
153
  warn: (...args) => _error(formatConsoleArgs(args, __consoleBudget)),
154
154
  info: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
155
+ debug: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
156
+ trace: (...args) => _error(formatConsoleArgs(args, __consoleBudget)),
157
+ dir: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
158
+ table: (...args) => _log(formatConsoleArgs(args, __consoleBudget)),
155
159
  };
156
160
  `;
157
161
  }
@@ -75,11 +75,61 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
75
75
  classification: "hardened",
76
76
  rationale: "Bridge-owned dns module handle for require resolution.",
77
77
  },
78
+ {
79
+ name: "_dgramModule",
80
+ classification: "hardened",
81
+ rationale: "Bridge-owned dgram module handle for require resolution.",
82
+ },
83
+ {
84
+ name: "_netModule",
85
+ classification: "hardened",
86
+ rationale: "Bridge-owned net module handle for require resolution.",
87
+ },
88
+ {
89
+ name: "_tlsModule",
90
+ classification: "hardened",
91
+ rationale: "Bridge-owned tls module handle for require resolution.",
92
+ },
93
+ {
94
+ name: "_netSocketDispatch",
95
+ classification: "hardened",
96
+ rationale: "Host-to-sandbox net socket event dispatch entrypoint.",
97
+ },
78
98
  {
79
99
  name: "_httpServerDispatch",
80
100
  classification: "hardened",
81
101
  rationale: "Host-to-sandbox HTTP server dispatch entrypoint.",
82
102
  },
103
+ {
104
+ name: "_httpServerUpgradeDispatch",
105
+ classification: "hardened",
106
+ rationale: "Host-to-sandbox HTTP upgrade dispatch entrypoint.",
107
+ },
108
+ {
109
+ name: "_httpServerConnectDispatch",
110
+ classification: "hardened",
111
+ rationale: "Host-to-sandbox HTTP CONNECT dispatch entrypoint.",
112
+ },
113
+ {
114
+ name: "_http2Dispatch",
115
+ classification: "hardened",
116
+ rationale: "Host-to-sandbox HTTP/2 event dispatch entrypoint.",
117
+ },
118
+ {
119
+ name: "_timerDispatch",
120
+ classification: "hardened",
121
+ rationale: "Host-to-sandbox timer callback dispatch entrypoint.",
122
+ },
123
+ {
124
+ name: "_upgradeSocketData",
125
+ classification: "hardened",
126
+ rationale: "Host-to-sandbox HTTP upgrade socket data dispatch entrypoint.",
127
+ },
128
+ {
129
+ name: "_upgradeSocketEnd",
130
+ classification: "hardened",
131
+ rationale: "Host-to-sandbox HTTP upgrade socket close dispatch entrypoint.",
132
+ },
83
133
  {
84
134
  name: "ProcessExitError",
85
135
  classification: "hardened",
@@ -110,6 +160,16 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
110
160
  classification: "hardened",
111
161
  rationale: "Host file-loading bridge reference.",
112
162
  },
163
+ {
164
+ name: "_resolveModuleSync",
165
+ classification: "hardened",
166
+ rationale: "Host synchronous module-resolution bridge reference.",
167
+ },
168
+ {
169
+ name: "_loadFileSync",
170
+ classification: "hardened",
171
+ rationale: "Host synchronous file-loading bridge reference.",
172
+ },
113
173
  {
114
174
  name: "_scheduleTimer",
115
175
  classification: "hardened",
@@ -125,6 +185,111 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
125
185
  classification: "hardened",
126
186
  rationale: "Host entropy bridge reference for crypto.randomUUID.",
127
187
  },
188
+ {
189
+ name: "_cryptoHashDigest",
190
+ classification: "hardened",
191
+ rationale: "Host crypto digest bridge reference.",
192
+ },
193
+ {
194
+ name: "_cryptoHmacDigest",
195
+ classification: "hardened",
196
+ rationale: "Host crypto HMAC bridge reference.",
197
+ },
198
+ {
199
+ name: "_cryptoPbkdf2",
200
+ classification: "hardened",
201
+ rationale: "Host crypto PBKDF2 bridge reference.",
202
+ },
203
+ {
204
+ name: "_cryptoScrypt",
205
+ classification: "hardened",
206
+ rationale: "Host crypto scrypt bridge reference.",
207
+ },
208
+ {
209
+ name: "_cryptoCipheriv",
210
+ classification: "hardened",
211
+ rationale: "Host crypto cipher bridge reference.",
212
+ },
213
+ {
214
+ name: "_cryptoDecipheriv",
215
+ classification: "hardened",
216
+ rationale: "Host crypto decipher bridge reference.",
217
+ },
218
+ {
219
+ name: "_cryptoCipherivCreate",
220
+ classification: "hardened",
221
+ rationale: "Host streaming cipher bridge reference.",
222
+ },
223
+ {
224
+ name: "_cryptoCipherivUpdate",
225
+ classification: "hardened",
226
+ rationale: "Host streaming cipher update bridge reference.",
227
+ },
228
+ {
229
+ name: "_cryptoCipherivFinal",
230
+ classification: "hardened",
231
+ rationale: "Host streaming cipher finalization bridge reference.",
232
+ },
233
+ {
234
+ name: "_cryptoSign",
235
+ classification: "hardened",
236
+ rationale: "Host crypto sign bridge reference.",
237
+ },
238
+ {
239
+ name: "_cryptoVerify",
240
+ classification: "hardened",
241
+ rationale: "Host crypto verify bridge reference.",
242
+ },
243
+ {
244
+ name: "_cryptoAsymmetricOp",
245
+ classification: "hardened",
246
+ rationale: "Host asymmetric crypto operation bridge reference.",
247
+ },
248
+ {
249
+ name: "_cryptoCreateKeyObject",
250
+ classification: "hardened",
251
+ rationale: "Host asymmetric key import bridge reference.",
252
+ },
253
+ {
254
+ name: "_cryptoGenerateKeyPairSync",
255
+ classification: "hardened",
256
+ rationale: "Host crypto key-pair generation bridge reference.",
257
+ },
258
+ {
259
+ name: "_cryptoGenerateKeySync",
260
+ classification: "hardened",
261
+ rationale: "Host symmetric crypto key generation bridge reference.",
262
+ },
263
+ {
264
+ name: "_cryptoGeneratePrimeSync",
265
+ classification: "hardened",
266
+ rationale: "Host prime generation bridge reference.",
267
+ },
268
+ {
269
+ name: "_cryptoDiffieHellman",
270
+ classification: "hardened",
271
+ rationale: "Host stateless Diffie-Hellman bridge reference.",
272
+ },
273
+ {
274
+ name: "_cryptoDiffieHellmanGroup",
275
+ classification: "hardened",
276
+ rationale: "Host Diffie-Hellman group bridge reference.",
277
+ },
278
+ {
279
+ name: "_cryptoDiffieHellmanSessionCreate",
280
+ classification: "hardened",
281
+ rationale: "Host Diffie-Hellman/ECDH session creation bridge reference.",
282
+ },
283
+ {
284
+ name: "_cryptoDiffieHellmanSessionCall",
285
+ classification: "hardened",
286
+ rationale: "Host Diffie-Hellman/ECDH session method bridge reference.",
287
+ },
288
+ {
289
+ name: "_cryptoSubtle",
290
+ classification: "hardened",
291
+ rationale: "Host WebCrypto subtle bridge reference.",
292
+ },
128
293
  {
129
294
  name: "_fsReadFile",
130
295
  classification: "hardened",
@@ -275,6 +440,181 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
275
440
  classification: "hardened",
276
441
  rationale: "Host network bridge reference.",
277
442
  },
443
+ {
444
+ name: "_networkHttpServerRespondRaw",
445
+ classification: "hardened",
446
+ rationale: "Host network bridge reference for sandbox HTTP server responses.",
447
+ },
448
+ {
449
+ name: "_networkHttpServerWaitRaw",
450
+ classification: "hardened",
451
+ rationale: "Host network bridge reference for sandbox HTTP server lifetime tracking.",
452
+ },
453
+ {
454
+ name: "_networkHttp2ServerListenRaw",
455
+ classification: "hardened",
456
+ rationale: "Host HTTP/2 server listen bridge reference.",
457
+ },
458
+ {
459
+ name: "_networkHttp2ServerCloseRaw",
460
+ classification: "hardened",
461
+ rationale: "Host HTTP/2 server close bridge reference.",
462
+ },
463
+ {
464
+ name: "_networkHttp2ServerWaitRaw",
465
+ classification: "hardened",
466
+ rationale: "Host HTTP/2 server lifetime bridge reference.",
467
+ },
468
+ {
469
+ name: "_networkHttp2SessionConnectRaw",
470
+ classification: "hardened",
471
+ rationale: "Host HTTP/2 session connect bridge reference.",
472
+ },
473
+ {
474
+ name: "_networkHttp2SessionRequestRaw",
475
+ classification: "hardened",
476
+ rationale: "Host HTTP/2 session request bridge reference.",
477
+ },
478
+ {
479
+ name: "_networkHttp2SessionSettingsRaw",
480
+ classification: "hardened",
481
+ rationale: "Host HTTP/2 session settings bridge reference.",
482
+ },
483
+ {
484
+ name: "_networkHttp2SessionGoawayRaw",
485
+ classification: "hardened",
486
+ rationale: "Host HTTP/2 session GOAWAY bridge reference.",
487
+ },
488
+ {
489
+ name: "_networkHttp2SessionCloseRaw",
490
+ classification: "hardened",
491
+ rationale: "Host HTTP/2 session close bridge reference.",
492
+ },
493
+ {
494
+ name: "_networkHttp2SessionDestroyRaw",
495
+ classification: "hardened",
496
+ rationale: "Host HTTP/2 session destroy bridge reference.",
497
+ },
498
+ {
499
+ name: "_networkHttp2SessionWaitRaw",
500
+ classification: "hardened",
501
+ rationale: "Host HTTP/2 session lifetime bridge reference.",
502
+ },
503
+ {
504
+ name: "_networkHttp2StreamRespondRaw",
505
+ classification: "hardened",
506
+ rationale: "Host HTTP/2 stream respond bridge reference.",
507
+ },
508
+ {
509
+ name: "_networkHttp2StreamPushStreamRaw",
510
+ classification: "hardened",
511
+ rationale: "Host HTTP/2 push stream bridge reference.",
512
+ },
513
+ {
514
+ name: "_networkHttp2StreamWriteRaw",
515
+ classification: "hardened",
516
+ rationale: "Host HTTP/2 stream write bridge reference.",
517
+ },
518
+ {
519
+ name: "_networkHttp2StreamEndRaw",
520
+ classification: "hardened",
521
+ rationale: "Host HTTP/2 stream end bridge reference.",
522
+ },
523
+ {
524
+ name: "_upgradeSocketWriteRaw",
525
+ classification: "hardened",
526
+ rationale: "Host HTTP upgrade socket write bridge reference.",
527
+ },
528
+ {
529
+ name: "_upgradeSocketEndRaw",
530
+ classification: "hardened",
531
+ rationale: "Host HTTP upgrade socket half-close bridge reference.",
532
+ },
533
+ {
534
+ name: "_upgradeSocketDestroyRaw",
535
+ classification: "hardened",
536
+ rationale: "Host HTTP upgrade socket destroy bridge reference.",
537
+ },
538
+ {
539
+ name: "_netSocketConnectRaw",
540
+ classification: "hardened",
541
+ rationale: "Host net socket connect bridge reference.",
542
+ },
543
+ {
544
+ name: "_netSocketWaitConnectRaw",
545
+ classification: "hardened",
546
+ rationale: "Host net socket connect-wait bridge reference.",
547
+ },
548
+ {
549
+ name: "_netSocketReadRaw",
550
+ classification: "hardened",
551
+ rationale: "Host net socket read bridge reference.",
552
+ },
553
+ {
554
+ name: "_netSocketSetNoDelayRaw",
555
+ classification: "hardened",
556
+ rationale: "Host net socket no-delay bridge reference.",
557
+ },
558
+ {
559
+ name: "_netSocketSetKeepAliveRaw",
560
+ classification: "hardened",
561
+ rationale: "Host net socket keepalive bridge reference.",
562
+ },
563
+ {
564
+ name: "_netSocketWriteRaw",
565
+ classification: "hardened",
566
+ rationale: "Host net socket write bridge reference.",
567
+ },
568
+ {
569
+ name: "_netSocketEndRaw",
570
+ classification: "hardened",
571
+ rationale: "Host net socket end bridge reference.",
572
+ },
573
+ {
574
+ name: "_netSocketDestroyRaw",
575
+ classification: "hardened",
576
+ rationale: "Host net socket destroy bridge reference.",
577
+ },
578
+ {
579
+ name: "_netSocketUpgradeTlsRaw",
580
+ classification: "hardened",
581
+ rationale: "Host net socket TLS-upgrade bridge reference.",
582
+ },
583
+ {
584
+ name: "_netSocketGetTlsClientHelloRaw",
585
+ classification: "hardened",
586
+ rationale: "Host loopback TLS client-hello bridge reference.",
587
+ },
588
+ {
589
+ name: "_netSocketTlsQueryRaw",
590
+ classification: "hardened",
591
+ rationale: "Host TLS socket query bridge reference.",
592
+ },
593
+ {
594
+ name: "_tlsGetCiphersRaw",
595
+ classification: "hardened",
596
+ rationale: "Host TLS cipher-list bridge reference.",
597
+ },
598
+ {
599
+ name: "_netServerListenRaw",
600
+ classification: "hardened",
601
+ rationale: "Host net server listen bridge reference.",
602
+ },
603
+ {
604
+ name: "_netServerAcceptRaw",
605
+ classification: "hardened",
606
+ rationale: "Host net server accept bridge reference.",
607
+ },
608
+ {
609
+ name: "_netServerCloseRaw",
610
+ classification: "hardened",
611
+ rationale: "Host net server close bridge reference.",
612
+ },
613
+ {
614
+ name: "_batchResolveModules",
615
+ classification: "hardened",
616
+ rationale: "Host bridge for batched module resolution to reduce IPC round-trips.",
617
+ },
278
618
  {
279
619
  name: "_ptySetRawMode",
280
620
  classification: "hardened",
@@ -380,6 +720,11 @@ export const NODE_CUSTOM_GLOBAL_INVENTORY = [
380
720
  classification: "hardened",
381
721
  rationale: "Blob API global stub — must not be replaceable by sandbox code.",
382
722
  },
723
+ {
724
+ name: "FormData",
725
+ classification: "hardened",
726
+ rationale: "FormData API global stub — must not be replaceable by sandbox code.",
727
+ },
383
728
  ];
384
729
  export const HARDENED_NODE_CUSTOM_GLOBALS = NODE_CUSTOM_GLOBAL_INVENTORY
385
730
  .filter((entry) => entry.classification === "hardened")
@@ -1,29 +1,38 @@
1
- import type { VirtualFileSystem, VirtualStat } from "../types.js";
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
- private modes;
12
- private owners;
13
- private timestamps;
14
- private hardLinks;
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<Array<{
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): Promise<void>;
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,16 @@ 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 updateFileMetadata;
57
+ private requirePathInode;
58
+ private requireFileInode;
59
+ private requireInode;
41
60
  }
42
61
  export declare function createInMemoryFileSystem(): InMemoryFileSystem;