typenative 0.6.2 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1131) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +18 -8
  3. package/bin/go/overrides.js +21 -1
  4. package/bin/index.js +48 -25
  5. package/bin/main.js +2 -1
  6. package/bin/node/assert.js +56 -17
  7. package/bin/node/async_hooks.js +69 -10
  8. package/bin/node/buffer.js +321 -7
  9. package/bin/node/child_process.js +220 -16
  10. package/bin/node/cluster.js +436 -32
  11. package/bin/node/crypto.js +814 -5
  12. package/bin/node/crypto_curves.js +142 -0
  13. package/bin/node/crypto_keys.js +1147 -48
  14. package/bin/node/crypto_pem.js +313 -0
  15. package/bin/node/crypto_pkcs12.js +17 -0
  16. package/bin/node/dgram.js +161 -10
  17. package/bin/node/diagnostics_channel.js +5 -1
  18. package/bin/node/events.js +358 -8
  19. package/bin/node/ffi.js +933 -0
  20. package/bin/node/fs.js +1346 -10
  21. package/bin/node/histogram.js +1991 -0
  22. package/bin/node/http.js +630 -55
  23. package/bin/node/http2.js +1141 -88
  24. package/bin/node/intl.js +4576 -0
  25. package/bin/node/intl_data.js +65412 -0
  26. package/bin/node/module_v8.js +155 -16
  27. package/bin/node/net.js +59 -10
  28. package/bin/node/path.js +5 -1
  29. package/bin/node/process.js +355 -4
  30. package/bin/node/readline.js +558 -8
  31. package/bin/node/registry.js +2 -0
  32. package/bin/node/sqlite.js +1539 -7
  33. package/bin/node/stream.js +371 -32
  34. package/bin/node/stream_web.js +422 -15
  35. package/bin/node/system_extra.js +40 -154
  36. package/bin/node/temporal.js +96 -0
  37. package/bin/node/temporal_runtime.js +5075 -0
  38. package/bin/node/temporal_zones.js +460 -0
  39. package/bin/node/test.js +191 -8
  40. package/bin/node/test_coverage.js +58 -0
  41. package/bin/node/test_report.js +50 -4
  42. package/bin/node/test_run.js +64 -3
  43. package/bin/node/timers.js +123 -0
  44. package/bin/node/tls.js +346 -12
  45. package/bin/node/tls_roots.js +122 -0
  46. package/bin/node/typed_arrays.js +867 -93
  47. package/bin/node/url.js +657 -0
  48. package/bin/node/util.js +449 -7
  49. package/bin/node/util_extra.js +6 -0
  50. package/bin/node/wasi.js +214 -0
  51. package/bin/node/webassembly.js +1137 -0
  52. package/bin/node/websocket.js +763 -0
  53. package/bin/node/webview.js +3257 -244
  54. package/bin/node/worker_threads.js +434 -52
  55. package/bin/node/zlib.js +455 -22
  56. package/bin/node/zlib_iter.js +585 -0
  57. package/bin/node/zlib_zip.js +2392 -0
  58. package/bin/transpiler.js +3417 -501
  59. package/bin/typecheck-node.js +49 -17
  60. package/bin/version.js +1 -1
  61. package/govendor/github.com/cloudflare/circl/.golangci.yaml +64 -0
  62. package/govendor/github.com/cloudflare/circl/.semgrepignore +1 -0
  63. package/govendor/github.com/cloudflare/circl/AGENTS.md +91 -0
  64. package/govendor/github.com/cloudflare/circl/CITATION.cff +30 -0
  65. package/govendor/github.com/cloudflare/circl/LICENSE +57 -0
  66. package/govendor/github.com/cloudflare/circl/Makefile +70 -0
  67. package/govendor/github.com/cloudflare/circl/README.md +206 -0
  68. package/govendor/github.com/cloudflare/circl/REVIEW.md +83 -0
  69. package/govendor/github.com/cloudflare/circl/codecov.yml +21 -0
  70. package/govendor/github.com/cloudflare/circl/dh/x448/curve.go +104 -0
  71. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go +30 -0
  72. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h +111 -0
  73. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s +194 -0
  74. package/govendor/github.com/cloudflare/circl/dh/x448/curve_generic.go +100 -0
  75. package/govendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go +11 -0
  76. package/govendor/github.com/cloudflare/circl/dh/x448/doc.go +19 -0
  77. package/govendor/github.com/cloudflare/circl/dh/x448/key.go +46 -0
  78. package/govendor/github.com/cloudflare/circl/dh/x448/table.go +460 -0
  79. package/govendor/github.com/cloudflare/circl/doc.go +8 -0
  80. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go +71 -0
  81. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go +90 -0
  82. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go +52 -0
  83. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/point.go +181 -0
  84. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go +203 -0
  85. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go +138 -0
  86. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go +135 -0
  87. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go +216 -0
  88. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go +62 -0
  89. package/govendor/github.com/cloudflare/circl/go.mod +3 -0
  90. package/govendor/github.com/cloudflare/circl/internal/conv/conv.go +173 -0
  91. package/govendor/github.com/cloudflare/circl/internal/sha3/doc.go +62 -0
  92. package/govendor/github.com/cloudflare/circl/internal/sha3/hashes.go +69 -0
  93. package/govendor/github.com/cloudflare/circl/internal/sha3/keccakf.go +391 -0
  94. package/govendor/github.com/cloudflare/circl/internal/sha3/rc.go +29 -0
  95. package/govendor/github.com/cloudflare/circl/internal/sha3/sha3.go +200 -0
  96. package/govendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s +33 -0
  97. package/govendor/github.com/cloudflare/circl/internal/sha3/shake.go +119 -0
  98. package/govendor/github.com/cloudflare/circl/internal/sha3/xor.go +15 -0
  99. package/govendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go +33 -0
  100. package/govendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go +61 -0
  101. package/govendor/github.com/cloudflare/circl/math/fp448/fp.go +164 -0
  102. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go +43 -0
  103. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h +591 -0
  104. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s +75 -0
  105. package/govendor/github.com/cloudflare/circl/math/fp448/fp_generic.go +339 -0
  106. package/govendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go +12 -0
  107. package/govendor/github.com/cloudflare/circl/math/fp448/fuzzer.go +75 -0
  108. package/govendor/github.com/cloudflare/circl/math/integer.go +16 -0
  109. package/govendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go +145 -0
  110. package/govendor/github.com/cloudflare/circl/math/mlsbset/power.go +64 -0
  111. package/govendor/github.com/cloudflare/circl/math/primes.go +34 -0
  112. package/govendor/github.com/cloudflare/circl/math/wnaf.go +84 -0
  113. package/govendor/github.com/cloudflare/circl/sign/ed448/ed448.go +417 -0
  114. package/govendor/github.com/cloudflare/circl/sign/ed448/signapi.go +89 -0
  115. package/govendor/github.com/cloudflare/circl/sign/sign.go +119 -0
  116. package/{examples/react-compiler/vendor/picocolors → govendor/github.com/decred/dcrd/dcrec/secp256k1/v4}/LICENSE +4 -2
  117. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/README.md +72 -0
  118. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/compressedbytepoints.go +18 -0
  119. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve.go +1310 -0
  120. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve_embedded.go +14 -0
  121. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve_precompute.go +14 -0
  122. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/doc.go +59 -0
  123. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdh.go +21 -0
  124. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/README.md +52 -0
  125. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/doc.go +42 -0
  126. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/error.go +134 -0
  127. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/signature.go +1001 -0
  128. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ellipticadaptor.go +296 -0
  129. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/error.go +67 -0
  130. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/field.go +1696 -0
  131. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/go.mod +3 -0
  132. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/loadprecomputed.go +91 -0
  133. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/modnscalar.go +1105 -0
  134. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/nonce.go +263 -0
  135. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/privkey.go +111 -0
  136. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/pubkey.go +236 -0
  137. package/govendor/github.com/ebitengine/purego/LICENSE +201 -0
  138. package/govendor/github.com/ebitengine/purego/README.md +124 -0
  139. package/govendor/github.com/ebitengine/purego/abi_amd64.h +99 -0
  140. package/govendor/github.com/ebitengine/purego/abi_arm64.h +39 -0
  141. package/govendor/github.com/ebitengine/purego/abi_loong64.h +60 -0
  142. package/govendor/github.com/ebitengine/purego/cdecl.go +11 -0
  143. package/govendor/github.com/ebitengine/purego/cgo.go +19 -0
  144. package/govendor/github.com/ebitengine/purego/dlerror.go +17 -0
  145. package/govendor/github.com/ebitengine/purego/dlfcn.go +99 -0
  146. package/govendor/github.com/ebitengine/purego/dlfcn_android.go +34 -0
  147. package/govendor/github.com/ebitengine/purego/dlfcn_darwin.go +20 -0
  148. package/govendor/github.com/ebitengine/purego/dlfcn_freebsd.go +14 -0
  149. package/govendor/github.com/ebitengine/purego/dlfcn_linux.go +16 -0
  150. package/govendor/github.com/ebitengine/purego/dlfcn_netbsd.go +15 -0
  151. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_freebsd.go +11 -0
  152. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_linux.go +19 -0
  153. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_netbsd.go +11 -0
  154. package/govendor/github.com/ebitengine/purego/dlfcn_playground.go +24 -0
  155. package/govendor/github.com/ebitengine/purego/dlfcn_stubs.s +22 -0
  156. package/govendor/github.com/ebitengine/purego/func.go +780 -0
  157. package/govendor/github.com/ebitengine/purego/gen.go +6 -0
  158. package/govendor/github.com/ebitengine/purego/go.mod +3 -0
  159. package/govendor/github.com/ebitengine/purego/go_runtime.go +19 -0
  160. package/govendor/github.com/ebitengine/purego/internal/cgo/dlfcn_cgo_unix.go +56 -0
  161. package/govendor/github.com/ebitengine/purego/internal/cgo/empty.go +6 -0
  162. package/govendor/github.com/ebitengine/purego/internal/cgo/syscall_cgo_unix.go +49 -0
  163. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_amd64.h +99 -0
  164. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_arm64.h +39 -0
  165. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_loong64.h +60 -0
  166. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_ppc64x.h +195 -0
  167. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_riscv64.h +72 -0
  168. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_386.s +29 -0
  169. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_amd64.s +39 -0
  170. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_arm.s +58 -0
  171. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_arm64.s +35 -0
  172. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_loong64.s +38 -0
  173. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_ppc64le.s +79 -0
  174. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_riscv64.s +36 -0
  175. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_s390x.s +52 -0
  176. package/govendor/github.com/ebitengine/purego/internal/fakecgo/callbacks.go +93 -0
  177. package/govendor/github.com/ebitengine/purego/internal/fakecgo/doc.go +32 -0
  178. package/govendor/github.com/ebitengine/purego/internal/fakecgo/fakecgo.go +14 -0
  179. package/govendor/github.com/ebitengine/purego/internal/fakecgo/freebsd.go +27 -0
  180. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_darwin.go +86 -0
  181. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_freebsd.go +77 -0
  182. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +72 -0
  183. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_linux.go +77 -0
  184. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_netbsd.go +83 -0
  185. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_setenv.go +18 -0
  186. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_util.go +38 -0
  187. package/govendor/github.com/ebitengine/purego/internal/fakecgo/iscgo.go +19 -0
  188. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo.go +37 -0
  189. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_darwin.go +37 -0
  190. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_freebsd.go +27 -0
  191. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_linux.go +27 -0
  192. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_netbsd.go +36 -0
  193. package/govendor/github.com/ebitengine/purego/internal/fakecgo/linux.go +189 -0
  194. package/govendor/github.com/ebitengine/purego/internal/fakecgo/netbsd.go +23 -0
  195. package/govendor/github.com/ebitengine/purego/internal/fakecgo/setenv.go +19 -0
  196. package/govendor/github.com/ebitengine/purego/internal/fakecgo/threadentry_amd64.go +15 -0
  197. package/govendor/github.com/ebitengine/purego/internal/fakecgo/threadentry_noasm.go +24 -0
  198. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_386.s +130 -0
  199. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_amd64.s +124 -0
  200. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_arm.s +131 -0
  201. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_arm64.s +81 -0
  202. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_386.s +78 -0
  203. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_amd64.s +69 -0
  204. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_arm.s +69 -0
  205. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_arm64.s +60 -0
  206. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_loong64.s +60 -0
  207. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_ppc64le.s +69 -0
  208. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_riscv64.s +60 -0
  209. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_s390x.s +51 -0
  210. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_loong64.s +78 -0
  211. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_ppc64le.s +132 -0
  212. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_riscv64.s +76 -0
  213. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_s390x.s +158 -0
  214. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols.go +165 -0
  215. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_darwin.go +59 -0
  216. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_freebsd.go +48 -0
  217. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_linux.go +158 -0
  218. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_netbsd.go +59 -0
  219. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_darwin.s +19 -0
  220. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_freebsd.s +16 -0
  221. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_linux.s +46 -0
  222. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_netbsd.s +19 -0
  223. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_stubs.s +55 -0
  224. package/govendor/github.com/ebitengine/purego/internal/strings/strings.go +40 -0
  225. package/govendor/github.com/ebitengine/purego/is_ios.go +13 -0
  226. package/govendor/github.com/ebitengine/purego/nocgo.go +25 -0
  227. package/govendor/github.com/ebitengine/purego/struct_amd64.go +518 -0
  228. package/govendor/github.com/ebitengine/purego/struct_arm.go +100 -0
  229. package/govendor/github.com/ebitengine/purego/struct_arm64.go +757 -0
  230. package/govendor/github.com/ebitengine/purego/struct_loong64.go +244 -0
  231. package/govendor/github.com/ebitengine/purego/struct_other.go +54 -0
  232. package/govendor/github.com/ebitengine/purego/struct_ppc64le.go +180 -0
  233. package/govendor/github.com/ebitengine/purego/struct_riscv64.go +158 -0
  234. package/govendor/github.com/ebitengine/purego/struct_s390x.go +158 -0
  235. package/govendor/github.com/ebitengine/purego/sys_386.s +153 -0
  236. package/govendor/github.com/ebitengine/purego/sys_amd64.s +206 -0
  237. package/govendor/github.com/ebitengine/purego/sys_arm.s +153 -0
  238. package/govendor/github.com/ebitengine/purego/sys_arm64.s +133 -0
  239. package/govendor/github.com/ebitengine/purego/sys_loong64.s +131 -0
  240. package/govendor/github.com/ebitengine/purego/sys_ppc64le.s +126 -0
  241. package/govendor/github.com/ebitengine/purego/sys_riscv64.s +135 -0
  242. package/govendor/github.com/ebitengine/purego/sys_s390x.s +148 -0
  243. package/govendor/github.com/ebitengine/purego/sys_unix_386.s +234 -0
  244. package/govendor/github.com/ebitengine/purego/sys_unix_arm.s +99 -0
  245. package/govendor/github.com/ebitengine/purego/sys_unix_arm64.s +75 -0
  246. package/govendor/github.com/ebitengine/purego/sys_unix_loong64.s +79 -0
  247. package/govendor/github.com/ebitengine/purego/sys_unix_ppc64le.s +114 -0
  248. package/govendor/github.com/ebitengine/purego/sys_unix_riscv64.s +79 -0
  249. package/govendor/github.com/ebitengine/purego/sys_unix_s390x.s +111 -0
  250. package/govendor/github.com/ebitengine/purego/syscall.go +95 -0
  251. package/govendor/github.com/ebitengine/purego/syscall_32bit.go +97 -0
  252. package/govendor/github.com/ebitengine/purego/syscall_cgo_linux.go +20 -0
  253. package/govendor/github.com/ebitengine/purego/syscall_notstackargs.go +55 -0
  254. package/govendor/github.com/ebitengine/purego/syscall_ppc64le.go +73 -0
  255. package/govendor/github.com/ebitengine/purego/syscall_stackargs_ppc64le.go +38 -0
  256. package/govendor/github.com/ebitengine/purego/syscall_stackargs_s390x.go +38 -0
  257. package/govendor/github.com/ebitengine/purego/syscall_unix.go +392 -0
  258. package/govendor/github.com/ebitengine/purego/syscall_windows.go +54 -0
  259. package/govendor/github.com/ebitengine/purego/zcallback_386.s +4014 -0
  260. package/govendor/github.com/ebitengine/purego/zcallback_amd64.s +2014 -0
  261. package/govendor/github.com/ebitengine/purego/zcallback_arm.s +4014 -0
  262. package/govendor/github.com/ebitengine/purego/zcallback_arm64.s +4014 -0
  263. package/govendor/github.com/ebitengine/purego/zcallback_loong64.s +4014 -0
  264. package/govendor/github.com/ebitengine/purego/zcallback_ppc64le.s +4014 -0
  265. package/govendor/github.com/ebitengine/purego/zcallback_riscv64.s +4051 -0
  266. package/govendor/github.com/ebitengine/purego/zcallback_s390x.s +4015 -0
  267. package/govendor/github.com/klauspost/compress/.gitattributes +3 -0
  268. package/govendor/github.com/klauspost/compress/.goreleaser.yml +132 -0
  269. package/govendor/github.com/klauspost/compress/AGENTS.md +106 -0
  270. package/govendor/github.com/klauspost/compress/LICENSE +304 -0
  271. package/govendor/github.com/klauspost/compress/README.md +766 -0
  272. package/govendor/github.com/klauspost/compress/SECURITY.md +25 -0
  273. package/govendor/github.com/klauspost/compress/compressible.go +85 -0
  274. package/govendor/github.com/klauspost/compress/fse/README.md +79 -0
  275. package/govendor/github.com/klauspost/compress/fse/bitreader.go +122 -0
  276. package/govendor/github.com/klauspost/compress/fse/bitwriter.go +167 -0
  277. package/govendor/github.com/klauspost/compress/fse/bytereader.go +47 -0
  278. package/govendor/github.com/klauspost/compress/fse/compress.go +685 -0
  279. package/govendor/github.com/klauspost/compress/fse/decompress.go +383 -0
  280. package/govendor/github.com/klauspost/compress/fse/fse.go +150 -0
  281. package/govendor/github.com/klauspost/compress/gen.sh +4 -0
  282. package/govendor/github.com/klauspost/compress/go.mod +3 -0
  283. package/govendor/github.com/klauspost/compress/huff0/README.md +89 -0
  284. package/govendor/github.com/klauspost/compress/huff0/bitreader.go +323 -0
  285. package/govendor/github.com/klauspost/compress/huff0/bitwriter.go +97 -0
  286. package/govendor/github.com/klauspost/compress/huff0/build_table.go +168 -0
  287. package/govendor/github.com/klauspost/compress/huff0/compress.go +747 -0
  288. package/govendor/github.com/klauspost/compress/huff0/decompress.go +1188 -0
  289. package/govendor/github.com/klauspost/compress/huff0/decompress_amd64.go +128 -0
  290. package/govendor/github.com/klauspost/compress/huff0/decompress_amd64.s +3476 -0
  291. package/govendor/github.com/klauspost/compress/huff0/decompress_arm64.go +72 -0
  292. package/govendor/github.com/klauspost/compress/huff0/decompress_arm64.s +1648 -0
  293. package/govendor/github.com/klauspost/compress/huff0/decompress_asm.go +252 -0
  294. package/govendor/github.com/klauspost/compress/huff0/decompress_generic.go +278 -0
  295. package/govendor/github.com/klauspost/compress/huff0/huff0.go +337 -0
  296. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go +34 -0
  297. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go +10 -0
  298. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s +34 -0
  299. package/govendor/github.com/klauspost/compress/internal/le/le.go +5 -0
  300. package/govendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go +42 -0
  301. package/govendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go +52 -0
  302. package/govendor/github.com/klauspost/compress/internal/regmask/regmask.go +50 -0
  303. package/govendor/github.com/klauspost/compress/internal/regmask/regmask_386.go +39 -0
  304. package/govendor/github.com/klauspost/compress/internal/snapref/LICENSE +27 -0
  305. package/govendor/github.com/klauspost/compress/internal/snapref/decode.go +264 -0
  306. package/govendor/github.com/klauspost/compress/internal/snapref/decode_other.go +113 -0
  307. package/govendor/github.com/klauspost/compress/internal/snapref/encode.go +291 -0
  308. package/govendor/github.com/klauspost/compress/internal/snapref/encode_other.go +250 -0
  309. package/govendor/github.com/klauspost/compress/internal/snapref/snappy.go +98 -0
  310. package/govendor/github.com/klauspost/compress/s2sx.mod +3 -0
  311. package/govendor/github.com/klauspost/compress/s2sx.sum +0 -0
  312. package/govendor/github.com/klauspost/compress/zstd/README.md +487 -0
  313. package/govendor/github.com/klauspost/compress/zstd/bitreader.go +176 -0
  314. package/govendor/github.com/klauspost/compress/zstd/bitwriter.go +151 -0
  315. package/govendor/github.com/klauspost/compress/zstd/blockdec.go +728 -0
  316. package/govendor/github.com/klauspost/compress/zstd/blockenc.go +923 -0
  317. package/govendor/github.com/klauspost/compress/zstd/blocktype_string.go +85 -0
  318. package/govendor/github.com/klauspost/compress/zstd/bytebuf.go +131 -0
  319. package/govendor/github.com/klauspost/compress/zstd/bytereader.go +82 -0
  320. package/govendor/github.com/klauspost/compress/zstd/decodeheader.go +261 -0
  321. package/govendor/github.com/klauspost/compress/zstd/decoder.go +995 -0
  322. package/govendor/github.com/klauspost/compress/zstd/decoder_options.go +213 -0
  323. package/govendor/github.com/klauspost/compress/zstd/dict.go +605 -0
  324. package/govendor/github.com/klauspost/compress/zstd/enc_base.go +200 -0
  325. package/govendor/github.com/klauspost/compress/zstd/enc_best.go +572 -0
  326. package/govendor/github.com/klauspost/compress/zstd/enc_better.go +1262 -0
  327. package/govendor/github.com/klauspost/compress/zstd/enc_dfast.go +1136 -0
  328. package/govendor/github.com/klauspost/compress/zstd/enc_fast.go +892 -0
  329. package/govendor/github.com/klauspost/compress/zstd/enc_jobs.go +352 -0
  330. package/govendor/github.com/klauspost/compress/zstd/encoder.go +881 -0
  331. package/govendor/github.com/klauspost/compress/zstd/encoder_options.go +422 -0
  332. package/govendor/github.com/klauspost/compress/zstd/framedec.go +404 -0
  333. package/govendor/github.com/klauspost/compress/zstd/frameenc.go +137 -0
  334. package/govendor/github.com/klauspost/compress/zstd/fse_decoder.go +333 -0
  335. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s +132 -0
  336. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_arm64.s +148 -0
  337. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_asm.go +70 -0
  338. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go +71 -0
  339. package/govendor/github.com/klauspost/compress/zstd/fse_encoder.go +701 -0
  340. package/govendor/github.com/klauspost/compress/zstd/fse_predefined.go +168 -0
  341. package/govendor/github.com/klauspost/compress/zstd/hash.go +57 -0
  342. package/govendor/github.com/klauspost/compress/zstd/history.go +119 -0
  343. package/{examples/react-compiler/vendor/jsesc/LICENSE-MIT.txt → govendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt} +3 -1
  344. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md +71 -0
  345. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go +242 -0
  346. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s +210 -0
  347. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s +184 -0
  348. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go +11 -0
  349. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go +75 -0
  350. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go +11 -0
  351. package/govendor/github.com/klauspost/compress/zstd/matchlen_amd64.go +15 -0
  352. package/govendor/github.com/klauspost/compress/zstd/matchlen_amd64.s +66 -0
  353. package/govendor/github.com/klauspost/compress/zstd/matchlen_generic.go +37 -0
  354. package/govendor/github.com/klauspost/compress/zstd/seqdec.go +620 -0
  355. package/govendor/github.com/klauspost/compress/zstd/seqdec_amd64.go +115 -0
  356. package/govendor/github.com/klauspost/compress/zstd/seqdec_amd64.s +4762 -0
  357. package/govendor/github.com/klauspost/compress/zstd/seqdec_arm64.go +81 -0
  358. package/govendor/github.com/klauspost/compress/zstd/seqdec_arm64.s +2919 -0
  359. package/govendor/github.com/klauspost/compress/zstd/seqdec_asm.go +327 -0
  360. package/govendor/github.com/klauspost/compress/zstd/seqdec_generic.go +258 -0
  361. package/govendor/github.com/klauspost/compress/zstd/seqenc.go +159 -0
  362. package/govendor/github.com/klauspost/compress/zstd/simple.go +54 -0
  363. package/govendor/github.com/klauspost/compress/zstd/snappy.go +447 -0
  364. package/govendor/github.com/klauspost/compress/zstd/zip.go +141 -0
  365. package/govendor/github.com/klauspost/compress/zstd/zstd.go +126 -0
  366. package/govendor/github.com/tetratelabs/wazero/.editorconfig +7 -0
  367. package/govendor/github.com/tetratelabs/wazero/.gitattributes +2 -0
  368. package/govendor/github.com/tetratelabs/wazero/.gitmodules +3 -0
  369. package/govendor/github.com/tetratelabs/wazero/CONTRIBUTING.md +75 -0
  370. package/govendor/github.com/tetratelabs/wazero/LICENSE +201 -0
  371. package/govendor/github.com/tetratelabs/wazero/Makefile +385 -0
  372. package/govendor/github.com/tetratelabs/wazero/NOTICE +2 -0
  373. package/govendor/github.com/tetratelabs/wazero/RATIONALE.md +1577 -0
  374. package/govendor/github.com/tetratelabs/wazero/README.md +135 -0
  375. package/govendor/github.com/tetratelabs/wazero/api/features.go +228 -0
  376. package/govendor/github.com/tetratelabs/wazero/api/wasm.go +766 -0
  377. package/govendor/github.com/tetratelabs/wazero/builder.go +367 -0
  378. package/govendor/github.com/tetratelabs/wazero/cache.go +123 -0
  379. package/govendor/github.com/tetratelabs/wazero/codecov.yml +9 -0
  380. package/govendor/github.com/tetratelabs/wazero/config.go +899 -0
  381. package/govendor/github.com/tetratelabs/wazero/experimental/checkpoint.go +35 -0
  382. package/govendor/github.com/tetratelabs/wazero/experimental/close.go +63 -0
  383. package/govendor/github.com/tetratelabs/wazero/experimental/compilationworkers.go +19 -0
  384. package/govendor/github.com/tetratelabs/wazero/experimental/experimental.go +41 -0
  385. package/govendor/github.com/tetratelabs/wazero/experimental/features.go +39 -0
  386. package/govendor/github.com/tetratelabs/wazero/experimental/importresolver.go +19 -0
  387. package/govendor/github.com/tetratelabs/wazero/experimental/listener.go +324 -0
  388. package/govendor/github.com/tetratelabs/wazero/experimental/memory.go +52 -0
  389. package/govendor/github.com/tetratelabs/wazero/experimental/sys/dir.go +92 -0
  390. package/govendor/github.com/tetratelabs/wazero/experimental/sys/errno.go +98 -0
  391. package/govendor/github.com/tetratelabs/wazero/experimental/sys/error.go +45 -0
  392. package/govendor/github.com/tetratelabs/wazero/experimental/sys/file.go +356 -0
  393. package/govendor/github.com/tetratelabs/wazero/experimental/sys/fs.go +292 -0
  394. package/govendor/github.com/tetratelabs/wazero/experimental/sys/oflag.go +70 -0
  395. package/govendor/github.com/tetratelabs/wazero/experimental/sys/poll.go +48 -0
  396. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno.go +106 -0
  397. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_notwindows.go +13 -0
  398. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_unsupported.go +7 -0
  399. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_windows.go +37 -0
  400. package/govendor/github.com/tetratelabs/wazero/experimental/sys/time.go +10 -0
  401. package/govendor/github.com/tetratelabs/wazero/experimental/sys/unimplemented.go +160 -0
  402. package/govendor/github.com/tetratelabs/wazero/fsconfig.go +213 -0
  403. package/govendor/github.com/tetratelabs/wazero/go.mod +3 -0
  404. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/args.go +97 -0
  405. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/clock.go +116 -0
  406. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/environ.go +100 -0
  407. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/fs.go +2015 -0
  408. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/poll.go +247 -0
  409. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/proc.go +44 -0
  410. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/random.go +55 -0
  411. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sched.go +22 -0
  412. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sock.go +188 -0
  413. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/wasi.go +314 -0
  414. package/govendor/github.com/tetratelabs/wazero/internal/descriptor/table.go +149 -0
  415. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/compiler.go +3884 -0
  416. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/format.go +22 -0
  417. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/interpreter.go +4963 -0
  418. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/operations.go +2978 -0
  419. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/signature.go +825 -0
  420. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/abi.go +170 -0
  421. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/backend.go +3 -0
  422. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/compiler.go +402 -0
  423. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/compiler_lower.go +226 -0
  424. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/go_call.go +33 -0
  425. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi.go +186 -0
  426. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.go +9 -0
  427. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.s +29 -0
  428. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_preamble.go +248 -0
  429. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_go_call.go +440 -0
  430. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/cond.go +168 -0
  431. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/ext.go +35 -0
  432. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/instr.go +2495 -0
  433. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/instr_encoding.go +1714 -0
  434. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/lower_constant.go +71 -0
  435. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/lower_mem.go +187 -0
  436. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine.go +3782 -0
  437. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_pro_epi_logue.go +334 -0
  438. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_regalloc.go +352 -0
  439. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_vec.go +992 -0
  440. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/operands.go +336 -0
  441. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/reg.go +181 -0
  442. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/stack.go +130 -0
  443. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi.go +376 -0
  444. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_arm64.go +9 -0
  445. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_arm64.s +29 -0
  446. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_preamble.go +233 -0
  447. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_go_call.go +430 -0
  448. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/cond.go +215 -0
  449. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/instr.go +2562 -0
  450. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/instr_encoding.go +2357 -0
  451. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_constant.go +301 -0
  452. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_instr.go +2227 -0
  453. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_instr_operands.go +340 -0
  454. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_mem.go +451 -0
  455. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine.go +631 -0
  456. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_pro_epi_logue.go +486 -0
  457. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_regalloc.go +351 -0
  458. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_relocation.go +128 -0
  459. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/reg.go +397 -0
  460. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/unwind_stack.go +84 -0
  461. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/machine.go +119 -0
  462. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/api.go +124 -0
  463. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/reg.go +123 -0
  464. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/regalloc.go +1189 -0
  465. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/regset.go +96 -0
  466. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/vdef.go +19 -0
  467. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/call_engine.go +884 -0
  468. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/engine.go +1008 -0
  469. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/engine_cache.go +347 -0
  470. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_amd64.go +13 -0
  471. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_arm64.go +13 -0
  472. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_other.go +15 -0
  473. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/frontend.go +663 -0
  474. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/lower.go +5045 -0
  475. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/misc.go +10 -0
  476. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/sort_id.go +13 -0
  477. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/hostmodule.go +88 -0
  478. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_amd64.go +30 -0
  479. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_arm64.go +32 -0
  480. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_other.go +29 -0
  481. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/memmove.go +11 -0
  482. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/module_engine.go +403 -0
  483. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/basic_block.go +381 -0
  484. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/basic_block_sort.go +32 -0
  485. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/builder.go +790 -0
  486. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/cmp.go +107 -0
  487. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/funcref.go +12 -0
  488. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/instructions.go +3024 -0
  489. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass.go +393 -0
  490. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass_blk_layouts.go +334 -0
  491. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass_cfg.go +313 -0
  492. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/signature.go +49 -0
  493. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/ssa.go +14 -0
  494. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/type.go +115 -0
  495. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/vs.go +114 -0
  496. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/debug_options.go +189 -0
  497. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/exitcode.go +150 -0
  498. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/offsetdata.go +248 -0
  499. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap.go +96 -0
  500. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap_disabled.go +5 -0
  501. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap_enabled.go +5 -0
  502. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/pool.go +215 -0
  503. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/ptr.go +15 -0
  504. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/queue.go +26 -0
  505. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/resetmap.go +11 -0
  506. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/checkpoint.go +10 -0
  507. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/close.go +5 -0
  508. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/compilationworkers.go +6 -0
  509. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/expctxkeys.go +2 -0
  510. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/importresolver.go +6 -0
  511. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/listener.go +7 -0
  512. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/memory.go +4 -0
  513. package/govendor/github.com/tetratelabs/wazero/internal/filecache/compilationcache.go +42 -0
  514. package/govendor/github.com/tetratelabs/wazero/internal/filecache/file_cache.go +76 -0
  515. package/govendor/github.com/tetratelabs/wazero/internal/ieee754/ieee754.go +29 -0
  516. package/govendor/github.com/tetratelabs/wazero/internal/internalapi/internal.go +9 -0
  517. package/govendor/github.com/tetratelabs/wazero/internal/leb128/leb128.go +285 -0
  518. package/govendor/github.com/tetratelabs/wazero/internal/moremath/moremath.go +271 -0
  519. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid.go +26 -0
  520. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.go +22 -0
  521. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_arm64.go +13 -0
  522. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_unsupported.go +5 -0
  523. package/govendor/github.com/tetratelabs/wazero/internal/platform/crypto.go +17 -0
  524. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_linux.go +72 -0
  525. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_other.go +19 -0
  526. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_unix.go +14 -0
  527. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_unsupported.go +22 -0
  528. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_windows.go +31 -0
  529. package/govendor/github.com/tetratelabs/wazero/internal/platform/path.go +6 -0
  530. package/govendor/github.com/tetratelabs/wazero/internal/platform/path_windows.go +17 -0
  531. package/govendor/github.com/tetratelabs/wazero/internal/platform/platform.go +71 -0
  532. package/govendor/github.com/tetratelabs/wazero/internal/platform/time.go +76 -0
  533. package/govendor/github.com/tetratelabs/wazero/internal/platform/time_notwindows.go +11 -0
  534. package/govendor/github.com/tetratelabs/wazero/internal/platform/time_windows.go +40 -0
  535. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock.go +89 -0
  536. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock_supported.go +11 -0
  537. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock_unsupported.go +10 -0
  538. package/govendor/github.com/tetratelabs/wazero/internal/sys/fs.go +458 -0
  539. package/govendor/github.com/tetratelabs/wazero/internal/sys/lazy.go +135 -0
  540. package/govendor/github.com/tetratelabs/wazero/internal/sys/stdio.go +125 -0
  541. package/govendor/github.com/tetratelabs/wazero/internal/sys/sys.go +228 -0
  542. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/adapter.go +105 -0
  543. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_linux.go +12 -0
  544. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_unsupported.go +14 -0
  545. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/dir.go +24 -0
  546. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs.go +137 -0
  547. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file.go +576 -0
  548. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_unix.go +39 -0
  549. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_unsupported.go +28 -0
  550. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_windows.go +133 -0
  551. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens.go +29 -0
  552. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.go +42 -0
  553. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.s +8 -0
  554. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_linux.go +38 -0
  555. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_unsupported.go +18 -0
  556. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_windows.go +42 -0
  557. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_unix.go +22 -0
  558. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_unsupported.go +17 -0
  559. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_windows.go +28 -0
  560. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go +17 -0
  561. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unsupported.go +13 -0
  562. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_windows.go +23 -0
  563. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/oflag.go +38 -0
  564. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_bsd.go +26 -0
  565. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_darwin.go +26 -0
  566. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_supported.go +30 -0
  567. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_unix.go +20 -0
  568. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_unsupported.go +16 -0
  569. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_windows.go +163 -0
  570. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/osfile.go +318 -0
  571. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll.go +17 -0
  572. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_darwin.go +55 -0
  573. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_darwin.s +8 -0
  574. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_linux.go +57 -0
  575. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_unsupported.go +12 -0
  576. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_windows.go +224 -0
  577. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/readfs.go +117 -0
  578. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_unix.go +16 -0
  579. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_unsupported.go +16 -0
  580. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_windows.go +55 -0
  581. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock.go +186 -0
  582. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_supported.go +76 -0
  583. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unix.go +48 -0
  584. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unsupported.go +79 -0
  585. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_windows.go +80 -0
  586. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat.go +16 -0
  587. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_supported.go +40 -0
  588. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_unsupported.go +40 -0
  589. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_windows.go +118 -0
  590. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sync.go +13 -0
  591. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sync_windows.go +20 -0
  592. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/syscall6_darwin.go +13 -0
  593. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sysfs.go +6 -0
  594. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_unix.go +17 -0
  595. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_unsupported.go +14 -0
  596. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_windows.go +25 -0
  597. package/govendor/github.com/tetratelabs/wazero/internal/u32/u32.go +11 -0
  598. package/govendor/github.com/tetratelabs/wazero/internal/u64/u64.go +15 -0
  599. package/govendor/github.com/tetratelabs/wazero/internal/version/version.go +52 -0
  600. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/args.go +6 -0
  601. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/clock.go +16 -0
  602. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/environ.go +6 -0
  603. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/errno.go +314 -0
  604. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/fs.go +164 -0
  605. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/poll.go +15 -0
  606. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/proc.go +6 -0
  607. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/random.go +3 -0
  608. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/rights.go +148 -0
  609. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/sched.go +3 -0
  610. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/sock.go +71 -0
  611. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/wasi.go +26 -0
  612. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/code.go +124 -0
  613. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/const_expr.go +116 -0
  614. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/custom.go +22 -0
  615. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/data.go +79 -0
  616. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/decoder.go +235 -0
  617. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/element.go +250 -0
  618. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/errors.go +11 -0
  619. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/export.go +32 -0
  620. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/function.go +56 -0
  621. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/global.go +50 -0
  622. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/header.go +9 -0
  623. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/import.go +68 -0
  624. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/limits.go +47 -0
  625. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/memory.go +42 -0
  626. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/names.go +151 -0
  627. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/section.go +309 -0
  628. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/table.go +79 -0
  629. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/value.go +97 -0
  630. package/govendor/github.com/tetratelabs/wazero/internal/wasm/const_expr.go +259 -0
  631. package/govendor/github.com/tetratelabs/wazero/internal/wasm/counts.go +53 -0
  632. package/govendor/github.com/tetratelabs/wazero/internal/wasm/engine.go +76 -0
  633. package/govendor/github.com/tetratelabs/wazero/internal/wasm/exception.go +9 -0
  634. package/govendor/github.com/tetratelabs/wazero/internal/wasm/func_validation.go +2804 -0
  635. package/govendor/github.com/tetratelabs/wazero/internal/wasm/function_definition.go +210 -0
  636. package/govendor/github.com/tetratelabs/wazero/internal/wasm/global.go +55 -0
  637. package/govendor/github.com/tetratelabs/wazero/internal/wasm/gofunc.go +279 -0
  638. package/govendor/github.com/tetratelabs/wazero/internal/wasm/host.go +179 -0
  639. package/govendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go +1962 -0
  640. package/govendor/github.com/tetratelabs/wazero/internal/wasm/memory.go +475 -0
  641. package/govendor/github.com/tetratelabs/wazero/internal/wasm/memory_definition.go +128 -0
  642. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module.go +1359 -0
  643. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module_instance.go +251 -0
  644. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module_instance_lookup.go +73 -0
  645. package/govendor/github.com/tetratelabs/wazero/internal/wasm/store.go +726 -0
  646. package/govendor/github.com/tetratelabs/wazero/internal/wasm/store_module_list.go +95 -0
  647. package/govendor/github.com/tetratelabs/wazero/internal/wasm/table.go +321 -0
  648. package/govendor/github.com/tetratelabs/wazero/internal/wasmdebug/debug.go +170 -0
  649. package/govendor/github.com/tetratelabs/wazero/internal/wasmdebug/dwarf.go +225 -0
  650. package/govendor/github.com/tetratelabs/wazero/internal/wasmruntime/errors.go +54 -0
  651. package/govendor/github.com/tetratelabs/wazero/netlify.toml +15 -0
  652. package/govendor/github.com/tetratelabs/wazero/runtime.go +399 -0
  653. package/govendor/github.com/tetratelabs/wazero/sys/clock.go +26 -0
  654. package/govendor/github.com/tetratelabs/wazero/sys/error.go +83 -0
  655. package/govendor/github.com/tetratelabs/wazero/sys/stat.go +105 -0
  656. package/govendor/github.com/tetratelabs/wazero/sys/stat_bsd.go +29 -0
  657. package/govendor/github.com/tetratelabs/wazero/sys/stat_posix.go +29 -0
  658. package/govendor/github.com/tetratelabs/wazero/sys/stat_unsupported.go +14 -0
  659. package/govendor/github.com/tetratelabs/wazero/sys/stat_windows.go +24 -0
  660. package/govendor/golang.org/x/crypto/LICENSE +27 -0
  661. package/govendor/golang.org/x/crypto/PATENTS +22 -0
  662. package/govendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go +46 -0
  663. package/govendor/golang.org/x/crypto/cryptobyte/asn1.go +825 -0
  664. package/govendor/golang.org/x/crypto/cryptobyte/builder.go +350 -0
  665. package/govendor/golang.org/x/crypto/cryptobyte/string.go +183 -0
  666. package/govendor/golang.org/x/crypto/go.mod +3 -0
  667. package/govendor/golang.org/x/crypto/pbkdf2/pbkdf2.go +30 -0
  668. package/govendor/golang.org/x/net/LICENSE +27 -0
  669. package/govendor/golang.org/x/net/PATENTS +22 -0
  670. package/govendor/golang.org/x/net/dns/dnsmessage/message.go +2733 -0
  671. package/govendor/golang.org/x/net/dns/dnsmessage/svcb.go +333 -0
  672. package/govendor/golang.org/x/net/go.mod +3 -0
  673. package/govendor/golang.org/x/net/http/httpguts/guts.go +50 -0
  674. package/govendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
  675. package/govendor/golang.org/x/net/http2/README.md +19 -0
  676. package/govendor/golang.org/x/net/http2/ascii.go +65 -0
  677. package/govendor/golang.org/x/net/http2/ciphers.go +641 -0
  678. package/govendor/golang.org/x/net/http2/client_conn_pool.go +301 -0
  679. package/govendor/golang.org/x/net/http2/client_priority_go126.go +20 -0
  680. package/govendor/golang.org/x/net/http2/client_priority_go127.go +13 -0
  681. package/govendor/golang.org/x/net/http2/clientconn.go +57 -0
  682. package/govendor/golang.org/x/net/http2/config.go +171 -0
  683. package/govendor/golang.org/x/net/http2/config_go125.go +15 -0
  684. package/govendor/golang.org/x/net/http2/config_go126.go +15 -0
  685. package/govendor/golang.org/x/net/http2/databuffer.go +146 -0
  686. package/govendor/golang.org/x/net/http2/errors.go +145 -0
  687. package/govendor/golang.org/x/net/http2/flow.go +175 -0
  688. package/govendor/golang.org/x/net/http2/frame.go +1887 -0
  689. package/govendor/golang.org/x/net/http2/gotrack.go +181 -0
  690. package/govendor/golang.org/x/net/http2/hpack/encode.go +244 -0
  691. package/govendor/golang.org/x/net/http2/hpack/hpack.go +522 -0
  692. package/govendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
  693. package/govendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
  694. package/govendor/golang.org/x/net/http2/hpack/tables.go +426 -0
  695. package/govendor/golang.org/x/net/http2/http2.go +415 -0
  696. package/govendor/golang.org/x/net/http2/pipe.go +184 -0
  697. package/govendor/golang.org/x/net/http2/server.go +3239 -0
  698. package/govendor/golang.org/x/net/http2/server_common.go +268 -0
  699. package/govendor/golang.org/x/net/http2/server_wrap.go +217 -0
  700. package/govendor/golang.org/x/net/http2/transport.go +3084 -0
  701. package/govendor/golang.org/x/net/http2/transport_common.go +516 -0
  702. package/govendor/golang.org/x/net/http2/transport_wrap.go +583 -0
  703. package/govendor/golang.org/x/net/http2/unencrypted.go +32 -0
  704. package/govendor/golang.org/x/net/http2/write.go +381 -0
  705. package/govendor/golang.org/x/net/http2/writesched.go +253 -0
  706. package/govendor/golang.org/x/net/http2/writesched_common.go +90 -0
  707. package/govendor/golang.org/x/net/http2/writesched_priority_rfc7540.go +420 -0
  708. package/govendor/golang.org/x/net/http2/writesched_priority_rfc9218.go +226 -0
  709. package/govendor/golang.org/x/net/http2/writesched_random.go +81 -0
  710. package/govendor/golang.org/x/net/http2/writesched_roundrobin.go +121 -0
  711. package/govendor/golang.org/x/net/idna/idna.go +884 -0
  712. package/govendor/golang.org/x/net/idna/punycode.go +220 -0
  713. package/govendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
  714. package/govendor/golang.org/x/net/idna/tables17.0.0.go +5302 -0
  715. package/govendor/golang.org/x/net/idna/trie.go +51 -0
  716. package/govendor/golang.org/x/net/idna/trieval.go +119 -0
  717. package/govendor/golang.org/x/net/internal/httpcommon/README.md +7 -0
  718. package/govendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
  719. package/govendor/golang.org/x/net/internal/httpcommon/gzip.go +132 -0
  720. package/govendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
  721. package/govendor/golang.org/x/net/internal/httpcommon/request.go +503 -0
  722. package/govendor/golang.org/x/net/internal/httpsfv/httpsfv.go +665 -0
  723. package/govendor/golang.org/x/sys/cpu/asm_aix_ppc64.s +17 -0
  724. package/govendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s +12 -0
  725. package/govendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s +17 -0
  726. package/govendor/golang.org/x/sys/cpu/byteorder.go +66 -0
  727. package/govendor/golang.org/x/sys/cpu/cpu.go +357 -0
  728. package/govendor/golang.org/x/sys/cpu/cpu_aix.go +33 -0
  729. package/govendor/golang.org/x/sys/cpu/cpu_arm.go +73 -0
  730. package/govendor/golang.org/x/sys/cpu/cpu_arm64.go +191 -0
  731. package/govendor/golang.org/x/sys/cpu/cpu_arm64.s +35 -0
  732. package/govendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go +67 -0
  733. package/govendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go +31 -0
  734. package/govendor/golang.org/x/sys/cpu/cpu_darwin_x86.go +61 -0
  735. package/govendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +12 -0
  736. package/govendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go +11 -0
  737. package/govendor/golang.org/x/sys/cpu/cpu_gc_s390x.go +21 -0
  738. package/govendor/golang.org/x/sys/cpu/cpu_gc_x86.go +15 -0
  739. package/govendor/golang.org/x/sys/cpu/cpu_gc_x86.s +26 -0
  740. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +12 -0
  741. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go +22 -0
  742. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c +37 -0
  743. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go +25 -0
  744. package/govendor/golang.org/x/sys/cpu/cpu_linux.go +15 -0
  745. package/govendor/golang.org/x/sys/cpu/cpu_linux_arm.go +39 -0
  746. package/govendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +120 -0
  747. package/govendor/golang.org/x/sys/cpu/cpu_linux_loong64.go +22 -0
  748. package/govendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go +22 -0
  749. package/govendor/golang.org/x/sys/cpu/cpu_linux_noinit.go +9 -0
  750. package/govendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go +34 -0
  751. package/govendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go +173 -0
  752. package/govendor/golang.org/x/sys/cpu/cpu_linux_s390x.go +40 -0
  753. package/govendor/golang.org/x/sys/cpu/cpu_loong64.go +62 -0
  754. package/govendor/golang.org/x/sys/cpu/cpu_loong64.s +13 -0
  755. package/govendor/golang.org/x/sys/cpu/cpu_mips64x.go +15 -0
  756. package/govendor/golang.org/x/sys/cpu/cpu_mipsx.go +11 -0
  757. package/govendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go +47 -0
  758. package/govendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go +173 -0
  759. package/govendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go +65 -0
  760. package/govendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s +11 -0
  761. package/govendor/golang.org/x/sys/cpu/cpu_other_arm.go +9 -0
  762. package/govendor/golang.org/x/sys/cpu/cpu_other_arm64.go +11 -0
  763. package/govendor/golang.org/x/sys/cpu/cpu_other_mips64x.go +11 -0
  764. package/govendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go +12 -0
  765. package/govendor/golang.org/x/sys/cpu/cpu_other_riscv64.go +11 -0
  766. package/govendor/golang.org/x/sys/cpu/cpu_other_x86.go +11 -0
  767. package/govendor/golang.org/x/sys/cpu/cpu_ppc64x.go +16 -0
  768. package/govendor/golang.org/x/sys/cpu/cpu_riscv64.go +33 -0
  769. package/govendor/golang.org/x/sys/cpu/cpu_riscv64.s +17 -0
  770. package/govendor/golang.org/x/sys/cpu/cpu_s390x.go +172 -0
  771. package/govendor/golang.org/x/sys/cpu/cpu_s390x.s +57 -0
  772. package/govendor/golang.org/x/sys/cpu/cpu_sparc64.go +12 -0
  773. package/govendor/golang.org/x/sys/cpu/cpu_wasm.go +17 -0
  774. package/govendor/golang.org/x/sys/cpu/cpu_windows.go +26 -0
  775. package/govendor/golang.org/x/sys/cpu/cpu_windows_arm64.go +38 -0
  776. package/govendor/golang.org/x/sys/cpu/cpu_x86.go +259 -0
  777. package/govendor/golang.org/x/sys/cpu/cpu_zos.go +10 -0
  778. package/govendor/golang.org/x/sys/cpu/cpu_zos_s390x.go +25 -0
  779. package/govendor/golang.org/x/sys/cpu/endian_big.go +10 -0
  780. package/govendor/golang.org/x/sys/cpu/endian_little.go +10 -0
  781. package/govendor/golang.org/x/sys/cpu/hwcap_linux.go +71 -0
  782. package/govendor/golang.org/x/sys/cpu/parse.go +55 -0
  783. package/govendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go +53 -0
  784. package/govendor/golang.org/x/sys/cpu/runtime_auxv.go +16 -0
  785. package/govendor/golang.org/x/sys/cpu/runtime_auxv_go121.go +18 -0
  786. package/govendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go +26 -0
  787. package/govendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go +35 -0
  788. package/govendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go +54 -0
  789. package/govendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go +98 -0
  790. package/govendor/golang.org/x/sys/cpu/zcpu_windows.go +48 -0
  791. package/govendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +20 -0
  792. package/govendor/golang.org/x/sys/unix/asm_linux_sparc64.s +48 -0
  793. package/govendor/golang.org/x/sys/unix/asm_zos_s390x.s +4 -186
  794. package/govendor/golang.org/x/sys/unix/bpxsvc_zos.s +9 -9
  795. package/govendor/golang.org/x/sys/unix/fcntl_darwin.go +2 -2
  796. package/govendor/golang.org/x/sys/unix/mkerrors.sh +1 -1
  797. package/govendor/golang.org/x/sys/unix/ptrace_zos.go +537 -0
  798. package/govendor/golang.org/x/sys/unix/ptrace_zos_singlestep.go +425 -0
  799. package/govendor/golang.org/x/sys/unix/syscall_darwin.go +1 -0
  800. package/govendor/golang.org/x/sys/unix/syscall_freebsd.go +9 -0
  801. package/govendor/golang.org/x/sys/unix/syscall_linux.go +20 -1
  802. package/govendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +3 -3
  803. package/govendor/golang.org/x/sys/unix/syscall_netbsd.go +9 -0
  804. package/govendor/golang.org/x/sys/unix/syscall_unix_gc.go +1 -1
  805. package/govendor/golang.org/x/sys/unix/syscall_zos_s390x.go +0 -4
  806. package/govendor/golang.org/x/sys/unix/xattr_bsd.go +12 -12
  807. package/govendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +6 -0
  808. package/govendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +6 -0
  809. package/govendor/golang.org/x/sys/unix/zerrors_linux.go +32 -0
  810. package/govendor/golang.org/x/sys/unix/zerrors_linux_386.go +2 -0
  811. package/govendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +2 -0
  812. package/govendor/golang.org/x/sys/unix/zerrors_linux_arm.go +2 -0
  813. package/govendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +2 -0
  814. package/govendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +2 -0
  815. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips.go +2 -0
  816. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +2 -0
  817. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +2 -0
  818. package/govendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +2 -0
  819. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +2 -0
  820. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +2 -0
  821. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +2 -0
  822. package/govendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +2 -0
  823. package/govendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +2 -0
  824. package/govendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +2 -0
  825. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +11 -0
  826. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +11 -0
  827. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +159 -0
  828. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +159 -0
  829. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +159 -0
  830. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +159 -0
  831. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +159 -0
  832. package/govendor/golang.org/x/sys/unix/zsyscall_linux.go +28 -1
  833. package/govendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +3 -3
  834. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +159 -0
  835. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +159 -0
  836. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +159 -0
  837. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +159 -0
  838. package/govendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +13 -0
  839. package/govendor/golang.org/x/sys/unix/ztypes_linux.go +65 -36
  840. package/govendor/golang.org/x/sys/unix/ztypes_linux_386.go +6 -0
  841. package/govendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +7 -0
  842. package/govendor/golang.org/x/sys/unix/ztypes_linux_arm.go +6 -0
  843. package/govendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +7 -0
  844. package/govendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +7 -0
  845. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips.go +6 -0
  846. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +7 -0
  847. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +7 -0
  848. package/govendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +6 -0
  849. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +6 -0
  850. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +7 -0
  851. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +7 -0
  852. package/govendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +7 -0
  853. package/govendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +7 -0
  854. package/govendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +10 -5
  855. package/govendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +78 -0
  856. package/govendor/golang.org/x/text/.gitattributes +10 -0
  857. package/govendor/golang.org/x/text/CONTRIBUTING.md +26 -0
  858. package/govendor/golang.org/x/text/LICENSE +27 -0
  859. package/govendor/golang.org/x/text/PATENTS +22 -0
  860. package/govendor/golang.org/x/text/README.md +81 -0
  861. package/govendor/golang.org/x/text/cases/cases.go +162 -0
  862. package/govendor/golang.org/x/text/cases/context.go +376 -0
  863. package/govendor/golang.org/x/text/cases/fold.go +34 -0
  864. package/govendor/golang.org/x/text/cases/icu.go +61 -0
  865. package/govendor/golang.org/x/text/cases/info.go +82 -0
  866. package/govendor/golang.org/x/text/cases/map.go +816 -0
  867. package/govendor/golang.org/x/text/cases/tables15.0.0.go +2527 -0
  868. package/govendor/golang.org/x/text/cases/tables17.0.0.go +2642 -0
  869. package/govendor/golang.org/x/text/cases/trieval.go +217 -0
  870. package/govendor/golang.org/x/text/codereview.cfg +1 -0
  871. package/govendor/golang.org/x/text/collate/collate.go +402 -0
  872. package/govendor/golang.org/x/text/collate/index.go +32 -0
  873. package/govendor/golang.org/x/text/collate/option.go +239 -0
  874. package/govendor/golang.org/x/text/collate/sort.go +81 -0
  875. package/govendor/golang.org/x/text/collate/tables.go +73789 -0
  876. package/govendor/golang.org/x/text/currency/common.go +67 -0
  877. package/govendor/golang.org/x/text/currency/currency.go +185 -0
  878. package/govendor/golang.org/x/text/currency/format.go +220 -0
  879. package/govendor/golang.org/x/text/currency/query.go +152 -0
  880. package/govendor/golang.org/x/text/currency/tables.go +2629 -0
  881. package/govendor/golang.org/x/text/doc.go +16 -0
  882. package/govendor/golang.org/x/text/feature/plural/common.go +70 -0
  883. package/govendor/golang.org/x/text/feature/plural/message.go +244 -0
  884. package/govendor/golang.org/x/text/feature/plural/plural.go +262 -0
  885. package/govendor/golang.org/x/text/feature/plural/tables.go +552 -0
  886. package/govendor/golang.org/x/text/go.mod +3 -0
  887. package/govendor/golang.org/x/text/internal/catmsg/catmsg.go +417 -0
  888. package/govendor/golang.org/x/text/internal/catmsg/codec.go +407 -0
  889. package/govendor/golang.org/x/text/internal/catmsg/varint.go +62 -0
  890. package/govendor/golang.org/x/text/internal/colltab/collelem.go +374 -0
  891. package/govendor/golang.org/x/text/internal/colltab/colltab.go +105 -0
  892. package/govendor/golang.org/x/text/internal/colltab/contract.go +145 -0
  893. package/govendor/golang.org/x/text/internal/colltab/iter.go +178 -0
  894. package/govendor/golang.org/x/text/internal/colltab/numeric.go +236 -0
  895. package/govendor/golang.org/x/text/internal/colltab/table.go +275 -0
  896. package/govendor/golang.org/x/text/internal/colltab/trie.go +159 -0
  897. package/govendor/golang.org/x/text/internal/colltab/weighter.go +31 -0
  898. package/govendor/golang.org/x/text/internal/format/format.go +41 -0
  899. package/govendor/golang.org/x/text/internal/format/parser.go +358 -0
  900. package/govendor/golang.org/x/text/internal/internal.go +49 -0
  901. package/govendor/golang.org/x/text/internal/language/common.go +16 -0
  902. package/govendor/golang.org/x/text/internal/language/compact/compact.go +61 -0
  903. package/govendor/golang.org/x/text/internal/language/compact/language.go +260 -0
  904. package/govendor/golang.org/x/text/internal/language/compact/parents.go +120 -0
  905. package/govendor/golang.org/x/text/internal/language/compact/tables.go +1015 -0
  906. package/govendor/golang.org/x/text/internal/language/compact/tags.go +91 -0
  907. package/govendor/golang.org/x/text/internal/language/compact.go +29 -0
  908. package/govendor/golang.org/x/text/internal/language/compose.go +167 -0
  909. package/govendor/golang.org/x/text/internal/language/coverage.go +28 -0
  910. package/govendor/golang.org/x/text/internal/language/language.go +627 -0
  911. package/govendor/golang.org/x/text/internal/language/lookup.go +412 -0
  912. package/govendor/golang.org/x/text/internal/language/match.go +226 -0
  913. package/govendor/golang.org/x/text/internal/language/parse.go +608 -0
  914. package/govendor/golang.org/x/text/internal/language/tables.go +3494 -0
  915. package/govendor/golang.org/x/text/internal/language/tags.go +48 -0
  916. package/govendor/golang.org/x/text/internal/match.go +67 -0
  917. package/govendor/golang.org/x/text/internal/number/common.go +55 -0
  918. package/govendor/golang.org/x/text/internal/number/decimal.go +500 -0
  919. package/govendor/golang.org/x/text/internal/number/format.go +533 -0
  920. package/govendor/golang.org/x/text/internal/number/number.go +152 -0
  921. package/govendor/golang.org/x/text/internal/number/pattern.go +485 -0
  922. package/govendor/golang.org/x/text/internal/number/roundingmode_string.go +30 -0
  923. package/govendor/golang.org/x/text/internal/number/tables.go +1219 -0
  924. package/govendor/golang.org/x/text/internal/stringset/set.go +86 -0
  925. package/govendor/golang.org/x/text/internal/tag/tag.go +100 -0
  926. package/govendor/golang.org/x/text/language/coverage.go +187 -0
  927. package/govendor/golang.org/x/text/language/display/dict.go +92 -0
  928. package/govendor/golang.org/x/text/language/display/display.go +420 -0
  929. package/govendor/golang.org/x/text/language/display/lookup.go +253 -0
  930. package/govendor/golang.org/x/text/language/display/tables.go +53114 -0
  931. package/govendor/golang.org/x/text/language/doc.go +98 -0
  932. package/govendor/golang.org/x/text/language/language.go +605 -0
  933. package/govendor/golang.org/x/text/language/match.go +735 -0
  934. package/govendor/golang.org/x/text/language/parse.go +258 -0
  935. package/govendor/golang.org/x/text/language/tables.go +298 -0
  936. package/govendor/golang.org/x/text/language/tags.go +145 -0
  937. package/govendor/golang.org/x/text/message/catalog/catalog.go +365 -0
  938. package/govendor/golang.org/x/text/message/catalog/dict.go +133 -0
  939. package/govendor/golang.org/x/text/secure/bidirule/bidirule.go +346 -0
  940. package/govendor/golang.org/x/text/transform/transform.go +709 -0
  941. package/govendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
  942. package/govendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
  943. package/govendor/golang.org/x/text/unicode/bidi/core.go +1050 -0
  944. package/govendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
  945. package/govendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
  946. package/govendor/golang.org/x/text/unicode/bidi/tables17.0.0.go +2135 -0
  947. package/govendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
  948. package/govendor/golang.org/x/text/unicode/norm/composition.go +524 -0
  949. package/govendor/golang.org/x/text/unicode/norm/forminfo.go +296 -0
  950. package/govendor/golang.org/x/text/unicode/norm/input.go +109 -0
  951. package/govendor/golang.org/x/text/unicode/norm/iter.go +454 -0
  952. package/govendor/golang.org/x/text/unicode/norm/normalize.go +613 -0
  953. package/govendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
  954. package/govendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
  955. package/govendor/golang.org/x/text/unicode/norm/tables17.0.0.go +8104 -0
  956. package/govendor/golang.org/x/text/unicode/norm/transform.go +89 -0
  957. package/govendor/golang.org/x/text/unicode/norm/trie.go +54 -0
  958. package/govendor/manifest.txt +11 -2
  959. package/govendor/software.sslmate.com/src/go-pkcs12/.gitattributes +10 -0
  960. package/govendor/software.sslmate.com/src/go-pkcs12/LICENSE +28 -0
  961. package/govendor/software.sslmate.com/src/go-pkcs12/README.md +31 -0
  962. package/govendor/software.sslmate.com/src/go-pkcs12/bmp-string.go +63 -0
  963. package/govendor/software.sslmate.com/src/go-pkcs12/crypto.go +331 -0
  964. package/govendor/software.sslmate.com/src/go-pkcs12/errors.go +23 -0
  965. package/govendor/software.sslmate.com/src/go-pkcs12/go.mod +3 -0
  966. package/govendor/software.sslmate.com/src/go-pkcs12/internal/rc2/rc2.go +271 -0
  967. package/govendor/software.sslmate.com/src/go-pkcs12/mac.go +202 -0
  968. package/govendor/software.sslmate.com/src/go-pkcs12/pbkdf.go +184 -0
  969. package/govendor/software.sslmate.com/src/go-pkcs12/pkcs12.go +1000 -0
  970. package/govendor/software.sslmate.com/src/go-pkcs12/safebags.go +107 -0
  971. package/package.json +11 -1
  972. package/types/tsconfig.json +17 -0
  973. package/types/typenative-npm.d.ts +1327 -80
  974. package/types/typenative.d.ts +1312 -25
  975. package/.gitattributes +0 -1
  976. package/.github/workflows/ci.yml +0 -68
  977. package/.github/workflows/npm-publish-github-packages.yml +0 -88
  978. package/CHANGELOG.md +0 -1358
  979. package/CONTRIBUTION.md +0 -133
  980. package/conformance.md +0 -1450
  981. package/examples/README.md +0 -113
  982. package/examples/angular-templates/README.md +0 -141
  983. package/examples/angular-templates/bench.mjs +0 -173
  984. package/examples/angular-templates/dom-type-globals.d.ts +0 -21
  985. package/examples/angular-templates/dom-type-stubs.ts +0 -21
  986. package/examples/angular-templates/main.ts +0 -135
  987. package/examples/angular-templates/parity.mjs +0 -157
  988. package/examples/angular-templates/run-node.mjs +0 -69
  989. package/examples/angular-templates/vendor/angular/compiler/LICENSE +0 -21
  990. package/examples/desktop-notes/README.md +0 -106
  991. package/examples/desktop-notes/bench.mjs +0 -125
  992. package/examples/desktop-notes/main.ts +0 -131
  993. package/examples/desktop-notes/package-lock.json +0 -726
  994. package/examples/desktop-notes/package.json +0 -9
  995. package/examples/desktop-notes/ui.ts +0 -176
  996. package/examples/dupe-finder/README.md +0 -78
  997. package/examples/dupe-finder/bench.mjs +0 -120
  998. package/examples/dupe-finder/main.ts +0 -87
  999. package/examples/fibonacci/README.md +0 -89
  1000. package/examples/fibonacci/bench.mjs +0 -87
  1001. package/examples/fibonacci/main.ts +0 -21
  1002. package/examples/hello-world/README.md +0 -62
  1003. package/examples/hello-world/bench.mjs +0 -66
  1004. package/examples/hello-world/main.ts +0 -7
  1005. package/examples/json-server/README.md +0 -131
  1006. package/examples/json-server/bench.mjs +0 -263
  1007. package/examples/json-server/main.ts +0 -67
  1008. package/examples/mandelbrot-png/README.md +0 -63
  1009. package/examples/mandelbrot-png/bench.mjs +0 -95
  1010. package/examples/mandelbrot-png/main.ts +0 -98
  1011. package/examples/mandelbrot-png/preview.png +0 -0
  1012. package/examples/marked-cli/README.md +0 -175
  1013. package/examples/marked-cli/bench.mjs +0 -178
  1014. package/examples/marked-cli/main.ts +0 -410
  1015. package/examples/marked-cli/parity.mjs +0 -185
  1016. package/examples/marked-cli/vendor/marked/LICENSE +0 -44
  1017. package/examples/marked-cli/vendor/marked/VENDOR.md +0 -26
  1018. package/examples/openai-chat/README.md +0 -148
  1019. package/examples/openai-chat/bench.mjs +0 -175
  1020. package/examples/openai-chat/main.ts +0 -488
  1021. package/examples/react-compiler/README.md +0 -185
  1022. package/examples/react-compiler/bench.mjs +0 -181
  1023. package/examples/react-compiler/main.ts +0 -324
  1024. package/examples/react-compiler/parity.mjs +0 -362
  1025. package/examples/react-compiler/run-node.mjs +0 -90
  1026. package/examples/react-compiler/vendor/babel/LICENSE +0 -22
  1027. package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-lower.json +0 -15
  1028. package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-upper.json +0 -51
  1029. package/examples/react-compiler/vendor/charcodes/package.json +0 -25
  1030. package/examples/react-compiler/vendor/invariant/LICENSE +0 -21
  1031. package/examples/react-compiler/vendor/invariant/invariant.cjs +0 -51
  1032. package/examples/react-compiler/vendor/invariant/invariant.d.cts +0 -11
  1033. package/examples/react-compiler/vendor/invariant/types/LICENSE +0 -21
  1034. package/examples/react-compiler/vendor/jridgewell/gen-mapping/LICENSE +0 -19
  1035. package/examples/react-compiler/vendor/jridgewell/resolve-uri/LICENSE +0 -19
  1036. package/examples/react-compiler/vendor/jridgewell/sourcemap-codec/LICENSE +0 -19
  1037. package/examples/react-compiler/vendor/jridgewell/trace-mapping/LICENSE +0 -19
  1038. package/examples/react-compiler/vendor/js-tokens/LICENSE +0 -21
  1039. package/examples/react-compiler/vendor/js-tokens/index.cjs +0 -23
  1040. package/examples/react-compiler/vendor/js-tokens/index.d.cts +0 -13
  1041. package/examples/react-compiler/vendor/jsesc/jsesc.cjs +0 -337
  1042. package/examples/react-compiler/vendor/jsesc/jsesc.d.cts +0 -384
  1043. package/examples/react-compiler/vendor/jsesc/types/LICENSE +0 -21
  1044. package/examples/react-compiler/vendor/picocolors/picocolors.cjs +0 -75
  1045. package/examples/react-compiler/vendor/picocolors/picocolors.d.cts +0 -5
  1046. package/examples/react-compiler/vendor/picocolors/types.d.ts +0 -51
  1047. package/examples/react-compiler/vendor/react-compiler/LICENSE +0 -21
  1048. package/examples/react-compiler/vendor/stubs/babel-core.ts +0 -31
  1049. package/examples/react-compiler/vendor/stubs/debug.ts +0 -18
  1050. package/examples/react-compiler/vendor/stubs/js-tokens.d.ts +0 -13
  1051. package/examples/react-compiler/vendor/stubs/pretty-format.ts +0 -18
  1052. package/examples/react-compiler/vendor/zod/LICENSE +0 -21
  1053. package/examples/react-compiler/vendor/zod-validation-error/LICENSE +0 -9
  1054. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/NonEmptyArray.ts +0 -5
  1055. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinPath.ts +0 -49
  1056. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinValues.ts +0 -48
  1057. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/stringify.ts +0 -50
  1058. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/titleCase.ts +0 -6
  1059. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/MessageBuilder.ts +0 -126
  1060. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/ValidationError.ts +0 -39
  1061. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/custom.ts +0 -12
  1062. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/errorMap.ts +0 -78
  1063. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/index.ts +0 -2
  1064. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidElement.ts +0 -12
  1065. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidKey.ts +0 -12
  1066. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidStringFormat.ts +0 -131
  1067. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidType.ts +0 -54
  1068. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidUnion.ts +0 -12
  1069. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidValue.ts +0 -40
  1070. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/notMultipleOf.ts +0 -12
  1071. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooBig.ts +0 -76
  1072. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooSmall.ts +0 -76
  1073. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/types.ts +0 -27
  1074. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/unrecognizedKeys.ts +0 -27
  1075. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromError.ts +0 -13
  1076. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodError.ts +0 -61
  1077. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodIssue.ts +0 -38
  1078. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/index.ts +0 -20
  1079. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationError.ts +0 -5
  1080. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationErrorLike.ts +0 -8
  1081. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isZodErrorLike.ts +0 -11
  1082. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/toValidationError.ts +0 -20
  1083. package/examples/react-compiler/vendor.mjs +0 -688
  1084. package/examples/todo-cli/README.md +0 -69
  1085. package/examples/todo-cli/bench.mjs +0 -89
  1086. package/examples/todo-cli/main.ts +0 -92
  1087. package/examples/yaml-cli/README.md +0 -152
  1088. package/examples/yaml-cli/bench.mjs +0 -265
  1089. package/examples/yaml-cli/main.ts +0 -251
  1090. package/examples/yaml-cli/parity.mjs +0 -156
  1091. package/examples/yaml-cli/vendor/yaml/LICENSE +0 -13
  1092. package/examples/yaml-cli/vendor/yaml/VENDOR.md +0 -25
  1093. package/govendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +0 -22
  1094. package/govendor/golang.org/x/sys/windows/types_windows_arm.go +0 -35
  1095. package/performance/README.md +0 -196
  1096. package/performance/any-dynamic.ts +0 -21
  1097. package/performance/any-record-view.ts +0 -20
  1098. package/performance/arr-hof.ts +0 -21
  1099. package/performance/arr-push-index.ts +0 -15
  1100. package/performance/arr-sort.ts +0 -21
  1101. package/performance/async-await.ts +0 -24
  1102. package/performance/class-dispatch.ts +0 -52
  1103. package/performance/events-emit.ts +0 -27
  1104. package/performance/exc-throw-rare.ts +0 -25
  1105. package/performance/exc-try-catch.ts +0 -26
  1106. package/performance/fn-closures.ts +0 -29
  1107. package/performance/fn-recursion-tree.ts +0 -31
  1108. package/performance/gen-for-of.ts +0 -46
  1109. package/performance/json-roundtrip.ts +0 -27
  1110. package/performance/map-delete.ts +0 -24
  1111. package/performance/map-string-keys.ts +0 -22
  1112. package/performance/num-arith-loop.ts +0 -14
  1113. package/performance/num-bitwise.ts +0 -21
  1114. package/performance/num-mod-int.ts +0 -16
  1115. package/performance/num-to-string.ts +0 -16
  1116. package/performance/obj-alloc.ts +0 -32
  1117. package/performance/regex-exec.ts +0 -29
  1118. package/performance/regex-site.ts +0 -28
  1119. package/performance/set-ops.ts +0 -20
  1120. package/performance/str-char-scan.ts +0 -35
  1121. package/performance/str-concat-plus.ts +0 -18
  1122. package/performance/str-concat.ts +0 -24
  1123. package/performance/str-short-scan.ts +0 -26
  1124. package/performance/str-split-join.ts +0 -23
  1125. package/performance/str-template.ts +0 -16
  1126. package/performance/union-switch.ts +0 -57
  1127. package/tsparser/check.go +0 -158
  1128. package/tsparser/go.mod +0 -14
  1129. package/tsparser/go.sum +0 -22
  1130. package/tsparser/main.go +0 -363
  1131. package/tsparser/tsparser.exe +0 -4
package/bin/node/http2.js CHANGED
@@ -1,39 +1,128 @@
1
- // node:http2 on Go's net/http (HTTP/2 over TLS, and cleartext h2c with prior
2
- // knowledge). Servers are http.Servers speaking HTTP/2: the 'stream' event
3
- // hands out ServerHttp2Streams (respond / write / end, request headers with
4
- // :method / :path / :scheme / :authority); without 'stream' listeners the
5
- // compatibility 'request' API serves Http2ServerRequest / Response (the
6
- // node:http objects). connect() returns a ClientHttp2Session whose request()
7
- // streams are Duplexes emitting 'response' with :status. Frame-level features
8
- // (push, ping, settings, goaway) are not exposed by Go's standard library.
1
+ // node:http2 on golang.org/x/net/http2 (net/http's own HTTP/2 on Go 1.27:
2
+ // over TLS, and cleartext h2c with prior knowledge). Every connection is a
3
+ // session: servers accept connections themselves ('session', then
4
+ // x/net/http2's ServeConn), connect() dials one and hands it to NewClientConn.
5
+ // Between the library and the socket sits a tnH2Tap that splits the byte
6
+ // stream into frames, so the session's PING / SETTINGS / GOAWAY / ALTSVC go
7
+ // out between two of the library's frames and the peer's reach the session.
8
+ // The 'stream' event hands out ServerHttp2Streams (respond / write / end,
9
+ // request headers with :method / :path / :scheme / :authority); without
10
+ // 'stream' listeners the compatibility 'request' API serves
11
+ // Http2ServerRequest / Response (the node:http objects). A client session's
12
+ // request() streams are Duplexes emitting 'response' with :status.
9
13
  import { defineClass, defineHelper, defineModule, setResults } from './registry.js';
10
14
  import { STREAM_METHODS, STREAM_GETTERS, streamListenerTypes } from './stream.js';
11
15
  const http2Helper = `// node:http2
12
- var tnHttp2NextID float64 = -1
16
+ // Settings as Node reports them (localSettings / remoteSettings): the RFC 9113
17
+ // initial values, updated by each SETTINGS frame
18
+ type tnH2Settings struct {
19
+ headerTableSize float64
20
+ enablePush bool
21
+ initialWindowSize float64
22
+ maxFrameSize float64
23
+ maxConcurrentStreams float64
24
+ maxHeaderListSize float64
25
+ enableConnectProtocol bool
26
+ }
27
+
28
+ func tnH2InitialSettings() tnH2Settings {
29
+ return tnH2Settings{4096, true, 65535, 16384, 4294967295, 4294967295, false}
30
+ }
31
+
32
+ func (st *tnH2Settings) apply(id http2.SettingID, v uint32) {
33
+ switch id {
34
+ case http2.SettingHeaderTableSize:
35
+ st.headerTableSize = float64(v)
36
+ case http2.SettingEnablePush:
37
+ st.enablePush = v != 0
38
+ case http2.SettingInitialWindowSize:
39
+ st.initialWindowSize = float64(v)
40
+ case http2.SettingMaxFrameSize:
41
+ st.maxFrameSize = float64(v)
42
+ case http2.SettingMaxConcurrentStreams:
43
+ st.maxConcurrentStreams = float64(v)
44
+ case http2.SettingMaxHeaderListSize:
45
+ st.maxHeaderListSize = float64(v)
46
+ case http2.SettingEnableConnectProtocol:
47
+ st.enableConnectProtocol = v != 0
48
+ }
49
+ }
13
50
 
51
+ func (st tnH2Settings) object() map[string]interface{} {
52
+ return map[string]interface{}{
53
+ "headerTableSize": st.headerTableSize,
54
+ "enablePush": st.enablePush,
55
+ "initialWindowSize": st.initialWindowSize,
56
+ "maxFrameSize": st.maxFrameSize,
57
+ "maxConcurrentStreams": st.maxConcurrentStreams,
58
+ "maxHeaderListSize": st.maxHeaderListSize,
59
+ "maxHeaderSize": st.maxHeaderListSize,
60
+ "enableConnectProtocol": st.enableConnectProtocol,
61
+ }
62
+ }
63
+
64
+ func tnH2ParseSettings(payload []byte) []http2.Setting {
65
+ out := []http2.Setting{}
66
+ for i := 0; i+6 <= len(payload); i += 6 {
67
+ out = append(out, http2.Setting{ID: http2.SettingID(binary.BigEndian.Uint16(payload[i:])), Val: binary.BigEndian.Uint32(payload[i+2:])})
68
+ }
69
+ return out
70
+ }
71
+
72
+ // An HTTP/2 session: x/net/http2 (net/http's HTTP/2 on Go 1.27) speaks the
73
+ // protocol over a tnH2Tap, which lets the session add its own frames and see
74
+ // the peer's PING / SETTINGS / GOAWAY / ALTSVC frames
14
75
  type TnHttp2Session struct {
15
76
  TnEventEmitter
77
+ // 0 on the server, 1 on the client (NGHTTP2_SESSION_SERVER / CLIENT)
78
+ typ float64
16
79
  origin string
17
- transport *http.Transport
18
- client *http.Client
80
+ cc *http2.ClientConn
81
+ conn net.Conn
82
+ tap *tnH2Tap
19
83
  encrypted bool
20
84
  alpnProtocol string
21
85
  closed bool
22
86
  destroyed bool
23
87
  finished bool
24
88
  refd bool
89
+ connecting bool
25
90
  active int
26
91
  nextID float64
27
92
  socket *TnSocket
93
+ local tnH2Settings
94
+ remote tnH2Settings
95
+ pending []*TnHttp2Stream
96
+ // frame calls made while the client is still connecting
97
+ deferred []func()
98
+ // server side: handlers running on the connection
99
+ handlers int32
28
100
 
29
101
  connectEmitted bool
102
+ closeEmitted bool
30
103
  }
31
104
 
32
- func (s *TnHttp2Session) Get_closed() bool { return s.closed }
33
- func (s *TnHttp2Session) Get_destroyed() bool { return s.destroyed }
34
- func (s *TnHttp2Session) Get_encrypted() bool { return s.encrypted }
35
- func (s *TnHttp2Session) Get_alpnProtocol() string { return s.alpnProtocol }
36
- func (s *TnHttp2Session) Get_socket() *TnSocket { return s.socket }
105
+ func tnNewHttp2Session(typ float64) *TnHttp2Session {
106
+ return &TnHttp2Session{typ: typ, local: tnH2InitialSettings(), remote: tnH2InitialSettings()}
107
+ }
108
+
109
+ func (s *TnHttp2Session) Get_closed() bool { return s.closed }
110
+ func (s *TnHttp2Session) Get_destroyed() bool { return s.destroyed }
111
+ func (s *TnHttp2Session) Get_encrypted() bool { return s.encrypted }
112
+ func (s *TnHttp2Session) Get_alpnProtocol() string { return s.alpnProtocol }
113
+ func (s *TnHttp2Session) Get_socket() *TnSocket { return s.socket }
114
+ func (s *TnHttp2Session) Get_connecting() bool { return s.connecting }
115
+ func (s *TnHttp2Session) Get_type_() float64 { return s.typ }
116
+ func (s *TnHttp2Session) Get_localSettings() map[string]interface{} { return s.local.object() }
117
+ func (s *TnHttp2Session) Get_remoteSettings() map[string]interface{} { return s.remote.object() }
118
+
119
+ // true while a SETTINGS frame this side sent (its first one included) waits for its ACK
120
+ func (s *TnHttp2Session) Get_pendingSettingsAck() bool {
121
+ if s.tap == nil {
122
+ return s.connecting
123
+ }
124
+ return s.tap.unacked() > 0
125
+ }
37
126
 
38
127
  func (s *TnHttp2Session) ref() *TnHttp2Session {
39
128
  if !s.refd && !s.finished {
@@ -53,31 +142,717 @@ func (s *TnHttp2Session) unref() *TnHttp2Session {
53
142
 
54
143
  func (s *TnHttp2Session) setTimeout(ms float64, cb ...interface{}) *TnHttp2Session { return s }
55
144
 
56
- // 'connect' fires once, when the session's first connection is up; guarded on
57
- // the loop so the eager probe dial and the transport's own dials can both call
58
- // it without racing
59
- func (s *TnHttp2Session) emitConnect(conn net.Conn) {
60
- TnLoopPost(func() {
61
- if s.connectEmitted || s.destroyed {
145
+ const tnH2Preface = "PRI * HTTP/2.0\\r\\n\\r\\nSM\\r\\n\\r\\n"
146
+
147
+ const (
148
+ tnH2FrameHeaders = 0x1
149
+ tnH2FrameSettings = 0x4
150
+ tnH2FramePing = 0x6
151
+ tnH2FrameGoAway = 0x7
152
+ tnH2FrameAltSvc = 0xa
153
+ )
154
+
155
+ // A SETTINGS frame waiting for its ACK; ours were sent by session.settings()
156
+ type tnH2Ack struct {
157
+ ours bool
158
+ settings []http2.Setting
159
+ cb interface{}
160
+ start time.Time
161
+ }
162
+
163
+ type tnH2Ping struct {
164
+ cb interface{}
165
+ start time.Time
166
+ }
167
+
168
+ type tnH2Out struct {
169
+ frame []byte
170
+ ack *tnH2Ack
171
+ }
172
+
173
+ // The connection under x/net/http2. Writes are parsed into frames so the
174
+ // session's own frames go out only between two of the library's frames (its
175
+ // buffered writer can split one frame across Write calls); reads are parsed
176
+ // into frames so the peer's control frames reach the session. The ACKs of the
177
+ // session's own SETTINGS and PINGs are taken out of the stream: the library
178
+ // never sent those frames.
179
+ type tnH2Tap struct {
180
+ net.Conn
181
+ s *TnHttp2Session
182
+ // read side: only the connection's read loop calls Read
183
+ rbuf []byte
184
+ out []byte
185
+ off int
186
+ tmp []byte
187
+ rskip int
188
+ rleft int
189
+ rplain bool
190
+ // write side
191
+ mu sync.Mutex
192
+ wskip int
193
+ whdr [9]byte
194
+ whdrN int
195
+ wleft int
196
+ wcollect bool
197
+ wpayload []byte
198
+ wstarted bool
199
+ queued []tnH2Out
200
+ acks []*tnH2Ack
201
+ pings map[[8]byte]tnH2Ping
202
+ // the library's own advertised limits: settings() never goes above them,
203
+ // or the peer would send what the library refuses
204
+ libWindow uint32
205
+ libFrame uint32
206
+ libTable uint32
207
+ lastPeerStream uint32
208
+ closeOnce sync.Once
209
+ }
210
+
211
+ // A TLS connection keeps its ConnectionState, so the library sees TLS (r.TLS, ALPN)
212
+ type tnH2TapTLS struct {
213
+ *tnH2Tap
214
+ tc *tls.Conn
215
+ }
216
+
217
+ func (t *tnH2TapTLS) ConnectionState() tls.ConnectionState { return t.tc.ConnectionState() }
218
+
219
+ func tnNewH2Tap(conn net.Conn, s *TnHttp2Session, server bool) (*tnH2Tap, net.Conn) {
220
+ t := &tnH2Tap{Conn: conn, s: s, pings: map[[8]byte]tnH2Ping{}, libWindow: 65535, libFrame: 16384, libTable: 4096}
221
+ if server {
222
+ t.rskip = len(tnH2Preface)
223
+ } else {
224
+ t.wskip = len(tnH2Preface)
225
+ }
226
+ if tc, ok := conn.(*tls.Conn); ok {
227
+ return t, &tnH2TapTLS{tnH2Tap: t, tc: tc}
228
+ }
229
+ return t, t
230
+ }
231
+
232
+ // The library closes the connection itself too (after a GOAWAY, its reader
233
+ // may stop without a read error): either way the session hears of it once
234
+ func (t *tnH2Tap) Close() error {
235
+ t.closeOnce.Do(func() { TnLoopPost(t.s.connClosed) })
236
+ return t.Conn.Close()
237
+ }
238
+
239
+ func (t *tnH2Tap) Read(p []byte) (int, error) {
240
+ for t.off == len(t.out) {
241
+ if t.tmp == nil {
242
+ t.tmp = make([]byte, 32768)
243
+ }
244
+ n, err := t.Conn.Read(t.tmp)
245
+ if n > 0 {
246
+ t.feed(t.tmp[:n])
247
+ }
248
+ if err != nil {
249
+ t.closeOnce.Do(func() { TnLoopPost(t.s.connClosed) })
250
+ if t.off < len(t.out) {
251
+ break
252
+ }
253
+ return 0, err
254
+ }
255
+ }
256
+ n := copy(p, t.out[t.off:])
257
+ t.off += n
258
+ if t.off == len(t.out) {
259
+ t.out = t.out[:0]
260
+ t.off = 0
261
+ }
262
+ return n, nil
263
+ }
264
+
265
+ func (t *tnH2Tap) feed(b []byte) {
266
+ if t.rplain {
267
+ t.out = append(t.out, b...)
268
+ return
269
+ }
270
+ if t.rskip > 0 {
271
+ // The client preface; anything else is not HTTP/2, left to the library
272
+ k := min(t.rskip, len(b))
273
+ at := len(tnH2Preface) - t.rskip
274
+ if string(b[:k]) != tnH2Preface[at:at+k] {
275
+ t.rplain = true
276
+ t.out = append(t.out, b...)
277
+ return
278
+ }
279
+ t.out = append(t.out, b[:k]...)
280
+ t.rskip -= k
281
+ b = b[k:]
282
+ }
283
+ t.rbuf = append(t.rbuf, b...)
284
+ i := 0
285
+ for {
286
+ if t.rleft > 0 {
287
+ k := min(t.rleft, len(t.rbuf)-i)
288
+ t.out = append(t.out, t.rbuf[i:i+k]...)
289
+ i += k
290
+ t.rleft -= k
291
+ if t.rleft > 0 {
292
+ break
293
+ }
294
+ continue
295
+ }
296
+ if len(t.rbuf)-i < 9 {
297
+ break
298
+ }
299
+ h := t.rbuf[i:]
300
+ length := int(h[0])<<16 | int(h[1])<<8 | int(h[2])
301
+ switch h[3] {
302
+ case tnH2FrameSettings, tnH2FramePing, tnH2FrameGoAway, tnH2FrameAltSvc:
303
+ if len(h) < 9+length {
304
+ t.rbuf = append(t.rbuf[:0], t.rbuf[i:]...)
305
+ return
306
+ }
307
+ frame := h[:9+length]
308
+ if t.observe(frame) {
309
+ t.out = append(t.out, frame...)
310
+ }
311
+ i += 9 + length
312
+ continue
313
+ case tnH2FrameHeaders:
314
+ if id := binary.BigEndian.Uint32(h[5:9]) & 0x7fffffff; id > atomic.LoadUint32(&t.lastPeerStream) {
315
+ atomic.StoreUint32(&t.lastPeerStream, id)
316
+ }
317
+ }
318
+ t.out = append(t.out, h[:9]...)
319
+ i += 9
320
+ t.rleft = length
321
+ }
322
+ t.rbuf = append(t.rbuf[:0], t.rbuf[i:]...)
323
+ }
324
+
325
+ // A peer frame the session cares about; false drops it (the library did not send its request)
326
+ func (t *tnH2Tap) observe(frame []byte) bool {
327
+ s := t.s
328
+ flags := frame[4]
329
+ streamID := binary.BigEndian.Uint32(frame[5:9]) & 0x7fffffff
330
+ payload := append([]byte{}, frame[9:]...)
331
+ switch frame[3] {
332
+ case tnH2FrameSettings:
333
+ if flags&0x1 != 0 {
334
+ t.mu.Lock()
335
+ var ack *tnH2Ack
336
+ if len(t.acks) > 0 {
337
+ ack = t.acks[0]
338
+ t.acks = t.acks[1:]
339
+ }
340
+ t.mu.Unlock()
341
+ if ack == nil {
342
+ return true
343
+ }
344
+ TnLoopPost(func() { s.settingsAcked(ack) })
345
+ return !ack.ours
346
+ }
347
+ list := tnH2ParseSettings(payload)
348
+ TnLoopPost(func() {
349
+ if s.destroyed {
350
+ return
351
+ }
352
+ for _, e := range list {
353
+ s.remote.apply(e.ID, e.Val)
354
+ }
355
+ s.emit("remoteSettings", s.remote.object())
356
+ })
357
+ case tnH2FramePing:
358
+ if len(payload) != 8 {
359
+ return true
360
+ }
361
+ var data [8]byte
362
+ copy(data[:], payload)
363
+ if flags&0x1 != 0 {
364
+ t.mu.Lock()
365
+ p, ok := t.pings[data]
366
+ delete(t.pings, data)
367
+ t.mu.Unlock()
368
+ if !ok {
369
+ return true
370
+ }
371
+ duration := float64(time.Since(p.start)) / float64(time.Millisecond)
372
+ TnLoopPost(func() { TnInvoke(p.cb, nil, duration, payload) })
373
+ return false
374
+ }
375
+ TnLoopPost(func() {
376
+ if !s.destroyed {
377
+ s.emit("ping", payload)
378
+ }
379
+ })
380
+ case tnH2FrameGoAway:
381
+ if len(payload) < 8 {
382
+ return true
383
+ }
384
+ last := float64(binary.BigEndian.Uint32(payload[0:4]) & 0x7fffffff)
385
+ code := float64(binary.BigEndian.Uint32(payload[4:8]))
386
+ opaque := payload[8:]
387
+ TnLoopPost(func() { s.goawayReceived(code, last, opaque) })
388
+ case tnH2FrameAltSvc:
389
+ if len(payload) < 2 {
390
+ return false
391
+ }
392
+ n := int(binary.BigEndian.Uint16(payload))
393
+ if 2+n > len(payload) {
394
+ return false
395
+ }
396
+ origin := string(payload[2 : 2+n])
397
+ alt := string(payload[2+n:])
398
+ TnLoopPost(func() {
399
+ if !s.destroyed {
400
+ s.emit("altsvc", alt, origin, float64(streamID))
401
+ }
402
+ })
403
+ // net/http has no use for ALTSVC
404
+ return false
405
+ }
406
+ return true
407
+ }
408
+
409
+ func (t *tnH2Tap) atBoundary() bool {
410
+ return t.wstarted && t.wskip == 0 && t.whdrN == 0 && t.wleft == 0
411
+ }
412
+
413
+ func (t *tnH2Tap) flushQueued() error {
414
+ for len(t.queued) > 0 {
415
+ q := t.queued[0]
416
+ t.queued = t.queued[1:]
417
+ if q.ack != nil {
418
+ t.acks = append(t.acks, q.ack)
419
+ }
420
+ if _, err := t.Conn.Write(q.frame); err != nil {
421
+ return err
422
+ }
423
+ }
424
+ return nil
425
+ }
426
+
427
+ func (t *tnH2Tap) Write(p []byte) (int, error) {
428
+ t.mu.Lock()
429
+ defer t.mu.Unlock()
430
+ start, i := 0, 0
431
+ for i < len(p) {
432
+ if t.wskip > 0 {
433
+ k := min(t.wskip, len(p)-i)
434
+ t.wskip -= k
435
+ i += k
436
+ continue
437
+ }
438
+ if t.wleft > 0 {
439
+ k := min(t.wleft, len(p)-i)
440
+ if t.wcollect {
441
+ t.wpayload = append(t.wpayload, p[i:i+k]...)
442
+ }
443
+ t.wleft -= k
444
+ i += k
445
+ if t.wleft == 0 {
446
+ t.frameWritten()
447
+ }
448
+ continue
449
+ }
450
+ if t.whdrN == 0 && t.wstarted && len(t.queued) > 0 {
451
+ if i > start {
452
+ if _, err := t.Conn.Write(p[start:i]); err != nil {
453
+ return start, err
454
+ }
455
+ }
456
+ start = i
457
+ if err := t.flushQueued(); err != nil {
458
+ return start, err
459
+ }
460
+ }
461
+ t.whdr[t.whdrN] = p[i]
462
+ t.whdrN++
463
+ i++
464
+ if t.whdrN == 9 {
465
+ t.whdrN = 0
466
+ t.wleft = int(t.whdr[0])<<16 | int(t.whdr[1])<<8 | int(t.whdr[2])
467
+ t.wcollect = t.whdr[3] == tnH2FrameSettings && t.whdr[4]&0x1 == 0
468
+ t.wpayload = t.wpayload[:0]
469
+ if t.wleft == 0 {
470
+ t.frameWritten()
471
+ }
472
+ }
473
+ }
474
+ if i > start {
475
+ if _, err := t.Conn.Write(p[start:i]); err != nil {
476
+ return start, err
477
+ }
478
+ }
479
+ if t.atBoundary() && len(t.queued) > 0 {
480
+ if err := t.flushQueued(); err != nil {
481
+ return len(p), err
482
+ }
483
+ }
484
+ return len(p), nil
485
+ }
486
+
487
+ // One of the library's frames is out: its SETTINGS wait for an ACK too
488
+ func (t *tnH2Tap) frameWritten() {
489
+ t.wstarted = true
490
+ if !t.wcollect {
491
+ return
492
+ }
493
+ list := tnH2ParseSettings(t.wpayload)
494
+ for _, e := range list {
495
+ switch e.ID {
496
+ case http2.SettingInitialWindowSize:
497
+ t.libWindow = e.Val
498
+ case http2.SettingMaxFrameSize:
499
+ t.libFrame = e.Val
500
+ case http2.SettingHeaderTableSize:
501
+ t.libTable = e.Val
502
+ }
503
+ }
504
+ t.acks = append(t.acks, &tnH2Ack{settings: list})
505
+ }
506
+
507
+ // Sends one of the session's frames as soon as no library frame is half written
508
+ func (t *tnH2Tap) send(frame []byte, ack *tnH2Ack) error {
509
+ t.mu.Lock()
510
+ defer t.mu.Unlock()
511
+ t.queued = append(t.queued, tnH2Out{frame: frame, ack: ack})
512
+ if t.atBoundary() {
513
+ return t.flushQueued()
514
+ }
515
+ return nil
516
+ }
517
+
518
+ func (t *tnH2Tap) unacked() int {
519
+ t.mu.Lock()
520
+ defer t.mu.Unlock()
521
+ n := len(t.acks)
522
+ for _, q := range t.queued {
523
+ if q.ack != nil {
524
+ n++
525
+ }
526
+ }
527
+ return n
528
+ }
529
+
530
+ func tnH2Frame(write func(f *http2.Framer) error) []byte {
531
+ var buf bytes.Buffer
532
+ write(http2.NewFramer(&buf, nil))
533
+ return buf.Bytes()
534
+ }
535
+
536
+ func tnHttp2SettingID(name string) (http2.SettingID, bool) {
537
+ switch name {
538
+ case "headerTableSize":
539
+ return http2.SettingHeaderTableSize, true
540
+ case "enablePush":
541
+ return http2.SettingEnablePush, true
542
+ case "maxConcurrentStreams":
543
+ return http2.SettingMaxConcurrentStreams, true
544
+ case "initialWindowSize":
545
+ return http2.SettingInitialWindowSize, true
546
+ case "maxFrameSize":
547
+ return http2.SettingMaxFrameSize, true
548
+ case "maxHeaderListSize", "maxHeaderSize":
549
+ return http2.SettingMaxHeaderListSize, true
550
+ case "enableConnectProtocol":
551
+ return http2.SettingEnableConnectProtocol, true
552
+ }
553
+ return 0, false
554
+ }
555
+
556
+ // The settings object as SETTINGS frame entries, with Node's range checks
557
+ func tnHttp2Settings(settings interface{}) ([]http2.Setting, map[string]interface{}, error) {
558
+ out := []http2.Setting{}
559
+ local := map[string]interface{}{}
560
+ for _, e := range tnEntries(settings) {
561
+ name := fmt.Sprint(e[0])
562
+ id, ok := tnHttp2SettingID(name)
563
+ if !ok {
564
+ continue
565
+ }
566
+ var value float64
567
+ switch v := e[1].(type) {
568
+ case bool:
569
+ if v {
570
+ value = 1
571
+ }
572
+ default:
573
+ n, ok := tnNetNumber(v)
574
+ if !ok || n != math.Trunc(n) {
575
+ return nil, nil, tnHttp2SettingError(name, e[1])
576
+ }
577
+ value = n
578
+ }
579
+ valid := value >= 0 && value <= 4294967295
580
+ switch id {
581
+ case http2.SettingEnablePush, http2.SettingEnableConnectProtocol:
582
+ valid = value == 0 || value == 1
583
+ case http2.SettingInitialWindowSize:
584
+ valid = value >= 0 && value <= 2147483647
585
+ case http2.SettingMaxFrameSize:
586
+ valid = value >= 16384 && value <= 16777215
587
+ }
588
+ if !valid {
589
+ return nil, nil, tnHttp2SettingError(name, e[1])
590
+ }
591
+ out = append(out, http2.Setting{ID: id, Val: uint32(value)})
592
+ if id == http2.SettingEnablePush || id == http2.SettingEnableConnectProtocol {
593
+ local[name] = value == 1
594
+ } else {
595
+ local[name] = value
596
+ }
597
+ }
598
+ return out, local, nil
599
+ }
600
+
601
+ func tnHttp2SettingError(name string, value interface{}) *TnError {
602
+ return TnNodeError("RangeError", "ERR_HTTP2_INVALID_SETTING_VALUE", "Invalid value for setting \\""+name+"\\": "+TnJSString(value))
603
+ }
604
+
605
+ // Runs a frame call now, or once the client's connection is up (as Node queues them on 'connect')
606
+ func (s *TnHttp2Session) whenConnected(fn func()) {
607
+ if s.tap == nil && s.connecting {
608
+ s.deferred = append(s.deferred, fn)
609
+ return
610
+ }
611
+ fn()
612
+ }
613
+
614
+ func (s *TnHttp2Session) checkLive() {
615
+ if s.destroyed {
616
+ panic(TnNodeError("Error", "ERR_HTTP2_INVALID_SESSION", "The session has been destroyed"))
617
+ }
618
+ }
619
+
620
+ // session.settings(settings, callback?): a SETTINGS frame; the callback and
621
+ // 'localSettings' follow the peer's ACK, as in Node
622
+ func (s *TnHttp2Session) settings(settings interface{}, cb ...interface{}) {
623
+ s.checkLive()
624
+ list, _, err := tnHttp2Settings(settings)
625
+ if err != nil {
626
+ panic(err)
627
+ }
628
+ var callback interface{}
629
+ if len(cb) > 0 && tnIsFunc(cb[0]) {
630
+ callback = cb[0]
631
+ }
632
+ s.whenConnected(func() {
633
+ if s.tap == nil || s.destroyed {
62
634
  return
63
635
  }
64
- s.connectEmitted = true
65
- s.socket = tnInfoSocket(conn.LocalAddr(), conn.RemoteAddr().String())
66
- s.socket.encrypted = s.encrypted
67
- s.emit("connect", s, s.socket)
636
+ // Never advertise more than the library itself can take: the peer
637
+ // would send frames it refuses
638
+ s.tap.mu.Lock()
639
+ for i := range list {
640
+ switch list[i].ID {
641
+ case http2.SettingInitialWindowSize:
642
+ list[i].Val = min(list[i].Val, s.tap.libWindow)
643
+ case http2.SettingMaxFrameSize:
644
+ list[i].Val = min(list[i].Val, s.tap.libFrame)
645
+ case http2.SettingHeaderTableSize:
646
+ list[i].Val = min(list[i].Val, s.tap.libTable)
647
+ }
648
+ }
649
+ s.tap.mu.Unlock()
650
+ frame := tnH2Frame(func(f *http2.Framer) error { return f.WriteSettings(list...) })
651
+ ack := &tnH2Ack{ours: true, settings: list, cb: callback, start: time.Now()}
652
+ if err := s.tap.send(frame, ack); err != nil {
653
+ e := TnNetError(err, "write", "", -1)
654
+ TnLoopPost(func() { s.destroy(e) })
655
+ }
68
656
  })
69
657
  }
70
658
 
659
+ // The peer acknowledged a SETTINGS frame of ours (or of the library's)
660
+ func (s *TnHttp2Session) settingsAcked(ack *tnH2Ack) {
661
+ if s.destroyed {
662
+ return
663
+ }
664
+ for _, e := range ack.settings {
665
+ s.local.apply(e.ID, e.Val)
666
+ }
667
+ current := s.local.object()
668
+ if ack.cb != nil {
669
+ TnInvoke(ack.cb, nil, current, float64(time.Since(ack.start))/float64(time.Millisecond))
670
+ }
671
+ s.emit("localSettings", current)
672
+ }
673
+
674
+ // session.ping([payload], callback): the callback runs on the peer's ACK with
675
+ // (err, duration in ms, payload); true when the PING was sent
676
+ func (s *TnHttp2Session) ping(args ...interface{}) bool {
677
+ s.checkLive()
678
+ var payload []byte
679
+ var callback interface{}
680
+ for _, a := range args {
681
+ if tnIsFunc(a) {
682
+ callback = a
683
+ } else if a != nil {
684
+ payload = TnBufferFrom(a, "")
685
+ }
686
+ }
687
+ if callback == nil {
688
+ panic(TnNodeError("TypeError", "ERR_INVALID_ARG_TYPE", "The \\"callback\\" argument must be of type function"))
689
+ }
690
+ if payload != nil && len(payload) != 8 {
691
+ panic(TnNodeError("RangeError", "ERR_HTTP2_PING_LENGTH", "HTTP2 ping payload must be 8 bytes"))
692
+ }
693
+ var data [8]byte
694
+ if payload != nil {
695
+ copy(data[:], payload)
696
+ } else {
697
+ cryptorand.Read(data[:])
698
+ }
699
+ s.whenConnected(func() {
700
+ if s.tap == nil || s.destroyed {
701
+ return
702
+ }
703
+ s.tap.mu.Lock()
704
+ s.tap.pings[data] = tnH2Ping{cb: callback, start: time.Now()}
705
+ s.tap.mu.Unlock()
706
+ frame := tnH2Frame(func(f *http2.Framer) error { return f.WritePing(false, data) })
707
+ if err := s.tap.send(frame, nil); err != nil {
708
+ e := TnNetError(err, "write", "", -1)
709
+ TnLoopPost(func() { TnInvoke(callback, e, float64(0), data[:]) })
710
+ }
711
+ })
712
+ return true
713
+ }
714
+
715
+ // session.goaway([code[, lastStreamID[, opaqueData]]]): a notification only,
716
+ // as in Node (the session stays usable)
717
+ func (s *TnHttp2Session) goaway(args ...interface{}) {
718
+ s.checkLive()
719
+ code := uint32(0)
720
+ lastStream := uint32(0)
721
+ var opaque []byte
722
+ if len(args) > 0 && args[0] != nil {
723
+ if n, ok := tnNetNumber(args[0]); ok {
724
+ code = uint32(n)
725
+ }
726
+ }
727
+ if len(args) > 1 && args[1] != nil {
728
+ if n, ok := tnNetNumber(args[1]); ok {
729
+ lastStream = uint32(n)
730
+ }
731
+ }
732
+ if len(args) > 2 && args[2] != nil {
733
+ opaque = TnBufferFrom(args[2], "")
734
+ }
735
+ s.whenConnected(func() {
736
+ if s.tap == nil || s.destroyed {
737
+ return
738
+ }
739
+ frame := tnH2Frame(func(f *http2.Framer) error { return f.WriteGoAway(lastStream, http2.ErrCode(code), opaque) })
740
+ s.tap.send(frame, nil)
741
+ })
742
+ }
743
+
744
+ // A GOAWAY from the peer: 'goaway', then a graceful close (NO_ERROR) or an
745
+ // error, as Node does
746
+ func (s *TnHttp2Session) goawayReceived(code float64, last float64, opaque []byte) {
747
+ if s.destroyed {
748
+ return
749
+ }
750
+ s.emit("goaway", code, last, opaque)
751
+ if code == 0 {
752
+ s.close()
753
+ } else {
754
+ s.destroy(TnNodeError("Error", "ERR_HTTP2_SESSION_ERROR", "Session closed with error code "+TnNumStr(code)))
755
+ }
756
+ }
757
+
758
+ // ServerHttp2Session.altsvc(alt, originOrStream): an ALTSVC frame for an
759
+ // origin (stream 0) or for one stream
760
+ func (s *TnHttp2Session) altsvc(alt string, originOrStream interface{}) {
761
+ s.checkLive()
762
+ origin := ""
763
+ streamID := uint32(0)
764
+ switch v := originOrStream.(type) {
765
+ case string:
766
+ origin = v
767
+ case interface{ Get_href() string }:
768
+ origin = v.Get_href()
769
+ default:
770
+ if n, ok := tnNetNumber(v); ok {
771
+ streamID = uint32(n)
772
+ }
773
+ }
774
+ if origin != "" {
775
+ u, err := tnurl.Parse(origin)
776
+ if err != nil || u.Scheme == "" || u.Host == "" {
777
+ panic(TnNodeError("TypeError", "ERR_INVALID_URL", "Invalid URL"))
778
+ }
779
+ origin = u.Scheme + "://" + u.Host
780
+ }
781
+ payload := make([]byte, 2, 2+len(origin)+len(alt))
782
+ binary.BigEndian.PutUint16(payload, uint16(len(origin)))
783
+ payload = append(payload, origin...)
784
+ payload = append(payload, alt...)
785
+ s.whenConnected(func() {
786
+ if s.tap == nil || s.destroyed {
787
+ return
788
+ }
789
+ frame := tnH2Frame(func(f *http2.Framer) error { return f.WriteRawFrame(http2.FrameType(tnH2FrameAltSvc), 0, streamID, payload) })
790
+ s.tap.send(frame, nil)
791
+ })
792
+ }
793
+
794
+ // Ends a closed session once its streams are done: the client shuts its
795
+ // connection down; the server sends GOAWAY and lets its handlers finish
71
796
  func (s *TnHttp2Session) maybeFinish() {
72
- if !s.closed || s.active > 0 || s.finished {
797
+ if !s.closed || s.finished {
798
+ return
799
+ }
800
+ if s.typ == 1 && s.active > 0 {
801
+ return
802
+ }
803
+ if s.typ == 0 && atomic.LoadInt32(&s.handlers) > 0 && !s.destroyed {
804
+ return
805
+ }
806
+ if s.connecting && !s.destroyed {
807
+ // closed before the connection is up: finish once it is
73
808
  return
74
809
  }
75
810
  s.finished = true
76
- if s.transport != nil {
77
- s.transport.CloseIdleConnections()
811
+ if s.cc != nil {
812
+ cc := s.cc
813
+ if s.destroyed {
814
+ cc.Close()
815
+ } else {
816
+ go func() {
817
+ cc.Shutdown(context.Background())
818
+ cc.Close()
819
+ }()
820
+ }
821
+ } else if s.conn != nil {
822
+ conn := s.conn
823
+ if s.destroyed {
824
+ conn.Close()
825
+ } else {
826
+ // The last handler has returned; give the library a moment to
827
+ // write the stream's final frames
828
+ if s.tap != nil {
829
+ last := atomic.LoadUint32(&s.tap.lastPeerStream)
830
+ s.tap.send(tnH2Frame(func(f *http2.Framer) error { return f.WriteGoAway(last, http2.ErrCodeNo, nil) }), nil)
831
+ }
832
+ time.AfterFunc(50*time.Millisecond, func() { conn.Close() })
833
+ }
834
+ }
835
+ if s.conn == nil && s.cc == nil {
836
+ // never connected: nothing else will report the close
837
+ s.unref()
838
+ TnLoopPost(func() { s.emit("close") })
839
+ }
840
+ }
841
+
842
+ // The connection is gone (its reader stopped): 'close', once
843
+ func (s *TnHttp2Session) connClosed() {
844
+ if s.closeEmitted {
845
+ return
78
846
  }
847
+ s.closeEmitted = true
848
+ s.closed = true
849
+ s.finished = true
79
850
  s.unref()
80
- TnLoopPost(func() { s.emit("close") })
851
+ for _, st := range s.pending {
852
+ st.destroy(TnNodeError("Error", "ERR_HTTP2_STREAM_CANCEL", "The pending stream has been canceled"))
853
+ }
854
+ s.pending = nil
855
+ s.emit("close")
81
856
  }
82
857
 
83
858
  // close(cb?): no new streams; 'close' once the open ones finish
@@ -100,6 +875,14 @@ func (s *TnHttp2Session) destroy(err ...interface{}) {
100
875
  TnLoopPost(func() { s.emit("error", e) })
101
876
  }
102
877
  s.active = 0
878
+ if s.finished {
879
+ // a graceful close is under way: cut it short
880
+ if s.cc != nil {
881
+ s.cc.Close()
882
+ } else if s.conn != nil {
883
+ s.conn.Close()
884
+ }
885
+ }
103
886
  s.maybeFinish()
104
887
  }
105
888
 
@@ -108,7 +891,8 @@ func (s *TnHttp2Session) streamDone() {
108
891
  s.maybeFinish()
109
892
  }
110
893
 
111
- // connect(authority, options?, listener?)
894
+ // connect(authority, options?, listener?): one connection per session, as in
895
+ // Node; x/net/http2's ClientConn runs the protocol over the session's tap
112
896
  func TnHttp2Connect(authority interface{}, args ...interface{}) *TnHttp2Session {
113
897
  var opts, listener interface{}
114
898
  for _, a := range args {
@@ -131,65 +915,114 @@ func TnHttp2Connect(authority interface{}, args ...interface{}) *TnHttp2Session
131
915
  if err != nil || u.Host == "" {
132
916
  panic(TnNodeError("TypeError", "ERR_INVALID_URL", "Invalid URL"))
133
917
  }
134
- s := &TnHttp2Session{origin: u.Scheme + "://" + u.Host}
135
- protocols := new(http.Protocols)
136
- t := &http.Transport{Proxy: nil, DisableCompression: true, IdleConnTimeout: 30 * time.Second}
918
+ s := tnNewHttp2Session(1)
919
+ s.origin = u.Scheme + "://" + u.Host
920
+ s.alpnProtocol = "h2c"
921
+ s.connecting = true
137
922
  port := u.Port()
923
+ host := u.Hostname()
924
+ var cfg *tls.Config
138
925
  if u.Scheme == "https" {
139
- cfg, err := tnTLSClientConfig(opts, u.Hostname(), nil)
926
+ cfg, err = tnTLSClientConfig(opts, host, nil)
140
927
  if err != nil {
141
928
  panic(err)
142
929
  }
143
- t.TLSClientConfig = cfg
144
- protocols.SetHTTP2(true)
930
+ cfg = cfg.Clone()
931
+ cfg.NextProtos = []string{"h2"}
145
932
  s.encrypted = true
146
933
  s.alpnProtocol = "h2"
147
934
  if port == "" {
148
935
  port = "443"
149
936
  }
150
- } else {
151
- protocols.SetUnencryptedHTTP2(true)
152
- s.alpnProtocol = "h2c"
153
- if port == "" {
154
- port = "80"
155
- }
156
- }
157
- t.Protocols = protocols
158
- s.transport = t
159
- s.client = &http.Client{Transport: t, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
160
- // The transport dials through here (https too, there is no custom DialTLS),
161
- // so 'connect' is posted before that request's response can be
162
- dialer := &net.Dialer{Timeout: 10 * time.Second}
163
- t.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
164
- conn, err := dialer.DialContext(ctx, network, addr)
165
- if err != nil {
166
- return nil, err
167
- }
168
- s.emitConnect(conn)
169
- return conn, nil
937
+ } else if port == "" {
938
+ port = "80"
170
939
  }
171
940
  if listener != nil {
172
941
  s.TnEventEmitter.once("connect", listener)
173
942
  }
174
943
  s.ref()
175
- host := u.Hostname()
944
+ TnLoopRef()
176
945
  go func() {
177
- conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, port), 10*time.Second)
946
+ dialer := &net.Dialer{Timeout: 10 * time.Second}
947
+ addr := net.JoinHostPort(host, port)
948
+ var conn net.Conn
949
+ var dialErr error
950
+ if cfg != nil {
951
+ conn, dialErr = tls.DialWithDialer(dialer, "tcp", addr, cfg)
952
+ if dialErr == nil {
953
+ if tc, ok := conn.(*tls.Conn); !ok || tc.ConnectionState().NegotiatedProtocol != "h2" {
954
+ conn.Close()
955
+ conn = nil
956
+ dialErr = fmt.Errorf("http2: the server did not negotiate h2")
957
+ }
958
+ }
959
+ } else {
960
+ conn, dialErr = dialer.Dial("tcp", addr)
961
+ }
962
+ var cc *http2.ClientConn
963
+ var tap *tnH2Tap
964
+ if dialErr == nil {
965
+ var tapped net.Conn
966
+ tap, tapped = tnNewH2Tap(conn, s, false)
967
+ transport := &http2.Transport{AllowHTTP: cfg == nil, TLSClientConfig: cfg, DisableCompression: true}
968
+ cc, dialErr = transport.NewClientConn(tapped)
969
+ if dialErr != nil {
970
+ conn.Close()
971
+ conn = nil
972
+ }
973
+ }
178
974
  TnLoopPost(func() {
179
- if err != nil {
180
- if s.connectEmitted || s.destroyed {
975
+ defer TnLoopUnref()
976
+ s.connecting = false
977
+ if dialErr != nil {
978
+ if s.destroyed {
181
979
  return
182
980
  }
183
- p, _ := strconv.ParseFloat(port, 64)
184
- target := host
185
- if ip := tnDialedIP(err); ip != "" {
186
- target = ip
981
+ // A verification failure is already a Node error (its code is
982
+ // DEPTH_ZERO_SELF_SIGNED_CERT & co.)
983
+ var e *TnError
984
+ if te := tnUnwrapTnError(dialErr); te != nil {
985
+ e = te
986
+ } else {
987
+ p, _ := strconv.ParseFloat(port, 64)
988
+ target := host
989
+ if ip := tnDialedIP(dialErr); ip != "" {
990
+ target = ip
991
+ }
992
+ e = TnNetError(dialErr, "connect", target, p)
993
+ }
994
+ cancel := TnNodeError("Error", "ERR_HTTP2_STREAM_CANCEL", "The pending stream has been canceled (caused by: "+e.message+")")
995
+ cancel.props["cause"] = e
996
+ for _, st := range s.pending {
997
+ st.destroy(cancel)
187
998
  }
188
- s.destroy(TnNetError(err, "connect", target, p))
999
+ s.pending = nil
1000
+ s.deferred = nil
1001
+ s.destroy(e)
189
1002
  return
190
1003
  }
191
- s.emitConnect(conn)
192
- conn.Close()
1004
+ s.cc = cc
1005
+ s.conn = conn
1006
+ s.tap = tap
1007
+ if s.destroyed {
1008
+ cc.Close()
1009
+ return
1010
+ }
1011
+ s.connectEmitted = true
1012
+ s.socket = tnInfoSocket(conn.LocalAddr(), conn.RemoteAddr().String())
1013
+ s.socket.encrypted = s.encrypted
1014
+ s.emit("connect", s, s.socket)
1015
+ deferred := s.deferred
1016
+ s.deferred = nil
1017
+ for _, fn := range deferred {
1018
+ fn()
1019
+ }
1020
+ pending := s.pending
1021
+ s.pending = nil
1022
+ for _, st := range pending {
1023
+ st.start()
1024
+ }
1025
+ s.maybeFinish()
193
1026
  })
194
1027
  }()
195
1028
  return s
@@ -379,7 +1212,15 @@ func (st *TnHttp2Stream) additionalHeaders(headers interface{}) {}
379
1212
 
380
1213
  // The server side: one stream per request
381
1214
  func tnHttp2ServeStream(hs *TnHttpServer, w http.ResponseWriter, r *http.Request) bool {
382
- if r.ProtoMajor != 2 || hs.listenerCount("stream") == 0 {
1215
+ if r.ProtoMajor != 2 {
1216
+ return false
1217
+ }
1218
+ sess, _ := r.Context().Value(tnH2SessionKey{}).(*TnHttp2Session)
1219
+ listening := false
1220
+ TnLoopCall(func() {
1221
+ listening = hs.listenerCount("stream") > 0 || (sess != nil && sess.listenerCount("stream") > 0)
1222
+ })
1223
+ if !listening {
383
1224
  return false
384
1225
  }
385
1226
  TnLoopRef()
@@ -398,11 +1239,19 @@ func tnHttp2ServeStream(hs *TnHttpServer, w http.ResponseWriter, r *http.Request
398
1239
  req.socket = tnInfoSocket(local, r.RemoteAddr)
399
1240
  st := tnNewHttp2Stream()
400
1241
  st.res = tnNewServerResponse(req)
401
- tnHttp2NextID += 2
402
- st.id = tnHttp2NextID
403
- st.session = &TnHttp2Session{socket: req.socket, encrypted: r.TLS != nil, alpnProtocol: "h2c"}
1242
+ st.session = sess
1243
+ if sess == nil {
1244
+ st.session = tnNewHttp2Session(0)
1245
+ st.session.socket = req.socket
1246
+ st.session.encrypted = r.TLS != nil
1247
+ }
1248
+ // client stream ids: 1, 3, 5... in the order the handlers start
1249
+ st.session.nextID += 2
1250
+ if st.session.nextID == 2 {
1251
+ st.session.nextID = 1
1252
+ }
1253
+ st.id = st.session.nextID
404
1254
  if r.TLS != nil {
405
- st.session.alpnProtocol = "h2"
406
1255
  req.socket.encrypted = true
407
1256
  }
408
1257
  st.sink = func(chunk interface{}, done func(err interface{})) {
@@ -438,7 +1287,11 @@ func tnHttp2ServeStream(hs *TnHttpServer, w http.ResponseWriter, r *http.Request
438
1287
  headers.Set(":path", r.RequestURI)
439
1288
  tnHttp2Headers(r.Header, headers)
440
1289
  created <- st
1290
+ // Node's server listens on each session first, then re-emits
441
1291
  hs.emit("stream", st, headers, float64(4))
1292
+ if sess != nil {
1293
+ sess.emit("stream", st, headers, float64(4))
1294
+ }
442
1295
  tnPumpHttp2(r.Body, &st.TnStream, func() { close(bodyDone) })
443
1296
  })
444
1297
  })
@@ -451,33 +1304,153 @@ func tnHttp2ServeStream(hs *TnHttpServer, w http.ResponseWriter, r *http.Request
451
1304
  return true
452
1305
  }
453
1306
 
454
- func init() { tnHttp2StreamHook = tnHttp2ServeStream }
1307
+ type tnH2SessionKey struct{}
1308
+
1309
+ // The x/net/http2 server of an http2 Server (configured onto its http.Server,
1310
+ // so http.Server.Shutdown sends GOAWAY on every connection), its live sessions
1311
+ type tnH2ServerState struct {
1312
+ srv *http2.Server
1313
+ allowHTTP1 bool
1314
+ mu sync.Mutex
1315
+ sessions map[*TnHttp2Session]struct{}
1316
+ }
1317
+
1318
+ var tnH2Servers sync.Map
1319
+
1320
+ func tnH2State(hs *TnHttpServer) *tnH2ServerState {
1321
+ v, _ := tnH2Servers.Load(hs)
1322
+ st, _ := v.(*tnH2ServerState)
1323
+ return st
1324
+ }
1325
+
1326
+ // Accepts the connections of an http2 server: each one is a session ('session'
1327
+ // before its first stream), served by x/net/http2 through a tap. With
1328
+ // allowHTTP1, a TLS connection that negotiated http/1.1 goes to node:http's server.
1329
+ func tnHttp2Serve(hs *TnHttpServer, ln net.Listener) {
1330
+ state := tnH2State(hs)
1331
+ local := ln.Addr()
1332
+ for {
1333
+ conn, err := ln.Accept()
1334
+ if err != nil {
1335
+ return
1336
+ }
1337
+ hs.connMu.Lock()
1338
+ if atomic.LoadInt32(&hs.closing) != 0 {
1339
+ hs.connMu.Unlock()
1340
+ conn.Close()
1341
+ return
1342
+ }
1343
+ hs.inFlight.Add(1)
1344
+ hs.connMu.Unlock()
1345
+ go func() {
1346
+ if tc, ok := conn.(*tls.Conn); ok {
1347
+ if err := tc.Handshake(); err != nil {
1348
+ conn.Close()
1349
+ hs.inFlight.Done()
1350
+ return
1351
+ }
1352
+ if tc.ConnectionState().NegotiatedProtocol != "h2" {
1353
+ if state != nil && state.allowHTTP1 {
1354
+ hc := &tnHttpConn{conn: conn, closed: make(chan struct{})}
1355
+ hs.connMu.Lock()
1356
+ hs.httpConns[hc] = struct{}{}
1357
+ hs.connMu.Unlock()
1358
+ // (serveConn marks inFlight done)
1359
+ hs.serveConn(hc, local)
1360
+ return
1361
+ }
1362
+ conn.Close()
1363
+ hs.inFlight.Done()
1364
+ return
1365
+ }
1366
+ }
1367
+ tnHttp2ServeSession(hs, state, conn)
1368
+ hs.inFlight.Done()
1369
+ }()
1370
+ }
1371
+ }
1372
+
1373
+ func tnHttp2ServeSession(hs *TnHttpServer, state *tnH2ServerState, conn net.Conn) {
1374
+ s := tnNewHttp2Session(0)
1375
+ s.conn = conn
1376
+ tap, tapped := tnNewH2Tap(conn, s, true)
1377
+ s.tap = tap
1378
+ if tc, ok := conn.(*tls.Conn); ok {
1379
+ s.encrypted = true
1380
+ s.alpnProtocol = tc.ConnectionState().NegotiatedProtocol
1381
+ } else {
1382
+ s.alpnProtocol = "h2c"
1383
+ }
1384
+ s.socket = tnInfoSocket(conn.LocalAddr(), conn.RemoteAddr().String())
1385
+ s.socket.encrypted = s.encrypted
1386
+ if state != nil {
1387
+ state.mu.Lock()
1388
+ state.sessions[s] = struct{}{}
1389
+ state.mu.Unlock()
1390
+ defer func() {
1391
+ state.mu.Lock()
1392
+ delete(state.sessions, s)
1393
+ state.mu.Unlock()
1394
+ }()
1395
+ }
1396
+ TnLoopCall(func() {
1397
+ TnAsyncRun(hs.asyncCtx, func() { hs.emit("session", s) })
1398
+ })
1399
+ handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
1400
+ atomic.AddInt32(&s.handlers, 1)
1401
+ defer func() {
1402
+ if atomic.AddInt32(&s.handlers, -1) == 0 {
1403
+ TnLoopPost(s.maybeFinish)
1404
+ }
1405
+ }()
1406
+ hs.ServeHTTP(w, r)
1407
+ })
1408
+ ctx := context.WithValue(context.Background(), tnH2SessionKey{}, s)
1409
+ srv := &http2.Server{}
1410
+ if state != nil {
1411
+ srv = state.srv
1412
+ }
1413
+ srv.ServeConn(tapped, &http2.ServeConnOpts{Context: ctx, Handler: handler})
1414
+ conn.Close()
1415
+ TnLoopPost(s.connClosed)
1416
+ }
1417
+
1418
+ func init() {
1419
+ tnHttp2StreamHook = tnHttp2ServeStream
1420
+ tnHttp2ServeHook = tnHttp2Serve
1421
+ tnHttp2CloseAllHook = func(hs *TnHttpServer) {
1422
+ if state := tnH2State(hs); state != nil {
1423
+ state.mu.Lock()
1424
+ for s := range state.sessions {
1425
+ s.conn.Close()
1426
+ }
1427
+ state.mu.Unlock()
1428
+ }
1429
+ }
1430
+ }
455
1431
 
456
1432
  // createServer(options?, onRequest?) / createSecureServer({ key, cert, allowHTTP1 }, onRequest?)
457
1433
  func TnHttp2CreateServer(secure bool, args ...interface{}) *TnHttpServer {
458
1434
  hs := TnNewHttpServer(secure, args...)
459
1435
  hs.h2 = true
460
- protocols := new(http.Protocols)
1436
+ state := &tnH2ServerState{srv: &http2.Server{}, sessions: map[*TnHttp2Session]struct{}{}}
461
1437
  if secure {
462
- protocols.SetHTTP2(true)
463
- allowHTTP1 := false
464
1438
  for _, a := range args {
465
1439
  if a != nil && !tnIsFunc(a) {
466
- allowHTTP1, _ = TnGetValue(a, "allowHTTP1").(bool)
1440
+ state.allowHTTP1, _ = TnGetValue(a, "allowHTTP1").(bool)
467
1441
  }
468
1442
  }
469
1443
  if hs.tlsConfig == nil {
470
1444
  hs.tlsConfig = &tls.Config{}
471
1445
  }
472
1446
  hs.tlsConfig.NextProtos = []string{"h2"}
473
- if allowHTTP1 {
474
- protocols.SetHTTP1(true)
1447
+ if state.allowHTTP1 {
475
1448
  hs.tlsConfig.NextProtos = append(hs.tlsConfig.NextProtos, "http/1.1")
476
1449
  }
477
- } else {
478
- protocols.SetUnencryptedHTTP2(true)
479
1450
  }
480
- hs.httpServer.Protocols = protocols
1451
+ // ServeConn then serves through hs.httpServer, whose Shutdown reaches every connection
1452
+ http2.ConfigureServer(hs.httpServer, state.srv)
1453
+ tnH2Servers.Store(hs, state)
481
1454
  return hs
482
1455
  }
483
1456
 
@@ -537,8 +1510,13 @@ func (st *TnHttp2Stream) start() {
537
1510
  if st.started {
538
1511
  return
539
1512
  }
540
- st.started = true
541
1513
  s := st.session
1514
+ if s.cc == nil {
1515
+ // the session is still dialing: start once 'connect' fires
1516
+ s.pending = append(s.pending, st)
1517
+ return
1518
+ }
1519
+ st.started = true
542
1520
  var body io.Reader
543
1521
  if len(st.body) > 0 {
544
1522
  body = bytes.NewReader(st.body)
@@ -557,7 +1535,7 @@ func (st *TnHttp2Stream) start() {
557
1535
  }
558
1536
  TnLoopRef()
559
1537
  go func() {
560
- resp, err := s.client.Do(req)
1538
+ resp, err := s.cc.RoundTrip(req)
561
1539
  TnLoopPost(func() {
562
1540
  defer TnLoopUnref()
563
1541
  if err != nil {
@@ -601,9 +1579,64 @@ func TnHttp2DefaultSettings() map[string]interface{} {
601
1579
  "initialWindowSize": float64(65535),
602
1580
  "maxFrameSize": float64(16384),
603
1581
  "maxConcurrentStreams": float64(4294967295),
1582
+ "maxHeaderSize": float64(65535),
604
1583
  "maxHeaderListSize": float64(65535),
605
1584
  "enableConnectProtocol": false,
606
1585
  }
1586
+ }
1587
+
1588
+ // http2.getPackedSettings(settings?): the SETTINGS payload, six bytes each,
1589
+ // ordered by setting id as Node does
1590
+ func TnHttp2GetPackedSettings(settings interface{}) []byte {
1591
+ entries, _, err := tnHttp2Settings(settings)
1592
+ if err != nil {
1593
+ panic(err)
1594
+ }
1595
+ sort.Slice(entries, func(i, j int) bool { return entries[i].ID < entries[j].ID })
1596
+ buf := make([]byte, 0, len(entries)*6)
1597
+ for _, e := range entries {
1598
+ var b [6]byte
1599
+ binary.BigEndian.PutUint16(b[0:2], uint16(e.ID))
1600
+ binary.BigEndian.PutUint32(b[2:6], e.Val)
1601
+ buf = append(buf, b[:]...)
1602
+ }
1603
+ return buf
1604
+ }
1605
+
1606
+ // http2.getUnpackedSettings(buf): unknown ids land in customSettings
1607
+ func TnHttp2GetUnpackedSettings(b []byte) map[string]interface{} {
1608
+ if len(b)%6 != 0 {
1609
+ panic(TnNodeError("RangeError", "ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH", "Packed settings length must be a multiple of six"))
1610
+ }
1611
+ out := map[string]interface{}{}
1612
+ custom := map[string]interface{}{}
1613
+ for i := 0; i+6 <= len(b); i += 6 {
1614
+ id := http2.SettingID(binary.BigEndian.Uint16(b[i : i+2]))
1615
+ val := binary.BigEndian.Uint32(b[i+2 : i+6])
1616
+ switch id {
1617
+ case http2.SettingHeaderTableSize:
1618
+ out["headerTableSize"] = float64(val)
1619
+ case http2.SettingEnablePush:
1620
+ out["enablePush"] = val == 1
1621
+ case http2.SettingMaxConcurrentStreams:
1622
+ out["maxConcurrentStreams"] = float64(val)
1623
+ case http2.SettingInitialWindowSize:
1624
+ out["initialWindowSize"] = float64(val)
1625
+ case http2.SettingMaxFrameSize:
1626
+ out["maxFrameSize"] = float64(val)
1627
+ case http2.SettingMaxHeaderListSize:
1628
+ out["maxHeaderSize"] = float64(val)
1629
+ out["maxHeaderListSize"] = float64(val)
1630
+ case http2.SettingEnableConnectProtocol:
1631
+ out["enableConnectProtocol"] = val == 1
1632
+ default:
1633
+ custom[strconv.Itoa(int(id))] = float64(val)
1634
+ }
1635
+ }
1636
+ if len(custom) > 0 {
1637
+ out["customSettings"] = custom
1638
+ }
1639
+ return out
607
1640
  }`;
608
1641
  const HTTP2_CONSTANTS = {
609
1642
  HTTP2_HEADER_STATUS: ':status',
@@ -647,12 +1680,12 @@ const HTTP2_NUMBERS = {
647
1680
  };
648
1681
  export function registerHttp2(r) {
649
1682
  defineModule(r, 'http2');
650
- defineHelper(r, 'nodeHttp2', ['bytes', 'context', 'crypto/tls', 'fmt', 'io', 'net', 'net/http', 'net/url', 'os', 'sort', 'strconv', 'strings', 'time'], ['nodeHttp', 'nodeNet', 'netErrors', 'nodeStream', 'nodeEvents', 'eventLoop', 'nodeInvoke', 'dynamic', 'orderedMap', 'tlsConfig', 'fsErrors'], http2Helper);
1683
+ defineHelper(r, 'nodeHttp2', ['bytes', 'context', 'crypto/rand', 'crypto/tls', 'encoding/binary', 'fmt', 'golang.org/x/net/http2', 'io', 'math', 'net', 'net/http', 'net/url', 'os', 'sort', 'strconv', 'strings', 'sync', 'sync/atomic', 'time'], ['nodeHttp', 'nodeNet', 'netErrors', 'nodeStream', 'nodeEvents', 'eventLoop', 'nodeInvoke', 'dynamic', 'orderedMap', 'tlsConfig', 'fsErrors', 'buffer'], http2Helper);
651
1684
  const use = () => r.helper('nodeHttp2');
652
1685
  defineClass(r, 'http2.Http2Stream', '*TnHttp2Stream', 'class', STREAM_METHODS + '; respond=; respondWithFile=; close=; pushStream=; additionalHeaders=', '', STREAM_GETTERS + '; id=float64; session=*TnHttp2Session; sentHeaders=*TnMap[string, interface{}]; headersSent=bool; pushAllowed=bool; endAfterHeaders=bool; rstCode=float64; aborted=bool', '');
653
1686
  for (const name of ['ServerHttp2Stream', 'ClientHttp2Stream'])
654
1687
  r.classes[`http2.${name}`] = r.classes['http2.Http2Stream'];
655
- defineClass(r, 'http2.Http2Session', '*TnHttp2Session', 'class', 'on=*TnEventEmitter; once=*TnEventEmitter; off=*TnEventEmitter; removeListener=*TnEventEmitter; emit=bool; request=*TnHttp2Stream; close=; destroy=; ref=*TnHttp2Session; unref=*TnHttp2Session; setTimeout=*TnHttp2Session', '', 'closed=bool; destroyed=bool; encrypted=bool; alpnProtocol=string; socket=*TnSocket', '');
1688
+ defineClass(r, 'http2.Http2Session', '*TnHttp2Session', 'class', 'on=*TnEventEmitter; once=*TnEventEmitter; off=*TnEventEmitter; removeListener=*TnEventEmitter; emit=bool; request=*TnHttp2Stream; close=; destroy=; ref=*TnHttp2Session; unref=*TnHttp2Session; setTimeout=*TnHttp2Session; ping=bool; settings=; goaway=; altsvc=', '', 'closed=bool; destroyed=bool; encrypted=bool; alpnProtocol=string; socket=*TnSocket; type=float64; connecting=bool; localSettings=interface{}; remoteSettings=interface{}; pendingSettingsAck=bool', '');
656
1689
  for (const name of ['ServerHttp2Session', 'ClientHttp2Session'])
657
1690
  r.classes[`http2.${name}`] = r.classes['http2.Http2Session'];
658
1691
  for (const name of ['Http2Server', 'Http2SecureServer'])
@@ -678,12 +1711,24 @@ export function registerHttp2(r) {
678
1711
  const name = event && event.kind === 'StringLiteral' ? String(event.text) : '';
679
1712
  if (name === 'connect')
680
1713
  return ['*TnHttp2Session', '*TnSocket'];
1714
+ if (name === 'stream')
1715
+ return ['*TnHttp2Stream', '*TnMap[string, interface{}]', 'float64'];
1716
+ if (name === 'ping')
1717
+ return ['[]byte'];
1718
+ if (name === 'goaway')
1719
+ return ['float64', 'float64', '[]byte'];
1720
+ if (name === 'altsvc')
1721
+ return ['string', 'string', 'float64'];
1722
+ if (name === 'localSettings' || name === 'remoteSettings')
1723
+ return ['interface{}'];
681
1724
  if (name === 'error')
682
1725
  return ['interface{}'];
683
1726
  return [];
684
1727
  };
685
1728
  r.paramTypers['http2.Http2Session#on'] = sessionListeners;
686
1729
  r.paramTypers['http2.Http2Session#once'] = sessionListeners;
1730
+ r.paramTypers['http2.Http2Session#ping'] = (_n) => ['interface{}', 'float64', '[]byte'];
1731
+ r.paramTypers['http2.Http2Session#settings'] = (_n) => ['interface{}', 'interface{}'];
687
1732
  r.functions['http2.createServer'] = (c) => {
688
1733
  use();
689
1734
  return `TnHttp2CreateServer(false${c.args.length > 0 ? ', ' : ''}${c.args.join(', ')})`;
@@ -703,7 +1748,15 @@ export function registerHttp2(r) {
703
1748
  use();
704
1749
  return 'TnHttp2DefaultSettings()';
705
1750
  };
706
- setResults(r, 'http2', 'createServer=*TnHttpServer; createSecureServer=*TnHttpServer; connect=*TnHttp2Session; getDefaultSettings=map[string]interface{}');
1751
+ r.functions['http2.getPackedSettings'] = (c) => {
1752
+ use();
1753
+ return `TnHttp2GetPackedSettings(${c.args.join(', ')})`;
1754
+ };
1755
+ r.functions['http2.getUnpackedSettings'] = (c) => {
1756
+ use();
1757
+ return `TnHttp2GetUnpackedSettings(${c.args.join(', ')})`;
1758
+ };
1759
+ setResults(r, 'http2', 'createServer=*TnHttpServer; createSecureServer=*TnHttpServer; connect=*TnHttp2Session; getDefaultSettings=interface{}; getPackedSettings=[]byte; getUnpackedSettings=interface{}');
707
1760
  r.objects['http2.constants'] = true;
708
1761
  for (const name of Object.keys(HTTP2_CONSTANTS)) {
709
1762
  const text = HTTP2_CONSTANTS[name];