@scriptc/compiler 0.2.4 → 0.2.6

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 (1201) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +972 -245
  2. package/ambient/scriptc-overrides.d.ts +5 -1
  3. package/ambient/scriptc.d.ts +22 -2
  4. package/dist/backend/build-cache.d.ts +4 -0
  5. package/dist/backend/build-cache.js +16 -2
  6. package/dist/backend/build-cache.js.map +1 -1
  7. package/dist/backend/cycle-analysis.js +17 -5
  8. package/dist/backend/cycle-analysis.js.map +1 -1
  9. package/dist/backend/cycle-analysis.test.js +50 -11
  10. package/dist/backend/cycle-analysis.test.js.map +1 -1
  11. package/dist/backend/debug-symbols.js.map +1 -1
  12. package/dist/backend/executable-features.js +3 -1
  13. package/dist/backend/executable-features.js.map +1 -1
  14. package/dist/backend/external-c.d.ts +13 -6
  15. package/dist/backend/external-c.js +15 -3
  16. package/dist/backend/external-c.js.map +1 -1
  17. package/dist/backend/ffi-callbacks.js +6 -9
  18. package/dist/backend/ffi-callbacks.js.map +1 -1
  19. package/dist/backend/library-identity-markers.js.map +1 -1
  20. package/dist/backend/library-pack.d.ts +1 -1
  21. package/dist/backend/library-pack.js +81 -24
  22. package/dist/backend/library-pack.js.map +1 -1
  23. package/dist/backend/link-plan-core.d.ts +2 -0
  24. package/dist/backend/link-plan-core.js +10 -2
  25. package/dist/backend/link-plan-core.js.map +1 -1
  26. package/dist/backend/link-plan.d.ts +2 -1
  27. package/dist/backend/link-plan.js +7 -5
  28. package/dist/backend/link-plan.js.map +1 -1
  29. package/dist/backend/linker.d.ts +1 -1
  30. package/dist/backend/linker.js +42 -23
  31. package/dist/backend/linker.js.map +1 -1
  32. package/dist/backend/literals.js +5 -4
  33. package/dist/backend/literals.js.map +1 -1
  34. package/dist/backend/literals.test.js +30 -5
  35. package/dist/backend/literals.test.js.map +1 -1
  36. package/dist/backend/llvm/blocks.test.js +5 -2
  37. package/dist/backend/llvm/blocks.test.js.map +1 -1
  38. package/dist/backend/llvm/borrowed-inputs.js.map +1 -1
  39. package/dist/backend/llvm/borrowed-receivers.js +43 -19
  40. package/dist/backend/llvm/borrowed-receivers.js.map +1 -1
  41. package/dist/backend/llvm/byte-numbers.js +38 -5
  42. package/dist/backend/llvm/byte-numbers.js.map +1 -1
  43. package/dist/backend/llvm/byte-windows.d.ts +31 -0
  44. package/dist/backend/llvm/byte-windows.js +334 -0
  45. package/dist/backend/llvm/byte-windows.js.map +1 -0
  46. package/dist/backend/llvm/byte-windows.test.d.ts +1 -0
  47. package/dist/backend/llvm/byte-windows.test.js +244 -0
  48. package/dist/backend/llvm/byte-windows.test.js.map +1 -0
  49. package/dist/backend/llvm/bytes-bounds.js +73 -22
  50. package/dist/backend/llvm/bytes-bounds.js.map +1 -1
  51. package/dist/backend/llvm/call-lifetimes.d.ts +5 -2
  52. package/dist/backend/llvm/call-lifetimes.js +72 -19
  53. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  54. package/dist/backend/llvm/call-lifetimes.test.js +159 -28
  55. package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
  56. package/dist/backend/llvm/checked-value-lifetimes.d.ts +4 -0
  57. package/dist/backend/llvm/checked-value-lifetimes.js +14 -4
  58. package/dist/backend/llvm/checked-value-lifetimes.js.map +1 -1
  59. package/dist/backend/llvm/classes.d.ts +14 -1
  60. package/dist/backend/llvm/classes.js +94 -19
  61. package/dist/backend/llvm/classes.js.map +1 -1
  62. package/dist/backend/llvm/classes.test.d.ts +1 -0
  63. package/dist/backend/llvm/classes.test.js +99 -0
  64. package/dist/backend/llvm/classes.test.js.map +1 -0
  65. package/dist/backend/llvm/common.js +4 -1
  66. package/dist/backend/llvm/common.js.map +1 -1
  67. package/dist/backend/llvm/constant-callbacks.d.ts +11 -0
  68. package/dist/backend/llvm/constant-callbacks.js +213 -0
  69. package/dist/backend/llvm/constant-callbacks.js.map +1 -0
  70. package/dist/backend/llvm/constant-callbacks.test.d.ts +1 -0
  71. package/dist/backend/llvm/constant-callbacks.test.js +124 -0
  72. package/dist/backend/llvm/constant-callbacks.test.js.map +1 -0
  73. package/dist/backend/llvm/counted-loops.js +10 -3
  74. package/dist/backend/llvm/counted-loops.js.map +1 -1
  75. package/dist/backend/llvm/debug-info.js +33 -13
  76. package/dist/backend/llvm/debug-info.js.map +1 -1
  77. package/dist/backend/llvm/debug-info.test.js +28 -6
  78. package/dist/backend/llvm/debug-info.test.js.map +1 -1
  79. package/dist/backend/llvm/dyn.d.ts +1 -1
  80. package/dist/backend/llvm/dyn.js +75 -56
  81. package/dist/backend/llvm/dyn.js.map +1 -1
  82. package/dist/backend/llvm/emitter.d.ts +28 -3
  83. package/dist/backend/llvm/emitter.js +506 -145
  84. package/dist/backend/llvm/emitter.js.map +1 -1
  85. package/dist/backend/llvm/emitter.test.js +247 -50
  86. package/dist/backend/llvm/emitter.test.js.map +1 -1
  87. package/dist/backend/llvm/expr-async.js +25 -6
  88. package/dist/backend/llvm/expr-async.js.map +1 -1
  89. package/dist/backend/llvm/expr-bytes.js +24 -4
  90. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  91. package/dist/backend/llvm/expr-callbacks.js +10 -4
  92. package/dist/backend/llvm/expr-callbacks.js.map +1 -1
  93. package/dist/backend/llvm/expr-calls.js +110 -31
  94. package/dist/backend/llvm/expr-calls.js.map +1 -1
  95. package/dist/backend/llvm/expr-containers.d.ts +2 -0
  96. package/dist/backend/llvm/expr-containers.js +112 -41
  97. package/dist/backend/llvm/expr-containers.js.map +1 -1
  98. package/dist/backend/llvm/expr-control.js +1 -3
  99. package/dist/backend/llvm/expr-control.js.map +1 -1
  100. package/dist/backend/llvm/expr-dispatch.js +3 -1
  101. package/dist/backend/llvm/expr-dispatch.js.map +1 -1
  102. package/dist/backend/llvm/expr-dynamic.js +55 -7
  103. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  104. package/dist/backend/llvm/expr-island.js +26 -6
  105. package/dist/backend/llvm/expr-island.js.map +1 -1
  106. package/dist/backend/llvm/expr-primitives.js +95 -19
  107. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  108. package/dist/backend/llvm/expr-primitives.test.js +44 -2
  109. package/dist/backend/llvm/expr-primitives.test.js.map +1 -1
  110. package/dist/backend/llvm/expr-records.js +10 -9
  111. package/dist/backend/llvm/expr-records.js.map +1 -1
  112. package/dist/backend/llvm/expr-stream-bridges.js +44 -26
  113. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  114. package/dist/backend/llvm/expr-stream-bridges.test.js +51 -14
  115. package/dist/backend/llvm/expr-stream-bridges.test.js.map +1 -1
  116. package/dist/backend/llvm/expr-stream-callbacks.js +34 -14
  117. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
  118. package/dist/backend/llvm/integer-remainder.d.ts +7 -0
  119. package/dist/backend/llvm/integer-remainder.js +26 -0
  120. package/dist/backend/llvm/integer-remainder.js.map +1 -0
  121. package/dist/backend/llvm/integer-values.js +15 -4
  122. package/dist/backend/llvm/integer-values.js.map +1 -1
  123. package/dist/backend/llvm/integer-views.js +23 -7
  124. package/dist/backend/llvm/integer-views.js.map +1 -1
  125. package/dist/backend/llvm/integer-views.test.js +42 -7
  126. package/dist/backend/llvm/integer-views.test.js.map +1 -1
  127. package/dist/backend/llvm/layouts.js +1 -1
  128. package/dist/backend/llvm/layouts.js.map +1 -1
  129. package/dist/backend/llvm/lib-abi.js +20 -4
  130. package/dist/backend/llvm/lib-abi.js.map +1 -1
  131. package/dist/backend/llvm/lib-connect.js +7 -1
  132. package/dist/backend/llvm/lib-connect.js.map +1 -1
  133. package/dist/backend/llvm/lib-datagram.js +35 -10
  134. package/dist/backend/llvm/lib-datagram.js.map +1 -1
  135. package/dist/backend/llvm/lib-dispatch.js +42 -38
  136. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  137. package/dist/backend/llvm/lib-filesystem.js +33 -18
  138. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  139. package/dist/backend/llvm/lib-http2.js +60 -15
  140. package/dist/backend/llvm/lib-http2.js.map +1 -1
  141. package/dist/backend/llvm/lib-lookup.js +12 -5
  142. package/dist/backend/llvm/lib-lookup.js.map +1 -1
  143. package/dist/backend/llvm/lib-network.js +97 -31
  144. package/dist/backend/llvm/lib-network.js.map +1 -1
  145. package/dist/backend/llvm/lib-process.js +57 -14
  146. package/dist/backend/llvm/lib-process.js.map +1 -1
  147. package/dist/backend/llvm/lib-shared.js +122 -31
  148. package/dist/backend/llvm/lib-shared.js.map +1 -1
  149. package/dist/backend/llvm/lib-stream.js +33 -14
  150. package/dist/backend/llvm/lib-stream.js.map +1 -1
  151. package/dist/backend/llvm/lib-test.js +21 -7
  152. package/dist/backend/llvm/lib-test.js.map +1 -1
  153. package/dist/backend/llvm/lib-tls.js +69 -20
  154. package/dist/backend/llvm/lib-tls.js.map +1 -1
  155. package/dist/backend/llvm/local-array-reads.d.ts +9 -2
  156. package/dist/backend/llvm/local-array-reads.js +176 -89
  157. package/dist/backend/llvm/local-array-reads.js.map +1 -1
  158. package/dist/backend/llvm/local-array-reads.test.js +394 -62
  159. package/dist/backend/llvm/local-array-reads.test.js.map +1 -1
  160. package/dist/backend/llvm/local-union-storage.d.ts +25 -0
  161. package/dist/backend/llvm/local-union-storage.js +109 -0
  162. package/dist/backend/llvm/local-union-storage.js.map +1 -0
  163. package/dist/backend/llvm/local-union-storage.test.d.ts +1 -0
  164. package/dist/backend/llvm/local-union-storage.test.js +210 -0
  165. package/dist/backend/llvm/local-union-storage.test.js.map +1 -0
  166. package/dist/backend/llvm/loop-array-borrows.d.ts +11 -0
  167. package/dist/backend/llvm/loop-array-borrows.js +70 -0
  168. package/dist/backend/llvm/loop-array-borrows.js.map +1 -0
  169. package/dist/backend/llvm/loop-array-borrows.test.d.ts +1 -0
  170. package/dist/backend/llvm/loop-array-borrows.test.js +145 -0
  171. package/dist/backend/llvm/loop-array-borrows.test.js.map +1 -0
  172. package/dist/backend/llvm/map-read-lifetimes.d.ts +11 -2
  173. package/dist/backend/llvm/map-read-lifetimes.js +64 -19
  174. package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
  175. package/dist/backend/llvm/map-read-lifetimes.test.js +89 -17
  176. package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
  177. package/dist/backend/llvm/reference-effects.d.ts +5 -3
  178. package/dist/backend/llvm/reference-effects.js +74 -36
  179. package/dist/backend/llvm/reference-effects.js.map +1 -1
  180. package/dist/backend/llvm/reference-effects.test.js +92 -9
  181. package/dist/backend/llvm/reference-effects.test.js.map +1 -1
  182. package/dist/backend/llvm/shapes.d.ts +4 -1
  183. package/dist/backend/llvm/shapes.js +82 -24
  184. package/dist/backend/llvm/shapes.js.map +1 -1
  185. package/dist/backend/llvm/shapes.test.js +3 -1
  186. package/dist/backend/llvm/shapes.test.js.map +1 -1
  187. package/dist/backend/llvm/split-loops.d.ts +48 -0
  188. package/dist/backend/llvm/split-loops.js +183 -0
  189. package/dist/backend/llvm/split-loops.js.map +1 -0
  190. package/dist/backend/llvm/split.js +4 -11
  191. package/dist/backend/llvm/split.js.map +1 -1
  192. package/dist/backend/llvm/split.test.js +80 -8
  193. package/dist/backend/llvm/split.test.js.map +1 -1
  194. package/dist/backend/llvm/stack-callbacks.d.ts +14 -0
  195. package/dist/backend/llvm/stack-callbacks.js +73 -0
  196. package/dist/backend/llvm/stack-callbacks.js.map +1 -0
  197. package/dist/backend/llvm/stack-captures.d.ts +25 -0
  198. package/dist/backend/llvm/stack-captures.js +150 -0
  199. package/dist/backend/llvm/stack-captures.js.map +1 -0
  200. package/dist/backend/llvm/stack-unions.js +14 -5
  201. package/dist/backend/llvm/stack-unions.js.map +1 -1
  202. package/dist/backend/llvm/stack-unions.test.js +151 -32
  203. package/dist/backend/llvm/stack-unions.test.js.map +1 -1
  204. package/dist/backend/llvm/string-construction.js.map +1 -1
  205. package/dist/backend/llvm/string-construction.test.js +32 -7
  206. package/dist/backend/llvm/string-construction.test.js.map +1 -1
  207. package/dist/backend/llvm/string-lifetimes.js +14 -8
  208. package/dist/backend/llvm/string-lifetimes.js.map +1 -1
  209. package/dist/backend/llvm/string-lifetimes.test.js +119 -29
  210. package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
  211. package/dist/backend/llvm/string-slices.d.ts +20 -0
  212. package/dist/backend/llvm/string-slices.js +87 -0
  213. package/dist/backend/llvm/string-slices.js.map +1 -0
  214. package/dist/backend/llvm/string-slices.test.d.ts +1 -0
  215. package/dist/backend/llvm/string-slices.test.js +98 -0
  216. package/dist/backend/llvm/string-slices.test.js.map +1 -0
  217. package/dist/backend/llvm/switch-dispatch.d.ts +9 -0
  218. package/dist/backend/llvm/switch-dispatch.js +114 -0
  219. package/dist/backend/llvm/switch-dispatch.js.map +1 -0
  220. package/dist/backend/llvm/switch-dispatch.test.d.ts +1 -0
  221. package/dist/backend/llvm/switch-dispatch.test.js +83 -0
  222. package/dist/backend/llvm/switch-dispatch.test.js.map +1 -0
  223. package/dist/backend/llvm/unsupported.js.map +1 -1
  224. package/dist/backend/llvm/walkers.d.ts +4 -14
  225. package/dist/backend/llvm/walkers.js +58 -313
  226. package/dist/backend/llvm/walkers.js.map +1 -1
  227. package/dist/backend/mangle.js +9 -3
  228. package/dist/backend/mangle.js.map +1 -1
  229. package/dist/backend/may-throw.js +18 -8
  230. package/dist/backend/may-throw.js.map +1 -1
  231. package/dist/backend/may-throw.test.js +119 -23
  232. package/dist/backend/may-throw.test.js.map +1 -1
  233. package/dist/backend/native/artifact-stamps.d.ts +39 -0
  234. package/dist/backend/native/artifact-stamps.js +371 -0
  235. package/dist/backend/native/artifact-stamps.js.map +1 -0
  236. package/dist/backend/native/cache-warm.d.ts +24 -0
  237. package/dist/backend/native/cache-warm.js +80 -0
  238. package/dist/backend/native/cache-warm.js.map +1 -0
  239. package/dist/backend/native/compiler-fingerprint.d.ts +19 -0
  240. package/dist/backend/native/compiler-fingerprint.js +357 -0
  241. package/dist/backend/native/compiler-fingerprint.js.map +1 -0
  242. package/dist/backend/native/contracts.d.ts +316 -0
  243. package/dist/backend/native/contracts.js +2 -0
  244. package/dist/backend/native/contracts.js.map +1 -0
  245. package/dist/backend/native/dependency-files.d.ts +5 -0
  246. package/dist/backend/native/dependency-files.js +83 -0
  247. package/dist/backend/native/dependency-files.js.map +1 -0
  248. package/dist/backend/native/driver.d.ts +50 -0
  249. package/dist/backend/native/driver.js +294 -0
  250. package/dist/backend/native/driver.js.map +1 -0
  251. package/dist/backend/native/executable.d.ts +18 -0
  252. package/dist/backend/native/executable.js +1275 -0
  253. package/dist/backend/native/executable.js.map +1 -0
  254. package/dist/backend/native/library.d.ts +2 -0
  255. package/dist/backend/native/library.js +614 -0
  256. package/dist/backend/native/library.js.map +1 -0
  257. package/dist/backend/native/linker-fingerprint.d.ts +8 -0
  258. package/dist/backend/native/linker-fingerprint.js +174 -0
  259. package/dist/backend/native/linker-fingerprint.js.map +1 -0
  260. package/dist/backend/native/object-merge.d.ts +2 -0
  261. package/dist/backend/native/object-merge.js +154 -0
  262. package/dist/backend/native/object-merge.js.map +1 -0
  263. package/dist/backend/native/process.d.ts +17 -0
  264. package/dist/backend/native/process.js +42 -0
  265. package/dist/backend/native/process.js.map +1 -0
  266. package/dist/backend/native/program-shards.d.ts +21 -0
  267. package/dist/backend/native/program-shards.js +99 -0
  268. package/dist/backend/native/program-shards.js.map +1 -0
  269. package/dist/backend/native/runtime-inputs.d.ts +12 -0
  270. package/dist/backend/native/runtime-inputs.js +165 -0
  271. package/dist/backend/native/runtime-inputs.js.map +1 -0
  272. package/dist/backend/native/runtime-inputs.test.d.ts +1 -0
  273. package/dist/backend/native/runtime-inputs.test.js +64 -0
  274. package/dist/backend/native/runtime-inputs.test.js.map +1 -0
  275. package/dist/backend/native/runtime-objects.d.ts +16 -0
  276. package/dist/backend/native/runtime-objects.js +122 -0
  277. package/dist/backend/native/runtime-objects.js.map +1 -0
  278. package/dist/backend/native/session.d.ts +12 -0
  279. package/dist/backend/native/session.js +31 -0
  280. package/dist/backend/native/session.js.map +1 -0
  281. package/dist/backend/native/tool-identity.d.ts +37 -0
  282. package/dist/backend/native/tool-identity.js +310 -0
  283. package/dist/backend/native/tool-identity.js.map +1 -0
  284. package/dist/backend/native/trace-paths.d.ts +12 -0
  285. package/dist/backend/native/trace-paths.js +73 -0
  286. package/dist/backend/native/trace-paths.js.map +1 -0
  287. package/dist/backend/native/vendor.d.ts +1 -0
  288. package/dist/backend/native/vendor.js +12 -0
  289. package/dist/backend/native/vendor.js.map +1 -0
  290. package/dist/backend/native-codegen-core.d.ts +6 -0
  291. package/dist/backend/native-codegen-core.js +23 -1
  292. package/dist/backend/native-codegen-core.js.map +1 -1
  293. package/dist/backend/native-codegen.d.ts +5 -1
  294. package/dist/backend/native-codegen.js +52 -25
  295. package/dist/backend/native-codegen.js.map +1 -1
  296. package/dist/backend/native-codegen.test.js +59 -11
  297. package/dist/backend/native-codegen.test.js.map +1 -1
  298. package/dist/backend/native-link-info-core.d.ts +1 -0
  299. package/dist/backend/native-link-info-core.js +9 -5
  300. package/dist/backend/native-link-info-core.js.map +1 -1
  301. package/dist/backend/native-link-info.js +14 -5
  302. package/dist/backend/native-link-info.js.map +1 -1
  303. package/dist/backend/native-link-info.test.js +58 -13
  304. package/dist/backend/native-link-info.test.js.map +1 -1
  305. package/dist/backend/native-toolchain.d.ts +17 -450
  306. package/dist/backend/native-toolchain.js +17 -3971
  307. package/dist/backend/native-toolchain.js.map +1 -1
  308. package/dist/backend/native-toolchain.test.js +103 -72
  309. package/dist/backend/native-toolchain.test.js.map +1 -1
  310. package/dist/backend/native-tools.d.ts +3 -1
  311. package/dist/backend/native-tools.js +30 -9
  312. package/dist/backend/native-tools.js.map +1 -1
  313. package/dist/backend/object-localize.js +17 -14
  314. package/dist/backend/object-localize.js.map +1 -1
  315. package/dist/backend/object-localize.test.js +59 -12
  316. package/dist/backend/object-localize.test.js.map +1 -1
  317. package/dist/backend/runtime-abi.d.ts +2 -2
  318. package/dist/backend/runtime-abi.js +2 -2
  319. package/dist/backend/runtime-pack-core.d.ts +1 -0
  320. package/dist/backend/runtime-pack-core.js +104 -50
  321. package/dist/backend/runtime-pack-core.js.map +1 -1
  322. package/dist/backend/runtime-pack-native.js +5 -3
  323. package/dist/backend/runtime-pack-native.js.map +1 -1
  324. package/dist/backend/runtime-pack-targets.test.js +126 -17
  325. package/dist/backend/runtime-pack-targets.test.js.map +1 -1
  326. package/dist/backend/runtime-pack.d.ts +1 -1
  327. package/dist/backend/runtime-pack.js +11 -12
  328. package/dist/backend/runtime-pack.js.map +1 -1
  329. package/dist/backend/runtime-pack.test.js +51 -25
  330. package/dist/backend/runtime-pack.test.js.map +1 -1
  331. package/dist/backend/source-locations.js.map +1 -1
  332. package/dist/backend/source-locations.test.js +7 -2
  333. package/dist/backend/source-locations.test.js.map +1 -1
  334. package/dist/backend/target-diagnostics.js +44 -14
  335. package/dist/backend/target-diagnostics.js.map +1 -1
  336. package/dist/backend/target-diagnostics.test.js +93 -20
  337. package/dist/backend/target-diagnostics.test.js.map +1 -1
  338. package/dist/backend/targets.js +230 -86
  339. package/dist/backend/targets.js.map +1 -1
  340. package/dist/backend/targets.test.js +32 -18
  341. package/dist/backend/targets.test.js.map +1 -1
  342. package/dist/backend/toolchain-environment.js +5 -1
  343. package/dist/backend/toolchain-environment.js.map +1 -1
  344. package/dist/backend/vendor-archives.d.ts +2 -2
  345. package/dist/backend/vendor-archives.js +84 -35
  346. package/dist/backend/vendor-archives.js.map +1 -1
  347. package/dist/backend/vendor-inputs.js +13 -1
  348. package/dist/backend/vendor-inputs.js.map +1 -1
  349. package/dist/backend/warm-cache.d.ts +1 -1
  350. package/dist/backend/warm-cache.js +33 -9
  351. package/dist/backend/warm-cache.js.map +1 -1
  352. package/dist/cli/command.js +39 -9
  353. package/dist/cli/command.js.map +1 -1
  354. package/dist/cli/output-options.js +14 -4
  355. package/dist/cli/output-options.js.map +1 -1
  356. package/dist/cli/paths.js.map +1 -1
  357. package/dist/cli/wasi-runner.js.map +1 -1
  358. package/dist/compat/fetch-profile.js +36 -35
  359. package/dist/compat/fetch-profile.js.map +1 -1
  360. package/dist/coverage/report.js +16 -17
  361. package/dist/coverage/report.js.map +1 -1
  362. package/dist/coverage/surface-manifest.js +112 -26
  363. package/dist/coverage/surface-manifest.js.map +1 -1
  364. package/dist/diagnostics/diagnostic.js +55 -16
  365. package/dist/diagnostics/diagnostic.js.map +1 -1
  366. package/dist/executable/executable-cache.d.ts +2 -1
  367. package/dist/executable/executable-cache.js +79 -48
  368. package/dist/executable/executable-cache.js.map +1 -1
  369. package/dist/executable/executable-cache.test.js +90 -26
  370. package/dist/executable/executable-cache.test.js.map +1 -1
  371. package/dist/executable/prepare.js +2 -2
  372. package/dist/executable/prepare.js.map +1 -1
  373. package/dist/ffi/ffi-manifest.js +78 -20
  374. package/dist/ffi/ffi-manifest.js.map +1 -1
  375. package/dist/ffi/ffi-manifest.test.js +96 -16
  376. package/dist/ffi/ffi-manifest.test.js.map +1 -1
  377. package/dist/format-integer.js.map +1 -1
  378. package/dist/frontend/analysis.js +12 -2
  379. package/dist/frontend/analysis.js.map +1 -1
  380. package/dist/frontend/arguments-usage.js.map +1 -1
  381. package/dist/frontend/binding-source.js +9 -3
  382. package/dist/frontend/binding-source.js.map +1 -1
  383. package/dist/frontend/builtin-modules.js +46 -2
  384. package/dist/frontend/builtin-modules.js.map +1 -1
  385. package/dist/frontend/cjs-resolve.js +40 -17
  386. package/dist/frontend/cjs-resolve.js.map +1 -1
  387. package/dist/frontend/cjs-syntax.js +31 -10
  388. package/dist/frontend/cjs-syntax.js.map +1 -1
  389. package/dist/frontend/comptime-node.test.js +10 -11
  390. package/dist/frontend/comptime-node.test.js.map +1 -1
  391. package/dist/frontend/dts-paths.js +7 -3
  392. package/dist/frontend/dts-paths.js.map +1 -1
  393. package/dist/frontend/fork-target.d.ts +5 -0
  394. package/dist/frontend/fork-target.js +55 -18
  395. package/dist/frontend/fork-target.js.map +1 -1
  396. package/dist/frontend/fork-target.test.d.ts +1 -0
  397. package/dist/frontend/fork-target.test.js +59 -0
  398. package/dist/frontend/fork-target.test.js.map +1 -0
  399. package/dist/frontend/function-completion.js +11 -6
  400. package/dist/frontend/function-completion.js.map +1 -1
  401. package/dist/frontend/helper-tokens.js +53 -6
  402. package/dist/frontend/helper-tokens.js.map +1 -1
  403. package/dist/frontend/helper-tokens.test.js +18 -2
  404. package/dist/frontend/helper-tokens.test.js.map +1 -1
  405. package/dist/frontend/inferred-js-diagnostics.js +32 -12
  406. package/dist/frontend/inferred-js-diagnostics.js.map +1 -1
  407. package/dist/frontend/inferred-js-diagnostics.test.js +11 -15
  408. package/dist/frontend/inferred-js-diagnostics.test.js.map +1 -1
  409. package/dist/frontend/input-tracker.js +11 -11
  410. package/dist/frontend/input-tracker.js.map +1 -1
  411. package/dist/frontend/input-tracker.test.js +4 -1
  412. package/dist/frontend/input-tracker.test.js.map +1 -1
  413. package/dist/frontend/lib-contract.js +38 -9
  414. package/dist/frontend/lib-contract.js.map +1 -1
  415. package/dist/frontend/literal-values.js.map +1 -1
  416. package/dist/frontend/literal-values.test.js +28 -8
  417. package/dist/frontend/literal-values.test.js.map +1 -1
  418. package/dist/frontend/lowering/abstract-equality.js +53 -10
  419. package/dist/frontend/lowering/abstract-equality.js.map +1 -1
  420. package/dist/frontend/lowering/array-indexed-mutation.d.ts +1 -1
  421. package/dist/frontend/lowering/array-indexed-mutation.js +108 -106
  422. package/dist/frontend/lowering/array-indexed-mutation.js.map +1 -1
  423. package/dist/frontend/lowering/array-values.js +37 -14
  424. package/dist/frontend/lowering/array-values.js.map +1 -1
  425. package/dist/frontend/lowering/binding-analysis.d.ts +50 -0
  426. package/dist/frontend/lowering/binding-analysis.js +376 -0
  427. package/dist/frontend/lowering/binding-analysis.js.map +1 -0
  428. package/dist/frontend/lowering/builtin-calls.d.ts +9 -0
  429. package/dist/frontend/lowering/builtin-calls.js +60 -0
  430. package/dist/frontend/lowering/builtin-calls.js.map +1 -0
  431. package/dist/frontend/lowering/builtins/arguments.d.ts +43 -0
  432. package/dist/frontend/lowering/builtins/arguments.js +247 -0
  433. package/dist/frontend/lowering/builtins/arguments.js.map +1 -0
  434. package/dist/frontend/lowering/builtins/async-context.d.ts +52 -0
  435. package/dist/frontend/lowering/builtins/async-context.js +436 -0
  436. package/dist/frontend/lowering/builtins/async-context.js.map +1 -0
  437. package/dist/frontend/lowering/builtins/atomics.d.ts +6 -0
  438. package/dist/frontend/lowering/builtins/atomics.js +82 -0
  439. package/dist/frontend/lowering/builtins/atomics.js.map +1 -0
  440. package/dist/frontend/lowering/builtins/callable-aliases.d.ts +13 -0
  441. package/dist/frontend/lowering/builtins/callable-aliases.js +87 -0
  442. package/dist/frontend/lowering/builtins/callable-aliases.js.map +1 -0
  443. package/dist/frontend/lowering/builtins/child-process-async.d.ts +18 -0
  444. package/dist/frontend/lowering/builtins/child-process-async.js +245 -0
  445. package/dist/frontend/lowering/builtins/child-process-async.js.map +1 -0
  446. package/dist/frontend/lowering/builtins/child-process-methods.d.ts +21 -0
  447. package/dist/frontend/lowering/builtins/child-process-methods.js +362 -0
  448. package/dist/frontend/lowering/builtins/child-process-methods.js.map +1 -0
  449. package/dist/frontend/lowering/builtins/child-process-sync.d.ts +4 -0
  450. package/dist/frontend/lowering/builtins/child-process-sync.js +639 -0
  451. package/dist/frontend/lowering/builtins/child-process-sync.js.map +1 -0
  452. package/dist/frontend/lowering/builtins/child-process.d.ts +55 -0
  453. package/dist/frontend/lowering/builtins/child-process.js +669 -0
  454. package/dist/frontend/lowering/builtins/child-process.js.map +1 -0
  455. package/dist/frontend/lowering/builtins/compression.d.ts +7 -0
  456. package/dist/frontend/lowering/builtins/compression.js +115 -0
  457. package/dist/frontend/lowering/builtins/compression.js.map +1 -0
  458. package/dist/frontend/lowering/builtins/console.d.ts +10 -0
  459. package/dist/frontend/lowering/builtins/console.js +38 -0
  460. package/dist/frontend/lowering/builtins/console.js.map +1 -0
  461. package/dist/frontend/lowering/builtins/constants.d.ts +24 -0
  462. package/dist/frontend/lowering/builtins/constants.js +141 -0
  463. package/dist/frontend/lowering/builtins/constants.js.map +1 -0
  464. package/dist/frontend/lowering/builtins/crypto.d.ts +22 -0
  465. package/dist/frontend/lowering/builtins/crypto.js +517 -0
  466. package/dist/frontend/lowering/builtins/crypto.js.map +1 -0
  467. package/dist/frontend/lowering/builtins/dates.d.ts +7 -0
  468. package/dist/frontend/lowering/builtins/dates.js +101 -0
  469. package/dist/frontend/lowering/builtins/dates.js.map +1 -0
  470. package/dist/frontend/lowering/builtins/environment.d.ts +34 -0
  471. package/dist/frontend/lowering/builtins/environment.js +95 -0
  472. package/dist/frontend/lowering/builtins/environment.js.map +1 -0
  473. package/dist/frontend/lowering/builtins/errors.d.ts +14 -0
  474. package/dist/frontend/lowering/builtins/errors.js +83 -0
  475. package/dist/frontend/lowering/builtins/errors.js.map +1 -0
  476. package/dist/frontend/lowering/builtins/filesystem-calls.d.ts +35 -0
  477. package/dist/frontend/lowering/builtins/filesystem-calls.js +725 -0
  478. package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -0
  479. package/dist/frontend/lowering/builtins/filesystem.d.ts +108 -0
  480. package/dist/frontend/lowering/builtins/filesystem.js +1061 -0
  481. package/dist/frontend/lowering/builtins/filesystem.js.map +1 -0
  482. package/dist/frontend/lowering/builtins/ipc.d.ts +8 -0
  483. package/dist/frontend/lowering/builtins/ipc.js +76 -0
  484. package/dist/frontend/lowering/builtins/ipc.js.map +1 -0
  485. package/dist/frontend/lowering/builtins/json.d.ts +12 -0
  486. package/dist/frontend/lowering/builtins/json.js +387 -0
  487. package/dist/frontend/lowering/builtins/json.js.map +1 -0
  488. package/dist/frontend/lowering/builtins/module-bindings.d.ts +85 -0
  489. package/dist/frontend/lowering/builtins/module-bindings.js +346 -0
  490. package/dist/frontend/lowering/builtins/module-bindings.js.map +1 -0
  491. package/dist/frontend/lowering/builtins/module-calls.d.ts +8 -0
  492. package/dist/frontend/lowering/builtins/module-calls.js +308 -0
  493. package/dist/frontend/lowering/builtins/module-calls.js.map +1 -0
  494. package/dist/frontend/lowering/builtins/module-resolution.d.ts +38 -0
  495. package/dist/frontend/lowering/builtins/module-resolution.js +344 -0
  496. package/dist/frontend/lowering/builtins/module-resolution.js.map +1 -0
  497. package/dist/frontend/lowering/builtins/numbers.d.ts +15 -0
  498. package/dist/frontend/lowering/builtins/numbers.js +124 -0
  499. package/dist/frontend/lowering/builtins/numbers.js.map +1 -0
  500. package/dist/frontend/lowering/builtins/operating-system.d.ts +13 -0
  501. package/dist/frontend/lowering/builtins/operating-system.js +148 -0
  502. package/dist/frontend/lowering/builtins/operating-system.js.map +1 -0
  503. package/dist/frontend/lowering/builtins/performance.d.ts +13 -0
  504. package/dist/frontend/lowering/builtins/performance.js +100 -0
  505. package/dist/frontend/lowering/builtins/performance.js.map +1 -0
  506. package/dist/frontend/lowering/builtins/process.d.ts +50 -0
  507. package/dist/frontend/lowering/builtins/process.js +1138 -0
  508. package/dist/frontend/lowering/builtins/process.js.map +1 -0
  509. package/dist/frontend/lowering/builtins/promises.d.ts +14 -0
  510. package/dist/frontend/lowering/builtins/promises.js +356 -0
  511. package/dist/frontend/lowering/builtins/promises.js.map +1 -0
  512. package/dist/frontend/lowering/builtins/properties.d.ts +11 -0
  513. package/dist/frontend/lowering/builtins/properties.js +186 -0
  514. package/dist/frontend/lowering/builtins/properties.js.map +1 -0
  515. package/dist/frontend/lowering/builtins/querystring.d.ts +19 -0
  516. package/dist/frontend/lowering/builtins/querystring.js +150 -0
  517. package/dist/frontend/lowering/builtins/querystring.js.map +1 -0
  518. package/dist/frontend/lowering/builtins/readline.d.ts +13 -0
  519. package/dist/frontend/lowering/builtins/readline.js +138 -0
  520. package/dist/frontend/lowering/builtins/readline.js.map +1 -0
  521. package/dist/frontend/lowering/builtins/receiver-types.d.ts +5 -0
  522. package/dist/frontend/lowering/builtins/receiver-types.js +15 -0
  523. package/dist/frontend/lowering/builtins/receiver-types.js.map +1 -0
  524. package/dist/frontend/lowering/builtins/reflection.d.ts +13 -0
  525. package/dist/frontend/lowering/builtins/reflection.js +95 -0
  526. package/dist/frontend/lowering/builtins/reflection.js.map +1 -0
  527. package/dist/frontend/lowering/builtins/strings.d.ts +14 -0
  528. package/dist/frontend/lowering/builtins/strings.js +121 -0
  529. package/dist/frontend/lowering/builtins/strings.js.map +1 -0
  530. package/dist/frontend/lowering/builtins/text-codecs.d.ts +29 -0
  531. package/dist/frontend/lowering/builtins/text-codecs.js +590 -0
  532. package/dist/frontend/lowering/builtins/text-codecs.js.map +1 -0
  533. package/dist/frontend/lowering/builtins/timers.d.ts +22 -0
  534. package/dist/frontend/lowering/builtins/timers.js +180 -0
  535. package/dist/frontend/lowering/builtins/timers.js.map +1 -0
  536. package/dist/frontend/lowering/builtins/url.d.ts +37 -0
  537. package/dist/frontend/lowering/builtins/url.js +596 -0
  538. package/dist/frontend/lowering/builtins/url.js.map +1 -0
  539. package/dist/frontend/lowering/builtins/util-types.d.ts +7 -0
  540. package/dist/frontend/lowering/builtins/util-types.js +31 -0
  541. package/dist/frontend/lowering/builtins/util-types.js.map +1 -0
  542. package/dist/frontend/lowering/builtins/workers.d.ts +5 -0
  543. package/dist/frontend/lowering/builtins/workers.js +65 -0
  544. package/dist/frontend/lowering/builtins/workers.js.map +1 -0
  545. package/dist/frontend/lowering/call-arguments.d.ts +72 -0
  546. package/dist/frontend/lowering/call-arguments.js +618 -0
  547. package/dist/frontend/lowering/call-arguments.js.map +1 -0
  548. package/dist/frontend/lowering/call-signatures.d.ts +115 -0
  549. package/dist/frontend/lowering/call-signatures.js +719 -0
  550. package/dist/frontend/lowering/call-signatures.js.map +1 -0
  551. package/dist/frontend/lowering/callback-arg.js.map +1 -1
  552. package/dist/frontend/lowering/checked-iterable-spread.js +53 -10
  553. package/dist/frontend/lowering/checked-iterable-spread.js.map +1 -1
  554. package/dist/frontend/lowering/checked-promise-all.js +41 -9
  555. package/dist/frontend/lowering/checked-promise-all.js.map +1 -1
  556. package/dist/frontend/lowering/class-assertions.d.ts +7 -0
  557. package/dist/frontend/lowering/class-assertions.js +96 -0
  558. package/dist/frontend/lowering/class-assertions.js.map +1 -0
  559. package/dist/frontend/lowering/class-callbacks.d.ts +1 -1
  560. package/dist/frontend/lowering/class-callbacks.js +130 -27
  561. package/dist/frontend/lowering/class-callbacks.js.map +1 -1
  562. package/dist/frontend/lowering/class-construction.d.ts +1 -1
  563. package/dist/frontend/lowering/class-construction.js +247 -50
  564. package/dist/frontend/lowering/class-construction.js.map +1 -1
  565. package/dist/frontend/lowering/class-descriptors.js +109 -29
  566. package/dist/frontend/lowering/class-descriptors.js.map +1 -1
  567. package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +6 -1
  568. package/dist/frontend/lowering/class-dynamic-dispatch.js +2471 -465
  569. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  570. package/dist/frontend/lowering/class-dynamic-dispatch.test.js +284 -44
  571. package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -1
  572. package/dist/frontend/lowering/class-instance-constructor.js +17 -5
  573. package/dist/frontend/lowering/class-instance-constructor.js.map +1 -1
  574. package/dist/frontend/lowering/class-method-values.js +199 -51
  575. package/dist/frontend/lowering/class-method-values.js.map +1 -1
  576. package/dist/frontend/lowering/class-protocols.d.ts +17 -0
  577. package/dist/frontend/lowering/class-protocols.js +126 -0
  578. package/dist/frontend/lowering/class-protocols.js.map +1 -0
  579. package/dist/frontend/lowering/class-prototypes.js +345 -86
  580. package/dist/frontend/lowering/class-prototypes.js.map +1 -1
  581. package/dist/frontend/lowering/class-runtime-statics.d.ts +1 -1
  582. package/dist/frontend/lowering/class-runtime-statics.js +80 -17
  583. package/dist/frontend/lowering/class-runtime-statics.js.map +1 -1
  584. package/dist/frontend/lowering/class-static-data.js +76 -16
  585. package/dist/frontend/lowering/class-static-data.js.map +1 -1
  586. package/dist/frontend/lowering/coercions/builders.d.ts +13 -0
  587. package/dist/frontend/lowering/coercions/builders.js +77 -0
  588. package/dist/frontend/lowering/coercions/builders.js.map +1 -0
  589. package/dist/frontend/lowering/coercions/function-adapters.d.ts +58 -0
  590. package/dist/frontend/lowering/coercions/function-adapters.js +430 -0
  591. package/dist/frontend/lowering/coercions/function-adapters.js.map +1 -0
  592. package/dist/frontend/lowering/coercions/island.d.ts +37 -0
  593. package/dist/frontend/lowering/coercions/island.js +350 -0
  594. package/dist/frontend/lowering/coercions/island.js.map +1 -0
  595. package/dist/frontend/lowering/coercions/state.d.ts +14 -0
  596. package/dist/frontend/lowering/coercions/state.js +16 -0
  597. package/dist/frontend/lowering/coercions/state.js.map +1 -0
  598. package/dist/frontend/lowering/coercions/structural-plans.d.ts +40 -0
  599. package/dist/frontend/lowering/coercions/structural-plans.js +447 -0
  600. package/dist/frontend/lowering/coercions/structural-plans.js.map +1 -0
  601. package/dist/frontend/lowering/coercions/structural.d.ts +63 -0
  602. package/dist/frontend/lowering/coercions/structural.js +616 -0
  603. package/dist/frontend/lowering/coercions/structural.js.map +1 -0
  604. package/dist/frontend/lowering/coercions/unions.d.ts +65 -0
  605. package/dist/frontend/lowering/coercions/unions.js +318 -0
  606. package/dist/frontend/lowering/coercions/unions.js.map +1 -0
  607. package/dist/frontend/lowering/collection-ingestion.js +355 -72
  608. package/dist/frontend/lowering/collection-ingestion.js.map +1 -1
  609. package/dist/frontend/lowering/containers/array-callbacks.d.ts +88 -0
  610. package/dist/frontend/lowering/containers/array-callbacks.js +1611 -0
  611. package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -0
  612. package/dist/frontend/lowering/containers/array-construction.d.ts +42 -0
  613. package/dist/frontend/lowering/containers/array-construction.js +1044 -0
  614. package/dist/frontend/lowering/containers/array-construction.js.map +1 -0
  615. package/dist/frontend/lowering/containers/array-iteration.d.ts +16 -0
  616. package/dist/frontend/lowering/containers/array-iteration.js +95 -0
  617. package/dist/frontend/lowering/containers/array-iteration.js.map +1 -0
  618. package/dist/frontend/lowering/containers/array-methods.d.ts +27 -0
  619. package/dist/frontend/lowering/containers/array-methods.js +1854 -0
  620. package/dist/frontend/lowering/containers/array-methods.js.map +1 -0
  621. package/dist/frontend/lowering/containers/bytes.d.ts +17 -17
  622. package/dist/frontend/lowering/containers/bytes.js +430 -138
  623. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  624. package/dist/frontend/lowering/containers/callback-arguments.d.ts +26 -0
  625. package/dist/frontend/lowering/containers/callback-arguments.js +179 -0
  626. package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -0
  627. package/dist/frontend/lowering/containers/collection-grouping.d.ts +19 -0
  628. package/dist/frontend/lowering/containers/collection-grouping.js +297 -0
  629. package/dist/frontend/lowering/containers/collection-grouping.js.map +1 -0
  630. package/dist/frontend/lowering/containers/collection-methods.d.ts +57 -0
  631. package/dist/frontend/lowering/containers/collection-methods.js +1314 -0
  632. package/dist/frontend/lowering/containers/collection-methods.js.map +1 -0
  633. package/dist/frontend/lowering/containers/dynamic-receivers.d.ts +18 -0
  634. package/dist/frontend/lowering/containers/dynamic-receivers.js +114 -0
  635. package/dist/frontend/lowering/containers/dynamic-receivers.js.map +1 -0
  636. package/dist/frontend/lowering/containers/for-of.d.ts +60 -0
  637. package/dist/frontend/lowering/containers/for-of.js +643 -0
  638. package/dist/frontend/lowering/containers/for-of.js.map +1 -0
  639. package/dist/frontend/lowering/containers/indexed-objects.d.ts +132 -0
  640. package/dist/frontend/lowering/containers/indexed-objects.js +1743 -0
  641. package/dist/frontend/lowering/containers/indexed-objects.js.map +1 -0
  642. package/dist/frontend/lowering/containers/iterator-helpers.d.ts +20 -0
  643. package/dist/frontend/lowering/containers/iterator-helpers.js +809 -0
  644. package/dist/frontend/lowering/containers/iterator-helpers.js.map +1 -0
  645. package/dist/frontend/lowering/containers/string-and-regexp.js +601 -160
  646. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  647. package/dist/frontend/lowering/containers/string-replacement.js +213 -63
  648. package/dist/frontend/lowering/containers/string-replacement.js.map +1 -1
  649. package/dist/frontend/lowering/crypto-tables.js +263 -64
  650. package/dist/frontend/lowering/crypto-tables.js.map +1 -1
  651. package/dist/frontend/lowering/deferred-module-initializers.js +172 -68
  652. package/dist/frontend/lowering/deferred-module-initializers.js.map +1 -1
  653. package/dist/frontend/lowering/deferred-module-initializers.test.js +41 -8
  654. package/dist/frontend/lowering/deferred-module-initializers.test.js.map +1 -1
  655. package/dist/frontend/lowering/error-methods.js +339 -65
  656. package/dist/frontend/lowering/error-methods.js.map +1 -1
  657. package/dist/frontend/lowering/expressions/evaluation-safety.js +3 -2
  658. package/dist/frontend/lowering/expressions/evaluation-safety.js.map +1 -1
  659. package/dist/frontend/lowering/expressions/global-symbols.js +2 -1
  660. package/dist/frontend/lowering/expressions/global-symbols.js.map +1 -1
  661. package/dist/frontend/lowering/expressions/native-proxy.js +11 -5
  662. package/dist/frontend/lowering/expressions/native-proxy.js.map +1 -1
  663. package/dist/frontend/lowering/expressions/nullish-assignment.js +67 -13
  664. package/dist/frontend/lowering/expressions/nullish-assignment.js.map +1 -1
  665. package/dist/frontend/lowering/expressions/object-literals.js +588 -165
  666. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  667. package/dist/frontend/lowering/expressions/optional-chains.d.ts +1 -1
  668. package/dist/frontend/lowering/expressions/optional-chains.js +68 -17
  669. package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
  670. package/dist/frontend/lowering/expressions/union-field-write.js +45 -18
  671. package/dist/frontend/lowering/expressions/union-field-write.js.map +1 -1
  672. package/dist/frontend/lowering/function-context.js +5 -1
  673. package/dist/frontend/lowering/function-context.js.map +1 -1
  674. package/dist/frontend/lowering/function-returns.d.ts +67 -0
  675. package/dist/frontend/lowering/function-returns.js +392 -0
  676. package/dist/frontend/lowering/function-returns.js.map +1 -0
  677. package/dist/frontend/lowering/generator-delegation.d.ts +1 -1
  678. package/dist/frontend/lowering/generator-delegation.js +171 -39
  679. package/dist/frontend/lowering/generator-delegation.js.map +1 -1
  680. package/dist/frontend/lowering/generator-dynamic-dispatch.d.ts +1 -1
  681. package/dist/frontend/lowering/generator-dynamic-dispatch.js +176 -36
  682. package/dist/frontend/lowering/generator-dynamic-dispatch.js.map +1 -1
  683. package/dist/frontend/lowering/generic-functions.d.ts +271 -0
  684. package/dist/frontend/lowering/generic-functions.js +1730 -0
  685. package/dist/frontend/lowering/generic-functions.js.map +1 -0
  686. package/dist/frontend/lowering/import-meta.d.ts +1 -1
  687. package/dist/frontend/lowering/import-meta.js +37 -14
  688. package/dist/frontend/lowering/import-meta.js.map +1 -1
  689. package/dist/frontend/lowering/indexed-comparison.js +6 -2
  690. package/dist/frontend/lowering/indexed-comparison.js.map +1 -1
  691. package/dist/frontend/lowering/instantiation-path.d.ts +8 -0
  692. package/dist/frontend/lowering/instantiation-path.js +10 -0
  693. package/dist/frontend/lowering/instantiation-path.js.map +1 -0
  694. package/dist/frontend/lowering/instantiation-path.test.d.ts +1 -0
  695. package/dist/frontend/lowering/instantiation-path.test.js +23 -0
  696. package/dist/frontend/lowering/instantiation-path.test.js.map +1 -0
  697. package/dist/frontend/lowering/iterator-consumption.d.ts +9 -0
  698. package/dist/frontend/lowering/iterator-consumption.js +91 -0
  699. package/dist/frontend/lowering/iterator-consumption.js.map +1 -0
  700. package/dist/frontend/lowering/lib-boundary.js +40 -17
  701. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  702. package/dist/frontend/lowering/lib-boundary.test.js +49 -11
  703. package/dist/frontend/lowering/lib-boundary.test.js.map +1 -1
  704. package/dist/frontend/lowering/lower-array-sort.d.ts +0 -19
  705. package/dist/frontend/lowering/lower-array-sort.js +331 -566
  706. package/dist/frontend/lowering/lower-array-sort.js.map +1 -1
  707. package/dist/frontend/lowering/lower-assert.js +248 -43
  708. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  709. package/dist/frontend/lowering/lower-async-iteration.js +71 -16
  710. package/dist/frontend/lowering/lower-async-iteration.js.map +1 -1
  711. package/dist/frontend/lowering/lower-builtin-values.js +430 -77
  712. package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
  713. package/dist/frontend/lowering/lower-calls.d.ts +39 -558
  714. package/dist/frontend/lowering/lower-calls.js +2628 -5669
  715. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  716. package/dist/frontend/lowering/lower-classes.d.ts +248 -242
  717. package/dist/frontend/lowering/lower-classes.js +1820 -775
  718. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  719. package/dist/frontend/lowering/lower-comptime.d.ts +35 -35
  720. package/dist/frontend/lowering/lower-comptime.js +39 -37
  721. package/dist/frontend/lowering/lower-comptime.js.map +1 -1
  722. package/dist/frontend/lowering/lower-dgram.js +59 -31
  723. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  724. package/dist/frontend/lowering/lower-enums.js +5 -2
  725. package/dist/frontend/lowering/lower-enums.js.map +1 -1
  726. package/dist/frontend/lowering/lower-event-emitter.js +323 -86
  727. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
  728. package/dist/frontend/lowering/lower-expando.js +19 -7
  729. package/dist/frontend/lowering/lower-expando.js.map +1 -1
  730. package/dist/frontend/lowering/lower-exprs.d.ts +194 -194
  731. package/dist/frontend/lowering/lower-exprs.js +3473 -1160
  732. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  733. package/dist/frontend/lowering/lower-functions.d.ts +23 -0
  734. package/dist/frontend/lowering/lower-functions.js +449 -0
  735. package/dist/frontend/lowering/lower-functions.js.map +1 -0
  736. package/dist/frontend/lowering/lower-generators.js +121 -32
  737. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  738. package/dist/frontend/lowering/lower-global-value.js +15 -4
  739. package/dist/frontend/lowering/lower-global-value.js.map +1 -1
  740. package/dist/frontend/lowering/lower-inspect.js +479 -89
  741. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  742. package/dist/frontend/lowering/lower-island.d.ts +79 -79
  743. package/dist/frontend/lowering/lower-island.js +366 -274
  744. package/dist/frontend/lowering/lower-island.js.map +1 -1
  745. package/dist/frontend/lowering/lower-island.test.js +7 -2
  746. package/dist/frontend/lowering/lower-island.test.js.map +1 -1
  747. package/dist/frontend/lowering/lower-mixins.js +17 -8
  748. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  749. package/dist/frontend/lowering/lower-modules.d.ts +95 -94
  750. package/dist/frontend/lowering/lower-modules.js +655 -329
  751. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  752. package/dist/frontend/lowering/lower-modules.test.js +91 -20
  753. package/dist/frontend/lowering/lower-modules.test.js.map +1 -1
  754. package/dist/frontend/lowering/lower-namespaces.js +25 -8
  755. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  756. package/dist/frontend/lowering/lower-node-module.js +115 -34
  757. package/dist/frontend/lowering/lower-node-module.js.map +1 -1
  758. package/dist/frontend/lowering/lower-server.js +1210 -290
  759. package/dist/frontend/lowering/lower-server.js.map +1 -1
  760. package/dist/frontend/lowering/lower-stmts.d.ts +148 -148
  761. package/dist/frontend/lowering/lower-stmts.js +2324 -994
  762. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  763. package/dist/frontend/lowering/lower-stmts.test.js +13 -5
  764. package/dist/frontend/lowering/lower-stmts.test.js.map +1 -1
  765. package/dist/frontend/lowering/lower-stream.js +363 -91
  766. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  767. package/dist/frontend/lowering/lower-system-errors.js +30 -8
  768. package/dist/frontend/lowering/lower-system-errors.js.map +1 -1
  769. package/dist/frontend/lowering/lower-test.js +40 -13
  770. package/dist/frontend/lowering/lower-test.js.map +1 -1
  771. package/dist/frontend/lowering/lower-timers.d.ts +31 -0
  772. package/dist/frontend/lowering/lower-timers.js +336 -0
  773. package/dist/frontend/lowering/lower-timers.js.map +1 -0
  774. package/dist/frontend/lowering/lower-url.d.ts +1 -1
  775. package/dist/frontend/lowering/lower-url.js +46 -13
  776. package/dist/frontend/lowering/lower-url.js.map +1 -1
  777. package/dist/frontend/lowering/lowerer.d.ts +34 -352
  778. package/dist/frontend/lowering/lowerer.js +1074 -2712
  779. package/dist/frontend/lowering/lowerer.js.map +1 -1
  780. package/dist/frontend/lowering/lowerer.test.js +85 -17
  781. package/dist/frontend/lowering/lowerer.test.js.map +1 -1
  782. package/dist/frontend/lowering/module-namespace-elements.js +43 -8
  783. package/dist/frontend/lowering/module-namespace-elements.js.map +1 -1
  784. package/dist/frontend/lowering/native-ffi.d.ts +21 -1
  785. package/dist/frontend/lowering/native-ffi.js +487 -18
  786. package/dist/frontend/lowering/native-ffi.js.map +1 -1
  787. package/dist/frontend/lowering/object-enumeration-receiver.js +55 -10
  788. package/dist/frontend/lowering/object-enumeration-receiver.js.map +1 -1
  789. package/dist/frontend/lowering/object-factory-new.d.ts +1 -1
  790. package/dist/frontend/lowering/object-factory-new.js +36 -11
  791. package/dist/frontend/lowering/object-factory-new.js.map +1 -1
  792. package/dist/frontend/lowering/optional-arguments.js +49 -20
  793. package/dist/frontend/lowering/optional-arguments.js.map +1 -1
  794. package/dist/frontend/lowering/pairs-snapshot.js +66 -14
  795. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -1
  796. package/dist/frontend/lowering/runtime-optional-locals.js +3 -1
  797. package/dist/frontend/lowering/runtime-optional-locals.js.map +1 -1
  798. package/dist/frontend/lowering/runtime-optional-locals.test.js.map +1 -1
  799. package/dist/frontend/lowering/sanitize-class-types.js +4 -1
  800. package/dist/frontend/lowering/sanitize-class-types.js.map +1 -1
  801. package/dist/frontend/lowering/sanitize-class-types.test.js +86 -18
  802. package/dist/frontend/lowering/sanitize-class-types.test.js.map +1 -1
  803. package/dist/frontend/lowering/split-consumers.d.ts +7 -0
  804. package/dist/frontend/lowering/split-consumers.js +64 -0
  805. package/dist/frontend/lowering/split-consumers.js.map +1 -0
  806. package/dist/frontend/lowering/static-this.js +13 -6
  807. package/dist/frontend/lowering/static-this.js.map +1 -1
  808. package/dist/frontend/lowering/string-index.js +32 -10
  809. package/dist/frontend/lowering/string-index.js.map +1 -1
  810. package/dist/frontend/lowering/surfaces.d.ts +45 -46
  811. package/dist/frontend/lowering/surfaces.js +1129 -256
  812. package/dist/frontend/lowering/surfaces.js.map +1 -1
  813. package/dist/frontend/lowering/symbol-fields.js +40 -15
  814. package/dist/frontend/lowering/symbol-fields.js.map +1 -1
  815. package/dist/frontend/lowering/symbol-methods.js.map +1 -1
  816. package/dist/frontend/lowering/text-decoder-encoding.js +236 -24
  817. package/dist/frontend/lowering/text-decoder-encoding.js.map +1 -1
  818. package/dist/frontend/lowering/text-decoder-encoding.test.js +84 -12
  819. package/dist/frontend/lowering/text-decoder-encoding.test.js.map +1 -1
  820. package/dist/frontend/lowering/union-narrow.js +59 -16
  821. package/dist/frontend/lowering/union-narrow.js.map +1 -1
  822. package/dist/frontend/lowering/union-narrow.test.js +24 -7
  823. package/dist/frontend/lowering/union-narrow.test.js.map +1 -1
  824. package/dist/frontend/lowering/union-retag.js +155 -40
  825. package/dist/frontend/lowering/union-retag.js.map +1 -1
  826. package/dist/frontend/lowering/union-retag.test.js +131 -33
  827. package/dist/frontend/lowering/union-retag.test.js.map +1 -1
  828. package/dist/frontend/lowering/unregistered-class-types.js.map +1 -1
  829. package/dist/frontend/lowering/unregistered-class-types.test.js +34 -8
  830. package/dist/frontend/lowering/unregistered-class-types.test.js.map +1 -1
  831. package/dist/frontend/module-source-candidates.d.ts +10 -0
  832. package/dist/frontend/module-source-candidates.js +40 -0
  833. package/dist/frontend/module-source-candidates.js.map +1 -0
  834. package/dist/frontend/module-source-candidates.test.d.ts +1 -0
  835. package/dist/frontend/module-source-candidates.test.js +53 -0
  836. package/dist/frontend/module-source-candidates.test.js.map +1 -0
  837. package/dist/frontend/module-syntax.js +21 -8
  838. package/dist/frontend/module-syntax.js.map +1 -1
  839. package/dist/frontend/module-syntax.test.js +37 -13
  840. package/dist/frontend/module-syntax.test.js.map +1 -1
  841. package/dist/frontend/npm-fetch-analysis.js +13 -4
  842. package/dist/frontend/npm-fetch-analysis.js.map +1 -1
  843. package/dist/frontend/npm-fetch-analysis.test.js +33 -10
  844. package/dist/frontend/npm-fetch-analysis.test.js.map +1 -1
  845. package/dist/frontend/npm-fetch-node.js.map +1 -1
  846. package/dist/frontend/npm-fetch-syntax.js +4 -9
  847. package/dist/frontend/npm-fetch-syntax.js.map +1 -1
  848. package/dist/frontend/npm-node.js +3 -1
  849. package/dist/frontend/npm-node.js.map +1 -1
  850. package/dist/frontend/npm-static-bundled-cjs.js +88 -29
  851. package/dist/frontend/npm-static-bundled-cjs.js.map +1 -1
  852. package/dist/frontend/npm-static-bundled-cjs.test.js +29 -10
  853. package/dist/frontend/npm-static-bundled-cjs.test.js.map +1 -1
  854. package/dist/frontend/npm-static-declaration-syntax.js +148 -56
  855. package/dist/frontend/npm-static-declaration-syntax.js.map +1 -1
  856. package/dist/frontend/npm-static-declarations.d.ts +1 -1
  857. package/dist/frontend/npm-static-declarations.js.map +1 -1
  858. package/dist/frontend/npm-static-declarations.test.js +33 -7
  859. package/dist/frontend/npm-static-declarations.test.js.map +1 -1
  860. package/dist/frontend/npm-static-prune.js +26 -12
  861. package/dist/frontend/npm-static-prune.js.map +1 -1
  862. package/dist/frontend/npm-static-prune.test.js +17 -3
  863. package/dist/frontend/npm-static-prune.test.js.map +1 -1
  864. package/dist/frontend/npm-static-rewrite-host.js +2 -3
  865. package/dist/frontend/npm-static-rewrite-host.js.map +1 -1
  866. package/dist/frontend/npm-static-rewrite-syntax.js +64 -21
  867. package/dist/frontend/npm-static-rewrite-syntax.js.map +1 -1
  868. package/dist/frontend/npm-static-rewrite.js.map +1 -1
  869. package/dist/frontend/npm-static-subtyping.js +9 -4
  870. package/dist/frontend/npm-static-subtyping.js.map +1 -1
  871. package/dist/frontend/npm-static-subtyping.test.js +30 -6
  872. package/dist/frontend/npm-static-subtyping.test.js.map +1 -1
  873. package/dist/frontend/npm-static.js +15 -4
  874. package/dist/frontend/npm-static.js.map +1 -1
  875. package/dist/frontend/npm.js +122 -36
  876. package/dist/frontend/npm.js.map +1 -1
  877. package/dist/frontend/npm.test.js +30 -10
  878. package/dist/frontend/npm.test.js.map +1 -1
  879. package/dist/frontend/pipeline-native.js.map +1 -1
  880. package/dist/frontend/pipeline.js +25 -8
  881. package/dist/frontend/pipeline.js.map +1 -1
  882. package/dist/frontend/pipeline.test.js +21 -7
  883. package/dist/frontend/pipeline.test.js.map +1 -1
  884. package/dist/frontend/program-analysis.d.ts +2 -0
  885. package/dist/frontend/program-analysis.js +2 -0
  886. package/dist/frontend/program-analysis.js.map +1 -1
  887. package/dist/frontend/program-node.js +5 -3
  888. package/dist/frontend/program-node.js.map +1 -1
  889. package/dist/frontend/program.d.ts +2 -2
  890. package/dist/frontend/program.js +248 -127
  891. package/dist/frontend/program.js.map +1 -1
  892. package/dist/frontend/program.test.js +27 -27
  893. package/dist/frontend/program.test.js.map +1 -1
  894. package/dist/frontend/provenance-core.js +8 -4
  895. package/dist/frontend/provenance-core.js.map +1 -1
  896. package/dist/frontend/provenance-registry.js +1 -4
  897. package/dist/frontend/provenance-registry.js.map +1 -1
  898. package/dist/frontend/resolve.js +32 -20
  899. package/dist/frontend/resolve.js.map +1 -1
  900. package/dist/frontend/resolve.test.js +1 -1
  901. package/dist/frontend/resolve.test.js.map +1 -1
  902. package/dist/frontend/runtime-resolve.js +13 -4
  903. package/dist/frontend/runtime-resolve.js.map +1 -1
  904. package/dist/frontend/runtime-resolve.test.js +25 -9
  905. package/dist/frontend/runtime-resolve.test.js.map +1 -1
  906. package/dist/frontend/services-node.js +6 -2
  907. package/dist/frontend/services-node.js.map +1 -1
  908. package/dist/frontend/services-node.test.js +18 -6
  909. package/dist/frontend/services-node.test.js.map +1 -1
  910. package/dist/frontend/services.js +8 -4
  911. package/dist/frontend/services.js.map +1 -1
  912. package/dist/frontend/services.test.js +6 -2
  913. package/dist/frontend/services.test.js.map +1 -1
  914. package/dist/frontend/ts7/api.js +12 -4
  915. package/dist/frontend/ts7/api.js.map +1 -1
  916. package/dist/frontend/ts7/ast-bytes.js +10 -3
  917. package/dist/frontend/ts7/ast-bytes.js.map +1 -1
  918. package/dist/frontend/ts7/ast-bytes.test.js +23 -4
  919. package/dist/frontend/ts7/ast-bytes.test.js.map +1 -1
  920. package/dist/frontend/ts7/ast-guards.test.js +14 -5
  921. package/dist/frontend/ts7/ast-guards.test.js.map +1 -1
  922. package/dist/frontend/ts7/ast-node.d.ts +6 -1
  923. package/dist/frontend/ts7/ast-node.js +490 -172
  924. package/dist/frontend/ts7/ast-node.js.map +1 -1
  925. package/dist/frontend/ts7/ast-node.test.js +150 -36
  926. package/dist/frontend/ts7/ast-node.test.js.map +1 -1
  927. package/dist/frontend/ts7/ast-text.js +13 -3
  928. package/dist/frontend/ts7/ast-text.js.map +1 -1
  929. package/dist/frontend/ts7/ast-text.test.js.map +1 -1
  930. package/dist/frontend/ts7/ast-types.js.map +1 -1
  931. package/dist/frontend/ts7/ast-wire.d.ts +5 -1
  932. package/dist/frontend/ts7/ast-wire.js +83 -20
  933. package/dist/frontend/ts7/ast-wire.js.map +1 -1
  934. package/dist/frontend/ts7/ast-wire.test.js +53 -8
  935. package/dist/frontend/ts7/ast-wire.test.js.map +1 -1
  936. package/dist/frontend/ts7/ast.d.ts +2 -1
  937. package/dist/frontend/ts7/ast.js +53 -30
  938. package/dist/frontend/ts7/ast.js.map +1 -1
  939. package/dist/frontend/ts7/census-check.js +1 -1
  940. package/dist/frontend/ts7/census-check.js.map +1 -1
  941. package/dist/frontend/ts7/checker-cache.js.map +1 -1
  942. package/dist/frontend/ts7/checker.d.ts +8 -2
  943. package/dist/frontend/ts7/checker.js +46 -8
  944. package/dist/frontend/ts7/checker.js.map +1 -1
  945. package/dist/frontend/ts7/checker.test.js +96 -17
  946. package/dist/frontend/ts7/checker.test.js.map +1 -1
  947. package/dist/frontend/ts7/enums.test.js +9 -4
  948. package/dist/frontend/ts7/enums.test.js.map +1 -1
  949. package/dist/frontend/ts7/native-api.js.map +1 -1
  950. package/dist/frontend/ts7/native-host.js.map +1 -1
  951. package/dist/frontend/ts7/native-process.js +9 -3
  952. package/dist/frontend/ts7/native-process.js.map +1 -1
  953. package/dist/frontend/ts7/program-adapter.js +1 -1
  954. package/dist/frontend/ts7/program-adapter.js.map +1 -1
  955. package/dist/frontend/ts7/program-host.d.ts +7 -0
  956. package/dist/frontend/ts7/program-host.js +33 -6
  957. package/dist/frontend/ts7/program-host.js.map +1 -1
  958. package/dist/frontend/ts7/program-host.test.js +72 -11
  959. package/dist/frontend/ts7/program-host.test.js.map +1 -1
  960. package/dist/frontend/ts7/rpc-api.js +3 -1
  961. package/dist/frontend/ts7/rpc-api.js.map +1 -1
  962. package/dist/frontend/ts7/rpc-client.js +15 -5
  963. package/dist/frontend/ts7/rpc-client.js.map +1 -1
  964. package/dist/frontend/ts7/rpc-client.test.js +26 -8
  965. package/dist/frontend/ts7/rpc-client.test.js.map +1 -1
  966. package/dist/frontend/ts7/rpc-filesystem.js.map +1 -1
  967. package/dist/frontend/ts7/rpc-filesystem.test.js +43 -10
  968. package/dist/frontend/ts7/rpc-filesystem.test.js.map +1 -1
  969. package/dist/frontend/ts7/rpc-process.js +16 -6
  970. package/dist/frontend/ts7/rpc-process.js.map +1 -1
  971. package/dist/frontend/ts7/rpc-process.test.js.map +1 -1
  972. package/dist/frontend/ts7/rpc-wire.d.ts +1 -0
  973. package/dist/frontend/ts7/rpc-wire.js +41 -14
  974. package/dist/frontend/ts7/rpc-wire.js.map +1 -1
  975. package/dist/frontend/ts7/rpc-wire.test.js +36 -6
  976. package/dist/frontend/ts7/rpc-wire.test.js.map +1 -1
  977. package/dist/frontend/ts7/semantic-checker.js +209 -68
  978. package/dist/frontend/ts7/semantic-checker.js.map +1 -1
  979. package/dist/frontend/ts7/semantic-checker.test.js +29 -14
  980. package/dist/frontend/ts7/semantic-checker.test.js.map +1 -1
  981. package/dist/frontend/ts7/semantic-json.js +7 -1
  982. package/dist/frontend/ts7/semantic-json.js.map +1 -1
  983. package/dist/frontend/ts7/semantic-json.test.js +17 -3
  984. package/dist/frontend/ts7/semantic-json.test.js.map +1 -1
  985. package/dist/frontend/ts7/semantic-model.js +147 -51
  986. package/dist/frontend/ts7/semantic-model.js.map +1 -1
  987. package/dist/frontend/ts7/semantic-model.test.js +72 -19
  988. package/dist/frontend/ts7/semantic-model.test.js.map +1 -1
  989. package/dist/frontend/ts7/semantic-types.d.ts +2 -2
  990. package/dist/frontend/ts7/session-cache.js +10 -3
  991. package/dist/frontend/ts7/session-cache.js.map +1 -1
  992. package/dist/frontend/ts7/session-cache.test.js +13 -4
  993. package/dist/frontend/ts7/session-cache.test.js.map +1 -1
  994. package/dist/frontend/ts7/session-path.js +25 -10
  995. package/dist/frontend/ts7/session-path.js.map +1 -1
  996. package/dist/frontend/ts7/session-path.test.js +47 -4
  997. package/dist/frontend/ts7/session-path.test.js.map +1 -1
  998. package/dist/frontend/ts7/session-timing.js +22 -3
  999. package/dist/frontend/ts7/session-timing.js.map +1 -1
  1000. package/dist/frontend/ts7/session-timing.test.js +12 -3
  1001. package/dist/frontend/ts7/session-timing.test.js.map +1 -1
  1002. package/dist/frontend/ts7/session.d.ts +1 -0
  1003. package/dist/frontend/ts7/session.js +109 -35
  1004. package/dist/frontend/ts7/session.js.map +1 -1
  1005. package/dist/frontend/ts7/session.test.js +69 -15
  1006. package/dist/frontend/ts7/session.test.js.map +1 -1
  1007. package/dist/frontend/ts7/source-parser.js +17 -6
  1008. package/dist/frontend/ts7/source-parser.js.map +1 -1
  1009. package/dist/frontend/ts7/source-parser.test.js +32 -9
  1010. package/dist/frontend/ts7/source-parser.test.js.map +1 -1
  1011. package/dist/frontend/tsc-codes.js +56 -11
  1012. package/dist/frontend/tsc-codes.js.map +1 -1
  1013. package/dist/frontend/tsc-codes.test.d.ts +1 -0
  1014. package/dist/frontend/tsc-codes.test.js +16 -0
  1015. package/dist/frontend/tsc-codes.test.js.map +1 -0
  1016. package/dist/frontend/type-mapper.d.ts +3 -0
  1017. package/dist/frontend/type-mapper.js +589 -206
  1018. package/dist/frontend/type-mapper.js.map +1 -1
  1019. package/dist/frontend/type-mapper.test.js +108 -33
  1020. package/dist/frontend/type-mapper.test.js.map +1 -1
  1021. package/dist/frontend/union-discriminants.js +8 -2
  1022. package/dist/frontend/union-discriminants.js.map +1 -1
  1023. package/dist/frontend/union-discriminants.test.js +77 -20
  1024. package/dist/frontend/union-discriminants.test.js.map +1 -1
  1025. package/dist/frontend/worker-target.d.ts +6 -0
  1026. package/dist/frontend/worker-target.js +108 -0
  1027. package/dist/frontend/worker-target.js.map +1 -0
  1028. package/dist/frontend/worker-target.test.d.ts +1 -0
  1029. package/dist/frontend/worker-target.test.js +71 -0
  1030. package/dist/frontend/worker-target.test.js.map +1 -0
  1031. package/dist/index.d.ts +9 -8
  1032. package/dist/index.js +174 -88
  1033. package/dist/index.js.map +1 -1
  1034. package/dist/ir/analysis.js +95 -38
  1035. package/dist/ir/analysis.js.map +1 -1
  1036. package/dist/ir/analysis.test.js +91 -15
  1037. package/dist/ir/analysis.test.js.map +1 -1
  1038. package/dist/ir/api.d.ts +4 -0
  1039. package/dist/ir/api.js +6 -0
  1040. package/dist/ir/api.js.map +1 -0
  1041. package/dist/ir/build.d.ts +7 -0
  1042. package/dist/ir/build.js +27 -1
  1043. package/dist/ir/build.js.map +1 -1
  1044. package/dist/ir/builtin-effects.d.ts +9 -0
  1045. package/dist/ir/builtin-effects.js +643 -0
  1046. package/dist/ir/builtin-effects.js.map +1 -0
  1047. package/dist/ir/builtin-signatures.d.ts +15 -0
  1048. package/dist/ir/builtin-signatures.js +3397 -0
  1049. package/dist/ir/builtin-signatures.js.map +1 -0
  1050. package/dist/ir/byte-numbers.js +67 -16
  1051. package/dist/ir/byte-numbers.js.map +1 -1
  1052. package/dist/ir/byte-numbers.test.js +17 -4
  1053. package/dist/ir/byte-numbers.test.js.map +1 -1
  1054. package/dist/ir/constant-tables.js +13 -5
  1055. package/dist/ir/constant-tables.js.map +1 -1
  1056. package/dist/ir/constant-tables.test.js +47 -7
  1057. package/dist/ir/constant-tables.test.js.map +1 -1
  1058. package/dist/ir/control-flow.js +2 -1
  1059. package/dist/ir/control-flow.js.map +1 -1
  1060. package/dist/ir/control-flow.test.js +35 -11
  1061. package/dist/ir/control-flow.test.js.map +1 -1
  1062. package/dist/ir/initializer-bindings.d.ts +9 -0
  1063. package/dist/ir/initializer-bindings.js +115 -0
  1064. package/dist/ir/initializer-bindings.js.map +1 -0
  1065. package/dist/ir/initializer-bindings.test.d.ts +1 -0
  1066. package/dist/ir/initializer-bindings.test.js +118 -0
  1067. package/dist/ir/initializer-bindings.test.js.map +1 -0
  1068. package/dist/ir/integer-loop-facts.d.ts +12 -0
  1069. package/dist/ir/integer-loop-facts.js +137 -0
  1070. package/dist/ir/integer-loop-facts.js.map +1 -0
  1071. package/dist/ir/integer-loops.js +85 -30
  1072. package/dist/ir/integer-loops.js.map +1 -1
  1073. package/dist/ir/integer-loops.test.js +76 -13
  1074. package/dist/ir/integer-loops.test.js.map +1 -1
  1075. package/dist/ir/integer-ranges.js +93 -21
  1076. package/dist/ir/integer-ranges.js.map +1 -1
  1077. package/dist/ir/integer-ranges.test.js +199 -21
  1078. package/dist/ir/integer-ranges.test.js.map +1 -1
  1079. package/dist/ir/intrinsic-signatures.d.ts +20 -0
  1080. package/dist/ir/intrinsic-signatures.js +57 -0
  1081. package/dist/ir/intrinsic-signatures.js.map +1 -0
  1082. package/dist/ir/ir.d.ts +15 -2160
  1083. package/dist/ir/ir.js +160 -1396
  1084. package/dist/ir/ir.js.map +1 -1
  1085. package/dist/ir/ir.test.js +98 -77
  1086. package/dist/ir/ir.test.js.map +1 -1
  1087. package/dist/ir/numeric-call-specialization.d.ts +8 -0
  1088. package/dist/ir/numeric-call-specialization.js +198 -0
  1089. package/dist/ir/numeric-call-specialization.js.map +1 -0
  1090. package/dist/ir/runtime-features.d.ts +221 -0
  1091. package/dist/ir/runtime-features.js +552 -0
  1092. package/dist/ir/runtime-features.js.map +1 -0
  1093. package/dist/ir/runtime-features.test.d.ts +1 -0
  1094. package/dist/ir/runtime-features.test.js +98 -0
  1095. package/dist/ir/runtime-features.test.js.map +1 -0
  1096. package/dist/ir/scalar-records.js +130 -40
  1097. package/dist/ir/scalar-records.js.map +1 -1
  1098. package/dist/ir/scalar-records.test.js +146 -27
  1099. package/dist/ir/scalar-records.test.js.map +1 -1
  1100. package/dist/ir/serialize.d.ts +1 -1
  1101. package/dist/ir/serialize.js +7 -5
  1102. package/dist/ir/serialize.js.map +1 -1
  1103. package/dist/ir/serialize.test.js +44 -9
  1104. package/dist/ir/serialize.test.js.map +1 -1
  1105. package/dist/ir/traverse.js +156 -43
  1106. package/dist/ir/traverse.js.map +1 -1
  1107. package/dist/ir/traverse.test.js +99 -24
  1108. package/dist/ir/traverse.test.js.map +1 -1
  1109. package/dist/ir/validate.d.ts +1 -31
  1110. package/dist/ir/validate.js +869 -1910
  1111. package/dist/ir/validate.js.map +1 -1
  1112. package/dist/ir/validate.test.js +697 -114
  1113. package/dist/ir/validate.test.js.map +1 -1
  1114. package/dist/library/cache-primitives.js +9 -10
  1115. package/dist/library/cache-primitives.js.map +1 -1
  1116. package/dist/library/cache-reset.test.js +2 -1
  1117. package/dist/library/cache-reset.test.js.map +1 -1
  1118. package/dist/library/compiler-self-identity.js +11 -5
  1119. package/dist/library/compiler-self-identity.js.map +1 -1
  1120. package/dist/library/compiler-self-identity.test.js +10 -3
  1121. package/dist/library/compiler-self-identity.test.js.map +1 -1
  1122. package/dist/library/fence-eval.js +24 -7
  1123. package/dist/library/fence-eval.js.map +1 -1
  1124. package/dist/library/fence-eval.test.js +31 -7
  1125. package/dist/library/fence-eval.test.js.map +1 -1
  1126. package/dist/library/int-infer.js +199 -59
  1127. package/dist/library/int-infer.js.map +1 -1
  1128. package/dist/library/int-infer.test.js +137 -61
  1129. package/dist/library/int-infer.test.js.map +1 -1
  1130. package/dist/library/ir-policy.d.ts +27 -0
  1131. package/dist/library/ir-policy.js +234 -0
  1132. package/dist/library/ir-policy.js.map +1 -0
  1133. package/dist/library/library-cache.js +40 -17
  1134. package/dist/library/library-cache.js.map +1 -1
  1135. package/dist/library/library-cache.test.js +29 -18
  1136. package/dist/library/library-cache.test.js.map +1 -1
  1137. package/dist/library/library-profile.js +68 -13
  1138. package/dist/library/library-profile.js.map +1 -1
  1139. package/dist/library/prepare.js +48 -20
  1140. package/dist/library/prepare.js.map +1 -1
  1141. package/dist/library/semantic-source.js +16 -14
  1142. package/dist/library/semantic-source.js.map +1 -1
  1143. package/dist/library/semantic-source.test.js +9 -14
  1144. package/dist/library/semantic-source.test.js.map +1 -1
  1145. package/dist/library/sidecar-validate.js +53 -12
  1146. package/dist/library/sidecar-validate.js.map +1 -1
  1147. package/dist/library/sidecar.js +85 -24
  1148. package/dist/library/sidecar.js.map +1 -1
  1149. package/dist/library/trap-teaching.js +11 -2
  1150. package/dist/library/trap-teaching.js.map +1 -1
  1151. package/dist/native/cache.js +10 -4
  1152. package/dist/native/cache.js.map +1 -1
  1153. package/dist/native/cli.js +34 -9
  1154. package/dist/native/cli.js.map +1 -1
  1155. package/dist/native/compiler.js +191 -54
  1156. package/dist/native/compiler.js.map +1 -1
  1157. package/dist/native/compiler.test.js +134 -33
  1158. package/dist/native/compiler.test.js.map +1 -1
  1159. package/dist/native/comptime.js +23 -7
  1160. package/dist/native/comptime.js.map +1 -1
  1161. package/dist/native/comptime.test.js +26 -6
  1162. package/dist/native/comptime.test.js.map +1 -1
  1163. package/dist/native/executable-cache.js +77 -27
  1164. package/dist/native/executable-cache.js.map +1 -1
  1165. package/dist/native/executable-cache.test.js +41 -6
  1166. package/dist/native/executable-cache.test.js.map +1 -1
  1167. package/dist/native/file-identity.js +9 -2
  1168. package/dist/native/file-identity.js.map +1 -1
  1169. package/dist/native/file-identity.test.js.map +1 -1
  1170. package/dist/native/library.js +50 -12
  1171. package/dist/native/library.js.map +1 -1
  1172. package/dist/native/prepare.js +121 -34
  1173. package/dist/native/prepare.js.map +1 -1
  1174. package/dist/native/prepare.test.js +22 -6
  1175. package/dist/native/prepare.test.js.map +1 -1
  1176. package/dist/native/runtime-typescript.js +24 -11
  1177. package/dist/native/runtime-typescript.js.map +1 -1
  1178. package/dist/native/runtime-typescript.test.js.map +1 -1
  1179. package/dist/native/sanitizer.js +71 -18
  1180. package/dist/native/sanitizer.js.map +1 -1
  1181. package/dist/native/sanitizer.test.js +78 -20
  1182. package/dist/native/sanitizer.test.js.map +1 -1
  1183. package/dist/native/task.js.map +1 -1
  1184. package/dist/native/task.test.js +7 -2
  1185. package/dist/native/task.test.js.map +1 -1
  1186. package/dist/native/toolchain.js +68 -26
  1187. package/dist/native/toolchain.js.map +1 -1
  1188. package/dist/native/toolchain.test.js +59 -20
  1189. package/dist/native/toolchain.test.js.map +1 -1
  1190. package/dist/startup-cache.d.ts +1 -1
  1191. package/dist/startup-cache.js +1 -1
  1192. package/dist/startup-cache.js.map +1 -1
  1193. package/dist/timing.js.map +1 -1
  1194. package/package.json +20 -20
  1195. package/surface-manifest.json +30 -2
  1196. package/dist/frontend/lowering/lower-builtins.d.ts +0 -601
  1197. package/dist/frontend/lowering/lower-builtins.js +0 -8986
  1198. package/dist/frontend/lowering/lower-builtins.js.map +0 -1
  1199. package/dist/frontend/lowering/lower-containers.d.ts +0 -382
  1200. package/dist/frontend/lowering/lower-containers.js +0 -7344
  1201. package/dist/frontend/lowering/lower-containers.js.map +0 -1
@@ -0,0 +1,3397 @@
1
+ import { BIGINT_T } from "./ir.js";
2
+ import { arrayOf, BOOL, BYTES_U8, bytesOf, CHILD_T, CHILDSTREAM_T, CHILDWRITER_T, CRYPTOHASH_T, CRYPTOHMAC_T, DATE_T, DGRAMSOCK_T, DYN, F64, FILEHANDLE_T, FSWATCHER_T, HTTP2SESSION_T, HTTP2STREAM_T, HTTPCLIENTREQ_T, HTTPREQ_T, HTTPRES_T, JSVAL, NETSERVER_T, NETSOCKET_T, PROCSTREAM_T, REGEX, SEARCH_PARAMS_T, SECURECTX_T, SPAWNRES_T, STATS_T, STRING, SYMBOL_T, TESTCTX_T, URL_T, VOID, } from "./ir.js";
3
+ /** Preserve the closed names while giving every entry the same slot type. */
4
+ function defineLibFnSignatures(signatures) {
5
+ return signatures;
6
+ }
7
+ /** The closed native builtin call surface. Keep a call's semantics and ABI
8
+ * together here; frontend coercion and IR validation consume the same table.
9
+ * All arguments are required. Lowering supplies optional-source defaults
10
+ * before this boundary and preserves their evaluation order. */
11
+ export const LIB_FN_SIGS = defineLibFnSignatures({
12
+ /** Native static fetch and its Web-platform companions. fetch.start
13
+ * answers once the response head arrives; the response body readers
14
+ * consume the native body stream. AbortSignal and ReadableStream values
15
+ * are opaque checked-dynamic handles. */
16
+ "fetch.start": { argTypes: [STRING, DYN], result: { kind: "promise", inner: DYN } },
17
+ "fetch.responseNew": { argTypes: [DYN, DYN], result: DYN },
18
+ "fetch.input": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
19
+ "abort.controllerNew": { argTypes: [], result: DYN },
20
+ "abort.timeout": { argTypes: [DYN], result: DYN },
21
+ "abort.now": { argTypes: [DYN], result: DYN },
22
+ "abort.any": { argTypes: [DYN], result: DYN },
23
+ "fetch.function": { argTypes: [], result: DYN },
24
+ "fetch.requestNew": { argTypes: [DYN, DYN], result: DYN },
25
+ "fetch.headersNew": { argTypes: [DYN], result: DYN },
26
+ "fetch.responseArrayBuffer": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
27
+ "fetch.responseJson": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
28
+ "fetch.responseText": { argTypes: [DYN], result: { kind: "promise", inner: STRING } },
29
+ "fetch.responseBytes": { argTypes: [DYN], result: { kind: "promise", inner: BYTES_U8 } },
30
+ "fetch.abortControllerNew": { argTypes: [], result: DYN },
31
+ "fetch.abortTimeout": { argTypes: [DYN], result: DYN },
32
+ "fetch.abortNow": { argTypes: [DYN], result: DYN },
33
+ "fetch.abortAny": { argTypes: [DYN], result: DYN },
34
+ "fetch.streamNew": { argTypes: [DYN], result: DYN },
35
+ // Program-dependent iterable: typed arrays/bytes/string stay intact so
36
+ // the native stream can pull lazily; checked-dynamic values are the
37
+ // fallback. The libCall validator in validate.ts checks the closed set.
38
+ "fetch.webIs": { argTypes: [DYN, STRING], result: BOOL },
39
+ "fetch.streamIs": { argTypes: [DYN], result: BOOL },
40
+ "fetch.streamFrom": { argTypes: [null], result: DYN },
41
+ // The chunk/result record depends on ReadableStream<T>; validated by validate.ts.
42
+ "fetch.readerRead": { argTypes: [DYN], result: VOID },
43
+ "island.eval": { argTypes: [STRING], result: STRING },
44
+ /** Load an embedded npm package's runtime entry in the island (cached by
45
+ * the engine's module registry) and take one export: args are the entry
46
+ * KEY (an embedded module's key, from IrModule.embedded) and the export
47
+ * name — "default" for default imports, "*" for the namespace object.
48
+ * --dynamic only, like island.eval; result is an owned jsval. May throw
49
+ * (a package's top-level code can), bridged catchably. */
50
+ "island.import": { argTypes: [STRING, STRING, STRING], result: JSVAL },
51
+ /** Dynamic `import(spec)`: load a module through the island's module
52
+ * system — an embedded module's key or a builtin shim's "node:x" key —
53
+ * and answer an ENGINE promise of its namespace object (always a
54
+ * promise, never a throw: load and evaluation failures REJECT it,
55
+ * Node's shape). The frontend wraps the result in jsBridgePromise, so
56
+ * awaiting parks the fiber and a rejection crosses catchably. --dynamic
57
+ * only; result is an owned jsval holding the engine promise. */
58
+ "island.importDyn": { argTypes: [STRING], result: JSVAL },
59
+ // Result is the cast's mapped PROMISE target (program-dependent) —
60
+ // checked in the libCall case, like error.new.
61
+ /** A checked cast the boundary can never satisfy, DEFERRED to runtime:
62
+ * `islandValue as Promise<T>` — the value is an ENGINE promise and T
63
+ * has no validated exit (Node-typed async APIs put class-shaped
64
+ * interfaces there), so instead of refusing the build the cast throws a
65
+ * catchable TypeError AT THE CAST naming the target type (args: the
66
+ * island value — evaluated, borrowed — and the type name). The result
67
+ * type is the cast's mapped target (a typed dummy; the exception is
68
+ * pending). Documented divergence: JS `as` never checks — like the dyn
69
+ * boundary, a conversion that cannot happen throws instead of lying.
70
+ * --dynamic only. */
71
+ "island.castFail": { argTypes: [JSVAL, STRING], result: VOID },
72
+ "json.parse": { argTypes: [STRING], result: DYN },
73
+ "json.parseReviver": { argTypes: [STRING, DYN], result: DYN },
74
+ "json.stringifyReplacer": { argTypes: [DYN, DYN, STRING], result: DYN },
75
+ "json.stringifyValue": { argTypes: [DYN, DYN, DYN], result: DYN },
76
+ /** Keyed WRITE on a dyn value — `h.onDone = cb` / `h["k"] = v` on a
77
+ * checked-dynamic object (args: receiver, key string, value — all
78
+ * borrowed; the runtime copies the key and retains the value in). An
79
+ * OBJ receiver sets the member (later writes win, insertion order
80
+ * preserved — JS exactly); undefined/null throws Node's catchable
81
+ * "Cannot set properties of undefined (setting 'k')"; every other kind
82
+ * throws Node's STRICT-mode "Cannot create property 'k' on <kind>" —
83
+ * primitives quoting their rendering, V8's "on number '5'"
84
+ * (sloppy mode would silently ignore — suite tests are 'use strict';
85
+ * SEMANTICS.md notes the sloppy divergence: loud, never silent). Void
86
+ * result; in the may-throw seed set. */
87
+ "dyn.keySet": { argTypes: [DYN, STRING, DYN], result: VOID },
88
+ "dyn.keySetComputed": { argTypes: [DYN, DYN, DYN], result: VOID },
89
+ /** Delete an ordinary checked-native object's own key. Borrows both
90
+ * arguments; other receiver representations retain a runtime refusal. */
91
+ "dyn.keyDelete": { argTypes: [DYN, STRING, BOOL], result: VOID },
92
+ "dyn.keyDeleteComputed": { argTypes: [DYN, DYN, BOOL], result: VOID },
93
+ "dyn.hasKeyComputed": { argTypes: [DYN, DYN], result: BOOL },
94
+ "dyn.hasOwnComputed": { argTypes: [DYN, DYN], result: BOOL },
95
+ "dyn.propertyIsEnumerableComputed": { argTypes: [DYN, DYN], result: BOOL },
96
+ /** Native own properties on globalThis keyed by symbol identity. */
97
+ "dyn.globalSymbolGet": { argTypes: [SYMBOL_T], result: DYN },
98
+ "dyn.globalSymbolSet": { argTypes: [SYMBOL_T, DYN], result: VOID },
99
+ "dyn.globalSymbolHas": { argTypes: [SYMBOL_T], result: BOOL },
100
+ "dyn.globalSymbolDelete": { argTypes: [SYMBOL_T], result: VOID },
101
+ /** Exact native class capsule identity, without materializing its fields. */
102
+ "dyn.typedRefIs": { argTypes: [DYN, STRING], result: BOOL },
103
+ "dyn.classIs": { argTypes: [DYN, STRING], result: BOOL },
104
+ /** Destructuring pack over a dyn source — `const [a, b] = d`, a
105
+ * destructured dyn callback param (args: the source and the STATIC
106
+ * TypeError spelling, "" when the source has none — both borrowed;
107
+ * result: a fresh dyn array, +1). Iterable kinds collect like spread
108
+ * (arrays element-by-element, strings by code point, bytes by byte);
109
+ * every other kind throws V8's destructuring TypeError — the spelling
110
+ * verbatim when non-empty, else the runtime kind wording ("number 5 is
111
+ * not iterable (cannot read property Symbol(Symbol.iterator))"). In the
112
+ * may-throw seed set. */
113
+ "dyn.iterPack": { argTypes: [DYN, STRING], result: DYN },
114
+ "dyn.arrayFromIterator": { argTypes: [DYN], result: DYN },
115
+ "dyn.iterator": { argTypes: [DYN, STRING], result: DYN },
116
+ "dyn.iteratorResult": { argTypes: [DYN], result: DYN },
117
+ "dyn.iteratorCanStep": { argTypes: [DYN, DYN], result: BOOL },
118
+ "dyn.iteratorStep": { argTypes: [DYN], result: DYN },
119
+ "dyn.iteratorStepDone": { argTypes: [DYN], result: BOOL },
120
+ "dyn.mapSeedEntries": { argTypes: [DYN], result: DYN },
121
+ "dyn.mapSeedEntry": { argTypes: [DYN], result: DYN },
122
+ /** The for-of-over-dyn pack accessors — the emitted index loop drives
123
+ * them over a dyn.iterPack result (ARR by construction). arrLen: the
124
+ * ARR length as f64 (0 for non-ARR kinds; arg borrowed). arrAt: the
125
+ * element at index (+1; the undefined singleton past the end). Neither
126
+ * throws. */
127
+ "dyn.arrLen": { argTypes: [DYN], result: F64 },
128
+ "dyn.arrAt": { argTypes: [DYN, F64], result: DYN },
129
+ /** `key in v` with a RUNTIME (string) key on a checked-dynamic
130
+ * receiver (args: value dyn, key string; result bool): OBJ answers
131
+ * own-member presence, ARR answers 'length'/a valid index — exactly
132
+ * the literal-key dynHasKey path. Proxy has traps may throw. */
133
+ "dyn.hasKey": { argTypes: [DYN, STRING], result: BOOL },
134
+ "dyn.freeze": { argTypes: [DYN], result: DYN },
135
+ "dyn.isFrozen": { argTypes: [DYN], result: BOOL },
136
+ "dyn.nativeSetNew": { argTypes: [DYN], result: DYN },
137
+ "dyn.nativeSetIs": { argTypes: [DYN], result: BOOL },
138
+ "dyn.nativeMapIs": { argTypes: [DYN], result: BOOL },
139
+ "dyn.nativeUrlIs": { argTypes: [DYN], result: BOOL },
140
+ "dyn.nativeDateIs": { argTypes: [DYN], result: BOOL },
141
+ "date.nativeNew": { argTypes: [DYN], result: DYN },
142
+ "date.checkedValue": { argTypes: [DYN], result: DATE_T },
143
+ "dyn.nativeRegexIs": { argTypes: [DYN], result: BOOL },
144
+ /** toString() on a checked-dynamic receiver: runtime kind dispatch
145
+ * (bytes decode per the literal encoding — utf8 default; strings,
146
+ * numbers, booleans, arrays, objects answer JS-exactly; undefined and
147
+ * null throw the catchable TypeError). */
148
+ "dyn.toString": { argTypes: [DYN, DYN, STRING], result: STRING },
149
+ /** Object.defineProperties over dyn values (args: target, descriptors —
150
+ * both borrowed dyn; result: the target, +1 — JS's return value).
151
+ * Value descriptors become own properties on OBJ and FUNC targets;
152
+ * OBJ targets preserve data attributes. get/set
153
+ * descriptors and non-object targets/descriptors throw catchably
154
+ * (Node's TypeError texts; accessors the loud unsupported Error). In
155
+ * the may-throw seed set. */
156
+ "dyn.defineProps": { argTypes: [DYN, DYN], result: DYN },
157
+ "dyn.defineProperty": { argTypes: [DYN, DYN, DYN], result: DYN },
158
+ "dyn.getOwnPropertyDescriptor": { argTypes: [DYN, DYN], result: DYN },
159
+ "dyn.arrayProtoCall": { argTypes: [DYN, STRING, DYN], result: DYN },
160
+ "dyn.promiseAll": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
161
+ /** Bare `typeof v` on a dyn value AS A STRING (arg: the dyn value,
162
+ * borrowed; result: an owned string) — the dyn kind's JS answer:
163
+ * undefined→"undefined", null/object/array/bytes→"object" (JS's oldest
164
+ * wart preserved), boolean/number/string by kind, function→"function".
165
+ * Never throws. */
166
+ "dyn.typeof": { argTypes: [DYN], result: STRING },
167
+ /** Object.prototype.toString.call on a checked-dynamic value. */
168
+ "dyn.objectTag": { argTypes: [DYN], result: STRING },
169
+ /** Engine-free CommonJS module graph. Module values are scalar f64
170
+ * handles; generated startup defines the registry, init wrappers update
171
+ * loading/cache state, and the read surface answers Node's live metadata. */
172
+ "module.registryInit": { argTypes: [F64], result: VOID },
173
+ "module.define": { argTypes: [F64, STRING, STRING, STRING, arrayOf(STRING), BOOL], result: VOID },
174
+ "module.enter": { argTypes: [F64], result: VOID },
175
+ "module.link": { argTypes: [F64, F64], result: VOID },
176
+ "module.finish": { argTypes: [F64], result: VOID },
177
+ "module.fail": { argTypes: [F64], result: VOID },
178
+ "module.filename": { argTypes: [F64], result: STRING },
179
+ "module.id": { argTypes: [F64], result: STRING },
180
+ "module.path": { argTypes: [F64], result: STRING },
181
+ "module.paths": { argTypes: [F64], result: arrayOf(STRING) },
182
+ "module.children": { argTypes: [F64], result: arrayOf(F64) },
183
+ "module.parent": { argTypes: [F64], result: F64 },
184
+ "module.loaded": { argTypes: [F64], result: BOOL },
185
+ "module.cacheGet": { argTypes: [STRING], result: F64 },
186
+ "module.cacheHas": { argTypes: [STRING], result: BOOL },
187
+ "module.cacheKeys": { argTypes: [], result: arrayOf(STRING) },
188
+ "timers.setTimeout": { argTypes: [{ kind: "func", params: [], ret: VOID }, F64], result: VOID },
189
+ /** The repeating timer pair. setInterval takes (callback, ms) like
190
+ * setTimeout and RETURNS the f64 handle the fallback declarations
191
+ * promise (ids start at 1, so truthiness narrowing works); the loop
192
+ * owns the callback until clearInterval removes the entry (eagerly — a
193
+ * live interval keeps the loop alive, a cleared one releases it, like
194
+ * Node). Neither throws; a throw ESCAPING an interval callback ends the
195
+ * program like a setTimeout throw. */
196
+ "timers.setInterval": { argTypes: [{ kind: "func", params: [], ret: VOID }, F64], result: F64 },
197
+ "timers.clearInterval": { argTypes: [F64], result: VOID },
198
+ /** setTimeout WITH a clear handle (the f64 id) — the clearable/unref-able
199
+ * one-shot; clearTimeout cancels it, .unref() drops it from loop
200
+ * liveness. The plain timers.setTimeout stays the handle-less
201
+ * fire-and-forget. */
202
+ "timers.setTimeoutHandle": {
203
+ argTypes: [{ kind: "func", params: [], ret: VOID }, F64],
204
+ result: F64,
205
+ },
206
+ "timers.clearTimeout": { argTypes: [F64], result: VOID },
207
+ /** Timeout.unref()/ref()/hasRef() — loop-liveness bookkeeping over the
208
+ * handle id. unref/ref RETURN the handle (f64) for chaining; hasRef
209
+ * returns bool. */
210
+ "timers.unref": { argTypes: [F64], result: F64 },
211
+ "timers.ref": { argTypes: [F64], result: F64 },
212
+ "timers.hasRef": { argTypes: [F64], result: BOOL },
213
+ /** Timeout.refresh() — re-arm to now + the original delay (from the
214
+ * heap or from inside the firing callback; a one-shot that fired on an
215
+ * earlier turn is gone and no-ops — documented divergence). Returns
216
+ * the handle for chaining like unref/ref. */
217
+ "timers.refresh": { argTypes: [F64], result: F64 },
218
+ /** setImmediate/clearImmediate — Node's check phase: callbacks run
219
+ * once per loop turn AFTER due timers, FIFO, and immediates queued
220
+ * mid-phase wait for the next turn. setImmediate returns the f64
221
+ * handle (its own id space — clearTimeout of an Immediate no-ops,
222
+ * like Node); the Immediate ref trio mirrors the Timeout one (an
223
+ * unref'd pending immediate neither keeps the loop alive nor fires
224
+ * once nothing reffed remains). */
225
+ "timers.setImmediate": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: F64 },
226
+ /** queueMicrotask (scr_async.c): the callback enters the SAME FIFO
227
+ * promise continuations ride — one microtask order, like V8's queue —
228
+ * and a throw is an UNCAUGHT exception (never a rejection).
229
+ * timers.queueMicrotask takes an owned zero-param closure and never
230
+ * throws; the Dyn form (checked-dynamic arguments — the mustCall
231
+ * wrapper, the suite's invalid-input probes) throws Node's
232
+ * ERR_INVALID_ARG_TYPE synchronously on a non-function value and calls
233
+ * the function with zero arguments at drain. */
234
+ "timers.queueMicrotask": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: VOID },
235
+ "timers.queueMicrotaskDyn": { argTypes: [DYN], result: VOID },
236
+ "timers.clearImmediate": { argTypes: [F64], result: VOID },
237
+ /** process.nextTick(cb, ...args) — the user tick queue. args: [cb
238
+ * (() => void; trailing call arguments ride the timer surface's
239
+ * interned dyn thunk)]. Ticks drain BEFORE promise jobs at every loop
240
+ * checkpoint, to joint exhaustion with them (Node's tick-then-
241
+ * microtask order); ticks enqueued by station listeners run at the
242
+ * NEXT checkpoint (the stream-tick station divergence, SEMANTICS.md).
243
+ * Pending ticks are always-ready work — the loop neither sleeps nor
244
+ * exits while any exist; ticks scheduled from 'exit' listeners never
245
+ * run (Node). The enqueue itself never throws. */
246
+ "process.nextTick": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: VOID },
247
+ /** The process introspection statics. uptime: seconds since the
248
+ * binary's own start (fractional — a load-time monotonic anchor).
249
+ * availableMemory/constrainedMemory: libuv's numbers (free-ish bytes;
250
+ * the cgroup cap or 0). cpuUser/cpuSystem (+ threadCpu twins): the
251
+ * process/thread CPU clocks in microseconds — the frontend composes
252
+ * the {user, system} records. The *Diff forms answer current − prev
253
+ * for one field; cpuPrevValidate throws Node's ERR_INVALID_ARG_VALUE
254
+ * RangeError for negative/non-finite prev fields (user first, then
255
+ * system — Node's order; MAY THROW). rusage(idx): one
256
+ * process.resourceUsage() field by canonical index (Node's units).
257
+ * activeResources: the loop's own bookkeeping — 'Timeout' per armed
258
+ * (or firing, uncleared) timer, 'Immediate' per queued unfired
259
+ * immediate; unmodeled resource kinds are absent (SEMANTICS.md). */
260
+ "process.uptime": { argTypes: [], result: F64 },
261
+ /** perf_hooks performance.now(): fractional ms since process start. */
262
+ "perf.now": { argTypes: [], result: F64 },
263
+ "process.availableMemory": { argTypes: [], result: F64 },
264
+ "process.constrainedMemory": { argTypes: [], result: F64 },
265
+ "process.cpuUser": { argTypes: [], result: F64 },
266
+ "process.cpuSystem": { argTypes: [], result: F64 },
267
+ "process.cpuUserDiff": { argTypes: [F64], result: F64 },
268
+ "process.cpuSystemDiff": { argTypes: [F64], result: F64 },
269
+ "process.threadCpuUser": { argTypes: [], result: F64 },
270
+ "process.threadCpuSystem": { argTypes: [], result: F64 },
271
+ "process.threadCpuUserDiff": { argTypes: [F64], result: F64 },
272
+ "process.threadCpuSystemDiff": { argTypes: [F64], result: F64 },
273
+ "process.cpuPrevValidate": { argTypes: [F64, F64], result: VOID },
274
+ "process.rusage": { argTypes: [F64], result: F64 },
275
+ "process.activeResources": { argTypes: [], result: arrayOf(STRING) },
276
+ "timers.immediateUnref": { argTypes: [F64], result: F64 },
277
+ "timers.immediateRef": { argTypes: [F64], result: F64 },
278
+ "timers.immediateHasRef": { argTypes: [F64], result: BOOL },
279
+ /** The tolerated non-handle clear (`clearTimeout(null)`,
280
+ * `clearInterval({})`, zero-argument forms): Node silently ignores
281
+ * anything that is not a live handle — a VOID no-op the emitter drops
282
+ * (only syntactically side-effect-free arguments take this path). */
283
+ "timers.clearNoop": { argTypes: [], result: VOID },
284
+ // Signal listeners are zero-param (the ambient shape); exit/stdin
285
+ // callbacks carry program-dependent one-param shapes — null slots, the
286
+ // libCall case checks them (child.onExit precedent).
287
+ /** Named process signal events: [name string, callback dyn, once bool]
288
+ * or [name, callback] for removal. The runtime resolves platform signal
289
+ * numbers and delivers (name, number). Listeners do not keep the loop
290
+ * alive. Invalid callbacks and uncatchable signals throw. */
291
+ "process.onSignal": { argTypes: [STRING, DYN, BOOL], result: VOID },
292
+ "process.offSignal": { argTypes: [STRING, DYN], result: VOID },
293
+ /** The process 'exit' event — process.on/once/off("exit"). args: [cb,
294
+ * once bool] / [cb]. Listeners run SYNCHRONOUSLY at termination
295
+ * (normal exit, process.exit(), the uncaught/unhandled exit-1 paths)
296
+ * with the exit code; anything they schedule never runs, like Node.
297
+ * Callback shapes: () => void or (code: number) => void — the emitter
298
+ * picks the runtime adapter. Never throw. */
299
+ "process.onExit": { argTypes: [null, BOOL], result: VOID },
300
+ "process.offExit": { argTypes: [null], result: VOID },
301
+ /** process.stdin listener registration — stdin.on/once("data" | "end" |
302
+ * "error", cb). args: [cb, once bool]. data callbacks: () => void or
303
+ * (chunk: Uint8Array) => void; end: () => void; error: () => void or
304
+ * (err: Error) => void (the child error adapters are reused). While a
305
+ * data listener (or a parked for-await chunk promise) exists, stdin
306
+ * keeps the loop alive — Node's flowing-stdin keep-alive. Never
307
+ * throw. */
308
+ "stdin.onData": { argTypes: [null, BOOL], result: VOID },
309
+ "stdin.onEnd": { argTypes: [{ kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
310
+ "stdin.onError": { argTypes: [null, BOOL], result: VOID },
311
+ /** The for-await chunk source over process.stdin: no args, result
312
+ * Promise<Uint8Array> (+1). Fulfills with the next arrived chunk; the
313
+ * EMPTY bytes value is the done sentinel (POSIX reads never deliver
314
+ * empty data chunks), which the for-await desugar turns into loop
315
+ * exit. Never throws itself; awaiting it re-throws nothing (stdin
316
+ * errors surface through 'error' listeners, not the iterator). */
317
+ "stdin.nextChunk": { argTypes: [], result: { kind: "promise", inner: BYTES_U8 } },
318
+ "fs.readFileSync": { argTypes: [STRING, STRING], result: STRING },
319
+ "fs.readFileEncoded": { argTypes: [STRING, STRING], result: STRING },
320
+ "fs.readFdEncoded": { argTypes: [F64, STRING], result: STRING },
321
+ /** readFileSync(path) — the Buffer read (+1 bytes); throws catchably
322
+ * like the utf8 form. */
323
+ "fs.readFileSyncBuf": { argTypes: [STRING], result: BYTES_U8 },
324
+ /** readFileSync(path, enc) with a RUNTIME encoding (an untyped JS
325
+ * parameter): undefined/null answer Buffers, utf8 a string, other real
326
+ * encodings fence loudly, unknown names throw ERR_UNKNOWN_ENCODING. */
327
+ "fs.readFileSyncDyn": { argTypes: [STRING, DYN], result: DYN },
328
+ "fs.writeFileSync": { argTypes: [STRING, STRING], result: VOID },
329
+ "fs.appendFileSync": { argTypes: [STRING, STRING], result: VOID },
330
+ "fs.existsSync": { argTypes: [STRING], result: BOOL },
331
+ "fs.mkdirSync": { argTypes: [STRING], result: VOID },
332
+ "fs.rmSync": { argTypes: [STRING], result: VOID },
333
+ "fs.rmdirSync": { argTypes: [STRING], result: VOID },
334
+ "fs.readdirSync": { argTypes: [STRING], result: arrayOf(STRING) },
335
+ // Result is the call site's Dirent record array (VOID is the
336
+ // structure-checked sentinel, the os.networkInterfaces pattern).
337
+ /** `fs.readdirSync(path, { withFileTypes: true })` — Dirent rows over
338
+ * one readdir pass (scr_lib.c's scandir snapshot; DT_UNKNOWN falls back
339
+ * to lstat, Node's getDirents rule). The result type is the call site's
340
+ * interned Dirent record array (name, parentPath, hidden %dtype in
341
+ * libuv's UV_DIRENT encoding) — verified by the frontend; the emitter
342
+ * assembles the rows from the snapshot. OS order, no "."/"..". Throws
343
+ * Node's scandir errno error (may-throw seed set); fresh +1 array. */
344
+ "fs.readdirTypesSync": { argTypes: [STRING], result: VOID },
345
+ /** node:path (scr_path.c ports BOTH of Node's implementations
346
+ * function-by-function): the `path.*` family is posix, the
347
+ * `path.win32*` family is Node v24's path.win32 byte-for-byte — the
348
+ * frontend binds the bare module to the TARGET platform's family
349
+ * (Node on Windows IS path.win32) and the path.posix / path.win32
350
+ * namespaces to their own family everywhere. join and resolve take ONE
351
+ * string[] arg — the frontend packs the variadic call's arguments into
352
+ * an array literal. basename always receives its suffix (the frontend
353
+ * completes an omitted one with "", a Node no-op). toNamespacedPath is
354
+ * the posix identity and the win32 \\?\-prefixer. None of these throw;
355
+ * the resolves consult the process cwd like Node's. */
356
+ "path.join": { argTypes: [arrayOf(STRING)], result: STRING },
357
+ "path.resolve": { argTypes: [arrayOf(STRING)], result: STRING },
358
+ "path.normalize": { argTypes: [STRING], result: STRING },
359
+ "path.dirname": { argTypes: [STRING], result: STRING },
360
+ "path.basename": { argTypes: [STRING, STRING], result: STRING },
361
+ "path.extname": { argTypes: [STRING], result: STRING },
362
+ "path.isAbsolute": { argTypes: [STRING], result: BOOL },
363
+ "path.relative": { argTypes: [STRING, STRING], result: STRING },
364
+ "path.toNamespacedPath": { argTypes: [STRING], result: STRING },
365
+ "path.win32Join": { argTypes: [arrayOf(STRING)], result: STRING },
366
+ "path.win32Resolve": { argTypes: [arrayOf(STRING)], result: STRING },
367
+ "path.win32Normalize": { argTypes: [STRING], result: STRING },
368
+ "path.win32Dirname": { argTypes: [STRING], result: STRING },
369
+ "path.win32Basename": { argTypes: [STRING, STRING], result: STRING },
370
+ "path.win32Extname": { argTypes: [STRING], result: STRING },
371
+ "path.win32IsAbsolute": { argTypes: [STRING], result: BOOL },
372
+ "path.win32Relative": { argTypes: [STRING, STRING], result: STRING },
373
+ "path.win32ToNamespacedPath": { argTypes: [STRING], result: STRING },
374
+ /** node:os: homedir is $HOME else getpwuid(3); tmpdir is Node's env
375
+ * cascade ($TMPDIR/$TMP/$TEMP else /tmp, one trailing slash trimmed).
376
+ * os.platform() lowers to process.platform — one implementation. */
377
+ "os.homedir": { argTypes: [], result: STRING },
378
+ /** os.release(): uname(2)'s release field — Node's own implementation
379
+ * (the kernel version string, e.g. "24.6.0" on macOS 15). Interned; +1
380
+ * per read. Never throws. */
381
+ "os.release": { argTypes: [], result: STRING },
382
+ /** os.type(): uname(2)'s sysname ("Darwin", "Linux"; "Windows_NT" on
383
+ * win32) — Node's uv_os_uname answer. Interned per call; never throws. */
384
+ "os.type": { argTypes: [], result: STRING },
385
+ /** os.totalmem(): total physical memory in bytes. Never throws. */
386
+ "os.totalmem": { argTypes: [], result: F64 },
387
+ /** umask(2): arg < 0 reads without setting (umask has no read-only form
388
+ * — set 0, restore); otherwise sets and answers the PREVIOUS mask.
389
+ * Never throws. */
390
+ "process.umask": { argTypes: [F64], result: F64 },
391
+ /** chdir(2) — throws Node's fs-shaped error (ENOENT/EACCES/ENOTDIR,
392
+ * syscall "chdir") on failure. */
393
+ "process.chdir": { argTypes: [STRING], result: VOID },
394
+ "process.loadEnvFile": { argTypes: [DYN], result: VOID },
395
+ /** process._exiting: true once the exit sequence began (exit listeners
396
+ * running) — the runtime flag scr_run_exit_listeners/process.exit set.
397
+ * Never throws. */
398
+ "process.exiting": { argTypes: [], result: BOOL },
399
+ /** net's process-wide happy-eyeballs attempt budget (Node's default
400
+ * 250ms): one runtime double in the core unit, so reading/writing it
401
+ * never forces the net unit into the link. Never throw. */
402
+ "net.getAutoSelTimeout": { argTypes: [], result: F64 },
403
+ "net.setAutoSelTimeout": { argTypes: [F64], result: VOID },
404
+ /** realpath(3) with Node's error shape (syscall "lstat" in the message,
405
+ * Node's own spelling for realpathSync failures). +1 fresh string. */
406
+ "fs.realpathSync": { argTypes: [STRING], result: STRING },
407
+ /** Native realpath with syscall "realpath" on failure. +1 fresh string. */
408
+ "fs.realpathNativeSync": { argTypes: [STRING], result: STRING },
409
+ /** The os.userInfo() field trio (uv_os_get_passwd's slices): pw_name,
410
+ * pw_shell, pw_dir — the PASSWD homedir, not os.homedir's $HOME-first
411
+ * cascade (Node's own split). The frontend assembles the UserInfo
412
+ * record from these plus getuid/getgid. +1 fresh strings; a passwd
413
+ * lookup failure aborts (Node throws a system error there — no
414
+ * compiled program path reaches it for the running uid). */
415
+ "os.userName": { argTypes: [], result: STRING },
416
+ "os.userShell": { argTypes: [], result: STRING },
417
+ "os.userHomedir": { argTypes: [], result: STRING },
418
+ "os.tmpdir": { argTypes: [], result: STRING },
419
+ // Result is the call site's Dict<NetworkInterfaceInfo[]> record (VOID is
420
+ // the dgram.address sentinel — the libCall case checks the structure).
421
+ /** os.networkInterfaces(): getifaddrs(3) → the Dict<NetworkInterfaceInfo[]>
422
+ * record, built inline by the emitter from a runtime snapshot (scr_lib.c).
423
+ * The result type is the CALL SITE's mapped @types/node shape — a pure
424
+ * index-signature record whose value is `Info[] | undefined`, Info a
425
+ * two-record union (IPv4: scopeid `number | undefined` holding undefined;
426
+ * IPv6: scopeid number) — verified structurally by the frontend. Rows
427
+ * match libuv's filter (IFF_UP && IFF_RUNNING, AF_INET/AF_INET6; loopback
428
+ * = internal; MACs from the interface's link-level sibling entry, zeros
429
+ * when absent; cidr from the netmask's contiguous prefix, the null arm
430
+ * when it is missing or non-contiguous). Key/row order follows the OS's
431
+ * getifaddrs enumeration — Node itself does not guarantee an order.
432
+ * Fresh +1 record; never throws (a getifaddrs failure yields {}). */
433
+ "os.networkInterfaces": { argTypes: [], result: VOID },
434
+ /** `Math.max(...xs)` / `Math.min(...xs)` over one spread number[]
435
+ * (scr_number.c): the JS fold exactly — any NaN element poisons the
436
+ * result, ±0 order by the JS comparison (max prefers +0, min prefers
437
+ * -0), and the empty array yields -Infinity / +Infinity like the
438
+ * zero-argument calls. Borrows the array; never throws. */
439
+ "math.maxArr": { argTypes: [arrayOf(F64)], result: F64 },
440
+ "math.minArr": { argTypes: [arrayOf(F64)], result: F64 },
441
+ "math.hypotArr": { argTypes: [arrayOf(F64)], result: F64 },
442
+ /** `Math.floor(x)` — C floor() IS the JS operation (NaN/±0/±Infinity
443
+ * pass through bit-exactly). Never throws. */
444
+ "math.floor": { argTypes: [F64], result: F64 },
445
+ /** Math.abs (C fabs — IS the JS operation) and Math.round (scr_lib.c:
446
+ * ECMA half-toward-+Infinity with the exact-fraction comparison — C
447
+ * round() is half-away-from-zero and floor(x+0.5) drifts at the
448
+ * epsilon boundary). Borrow nothing; never throw. */
449
+ "math.abs": { argTypes: [F64], result: F64 },
450
+ "math.round": { argTypes: [F64], result: F64 },
451
+ /** Math.trunc / Math.ceil — C trunc()/ceil() ARE the JS operations
452
+ * (NaN/±0/±Infinity pass through bit-exactly; ceil(-0.5) is -0 in IEEE
453
+ * round-toward-+Infinity exactly as ECMA says). Static like floor —
454
+ * they are ask-4's wholeness-discharge operators, so the library
455
+ * inference needs them compiled, not island-served. Never throw. */
456
+ "math.trunc": { argTypes: [F64], result: F64 },
457
+ "math.ceil": { argTypes: [F64], result: F64 },
458
+ "math.sin": { argTypes: [F64], result: F64 },
459
+ "math.sinh": { argTypes: [F64], result: F64 },
460
+ "math.cos": { argTypes: [F64], result: F64 },
461
+ "math.cosh": { argTypes: [F64], result: F64 },
462
+ "math.tan": { argTypes: [F64], result: F64 },
463
+ "math.tanh": { argTypes: [F64], result: F64 },
464
+ "math.asin": { argTypes: [F64], result: F64 },
465
+ "math.asinh": { argTypes: [F64], result: F64 },
466
+ "math.acos": { argTypes: [F64], result: F64 },
467
+ "math.acosh": { argTypes: [F64], result: F64 },
468
+ "math.atan": { argTypes: [F64], result: F64 },
469
+ "math.atanh": { argTypes: [F64], result: F64 },
470
+ "math.cbrt": { argTypes: [F64], result: F64 },
471
+ "math.clz32": { argTypes: [F64], result: F64 },
472
+ /** Return -1, +1, or the original NaN/zero. In particular, -0 remains -0. */
473
+ "math.sign": { argTypes: [F64], result: F64 },
474
+ "math.exp": { argTypes: [F64], result: F64 },
475
+ "math.expm1": { argTypes: [F64], result: F64 },
476
+ "math.fround": { argTypes: [F64], result: F64 },
477
+ "math.sqrt": { argTypes: [F64], result: F64 },
478
+ "math.log": { argTypes: [F64], result: F64 },
479
+ "math.log1p": { argTypes: [F64], result: F64 },
480
+ "math.log2": { argTypes: [F64], result: F64 },
481
+ "math.log10": { argTypes: [F64], result: F64 },
482
+ "math.atan2": { argTypes: [F64, F64], result: F64 },
483
+ "math.pow": { argTypes: [F64, F64], result: F64 },
484
+ "math.imul": { argTypes: [F64, F64], result: F64 },
485
+ /** `Math.min(a, b)` / `Math.max(a, b)` — the two-argument scalar forms
486
+ * (scr_lib.c), JS-exact like the Arr folds: NaN poisons, max prefers +0
487
+ * over -0 (min the reverse). C fmin/fmax are NOT these (they drop NaN).
488
+ * Never throw. */
489
+ "math.min": { argTypes: [F64, F64], result: F64 },
490
+ "math.max": { argTypes: [F64, F64], result: F64 },
491
+ /** `Math.random()` — a uniform double in [0,1) with the spec's 53-bit
492
+ * granularity, drawn from arc4random_buf (the CSPRNG behind the crypto
493
+ * lowerings). Same distribution as Node, NECESSARILY different sequence
494
+ * (SEMANTICS.md 62 — no seeded sequence exists to match). Never throws. */
495
+ "math.random": { argTypes: [], result: F64 },
496
+ /** The static global parsers/tests (scr_string.c). num.parseInt is
497
+ * ECMA-262 19.2.5 exactly — JS whitespace, sign, ToInt32 radix (the
498
+ * frontend completes an omitted radix to 0 = the spec's "undefined":
499
+ * base 10 with the 0x hex escape), longest digit prefix, and the exact
500
+ * mathematical value correctly rounded (u64 fast path, bignum beyond —
501
+ * overflow is ±Infinity). num.isNaN is the NaN self-test on an
502
+ * already-number argument (tsc pins the argument to number, so no
503
+ * ToNumber coercion exists to model). Borrow; never throw. */
504
+ "num.parseInt": { argTypes: [STRING, F64], result: F64 },
505
+ /** ES parseFloat (scr_string.c): the longest StrDecimalLiteral prefix
506
+ * of the trimmed input (no hex, "Infinity" exact-case), NaN when none —
507
+ * ECMA-262 19.2.4 over a string argument (non-string arguments keep the
508
+ * fence: Node would ToNumber-coerce). Borrows; never throws. */
509
+ "num.parseFloat": { argTypes: [STRING], result: F64 },
510
+ /* ToNumber(string) — ECMA-262 7.1.4.1 StringToNumber (scr_string.c):
511
+ * trim the JS StrWhiteSpace set, empty/whitespace-only → +0, then the
512
+ * whole span must be one StrNumericLiteral — signed decimal (Infinity
513
+ * included, strtod-over-validated-span correct rounding) or unsigned
514
+ * 0x/0o/0b (exact value, nearest-even; signed forms are NaN) — with
515
+ * any trailing garbage answering NaN. Number(aString), unary + on
516
+ * strings, and util.format %d over strings lower here. Borrows; never
517
+ * throws. */
518
+ "num.fromString": { argTypes: [STRING], result: F64 },
519
+ "num.isNaN": { argTypes: [F64], result: BOOL },
520
+ /** The static URI component codecs (scr_string.c), ECMA-262 Encode/
521
+ * Decode with the component sets over the runtime's UTF-8 strings.
522
+ * str.encodeUriComponent percent-encodes every byte outside the
523
+ * unreserved component set (ALPHA/DIGIT/- _ . ! ~ * ' ( )) as uppercase
524
+ * %XX — the spec's per-code-point UTF-8 encoding IS a byte scan here —
525
+ * and never throws (the spec's URIError case is an unpaired surrogate,
526
+ * which cannot exist in well-formed UTF-8). str.decodeUriComponent
527
+ * decodes %XX escapes bytewise (raw non-escape bytes copy through) and
528
+ * requires the escaped bytes to form strictly valid UTF-8 (overlong
529
+ * forms, surrogate code points, and >U+10FFFF refused, per UTF8-decode
530
+ * without replacement); bad hex or an invalid sequence THROWS the
531
+ * spec's URIError ("URI malformed"), catchable. Borrow; results +1. */
532
+ "str.encodeUriComponent": { argTypes: [STRING], result: STRING },
533
+ // The base64 globals: the argument is a dyn value (WebIDL ToString
534
+ // runs in the runtime); the zero-argument form always throws.
535
+ /** The WHATWG base64 globals (scr_string.c), Node-global since v16.
536
+ * Arguments are borrowed dyn values — WebIDL ToString runs in the
537
+ * runtime over the dyn kind (String(null) is "null": the html spec's
538
+ * coercion, which Node's atob(null) exercises). str.atob decodes
539
+ * forgiving-base64 (ASCII whitespace stripped, %4==0 strips up to two
540
+ * '=', %4==1 refuses, leftover bits discarded) into the latin1 code
541
+ * points as a string; a malformed input THROWS the catchable
542
+ * DOMException InvalidCharacterError ("The string to be decoded is not
543
+ * correctly encoded."). str.btoa encodes the string's code points as
544
+ * base64; any code point over U+00FF THROWS InvalidCharacterError
545
+ * ("Invalid character"). str.b64Missing is the zero-argument call of
546
+ * either: always throws Node's TypeError [ERR_MISSING_ARGS] "The
547
+ * \"input\" argument must be specified". Results +1. */
548
+ "str.atob": { argTypes: [DYN], result: STRING },
549
+ "str.btoa": { argTypes: [DYN], result: STRING },
550
+ "str.b64Missing": { argTypes: [], result: STRING },
551
+ "str.decodeUriComponent": { argTypes: [STRING], result: STRING },
552
+ "str.decodeUri": { argTypes: [STRING], result: STRING },
553
+ /** encodeURI: the same Encode() keeping the reserved set and '#'
554
+ * unescaped — total like the component encoder. Borrow; result +1. */
555
+ "str.encodeUri": { argTypes: [STRING], result: STRING },
556
+ /** RegExp.escape (ES2025): per-code-point EncodeForRegExpEscape —
557
+ * leading ASCII alphanumeric hex-escapes, syntax characters and '/'
558
+ * take a backslash, other punctuators/whitespace/line terminators
559
+ * hex-escape, the rest passes through. Total; borrows; result +1. */
560
+ "regexp.escape": { argTypes: [STRING], result: STRING },
561
+ /** Number.prototype formatters (scr_lib.c), JS-exact:
562
+ * num.toExponential is toExponential() with the spec's "as many digits
563
+ * as necessary"; num.toFixed0 is the non-throwing omitted-argument
564
+ * toFixed() fast path; num.toFixed implements an explicit fractionDigits
565
+ * with exact binary-value rounding and THROWS RangeError outside 0..100.
566
+ * Successful results +1. */
567
+ "num.toExponential": { argTypes: [F64], result: STRING },
568
+ "num.toFixed0": { argTypes: [F64], result: STRING },
569
+ "num.toFixed": { argTypes: [F64, F64], result: STRING },
570
+ "num.toStringRadix": { argTypes: [F64, DYN], result: STRING },
571
+ /** Object.is over two numbers — the spec's SameValue on doubles: NaN
572
+ * equals NaN, +0 differs from -0, everything else is `===`. Plain bool
573
+ * result; never throws. (Union-armed operands take unionEq's sameValue
574
+ * flag instead — this is the both-f64 fast path.) */
575
+ "num.sameValue": { argTypes: [F64, F64], result: BOOL },
576
+ /** `new Intl.NumberFormat("en-US").format(x)` and
577
+ * `x.toLocaleString("en-US")` with DEFAULT options — the one locale
578
+ * whose data the runtime embeds (Node's default-build locale): decimal
579
+ * notation, 0–3 fraction digits rounded half-up on the SHORTEST
580
+ * round-tripping decimal (ICU's rounding input, probed vs Node —
581
+ * format(1.0005) is "1.001" though toFixed(3) answers "1.000"), ","
582
+ * grouping every three integer digits, "∞"/"NaN" texts, and "-0" for
583
+ * negative inputs rounding to zero. Result +1; never throws. */
584
+ "intl.numFormatEnUs": { argTypes: [F64], result: STRING },
585
+ /** ES Symbol values (scr_symbol.c — link-gated by moduleUsesSymbol).
586
+ * sym.new: `Symbol(desc)` — a fresh runtime-unique identity (+1) whose
587
+ * one arg is the description string (borrowed); sym.newAnon is the
588
+ * description-less `Symbol()` form. sym.for: the Symbol.for global
589
+ * registry — one interned symbol per key (borrowed), +1 on every call.
590
+ * sym.toString: "Symbol(desc)" (+1 string; "Symbol()" when absent).
591
+ * sym.desc / sym.keyFor answer the interned `string | undefined` union
592
+ * (the runtime returns +1-or-NULL; the backend builds the union arms —
593
+ * the child.stdout pattern). None of these throw. */
594
+ "sym.new": { argTypes: [STRING], result: SYMBOL_T },
595
+ "sym.newAnon": { argTypes: [], result: SYMBOL_T },
596
+ "sym.for": { argTypes: [STRING], result: SYMBOL_T },
597
+ "sym.wellKnown": { argTypes: [STRING], result: SYMBOL_T },
598
+ // Result is the interned `string | undefined` union — the libCall case
599
+ // checks the arms (the spawnRes.error pattern).
600
+ "sym.keyFor": { argTypes: [SYMBOL_T], result: VOID },
601
+ "sym.desc": { argTypes: [SYMBOL_T], result: VOID },
602
+ "sym.toString": { argTypes: [SYMBOL_T], result: STRING },
603
+ /** Engine-free arbitrary-precision bigint operations (scr_bigint.c).
604
+ * parse accepts the ECMAScript BigInt string grammar; fromF64 accepts
605
+ * finite integral Numbers. Arithmetic returns fresh immutable values.
606
+ * cmp returns -1/0/1 as f64; toString accepts a numeric radix. */
607
+ "bigint.parse": { argTypes: [STRING], result: BIGINT_T },
608
+ "bigint.fromF64": { argTypes: [F64], result: BIGINT_T },
609
+ "bigint.neg": { argTypes: [BIGINT_T], result: BIGINT_T },
610
+ "bigint.not": { argTypes: [BIGINT_T], result: BIGINT_T },
611
+ "bigint.add": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
612
+ "bigint.sub": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
613
+ "bigint.mul": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
614
+ "bigint.div": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
615
+ "bigint.mod": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
616
+ "bigint.pow": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
617
+ "bigint.and": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
618
+ "bigint.or": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
619
+ "bigint.xor": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
620
+ "bigint.shl": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
621
+ "bigint.shr": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
622
+ "bigint.eq": { argTypes: [BIGINT_T, BIGINT_T], result: BOOL },
623
+ "bigint.eqString": { argTypes: [BIGINT_T, STRING], result: BOOL },
624
+ "bigint.cmp": { argTypes: [BIGINT_T, BIGINT_T], result: F64 },
625
+ "bigint.cmpNumber": { argTypes: [BIGINT_T, F64], result: F64 },
626
+ "bigint.truthy": { argTypes: [BIGINT_T], result: BOOL },
627
+ "bigint.toString": { argTypes: [BIGINT_T, F64], result: STRING },
628
+ "bigint.inspect": { argTypes: [BIGINT_T], result: STRING },
629
+ "bigint.toF64": { argTypes: [BIGINT_T], result: F64 },
630
+ "bigint.asUintN": { argTypes: [F64, BIGINT_T], result: BIGINT_T },
631
+ "bigint.asIntN": { argTypes: [F64, BIGINT_T], result: BIGINT_T },
632
+ "bigint.bufferRead": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: BIGINT_T },
633
+ "bigint.bufferWrite": { argTypes: [BYTES_U8, BIGINT_T, F64, BOOL, BOOL], result: F64 },
634
+ "bigint.dataViewGet": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: BIGINT_T },
635
+ "bigint.dataViewSet": { argTypes: [BYTES_U8, F64, BIGINT_T, BOOL], result: VOID },
636
+ /** node:url + the URL class (scr_url.c). url.new parses one absolute
637
+ * URL string into a mutable URL value (+1) — invalid input THROWS a
638
+ * catchable TypeError ("Invalid URL"), like Node's constructor. The
639
+ * getters (borrowed receiver, +1 string) never throw; url.href doubles
640
+ * as toString(). fileURLToPath has one libFn per receiver form (URL
641
+ * value / string) — both THROW Node's TypeErrors on non-file schemes,
642
+ * encoded slashes, and non-empty hosts. url.pathToFileURL resolves the
643
+ * path (getcwd) and never throws. */
644
+ "url.new": { argTypes: [STRING], result: URL_T },
645
+ "url.newBase": { argTypes: [STRING, STRING], result: URL_T },
646
+ /** Factories consume already-converted input/base strings. canParse
647
+ * answers a boolean; parse returns a checked native URL or null (+1).
648
+ * Parser failures are suppressed; conversion occurs before these calls. */
649
+ "url.canParse": { argTypes: [STRING], result: BOOL },
650
+ "url.canParseBase": { argTypes: [STRING, STRING], result: BOOL },
651
+ "url.parse": { argTypes: [STRING], result: DYN },
652
+ "url.parseBase": { argTypes: [STRING, STRING], result: DYN },
653
+ "url.protocol": { argTypes: [URL_T], result: STRING },
654
+ "url.origin": { argTypes: [URL_T], result: STRING },
655
+ "url.username": { argTypes: [URL_T], result: STRING },
656
+ "url.password": { argTypes: [URL_T], result: STRING },
657
+ "url.host": { argTypes: [URL_T], result: STRING },
658
+ "url.hostname": { argTypes: [URL_T], result: STRING },
659
+ "url.port": { argTypes: [URL_T], result: STRING },
660
+ "url.pathname": { argTypes: [URL_T], result: STRING },
661
+ "url.href": { argTypes: [URL_T], result: STRING },
662
+ /** Selected component writes borrow the receiver and converted string.
663
+ * href replaces its parsed fields while retaining cached params identity. */
664
+ "url.set": { argTypes: [URL_T, STRING, STRING], result: VOID },
665
+ "url.setChecked": { argTypes: [URL_T, STRING, DYN], result: VOID },
666
+ "url.fileURLToPathUrl": { argTypes: [URL_T], result: STRING },
667
+ "url.fileURLToPathChecked": { argTypes: [DYN], result: STRING },
668
+ "url.fileURLToPathOptions": { argTypes: [DYN, DYN], result: STRING },
669
+ "url.fileURLToPathBuffer": { argTypes: [DYN, DYN], result: BYTES_U8 },
670
+ "url.pathToFileURLChecked": { argTypes: [DYN, DYN], result: URL_T },
671
+ "url.fileURLToPathStr": { argTypes: [STRING], result: STRING },
672
+ "url.pathToFileURL": { argTypes: [STRING], result: URL_T },
673
+ /** Explicit path syntax from the options.windows argument, independent
674
+ * of the executable's host platform. Windows UNC input can throw. */
675
+ "url.pathToFileURLPlatform": { argTypes: [STRING, BOOL], result: URL_T },
676
+ /** pathToFileURL under a win32 TARGET: the same scr_url_from_path call
677
+ * (the runtime selects the win32 arm by _WIN32), but a distinct IR name
678
+ * because that arm THROWS for malformed UNC inputs — may-throw seeds on
679
+ * it while posix pathToFileURL emission stays byte-identical. */
680
+ "url.pathToFileURLWin32": { argTypes: [STRING], result: URL_T },
681
+ /** URLSearchParams (scr_url.c — always linked with the url unit).
682
+ * Construction: sp.new (empty), sp.parse (one borrowed init string —
683
+ * a single leading '?' strips, Node's constructor), sp.copy (snapshot
684
+ * of another list), sp.fromPairs (a string[][] value — THROWS Node's
685
+ * ERR_INVALID_TUPLE TypeError on a non-[name, value] row; the one
686
+ * throwing entry in the family), sp.with (the record-literal init
687
+ * desugar: append one pair, answer the same list +1 — chains fold
688
+ * `new URLSearchParams({...})` into nested calls). url.searchParams
689
+ * answers the URL's LIVE cached view (+1, one identity per URL);
690
+ * url.search is the WHATWG search getter ("" for no/empty query).
691
+ * Methods mirror the WHATWG surface: sp.get answers +1-or-NULL (the
692
+ * sym.desc union pattern, null arm), sp.getAll a fresh string[];
693
+ * sp.append/sp.set/sp.delete/sp.deleteValue/sp.sort mutate and
694
+ * re-serialize a live view's URL query; sp.has/sp.hasValue answer
695
+ * bools; sp.size/sp.toString are pure reads. sp.keyAt/sp.valAt are
696
+ * the for-of/forEach desugar's index reads (live — the loop re-reads
697
+ * sp.size each pass). */
698
+ "sp.new": { argTypes: [], result: SEARCH_PARAMS_T },
699
+ "sp.newChecked": { argTypes: [DYN], result: SEARCH_PARAMS_T },
700
+ "sp.parse": { argTypes: [STRING], result: SEARCH_PARAMS_T },
701
+ "sp.copy": { argTypes: [SEARCH_PARAMS_T], result: SEARCH_PARAMS_T },
702
+ // The pairs argument is string[][] — checked structurally in validate.ts (the
703
+ // generic array-of slot has no named constant here).
704
+ "sp.fromPairs": { argTypes: [null], result: SEARCH_PARAMS_T },
705
+ "sp.with": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: SEARCH_PARAMS_T },
706
+ "url.searchParams": { argTypes: [URL_T], result: SEARCH_PARAMS_T },
707
+ "url.search": { argTypes: [URL_T], result: STRING },
708
+ "url.hash": { argTypes: [URL_T], result: STRING },
709
+ // Result is the interned `string | null` union — the libCall case
710
+ // checks the arms (the spawnRes.signal pattern).
711
+ "sp.get": { argTypes: [SEARCH_PARAMS_T, STRING], result: VOID },
712
+ "sp.getAll": { argTypes: [SEARCH_PARAMS_T, STRING], result: arrayOf(STRING) },
713
+ "sp.append": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
714
+ "sp.set": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
715
+ "sp.delete": { argTypes: [SEARCH_PARAMS_T, STRING], result: VOID },
716
+ "sp.deleteValue": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
717
+ "sp.has": { argTypes: [SEARCH_PARAMS_T, STRING], result: BOOL },
718
+ "sp.hasValue": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: BOOL },
719
+ "sp.sort": { argTypes: [SEARCH_PARAMS_T], result: VOID },
720
+ "sp.size": { argTypes: [SEARCH_PARAMS_T], result: F64 },
721
+ "sp.toString": { argTypes: [SEARCH_PARAMS_T], result: STRING },
722
+ "sp.keyAt": { argTypes: [SEARCH_PARAMS_T, F64], result: STRING },
723
+ "sp.valAt": { argTypes: [SEARCH_PARAMS_T, F64], result: STRING },
724
+ // node:querystring. qs.parse's result is the call site's ParsedUrlQuery
725
+ // dictionary record (VOID is the networkInterfaces sentinel — the
726
+ // libCall case checks the structure); qs.stringify's object argument
727
+ // is a dyn value (the frontend dynFroms typed records).
728
+ /** node:querystring (scr_qs.c — link-gated by moduleUsesQs; NOT
729
+ * URLSearchParams: the legacy codec's escaping and '+' rules differ).
730
+ * qs.escape is Node's qsEscape, which encodes exactly the component
731
+ * unreserved set — it emits the always-linked
732
+ * scr_str_encode_uri_component, so escape-only programs never pull the
733
+ * unit. qs.unescape is Node's qsUnescape: strict decodeURIComponent
734
+ * first, the lenient legacy unescapeBuffer fallback on failure (never
735
+ * throws). qs.parse takes (str, sep, eq, maxKeys) — the frontend
736
+ * completes omitted/null sep/eq to "&"/"=" and the omitted maxKeys
737
+ * option to Node's 1000 (0 and negatives mean unlimited, Node's rule) —
738
+ * and its result type is the CALL SITE's mapped ParsedUrlQuery shape (a
739
+ * pure index-signature record over `string | string[]`, an undefined
740
+ * arm tolerated — @types/node's Dict), verified structurally by the
741
+ * frontend (lowerQuerystringParseCall); the emitters construct the
742
+ * record and hand its overflow map to scr_qs_parse_into with the two
743
+ * union tags. qs.stringify takes (obj, sep, eq) with obj a dyn value
744
+ * (the frontend dynFroms the typed record; JS-world dyn values pass
745
+ * through) — Node's encodeStringified rules run in the runtime, so
746
+ * arrays expand to repeated keys and null/undefined/nested objects are
747
+ * empty values. Custom encoder/decoder options fence at compile time.
748
+ * All borrow; string results +1; none throw. */
749
+ "qs.parse": { argTypes: [STRING, STRING, STRING, F64], result: VOID },
750
+ "qs.stringify": { argTypes: [DYN, STRING, STRING], result: STRING },
751
+ "qs.escape": { argTypes: [STRING], result: STRING },
752
+ "qs.unescape": { argTypes: [STRING], result: STRING },
753
+ /** node:util.parseArgs: one checked-dynamic config object in, one
754
+ * checked-dynamic ParsedResults tree out. Statically typed member reads
755
+ * validate their values when leaving that tree. The native parser may
756
+ * throw Node's coded validation/grammar TypeErrors. */
757
+ "util.parseArgs": { argTypes: [DYN], result: DYN },
758
+ "util.parseEnv": { argTypes: [DYN], result: DYN },
759
+ "util.getSystemErrorName": { argTypes: [DYN], result: STRING },
760
+ "util.getSystemErrorMessage": { argTypes: [DYN], result: STRING },
761
+ "util.systemErrorEntries": { argTypes: [], result: DYN },
762
+ "util.stripVTControlCharacters": { argTypes: [DYN], result: STRING },
763
+ "util.toUSVString": { argTypes: [DYN], result: STRING },
764
+ "util.isDeepStrictEqual": { argTypes: [DYN, DYN, DYN], result: BOOL },
765
+ "util.styleText": { argTypes: [DYN, DYN, DYN], result: STRING },
766
+ "util.typeIs": { argTypes: [DYN, STRING], result: BOOL },
767
+ "util.typeValue": { argTypes: [DYN, STRING], result: DYN },
768
+ /** fs.statSync → a Stats value (may throw, like the other sync fs
769
+ * calls); the stats.* getters are pure reads on it. */
770
+ "fs.statSync": { argTypes: [STRING], result: STATS_T },
771
+ "fs.lstatSync": { argTypes: [STRING], result: STATS_T },
772
+ "fs.fstatSync": { argTypes: [F64], result: STATS_T },
773
+ "fs.fchmodSync": { argTypes: [F64, F64], result: VOID },
774
+ "fs.fsyncSync": { argTypes: [F64], result: VOID },
775
+ "fs.fdatasyncSync": { argTypes: [F64], result: VOID },
776
+ "fs.ftruncateSync": { argTypes: [F64, F64], result: VOID },
777
+ "fs.utimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
778
+ "fs.futimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
779
+ "fs.lutimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
780
+ "fs.readvSync": { argTypes: [F64, arrayOf(BYTES_U8), F64], result: F64 },
781
+ "fs.writevSync": { argTypes: [F64, arrayOf(BYTES_U8), F64], result: F64 },
782
+ "fs.linkSync": { argTypes: [DYN, DYN], result: VOID },
783
+ "fs.symlinkSync": { argTypes: [DYN, DYN, DYN], result: VOID },
784
+ "fs.readlinkSync": { argTypes: [DYN, DYN], result: DYN },
785
+ "fs.statfsSync": { argTypes: [DYN, DYN], result: DYN },
786
+ "fs.readlinkSyncStr": { argTypes: [DYN, DYN], result: STRING },
787
+ "fs.readlinkSyncBuffer": { argTypes: [DYN, DYN], result: BYTES_U8 },
788
+ /** fs.openSync(path, flags) → the raw fd as f64; fs.readSync/fs.writeSync
789
+ * over Buffer windows perform sequential I/O when position is -1 and
790
+ * offset-preserving positioned I/O otherwise; fs.writeStrSync is the
791
+ * utf8 string twin; and fs.closeSync(fd) closes the descriptor. This is
792
+ * the fd slice behind spawn/log-processing forms.
793
+ * flags is Node's string
794
+ * grammar ("r", "w", "a" and the +/x variants; unknown flags throw
795
+ * Node's ERR_INVALID_ARG_VALUE TypeError text). All throw Node-shaped
796
+ * fs errors (openSync ENOENT/EACCES..., readSync EBADF/range errors,
797
+ * closeSync EBADF). */
798
+ "fs.openSync": { argTypes: [STRING, STRING], result: F64 },
799
+ "fs.openNumericSync": { argTypes: [STRING, F64, F64], result: F64 },
800
+ "fs.readSync": { argTypes: [F64, BYTES_U8, F64, F64, F64], result: F64 },
801
+ "fs.writeSync": { argTypes: [F64, BYTES_U8, F64, F64, F64], result: F64 },
802
+ "fs.writeStrSync": { argTypes: [F64, STRING, F64, STRING], result: F64 },
803
+ // fs.watch's callback func type is program-dependent (zero params, or
804
+ // the eventType string) — the slot pins arity and the path/receiver.
805
+ /** fs.watch(path, listener?) → an FSWatcher handle (scr_watch.c —
806
+ * linked, and scr_watch_install() emitted, only when these appear on
807
+ * the IR; moduleUsesFsWatch is the switch). The path opens NOW —
808
+ * failure throws Node's fs error synchronously ("ENOENT: ..., watch
809
+ * 'x'", the polling-fallback catch shape) — and the unit's kqueue
810
+ * (EVFILT_VNODE) delivers "rename"/"change" through the loop's watch
811
+ * hook. The callback (nullable) MOVES in with an adapter per listener
812
+ * shape (zero-param, or the (eventType: string) form — runtime-
813
+ * provided); an open watcher keeps the loop alive until watcher.close()
814
+ * (idempotent, receiver borrowed, statement position only). */
815
+ "fs.watch": { argTypes: [STRING], result: FSWATCHER_T },
816
+ "fs.watchCb": { argTypes: [STRING, null], result: FSWATCHER_T },
817
+ "watcher.close": { argTypes: [FSWATCHER_T], result: VOID },
818
+ /** The composed `new crypto.X509Certificate(data).fingerprint` read
819
+ * (scr_lib.c — no certificate handle exists): the SHA-1 of the DER,
820
+ * uppercase colon-separated, over PEM or raw-DER Buffer input; other
821
+ * inputs throw Node's ERR_OSSL_PEM_NO_START_LINE Error (may-throw). */
822
+ "crypto.x509Fingerprint": { argTypes: [BYTES_U8], result: STRING },
823
+ "crypto.x509FingerprintStr": { argTypes: [STRING], result: STRING },
824
+ /** The certificate's Validity window (validFrom / validTo reads —
825
+ * scr_lib.c's minimal ASN.1 walk to the TBSCertificate validity
826
+ * SEQUENCE): UTCTime and GeneralizedTime render in Node's exact
827
+ * ASN1_TIME_print shape ("Jul 1 00:00:00 2026 GMT" — %2d space-padded
828
+ * day). Same input contract and PEM error as the fingerprint pair
829
+ * (may-throw). */
830
+ "crypto.x509ValidFrom": { argTypes: [BYTES_U8], result: STRING },
831
+ "crypto.x509ValidFromStr": { argTypes: [STRING], result: STRING },
832
+ "crypto.x509ValidTo": { argTypes: [BYTES_U8], result: STRING },
833
+ "crypto.x509ValidToStr": { argTypes: [STRING], result: STRING },
834
+ "fs.closeSync": { argTypes: [F64], result: VOID },
835
+ "stats.isFile": { argTypes: [STATS_T], result: BOOL },
836
+ "stats.isDirectory": { argTypes: [STATS_T], result: BOOL },
837
+ "stats.isSymbolicLink": { argTypes: [STATS_T], result: BOOL },
838
+ "stats.size": { argTypes: [STATS_T], result: F64 },
839
+ "stats.dev": { argTypes: [STATS_T], result: F64 },
840
+ "stats.ino": { argTypes: [STATS_T], result: F64 },
841
+ "stats.blocks": { argTypes: [STATS_T], result: F64 },
842
+ "stats.nlink": { argTypes: [STATS_T], result: F64 },
843
+ "stats.atimeMs": { argTypes: [STATS_T], result: F64 },
844
+ "stats.mtimeMs": { argTypes: [STATS_T], result: F64 },
845
+ "stats.ctimeMs": { argTypes: [STATS_T], result: F64 },
846
+ // The wider sync fs slice (unlink/chmod/chown/copyfile and the
847
+ // mode-carrying write/mkdir forms).
848
+ /** The wider sync fs slice (scr_lib.c), all throwing catchably with
849
+ * Node's errno message shapes and `.code` stamped like the rest of
850
+ * sync fs. unlink/chmod/chown wrap the syscalls 1:1 (Node reports the
851
+ * syscall's own name). copyFileSync copies contents into a fresh (or
852
+ * truncated) destination carrying the SOURCE's mode (libuv's
853
+ * uv_fs_copyfile behavior); its errors carry BOTH paths — Node's
854
+ * "copyfile 'src' -> 'dest'". lstatSync is statSync without following
855
+ * a trailing symlink (Node reports lstat); stats.isSymbolicLink /
856
+ * stats.dev / ino / blocks / nlink / atimeMs / mtimeMs / ctimeMs are pure reads on the widened
857
+ * snapshot (blocks is allocated 512-byte units; the times are milliseconds
858
+ * with their sub-second fractions, Node's arithmetic).
859
+ * writeFileModeSync is writeFileSync(path, data, { mode }): the mode
860
+ * applies at CREATION only (open(2) with O_CREAT, umask applying),
861
+ * exactly Node — an existing file keeps its permissions. mkdirModeSync
862
+ * / mkdirRecursiveModeSync are the mkdirSync option forms with an
863
+ * explicit mode (the recursive walk passes it to every directory it
864
+ * creates, like Node's). */
865
+ "fs.unlinkSync": { argTypes: [STRING], result: VOID },
866
+ "fs.chmodSync": { argTypes: [STRING, F64], result: VOID },
867
+ "fs.chownSync": { argTypes: [STRING, F64, F64], result: VOID },
868
+ "fs.copyFileSync": { argTypes: [STRING, STRING], result: VOID },
869
+ /** renameSync is the direct two-path syscall wrapper. renameCb defers
870
+ * the operation to the loop and fires a program-shaped Error | null
871
+ * callback through a backend-emitted adapter. */
872
+ "fs.renameSync": { argTypes: [STRING, STRING], result: VOID },
873
+ // Callback type is program-dependent (zero params or Error | null).
874
+ "fs.renameCb": { argTypes: [STRING, STRING, null], result: VOID },
875
+ "fs.writeFileModeSync": { argTypes: [STRING, STRING, F64], result: VOID },
876
+ "fs.mkdirModeSync": { argTypes: [STRING, F64], result: VOID },
877
+ "fs.mkdirRecursiveModeSync": { argTypes: [STRING, F64], result: VOID },
878
+ "atomics.wait": { argTypes: [bytesOf("i32"), F64, F64, F64], result: STRING },
879
+ "atomics.notify": { argTypes: [bytesOf("i32"), F64, F64], result: F64 },
880
+ "atomics.op": { argTypes: [null, F64, F64, F64, F64], result: F64 },
881
+ "worker.new": { argTypes: [F64, STRING, DYN], result: DYN },
882
+ "worker.isMainThread": { argTypes: [], result: BOOL },
883
+ "worker.threadId": { argTypes: [], result: F64 },
884
+ "worker.root": { argTypes: [], result: F64 },
885
+ "worker.data": { argTypes: [], result: DYN },
886
+ "worker.parentPort": { argTypes: [], result: DYN },
887
+ /** child_process.spawnSync (scr_child.c): posix_spawn + waitpid + piped
888
+ * utf8 capture — cmd borrowed, args one borrowed string[] (the frontend
889
+ * completes an omitted list to an empty literal), result an owned (+1)
890
+ * spawnRes. NEVER throws: spawn failure (nonexistent binary, EACCES) is
891
+ * data, like Node's error property — status null and empty outputs
892
+ * (SEMANTICS.md documents the divergence from Node's null stdout).
893
+ * The getters are pure reads: status is the interned `number | null`
894
+ * union (null = spawn failure or signal death, type-directed
895
+ * construction in the backend like process.envGet); stdout/stderr are
896
+ * +1 strings. */
897
+ "cp.spawnSync": { argTypes: [STRING, arrayOf(STRING)], result: SPAWNRES_T },
898
+ // spawnSync's options form: timeout, killSignal name ("" = SIGTERM),
899
+ // and the three stdio modes.
900
+ /** spawnSync with options (scr_child.c): the cp.spawnSync core plus the
901
+ * option slice portless-class CLIs pass — timeout (killSignal fires at
902
+ * the deadline and the result carries error: ETIMEDOUT + the signal,
903
+ * Node's shape), killSignal (a signal NAME; "" = the SIGTERM default),
904
+ * and per-fd stdio modes (in: 0 /dev/null, 1 ignore, 2 inherit; out/
905
+ * err: 0 capture, 1 ignore → "", 2 inherit → ""). NEVER throws — spawn
906
+ * failure and timeout are data on the result, like Node's error
907
+ * property. spawnRes.signal is the result's termination signal as the
908
+ * call site's `Signals | null` union (null = exited normally or spawn
909
+ * failure), constructed type-directedly like spawnRes.status. */
910
+ "cp.spawnSyncOpts": {
911
+ argTypes: [STRING, arrayOf(STRING), F64, STRING, F64, F64, F64],
912
+ result: SPAWNRES_T,
913
+ },
914
+ /** cp.spawnSyncOpts with the stdio carried as a RUNTIME string —
915
+ * "pipe" | "ignore" | "inherit", proven by the call site's TYPE (the
916
+ * defaultRunner idiom `stdio: options?.stdio ?? "pipe"`); the runtime
917
+ * maps the value to the three modes. Args (cmd, argv, timeout,
918
+ * killSignal, stdio). Never throws, like the other spawnSync forms. */
919
+ "cp.spawnSyncStdioStr": {
920
+ argTypes: [STRING, arrayOf(STRING), F64, STRING, STRING],
921
+ result: SPAWNRES_T,
922
+ },
923
+ // node:net (scr_net.c). Listener slots are program-dependent closures —
924
+ // null slots, checked in the libCall case (the child.onExit precedent);
925
+ // the zero-param callbacks pin the exact func type here. The trailing
926
+ // BOOL on registrations is the once flag.
927
+ /** node:net (scr_net.c — linked, and scr_net_install() emitted, only
928
+ * when one of these appears on the IR; moduleUsesNet is the switch).
929
+ * Receivers are borrowed; CALLBACKS MOVE into the handle's listener
930
+ * registry and are released at settlement (the child.onExit story).
931
+ * All listener registrations carry a trailing BOOL once-flag (`on` vs
932
+ * `once`) and are void — chaining is fenced. None of these throw:
933
+ * listen/connect failures are the async 'error' event, like Node.
934
+ *
935
+ * net.createServer's optional connection handler and the
936
+ * serverOnConnection listeners take the runtime-provided adapters
937
+ * (zero-param, or the one-param socket shape); sockOnData's adapters
938
+ * are the stdin pair's shapes (zero-param / bytes chunk); the error
939
+ * events reuse the child %Error adapters. net.listen/net.listenCb bind
940
+ * NOW and defer 'listening' to the next loop turn (Node's next-tick
941
+ * emit); net.serverPort is the composed `server.address().port` read.
942
+ * net.connect's host argument is a string ("localhost" pins to
943
+ * 127.0.0.1 — SEMANTICS.md); the connect callback is once('connect'). */
944
+ "net.createServer": { argTypes: [], result: NETSERVER_T },
945
+ "net.createServerCb": { argTypes: [null], result: NETSERVER_T },
946
+ "net.listen": { argTypes: [NETSERVER_T, F64], result: VOID },
947
+ "net.listenCb": {
948
+ argTypes: [NETSERVER_T, F64, { kind: "func", params: [], ret: VOID }],
949
+ result: VOID,
950
+ },
951
+ /** listen({ port, host, ipv6Only }[, cb]) — the explicit-interface bind
952
+ * (portless's listenOnProxyInterface): args [server, port, host,
953
+ * ipv6Only]. host is an IP literal string ("" = the host-less
954
+ * dual-stack any default); ipv6Only sets IPV6_V6ONLY before the bind.
955
+ * These are the old-shaped calls, retained for omitted reusePort so
956
+ * serialized IR remains compatible. Failures are the async 'error',
957
+ * message in Node's listen shape with the requested host. Never throws. */
958
+ "net.listenOpts": { argTypes: [NETSERVER_T, F64, STRING, BOOL], result: VOID },
959
+ // The callback slot is a zero-param void closure OR its
960
+ // `(() => void) | undefined` optional-binding union (checked specially).
961
+ "net.listenOptsCb": { argTypes: [NETSERVER_T, F64, STRING, BOOL, null], result: VOID },
962
+ /** Additive ABI for listen({ ..., reusePort }) — args
963
+ * [server, port, host, ipv6Only, reusePort], with the callback following
964
+ * those values in the callback form. The final BOOL is the requested
965
+ * kernel connection-distribution option; old spellings remain
966
+ * four/five-argument calls so serialized IR stays compatible. */
967
+ "net.listenOptsReusePort": { argTypes: [NETSERVER_T, F64, STRING, BOOL, BOOL], result: VOID },
968
+ // The callback is a zero-param void closure OR its optional-binding union;
969
+ // the callback follows the reusePort BOOL in this additive ABI.
970
+ "net.listenOptsReusePortCb": {
971
+ argTypes: [NETSERVER_T, F64, STRING, BOOL, BOOL, null],
972
+ result: VOID,
973
+ },
974
+ "net.serverPort": { argTypes: [NETSERVER_T], result: F64 },
975
+ "net.serverListening": { argTypes: [NETSERVER_T], result: BOOL },
976
+ // net.serverAddress's record result is shape-checked in the libCall case
977
+ // (the dgram.address sentinel pattern).
978
+ /** server.address() as the full AddressInfo record (the dgram.address
979
+ * materialization pattern: the emitter builds the record from the three
980
+ * runtime reads; the frontend pinned the shape). Never throws — before
981
+ * listen it answers the any-form defaults with port 0 where Node
982
+ * answers null (the serverPort stance). */
983
+ "net.serverAddress": { argTypes: [NETSERVER_T], result: VOID },
984
+ "net.serverClose": { argTypes: [NETSERVER_T], result: VOID },
985
+ "net.serverCloseCb": {
986
+ argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }],
987
+ result: VOID,
988
+ },
989
+ "net.serverOnError": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
990
+ "net.serverOnClose": {
991
+ argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }, BOOL],
992
+ result: VOID,
993
+ },
994
+ "net.serverOnConnection": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
995
+ /** 'secureConnection' — the TLS server's deferred 'connection' list
996
+ * (handshake-completion timing); on a server without deferred
997
+ * connections (a plain net server) the registration never fires,
998
+ * exactly Node's split. */
999
+ "net.serverOnSecureConnection": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
1000
+ "net.connect": { argTypes: [F64, STRING], result: NETSOCKET_T },
1001
+ /** connect with a validated autoSelectFamilyAttemptTimeout option (the
1002
+ * budget runs Node's validateInt32-from-1 ladder and is then inert —
1003
+ * the single dial has nothing to time). May-throw. */
1004
+ "net.connectAttempt": { argTypes: [F64, STRING, DYN], result: NETSOCKET_T },
1005
+ /** net.connect/createConnection over a RUNTIME option bag (computed
1006
+ * keys — the invalid-input probes): Node-order validation (the
1007
+ * objectMode trio's ERR_INVALID_ARG_VALUE, validatePort, host string,
1008
+ * autoSelectFamily boolean, the attempt budget), then the trailing
1009
+ * compiler-rendered fence — ALWAYS THROWS (the error.nodeThrow
1010
+ * polymorphic-result carve-out). May-throw seed. */
1011
+ "net.connectOptsChk": { argTypes: [DYN, STRING], result: VOID },
1012
+ "net.connectCb": {
1013
+ argTypes: [F64, STRING, { kind: "func", params: [], ret: VOID }],
1014
+ result: NETSOCKET_T,
1015
+ },
1016
+ // The lookup's exact func shape is program data (its answer callback's
1017
+ // union/record types) — checked specially in the libCall case.
1018
+ /** connect({ port, host, autoSelectFamily: true, lookup }) — the
1019
+ * caller-resolver dial (portless's createLoopbackConnection): args
1020
+ * [port, host, lookup]. The runtime creates the (connecting) socket
1021
+ * handle, invokes the lookup as Node does — lookup(hostname, options,
1022
+ * callback), options crossing as the dyn undefined — and the answer
1023
+ * closure (an emitter-synthesized per-shape thunk over a boxed socket,
1024
+ * the SNI-answer pattern) dials the answered addresses IN ORDER: each
1025
+ * connect failure tries the next, the LAST failure's message is the
1026
+ * socket's 'error' (Node's autoSelectFamily aggregate is a documented
1027
+ * divergence), and a lookup error surfaces as the deferred socket
1028
+ * 'error'. A synchronous throw INSIDE the lookup propagates out of the
1029
+ * connect call (may-throw seed). */
1030
+ "net.connectLookup": { argTypes: [F64, STRING, null], result: NETSOCKET_T },
1031
+ "net.sockWrite": { argTypes: [NETSOCKET_T, STRING], result: VOID },
1032
+ "net.sockWriteBytes": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
1033
+ "net.sockEnd": { argTypes: [NETSOCKET_T], result: VOID },
1034
+ "net.sockEndStr": { argTypes: [NETSOCKET_T, STRING], result: VOID },
1035
+ "net.sockEndBytes": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
1036
+ /** write/end with a CHECKED-DYNAMIC chunk (an untyped JS payload into a
1037
+ * typed socket): the runtime dispatches STR/BYTES and throws Node's
1038
+ * ERR_INVALID_ARG_TYPE chunk TypeError on any other kind. */
1039
+ "net.sockWriteDyn": { argTypes: [NETSOCKET_T, DYN], result: VOID },
1040
+ "net.sockEndDyn": { argTypes: [NETSOCKET_T, DYN], result: VOID },
1041
+ "net.sockDestroy": { argTypes: [NETSOCKET_T], result: VOID },
1042
+ "net.sockPipe": { argTypes: [NETSOCKET_T, NETSOCKET_T], result: VOID },
1043
+ /** socket.pipe(res) — raw socket chunks into a ServerResponse body
1044
+ * (the extended-CONNECT bridge leg): each chunk is a body write (the
1045
+ * response's own framing applies); source EOF end()s the response,
1046
+ * pipe's default. Borrows both. Never throws. */
1047
+ "net.sockPipeRes": { argTypes: [NETSOCKET_T, HTTPRES_T], result: VOID },
1048
+ "net.sockOnData": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
1049
+ "net.sockOnEnd": {
1050
+ argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL],
1051
+ result: VOID,
1052
+ },
1053
+ "net.sockOnClose": {
1054
+ argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL],
1055
+ result: VOID,
1056
+ },
1057
+ "net.sockOnError": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
1058
+ "net.sockOnConnect": {
1059
+ argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL],
1060
+ result: VOID,
1061
+ },
1062
+ // node:dgram + node:dns (scr_dgram.c). The message/error listeners and
1063
+ // dns.lookup's callback are program-dependent closures (null slots,
1064
+ // checked in the libCall case); dgram.address's record result is
1065
+ // program-dependent too (VOID here is the envGet sentinel — the libCall
1066
+ // case checks the {address, family, port} shape).
1067
+ /** node:dgram + node:dns (scr_dgram.c — linked, and
1068
+ * scr_dgram_install() emitted, only when one of these appears on the
1069
+ * IR; moduleUsesDgram is the switch — dns.lookup rides the same unit).
1070
+ * The net listener discipline verbatim: receivers borrowed, CALLBACKS
1071
+ * MOVE into the handle's registry and release at settlement, `on` vs
1072
+ * `once` is the trailing bool, registrations are void. bind/connect
1073
+ * bind NOW and defer 'listening'/'connect' to the next loop turn (the
1074
+ * net.listen story); their optional-host completions are ""
1075
+ * (bind → 0.0.0.0) and "127.0.0.1" (connect — udp4's Node default).
1076
+ * bind/connect/send/close/address THROW Node's state errors ("Socket
1077
+ * is already bound", "Already connected", "Not running") — may-throw
1078
+ * seeded. dgram.address returns the AddressInfo RECORD (the frontend
1079
+ * pins the {address, family, port} shape; the emitter builds it from
1080
+ * runtime parts). onMessage adapters are emitted per rinfo record
1081
+ * shape (the child.onExit precedent); onError reuses the child %Error
1082
+ * adapters. dns.lookup resolves via getaddrinfo AT CALL TIME and
1083
+ * defers the callback to the next turn (SEMANTICS.md documents the
1084
+ * blocking divergence); its per-union adapter builds the
1085
+ * `Error | null` first argument. */
1086
+ "dgram.createSocket": { argTypes: [BOOL], result: DGRAMSOCK_T },
1087
+ "dgram.bind": { argTypes: [DGRAMSOCK_T, F64, STRING], result: VOID },
1088
+ "dgram.bindCb": {
1089
+ argTypes: [DGRAMSOCK_T, F64, STRING, { kind: "func", params: [], ret: VOID }],
1090
+ result: VOID,
1091
+ },
1092
+ "dgram.connect": { argTypes: [DGRAMSOCK_T, F64, STRING], result: VOID },
1093
+ "dgram.connectCb": {
1094
+ argTypes: [DGRAMSOCK_T, F64, STRING, { kind: "func", params: [], ret: VOID }],
1095
+ result: VOID,
1096
+ },
1097
+ "dgram.sendStr": { argTypes: [DGRAMSOCK_T, STRING, F64, STRING], result: VOID },
1098
+ "dgram.sendBytes": { argTypes: [DGRAMSOCK_T, BYTES_U8, F64, STRING], result: VOID },
1099
+ /** The send argument-validation ladder over dyn arguments (Node's
1100
+ * signature shuffle: slice bounds, list/type contracts, port/address
1101
+ * validation, connected-state errors) — a fully-validated unconnected
1102
+ * single-payload send RUNS; callback/list/connected forms meet the
1103
+ * trailing fence. May-throw. */
1104
+ "dgram.sendChk": { argTypes: [DGRAMSOCK_T, DYN, DYN, DYN, DYN, DYN, STRING], result: VOID },
1105
+ "dgram.address": { argTypes: [DGRAMSOCK_T], result: VOID },
1106
+ "dgram.close": { argTypes: [DGRAMSOCK_T], result: VOID },
1107
+ "dgram.closeCb": {
1108
+ argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }],
1109
+ result: VOID,
1110
+ },
1111
+ "dgram.unref": { argTypes: [DGRAMSOCK_T], result: VOID },
1112
+ "dgram.ref": { argTypes: [DGRAMSOCK_T], result: VOID },
1113
+ "dgram.onMessage": { argTypes: [DGRAMSOCK_T, null, BOOL], result: VOID },
1114
+ "dgram.onError": { argTypes: [DGRAMSOCK_T, null, BOOL], result: VOID },
1115
+ "dgram.onListening": {
1116
+ argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL],
1117
+ result: VOID,
1118
+ },
1119
+ "dgram.onClose": {
1120
+ argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL],
1121
+ result: VOID,
1122
+ },
1123
+ "dgram.onConnect": {
1124
+ argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL],
1125
+ result: VOID,
1126
+ },
1127
+ "dns.lookup": { argTypes: [STRING, F64, null], result: VOID },
1128
+ // node:test (scr_test.c). Bodies are program-dependent closures (0 or
1129
+ // 1 testCtx param, void or Promise<void> result — the spoke pinned the
1130
+ // shape): null slots. sub's result is the settled Promise<void> the
1131
+ // await consumes.
1132
+ /** node:test (scr_test.c — linked only when one of these appears on
1133
+ * the IR; moduleUsesNodeTest is the switch, and the main epilogue asks
1134
+ * scr_test_exit_code() for the process's exit status). Strings are
1135
+ * BORROWED, callbacks MOVE. register/suite/hook attach to the runner
1136
+ * tree (register: name, mode 0|1|2 run/skip/todo, directive message ""
1137
+ * = none, cb or absent via registerEmpty, flags 1 async | 2 takes-ctx
1138
+ * | 4 only, "file:line:col"); suite runs its body AT registration
1139
+ * (Node's collection phase). sub is t.test — runs the subtest INLINE
1140
+ * on the runner fiber and returns the settled promise the await
1141
+ * consumes. ctxSkip/ctxTodo mark the running test; ctxDiagnostic
1142
+ * queues an ℹ line; ctxName reads t.name. Every registration keeps
1143
+ * the loop-run emitted (usesTimers) so the runner fiber drains. */
1144
+ "test.register": { argTypes: [STRING, F64, STRING, null, F64, STRING], result: VOID },
1145
+ "test.registerEmpty": { argTypes: [STRING, F64, STRING, F64, STRING], result: VOID },
1146
+ "test.suite": {
1147
+ argTypes: [STRING, F64, STRING, { kind: "func", params: [], ret: VOID }, STRING],
1148
+ result: VOID,
1149
+ },
1150
+ "test.hook": { argTypes: [F64, null, F64], result: VOID },
1151
+ "test.sub": {
1152
+ argTypes: [TESTCTX_T, STRING, F64, STRING, null, F64, STRING],
1153
+ result: { kind: "promise", inner: VOID },
1154
+ },
1155
+ "test.subEmpty": { argTypes: [TESTCTX_T, STRING, F64, STRING, STRING], result: VOID },
1156
+ "test.ctxSkip": { argTypes: [TESTCTX_T, STRING], result: VOID },
1157
+ "test.ctxTodo": { argTypes: [TESTCTX_T, STRING], result: VOID },
1158
+ "test.ctxDiagnostic": { argTypes: [TESTCTX_T, STRING], result: VOID },
1159
+ "test.ctxName": { argTypes: [TESTCTX_T], result: STRING },
1160
+ // node:http (scr_http.c over scr_net.c). The handler and the data
1161
+ // listeners are program-dependent closures (null slots, checked in the
1162
+ // libCall case); reqHeader's result is the interned string|undefined
1163
+ // union, checked like process.envGet.
1164
+ /** node:http, the server slice (scr_http.c over scr_net.c — linked
1165
+ * only when these appear on the IR; moduleUsesHttpServer is the
1166
+ * switch, and any http.* libCall also counts as net use so scr_net.c
1167
+ * links and installs). http.createServer's handler MOVES in and takes
1168
+ * the runtime adapters for its (req, res) / (req) / () shapes; req
1169
+ * body listeners follow the net.sockOnData story (bytes chunks, once
1170
+ * flags); reqHeader answers the interned `string | undefined` union
1171
+ * exactly like process.envGet; the res writers are borrowed-argument
1172
+ * voids with Node's framing decided in the runtime (Content-Length
1173
+ * for end-before-head, chunked after an explicit writeHead/write). */
1174
+ "http.createServer": { argTypes: [null], result: NETSERVER_T },
1175
+ /** http.createServer() / http.Server() with no handler — the
1176
+ * on("request") route; option helpers set parser behavior on a fresh
1177
+ * server before the constructor/factory result is returned. */
1178
+ "http.createServerEmpty": { argTypes: [], result: NETSERVER_T },
1179
+ "http.validateHeaderName": { argTypes: [STRING, STRING], result: VOID },
1180
+ "http.validateHeaderValue": { argTypes: [STRING, DYN], result: VOID },
1181
+ "http.serverJoinDupHeaders": { argTypes: [NETSERVER_T], result: VOID },
1182
+ "http.serverAllowMissingHostHeader": { argTypes: [NETSERVER_T], result: VOID },
1183
+ /** The five writable numeric http.Server timeout fields use one
1184
+ * selector ABI: 0 timeout, 1 keepAliveTimeout, 2 headersTimeout,
1185
+ * 3 requestTimeout, 4 keepAliveTimeoutBuffer. These calls store/read
1186
+ * the property values; timer enforcement remains outside this surface.
1187
+ * The constructor-option setter takes dyn so explicit undefined remains
1188
+ * distinguishable from a numeric value until its Node validation ladder. */
1189
+ "http.serverTimeoutGet": { argTypes: [NETSERVER_T, F64], result: F64 },
1190
+ "http.serverSetTimeout": { argTypes: [NETSERVER_T, F64], result: VOID },
1191
+ "http.serverSetTimeoutCb": { argTypes: [NETSERVER_T, F64, null], result: VOID },
1192
+ "http.serverOnTimeout": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
1193
+ "http.serverCloseAllConnections": { argTypes: [NETSERVER_T], result: VOID },
1194
+ "http.serverCloseIdleConnections": { argTypes: [NETSERVER_T], result: VOID },
1195
+ "http.serverTimeoutSet": { argTypes: [NETSERVER_T, F64, F64], result: VOID },
1196
+ "http.serverTimeoutOptionSet": { argTypes: [NETSERVER_T, F64, DYN], result: VOID },
1197
+ /** server.on("listening", cb) — the deferred listen-callback list. */
1198
+ "net.serverOnListening": {
1199
+ argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }, BOOL],
1200
+ result: VOID,
1201
+ },
1202
+ /** The ServerResponse member surface: statusCode/statusMessage reads
1203
+ * and assignments (Node's writable properties), the header CRUD trio
1204
+ * (getHeader answers `string | undefined` like reqHeader), and
1205
+ * end(cb)'s finish slot (resOnFinish registers, the end call follows —
1206
+ * the callback fires deferred, Node's 'finish' emit). writeHead's
1207
+ * statusMessage forms compose in interned helpers: resStatusMsgSet
1208
+ * then the ordinary writeHead entry. */
1209
+ "http.resStatusGet": { argTypes: [HTTPRES_T], result: F64 },
1210
+ "http.resStatusSet": { argTypes: [HTTPRES_T, F64], result: VOID },
1211
+ "http.resStatusMsgGet": { argTypes: [HTTPRES_T], result: VOID },
1212
+ "http.resStatusMsgSet": { argTypes: [HTTPRES_T, STRING], result: VOID },
1213
+ "http.resRequest": { argTypes: [HTTPRES_T], result: HTTPREQ_T },
1214
+ "http.resSocket": { argTypes: [HTTPRES_T], result: VOID },
1215
+ "http.resWritableFinished": { argTypes: [HTTPRES_T], result: BOOL },
1216
+ "http.resSendDateGet": { argTypes: [HTTPRES_T], result: BOOL },
1217
+ "http.resSendDateSet": { argTypes: [HTTPRES_T, BOOL], result: VOID },
1218
+ "http.resStrictContentLengthGet": { argTypes: [HTTPRES_T], result: BOOL },
1219
+ "http.resStrictContentLengthSet": { argTypes: [HTTPRES_T, BOOL], result: VOID },
1220
+ "http.resSetTimeout": { argTypes: [HTTPRES_T, F64], result: VOID },
1221
+ "http.resSetTimeoutCb": {
1222
+ argTypes: [HTTPRES_T, F64, { kind: "func", params: [], ret: VOID }],
1223
+ result: VOID,
1224
+ },
1225
+ // resGetHeader answers the interned `string | undefined` union — the
1226
+ // reqHeader/envGet sentinel pattern (VOID here, checked specially).
1227
+ "http.resGetHeader": { argTypes: [HTTPRES_T, STRING], result: VOID },
1228
+ "http.resGetHeaderNames": { argTypes: [HTTPRES_T], result: arrayOf(STRING) },
1229
+ "http.resGetRawHeaderNames": { argTypes: [HTTPRES_T], result: arrayOf(STRING) },
1230
+ "http.resGetHeaders": { argTypes: [HTTPRES_T], result: DYN },
1231
+ "http.resHasHeader": { argTypes: [HTTPRES_T, STRING], result: BOOL },
1232
+ "http.resRemoveHeader": { argTypes: [HTTPRES_T, STRING], result: VOID },
1233
+ "http.resOnFinish": {
1234
+ argTypes: [HTTPRES_T, { kind: "func", params: [], ret: VOID }],
1235
+ result: VOID,
1236
+ },
1237
+ "http.reqUrl": { argTypes: [HTTPREQ_T], result: STRING },
1238
+ "http.reqMethod": { argTypes: [HTTPREQ_T], result: STRING },
1239
+ "http.reqHeader": { argTypes: [HTTPREQ_T, STRING], result: VOID },
1240
+ "http.reqTrailer": { argTypes: [HTTPREQ_T, STRING], result: VOID },
1241
+ "http.reqHeaderValues": { argTypes: [HTTPREQ_T, STRING], result: VOID },
1242
+ "http.reqTrailerValues": { argTypes: [HTTPREQ_T, STRING], result: VOID },
1243
+ "http.reqOnData": { argTypes: [HTTPREQ_T, null, BOOL], result: VOID },
1244
+ "http.reqOnEnd": {
1245
+ argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL],
1246
+ result: VOID,
1247
+ },
1248
+ "http.resSetHeader": { argTypes: [HTTPRES_T, STRING, STRING], result: VOID },
1249
+ "http.resWriteHead": { argTypes: [HTTPRES_T, F64], result: VOID },
1250
+ "http.resWriteHeadN": {
1251
+ argTypes: [HTTPRES_T, F64, arrayOf(STRING), arrayOf(STRING)],
1252
+ result: VOID,
1253
+ },
1254
+ /** HTTP/1.1 informational heads; early hints takes flat string pairs,
1255
+ * with a lowercase `link` key required to send anything. */
1256
+ "http.resWriteContinue": { argTypes: [HTTPRES_T], result: VOID },
1257
+ "http.resWriteProcessing": { argTypes: [HTTPRES_T], result: VOID },
1258
+ "http.resWriteEarlyHints": { argTypes: [HTTPRES_T, arrayOf(STRING)], result: VOID },
1259
+ "http.resWrite": { argTypes: [HTTPRES_T, STRING], result: VOID },
1260
+ "http.resWriteBytes": { argTypes: [HTTPRES_T, BYTES_U8], result: VOID },
1261
+ "http.resEnd": { argTypes: [HTTPRES_T], result: VOID },
1262
+ "http.resEndStr": { argTypes: [HTTPRES_T, STRING], result: VOID },
1263
+ "http.resEndBytes": { argTypes: [HTTPRES_T, BYTES_U8], result: VOID },
1264
+ /** The checked-dynamic chunk twins (the net.sockWriteDyn story). */
1265
+ "http.resWriteDyn": { argTypes: [HTTPRES_T, DYN], result: VOID },
1266
+ "http.resEndDyn": { argTypes: [HTTPRES_T, DYN], result: VOID },
1267
+ "http.resHeadersSent": { argTypes: [HTTPRES_T], result: BOOL },
1268
+ "http.resWritableEnded": { argTypes: [HTTPRES_T], result: BOOL },
1269
+ "http.resFlushHeaders": { argTypes: [HTTPRES_T], result: VOID },
1270
+ "http.resAddTrailers": { argTypes: [HTTPRES_T, arrayOf(STRING)], result: VOID },
1271
+ "http.resCork": { argTypes: [HTTPRES_T], result: VOID },
1272
+ "http.resUncork": { argTypes: [HTTPRES_T], result: VOID },
1273
+ "http.resWritableCorked": { argTypes: [HTTPRES_T], result: F64 },
1274
+ // The member follow-ups: reqStatusCode's `number | undefined` and
1275
+ // sockRemoteAddress's `string | undefined` results are shape-checked in
1276
+ // the special cases in validate.ts (like reqHeader/columns).
1277
+ /** The server-surface member follow-ups: reqStatusCode answers the
1278
+ * interned `number | undefined` union (negative = the undefined arm —
1279
+ * a SERVER request, where Node's statusCode is undefined; every client
1280
+ * response carries a real status); reqSocket is the underlying
1281
+ * connection (+1, the same handle net.connect would give);
1282
+ * sockRemoteAddress answers `string | undefined` (NULL after the fd
1283
+ * closed, Node's destroyed-socket undefined; a dual-stack accept of an
1284
+ * IPv4 peer reads "::ffff:a.b.c.d" like Node). reqResume/reqDestroy and
1285
+ * the req error/close listener slots complete the IncomingMessage
1286
+ * surface portless's client responses use; resDestroy/resOnClose and
1287
+ * resWriteHeadPairs ([k0,v0,k1,v1,...] — the env.pairs helper's flat
1288
+ * shape) complete ServerResponse. sockSetTimeout arms the idle
1289
+ * EVFILT_TIMER ('timeout' fires after ms of inactivity, once per idle
1290
+ * period, never destroying the socket — Node's semantics). */
1291
+ "http.reqStatusCode": { argTypes: [HTTPREQ_T], result: VOID },
1292
+ // reqStatusMessage's `string | undefined` is program-interned like
1293
+ // reqHeader's (the VOID here is the envGet sentinel).
1294
+ "http.reqStatusMessage": { argTypes: [HTTPREQ_T], result: VOID },
1295
+ /** req.rawHeaders — [name, value, name, value, ...] in arrival order,
1296
+ * names in their ORIGINAL case (Node's shape); a fresh string[] per
1297
+ * read. reqStatusMessage answers the interned `string | undefined`
1298
+ * union — the reason phrase on client responses ("" when the status
1299
+ * line carried none), the undefined arm on server requests (the
1300
+ * statusCode split). sockDestroyed is socket.destroyed — true once the
1301
+ * fd is gone (destroy() or full close). */
1302
+ "http.reqRawHeaders": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
1303
+ /** The `{ ...req.headers }` snapshot feed: [lowercased name, value,
1304
+ * ...] pairs in arrival order — the interned %headers.snapshot helper
1305
+ * builds the record over it, exactly the process.envPairs pattern. */
1306
+ "http.reqHeaderPairs": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
1307
+ "http.reqRawTrailers": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
1308
+ "http.reqTrailerPairs": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
1309
+ "net.sockDestroyed": { argTypes: [NETSOCKET_T], result: BOOL },
1310
+ /** socket.writable — the write half is open: no end() yet, no FIN sent,
1311
+ * fd alive (connecting sockets answer true; writes queue). Node's
1312
+ * stream flag. Borrows; never throws. */
1313
+ "net.sockWritable": { argTypes: [NETSOCKET_T], result: BOOL },
1314
+ // The 'upgrade' registrations: the callback shapes are program-typed
1315
+ // ((req, socket, head) and shorter prefixes — the libCall case checks).
1316
+ /** The 'upgrade' events, both sides (SEMANTICS.md — the WebSocket
1317
+ * proxying surface): serverOnUpgrade registers (req, socket, head)
1318
+ * listeners fired INSTEAD of 'request' for Connection: upgrade
1319
+ * requests (the parser steps aside; the socket is raw; `head` carries
1320
+ * bytes past the request head; no listener = the socket destroys,
1321
+ * Node's default). clientOnUpgrade is the client twin: a 101 response
1322
+ * fires (res, socket, head) INSTEAD of 'response'. */
1323
+ "http.serverOnUpgrade": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
1324
+ /** server.on("connect", ...) — HTTP CONNECT tunneling, the 'upgrade'
1325
+ * machinery's twin: (req, socket, head) fired INSTEAD of 'request' for
1326
+ * CONNECT-method requests (no listener = the socket destroys, Node's
1327
+ * default). The h2 compat server's 'connect' (portless's RFC 8441
1328
+ * handler) only ever sees the HTTP/1.1 arm under the allowHTTP1
1329
+ * lowering, so a listener whose second parameter is a UNION with a
1330
+ * netSocket arm takes the socket wrapped at that arm (an emitted
1331
+ * per-shape adapter — the tags are program data). */
1332
+ "http.serverOnConnect": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
1333
+ "http.clientOnUpgrade": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
1334
+ "http.reqSocket": { argTypes: [HTTPREQ_T], result: NETSOCKET_T },
1335
+ // reqH2Stream's program-interned Http2Stream | undefined result is
1336
+ // checked in the special libCall cases in validate.ts.
1337
+ "http.reqH2Stream": { argTypes: [HTTPREQ_T], result: VOID },
1338
+ "http.reqH2StreamOrThrow": { argTypes: [HTTPREQ_T, STRING], result: HTTP2STREAM_T },
1339
+ /** req.pipe(dest) — the IncomingMessage body streaming into a
1340
+ * ServerResponse (the proxy's response leg), a ClientRequest (the
1341
+ * request-body forward), or a raw socket (the upgrade-rejection leg);
1342
+ * chunk-for-chunk, natural end ends the destination (Node's pipe
1343
+ * default; no backpressure — divergence 54's stream model). */
1344
+ "http.reqPipeRes": { argTypes: [HTTPREQ_T, HTTPRES_T], result: VOID },
1345
+ "http.reqPipeClient": { argTypes: [HTTPREQ_T, HTTPCLIENTREQ_T], result: VOID },
1346
+ "http.reqPipeSock": { argTypes: [HTTPREQ_T, NETSOCKET_T], result: VOID },
1347
+ "http.reqResume": { argTypes: [HTTPREQ_T], result: VOID },
1348
+ "http.reqDestroy": { argTypes: [HTTPREQ_T], result: VOID },
1349
+ "http.reqOnError": { argTypes: [HTTPREQ_T, null, BOOL], result: VOID },
1350
+ "http.reqOnClose": {
1351
+ argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL],
1352
+ result: VOID,
1353
+ },
1354
+ "http.reqOnAborted": {
1355
+ argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL],
1356
+ result: VOID,
1357
+ },
1358
+ "http.reqHttpVersion": { argTypes: [HTTPREQ_T], result: STRING },
1359
+ "http.reqHttpVersionMajor": { argTypes: [HTTPREQ_T], result: F64 },
1360
+ "http.reqHttpVersionMinor": { argTypes: [HTTPREQ_T], result: F64 },
1361
+ "http.reqAborted": { argTypes: [HTTPREQ_T], result: BOOL },
1362
+ "http.reqComplete": { argTypes: [HTTPREQ_T], result: BOOL },
1363
+ "http.resDestroy": { argTypes: [HTTPRES_T], result: VOID },
1364
+ "http.resOnClose": {
1365
+ argTypes: [HTTPRES_T, { kind: "func", params: [], ret: VOID }, BOOL],
1366
+ result: VOID,
1367
+ },
1368
+ "http.resWriteHeadPairs": { argTypes: [HTTPRES_T, F64, arrayOf(STRING)], result: VOID },
1369
+ /** writeHead(status, headers) with a checked-dynamic headers value —
1370
+ * the runtime OBJ walk (string/number values; loud fences otherwise;
1371
+ * may throw). */
1372
+ "http.resWriteHeadDyn": { argTypes: [HTTPRES_T, F64, DYN], result: VOID },
1373
+ "net.sockSetTimeout": { argTypes: [NETSOCKET_T, F64], result: VOID },
1374
+ /** setEncoding('utf8') — 'data' delivers strings inside the chunk-encoding window; other real encodings fence loudly, unknown names throw ERR_UNKNOWN_ENCODING (may throw). */
1375
+ "net.sockSetEncoding": { argTypes: [NETSOCKET_T, STRING], result: VOID },
1376
+ "http.reqSetEncoding": { argTypes: [HTTPREQ_T, STRING], result: VOID },
1377
+ "net.sockOnTimeout": {
1378
+ argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL],
1379
+ result: VOID,
1380
+ },
1381
+ "net.sockRemoteAddress": { argTypes: [NETSOCKET_T], result: VOID },
1382
+ /** socket.encrypted — `boolean | undefined`: the true arm iff the
1383
+ * socket carries a TLS transport (Node types `encrypted: true` on
1384
+ * TLSSocket; plain sockets answer undefined — the proxy.ts isEncrypted
1385
+ * idiom reads it through a cast). */
1386
+ "net.sockEncrypted": { argTypes: [NETSOCKET_T], result: VOID },
1387
+ // node:http, the client slice. The response callback shapes are
1388
+ // program-dependent (checked by validate.ts); header pairs arrive flat.
1389
+ /** node:http, the CLIENT slice (http.request/http.get over the net
1390
+ * client machinery): request/requestCb take (host, port, path, method,
1391
+ * timeoutMs, headerPairs, autoEnd[, responseCb]) — headerPairs is the
1392
+ * flat [k0,v0,...] array (empty for none), autoEnd true is http.get's
1393
+ * eager end(). The handle owns one dialed connection (NO pooling — the
1394
+ * wire still carries Node's exact head: user headers, then Host,
1395
+ * Connection: keep-alive, and the framing header; the socket closes
1396
+ * when the response completes). The response delivered to responseCb /
1397
+ * 'response' listeners IS an httpReq (IncomingMessage), status and
1398
+ * headers parsed from the wire, body via reqOnData/reqOnEnd. Errors are
1399
+ * Node-shaped ('connect ECONNREFUSED ip:port', 'socket hang up') and
1400
+ * fire 'error' then 'close'; an unhandled 'error' exits 1 like every
1401
+ * net handle. clientWrite before end commits to chunked framing unless
1402
+ * the caller set content-length; clientEnd(data) before any write sends
1403
+ * Content-Length exactly like Node. */
1404
+ "http.request": {
1405
+ argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL],
1406
+ result: HTTPCLIENTREQ_T,
1407
+ },
1408
+ "http.requestCb": {
1409
+ argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, null],
1410
+ result: HTTPCLIENTREQ_T,
1411
+ },
1412
+ /** new http.Agent(opts) / new https.Agent(opts): (secure, keepAlive,
1413
+ * keepAliveMsecs, maxSockets, maxFreeSockets, timeoutMs, port) — the
1414
+ * numeric options arrive < 0 for "unset" (Infinity/256/none; port
1415
+ * seeds the settable defaultPort, Node's option merge). Returns the
1416
+ * Agent as a checked-dynamic HANDLE (getName/destroy and the
1417
+ * sockets/requests/freeSockets counters dispatch through the dyn
1418
+ * handle ops). keepAlive: true THROWS the named construction fence —
1419
+ * socket POOLING is not modeled (one dial per request); maxSockets
1420
+ * accounting is real: over-limit requests defer their dial and queue.
1421
+ * MAY THROW. */
1422
+ "http.agentNew": { argTypes: [BOOL, BOOL, F64, F64, F64, F64, F64], result: DYN },
1423
+ /** The agent-threaded request rows: the http.request/https.request
1424
+ * shape with a trailing `agent` dyn argument (an Agent handle, false —
1425
+ * the one-shot Connection: close dial — or null/undefined for the
1426
+ * default path). port < 0 means "no port option": the agent's settable
1427
+ * defaultPort, then the scheme's. MAY THROW (a non-Agent value is
1428
+ * Node's ERR_INVALID_ARG_TYPE). */
1429
+ "http.requestAgent": {
1430
+ argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, DYN],
1431
+ result: HTTPCLIENTREQ_T,
1432
+ },
1433
+ "http.requestAgentCb": {
1434
+ argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, DYN, null],
1435
+ result: HTTPCLIENTREQ_T,
1436
+ },
1437
+ /** request/get with a URL-STRING first argument: the runtime parses it
1438
+ * (WHATWG) and dials — throws catchably on an unparsable input or a
1439
+ * non-http scheme. */
1440
+ "http.requestUrl": { argTypes: [STRING, STRING, BOOL], result: HTTPCLIENTREQ_T },
1441
+ "http.requestUrlCb": { argTypes: [STRING, STRING, BOOL, null], result: HTTPCLIENTREQ_T },
1442
+ /** The paused-mode demux surface (portless's first-byte TLS peek:
1443
+ * once('readable') + read(1) + unshift + emit('connection')).
1444
+ * sockOnReadable registers a zero-param listener (a consumer: arrived
1445
+ * bytes buffer instead of flowing, and EOF announces too); sockRead
1446
+ * answers `Buffer | null` (exactly n buffered bytes, or null — Node's
1447
+ * less-than-n answer; n <= 0 drains everything); sockUnshift returns
1448
+ * bytes to the front of the stream; serverEmitConnection routes a
1449
+ * socket into another server's protocol layer (a TLS target's
1450
+ * 'connection' waits for its handshake). */
1451
+ "net.sockOnReadable": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
1452
+ // sockRead's result is the interned `Buffer | null` union — checked
1453
+ // specially in validate.ts (the reqHeader/envGet pattern; VOID here is a
1454
+ // placeholder the special case overrides).
1455
+ "net.sockRead": { argTypes: [NETSOCKET_T, F64], result: VOID },
1456
+ "net.sockUnshift": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
1457
+ /** Socket flow control and the compat surface: pause/resume (reads
1458
+ * gate off/on — kernel backpressure holds paused bytes; resume flows
1459
+ * and discards sans listeners) and setNoDelay answer the SOCKET (+1,
1460
+ * Node's chaining); destroySoon ends now and destroys once the FIN
1461
+ * flushed; bytesWritten counts accepted bytes; readable is true until
1462
+ * the read half ends. */
1463
+ "net.sockPause": { argTypes: [NETSOCKET_T], result: NETSOCKET_T },
1464
+ "net.sockResume": { argTypes: [NETSOCKET_T], result: NETSOCKET_T },
1465
+ "net.sockSetNoDelay": { argTypes: [NETSOCKET_T, BOOL], result: NETSOCKET_T },
1466
+ "net.sockDestroySoon": { argTypes: [NETSOCKET_T], result: VOID },
1467
+ "net.sockBytesWritten": { argTypes: [NETSOCKET_T], result: F64 },
1468
+ "net.sockReadable": { argTypes: [NETSOCKET_T], result: BOOL },
1469
+ /** socket.on('finish', cb) / end(cb): fires once when the FIN goes out
1470
+ * (sweep-deferred, never the registering stack). */
1471
+ "net.sockOnFinish": {
1472
+ argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }],
1473
+ result: VOID,
1474
+ },
1475
+ "net.serverEmitConnection": { argTypes: [NETSERVER_T, NETSOCKET_T], result: VOID },
1476
+ // tls/https: cert/key/ca PEM arguments are strings OR Buffers (null =
1477
+ // both accepted; the emitter passes data+len either way).
1478
+ /** node:tls + node:https (scr_tls.c over scr_net.c/scr_http.c, with
1479
+ * the vendored mbedTLS archive — linked only when one of these appears
1480
+ * on the IR; moduleUsesTls is the switch, and every tls/https libCall
1481
+ * also counts as net AND http use so both units link and install).
1482
+ * tls.createServer takes (cert, key[, handler]) — cert/key are PEM
1483
+ * strings or Buffers (the emitter passes data+len for either); the
1484
+ * handler is Node's 'secureConnection' (fires post-handshake with a
1485
+ * socket that behaves exactly like a net socket, the same adapters as
1486
+ * net.createServer). https.createServer is (cert, key, handler) with
1487
+ * the http request-handler adapters. https.request/requestCb extend
1488
+ * the http client row with (…, rejectUnauthorized: bool, ca: PEM
1489
+ * string/Buffer — "" for none) and default port 443; everything else
1490
+ * (write/end/destroy/events, the response surface) IS the http client
1491
+ * surface — the handles are the same kinds. */
1492
+ "tls.createServer": { argTypes: [null, null], result: NETSERVER_T },
1493
+ "tls.createServerCb": { argTypes: [null, null, null], result: NETSERVER_T },
1494
+ // The runtime options records (divergence 66's stance): a dyn options
1495
+ // value whose members read at runtime; pemDyn extracts a runtime-valued
1496
+ // cert/key member (arg 1 is the precomposed fence label).
1497
+ /** RUNTIME options records (the divergence-66 stance): the *Dyn
1498
+ * creators take a checked-dynamic (dyn) options value whose members
1499
+ * read at runtime — cert/key extract like the literal path, members
1500
+ * whose literal forms fence THROW the catchable fence at runtime, and
1501
+ * undocumented keys drop like Node drops them. tls.pemDyn is the
1502
+ * literal walk's runtime-valued cert/key extraction: (value, whatLit)
1503
+ * → PEM bytes (strings/Buffers/one-element arrays of those) or the
1504
+ * thrown fence. All of them may throw. */
1505
+ "tls.pemDyn": { argTypes: [DYN, STRING], result: BYTES_U8 },
1506
+ "tls.createServerDyn": { argTypes: [DYN], result: NETSERVER_T },
1507
+ "tls.createServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
1508
+ "https.createServerDyn": { argTypes: [DYN], result: NETSERVER_T },
1509
+ "https.createServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
1510
+ /** createSecureServer(options, handler) — the eager COMPAT handler as
1511
+ * the first 'request' listener (Node's exact route), on both literal
1512
+ * flavors: Req is the dual ALPN allowHTTP1 server, H2Req the ALPN=h2-only
1513
+ * server (both use compat handles over h2 streams). Args are
1514
+ * (cert, key, cb, enableConnectProtocol). */
1515
+ "http2.createSecureServerReq": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
1516
+ "http2.createSecureServerH2Req": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
1517
+ /** createSecureServer with a RUNTIME options record (the divergence-66
1518
+ * stance): allowHTTP1/cert/key read at runtime — allowHTTP1 picks the
1519
+ * flavor, the TLS server walk fences its out-of-bounds members with
1520
+ * the catchable runtime fence, and h2 session-tuning keys drop exactly
1521
+ * like the literal walk ignores them. May throw. The Cb form carries
1522
+ * the eager compat handler. */
1523
+ "http2.createSecureServerDyn": { argTypes: [DYN], result: NETSERVER_T },
1524
+ "http2.createSecureServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
1525
+ // tls.connect(port, host, opts[, cb]) — port -1 / host "" read the
1526
+ // options record; the callback fires post-handshake (secureConnect).
1527
+ /** tls.connect — the TLS client socket: (port, host, opts[, cb]) where
1528
+ * port -1 reads options.port, host "" reads options.host, and opts is
1529
+ * the runtime (dyn) options record (rejectUnauthorized/ca/servername
1530
+ * implemented; other documented members throw the runtime fence). The
1531
+ * callback fires post-handshake — Node's secureConnect timing. */
1532
+ "tls.connect": { argTypes: [F64, STRING, DYN], result: NETSOCKET_T },
1533
+ "tls.connectCb": { argTypes: [F64, STRING, DYN, null], result: NETSOCKET_T },
1534
+ // The TLSSocket member surface (authError's `string | null` union is
1535
+ // shape-checked in the special cases in validate.ts — the reqHeader pattern).
1536
+ /** The TLSSocket member surface on the socket kind: authorized (bool —
1537
+ * Node's verify verdict), authorizationError (the verify-failure CODE
1538
+ * STRING or null), the 'secureConnect' registration (a TLS socket's
1539
+ * conn list fires at establishment; plain sockets never fire it), and
1540
+ * the 'session' registration (fires once with the serialized session —
1541
+ * a Buffer; the received-ticket event). */
1542
+ "tls.sockAuthorized": { argTypes: [NETSOCKET_T], result: BOOL },
1543
+ "tls.sockAuthError": { argTypes: [NETSOCKET_T], result: VOID },
1544
+ "tls.sockOnSecureConnect": {
1545
+ argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL],
1546
+ result: VOID,
1547
+ },
1548
+ "tls.sockOnSession": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
1549
+ // createSecureContext({ cert, key }) mints the opaque SNI-answer handle.
1550
+ /** tls.createSecureContext({ cert, key }) — parses the PEM pair into an
1551
+ * opaque SecureContext handle (secureCtx kind) for SNI callbacks to
1552
+ * answer with; cert/key are PEM strings or Buffers like createServer's. */
1553
+ "tls.createSecureContext": { argTypes: [null, null], result: SECURECTX_T },
1554
+ /** createSecureContext over a RUNTIME options record (the checked-
1555
+ * dynamic lane): Node's typed option validations first (the ciphers/
1556
+ * passphrase/engine/version/timeout/ticketKeys ladders), then the pem
1557
+ * walk — a validated { cert, key } bag builds the real context.
1558
+ * May-throw. */
1559
+ "tls.createSecureContextDyn": { argTypes: [DYN], result: SECURECTX_T },
1560
+ /** tls.getCACertificates(type): validateString + the documented name
1561
+ * set, then the trailing compiler-rendered fence — ALWAYS THROWS (the
1562
+ * error.nodeThrow polymorphic-result carve-out). May-throw seed. */
1563
+ "tls.caCertsChk": { argTypes: [DYN, STRING], result: VOID },
1564
+ // The CA-store introspection unit (scr_tls_ca.c): per-type cached PEM
1565
+ // string arrays and the default-set replacement.
1566
+ /** The CA-store introspection surface (scr_tls_ca.c — its own unit and
1567
+ * link gate, "tlsca." NOT "tls.", so a getCACertificates-only binary
1568
+ * never pulls mbedTLS): tlsca.get is tls.getCACertificates(type) — the
1569
+ * cached per-type string[] of PEM blocks (identity-stable across calls,
1570
+ * Node's caching; an unknown type throws Node's ERR_INVALID_ARG_VALUE
1571
+ * TypeError); tlsca.root is the tls.rootCertificates value read;
1572
+ * tlsca.set is tls.setDefaultCACertificates(certs) — replaces the
1573
+ * default set (deduped) and the anchors the TLS client verifies
1574
+ * against, throwing Node's ERR_CRYPTO_OPERATION_FAILED when no entry
1575
+ * carries a certificate block. */
1576
+ "tlsca.get": { argTypes: [STRING], result: arrayOf(STRING) },
1577
+ "tlsca.root": { argTypes: [], result: arrayOf(STRING) },
1578
+ "tlsca.set": { argTypes: [arrayOf(STRING)], result: VOID },
1579
+ "https.createServer": { argTypes: [null, null, null], result: NETSERVER_T },
1580
+ // http2's allowHTTP1 compatibility server (divergence 57): cert/key
1581
+ // like tls.createServer; the 'request' handler arrives separately via
1582
+ // http.serverOnRequest (shape checked in the libCall case, like
1583
+ // http.createServer's). sessionError callback shape is checked by validate.ts.
1584
+ /** node:http2 allowHTTP1: one TLS server advertises h2 + http/1.1 and
1585
+ * dispatches to the matching parser after ALPN. Request listeners mirror
1586
+ * into both compatibility lists; the remaining session/req.stream rows
1587
+ * below retain their explicitly limited behavior. */
1588
+ "http2.createSecureServer": { argTypes: [null, null, BOOL], result: NETSERVER_T },
1589
+ // The SNI-callback form: arg 2 is the JS SNICallback closure — a
1590
+ // `(servername, cb) => void` func, or its `| undefined` union from the
1591
+ // conditional-spread spelling (the libCall case checks the shape).
1592
+ /** createSecureServer with an SNI callback: args are (cert, key, sniCb)
1593
+ * where sniCb is the JS SNICallback — a `(servername, cb) => void`
1594
+ * closure, or the `SNICallback | undefined` union from the conditional-
1595
+ * spread spelling (`...(x ? { SNICallback: x } : {})`; the emitter
1596
+ * unwraps the union — the undefined arm means "no callback", exactly
1597
+ * the no-SNI server). The runtime parses each connection's ClientHello
1598
+ * for the server_name extension BEFORE the TLS handshake begins, calls
1599
+ * the callback with (servername, answer-closure), and resumes the
1600
+ * handshake when the answer arrives — cb(err) tears the socket down
1601
+ * silently (Node's 'tlsClientError' default), cb(null, ctx) serves
1602
+ * ctx's cert/key, cb(null, undefined) serves the default pair. */
1603
+ "http2.createSecureServerSni": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
1604
+ // The ALPN=h2 server (createSecureServer without allowHTTP1): the real
1605
+ // h2 session machinery behind the TLS handshake.
1606
+ /** The REAL h2-over-TLS server (createSecureServer WITHOUT allowHTTP1):
1607
+ * scr_http2_create_secure_server — the h2c session machinery behind an
1608
+ * mbedTLS handshake whose ALPN advertises h2 alone (an http/1.1-only
1609
+ * client fails the handshake with no_application_protocol, Node's
1610
+ * h2-only split). args are (cert, key) — PEM strings or Buffers. */
1611
+ "http2.createSecureServerH2": { argTypes: [null, null, BOOL], result: NETSERVER_T },
1612
+ "http.serverOnRequest": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
1613
+ "http2.serverOnSessionError": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
1614
+ /** The guarded absent-session compatibility call remains a no-op. */
1615
+ "http2.streamNoop": { argTypes: [], result: VOID },
1616
+ /** The UNGUARDED h2-only stream call (`req.stream.on(...)`): stream is
1617
+ * undefined on every connection the allowHTTP1 lowering accepts — and
1618
+ * on every HTTP/1.1 connection of Node's own allowHTTP1 server — so the
1619
+ * call IS Node's member read on undefined: throws the exact catchable
1620
+ * TypeError ("Cannot read properties of undefined (reading 'on')").
1621
+ * One arg: the read member's name (a string literal). Never returns. */
1622
+ "http2.streamUndefCall": { argTypes: [STRING], result: VOID },
1623
+ // The REAL h2c surface (scr_http2.c). Callback slots are null (the
1624
+ // emitter picks the thunk); pairs slots are string arrays; the
1625
+ // endStream tri-state and event flags ride as f64.
1626
+ /** node:http2, the REAL h2c surface (scr_http2.c — frame codec + HPACK
1627
+ * over the net loop; the design note atop that file has the story).
1628
+ * Sessions and streams are first-class handle kinds; 'stream'/'response'
1629
+ * payloads cross as flat [name, value, ...] pairs arrays and an EMITTED
1630
+ * adapter closure builds the program-side headers record (the response
1631
+ * :status rides separately as a number). */
1632
+ "http2.createServer": { argTypes: [], result: NETSERVER_T },
1633
+ "http2.createServerReq": { argTypes: [null], result: NETSERVER_T },
1634
+ "http2.serverOnStream": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
1635
+ "http2.serverOnSession": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
1636
+ // connect(authority, reject, ca[, cb]): the TLS client knobs an https
1637
+ // authority reads (inert on http ones, exactly Node); ca is a PEM
1638
+ // string/Buffer ("" = the system anchors).
1639
+ /** connect(authority[, listener]) — h2c prior knowledge; the listener
1640
+ * closure (if any) is the 'connect' once-listener. */
1641
+ "http2.connect": { argTypes: [STRING, BOOL, null], result: HTTP2SESSION_T },
1642
+ "http2.connectCb": { argTypes: [STRING, BOOL, null, null], result: HTTP2SESSION_T },
1643
+ /** session.request(pairs?, endStream) — endStream is a tri-state f64:
1644
+ * -1 the method's payload-meaningless default, 0/1 explicit. */
1645
+ "http2.sessionRequest": {
1646
+ argTypes: [HTTP2SESSION_T, arrayOf(STRING), F64],
1647
+ result: HTTP2STREAM_T,
1648
+ },
1649
+ "http2.sessionClose": { argTypes: [HTTP2SESSION_T], result: VOID },
1650
+ "http2.sessionCloseCb": { argTypes: [HTTP2SESSION_T, null], result: VOID },
1651
+ "http2.sessionDestroy": { argTypes: [HTTP2SESSION_T], result: VOID },
1652
+ "http2.sessionOnClose": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
1653
+ "http2.sessionOnError": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
1654
+ "http2.sessionOnConnect": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
1655
+ "http2.sessionOnStream": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
1656
+ "http2.sessionOnGoaway": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
1657
+ "http2.sessionClosed": { argTypes: [HTTP2SESSION_T], result: BOOL },
1658
+ "http2.sessionDestroyed": { argTypes: [HTTP2SESSION_T], result: BOOL },
1659
+ "http2.sessionEncrypted": { argTypes: [HTTP2SESSION_T], result: BOOL },
1660
+ "http2.sessionType": { argTypes: [HTTP2SESSION_T], result: F64 },
1661
+ "http2.sessionAlpn": { argTypes: [HTTP2SESSION_T], result: STRING },
1662
+ "http2.sessionSocket": { argTypes: [HTTP2SESSION_T], result: NETSOCKET_T },
1663
+ /** stream.respond(pairs?, endStream) — the server answer. */
1664
+ "http2.streamRespond": { argTypes: [HTTP2STREAM_T, arrayOf(STRING), BOOL], result: VOID },
1665
+ "http2.streamWrite": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
1666
+ "http2.streamWriteBytes": { argTypes: [HTTP2STREAM_T, BYTES_U8], result: VOID },
1667
+ "http2.streamEnd": { argTypes: [HTTP2STREAM_T], result: VOID },
1668
+ "http2.streamEndStr": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
1669
+ "http2.streamEndBytes": { argTypes: [HTTP2STREAM_T, BYTES_U8], result: VOID },
1670
+ "http2.streamClose": { argTypes: [HTTP2STREAM_T, F64], result: VOID },
1671
+ "http2.streamCloseCb": { argTypes: [HTTP2STREAM_T, F64, null], result: VOID },
1672
+ "http2.streamDestroy": { argTypes: [HTTP2STREAM_T], result: VOID },
1673
+ "http2.sessionSettings0": { argTypes: [HTTP2SESSION_T], result: VOID },
1674
+ "http2.sessionSettings": { argTypes: [HTTP2SESSION_T, DYN], result: VOID },
1675
+ "http2.sessionSettingsDynCb": { argTypes: [HTTP2SESSION_T, DYN, DYN], result: VOID },
1676
+ "http2.sessionSettingsCb0": {
1677
+ argTypes: [HTTP2SESSION_T, DYN, { kind: "func", params: [], ret: VOID }],
1678
+ result: VOID,
1679
+ },
1680
+ "http2.sessionOnSettingsDyn": { argTypes: [HTTP2SESSION_T, DYN, BOOL, BOOL], result: VOID },
1681
+ "http2.sessionOnSettings0": {
1682
+ argTypes: [HTTP2SESSION_T, { kind: "func", params: [], ret: VOID }, BOOL, BOOL],
1683
+ result: VOID,
1684
+ },
1685
+ "http2.sessionSettingsGet": { argTypes: [HTTP2SESSION_T, BOOL], result: DYN },
1686
+ "http2.sessionPendingSettingsAck": { argTypes: [HTTP2SESSION_T], result: BOOL },
1687
+ "http2.getDefaultSettings": { argTypes: [], result: DYN },
1688
+ "http2.streamSetEncoding": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
1689
+ "http2.streamSetEncodingRet": { argTypes: [HTTP2STREAM_T, STRING], result: HTTP2STREAM_T },
1690
+ "http2.streamResume": { argTypes: [HTTP2STREAM_T], result: VOID },
1691
+ "http2.streamPause": { argTypes: [HTTP2STREAM_T], result: VOID },
1692
+ "http2.streamOnData": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
1693
+ "http2.streamOnEnd": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
1694
+ "http2.streamOnClose": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
1695
+ "http2.streamOnAborted": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
1696
+ "http2.streamOnError": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
1697
+ "http2.streamOnResponse": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
1698
+ "http2.streamId": { argTypes: [HTTP2STREAM_T], result: F64 },
1699
+ "http2.streamRstCode": { argTypes: [HTTP2STREAM_T], result: F64 },
1700
+ "http2.streamDestroyed": { argTypes: [HTTP2STREAM_T], result: BOOL },
1701
+ "http2.streamClosed": { argTypes: [HTTP2STREAM_T], result: BOOL },
1702
+ "http2.streamAborted": { argTypes: [HTTP2STREAM_T], result: BOOL },
1703
+ "http2.streamPending": { argTypes: [HTTP2STREAM_T], result: BOOL },
1704
+ "http2.streamSession": { argTypes: [HTTP2STREAM_T], result: HTTP2SESSION_T },
1705
+ // The createConnection forms: arg 0 is the dialer closure (() =>
1706
+ // Socket — the libCall case checks), then path/method/timeout/headers/
1707
+ // autoEnd like http.request.
1708
+ /** The createConnection form (the proxy's own dialer): args are
1709
+ * (connCb, path, method, timeout, headers, autoEnd[, cb]) — connCb is
1710
+ * a `() => net.Socket` closure the runtime invokes ONCE, synchronously
1711
+ * (Node's onSocket timing); everything else matches http.request. The
1712
+ * Host header defaults to "localhost" — a headers.host entry wins
1713
+ * verbatim, the proxy shape. */
1714
+ "http.requestConn": {
1715
+ argTypes: [null, STRING, STRING, F64, arrayOf(STRING), BOOL],
1716
+ result: HTTPCLIENTREQ_T,
1717
+ },
1718
+ "http.requestConnCb": {
1719
+ argTypes: [null, STRING, STRING, F64, arrayOf(STRING), BOOL, null],
1720
+ result: HTTPCLIENTREQ_T,
1721
+ },
1722
+ "https.request": {
1723
+ argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null],
1724
+ result: HTTPCLIENTREQ_T,
1725
+ },
1726
+ "https.requestCb": {
1727
+ argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, null],
1728
+ result: HTTPCLIENTREQ_T,
1729
+ },
1730
+ /** The URL-string first argument, the http.requestUrl row over TLS:
1731
+ * no options means Node's defaults (verification on, default trust
1732
+ * anchors), and a non-https scheme is ERR_INVALID_PROTOCOL. */
1733
+ "https.requestUrl": { argTypes: [STRING, STRING, BOOL], result: HTTPCLIENTREQ_T },
1734
+ "https.requestUrlCb": { argTypes: [STRING, STRING, BOOL, null], result: HTTPCLIENTREQ_T },
1735
+ "https.requestAgent": {
1736
+ argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, DYN],
1737
+ result: HTTPCLIENTREQ_T,
1738
+ },
1739
+ "https.requestAgentCb": {
1740
+ argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, DYN, null],
1741
+ result: HTTPCLIENTREQ_T,
1742
+ },
1743
+ // The requestFn binding's runtime-secure rows: https.request's shape
1744
+ // with the leading `secure` bool.
1745
+ /** A call through a `const requestFn = tls ? https.request :
1746
+ * http.request` binding — the module-function-as-value ternary between
1747
+ * the two known clients: the https.request row with a leading `secure`
1748
+ * bool that picks the dial at RUNTIME (true = the TLS client, exactly
1749
+ * https.request; false = the plain client, exactly http.request —
1750
+ * rejectUnauthorized/ca ignored there like Node ignores TLS options on
1751
+ * http.request). The "https." prefix keeps the TLS unit linked. */
1752
+ "https.requestFn": {
1753
+ argTypes: [BOOL, STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null],
1754
+ result: HTTPCLIENTREQ_T,
1755
+ },
1756
+ "https.requestFnCb": {
1757
+ argTypes: [BOOL, STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, null],
1758
+ result: HTTPCLIENTREQ_T,
1759
+ },
1760
+ "http.clientWrite": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
1761
+ "http.clientSetHeader": { argTypes: [HTTPCLIENTREQ_T, STRING, STRING], result: VOID },
1762
+ "http.clientGetHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
1763
+ "http.clientHasHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: BOOL },
1764
+ "http.clientRemoveHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
1765
+ "http.clientGetHeaderNames": { argTypes: [HTTPCLIENTREQ_T], result: arrayOf(STRING) },
1766
+ "http.clientGetRawHeaderNames": { argTypes: [HTTPCLIENTREQ_T], result: arrayOf(STRING) },
1767
+ "http.clientGetHeaders": { argTypes: [HTTPCLIENTREQ_T], result: DYN },
1768
+ "http.clientWriteBytes": { argTypes: [HTTPCLIENTREQ_T, BYTES_U8], result: VOID },
1769
+ "http.clientEnd": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
1770
+ "http.clientEndStr": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
1771
+ "http.clientEndBytes": { argTypes: [HTTPCLIENTREQ_T, BYTES_U8], result: VOID },
1772
+ /** The checked-dynamic chunk twins (the net.sockWriteDyn story). */
1773
+ "http.clientWriteDyn": { argTypes: [HTTPCLIENTREQ_T, DYN], result: VOID },
1774
+ "http.clientEndDyn": { argTypes: [HTTPCLIENTREQ_T, DYN], result: VOID },
1775
+ "http.clientFlushHeaders": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
1776
+ "http.clientAddTrailers": { argTypes: [HTTPCLIENTREQ_T, arrayOf(STRING)], result: VOID },
1777
+ "http.clientCork": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
1778
+ "http.clientUncork": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
1779
+ "http.clientWritableCorked": { argTypes: [HTTPCLIENTREQ_T], result: F64 },
1780
+ "http.clientMethod": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
1781
+ "http.clientPath": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
1782
+ "http.clientHost": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
1783
+ "http.clientProtocol": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
1784
+ "http.clientHeadersSent": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
1785
+ "http.clientWritableEnded": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
1786
+ "http.clientWritableFinished": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
1787
+ "http.clientSocket": { argTypes: [HTTPCLIENTREQ_T], result: NETSOCKET_T },
1788
+ "http.clientReusedSocket": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
1789
+ "http.clientSetNoDelay": { argTypes: [HTTPCLIENTREQ_T, BOOL], result: VOID },
1790
+ "http.clientSetSocketKeepAlive": { argTypes: [HTTPCLIENTREQ_T, BOOL, F64], result: VOID },
1791
+ "http.clientSetTimeout": { argTypes: [HTTPCLIENTREQ_T, F64], result: VOID },
1792
+ "http.clientSetTimeoutCb": {
1793
+ argTypes: [HTTPCLIENTREQ_T, F64, { kind: "func", params: [], ret: VOID }],
1794
+ result: VOID,
1795
+ },
1796
+ "http.statusCodes": { argTypes: [], result: DYN },
1797
+ "http.methods": { argTypes: [], result: arrayOf(STRING) },
1798
+ "http.reqSetTimeout": { argTypes: [HTTPREQ_T, F64], result: VOID },
1799
+ "http.reqSetTimeoutCb": {
1800
+ argTypes: [HTTPREQ_T, F64, { kind: "func", params: [], ret: VOID }],
1801
+ result: VOID,
1802
+ },
1803
+ "http.clientDestroy": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
1804
+ "http.clientAbort": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
1805
+ "http.clientAborted": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
1806
+ "http.clientDestroyed": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
1807
+ "http.clientOnResponse": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
1808
+ "http.clientOnSocket": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
1809
+ "http.clientOnFinish": {
1810
+ argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL],
1811
+ result: VOID,
1812
+ },
1813
+ "http.clientOnError": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
1814
+ "http.clientOnTimeout": {
1815
+ argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL],
1816
+ result: VOID,
1817
+ },
1818
+ "http.clientOnClose": {
1819
+ argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL],
1820
+ result: VOID,
1821
+ },
1822
+ "http.clientOnAbort": {
1823
+ argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL],
1824
+ result: VOID,
1825
+ },
1826
+ /** execFileSync/execSync as ONE entry (args: cmd, argv, shell, input,
1827
+ * cwd, hasEnv, envPairs, timeoutMs, stdoutMode, stderrMode — see
1828
+ * scr_runtime.h). Throws Node's exact errors: "Command failed: <cmd>"
1829
+ * (+ captured stderr) on non-zero exit or signal death, "spawnSync
1830
+ * <file> ENOENT" on spawn failure, "spawnSync <file> ETIMEDOUT" after
1831
+ * the SIGTERM timeout. Result is the captured utf8 stdout (+1). */
1832
+ "cp.execSync": {
1833
+ argTypes: [
1834
+ STRING,
1835
+ arrayOf(STRING),
1836
+ BOOL,
1837
+ STRING,
1838
+ BOOL,
1839
+ STRING,
1840
+ BOOL,
1841
+ arrayOf(STRING),
1842
+ F64,
1843
+ F64,
1844
+ F64,
1845
+ ],
1846
+ result: STRING,
1847
+ },
1848
+ /** The promisified-execFile capture (args: cmd, argv, cwd, hasEnv,
1849
+ * envPairs, timeoutMs): the same exec core in the async shape — both
1850
+ * streams captured, no echo, Node's ASYNC messages on the throw paths
1851
+ * ("Command failed: <cmd>\n<stderr>" with the unconditional newline,
1852
+ * "spawn <file> ENOENT" with .code, timeouts reporting as ordinary
1853
+ * SIGTERM command failures — never ETIMEDOUT). Result reuses the
1854
+ * ScrSpawnRes container (+1; stdout/stderr strings, status unused).
1855
+ * Called only from the frontend's interned %execFileAsync ASYNC helper,
1856
+ * whose fiber turns the throw into the rejection. */
1857
+ "cp.execCapture": {
1858
+ argTypes: [STRING, arrayOf(STRING), STRING, BOOL, arrayOf(STRING), F64],
1859
+ result: SPAWNRES_T,
1860
+ },
1861
+ /** child_process.spawn (scr_child.c + the scr_async.c loop): posix_spawnp
1862
+ * with per-slot ignore/inherit/pipe modes (and number output fds), the
1863
+ * all-piped Node default, and the child registered with the event loop,
1864
+ * which polls waitpid(WNOHANG) at quiescence like timers.
1865
+ * NEVER throws: spawn failure defers to the "error" event, Node-exact
1866
+ * (the error message is Node's "spawn <cmd> <ERRNO-NAME>"; an "error"
1867
+ * event with no listener prints it and exits 1 like an EventEmitter).
1868
+ * cmd/args borrowed; result an owned (+1) child handle. The loop will
1869
+ * not exhaust while any spawned child is unreaped — Node's keep-alive.
1870
+ *
1871
+ * child.onExit / child.onClose / child.onError — terminal listener
1872
+ * registration through child.on/once. Close uses the exit adapter shape
1873
+ * but fires only after every piped stdio handle reaches EOF. The
1874
+ * receiver is borrowed, the CALLBACK MOVES into the child's listener
1875
+ * registry (released after the terminal event fires, or at reap for
1876
+ * the event that never fires). Both are void (chaining is fenced).
1877
+ * onExit's third emitted ingredient is an ADAPTER the backend interns
1878
+ * per callback shape: the runtime invokes adapter(cb, has_code, code)
1879
+ * and the adapter builds the `number | null` union (tags are program-
1880
+ * dependent) or ignores the code for a zero-param callback. onError's
1881
+ * adapters are runtime-provided (zero-param, or the %Error one-param
1882
+ * shape — scr_error_new needs no program types). "exit" fires once
1883
+ * with the code (f64 arm) or null (signal death); "error" fires only
1884
+ * for spawn failure, exactly Node's split. */
1885
+ "cp.spawn": { argTypes: [STRING, arrayOf(STRING)], result: CHILD_T },
1886
+ /** Static-native fork startup and IPC. process.forkTarget initializes a
1887
+ * re-executed child's inherited channel and returns its embedded target id
1888
+ * (-1 in the parent). The remaining entries mirror Node's JSON channel. */
1889
+ "process.forkTarget": { argTypes: [F64], result: F64 },
1890
+ "cp.fork": {
1891
+ argTypes: [F64, arrayOf(STRING), F64, F64, F64, BOOL, arrayOf(STRING), STRING],
1892
+ result: CHILD_T,
1893
+ },
1894
+ "child.connected": { argTypes: [CHILD_T], result: BOOL },
1895
+ "child.send": { argTypes: [CHILD_T, STRING], result: BOOL },
1896
+ "child.sendCb": { argTypes: [CHILD_T, STRING, null], result: BOOL },
1897
+ "child.disconnect": { argTypes: [CHILD_T], result: VOID },
1898
+ "child.onMessage": { argTypes: [CHILD_T, null, BOOL], result: VOID },
1899
+ "child.onDisconnect": { argTypes: [CHILD_T, null, BOOL], result: VOID },
1900
+ "child.onSpawn": { argTypes: [CHILD_T, null], result: VOID },
1901
+ /** Rest listeners use the checked function bridge to pack event arguments. */
1902
+ "child.onDyn": { argTypes: [CHILD_T, STRING, DYN], result: VOID },
1903
+ "process.connected": { argTypes: [], result: BOOL },
1904
+ "process.send": { argTypes: [STRING], result: BOOL },
1905
+ "process.sendCb": { argTypes: [STRING, null], result: BOOL },
1906
+ "process.disconnect": { argTypes: [], result: VOID },
1907
+ "process.onMessage": { argTypes: [null, BOOL], result: VOID },
1908
+ "process.onDisconnect": { argTypes: [null, BOOL], result: VOID },
1909
+ /** child_process.execFile's callback slice: starts an all-piped child,
1910
+ * captures stdout/stderr, and moves the error-first callback into the
1911
+ * child registry. The callback shape is program-dependent and checked
1912
+ * by the validator/backends. */
1913
+ "cp.execFile": { argTypes: [STRING, arrayOf(STRING), null], result: CHILD_T },
1914
+ // spawn's options form: per-slot stdio modes (0 ignore / 1 inherit /
1915
+ // 2 fd) with the out/err fds for mode 2, detached, env replacement
1916
+ // pairs, cwd ("" = inherit).
1917
+ /** spawn with options (scr_child.c): the cp.spawn core plus PER-SLOT
1918
+ * stdio — args are (cmd, argv, inMode, outMode, errMode, outFd, errFd,
1919
+ * detached, hasEnv, envPairs, cwd); modes 0 ignore (/dev/null), 1
1920
+ * inherit, 2 fd (out/err only — the fd dup2s into the child's slot,
1921
+ * Node's stdio fd form; the daemon-log idiom ["ignore", logFd, logFd]).
1922
+ * detached is POSIX_SPAWN_SETSID (the child gets its own session and
1923
+ * process group, Node's semantics), env is a REPLACEMENT ([k,v,...]
1924
+ * pairs like cp.execSync's), cwd ""=inherit. Same event/loop story as
1925
+ * cp.spawn. */
1926
+ "cp.spawnOpts": {
1927
+ argTypes: [
1928
+ STRING,
1929
+ arrayOf(STRING),
1930
+ F64,
1931
+ F64,
1932
+ F64,
1933
+ F64,
1934
+ F64,
1935
+ BOOL,
1936
+ BOOL,
1937
+ BOOL,
1938
+ arrayOf(STRING),
1939
+ STRING,
1940
+ ],
1941
+ result: CHILD_T,
1942
+ },
1943
+ /** Runtime options normalized into the native spawn core; unsupported
1944
+ * process features retain explicit refusals. (command, args, options). */
1945
+ "cp.spawnDynamic": { argTypes: [STRING, arrayOf(STRING), DYN], result: CHILD_T },
1946
+ // The callback's func type is program-dependent (zero params, or the
1947
+ // `number | null` union / the %Error class) — the libCall case checks
1948
+ // the shape; the slot here only pins arity and the child receiver.
1949
+ "child.onExit": { argTypes: [CHILD_T, null], result: VOID },
1950
+ "child.onClose": { argTypes: [CHILD_T, null], result: VOID },
1951
+ "child.onError": { argTypes: [CHILD_T, null], result: VOID },
1952
+ // Like process.envGet, spawnRes.status's result type is program-dependent
1953
+ // (the interned `number | null` union) — the libCall case checks the arms.
1954
+ "spawnRes.status": { argTypes: [SPAWNRES_T], result: VOID },
1955
+ // spawnRes.error's result is the interned `Error | undefined` union —
1956
+ // the libCall case checks the arms, the spawnRes.status pattern.
1957
+ /** Node's spawn-failure carrier `error?: Error`: a fresh +1 %Error
1958
+ * ("spawnSync <file> ENOENT", `code` stamped) when the spawn itself
1959
+ * failed, the interned undefined arm otherwise — the result type is the
1960
+ * call site's `Error | undefined` union, constructed type-directedly in
1961
+ * the backend (the envGet convention). Never throws. */
1962
+ "spawnRes.error": { argTypes: [SPAWNRES_T], result: VOID },
1963
+ // spawnRes.signal's result is the interned `string | null` union —
1964
+ // same pattern.
1965
+ "spawnRes.signal": { argTypes: [SPAWNRES_T], result: VOID },
1966
+ // The ChildProcess lifecycle members: pid/exitCode are program-dependent
1967
+ // unions (`number | undefined` / `number | null` — the libCall case
1968
+ // checks the arms, the spawnRes.status pattern).
1969
+ /** The ChildProcess lifecycle members (scr_child.c), Node's shapes
1970
+ * exactly (SEMANTICS.md has the pinned matrix). child.pid is the
1971
+ * checker's `number | undefined` (undefined = spawn failure) and
1972
+ * child.exitCode its `number | null` (null while running and after a
1973
+ * signal death; -errno once a spawn failure settled) — both unions are
1974
+ * type-directed constructions in the backend over a has/get runtime
1975
+ * pair, the spawnRes.status pattern. child.killed is Node's
1976
+ * sent-a-signal flag. child.kill sends while the child is un-reaped
1977
+ * (false after — Node's null-handle answer) and THROWS the
1978
+ * Unknown-signal TypeError on bad names (may-throw); killNum passes
1979
+ * numbers through (0 probes; never throws). child.unref drops the
1980
+ * child from the loop's keep-alive set — it is still reaped while the
1981
+ * loop runs for other reasons, and one the loop never reaps is left to
1982
+ * the OS at exit. All receivers borrowed. */
1983
+ "child.pid": { argTypes: [CHILD_T], result: VOID },
1984
+ "child.exitCode": { argTypes: [CHILD_T], result: VOID },
1985
+ // The close-override pair: the bound close's result func type and the
1986
+ // override's func argument are program-dependent (the callback union's
1987
+ // tags) — the slots pin the server receiver; the libCall case checks
1988
+ // the bound value's shape.
1989
+ /** The close-override pair (the portless close-proxy idiom).
1990
+ * serverCloseBind is `wrapper.close.bind(wrapper)` as a VALUE: a
1991
+ * compiler-emitted closure over the server whose invocation runs the
1992
+ * REAL close (scr_net_server_close_direct — never the override), so
1993
+ * the override body's `origClose(cb)` cannot recurse; its callback
1994
+ * argument (the `((err?: Error) => void) | undefined` union) registers
1995
+ * as a once-'close' listener, a one-param callback wrapped by an
1996
+ * emitted zero-arg trampoline firing the undefined arm (a clean close
1997
+ * carries no error). serverSetCloseOverride is `wrapper.close = fn`:
1998
+ * the override MOVES in behind an emitted zero-arg wrapper (it invokes
1999
+ * the user function with the undefined-arm callback — tags are program
2000
+ * data), and server.close() consults it before closing. */
2001
+ "net.serverCloseBind": { argTypes: [NETSERVER_T], result: VOID },
2002
+ "net.serverSetCloseOverride": { argTypes: [NETSERVER_T, null], result: VOID },
2003
+ // The piped-output stream reads: `Readable | null` unions (the libCall
2004
+ // case checks the arms — the child.pid pattern with a ref arm).
2005
+ /** The piped-output streams (stdio mode 3 — scr_child.c's stream
2006
+ * slice). child.stdout/child.stderr answer the checker's
2007
+ * `Readable | null` union (type-directed construction in the backend
2008
+ * over the +1-or-NULL runtime pair — the child.pid pattern with a ref
2009
+ * arm). stream.onData/onEnd register 'data'/'end' listeners (receiver
2010
+ * borrowed, CALLBACK MOVES, trailing once-flag, void — chaining
2011
+ * fenced): 'data' fires one Buffer chunk per read (zero-param and
2012
+ * Buffer/string adapters are runtime-provided; setEncoding threads
2013
+ * split multibyte sequences through the shared StringDecoder core. A
2014
+ * union-param listener —
2015
+ * ngrok's `Buffer | string` — gets a compiler-emitted adapter wrapping
2016
+ * the chunk at its Buffer arm), 'end' fires once at EOF, always BEFORE
2017
+ * the child's 'exit' (the pinned ordering). A flowing stream keeps the
2018
+ * loop alive: usesTimers. */
2019
+ "child.stdout": { argTypes: [CHILD_T], result: VOID },
2020
+ "child.stderr": { argTypes: [CHILD_T], result: VOID },
2021
+ /** The piped-input writer (stdio mode 3 on fd 0). child.stdin answers
2022
+ * `Writable | null`; writes copy borrowed data into the nonblocking
2023
+ * queue, end/destroy settle it, writable is a pure state read, and
2024
+ * listener callbacks move into the writer registry. */
2025
+ "child.stdin": { argTypes: [CHILD_T], result: VOID },
2026
+ // Listener registrations: callback func shapes are program-dependent
2027
+ // (zero-param / Buffer / Buffer-armed union) — the slots pin arity,
2028
+ // the stream receiver, and the once-flag.
2029
+ "stream.onData": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
2030
+ "stream.onDataStr": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
2031
+ "stream.onEnd": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
2032
+ "stream.childSetEncoding": { argTypes: [CHILDSTREAM_T, STRING], result: CHILDSTREAM_T },
2033
+ "writer.writeString": { argTypes: [CHILDWRITER_T, STRING], result: BOOL },
2034
+ "writer.writeBytes": { argTypes: [CHILDWRITER_T, BYTES_U8], result: BOOL },
2035
+ "writer.end": { argTypes: [CHILDWRITER_T], result: VOID },
2036
+ "writer.destroy": { argTypes: [CHILDWRITER_T], result: VOID },
2037
+ "writer.writable": { argTypes: [CHILDWRITER_T], result: BOOL },
2038
+ "writer.onDrain": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
2039
+ "writer.onFinish": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
2040
+ "writer.onError": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
2041
+ /** The first-class WritableStream write (`output.write(line)` — the
2042
+ * prefixStream idiom): the receiver IS the fd scalar (process.stdout/
2043
+ * stderr reads mint 1/2), dispatched onto the exact stdoutWrite/
2044
+ * stderrWrite paths so buffering and ordering stay identical. Data
2045
+ * borrowed; the bool is Node's always-true backpressure signal. */
2046
+ "procStream.write": { argTypes: [PROCSTREAM_T, STRING], result: BOOL },
2047
+ "child.killed": { argTypes: [CHILD_T], result: BOOL },
2048
+ "child.kill": { argTypes: [CHILD_T, STRING], result: BOOL },
2049
+ "child.killNum": { argTypes: [CHILD_T, F64], result: BOOL },
2050
+ "child.unref": { argTypes: [CHILD_T], result: VOID },
2051
+ "child.ref": { argTypes: [CHILD_T], result: VOID },
2052
+ "spawnRes.stdout": { argTypes: [SPAWNRES_T], result: STRING },
2053
+ "spawnRes.stderr": { argTypes: [SPAWNRES_T], result: STRING },
2054
+ /** fs/promises (scr_lib.c over scr_async.c's settled minting): the SAME
2055
+ * sync syscalls, wrapped in an ALREADY-SETTLED promise — failure
2056
+ * REJECTS (catchable at the await) instead of throwing, so none of
2057
+ * these are in the may-throw seed. readFile is utf8-fenced like
2058
+ * readFileSync. The non-interleaving divergence is documented in
2059
+ * SEMANTICS.md. */
2060
+ /** node:crypto randomness: randomUUID plus randomBytes as either a real
2061
+ * Buffer or the fused randomBytes(n).toString("hex"|"base64") path.
2062
+ * The size-taking forms throw Node's RangeError on invalid values. */
2063
+ "crypto.randomUUID": { argTypes: [], result: STRING },
2064
+ "crypto.randomBytesToString": { argTypes: [F64, STRING], result: STRING },
2065
+ /** crypto.randomBytes(n) → a real u8 Buffer (+1). THROWS Node's
2066
+ * RangeError on out-of-range sizes, exactly like the composed
2067
+ * randomBytesToString (which keeps its one-libCall lowering — the two
2068
+ * coexist: the composed form never materializes the Buffer). */
2069
+ "crypto.randomBytes": { argTypes: [F64], result: BYTES_U8 },
2070
+ /** The fused createHash(alg).update(data).digest(enc) fast path and the
2071
+ * one-shot crypto.hash implementation. First-class Hash/Hmac handles use
2072
+ * the entries below; all paths share the incremental runtime core. */
2073
+ "crypto.hashDigestStr": { argTypes: [STRING, STRING, STRING], result: STRING },
2074
+ "crypto.hashDigestBytes": { argTypes: [STRING, BYTES_U8, STRING], result: STRING },
2075
+ /** First-class static Hash/Hmac handles. Constructors validate the
2076
+ * runtime algorithm string (MD5, SHA-1, or SHA-2); update returns the same
2077
+ * handle by retained identity, copy snapshots Hash state, and digest
2078
+ * finalizes the handle and returns either a Buffer or encoded string. */
2079
+ "crypto.native": { argTypes: [], result: DYN },
2080
+ "crypto.hashNew": { argTypes: [STRING], result: CRYPTOHASH_T },
2081
+ "crypto.hmacNewStr": { argTypes: [STRING, STRING], result: CRYPTOHMAC_T },
2082
+ "crypto.hmacNewBytes": { argTypes: [STRING, BYTES_U8], result: CRYPTOHMAC_T },
2083
+ "crypto.hashUpdateStr": { argTypes: [CRYPTOHASH_T, STRING], result: CRYPTOHASH_T },
2084
+ "crypto.hashUpdateBytes": { argTypes: [CRYPTOHASH_T, BYTES_U8], result: CRYPTOHASH_T },
2085
+ "crypto.hmacUpdateStr": { argTypes: [CRYPTOHMAC_T, STRING], result: CRYPTOHMAC_T },
2086
+ "crypto.hmacUpdateBytes": { argTypes: [CRYPTOHMAC_T, BYTES_U8], result: CRYPTOHMAC_T },
2087
+ "crypto.hashCopy": { argTypes: [CRYPTOHASH_T], result: CRYPTOHASH_T },
2088
+ "crypto.hashDigestString": { argTypes: [CRYPTOHASH_T, STRING], result: STRING },
2089
+ "crypto.hashDigestBuffer": { argTypes: [CRYPTOHASH_T], result: BYTES_U8 },
2090
+ "crypto.hmacDigestString": { argTypes: [CRYPTOHMAC_T, STRING], result: STRING },
2091
+ "crypto.hmacDigestBuffer": { argTypes: [CRYPTOHMAC_T], result: BYTES_U8 },
2092
+ "crypto.timingSafeEqual": { argTypes: [BYTES_U8, BYTES_U8], result: BOOL },
2093
+ "crypto.randomFill": { argTypes: [BYTES_U8, F64, F64], result: BYTES_U8 },
2094
+ "crypto.randomFillRest": { argTypes: [BYTES_U8, F64], result: BYTES_U8 },
2095
+ "crypto.randomInt": { argTypes: [F64, F64], result: F64 },
2096
+ "crypto.pbkdf2": { argTypes: [BYTES_U8, BYTES_U8, F64, F64, STRING], result: BYTES_U8 },
2097
+ "crypto.randomBytesCb": { argTypes: [F64, null], result: VOID },
2098
+ "crypto.pbkdf2Cb": { argTypes: [BYTES_U8, BYTES_U8, F64, F64, STRING, null], result: VOID },
2099
+ "crypto.hkdf": { argTypes: [STRING, BYTES_U8, BYTES_U8, BYTES_U8, F64], result: DYN },
2100
+ "crypto.hkdfCb": { argTypes: [STRING, BYTES_U8, BYTES_U8, BYTES_U8, F64, null], result: VOID },
2101
+ "crypto.scrypt": { argTypes: [BYTES_U8, BYTES_U8, F64, DYN], result: BYTES_U8 },
2102
+ "crypto.scryptCb": { argTypes: [BYTES_U8, BYTES_U8, F64, DYN, null], result: VOID },
2103
+ // The Buffer statics and the fs/zlib Buffer forms: fixed always-u8
2104
+ // signatures (Buffer IS a Uint8Array — one bytes kind).
2105
+ /** The Buffer statics with fixed (always-u8) signatures. fromStr is
2106
+ * `Buffer.from(string, enc)` — the frontend completes an omitted
2107
+ * encoding to "utf8" and fences non-literal/unsupported ones; hex and
2108
+ * base64 decode Node-leniently, so it never throws. concat takes ONE
2109
+ * bytes<u8>[] arg (the list) and returns a fresh copy. `Buffer.from(u8)`
2110
+ * and `Buffer.alloc(n)` need no libFn — they lower to bytesNew. */
2111
+ "buffer.fromStr": { argTypes: [STRING, STRING], result: BYTES_U8 },
2112
+ "buffer.fromStrChecked": { argTypes: [STRING, STRING], result: BYTES_U8 },
2113
+ "buffer.brand": { argTypes: [BYTES_U8], result: BYTES_U8 },
2114
+ /** Buffer.from on checked-native strings, bytes, arrays and data-only
2115
+ * array-like/Buffer-JSON objects. The encoding is a normalized literal;
2116
+ * non-string inputs ignore it. Copies the input and may throw during
2117
+ * element coercion or argument validation. Custom object valueOf and
2118
+ * opaque reference inputs retain explicit runtime refusals. */
2119
+ "buffer.fromDyn": { argTypes: [DYN, STRING], result: BYTES_U8 },
2120
+ "buffer.concat": { argTypes: [arrayOf(BYTES_U8)], result: BYTES_U8 },
2121
+ /** Buffer.byteLength(string, enc) — enc a NORMALIZED literal like
2122
+ * fromStr's — and Buffer.isEncoding(name) over a runtime string
2123
+ * (case-insensitive against Node's alias set). Pure; never throw. */
2124
+ "buffer.byteLenDyn": { argTypes: [DYN, STRING], result: F64 },
2125
+ "buffer.byteLenStr": { argTypes: [STRING, STRING], result: F64 },
2126
+ "buffer.isEncoding": { argTypes: [STRING], result: BOOL },
2127
+ /** Buffer.concat(list, totalLength): the concatenation truncated or
2128
+ * zero-padded to the total. THROWS Node's 'length' RangeError on a
2129
+ * negative/non-integer total (may-throw seed). */
2130
+ "buffer.concatLen": { argTypes: [arrayOf(BYTES_U8), F64], result: BYTES_U8 },
2131
+ // The checked-dynamic compare/equals validators (Node's argument
2132
+ // ladders over dyn-boxed invalid-input probes).
2133
+ /** The checked-dynamic compare/equals validators (scr_bytes_io.c) —
2134
+ * the lowered form when an argument is NOT statically bytes<u8> (the
2135
+ * invalid-input probes; a dyn from an untyped JS helper): Node's own
2136
+ * argument ladders run at runtime — ERR_INVALID_ARG_TYPE with the
2137
+ * API's argument name ("buf1"/"buf2", "otherBuffer", "target"; offsets
2138
+ * "of type number"), validateOffset's ERR_OUT_OF_RANGE for bad
2139
+ * numbers, undefined offsets taking their Node defaults — and a
2140
+ * well-typed value still computes the real answer. All args borrowed
2141
+ * dyn; compareChk's four offset slots pass the undefined dyn when
2142
+ * syntactically absent. May-throw seeds. */
2143
+ "buffer.compareChk": { argTypes: [DYN, DYN], result: F64 },
2144
+ "bytes.equalsChk": { argTypes: [BYTES_U8, DYN], result: BOOL },
2145
+ "bytes.compareChk": { argTypes: [BYTES_U8, DYN, DYN, DYN, DYN, DYN], result: F64 },
2146
+ /** The deprecated `new Buffer(number, 'enc')` string-arm rejection:
2147
+ * always throws Node's ERR_INVALID_ARG_TYPE ("The \"string\" argument
2148
+ * must be of type string. Received ..."). Borrowed dyn; may-throw. */
2149
+ "buffer.newStringFail": { argTypes: [DYN], result: BYTES_U8 },
2150
+ /** fs._toUnixTimestamp(time) over a dyn value: numeric strings and
2151
+ * finite numbers coerce (negatives answer now/1000, Node's shape);
2152
+ * everything else throws Node's ERR_INVALID_ARG_TYPE. May-throw. */
2153
+ "fs.toUnixTimestamp": { argTypes: [DYN], result: F64 },
2154
+ /** The fs argument-validation ladders (checked-dynamic lane): each Chk
2155
+ * replicates its API's Node-order validation over dyn values (Node's
2156
+ * exact typed errors — ERR_INVALID_ARG_TYPE/VALUE, ERR_OUT_OF_RANGE),
2157
+ * and a full pass meets the trailing compiler-rendered SC2020 fence
2158
+ * string — so the ALWAYS-THROW forms take the error.nodeThrow
2159
+ * polymorphic-result carve-out. mkdtempSyncChk and the lchmod sync/
2160
+ * promise pair run the REAL operation on a validated pass instead
2161
+ * (macOS lchmod(2); non-APPLE answers Node's not-a-function /
2162
+ * ERR_METHOD_NOT_IMPLEMENTED shapes). May-throw seeds, all of them. */
2163
+ "fs.existsChk": { argTypes: [DYN, DYN], result: DYN },
2164
+ "fs.mkdtempChk": { argTypes: [DYN, DYN, STRING], result: VOID },
2165
+ "fs.mkdtempSyncChk": { argTypes: [DYN, DYN, STRING], result: STRING },
2166
+ "fs.readFileChk": { argTypes: [DYN, DYN, DYN, STRING], result: VOID },
2167
+ "fs.opendirChk": { argTypes: [DYN, DYN, STRING], result: VOID },
2168
+ "fs.watchFileChk": { argTypes: [DYN, DYN, STRING], result: VOID },
2169
+ "fs.lchmodChk": { argTypes: [DYN, DYN, DYN, STRING], result: VOID },
2170
+ "fs.lchmodSyncChk": { argTypes: [DYN, DYN], result: DYN },
2171
+ "fsp.lchmodChk": { argTypes: [DYN, DYN], result: { kind: "promise", inner: VOID } },
2172
+ "fs.readChk": { argTypes: [DYN, DYN, DYN, DYN, DYN, STRING], result: VOID },
2173
+ "fs.streamOptsChk": { argTypes: [DYN, DYN, STRING], result: VOID },
2174
+ /** The compiler-resolved ERR_INVALID_ARG_TYPE throw with a RUNTIME-
2175
+ * rendered Received tail: args [argname, "of type ..." clause, the
2176
+ * offending dyn value]. ALWAYS THROWS; polymorphic result (the
2177
+ * error.nodeThrow pattern). May-throw seed. */
2178
+ "error.argTypeThrow": { argTypes: [STRING, STRING, DYN], result: VOID },
2179
+ /** The property flavor of argTypeThrow ("The \"options.x\" property
2180
+ * must be ..."): the option-bag ladders' provably-invalid arms. ALWAYS
2181
+ * THROWS; polymorphic result. May-throw seed. */
2182
+ "error.propTypeThrow": { argTypes: [STRING, STRING, DYN], result: VOID },
2183
+ /** The checked-dynamic max-listeners ladders: setMaxChk is the
2184
+ * instance form over a dyn n (non-numbers ERR_INVALID_ARG_TYPE,
2185
+ * negatives/NaN ERR_OUT_OF_RANGE; +1 receiver back — chaining);
2186
+ * setDefaultMaxChk is the static/property form, its second argument
2187
+ * naming the message slot ("setMaxListeners" for the static call,
2188
+ * "defaultMaxListeners" for the module-property assignment). */
2189
+ "emitter.setMaxChk": { argTypes: [null, DYN], result: VOID },
2190
+ "emitter.setDefaultMaxChk": { argTypes: [DYN, STRING], result: VOID },
2191
+ /** The Buffer forms of fs: readFileSync(path) with NO
2192
+ * encoding → bytes<u8> (+1), writeFileSync/appendFileSync(path, bytes), and the
2193
+ * fs/promises readFile(path) no-encoding form (an already-settled
2194
+ * promise, rejecting on failure like the other fsp members). The sync
2195
+ * forms THROW catchably on failure exactly like the utf8 forms. */
2196
+ "fs.readFileSyncBytes": { argTypes: [STRING], result: BYTES_U8 },
2197
+ "fs.writeFileSyncBytes": { argTypes: [STRING, BYTES_U8], result: VOID },
2198
+ "fs.appendFileSyncBytes": { argTypes: [STRING, BYTES_U8], result: VOID },
2199
+ "fsp.readFileBytes": { argTypes: [STRING], result: { kind: "promise", inner: BYTES_U8 } },
2200
+ /** node:zlib (scr_zlib.c — native-toolchain.ts compiles/links it ONLY when these
2201
+ * appear on the IR, the regex/libcurl gating precedent): one-shot zlib,
2202
+ * raw-DEFLATE, gzip, and auto-detect codecs over u8 bytes with Node's
2203
+ * default options, or a validated literal compression level from -1 to 9.
2204
+ * Compression never throws (OOM aborts); decompression
2205
+ * of corrupt input THROWS Node's error catchably. */
2206
+ "zlib.deflateSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
2207
+ "zlib.inflateSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
2208
+ "zlib.deflateRawSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
2209
+ /** bytes, mode (0 zlib / 1 raw / 2 gzip), validated compression level. */
2210
+ "zlib.deflateLevelSync": { argTypes: [BYTES_U8, F64, F64], result: BYTES_U8 },
2211
+ "zlib.inflateRawSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
2212
+ "zlib.gzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
2213
+ "zlib.gunzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
2214
+ "zlib.unzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
2215
+ /** The default-options callback twins run on the executable's shared
2216
+ * native work pool and deliver (Error | null, Buffer) on a later loop
2217
+ * turn. crc32 validates its optional uint32 seed synchronously. */
2218
+ "zlib.deflateCb": { argTypes: [BYTES_U8, null], result: VOID },
2219
+ "zlib.inflateCb": { argTypes: [BYTES_U8, null], result: VOID },
2220
+ "zlib.deflateRawCb": { argTypes: [BYTES_U8, null], result: VOID },
2221
+ "zlib.inflateRawCb": { argTypes: [BYTES_U8, null], result: VOID },
2222
+ "zlib.gzipCb": { argTypes: [BYTES_U8, null], result: VOID },
2223
+ "zlib.gunzipCb": { argTypes: [BYTES_U8, null], result: VOID },
2224
+ "zlib.unzipCb": { argTypes: [BYTES_U8, null], result: VOID },
2225
+ "zlib.crc32": { argTypes: [BYTES_U8, F64], result: F64 },
2226
+ /** The Buffer overloads of the raw stream writes — same promptly
2227
+ * submitted streams as process.stdoutWrite/stderrWrite, constantly true.
2228
+ * The encoding arg is evaluated but ignored for bytes, like Node. The Cb
2229
+ * forms move their program-shaped completion callback to the tick queue. */
2230
+ "process.stdoutWriteBytes": { argTypes: [BYTES_U8, STRING], result: BOOL },
2231
+ "process.stderrWriteBytes": { argTypes: [BYTES_U8, STRING], result: BOOL },
2232
+ // Completion callback is program-dependent: zero params, checked-dynamic,
2233
+ // or an optional Error | null slot (same success shape as fs.rename).
2234
+ "process.stdoutWriteBytesCb": { argTypes: [BYTES_U8, STRING, null], result: BOOL },
2235
+ "process.stderrWriteBytesCb": { argTypes: [BYTES_U8, STRING, null], result: BOOL },
2236
+ "fsp.readFile": { argTypes: [STRING, STRING], result: { kind: "promise", inner: STRING } },
2237
+ "fsp.writeFile": { argTypes: [STRING, STRING], result: { kind: "promise", inner: VOID } },
2238
+ /** fs.promises.writeFile(path, data, { mode }): the settled-promise
2239
+ * twin of fs.writeFileModeSync. */
2240
+ "fsp.writeFileMode": {
2241
+ argTypes: [STRING, STRING, F64],
2242
+ result: { kind: "promise", inner: VOID },
2243
+ },
2244
+ "fsp.mkdir": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
2245
+ /** The fs/promises option/member tail the certs pipeline uses: mkdir's
2246
+ * literal { recursive?, mode? } options (the mkdirSync matrix behind
2247
+ * settled promises), unlink, chmod. Failures REJECT (catchable at the
2248
+ * await), like the rest of the fsp family. */
2249
+ "fsp.mkdirMode": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
2250
+ "fsp.mkdirRecursive": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
2251
+ "fsp.mkdirRecursiveMode": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
2252
+ "fsp.unlink": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
2253
+ "fsp.chmod": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
2254
+ "fsp.link": { argTypes: [DYN, DYN], result: { kind: "promise", inner: VOID } },
2255
+ "fsp.symlink": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
2256
+ "fsp.readlink": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
2257
+ "fsp.statfs": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
2258
+ "fsp.readlinkStr": { argTypes: [DYN, DYN], result: { kind: "promise", inner: STRING } },
2259
+ "fsp.readlinkBuffer": { argTypes: [DYN, DYN], result: { kind: "promise", inner: BYTES_U8 } },
2260
+ "fsp.utimes": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
2261
+ "fsp.lutimes": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
2262
+ "fsp.rename": { argTypes: [STRING, STRING], result: { kind: "promise", inner: VOID } },
2263
+ "fsp.readdir": { argTypes: [STRING], result: { kind: "promise", inner: arrayOf(STRING) } },
2264
+ // Result is promise<call-site Dirent record array>; the libCall case
2265
+ // validates the program-dependent record shape in validate.ts.
2266
+ /** `fs.promises.readdir(path, { withFileTypes: true })` — the settled-
2267
+ * promise twin of fs.readdirTypesSync. The backends assemble the same
2268
+ * call-site-shaped Dirent rows, then move the array into a promise;
2269
+ * scandir failure becomes its rejection. */
2270
+ "fsp.readdirTypes": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
2271
+ "fsp.rm": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
2272
+ "fsp.stat": { argTypes: [STRING], result: { kind: "promise", inner: STATS_T } },
2273
+ "fsp.realpath": { argTypes: [STRING], result: { kind: "promise", inner: STRING } },
2274
+ "fsp.lstat": { argTypes: [STRING], result: { kind: "promise", inner: STATS_T } },
2275
+ /** fs/promises.open and the statically represented FileHandle surface.
2276
+ * Every operation returns an already-settled promise; syscall failures
2277
+ * become rejections rather than escaping synchronously. read/write
2278
+ * results are call-site record shapes ({ bytesRead/bytesWritten,
2279
+ * buffer }) assembled by the backends around the fixed runtime ABI. */
2280
+ "fsp.open": { argTypes: [STRING, STRING, F64], result: { kind: "promise", inner: FILEHANDLE_T } },
2281
+ "fileHandle.fd": { argTypes: [FILEHANDLE_T], result: F64 },
2282
+ "fileHandle.close": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
2283
+ "fileHandle.sync": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
2284
+ "fileHandle.datasync": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
2285
+ "fileHandle.truncate": {
2286
+ argTypes: [FILEHANDLE_T, F64],
2287
+ result: { kind: "promise", inner: VOID },
2288
+ },
2289
+ "fileHandle.chmod": { argTypes: [FILEHANDLE_T, F64], result: { kind: "promise", inner: VOID } },
2290
+ "fileHandle.utimes": {
2291
+ argTypes: [FILEHANDLE_T, DYN, DYN],
2292
+ result: { kind: "promise", inner: VOID },
2293
+ },
2294
+ "fileHandle.readv": {
2295
+ argTypes: [FILEHANDLE_T, arrayOf(BYTES_U8), F64],
2296
+ result: { kind: "promise", inner: VOID },
2297
+ },
2298
+ "fileHandle.writev": {
2299
+ argTypes: [FILEHANDLE_T, arrayOf(BYTES_U8), F64],
2300
+ result: { kind: "promise", inner: VOID },
2301
+ },
2302
+ // read/write carry call-site result record shapes; the validator checks
2303
+ // those in validate.ts, so promise<void> is only a table sentinel.
2304
+ "fileHandle.read": {
2305
+ argTypes: [FILEHANDLE_T, BYTES_U8, F64, F64, F64, BOOL],
2306
+ result: { kind: "promise", inner: VOID },
2307
+ },
2308
+ "fileHandle.writeBytes": {
2309
+ argTypes: [FILEHANDLE_T, BYTES_U8, F64, F64, F64, BOOL],
2310
+ result: { kind: "promise", inner: VOID },
2311
+ },
2312
+ "fileHandle.writeStr": {
2313
+ argTypes: [FILEHANDLE_T, STRING, F64, STRING],
2314
+ result: { kind: "promise", inner: VOID },
2315
+ },
2316
+ "fileHandle.readFile": {
2317
+ argTypes: [FILEHANDLE_T, STRING],
2318
+ result: { kind: "promise", inner: STRING },
2319
+ },
2320
+ "fileHandle.readFileBytes": {
2321
+ argTypes: [FILEHANDLE_T, STRING],
2322
+ result: { kind: "promise", inner: BYTES_U8 },
2323
+ },
2324
+ "fileHandle.writeFile": {
2325
+ argTypes: [FILEHANDLE_T, STRING, STRING],
2326
+ result: { kind: "promise", inner: VOID },
2327
+ },
2328
+ "fileHandle.writeFileBytes": {
2329
+ argTypes: [FILEHANDLE_T, BYTES_U8, STRING],
2330
+ result: { kind: "promise", inner: VOID },
2331
+ },
2332
+ "fileHandle.stat": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: STATS_T } },
2333
+ "process.argv": { argTypes: [], result: arrayOf(STRING) },
2334
+ "process.platform": { argTypes: [], result: STRING },
2335
+ // The one libCall whose result type is program-dependent (union ids are
2336
+ // per-module): the `result` here is a placeholder — the libCall case
2337
+ // checks the union's ARMS ([string, undefinedT] in canonical order)
2338
+ // against the module's registry instead.
2339
+ /** getenv(3): one string key arg → the interned `string | undefined`
2340
+ * union (present: +1 string wrapped into the string arm; absent: the
2341
+ * interned undefined-arm instance). BOTH source forms — `process.env.FOO`
2342
+ * and `process.env[expr]` — lower here. Purely static; never throws. */
2343
+ "process.envGet": { argTypes: [STRING], result: VOID },
2344
+ /** setenv(3): (name, value) string args → void. Later envGet reads and
2345
+ * spawned children observe the write, like Node (values are strings —
2346
+ * the frontend fences non-string RHS). Never throws. */
2347
+ "process.envSet": { argTypes: [STRING, STRING], result: VOID },
2348
+ /** `delete process.env[NAME]` — unsetenv(3): the mutation is visible to
2349
+ * every later read (process.envGet asks getenv fresh) and inherited by
2350
+ * spawned children, exactly Node. Statement position only (JS's boolean
2351
+ * result is constant true there). Borrows the name; never throws. */
2352
+ "process.envUnset": { argTypes: [STRING], result: VOID },
2353
+ /** The whole environment as alternating [k0, v0, k1, v1, ...] strings in
2354
+ * environ order — the raw material of the process.env SNAPSHOT record
2355
+ * (the frontend's interned %env.snapshot helper keyed-writes the pairs
2356
+ * into a fresh `{ [k: string]: string | undefined }` record). Fresh +1
2357
+ * array; never throws. */
2358
+ "process.envPairs": { argTypes: [], result: arrayOf(STRING) },
2359
+ "process.exit": { argTypes: [F64], result: VOID },
2360
+ /** Numeric process.exitCode write (integer validation, implicit exit status). */
2361
+ "process.setExitCode": { argTypes: [F64], result: VOID },
2362
+ /** The code for process.exit() with no argument, or zero when unset. */
2363
+ "process.currentExitCode": { argTypes: [], result: F64 },
2364
+ "process.cwd": { argTypes: [], result: STRING },
2365
+ /** getpid(2) / getuid(2): zero args → f64. POSIX-only target, so both
2366
+ * always answer (the checker's `getuid?` optionality covers Windows —
2367
+ * `process.getuid?.()` lowers as the plain call). Never throw. */
2368
+ "process.pid": { argTypes: [], result: F64 },
2369
+ "dyn.this": { argTypes: [], result: DYN },
2370
+ "dyn.generatorThis": { argTypes: [], result: DYN },
2371
+ "process.getuid": { argTypes: [], result: F64 },
2372
+ "process.getgid": { argTypes: [], result: F64 },
2373
+ /** process.execPath: the compiled binary's own resolved absolute path
2374
+ * (one interned string, +1 per read) — the honest answer where Node's
2375
+ * is the node executable's (SEMANTICS.md divergence 12). Never throws. */
2376
+ "process.execPath": { argTypes: [], result: STRING },
2377
+ /** process.arch: the compiled binary's OWN architecture ("arm64",
2378
+ * "x64") — Node's answer for its own build on the same machine.
2379
+ * Interned; +1 per read. Never throws. */
2380
+ "process.arch": { argTypes: [], result: STRING },
2381
+ /** Stable native version dictionary. node/openssl identify compatibility
2382
+ * targets; components absent from the native runtime are omitted. */
2383
+ "process.versions": { argTypes: [], result: DYN },
2384
+ "process.builtinId": { argTypes: [DYN, arrayOf(STRING)], result: STRING },
2385
+ "process.builtinModule": { argTypes: [STRING, DYN], result: DYN },
2386
+ "process.builtinUnsupported": { argTypes: [STRING, STRING], result: DYN },
2387
+ "fs.callbackValue": { argTypes: [STRING], result: DYN },
2388
+ "fs.callbackCall": { argTypes: [STRING, DYN], result: DYN },
2389
+ "process.hrtimeValue": { argTypes: [], result: DYN },
2390
+ /** process.versions.node: the runtime's Node COMPATIBILITY TARGET —
2391
+ * there is no Node under the binary, so this reports the version whose
2392
+ * semantics the runtime implements (SEMANTICS.md divergence 60, the
2393
+ * execPath stance). Interned; +1 per read. Never throws. */
2394
+ "process.versionsNode": { argTypes: [], result: STRING },
2395
+ "process.versionsOpenssl": { argTypes: [], result: STRING },
2396
+ /** kill(2) with Node's exact semantics and error shapes: the pid must be
2397
+ * an int32 (else the ERR_INVALID_ARG_TYPE TypeError text), the named
2398
+ * form resolves Node's signal-name table (unknown names throw the
2399
+ * ERR_UNKNOWN_SIGNAL TypeError), an omitted signal completes to
2400
+ * "SIGTERM" in the frontend, signal 0 probes, and a kill(2) failure
2401
+ * throws Node's `kill ESRCH`/`kill EPERM` Error. Result is Node's
2402
+ * constant true. */
2403
+ "process.kill": { argTypes: [F64, STRING], result: BOOL },
2404
+ "process.killNum": { argTypes: [F64, F64], result: BOOL },
2405
+ /** The raw byte writes: one borrowed string arg → bool (constantly true
2406
+ * — this synchronous runtime never queues backpressure). stdoutWrite
2407
+ * shares console.log's stream, each call is submitted promptly, and
2408
+ * interleaved output keeps source order. No newline, no formatting,
2409
+ * never throws. */
2410
+ "process.stdoutWrite": { argTypes: [STRING], result: BOOL },
2411
+ "process.stdio": { argTypes: [F64], result: DYN },
2412
+ "process.stderrWrite": { argTypes: [STRING], result: BOOL },
2413
+ // error.new's result and the receiver slots are builtin-error classes —
2414
+ // program-dependent object types, checked in the libCall case.
2415
+ /** The runtime-provided Error hierarchy's entry points (scr_error.c).
2416
+ * error.new: one borrowed string arg (the message), result an owned (+1)
2417
+ * builtin error instance — the result TYPE names which builtin class
2418
+ * (backends derive the runtime kind from it). error.ctor: the
2419
+ * super(message) call of an `extends Error` constructor — borrowed
2420
+ * receiver (already allocated by the derived class's new) + borrowed
2421
+ * message, void; the receiver's type names the builtin class whose name
2422
+ * field to stamp. error.toString: borrowed `%Error`-typed receiver, +1
2423
+ * string in Node's "name: message" shape. Formatting can invoke a user
2424
+ * message accessor, which can throw. */
2425
+ "error.new": { argTypes: [STRING], result: VOID },
2426
+ /** ECMAScript constructors with raw checked-dynamic message/options.
2427
+ * Options retain cause presence; constructor calls borrow their args.
2428
+ * Message coercion may throw before the cause is installed. */
2429
+ "error.newOptions": { argTypes: [DYN, DYN], result: VOID },
2430
+ "error.ctorOptions": { argTypes: [null, DYN, DYN], result: VOID },
2431
+ /** Borrowed Error receiver. cause returns an owned dyn value (undefined
2432
+ * when absent); hasCause distinguishes absence from present undefined. */
2433
+ "error.cause": { argTypes: [null], result: DYN },
2434
+ "error.hasCause": { argTypes: [null], result: BOOL },
2435
+ /** Assignment borrows both operands and retains the new cause. */
2436
+ "error.setCause": { argTypes: [null, DYN], result: VOID },
2437
+ "error.defineCause": { argTypes: [null, DYN], result: VOID },
2438
+ "error.deleteCause": { argTypes: [null], result: VOID },
2439
+ /** The compiler-resolved Node-parity throw for always-throwing lowered
2440
+ * arms (ERR_INVALID_THIS receivers, ERR_MISSING_ARGS arity ladders,
2441
+ * the symbol-to-string TypeError): args are [error-kind f64 (the
2442
+ * SCR_ERR_* index: 0 Error, 1 TypeError, 2 RangeError), code (empty =
2443
+ * no code slot), message]. ALWAYS THROWS catchably; the result type is
2444
+ * the replaced expression's own (never materialized — the
2445
+ * global.undefRead pattern). May-throw seed. */
2446
+ "error.nodeThrow": { argTypes: [F64, STRING, STRING], result: VOID },
2447
+ /** JS ToString over a dyn value WITH the object protocol (a user
2448
+ * toString/valueOf member is CALLED and its throw propagates;
2449
+ * exhaustion throws "Cannot convert object to primitive value"; units
2450
+ * render "null"/"undefined") — the WHATWG USVString conversions
2451
+ * (URLSearchParams names/values). Borrowed dyn; +1 string. May-throw. */
2452
+ "dyn.toStringCoerce": { argTypes: [DYN], result: STRING },
2453
+ "dyn.stringConstructor": { argTypes: [DYN], result: STRING },
2454
+ "dyn.propertyKey": { argTypes: [DYN], result: DYN },
2455
+ "dyn.toNumeric": { argTypes: [DYN], result: DYN },
2456
+ "dyn.increment": { argTypes: [DYN, BOOL], result: DYN },
2457
+ /** JS ToNumber over a dyn value WITH the object protocol (number-hint
2458
+ * valueOf/toString ordering; user throws propagate). Borrowed dyn;
2459
+ * f64 result, or a throw. Used by statically lowered numeric coercions
2460
+ * whose checker type remained any. */
2461
+ "dyn.numberConstructor": { argTypes: [DYN], result: F64 },
2462
+ "dyn.bigintConstructor": { argTypes: [DYN], result: BIGINT_T },
2463
+ "dyn.toNumberCoerce": { argTypes: [DYN], result: F64 },
2464
+ "dyn.add": { argTypes: [DYN, DYN], result: DYN },
2465
+ "dyn.arithmetic": { argTypes: [DYN, DYN, STRING], result: DYN },
2466
+ "dyn.compare": { argTypes: [DYN, DYN, STRING], result: BOOL },
2467
+ "dyn.bitwise": { argTypes: [DYN, DYN, STRING], result: DYN },
2468
+ "dyn.proxyNew": { argTypes: [DYN, DYN], result: DYN },
2469
+ // Always throws; the result is the READ's declared type (a typed dummy
2470
+ // the unwind abandons) — the libCall case skips the result check.
2471
+ /** A read of a `declare`d const NOTHING defines (the bundler-define
2472
+ * pattern — __VERSION__): always throws the catchable ReferenceError
2473
+ * Node raises at the access ("<name> is not defined"). args[0] is the
2474
+ * name; the result type is the read's declared type (a typed dummy the
2475
+ * unwind abandons — the value never exists). */
2476
+ "global.undefRead": { argTypes: [STRING], result: VOID },
2477
+ "console.native": { argTypes: [], result: DYN },
2478
+ /** A native reference to the global object; known names retain value fences. */
2479
+ "global.native": { argTypes: [arrayOf(STRING)], result: DYN },
2480
+ // `X.name` through a class value: the arg is a program-dependent
2481
+ // classval (a null slot; the libCall case checks the kind).
2482
+ /** `X.name` through a class VALUE (scr_object.c): args[0] is a borrowed
2483
+ * classval; the result is the class object's stored .name string,
2484
+ * retained (+1 — the string is an interned immortal, so the retain is a
2485
+ * no-op, kept for ownership uniformity). Never throws. A direct
2486
+ * `C.name` on the class name itself folds to a strLit instead. */
2487
+ "class.name": { argTypes: [null], result: STRING },
2488
+ "error.ctor": { argTypes: [null, STRING], result: VOID },
2489
+ "error.toString": { argTypes: [null], result: STRING },
2490
+ /** SameValue over checked values, including NaN, signed zero and reference identity. */
2491
+ "dyn.sameValue": { argTypes: [DYN, DYN], result: BOOL },
2492
+ "error.stack": { argTypes: [null], result: STRING },
2493
+ "error.stackLimitGet": { argTypes: [], result: F64 },
2494
+ "error.stackLimitSet": { argTypes: [F64], result: VOID },
2495
+ // Receiver (any error-hierarchy object) and the program-dependent
2496
+ // `string | undefined` result are checked in the libCall case.
2497
+ /** NodeJS.ErrnoException's `.code` read: borrowed error-hierarchy
2498
+ * receiver → the interned `string | undefined` union (type-directed
2499
+ * construction in the backend, the process.envGet pattern) — the errno
2500
+ * name where a throw site stamped one (fs, exec spawn/timeout,
2501
+ * process.kill, the spawn 'error' event), the undefined arm everywhere
2502
+ * else. Never throws. */
2503
+ "error.code": { argTypes: [null], result: VOID },
2504
+ // DOMException: construction takes the two dyn args (WebIDL's
2505
+ // resolution runs in the runtime); the %DOMException result is a
2506
+ // program-dependent object type, checked in the libCall case. The
2507
+ // read surface takes the %DOMException receiver (a null slot — the
2508
+ // libCall case checks the class name).
2509
+ /** `new DOMException(message?, nameOrOptions?)` (scr_error.c): both args
2510
+ * are borrowed dyn values (the lowering passes the dyn undefined for an
2511
+ * absent argument, so WebIDL's optionality lives in one place). The
2512
+ * runtime ToStrings the message ("" for absent/undefined), resolves the
2513
+ * name — absent/undefined → "Error", a non-null object → ToString of its
2514
+ * `name` member plus the `cause` own-property record, anything else →
2515
+ * ToString — and stamps the legacy code from the WebIDL name table (0
2516
+ * off-table). Result is an owned (+1) %DOMException. Never throws (dyn
2517
+ * ToString is total). */
2518
+ "error.newDom": { argTypes: [DYN, DYN], result: VOID },
2519
+ /** DOMException's own read surface (scr_error.c; %DOMException receivers
2520
+ * only — borrowed). domCode: the legacy numeric code. domHasCause: the
2521
+ * options form's own-property record (`'cause' in e`). domCause: the
2522
+ * cause value, +1 (the dyn undefined when absent — matching Node's
2523
+ * undefined read). None throws. */
2524
+ "error.domCode": { argTypes: [null], result: F64 },
2525
+ "error.domHasCause": { argTypes: [null], result: BOOL },
2526
+ "error.domCause": { argTypes: [null], result: DYN },
2527
+ /** structuredClone of a %DOMException receiver (scr_error.c): WebIDL
2528
+ * serialization — name/message copy, the legacy code re-derives, cause
2529
+ * does not serialize. args are the borrowed receiver and the borrowed
2530
+ * options dyn value (the dyn undefined when absent — the shared
2531
+ * validation throws Node's exact option errors; any non-empty transfer
2532
+ * list throws DataCloneError, nothing static is transferable). Result
2533
+ * +1 %DOMException. */
2534
+ "error.domClone": { argTypes: [null, DYN], result: VOID },
2535
+ /** `d instanceof TypeError` (and the other BUILTIN error classes) on a
2536
+ * checked-dynamic value (scr_json.c): the from_error cache holds the
2537
+ * dyn↔error identity edge, so the test resolves the runtime error and
2538
+ * asks its vtable's stamped preorder interval — exact for every error
2539
+ * that crossed the boundary. A dyn object that never came from an
2540
+ * error (a hand-built {%error} literal) answers false: subclass
2541
+ * identity is unknowable there (the root keeps dynTest's marker
2542
+ * answer). args are the borrowed dyn and the SCR_ERR_* kind literal.
2543
+ * Never throws. */
2544
+ "dyn.errInstanceof": { argTypes: [DYN, F64], result: BOOL },
2545
+ "weakMap.is": { argTypes: [DYN], result: BOOL },
2546
+ "weakSet.is": { argTypes: [DYN], result: BOOL },
2547
+ "weakMap.new": { argTypes: [DYN], result: DYN },
2548
+ "weakSet.new": { argTypes: [DYN], result: DYN },
2549
+ "dyn.fromEntries": { argTypes: [DYN], result: DYN },
2550
+ "bytes.constructor": { argTypes: [STRING], result: DYN },
2551
+ "bytes.instanceOf": { argTypes: [DYN, DYN], result: BOOL },
2552
+ "bytes.construct": { argTypes: [DYN, DYN, STRING], result: DYN },
2553
+ /** The ambient receiver — JS `this` in a plain (non-method) function
2554
+ * body: the innermost binding the current firing/dispatch window
2555
+ * pushed (Node's listener receiver, a dyn OBJ method's object, an
2556
+ * apply/call thisArg), or the undefined dyn singleton with none bound
2557
+ * (the strict-mode plain-call answer, the old constant). Zero args →
2558
+ * dyn (+1). Never throws. */
2559
+ "dyn.dataViewIs": { argTypes: [DYN], result: BOOL },
2560
+ "dyn.construct": { argTypes: [DYN, DYN, STRING], result: DYN },
2561
+ "arrayBuffer.constructor": { argTypes: [], result: DYN },
2562
+ "sharedArrayBuffer.new": { argTypes: [DYN], result: DYN },
2563
+ "sharedArrayBuffer.is": { argTypes: [DYN], result: BOOL },
2564
+ "arrayBuffer.new": { argTypes: [DYN], result: DYN },
2565
+ "ffi.argument": { argTypes: [DYN, STRING], result: DYN },
2566
+ "ffi.memoryModule": { argTypes: [DYN], result: DYN },
2567
+ "intl.segmenterNew": { argTypes: [], result: DYN },
2568
+ "arrayBuffer.is": { argTypes: [DYN], result: BOOL },
2569
+ "arrayBuffer.isView": { argTypes: [DYN], result: BOOL },
2570
+ "arrayBuffer.byteLengthGetter": { argTypes: [], result: F64 },
2571
+ "arrayBuffer.byteLengthDescriptor": { argTypes: [DYN], result: DYN },
2572
+ "arrayBuffer.viewU8C": { argTypes: [DYN, DYN, DYN], result: bytesOf("u8c") },
2573
+ "arrayBuffer.viewI8": { argTypes: [DYN, DYN, DYN], result: bytesOf("i8") },
2574
+ "arrayBuffer.viewU16": { argTypes: [DYN, DYN, DYN], result: bytesOf("u16") },
2575
+ "arrayBuffer.viewI16": { argTypes: [DYN, DYN, DYN], result: bytesOf("i16") },
2576
+ "arrayBuffer.viewU8": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
2577
+ "arrayBuffer.viewU32": { argTypes: [DYN, DYN, DYN], result: bytesOf("u32") },
2578
+ "arrayBuffer.viewI32": { argTypes: [DYN, DYN, DYN], result: bytesOf("i32") },
2579
+ "arrayBuffer.viewF32": { argTypes: [DYN, DYN, DYN], result: bytesOf("f32") },
2580
+ "arrayBuffer.viewF64": { argTypes: [DYN, DYN, DYN], result: bytesOf("f64") },
2581
+ "arrayBuffer.viewDV": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
2582
+ /** Object.keys/values/entries over a CHECKED-DYNAMIC receiver
2583
+ * (scr_json.c): the runtime walks the dyn node's own members in JS
2584
+ * own-key order (array-index keys ascending first, then insertion
2585
+ * order) and answers a dyn array (entries: an array of [key, value]
2586
+ * pairs; values RETAIN the member nodes — reference semantics, like
2587
+ * JS). Strings/arrays/bytes answer their index keys; other scalars an
2588
+ * empty array; null/undefined throw Node's catchable TypeError
2589
+ * ("Cannot convert undefined or null to object"). */
2590
+ "dyn.objKeys": { argTypes: [DYN], result: DYN },
2591
+ "dyn.forInKeys": { argTypes: [DYN], result: DYN },
2592
+ "dyn.hasOwn": { argTypes: [DYN, STRING], result: BOOL },
2593
+ "dyn.propertyIsEnumerable": { argTypes: [DYN, STRING], result: BOOL },
2594
+ "dyn.assign": { argTypes: [DYN, DYN], result: DYN },
2595
+ "dyn.copyDataProperties": { argTypes: [DYN, DYN], result: DYN },
2596
+ "dyn.objectRest": { argTypes: [DYN, DYN], result: DYN },
2597
+ /** Variadic Object.assign over CHECKED-DYNAMIC targets (`Object.assign(
2598
+ * {}, ...arr.map(f), tail)` — the option-table merge): the lowering
2599
+ * builds one fresh dyn pack of sources (packPush retains a plain source
2600
+ * in; packPushSpread flattens a spread source through the spread-call
2601
+ * walk — V8's exact TypeError texts, the string arg spelling the spread
2602
+ * expression for the nullish form), so every source evaluates and
2603
+ * flattens BEFORE any copying (JS's ArgumentListEvaluation), then
2604
+ * assignAll copies each pack element's own enumerable keys onto the
2605
+ * target left to right and answers the TARGET (+1) — identity, like JS.
2606
+ * assignAll throws Node's ToObject TypeError on a nullish target. */
2607
+ "dyn.packPush": { argTypes: [DYN, DYN], result: VOID },
2608
+ "dyn.packPushSpread": { argTypes: [DYN, DYN, STRING], result: VOID },
2609
+ /** The iterated-path spread twin: V8 spells the optimized apply-path
2610
+ * texts (packPushSpread's — the expression named for nullish sources)
2611
+ * only for the SINGLE LAST argument's spread; any other spread position
2612
+ * drives the real iterator protocol, whose failure describes the VALUE
2613
+ * ("object null is not iterable (cannot read property
2614
+ * Symbol(Symbol.iterator))"). The frontend picks by position. */
2615
+ "dyn.packPushSpreadIter": { argTypes: [DYN, DYN], result: VOID },
2616
+ "dyn.reflectApply": { argTypes: [DYN, DYN, DYN], result: DYN },
2617
+ "dyn.reflectGet": { argTypes: [DYN, DYN, DYN], result: DYN },
2618
+ "dyn.reflectSet": { argTypes: [DYN, DYN, DYN, DYN], result: BOOL },
2619
+ "dyn.reflectDefine": { argTypes: [DYN, DYN, DYN], result: BOOL },
2620
+ "dyn.abstractEq": { argTypes: [DYN, DYN], result: BOOL },
2621
+ "dyn.assignAll": { argTypes: [DYN, DYN], result: DYN },
2622
+ /** `Object.create(null)` (scr_json.c): a fresh NULL-PROTOTYPE dyn
2623
+ * dictionary. The checked-dynamic tree's OBJ dispatch is already own-member-only —
2624
+ * Node's null-proto answer — so the flag's whole job is the observations
2625
+ * that SEE the prototype: inspect's "[Object: null prototype]" prefix
2626
+ * and deepStrictEqual's prototype gate. Never throws. Static builds
2627
+ * only; --dynamic routes Object.create through the engine instead. */
2628
+ "dyn.objCreateNullProto": { argTypes: [], result: DYN },
2629
+ "dyn.arrayPrototype": { argTypes: [], result: DYN },
2630
+ "dyn.arrayConstructor": { argTypes: [], result: DYN },
2631
+ "dyn.objectPrototype": { argTypes: [], result: DYN },
2632
+ "dyn.functionApply": { argTypes: [], result: DYN },
2633
+ "dyn.builtinMethod": { argTypes: [STRING, STRING], result: DYN },
2634
+ "dyn.classPrototype": { argTypes: [DYN, DYN], result: DYN },
2635
+ "dyn.classBasePrototype": { argTypes: [DYN], result: DYN },
2636
+ "dyn.classInherit": { argTypes: [DYN, DYN], result: DYN },
2637
+ "dyn.classSuper": { argTypes: [DYN, DYN, DYN], result: VOID },
2638
+ "dyn.assignPrototype": { argTypes: [DYN, DYN, DYN], result: DYN },
2639
+ "dyn.definePrototypeProps": { argTypes: [DYN, DYN, DYN], result: DYN },
2640
+ "dyn.bagGet": { argTypes: [DYN, STRING, DYN], result: DYN },
2641
+ "dyn.bagSet": { argTypes: [DYN, STRING, DYN, DYN], result: VOID },
2642
+ "dyn.objCreate": { argTypes: [DYN], result: DYN },
2643
+ "dyn.objCreateWithProperties": { argTypes: [DYN, DYN], result: DYN },
2644
+ "dyn.getPrototype": { argTypes: [DYN], result: DYN },
2645
+ "dyn.setPrototype": { argTypes: [DYN, DYN], result: DYN },
2646
+ "dyn.getOwnPropertyNames": { argTypes: [DYN], result: DYN },
2647
+ "dyn.ownKeys": { argTypes: [DYN], result: DYN },
2648
+ "dyn.getOwnPropertySymbols": { argTypes: [DYN], result: DYN },
2649
+ "dyn.getOwnPropertyDescriptors": { argTypes: [DYN], result: DYN },
2650
+ "dyn.preventExtensions": { argTypes: [DYN], result: DYN },
2651
+ "dyn.isExtensible": { argTypes: [DYN], result: BOOL },
2652
+ "dyn.seal": { argTypes: [DYN], result: DYN },
2653
+ "dyn.isSealed": { argTypes: [DYN], result: BOOL },
2654
+ "dyn.objValues": { argTypes: [DYN], result: DYN },
2655
+ "dyn.objEntries": { argTypes: [DYN], result: DYN },
2656
+ /** structuredClone over the checked-dynamic tree (scr_json.c): the JSON-safe subset plus
2657
+ * bytes (a fresh copy — a Buffer clones as a plain Uint8Array, like
2658
+ * Node), deep. Functions and handle kinds throw the spec's catchable
2659
+ * DataCloneError; CYCLES throw the scriptc fence (the checked-dynamic tree cannot
2660
+ * represent them — Node clones cycles; documented divergence). The
2661
+ * options dyn value validates with Node's exact errors (dictionary
2662
+ * conversion, the transfer-sequence member; any non-empty transfer
2663
+ * list throws DataCloneError). dyn.cloneMissing is the zero-argument
2664
+ * call: always throws Node's TypeError [ERR_MISSING_ARGS] with Node's
2665
+ * own (verbatim, doubly-wrapped) message. */
2666
+ "dyn.structuredClone": { argTypes: [DYN, DYN], result: DYN },
2667
+ "dyn.cloneMissing": { argTypes: [], result: DYN },
2668
+ /** structuredClone with a NON-EMPTY transfer array of static values:
2669
+ * nothing static is transferable, so the call always throws Node's
2670
+ * catchable DataCloneError ("Found invalid value in transferList.") —
2671
+ * lowered directly (the list's values need no dyn representation to
2672
+ * fail). */
2673
+ "dyn.cloneTransferFail": { argTypes: [], result: DYN },
2674
+ /** `new RegExp(pattern, flags?)` (scr_regex.c): a heap regex over the
2675
+ * same libregexp engine the literals use. The pattern compiles EAGERLY
2676
+ * so an invalid pattern (or an unknown flag letter) throws Node's
2677
+ * catchable SyntaxError at construction — Node's message shape with
2678
+ * libregexp's detail text (approximate fidelity; e.name exact). An
2679
+ * empty pattern stores the spec's "(?:)" source. Both args borrowed
2680
+ * strings (the lowering completes an absent flags to ""); result +1.
2681
+ * The result TYPE is the regex kind, so the link switch pulls the
2682
+ * engine exactly like a literal. */
2683
+ "regex.new": { argTypes: [STRING, STRING], result: REGEX },
2684
+ "regex.resetLastIndex": { argTypes: [REGEX, F64], result: VOID },
2685
+ "regex.newChecked": { argTypes: [DYN, DYN], result: REGEX },
2686
+ "regex.replaceCallback": { argTypes: [STRING, REGEX, DYN, BOOL], result: STRING },
2687
+ // node:events EventEmitter: receivers are emitter-hierarchy objects and
2688
+ // the chaining forms (on/off/removeAll/setMax) return the receiver's
2689
+ // own class — program-dependent object types, checked in the libCall
2690
+ // case. emitter.emit is the one VARIADIC libCall: args beyond
2691
+ // (recv, name) are the event's frontend-unified tuple, any borrowable
2692
+ // kind — the count check admits a longer list for it alone.
2693
+ /** node:events EventEmitter (scr_events_emitter.c, link-gated by
2694
+ * moduleUsesEmitter). The receiver of every instance form is a borrowed
2695
+ * emitter-hierarchy object (`%EventEmitter` or a user subclass — the
2696
+ * backend reinterprets to ScrEmitter*, the identical prefix); event
2697
+ * names are borrowed strings (compile-time literals — the frontend
2698
+ * fences non-literals and unifies each event's argument tuple program-
2699
+ * wide). The chaining forms (on/off/removeAll/setMax) return the
2700
+ * receiver +1 typed as its static class, Node's `return this`.
2701
+ *
2702
+ * emitter.new: `new EventEmitter()` → a +1 bare emitter. emitter.ctor:
2703
+ * super() into the prefix of an emitted subclass (borrowed receiver,
2704
+ * void — allocation already initialized the prefix). emitter.on:
2705
+ * (recv, name, cb /moves/, once, prepend) — the backend synthesizes the
2706
+ * per-signature va_list invoke adapter from the cb's func type.
2707
+ * emitter.emit: (recv, name, ...tuple) — VARIADIC, the one libCall
2708
+ * whose arg count exceeds its signature; args are borrowed, result is
2709
+ * the had-listeners bool. emitter.emitError: emit('error', err) —
2710
+ * throws err when unhandled. count/countFn/names/listeners/getMax/
2711
+ * setMax/setDefaultMax/getDefaultMax are the introspection surface. */
2712
+ "emitter.new": { argTypes: [], result: VOID },
2713
+ "emitter.ctor": { argTypes: [null], result: VOID },
2714
+ "emitter.on": { argTypes: [null, STRING, null, BOOL, BOOL], result: VOID },
2715
+ "emitter.off": { argTypes: [null, STRING, null], result: VOID },
2716
+ // The dyn-adapted registration family (JS-lane checked-dynamic
2717
+ // listeners): checkListener has NO receiver (it validates the listener
2718
+ // argument alone); onDyn carries (recv, name, cb dyn, adapter func,
2719
+ // once, prepend), offDyn (recv, name, cb dyn).
2720
+ "emitter.checkListener": { argTypes: [DYN], result: VOID },
2721
+ "emitter.onDyn": { argTypes: [null, STRING, DYN, null, BOOL, BOOL], result: VOID },
2722
+ "emitter.onFlex": { argTypes: [null, STRING, DYN, BOOL, BOOL], result: VOID },
2723
+ "emitter.offDyn": { argTypes: [null, STRING, DYN], result: VOID },
2724
+ "emitter.removeAll": { argTypes: [null, STRING, BOOL], result: VOID },
2725
+ "emitter.emit": { argTypes: [null, STRING], result: BOOL },
2726
+ "emitter.emitFlex": { argTypes: [null, STRING], result: BOOL },
2727
+ "emitter.emitError": { argTypes: [null, STRING, null], result: BOOL },
2728
+ "emitter.count": { argTypes: [null, STRING], result: F64 },
2729
+ "emitter.countFn": { argTypes: [null, STRING, null], result: F64 },
2730
+ "emitter.countDyn": { argTypes: [null, STRING, DYN], result: F64 },
2731
+ "emitter.names": { argTypes: [null], result: VOID },
2732
+ "emitter.listeners": { argTypes: [null, STRING], result: VOID },
2733
+ /** Stream-'data' registration twins of emitter.on/onDyn (same args):
2734
+ * chosen at registration sites whose receiver is stream-rooted, so the
2735
+ * backend emits DATA thunks — the runtime's 'data' emission carries
2736
+ * BOTH payload slots (bytes, string; exactly one non-NULL — encoded
2737
+ * streams deliver strings), and the thunk unwraps the listener's
2738
+ * declared side (typed) or boxes by tag (dyn). emitter.emitData is the
2739
+ * user-emit form: (recv, name, chunk) with a bytes OR string chunk. */
2740
+ "emitter.onData": { argTypes: [null, STRING, null, BOOL, BOOL], result: VOID },
2741
+ "emitter.onDataDyn": { argTypes: [null, STRING, DYN, null, BOOL, BOOL], result: VOID },
2742
+ "emitter.emitData": { argTypes: [null, STRING, null], result: BOOL },
2743
+ "emitter.setMax": { argTypes: [null, F64], result: VOID },
2744
+ "emitter.getMax": { argTypes: [null], result: F64 },
2745
+ "emitter.setDefaultMax": { argTypes: [F64], result: VOID },
2746
+ "emitter.getDefaultMax": { argTypes: [], result: F64 },
2747
+ // node:stream: receivers are stream-hierarchy objects and several
2748
+ // results are program-dependent (the receiver's class, unions) — the
2749
+ // libCall case owns those checks. The constructors and a few methods
2750
+ // are VARIADIC (trailing option callbacks / the optional chunk+cb tail):
2751
+ // argTypes here is the fixed prefix, VARIADIC_LIB_FNS admits the rest.
2752
+ /** node:stream (scr_stream.c, link-gated by moduleUsesStream — which
2753
+ * implies the emitter unit: stream events dispatch through the embedded
2754
+ * ScrEmitter registry). Receivers are borrowed stream-class objects
2755
+ * (`%Readable`/`%Writable`/`%Duplex`/`%Transform`/`%PassThrough` — one
2756
+ * runtime layout, reinterpreted by side).
2757
+ *
2758
+ * Constructors (`readable.new` et al): args are [hwmR, hwmW, flags]
2759
+ * followed by the PRESENT user callbacks in canonical order (read,
2760
+ * write, final, destroy, transform, flush — the flags f64 is a bitmask
2761
+ * naming which follow; absent ones emit NULL). Every callback closure
2762
+ * MOVES and carries a leading `this` param (the stream), invoked
2763
+ * through compiler-emitted adapters. Results are +1.
2764
+ *
2765
+ * readable.push / readable.pushStr / readable.pushNull: Node's push —
2766
+ * buffers or delivers (bytes chunk borrowed; string converted utf8);
2767
+ * returns the below-hwm answer. readable.read: (recv, size — -1 for
2768
+ * absent) → Buffer|null union. pause/resume return recv +1 (`this`);
2769
+ * isPaused answers the flag. readable.pipe: (recv, dst, end) → dst +1,
2770
+ * fires 'pipe' on dst; readable.unpipe (recv[, dst]) → recv +1.
2771
+ * writable.write/writeStr: (recv, chunk[, cb]) → below-hwm bool (cb
2772
+ * MOVES when present, called after the user write completes).
2773
+ * writable.end: (recv, flags[, chunk][, cb]) → recv +1. cork/uncork are
2774
+ * void. stream.destroy/destroyErr: (recv[, err]) → recv +1.
2775
+ * stream.prop: (recv, name-literal) → the flag/number the name asks
2776
+ * for; stream.errored → Error|null union; readable.flowing →
2777
+ * bool|null union. All may leave a listener's exception pending
2778
+ * (dispatch runs user code synchronously, like emit). */
2779
+ "readable.new": { argTypes: [F64, BOOL, BOOL, F64], result: VOID },
2780
+ "writable.new": { argTypes: [F64, BOOL, BOOL, F64], result: VOID },
2781
+ "duplex.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
2782
+ "transform.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
2783
+ "passthrough.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
2784
+ // The subclass-initialization twins: the borrowed receiver leads, then
2785
+ // the .new tail (variadic callbacks likewise).
2786
+ // The dyn-options twins: newDyn takes the record, initDyn the borrowed
2787
+ // receiver + record + fallback flags (trailing wrapper closures ride
2788
+ // the variadic tail like the static forms).
2789
+ /** The underscore-method assignment surface (`r._read = fn` after
2790
+ * construction — Node's own-property shadow of the prototype method):
2791
+ * args [stream receiver (borrowed), callback closure (+1 moves)]. The
2792
+ * runtime slot the matching option callback fills swaps its closure
2793
+ * and invoke thunk; the next dispatch uses it (Node's timing). The
2794
+ * setters themselves never throw. */
2795
+ "stream.setRead": { argTypes: [null, null], result: VOID },
2796
+ "stream.setWrite": { argTypes: [null, null], result: VOID },
2797
+ "stream.setFinal": { argTypes: [null, null], result: VOID },
2798
+ "stream.setDestroy": { argTypes: [null, null], result: VOID },
2799
+ "stream.setTransform": { argTypes: [null, null], result: VOID },
2800
+ "stream.setFlush": { argTypes: [null, null], result: VOID },
2801
+ /** The dyn-options twins (a checked-dynamic options record — the JS
2802
+ * lane's `super(options)` forwarding and `new Readable(dynVar)`): the
2803
+ * option walk runs at RUNTIME with Node's reading rules. newDyn:
2804
+ * (optsDyn) → the fresh stream; initDyn: (recv, optsDyn, flags,
2805
+ * ...fallback wrapper closures in canonical order — the flags literal
2806
+ * names which ride, exactly the .init callback ABI). MAY THROW (a
2807
+ * consumed-but-unlowered option is the compile fence's runtime twin). */
2808
+ /** stream.finished(s, cb) — the callback form: the watcher fires once
2809
+ * at the terminal point with the finish status; the result is the +1
2810
+ * cleanup closure. stream.pipeline(count, s1..sn, cb): chains pipes,
2811
+ * propagates the first error by destroying the rest, calls cb after the
2812
+ * last 'close'; answers the destination +1. The Dyn twins take the
2813
+ * callback as a checked-dynamic VALUE (mustCall wrappers). */
2814
+ "stream.finished": { argTypes: [null, null], result: VOID },
2815
+ "stream.finishedDyn": { argTypes: [null, DYN], result: VOID },
2816
+ "stream.pipeline": { argTypes: [F64], result: VOID },
2817
+ "stream.pipelineDyn": { argTypes: [F64], result: VOID },
2818
+ /** node:stream/promises — the promise forms over the same machinery:
2819
+ * sp.finished: (s) → a pending void promise the terminal watcher
2820
+ * settles; sp.pipeline: (count, s1..sn) → the callback pipeline's
2821
+ * chaining/destroyer semantics settling a void promise (fulfilled on a
2822
+ * clean finish, rejected with the finish status otherwise). */
2823
+ "sp.finished": { argTypes: [null], result: { kind: "promise", inner: VOID } },
2824
+ "sp.pipeline": { argTypes: [F64], result: { kind: "promise", inner: VOID } },
2825
+ /** node:stream/consumers — the promise consumers over the readable
2826
+ * machinery: (s) → a pending promise settled at the terminal point
2827
+ * with the accumulated result (sc.text: the utf8 decode, sc.json: the
2828
+ * parsed dyn — malformed input rejects with the parse's SyntaxError,
2829
+ * sc.buffer: the concatenated bytes) or rejected with the stream's
2830
+ * error / ERR_STREAM_PREMATURE_CLOSE. */
2831
+ "sc.text": { argTypes: [null], result: { kind: "promise", inner: STRING } },
2832
+ "sc.json": { argTypes: [null], result: { kind: "promise", inner: DYN } },
2833
+ "sc.buffer": { argTypes: [null], result: { kind: "promise", inner: BYTES_U8 } },
2834
+ "readable.newDyn": { argTypes: [DYN], result: VOID },
2835
+ "writable.newDyn": { argTypes: [DYN], result: VOID },
2836
+ "duplex.newDyn": { argTypes: [DYN], result: VOID },
2837
+ "transform.newDyn": { argTypes: [DYN], result: VOID },
2838
+ "passthrough.newDyn": { argTypes: [DYN], result: VOID },
2839
+ "readable.initDyn": { argTypes: [null, DYN, F64], result: VOID },
2840
+ "writable.initDyn": { argTypes: [null, DYN, F64], result: VOID },
2841
+ "duplex.initDyn": { argTypes: [null, DYN, F64], result: VOID },
2842
+ "transform.initDyn": { argTypes: [null, DYN, F64], result: VOID },
2843
+ "passthrough.initDyn": { argTypes: [null, DYN, F64], result: VOID },
2844
+ /** Subclass initialization (`super(options?)` in a user `extends
2845
+ * Readable` constructor): same tail as the `.new` forms, prefixed with
2846
+ * the BORROWED receiver (the emitted subclass allocation — vtable and
2847
+ * display name stamped, state NULL until here). Overridden underscore
2848
+ * methods arrive as synthesized wrapper closures dispatching through
2849
+ * the vtable. Void result. */
2850
+ "readable.init": { argTypes: [null, F64, BOOL, BOOL, F64], result: VOID },
2851
+ "writable.init": { argTypes: [null, F64, BOOL, BOOL, F64], result: VOID },
2852
+ "duplex.init": { argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
2853
+ "transform.init": { argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
2854
+ "passthrough.init": {
2855
+ argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64],
2856
+ result: VOID,
2857
+ },
2858
+ "readable.push": { argTypes: [null, BYTES_U8], result: BOOL },
2859
+ "readable.pushStr": { argTypes: [null, STRING], result: BOOL },
2860
+ "readable.pushNull": { argTypes: [null], result: BOOL },
2861
+ "readable.pushU": { argTypes: [null, null], result: BOOL },
2862
+ "readable.pushDyn": { argTypes: [null, DYN], result: BOOL },
2863
+ "readable.unshift": { argTypes: [null, BYTES_U8], result: VOID },
2864
+ "readable.unshiftStr": { argTypes: [null, STRING], result: VOID },
2865
+ "stream.onDyn": { argTypes: [null, STRING, DYN, BOOL, BOOL], result: VOID },
2866
+ "readable.readDyn": { argTypes: [null, DYN], result: DYN },
2867
+ "readable.read": { argTypes: [null, F64], result: VOID },
2868
+ "readable.pause": { argTypes: [null], result: VOID },
2869
+ "readable.setEncoding": { argTypes: [null, STRING], result: VOID },
2870
+ /** push(chunk, enc) with a literal non-utf8 encoding, and the
2871
+ * defaultEncoding option's push side (how push(string) decodes —
2872
+ * Buffer.from(chunk, enc)); both carry the CANONICAL literal. */
2873
+ "readable.pushStrEnc": { argTypes: [null, STRING, STRING], result: BOOL },
2874
+ "readable.pushEncoding": { argTypes: [null, STRING], result: VOID },
2875
+ /** for-await over a readable (the desugared loop's per-pass promise):
2876
+ * +1 promise of the next chunk — buffered content, the EOF sentinel
2877
+ * (empty Buffer / dyn undefined), or a rejection with the stream's
2878
+ * error. The Dyn twin boxes chunks by runtime tag (the JS lane).
2879
+ * readable.fromArr is Readable.from(array): a fully-seeded object-
2880
+ * entry stream (one whole chunk per element; strings per the flag). */
2881
+ "readable.nextChunk": { argTypes: [null], result: VOID },
2882
+ "readable.nextChunkDyn": { argTypes: [null], result: VOID },
2883
+ "readable.fromArr": { argTypes: [null, BOOL], result: VOID },
2884
+ "readable.resume": { argTypes: [null], result: VOID },
2885
+ "readable.isPaused": { argTypes: [null], result: BOOL },
2886
+ "readable.pipe": { argTypes: [null, null, BOOL], result: VOID },
2887
+ "readable.unpipe": { argTypes: [null], result: VOID },
2888
+ "readable.flowing": { argTypes: [null], result: VOID },
2889
+ "writable.write": { argTypes: [null, BYTES_U8], result: BOOL },
2890
+ "writable.writeStr": { argTypes: [null, STRING], result: BOOL },
2891
+ "writable.writeU": { argTypes: [null, null], result: BOOL },
2892
+ "writable.writeDyn": { argTypes: [null, DYN], result: BOOL },
2893
+ "writable.end": { argTypes: [null, F64], result: VOID },
2894
+ "writable.cork": { argTypes: [null], result: VOID },
2895
+ "writable.uncork": { argTypes: [null], result: VOID },
2896
+ "stream.destroy": { argTypes: [null], result: VOID },
2897
+ "stream.destroyErr": { argTypes: [null, null], result: VOID },
2898
+ /** AsyncIteratorClose for Readable[Symbol.asyncIterator](): destroy with
2899
+ * Node's AbortError/ABORT_ERR payload while the iterator's internal error
2900
+ * consumer prevents an unhandled-error crash. */
2901
+ "stream.iteratorClose": { argTypes: [null], result: VOID },
2902
+ "stream.prop": { argTypes: [null, STRING], result: VOID },
2903
+ "stream.errored": { argTypes: [null], result: VOID },
2904
+ // node:assert: pass/negated/deep/hasMsg are frontend-computed bools; the
2905
+ // message slot always carries a string ("" when hasMsg is false).
2906
+ /** node:assert (scr_assert.c; assert.match in scr_regex.c — every call
2907
+ * site carries a regex value, so the regex link switch is already on).
2908
+ * Failures throw a catchable AssertionError — a runtime %Error whose
2909
+ * name is "AssertionError" and whose code slot is "ERR_ASSERTION" — so
2910
+ * `instanceof Error`, `.name`, `.message`, and `.code` all answer like
2911
+ * Node's. Generated messages are Node's assertion_error.js scalar forms
2912
+ * byte-exactly (the short `a !== b` form, the stacked `+ actual
2913
+ * - expected` diff with the string `^` indicator, the inline-vs-block
2914
+ * not-equal split); composite deep failures carry the header line
2915
+ * without the rendered inspect diff (documented divergence).
2916
+ *
2917
+ * assert.ok: (pass, message) — the frontend computed the truthiness AND
2918
+ * the full message (the user's, or the compile-time source-text form —
2919
+ * assert.fail lowers here too with pass=false). assert.eqF64/eqBigInt/
2920
+ * eqStr/eqBool: (a, b, negated, deep, msg, hasMsg) — Object.is comparison,
2921
+ * covering strictEqual/notStrictEqual and the scalar deepStrictEqual
2922
+ * pair; msg is a typed dummy ("" literal) when hasMsg is false (Node
2923
+ * distinguishes an omitted message from an empty one per operator).
2924
+ * assert.deepResult: (equal, negated, msg, hasMsg) — the verdict of a
2925
+ * frontend-synthesized structural comparison, turned into Node's throw.
2926
+ * assert.sameValue: Object.is over doubles (the deep-equal helpers'
2927
+ * number leaf; never throws). assert.match: (s, regex, negated, msg,
2928
+ * hasMsg) — a fresh exec from index 0. assert.throwsNone: (rejection,
2929
+ * ename, hasEname, msg, hasMsg) — the "Missing expected
2930
+ * exception|rejection" throw of assert.throws/rejects whose callback
2931
+ * returned (fulfilled) normally, with Node's ` (${expected.name})`
2932
+ * detail when the expected class or shape carries a name.
2933
+ * assert.throwsMismatch: (expectedName, error) — the wrong-class throw
2934
+ * of the assert.throws(fn, ErrorClass) form. assert.eqSym:
2935
+ * (a, b, negated, deep, msg, hasMsg) — strict equality over symbol
2936
+ * values, pointer identity with v24's "Symbol(desc)" stacked-diff
2937
+ * messages (scr_symbol.c, the assert.match pattern — symbol-typed
2938
+ * slots already flip the symbol link switch). assert.eqDyn:
2939
+ * (a, b, negated, deep, msg, hasMsg) — the whole quartet over
2940
+ * checked-dynamic operands (both slots dyn; the frontend boxes a
2941
+ * static side with dynFrom first): SameValue for the strict pair over
2942
+ * the dyn kinds (boxed-closure identity for functions), the structural
2943
+ * dyn walk for the deep pair, with assertion_error.js's messages —
2944
+ * scalar forms byte-exact, composites rendered compact:false/sorted
2945
+ * through the checked-dynamic tree and diffed with the real myers line printer.
2946
+ *
2947
+ * The assert.throws(fn, {name/code/message}) shape check
2948
+ * (expectedException over the static error surface): shapeBegin
2949
+ * stashes the caught error, shapeStr/shapeRe add one expected key each
2950
+ * (key ids 0 code / 1 message / 2 name; shapeRe lives in scr_regex.c —
2951
+ * its regex argument flips the regex link switch — and tests eagerly
2952
+ * so scr_assert.c stays libregexp-free), then shapeEnd throws Node's
2953
+ * deep-equal Comparison diff BYTE-EXACTLY (the bounded key set makes
2954
+ * the rendering enumerable) or the custom message.
2955
+ * assert.throwsRegex: (regex, error, msg, hasMsg) — the
2956
+ * assert.throws(fn, /re/) check over String(error), Node's
2957
+ * regex-mismatch message. assert.regexErrTest: doesNotReject's silent
2958
+ * regex predicate over String(error) (never throws).
2959
+ * assert.unwantedRejection: (error, msg, hasMsg) — doesNotReject's
2960
+ * "Got unwanted rejection" throw.
2961
+ * assert.ifErrorErr/F64/Str/Bool: assert.ifError's per-type throws
2962
+ * ("ifError got unwanted exception: " + the error's message/name or
2963
+ * the value's inspection) — the frontend routes null/undefined to a
2964
+ * no-op and everything else here (Node throws for falsy values too).
2965
+ * All arguments are borrowed. */
2966
+ "assert.ok": { argTypes: [BOOL, STRING], result: VOID },
2967
+ "assert.eqF64": { argTypes: [F64, F64, BOOL, BOOL, STRING, BOOL], result: VOID },
2968
+ "assert.eqBigInt": { argTypes: [BIGINT_T, BIGINT_T, BOOL, BOOL, STRING, BOOL], result: VOID },
2969
+ "assert.eqStr": { argTypes: [STRING, STRING, BOOL, BOOL, STRING, BOOL], result: VOID },
2970
+ "assert.eqBool": { argTypes: [BOOL, BOOL, BOOL, BOOL, STRING, BOOL], result: VOID },
2971
+ "assert.deepResult": { argTypes: [BOOL, BOOL, STRING, BOOL], result: VOID },
2972
+ "assert.sameValue": { argTypes: [F64, F64], result: BOOL },
2973
+ // The deep-equality pair memo: both slots are program-dependent
2974
+ // (any cycle-capable record/array/map type).
2975
+ /* deepStrictEqual's pair memo over cycle-capable types: enter answers
2976
+ * true for a pair already being compared (Node's memo — equal cyclic
2977
+ * structures compare true); leave pops. */
2978
+ "assert.deqEnter": { argTypes: [null, null], result: BOOL },
2979
+ "assert.deqLeave": { argTypes: [], result: VOID },
2980
+ "assert.match": { argTypes: [STRING, REGEX, BOOL, STRING, BOOL], result: VOID },
2981
+ "assert.throwsNone": { argTypes: [BOOL, STRING, BOOL, STRING, BOOL], result: VOID },
2982
+ "assert.throwsMismatch": {
2983
+ argTypes: [STRING, { kind: "object", className: "%Error" }, STRING, BOOL],
2984
+ result: VOID,
2985
+ },
2986
+ "assert.throwsRegex": {
2987
+ argTypes: [REGEX, { kind: "object", className: "%Error" }, STRING, BOOL],
2988
+ result: VOID,
2989
+ },
2990
+ // Symbol strict equality (pointer identity; scr_symbol.c).
2991
+ "assert.eqSym": {
2992
+ argTypes: [{ kind: "symbol" }, { kind: "symbol" }, BOOL, BOOL, STRING, BOOL],
2993
+ result: VOID,
2994
+ },
2995
+ // The equality quartet over checked-dynamic operands (the frontend
2996
+ // boxes a static side into the checked-dynamic tree first).
2997
+ "assert.eqDyn": { argTypes: [DYN, DYN, BOOL, BOOL, STRING, BOOL], result: VOID },
2998
+ "assert.looseResult": { argTypes: [BOOL, BOOL, STRING, STRING, STRING, BOOL], result: VOID },
2999
+ // The throws(fn, {shape}) accumulator: begin/slot calls never throw;
3000
+ // shapeEnd throws the Comparison diff. The error slot is the
3001
+ // %Error-narrowed caught value.
3002
+ "assert.shapeBegin": { argTypes: [{ kind: "object", className: "%Error" }], result: VOID },
3003
+ "assert.shapeStr": { argTypes: [F64, STRING], result: VOID },
3004
+ "assert.shapeRe": { argTypes: [F64, REGEX], result: VOID },
3005
+ "assert.shapeEnd": { argTypes: [STRING, BOOL], result: VOID },
3006
+ "assert.regexErrTest": {
3007
+ argTypes: [REGEX, { kind: "object", className: "%Error" }],
3008
+ result: BOOL,
3009
+ },
3010
+ "assert.unwantedRejection": {
3011
+ argTypes: [{ kind: "object", className: "%Error" }, STRING, BOOL],
3012
+ result: VOID,
3013
+ },
3014
+ "assert.unwantedError": { argTypes: [STRING, BOOL, STRING, BOOL], result: VOID },
3015
+ "assert.noErrorPredicate": { argTypes: [DYN, DYN], result: BOOL },
3016
+ "assert.regexDynTest": { argTypes: [REGEX, DYN], result: BOOL },
3017
+ /** Node's expectsError over an error-INSTANCE expected (assert.throws/
3018
+ * rejects second argument): walk the expected dyn error's keys (name,
3019
+ * message, code — the %error marker skipped) and deep-compare each
3020
+ * against the caught value's; a mismatch throws the deep-equal
3021
+ * AssertionError (scr_assert.c). MAY THROW by design. */
3022
+ "assert.expectsErrDyn": { argTypes: [DYN, DYN, STRING, BOOL], result: VOID },
3023
+ // assert.ifError's typed entries (always throw; unit args never
3024
+ // lower). The error slot is program-dependent — any %Error-hierarchy
3025
+ // class, root or subclass (the insp.error precedent, null slot).
3026
+ "assert.ifErrorErr": { argTypes: [null], result: VOID },
3027
+ "assert.ifErrorF64": { argTypes: [F64], result: VOID },
3028
+ "assert.ifErrorStr": { argTypes: [STRING], result: VOID },
3029
+ "assert.ifErrorBool": { argTypes: [BOOL], result: VOID },
3030
+ "assert.ifErrorDyn": { argTypes: [DYN], result: VOID },
3031
+ // Bytes equality: the two value slots are any bytes kind (the frontend
3032
+ // gates both sides to ONE static bytes type; the libCall case checks
3033
+ // the kind and the pair below).
3034
+ "assert.refEqBytes": { argTypes: [null, null, BOOL, BOOL, STRING, BOOL], result: VOID },
3035
+ "assert.refEqFn": { argTypes: [null, null, BOOL, STRING, BOOL], result: VOID },
3036
+ "assert.bytesDeepEq": { argTypes: [null, null, BOOL], result: BOOL },
3037
+ // util.inspect: the error receiver is program-dependent (a builtin or
3038
+ // user error class — the error.toString precedent, null slot).
3039
+ /** util.inspect (scr_inspect.c — its own link switch, moduleUsesInspect):
3040
+ * the runtime half of the static rendering. Scalar formatters return +1
3041
+ * strings (insp.f64: JS ToString except -0; insp.str: the quoting
3042
+ * ladder + line splitting; insp.regex: /source/flags; insp.buffer:
3043
+ * <Buffer aa ..>). insp.error renders the STACKLESS [Name: message]
3044
+ * form with the code slot as its one property. insp.dyn walks the
3045
+ * checked-dynamic tree entirely in the runtime (its shape lives in the
3046
+ * value); insp.dynS is format's %s twin (dyn strings pass verbatim).
3047
+ * insp.jsval ([value, recurse, depth], --dynamic only) renders the
3048
+ * island scalars and THROWS a catchable TypeError on composites (the
3049
+ * may-throw seed set). begin/entry/moreItems/end drive the frame
3050
+ * engine from the compiler-synthesized per-type traversal helpers
3051
+ * (%util.insp.N — the deepStrictEqual precedent). */
3052
+ "insp.f64": { argTypes: [F64], result: STRING },
3053
+ /** util.format %j over a checked-dynamic argument: the runtime dyn
3054
+ * walk (JS-exact stringify; root undefined/function prints
3055
+ * "undefined"; a handle in the tree throws the loud fence). */
3056
+ "insp.jsonDyn": { argTypes: [DYN], result: STRING },
3057
+ "insp.str": { argTypes: [STRING], result: STRING },
3058
+ "insp.regex": { argTypes: [REGEX], result: STRING },
3059
+ "insp.buffer": { argTypes: [BYTES_U8], result: STRING },
3060
+ "insp.error": { argTypes: [null, F64, F64], result: STRING },
3061
+ "insp.dyn": { argTypes: [DYN, F64, F64], result: STRING },
3062
+ "insp.dynS": { argTypes: [DYN, F64], result: STRING },
3063
+ "insp.jsval": { argTypes: [JSVAL, F64, F64], result: STRING },
3064
+ "insp.begin": { argTypes: [F64], result: VOID },
3065
+ "insp.entry": { argTypes: [STRING, BOOL], result: VOID },
3066
+ // Circular references: the receiver slot is program-dependent (any
3067
+ // cycle-capable record/array/map/class type — the insp.error precedent).
3068
+ /* Circular references over cycle-capable composites (recursive record/
3069
+ * class types): circCheck answers a value's circular id when it is
3070
+ * already on the traversal stack (0 otherwise), seenPush/refWrap
3071
+ * bracket the frame (refWrap adds Node's "<ref *N> " prefix to values
3072
+ * the walk found circular), circular renders "[Circular *N]". */
3073
+ "insp.circCheck": { argTypes: [null], result: F64 },
3074
+ "insp.seenPush": { argTypes: [null], result: VOID },
3075
+ "insp.refWrap": { argTypes: [null, STRING], result: STRING },
3076
+ "insp.circular": { argTypes: [F64], result: STRING },
3077
+ "insp.key": { argTypes: [STRING], result: STRING },
3078
+ "insp.moreItems": { argTypes: [F64], result: STRING },
3079
+ "insp.end": { argTypes: [STRING, STRING, STRING, F64, BOOL, BOOL], result: STRING },
3080
+ /** node:string_decoder's utf8 StringDecoder (scr_string.c): the decoder
3081
+ * value is a one-field record whose f64 PACKS the pending partial
3082
+ * sequence (count + up to 3 raw bytes — Node buffers at most 3 for
3083
+ * every encoding); the frontend's interned %strdec helpers thread it,
3084
+ * with the decoder's CANONICAL encoding name first, through these pure
3085
+ * functions. write: (enc, pending, chunk) → the decoded complete
3086
+ * prefix of pending+chunk (+1); next: (enc, pending, chunk) → the
3087
+ * packed NEW pending; end: (enc, pending) → the buffered partial's
3088
+ * flush (+1). Node-exact per encoding (oracle-pinned); none throws. */
3089
+ "strdec.write": { argTypes: [STRING, F64, BYTES_U8], result: STRING },
3090
+ "strdec.next": { argTypes: [STRING, F64, BYTES_U8], result: F64 },
3091
+ "strdec.end": { argTypes: [STRING, F64], result: STRING },
3092
+ // node:readline: the interface handle is f64; the callbacks' func types
3093
+ // are program-dependent (zero-param or (answer: string) — the emitter
3094
+ // picks the adapter), so those slots are null like child.onExit's.
3095
+ /** node:readline's question/close slice (scr_readline.c, linked under
3096
+ * the events gate — these fns imply moduleUsesProcessEvents). The
3097
+ * interface value is an f64 handle (the Timeout-id precedent).
3098
+ * rl.create: [] → f64 — createInterface({ input: process.stdin,
3099
+ * output: process.stdout }), registering the unit's shared stdin
3100
+ * consumer (an OPEN interface keeps the loop alive until close/EOF,
3101
+ * Node's semantics). rl.question: [handle, query, cb] — writes the
3102
+ * query to stdout (Node writes under pipes too) and delivers the next
3103
+ * line's text through a backend-picked adapter (zero-param or
3104
+ * (answer: string)); THROWS Node's "readline was closed" on a closed
3105
+ * interface (may-throw). rl.close: [handle] — fires 'close' listeners
3106
+ * SYNCHRONOUSLY (Node's inline emit) and detaches the consumer (the
3107
+ * loop stops waiting on fd 0). rl.onClose: [handle, cb] — a zero-arg
3108
+ * listener (moves); stdin EOF closes every open interface with the
3109
+ * buffered partial line DISCARDED, like Node. */
3110
+ "rl.create": { argTypes: [], result: F64 },
3111
+ "rl.question": { argTypes: [F64, STRING, null], result: VOID },
3112
+ "rl.close": { argTypes: [F64], result: VOID },
3113
+ "rl.onClose": { argTypes: [F64, null], result: VOID },
3114
+ /** node:timers/promises — the promisified pair (scr_async.c, beside
3115
+ * the timer heap they ride): tp.setTimeout: [ms] → a pending void
3116
+ * promise a one-shot heap timer fulfills (the loop's timer phase, FIFO
3117
+ * against equal deadlines like Node); tp.setImmediate: [] → the same
3118
+ * through the immediate queue (fires before due timers of later loop
3119
+ * turns, Node's check phase). Neither throws. */
3120
+ "tp.setTimeout": { argTypes: [F64], result: { kind: "promise", inner: VOID } },
3121
+ "tp.setImmediate": { argTypes: [], result: { kind: "promise", inner: VOID } },
3122
+ /** node:diagnostics_channel (scr_dc.c, linked when any dc.* appears —
3123
+ * the zlib gating precedent): a process-global name→channel registry;
3124
+ * channel values are f64 handles (type-mapper.ts maps Channel to F64, the
3125
+ * readline.Interface pattern). Subscribers are dyn function values —
3126
+ * identity-compared by unsubscribe, called (message, name) by publish
3127
+ * over a SNAPSHOT of the list (a subscriber unsubscribing itself
3128
+ * mid-publish still lets its siblings fire, Node's behavior). dc.publish
3129
+ * MAY THROW: a subscriber's throw propagates out of publish (catchable
3130
+ * there) where Node routes it to triggerUncaughtException — the
3131
+ * documented divergence. subscribe/unsubscribe throw Node's
3132
+ * ERR_INVALID_ARG_TYPE TypeError for non-function subscribers. */
3133
+ "dc.channel": { argTypes: [STRING], result: F64 },
3134
+ "dc.subscribe": { argTypes: [STRING, DYN], result: VOID },
3135
+ "dc.unsubscribe": { argTypes: [STRING, DYN], result: BOOL },
3136
+ "dc.hasSubscribers": { argTypes: [STRING], result: BOOL },
3137
+ "dc.publish": { argTypes: [F64, DYN], result: VOID },
3138
+ "dc.chanSubscribe": { argTypes: [F64, DYN], result: VOID },
3139
+ "dc.chanUnsubscribe": { argTypes: [F64, DYN], result: BOOL },
3140
+ "dc.chanHasSubscribers": { argTypes: [F64], result: BOOL },
3141
+ "dc.chanName": { argTypes: [F64], result: STRING },
3142
+ /** TracingChannel (dc.tracingChannel): a registry entry of the five
3143
+ * event channels, an f64 handle like Channel (type-mapper.ts). tcSubscribe/
3144
+ * tcUnsubscribe walk a dyn handlers object's five event keys (truthy
3145
+ * non-function slots throw the per-channel ERR_INVALID_ARG_TYPE);
3146
+ * tcTraceSync/tcTraceCallback/tcTracePromise run Node's publish choreography in C over
3147
+ * dyn values (fn, ctx, thisArg, args-array) with thisArg bound as the
3148
+ * ambient receiver — the traced call's throw and any subscriber throw
3149
+ * both propagate (MAY THROW). tcTraceCallback wraps args[position] in a
3150
+ * native error/result + asyncStart/asyncEnd publisher and throws Node's
3151
+ * TypeError when that slot is not callable. tracingChannelOf is the
3152
+ * five-Channel collection form of the constructor. */
3153
+ /** setImmediate as a first-class dyn value (scr_async.c): a minted dyn
3154
+ * callable scheduling args[0](args[1..]) on the immediate queue — the
3155
+ * Node-suite traceCallback shape (`traceCallback(setImmediate, ...)`).
3156
+ * Calling it validates the callback (the dyn call machinery); minting
3157
+ * never throws. */
3158
+ "timers.setImmediateFnValue": { argTypes: [], result: DYN },
3159
+ /** `new Promise(setImmediate)` (the Node-suite early-exit shape): a
3160
+ * fresh promise an immediate fulfills with the undefined dyn value —
3161
+ * the executor IS setImmediate, so resolve rides the immediate queue
3162
+ * (scr_async.c). Never throws. */
3163
+ "timers.immediatePromise": { argTypes: [], result: { kind: "promise", inner: DYN } },
3164
+ "dc.tracingChannel": { argTypes: [STRING], result: F64 },
3165
+ "dc.tracingChannelOf": { argTypes: [F64, F64, F64, F64, F64], result: F64 },
3166
+ "dc.tcChannel": { argTypes: [F64, F64], result: F64 },
3167
+ "dc.tcHasSubscribers": { argTypes: [F64], result: BOOL },
3168
+ "dc.tcSubscribe": { argTypes: [F64, DYN], result: VOID },
3169
+ "dc.tcUnsubscribe": { argTypes: [F64, DYN], result: BOOL },
3170
+ "dc.tcTraceSync": { argTypes: [F64, DYN, DYN, DYN, DYN], result: DYN },
3171
+ "dc.tcTraceCallback": { argTypes: [F64, DYN, F64, DYN, DYN, DYN], result: DYN },
3172
+ /** tracePromise (scr_dc.c): start publish, the traced call, a wrap of
3173
+ * non-promise results, the end publish, and a REACTION FIBER that
3174
+ * awaits the traced promise and publishes asyncStart/asyncEnd (error
3175
+ * first on rejection) before settling the returned promise<dyn> with
3176
+ * the passed-through outcome. MAY THROW (the traced call and the
3177
+ * synchronous publishes). */
3178
+ "dc.tcTracePromise": {
3179
+ argTypes: [F64, DYN, DYN, DYN, DYN],
3180
+ result: { kind: "promise", inner: DYN },
3181
+ },
3182
+ /** process.on/once('unhandledRejection', fn): registers a dyn listener
3183
+ * the checkpoint report dispatches per never-observed rejection —
3184
+ * (reason, promise) — instead of printing and exiting 1 (scr_async.c).
3185
+ * The bool second arg is `once` (auto-removed after one delivery,
3186
+ * Node's once); off/removeListener remove by closure identity, the
3187
+ * offWarning stance. Throws Node's ERR_INVALID_ARG_TYPE on a
3188
+ * non-function. */
3189
+ /** Uncaught exception handlers and monitors: [callback dyn, once, monitor]. */
3190
+ "process.onUncaughtException": { argTypes: [DYN, BOOL, BOOL], result: VOID },
3191
+ "process.offUncaughtException": { argTypes: [DYN, BOOL], result: VOID },
3192
+ "process.onUnhandledRejection": { argTypes: [DYN, BOOL], result: VOID },
3193
+ "process.offUnhandledRejection": { argTypes: [DYN], result: VOID },
3194
+ /** process.on/once/off('rejectionHandled', fn): the sibling registry.
3195
+ * A handler attached after unhandledRejection delivery fires the event
3196
+ * once. Dispatch is synchronous at the attach, with the promise,
3197
+ * Node's payload. */
3198
+ "process.onRejectionHandled": { argTypes: [DYN, BOOL], result: VOID },
3199
+ "process.offRejectionHandled": { argTypes: [DYN], result: VOID },
3200
+ /** process warnings (scr_lib.c): onWarning/offWarning register dyn
3201
+ * listeners; emitWarning applies Node's full argument grammar over the
3202
+ * call's dyn argument vector (ERR_INVALID_ARG_TYPE TypeErrors — MAY
3203
+ * THROW; a listener throw propagates too) and always prints Node's
3204
+ * stderr report. Emission is synchronous (SEMANTICS.md). */
3205
+ "process.onWarning": { argTypes: [DYN], result: VOID },
3206
+ "process.offWarning": { argTypes: [DYN], result: VOID },
3207
+ "process.emitWarning": { argTypes: [DYN], result: VOID },
3208
+ /** AsyncLocalStorage (node:async_hooks — scr_async.c): stores are f64
3209
+ * handles; contexts are immutable fiber-carried snapshots (spawned
3210
+ * fibers inherit the spawner's — Node's init-time capture). run/exit
3211
+ * enter (or clear) the store, call the dyn function with forwarded
3212
+ * arguments, and restore (the finally); getStore answers the current
3213
+ * dyn value or undefined; enterWith installs with no restore point.
3214
+ * run/exit MAY THROW (the callback's own throws propagate). */
3215
+ /** `await v` over a checked-dynamic VALUE (scr_async.c): a dyn promise
3216
+ * adopts (rejections re-throw — MAY THROW), anything else takes JS's
3217
+ * one-microtask non-thenable await and answers itself. Only emitted
3218
+ * inside async bodies (the frontend's isAsync gate). */
3219
+ "async.awaitDyn": { argTypes: [DYN], result: DYN },
3220
+ /** The bare one-microtask hop (scr_await_hop): `await v` over a typed
3221
+ * NON-promise value — JS awaits non-thenables through exactly one
3222
+ * microtask turn and yields the value itself. Never throws. */
3223
+ "async.hop": { argTypes: [], result: VOID },
3224
+ "als.new": { argTypes: [], result: F64 },
3225
+ "als.get": { argTypes: [F64], result: DYN },
3226
+ "als.run": { argTypes: [F64, DYN, DYN, DYN], result: DYN },
3227
+ "als.exitRun": { argTypes: [F64, DYN, DYN], result: DYN },
3228
+ "als.enterWith": { argTypes: [F64, DYN], result: VOID },
3229
+ "als.disable": { argTypes: [F64], result: VOID },
3230
+ /** Channel.bindStore/unbindStore/runStores (scr_dc.c): the
3231
+ * AsyncLocalStorage integration — set-semantics bindings per store,
3232
+ * runStores entering every bound store with transform(data) around the
3233
+ * publish and the callback (MAY THROW: transforms, subscribers, and
3234
+ * the callback all run). */
3235
+ "dc.chanBindStore": { argTypes: [F64, F64, DYN], result: VOID },
3236
+ "dc.chanUnbindStore": { argTypes: [F64, F64], result: BOOL },
3237
+ "dc.chanRunStores": { argTypes: [F64, DYN, DYN, DYN, DYN], result: DYN },
3238
+ /** The Number statics with a static C implementation (scr_lib.c): one
3239
+ * f64 arg → bool, JS-exact BY CONSTRUCTION — Number.isFinite/isNaN/
3240
+ * isInteger/isSafeInteger never coerce, and the frontend routes only
3241
+ * f64-typed arguments here (other static types fence). None throws. */
3242
+ "number.isFinite": { argTypes: [F64], result: BOOL },
3243
+ "number.isNaN": { argTypes: [F64], result: BOOL },
3244
+ "number.isInteger": { argTypes: [F64], result: BOOL },
3245
+ "number.isSafeInteger": { argTypes: [F64], result: BOOL },
3246
+ /** Date (scr_lib.c). Values are TimeClip'd epoch-millisecond scalars:
3247
+ * construction/store/pass/getters are exact while identity and mutation
3248
+ * remain fenced. date.now is Node's integer milliseconds since epoch;
3249
+ * date.toISOString formats one raw f64 millisecond time value and
3250
+ * date.toISOStringValue formats a stored Date, both with Node's rules (UTC,
3251
+ * YYYY-MM-DDTHH:mm:ss.sssZ, expanded ±YYYYYY years outside 0–9999,
3252
+ * ToInteger truncation of fractional ms) and THROWS Node's "Invalid
3253
+ * time value" RangeError on NaN / out-of-range input (may-throw seed).
3254
+ * Results: f64 / owned (+1) string. */
3255
+ "date.now": { argTypes: [], result: F64 },
3256
+ "date.newNow": { argTypes: [], result: DATE_T },
3257
+ "date.newMs": { argTypes: [F64], result: DATE_T },
3258
+ "date.newString": { argTypes: [STRING], result: DATE_T },
3259
+ /** Date.parse(dateString), with its own reach witness for exact fences. */
3260
+ "date.parse": { argTypes: [STRING], result: F64 },
3261
+ "date.getTime": { argTypes: [DATE_T], result: F64 },
3262
+ "date.valueOf": { argTypes: [DATE_T], result: F64 },
3263
+ "date.toISOString": { argTypes: [F64], result: STRING },
3264
+ "date.toISOStringValue": { argTypes: [DATE_T], result: STRING },
3265
+ "date.getFullYear": { argTypes: [DATE_T], result: F64 },
3266
+ "date.getUTCFullYear": { argTypes: [DATE_T], result: F64 },
3267
+ "date.getMonth": { argTypes: [DATE_T], result: F64 },
3268
+ "date.getUTCMonth": { argTypes: [DATE_T], result: F64 },
3269
+ "date.getDate": { argTypes: [DATE_T], result: F64 },
3270
+ "date.getUTCDate": { argTypes: [DATE_T], result: F64 },
3271
+ "date.getDay": { argTypes: [DATE_T], result: F64 },
3272
+ "date.getUTCDay": { argTypes: [DATE_T], result: F64 },
3273
+ "date.getHours": { argTypes: [DATE_T], result: F64 },
3274
+ "date.getUTCHours": { argTypes: [DATE_T], result: F64 },
3275
+ "date.getMinutes": { argTypes: [DATE_T], result: F64 },
3276
+ "date.getUTCMinutes": { argTypes: [DATE_T], result: F64 },
3277
+ "date.getSeconds": { argTypes: [DATE_T], result: F64 },
3278
+ "date.getUTCSeconds": { argTypes: [DATE_T], result: F64 },
3279
+ "date.getMilliseconds": { argTypes: [DATE_T], result: F64 },
3280
+ "date.getUTCMilliseconds": { argTypes: [DATE_T], result: F64 },
3281
+ "date.getTimezoneOffset": { argTypes: [DATE_T], result: F64 },
3282
+ /** The composed `new Date(dateString).getTime()` read: one borrowed
3283
+ * string, f64 milliseconds since epoch. The parsed grammar is BOUNDED
3284
+ * (documented divergence — V8's parser accepts far more): the ASN.1
3285
+ * validity shape X509Certificate.validFrom/validTo answer ("Jul 1
3286
+ * 00:00:00 2026 GMT" — the portless cert-expiry read), and ECMA's own
3287
+ * date-time string format (YYYY-MM-DD[THH:mm[:ss[.sss]]][Z|±HH:MM] —
3288
+ * date-only forms are UTC, exactly the spec). Anything else is NaN,
3289
+ * Node's invalid-date getTime. Never throws. */
3290
+ "date.parseGetTime": { argTypes: [STRING], result: F64 },
3291
+ /** `Date.UTC(...)` — seven f64 arguments (the frontend completes the
3292
+ * spec's defaults for omitted trailing parts: month 0, date 1, time
3293
+ * parts 0), the spec's MakeDay/MakeTime/TimeClip exactly: 0–99 years
3294
+ * map to 1900+year, out-of-range months/dates roll over, non-finite
3295
+ * parts and out-of-range results answer NaN. Never throws. */
3296
+ "date.utc": { argTypes: [F64, F64, F64, F64, F64, F64, F64], result: F64 },
3297
+ /** WHATWG TextDecoder.decode over u8 bytes (scr_bytes.c): utf-8 with
3298
+ * default options — the same maximal-subpart replacement decode as
3299
+ * Buffer.toString("utf8"), with the leading BOM stripped (the one
3300
+ * behavioral difference; ignoreBOM defaults to false). Inline calls
3301
+ * lower directly; stored decoder records dispatch by encoding id.
3302
+ * TextEncoder.encode needs no libFn: its matching forms
3303
+ * lower to buffer.fromStr(s, "utf8") (identical bytes — ScrStr storage
3304
+ * is well-formed UTF-8). Borrowed arg; owned (+1) string; never throws. */
3305
+ "text.decode": { argTypes: [BYTES_U8], result: STRING },
3306
+ "bytes.bufferSource": { argTypes: [DYN], result: BYTES_U8 },
3307
+ "text.decodeBufferSource": { argTypes: [DYN], result: STRING },
3308
+ "text.decodeOptions": { argTypes: [BYTES_U8, BOOL, BOOL], result: STRING },
3309
+ "text.decodeStream": { argTypes: [DYN, BYTES_U8, F64, BOOL, BOOL, BOOL], result: STRING },
3310
+ "text.decodeLegacyOptions": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: STRING },
3311
+ /** TextDecoder.decode for a compile-time non-UTF-8 WHATWG label. The
3312
+ * second f64 is the frontend-owned encoding id consumed by scr_bytes.c;
3313
+ * label aliases/case/ASCII whitespace are canonicalized before IR. The
3314
+ * mapping tables are generated from the pinned Node 24 oracle, keeping
3315
+ * output portable without an ICU/iconv dependency. Borrowed args; owned
3316
+ * (+1) string; never throws. */
3317
+ "text.decodeLegacy": { argTypes: [BYTES_U8, F64], result: STRING },
3318
+ "text.decoderEncoding": { argTypes: [DYN], result: F64 },
3319
+ "text.decoderName": { argTypes: [F64], result: STRING },
3320
+ "text.encodeInto": { argTypes: [DYN, DYN], result: DYN },
3321
+ "buffer.isAscii": { argTypes: [DYN], result: BOOL },
3322
+ "buffer.isUtf8": { argTypes: [DYN], result: BOOL },
3323
+ "buffer.transcode": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
3324
+ /** The fs option forms and friends (scr_lib.c), all throwing catchably
3325
+ * like the rest of sync fs. mkdirRecursiveSync is Node's recursive
3326
+ * algorithm (try mkdir, EEXIST-dir is fine, ENOENT creates the parent
3327
+ * first — errors report Node's errno at Node's path, EEXIST at a file
3328
+ * target, ENOTDIR at the full path past a file); the first-created-dir
3329
+ * return value has no lowering (statement position only, frontend-
3330
+ * fenced). rmOptsSync is rmSync with (recursive, force) bools: force
3331
+ * swallows ENOENT, recursive removes trees post-order, a directory
3332
+ * without recursive throws the EISDIR-worded error (divergence 13's
3333
+ * wording note). mkdtempSync appends the six X's and returns the
3334
+ * created path (+1). accessSync takes the F_OK/R_OK/W_OK/X_OK bits as
3335
+ * one f64 (the frontend bakes fs.constants.* as literals and completes
3336
+ * an omitted mode to 0). readFdSync/readFdSyncBytes are the
3337
+ * readFileSync(fd[, "utf8"]) forms — a read(2) loop to EOF on the fd
3338
+ * (the stdin path); errors carry Node's no-path message shape. */
3339
+ "fs.mkdirRecursiveSync": { argTypes: [STRING], result: VOID },
3340
+ "fs.rmOptsSync": { argTypes: [STRING, BOOL, BOOL], result: VOID },
3341
+ /** rmOptsSync's maxRetries/retryDelay form (path, recursive, force,
3342
+ * maxRetries, retryDelay): Node's linear-backoff retry on
3343
+ * EBUSY/EMFILE/ENFILE/ENOTEMPTY/EPERM — the tmpdir-harness shape
3344
+ * rmSync(p, { maxRetries: 3, recursive: true, force: true }). */
3345
+ "fs.rmRetrySync": { argTypes: [STRING, BOOL, BOOL, F64, F64], result: VOID },
3346
+ "fs.mkdtempSync": { argTypes: [STRING], result: STRING },
3347
+ "fs.accessSync": { argTypes: [STRING, F64], result: VOID },
3348
+ "fs.readFdSync": { argTypes: [F64, STRING], result: STRING },
3349
+ "fs.readFdSyncBytes": { argTypes: [F64], result: BYTES_U8 },
3350
+ /** isatty(3) over an fd literal (0/1/2 — process.stdin/stdout/stderr
3351
+ * .isTTY reads). A real boolean: false where Node's non-TTY streams
3352
+ * expose undefined (documented divergence). Never throws. */
3353
+ "process.isTTY": { argTypes: [F64], result: BOOL },
3354
+ // Like process.envGet: the result is the module's interned
3355
+ // `number | undefined` union — checked by arms in the libCall case.
3356
+ /** Terminal width over an fd literal (1/2 — process.stdout/stderr
3357
+ * .columns): ioctl(TIOCGWINSZ). The result is the module's interned
3358
+ * `number | undefined` union — a non-TTY stream (or an ioctl refusal)
3359
+ * yields the undefined arm, exactly Node's missing `.columns`. Never
3360
+ * throws. */
3361
+ "process.columns": { argTypes: [F64], result: VOID },
3362
+ /** Terminal height, with the same fd and optional-number contract. */
3363
+ "process.rows": { argTypes: [F64], result: VOID },
3364
+ /** process.stdin.destroy(): a deliberate no-op (no stream machinery
3365
+ * exists to tear down; documented in SEMANTICS.md). */
3366
+ "process.stdinDestroy": { argTypes: [], result: VOID },
3367
+ /** process.stdin.setRawMode(mode) — one borrowed bool arg, void. On a
3368
+ * TTY stdin: termios raw mode on/off (libuv's UV_TTY_MODE_RAW flag set,
3369
+ * the mode Node's setRawMode(true) applies; false restores the entry
3370
+ * state). On a NON-TTY stdin Node's process.stdin has no such method at
3371
+ * all, so the call throws Node's exact catchable TypeError
3372
+ * ("process.stdin.setRawMode is not a function") — the may-throw seed
3373
+ * carries it. */
3374
+ "process.stdinSetRawMode": { argTypes: [BOOL], result: VOID },
3375
+ // Arg 0 is a packed f64[] OR a bytes value (the spread-typed-array
3376
+ // form) — checked in the libCall case.
3377
+ /** fromCharCode takes one packed f64[] or bytes arg and builds a string
3378
+ * from UTF-16 code units. Adjacent surrogate pairs combine; lone
3379
+ * surrogates follow the runtime's replacement policy. */
3380
+ "string.fromCharCode": { argTypes: [null], result: STRING },
3381
+ /** Numeric code points, with catchable RangeError for non-integers or
3382
+ * values outside 0..0x10ffff. Uses the same UTF-8 surrogate policy. */
3383
+ "string.fromCodePoint": { argTypes: [null], result: STRING },
3384
+ /** lastIndexOf returns the last UTF-16 start index, or -1. The two-arg
3385
+ * form searches at or before its numeric position; NaN starts at the end.
3386
+ * String arguments are borrowed and neither form throws. */
3387
+ "string.lastIndexOf": { argTypes: [STRING, STRING], result: F64 },
3388
+ "string.lastIndexOfFrom": { argTypes: [STRING, STRING, F64], result: F64 },
3389
+ /** String.raw(template, ...subs): the raw literals array (a string[]
3390
+ * read off the template record) interleaved with the PRE-STRINGIFIED
3391
+ * substitutions (the frontend applies the static ToString and packs
3392
+ * them into one string[] literal) — extra substitutions drop, missing
3393
+ * ones skip, the spec's loop exactly (scr_array.c). Borrowed args;
3394
+ * +1 string; never throws. */
3395
+ "string.raw": { argTypes: [arrayOf(STRING), arrayOf(STRING)], result: STRING },
3396
+ });
3397
+ //# sourceMappingURL=builtin-signatures.js.map