@capsule-run/sdk 0.8.3 → 0.8.5

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 (321) hide show
  1. package/dist/polyfills/unenv-runtime/_internal/types.d.mts +5 -0
  2. package/dist/polyfills/unenv-runtime/_internal/types.mjs +1 -0
  3. package/dist/polyfills/unenv-runtime/_internal/utils.d.mts +14 -0
  4. package/dist/polyfills/unenv-runtime/_internal/utils.mjs +49 -0
  5. package/dist/polyfills/unenv-runtime/mock/empty.d.mts +2 -0
  6. package/dist/polyfills/unenv-runtime/mock/empty.mjs +1 -0
  7. package/dist/polyfills/unenv-runtime/mock/noop.d.mts +2 -0
  8. package/dist/polyfills/unenv-runtime/mock/noop.mjs +1 -0
  9. package/dist/polyfills/unenv-runtime/mock/proxy.d.mts +2 -0
  10. package/dist/polyfills/unenv-runtime/mock/proxy.mjs +43 -0
  11. package/dist/polyfills/unenv-runtime/node/assert/strict.d.mts +4 -0
  12. package/dist/polyfills/unenv-runtime/node/assert/strict.mjs +25 -0
  13. package/dist/polyfills/unenv-runtime/node/assert.d.mts +165 -0
  14. package/dist/polyfills/unenv-runtime/node/assert.mjs +737 -0
  15. package/dist/polyfills/unenv-runtime/node/async_hooks.d.mts +5 -0
  16. package/dist/polyfills/unenv-runtime/node/async_hooks.mjs +15 -0
  17. package/dist/polyfills/unenv-runtime/node/buffer.d.mts +19 -0
  18. package/dist/polyfills/unenv-runtime/node/buffer.mjs +35 -0
  19. package/dist/polyfills/unenv-runtime/node/child_process.d.mts +12 -0
  20. package/dist/polyfills/unenv-runtime/node/child_process.mjs +21 -0
  21. package/dist/polyfills/unenv-runtime/node/cluster.d.mts +33 -0
  22. package/dist/polyfills/unenv-runtime/node/cluster.mjs +71 -0
  23. package/dist/polyfills/unenv-runtime/node/console.d.mts +38 -0
  24. package/dist/polyfills/unenv-runtime/node/console.mjs +74 -0
  25. package/dist/polyfills/unenv-runtime/node/constants.d.mts +13 -0
  26. package/dist/polyfills/unenv-runtime/node/constants.mjs +254 -0
  27. package/dist/polyfills/unenv-runtime/node/crypto.d.mts +6 -0
  28. package/dist/polyfills/unenv-runtime/node/crypto.mjs +138 -0
  29. package/dist/polyfills/unenv-runtime/node/dgram.d.mts +6 -0
  30. package/dist/polyfills/unenv-runtime/node/dgram.mjs +12 -0
  31. package/dist/polyfills/unenv-runtime/node/diagnostics_channel.d.mts +11 -0
  32. package/dist/polyfills/unenv-runtime/node/diagnostics_channel.mjs +34 -0
  33. package/dist/polyfills/unenv-runtime/node/dns/promises.d.mts +27 -0
  34. package/dist/polyfills/unenv-runtime/node/dns/promises.mjs +75 -0
  35. package/dist/polyfills/unenv-runtime/node/dns.d.mts +29 -0
  36. package/dist/polyfills/unenv-runtime/node/dns.mjs +81 -0
  37. package/dist/polyfills/unenv-runtime/node/domain.d.mts +8 -0
  38. package/dist/polyfills/unenv-runtime/node/domain.mjs +16 -0
  39. package/dist/polyfills/unenv-runtime/node/events.d.mts +13 -0
  40. package/dist/polyfills/unenv-runtime/node/events.mjs +12 -0
  41. package/dist/polyfills/unenv-runtime/node/fs/promises.d.mts +7 -0
  42. package/dist/polyfills/unenv-runtime/node/fs/promises.mjs +38 -0
  43. package/dist/polyfills/unenv-runtime/node/fs.d.mts +10 -0
  44. package/dist/polyfills/unenv-runtime/node/fs.mjs +117 -0
  45. package/dist/polyfills/unenv-runtime/node/http.d.mts +23 -0
  46. package/dist/polyfills/unenv-runtime/node/http.mjs +45 -0
  47. package/dist/polyfills/unenv-runtime/node/http2.d.mts +15 -0
  48. package/dist/polyfills/unenv-runtime/node/http2.mjs +284 -0
  49. package/dist/polyfills/unenv-runtime/node/https.d.mts +10 -0
  50. package/dist/polyfills/unenv-runtime/node/https.mjs +16 -0
  51. package/dist/polyfills/unenv-runtime/node/inspector/promises.d.mts +10 -0
  52. package/dist/polyfills/unenv-runtime/node/inspector/promises.mjs +40 -0
  53. package/dist/polyfills/unenv-runtime/node/inspector.d.mts +12 -0
  54. package/dist/polyfills/unenv-runtime/node/inspector.mjs +53 -0
  55. package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-hook.d.mts +7 -0
  56. package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-hook.mjs +115 -0
  57. package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-local-storage.d.mts +2 -0
  58. package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-local-storage.mjs +36 -0
  59. package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-resource.d.mts +2 -0
  60. package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-resource.mjs +37 -0
  61. package/dist/polyfills/unenv-runtime/node/internal/buffer/base64.d.mts +4 -0
  62. package/dist/polyfills/unenv-runtime/node/internal/buffer/base64.mjs +97 -0
  63. package/dist/polyfills/unenv-runtime/node/internal/buffer/buffer.d.mts +13 -0
  64. package/dist/polyfills/unenv-runtime/node/internal/buffer/buffer.mjs +1846 -0
  65. package/dist/polyfills/unenv-runtime/node/internal/buffer/file.d.mts +14 -0
  66. package/dist/polyfills/unenv-runtime/node/internal/buffer/file.mjs +26 -0
  67. package/dist/polyfills/unenv-runtime/node/internal/buffer/ieee754.d.mts +4 -0
  68. package/dist/polyfills/unenv-runtime/node/internal/buffer/ieee754.mjs +89 -0
  69. package/dist/polyfills/unenv-runtime/node/internal/crypto/constants.d.mts +58 -0
  70. package/dist/polyfills/unenv-runtime/node/internal/crypto/constants.mjs +58 -0
  71. package/dist/polyfills/unenv-runtime/node/internal/crypto/node.d.mts +78 -0
  72. package/dist/polyfills/unenv-runtime/node/internal/crypto/node.mjs +110 -0
  73. package/dist/polyfills/unenv-runtime/node/internal/crypto/web.d.mts +5 -0
  74. package/dist/polyfills/unenv-runtime/node/internal/crypto/web.mjs +9 -0
  75. package/dist/polyfills/unenv-runtime/node/internal/dgram/socket.d.mts +31 -0
  76. package/dist/polyfills/unenv-runtime/node/internal/dgram/socket.mjs +61 -0
  77. package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/channel.d.mts +18 -0
  78. package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/channel.mjs +40 -0
  79. package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/tracing-channel.d.mts +19 -0
  80. package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/tracing-channel.mjs +48 -0
  81. package/dist/polyfills/unenv-runtime/node/internal/dns/constants.d.mts +28 -0
  82. package/dist/polyfills/unenv-runtime/node/internal/dns/constants.mjs +28 -0
  83. package/dist/polyfills/unenv-runtime/node/internal/domain/domain.d.mts +13 -0
  84. package/dist/polyfills/unenv-runtime/node/internal/domain/domain.mjs +19 -0
  85. package/dist/polyfills/unenv-runtime/node/internal/events/events.d.mts +207 -0
  86. package/dist/polyfills/unenv-runtime/node/internal/events/events.mjs +1097 -0
  87. package/dist/polyfills/unenv-runtime/node/internal/fs/classes.d.mts +8 -0
  88. package/dist/polyfills/unenv-runtime/node/internal/fs/classes.mjs +8 -0
  89. package/dist/polyfills/unenv-runtime/node/internal/fs/constants.d.mts +59 -0
  90. package/dist/polyfills/unenv-runtime/node/internal/fs/constants.mjs +59 -0
  91. package/dist/polyfills/unenv-runtime/node/internal/fs/fs.d.mts +96 -0
  92. package/dist/polyfills/unenv-runtime/node/internal/fs/fs.mjs +106 -0
  93. package/dist/polyfills/unenv-runtime/node/internal/fs/promises.d.mts +32 -0
  94. package/dist/polyfills/unenv-runtime/node/internal/fs/promises.mjs +32 -0
  95. package/dist/polyfills/unenv-runtime/node/internal/http/agent.d.mts +14 -0
  96. package/dist/polyfills/unenv-runtime/node/internal/http/agent.mjs +16 -0
  97. package/dist/polyfills/unenv-runtime/node/internal/http/constants.d.mts +67 -0
  98. package/dist/polyfills/unenv-runtime/node/internal/http/constants.mjs +103 -0
  99. package/dist/polyfills/unenv-runtime/node/internal/http/request.d.mts +31 -0
  100. package/dist/polyfills/unenv-runtime/node/internal/http/request.mjs +53 -0
  101. package/dist/polyfills/unenv-runtime/node/internal/http/response.d.mts +42 -0
  102. package/dist/polyfills/unenv-runtime/node/internal/http/response.mjs +101 -0
  103. package/dist/polyfills/unenv-runtime/node/internal/http2/constants.d.mts +241 -0
  104. package/dist/polyfills/unenv-runtime/node/internal/http2/constants.mjs +241 -0
  105. package/dist/polyfills/unenv-runtime/node/internal/net/server.d.mts +17 -0
  106. package/dist/polyfills/unenv-runtime/node/internal/net/server.mjs +33 -0
  107. package/dist/polyfills/unenv-runtime/node/internal/net/socket.d.mts +45 -0
  108. package/dist/polyfills/unenv-runtime/node/internal/net/socket.mjs +83 -0
  109. package/dist/polyfills/unenv-runtime/node/internal/os/constants.d.mts +133 -0
  110. package/dist/polyfills/unenv-runtime/node/internal/os/constants.mjs +133 -0
  111. package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/constants.d.mts +25 -0
  112. package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/constants.mjs +25 -0
  113. package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/histogram.d.mts +28 -0
  114. package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/histogram.mjs +43 -0
  115. package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/performance.d.mts +103 -0
  116. package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/performance.mjs +232 -0
  117. package/dist/polyfills/unenv-runtime/node/internal/process/env.d.mts +1 -0
  118. package/dist/polyfills/unenv-runtime/node/internal/process/env.mjs +40 -0
  119. package/dist/polyfills/unenv-runtime/node/internal/process/hrtime.d.mts +2 -0
  120. package/dist/polyfills/unenv-runtime/node/internal/process/hrtime.mjs +21 -0
  121. package/dist/polyfills/unenv-runtime/node/internal/process/nexttick.d.mts +3 -0
  122. package/dist/polyfills/unenv-runtime/node/internal/process/nexttick.mjs +55 -0
  123. package/dist/polyfills/unenv-runtime/node/internal/process/node-version.d.mts +2 -0
  124. package/dist/polyfills/unenv-runtime/node/internal/process/node-version.mjs +2 -0
  125. package/dist/polyfills/unenv-runtime/node/internal/process/process.d.mts +113 -0
  126. package/dist/polyfills/unenv-runtime/node/internal/process/process.mjs +238 -0
  127. package/dist/polyfills/unenv-runtime/node/internal/punycode/punycode.d.mts +59 -0
  128. package/dist/polyfills/unenv-runtime/node/internal/punycode/punycode.mjs +410 -0
  129. package/dist/polyfills/unenv-runtime/node/internal/querystring/querystring.d.mts +11 -0
  130. package/dist/polyfills/unenv-runtime/node/internal/querystring/querystring.mjs +320 -0
  131. package/dist/polyfills/unenv-runtime/node/internal/readline/interface.d.mts +20 -0
  132. package/dist/polyfills/unenv-runtime/node/internal/readline/interface.mjs +31 -0
  133. package/dist/polyfills/unenv-runtime/node/internal/readline/promises/interface.d.mts +7 -0
  134. package/dist/polyfills/unenv-runtime/node/internal/readline/promises/interface.mjs +6 -0
  135. package/dist/polyfills/unenv-runtime/node/internal/readline/promises/readline.d.mts +10 -0
  136. package/dist/polyfills/unenv-runtime/node/internal/readline/promises/readline.mjs +20 -0
  137. package/dist/polyfills/unenv-runtime/node/internal/stream/duplex.d.mts +3 -0
  138. package/dist/polyfills/unenv-runtime/node/internal/stream/duplex.mjs +19 -0
  139. package/dist/polyfills/unenv-runtime/node/internal/stream/readable.d.mts +67 -0
  140. package/dist/polyfills/unenv-runtime/node/internal/stream/readable.mjs +112 -0
  141. package/dist/polyfills/unenv-runtime/node/internal/stream/transform.d.mts +10 -0
  142. package/dist/polyfills/unenv-runtime/node/internal/stream/transform.mjs +9 -0
  143. package/dist/polyfills/unenv-runtime/node/internal/stream/writable.d.mts +2 -0
  144. package/dist/polyfills/unenv-runtime/node/internal/stream/writable.mjs +87 -0
  145. package/dist/polyfills/unenv-runtime/node/internal/timers/immediate.d.mts +9 -0
  146. package/dist/polyfills/unenv-runtime/node/internal/timers/immediate.mjs +28 -0
  147. package/dist/polyfills/unenv-runtime/node/internal/timers/scheduler.d.mts +6 -0
  148. package/dist/polyfills/unenv-runtime/node/internal/timers/scheduler.mjs +10 -0
  149. package/dist/polyfills/unenv-runtime/node/internal/timers/set-immediate.d.mts +3 -0
  150. package/dist/polyfills/unenv-runtime/node/internal/timers/set-immediate.mjs +13 -0
  151. package/dist/polyfills/unenv-runtime/node/internal/timers/set-interval.d.mts +2 -0
  152. package/dist/polyfills/unenv-runtime/node/internal/timers/set-interval.mjs +8 -0
  153. package/dist/polyfills/unenv-runtime/node/internal/timers/set-timeout.d.mts +3 -0
  154. package/dist/polyfills/unenv-runtime/node/internal/timers/set-timeout.mjs +11 -0
  155. package/dist/polyfills/unenv-runtime/node/internal/timers/timeout.d.mts +11 -0
  156. package/dist/polyfills/unenv-runtime/node/internal/timers/timeout.mjs +30 -0
  157. package/dist/polyfills/unenv-runtime/node/internal/tls/constants.d.mts +7 -0
  158. package/dist/polyfills/unenv-runtime/node/internal/tls/constants.mjs +7 -0
  159. package/dist/polyfills/unenv-runtime/node/internal/tls/secure-context.d.mts +4 -0
  160. package/dist/polyfills/unenv-runtime/node/internal/tls/secure-context.mjs +3 -0
  161. package/dist/polyfills/unenv-runtime/node/internal/tls/server.d.mts +9 -0
  162. package/dist/polyfills/unenv-runtime/node/internal/tls/server.mjs +15 -0
  163. package/dist/polyfills/unenv-runtime/node/internal/tls/tls-socket.d.mts +31 -0
  164. package/dist/polyfills/unenv-runtime/node/internal/tls/tls-socket.mjs +48 -0
  165. package/dist/polyfills/unenv-runtime/node/internal/trace_events/tracing.d.mts +7 -0
  166. package/dist/polyfills/unenv-runtime/node/internal/trace_events/tracing.mjs +10 -0
  167. package/dist/polyfills/unenv-runtime/node/internal/tty/read-stream.d.mts +8 -0
  168. package/dist/polyfills/unenv-runtime/node/internal/tty/read-stream.mjs +12 -0
  169. package/dist/polyfills/unenv-runtime/node/internal/tty/write-stream.d.mts +20 -0
  170. package/dist/polyfills/unenv-runtime/node/internal/tty/write-stream.mjs +44 -0
  171. package/dist/polyfills/unenv-runtime/node/internal/url/constants.d.mts +44 -0
  172. package/dist/polyfills/unenv-runtime/node/internal/url/constants.mjs +44 -0
  173. package/dist/polyfills/unenv-runtime/node/internal/url/errors.d.mts +26 -0
  174. package/dist/polyfills/unenv-runtime/node/internal/url/errors.mjs +54 -0
  175. package/dist/polyfills/unenv-runtime/node/internal/url/url.d.mts +22 -0
  176. package/dist/polyfills/unenv-runtime/node/internal/url/url.mjs +181 -0
  177. package/dist/polyfills/unenv-runtime/node/internal/url/util.d.mts +4 -0
  178. package/dist/polyfills/unenv-runtime/node/internal/url/util.mjs +7 -0
  179. package/dist/polyfills/unenv-runtime/node/internal/util/inherits.d.mts +1 -0
  180. package/dist/polyfills/unenv-runtime/node/internal/util/inherits.mjs +12 -0
  181. package/dist/polyfills/unenv-runtime/node/internal/util/legacy-types.d.mts +19 -0
  182. package/dist/polyfills/unenv-runtime/node/internal/util/legacy-types.mjs +25 -0
  183. package/dist/polyfills/unenv-runtime/node/internal/util/log.d.mts +8 -0
  184. package/dist/polyfills/unenv-runtime/node/internal/util/log.mjs +55 -0
  185. package/dist/polyfills/unenv-runtime/node/internal/util/mime.d.mts +19 -0
  186. package/dist/polyfills/unenv-runtime/node/internal/util/mime.mjs +35 -0
  187. package/dist/polyfills/unenv-runtime/node/internal/util/promisify.d.mts +3 -0
  188. package/dist/polyfills/unenv-runtime/node/internal/util/promisify.mjs +23 -0
  189. package/dist/polyfills/unenv-runtime/node/internal/util/types.d.mts +45 -0
  190. package/dist/polyfills/unenv-runtime/node/internal/util/types.mjs +45 -0
  191. package/dist/polyfills/unenv-runtime/node/internal/v8/deserializer.d.mts +12 -0
  192. package/dist/polyfills/unenv-runtime/node/internal/v8/deserializer.mjs +23 -0
  193. package/dist/polyfills/unenv-runtime/node/internal/v8/profiler.d.mts +10 -0
  194. package/dist/polyfills/unenv-runtime/node/internal/v8/profiler.mjs +11 -0
  195. package/dist/polyfills/unenv-runtime/node/internal/v8/serializer.d.mts +12 -0
  196. package/dist/polyfills/unenv-runtime/node/internal/v8/serializer.mjs +15 -0
  197. package/dist/polyfills/unenv-runtime/node/internal/vm/constants.d.mts +2 -0
  198. package/dist/polyfills/unenv-runtime/node/internal/vm/constants.mjs +2 -0
  199. package/dist/polyfills/unenv-runtime/node/internal/vm/script.d.mts +7 -0
  200. package/dist/polyfills/unenv-runtime/node/internal/vm/script.mjs +15 -0
  201. package/dist/polyfills/unenv-runtime/node/internal/worker_threads/broadcast-channel.d.mts +10 -0
  202. package/dist/polyfills/unenv-runtime/node/internal/worker_threads/broadcast-channel.mjs +13 -0
  203. package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-channel.d.mts +5 -0
  204. package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-channel.mjs +5 -0
  205. package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-port.d.mts +12 -0
  206. package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-port.mjs +17 -0
  207. package/dist/polyfills/unenv-runtime/node/internal/worker_threads/worker.d.mts +21 -0
  208. package/dist/polyfills/unenv-runtime/node/internal/worker_threads/worker.mjs +25 -0
  209. package/dist/polyfills/unenv-runtime/node/internal/zlib/codes.d.mts +21 -0
  210. package/dist/polyfills/unenv-runtime/node/internal/zlib/codes.mjs +21 -0
  211. package/dist/polyfills/unenv-runtime/node/internal/zlib/constants.d.mts +108 -0
  212. package/dist/polyfills/unenv-runtime/node/internal/zlib/constants.mjs +108 -0
  213. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/_shared.d.mts +22 -0
  214. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/_shared.mjs +40 -0
  215. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/brotli.d.mts +16 -0
  216. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/brotli.mjs +16 -0
  217. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/deflate.d.mts +29 -0
  218. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/deflate.mjs +36 -0
  219. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/gzip.d.mts +16 -0
  220. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/gzip.mjs +16 -0
  221. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/zip.d.mts +9 -0
  222. package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/zip.mjs +9 -0
  223. package/dist/polyfills/unenv-runtime/node/module.d.mts +54 -0
  224. package/dist/polyfills/unenv-runtime/node/module.mjs +191 -0
  225. package/dist/polyfills/unenv-runtime/node/net.d.mts +22 -0
  226. package/dist/polyfills/unenv-runtime/node/net.mjs +52 -0
  227. package/dist/polyfills/unenv-runtime/node/os.d.mts +26 -0
  228. package/dist/polyfills/unenv-runtime/node/os.mjs +118 -0
  229. package/dist/polyfills/unenv-runtime/node/path/posix.d.mts +2 -0
  230. package/dist/polyfills/unenv-runtime/node/path/posix.mjs +2 -0
  231. package/dist/polyfills/unenv-runtime/node/path/win32.d.mts +2 -0
  232. package/dist/polyfills/unenv-runtime/node/path/win32.mjs +2 -0
  233. package/dist/polyfills/unenv-runtime/node/path.d.mts +12 -0
  234. package/dist/polyfills/unenv-runtime/node/path.mjs +31 -0
  235. package/dist/polyfills/unenv-runtime/node/perf_hooks.d.mts +8 -0
  236. package/dist/polyfills/unenv-runtime/node/perf_hooks.mjs +51 -0
  237. package/dist/polyfills/unenv-runtime/node/process.d.mts +3 -0
  238. package/dist/polyfills/unenv-runtime/node/process.mjs +12 -0
  239. package/dist/polyfills/unenv-runtime/node/punycode.d.mts +3 -0
  240. package/dist/polyfills/unenv-runtime/node/punycode.mjs +3 -0
  241. package/dist/polyfills/unenv-runtime/node/querystring.d.mts +49 -0
  242. package/dist/polyfills/unenv-runtime/node/querystring.mjs +766 -0
  243. package/dist/polyfills/unenv-runtime/node/readline/promises.d.mts +6 -0
  244. package/dist/polyfills/unenv-runtime/node/readline/promises.mjs +10 -0
  245. package/dist/polyfills/unenv-runtime/node/readline.d.mts +13 -0
  246. package/dist/polyfills/unenv-runtime/node/readline.mjs +21 -0
  247. package/dist/polyfills/unenv-runtime/node/repl.d.mts +10 -0
  248. package/dist/polyfills/unenv-runtime/node/repl.mjs +20 -0
  249. package/dist/polyfills/unenv-runtime/node/sqlite.d.mts +6 -0
  250. package/dist/polyfills/unenv-runtime/node/sqlite.mjs +9 -0
  251. package/dist/polyfills/unenv-runtime/node/stream/consumers.d.mts +7 -0
  252. package/dist/polyfills/unenv-runtime/node/stream/consumers.mjs +13 -0
  253. package/dist/polyfills/unenv-runtime/node/stream/promises.d.mts +4 -0
  254. package/dist/polyfills/unenv-runtime/node/stream/promises.mjs +7 -0
  255. package/dist/polyfills/unenv-runtime/node/stream/web.d.mts +24 -0
  256. package/dist/polyfills/unenv-runtime/node/stream/web.mjs +41 -0
  257. package/dist/polyfills/unenv-runtime/node/stream.d.mts +42 -0
  258. package/dist/polyfills/unenv-runtime/node/stream.mjs +54 -0
  259. package/dist/polyfills/unenv-runtime/node/string_decoder.d.mts +5 -0
  260. package/dist/polyfills/unenv-runtime/node/string_decoder.mjs +3 -0
  261. package/dist/polyfills/unenv-runtime/node/sys.d.mts +2 -0
  262. package/dist/polyfills/unenv-runtime/node/sys.mjs +2 -0
  263. package/dist/polyfills/unenv-runtime/node/timers/promises.d.mts +6 -0
  264. package/dist/polyfills/unenv-runtime/node/timers/promises.mjs +14 -0
  265. package/dist/polyfills/unenv-runtime/node/timers.d.mts +15 -0
  266. package/dist/polyfills/unenv-runtime/node/timers.mjs +32 -0
  267. package/dist/polyfills/unenv-runtime/node/tls.d.mts +15 -0
  268. package/dist/polyfills/unenv-runtime/node/tls.mjs +41 -0
  269. package/dist/polyfills/unenv-runtime/node/trace_events.d.mts +5 -0
  270. package/dist/polyfills/unenv-runtime/node/trace_events.mjs +9 -0
  271. package/dist/polyfills/unenv-runtime/node/tty.d.mts +9 -0
  272. package/dist/polyfills/unenv-runtime/node/tty.mjs +12 -0
  273. package/dist/polyfills/unenv-runtime/node/url.d.mts +61 -0
  274. package/dist/polyfills/unenv-runtime/node/url.mjs +1044 -0
  275. package/dist/polyfills/unenv-runtime/node/util/types.d.mts +3 -0
  276. package/dist/polyfills/unenv-runtime/node/util/types.mjs +3 -0
  277. package/dist/polyfills/unenv-runtime/node/util.d.mts +32 -0
  278. package/dist/polyfills/unenv-runtime/node/util.mjs +84 -0
  279. package/dist/polyfills/unenv-runtime/node/v8.d.mts +29 -0
  280. package/dist/polyfills/unenv-runtime/node/v8.mjs +108 -0
  281. package/dist/polyfills/unenv-runtime/node/vm.d.mts +15 -0
  282. package/dist/polyfills/unenv-runtime/node/vm.mjs +41 -0
  283. package/dist/polyfills/unenv-runtime/node/wasi.d.mts +4 -0
  284. package/dist/polyfills/unenv-runtime/node/wasi.mjs +3 -0
  285. package/dist/polyfills/unenv-runtime/node/worker_threads.d.mts +23 -0
  286. package/dist/polyfills/unenv-runtime/node/worker_threads.mjs +55 -0
  287. package/dist/polyfills/unenv-runtime/node/zlib.d.mts +16 -0
  288. package/dist/polyfills/unenv-runtime/node/zlib.mjs +212 -0
  289. package/dist/polyfills/unenv-runtime/npm/cross-fetch.d.mts +6 -0
  290. package/dist/polyfills/unenv-runtime/npm/cross-fetch.mjs +6 -0
  291. package/dist/polyfills/unenv-runtime/npm/debug.d.mts +15 -0
  292. package/dist/polyfills/unenv-runtime/npm/debug.mjs +43 -0
  293. package/dist/polyfills/unenv-runtime/npm/fsevents.d.mts +16 -0
  294. package/dist/polyfills/unenv-runtime/npm/fsevents.mjs +20 -0
  295. package/dist/polyfills/unenv-runtime/npm/inherits.d.mts +2 -0
  296. package/dist/polyfills/unenv-runtime/npm/inherits.mjs +2 -0
  297. package/dist/polyfills/unenv-runtime/npm/node-fetch.d.mts +12 -0
  298. package/dist/polyfills/unenv-runtime/npm/node-fetch.mjs +23 -0
  299. package/dist/polyfills/unenv-runtime/npm/whatwg-url/index.d.mts +13 -0
  300. package/dist/polyfills/unenv-runtime/npm/whatwg-url/index.mjs +15 -0
  301. package/dist/polyfills/unenv-runtime/npm/whatwg-url/webidl2js-wrapper.d.mts +2 -0
  302. package/dist/polyfills/unenv-runtime/npm/whatwg-url/webidl2js-wrapper.mjs +2 -0
  303. package/dist/polyfills/unenv-runtime/polyfill/buffer.d.mts +1 -0
  304. package/dist/polyfills/unenv-runtime/polyfill/buffer.mjs +4 -0
  305. package/dist/polyfills/unenv-runtime/polyfill/globalthis-global.d.mts +1 -0
  306. package/dist/polyfills/unenv-runtime/polyfill/globalthis-global.mjs +5 -0
  307. package/dist/polyfills/unenv-runtime/polyfill/globalthis.d.mts +2 -0
  308. package/dist/polyfills/unenv-runtime/polyfill/globalthis.mjs +2 -0
  309. package/dist/polyfills/unenv-runtime/polyfill/package.json +3 -0
  310. package/dist/polyfills/unenv-runtime/polyfill/performance.d.mts +2 -0
  311. package/dist/polyfills/unenv-runtime/polyfill/performance.mjs +10 -0
  312. package/dist/polyfills/unenv-runtime/polyfill/process.d.mts +2 -0
  313. package/dist/polyfills/unenv-runtime/polyfill/process.mjs +10 -0
  314. package/dist/polyfills/unenv-runtime/polyfill/source-maps.mjs +15 -0
  315. package/dist/polyfills/unenv-runtime/polyfill/timers.d.mts +1 -0
  316. package/dist/polyfills/unenv-runtime/polyfill/timers.mjs +7 -0
  317. package/dist/polyfills/unenv-runtime/web/performance/_polyfills.d.mts +100 -0
  318. package/dist/polyfills/unenv-runtime/web/performance/_polyfills.mjs +184 -0
  319. package/dist/polyfills/unenv-runtime/web/performance/index.d.mts +12 -0
  320. package/dist/polyfills/unenv-runtime/web/performance/index.mjs +14 -0
  321. package/package.json +2 -2
@@ -0,0 +1,25 @@
1
+ // npx -y node@22.14 -e 'const {constants}=require("perf_hooks");console.log(Object.entries(Object.getOwnPropertyDescriptors(constants)).map(([k,v]) => `export const ${k} = ${JSON.stringify(v.value)}`).join("\n"))'
2
+ export declare const NODE_PERFORMANCE_GC_MAJOR = 4;
3
+ export declare const NODE_PERFORMANCE_GC_MINOR = 1;
4
+ export declare const NODE_PERFORMANCE_GC_INCREMENTAL = 8;
5
+ export declare const NODE_PERFORMANCE_GC_WEAKCB = 16;
6
+ export declare const NODE_PERFORMANCE_GC_FLAGS_NO = 0;
7
+ export declare const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED = 2;
8
+ export declare const NODE_PERFORMANCE_GC_FLAGS_FORCED = 4;
9
+ export declare const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING = 8;
10
+ export declare const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE = 16;
11
+ export declare const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY = 32;
12
+ export declare const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE = 64;
13
+ export declare const NODE_PERFORMANCE_ENTRY_TYPE_GC = 0;
14
+ export declare const NODE_PERFORMANCE_ENTRY_TYPE_HTTP = 1;
15
+ export declare const NODE_PERFORMANCE_ENTRY_TYPE_HTTP2 = 2;
16
+ export declare const NODE_PERFORMANCE_ENTRY_TYPE_NET = 3;
17
+ export declare const NODE_PERFORMANCE_ENTRY_TYPE_DNS = 4;
18
+ export declare const NODE_PERFORMANCE_MILESTONE_TIME_ORIGIN_TIMESTAMP = 0;
19
+ export declare const NODE_PERFORMANCE_MILESTONE_TIME_ORIGIN = 1;
20
+ export declare const NODE_PERFORMANCE_MILESTONE_ENVIRONMENT = 2;
21
+ export declare const NODE_PERFORMANCE_MILESTONE_NODE_START = 3;
22
+ export declare const NODE_PERFORMANCE_MILESTONE_V8_START = 4;
23
+ export declare const NODE_PERFORMANCE_MILESTONE_LOOP_START = 5;
24
+ export declare const NODE_PERFORMANCE_MILESTONE_LOOP_EXIT = 6;
25
+ export declare const NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE = 7;
@@ -0,0 +1,25 @@
1
+ // npx -y node@22.14 -e 'const {constants}=require("perf_hooks");console.log(Object.entries(Object.getOwnPropertyDescriptors(constants)).map(([k,v]) => `export const ${k} = ${JSON.stringify(v.value)}`).join("\n"))'
2
+ export const NODE_PERFORMANCE_GC_MAJOR = 4;
3
+ export const NODE_PERFORMANCE_GC_MINOR = 1;
4
+ export const NODE_PERFORMANCE_GC_INCREMENTAL = 8;
5
+ export const NODE_PERFORMANCE_GC_WEAKCB = 16;
6
+ export const NODE_PERFORMANCE_GC_FLAGS_NO = 0;
7
+ export const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED = 2;
8
+ export const NODE_PERFORMANCE_GC_FLAGS_FORCED = 4;
9
+ export const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING = 8;
10
+ export const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE = 16;
11
+ export const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY = 32;
12
+ export const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE = 64;
13
+ export const NODE_PERFORMANCE_ENTRY_TYPE_GC = 0;
14
+ export const NODE_PERFORMANCE_ENTRY_TYPE_HTTP = 1;
15
+ export const NODE_PERFORMANCE_ENTRY_TYPE_HTTP2 = 2;
16
+ export const NODE_PERFORMANCE_ENTRY_TYPE_NET = 3;
17
+ export const NODE_PERFORMANCE_ENTRY_TYPE_DNS = 4;
18
+ export const NODE_PERFORMANCE_MILESTONE_TIME_ORIGIN_TIMESTAMP = 0;
19
+ export const NODE_PERFORMANCE_MILESTONE_TIME_ORIGIN = 1;
20
+ export const NODE_PERFORMANCE_MILESTONE_ENVIRONMENT = 2;
21
+ export const NODE_PERFORMANCE_MILESTONE_NODE_START = 3;
22
+ export const NODE_PERFORMANCE_MILESTONE_V8_START = 4;
23
+ export const NODE_PERFORMANCE_MILESTONE_LOOP_START = 5;
24
+ export const NODE_PERFORMANCE_MILESTONE_LOOP_EXIT = 6;
25
+ export const NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE = 7;
@@ -0,0 +1,28 @@
1
+ import type nodePerfHooks from "node:perf_hooks";
2
+ declare class Histogram implements nodePerfHooks.Histogram {
3
+ min: number;
4
+ max: number;
5
+ mean;
6
+ exceeds: number;
7
+ stddev;
8
+ count: number;
9
+ countBigInt: bigint;
10
+ exceedsBigInt: bigint;
11
+ maxBigInt: number;
12
+ minBigInt: bigint;
13
+ percentiles: Map<number, number>;
14
+ percentilesBigInt: Map<bigint, bigint>;
15
+ percentileBigInt(_percentile: number): bigint;
16
+ percentile(percentile: number): number;
17
+ reset(): void;
18
+ }
19
+ export declare class IntervalHistogram extends Histogram implements nodePerfHooks.IntervalHistogram {
20
+ enable(): boolean;
21
+ disable(): boolean;
22
+ }
23
+ export declare class RecordableHistogram extends Histogram implements nodePerfHooks.RecordableHistogram {
24
+ record(val: number | bigint): void;
25
+ recordDelta(): void;
26
+ add(other: nodePerfHooks.RecordableHistogram): void;
27
+ }
28
+ export {};
@@ -0,0 +1,43 @@
1
+ import { createNotImplementedError } from "../../../_internal/utils.mjs";
2
+ class Histogram {
3
+ min = 0x8000000000000000;
4
+ max = 0;
5
+ mean = Number.NaN;
6
+ exceeds = 0;
7
+ stddev = Number.NaN;
8
+ count = 0;
9
+ countBigInt = BigInt(0);
10
+ exceedsBigInt = BigInt(0);
11
+ maxBigInt = 0;
12
+ minBigInt = BigInt(9223372036854775807n);
13
+ percentiles = new Map();
14
+ percentilesBigInt = new Map();
15
+ percentileBigInt(_percentile) {
16
+ throw createNotImplementedError("Histogram.percentileBigInt");
17
+ }
18
+ percentile(percentile) {
19
+ return this.percentiles.get(percentile) ?? Number.NaN;
20
+ }
21
+ reset() {
22
+ throw createNotImplementedError("Histogram.reset");
23
+ }
24
+ }
25
+ export class IntervalHistogram extends Histogram {
26
+ enable() {
27
+ return true;
28
+ }
29
+ disable() {
30
+ return true;
31
+ }
32
+ }
33
+ export class RecordableHistogram extends Histogram {
34
+ record(val) {
35
+ throw createNotImplementedError("RecordableHistogram.record");
36
+ }
37
+ recordDelta() {
38
+ throw createNotImplementedError("RecordableHistogram.recordDelta");
39
+ }
40
+ add(other) {
41
+ throw createNotImplementedError("RecordableHistogram.add");
42
+ }
43
+ }
@@ -0,0 +1,103 @@
1
+ import type nodePerfHooks from "node:perf_hooks";
2
+ // PerformanceEntry
3
+ export declare class PerformanceEntry implements nodePerfHooks.PerformanceEntry {
4
+ readonly __unenv__: true;
5
+ detail: any | undefined;
6
+ entryType: any;
7
+ name: string;
8
+ startTime: number;
9
+ constructor(name: string, options?: PerformanceMarkOptions);
10
+ get duration(): number;
11
+ toJSON(): {};
12
+ }
13
+ // PerformanceMark
14
+ export declare const PerformanceMark: typeof nodePerfHooks.PerformanceMark;
15
+ // PerformanceMark
16
+ export declare class PerformanceMeasure extends PerformanceEntry implements globalThis.PerformanceMeasure {
17
+ entryType: "measure";
18
+ }
19
+ // PerformanceResourceTiming
20
+ export declare class PerformanceResourceTiming extends PerformanceEntry implements globalThis.PerformanceResourceTiming {
21
+ entryType: "resource";
22
+ serverTiming: readonly PerformanceServerTiming[];
23
+ connectEnd: number;
24
+ connectStart: number;
25
+ decodedBodySize: number;
26
+ domainLookupEnd: number;
27
+ domainLookupStart: number;
28
+ encodedBodySize: number;
29
+ fetchStart: number;
30
+ initiatorType: string;
31
+ name: string;
32
+ nextHopProtocol: string;
33
+ redirectEnd: number;
34
+ redirectStart: number;
35
+ requestStart: number;
36
+ responseEnd: number;
37
+ responseStart: number;
38
+ secureConnectionStart: number;
39
+ startTime: number;
40
+ transferSize: number;
41
+ workerStart: number;
42
+ responseStatus: number;
43
+ }
44
+ // PerformanceObserverEntryList
45
+ export declare class PerformanceObserverEntryList implements globalThis.PerformanceObserverEntryList {
46
+ readonly __unenv__: true;
47
+ getEntries(): PerformanceEntryList;
48
+ getEntriesByName(_name: string, _type?: string | undefined): PerformanceEntryList;
49
+ getEntriesByType(type: string): PerformanceEntryList;
50
+ }
51
+ // Performance
52
+ export declare class Performance implements nodePerfHooks.Performance {
53
+ readonly __unenv__: true;
54
+ timeOrigin: number;
55
+ eventCounts: EventCounts;
56
+ _entries: PerformanceEntry[];
57
+ _resourceTimingBufferSize: number;
58
+ navigation: any;
59
+ timing: any;
60
+ timerify<T extends (...params: any[]) => any>(_fn: T, _options?: nodePerfHooks.TimerifyOptions | undefined): T;
61
+ get nodeTiming(): nodePerfHooks.PerformanceNodeTiming;
62
+ eventLoopUtilization(): nodePerfHooks.EventLoopUtilization;
63
+ markResourceTiming(): nodePerfHooks.PerformanceResourceTiming;
64
+ onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
65
+ now(): number;
66
+ clearMarks(markName?: string | undefined): void;
67
+ clearMeasures(measureName?: string | undefined): void;
68
+ clearResourceTimings(): void;
69
+ getEntries(): any;
70
+ getEntriesByName(name: string, type?: string | undefined): any;
71
+ getEntriesByType(type: string): any[];
72
+ mark(name: string, options?: PerformanceMarkOptions | undefined): any;
73
+ measure(measureName: string, startOrMeasureOptions?: string | PerformanceMeasureOptions, endMark?: string);
74
+ setResourceTimingBufferSize(maxSize: number): void;
75
+ addEventListener<K extends "resourcetimingbufferfull">(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
76
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
77
+ removeEventListener<K extends "resourcetimingbufferfull">(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void;
78
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
79
+ dispatchEvent(event: Event): boolean;
80
+ toJSON();
81
+ }
82
+ // PerformanceObserver
83
+ export declare class PerformanceObserver implements nodePerfHooks.PerformanceObserver {
84
+ readonly __unenv__: true;
85
+ static supportedEntryTypes: ReadonlyArray<string>;
86
+ _callback: PerformanceObserverCallback | null;
87
+ constructor(callback: PerformanceObserverCallback);
88
+ takeRecords(): unknown;
89
+ disconnect(): void;
90
+ observe(options: any);
91
+ bind<Func extends (...args: any[]) => any>(fn: Func): Func;
92
+ runInAsyncScope<
93
+ This,
94
+ Result
95
+ >(fn: (this: This, ...args: any[]) => Result, thisArg?: This | undefined, ...args: any[]);
96
+ asyncId(): number;
97
+ triggerAsyncId(): number;
98
+ emitDestroy(): this;
99
+ }
100
+ // workerd implements a subset of globalThis.performance (as of last check, only timeOrigin set to 0 + now() implemented)
101
+ // We already use performance.now() from globalThis.performance, if provided (see top of this file)
102
+ // If we detect this condition, we can just use polyfill instead.
103
+ export declare const performance: unknown;
@@ -0,0 +1,232 @@
1
+ import { createNotImplementedError } from "../../../_internal/utils.mjs";
2
+ const _timeOrigin = globalThis.performance?.timeOrigin ?? Date.now();
3
+ const _performanceNow = globalThis.performance?.now ? globalThis.performance.now.bind(globalThis.performance) : () => Date.now() - _timeOrigin;
4
+ const nodeTiming = {
5
+ name: "node",
6
+ entryType: "node",
7
+ startTime: 0,
8
+ duration: 0,
9
+ nodeStart: 0,
10
+ v8Start: 0,
11
+ bootstrapComplete: 0,
12
+ environment: 0,
13
+ loopStart: 0,
14
+ loopExit: 0,
15
+ idleTime: 0,
16
+ uvMetricsInfo: {
17
+ loopCount: 0,
18
+ events: 0,
19
+ eventsWaiting: 0
20
+ },
21
+ detail: undefined,
22
+ toJSON() {
23
+ return this;
24
+ }
25
+ };
26
+ // PerformanceEntry
27
+ export class PerformanceEntry {
28
+ __unenv__ = true;
29
+ detail;
30
+ entryType = "event";
31
+ name;
32
+ startTime;
33
+ constructor(name, options) {
34
+ this.name = name;
35
+ this.startTime = options?.startTime || _performanceNow();
36
+ this.detail = options?.detail;
37
+ }
38
+ get duration() {
39
+ return _performanceNow() - this.startTime;
40
+ }
41
+ toJSON() {
42
+ return {
43
+ name: this.name,
44
+ entryType: this.entryType,
45
+ startTime: this.startTime,
46
+ duration: this.duration,
47
+ detail: this.detail
48
+ };
49
+ }
50
+ }
51
+ // PerformanceMark
52
+ export const PerformanceMark = class PerformanceMark extends PerformanceEntry {
53
+ entryType = "mark";
54
+ constructor() {
55
+ // @ts-ignore
56
+ super(...arguments);
57
+ }
58
+ get duration() {
59
+ return 0;
60
+ }
61
+ };
62
+ // PerformanceMark
63
+ export class PerformanceMeasure extends PerformanceEntry {
64
+ entryType = "measure";
65
+ }
66
+ // PerformanceResourceTiming
67
+ export class PerformanceResourceTiming extends PerformanceEntry {
68
+ entryType = "resource";
69
+ serverTiming = [];
70
+ connectEnd = 0;
71
+ connectStart = 0;
72
+ decodedBodySize = 0;
73
+ domainLookupEnd = 0;
74
+ domainLookupStart = 0;
75
+ encodedBodySize = 0;
76
+ fetchStart = 0;
77
+ initiatorType = "";
78
+ name = "";
79
+ nextHopProtocol = "";
80
+ redirectEnd = 0;
81
+ redirectStart = 0;
82
+ requestStart = 0;
83
+ responseEnd = 0;
84
+ responseStart = 0;
85
+ secureConnectionStart = 0;
86
+ startTime = 0;
87
+ transferSize = 0;
88
+ workerStart = 0;
89
+ responseStatus = 0;
90
+ }
91
+ // PerformanceObserverEntryList
92
+ export class PerformanceObserverEntryList {
93
+ __unenv__ = true;
94
+ getEntries() {
95
+ return [];
96
+ }
97
+ getEntriesByName(_name, _type) {
98
+ return [];
99
+ }
100
+ getEntriesByType(type) {
101
+ return [];
102
+ }
103
+ }
104
+ // Performance
105
+ export class Performance {
106
+ __unenv__ = true;
107
+ timeOrigin = _timeOrigin;
108
+ eventCounts = new Map();
109
+ _entries = [];
110
+ _resourceTimingBufferSize = 0;
111
+ navigation = undefined;
112
+ timing = undefined;
113
+ timerify(_fn, _options) {
114
+ throw createNotImplementedError("Performance.timerify");
115
+ }
116
+ get nodeTiming() {
117
+ return nodeTiming;
118
+ }
119
+ eventLoopUtilization() {
120
+ return {};
121
+ }
122
+ markResourceTiming() {
123
+ // TODO: create a new PerformanceResourceTiming entry
124
+ // so that performance.getEntries, getEntriesByName, and getEntriesByType return it
125
+ // see: https://nodejs.org/api/perf_hooks.html#performancemarkresourcetimingtiminginfo-requestedurl-initiatortype-global-cachemode-bodyinfo-responsestatus-deliverytype
126
+ return new PerformanceResourceTiming("");
127
+ }
128
+ onresourcetimingbufferfull = null;
129
+ now() {
130
+ // https://developer.mozilla.org/en-US/docs/Web/API/Performance/now
131
+ if (this.timeOrigin === _timeOrigin) {
132
+ return _performanceNow();
133
+ }
134
+ return Date.now() - this.timeOrigin;
135
+ }
136
+ clearMarks(markName) {
137
+ this._entries = markName ? this._entries.filter((e) => e.name !== markName) : this._entries.filter((e) => e.entryType !== "mark");
138
+ }
139
+ clearMeasures(measureName) {
140
+ this._entries = measureName ? this._entries.filter((e) => e.name !== measureName) : this._entries.filter((e) => e.entryType !== "measure");
141
+ }
142
+ clearResourceTimings() {
143
+ this._entries = this._entries.filter((e) => e.entryType !== "resource" || e.entryType !== "navigation");
144
+ }
145
+ getEntries() {
146
+ return this._entries;
147
+ }
148
+ getEntriesByName(name, type) {
149
+ return this._entries.filter((e) => e.name === name && (!type || e.entryType === type));
150
+ }
151
+ getEntriesByType(type) {
152
+ return this._entries.filter((e) => e.entryType === type);
153
+ }
154
+ mark(name, options) {
155
+ // @ts-expect-error constructor is not protected
156
+ const entry = new PerformanceMark(name, options);
157
+ this._entries.push(entry);
158
+ return entry;
159
+ }
160
+ measure(measureName, startOrMeasureOptions, endMark) {
161
+ let start;
162
+ let end;
163
+ if (typeof startOrMeasureOptions === "string") {
164
+ start = this.getEntriesByName(startOrMeasureOptions, "mark")[0]?.startTime;
165
+ end = this.getEntriesByName(endMark, "mark")[0]?.startTime;
166
+ } else {
167
+ start = Number.parseFloat(startOrMeasureOptions?.start) || this.now();
168
+ end = Number.parseFloat(startOrMeasureOptions?.end) || this.now();
169
+ }
170
+ const entry = new PerformanceMeasure(measureName, {
171
+ startTime: start,
172
+ detail: {
173
+ start,
174
+ end
175
+ }
176
+ });
177
+ this._entries.push(entry);
178
+ return entry;
179
+ }
180
+ setResourceTimingBufferSize(maxSize) {
181
+ this._resourceTimingBufferSize = maxSize;
182
+ }
183
+ addEventListener(type, listener, options) {
184
+ throw createNotImplementedError("Performance.addEventListener");
185
+ }
186
+ removeEventListener(type, listener, options) {
187
+ throw createNotImplementedError("Performance.removeEventListener");
188
+ }
189
+ dispatchEvent(event) {
190
+ throw createNotImplementedError("Performance.dispatchEvent");
191
+ }
192
+ toJSON() {
193
+ return this;
194
+ }
195
+ }
196
+ // PerformanceObserver
197
+ export class PerformanceObserver {
198
+ __unenv__ = true;
199
+ static supportedEntryTypes = [];
200
+ _callback = null;
201
+ constructor(callback) {
202
+ this._callback = callback;
203
+ }
204
+ takeRecords() {
205
+ return [];
206
+ }
207
+ disconnect() {
208
+ throw createNotImplementedError("PerformanceObserver.disconnect");
209
+ }
210
+ observe(options) {
211
+ throw createNotImplementedError("PerformanceObserver.observe");
212
+ }
213
+ bind(fn) {
214
+ return fn;
215
+ }
216
+ runInAsyncScope(fn, thisArg, ...args) {
217
+ return fn.call(thisArg, ...args);
218
+ }
219
+ asyncId() {
220
+ return 0;
221
+ }
222
+ triggerAsyncId() {
223
+ return 0;
224
+ }
225
+ emitDestroy() {
226
+ return this;
227
+ }
228
+ }
229
+ // workerd implements a subset of globalThis.performance (as of last check, only timeOrigin set to 0 + now() implemented)
230
+ // We already use performance.now() from globalThis.performance, if provided (see top of this file)
231
+ // If we detect this condition, we can just use polyfill instead.
232
+ export const performance = globalThis.performance && "addEventListener" in globalThis.performance ? globalThis.performance : new Performance();
@@ -0,0 +1 @@
1
+ export declare const env: NodeJS.Process["env"];
@@ -0,0 +1,40 @@
1
+ const _envShim = Object.create(null);
2
+ // Keep a reference to the original process to avoid circular references after polyfilling
3
+ const originalProcess = globalThis["process"];
4
+ const _getEnv = (useShim) => globalThis.__env__ || originalProcess?.env || (useShim ? _envShim : globalThis);
5
+ export const env = /* @__PURE__ */ new Proxy(_envShim, {
6
+ get(_, prop) {
7
+ const env = _getEnv();
8
+ return env[prop] ?? _envShim[prop];
9
+ },
10
+ has(_, prop) {
11
+ const env = _getEnv();
12
+ return prop in env || prop in _envShim;
13
+ },
14
+ set(_, prop, value) {
15
+ const env = _getEnv(true);
16
+ env[prop] = value;
17
+ return true;
18
+ },
19
+ deleteProperty(_, prop) {
20
+ const env = _getEnv(true);
21
+ delete env[prop];
22
+ return true;
23
+ },
24
+ ownKeys() {
25
+ const env = _getEnv();
26
+ return Object.keys(env);
27
+ },
28
+ getOwnPropertyDescriptor(_, prop) {
29
+ const env = _getEnv();
30
+ if (prop in env) {
31
+ return {
32
+ value: env[prop],
33
+ writable: true,
34
+ enumerable: true,
35
+ configurable: true
36
+ };
37
+ }
38
+ return undefined;
39
+ }
40
+ });
@@ -0,0 +1,2 @@
1
+ // https://nodejs.org/api/process.html#processhrtime
2
+ export declare const hrtime: NodeJS.Process["hrtime"];
@@ -0,0 +1,21 @@
1
+ // https://nodejs.org/api/process.html#processhrtime
2
+ export const hrtime = /* @__PURE__ */ Object.assign(function hrtime(startTime) {
3
+ const now = Date.now();
4
+ // millis to seconds
5
+ const seconds = Math.trunc(now / 1e3);
6
+ // convert millis to nanos
7
+ const nanos = now % 1e3 * 1e6;
8
+ if (startTime) {
9
+ let diffSeconds = seconds - startTime[0];
10
+ let diffNanos = nanos - startTime[0];
11
+ if (diffNanos < 0) {
12
+ diffSeconds = diffSeconds - 1;
13
+ diffNanos = 1e9 + diffNanos;
14
+ }
15
+ return [diffSeconds, diffNanos];
16
+ }
17
+ return [seconds, nanos];
18
+ }, { bigint: function bigint() {
19
+ // Convert milliseconds to nanoseconds
20
+ return BigInt(Date.now() * 1e6);
21
+ } });
@@ -0,0 +1,3 @@
1
+ // https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask
2
+ // https://nodejs.org/api/process.html#when-to-use-queuemicrotask-vs-processnexttick
3
+ export declare const nextTick: NodeJS.Process["nextTick"];
@@ -0,0 +1,55 @@
1
+ // https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask
2
+ // https://nodejs.org/api/process.html#when-to-use-queuemicrotask-vs-processnexttick
3
+ export const nextTick = globalThis.queueMicrotask ? (cb, ...args) => {
4
+ globalThis.queueMicrotask(cb.bind(undefined, ...args));
5
+ } : /* @__PURE__ */ createNextTickWithTimeout();
6
+ // Fallback for runtimes not implementing queueMicrotask
7
+ function createNextTickWithTimeout() {
8
+ let queue = [];
9
+ let draining = false;
10
+ let currentQueue;
11
+ let queueIndex = -1;
12
+ function cleanUpNextTick() {
13
+ if (!draining || !currentQueue) {
14
+ return;
15
+ }
16
+ draining = false;
17
+ if (currentQueue.length > 0) {
18
+ queue = [...currentQueue, ...queue];
19
+ } else {
20
+ queueIndex = -1;
21
+ }
22
+ if (queue.length > 0) {
23
+ drainQueue();
24
+ }
25
+ }
26
+ function drainQueue() {
27
+ if (draining) {
28
+ return;
29
+ }
30
+ const timeout = setTimeout(cleanUpNextTick);
31
+ draining = true;
32
+ let len = queue.length;
33
+ while (len) {
34
+ currentQueue = queue;
35
+ queue = [];
36
+ while (++queueIndex < len) {
37
+ if (currentQueue) {
38
+ currentQueue[queueIndex]();
39
+ }
40
+ }
41
+ queueIndex = -1;
42
+ len = queue.length;
43
+ }
44
+ currentQueue = undefined;
45
+ draining = false;
46
+ clearTimeout(timeout);
47
+ }
48
+ const nextTick = (cb, ...args) => {
49
+ queue.push(cb.bind(undefined, ...args));
50
+ if (queue.length === 1 && !draining) {
51
+ setTimeout(drainQueue);
52
+ }
53
+ };
54
+ return nextTick;
55
+ }
@@ -0,0 +1,2 @@
1
+ // Extracted from .nvmrc
2
+ export declare const NODE_VERSION = "22.14.0";
@@ -0,0 +1,2 @@
1
+ // Extracted from .nvmrc
2
+ export const NODE_VERSION = "22.14.0";