@capsule-run/sdk 0.8.4 → 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.
- package/dist/polyfills/unenv-runtime/_internal/types.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/_internal/types.mjs +1 -0
- package/dist/polyfills/unenv-runtime/_internal/utils.d.mts +14 -0
- package/dist/polyfills/unenv-runtime/_internal/utils.mjs +49 -0
- package/dist/polyfills/unenv-runtime/mock/empty.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/mock/empty.mjs +1 -0
- package/dist/polyfills/unenv-runtime/mock/noop.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/mock/noop.mjs +1 -0
- package/dist/polyfills/unenv-runtime/mock/proxy.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/mock/proxy.mjs +43 -0
- package/dist/polyfills/unenv-runtime/node/assert/strict.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/assert/strict.mjs +25 -0
- package/dist/polyfills/unenv-runtime/node/assert.d.mts +165 -0
- package/dist/polyfills/unenv-runtime/node/assert.mjs +737 -0
- package/dist/polyfills/unenv-runtime/node/async_hooks.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/async_hooks.mjs +15 -0
- package/dist/polyfills/unenv-runtime/node/buffer.d.mts +19 -0
- package/dist/polyfills/unenv-runtime/node/buffer.mjs +35 -0
- package/dist/polyfills/unenv-runtime/node/child_process.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/child_process.mjs +21 -0
- package/dist/polyfills/unenv-runtime/node/cluster.d.mts +33 -0
- package/dist/polyfills/unenv-runtime/node/cluster.mjs +71 -0
- package/dist/polyfills/unenv-runtime/node/console.d.mts +38 -0
- package/dist/polyfills/unenv-runtime/node/console.mjs +74 -0
- package/dist/polyfills/unenv-runtime/node/constants.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/constants.mjs +254 -0
- package/dist/polyfills/unenv-runtime/node/crypto.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/crypto.mjs +138 -0
- package/dist/polyfills/unenv-runtime/node/dgram.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/dgram.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/diagnostics_channel.d.mts +11 -0
- package/dist/polyfills/unenv-runtime/node/diagnostics_channel.mjs +34 -0
- package/dist/polyfills/unenv-runtime/node/dns/promises.d.mts +27 -0
- package/dist/polyfills/unenv-runtime/node/dns/promises.mjs +75 -0
- package/dist/polyfills/unenv-runtime/node/dns.d.mts +29 -0
- package/dist/polyfills/unenv-runtime/node/dns.mjs +81 -0
- package/dist/polyfills/unenv-runtime/node/domain.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/domain.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/events.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/events.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/fs/promises.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/fs/promises.mjs +38 -0
- package/dist/polyfills/unenv-runtime/node/fs.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/fs.mjs +117 -0
- package/dist/polyfills/unenv-runtime/node/http.d.mts +23 -0
- package/dist/polyfills/unenv-runtime/node/http.mjs +45 -0
- package/dist/polyfills/unenv-runtime/node/http2.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/node/http2.mjs +284 -0
- package/dist/polyfills/unenv-runtime/node/https.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/https.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/inspector/promises.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/inspector/promises.mjs +40 -0
- package/dist/polyfills/unenv-runtime/node/inspector.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/inspector.mjs +53 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-hook.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-hook.mjs +115 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-local-storage.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-local-storage.mjs +36 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-resource.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/async_hooks/async-resource.mjs +37 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/base64.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/base64.mjs +97 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/buffer.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/buffer.mjs +1846 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/file.d.mts +14 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/file.mjs +26 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/ieee754.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/internal/buffer/ieee754.mjs +89 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/constants.d.mts +58 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/constants.mjs +58 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/node.d.mts +78 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/node.mjs +110 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/web.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/internal/crypto/web.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/dgram/socket.d.mts +31 -0
- package/dist/polyfills/unenv-runtime/node/internal/dgram/socket.mjs +61 -0
- package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/channel.d.mts +18 -0
- package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/channel.mjs +40 -0
- package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/tracing-channel.d.mts +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/diagnostics_channel/tracing-channel.mjs +48 -0
- package/dist/polyfills/unenv-runtime/node/internal/dns/constants.d.mts +28 -0
- package/dist/polyfills/unenv-runtime/node/internal/dns/constants.mjs +28 -0
- package/dist/polyfills/unenv-runtime/node/internal/domain/domain.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/internal/domain/domain.mjs +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/events/events.d.mts +207 -0
- package/dist/polyfills/unenv-runtime/node/internal/events/events.mjs +1097 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/classes.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/classes.mjs +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/constants.d.mts +59 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/constants.mjs +59 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/fs.d.mts +96 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/fs.mjs +106 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/promises.d.mts +32 -0
- package/dist/polyfills/unenv-runtime/node/internal/fs/promises.mjs +32 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/agent.d.mts +14 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/agent.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/constants.d.mts +67 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/constants.mjs +103 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/request.d.mts +31 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/request.mjs +53 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/response.d.mts +42 -0
- package/dist/polyfills/unenv-runtime/node/internal/http/response.mjs +101 -0
- package/dist/polyfills/unenv-runtime/node/internal/http2/constants.d.mts +241 -0
- package/dist/polyfills/unenv-runtime/node/internal/http2/constants.mjs +241 -0
- package/dist/polyfills/unenv-runtime/node/internal/net/server.d.mts +17 -0
- package/dist/polyfills/unenv-runtime/node/internal/net/server.mjs +33 -0
- package/dist/polyfills/unenv-runtime/node/internal/net/socket.d.mts +45 -0
- package/dist/polyfills/unenv-runtime/node/internal/net/socket.mjs +83 -0
- package/dist/polyfills/unenv-runtime/node/internal/os/constants.d.mts +133 -0
- package/dist/polyfills/unenv-runtime/node/internal/os/constants.mjs +133 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/constants.d.mts +25 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/constants.mjs +25 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/histogram.d.mts +28 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/histogram.mjs +43 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/performance.d.mts +103 -0
- package/dist/polyfills/unenv-runtime/node/internal/perf_hooks/performance.mjs +232 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/env.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/env.mjs +40 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/hrtime.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/hrtime.mjs +21 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/nexttick.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/nexttick.mjs +55 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/node-version.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/node-version.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/process.d.mts +113 -0
- package/dist/polyfills/unenv-runtime/node/internal/process/process.mjs +238 -0
- package/dist/polyfills/unenv-runtime/node/internal/punycode/punycode.d.mts +59 -0
- package/dist/polyfills/unenv-runtime/node/internal/punycode/punycode.mjs +410 -0
- package/dist/polyfills/unenv-runtime/node/internal/querystring/querystring.d.mts +11 -0
- package/dist/polyfills/unenv-runtime/node/internal/querystring/querystring.mjs +320 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/interface.d.mts +20 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/interface.mjs +31 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/promises/interface.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/promises/interface.mjs +6 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/promises/readline.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/readline/promises/readline.mjs +20 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/duplex.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/duplex.mjs +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/readable.d.mts +67 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/readable.mjs +112 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/transform.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/transform.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/writable.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/stream/writable.mjs +87 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/immediate.d.mts +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/immediate.mjs +28 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/scheduler.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/scheduler.mjs +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-immediate.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-immediate.mjs +13 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-interval.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-interval.mjs +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-timeout.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/set-timeout.mjs +11 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/timeout.d.mts +11 -0
- package/dist/polyfills/unenv-runtime/node/internal/timers/timeout.mjs +30 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/constants.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/constants.mjs +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/secure-context.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/secure-context.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/server.d.mts +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/server.mjs +15 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/tls-socket.d.mts +31 -0
- package/dist/polyfills/unenv-runtime/node/internal/tls/tls-socket.mjs +48 -0
- package/dist/polyfills/unenv-runtime/node/internal/trace_events/tracing.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/trace_events/tracing.mjs +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/tty/read-stream.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/tty/read-stream.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/tty/write-stream.d.mts +20 -0
- package/dist/polyfills/unenv-runtime/node/internal/tty/write-stream.mjs +44 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/constants.d.mts +44 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/constants.mjs +44 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/errors.d.mts +26 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/errors.mjs +54 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/url.d.mts +22 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/url.mjs +181 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/util.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/internal/url/util.mjs +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/inherits.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/inherits.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/legacy-types.d.mts +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/legacy-types.mjs +25 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/log.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/log.mjs +55 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/mime.d.mts +19 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/mime.mjs +35 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/promisify.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/promisify.mjs +23 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/types.d.mts +45 -0
- package/dist/polyfills/unenv-runtime/node/internal/util/types.mjs +45 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/deserializer.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/deserializer.mjs +23 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/profiler.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/profiler.mjs +11 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/serializer.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/v8/serializer.mjs +15 -0
- package/dist/polyfills/unenv-runtime/node/internal/vm/constants.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/vm/constants.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/internal/vm/script.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/internal/vm/script.mjs +15 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/broadcast-channel.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/broadcast-channel.mjs +13 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-channel.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-channel.mjs +5 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-port.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/message-port.mjs +17 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/worker.d.mts +21 -0
- package/dist/polyfills/unenv-runtime/node/internal/worker_threads/worker.mjs +25 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/codes.d.mts +21 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/codes.mjs +21 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/constants.d.mts +108 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/constants.mjs +108 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/_shared.d.mts +22 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/_shared.mjs +40 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/brotli.d.mts +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/brotli.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/deflate.d.mts +29 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/deflate.mjs +36 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/gzip.d.mts +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/gzip.mjs +16 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/zip.d.mts +9 -0
- package/dist/polyfills/unenv-runtime/node/internal/zlib/formats/zip.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/module.d.mts +54 -0
- package/dist/polyfills/unenv-runtime/node/module.mjs +191 -0
- package/dist/polyfills/unenv-runtime/node/net.d.mts +22 -0
- package/dist/polyfills/unenv-runtime/node/net.mjs +52 -0
- package/dist/polyfills/unenv-runtime/node/os.d.mts +26 -0
- package/dist/polyfills/unenv-runtime/node/os.mjs +118 -0
- package/dist/polyfills/unenv-runtime/node/path/posix.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/path/posix.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/path/win32.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/path/win32.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/path.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/node/path.mjs +31 -0
- package/dist/polyfills/unenv-runtime/node/perf_hooks.d.mts +8 -0
- package/dist/polyfills/unenv-runtime/node/perf_hooks.mjs +51 -0
- package/dist/polyfills/unenv-runtime/node/process.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/process.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/punycode.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/punycode.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/querystring.d.mts +49 -0
- package/dist/polyfills/unenv-runtime/node/querystring.mjs +766 -0
- package/dist/polyfills/unenv-runtime/node/readline/promises.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/readline/promises.mjs +10 -0
- package/dist/polyfills/unenv-runtime/node/readline.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/node/readline.mjs +21 -0
- package/dist/polyfills/unenv-runtime/node/repl.d.mts +10 -0
- package/dist/polyfills/unenv-runtime/node/repl.mjs +20 -0
- package/dist/polyfills/unenv-runtime/node/sqlite.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/sqlite.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/stream/consumers.d.mts +7 -0
- package/dist/polyfills/unenv-runtime/node/stream/consumers.mjs +13 -0
- package/dist/polyfills/unenv-runtime/node/stream/promises.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/stream/promises.mjs +7 -0
- package/dist/polyfills/unenv-runtime/node/stream/web.d.mts +24 -0
- package/dist/polyfills/unenv-runtime/node/stream/web.mjs +41 -0
- package/dist/polyfills/unenv-runtime/node/stream.d.mts +42 -0
- package/dist/polyfills/unenv-runtime/node/stream.mjs +54 -0
- package/dist/polyfills/unenv-runtime/node/string_decoder.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/string_decoder.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/sys.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/node/sys.mjs +2 -0
- package/dist/polyfills/unenv-runtime/node/timers/promises.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/node/timers/promises.mjs +14 -0
- package/dist/polyfills/unenv-runtime/node/timers.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/node/timers.mjs +32 -0
- package/dist/polyfills/unenv-runtime/node/tls.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/node/tls.mjs +41 -0
- package/dist/polyfills/unenv-runtime/node/trace_events.d.mts +5 -0
- package/dist/polyfills/unenv-runtime/node/trace_events.mjs +9 -0
- package/dist/polyfills/unenv-runtime/node/tty.d.mts +9 -0
- package/dist/polyfills/unenv-runtime/node/tty.mjs +12 -0
- package/dist/polyfills/unenv-runtime/node/url.d.mts +61 -0
- package/dist/polyfills/unenv-runtime/node/url.mjs +1044 -0
- package/dist/polyfills/unenv-runtime/node/util/types.d.mts +3 -0
- package/dist/polyfills/unenv-runtime/node/util/types.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/util.d.mts +32 -0
- package/dist/polyfills/unenv-runtime/node/util.mjs +84 -0
- package/dist/polyfills/unenv-runtime/node/v8.d.mts +29 -0
- package/dist/polyfills/unenv-runtime/node/v8.mjs +108 -0
- package/dist/polyfills/unenv-runtime/node/vm.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/node/vm.mjs +41 -0
- package/dist/polyfills/unenv-runtime/node/wasi.d.mts +4 -0
- package/dist/polyfills/unenv-runtime/node/wasi.mjs +3 -0
- package/dist/polyfills/unenv-runtime/node/worker_threads.d.mts +23 -0
- package/dist/polyfills/unenv-runtime/node/worker_threads.mjs +55 -0
- package/dist/polyfills/unenv-runtime/node/zlib.d.mts +16 -0
- package/dist/polyfills/unenv-runtime/node/zlib.mjs +212 -0
- package/dist/polyfills/unenv-runtime/npm/cross-fetch.d.mts +6 -0
- package/dist/polyfills/unenv-runtime/npm/cross-fetch.mjs +6 -0
- package/dist/polyfills/unenv-runtime/npm/debug.d.mts +15 -0
- package/dist/polyfills/unenv-runtime/npm/debug.mjs +43 -0
- package/dist/polyfills/unenv-runtime/npm/fsevents.d.mts +16 -0
- package/dist/polyfills/unenv-runtime/npm/fsevents.mjs +20 -0
- package/dist/polyfills/unenv-runtime/npm/inherits.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/npm/inherits.mjs +2 -0
- package/dist/polyfills/unenv-runtime/npm/node-fetch.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/npm/node-fetch.mjs +23 -0
- package/dist/polyfills/unenv-runtime/npm/whatwg-url/index.d.mts +13 -0
- package/dist/polyfills/unenv-runtime/npm/whatwg-url/index.mjs +15 -0
- package/dist/polyfills/unenv-runtime/npm/whatwg-url/webidl2js-wrapper.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/npm/whatwg-url/webidl2js-wrapper.mjs +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/buffer.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/polyfill/buffer.mjs +4 -0
- package/dist/polyfills/unenv-runtime/polyfill/globalthis-global.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/polyfill/globalthis-global.mjs +5 -0
- package/dist/polyfills/unenv-runtime/polyfill/globalthis.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/globalthis.mjs +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/package.json +3 -0
- package/dist/polyfills/unenv-runtime/polyfill/performance.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/performance.mjs +10 -0
- package/dist/polyfills/unenv-runtime/polyfill/process.d.mts +2 -0
- package/dist/polyfills/unenv-runtime/polyfill/process.mjs +10 -0
- package/dist/polyfills/unenv-runtime/polyfill/source-maps.mjs +15 -0
- package/dist/polyfills/unenv-runtime/polyfill/timers.d.mts +1 -0
- package/dist/polyfills/unenv-runtime/polyfill/timers.mjs +7 -0
- package/dist/polyfills/unenv-runtime/web/performance/_polyfills.d.mts +100 -0
- package/dist/polyfills/unenv-runtime/web/performance/_polyfills.mjs +184 -0
- package/dist/polyfills/unenv-runtime/web/performance/index.d.mts +12 -0
- package/dist/polyfills/unenv-runtime/web/performance/index.mjs +14 -0
- package/package.json +2 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// https://www.npmjs.com/package/debug
|
|
2
|
+
import type { Debug } from "debug";
|
|
3
|
+
declare const debug: Debug;
|
|
4
|
+
export declare const coerce: unknown;
|
|
5
|
+
export declare const disable: unknown;
|
|
6
|
+
export declare const enable: unknown;
|
|
7
|
+
export declare const enabled: unknown;
|
|
8
|
+
export declare const formatArgs: unknown;
|
|
9
|
+
export declare const log: unknown;
|
|
10
|
+
export declare const selectColor: unknown;
|
|
11
|
+
export declare const humanize: any;
|
|
12
|
+
export declare const names: unknown;
|
|
13
|
+
export declare const skips: unknown;
|
|
14
|
+
export declare const formatters: unknown;
|
|
15
|
+
export default debug;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function createDebug(namespace) {
|
|
2
|
+
return Object.assign((...args) => {
|
|
3
|
+
const env = globalThis.process?.env.DEBUG;
|
|
4
|
+
if (!env || env !== "*" && !env.startsWith(namespace)) return;
|
|
5
|
+
console.debug(...args);
|
|
6
|
+
}, {
|
|
7
|
+
color: "#000000",
|
|
8
|
+
diff: 0,
|
|
9
|
+
enabled: true,
|
|
10
|
+
log: console.debug.bind(console),
|
|
11
|
+
namespace,
|
|
12
|
+
destroy: () => false,
|
|
13
|
+
extend: (ns, _del) => createDebug(namespace + ns)
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const debug = Object.assign(createDebug, {
|
|
17
|
+
coerce: (val) => val,
|
|
18
|
+
disable: () => "",
|
|
19
|
+
enable: (_namespaces) => {},
|
|
20
|
+
enabled: (_namespaces) => true,
|
|
21
|
+
formatArgs(args) {
|
|
22
|
+
args[0] = `${this.namespace} ${args[0]}`;
|
|
23
|
+
},
|
|
24
|
+
log: console.debug.bind(console),
|
|
25
|
+
selectColor: (_namespace) => 0,
|
|
26
|
+
humanize: (num) => `${num}ms`,
|
|
27
|
+
inspectOpts: {},
|
|
28
|
+
names: [],
|
|
29
|
+
skips: [],
|
|
30
|
+
formatters: {}
|
|
31
|
+
});
|
|
32
|
+
export const coerce = debug.coerce;
|
|
33
|
+
export const disable = debug.disable;
|
|
34
|
+
export const enable = debug.enable;
|
|
35
|
+
export const enabled = debug.enabled;
|
|
36
|
+
export const formatArgs = debug.formatArgs;
|
|
37
|
+
export const log = debug.log;
|
|
38
|
+
export const selectColor = debug.selectColor;
|
|
39
|
+
export const humanize = debug.humanize;
|
|
40
|
+
export const names = debug.names;
|
|
41
|
+
export const skips = debug.skips;
|
|
42
|
+
export const formatters = debug.formatters;
|
|
43
|
+
export default debug;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// https://www.npmjs.com/package/fsevents
|
|
2
|
+
declare const _default: {
|
|
3
|
+
watch(_dir: string, _cb: (...args: any[]) => any);
|
|
4
|
+
getInfo(path: string, _flags: number, _id: string): {
|
|
5
|
+
event: string;
|
|
6
|
+
type: string;
|
|
7
|
+
flags: number;
|
|
8
|
+
changes: {
|
|
9
|
+
inode: boolean;
|
|
10
|
+
finder: boolean;
|
|
11
|
+
access: boolean;
|
|
12
|
+
xattrs: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// https://www.npmjs.com/package/fsevents
|
|
2
|
+
export default {
|
|
3
|
+
watch(_dir, _cb) {
|
|
4
|
+
return Promise.resolve();
|
|
5
|
+
},
|
|
6
|
+
getInfo(path, _flags, _id) {
|
|
7
|
+
return {
|
|
8
|
+
event: "mock",
|
|
9
|
+
path,
|
|
10
|
+
type: "file",
|
|
11
|
+
flags: 4294967296,
|
|
12
|
+
changes: {
|
|
13
|
+
inode: false,
|
|
14
|
+
finder: false,
|
|
15
|
+
access: false,
|
|
16
|
+
xattrs: false
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// https://github.com/node-fetch/node-fetch
|
|
2
|
+
// Native browser APIs
|
|
3
|
+
export declare const fetch: unknown;
|
|
4
|
+
export declare const Headers: unknown;
|
|
5
|
+
export declare const Request: unknown;
|
|
6
|
+
export declare const Response: unknown;
|
|
7
|
+
export declare const AbortController: unknown;
|
|
8
|
+
// Error handling
|
|
9
|
+
export declare const FetchError: unknown;
|
|
10
|
+
export declare const AbortError: unknown;
|
|
11
|
+
export declare const isRedirect: unknown;
|
|
12
|
+
export default fetch;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// https://github.com/node-fetch/node-fetch
|
|
2
|
+
// Native browser APIs
|
|
3
|
+
export const fetch = (...args) => globalThis.fetch(...args);
|
|
4
|
+
export const Headers = globalThis.Headers;
|
|
5
|
+
export const Request = globalThis.Request;
|
|
6
|
+
export const Response = globalThis.Response;
|
|
7
|
+
export const AbortController = globalThis.AbortController;
|
|
8
|
+
// Error handling
|
|
9
|
+
export const FetchError = Error;
|
|
10
|
+
export const AbortError = Error;
|
|
11
|
+
// Top-level exported helpers (from node-fetch v3)
|
|
12
|
+
const redirectStatus = new Set([
|
|
13
|
+
301,
|
|
14
|
+
302,
|
|
15
|
+
303,
|
|
16
|
+
307,
|
|
17
|
+
308
|
|
18
|
+
]);
|
|
19
|
+
export const isRedirect = (code) => redirectStatus.has(code);
|
|
20
|
+
// node-fetch v2
|
|
21
|
+
fetch.Promise = globalThis.Promise;
|
|
22
|
+
fetch.isRedirect = isRedirect;
|
|
23
|
+
export default fetch;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const URL: unknown;
|
|
2
|
+
export declare const URLSearchParams: unknown;
|
|
3
|
+
export declare const parseURL: unknown;
|
|
4
|
+
export declare const basicURLParse: unknown;
|
|
5
|
+
export declare const serializeURL: unknown;
|
|
6
|
+
export declare const serializeHost: unknown;
|
|
7
|
+
export declare const serializeInteger: unknown;
|
|
8
|
+
export declare const serializeURLOrigin: unknown;
|
|
9
|
+
export declare const setTheUsername: unknown;
|
|
10
|
+
export declare const setThePassword: unknown;
|
|
11
|
+
export declare const cannotHaveAUsernamePasswordPort: unknown;
|
|
12
|
+
export declare const percentDecodeBytes: unknown;
|
|
13
|
+
export declare const percentDecodeString: unknown;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// https://www.npmjs.com/package/whatwg-url
|
|
2
|
+
import { notImplemented } from "../../_internal/utils.mjs";
|
|
3
|
+
export const URL = globalThis.URL;
|
|
4
|
+
export const URLSearchParams = globalThis.URLSearchParams;
|
|
5
|
+
export const parseURL = /* @__PURE__ */ notImplemented("whatwg-url.parseURL");
|
|
6
|
+
export const basicURLParse = /* @__PURE__ */ notImplemented("whatwg-url.basicURLParse");
|
|
7
|
+
export const serializeURL = /* @__PURE__ */ notImplemented("whatwg-url.serializeURL");
|
|
8
|
+
export const serializeHost = /* @__PURE__ */ notImplemented("whatwg-url.serializeHost");
|
|
9
|
+
export const serializeInteger = /* @__PURE__ */ notImplemented("whatwg-url.serializeInteger");
|
|
10
|
+
export const serializeURLOrigin = /* @__PURE__ */ notImplemented("whatwg-url.serializeURLOrigin");
|
|
11
|
+
export const setTheUsername = /* @__PURE__ */ notImplemented("whatwg-url.setTheUsername");
|
|
12
|
+
export const setThePassword = /* @__PURE__ */ notImplemented("whatwg-url.setThePassword");
|
|
13
|
+
export const cannotHaveAUsernamePasswordPort = /* @__PURE__ */ notImplemented("whatwg-url.cannotHaveAUsernamePasswordPort");
|
|
14
|
+
export const percentDecodeBytes = /* @__PURE__ */ notImplemented("whatwg-url.percentDecodeBytes");
|
|
15
|
+
export const percentDecodeString = /* @__PURE__ */ notImplemented("whatwg-url.percentDecodeString");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default globalThis;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { performance, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, PerformanceObserver, PerformanceObserverEntryList, PerformanceResourceTiming } from "../web/performance/index.mjs";
|
|
2
|
+
globalThis.performance ||= performance;
|
|
3
|
+
globalThis.Performance ||= Performance;
|
|
4
|
+
globalThis.PerformanceEntry ||= PerformanceEntry;
|
|
5
|
+
globalThis.PerformanceMark ||= PerformanceMark;
|
|
6
|
+
globalThis.PerformanceMeasure ||= PerformanceMeasure;
|
|
7
|
+
globalThis.PerformanceObserver ||= PerformanceObserver;
|
|
8
|
+
globalThis.PerformanceObserverEntryList ||= PerformanceObserverEntryList;
|
|
9
|
+
globalThis.PerformanceResourceTiming ||= PerformanceResourceTiming;
|
|
10
|
+
export default globalThis.performance;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import processModule from "node:process";
|
|
2
|
+
// Keep a reference to the original process to avoid circular references after polyfilling
|
|
3
|
+
const originalProcess = globalThis["process"];
|
|
4
|
+
globalThis.process = originalProcess ? new Proxy(originalProcess, { get(target, prop, receiver) {
|
|
5
|
+
if (Reflect.has(target, prop)) {
|
|
6
|
+
return Reflect.get(target, prop, receiver);
|
|
7
|
+
}
|
|
8
|
+
return Reflect.get(processModule, prop, receiver);
|
|
9
|
+
} }) : processModule;
|
|
10
|
+
export default globalThis.process;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This polyfill enables `node --enable-source-maps` effect in supported Node.js versions (22.14+, 23.7+)
|
|
2
|
+
// Docs: https://nodejs.org/api/module.html#modulesetsourcemapssupportenabled-options
|
|
3
|
+
try {
|
|
4
|
+
const nodeModule = globalThis.process?.getBuiltinModule?.("node:module");
|
|
5
|
+
// @ts-expect-error TODO: update Node.js types
|
|
6
|
+
if (nodeModule && !nodeModule.getSourceMapsSupport?.()?.enabled) {
|
|
7
|
+
// @ts-expect-error
|
|
8
|
+
nodeModule.setSourceMapsSupport?.(true, {
|
|
9
|
+
generatedCode: true,
|
|
10
|
+
nodeModules: true
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.warn("Failed to enable source maps support:", error);
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export type _PerformanceEntryType = "mark" | "measure" | "resource" | "event";
|
|
2
|
+
// --------------------------------------
|
|
3
|
+
// Performance entry polyfills
|
|
4
|
+
// --------------------------------------
|
|
5
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/supportedEntryTypes_static
|
|
6
|
+
export declare const _supportedEntryTypes: _PerformanceEntryType[];
|
|
7
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry
|
|
8
|
+
export declare class _PerformanceEntry implements globalThis.PerformanceEntry {
|
|
9
|
+
readonly __unenv__: true;
|
|
10
|
+
detail: any | undefined;
|
|
11
|
+
entryType: _PerformanceEntryType;
|
|
12
|
+
name: string;
|
|
13
|
+
startTime: number;
|
|
14
|
+
constructor(name: string, options?: PerformanceMarkOptions);
|
|
15
|
+
get duration(): number;
|
|
16
|
+
toJSON(): {};
|
|
17
|
+
}
|
|
18
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMark
|
|
19
|
+
export declare class _PerformanceMark extends _PerformanceEntry implements globalThis.PerformanceMark {
|
|
20
|
+
entryType: "mark";
|
|
21
|
+
}
|
|
22
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure
|
|
23
|
+
export declare class _PerformanceMeasure extends _PerformanceEntry implements globalThis.PerformanceMeasure {
|
|
24
|
+
entryType: "measure";
|
|
25
|
+
}
|
|
26
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming
|
|
27
|
+
export declare class _PerformanceResourceTiming extends _PerformanceEntry implements globalThis.PerformanceResourceTiming {
|
|
28
|
+
entryType: "resource";
|
|
29
|
+
serverTiming: readonly PerformanceServerTiming[];
|
|
30
|
+
connectEnd: number;
|
|
31
|
+
connectStart: number;
|
|
32
|
+
decodedBodySize: number;
|
|
33
|
+
domainLookupEnd: number;
|
|
34
|
+
domainLookupStart: number;
|
|
35
|
+
encodedBodySize: number;
|
|
36
|
+
fetchStart: number;
|
|
37
|
+
initiatorType: string;
|
|
38
|
+
name: string;
|
|
39
|
+
nextHopProtocol: string;
|
|
40
|
+
redirectEnd: number;
|
|
41
|
+
redirectStart: number;
|
|
42
|
+
requestStart: number;
|
|
43
|
+
responseEnd: number;
|
|
44
|
+
responseStart: number;
|
|
45
|
+
secureConnectionStart: number;
|
|
46
|
+
startTime: number;
|
|
47
|
+
transferSize: number;
|
|
48
|
+
workerStart: number;
|
|
49
|
+
responseStatus: number;
|
|
50
|
+
}
|
|
51
|
+
// --------------------------------------
|
|
52
|
+
// PerformanceObserver polyfill
|
|
53
|
+
// --------------------------------------
|
|
54
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver
|
|
55
|
+
export declare class _PerformanceObserver implements globalThis.PerformanceObserver {
|
|
56
|
+
readonly __unenv__: true;
|
|
57
|
+
static supportedEntryTypes: ReadonlyArray<string>;
|
|
58
|
+
_callback: PerformanceObserverCallback | null;
|
|
59
|
+
constructor(callback: PerformanceObserverCallback);
|
|
60
|
+
takeRecords(): unknown;
|
|
61
|
+
disconnect(): void;
|
|
62
|
+
observe(options: PerformanceObserverInit): void;
|
|
63
|
+
}
|
|
64
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserverEntryList
|
|
65
|
+
export declare class _PerformanceObserverEntryList implements globalThis.PerformanceObserverEntryList {
|
|
66
|
+
readonly __unenv__: true;
|
|
67
|
+
getEntries(): PerformanceEntryList;
|
|
68
|
+
getEntriesByName(_name: string, _type?: string | undefined): PerformanceEntryList;
|
|
69
|
+
getEntriesByType(type: string): PerformanceEntryList;
|
|
70
|
+
}
|
|
71
|
+
// --------------------------------------
|
|
72
|
+
// Performance polyfill
|
|
73
|
+
// --------------------------------------
|
|
74
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Performance
|
|
75
|
+
export declare class _Performance<PerformanceEntryT extends PerformanceEntry = PerformanceEntry> implements globalThis.Performance {
|
|
76
|
+
readonly __unenv__: true;
|
|
77
|
+
timeOrigin: number;
|
|
78
|
+
eventCounts: EventCounts;
|
|
79
|
+
_entries: PerformanceEntry[];
|
|
80
|
+
_resourceTimingBufferSize: number;
|
|
81
|
+
navigation: any;
|
|
82
|
+
timing: any;
|
|
83
|
+
onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
|
|
84
|
+
now(): number;
|
|
85
|
+
clearMarks(markName?: string | undefined): void;
|
|
86
|
+
clearMeasures(measureName?: string | undefined): void;
|
|
87
|
+
clearResourceTimings(): void;
|
|
88
|
+
getEntries(): PerformanceEntryT[];
|
|
89
|
+
getEntriesByName(name: string, type?: string | undefined): PerformanceEntryT[];
|
|
90
|
+
getEntriesByType(type: string): PerformanceEntryT[];
|
|
91
|
+
mark(name: string, options?: PerformanceMarkOptions | undefined): PerformanceMark;
|
|
92
|
+
measure(measureName: string, startOrMeasureOptions?: string | PerformanceMeasureOptions, endMark?: string): PerformanceMeasure;
|
|
93
|
+
setResourceTimingBufferSize(maxSize: number): void;
|
|
94
|
+
toJSON();
|
|
95
|
+
addEventListener<K extends "resourcetimingbufferfull">(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
96
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
97
|
+
removeEventListener<K extends "resourcetimingbufferfull">(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void;
|
|
98
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
99
|
+
dispatchEvent(event: Event): boolean;
|
|
100
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
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
|
+
// --------------------------------------
|
|
5
|
+
// Performance entry polyfills
|
|
6
|
+
// --------------------------------------
|
|
7
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/supportedEntryTypes_static
|
|
8
|
+
export const _supportedEntryTypes = [
|
|
9
|
+
"event",
|
|
10
|
+
"mark",
|
|
11
|
+
"measure",
|
|
12
|
+
"resource"
|
|
13
|
+
];
|
|
14
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry
|
|
15
|
+
export class _PerformanceEntry {
|
|
16
|
+
__unenv__ = true;
|
|
17
|
+
detail;
|
|
18
|
+
entryType = "event";
|
|
19
|
+
name;
|
|
20
|
+
startTime;
|
|
21
|
+
constructor(name, options) {
|
|
22
|
+
this.name = name;
|
|
23
|
+
this.startTime = options?.startTime || _performanceNow();
|
|
24
|
+
this.detail = options?.detail;
|
|
25
|
+
}
|
|
26
|
+
get duration() {
|
|
27
|
+
return _performanceNow() - this.startTime;
|
|
28
|
+
}
|
|
29
|
+
toJSON() {
|
|
30
|
+
return {
|
|
31
|
+
name: this.name,
|
|
32
|
+
entryType: this.entryType,
|
|
33
|
+
startTime: this.startTime,
|
|
34
|
+
duration: this.duration,
|
|
35
|
+
detail: this.detail
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMark
|
|
40
|
+
export class _PerformanceMark extends _PerformanceEntry {
|
|
41
|
+
entryType = "mark";
|
|
42
|
+
}
|
|
43
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure
|
|
44
|
+
export class _PerformanceMeasure extends _PerformanceEntry {
|
|
45
|
+
entryType = "measure";
|
|
46
|
+
}
|
|
47
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming
|
|
48
|
+
export class _PerformanceResourceTiming extends _PerformanceEntry {
|
|
49
|
+
entryType = "resource";
|
|
50
|
+
serverTiming = [];
|
|
51
|
+
connectEnd = 0;
|
|
52
|
+
connectStart = 0;
|
|
53
|
+
decodedBodySize = 0;
|
|
54
|
+
domainLookupEnd = 0;
|
|
55
|
+
domainLookupStart = 0;
|
|
56
|
+
encodedBodySize = 0;
|
|
57
|
+
fetchStart = 0;
|
|
58
|
+
initiatorType = "";
|
|
59
|
+
name = "";
|
|
60
|
+
nextHopProtocol = "";
|
|
61
|
+
redirectEnd = 0;
|
|
62
|
+
redirectStart = 0;
|
|
63
|
+
requestStart = 0;
|
|
64
|
+
responseEnd = 0;
|
|
65
|
+
responseStart = 0;
|
|
66
|
+
secureConnectionStart = 0;
|
|
67
|
+
startTime = 0;
|
|
68
|
+
transferSize = 0;
|
|
69
|
+
workerStart = 0;
|
|
70
|
+
responseStatus = 0;
|
|
71
|
+
}
|
|
72
|
+
// --------------------------------------
|
|
73
|
+
// PerformanceObserver polyfill
|
|
74
|
+
// --------------------------------------
|
|
75
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver
|
|
76
|
+
export class _PerformanceObserver {
|
|
77
|
+
__unenv__ = true;
|
|
78
|
+
static supportedEntryTypes = _supportedEntryTypes;
|
|
79
|
+
_callback = null;
|
|
80
|
+
constructor(callback) {
|
|
81
|
+
this._callback = callback;
|
|
82
|
+
}
|
|
83
|
+
takeRecords() {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
disconnect() {
|
|
87
|
+
throw createNotImplementedError("PerformanceObserver.disconnect");
|
|
88
|
+
}
|
|
89
|
+
observe(options) {
|
|
90
|
+
throw createNotImplementedError("PerformanceObserver.observe");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserverEntryList
|
|
94
|
+
export class _PerformanceObserverEntryList {
|
|
95
|
+
__unenv__ = true;
|
|
96
|
+
getEntries() {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
getEntriesByName(_name, _type) {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
getEntriesByType(type) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// --------------------------------------
|
|
107
|
+
// Performance polyfill
|
|
108
|
+
// --------------------------------------
|
|
109
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Performance
|
|
110
|
+
export class _Performance {
|
|
111
|
+
__unenv__ = true;
|
|
112
|
+
timeOrigin = _timeOrigin;
|
|
113
|
+
eventCounts = new Map();
|
|
114
|
+
_entries = [];
|
|
115
|
+
_resourceTimingBufferSize = 0;
|
|
116
|
+
navigation = undefined;
|
|
117
|
+
timing = undefined;
|
|
118
|
+
onresourcetimingbufferfull = null;
|
|
119
|
+
now() {
|
|
120
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Performance/now
|
|
121
|
+
if (this.timeOrigin === _timeOrigin) {
|
|
122
|
+
return _performanceNow();
|
|
123
|
+
}
|
|
124
|
+
return Date.now() - this.timeOrigin;
|
|
125
|
+
}
|
|
126
|
+
clearMarks(markName) {
|
|
127
|
+
this._entries = markName ? this._entries.filter((e) => e.name !== markName) : this._entries.filter((e) => e.entryType !== "mark");
|
|
128
|
+
}
|
|
129
|
+
clearMeasures(measureName) {
|
|
130
|
+
this._entries = measureName ? this._entries.filter((e) => e.name !== measureName) : this._entries.filter((e) => e.entryType !== "measure");
|
|
131
|
+
}
|
|
132
|
+
clearResourceTimings() {
|
|
133
|
+
this._entries = this._entries.filter((e) => e.entryType !== "resource" || e.entryType !== "navigation");
|
|
134
|
+
}
|
|
135
|
+
getEntries() {
|
|
136
|
+
return this._entries;
|
|
137
|
+
}
|
|
138
|
+
getEntriesByName(name, type) {
|
|
139
|
+
return this._entries.filter((e) => e.name === name && (!type || e.entryType === type));
|
|
140
|
+
}
|
|
141
|
+
getEntriesByType(type) {
|
|
142
|
+
return this._entries.filter((e) => e.entryType === type);
|
|
143
|
+
}
|
|
144
|
+
mark(name, options) {
|
|
145
|
+
const entry = new _PerformanceMark(name, options);
|
|
146
|
+
this._entries.push(entry);
|
|
147
|
+
return entry;
|
|
148
|
+
}
|
|
149
|
+
measure(measureName, startOrMeasureOptions, endMark) {
|
|
150
|
+
let start;
|
|
151
|
+
let end;
|
|
152
|
+
if (typeof startOrMeasureOptions === "string") {
|
|
153
|
+
start = this.getEntriesByName(startOrMeasureOptions, "mark")[0]?.startTime;
|
|
154
|
+
end = this.getEntriesByName(endMark, "mark")[0]?.startTime;
|
|
155
|
+
} else {
|
|
156
|
+
start = Number.parseFloat(startOrMeasureOptions?.start) || this.now();
|
|
157
|
+
end = Number.parseFloat(startOrMeasureOptions?.end) || this.now();
|
|
158
|
+
}
|
|
159
|
+
const entry = new _PerformanceMeasure(measureName, {
|
|
160
|
+
startTime: start,
|
|
161
|
+
detail: {
|
|
162
|
+
start,
|
|
163
|
+
end
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
this._entries.push(entry);
|
|
167
|
+
return entry;
|
|
168
|
+
}
|
|
169
|
+
setResourceTimingBufferSize(maxSize) {
|
|
170
|
+
this._resourceTimingBufferSize = maxSize;
|
|
171
|
+
}
|
|
172
|
+
toJSON() {
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
addEventListener(type, listener, options) {
|
|
176
|
+
throw createNotImplementedError("Performance.addEventListener");
|
|
177
|
+
}
|
|
178
|
+
removeEventListener(type, listener, options) {
|
|
179
|
+
throw createNotImplementedError("Performance.removeEventListener");
|
|
180
|
+
}
|
|
181
|
+
dispatchEvent(event) {
|
|
182
|
+
throw createNotImplementedError("Performance.dispatchEvent");
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { type _PerformanceEntryType, _PerformanceEntry, _PerformanceMark, _PerformanceMeasure, _PerformanceResourceTiming, _Performance, _PerformanceObserver, _PerformanceObserverEntryList } from "./_polyfills.mjs";
|
|
2
|
+
export declare const PerformanceEntry: typeof globalThis.PerformanceEntry;
|
|
3
|
+
export declare const PerformanceMark: typeof globalThis.PerformanceMark;
|
|
4
|
+
export declare const PerformanceMeasure: typeof globalThis.PerformanceMeasure;
|
|
5
|
+
export declare const PerformanceResourceTiming: typeof globalThis.PerformanceResourceTiming;
|
|
6
|
+
export declare const PerformanceObserver: typeof globalThis.PerformanceObserver;
|
|
7
|
+
export declare const Performance: typeof globalThis.Performance;
|
|
8
|
+
export declare const PerformanceObserverEntryList: typeof globalThis.PerformanceObserverEntryList;
|
|
9
|
+
// workerd implements a subset of globalThis.performance (as of last check, only timeOrigin set to 0 + now() implemented)
|
|
10
|
+
// We already use performance.now() from globalThis.performance, if provided (see top of this file)
|
|
11
|
+
// If we detect this condition, we can just use polyfill instead.
|
|
12
|
+
export declare const performance: unknown;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Performance_API
|
|
2
|
+
import { _PerformanceEntry, _PerformanceMark, _PerformanceMeasure, _PerformanceResourceTiming, _Performance, _PerformanceObserver, _PerformanceObserverEntryList } from "./_polyfills.mjs";
|
|
3
|
+
export { _PerformanceEntry, _PerformanceMark, _PerformanceMeasure, _PerformanceResourceTiming, _Performance, _PerformanceObserver, _PerformanceObserverEntryList } from "./_polyfills.mjs";
|
|
4
|
+
export const PerformanceEntry = globalThis.PerformanceEntry || _PerformanceEntry;
|
|
5
|
+
export const PerformanceMark = globalThis.PerformanceMark || _PerformanceMark;
|
|
6
|
+
export const PerformanceMeasure = globalThis.PerformanceMeasure || _PerformanceMeasure;
|
|
7
|
+
export const PerformanceResourceTiming = globalThis.PerformanceResourceTiming || _PerformanceResourceTiming;
|
|
8
|
+
export const PerformanceObserver = globalThis.PerformanceObserver || _PerformanceObserver;
|
|
9
|
+
export const Performance = globalThis.Performance || _Performance;
|
|
10
|
+
export const PerformanceObserverEntryList = globalThis.PerformanceObserverEntryList || _PerformanceObserverEntryList;
|
|
11
|
+
// workerd implements a subset of globalThis.performance (as of last check, only timeOrigin set to 0 + now() implemented)
|
|
12
|
+
// We already use performance.now() from globalThis.performance, if provided (see top of this file)
|
|
13
|
+
// If we detect this condition, we can just use polyfill instead.
|
|
14
|
+
export const performance = globalThis.performance && "addEventListener" in globalThis.performance ? globalThis.performance : new _Performance();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capsule-run/sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Capsule JavaScript SDK - run AI agent tasks in secure WASM sandboxes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "tsc",
|
|
33
|
+
"build": "tsc && node scripts/copy-unenv-polyfills.mjs",
|
|
34
34
|
"clean": "rm -rf dist"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|