From 5f541f52be789dce3b47a8a20b243eb01a72bfb3 Mon Sep 17 00:00:00 2001 From: ralph squillace Date: Sun, 15 Mar 2026 21:45:47 +0100 Subject: [PATCH 01/10] updating the toolchain Signed-off-by: ralph squillace --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b8889a3..76a06e6 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.87.0" +channel = "1.94.0" From 59de8cba1b03ba1b65e825999b7cd58b7ef489be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= Date: Mon, 16 Mar 2026 14:04:21 +0200 Subject: [PATCH 02/10] Update host to use wasi 0.2.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Prepare for multiple guest components - Upgrade the rust version used - Move hyperlight wit file under a `wit/host` directory Signed-off-by: Doru Blânzeanu --- Cargo.lock | 1267 ++++++++++++--------- README.md | 6 +- {guest => guest_rust}/Cargo.lock | 123 +- {guest => guest_rust}/Cargo.toml | 0 {guest => guest_rust}/LICENSE | 0 {guest => guest_rust}/README.md | 0 {guest => guest_rust}/src/lib.rs | 6 +- justfile | 36 +- src/types/random.rs | 3 + hyperlight.wit => wit/host/hyperlight.wit | 75 +- 10 files changed, 853 insertions(+), 663 deletions(-) rename {guest => guest_rust}/Cargo.lock (57%) rename {guest => guest_rust}/Cargo.toml (100%) rename {guest => guest_rust}/LICENSE (100%) rename {guest => guest_rust}/README.md (100%) rename {guest => guest_rust}/src/lib.rs (96%) rename hyperlight.wit => wit/host/hyperlight.wit (86%) diff --git a/Cargo.lock b/Cargo.lock index 8a8d0b4..1a7a0db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - [[package]] name = "adler2" version = "2.0.1" @@ -26,14 +17,14 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.8.26", + "zerocopy 0.8.42", ] [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] @@ -53,12 +44,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -70,9 +55,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.20" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -85,9 +70,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" @@ -100,29 +85,29 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anyhow" -version = "1.0.99" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "arrayref" @@ -138,16 +123,12 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" -version = "0.4.28" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6448dfb3960f0b038e88c781ead1e7eb7929dfc3a71a1336ec9086c00f6d1e75" +checksum = "d0f9ee0f6e02ffd7ad5816e9464499fba7b3effd01123b515c41d1697c43dad1" dependencies = [ - "brotli", "compression-codecs", "compression-core", - "flate2", - "futures-core", - "memchr", "pin-project-lite", "tokio", ] @@ -175,21 +156,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - [[package]] name = "base64" version = "0.22.1" @@ -204,21 +170,22 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.3" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "blake3" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", + "cpufeatures", ] [[package]] @@ -253,9 +220,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" dependencies = [ "memchr", "serde", @@ -273,9 +240,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] name = "byteorder" @@ -291,10 +258,11 @@ checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "cc" -version = "1.2.34" +version = "1.2.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc" +checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -302,9 +270,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" @@ -314,49 +282,46 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-link", + "windows-link 0.2.1", ] [[package]] name = "colorchoice" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "compression-codecs" -version = "0.4.28" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46cc6539bf1c592cff488b9f253b30bc0ec50d15407c2cf45e27bd8f308d5905" +checksum = "eb7b51a7d9c967fc26773061ba86150f19c50c0d65c887cb1fbe295fd16619b7" dependencies = [ "brotli", "compression-core", "flate2", - "futures-core", "memchr", - "pin-project-lite", ] [[package]] name = "compression-core" -version = "0.4.28" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2957e823c15bde7ecf1e8b64e537aa03a6be5fda0e2334e99887669e75b12e01" +checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" [[package]] name = "constant_time_eq" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" [[package]] name = "core-foundation" @@ -368,6 +333,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -409,9 +384,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -445,7 +420,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -467,16 +442,16 @@ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elfcore" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824386967a6a98e7f99d5c15d40cd1534b0ebfc4193a7109689dcf5322e8d744" +checksum = "0fdaa3d1c27119b3394513f4596894a40cd53cb4acec7fce636a9ca0c4abb171" dependencies = [ "libc", "nix", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.18", "tracing", - "zerocopy 0.7.35", + "zerocopy 0.8.42", ] [[package]] @@ -490,9 +465,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" dependencies = [ "log", "regex", @@ -500,9 +475,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" dependencies = [ "anstream", "anstyle", @@ -519,12 +494,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -535,31 +510,36 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "filetime" -version = "0.2.26" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" +checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.60.2", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + [[package]] name = "flatbuffers" -version = "25.2.10" +version = "25.12.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1045398c1bfd89168b5fd3f1fc11f6e70b34f6f66300c87d44d3de849463abf1" +checksum = "35f6839d7b3b98adde531effaf34f0c2badc6f4735d26fe74709d8e513a96ef3" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.11.0", "rustc_version", ] [[package]] name = "flate2" -version = "1.1.2" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", "miniz_oxide", @@ -603,9 +583,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", "futures-sink", @@ -613,21 +593,21 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", @@ -636,21 +616,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-core", "futures-io", @@ -659,7 +639,6 @@ dependencies = [ "futures-task", "memchr", "pin-project-lite", - "pin-utils", "slab", ] @@ -675,36 +654,43 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "r-efi 5.3.0", + "wasip2", "wasm-bindgen", ] [[package]] -name = "gimli" -version = "0.31.1" +name = "getrandom" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] [[package]] name = "git2" @@ -712,7 +698,7 @@ version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.11.0", "libc", "libgit2-sys", "log", @@ -721,9 +707,9 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.16" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" +checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" dependencies = [ "aho-corasick", "bstr", @@ -734,9 +720,9 @@ dependencies = [ [[package]] name = "goblin" -version = "0.10.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6a80adfd63bd7ffd94fefc3d22167880c440a724303080e5aa686fa36abaa96" +checksum = "983a6aafb3b12d4c41ea78d39e189af4298ce747353945ff5105b54a056e5cd9" dependencies = [ "log", "plain", @@ -745,9 +731,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ "atomic-waker", "bytes", @@ -772,6 +758,18 @@ dependencies = [ "serde", ] +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hex" version = "0.4.3" @@ -780,12 +778,11 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", - "fnv", "itoa", ] @@ -826,9 +823,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ "atomic-waker", "bytes", @@ -882,14 +879,13 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.16" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ "base64", "bytes", "futures-channel", - "futures-core", "futures-util", "http", "http-body", @@ -898,9 +894,10 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.0", + "socket2", "system-configuration", "tokio", + "tower-layer", "tower-service", "tracing", "windows-registry", @@ -908,9 +905,9 @@ dependencies = [ [[package]] name = "hyperlight-common" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6acd5b66984215357ca8b48a941b8dd330b857112a25206577f75ce33746a189" +checksum = "f7f54e238983959d8b6df4c3ba649eb0419525ce70c640a81bd187b5c9ee6370" dependencies = [ "anyhow", "flatbuffers", @@ -921,9 +918,9 @@ dependencies = [ [[package]] name = "hyperlight-component-macro" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e190be8d182a819afa6356e0b494b3c3b94a95647c7f049a2d15c684e2b2c2" +checksum = "7503ed5b290f80e869876fcf2f48846432b954c285caace4cddb1edcbafea216" dependencies = [ "env_logger", "hyperlight-component-util", @@ -932,14 +929,14 @@ dependencies = [ "proc-macro2", "quote", "syn", - "wasmparser", + "wasmparser 0.238.1", ] [[package]] name = "hyperlight-component-util" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab31eb8c6e7c7eb0fddcd32a8171ebfd5afa8e562e5fabd398cba61846be13c2" +checksum = "c57729c707663f0973658cc96fc34bc7e32b9ceea4c36a1964a306601df69b95" dependencies = [ "itertools", "log", @@ -947,17 +944,17 @@ dependencies = [ "proc-macro2", "quote", "syn", - "wasmparser", + "wasmparser 0.238.1", ] [[package]] name = "hyperlight-host" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e534de1b3618e476bd15361587a941834b273888f3411585498c63fadeeed82" +checksum = "54b93b8262196a19ddf6d43484b94e890e828aac0b99b0b2e55649da6e8df6a1" dependencies = [ "anyhow", - "bitflags 2.9.3", + "bitflags 2.11.0", "blake3", "cfg-if", "cfg_aliases", @@ -982,14 +979,14 @@ dependencies = [ "serde_json", "sha256", "termcolor", - "thiserror 2.0.16", + "thiserror 2.0.18", "tracing", "tracing-core", "tracing-log", "uuid", "vmm-sys-util", "windows", - "windows-result", + "windows-result 0.3.4", "windows-sys 0.60.2", "windows-version", ] @@ -1023,7 +1020,7 @@ version = "0.0.0" dependencies = [ "anyhow", "bytes", - "getrandom 0.3.3", + "getrandom 0.3.4", "http-body-util", "hyper", "hyper-util", @@ -1037,9 +1034,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.63" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1047,7 +1044,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core", + "windows-core 0.62.2", ] [[package]] @@ -1061,9 +1058,9 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", "potential_utf", @@ -1074,9 +1071,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", @@ -1087,11 +1084,10 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", @@ -1102,42 +1098,38 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", - "potential_utf", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", "icu_locale_core", - "stable_deref_trait", - "tinystr", "writeable", "yoke", "zerofrom", @@ -1145,6 +1137,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + [[package]] name = "idna" version = "1.1.0" @@ -1168,37 +1166,27 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.11.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.16.1", "serde", -] - -[[package]] -name = "io-uring" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" -dependencies = [ - "bitflags 2.9.3", - "cfg-if", - "libc", + "serde_core", ] [[package]] name = "ipnet" -version = "2.11.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" [[package]] name = "iri-string" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" dependencies = [ "memchr", "serde", @@ -1206,9 +1194,9 @@ dependencies = [ [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" @@ -1221,28 +1209,28 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jiff" -version = "0.2.15" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" dependencies = [ "jiff-static", "log", "portable-atomic", "portable-atomic-util", - "serde", + "serde_core", ] [[package]] name = "jiff-static" -version = "0.2.15" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" dependencies = [ "proc-macro2", "quote", @@ -1255,15 +1243,15 @@ version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" dependencies = [ "once_cell", "wasm-bindgen", @@ -1284,7 +1272,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "333f77a20344a448f3f70664918135fddeb804e938f28a99d685bd92926e0b19" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.11.0", "kvm-bindings", "libc", "vmm-sys-util", @@ -1296,11 +1284,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" -version = "0.2.175" +version = "0.2.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" [[package]] name = "libgit2-sys" @@ -1316,20 +1310,21 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.9" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" +checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.11.0", "libc", - "redox_syscall", + "plain", + "redox_syscall 0.7.3", ] [[package]] name = "libz-sys" -version = "1.1.22" +version = "1.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" +checksum = "d52f4c29e2a68ac30c9087e1b772dc9f44a2b66ed44edf2266cf2be9b03dafc1" dependencies = [ "cc", "libc", @@ -1339,31 +1334,30 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.9.4" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "lock_api" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.27" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "lru-slab" @@ -1373,15 +1367,15 @@ checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" [[package]] name = "memchr" -version = "2.7.5" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "metrics" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dea7ac8057892855ec285c440160265225438c3c45072613c25a4b26e98ef5" +checksum = "5d5312e9ba3771cfa961b585728215e3d972c950a3eed9252aa093d6301277e8" dependencies = [ "ahash", "portable-atomic", @@ -1400,17 +1394,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "simd-adler32", ] [[package]] name = "mio" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", + "wasi", + "windows-sys 0.61.2", ] [[package]] @@ -1434,7 +1429,7 @@ dependencies = [ "libc", "num_enum", "vmm-sys-util", - "zerocopy 0.8.26", + "zerocopy 0.8.42", ] [[package]] @@ -1457,15 +1452,15 @@ checksum = "89abe853221fa6f14ad4066affb9abda241a03d65622887d5794e1422d0bd75a" dependencies = [ "libc", "mshv-bindings 0.3.2", - "thiserror 2.0.16", + "thiserror 2.0.18", "vmm-sys-util", ] [[package]] name = "native-tls" -version = "0.2.14" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" dependencies = [ "libc", "log", @@ -1480,12 +1475,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.4" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +checksum = "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.11.0", "cfg-if", + "cfg_aliases", "libc", ] @@ -1500,9 +1496,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" dependencies = [ "num_enum_derive", "rustversion", @@ -1510,43 +1506,34 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openssl" -version = "0.10.73" +version = "0.10.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +checksum = "951c002c75e16ea2c65b8c7e4d3d51d5530d8dfa7d060b4776828c88cfb18ecf" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.11.0", "cfg-if", "foreign-types", "libc", @@ -1568,15 +1555,15 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.6" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "openssl-sys" -version = "0.9.109" +version = "0.9.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +checksum = "57d55af3b3e226502be1526dfdba67ab0e9c96fc293004e79576b2b9edb0dbdb" dependencies = [ "cc", "libc", @@ -1602,9 +1589,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -1612,15 +1599,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.11" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.18", "smallvec", - "windows-targets 0.52.6", + "windows-link 0.2.1", ] [[package]] @@ -1631,9 +1618,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pin-utils" @@ -1655,24 +1642,24 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3" dependencies = [ "portable-atomic", ] [[package]] name = "potential_utf" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" dependencies = [ "zerovec", ] @@ -1683,7 +1670,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.26", + "zerocopy 0.8.42", ] [[package]] @@ -1698,18 +1685,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.101" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quinn" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", "cfg_aliases", @@ -1718,8 +1705,8 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.5.10", - "thiserror 2.0.16", + "socket2", + "thiserror 2.0.18", "tokio", "tracing", "web-time", @@ -1727,12 +1714,12 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.12" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" dependencies = [ "bytes", - "getrandom 0.3.3", + "getrandom 0.3.4", "lru-slab", "rand", "ring", @@ -1740,7 +1727,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.16", + "thiserror 2.0.18", "tinyvec", "tracing", "web-time", @@ -1748,23 +1735,23 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.10", + "socket2", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -1775,6 +1762,12 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "rand" version = "0.9.2" @@ -1797,20 +1790,29 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.3" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "getrandom 0.3.3", + "bitflags 2.11.0", ] [[package]] name = "redox_syscall" -version = "0.5.17" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" +checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.11.0", ] [[package]] @@ -1819,16 +1821,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", "libredox", - "thiserror 2.0.16", + "thiserror 2.0.18", ] [[package]] name = "regex" -version = "1.11.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -1838,9 +1840,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.10" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -1849,17 +1851,16 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.6" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "reqwest" -version = "0.12.23" +version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ - "async-compression", "base64", "bytes", "encoding_rs", @@ -1910,7 +1911,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.16", + "getrandom 0.2.17", "libc", "untrusted", "windows-sys 0.52.0", @@ -1918,9 +1919,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.7.2" +version = "8.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "025908b8682a26ba8d12f6f2d66b987584a4a87bc024abc5bbc12553a8cd178a" +checksum = "04113cb9355a377d83f06ef1f0a45b8ab8cd7d8b1288160717d66df5c7988d27" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1929,9 +1930,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.7.2" +version = "8.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6065f1a4392b71819ec1ea1df1120673418bf386f50de1d6f54204d836d4349c" +checksum = "da0902e4c7c8e997159ab384e6d0fc91c221375f6894346ae107f47dd0f3ccaa" dependencies = [ "proc-macro2", "quote", @@ -1943,21 +1944,15 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "8.7.2" +version = "8.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6cc0c81648b20b70c491ff8cce00c1c3b223bb8ed2b5d41f0e54c6c4c0a3594" +checksum = "5bcdef0be6fe7f6fa333b1073c949729274b05f123a0ad7efcb8efd878e5c3b1" dependencies = [ "globset", "sha2", "walkdir", ] -[[package]] -name = "rustc-demangle" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" - [[package]] name = "rustc-hash" version = "2.1.1" @@ -1975,22 +1970,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.8" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.11.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "rustls" -version = "0.23.31" +version = "0.23.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" +checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" dependencies = [ "once_cell", "ring", @@ -2002,9 +1997,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ "web-time", "zeroize", @@ -2012,9 +2007,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.4" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring", "rustls-pki-types", @@ -2029,9 +2024,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "same-file" @@ -2044,11 +2039,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.27" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2068,9 +2063,9 @@ dependencies = [ [[package]] name = "scroll_derive" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc4f90c27b57691bbaf11d8ecc7cfbfe98a4da6dbe60226115d322aa80c06e" +checksum = "ed76efe62313ab6610570951494bdaa81568026e0318eaa55f167de70eeea67d" dependencies = [ "proc-macro2", "quote", @@ -2079,12 +2074,12 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.9.3", - "core-foundation", + "bitflags 2.11.0", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -2092,9 +2087,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" dependencies = [ "core-foundation-sys", "libc", @@ -2102,24 +2097,34 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -2128,14 +2133,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.143" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", - "ryu", "serde", + "serde_core", + "zmij", ] [[package]] @@ -2176,9 +2182,9 @@ dependencies = [ [[package]] name = "shellexpand" -version = "3.1.1" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1fdf65dd6331831494dd616b30351c38e96e45921a27745cf98490458b90bb" +checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8" dependencies = [ "dirs", ] @@ -2191,18 +2197,25 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.6" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + [[package]] name = "slab" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" @@ -2212,22 +2225,12 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.5.10" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "socket2" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" -dependencies = [ - "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2241,9 +2244,9 @@ dependencies = [ [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "subtle" @@ -2253,9 +2256,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.106" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -2284,12 +2287,12 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ - "bitflags 2.9.3", - "core-foundation", + "bitflags 2.11.0", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -2316,15 +2319,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.21.0" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.3", + "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2347,11 +2350,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.16" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.16", + "thiserror-impl 2.0.18", ] [[package]] @@ -2367,9 +2370,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.16" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", @@ -2378,9 +2381,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", @@ -2388,9 +2391,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" dependencies = [ "tinyvec_macros", ] @@ -2403,29 +2406,26 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.47.1" +version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" dependencies = [ - "backtrace", "bytes", - "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", - "slab", - "socket2 0.6.0", + "socket2", "tokio-macros", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" dependencies = [ "proc-macro2", "quote", @@ -2444,9 +2444,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ "rustls", "tokio", @@ -2454,9 +2454,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.16" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -2467,9 +2467,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", @@ -2482,17 +2482,22 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ - "bitflags 2.9.3", + "async-compression", + "bitflags 2.11.0", "bytes", + "futures-core", "futures-util", "http", "http-body", + "http-body-util", "iri-string", "pin-project-lite", + "tokio", + "tokio-util", "tower", "tower-layer", "tower-service", @@ -2512,9 +2517,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", @@ -2524,9 +2529,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", @@ -2535,9 +2540,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -2562,15 +2567,21 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-xid" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "untrusted" @@ -2580,9 +2591,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.7" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", @@ -2604,11 +2615,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.4.2", "js-sys", "wasm-bindgen", ] @@ -2667,47 +2678,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" +name = "wasip2" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] -name = "wasm-bindgen" -version = "0.2.100" +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", + "wit-bindgen", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" +name = "wasm-bindgen" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -2716,9 +2724,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2726,26 +2734,48 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser 0.244.0", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser 0.244.0", +] + [[package]] name = "wasm-streams" version = "0.4.2" @@ -2761,22 +2791,34 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.238.0" +version = "0.238.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ad4ca2ecb86b79ea410cd970985665de1d05774b7107b214bc5852b1bcbad7" +checksum = "3fa99c8328024423875ae4a55345cfde8f0371327fb2d0f33b0f52a06fc44408" dependencies = [ - "bitflags 2.9.3", - "hashbrown", + "bitflags 2.11.0", + "hashbrown 0.15.5", "indexmap", "semver", "serde", ] +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags 2.11.0", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" dependencies = [ "js-sys", "wasm-bindgen", @@ -2794,9 +2836,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.2" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2" +checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" dependencies = [ "rustls-pki-types", ] @@ -2819,11 +2861,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2839,9 +2881,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ "windows-collections", - "windows-core", + "windows-core 0.61.2", "windows-future", - "windows-link", + "windows-link 0.1.3", "windows-numerics", ] @@ -2851,7 +2893,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" dependencies = [ - "windows-core", + "windows-core 0.61.2", ] [[package]] @@ -2862,9 +2904,22 @@ checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ "windows-implement", "windows-interface", - "windows-link", - "windows-result", - "windows-strings", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", ] [[package]] @@ -2873,16 +2928,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ - "windows-core", - "windows-link", + "windows-core 0.61.2", + "windows-link 0.1.3", "windows-threading", ] [[package]] name = "windows-implement" -version = "0.60.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", @@ -2891,9 +2946,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.1" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", @@ -2906,25 +2961,31 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-numerics" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ - "windows-core", - "windows-link", + "windows-core 0.61.2", + "windows-link 0.1.3", ] [[package]] name = "windows-registry" -version = "0.5.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-link", - "windows-result", - "windows-strings", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", ] [[package]] @@ -2933,7 +2994,16 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", ] [[package]] @@ -2942,7 +3012,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", ] [[package]] @@ -2956,20 +3035,20 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.53.5", ] [[package]] name = "windows-sys" -version = "0.60.2" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-targets 0.53.3", + "windows-link 0.2.1", ] [[package]] @@ -2990,19 +3069,19 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.3" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -3011,16 +3090,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] name = "windows-version" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04a5c6627e310a23ad2358483286c7df260c964eb2d003d8efd6d0f4e79265c" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -3031,9 +3110,9 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -3043,9 +3122,9 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -3055,9 +3134,9 @@ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[package]] name = "windows_i686_gnullvm" @@ -3067,9 +3146,9 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -3079,9 +3158,9 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -3091,9 +3170,9 @@ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -3103,9 +3182,9 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -3115,30 +3194,109 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.53.0" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags 2.11.0", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser 0.244.0", + "wit-parser", +] [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "wit-parser" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ - "bitflags 2.9.3", + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.244.0", ] [[package]] name = "writeable" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "xattr" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3a19837351dc82ba89f8a125e22a3c475f05aba604acc023d62b2739ae2909" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", "rustix", @@ -3146,11 +3304,10 @@ dependencies = [ [[package]] name = "yoke" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -3158,9 +3315,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", @@ -3180,11 +3337,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.26" +version = "0.8.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +checksum = "f2578b716f8a7a858b7f02d5bd870c14bf4ddbbcf3a4c05414ba6503640505e3" dependencies = [ - "zerocopy-derive 0.8.26", + "zerocopy-derive 0.8.42", ] [[package]] @@ -3200,9 +3357,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.26" +version = "0.8.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +checksum = "7e6cc098ea4d3bd6246687de65af3f920c430e236bee1e3bf2e441463f08a02f" dependencies = [ "proc-macro2", "quote", @@ -3232,15 +3389,15 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zerotrie" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" dependencies = [ "displaydoc", "yoke", @@ -3249,9 +3406,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", @@ -3260,11 +3417,17 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", "syn", ] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/README.md b/README.md index 0423372..0cc0387 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ cargo build Build the guest component: ```sh cargo component build --release \ - --manifest-path guest/Cargo.toml \ + --manifest-path guest_rust/Cargo.toml \ --target-dir target ``` @@ -73,11 +73,11 @@ AOT compile it: cargo install hyperlight-wasm-aot hyperlight-wasm-aot compile --component \ target/wasm32-wasip1/release/sample_wasi_http_rust.wasm \ - target/wasm32-wasip1/release/sample_wasi_http_rust.bin + out/sample_wasi_http_rust.aot ``` You can then run the server: ```sh -cargo run -- target/wasm32-wasip1/release/sample_wasi_http_rust.bin +cargo run -- out/sample_wasi_http_rust.aot ``` diff --git a/guest/Cargo.lock b/guest_rust/Cargo.lock similarity index 57% rename from guest/Cargo.lock rename to guest_rust/Cargo.lock index c41e459..5bc3c79 100644 --- a/guest/Cargo.lock +++ b/guest_rust/Cargo.lock @@ -2,11 +2,17 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + [[package]] name = "bitflags" -version = "2.9.3" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "bytes" @@ -14,93 +20,83 @@ version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - [[package]] name = "http" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", - "fnv", "itoa", ] [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "memchr" -version = "2.7.5" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "proc-macro2" -version = "1.0.101" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - [[package]] name = "sample-wasi-http-rust" version = "0.0.0" dependencies = [ - "wit-bindgen-rt 0.44.0", + "wit-bindgen-rt", "wstd", ] [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -109,27 +105,28 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.143" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", - "ryu", "serde", + "serde_core", + "zmij", ] [[package]] name = "slab" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "syn" -version = "2.0.106" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -138,24 +135,24 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" +name = "wasip2" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ - "wit-bindgen-rt 0.39.0", + "wit-bindgen", ] [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "wit-bindgen" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" dependencies = [ "bitflags", ] @@ -171,27 +168,33 @@ dependencies = [ [[package]] name = "wstd" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f51495e1ae93476d1629b5810bd6068fdf22545a8ada7ea5929e2faed7b793" +checksum = "d0736607b57fcb58dd3148cf34d6a6ca63ba041fde8a12ab3f2c48ddf6d11877" dependencies = [ - "futures-core", + "async-task", "http", "itoa", "pin-project-lite", "serde", "serde_json", "slab", - "wasi", + "wasip2", "wstd-macro", ] [[package]] name = "wstd-macro" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225ac858e4405bdf164d92d070422c0b3b9b81f9b0b68836841f4d1bafc446b3" +checksum = "cb142608f932022fa7d155d8ed99649d02c56a50532e71913a5a03c7c4e288d3" dependencies = [ "quote", "syn", ] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/guest/Cargo.toml b/guest_rust/Cargo.toml similarity index 100% rename from guest/Cargo.toml rename to guest_rust/Cargo.toml diff --git a/guest/LICENSE b/guest_rust/LICENSE similarity index 100% rename from guest/LICENSE rename to guest_rust/LICENSE diff --git a/guest/README.md b/guest_rust/README.md similarity index 100% rename from guest/README.md rename to guest_rust/README.md diff --git a/guest/src/lib.rs b/guest_rust/src/lib.rs similarity index 96% rename from guest/src/lib.rs rename to guest_rust/src/lib.rs index 0203455..d39b2e8 100644 --- a/guest/src/lib.rs +++ b/guest_rust/src/lib.rs @@ -1,7 +1,7 @@ use wstd::http::body::{BodyForthcoming, IncomingBody}; use wstd::http::server::{Finished, Responder}; use wstd::http::{IntoBody, Request, Response, StatusCode}; -use wstd::io::{copy, empty, AsyncWrite}; +use wstd::io::{AsyncWrite, copy, empty}; use wstd::time::{Duration, Instant}; #[wstd::http_server] @@ -19,7 +19,7 @@ async fn main(req: Request, res: Responder) -> Finished { async fn home(_req: Request, res: Responder) -> Finished { // To send a single string as the response body, use `res::respond`. - res.respond(Response::new("Hello, wasi:http/proxy world!\n".into_body())) + res.respond(Response::new("Hello, Rust wasi:http world!\n".into_body())) .await } @@ -97,4 +97,4 @@ async fn proxy(_req: Request, res: Responder) -> Finished { let mut body = res.start_response(Response::new(BodyForthcoming)); let result = copy(upstream_res.body_mut(), &mut body).await; Finished::finish(body, result, None) -} \ No newline at end of file +} diff --git a/justfile b/justfile index 57182b4..d43b4a7 100644 --- a/justfile +++ b/justfile @@ -1,29 +1,27 @@ TARGET_DIR := justfile_directory() + "/target" BIN_DIR := TARGET_DIR + "/bin" -GUEST_DIR := justfile_directory() + "/guest" +OUT_DIR := justfile_directory() + "/out" +default-target := "release" default: run -install-cargo-component: - test -f {{ BIN_DIR }}/cargo-component || \ - cargo install cargo-component \ - --root {{ TARGET_DIR }} - -build-component: install-cargo-component - test -f {{ TARGET_DIR }}/wasm32-wasip1/release/sample_wasi_http_rust.wasm || \ - cargo-component build --release \ - --manifest-path {{ GUEST_DIR }}/Cargo.toml \ - --target-dir {{ TARGET_DIR }} +make-out-dir: + mkdir -p {{ OUT_DIR }} install-hyperlight-wasm-aot: test -f {{ BIN_DIR }}/hyperlight-wasm-aot || \ cargo install hyperlight-wasm-aot \ + --locked \ + --version 0.9.0 \ --root {{ TARGET_DIR }} -aot-component: build-component install-hyperlight-wasm-aot - {{ BIN_DIR }}/hyperlight-wasm-aot compile --component \ - {{ TARGET_DIR }}/wasm32-wasip1/release/sample_wasi_http_rust.wasm \ - {{ TARGET_DIR }}/wasm32-wasip1/release/sample_wasi_http_rust.bin +build-rust-component target=default-target: make-out-dir install-hyperlight-wasm-aot + cargo component build \ + --profile={{ if target == "debug" { "dev" } else { target } }} \ + --manifest-path guest_rust/Cargo.toml \ + --target-dir {{ TARGET_DIR }} + cp {{ TARGET_DIR }}/wasm32-wasip1/{{ target }}/sample_wasi_http_rust.wasm {{ OUT_DIR }}/sample_wasi_http_rust.wasm + cd {{ OUT_DIR }} && {{ BIN_DIR }}/hyperlight-wasm-aot compile --component sample_wasi_http_rust.wasm install-wasm-tools: test -f {{ BIN_DIR }}/wasm-tools || \ @@ -31,11 +29,11 @@ install-wasm-tools: --root {{ TARGET_DIR }} make-wit-world: install-wasm-tools - test -f hyperlight-world.wasm || \ - {{ BIN_DIR }}/wasm-tools component wit hyperlight.wit -w -o hyperlight-world.wasm + {{ BIN_DIR }}/wasm-tools component wit wit/host/hyperlight.wit -w -o hyperlight-world.wasm build: make-wit-world cargo build -run: build aot-component - cargo run -- {{ TARGET_DIR }}/wasm32-wasip1/release/sample_wasi_http_rust.bin +run: build build-rust-component + cargo run -- {{ OUT_DIR }}/sample_wasi_http_rust.aot + diff --git a/src/types/random.rs b/src/types/random.rs index d0bb073..f334807 100644 --- a/src/types/random.rs +++ b/src/types/random.rs @@ -8,4 +8,7 @@ impl wasi::random::Random for WasiImpl { getrandom::fill(&mut buf).unwrap(); buf } + fn get_random_u64(&mut self) -> u64 { + getrandom::u64().unwrap() + } } diff --git a/hyperlight.wit b/wit/host/hyperlight.wit similarity index 86% rename from hyperlight.wit rename to wit/host/hyperlight.wit index 1802b79..ee71829 100644 --- a/hyperlight.wit +++ b/wit/host/hyperlight.wit @@ -1,20 +1,22 @@ package root:component; world root { - import wasi:io/poll@0.2.3; - import wasi:clocks/monotonic-clock@0.2.3; - import wasi:random/random@0.2.3; - import wasi:io/error@0.2.3; - import wasi:io/streams@0.2.3; - import wasi:cli/stdout@0.2.3; - import wasi:cli/stderr@0.2.3; - import wasi:cli/stdin@0.2.3; - import wasi:http/types@0.2.3; - import wasi:http/outgoing-handler@0.2.3; - - export wasi:http/incoming-handler@0.2.3; + import wasi:io/poll@0.2.9; + import wasi:clocks/monotonic-clock@0.2.9; + import wasi:random/random@0.2.9; + import wasi:io/error@0.2.9; + import wasi:io/streams@0.2.9; + import wasi:cli/stdout@0.2.9; + import wasi:cli/stderr@0.2.9; + import wasi:cli/stdin@0.2.9; + import wasi:http/types@0.2.9; + import wasi:http/outgoing-handler@0.2.9; + + export wasi:http/incoming-handler@0.2.9; + export wasi:cli/run@0.2.9; } -package wasi:io@0.2.3 { + +package wasi:io@0.2.9 { interface poll { resource pollable { ready: func() -> bool; @@ -61,9 +63,9 @@ package wasi:io@0.2.3 { } -package wasi:clocks@0.2.3 { +package wasi:clocks@0.2.9 { interface monotonic-clock { - use wasi:io/poll@0.2.3.{pollable}; + use wasi:io/poll@0.2.9.{pollable}; type instant = u64; @@ -77,17 +79,31 @@ package wasi:clocks@0.2.3 { subscribe-duration: func(when: duration) -> pollable; } + interface wall-clock { + record datetime { + seconds: u64, + nanoseconds: u32, + } + + now: func() -> datetime; + + resolution: func() -> datetime; + } } -package wasi:random@0.2.3 { +package wasi:random@0.2.9 { interface random { get-random-bytes: func(len: u64) -> list; + get-random-u64: func() -> u64; + } + interface insecure-seed { + insecure-seed: func() -> tuple; } } -package wasi:cli@0.2.3 { +package wasi:cli@0.2.9 { interface environment { get-environment: func() -> list>; @@ -96,17 +112,17 @@ package wasi:cli@0.2.3 { initial-cwd: func() -> option; } interface stdin { - use wasi:io/streams@0.2.3.{input-stream}; + use wasi:io/streams@0.2.9.{input-stream}; get-stdin: func() -> input-stream; } interface stdout { - use wasi:io/streams@0.2.3.{output-stream}; + use wasi:io/streams@0.2.9.{output-stream}; get-stdout: func() -> output-stream; } interface stderr { - use wasi:io/streams@0.2.3.{output-stream}; + use wasi:io/streams@0.2.9.{output-stream}; get-stderr: func() -> output-stream; } @@ -131,16 +147,22 @@ package wasi:cli@0.2.3 { get-terminal-stderr: func() -> option; } + interface run { + run: func() -> result; + } + interface exit { + exit: func(status: result); + } } -package wasi:http@0.2.3 { +package wasi:http@0.2.9 { interface types { - use wasi:clocks/monotonic-clock@0.2.3.{duration}; - use wasi:io/streams@0.2.3.{input-stream}; - use wasi:io/poll@0.2.3.{pollable}; - use wasi:io/streams@0.2.3.{output-stream}; - use wasi:io/error@0.2.3.{error as io-error}; + use wasi:clocks/monotonic-clock@0.2.9.{duration}; + use wasi:io/streams@0.2.9.{input-stream}; + use wasi:io/poll@0.2.9.{pollable}; + use wasi:io/streams@0.2.9.{output-stream}; + use wasi:io/error@0.2.9.{error as io-error}; resource fields { constructor(); @@ -332,3 +354,4 @@ package wasi:http@0.2.3 { handle: func(request: incoming-request, response-out: response-outparam); } } + From 5254f245c25bae37f048a9720d7c8884feea18b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= Date: Tue, 17 Mar 2026 15:42:19 +0200 Subject: [PATCH 03/10] Add JS guest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implement clocks/wall-clock - Implement cli/environment Signed-off-by: Doru Blânzeanu --- README.md | 24 +- eslint.config.js | 15 + guest_js/endpoints/echo.js | 24 + guest_js/endpoints/sleep.js | 14 + guest_js/endpoints/upload.js | 24 + guest_js/server.js | 18 + justfile | 10 +- package-lock.json | 4437 ++++++++++++++++++++++++++++++++ package.json | 30 + rollup.config.js | 10 + src/types.rs | 19 + src/types/cli.rs | 22 + src/types/clocks_wall_clock.rs | 21 + wit/guest_js/world.wit | 2609 +++++++++++++++++++ wit/host/hyperlight.wit | 3 + 15 files changed, 7276 insertions(+), 4 deletions(-) create mode 100644 eslint.config.js create mode 100644 guest_js/endpoints/echo.js create mode 100644 guest_js/endpoints/sleep.js create mode 100644 guest_js/endpoints/upload.js create mode 100644 guest_js/server.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 rollup.config.js create mode 100644 src/types/clocks_wall_clock.rs create mode 100644 wit/guest_js/world.wit diff --git a/README.md b/README.md index 0cc0387..28ce412 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,11 @@ If you want to follow the manual build instructions, you will also need: ### Building +```sh +# Install JS dependencies +npm install +``` + ```sh just build ``` @@ -29,7 +34,11 @@ just build ### Running ```sh -just run +# Run Rust +just run-rust + +# Run JS +just run-js ``` From another terminal, you can then test the server: @@ -53,11 +62,16 @@ Compile the WIT and set the environment variables used when building wasm-tools component wit hyperlight.wit -w -o hyperlight-world.wasm ``` -Build: +Build Rust: ``` cargo build ``` +Build JS: +``` +npm run build +``` + ### Running Build the guest component: @@ -78,6 +92,12 @@ hyperlight-wasm-aot compile --component \ You can then run the server: +Rust: ```sh cargo run -- out/sample_wasi_http_rust.aot ``` + +JS: +```sh +cargo run -- out/sample_wasi_http_js.aot +``` diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..39b2d67 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,15 @@ +import { defineConfig } from "eslint/config"; +import js from "@eslint/js"; +import globals from "globals"; + +export default defineConfig([ + { + files: ["**/*.{js,mjs,cjs}"], + plugins: { js }, + extends: ["js/recommended"], + }, + { + files: ["**/*.{js,mjs,cjs}"], + languageOptions: { globals: globals.browser }, + }, +]); diff --git a/guest_js/endpoints/echo.js b/guest_js/endpoints/echo.js new file mode 100644 index 0000000..e4d232c --- /dev/null +++ b/guest_js/endpoints/echo.js @@ -0,0 +1,24 @@ +export { echo, echoHeaders }; + +// Echo the body of the request in the response +const echo = async (req) => { + const bodyText = req.body ? await req.text() : "No body to echo"; + + return new Response(bodyText, { + status: 200, + headers: { + "Content-Type": "text/plain", + }, + }); +}; + +// Echo all headers from the request in JSON format +const echoHeaders = (req) => { + const headersObj = Object.fromEntries(req.headers.entries()); + return new Response(JSON.stringify(headersObj, null, 2), { + status: 200, + headers: { + "Content-Type": "application/json", + }, + }); +}; diff --git a/guest_js/endpoints/sleep.js b/guest_js/endpoints/sleep.js new file mode 100644 index 0000000..6a032da --- /dev/null +++ b/guest_js/endpoints/sleep.js @@ -0,0 +1,14 @@ +export { sleep }; + +// Async sleep function that returns a response after waiting +const sleep = async (ms) => { + const msNum = parseInt(ms, 10); + await new Promise((resolve) => setTimeout(resolve, msNum)); + + return new Response(`Sleeping for ${ms}ms...`, { + status: 200, + headers: { + "Content-Type": "text/plain", + }, + }); +}; diff --git a/guest_js/endpoints/upload.js b/guest_js/endpoints/upload.js new file mode 100644 index 0000000..90f40ab --- /dev/null +++ b/guest_js/endpoints/upload.js @@ -0,0 +1,24 @@ +export { upload }; + +// Endpoint to handle file uploads using FormData and Blob +const upload = async (req) => { + try { + const blob = await req.blob(); + + if (!blob || !(blob instanceof Blob)) { + return new Response("File not found in form data.", { status: 400 }); + } + + const text = await blob.text(); + + return new Response(text, { + headers: { + "Content-Type": blob.type || "application/octet-stream", + }, + }); + } catch (error) { + return new Response(`Error processing form data: ${error}`, { + status: 500, + }); + } +}; diff --git a/guest_js/server.js b/guest_js/server.js new file mode 100644 index 0000000..9966298 --- /dev/null +++ b/guest_js/server.js @@ -0,0 +1,18 @@ +import { AutoRouter } from "itty-router"; + +import { sleep } from "./endpoints/sleep.js"; +import { upload } from "./endpoints/upload.js"; +import { echo, echoHeaders } from "./endpoints/echo.js"; + +let router = AutoRouter(); + +router + .get("/", () => new Response("Hello, JS wasi:http world!\n")) + .get("/echo-headers", (req) => echoHeaders(req)) + .get("/sleep/:ms", async ({ ms }) => await sleep(ms)) + .post("/echo", (req) => echo(req)) + .post("/upload", async (req) => await upload(req)); + +addEventListener("fetch", async (event) => { + event.respondWith(router.fetch(event.request)); +}); diff --git a/justfile b/justfile index d43b4a7..f15436b 100644 --- a/justfile +++ b/justfile @@ -3,7 +3,7 @@ BIN_DIR := TARGET_DIR + "/bin" OUT_DIR := justfile_directory() + "/out" default-target := "release" -default: run +default: run-rust make-out-dir: mkdir -p {{ OUT_DIR }} @@ -15,6 +15,10 @@ install-hyperlight-wasm-aot: --version 0.9.0 \ --root {{ TARGET_DIR }} +build-js-component: make-out-dir install-hyperlight-wasm-aot + npm run build + cd {{ OUT_DIR }} && {{ BIN_DIR }}/hyperlight-wasm-aot compile --component sample-wasi-http-js.wasm + build-rust-component target=default-target: make-out-dir install-hyperlight-wasm-aot cargo component build \ --profile={{ if target == "debug" { "dev" } else { target } }} \ @@ -34,6 +38,8 @@ make-wit-world: install-wasm-tools build: make-wit-world cargo build -run: build build-rust-component +run-rust: build build-rust-component cargo run -- {{ OUT_DIR }}/sample_wasi_http_rust.aot +run-js: build build-js-component + cargo run -- {{ OUT_DIR }}/sample-wasi-http-js.aot diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..0dff8f3 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4437 @@ +{ + "name": "sample-wasi-http-js", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sample-wasi-http-js", + "version": "1.0.0", + "dependencies": { + "@bytecodealliance/preview2-shim": "^0.17.8", + "itty-router": "^5.0.18" + }, + "devDependencies": { + "@bytecodealliance/componentize-js": "^0.19.3", + "@bytecodealliance/jco": "^1.15.4", + "@bytecodealliance/jco-std": "^0.1.3", + "@eslint/js": "^9.24.0", + "@rollup/plugin-node-resolve": "*", + "eslint": "^9.24.0", + "globals": "^16.0.0", + "just-install": "*", + "prettier": "^3.5.3", + "rollup": "^4.37.0", + "vitest": "^3.1.1", + "wait-on": "^8.0.3" + } + }, + "node_modules/@bytecodealliance/componentize-js": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.19.3.tgz", + "integrity": "sha512-ju7Y4WeF0B9uMkSPHJgmT6ouEfSwbe9M1uR/YOnYZjBpxJjH9qzxIkJg/kf8NycVDyFJ2/lscmJ1E1uPiDQVRQ==", + "dev": true, + "workspaces": [ + "." + ], + "dependencies": { + "@bytecodealliance/jco": "^1.15.1", + "@bytecodealliance/wizer": "^10.0.0", + "es-module-lexer": "^1.6.0", + "oxc-parser": "^0.76.0" + }, + "bin": { + "componentize-js": "src/cli.js" + } + }, + "node_modules/@bytecodealliance/jco": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.16.1.tgz", + "integrity": "sha512-j5C32PuS2QHyG9+Sly7vQMkeaM7oOFi9JISiCtPswmOOdTV9i0dTwkDpviZMJ+itpfZHKuGO9OEmhH2QRKXtbw==", + "dev": true, + "license": "(Apache-2.0 WITH LLVM-exception)", + "dependencies": { + "@bytecodealliance/componentize-js": "^0.19.3", + "@bytecodealliance/preview2-shim": "^0.17.3", + "binaryen": "^123.0.0", + "commander": "^14", + "mkdirp": "^3", + "ora": "^8", + "terser": "^5" + }, + "bin": { + "jco": "src/jco.js" + } + }, + "node_modules/@bytecodealliance/jco-std": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@bytecodealliance/jco-std/-/jco-std-0.1.3.tgz", + "integrity": "sha512-BmKecKbNF8STjsfrf28HAoo51VKKDNY2NHTwxp5l+e0M4Kki2mtAMIeD5nKTN00MZzug2FtO1dnMZ+nWIYdg5w==", + "dev": true, + "license": "(Apache-2.0 WITH LLVM-exception)" + }, + "node_modules/@bytecodealliance/preview2-shim": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@bytecodealliance/preview2-shim/-/preview2-shim-0.17.8.tgz", + "integrity": "sha512-wS5kg8u0KCML1UeHQPJ1IuOI24x/XLentCzsqPER1+gDNC5Cz2hG4G2blLOZap+3CEGhIhnJ9mmZYj6a2W0Lww==", + "license": "(Apache-2.0 WITH LLVM-exception)" + }, + "node_modules/@bytecodealliance/wizer": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@bytecodealliance/wizer/-/wizer-10.0.0.tgz", + "integrity": "sha512-ziWmovyu1jQl9TsKlfC2bwuUZwxVPFHlX4fOqTzxhgS76jITIo45nzODEwPgU+jjmOr8F3YX2V2wAChC5NKujg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "wizer": "wizer.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@bytecodealliance/wizer-darwin-arm64": "10.0.0", + "@bytecodealliance/wizer-darwin-x64": "10.0.0", + "@bytecodealliance/wizer-linux-arm64": "10.0.0", + "@bytecodealliance/wizer-linux-s390x": "10.0.0", + "@bytecodealliance/wizer-linux-x64": "10.0.0", + "@bytecodealliance/wizer-win32-x64": "10.0.0" + } + }, + "node_modules/@bytecodealliance/wizer-darwin-arm64": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@bytecodealliance/wizer-darwin-arm64/-/wizer-darwin-arm64-10.0.0.tgz", + "integrity": "sha512-dhZTWel+xccGTKSJtI9A7oM4yyP20FWflsT+AoqkOqkCY7kCNrj4tmMtZ6GXZFRDkrPY5+EnOh62sfShEibAMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "wizer-darwin-arm64": "wizer" + } + }, + "node_modules/@bytecodealliance/wizer-darwin-x64": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@bytecodealliance/wizer-darwin-x64/-/wizer-darwin-x64-10.0.0.tgz", + "integrity": "sha512-r/LUIZw6Q3Hf4htd46mD+EBxfwjBkxVIrTM1r+B2pTCddoBYQnKVdVsI4UFyy7NoBxzEg8F8BwmTNoSLmFRjpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "bin": { + "wizer-darwin-x64": "wizer" + } + }, + "node_modules/@bytecodealliance/wizer-linux-arm64": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@bytecodealliance/wizer-linux-arm64/-/wizer-linux-arm64-10.0.0.tgz", + "integrity": "sha512-pGSfFWXzeTqHm6z1PtVaEn+7Fm3QGC8YnHrzBV4sQDVS3N1NwmuHZAc8kslmlFPNdu61ycEvdOsSgCny8JPQvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "bin": { + "wizer-linux-arm64": "wizer" + } + }, + "node_modules/@bytecodealliance/wizer-linux-s390x": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@bytecodealliance/wizer-linux-s390x/-/wizer-linux-s390x-10.0.0.tgz", + "integrity": "sha512-O8vHxRTAdb1lUnVXMIMTcp/9q4pq1D4iIKigJCipg2JN15taV9uFAWh0fO88wylXwuSlO7dOE1AwQl54fMKXQg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "bin": { + "wizer-linux-s390x": "wizer" + } + }, + "node_modules/@bytecodealliance/wizer-linux-x64": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@bytecodealliance/wizer-linux-x64/-/wizer-linux-x64-10.0.0.tgz", + "integrity": "sha512-fJtM1sy43FBMnp+xpapFX6U1YdTBKA/1T4CYfG/qeE8jn0SXk2EuiYoY/EnC2uyNy9hjTrvfdYO5n4MXW0EIdQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "bin": { + "wizer-linux-x64": "wizer" + } + }, + "node_modules/@bytecodealliance/wizer-win32-x64": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@bytecodealliance/wizer-win32-x64/-/wizer-win32-x64-10.0.0.tgz", + "integrity": "sha512-55BPLfGT7iT7gH5M69NpTM16QknJZ7OxJ0z73VOEoeGA9CT8QPKMRzFKsPIvLs+W8G28fdudFA94nElrdkp3Kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "bin": { + "wizer-win32-x64": "wizer" + } + }, + "node_modules/@emnapi/core": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.8.1.tgz", + "integrity": "sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.1.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", + "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@hapi/address": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@hapi/address/-/address-5.1.1.tgz", + "integrity": "sha512-A+po2d/dVoY7cYajycYI43ZbYMXukuopIsqCjh5QzsBCipDtdofHntljDlpccMjIfTy6UOkg+5KPriwYch2bXA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^11.0.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@hapi/formula": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-3.0.2.tgz", + "integrity": "sha512-hY5YPNXzw1He7s0iqkRQi+uMGh383CGdyyIGYtB+W5N3KHPXoqychklvHhKCC9M3Xtv0OCs/IHw+r4dcHtBYWw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/hoek": { + "version": "11.0.7", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-11.0.7.tgz", + "integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/pinpoint": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.1.tgz", + "integrity": "sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/tlds": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@hapi/tlds/-/tlds-1.1.5.tgz", + "integrity": "sha512-Vq/1gnIIsvFUpKlDdfrPd/ssHDpAyBP/baVukh3u2KSG2xoNjsnRNjQiPmuyPPGqsn1cqVWWhtZHfOBaLizFRQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@hapi/topo": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-6.0.2.tgz", + "integrity": "sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^11.0.2" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", + "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@tybys/wasm-util": "^0.10.0" + } + }, + "node_modules/@oxc-parser/binding-android-arm64": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.76.0.tgz", + "integrity": "sha512-1XJW/16CDmF5bHE7LAyPPmEEVnxSadDgdJz+xiLqBrmC4lfAeuAfRw3HlOygcPGr+AJsbD4Z5sFJMkwjbSZlQg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-arm64": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.76.0.tgz", + "integrity": "sha512-yoQwSom8xsB+JdGsPUU0xxmxLKiF2kdlrK7I56WtGKZilixuBf/TmOwNYJYLRWkBoW5l2/pDZOhBm2luwmLiLw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-x64": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.76.0.tgz", + "integrity": "sha512-uRIopPLvr3pf2Xj7f5LKyCuqzIU6zOS+zEIR8UDYhcgJyZHnvBkfrYnfcztyIcrGdQehrFUi3uplmI09E7RdiQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-freebsd-x64": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.76.0.tgz", + "integrity": "sha512-a0EOFvnOd2FqmDSvH6uWLROSlU6KV/JDKbsYDA/zRLyKcG6HCsmFnPsp8iV7/xr9WMbNgyJi6R5IMpePQlUq7Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.76.0.tgz", + "integrity": "sha512-ikRYDHL3fOdZwfJKmcdqjlLgkeNZ3Ez0qM8wAev5zlHZ+lY/Ig7qG5SCqPlvuTu+nNQ6zrFFaKvvt69EBKXU/g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.76.0.tgz", + "integrity": "sha512-dtRv5J5MRCLR7x39K8ufIIW4svIc7gYFUaI0YFXmmeOBhK/K2t/CkguPnDroKtsmXIPHDRtmJ1JJYzNcgJl6Wg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm64-gnu": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.76.0.tgz", + "integrity": "sha512-IE4iiiggFH2snagQxHrY5bv6dDpRMMat+vdlMN/ibonA65eOmRLp8VLTXnDiNrcla/itJ1L9qGABHNKU+SnE8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm64-musl": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.76.0.tgz", + "integrity": "sha512-wi9zQPMDHrBuRuT7Iurfidc9qlZh7cKa5vfYzOWNBCaqJdgxmNOFzvYen02wVUxSWGKhpiPHxrPX0jdRyJ8Npg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.76.0.tgz", + "integrity": "sha512-0tqqu1pqPee2lLGY8vtYlX1L415fFn89e0a3yp4q5N9f03j1rRs0R31qesTm3bt/UK8HYjECZ+56FCVPs2MEMQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-s390x-gnu": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.76.0.tgz", + "integrity": "sha512-y36Hh1a5TA+oIGtlc8lT7N9vdHXBlhBetQJW0p457KbiVQ7jF7AZkaPWhESkjHWAsTVKD2OjCa9ZqfaqhSI0FQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-x64-gnu": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.76.0.tgz", + "integrity": "sha512-7/acaG9htovp3gp/J0kHgbItQTuHctl+rbqPPqZ9DRBYTz8iV8kv3QN8t8Or8i/hOmOjfZp9McDoSU1duoR4/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-linux-x64-musl": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.76.0.tgz", + "integrity": "sha512-AxFt0reY6Q2rfudABmMTFGR8tFFr58NlH2rRBQgcj+F+iEwgJ+jMwAPhXd2y1I2zaI8GspuahedUYQinqxWqjA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-wasm32-wasi": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.76.0.tgz", + "integrity": "sha512-wHdkHdhf6AWBoO8vs5cpoR6zEFY1rB+fXWtq6j/xb9j/lu1evlujRVMkh8IM/M/pOUIrNkna3nzST/mRImiveQ==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^0.2.11" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@oxc-parser/binding-win32-arm64-msvc": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.76.0.tgz", + "integrity": "sha512-G7ZlEWcb2hNwCK3qalzqJoyB6HaTigQ/GEa7CU8sAJ/WwMdG/NnPqiC9IqpEAEy1ARSo4XMALfKbKNuqbSs5mg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-parser/binding-win32-x64-msvc": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.76.0.tgz", + "integrity": "sha512-0jLzzmnu8/mqNhKBnNS2lFUbPEzRdj5ReiZwHGHpjma0+ullmmwP2AqSEqx3ssHDK9CpcEMdKOK2LsbCfhHKIA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.76.0.tgz", + "integrity": "sha512-CH3THIrSViKal8yV/Wh3FK0pFhp40nzW1MUDCik9fNuid2D/7JJXKJnfFOAvMxInGXDlvmgT6ACAzrl47TqzkQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", + "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", + "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz", + "integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz", + "integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz", + "integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz", + "integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz", + "integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz", + "integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz", + "integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz", + "integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz", + "integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz", + "integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz", + "integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz", + "integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz", + "integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz", + "integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz", + "integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz", + "integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz", + "integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz", + "integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz", + "integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz", + "integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz", + "integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz", + "integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz", + "integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz", + "integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz", + "integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "25.2.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.3.tgz", + "integrity": "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vitest/expect": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", + "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", + "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.4", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", + "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.4", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", + "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", + "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.13.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz", + "integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/binaryen": { + "version": "123.0.0", + "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-123.0.0.tgz", + "integrity": "sha512-/hls/a309aZCc0itqP6uhoR+5DsKSlJVfB8Opd2BY9Ndghs84IScTunlyidyF4r2Xe3lQttnfBNIDjaNpj6mTw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "wasm-as": "bin/wasm-as", + "wasm-ctor-eval": "bin/wasm-ctor-eval", + "wasm-dis": "bin/wasm-dis", + "wasm-merge": "bin/wasm-merge", + "wasm-metadce": "bin/wasm-metadce", + "wasm-opt": "bin/wasm-opt", + "wasm-reduce": "bin/wasm-reduce", + "wasm-shell": "bin/wasm-shell", + "wasm2js": "bin/wasm2js" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.3", + "@esbuild/android-arm": "0.27.3", + "@esbuild/android-arm64": "0.27.3", + "@esbuild/android-x64": "0.27.3", + "@esbuild/darwin-arm64": "0.27.3", + "@esbuild/darwin-x64": "0.27.3", + "@esbuild/freebsd-arm64": "0.27.3", + "@esbuild/freebsd-x64": "0.27.3", + "@esbuild/linux-arm": "0.27.3", + "@esbuild/linux-arm64": "0.27.3", + "@esbuild/linux-ia32": "0.27.3", + "@esbuild/linux-loong64": "0.27.3", + "@esbuild/linux-mips64el": "0.27.3", + "@esbuild/linux-ppc64": "0.27.3", + "@esbuild/linux-riscv64": "0.27.3", + "@esbuild/linux-s390x": "0.27.3", + "@esbuild/linux-x64": "0.27.3", + "@esbuild/netbsd-arm64": "0.27.3", + "@esbuild/netbsd-x64": "0.27.3", + "@esbuild/openbsd-arm64": "0.27.3", + "@esbuild/openbsd-x64": "0.27.3", + "@esbuild/openharmony-arm64": "0.27.3", + "@esbuild/sunos-x64": "0.27.3", + "@esbuild/win32-arm64": "0.27.3", + "@esbuild/win32-ia32": "0.27.3", + "@esbuild/win32-x64": "0.27.3" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.2.tgz", + "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.39.2", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/itty-router": { + "version": "5.0.22", + "resolved": "https://registry.npmjs.org/itty-router/-/itty-router-5.0.22.tgz", + "integrity": "sha512-9hmdGErWdYDOurGYxSbqLhy4EFReIwk71hMZTJ5b+zfa2zjMNV1ftFno2b8VjAQvX615gNB8Qxbl9JMRqHnIVA==", + "license": "MIT" + }, + "node_modules/joi": { + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/joi/-/joi-18.0.2.tgz", + "integrity": "sha512-RuCOQMIt78LWnktPoeBL0GErkNaJPTBGcYuyaBvUOQSpcpcLfWrHPPihYdOGbV5pam9VTWbeoF7TsGiHugcjGA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/address": "^5.1.1", + "@hapi/formula": "^3.0.2", + "@hapi/hoek": "^11.0.7", + "@hapi/pinpoint": "^2.0.1", + "@hapi/tlds": "^1.1.1", + "@hapi/topo": "^6.0.2", + "@standard-schema/spec": "^1.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/just-install": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/just-install/-/just-install-2.0.2.tgz", + "integrity": "sha512-zH6aon3V2P8ZbD+njaMB/orHsOyFMgONSpxKtbovNu7Bhb1rD9qhnMkT2Nj91++b9GgqHNbozhUdIMxecmWJaw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "extract-zip": "^2.0.1", + "node-fetch": "^3.3.2" + }, + "bin": { + "just": "bin/just.js", + "just-install": "install.js" + }, + "engines": { + "node": ">=18.0" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz", + "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "is-unicode-supported": "^1.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ora": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz", + "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.3.0", + "cli-cursor": "^5.0.0", + "cli-spinners": "^2.9.2", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^2.0.0", + "log-symbols": "^6.0.0", + "stdin-discarder": "^0.2.2", + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/oxc-parser": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.76.0.tgz", + "integrity": "sha512-l98B2e9evuhES7zN99rb1QGhbzx25829TJFaKi2j0ib3/K/G5z1FdGYz6HZkrU3U8jdH7v2FC8mX1j2l9JrOUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "^0.76.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-parser/binding-android-arm64": "0.76.0", + "@oxc-parser/binding-darwin-arm64": "0.76.0", + "@oxc-parser/binding-darwin-x64": "0.76.0", + "@oxc-parser/binding-freebsd-x64": "0.76.0", + "@oxc-parser/binding-linux-arm-gnueabihf": "0.76.0", + "@oxc-parser/binding-linux-arm-musleabihf": "0.76.0", + "@oxc-parser/binding-linux-arm64-gnu": "0.76.0", + "@oxc-parser/binding-linux-arm64-musl": "0.76.0", + "@oxc-parser/binding-linux-riscv64-gnu": "0.76.0", + "@oxc-parser/binding-linux-s390x-gnu": "0.76.0", + "@oxc-parser/binding-linux-x64-gnu": "0.76.0", + "@oxc-parser/binding-linux-x64-musl": "0.76.0", + "@oxc-parser/binding-wasm32-wasi": "0.76.0", + "@oxc-parser/binding-win32-arm64-msvc": "0.76.0", + "@oxc-parser/binding-win32-x64-msvc": "0.76.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", + "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rollup": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz", + "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.57.1", + "@rollup/rollup-android-arm64": "4.57.1", + "@rollup/rollup-darwin-arm64": "4.57.1", + "@rollup/rollup-darwin-x64": "4.57.1", + "@rollup/rollup-freebsd-arm64": "4.57.1", + "@rollup/rollup-freebsd-x64": "4.57.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.57.1", + "@rollup/rollup-linux-arm-musleabihf": "4.57.1", + "@rollup/rollup-linux-arm64-gnu": "4.57.1", + "@rollup/rollup-linux-arm64-musl": "4.57.1", + "@rollup/rollup-linux-loong64-gnu": "4.57.1", + "@rollup/rollup-linux-loong64-musl": "4.57.1", + "@rollup/rollup-linux-ppc64-gnu": "4.57.1", + "@rollup/rollup-linux-ppc64-musl": "4.57.1", + "@rollup/rollup-linux-riscv64-gnu": "4.57.1", + "@rollup/rollup-linux-riscv64-musl": "4.57.1", + "@rollup/rollup-linux-s390x-gnu": "4.57.1", + "@rollup/rollup-linux-x64-gnu": "4.57.1", + "@rollup/rollup-linux-x64-musl": "4.57.1", + "@rollup/rollup-openbsd-x64": "4.57.1", + "@rollup/rollup-openharmony-arm64": "4.57.1", + "@rollup/rollup-win32-arm64-msvc": "4.57.1", + "@rollup/rollup-win32-ia32-msvc": "4.57.1", + "@rollup/rollup-win32-x64-gnu": "4.57.1", + "@rollup/rollup-win32-x64-msvc": "4.57.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/stdin-discarder": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz", + "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-literal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", + "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/terser": { + "version": "5.46.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.0.tgz", + "integrity": "sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", + "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", + "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", + "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.4", + "@vitest/mocker": "3.2.4", + "@vitest/pretty-format": "^3.2.4", + "@vitest/runner": "3.2.4", + "@vitest/snapshot": "3.2.4", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.4", + "@vitest/ui": "3.2.4", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/wait-on": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-8.0.5.tgz", + "integrity": "sha512-J3WlS0txVHkhLRb2FsmRg3dkMTCV1+M6Xra3Ho7HzZDHpE7DCOnoSoCJsZotrmW3uRMhvIJGSKUKrh/MeF4iag==", + "dev": true, + "license": "MIT", + "dependencies": { + "axios": "^1.12.1", + "joi": "^18.0.1", + "lodash": "^4.17.21", + "minimist": "^1.2.8", + "rxjs": "^7.8.2" + }, + "bin": { + "wait-on": "bin/wait-on" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..89207f8 --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "sample-wasi-http-js", + "version": "1.0.0", + "description": "Default build using upstream componentize-js", + "scripts": { + "bundle": "rollup -c", + "build": "npm run bundle && npx componentize-js --wit wit/guest_js -d stdio -o out/$npm_package_name.wasm out/bundle.js", + "format-ci": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css}\"", + "lint": "eslint src/**/*.js", + "test": "vitest --run" + }, + "devDependencies": { + "@bytecodealliance/componentize-js": "^0.19.3", + "@bytecodealliance/jco": "^1.15.4", + "@bytecodealliance/jco-std": "^0.1.3", + "@eslint/js": "^9.24.0", + "@rollup/plugin-node-resolve": "*", + "eslint": "^9.24.0", + "globals": "^16.0.0", + "just-install": "*", + "prettier": "^3.5.3", + "rollup": "^4.37.0", + "vitest": "^3.1.1", + "wait-on": "^8.0.3" + }, + "dependencies": { + "@bytecodealliance/preview2-shim": "^0.17.8", + "itty-router": "^5.0.18" + } +} diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..7a2931b --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,10 @@ +import { nodeResolve } from "@rollup/plugin-node-resolve"; + +export default { + input: "guest_js/server.js", + output: { + file: "out/bundle.js", + format: "esm", + }, + plugins: [nodeResolve()], +}; diff --git a/src/types.rs b/src/types.rs index 21b1372..4f6aed8 100644 --- a/src/types.rs +++ b/src/types.rs @@ -5,6 +5,7 @@ use crate::bindings::root::component::RootImports; pub mod buffer; pub mod cli; pub mod clocks_monotonic_clock; +pub mod clocks_wall_clock; pub mod headers; pub mod http_future; pub mod http_future_headers; @@ -51,6 +52,12 @@ impl RootImports for WasiImpl { self } + type WallClock = Self; + + fn wall_clock(&mut self) -> impl BorrowMut { + self + } + type Error = Self; fn error(&mut self) -> impl BorrowMut { @@ -98,4 +105,16 @@ impl RootImports for WasiImpl { fn stdin(&mut self) -> impl BorrowMut { self } + + type Environment = Self; + + fn environment(&mut self) -> impl BorrowMut { + self + } + + type Exit = Self; + + fn exit(&mut self) -> impl BorrowMut { + self + } } diff --git a/src/types/cli.rs b/src/types/cli.rs index 520fc50..d36d0ce 100644 --- a/src/types/cli.rs +++ b/src/types/cli.rs @@ -74,3 +74,25 @@ impl wasi::cli::Stderr> for WasiImpl { STDERR.clone() } } + +impl wasi::cli::Environment for WasiImpl { + fn get_environment(&mut self) -> Vec<(String, String)> { + vec![] + } + + fn get_arguments(&mut self) -> Vec { + vec![] + } + + fn initial_cwd(&mut self) -> Option { + std::env::current_dir() + .ok() + .and_then(|p| p.into_os_string().into_string().ok()) + } +} + +impl wasi::cli::Exit for WasiImpl { + fn exit(&mut self, _status: std::result::Result<(), ()>) { + //TODO: This doesn't do anything for the time being + } +} diff --git a/src/types/clocks_wall_clock.rs b/src/types/clocks_wall_clock.rs new file mode 100644 index 0000000..5edd602 --- /dev/null +++ b/src/types/clocks_wall_clock.rs @@ -0,0 +1,21 @@ +use super::WasiImpl; +use crate::bindings::wasi; + +impl wasi::clocks::WallClock for WasiImpl { + fn now(&mut self) -> wasi::clocks::wall_clock::Datetime { + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap(); + wasi::clocks::wall_clock::Datetime { + seconds: now.as_secs(), + nanoseconds: now.subsec_nanos(), + } + } + + fn resolution(&mut self) -> wasi::clocks::wall_clock::Datetime { + wasi::clocks::wall_clock::Datetime { + seconds: 1, + nanoseconds: 0, + } + } +} diff --git a/wit/guest_js/world.wit b/wit/guest_js/world.wit new file mode 100644 index 0000000..9ff6ce3 --- /dev/null +++ b/wit/guest_js/world.wit @@ -0,0 +1,2609 @@ +package root:component; + +world root { + import wasi:io/poll@0.2.3; + import wasi:clocks/monotonic-clock@0.2.3; + import wasi:clocks/wall-clock@0.2.3; + import wasi:random/random@0.2.3; + import wasi:io/error@0.2.3; + import wasi:io/streams@0.2.3; + import wasi:cli/stdout@0.2.3; + import wasi:cli/stderr@0.2.3; + import wasi:cli/stdin@0.2.3; + import wasi:cli/environment@0.2.3; + import wasi:cli/exit@0.2.3; + import wasi:http/types@0.2.3; + import wasi:http/outgoing-handler@0.2.3; + + export wasi:http/incoming-handler@0.2.3; +} + +package wasi:cli@0.2.3 { + @since(version = 0.2.0) + interface environment { + /// Get the POSIX-style environment variables. + /// + /// Each environment variable is provided as a pair of string variable names + /// and string value. + /// + /// Morally, these are a value import, but until value imports are available + /// in the component model, this import function should return the same + /// values each time it is called. + @since(version = 0.2.0) + get-environment: func() -> list>; + + /// Get the POSIX-style arguments to the program. + @since(version = 0.2.0) + get-arguments: func() -> list; + + /// Return a path that programs should use as their initial current working + /// directory, interpreting `.` as shorthand for this. + @since(version = 0.2.0) + initial-cwd: func() -> option; + } + + @since(version = 0.2.0) + interface exit { + /// Exit the current instance and any linked instances. + @since(version = 0.2.0) + exit: func(status: result); + } + + @since(version = 0.2.0) + interface run { + /// Run the program. + @since(version = 0.2.0) + run: func() -> result; + } + + @since(version = 0.2.0) + interface stdin { + @since(version = 0.2.0) + use wasi:io/streams@0.2.3.{input-stream}; + + @since(version = 0.2.0) + get-stdin: func() -> input-stream; + } + + @since(version = 0.2.0) + interface stdout { + @since(version = 0.2.0) + use wasi:io/streams@0.2.3.{output-stream}; + + @since(version = 0.2.0) + get-stdout: func() -> output-stream; + } + + @since(version = 0.2.0) + interface stderr { + @since(version = 0.2.0) + use wasi:io/streams@0.2.3.{output-stream}; + + @since(version = 0.2.0) + get-stderr: func() -> output-stream; + } + + /// Terminal input. + /// + /// In the future, this may include functions for disabling echoing, + /// disabling input buffering so that keyboard events are sent through + /// immediately, querying supported features, and so on. + @since(version = 0.2.0) + interface terminal-input { + /// The input side of a terminal. + @since(version = 0.2.0) + resource terminal-input; + } + + /// Terminal output. + /// + /// In the future, this may include functions for querying the terminal + /// size, being notified of terminal size changes, querying supported + /// features, and so on. + @since(version = 0.2.0) + interface terminal-output { + /// The output side of a terminal. + @since(version = 0.2.0) + resource terminal-output; + } + + /// An interface providing an optional `terminal-input` for stdin as a + /// link-time authority. + @since(version = 0.2.0) + interface terminal-stdin { + @since(version = 0.2.0) + use terminal-input.{terminal-input}; + + /// If stdin is connected to a terminal, return a `terminal-input` handle + /// allowing further interaction with it. + @since(version = 0.2.0) + get-terminal-stdin: func() -> option; + } + + /// An interface providing an optional `terminal-output` for stdout as a + /// link-time authority. + @since(version = 0.2.0) + interface terminal-stdout { + @since(version = 0.2.0) + use terminal-output.{terminal-output}; + + /// If stdout is connected to a terminal, return a `terminal-output` handle + /// allowing further interaction with it. + @since(version = 0.2.0) + get-terminal-stdout: func() -> option; + } + + /// An interface providing an optional `terminal-output` for stderr as a + /// link-time authority. + @since(version = 0.2.0) + interface terminal-stderr { + @since(version = 0.2.0) + use terminal-output.{terminal-output}; + + /// If stderr is connected to a terminal, return a `terminal-output` handle + /// allowing further interaction with it. + @since(version = 0.2.0) + get-terminal-stderr: func() -> option; + } + + @since(version = 0.2.0) + world imports { + @since(version = 0.2.0) + import environment; + @since(version = 0.2.0) + import exit; + @since(version = 0.2.0) + import wasi:io/error@0.2.3; + @since(version = 0.2.0) + import wasi:io/poll@0.2.3; + @since(version = 0.2.0) + import wasi:io/streams@0.2.3; + @since(version = 0.2.0) + import stdin; + @since(version = 0.2.0) + import stdout; + @since(version = 0.2.0) + import stderr; + @since(version = 0.2.0) + import terminal-input; + @since(version = 0.2.0) + import terminal-output; + @since(version = 0.2.0) + import terminal-stdin; + @since(version = 0.2.0) + import terminal-stdout; + @since(version = 0.2.0) + import terminal-stderr; + @since(version = 0.2.0) + import wasi:clocks/monotonic-clock@0.2.3; + @since(version = 0.2.0) + import wasi:clocks/wall-clock@0.2.3; + @since(version = 0.2.0) + import wasi:filesystem/types@0.2.3; + @since(version = 0.2.0) + import wasi:filesystem/preopens@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/network@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/instance-network@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/udp@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/udp-create-socket@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/tcp@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/tcp-create-socket@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/ip-name-lookup@0.2.3; + @since(version = 0.2.0) + import wasi:random/random@0.2.3; + @since(version = 0.2.0) + import wasi:random/insecure@0.2.3; + @since(version = 0.2.0) + import wasi:random/insecure-seed@0.2.3; + } + @since(version = 0.2.0) + world command { + @since(version = 0.2.0) + import environment; + @since(version = 0.2.0) + import exit; + @since(version = 0.2.0) + import wasi:io/error@0.2.3; + @since(version = 0.2.0) + import wasi:io/poll@0.2.3; + @since(version = 0.2.0) + import wasi:io/streams@0.2.3; + @since(version = 0.2.0) + import stdin; + @since(version = 0.2.0) + import stdout; + @since(version = 0.2.0) + import stderr; + @since(version = 0.2.0) + import terminal-input; + @since(version = 0.2.0) + import terminal-output; + @since(version = 0.2.0) + import terminal-stdin; + @since(version = 0.2.0) + import terminal-stdout; + @since(version = 0.2.0) + import terminal-stderr; + @since(version = 0.2.0) + import wasi:clocks/monotonic-clock@0.2.3; + @since(version = 0.2.0) + import wasi:clocks/wall-clock@0.2.3; + @since(version = 0.2.0) + import wasi:filesystem/types@0.2.3; + @since(version = 0.2.0) + import wasi:filesystem/preopens@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/network@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/instance-network@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/udp@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/udp-create-socket@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/tcp@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/tcp-create-socket@0.2.3; + @since(version = 0.2.0) + import wasi:sockets/ip-name-lookup@0.2.3; + @since(version = 0.2.0) + import wasi:random/random@0.2.3; + @since(version = 0.2.0) + import wasi:random/insecure@0.2.3; + @since(version = 0.2.0) + import wasi:random/insecure-seed@0.2.3; + + @since(version = 0.2.0) + export run; + } +} + +package wasi:clocks@0.2.3 { + /// WASI Monotonic Clock is a clock API intended to let users measure elapsed + /// time. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + /// + /// A monotonic clock is a clock which has an unspecified initial value, and + /// successive reads of the clock will produce non-decreasing values. + @since(version = 0.2.0) + interface monotonic-clock { + @since(version = 0.2.0) + use wasi:io/poll@0.2.3.{pollable}; + + /// An instant in time, in nanoseconds. An instant is relative to an + /// unspecified initial value, and can only be compared to instances from + /// the same monotonic-clock. + @since(version = 0.2.0) + type instant = u64; + + /// A duration of time, in nanoseconds. + @since(version = 0.2.0) + type duration = u64; + + /// Read the current value of the clock. + /// + /// The clock is monotonic, therefore calling this function repeatedly will + /// produce a sequence of non-decreasing values. + @since(version = 0.2.0) + now: func() -> instant; + + /// Query the resolution of the clock. Returns the duration of time + /// corresponding to a clock tick. + @since(version = 0.2.0) + resolution: func() -> duration; + + /// Create a `pollable` which will resolve once the specified instant + /// has occurred. + @since(version = 0.2.0) + subscribe-instant: func(when: instant) -> pollable; + + /// Create a `pollable` that will resolve after the specified duration has + /// elapsed from the time this function is invoked. + @since(version = 0.2.0) + subscribe-duration: func(when: duration) -> pollable; + } + + /// WASI Wall Clock is a clock API intended to let users query the current + /// time. The name "wall" makes an analogy to a "clock on the wall", which + /// is not necessarily monotonic as it may be reset. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + /// + /// A wall clock is a clock which measures the date and time according to + /// some external reference. + /// + /// External references may be reset, so this clock is not necessarily + /// monotonic, making it unsuitable for measuring elapsed time. + /// + /// It is intended for reporting the current date and time for humans. + @since(version = 0.2.0) + interface wall-clock { + /// A time and date in seconds plus nanoseconds. + @since(version = 0.2.0) + record datetime { + seconds: u64, + nanoseconds: u32, + } + + /// Read the current value of the clock. + /// + /// This clock is not monotonic, therefore calling this function repeatedly + /// will not necessarily produce a sequence of non-decreasing values. + /// + /// The returned timestamps represent the number of seconds since + /// 1970-01-01T00:00:00Z, also known as [POSIX's Seconds Since the Epoch], + /// also known as [Unix Time]. + /// + /// The nanoseconds field of the output is always less than 1000000000. + /// + /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 + /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time + @since(version = 0.2.0) + now: func() -> datetime; + + /// Query the resolution of the clock. + /// + /// The nanoseconds field of the output is always less than 1000000000. + @since(version = 0.2.0) + resolution: func() -> datetime; + } + + @since(version = 0.2.0) + world imports { + @since(version = 0.2.0) + import wasi:io/poll@0.2.3; + @since(version = 0.2.0) + import monotonic-clock; + @since(version = 0.2.0) + import wall-clock; + } +} + +package wasi:filesystem@0.2.3 { + interface types { + use wasi:io/streams@0.2.3.{input-stream, output-stream, error}; + use wasi:clocks/wall-clock@0.2.3.{datetime}; + + type filesize = u64; + + enum descriptor-type { + unknown, + block-device, + character-device, + directory, + fifo, + symbolic-link, + regular-file, + socket, + } + + flags descriptor-flags { + read, + write, + file-integrity-sync, + data-integrity-sync, + requested-write-sync, + mutate-directory, + } + + flags path-flags { + symlink-follow, + } + + flags open-flags { + create, + directory, + exclusive, + truncate, + } + + type link-count = u64; + + record descriptor-stat { + %type: descriptor-type, + link-count: link-count, + size: filesize, + data-access-timestamp: option, + data-modification-timestamp: option, + status-change-timestamp: option, + } + + variant new-timestamp { + no-change, + now, + timestamp(datetime), + } + + record directory-entry { + %type: descriptor-type, + name: string, + } + + enum error-code { + access, + would-block, + already, + bad-descriptor, + busy, + deadlock, + quota, + exist, + file-too-large, + illegal-byte-sequence, + in-progress, + interrupted, + invalid, + io, + is-directory, + loop, + too-many-links, + message-size, + name-too-long, + no-device, + no-entry, + no-lock, + insufficient-memory, + insufficient-space, + not-directory, + not-empty, + not-recoverable, + unsupported, + no-tty, + no-such-device, + overflow, + not-permitted, + pipe, + read-only, + invalid-seek, + text-file-busy, + cross-device, + } + + enum advice { + normal, + sequential, + random, + will-need, + dont-need, + no-reuse, + } + + record metadata-hash-value { + lower: u64, + upper: u64, + } + + resource descriptor { + read-via-stream: func(offset: filesize) -> result; + write-via-stream: func(offset: filesize) -> result; + append-via-stream: func() -> result; + advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; + sync-data: func() -> result<_, error-code>; + get-flags: func() -> result; + get-type: func() -> result; + set-size: func(size: filesize) -> result<_, error-code>; + set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; + read: func(length: filesize, offset: filesize) -> result, bool>, error-code>; + write: func(buffer: list, offset: filesize) -> result; + read-directory: func() -> result; + sync: func() -> result<_, error-code>; + create-directory-at: func(path: string) -> result<_, error-code>; + stat: func() -> result; + stat-at: func(path-flags: path-flags, path: string) -> result; + set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; + link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; + open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; + readlink-at: func(path: string) -> result; + remove-directory-at: func(path: string) -> result<_, error-code>; + rename-at: func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; + symlink-at: func(old-path: string, new-path: string) -> result<_, error-code>; + unlink-file-at: func(path: string) -> result<_, error-code>; + is-same-object: func(other: borrow) -> bool; + metadata-hash: func() -> result; + metadata-hash-at: func(path-flags: path-flags, path: string) -> result; + } + + resource directory-entry-stream { + read-directory-entry: func() -> result, error-code>; + } + + filesystem-error-code: func(err: borrow) -> option; + } + + interface preopens { + use types.{descriptor}; + + get-directories: func() -> list>; + } +} + +package wasi:http@0.2.3 { + /// This interface defines all of the types and methods for implementing + /// HTTP Requests and Responses, both incoming and outgoing, as well as + /// their headers, trailers, and bodies. + @since(version = 0.2.0) + interface types { + @since(version = 0.2.0) + use wasi:clocks/monotonic-clock@0.2.3.{duration}; + @since(version = 0.2.0) + use wasi:io/streams@0.2.3.{input-stream, output-stream}; + @since(version = 0.2.0) + use wasi:io/error@0.2.3.{error as io-error}; + @since(version = 0.2.0) + use wasi:io/poll@0.2.3.{pollable}; + + /// This type corresponds to HTTP standard Methods. + @since(version = 0.2.0) + variant method { + get, + head, + post, + put, + delete, + connect, + options, + trace, + patch, + other(string), + } + + /// This type corresponds to HTTP standard Related Schemes. + @since(version = 0.2.0) + variant scheme { + HTTP, + HTTPS, + other(string), + } + + /// Defines the case payload type for `DNS-error` above: + @since(version = 0.2.0) + record DNS-error-payload { + rcode: option, + info-code: option, + } + + /// Defines the case payload type for `TLS-alert-received` above: + @since(version = 0.2.0) + record TLS-alert-received-payload { + alert-id: option, + alert-message: option, + } + + /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: + @since(version = 0.2.0) + record field-size-payload { + field-name: option, + field-size: option, + } + + /// These cases are inspired by the IANA HTTP Proxy Error Types: + /// + @since(version = 0.2.0) + variant error-code { + DNS-timeout, + DNS-error(DNS-error-payload), + destination-not-found, + destination-unavailable, + destination-IP-prohibited, + destination-IP-unroutable, + connection-refused, + connection-terminated, + connection-timeout, + connection-read-timeout, + connection-write-timeout, + connection-limit-reached, + TLS-protocol-error, + TLS-certificate-error, + TLS-alert-received(TLS-alert-received-payload), + HTTP-request-denied, + HTTP-request-length-required, + HTTP-request-body-size(option), + HTTP-request-method-invalid, + HTTP-request-URI-invalid, + HTTP-request-URI-too-long, + HTTP-request-header-section-size(option), + HTTP-request-header-size(option), + HTTP-request-trailer-section-size(option), + HTTP-request-trailer-size(field-size-payload), + HTTP-response-incomplete, + HTTP-response-header-section-size(option), + HTTP-response-header-size(field-size-payload), + HTTP-response-body-size(option), + HTTP-response-trailer-section-size(option), + HTTP-response-trailer-size(field-size-payload), + HTTP-response-transfer-coding(option), + HTTP-response-content-coding(option), + HTTP-response-timeout, + HTTP-upgrade-failed, + HTTP-protocol-error, + loop-detected, + configuration-error, + /// This is a catch-all error for anything that doesn't fit cleanly into a + /// more specific case. It also includes an optional string for an + /// unstructured description of the error. Users should not depend on the + /// string for diagnosing errors, as it's not required to be consistent + /// between implementations. + internal-error(option), + } + + /// This type enumerates the different kinds of errors that may occur when + /// setting or appending to a `fields` resource. + @since(version = 0.2.0) + variant header-error { + /// This error indicates that a `field-name` or `field-value` was + /// syntactically invalid when used with an operation that sets headers in a + /// `fields`. + invalid-syntax, + /// This error indicates that a forbidden `field-name` was used when trying + /// to set a header in a `fields`. + forbidden, + /// This error indicates that the operation on the `fields` was not + /// permitted because the fields are immutable. + immutable, + } + + /// Field keys are always strings. + /// + /// Field keys should always be treated as case insensitive by the `fields` + /// resource for the purposes of equality checking. + /// + /// # Deprecation + /// + /// This type has been deprecated in favor of the `field-name` type. + @since(version = 0.2.0) + @deprecated(version = 0.2.2) + type field-key = string; + + /// Field names are always strings. + /// + /// Field names should always be treated as case insensitive by the `fields` + /// resource for the purposes of equality checking. + @since(version = 0.2.1) + type field-name = field-key; + + /// Field values should always be ASCII strings. However, in + /// reality, HTTP implementations often have to interpret malformed values, + /// so they are provided as a list of bytes. + @since(version = 0.2.0) + type field-value = list; + + /// This following block defines the `fields` resource which corresponds to + /// HTTP standard Fields. Fields are a common representation used for both + /// Headers and Trailers. + /// + /// A `fields` may be mutable or immutable. A `fields` created using the + /// constructor, `from-list`, or `clone` will be mutable, but a `fields` + /// resource given by other means (including, but not limited to, + /// `incoming-request.headers`, `outgoing-request.headers`) might be be + /// immutable. In an immutable fields, the `set`, `append`, and `delete` + /// operations will fail with `header-error.immutable`. + @since(version = 0.2.0) + resource fields { + /// Construct an empty HTTP Fields. + /// + /// The resulting `fields` is mutable. + @since(version = 0.2.0) + constructor(); + /// Construct an HTTP Fields. + /// + /// The resulting `fields` is mutable. + /// + /// The list represents each name-value pair in the Fields. Names + /// which have multiple values are represented by multiple entries in this + /// list with the same name. + /// + /// The tuple is a pair of the field name, represented as a string, and + /// Value, represented as a list of bytes. + /// + /// An error result will be returned if any `field-name` or `field-value` is + /// syntactically invalid, or if a field is forbidden. + @since(version = 0.2.0) + from-list: static func(entries: list>) -> result; + /// Get all of the values corresponding to a name. If the name is not present + /// in this `fields` or is syntactically invalid, an empty list is returned. + /// However, if the name is present but empty, this is represented by a list + /// with one or more empty field-values present. + @since(version = 0.2.0) + get: func(name: field-name) -> list; + /// Returns `true` when the name is present in this `fields`. If the name is + /// syntactically invalid, `false` is returned. + @since(version = 0.2.0) + has: func(name: field-name) -> bool; + /// Set all of the values for a name. Clears any existing values for that + /// name, if they have been set. + /// + /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-name` or any of + /// the `field-value`s are syntactically invalid. + @since(version = 0.2.0) + set: func(name: field-name, value: list) -> result<_, header-error>; + /// Delete all values for a name. Does nothing if no values for the name + /// exist. + /// + /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-name` is + /// syntactically invalid. + @since(version = 0.2.0) + delete: func(name: field-name) -> result<_, header-error>; + /// Append a value for a name. Does not change or delete any existing + /// values for that name. + /// + /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-name` or + /// `field-value` are syntactically invalid. + @since(version = 0.2.0) + append: func(name: field-name, value: field-value) -> result<_, header-error>; + /// Retrieve the full set of names and values in the Fields. Like the + /// constructor, the list represents each name-value pair. + /// + /// The outer list represents each name-value pair in the Fields. Names + /// which have multiple values are represented by multiple entries in this + /// list with the same name. + /// + /// The names and values are always returned in the original casing and in + /// the order in which they will be serialized for transport. + @since(version = 0.2.0) + entries: func() -> list>; + /// Make a deep copy of the Fields. Equivalent in behavior to calling the + /// `fields` constructor on the return value of `entries`. The resulting + /// `fields` is mutable. + @since(version = 0.2.0) + clone: func() -> fields; + } + + /// Headers is an alias for Fields. + @since(version = 0.2.0) + type headers = fields; + + /// Trailers is an alias for Fields. + @since(version = 0.2.0) + type trailers = fields; + + /// Represents an incoming HTTP Request. + @since(version = 0.2.0) + resource incoming-request { + /// Returns the method of the incoming request. + @since(version = 0.2.0) + method: func() -> method; + /// Returns the path with query parameters from the request, as a string. + @since(version = 0.2.0) + path-with-query: func() -> option; + /// Returns the protocol scheme from the request. + @since(version = 0.2.0) + scheme: func() -> option; + /// Returns the authority of the Request's target URI, if present. + @since(version = 0.2.0) + authority: func() -> option; + /// Get the `headers` associated with the request. + /// + /// The returned `headers` resource is immutable: `set`, `append`, and + /// `delete` operations will fail with `header-error.immutable`. + /// + /// The `headers` returned are a child resource: it must be dropped before + /// the parent `incoming-request` is dropped. Dropping this + /// `incoming-request` before all children are dropped will trap. + @since(version = 0.2.0) + headers: func() -> headers; + /// Gives the `incoming-body` associated with this request. Will only + /// return success at most once, and subsequent calls will return error. + @since(version = 0.2.0) + consume: func() -> result; + } + + /// Represents an outgoing HTTP Request. + @since(version = 0.2.0) + resource outgoing-request { + /// Construct a new `outgoing-request` with a default `method` of `GET`, and + /// `none` values for `path-with-query`, `scheme`, and `authority`. + /// + /// * `headers` is the HTTP Headers for the Request. + /// + /// It is possible to construct, or manipulate with the accessor functions + /// below, an `outgoing-request` with an invalid combination of `scheme` + /// and `authority`, or `headers` which are not permitted to be sent. + /// It is the obligation of the `outgoing-handler.handle` implementation + /// to reject invalid constructions of `outgoing-request`. + @since(version = 0.2.0) + constructor(headers: headers); + /// Returns the resource corresponding to the outgoing Body for this + /// Request. + /// + /// Returns success on the first call: the `outgoing-body` resource for + /// this `outgoing-request` can be retrieved at most once. Subsequent + /// calls will return error. + @since(version = 0.2.0) + body: func() -> result; + /// Get the Method for the Request. + @since(version = 0.2.0) + method: func() -> method; + /// Set the Method for the Request. Fails if the string present in a + /// `method.other` argument is not a syntactically valid method. + @since(version = 0.2.0) + set-method: func(method: method) -> result; + /// Get the combination of the HTTP Path and Query for the Request. + /// When `none`, this represents an empty Path and empty Query. + @since(version = 0.2.0) + path-with-query: func() -> option; + /// Set the combination of the HTTP Path and Query for the Request. + /// When `none`, this represents an empty Path and empty Query. Fails is the + /// string given is not a syntactically valid path and query uri component. + @since(version = 0.2.0) + set-path-with-query: func(path-with-query: option) -> result; + /// Get the HTTP Related Scheme for the Request. When `none`, the + /// implementation may choose an appropriate default scheme. + @since(version = 0.2.0) + scheme: func() -> option; + /// Set the HTTP Related Scheme for the Request. When `none`, the + /// implementation may choose an appropriate default scheme. Fails if the + /// string given is not a syntactically valid uri scheme. + @since(version = 0.2.0) + set-scheme: func(scheme: option) -> result; + /// Get the authority of the Request's target URI. A value of `none` may be used + /// with Related Schemes which do not require an authority. The HTTP and + /// HTTPS schemes always require an authority. + @since(version = 0.2.0) + authority: func() -> option; + /// Set the authority of the Request's target URI. A value of `none` may be used + /// with Related Schemes which do not require an authority. The HTTP and + /// HTTPS schemes always require an authority. Fails if the string given is + /// not a syntactically valid URI authority. + @since(version = 0.2.0) + set-authority: func(authority: option) -> result; + /// Get the headers associated with the Request. + /// + /// The returned `headers` resource is immutable: `set`, `append`, and + /// `delete` operations will fail with `header-error.immutable`. + /// + /// This headers resource is a child: it must be dropped before the parent + /// `outgoing-request` is dropped, or its ownership is transferred to + /// another component by e.g. `outgoing-handler.handle`. + @since(version = 0.2.0) + headers: func() -> headers; + } + + /// Parameters for making an HTTP Request. Each of these parameters is + /// currently an optional timeout applicable to the transport layer of the + /// HTTP protocol. + /// + /// These timeouts are separate from any the user may use to bound a + /// blocking call to `wasi:io/poll.poll`. + @since(version = 0.2.0) + resource request-options { + /// Construct a default `request-options` value. + @since(version = 0.2.0) + constructor(); + /// The timeout for the initial connect to the HTTP Server. + @since(version = 0.2.0) + connect-timeout: func() -> option; + /// Set the timeout for the initial connect to the HTTP Server. An error + /// return value indicates that this timeout is not supported. + @since(version = 0.2.0) + set-connect-timeout: func(duration: option) -> result; + /// The timeout for receiving the first byte of the Response body. + @since(version = 0.2.0) + first-byte-timeout: func() -> option; + /// Set the timeout for receiving the first byte of the Response body. An + /// error return value indicates that this timeout is not supported. + @since(version = 0.2.0) + set-first-byte-timeout: func(duration: option) -> result; + /// The timeout for receiving subsequent chunks of bytes in the Response + /// body stream. + @since(version = 0.2.0) + between-bytes-timeout: func() -> option; + /// Set the timeout for receiving subsequent chunks of bytes in the Response + /// body stream. An error return value indicates that this timeout is not + /// supported. + @since(version = 0.2.0) + set-between-bytes-timeout: func(duration: option) -> result; + } + + /// Represents the ability to send an HTTP Response. + /// + /// This resource is used by the `wasi:http/incoming-handler` interface to + /// allow a Response to be sent corresponding to the Request provided as the + /// other argument to `incoming-handler.handle`. + @since(version = 0.2.0) + resource response-outparam { + /// Set the value of the `response-outparam` to either send a response, + /// or indicate an error. + /// + /// This method consumes the `response-outparam` to ensure that it is + /// called at most once. If it is never called, the implementation + /// will respond with an error. + /// + /// The user may provide an `error` to `response` to allow the + /// implementation determine how to respond with an HTTP error response. + @since(version = 0.2.0) + set: static func(param: response-outparam, response: result); + } + + /// This type corresponds to the HTTP standard Status Code. + @since(version = 0.2.0) + type status-code = u16; + + /// Represents an incoming HTTP Response. + @since(version = 0.2.0) + resource incoming-response { + /// Returns the status code from the incoming response. + @since(version = 0.2.0) + status: func() -> status-code; + /// Returns the headers from the incoming response. + /// + /// The returned `headers` resource is immutable: `set`, `append`, and + /// `delete` operations will fail with `header-error.immutable`. + /// + /// This headers resource is a child: it must be dropped before the parent + /// `incoming-response` is dropped. + @since(version = 0.2.0) + headers: func() -> headers; + /// Returns the incoming body. May be called at most once. Returns error + /// if called additional times. + @since(version = 0.2.0) + consume: func() -> result; + } + + /// Represents an incoming HTTP Request or Response's Body. + /// + /// A body has both its contents - a stream of bytes - and a (possibly + /// empty) set of trailers, indicating that the full contents of the + /// body have been received. This resource represents the contents as + /// an `input-stream` and the delivery of trailers as a `future-trailers`, + /// and ensures that the user of this interface may only be consuming either + /// the body contents or waiting on trailers at any given time. + @since(version = 0.2.0) + resource incoming-body { + /// Returns the contents of the body, as a stream of bytes. + /// + /// Returns success on first call: the stream representing the contents + /// can be retrieved at most once. Subsequent calls will return error. + /// + /// The returned `input-stream` resource is a child: it must be dropped + /// before the parent `incoming-body` is dropped, or consumed by + /// `incoming-body.finish`. + /// + /// This invariant ensures that the implementation can determine whether + /// the user is consuming the contents of the body, waiting on the + /// `future-trailers` to be ready, or neither. This allows for network + /// backpressure is to be applied when the user is consuming the body, + /// and for that backpressure to not inhibit delivery of the trailers if + /// the user does not read the entire body. + @since(version = 0.2.0) + %stream: func() -> result; + /// Takes ownership of `incoming-body`, and returns a `future-trailers`. + /// This function will trap if the `input-stream` child is still alive. + @since(version = 0.2.0) + finish: static func(this: incoming-body) -> future-trailers; + } + + /// Represents a future which may eventually return trailers, or an error. + /// + /// In the case that the incoming HTTP Request or Response did not have any + /// trailers, this future will resolve to the empty set of trailers once the + /// complete Request or Response body has been received. + @since(version = 0.2.0) + resource future-trailers { + /// Returns a pollable which becomes ready when either the trailers have + /// been received, or an error has occurred. When this pollable is ready, + /// the `get` method will return `some`. + @since(version = 0.2.0) + subscribe: func() -> pollable; + /// Returns the contents of the trailers, or an error which occurred, + /// once the future is ready. + /// + /// The outer `option` represents future readiness. Users can wait on this + /// `option` to become `some` using the `subscribe` method. + /// + /// The outer `result` is used to retrieve the trailers or error at most + /// once. It will be success on the first call in which the outer option + /// is `some`, and error on subsequent calls. + /// + /// The inner `result` represents that either the HTTP Request or Response + /// body, as well as any trailers, were received successfully, or that an + /// error occurred receiving them. The optional `trailers` indicates whether + /// or not trailers were present in the body. + /// + /// When some `trailers` are returned by this method, the `trailers` + /// resource is immutable, and a child. Use of the `set`, `append`, or + /// `delete` methods will return an error, and the resource must be + /// dropped before the parent `future-trailers` is dropped. + @since(version = 0.2.0) + get: func() -> option, error-code>>>; + } + + /// Represents an outgoing HTTP Response. + @since(version = 0.2.0) + resource outgoing-response { + /// Construct an `outgoing-response`, with a default `status-code` of `200`. + /// If a different `status-code` is needed, it must be set via the + /// `set-status-code` method. + /// + /// * `headers` is the HTTP Headers for the Response. + @since(version = 0.2.0) + constructor(headers: headers); + /// Get the HTTP Status Code for the Response. + @since(version = 0.2.0) + status-code: func() -> status-code; + /// Set the HTTP Status Code for the Response. Fails if the status-code + /// given is not a valid http status code. + @since(version = 0.2.0) + set-status-code: func(status-code: status-code) -> result; + /// Get the headers associated with the Request. + /// + /// The returned `headers` resource is immutable: `set`, `append`, and + /// `delete` operations will fail with `header-error.immutable`. + /// + /// This headers resource is a child: it must be dropped before the parent + /// `outgoing-request` is dropped, or its ownership is transferred to + /// another component by e.g. `outgoing-handler.handle`. + @since(version = 0.2.0) + headers: func() -> headers; + /// Returns the resource corresponding to the outgoing Body for this Response. + /// + /// Returns success on the first call: the `outgoing-body` resource for + /// this `outgoing-response` can be retrieved at most once. Subsequent + /// calls will return error. + @since(version = 0.2.0) + body: func() -> result; + } + + /// Represents an outgoing HTTP Request or Response's Body. + /// + /// A body has both its contents - a stream of bytes - and a (possibly + /// empty) set of trailers, inducating the full contents of the body + /// have been sent. This resource represents the contents as an + /// `output-stream` child resource, and the completion of the body (with + /// optional trailers) with a static function that consumes the + /// `outgoing-body` resource, and ensures that the user of this interface + /// may not write to the body contents after the body has been finished. + /// + /// If the user code drops this resource, as opposed to calling the static + /// method `finish`, the implementation should treat the body as incomplete, + /// and that an error has occurred. The implementation should propagate this + /// error to the HTTP protocol by whatever means it has available, + /// including: corrupting the body on the wire, aborting the associated + /// Request, or sending a late status code for the Response. + @since(version = 0.2.0) + resource outgoing-body { + /// Returns a stream for writing the body contents. + /// + /// The returned `output-stream` is a child resource: it must be dropped + /// before the parent `outgoing-body` resource is dropped (or finished), + /// otherwise the `outgoing-body` drop or `finish` will trap. + /// + /// Returns success on the first call: the `output-stream` resource for + /// this `outgoing-body` may be retrieved at most once. Subsequent calls + /// will return error. + @since(version = 0.2.0) + write: func() -> result; + /// Finalize an outgoing body, optionally providing trailers. This must be + /// called to signal that the response is complete. If the `outgoing-body` + /// is dropped without calling `outgoing-body.finalize`, the implementation + /// should treat the body as corrupted. + /// + /// Fails if the body's `outgoing-request` or `outgoing-response` was + /// constructed with a Content-Length header, and the contents written + /// to the body (via `write`) does not match the value given in the + /// Content-Length. + @since(version = 0.2.0) + finish: static func(this: outgoing-body, trailers: option) -> result<_, error-code>; + } + + /// Represents a future which may eventually return an incoming HTTP + /// Response, or an error. + /// + /// This resource is returned by the `wasi:http/outgoing-handler` interface to + /// provide the HTTP Response corresponding to the sent Request. + @since(version = 0.2.0) + resource future-incoming-response { + /// Returns a pollable which becomes ready when either the Response has + /// been received, or an error has occurred. When this pollable is ready, + /// the `get` method will return `some`. + @since(version = 0.2.0) + subscribe: func() -> pollable; + /// Returns the incoming HTTP Response, or an error, once one is ready. + /// + /// The outer `option` represents future readiness. Users can wait on this + /// `option` to become `some` using the `subscribe` method. + /// + /// The outer `result` is used to retrieve the response or error at most + /// once. It will be success on the first call in which the outer option + /// is `some`, and error on subsequent calls. + /// + /// The inner `result` represents that either the incoming HTTP Response + /// status and headers have received successfully, or that an error + /// occurred. Errors may also occur while consuming the response body, + /// but those will be reported by the `incoming-body` and its + /// `output-stream` child. + @since(version = 0.2.0) + get: func() -> option>>; + } + + /// Attempts to extract a http-related `error` from the wasi:io `error` + /// provided. + /// + /// Stream operations which return + /// `wasi:io/stream/stream-error::last-operation-failed` have a payload of + /// type `wasi:io/error/error` with more information about the operation + /// that failed. This payload can be passed through to this function to see + /// if there's http-related information about the error to return. + /// + /// Note that this function is fallible because not all io-errors are + /// http-related errors. + @since(version = 0.2.0) + http-error-code: func(err: borrow) -> option; + } + + /// This interface defines a handler of incoming HTTP Requests. It should + /// be exported by components which can respond to HTTP Requests. + @since(version = 0.2.0) + interface incoming-handler { + @since(version = 0.2.0) + use types.{incoming-request, response-outparam}; + + /// This function is invoked with an incoming HTTP Request, and a resource + /// `response-outparam` which provides the capability to reply with an HTTP + /// Response. The response is sent by calling the `response-outparam.set` + /// method, which allows execution to continue after the response has been + /// sent. This enables both streaming to the response body, and performing other + /// work. + /// + /// The implementor of this function must write a response to the + /// `response-outparam` before returning, or else the caller will respond + /// with an error on its behalf. + @since(version = 0.2.0) + handle: func(request: incoming-request, response-out: response-outparam); + } + + /// This interface defines a handler of outgoing HTTP Requests. It should be + /// imported by components which wish to make HTTP Requests. + @since(version = 0.2.0) + interface outgoing-handler { + @since(version = 0.2.0) + use types.{outgoing-request, request-options, future-incoming-response, error-code}; + + /// This function is invoked with an outgoing HTTP Request, and it returns + /// a resource `future-incoming-response` which represents an HTTP Response + /// which may arrive in the future. + /// + /// The `options` argument accepts optional parameters for the HTTP + /// protocol's transport layer. + /// + /// This function may return an error if the `outgoing-request` is invalid + /// or not allowed to be made. Otherwise, protocol errors are reported + /// through the `future-incoming-response`. + @since(version = 0.2.0) + handle: func(request: outgoing-request, options: option) -> result; + } + + /// The `wasi:http/imports` world imports all the APIs for HTTP proxies. + /// It is intended to be `include`d in other worlds. + @since(version = 0.2.0) + world imports { + @since(version = 0.2.0) + import wasi:io/poll@0.2.3; + @since(version = 0.2.0) + import wasi:clocks/monotonic-clock@0.2.3; + @since(version = 0.2.0) + import wasi:clocks/wall-clock@0.2.3; + @since(version = 0.2.0) + import wasi:random/random@0.2.3; + @since(version = 0.2.0) + import wasi:io/error@0.2.3; + @since(version = 0.2.0) + import wasi:io/streams@0.2.3; + @since(version = 0.2.0) + import wasi:cli/stdout@0.2.3; + @since(version = 0.2.0) + import wasi:cli/stderr@0.2.3; + @since(version = 0.2.0) + import wasi:cli/stdin@0.2.3; + @since(version = 0.2.0) + import types; + @since(version = 0.2.0) + import outgoing-handler; + } + /// The `wasi:http/proxy` world captures a widely-implementable intersection of + /// hosts that includes HTTP forward and reverse proxies. Components targeting + /// this world may concurrently stream in and out any number of incoming and + /// outgoing HTTP requests. + @since(version = 0.2.0) + world proxy { + @since(version = 0.2.0) + import wasi:io/poll@0.2.3; + @since(version = 0.2.0) + import wasi:clocks/monotonic-clock@0.2.3; + @since(version = 0.2.0) + import wasi:clocks/wall-clock@0.2.3; + @since(version = 0.2.0) + import wasi:random/random@0.2.3; + @since(version = 0.2.0) + import wasi:io/error@0.2.3; + @since(version = 0.2.0) + import wasi:io/streams@0.2.3; + @since(version = 0.2.0) + import wasi:cli/stdout@0.2.3; + @since(version = 0.2.0) + import wasi:cli/stderr@0.2.3; + @since(version = 0.2.0) + import wasi:cli/stdin@0.2.3; + @since(version = 0.2.0) + import types; + @since(version = 0.2.0) + import outgoing-handler; + + @since(version = 0.2.0) + export incoming-handler; + } +} + +package wasi:io@0.2.3 { + @since(version = 0.2.0) + interface error { + /// A resource which represents some error information. + /// + /// The only method provided by this resource is `to-debug-string`, + /// which provides some human-readable information about the error. + /// + /// In the `wasi:io` package, this resource is returned through the + /// `wasi:io/streams/stream-error` type. + /// + /// To provide more specific error information, other interfaces may + /// offer functions to "downcast" this error into more specific types. For example, + /// errors returned from streams derived from filesystem types can be described using + /// the filesystem's own error-code type. This is done using the function + /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow` + /// parameter and returns an `option`. + /// + /// The set of functions which can "downcast" an `error` into a more + /// concrete type is open. + @since(version = 0.2.0) + resource error { + /// Returns a string that is suitable to assist humans in debugging + /// this error. + /// + /// WARNING: The returned string should not be consumed mechanically! + /// It may change across platforms, hosts, or other implementation + /// details. Parsing this string is a major platform-compatibility + /// hazard. + @since(version = 0.2.0) + to-debug-string: func() -> string; + } + } + + /// A poll API intended to let users wait for I/O events on multiple handles + /// at once. + @since(version = 0.2.0) + interface poll { + /// `pollable` represents a single I/O event which may be ready, or not. + @since(version = 0.2.0) + resource pollable { + /// Return the readiness of a pollable. This function never blocks. + /// + /// Returns `true` when the pollable is ready, and `false` otherwise. + @since(version = 0.2.0) + ready: func() -> bool; + /// `block` returns immediately if the pollable is ready, and otherwise + /// blocks until ready. + /// + /// This function is equivalent to calling `poll.poll` on a list + /// containing only this pollable. + @since(version = 0.2.0) + block: func(); + } + + /// Poll for completion on a set of pollables. + /// + /// This function takes a list of pollables, which identify I/O sources of + /// interest, and waits until one or more of the events is ready for I/O. + /// + /// The result `list` contains one or more indices of handles in the + /// argument list that is ready for I/O. + /// + /// This function traps if either: + /// - the list is empty, or: + /// - the list contains more elements than can be indexed with a `u32` value. + /// + /// A timeout can be implemented by adding a pollable from the + /// wasi-clocks API to the list. + /// + /// This function does not return a `result`; polling in itself does not + /// do any I/O so it doesn't fail. If any of the I/O sources identified by + /// the pollables has an error, it is indicated by marking the source as + /// being ready for I/O. + @since(version = 0.2.0) + poll: func(in: list>) -> list; + } + + /// WASI I/O is an I/O abstraction API which is currently focused on providing + /// stream types. + /// + /// In the future, the component model is expected to add built-in stream types; + /// when it does, they are expected to subsume this API. + @since(version = 0.2.0) + interface streams { + @since(version = 0.2.0) + use error.{error}; + @since(version = 0.2.0) + use poll.{pollable}; + + /// An error for input-stream and output-stream operations. + @since(version = 0.2.0) + variant stream-error { + /// The last operation (a write or flush) failed before completion. + /// + /// More information is available in the `error` payload. + /// + /// After this, the stream will be closed. All future operations return + /// `stream-error::closed`. + last-operation-failed(error), + /// The stream is closed: no more input will be accepted by the + /// stream. A closed output-stream will return this error on all + /// future operations. + closed, + } + + /// An input bytestream. + /// + /// `input-stream`s are *non-blocking* to the extent practical on underlying + /// platforms. I/O operations always return promptly; if fewer bytes are + /// promptly available than requested, they return the number of bytes promptly + /// available, which could even be zero. To wait for data to be available, + /// use the `subscribe` function to obtain a `pollable` which can be polled + /// for using `wasi:io/poll`. + @since(version = 0.2.0) + resource input-stream { + /// Perform a non-blocking read from the stream. + /// + /// When the source of a `read` is binary data, the bytes from the source + /// are returned verbatim. When the source of a `read` is known to the + /// implementation to be text, bytes containing the UTF-8 encoding of the + /// text are returned. + /// + /// This function returns a list of bytes containing the read data, + /// when successful. The returned list will contain up to `len` bytes; + /// it may return fewer than requested, but not more. The list is + /// empty when no bytes are available for reading at this time. The + /// pollable given by `subscribe` will be ready when more bytes are + /// available. + /// + /// This function fails with a `stream-error` when the operation + /// encounters an error, giving `last-operation-failed`, or when the + /// stream is closed, giving `closed`. + /// + /// When the caller gives a `len` of 0, it represents a request to + /// read 0 bytes. If the stream is still open, this call should + /// succeed and return an empty list, or otherwise fail with `closed`. + /// + /// The `len` parameter is a `u64`, which could represent a list of u8 which + /// is not possible to allocate in wasm32, or not desirable to allocate as + /// as a return value by the callee. The callee may return a list of bytes + /// less than `len` in size while more bytes are available for reading. + @since(version = 0.2.0) + read: func(len: u64) -> result, stream-error>; + /// Read bytes from a stream, after blocking until at least one byte can + /// be read. Except for blocking, behavior is identical to `read`. + @since(version = 0.2.0) + blocking-read: func(len: u64) -> result, stream-error>; + /// Skip bytes from a stream. Returns number of bytes skipped. + /// + /// Behaves identical to `read`, except instead of returning a list + /// of bytes, returns the number of bytes consumed from the stream. + @since(version = 0.2.0) + skip: func(len: u64) -> result; + /// Skip bytes from a stream, after blocking until at least one byte + /// can be skipped. Except for blocking behavior, identical to `skip`. + @since(version = 0.2.0) + blocking-skip: func(len: u64) -> result; + /// Create a `pollable` which will resolve once either the specified stream + /// has bytes available to read or the other end of the stream has been + /// closed. + /// The created `pollable` is a child resource of the `input-stream`. + /// Implementations may trap if the `input-stream` is dropped before + /// all derived `pollable`s created with this function are dropped. + @since(version = 0.2.0) + subscribe: func() -> pollable; + } + + /// An output bytestream. + /// + /// `output-stream`s are *non-blocking* to the extent practical on + /// underlying platforms. Except where specified otherwise, I/O operations also + /// always return promptly, after the number of bytes that can be written + /// promptly, which could even be zero. To wait for the stream to be ready to + /// accept data, the `subscribe` function to obtain a `pollable` which can be + /// polled for using `wasi:io/poll`. + /// + /// Dropping an `output-stream` while there's still an active write in + /// progress may result in the data being lost. Before dropping the stream, + /// be sure to fully flush your writes. + @since(version = 0.2.0) + resource output-stream { + /// Check readiness for writing. This function never blocks. + /// + /// Returns the number of bytes permitted for the next call to `write`, + /// or an error. Calling `write` with more bytes than this function has + /// permitted will trap. + /// + /// When this function returns 0 bytes, the `subscribe` pollable will + /// become ready when this function will report at least 1 byte, or an + /// error. + @since(version = 0.2.0) + check-write: func() -> result; + /// Perform a write. This function never blocks. + /// + /// When the destination of a `write` is binary data, the bytes from + /// `contents` are written verbatim. When the destination of a `write` is + /// known to the implementation to be text, the bytes of `contents` are + /// transcoded from UTF-8 into the encoding of the destination and then + /// written. + /// + /// Precondition: check-write gave permit of Ok(n) and contents has a + /// length of less than or equal to n. Otherwise, this function will trap. + /// + /// returns Err(closed) without writing if the stream has closed since + /// the last call to check-write provided a permit. + @since(version = 0.2.0) + write: func(contents: list) -> result<_, stream-error>; + /// Perform a write of up to 4096 bytes, and then flush the stream. Block + /// until all of these operations are complete, or an error occurs. + /// + /// This is a convenience wrapper around the use of `check-write`, + /// `subscribe`, `write`, and `flush`, and is implemented with the + /// following pseudo-code: + /// + /// ```text + /// let pollable = this.subscribe(); + /// while !contents.is_empty() { + /// // Wait for the stream to become writable + /// pollable.block(); + /// let Ok(n) = this.check-write(); // eliding error handling + /// let len = min(n, contents.len()); + /// let (chunk, rest) = contents.split_at(len); + /// this.write(chunk ); // eliding error handling + /// contents = rest; + /// } + /// this.flush(); + /// // Wait for completion of `flush` + /// pollable.block(); + /// // Check for any errors that arose during `flush` + /// let _ = this.check-write(); // eliding error handling + /// ``` + @since(version = 0.2.0) + blocking-write-and-flush: func(contents: list) -> result<_, stream-error>; + /// Request to flush buffered output. This function never blocks. + /// + /// This tells the output-stream that the caller intends any buffered + /// output to be flushed. the output which is expected to be flushed + /// is all that has been passed to `write` prior to this call. + /// + /// Upon calling this function, the `output-stream` will not accept any + /// writes (`check-write` will return `ok(0)`) until the flush has + /// completed. The `subscribe` pollable will become ready when the + /// flush has completed and the stream can accept more writes. + @since(version = 0.2.0) + flush: func() -> result<_, stream-error>; + /// Request to flush buffered output, and block until flush completes + /// and stream is ready for writing again. + @since(version = 0.2.0) + blocking-flush: func() -> result<_, stream-error>; + /// Create a `pollable` which will resolve once the output-stream + /// is ready for more writing, or an error has occurred. When this + /// pollable is ready, `check-write` will return `ok(n)` with n>0, or an + /// error. + /// + /// If the stream is closed, this pollable is always ready immediately. + /// + /// The created `pollable` is a child resource of the `output-stream`. + /// Implementations may trap if the `output-stream` is dropped before + /// all derived `pollable`s created with this function are dropped. + @since(version = 0.2.0) + subscribe: func() -> pollable; + /// Write zeroes to a stream. + /// + /// This should be used precisely like `write` with the exact same + /// preconditions (must use check-write first), but instead of + /// passing a list of bytes, you simply pass the number of zero-bytes + /// that should be written. + @since(version = 0.2.0) + write-zeroes: func(len: u64) -> result<_, stream-error>; + /// Perform a write of up to 4096 zeroes, and then flush the stream. + /// Block until all of these operations are complete, or an error + /// occurs. + /// + /// This is a convenience wrapper around the use of `check-write`, + /// `subscribe`, `write-zeroes`, and `flush`, and is implemented with + /// the following pseudo-code: + /// + /// ```text + /// let pollable = this.subscribe(); + /// while num_zeroes != 0 { + /// // Wait for the stream to become writable + /// pollable.block(); + /// let Ok(n) = this.check-write(); // eliding error handling + /// let len = min(n, num_zeroes); + /// this.write-zeroes(len); // eliding error handling + /// num_zeroes -= len; + /// } + /// this.flush(); + /// // Wait for completion of `flush` + /// pollable.block(); + /// // Check for any errors that arose during `flush` + /// let _ = this.check-write(); // eliding error handling + /// ``` + @since(version = 0.2.0) + blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>; + /// Read from one stream and write to another. + /// + /// The behavior of splice is equivalent to: + /// 1. calling `check-write` on the `output-stream` + /// 2. calling `read` on the `input-stream` with the smaller of the + /// `check-write` permitted length and the `len` provided to `splice` + /// 3. calling `write` on the `output-stream` with that read data. + /// + /// Any error reported by the call to `check-write`, `read`, or + /// `write` ends the splice and reports that error. + /// + /// This function returns the number of bytes transferred; it may be less + /// than `len`. + @since(version = 0.2.0) + splice: func(src: borrow, len: u64) -> result; + /// Read from one stream and write to another, with blocking. + /// + /// This is similar to `splice`, except that it blocks until the + /// `output-stream` is ready for writing, and the `input-stream` + /// is ready for reading, before performing the `splice`. + @since(version = 0.2.0) + blocking-splice: func(src: borrow, len: u64) -> result; + } + } + + @since(version = 0.2.0) + world imports { + @since(version = 0.2.0) + import error; + @since(version = 0.2.0) + import poll; + @since(version = 0.2.0) + import streams; + } +} + +package wasi:random@0.2.3 { + /// The insecure-seed interface for seeding hash-map DoS resistance. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + @since(version = 0.2.0) + interface insecure-seed { + /// Return a 128-bit value that may contain a pseudo-random value. + /// + /// The returned value is not required to be computed from a CSPRNG, and may + /// even be entirely deterministic. Host implementations are encouraged to + /// provide pseudo-random values to any program exposed to + /// attacker-controlled content, to enable DoS protection built into many + /// languages' hash-map implementations. + /// + /// This function is intended to only be called once, by a source language + /// to initialize Denial Of Service (DoS) protection in its hash-map + /// implementation. + /// + /// # Expected future evolution + /// + /// This will likely be changed to a value import, to prevent it from being + /// called multiple times and potentially used for purposes other than DoS + /// protection. + @since(version = 0.2.0) + insecure-seed: func() -> tuple; + } + + /// The insecure interface for insecure pseudo-random numbers. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + @since(version = 0.2.0) + interface insecure { + /// Return `len` insecure pseudo-random bytes. + /// + /// This function is not cryptographically secure. Do not use it for + /// anything related to security. + /// + /// There are no requirements on the values of the returned bytes, however + /// implementations are encouraged to return evenly distributed values with + /// a long period. + @since(version = 0.2.0) + get-insecure-random-bytes: func(len: u64) -> list; + + /// Return an insecure pseudo-random `u64` value. + /// + /// This function returns the same type of pseudo-random data as + /// `get-insecure-random-bytes`, represented as a `u64`. + @since(version = 0.2.0) + get-insecure-random-u64: func() -> u64; + } + + /// WASI Random is a random data API. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + @since(version = 0.2.0) + interface random { + /// Return `len` cryptographically-secure random or pseudo-random bytes. + /// + /// This function must produce data at least as cryptographically secure and + /// fast as an adequately seeded cryptographically-secure pseudo-random + /// number generator (CSPRNG). It must not block, from the perspective of + /// the calling program, under any circumstances, including on the first + /// request and on requests for numbers of bytes. The returned data must + /// always be unpredictable. + /// + /// This function must always return fresh data. Deterministic environments + /// must omit this function, rather than implementing it with deterministic + /// data. + @since(version = 0.2.0) + get-random-bytes: func(len: u64) -> list; + + /// Return a cryptographically-secure random or pseudo-random `u64` value. + /// + /// This function returns the same type of data as `get-random-bytes`, + /// represented as a `u64`. + @since(version = 0.2.0) + get-random-u64: func() -> u64; + } + + @since(version = 0.2.0) + world imports { + @since(version = 0.2.0) + import random; + @since(version = 0.2.0) + import insecure; + @since(version = 0.2.0) + import insecure-seed; + } +} + +package wasi:sockets@0.2.3 { + @since(version = 0.2.0) + interface network { + /// An opaque resource that represents access to (a subset of) the network. + /// This enables context-based security for networking. + /// There is no need for this to map 1:1 to a physical network interface. + @since(version = 0.2.0) + resource network; + + /// Error codes. + /// + /// In theory, every API can return any error code. + /// In practice, API's typically only return the errors documented per API + /// combined with a couple of errors that are always possible: + /// - `unknown` + /// - `access-denied` + /// - `not-supported` + /// - `out-of-memory` + /// - `concurrency-conflict` + /// + /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. + @since(version = 0.2.0) + enum error-code { + /// Unknown error + unknown, + /// Access denied. + /// + /// POSIX equivalent: EACCES, EPERM + access-denied, + /// The operation is not supported. + /// + /// POSIX equivalent: EOPNOTSUPP + not-supported, + /// One of the arguments is invalid. + /// + /// POSIX equivalent: EINVAL + invalid-argument, + /// Not enough memory to complete the operation. + /// + /// POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY + out-of-memory, + /// The operation timed out before it could finish completely. + timeout, + /// This operation is incompatible with another asynchronous operation that is already in progress. + /// + /// POSIX equivalent: EALREADY + concurrency-conflict, + /// Trying to finish an asynchronous operation that: + /// - has not been started yet, or: + /// - was already finished by a previous `finish-*` call. + /// + /// Note: this is scheduled to be removed when `future`s are natively supported. + not-in-progress, + /// The operation has been aborted because it could not be completed immediately. + /// + /// Note: this is scheduled to be removed when `future`s are natively supported. + would-block, + /// The operation is not valid in the socket's current state. + invalid-state, + /// A new socket resource could not be created because of a system limit. + new-socket-limit, + /// A bind operation failed because the provided address is not an address that the `network` can bind to. + address-not-bindable, + /// A bind operation failed because the provided address is already in use or because there are no ephemeral ports available. + address-in-use, + /// The remote address is not reachable + remote-unreachable, + /// The TCP connection was forcefully rejected + connection-refused, + /// The TCP connection was reset. + connection-reset, + /// A TCP connection was aborted. + connection-aborted, + /// The size of a datagram sent to a UDP socket exceeded the maximum + /// supported size. + datagram-too-large, + /// Name does not exist or has no suitable associated IP addresses. + name-unresolvable, + /// A temporary failure in name resolution occurred. + temporary-resolver-failure, + /// A permanent failure in name resolution occurred. + permanent-resolver-failure, + } + + @since(version = 0.2.0) + enum ip-address-family { + /// Similar to `AF_INET` in POSIX. + ipv4, + /// Similar to `AF_INET6` in POSIX. + ipv6, + } + + @since(version = 0.2.0) + type ipv4-address = tuple; + + @since(version = 0.2.0) + type ipv6-address = tuple; + + @since(version = 0.2.0) + variant ip-address { + ipv4(ipv4-address), + ipv6(ipv6-address), + } + + @since(version = 0.2.0) + record ipv4-socket-address { + /// sin_port + port: u16, + /// sin_addr + address: ipv4-address, + } + + @since(version = 0.2.0) + record ipv6-socket-address { + /// sin6_port + port: u16, + /// sin6_flowinfo + flow-info: u32, + /// sin6_addr + address: ipv6-address, + /// sin6_scope_id + scope-id: u32, + } + + @since(version = 0.2.0) + variant ip-socket-address { + ipv4(ipv4-socket-address), + ipv6(ipv6-socket-address), + } + } + + /// This interface provides a value-export of the default network handle.. + @since(version = 0.2.0) + interface instance-network { + @since(version = 0.2.0) + use network.{network}; + + /// Get a handle to the default network. + @since(version = 0.2.0) + instance-network: func() -> network; + } + + @since(version = 0.2.0) + interface ip-name-lookup { + @since(version = 0.2.0) + use wasi:io/poll@0.2.3.{pollable}; + @since(version = 0.2.0) + use network.{network, error-code, ip-address}; + + @since(version = 0.2.0) + resource resolve-address-stream { + /// Returns the next address from the resolver. + /// + /// This function should be called multiple times. On each call, it will + /// return the next address in connection order preference. If all + /// addresses have been exhausted, this function returns `none`. + /// + /// This function never returns IPv4-mapped IPv6 addresses. + /// + /// # Typical errors + /// - `name-unresolvable`: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY) + /// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN) + /// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL) + /// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN) + @since(version = 0.2.0) + resolve-next-address: func() -> result, error-code>; + /// Create a `pollable` which will resolve once the stream is ready for I/O. + /// + /// Note: this function is here for WASI 0.2 only. + /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) + subscribe: func() -> pollable; + } + + /// Resolve an internet host name to a list of IP addresses. + /// + /// Unicode domain names are automatically converted to ASCII using IDNA encoding. + /// If the input is an IP address string, the address is parsed and returned + /// as-is without making any external requests. + /// + /// See the wasi-socket proposal README.md for a comparison with getaddrinfo. + /// + /// This function never blocks. It either immediately fails or immediately + /// returns successfully with a `resolve-address-stream` that can be used + /// to (asynchronously) fetch the results. + /// + /// # Typical errors + /// - `invalid-argument`: `name` is a syntactically invalid domain name or IP address. + /// + /// # References: + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + resolve-addresses: func(network: borrow, name: string) -> result; + } + + @since(version = 0.2.0) + interface tcp { + @since(version = 0.2.0) + use wasi:io/streams@0.2.3.{input-stream, output-stream}; + @since(version = 0.2.0) + use wasi:io/poll@0.2.3.{pollable}; + @since(version = 0.2.0) + use wasi:clocks/monotonic-clock@0.2.3.{duration}; + @since(version = 0.2.0) + use network.{network, error-code, ip-socket-address, ip-address-family}; + + @since(version = 0.2.0) + enum shutdown-type { + /// Similar to `SHUT_RD` in POSIX. + receive, + /// Similar to `SHUT_WR` in POSIX. + send, + /// Similar to `SHUT_RDWR` in POSIX. + both, + } + + /// A TCP socket resource. + /// + /// The socket can be in one of the following states: + /// - `unbound` + /// - `bind-in-progress` + /// - `bound` (See note below) + /// - `listen-in-progress` + /// - `listening` + /// - `connect-in-progress` + /// - `connected` + /// - `closed` + /// See + /// for more information. + /// + /// Note: Except where explicitly mentioned, whenever this documentation uses + /// the term "bound" without backticks it actually means: in the `bound` state *or higher*. + /// (i.e. `bound`, `listen-in-progress`, `listening`, `connect-in-progress` or `connected`) + /// + /// In addition to the general error codes documented on the + /// `network::error-code` type, TCP socket methods may always return + /// `error(invalid-state)` when in the `closed` state. + @since(version = 0.2.0) + resource tcp-socket { + /// Bind the socket to a specific network on the provided IP address and port. + /// + /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which + /// network interface(s) to bind to. + /// If the TCP/UDP port is zero, the socket will be bound to a random free port. + /// + /// Bind can be attempted multiple times on the same socket, even with + /// different arguments on each iteration. But never concurrently and + /// only as long as the previous bind failed. Once a bind succeeds, the + /// binding can't be changed anymore. + /// + /// # Typical errors + /// - `invalid-argument`: The `local-address` has the wrong address family. (EAFNOSUPPORT, EFAULT on Windows) + /// - `invalid-argument`: `local-address` is not a unicast address. (EINVAL) + /// - `invalid-argument`: `local-address` is an IPv4-mapped IPv6 address. (EINVAL) + /// - `invalid-state`: The socket is already bound. (EINVAL) + /// - `address-in-use`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows) + /// - `address-in-use`: Address is already in use. (EADDRINUSE) + /// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL) + /// - `not-in-progress`: A `bind` operation is not in progress. + /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) + /// + /// # Implementors note + /// When binding to a non-zero port, this bind operation shouldn't be affected by the TIME_WAIT + /// state of a recently closed socket on the same local address. In practice this means that the SO_REUSEADDR + /// socket option should be set implicitly on all platforms, except on Windows where this is the default behavior + /// and SO_REUSEADDR performs something different entirely. + /// + /// Unlike in POSIX, in WASI the bind operation is async. This enables + /// interactive WASI hosts to inject permission prompts. Runtimes that + /// don't want to make use of this ability can simply call the native + /// `bind` as part of either `start-bind` or `finish-bind`. + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; + @since(version = 0.2.0) + finish-bind: func() -> result<_, error-code>; + /// Connect to a remote endpoint. + /// + /// On success: + /// - the socket is transitioned into the `connected` state. + /// - a pair of streams is returned that can be used to read & write to the connection + /// + /// After a failed connection attempt, the socket will be in the `closed` + /// state and the only valid action left is to `drop` the socket. A single + /// socket can not be used to connect more than once. + /// + /// # Typical errors + /// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) + /// - `invalid-argument`: `remote-address` is not a unicast address. (EINVAL, ENETUNREACH on Linux, EAFNOSUPPORT on MacOS) + /// - `invalid-argument`: `remote-address` is an IPv4-mapped IPv6 address. (EINVAL, EADDRNOTAVAIL on Illumos) + /// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EADDRNOTAVAIL on Windows) + /// - `invalid-argument`: The port in `remote-address` is set to 0. (EADDRNOTAVAIL on Windows) + /// - `invalid-argument`: The socket is already attached to a different network. The `network` passed to `connect` must be identical to the one passed to `bind`. + /// - `invalid-state`: The socket is already in the `connected` state. (EISCONN) + /// - `invalid-state`: The socket is already in the `listening` state. (EOPNOTSUPP, EINVAL on Windows) + /// - `timeout`: Connection timed out. (ETIMEDOUT) + /// - `connection-refused`: The connection was forcefully rejected. (ECONNREFUSED) + /// - `connection-reset`: The connection was reset. (ECONNRESET) + /// - `connection-aborted`: The connection was aborted. (ECONNABORTED) + /// - `remote-unreachable`: The remote address is not reachable. (EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET) + /// - `address-in-use`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD) + /// - `not-in-progress`: A connect operation is not in progress. + /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) + /// + /// # Implementors note + /// The POSIX equivalent of `start-connect` is the regular `connect` syscall. + /// Because all WASI sockets are non-blocking this is expected to return + /// EINPROGRESS, which should be translated to `ok()` in WASI. + /// + /// The POSIX equivalent of `finish-connect` is a `poll` for event `POLLOUT` + /// with a timeout of 0 on the socket descriptor. Followed by a check for + /// the `SO_ERROR` socket option, in case the poll signaled readiness. + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; + @since(version = 0.2.0) + finish-connect: func() -> result, error-code>; + /// Start listening for new connections. + /// + /// Transitions the socket into the `listening` state. + /// + /// Unlike POSIX, the socket must already be explicitly bound. + /// + /// # Typical errors + /// - `invalid-state`: The socket is not bound to any local address. (EDESTADDRREQ) + /// - `invalid-state`: The socket is already in the `connected` state. (EISCONN, EINVAL on BSD) + /// - `invalid-state`: The socket is already in the `listening` state. + /// - `address-in-use`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE) + /// - `not-in-progress`: A listen operation is not in progress. + /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) + /// + /// # Implementors note + /// Unlike in POSIX, in WASI the listen operation is async. This enables + /// interactive WASI hosts to inject permission prompts. Runtimes that + /// don't want to make use of this ability can simply call the native + /// `listen` as part of either `start-listen` or `finish-listen`. + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + start-listen: func() -> result<_, error-code>; + @since(version = 0.2.0) + finish-listen: func() -> result<_, error-code>; + /// Accept a new client socket. + /// + /// The returned socket is bound and in the `connected` state. The following properties are inherited from the listener socket: + /// - `address-family` + /// - `keep-alive-enabled` + /// - `keep-alive-idle-time` + /// - `keep-alive-interval` + /// - `keep-alive-count` + /// - `hop-limit` + /// - `receive-buffer-size` + /// - `send-buffer-size` + /// + /// On success, this function returns the newly accepted client socket along with + /// a pair of streams that can be used to read & write to the connection. + /// + /// # Typical errors + /// - `invalid-state`: Socket is not in the `listening` state. (EINVAL) + /// - `would-block`: No pending connections at the moment. (EWOULDBLOCK, EAGAIN) + /// - `connection-aborted`: An incoming connection was pending, but was terminated by the client before this listener could accept it. (ECONNABORTED) + /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + accept: func() -> result, error-code>; + /// Get the bound local address. + /// + /// POSIX mentions: + /// > If the socket has not been bound to a local name, the value + /// > stored in the object pointed to by `address` is unspecified. + /// + /// WASI is stricter and requires `local-address` to return `invalid-state` when the socket hasn't been bound yet. + /// + /// # Typical errors + /// - `invalid-state`: The socket is not bound to any local address. + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + local-address: func() -> result; + /// Get the remote address. + /// + /// # Typical errors + /// - `invalid-state`: The socket is not connected to a remote address. (ENOTCONN) + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + remote-address: func() -> result; + /// Whether the socket is in the `listening` state. + /// + /// Equivalent to the SO_ACCEPTCONN socket option. + @since(version = 0.2.0) + is-listening: func() -> bool; + /// Whether this is a IPv4 or IPv6 socket. + /// + /// Equivalent to the SO_DOMAIN socket option. + @since(version = 0.2.0) + address-family: func() -> ip-address-family; + /// Hints the desired listen queue size. Implementations are free to ignore this. + /// + /// If the provided value is 0, an `invalid-argument` error is returned. + /// Any other value will never cause an error, but it might be silently clamped and/or rounded. + /// + /// # Typical errors + /// - `not-supported`: (set) The platform does not support changing the backlog size after the initial listen. + /// - `invalid-argument`: (set) The provided value was 0. + /// - `invalid-state`: (set) The socket is in the `connect-in-progress` or `connected` state. + @since(version = 0.2.0) + set-listen-backlog-size: func(value: u64) -> result<_, error-code>; + /// Enables or disables keepalive. + /// + /// The keepalive behavior can be adjusted using: + /// - `keep-alive-idle-time` + /// - `keep-alive-interval` + /// - `keep-alive-count` + /// These properties can be configured while `keep-alive-enabled` is false, but only come into effect when `keep-alive-enabled` is true. + /// + /// Equivalent to the SO_KEEPALIVE socket option. + @since(version = 0.2.0) + keep-alive-enabled: func() -> result; + @since(version = 0.2.0) + set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; + /// Amount of time the connection has to be idle before TCP starts sending keepalive packets. + /// + /// If the provided value is 0, an `invalid-argument` error is returned. + /// Any other value will never cause an error, but it might be silently clamped and/or rounded. + /// I.e. after setting a value, reading the same setting back may return a different value. + /// + /// Equivalent to the TCP_KEEPIDLE socket option. (TCP_KEEPALIVE on MacOS) + /// + /// # Typical errors + /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) + keep-alive-idle-time: func() -> result; + @since(version = 0.2.0) + set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; + /// The time between keepalive packets. + /// + /// If the provided value is 0, an `invalid-argument` error is returned. + /// Any other value will never cause an error, but it might be silently clamped and/or rounded. + /// I.e. after setting a value, reading the same setting back may return a different value. + /// + /// Equivalent to the TCP_KEEPINTVL socket option. + /// + /// # Typical errors + /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) + keep-alive-interval: func() -> result; + @since(version = 0.2.0) + set-keep-alive-interval: func(value: duration) -> result<_, error-code>; + /// The maximum amount of keepalive packets TCP should send before aborting the connection. + /// + /// If the provided value is 0, an `invalid-argument` error is returned. + /// Any other value will never cause an error, but it might be silently clamped and/or rounded. + /// I.e. after setting a value, reading the same setting back may return a different value. + /// + /// Equivalent to the TCP_KEEPCNT socket option. + /// + /// # Typical errors + /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) + keep-alive-count: func() -> result; + @since(version = 0.2.0) + set-keep-alive-count: func(value: u32) -> result<_, error-code>; + /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. + /// + /// If the provided value is 0, an `invalid-argument` error is returned. + /// + /// # Typical errors + /// - `invalid-argument`: (set) The TTL value must be 1 or higher. + @since(version = 0.2.0) + hop-limit: func() -> result; + @since(version = 0.2.0) + set-hop-limit: func(value: u8) -> result<_, error-code>; + /// The kernel buffer space reserved for sends/receives on this socket. + /// + /// If the provided value is 0, an `invalid-argument` error is returned. + /// Any other value will never cause an error, but it might be silently clamped and/or rounded. + /// I.e. after setting a value, reading the same setting back may return a different value. + /// + /// Equivalent to the SO_RCVBUF and SO_SNDBUF socket options. + /// + /// # Typical errors + /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) + receive-buffer-size: func() -> result; + @since(version = 0.2.0) + set-receive-buffer-size: func(value: u64) -> result<_, error-code>; + @since(version = 0.2.0) + send-buffer-size: func() -> result; + @since(version = 0.2.0) + set-send-buffer-size: func(value: u64) -> result<_, error-code>; + /// Create a `pollable` which can be used to poll for, or block on, + /// completion of any of the asynchronous operations of this socket. + /// + /// When `finish-bind`, `finish-listen`, `finish-connect` or `accept` + /// return `error(would-block)`, this pollable can be used to wait for + /// their success or failure, after which the method can be retried. + /// + /// The pollable is not limited to the async operation that happens to be + /// in progress at the time of calling `subscribe` (if any). Theoretically, + /// `subscribe` only has to be called once per socket and can then be + /// (re)used for the remainder of the socket's lifetime. + /// + /// See + /// for more information. + /// + /// Note: this function is here for WASI 0.2 only. + /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) + subscribe: func() -> pollable; + /// Initiate a graceful shutdown. + /// + /// - `receive`: The socket is not expecting to receive any data from + /// the peer. The `input-stream` associated with this socket will be + /// closed. Any data still in the receive queue at time of calling + /// this method will be discarded. + /// - `send`: The socket has no more data to send to the peer. The `output-stream` + /// associated with this socket will be closed and a FIN packet will be sent. + /// - `both`: Same effect as `receive` & `send` combined. + /// + /// This function is idempotent; shutting down a direction more than once + /// has no effect and returns `ok`. + /// + /// The shutdown function does not close (drop) the socket. + /// + /// # Typical errors + /// - `invalid-state`: The socket is not in the `connected` state. (ENOTCONN) + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>; + } + } + + @since(version = 0.2.0) + interface tcp-create-socket { + @since(version = 0.2.0) + use network.{network, error-code, ip-address-family}; + @since(version = 0.2.0) + use tcp.{tcp-socket}; + + /// Create a new TCP socket. + /// + /// Similar to `socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)` in POSIX. + /// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise. + /// + /// This function does not require a network capability handle. This is considered to be safe because + /// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`connect` + /// is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world. + /// + /// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations. + /// + /// # Typical errors + /// - `not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT) + /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + create-tcp-socket: func(address-family: ip-address-family) -> result; + } + + @since(version = 0.2.0) + interface udp { + @since(version = 0.2.0) + use wasi:io/poll@0.2.3.{pollable}; + @since(version = 0.2.0) + use network.{network, error-code, ip-socket-address, ip-address-family}; + + /// A received datagram. + @since(version = 0.2.0) + record incoming-datagram { + /// The payload. + /// + /// Theoretical max size: ~64 KiB. In practice, typically less than 1500 bytes. + data: list, + /// The source address. + /// + /// This field is guaranteed to match the remote address the stream was initialized with, if any. + /// + /// Equivalent to the `src_addr` out parameter of `recvfrom`. + remote-address: ip-socket-address, + } + + /// A datagram to be sent out. + @since(version = 0.2.0) + record outgoing-datagram { + /// The payload. + data: list, + /// The destination address. + /// + /// The requirements on this field depend on how the stream was initialized: + /// - with a remote address: this field must be None or match the stream's remote address exactly. + /// - without a remote address: this field is required. + /// + /// If this value is None, the send operation is equivalent to `send` in POSIX. Otherwise it is equivalent to `sendto`. + remote-address: option, + } + + /// A UDP socket handle. + @since(version = 0.2.0) + resource udp-socket { + /// Bind the socket to a specific network on the provided IP address and port. + /// + /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which + /// network interface(s) to bind to. + /// If the port is zero, the socket will be bound to a random free port. + /// + /// # Typical errors + /// - `invalid-argument`: The `local-address` has the wrong address family. (EAFNOSUPPORT, EFAULT on Windows) + /// - `invalid-state`: The socket is already bound. (EINVAL) + /// - `address-in-use`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows) + /// - `address-in-use`: Address is already in use. (EADDRINUSE) + /// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL) + /// - `not-in-progress`: A `bind` operation is not in progress. + /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) + /// + /// # Implementors note + /// Unlike in POSIX, in WASI the bind operation is async. This enables + /// interactive WASI hosts to inject permission prompts. Runtimes that + /// don't want to make use of this ability can simply call the native + /// `bind` as part of either `start-bind` or `finish-bind`. + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; + @since(version = 0.2.0) + finish-bind: func() -> result<_, error-code>; + /// Set up inbound & outbound communication channels, optionally to a specific peer. + /// + /// This function only changes the local socket configuration and does not generate any network traffic. + /// On success, the `remote-address` of the socket is updated. The `local-address` may be updated as well, + /// based on the best network path to `remote-address`. + /// + /// When a `remote-address` is provided, the returned streams are limited to communicating with that specific peer: + /// - `send` can only be used to send to this destination. + /// - `receive` will only return datagrams sent from the provided `remote-address`. + /// + /// This method may be called multiple times on the same socket to change its association, but + /// only the most recently returned pair of streams will be operational. Implementations may trap if + /// the streams returned by a previous invocation haven't been dropped yet before calling `stream` again. + /// + /// The POSIX equivalent in pseudo-code is: + /// ```text + /// if (was previously connected) { + /// connect(s, AF_UNSPEC) + /// } + /// if (remote_address is Some) { + /// connect(s, remote_address) + /// } + /// ``` + /// + /// Unlike in POSIX, the socket must already be explicitly bound. + /// + /// # Typical errors + /// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) + /// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL) + /// - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL) + /// - `invalid-state`: The socket is not bound. + /// - `address-in-use`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD) + /// - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET) + /// - `connection-refused`: The connection was refused. (ECONNREFUSED) + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + %stream: func(remote-address: option) -> result, error-code>; + /// Get the current bound address. + /// + /// POSIX mentions: + /// > If the socket has not been bound to a local name, the value + /// > stored in the object pointed to by `address` is unspecified. + /// + /// WASI is stricter and requires `local-address` to return `invalid-state` when the socket hasn't been bound yet. + /// + /// # Typical errors + /// - `invalid-state`: The socket is not bound to any local address. + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + local-address: func() -> result; + /// Get the address the socket is currently streaming to. + /// + /// # Typical errors + /// - `invalid-state`: The socket is not streaming to a specific remote address. (ENOTCONN) + /// + /// # References + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + remote-address: func() -> result; + /// Whether this is a IPv4 or IPv6 socket. + /// + /// Equivalent to the SO_DOMAIN socket option. + @since(version = 0.2.0) + address-family: func() -> ip-address-family; + /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. + /// + /// If the provided value is 0, an `invalid-argument` error is returned. + /// + /// # Typical errors + /// - `invalid-argument`: (set) The TTL value must be 1 or higher. + @since(version = 0.2.0) + unicast-hop-limit: func() -> result; + @since(version = 0.2.0) + set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; + /// The kernel buffer space reserved for sends/receives on this socket. + /// + /// If the provided value is 0, an `invalid-argument` error is returned. + /// Any other value will never cause an error, but it might be silently clamped and/or rounded. + /// I.e. after setting a value, reading the same setting back may return a different value. + /// + /// Equivalent to the SO_RCVBUF and SO_SNDBUF socket options. + /// + /// # Typical errors + /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) + receive-buffer-size: func() -> result; + @since(version = 0.2.0) + set-receive-buffer-size: func(value: u64) -> result<_, error-code>; + @since(version = 0.2.0) + send-buffer-size: func() -> result; + @since(version = 0.2.0) + set-send-buffer-size: func(value: u64) -> result<_, error-code>; + /// Create a `pollable` which will resolve once the socket is ready for I/O. + /// + /// Note: this function is here for WASI 0.2 only. + /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) + subscribe: func() -> pollable; + } + + @since(version = 0.2.0) + resource incoming-datagram-stream { + /// Receive messages on the socket. + /// + /// This function attempts to receive up to `max-results` datagrams on the socket without blocking. + /// The returned list may contain fewer elements than requested, but never more. + /// + /// This function returns successfully with an empty list when either: + /// - `max-results` is 0, or: + /// - `max-results` is greater than 0, but no results are immediately available. + /// This function never returns `error(would-block)`. + /// + /// # Typical errors + /// - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET) + /// - `connection-refused`: The connection was refused. (ECONNREFUSED) + /// + /// # References + /// - + /// - + /// - + /// - + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + receive: func(max-results: u64) -> result, error-code>; + /// Create a `pollable` which will resolve once the stream is ready to receive again. + /// + /// Note: this function is here for WASI 0.2 only. + /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) + subscribe: func() -> pollable; + } + + @since(version = 0.2.0) + resource outgoing-datagram-stream { + /// Check readiness for sending. This function never blocks. + /// + /// Returns the number of datagrams permitted for the next call to `send`, + /// or an error. Calling `send` with more datagrams than this function has + /// permitted will trap. + /// + /// When this function returns ok(0), the `subscribe` pollable will + /// become ready when this function will report at least ok(1), or an + /// error. + /// + /// Never returns `would-block`. + check-send: func() -> result; + /// Send messages on the socket. + /// + /// This function attempts to send all provided `datagrams` on the socket without blocking and + /// returns how many messages were actually sent (or queued for sending). This function never + /// returns `error(would-block)`. If none of the datagrams were able to be sent, `ok(0)` is returned. + /// + /// This function semantically behaves the same as iterating the `datagrams` list and sequentially + /// sending each individual datagram until either the end of the list has been reached or the first error occurred. + /// If at least one datagram has been sent successfully, this function never returns an error. + /// + /// If the input list is empty, the function returns `ok(0)`. + /// + /// Each call to `send` must be permitted by a preceding `check-send`. Implementations must trap if + /// either `check-send` was not called or `datagrams` contains more items than `check-send` permitted. + /// + /// # Typical errors + /// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) + /// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL) + /// - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL) + /// - `invalid-argument`: The socket is in "connected" mode and `remote-address` is `some` value that does not match the address passed to `stream`. (EISCONN) + /// - `invalid-argument`: The socket is not "connected" and no value for `remote-address` was provided. (EDESTADDRREQ) + /// - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET) + /// - `connection-refused`: The connection was refused. (ECONNREFUSED) + /// - `datagram-too-large`: The datagram is too large. (EMSGSIZE) + /// + /// # References + /// - + /// - + /// - + /// - + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + send: func(datagrams: list) -> result; + /// Create a `pollable` which will resolve once the stream is ready to send again. + /// + /// Note: this function is here for WASI 0.2 only. + /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) + subscribe: func() -> pollable; + } + } + + @since(version = 0.2.0) + interface udp-create-socket { + @since(version = 0.2.0) + use network.{network, error-code, ip-address-family}; + @since(version = 0.2.0) + use udp.{udp-socket}; + + /// Create a new UDP socket. + /// + /// Similar to `socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)` in POSIX. + /// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise. + /// + /// This function does not require a network capability handle. This is considered to be safe because + /// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind` is called, + /// the socket is effectively an in-memory configuration object, unable to communicate with the outside world. + /// + /// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations. + /// + /// # Typical errors + /// - `not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT) + /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) + /// + /// # References: + /// - + /// - + /// - + /// - + @since(version = 0.2.0) + create-udp-socket: func(address-family: ip-address-family) -> result; + } + + @since(version = 0.2.0) + world imports { + @since(version = 0.2.0) + import network; + @since(version = 0.2.0) + import instance-network; + @since(version = 0.2.0) + import wasi:io/poll@0.2.3; + @since(version = 0.2.0) + import udp; + @since(version = 0.2.0) + import udp-create-socket; + @since(version = 0.2.0) + import wasi:io/error@0.2.3; + @since(version = 0.2.0) + import wasi:io/streams@0.2.3; + @since(version = 0.2.0) + import wasi:clocks/monotonic-clock@0.2.3; + @since(version = 0.2.0) + import tcp; + @since(version = 0.2.0) + import tcp-create-socket; + @since(version = 0.2.0) + import ip-name-lookup; + } +} diff --git a/wit/host/hyperlight.wit b/wit/host/hyperlight.wit index ee71829..f3f76d2 100644 --- a/wit/host/hyperlight.wit +++ b/wit/host/hyperlight.wit @@ -3,12 +3,15 @@ package root:component; world root { import wasi:io/poll@0.2.9; import wasi:clocks/monotonic-clock@0.2.9; + import wasi:clocks/wall-clock@0.2.9; import wasi:random/random@0.2.9; import wasi:io/error@0.2.9; import wasi:io/streams@0.2.9; import wasi:cli/stdout@0.2.9; import wasi:cli/stderr@0.2.9; import wasi:cli/stdin@0.2.9; + import wasi:cli/environment@0.2.9; + import wasi:cli/exit@0.2.9; import wasi:http/types@0.2.9; import wasi:http/outgoing-handler@0.2.9; From 130c13a04d0d9829e63df2d6d9f3c750993a146d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= Date: Tue, 17 Mar 2026 17:04:25 +0200 Subject: [PATCH 04/10] Update guest js world to be smaller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Doru Blânzeanu --- wit/guest_js/world.wit | 2566 +++------------------------------------- 1 file changed, 138 insertions(+), 2428 deletions(-) diff --git a/wit/guest_js/world.wit b/wit/guest_js/world.wit index 9ff6ce3..0857e96 100644 --- a/wit/guest_js/world.wit +++ b/wit/guest_js/world.wit @@ -7,9 +7,7 @@ world root { import wasi:random/random@0.2.3; import wasi:io/error@0.2.3; import wasi:io/streams@0.2.3; - import wasi:cli/stdout@0.2.3; import wasi:cli/stderr@0.2.3; - import wasi:cli/stdin@0.2.3; import wasi:cli/environment@0.2.3; import wasi:cli/exit@0.2.3; import wasi:http/types@0.2.3; @@ -18,532 +16,150 @@ world root { export wasi:http/incoming-handler@0.2.3; } -package wasi:cli@0.2.3 { - @since(version = 0.2.0) - interface environment { - /// Get the POSIX-style environment variables. - /// - /// Each environment variable is provided as a pair of string variable names - /// and string value. - /// - /// Morally, these are a value import, but until value imports are available - /// in the component model, this import function should return the same - /// values each time it is called. - @since(version = 0.2.0) - get-environment: func() -> list>; - - /// Get the POSIX-style arguments to the program. - @since(version = 0.2.0) - get-arguments: func() -> list; - - /// Return a path that programs should use as their initial current working - /// directory, interpreting `.` as shorthand for this. - @since(version = 0.2.0) - initial-cwd: func() -> option; - } - - @since(version = 0.2.0) - interface exit { - /// Exit the current instance and any linked instances. - @since(version = 0.2.0) - exit: func(status: result); - } - - @since(version = 0.2.0) - interface run { - /// Run the program. - @since(version = 0.2.0) - run: func() -> result; - } - - @since(version = 0.2.0) - interface stdin { - @since(version = 0.2.0) - use wasi:io/streams@0.2.3.{input-stream}; - - @since(version = 0.2.0) - get-stdin: func() -> input-stream; - } - - @since(version = 0.2.0) - interface stdout { - @since(version = 0.2.0) - use wasi:io/streams@0.2.3.{output-stream}; - - @since(version = 0.2.0) - get-stdout: func() -> output-stream; - } - - @since(version = 0.2.0) - interface stderr { - @since(version = 0.2.0) - use wasi:io/streams@0.2.3.{output-stream}; - - @since(version = 0.2.0) - get-stderr: func() -> output-stream; - } - - /// Terminal input. - /// - /// In the future, this may include functions for disabling echoing, - /// disabling input buffering so that keyboard events are sent through - /// immediately, querying supported features, and so on. - @since(version = 0.2.0) - interface terminal-input { - /// The input side of a terminal. - @since(version = 0.2.0) - resource terminal-input; - } - - /// Terminal output. - /// - /// In the future, this may include functions for querying the terminal - /// size, being notified of terminal size changes, querying supported - /// features, and so on. - @since(version = 0.2.0) - interface terminal-output { - /// The output side of a terminal. - @since(version = 0.2.0) - resource terminal-output; - } - - /// An interface providing an optional `terminal-input` for stdin as a - /// link-time authority. - @since(version = 0.2.0) - interface terminal-stdin { - @since(version = 0.2.0) - use terminal-input.{terminal-input}; +package wasi:io@0.2.3 { + interface poll { + resource pollable { + ready: func() -> bool; + block: func(); + } - /// If stdin is connected to a terminal, return a `terminal-input` handle - /// allowing further interaction with it. - @since(version = 0.2.0) - get-terminal-stdin: func() -> option; + poll: func(in: list>) -> list; } - - /// An interface providing an optional `terminal-output` for stdout as a - /// link-time authority. - @since(version = 0.2.0) - interface terminal-stdout { - @since(version = 0.2.0) - use terminal-output.{terminal-output}; - - /// If stdout is connected to a terminal, return a `terminal-output` handle - /// allowing further interaction with it. - @since(version = 0.2.0) - get-terminal-stdout: func() -> option; + interface error { + resource error { + to-debug-string: func() -> string; + } } + interface streams { + use error.{error}; + use poll.{pollable}; - /// An interface providing an optional `terminal-output` for stderr as a - /// link-time authority. - @since(version = 0.2.0) - interface terminal-stderr { - @since(version = 0.2.0) - use terminal-output.{terminal-output}; - - /// If stderr is connected to a terminal, return a `terminal-output` handle - /// allowing further interaction with it. - @since(version = 0.2.0) - get-terminal-stderr: func() -> option; - } + resource input-stream { + read: func(len: u64) -> result, stream-error>; + blocking-read: func(len: u64) -> result, stream-error>; + skip: func(len: u64) -> result; + blocking-skip: func(len: u64) -> result; + subscribe: func() -> pollable; + } - @since(version = 0.2.0) - world imports { - @since(version = 0.2.0) - import environment; - @since(version = 0.2.0) - import exit; - @since(version = 0.2.0) - import wasi:io/error@0.2.3; - @since(version = 0.2.0) - import wasi:io/poll@0.2.3; - @since(version = 0.2.0) - import wasi:io/streams@0.2.3; - @since(version = 0.2.0) - import stdin; - @since(version = 0.2.0) - import stdout; - @since(version = 0.2.0) - import stderr; - @since(version = 0.2.0) - import terminal-input; - @since(version = 0.2.0) - import terminal-output; - @since(version = 0.2.0) - import terminal-stdin; - @since(version = 0.2.0) - import terminal-stdout; - @since(version = 0.2.0) - import terminal-stderr; - @since(version = 0.2.0) - import wasi:clocks/monotonic-clock@0.2.3; - @since(version = 0.2.0) - import wasi:clocks/wall-clock@0.2.3; - @since(version = 0.2.0) - import wasi:filesystem/types@0.2.3; - @since(version = 0.2.0) - import wasi:filesystem/preopens@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/network@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/instance-network@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/udp@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/udp-create-socket@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/tcp@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/tcp-create-socket@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/ip-name-lookup@0.2.3; - @since(version = 0.2.0) - import wasi:random/random@0.2.3; - @since(version = 0.2.0) - import wasi:random/insecure@0.2.3; - @since(version = 0.2.0) - import wasi:random/insecure-seed@0.2.3; - } - @since(version = 0.2.0) - world command { - @since(version = 0.2.0) - import environment; - @since(version = 0.2.0) - import exit; - @since(version = 0.2.0) - import wasi:io/error@0.2.3; - @since(version = 0.2.0) - import wasi:io/poll@0.2.3; - @since(version = 0.2.0) - import wasi:io/streams@0.2.3; - @since(version = 0.2.0) - import stdin; - @since(version = 0.2.0) - import stdout; - @since(version = 0.2.0) - import stderr; - @since(version = 0.2.0) - import terminal-input; - @since(version = 0.2.0) - import terminal-output; - @since(version = 0.2.0) - import terminal-stdin; - @since(version = 0.2.0) - import terminal-stdout; - @since(version = 0.2.0) - import terminal-stderr; - @since(version = 0.2.0) - import wasi:clocks/monotonic-clock@0.2.3; - @since(version = 0.2.0) - import wasi:clocks/wall-clock@0.2.3; - @since(version = 0.2.0) - import wasi:filesystem/types@0.2.3; - @since(version = 0.2.0) - import wasi:filesystem/preopens@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/network@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/instance-network@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/udp@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/udp-create-socket@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/tcp@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/tcp-create-socket@0.2.3; - @since(version = 0.2.0) - import wasi:sockets/ip-name-lookup@0.2.3; - @since(version = 0.2.0) - import wasi:random/random@0.2.3; - @since(version = 0.2.0) - import wasi:random/insecure@0.2.3; - @since(version = 0.2.0) - import wasi:random/insecure-seed@0.2.3; + resource output-stream { + check-write: func() -> result; + write: func(contents: list) -> result<_, stream-error>; + blocking-write-and-flush: func(contents: list) -> result<_, stream-error>; + flush: func() -> result<_, stream-error>; + blocking-flush: func() -> result<_, stream-error>; + subscribe: func() -> pollable; + write-zeroes: func(len: u64) -> result<_, stream-error>; + blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>; + splice: func(src: borrow, len: u64) -> result; + blocking-splice: func(src: borrow, len: u64) -> result; + } - @since(version = 0.2.0) - export run; + variant stream-error { + last-operation-failed(error), + closed, + } } } + package wasi:clocks@0.2.3 { - /// WASI Monotonic Clock is a clock API intended to let users measure elapsed - /// time. - /// - /// It is intended to be portable at least between Unix-family platforms and - /// Windows. - /// - /// A monotonic clock is a clock which has an unspecified initial value, and - /// successive reads of the clock will produce non-decreasing values. - @since(version = 0.2.0) interface monotonic-clock { - @since(version = 0.2.0) use wasi:io/poll@0.2.3.{pollable}; - /// An instant in time, in nanoseconds. An instant is relative to an - /// unspecified initial value, and can only be compared to instances from - /// the same monotonic-clock. - @since(version = 0.2.0) type instant = u64; - /// A duration of time, in nanoseconds. - @since(version = 0.2.0) type duration = u64; - /// Read the current value of the clock. - /// - /// The clock is monotonic, therefore calling this function repeatedly will - /// produce a sequence of non-decreasing values. - @since(version = 0.2.0) now: func() -> instant; - /// Query the resolution of the clock. Returns the duration of time - /// corresponding to a clock tick. - @since(version = 0.2.0) resolution: func() -> duration; - /// Create a `pollable` which will resolve once the specified instant - /// has occurred. - @since(version = 0.2.0) subscribe-instant: func(when: instant) -> pollable; - /// Create a `pollable` that will resolve after the specified duration has - /// elapsed from the time this function is invoked. - @since(version = 0.2.0) subscribe-duration: func(when: duration) -> pollable; } - - /// WASI Wall Clock is a clock API intended to let users query the current - /// time. The name "wall" makes an analogy to a "clock on the wall", which - /// is not necessarily monotonic as it may be reset. - /// - /// It is intended to be portable at least between Unix-family platforms and - /// Windows. - /// - /// A wall clock is a clock which measures the date and time according to - /// some external reference. - /// - /// External references may be reset, so this clock is not necessarily - /// monotonic, making it unsuitable for measuring elapsed time. - /// - /// It is intended for reporting the current date and time for humans. - @since(version = 0.2.0) interface wall-clock { - /// A time and date in seconds plus nanoseconds. - @since(version = 0.2.0) record datetime { seconds: u64, nanoseconds: u32, } - /// Read the current value of the clock. - /// - /// This clock is not monotonic, therefore calling this function repeatedly - /// will not necessarily produce a sequence of non-decreasing values. - /// - /// The returned timestamps represent the number of seconds since - /// 1970-01-01T00:00:00Z, also known as [POSIX's Seconds Since the Epoch], - /// also known as [Unix Time]. - /// - /// The nanoseconds field of the output is always less than 1000000000. - /// - /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 - /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time - @since(version = 0.2.0) now: func() -> datetime; - /// Query the resolution of the clock. - /// - /// The nanoseconds field of the output is always less than 1000000000. - @since(version = 0.2.0) resolution: func() -> datetime; } - - @since(version = 0.2.0) - world imports { - @since(version = 0.2.0) - import wasi:io/poll@0.2.3; - @since(version = 0.2.0) - import monotonic-clock; - @since(version = 0.2.0) - import wall-clock; - } } -package wasi:filesystem@0.2.3 { - interface types { - use wasi:io/streams@0.2.3.{input-stream, output-stream, error}; - use wasi:clocks/wall-clock@0.2.3.{datetime}; - type filesize = u64; +package wasi:random@0.2.3 { + interface random { + get-random-bytes: func(len: u64) -> list; - enum descriptor-type { - unknown, - block-device, - character-device, - directory, - fifo, - symbolic-link, - regular-file, - socket, - } + get-random-u64: func() -> u64; + } +} - flags descriptor-flags { - read, - write, - file-integrity-sync, - data-integrity-sync, - requested-write-sync, - mutate-directory, - } - flags path-flags { - symlink-follow, - } +package wasi:cli@0.2.3 { + interface stderr { + use wasi:io/streams@0.2.3.{output-stream}; - flags open-flags { - create, - directory, - exclusive, - truncate, - } + get-stderr: func() -> output-stream; + } + interface environment { + get-environment: func() -> list>; - type link-count = u64; + get-arguments: func() -> list; - record descriptor-stat { - %type: descriptor-type, - link-count: link-count, - size: filesize, - data-access-timestamp: option, - data-modification-timestamp: option, - status-change-timestamp: option, - } + initial-cwd: func() -> option; + } + interface exit { + exit: func(status: result); + } +} - variant new-timestamp { - no-change, - now, - timestamp(datetime), - } - record directory-entry { - %type: descriptor-type, - name: string, - } +package wasi:http@0.2.3 { + interface types { + use wasi:io/streams@0.2.3.{input-stream, output-stream}; + use wasi:io/poll@0.2.3.{pollable}; + use wasi:io/error@0.2.3.{error as io-error}; + use wasi:clocks/monotonic-clock@0.2.3.{duration}; - enum error-code { - access, - would-block, - already, - bad-descriptor, - busy, - deadlock, - quota, - exist, - file-too-large, - illegal-byte-sequence, - in-progress, - interrupted, - invalid, - io, - is-directory, - loop, - too-many-links, - message-size, - name-too-long, - no-device, - no-entry, - no-lock, - insufficient-memory, - insufficient-space, - not-directory, - not-empty, - not-recoverable, - unsupported, - no-tty, - no-such-device, - overflow, - not-permitted, - pipe, - read-only, - invalid-seek, - text-file-busy, - cross-device, + resource fields { + constructor(); + from-list: static func(entries: list>) -> result; + get: func(name: field-name) -> list; + has: func(name: field-name) -> bool; + set: func(name: field-name, value: list) -> result<_, header-error>; + delete: func(name: field-name) -> result<_, header-error>; + append: func(name: field-name, value: field-value) -> result<_, header-error>; + entries: func() -> list>; + clone: func() -> fields; } - enum advice { - normal, - sequential, - random, - will-need, - dont-need, - no-reuse, - } + type field-key = string; - record metadata-hash-value { - lower: u64, - upper: u64, - } + type field-name = field-key; - resource descriptor { - read-via-stream: func(offset: filesize) -> result; - write-via-stream: func(offset: filesize) -> result; - append-via-stream: func() -> result; - advise: func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; - sync-data: func() -> result<_, error-code>; - get-flags: func() -> result; - get-type: func() -> result; - set-size: func(size: filesize) -> result<_, error-code>; - set-times: func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - read: func(length: filesize, offset: filesize) -> result, bool>, error-code>; - write: func(buffer: list, offset: filesize) -> result; - read-directory: func() -> result; - sync: func() -> result<_, error-code>; - create-directory-at: func(path: string) -> result<_, error-code>; - stat: func() -> result; - stat-at: func(path-flags: path-flags, path: string) -> result; - set-times-at: func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; - link-at: func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - open-at: func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; - readlink-at: func(path: string) -> result; - remove-directory-at: func(path: string) -> result<_, error-code>; - rename-at: func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; - symlink-at: func(old-path: string, new-path: string) -> result<_, error-code>; - unlink-file-at: func(path: string) -> result<_, error-code>; - is-same-object: func(other: borrow) -> bool; - metadata-hash: func() -> result; - metadata-hash-at: func(path-flags: path-flags, path: string) -> result; - } + type field-value = list; - resource directory-entry-stream { - read-directory-entry: func() -> result, error-code>; + variant header-error { + invalid-syntax, + forbidden, + immutable, } - filesystem-error-code: func(err: borrow) -> option; - } - - interface preopens { - use types.{descriptor}; - - get-directories: func() -> list>; - } -} - -package wasi:http@0.2.3 { - /// This interface defines all of the types and methods for implementing - /// HTTP Requests and Responses, both incoming and outgoing, as well as - /// their headers, trailers, and bodies. - @since(version = 0.2.0) - interface types { - @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.3.{duration}; - @since(version = 0.2.0) - use wasi:io/streams@0.2.3.{input-stream, output-stream}; - @since(version = 0.2.0) - use wasi:io/error@0.2.3.{error as io-error}; - @since(version = 0.2.0) - use wasi:io/poll@0.2.3.{pollable}; + resource incoming-request { + method: func() -> method; + path-with-query: func() -> option; + scheme: func() -> option; + authority: func() -> option; + headers: func() -> headers; + consume: func() -> result; + } - /// This type corresponds to HTTP standard Methods. - @since(version = 0.2.0) variant method { get, head, @@ -557,38 +173,65 @@ package wasi:http@0.2.3 { other(string), } - /// This type corresponds to HTTP standard Related Schemes. - @since(version = 0.2.0) variant scheme { HTTP, HTTPS, other(string), } - /// Defines the case payload type for `DNS-error` above: - @since(version = 0.2.0) + type headers = fields; + + resource incoming-body { + %stream: func() -> result; + finish: static func(this: incoming-body) -> future-trailers; + } + + resource outgoing-request { + constructor(headers: headers); + body: func() -> result; + method: func() -> method; + set-method: func(method: method) -> result; + path-with-query: func() -> option; + set-path-with-query: func(path-with-query: option) -> result; + scheme: func() -> option; + set-scheme: func(scheme: option) -> result; + authority: func() -> option; + set-authority: func(authority: option) -> result; + headers: func() -> headers; + } + + resource outgoing-body { + write: func() -> result; + finish: static func(this: outgoing-body, trailers: option) -> result<_, error-code>; + } + + resource response-outparam { + set: static func(param: response-outparam, response: result); + } + + resource outgoing-response { + constructor(headers: headers); + status-code: func() -> status-code; + set-status-code: func(status-code: status-code) -> result; + headers: func() -> headers; + body: func() -> result; + } + record DNS-error-payload { rcode: option, info-code: option, } - /// Defines the case payload type for `TLS-alert-received` above: - @since(version = 0.2.0) record TLS-alert-received-payload { alert-id: option, alert-message: option, } - /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: - @since(version = 0.2.0) record field-size-payload { field-name: option, field-size: option, } - /// These cases are inspired by the IANA HTTP Proxy Error Types: - /// - @since(version = 0.2.0) variant error-code { DNS-timeout, DNS-error(DNS-error-payload), @@ -628,1982 +271,49 @@ package wasi:http@0.2.3 { HTTP-protocol-error, loop-detected, configuration-error, - /// This is a catch-all error for anything that doesn't fit cleanly into a - /// more specific case. It also includes an optional string for an - /// unstructured description of the error. Users should not depend on the - /// string for diagnosing errors, as it's not required to be consistent - /// between implementations. internal-error(option), } - /// This type enumerates the different kinds of errors that may occur when - /// setting or appending to a `fields` resource. - @since(version = 0.2.0) - variant header-error { - /// This error indicates that a `field-name` or `field-value` was - /// syntactically invalid when used with an operation that sets headers in a - /// `fields`. - invalid-syntax, - /// This error indicates that a forbidden `field-name` was used when trying - /// to set a header in a `fields`. - forbidden, - /// This error indicates that the operation on the `fields` was not - /// permitted because the fields are immutable. - immutable, - } - - /// Field keys are always strings. - /// - /// Field keys should always be treated as case insensitive by the `fields` - /// resource for the purposes of equality checking. - /// - /// # Deprecation - /// - /// This type has been deprecated in favor of the `field-name` type. - @since(version = 0.2.0) - @deprecated(version = 0.2.2) - type field-key = string; - - /// Field names are always strings. - /// - /// Field names should always be treated as case insensitive by the `fields` - /// resource for the purposes of equality checking. - @since(version = 0.2.1) - type field-name = field-key; - - /// Field values should always be ASCII strings. However, in - /// reality, HTTP implementations often have to interpret malformed values, - /// so they are provided as a list of bytes. - @since(version = 0.2.0) - type field-value = list; - - /// This following block defines the `fields` resource which corresponds to - /// HTTP standard Fields. Fields are a common representation used for both - /// Headers and Trailers. - /// - /// A `fields` may be mutable or immutable. A `fields` created using the - /// constructor, `from-list`, or `clone` will be mutable, but a `fields` - /// resource given by other means (including, but not limited to, - /// `incoming-request.headers`, `outgoing-request.headers`) might be be - /// immutable. In an immutable fields, the `set`, `append`, and `delete` - /// operations will fail with `header-error.immutable`. - @since(version = 0.2.0) - resource fields { - /// Construct an empty HTTP Fields. - /// - /// The resulting `fields` is mutable. - @since(version = 0.2.0) - constructor(); - /// Construct an HTTP Fields. - /// - /// The resulting `fields` is mutable. - /// - /// The list represents each name-value pair in the Fields. Names - /// which have multiple values are represented by multiple entries in this - /// list with the same name. - /// - /// The tuple is a pair of the field name, represented as a string, and - /// Value, represented as a list of bytes. - /// - /// An error result will be returned if any `field-name` or `field-value` is - /// syntactically invalid, or if a field is forbidden. - @since(version = 0.2.0) - from-list: static func(entries: list>) -> result; - /// Get all of the values corresponding to a name. If the name is not present - /// in this `fields` or is syntactically invalid, an empty list is returned. - /// However, if the name is present but empty, this is represented by a list - /// with one or more empty field-values present. - @since(version = 0.2.0) - get: func(name: field-name) -> list; - /// Returns `true` when the name is present in this `fields`. If the name is - /// syntactically invalid, `false` is returned. - @since(version = 0.2.0) - has: func(name: field-name) -> bool; - /// Set all of the values for a name. Clears any existing values for that - /// name, if they have been set. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - /// - /// Fails with `header-error.invalid-syntax` if the `field-name` or any of - /// the `field-value`s are syntactically invalid. - @since(version = 0.2.0) - set: func(name: field-name, value: list) -> result<_, header-error>; - /// Delete all values for a name. Does nothing if no values for the name - /// exist. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - /// - /// Fails with `header-error.invalid-syntax` if the `field-name` is - /// syntactically invalid. - @since(version = 0.2.0) - delete: func(name: field-name) -> result<_, header-error>; - /// Append a value for a name. Does not change or delete any existing - /// values for that name. - /// - /// Fails with `header-error.immutable` if the `fields` are immutable. - /// - /// Fails with `header-error.invalid-syntax` if the `field-name` or - /// `field-value` are syntactically invalid. - @since(version = 0.2.0) - append: func(name: field-name, value: field-value) -> result<_, header-error>; - /// Retrieve the full set of names and values in the Fields. Like the - /// constructor, the list represents each name-value pair. - /// - /// The outer list represents each name-value pair in the Fields. Names - /// which have multiple values are represented by multiple entries in this - /// list with the same name. - /// - /// The names and values are always returned in the original casing and in - /// the order in which they will be serialized for transport. - @since(version = 0.2.0) - entries: func() -> list>; - /// Make a deep copy of the Fields. Equivalent in behavior to calling the - /// `fields` constructor on the return value of `entries`. The resulting - /// `fields` is mutable. - @since(version = 0.2.0) - clone: func() -> fields; + resource incoming-response { + status: func() -> status-code; + headers: func() -> headers; + consume: func() -> result; } - /// Headers is an alias for Fields. - @since(version = 0.2.0) - type headers = fields; + type status-code = u16; - /// Trailers is an alias for Fields. - @since(version = 0.2.0) type trailers = fields; - /// Represents an incoming HTTP Request. - @since(version = 0.2.0) - resource incoming-request { - /// Returns the method of the incoming request. - @since(version = 0.2.0) - method: func() -> method; - /// Returns the path with query parameters from the request, as a string. - @since(version = 0.2.0) - path-with-query: func() -> option; - /// Returns the protocol scheme from the request. - @since(version = 0.2.0) - scheme: func() -> option; - /// Returns the authority of the Request's target URI, if present. - @since(version = 0.2.0) - authority: func() -> option; - /// Get the `headers` associated with the request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// The `headers` returned are a child resource: it must be dropped before - /// the parent `incoming-request` is dropped. Dropping this - /// `incoming-request` before all children are dropped will trap. - @since(version = 0.2.0) - headers: func() -> headers; - /// Gives the `incoming-body` associated with this request. Will only - /// return success at most once, and subsequent calls will return error. - @since(version = 0.2.0) - consume: func() -> result; - } - - /// Represents an outgoing HTTP Request. - @since(version = 0.2.0) - resource outgoing-request { - /// Construct a new `outgoing-request` with a default `method` of `GET`, and - /// `none` values for `path-with-query`, `scheme`, and `authority`. - /// - /// * `headers` is the HTTP Headers for the Request. - /// - /// It is possible to construct, or manipulate with the accessor functions - /// below, an `outgoing-request` with an invalid combination of `scheme` - /// and `authority`, or `headers` which are not permitted to be sent. - /// It is the obligation of the `outgoing-handler.handle` implementation - /// to reject invalid constructions of `outgoing-request`. - @since(version = 0.2.0) - constructor(headers: headers); - /// Returns the resource corresponding to the outgoing Body for this - /// Request. - /// - /// Returns success on the first call: the `outgoing-body` resource for - /// this `outgoing-request` can be retrieved at most once. Subsequent - /// calls will return error. - @since(version = 0.2.0) - body: func() -> result; - /// Get the Method for the Request. - @since(version = 0.2.0) - method: func() -> method; - /// Set the Method for the Request. Fails if the string present in a - /// `method.other` argument is not a syntactically valid method. - @since(version = 0.2.0) - set-method: func(method: method) -> result; - /// Get the combination of the HTTP Path and Query for the Request. - /// When `none`, this represents an empty Path and empty Query. - @since(version = 0.2.0) - path-with-query: func() -> option; - /// Set the combination of the HTTP Path and Query for the Request. - /// When `none`, this represents an empty Path and empty Query. Fails is the - /// string given is not a syntactically valid path and query uri component. - @since(version = 0.2.0) - set-path-with-query: func(path-with-query: option) -> result; - /// Get the HTTP Related Scheme for the Request. When `none`, the - /// implementation may choose an appropriate default scheme. - @since(version = 0.2.0) - scheme: func() -> option; - /// Set the HTTP Related Scheme for the Request. When `none`, the - /// implementation may choose an appropriate default scheme. Fails if the - /// string given is not a syntactically valid uri scheme. - @since(version = 0.2.0) - set-scheme: func(scheme: option) -> result; - /// Get the authority of the Request's target URI. A value of `none` may be used - /// with Related Schemes which do not require an authority. The HTTP and - /// HTTPS schemes always require an authority. - @since(version = 0.2.0) - authority: func() -> option; - /// Set the authority of the Request's target URI. A value of `none` may be used - /// with Related Schemes which do not require an authority. The HTTP and - /// HTTPS schemes always require an authority. Fails if the string given is - /// not a syntactically valid URI authority. - @since(version = 0.2.0) - set-authority: func(authority: option) -> result; - /// Get the headers associated with the Request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transferred to - /// another component by e.g. `outgoing-handler.handle`. - @since(version = 0.2.0) - headers: func() -> headers; + resource future-incoming-response { + subscribe: func() -> pollable; + get: func() -> option>>; } - /// Parameters for making an HTTP Request. Each of these parameters is - /// currently an optional timeout applicable to the transport layer of the - /// HTTP protocol. - /// - /// These timeouts are separate from any the user may use to bound a - /// blocking call to `wasi:io/poll.poll`. - @since(version = 0.2.0) resource request-options { - /// Construct a default `request-options` value. - @since(version = 0.2.0) constructor(); - /// The timeout for the initial connect to the HTTP Server. - @since(version = 0.2.0) connect-timeout: func() -> option; - /// Set the timeout for the initial connect to the HTTP Server. An error - /// return value indicates that this timeout is not supported. - @since(version = 0.2.0) set-connect-timeout: func(duration: option) -> result; - /// The timeout for receiving the first byte of the Response body. - @since(version = 0.2.0) first-byte-timeout: func() -> option; - /// Set the timeout for receiving the first byte of the Response body. An - /// error return value indicates that this timeout is not supported. - @since(version = 0.2.0) set-first-byte-timeout: func(duration: option) -> result; - /// The timeout for receiving subsequent chunks of bytes in the Response - /// body stream. - @since(version = 0.2.0) between-bytes-timeout: func() -> option; - /// Set the timeout for receiving subsequent chunks of bytes in the Response - /// body stream. An error return value indicates that this timeout is not - /// supported. - @since(version = 0.2.0) set-between-bytes-timeout: func(duration: option) -> result; } - /// Represents the ability to send an HTTP Response. - /// - /// This resource is used by the `wasi:http/incoming-handler` interface to - /// allow a Response to be sent corresponding to the Request provided as the - /// other argument to `incoming-handler.handle`. - @since(version = 0.2.0) - resource response-outparam { - /// Set the value of the `response-outparam` to either send a response, - /// or indicate an error. - /// - /// This method consumes the `response-outparam` to ensure that it is - /// called at most once. If it is never called, the implementation - /// will respond with an error. - /// - /// The user may provide an `error` to `response` to allow the - /// implementation determine how to respond with an HTTP error response. - @since(version = 0.2.0) - set: static func(param: response-outparam, response: result); - } - - /// This type corresponds to the HTTP standard Status Code. - @since(version = 0.2.0) - type status-code = u16; - - /// Represents an incoming HTTP Response. - @since(version = 0.2.0) - resource incoming-response { - /// Returns the status code from the incoming response. - @since(version = 0.2.0) - status: func() -> status-code; - /// Returns the headers from the incoming response. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `incoming-response` is dropped. - @since(version = 0.2.0) - headers: func() -> headers; - /// Returns the incoming body. May be called at most once. Returns error - /// if called additional times. - @since(version = 0.2.0) - consume: func() -> result; - } - - /// Represents an incoming HTTP Request or Response's Body. - /// - /// A body has both its contents - a stream of bytes - and a (possibly - /// empty) set of trailers, indicating that the full contents of the - /// body have been received. This resource represents the contents as - /// an `input-stream` and the delivery of trailers as a `future-trailers`, - /// and ensures that the user of this interface may only be consuming either - /// the body contents or waiting on trailers at any given time. - @since(version = 0.2.0) - resource incoming-body { - /// Returns the contents of the body, as a stream of bytes. - /// - /// Returns success on first call: the stream representing the contents - /// can be retrieved at most once. Subsequent calls will return error. - /// - /// The returned `input-stream` resource is a child: it must be dropped - /// before the parent `incoming-body` is dropped, or consumed by - /// `incoming-body.finish`. - /// - /// This invariant ensures that the implementation can determine whether - /// the user is consuming the contents of the body, waiting on the - /// `future-trailers` to be ready, or neither. This allows for network - /// backpressure is to be applied when the user is consuming the body, - /// and for that backpressure to not inhibit delivery of the trailers if - /// the user does not read the entire body. - @since(version = 0.2.0) - %stream: func() -> result; - /// Takes ownership of `incoming-body`, and returns a `future-trailers`. - /// This function will trap if the `input-stream` child is still alive. - @since(version = 0.2.0) - finish: static func(this: incoming-body) -> future-trailers; - } - - /// Represents a future which may eventually return trailers, or an error. - /// - /// In the case that the incoming HTTP Request or Response did not have any - /// trailers, this future will resolve to the empty set of trailers once the - /// complete Request or Response body has been received. - @since(version = 0.2.0) resource future-trailers { - /// Returns a pollable which becomes ready when either the trailers have - /// been received, or an error has occurred. When this pollable is ready, - /// the `get` method will return `some`. - @since(version = 0.2.0) subscribe: func() -> pollable; - /// Returns the contents of the trailers, or an error which occurred, - /// once the future is ready. - /// - /// The outer `option` represents future readiness. Users can wait on this - /// `option` to become `some` using the `subscribe` method. - /// - /// The outer `result` is used to retrieve the trailers or error at most - /// once. It will be success on the first call in which the outer option - /// is `some`, and error on subsequent calls. - /// - /// The inner `result` represents that either the HTTP Request or Response - /// body, as well as any trailers, were received successfully, or that an - /// error occurred receiving them. The optional `trailers` indicates whether - /// or not trailers were present in the body. - /// - /// When some `trailers` are returned by this method, the `trailers` - /// resource is immutable, and a child. Use of the `set`, `append`, or - /// `delete` methods will return an error, and the resource must be - /// dropped before the parent `future-trailers` is dropped. - @since(version = 0.2.0) get: func() -> option, error-code>>>; } - /// Represents an outgoing HTTP Response. - @since(version = 0.2.0) - resource outgoing-response { - /// Construct an `outgoing-response`, with a default `status-code` of `200`. - /// If a different `status-code` is needed, it must be set via the - /// `set-status-code` method. - /// - /// * `headers` is the HTTP Headers for the Response. - @since(version = 0.2.0) - constructor(headers: headers); - /// Get the HTTP Status Code for the Response. - @since(version = 0.2.0) - status-code: func() -> status-code; - /// Set the HTTP Status Code for the Response. Fails if the status-code - /// given is not a valid http status code. - @since(version = 0.2.0) - set-status-code: func(status-code: status-code) -> result; - /// Get the headers associated with the Request. - /// - /// The returned `headers` resource is immutable: `set`, `append`, and - /// `delete` operations will fail with `header-error.immutable`. - /// - /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transferred to - /// another component by e.g. `outgoing-handler.handle`. - @since(version = 0.2.0) - headers: func() -> headers; - /// Returns the resource corresponding to the outgoing Body for this Response. - /// - /// Returns success on the first call: the `outgoing-body` resource for - /// this `outgoing-response` can be retrieved at most once. Subsequent - /// calls will return error. - @since(version = 0.2.0) - body: func() -> result; - } - - /// Represents an outgoing HTTP Request or Response's Body. - /// - /// A body has both its contents - a stream of bytes - and a (possibly - /// empty) set of trailers, inducating the full contents of the body - /// have been sent. This resource represents the contents as an - /// `output-stream` child resource, and the completion of the body (with - /// optional trailers) with a static function that consumes the - /// `outgoing-body` resource, and ensures that the user of this interface - /// may not write to the body contents after the body has been finished. - /// - /// If the user code drops this resource, as opposed to calling the static - /// method `finish`, the implementation should treat the body as incomplete, - /// and that an error has occurred. The implementation should propagate this - /// error to the HTTP protocol by whatever means it has available, - /// including: corrupting the body on the wire, aborting the associated - /// Request, or sending a late status code for the Response. - @since(version = 0.2.0) - resource outgoing-body { - /// Returns a stream for writing the body contents. - /// - /// The returned `output-stream` is a child resource: it must be dropped - /// before the parent `outgoing-body` resource is dropped (or finished), - /// otherwise the `outgoing-body` drop or `finish` will trap. - /// - /// Returns success on the first call: the `output-stream` resource for - /// this `outgoing-body` may be retrieved at most once. Subsequent calls - /// will return error. - @since(version = 0.2.0) - write: func() -> result; - /// Finalize an outgoing body, optionally providing trailers. This must be - /// called to signal that the response is complete. If the `outgoing-body` - /// is dropped without calling `outgoing-body.finalize`, the implementation - /// should treat the body as corrupted. - /// - /// Fails if the body's `outgoing-request` or `outgoing-response` was - /// constructed with a Content-Length header, and the contents written - /// to the body (via `write`) does not match the value given in the - /// Content-Length. - @since(version = 0.2.0) - finish: static func(this: outgoing-body, trailers: option) -> result<_, error-code>; - } - - /// Represents a future which may eventually return an incoming HTTP - /// Response, or an error. - /// - /// This resource is returned by the `wasi:http/outgoing-handler` interface to - /// provide the HTTP Response corresponding to the sent Request. - @since(version = 0.2.0) - resource future-incoming-response { - /// Returns a pollable which becomes ready when either the Response has - /// been received, or an error has occurred. When this pollable is ready, - /// the `get` method will return `some`. - @since(version = 0.2.0) - subscribe: func() -> pollable; - /// Returns the incoming HTTP Response, or an error, once one is ready. - /// - /// The outer `option` represents future readiness. Users can wait on this - /// `option` to become `some` using the `subscribe` method. - /// - /// The outer `result` is used to retrieve the response or error at most - /// once. It will be success on the first call in which the outer option - /// is `some`, and error on subsequent calls. - /// - /// The inner `result` represents that either the incoming HTTP Response - /// status and headers have received successfully, or that an error - /// occurred. Errors may also occur while consuming the response body, - /// but those will be reported by the `incoming-body` and its - /// `output-stream` child. - @since(version = 0.2.0) - get: func() -> option>>; - } - - /// Attempts to extract a http-related `error` from the wasi:io `error` - /// provided. - /// - /// Stream operations which return - /// `wasi:io/stream/stream-error::last-operation-failed` have a payload of - /// type `wasi:io/error/error` with more information about the operation - /// that failed. This payload can be passed through to this function to see - /// if there's http-related information about the error to return. - /// - /// Note that this function is fallible because not all io-errors are - /// http-related errors. - @since(version = 0.2.0) http-error-code: func(err: borrow) -> option; } - - /// This interface defines a handler of incoming HTTP Requests. It should - /// be exported by components which can respond to HTTP Requests. - @since(version = 0.2.0) - interface incoming-handler { - @since(version = 0.2.0) - use types.{incoming-request, response-outparam}; - - /// This function is invoked with an incoming HTTP Request, and a resource - /// `response-outparam` which provides the capability to reply with an HTTP - /// Response. The response is sent by calling the `response-outparam.set` - /// method, which allows execution to continue after the response has been - /// sent. This enables both streaming to the response body, and performing other - /// work. - /// - /// The implementor of this function must write a response to the - /// `response-outparam` before returning, or else the caller will respond - /// with an error on its behalf. - @since(version = 0.2.0) - handle: func(request: incoming-request, response-out: response-outparam); - } - - /// This interface defines a handler of outgoing HTTP Requests. It should be - /// imported by components which wish to make HTTP Requests. - @since(version = 0.2.0) interface outgoing-handler { - @since(version = 0.2.0) use types.{outgoing-request, request-options, future-incoming-response, error-code}; - /// This function is invoked with an outgoing HTTP Request, and it returns - /// a resource `future-incoming-response` which represents an HTTP Response - /// which may arrive in the future. - /// - /// The `options` argument accepts optional parameters for the HTTP - /// protocol's transport layer. - /// - /// This function may return an error if the `outgoing-request` is invalid - /// or not allowed to be made. Otherwise, protocol errors are reported - /// through the `future-incoming-response`. - @since(version = 0.2.0) handle: func(request: outgoing-request, options: option) -> result; } + interface incoming-handler { + use types.{incoming-request, response-outparam}; - /// The `wasi:http/imports` world imports all the APIs for HTTP proxies. - /// It is intended to be `include`d in other worlds. - @since(version = 0.2.0) - world imports { - @since(version = 0.2.0) - import wasi:io/poll@0.2.3; - @since(version = 0.2.0) - import wasi:clocks/monotonic-clock@0.2.3; - @since(version = 0.2.0) - import wasi:clocks/wall-clock@0.2.3; - @since(version = 0.2.0) - import wasi:random/random@0.2.3; - @since(version = 0.2.0) - import wasi:io/error@0.2.3; - @since(version = 0.2.0) - import wasi:io/streams@0.2.3; - @since(version = 0.2.0) - import wasi:cli/stdout@0.2.3; - @since(version = 0.2.0) - import wasi:cli/stderr@0.2.3; - @since(version = 0.2.0) - import wasi:cli/stdin@0.2.3; - @since(version = 0.2.0) - import types; - @since(version = 0.2.0) - import outgoing-handler; - } - /// The `wasi:http/proxy` world captures a widely-implementable intersection of - /// hosts that includes HTTP forward and reverse proxies. Components targeting - /// this world may concurrently stream in and out any number of incoming and - /// outgoing HTTP requests. - @since(version = 0.2.0) - world proxy { - @since(version = 0.2.0) - import wasi:io/poll@0.2.3; - @since(version = 0.2.0) - import wasi:clocks/monotonic-clock@0.2.3; - @since(version = 0.2.0) - import wasi:clocks/wall-clock@0.2.3; - @since(version = 0.2.0) - import wasi:random/random@0.2.3; - @since(version = 0.2.0) - import wasi:io/error@0.2.3; - @since(version = 0.2.0) - import wasi:io/streams@0.2.3; - @since(version = 0.2.0) - import wasi:cli/stdout@0.2.3; - @since(version = 0.2.0) - import wasi:cli/stderr@0.2.3; - @since(version = 0.2.0) - import wasi:cli/stdin@0.2.3; - @since(version = 0.2.0) - import types; - @since(version = 0.2.0) - import outgoing-handler; - - @since(version = 0.2.0) - export incoming-handler; - } -} - -package wasi:io@0.2.3 { - @since(version = 0.2.0) - interface error { - /// A resource which represents some error information. - /// - /// The only method provided by this resource is `to-debug-string`, - /// which provides some human-readable information about the error. - /// - /// In the `wasi:io` package, this resource is returned through the - /// `wasi:io/streams/stream-error` type. - /// - /// To provide more specific error information, other interfaces may - /// offer functions to "downcast" this error into more specific types. For example, - /// errors returned from streams derived from filesystem types can be described using - /// the filesystem's own error-code type. This is done using the function - /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow` - /// parameter and returns an `option`. - /// - /// The set of functions which can "downcast" an `error` into a more - /// concrete type is open. - @since(version = 0.2.0) - resource error { - /// Returns a string that is suitable to assist humans in debugging - /// this error. - /// - /// WARNING: The returned string should not be consumed mechanically! - /// It may change across platforms, hosts, or other implementation - /// details. Parsing this string is a major platform-compatibility - /// hazard. - @since(version = 0.2.0) - to-debug-string: func() -> string; - } - } - - /// A poll API intended to let users wait for I/O events on multiple handles - /// at once. - @since(version = 0.2.0) - interface poll { - /// `pollable` represents a single I/O event which may be ready, or not. - @since(version = 0.2.0) - resource pollable { - /// Return the readiness of a pollable. This function never blocks. - /// - /// Returns `true` when the pollable is ready, and `false` otherwise. - @since(version = 0.2.0) - ready: func() -> bool; - /// `block` returns immediately if the pollable is ready, and otherwise - /// blocks until ready. - /// - /// This function is equivalent to calling `poll.poll` on a list - /// containing only this pollable. - @since(version = 0.2.0) - block: func(); - } - - /// Poll for completion on a set of pollables. - /// - /// This function takes a list of pollables, which identify I/O sources of - /// interest, and waits until one or more of the events is ready for I/O. - /// - /// The result `list` contains one or more indices of handles in the - /// argument list that is ready for I/O. - /// - /// This function traps if either: - /// - the list is empty, or: - /// - the list contains more elements than can be indexed with a `u32` value. - /// - /// A timeout can be implemented by adding a pollable from the - /// wasi-clocks API to the list. - /// - /// This function does not return a `result`; polling in itself does not - /// do any I/O so it doesn't fail. If any of the I/O sources identified by - /// the pollables has an error, it is indicated by marking the source as - /// being ready for I/O. - @since(version = 0.2.0) - poll: func(in: list>) -> list; - } - - /// WASI I/O is an I/O abstraction API which is currently focused on providing - /// stream types. - /// - /// In the future, the component model is expected to add built-in stream types; - /// when it does, they are expected to subsume this API. - @since(version = 0.2.0) - interface streams { - @since(version = 0.2.0) - use error.{error}; - @since(version = 0.2.0) - use poll.{pollable}; - - /// An error for input-stream and output-stream operations. - @since(version = 0.2.0) - variant stream-error { - /// The last operation (a write or flush) failed before completion. - /// - /// More information is available in the `error` payload. - /// - /// After this, the stream will be closed. All future operations return - /// `stream-error::closed`. - last-operation-failed(error), - /// The stream is closed: no more input will be accepted by the - /// stream. A closed output-stream will return this error on all - /// future operations. - closed, - } - - /// An input bytestream. - /// - /// `input-stream`s are *non-blocking* to the extent practical on underlying - /// platforms. I/O operations always return promptly; if fewer bytes are - /// promptly available than requested, they return the number of bytes promptly - /// available, which could even be zero. To wait for data to be available, - /// use the `subscribe` function to obtain a `pollable` which can be polled - /// for using `wasi:io/poll`. - @since(version = 0.2.0) - resource input-stream { - /// Perform a non-blocking read from the stream. - /// - /// When the source of a `read` is binary data, the bytes from the source - /// are returned verbatim. When the source of a `read` is known to the - /// implementation to be text, bytes containing the UTF-8 encoding of the - /// text are returned. - /// - /// This function returns a list of bytes containing the read data, - /// when successful. The returned list will contain up to `len` bytes; - /// it may return fewer than requested, but not more. The list is - /// empty when no bytes are available for reading at this time. The - /// pollable given by `subscribe` will be ready when more bytes are - /// available. - /// - /// This function fails with a `stream-error` when the operation - /// encounters an error, giving `last-operation-failed`, or when the - /// stream is closed, giving `closed`. - /// - /// When the caller gives a `len` of 0, it represents a request to - /// read 0 bytes. If the stream is still open, this call should - /// succeed and return an empty list, or otherwise fail with `closed`. - /// - /// The `len` parameter is a `u64`, which could represent a list of u8 which - /// is not possible to allocate in wasm32, or not desirable to allocate as - /// as a return value by the callee. The callee may return a list of bytes - /// less than `len` in size while more bytes are available for reading. - @since(version = 0.2.0) - read: func(len: u64) -> result, stream-error>; - /// Read bytes from a stream, after blocking until at least one byte can - /// be read. Except for blocking, behavior is identical to `read`. - @since(version = 0.2.0) - blocking-read: func(len: u64) -> result, stream-error>; - /// Skip bytes from a stream. Returns number of bytes skipped. - /// - /// Behaves identical to `read`, except instead of returning a list - /// of bytes, returns the number of bytes consumed from the stream. - @since(version = 0.2.0) - skip: func(len: u64) -> result; - /// Skip bytes from a stream, after blocking until at least one byte - /// can be skipped. Except for blocking behavior, identical to `skip`. - @since(version = 0.2.0) - blocking-skip: func(len: u64) -> result; - /// Create a `pollable` which will resolve once either the specified stream - /// has bytes available to read or the other end of the stream has been - /// closed. - /// The created `pollable` is a child resource of the `input-stream`. - /// Implementations may trap if the `input-stream` is dropped before - /// all derived `pollable`s created with this function are dropped. - @since(version = 0.2.0) - subscribe: func() -> pollable; - } - - /// An output bytestream. - /// - /// `output-stream`s are *non-blocking* to the extent practical on - /// underlying platforms. Except where specified otherwise, I/O operations also - /// always return promptly, after the number of bytes that can be written - /// promptly, which could even be zero. To wait for the stream to be ready to - /// accept data, the `subscribe` function to obtain a `pollable` which can be - /// polled for using `wasi:io/poll`. - /// - /// Dropping an `output-stream` while there's still an active write in - /// progress may result in the data being lost. Before dropping the stream, - /// be sure to fully flush your writes. - @since(version = 0.2.0) - resource output-stream { - /// Check readiness for writing. This function never blocks. - /// - /// Returns the number of bytes permitted for the next call to `write`, - /// or an error. Calling `write` with more bytes than this function has - /// permitted will trap. - /// - /// When this function returns 0 bytes, the `subscribe` pollable will - /// become ready when this function will report at least 1 byte, or an - /// error. - @since(version = 0.2.0) - check-write: func() -> result; - /// Perform a write. This function never blocks. - /// - /// When the destination of a `write` is binary data, the bytes from - /// `contents` are written verbatim. When the destination of a `write` is - /// known to the implementation to be text, the bytes of `contents` are - /// transcoded from UTF-8 into the encoding of the destination and then - /// written. - /// - /// Precondition: check-write gave permit of Ok(n) and contents has a - /// length of less than or equal to n. Otherwise, this function will trap. - /// - /// returns Err(closed) without writing if the stream has closed since - /// the last call to check-write provided a permit. - @since(version = 0.2.0) - write: func(contents: list) -> result<_, stream-error>; - /// Perform a write of up to 4096 bytes, and then flush the stream. Block - /// until all of these operations are complete, or an error occurs. - /// - /// This is a convenience wrapper around the use of `check-write`, - /// `subscribe`, `write`, and `flush`, and is implemented with the - /// following pseudo-code: - /// - /// ```text - /// let pollable = this.subscribe(); - /// while !contents.is_empty() { - /// // Wait for the stream to become writable - /// pollable.block(); - /// let Ok(n) = this.check-write(); // eliding error handling - /// let len = min(n, contents.len()); - /// let (chunk, rest) = contents.split_at(len); - /// this.write(chunk ); // eliding error handling - /// contents = rest; - /// } - /// this.flush(); - /// // Wait for completion of `flush` - /// pollable.block(); - /// // Check for any errors that arose during `flush` - /// let _ = this.check-write(); // eliding error handling - /// ``` - @since(version = 0.2.0) - blocking-write-and-flush: func(contents: list) -> result<_, stream-error>; - /// Request to flush buffered output. This function never blocks. - /// - /// This tells the output-stream that the caller intends any buffered - /// output to be flushed. the output which is expected to be flushed - /// is all that has been passed to `write` prior to this call. - /// - /// Upon calling this function, the `output-stream` will not accept any - /// writes (`check-write` will return `ok(0)`) until the flush has - /// completed. The `subscribe` pollable will become ready when the - /// flush has completed and the stream can accept more writes. - @since(version = 0.2.0) - flush: func() -> result<_, stream-error>; - /// Request to flush buffered output, and block until flush completes - /// and stream is ready for writing again. - @since(version = 0.2.0) - blocking-flush: func() -> result<_, stream-error>; - /// Create a `pollable` which will resolve once the output-stream - /// is ready for more writing, or an error has occurred. When this - /// pollable is ready, `check-write` will return `ok(n)` with n>0, or an - /// error. - /// - /// If the stream is closed, this pollable is always ready immediately. - /// - /// The created `pollable` is a child resource of the `output-stream`. - /// Implementations may trap if the `output-stream` is dropped before - /// all derived `pollable`s created with this function are dropped. - @since(version = 0.2.0) - subscribe: func() -> pollable; - /// Write zeroes to a stream. - /// - /// This should be used precisely like `write` with the exact same - /// preconditions (must use check-write first), but instead of - /// passing a list of bytes, you simply pass the number of zero-bytes - /// that should be written. - @since(version = 0.2.0) - write-zeroes: func(len: u64) -> result<_, stream-error>; - /// Perform a write of up to 4096 zeroes, and then flush the stream. - /// Block until all of these operations are complete, or an error - /// occurs. - /// - /// This is a convenience wrapper around the use of `check-write`, - /// `subscribe`, `write-zeroes`, and `flush`, and is implemented with - /// the following pseudo-code: - /// - /// ```text - /// let pollable = this.subscribe(); - /// while num_zeroes != 0 { - /// // Wait for the stream to become writable - /// pollable.block(); - /// let Ok(n) = this.check-write(); // eliding error handling - /// let len = min(n, num_zeroes); - /// this.write-zeroes(len); // eliding error handling - /// num_zeroes -= len; - /// } - /// this.flush(); - /// // Wait for completion of `flush` - /// pollable.block(); - /// // Check for any errors that arose during `flush` - /// let _ = this.check-write(); // eliding error handling - /// ``` - @since(version = 0.2.0) - blocking-write-zeroes-and-flush: func(len: u64) -> result<_, stream-error>; - /// Read from one stream and write to another. - /// - /// The behavior of splice is equivalent to: - /// 1. calling `check-write` on the `output-stream` - /// 2. calling `read` on the `input-stream` with the smaller of the - /// `check-write` permitted length and the `len` provided to `splice` - /// 3. calling `write` on the `output-stream` with that read data. - /// - /// Any error reported by the call to `check-write`, `read`, or - /// `write` ends the splice and reports that error. - /// - /// This function returns the number of bytes transferred; it may be less - /// than `len`. - @since(version = 0.2.0) - splice: func(src: borrow, len: u64) -> result; - /// Read from one stream and write to another, with blocking. - /// - /// This is similar to `splice`, except that it blocks until the - /// `output-stream` is ready for writing, and the `input-stream` - /// is ready for reading, before performing the `splice`. - @since(version = 0.2.0) - blocking-splice: func(src: borrow, len: u64) -> result; - } - } - - @since(version = 0.2.0) - world imports { - @since(version = 0.2.0) - import error; - @since(version = 0.2.0) - import poll; - @since(version = 0.2.0) - import streams; - } -} - -package wasi:random@0.2.3 { - /// The insecure-seed interface for seeding hash-map DoS resistance. - /// - /// It is intended to be portable at least between Unix-family platforms and - /// Windows. - @since(version = 0.2.0) - interface insecure-seed { - /// Return a 128-bit value that may contain a pseudo-random value. - /// - /// The returned value is not required to be computed from a CSPRNG, and may - /// even be entirely deterministic. Host implementations are encouraged to - /// provide pseudo-random values to any program exposed to - /// attacker-controlled content, to enable DoS protection built into many - /// languages' hash-map implementations. - /// - /// This function is intended to only be called once, by a source language - /// to initialize Denial Of Service (DoS) protection in its hash-map - /// implementation. - /// - /// # Expected future evolution - /// - /// This will likely be changed to a value import, to prevent it from being - /// called multiple times and potentially used for purposes other than DoS - /// protection. - @since(version = 0.2.0) - insecure-seed: func() -> tuple; - } - - /// The insecure interface for insecure pseudo-random numbers. - /// - /// It is intended to be portable at least between Unix-family platforms and - /// Windows. - @since(version = 0.2.0) - interface insecure { - /// Return `len` insecure pseudo-random bytes. - /// - /// This function is not cryptographically secure. Do not use it for - /// anything related to security. - /// - /// There are no requirements on the values of the returned bytes, however - /// implementations are encouraged to return evenly distributed values with - /// a long period. - @since(version = 0.2.0) - get-insecure-random-bytes: func(len: u64) -> list; - - /// Return an insecure pseudo-random `u64` value. - /// - /// This function returns the same type of pseudo-random data as - /// `get-insecure-random-bytes`, represented as a `u64`. - @since(version = 0.2.0) - get-insecure-random-u64: func() -> u64; - } - - /// WASI Random is a random data API. - /// - /// It is intended to be portable at least between Unix-family platforms and - /// Windows. - @since(version = 0.2.0) - interface random { - /// Return `len` cryptographically-secure random or pseudo-random bytes. - /// - /// This function must produce data at least as cryptographically secure and - /// fast as an adequately seeded cryptographically-secure pseudo-random - /// number generator (CSPRNG). It must not block, from the perspective of - /// the calling program, under any circumstances, including on the first - /// request and on requests for numbers of bytes. The returned data must - /// always be unpredictable. - /// - /// This function must always return fresh data. Deterministic environments - /// must omit this function, rather than implementing it with deterministic - /// data. - @since(version = 0.2.0) - get-random-bytes: func(len: u64) -> list; - - /// Return a cryptographically-secure random or pseudo-random `u64` value. - /// - /// This function returns the same type of data as `get-random-bytes`, - /// represented as a `u64`. - @since(version = 0.2.0) - get-random-u64: func() -> u64; - } - - @since(version = 0.2.0) - world imports { - @since(version = 0.2.0) - import random; - @since(version = 0.2.0) - import insecure; - @since(version = 0.2.0) - import insecure-seed; - } -} - -package wasi:sockets@0.2.3 { - @since(version = 0.2.0) - interface network { - /// An opaque resource that represents access to (a subset of) the network. - /// This enables context-based security for networking. - /// There is no need for this to map 1:1 to a physical network interface. - @since(version = 0.2.0) - resource network; - - /// Error codes. - /// - /// In theory, every API can return any error code. - /// In practice, API's typically only return the errors documented per API - /// combined with a couple of errors that are always possible: - /// - `unknown` - /// - `access-denied` - /// - `not-supported` - /// - `out-of-memory` - /// - `concurrency-conflict` - /// - /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. - @since(version = 0.2.0) - enum error-code { - /// Unknown error - unknown, - /// Access denied. - /// - /// POSIX equivalent: EACCES, EPERM - access-denied, - /// The operation is not supported. - /// - /// POSIX equivalent: EOPNOTSUPP - not-supported, - /// One of the arguments is invalid. - /// - /// POSIX equivalent: EINVAL - invalid-argument, - /// Not enough memory to complete the operation. - /// - /// POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY - out-of-memory, - /// The operation timed out before it could finish completely. - timeout, - /// This operation is incompatible with another asynchronous operation that is already in progress. - /// - /// POSIX equivalent: EALREADY - concurrency-conflict, - /// Trying to finish an asynchronous operation that: - /// - has not been started yet, or: - /// - was already finished by a previous `finish-*` call. - /// - /// Note: this is scheduled to be removed when `future`s are natively supported. - not-in-progress, - /// The operation has been aborted because it could not be completed immediately. - /// - /// Note: this is scheduled to be removed when `future`s are natively supported. - would-block, - /// The operation is not valid in the socket's current state. - invalid-state, - /// A new socket resource could not be created because of a system limit. - new-socket-limit, - /// A bind operation failed because the provided address is not an address that the `network` can bind to. - address-not-bindable, - /// A bind operation failed because the provided address is already in use or because there are no ephemeral ports available. - address-in-use, - /// The remote address is not reachable - remote-unreachable, - /// The TCP connection was forcefully rejected - connection-refused, - /// The TCP connection was reset. - connection-reset, - /// A TCP connection was aborted. - connection-aborted, - /// The size of a datagram sent to a UDP socket exceeded the maximum - /// supported size. - datagram-too-large, - /// Name does not exist or has no suitable associated IP addresses. - name-unresolvable, - /// A temporary failure in name resolution occurred. - temporary-resolver-failure, - /// A permanent failure in name resolution occurred. - permanent-resolver-failure, - } - - @since(version = 0.2.0) - enum ip-address-family { - /// Similar to `AF_INET` in POSIX. - ipv4, - /// Similar to `AF_INET6` in POSIX. - ipv6, - } - - @since(version = 0.2.0) - type ipv4-address = tuple; - - @since(version = 0.2.0) - type ipv6-address = tuple; - - @since(version = 0.2.0) - variant ip-address { - ipv4(ipv4-address), - ipv6(ipv6-address), - } - - @since(version = 0.2.0) - record ipv4-socket-address { - /// sin_port - port: u16, - /// sin_addr - address: ipv4-address, - } - - @since(version = 0.2.0) - record ipv6-socket-address { - /// sin6_port - port: u16, - /// sin6_flowinfo - flow-info: u32, - /// sin6_addr - address: ipv6-address, - /// sin6_scope_id - scope-id: u32, - } - - @since(version = 0.2.0) - variant ip-socket-address { - ipv4(ipv4-socket-address), - ipv6(ipv6-socket-address), - } - } - - /// This interface provides a value-export of the default network handle.. - @since(version = 0.2.0) - interface instance-network { - @since(version = 0.2.0) - use network.{network}; - - /// Get a handle to the default network. - @since(version = 0.2.0) - instance-network: func() -> network; - } - - @since(version = 0.2.0) - interface ip-name-lookup { - @since(version = 0.2.0) - use wasi:io/poll@0.2.3.{pollable}; - @since(version = 0.2.0) - use network.{network, error-code, ip-address}; - - @since(version = 0.2.0) - resource resolve-address-stream { - /// Returns the next address from the resolver. - /// - /// This function should be called multiple times. On each call, it will - /// return the next address in connection order preference. If all - /// addresses have been exhausted, this function returns `none`. - /// - /// This function never returns IPv4-mapped IPv6 addresses. - /// - /// # Typical errors - /// - `name-unresolvable`: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY) - /// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN) - /// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL) - /// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN) - @since(version = 0.2.0) - resolve-next-address: func() -> result, error-code>; - /// Create a `pollable` which will resolve once the stream is ready for I/O. - /// - /// Note: this function is here for WASI 0.2 only. - /// It's planned to be removed when `future` is natively supported in Preview3. - @since(version = 0.2.0) - subscribe: func() -> pollable; - } - - /// Resolve an internet host name to a list of IP addresses. - /// - /// Unicode domain names are automatically converted to ASCII using IDNA encoding. - /// If the input is an IP address string, the address is parsed and returned - /// as-is without making any external requests. - /// - /// See the wasi-socket proposal README.md for a comparison with getaddrinfo. - /// - /// This function never blocks. It either immediately fails or immediately - /// returns successfully with a `resolve-address-stream` that can be used - /// to (asynchronously) fetch the results. - /// - /// # Typical errors - /// - `invalid-argument`: `name` is a syntactically invalid domain name or IP address. - /// - /// # References: - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - resolve-addresses: func(network: borrow, name: string) -> result; - } - - @since(version = 0.2.0) - interface tcp { - @since(version = 0.2.0) - use wasi:io/streams@0.2.3.{input-stream, output-stream}; - @since(version = 0.2.0) - use wasi:io/poll@0.2.3.{pollable}; - @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.3.{duration}; - @since(version = 0.2.0) - use network.{network, error-code, ip-socket-address, ip-address-family}; - - @since(version = 0.2.0) - enum shutdown-type { - /// Similar to `SHUT_RD` in POSIX. - receive, - /// Similar to `SHUT_WR` in POSIX. - send, - /// Similar to `SHUT_RDWR` in POSIX. - both, - } - - /// A TCP socket resource. - /// - /// The socket can be in one of the following states: - /// - `unbound` - /// - `bind-in-progress` - /// - `bound` (See note below) - /// - `listen-in-progress` - /// - `listening` - /// - `connect-in-progress` - /// - `connected` - /// - `closed` - /// See - /// for more information. - /// - /// Note: Except where explicitly mentioned, whenever this documentation uses - /// the term "bound" without backticks it actually means: in the `bound` state *or higher*. - /// (i.e. `bound`, `listen-in-progress`, `listening`, `connect-in-progress` or `connected`) - /// - /// In addition to the general error codes documented on the - /// `network::error-code` type, TCP socket methods may always return - /// `error(invalid-state)` when in the `closed` state. - @since(version = 0.2.0) - resource tcp-socket { - /// Bind the socket to a specific network on the provided IP address and port. - /// - /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which - /// network interface(s) to bind to. - /// If the TCP/UDP port is zero, the socket will be bound to a random free port. - /// - /// Bind can be attempted multiple times on the same socket, even with - /// different arguments on each iteration. But never concurrently and - /// only as long as the previous bind failed. Once a bind succeeds, the - /// binding can't be changed anymore. - /// - /// # Typical errors - /// - `invalid-argument`: The `local-address` has the wrong address family. (EAFNOSUPPORT, EFAULT on Windows) - /// - `invalid-argument`: `local-address` is not a unicast address. (EINVAL) - /// - `invalid-argument`: `local-address` is an IPv4-mapped IPv6 address. (EINVAL) - /// - `invalid-state`: The socket is already bound. (EINVAL) - /// - `address-in-use`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows) - /// - `address-in-use`: Address is already in use. (EADDRINUSE) - /// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL) - /// - `not-in-progress`: A `bind` operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # Implementors note - /// When binding to a non-zero port, this bind operation shouldn't be affected by the TIME_WAIT - /// state of a recently closed socket on the same local address. In practice this means that the SO_REUSEADDR - /// socket option should be set implicitly on all platforms, except on Windows where this is the default behavior - /// and SO_REUSEADDR performs something different entirely. - /// - /// Unlike in POSIX, in WASI the bind operation is async. This enables - /// interactive WASI hosts to inject permission prompts. Runtimes that - /// don't want to make use of this ability can simply call the native - /// `bind` as part of either `start-bind` or `finish-bind`. - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - @since(version = 0.2.0) - finish-bind: func() -> result<_, error-code>; - /// Connect to a remote endpoint. - /// - /// On success: - /// - the socket is transitioned into the `connected` state. - /// - a pair of streams is returned that can be used to read & write to the connection - /// - /// After a failed connection attempt, the socket will be in the `closed` - /// state and the only valid action left is to `drop` the socket. A single - /// socket can not be used to connect more than once. - /// - /// # Typical errors - /// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) - /// - `invalid-argument`: `remote-address` is not a unicast address. (EINVAL, ENETUNREACH on Linux, EAFNOSUPPORT on MacOS) - /// - `invalid-argument`: `remote-address` is an IPv4-mapped IPv6 address. (EINVAL, EADDRNOTAVAIL on Illumos) - /// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EADDRNOTAVAIL on Windows) - /// - `invalid-argument`: The port in `remote-address` is set to 0. (EADDRNOTAVAIL on Windows) - /// - `invalid-argument`: The socket is already attached to a different network. The `network` passed to `connect` must be identical to the one passed to `bind`. - /// - `invalid-state`: The socket is already in the `connected` state. (EISCONN) - /// - `invalid-state`: The socket is already in the `listening` state. (EOPNOTSUPP, EINVAL on Windows) - /// - `timeout`: Connection timed out. (ETIMEDOUT) - /// - `connection-refused`: The connection was forcefully rejected. (ECONNREFUSED) - /// - `connection-reset`: The connection was reset. (ECONNRESET) - /// - `connection-aborted`: The connection was aborted. (ECONNABORTED) - /// - `remote-unreachable`: The remote address is not reachable. (EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET) - /// - `address-in-use`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD) - /// - `not-in-progress`: A connect operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # Implementors note - /// The POSIX equivalent of `start-connect` is the regular `connect` syscall. - /// Because all WASI sockets are non-blocking this is expected to return - /// EINPROGRESS, which should be translated to `ok()` in WASI. - /// - /// The POSIX equivalent of `finish-connect` is a `poll` for event `POLLOUT` - /// with a timeout of 0 on the socket descriptor. Followed by a check for - /// the `SO_ERROR` socket option, in case the poll signaled readiness. - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; - @since(version = 0.2.0) - finish-connect: func() -> result, error-code>; - /// Start listening for new connections. - /// - /// Transitions the socket into the `listening` state. - /// - /// Unlike POSIX, the socket must already be explicitly bound. - /// - /// # Typical errors - /// - `invalid-state`: The socket is not bound to any local address. (EDESTADDRREQ) - /// - `invalid-state`: The socket is already in the `connected` state. (EISCONN, EINVAL on BSD) - /// - `invalid-state`: The socket is already in the `listening` state. - /// - `address-in-use`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE) - /// - `not-in-progress`: A listen operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # Implementors note - /// Unlike in POSIX, in WASI the listen operation is async. This enables - /// interactive WASI hosts to inject permission prompts. Runtimes that - /// don't want to make use of this ability can simply call the native - /// `listen` as part of either `start-listen` or `finish-listen`. - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - start-listen: func() -> result<_, error-code>; - @since(version = 0.2.0) - finish-listen: func() -> result<_, error-code>; - /// Accept a new client socket. - /// - /// The returned socket is bound and in the `connected` state. The following properties are inherited from the listener socket: - /// - `address-family` - /// - `keep-alive-enabled` - /// - `keep-alive-idle-time` - /// - `keep-alive-interval` - /// - `keep-alive-count` - /// - `hop-limit` - /// - `receive-buffer-size` - /// - `send-buffer-size` - /// - /// On success, this function returns the newly accepted client socket along with - /// a pair of streams that can be used to read & write to the connection. - /// - /// # Typical errors - /// - `invalid-state`: Socket is not in the `listening` state. (EINVAL) - /// - `would-block`: No pending connections at the moment. (EWOULDBLOCK, EAGAIN) - /// - `connection-aborted`: An incoming connection was pending, but was terminated by the client before this listener could accept it. (ECONNABORTED) - /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - accept: func() -> result, error-code>; - /// Get the bound local address. - /// - /// POSIX mentions: - /// > If the socket has not been bound to a local name, the value - /// > stored in the object pointed to by `address` is unspecified. - /// - /// WASI is stricter and requires `local-address` to return `invalid-state` when the socket hasn't been bound yet. - /// - /// # Typical errors - /// - `invalid-state`: The socket is not bound to any local address. - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - local-address: func() -> result; - /// Get the remote address. - /// - /// # Typical errors - /// - `invalid-state`: The socket is not connected to a remote address. (ENOTCONN) - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - remote-address: func() -> result; - /// Whether the socket is in the `listening` state. - /// - /// Equivalent to the SO_ACCEPTCONN socket option. - @since(version = 0.2.0) - is-listening: func() -> bool; - /// Whether this is a IPv4 or IPv6 socket. - /// - /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.2.0) - address-family: func() -> ip-address-family; - /// Hints the desired listen queue size. Implementations are free to ignore this. - /// - /// If the provided value is 0, an `invalid-argument` error is returned. - /// Any other value will never cause an error, but it might be silently clamped and/or rounded. - /// - /// # Typical errors - /// - `not-supported`: (set) The platform does not support changing the backlog size after the initial listen. - /// - `invalid-argument`: (set) The provided value was 0. - /// - `invalid-state`: (set) The socket is in the `connect-in-progress` or `connected` state. - @since(version = 0.2.0) - set-listen-backlog-size: func(value: u64) -> result<_, error-code>; - /// Enables or disables keepalive. - /// - /// The keepalive behavior can be adjusted using: - /// - `keep-alive-idle-time` - /// - `keep-alive-interval` - /// - `keep-alive-count` - /// These properties can be configured while `keep-alive-enabled` is false, but only come into effect when `keep-alive-enabled` is true. - /// - /// Equivalent to the SO_KEEPALIVE socket option. - @since(version = 0.2.0) - keep-alive-enabled: func() -> result; - @since(version = 0.2.0) - set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; - /// Amount of time the connection has to be idle before TCP starts sending keepalive packets. - /// - /// If the provided value is 0, an `invalid-argument` error is returned. - /// Any other value will never cause an error, but it might be silently clamped and/or rounded. - /// I.e. after setting a value, reading the same setting back may return a different value. - /// - /// Equivalent to the TCP_KEEPIDLE socket option. (TCP_KEEPALIVE on MacOS) - /// - /// # Typical errors - /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.2.0) - keep-alive-idle-time: func() -> result; - @since(version = 0.2.0) - set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; - /// The time between keepalive packets. - /// - /// If the provided value is 0, an `invalid-argument` error is returned. - /// Any other value will never cause an error, but it might be silently clamped and/or rounded. - /// I.e. after setting a value, reading the same setting back may return a different value. - /// - /// Equivalent to the TCP_KEEPINTVL socket option. - /// - /// # Typical errors - /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.2.0) - keep-alive-interval: func() -> result; - @since(version = 0.2.0) - set-keep-alive-interval: func(value: duration) -> result<_, error-code>; - /// The maximum amount of keepalive packets TCP should send before aborting the connection. - /// - /// If the provided value is 0, an `invalid-argument` error is returned. - /// Any other value will never cause an error, but it might be silently clamped and/or rounded. - /// I.e. after setting a value, reading the same setting back may return a different value. - /// - /// Equivalent to the TCP_KEEPCNT socket option. - /// - /// # Typical errors - /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.2.0) - keep-alive-count: func() -> result; - @since(version = 0.2.0) - set-keep-alive-count: func(value: u32) -> result<_, error-code>; - /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. - /// - /// If the provided value is 0, an `invalid-argument` error is returned. - /// - /// # Typical errors - /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.2.0) - hop-limit: func() -> result; - @since(version = 0.2.0) - set-hop-limit: func(value: u8) -> result<_, error-code>; - /// The kernel buffer space reserved for sends/receives on this socket. - /// - /// If the provided value is 0, an `invalid-argument` error is returned. - /// Any other value will never cause an error, but it might be silently clamped and/or rounded. - /// I.e. after setting a value, reading the same setting back may return a different value. - /// - /// Equivalent to the SO_RCVBUF and SO_SNDBUF socket options. - /// - /// # Typical errors - /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.2.0) - receive-buffer-size: func() -> result; - @since(version = 0.2.0) - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.2.0) - send-buffer-size: func() -> result; - @since(version = 0.2.0) - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - /// Create a `pollable` which can be used to poll for, or block on, - /// completion of any of the asynchronous operations of this socket. - /// - /// When `finish-bind`, `finish-listen`, `finish-connect` or `accept` - /// return `error(would-block)`, this pollable can be used to wait for - /// their success or failure, after which the method can be retried. - /// - /// The pollable is not limited to the async operation that happens to be - /// in progress at the time of calling `subscribe` (if any). Theoretically, - /// `subscribe` only has to be called once per socket and can then be - /// (re)used for the remainder of the socket's lifetime. - /// - /// See - /// for more information. - /// - /// Note: this function is here for WASI 0.2 only. - /// It's planned to be removed when `future` is natively supported in Preview3. - @since(version = 0.2.0) - subscribe: func() -> pollable; - /// Initiate a graceful shutdown. - /// - /// - `receive`: The socket is not expecting to receive any data from - /// the peer. The `input-stream` associated with this socket will be - /// closed. Any data still in the receive queue at time of calling - /// this method will be discarded. - /// - `send`: The socket has no more data to send to the peer. The `output-stream` - /// associated with this socket will be closed and a FIN packet will be sent. - /// - `both`: Same effect as `receive` & `send` combined. - /// - /// This function is idempotent; shutting down a direction more than once - /// has no effect and returns `ok`. - /// - /// The shutdown function does not close (drop) the socket. - /// - /// # Typical errors - /// - `invalid-state`: The socket is not in the `connected` state. (ENOTCONN) - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>; - } - } - - @since(version = 0.2.0) - interface tcp-create-socket { - @since(version = 0.2.0) - use network.{network, error-code, ip-address-family}; - @since(version = 0.2.0) - use tcp.{tcp-socket}; - - /// Create a new TCP socket. - /// - /// Similar to `socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)` in POSIX. - /// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise. - /// - /// This function does not require a network capability handle. This is considered to be safe because - /// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`connect` - /// is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world. - /// - /// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations. - /// - /// # Typical errors - /// - `not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT) - /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - create-tcp-socket: func(address-family: ip-address-family) -> result; - } - - @since(version = 0.2.0) - interface udp { - @since(version = 0.2.0) - use wasi:io/poll@0.2.3.{pollable}; - @since(version = 0.2.0) - use network.{network, error-code, ip-socket-address, ip-address-family}; - - /// A received datagram. - @since(version = 0.2.0) - record incoming-datagram { - /// The payload. - /// - /// Theoretical max size: ~64 KiB. In practice, typically less than 1500 bytes. - data: list, - /// The source address. - /// - /// This field is guaranteed to match the remote address the stream was initialized with, if any. - /// - /// Equivalent to the `src_addr` out parameter of `recvfrom`. - remote-address: ip-socket-address, - } - - /// A datagram to be sent out. - @since(version = 0.2.0) - record outgoing-datagram { - /// The payload. - data: list, - /// The destination address. - /// - /// The requirements on this field depend on how the stream was initialized: - /// - with a remote address: this field must be None or match the stream's remote address exactly. - /// - without a remote address: this field is required. - /// - /// If this value is None, the send operation is equivalent to `send` in POSIX. Otherwise it is equivalent to `sendto`. - remote-address: option, - } - - /// A UDP socket handle. - @since(version = 0.2.0) - resource udp-socket { - /// Bind the socket to a specific network on the provided IP address and port. - /// - /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which - /// network interface(s) to bind to. - /// If the port is zero, the socket will be bound to a random free port. - /// - /// # Typical errors - /// - `invalid-argument`: The `local-address` has the wrong address family. (EAFNOSUPPORT, EFAULT on Windows) - /// - `invalid-state`: The socket is already bound. (EINVAL) - /// - `address-in-use`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows) - /// - `address-in-use`: Address is already in use. (EADDRINUSE) - /// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL) - /// - `not-in-progress`: A `bind` operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # Implementors note - /// Unlike in POSIX, in WASI the bind operation is async. This enables - /// interactive WASI hosts to inject permission prompts. Runtimes that - /// don't want to make use of this ability can simply call the native - /// `bind` as part of either `start-bind` or `finish-bind`. - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; - @since(version = 0.2.0) - finish-bind: func() -> result<_, error-code>; - /// Set up inbound & outbound communication channels, optionally to a specific peer. - /// - /// This function only changes the local socket configuration and does not generate any network traffic. - /// On success, the `remote-address` of the socket is updated. The `local-address` may be updated as well, - /// based on the best network path to `remote-address`. - /// - /// When a `remote-address` is provided, the returned streams are limited to communicating with that specific peer: - /// - `send` can only be used to send to this destination. - /// - `receive` will only return datagrams sent from the provided `remote-address`. - /// - /// This method may be called multiple times on the same socket to change its association, but - /// only the most recently returned pair of streams will be operational. Implementations may trap if - /// the streams returned by a previous invocation haven't been dropped yet before calling `stream` again. - /// - /// The POSIX equivalent in pseudo-code is: - /// ```text - /// if (was previously connected) { - /// connect(s, AF_UNSPEC) - /// } - /// if (remote_address is Some) { - /// connect(s, remote_address) - /// } - /// ``` - /// - /// Unlike in POSIX, the socket must already be explicitly bound. - /// - /// # Typical errors - /// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) - /// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL) - /// - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL) - /// - `invalid-state`: The socket is not bound. - /// - `address-in-use`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD) - /// - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET) - /// - `connection-refused`: The connection was refused. (ECONNREFUSED) - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - %stream: func(remote-address: option) -> result, error-code>; - /// Get the current bound address. - /// - /// POSIX mentions: - /// > If the socket has not been bound to a local name, the value - /// > stored in the object pointed to by `address` is unspecified. - /// - /// WASI is stricter and requires `local-address` to return `invalid-state` when the socket hasn't been bound yet. - /// - /// # Typical errors - /// - `invalid-state`: The socket is not bound to any local address. - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - local-address: func() -> result; - /// Get the address the socket is currently streaming to. - /// - /// # Typical errors - /// - `invalid-state`: The socket is not streaming to a specific remote address. (ENOTCONN) - /// - /// # References - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - remote-address: func() -> result; - /// Whether this is a IPv4 or IPv6 socket. - /// - /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.2.0) - address-family: func() -> ip-address-family; - /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. - /// - /// If the provided value is 0, an `invalid-argument` error is returned. - /// - /// # Typical errors - /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.2.0) - unicast-hop-limit: func() -> result; - @since(version = 0.2.0) - set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; - /// The kernel buffer space reserved for sends/receives on this socket. - /// - /// If the provided value is 0, an `invalid-argument` error is returned. - /// Any other value will never cause an error, but it might be silently clamped and/or rounded. - /// I.e. after setting a value, reading the same setting back may return a different value. - /// - /// Equivalent to the SO_RCVBUF and SO_SNDBUF socket options. - /// - /// # Typical errors - /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.2.0) - receive-buffer-size: func() -> result; - @since(version = 0.2.0) - set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.2.0) - send-buffer-size: func() -> result; - @since(version = 0.2.0) - set-send-buffer-size: func(value: u64) -> result<_, error-code>; - /// Create a `pollable` which will resolve once the socket is ready for I/O. - /// - /// Note: this function is here for WASI 0.2 only. - /// It's planned to be removed when `future` is natively supported in Preview3. - @since(version = 0.2.0) - subscribe: func() -> pollable; - } - - @since(version = 0.2.0) - resource incoming-datagram-stream { - /// Receive messages on the socket. - /// - /// This function attempts to receive up to `max-results` datagrams on the socket without blocking. - /// The returned list may contain fewer elements than requested, but never more. - /// - /// This function returns successfully with an empty list when either: - /// - `max-results` is 0, or: - /// - `max-results` is greater than 0, but no results are immediately available. - /// This function never returns `error(would-block)`. - /// - /// # Typical errors - /// - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET) - /// - `connection-refused`: The connection was refused. (ECONNREFUSED) - /// - /// # References - /// - - /// - - /// - - /// - - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - receive: func(max-results: u64) -> result, error-code>; - /// Create a `pollable` which will resolve once the stream is ready to receive again. - /// - /// Note: this function is here for WASI 0.2 only. - /// It's planned to be removed when `future` is natively supported in Preview3. - @since(version = 0.2.0) - subscribe: func() -> pollable; - } - - @since(version = 0.2.0) - resource outgoing-datagram-stream { - /// Check readiness for sending. This function never blocks. - /// - /// Returns the number of datagrams permitted for the next call to `send`, - /// or an error. Calling `send` with more datagrams than this function has - /// permitted will trap. - /// - /// When this function returns ok(0), the `subscribe` pollable will - /// become ready when this function will report at least ok(1), or an - /// error. - /// - /// Never returns `would-block`. - check-send: func() -> result; - /// Send messages on the socket. - /// - /// This function attempts to send all provided `datagrams` on the socket without blocking and - /// returns how many messages were actually sent (or queued for sending). This function never - /// returns `error(would-block)`. If none of the datagrams were able to be sent, `ok(0)` is returned. - /// - /// This function semantically behaves the same as iterating the `datagrams` list and sequentially - /// sending each individual datagram until either the end of the list has been reached or the first error occurred. - /// If at least one datagram has been sent successfully, this function never returns an error. - /// - /// If the input list is empty, the function returns `ok(0)`. - /// - /// Each call to `send` must be permitted by a preceding `check-send`. Implementations must trap if - /// either `check-send` was not called or `datagrams` contains more items than `check-send` permitted. - /// - /// # Typical errors - /// - `invalid-argument`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) - /// - `invalid-argument`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL) - /// - `invalid-argument`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL) - /// - `invalid-argument`: The socket is in "connected" mode and `remote-address` is `some` value that does not match the address passed to `stream`. (EISCONN) - /// - `invalid-argument`: The socket is not "connected" and no value for `remote-address` was provided. (EDESTADDRREQ) - /// - `remote-unreachable`: The remote address is not reachable. (ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN, ENONET) - /// - `connection-refused`: The connection was refused. (ECONNREFUSED) - /// - `datagram-too-large`: The datagram is too large. (EMSGSIZE) - /// - /// # References - /// - - /// - - /// - - /// - - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - send: func(datagrams: list) -> result; - /// Create a `pollable` which will resolve once the stream is ready to send again. - /// - /// Note: this function is here for WASI 0.2 only. - /// It's planned to be removed when `future` is natively supported in Preview3. - @since(version = 0.2.0) - subscribe: func() -> pollable; - } - } - - @since(version = 0.2.0) - interface udp-create-socket { - @since(version = 0.2.0) - use network.{network, error-code, ip-address-family}; - @since(version = 0.2.0) - use udp.{udp-socket}; - - /// Create a new UDP socket. - /// - /// Similar to `socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)` in POSIX. - /// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise. - /// - /// This function does not require a network capability handle. This is considered to be safe because - /// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind` is called, - /// the socket is effectively an in-memory configuration object, unable to communicate with the outside world. - /// - /// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations. - /// - /// # Typical errors - /// - `not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT) - /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) - /// - /// # References: - /// - - /// - - /// - - /// - - @since(version = 0.2.0) - create-udp-socket: func(address-family: ip-address-family) -> result; - } - - @since(version = 0.2.0) - world imports { - @since(version = 0.2.0) - import network; - @since(version = 0.2.0) - import instance-network; - @since(version = 0.2.0) - import wasi:io/poll@0.2.3; - @since(version = 0.2.0) - import udp; - @since(version = 0.2.0) - import udp-create-socket; - @since(version = 0.2.0) - import wasi:io/error@0.2.3; - @since(version = 0.2.0) - import wasi:io/streams@0.2.3; - @since(version = 0.2.0) - import wasi:clocks/monotonic-clock@0.2.3; - @since(version = 0.2.0) - import tcp; - @since(version = 0.2.0) - import tcp-create-socket; - @since(version = 0.2.0) - import ip-name-lookup; + handle: func(request: incoming-request, response-out: response-outparam); } } From 49f748fb4157b063685a26b0f503090ac4c3866a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= Date: Tue, 17 Mar 2026 22:42:56 +0200 Subject: [PATCH 05/10] Add devcontainer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Doru Blânzeanu --- .devcontainer/Dockerfile | 70 +++++++++++++++++++ .devcontainer/devcontainer.json | 34 +++++++++ .devcontainer/setup.sh | 4 ++ .github/workflows/CreateDevcontainerImage.yml | 67 ++++++++++++++++++ README.md | 4 ++ 5 files changed, 179 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/setup.sh create mode 100644 .github/workflows/CreateDevcontainerImage.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..8ede957 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,70 @@ +## Dockerfile for devcontainer + +FROM mcr.microsoft.com/devcontainers/base:bookworm AS base + +ARG USER=vscode +ARG GROUP=vscode + +ENV HOME="/home/${USER}" +ENV PATH="$HOME/.cargo/bin:$PATH" + +# Install dependencies +RUN apt-get update \ + && apt-get -y install \ + build-essential \ + cmake \ + curl \ + gdb \ + git \ + gnupg \ + lsb-release \ + make \ + pkg-config \ + software-properties-common \ + sudo \ + wget \ + musl-tools + +ARG LLVM_VERSION=18 + +# Install llvm +RUN wget https://apt.llvm.org/llvm.sh \ + && chmod +x ./llvm.sh \ + && sudo ./llvm.sh ${LLVM_VERSION} clang clang-tools-extra \ + && sudo ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/ld.lld /usr/bin/ld.lld \ + && sudo ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/clang /usr/bin/clang + +# Install Node.js +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt-get install -y nodejs + +FROM base AS dev + +# Make sure the devcontainer user has sudo access +RUN chown -R "${USER}:${GROUP}" /home/${USER} \ + && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +# Persist bash history +RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \ + && mkdir /commandhistory \ + && touch /commandhistory/.bash_history \ + && chown -R "${USER}" /commandhistory \ + && echo "$SNIPPET" >> "/home/${USER}/.bashrc" + +USER $USER + +ARG RUST_TOOLCHAIN=1.89 + +# Install rust +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ + && rustup default ${RUST_TOOLCHAIN} \ + && rustup target add x86_64-unknown-linux-gnu \ + && rustup target add x86_64-unknown-linux-musl \ + && rustup target add x86_64-unknown-none \ + && rustup target add wasm32-wasip1 \ + && rustup toolchain add nightly-x86_64-unknown-linux-gnu \ + && cargo install just \ + && cargo install cargo-component \ + && cargo install cargo-hyperlight \ + && cargo install hyperlight-wasm-aot --locked --version 0.12.0 \ + && cargo install wasmtime-cli --locked --version 36.0.6 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..9dba568 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +{ + "name": "Hyperlight Wasm HTTP Example", + + "image": "ghcr.io/hyperlight-dev/hyperlight-wasm-http-example-devcontainer:latest", + + "containerUser": "vscode", + "containerEnv": { + "DEVICE": "/dev/kvm", + "REMOTE_USER": "vscode", + "REMOTE_GROUP": "vscode" + }, + + "runArgs": [ + "--device=/dev/kvm" + ], + + "postStartCommand": "bash .devcontainer/setup.sh", + + "customizations": { + "vscode": { + "extensions": [ + "rust-lang.rust-analyzer", + "vadimcn.vscode-lldb", + "dbaeumer.vscode-eslint", + "bytecodealliance.starlingmonkey-debugger" + ], + "settings": { + "rust-analyzer.rustfmt.extraArgs": [ + "+nightly" + ] + } + } + } +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 0000000..052a7d0 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Change device ownership +sudo chown -R $REMOTE_USER:$REMOTE_GROUP $DEVICE diff --git a/.github/workflows/CreateDevcontainerImage.yml b/.github/workflows/CreateDevcontainerImage.yml new file mode 100644 index 0000000..e1409ce --- /dev/null +++ b/.github/workflows/CreateDevcontainerImage.yml @@ -0,0 +1,67 @@ +name: Create and publish devcontainer Docker image + +on: + push: + branches: + - "main" + paths: + - ".devcontainer/Dockerfile" + - ".github/workflows/CreateDevcontainerImage.yml" + - "rust-toolchain.toml" + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}-devcontainer + USER: vscode + GROUP: vscode + LLVM_VERSION: 18 + RUST_TOOLCHAIN_DEFAULT: 1.89 + RUST_TOOLCHAIN_FILE: rust-toolchain.toml + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Read Rust toolchain version from ${{ env.RUST_TOOLCHAIN_FILE }} + id: toolchain + run: | + version=$(cat ${{ env.RUST_TOOLCHAIN_FILE }} | sed -n '/\[toolchain\]/,/^\[/{/^\s*channel = /s/[^"]*"\([^"]*\)".*/\1/p}') + cat ${{ env.RUST_TOOLCHAIN_FILE }} | grep $version &> /dev/null \ + && echo "RUST_TOOLCHAIN=${version}" >> "$GITHUB_OUTPUT" \ + || echo "RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN_DEFAULT }}" >> "$GITHUB_OUTPUT" + + - name: Log in to the Container registry + uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v6 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v7 + with: + context: ./.devcontainer + push: true + tags: | + ${{ steps.meta.outputs.tags }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + labels: ${{ steps.meta.outputs.labels }} + build-args: | + USER=${{ env.USER }} + GROUP=${{ env.GROUP }} + LLVM_VERSION=${{ env.LLVM_VERSION }} + RUST_TOOLCHAIN=${{ steps.toolchain.outputs.RUST_TOOLCHAIN }} diff --git a/README.md b/README.md index 28ce412..1ad39fa 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,7 @@ JS: ```sh cargo run -- out/sample_wasi_http_js.aot ``` + +## Try it yourself! + +[GitHub codespaces](https://codespaces.new/hyperlight-dev/hyperlight-wasm-http-example) From 7638e0ffb4c2599a7aa68fcfdf5756149348a49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= Date: Wed, 18 Mar 2026 05:38:57 +0200 Subject: [PATCH 06/10] Add CI job that builds artifacts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Doru Blânzeanu --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..99659d8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6.0.2 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y clang + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: "1.89.0" + targets: wasm32-wasip1, x86_64-unknown-none + + - name: Setup Node.js + uses: actions/setup-node@v6.3.0 + with: + node-version: "lts/*" + cache: npm + + - name: Install just + uses: extractions/setup-just@v3 + + - name: Install cargo-component + run: cargo install cargo-component + + - name: Install npm dependencies + run: npm install + + - name: Build host and components + run: | + just build + just build-rust-component + just build-js-component From 58abe93f21c320a5656f2a7d0dbe272a99540b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= Date: Wed, 18 Mar 2026 05:11:26 +0200 Subject: [PATCH 07/10] Add JS guest license and readme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The JS guest is an example used from https://github.com/bytecodealliance/sample-wasi-http-js/ so we add the license and readme to properly mention this Signed-off-by: Doru Blânzeanu --- guest_js/LICENSE | 219 +++++++++++++++++++++++++++++++++++++++++++++ guest_js/README.md | 75 ++++++++++++++++ 2 files changed, 294 insertions(+) create mode 100644 guest_js/LICENSE create mode 100644 guest_js/README.md diff --git a/guest_js/LICENSE b/guest_js/LICENSE new file mode 100644 index 0000000..be1d7c4 --- /dev/null +++ b/guest_js/LICENSE @@ -0,0 +1,219 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. diff --git a/guest_js/README.md b/guest_js/README.md new file mode 100644 index 0000000..aad6b86 --- /dev/null +++ b/guest_js/README.md @@ -0,0 +1,75 @@ +> [!NOTE] +> This is a vendored version of [sample-wasi-http-js](https://github.com/bytecodealliance/sample-wasi-http-js) +> that adds a `/proxy` route to demonstrate `wasi:http/outgoing-request` functionality. + +# Sample: `wasi:http` in JavaScript + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/bytecodealliance/sample-wasi-http-js) + +An example project showing how to build a spec-compliant +[`wasi:http/proxy`][wasi-http] server for WASI 0.2 written in JavaScript. + +## Routes + +The following HTTP routes are available from the component: + +```text +/ # Hello world +/sleep # Sleep for {ms} milliseconds +/echo # Echo the HTTP body +/echo-headers # Echo the HTTP headers +/upload # Echo uploaded blob +``` + +Testing routes: + +```bash +# Hello world +$ curl localhost:8080 +# Sleep for {ms} milliseconds +$ curl localhost:8080/sleep/2000 +# Echo the HTTP body +$ curl -d "Test echo body" localhost:8080/echo +# Echo the HTTP headers +$ curl -H "X-Test-Header: 123" localhost:8080/echo-headers +# Echo uploaded blob +$ echo "Hello World!" > test_file.txt +$ curl -H "Content-Type: text/plain" --data-binary @test_file.txt http://localhost:8080/upload +``` + +## Quick Start +The project uses [`Wasmtime`][wasmtime] as its runtime. However, if needed, it +can easily be adjusted to use [`jco`][jco] instead. For `wasmtime` installation, +simply run: + +```bash +$ curl https://wasmtime.dev/install.sh -sSf | bash +``` + +The quickest way to start is by using [`just`][just]. +```bash +$ just serve # to build and serve the wasm component on `localhost:8080` +$ curl localhost:8080 # to send requests to component. +``` + +Alternatively, run: + +```bash +$ npm install +$ npm run build +$ wasmtime serve -S common dist/sample-wasi-http-js.wasm +``` + +## See Also + +- [sample-wasi-http-rust][rust-sample] An example `wasi:http` server component written in Rust. + +## License + +Apache-2.0 with LLVM Exception + +[jco]: https://github.com/bytecodealliance/jco +[just]: https://github.com/casey/just +[rust-sample]: https://github.com/bytecodealliance/sample-wasi-http-rust +[wasi-http]: https://github.com/WebAssembly/wasi-http +[wasmtime]: https://wasmtime.dev/ From 4f28ce93c8935fe936baf5b305f280ebe7b01050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= Date: Tue, 17 Mar 2026 17:48:25 +0200 Subject: [PATCH 08/10] Move wasi related implementation to serparate module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Doru Blânzeanu --- src/bindings.rs | 9933 ----------------- src/main.rs | 54 +- src/wasi_impl/mod.rs | 11 + src/{ => wasi_impl}/resource.rs | 2 +- src/{ => wasi_impl}/types.rs | 2 +- src/{ => wasi_impl}/types/buffer.rs | 0 src/{ => wasi_impl}/types/cli.rs | 2 +- .../types/clocks_monotonic_clock.rs | 2 +- .../types/clocks_wall_clock.rs | 2 +- src/{ => wasi_impl}/types/headers.rs | 0 src/{ => wasi_impl}/types/http_future.rs | 0 .../types/http_future_headers.rs | 2 +- .../types/http_future_incoming_response.rs | 2 +- src/{ => wasi_impl}/types/http_headers.rs | 2 +- .../types/http_incoming_body.rs | 2 +- .../types/http_incoming_request.rs | 2 +- .../types/http_incoming_response.rs | 2 +- .../types/http_outgoing_body.rs | 2 +- .../types/http_outgoing_handler.rs | 4 +- .../types/http_outgoing_request.rs | 2 +- .../types/http_outgoing_response.rs | 2 +- .../types/http_request_options.rs | 2 +- .../types/http_response_outparam.rs | 2 +- src/{ => wasi_impl}/types/io_error.rs | 4 +- src/{ => wasi_impl}/types/io_poll.rs | 2 +- src/{ => wasi_impl}/types/io_stream.rs | 2 +- src/{ => wasi_impl}/types/random.rs | 2 +- src/{ => wasi_impl}/types/types.rs | 2 +- src/{ => wasi_impl}/worker.rs | 0 29 files changed, 60 insertions(+), 9986 deletions(-) delete mode 100644 src/bindings.rs create mode 100644 src/wasi_impl/mod.rs rename src/{ => wasi_impl}/resource.rs (98%) rename src/{ => wasi_impl}/types.rs (97%) rename src/{ => wasi_impl}/types/buffer.rs (100%) rename src/{ => wasi_impl}/types/cli.rs (97%) rename src/{ => wasi_impl}/types/clocks_monotonic_clock.rs (93%) rename src/{ => wasi_impl}/types/clocks_wall_clock.rs (93%) rename src/{ => wasi_impl}/types/headers.rs (100%) rename src/{ => wasi_impl}/types/http_future.rs (100%) rename src/{ => wasi_impl}/types/http_future_headers.rs (97%) rename src/{ => wasi_impl}/types/http_future_incoming_response.rs (97%) rename src/{ => wasi_impl}/types/http_headers.rs (98%) rename src/{ => wasi_impl}/types/http_incoming_body.rs (97%) rename src/{ => wasi_impl}/types/http_incoming_request.rs (98%) rename src/{ => wasi_impl}/types/http_incoming_response.rs (97%) rename src/{ => wasi_impl}/types/http_outgoing_body.rs (98%) rename src/{ => wasi_impl}/types/http_outgoing_handler.rs (98%) rename src/{ => wasi_impl}/types/http_outgoing_request.rs (99%) rename src/{ => wasi_impl}/types/http_outgoing_response.rs (98%) rename src/{ => wasi_impl}/types/http_request_options.rs (98%) rename src/{ => wasi_impl}/types/http_response_outparam.rs (96%) rename src/{ => wasi_impl}/types/io_error.rs (78%) rename src/{ => wasi_impl}/types/io_poll.rs (99%) rename src/{ => wasi_impl}/types/io_stream.rs (99%) rename src/{ => wasi_impl}/types/random.rs (89%) rename src/{ => wasi_impl}/types/types.rs (89%) rename src/{ => wasi_impl}/worker.rs (100%) diff --git a/src/bindings.rs b/src/bindings.rs deleted file mode 100644 index 7a62163..0000000 --- a/src/bindings.rs +++ /dev/null @@ -1,9933 +0,0 @@ -#![allow( - clippy::all, - dead_code, - unused_variables, - non_snake_case, - unused_braces, - unused_mut -)] -pub mod r#root { - pub mod r#component { - pub trait RootExports { - type IncomingHandler: super::super::r#wasi::r#http::IncomingHandler< - ::T, - ::T, - ::T, - >>::T, - ::T, - ::T, - >>::T, - >>::T, - >>::T, - ::T, - ::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >>::T, - >>::T, - >>::T, - >; - fn r#incoming_handler( - &mut self, - ) -> impl ::core::borrow::BorrowMut; - } - pub trait RootImports { - type Poll: super::super::r#wasi::r#io::Poll; - fn r#poll(&mut self) -> impl ::core::borrow::BorrowMut; - type MonotonicClock: super::super::r#wasi::r#clocks::MonotonicClock< - ::T, - >; - fn r#monotonic_clock( - &mut self, - ) -> impl ::core::borrow::BorrowMut; - type Random: super::super::r#wasi::r#random::Random; - fn r#random(&mut self) -> impl ::core::borrow::BorrowMut; - type Error: super::super::r#wasi::r#io::Error; - fn r#error(&mut self) -> impl ::core::borrow::BorrowMut; - type Streams: super::super::r#wasi::r#io::Streams< - ::T, - ::T, - >; - fn r#streams(&mut self) -> impl ::core::borrow::BorrowMut; - type Stdout: super::super::r#wasi::r#cli::Stdout< - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >; - fn r#stdout(&mut self) -> impl ::core::borrow::BorrowMut; - type Stderr: super::super::r#wasi::r#cli::Stderr< - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >; - fn r#stderr(&mut self) -> impl ::core::borrow::BorrowMut; - type Stdin: super::super::r#wasi::r#cli::Stdin< - ::T, - ::T, - >>::T, - >; - fn r#stdin(&mut self) -> impl ::core::borrow::BorrowMut; - type Types: super::super::r#wasi::r#http::Types< - super::super::r#wasi::r#clocks::r#monotonic_clock::Duration, - ::T, - ::T, - ::T, - >>::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - ::T, - >; - fn r#types(&mut self) -> impl ::core::borrow::BorrowMut; - type OutgoingHandler: super::super::r#wasi::r#http::OutgoingHandler< - super::super::r#wasi::r#http::r#types::ErrorCode, - ::T, - ::T, - ::T, - >>::T, - ::T, - ::T, - >>::T, - >>::T, - >>::T, - ::T, - >>::T, - ::T, - ::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >>::T, - >>::T, - >::T, - >; - fn r#outgoing_handler( - &mut self, - ) -> impl ::core::borrow::BorrowMut; - } - pub trait Root { - type Exports: RootExports; - fn instantiate( - self, - imports: I, - ) -> Self::Exports; - } - } -} -pub mod r#wasi { - pub mod r#cli { - pub mod r#stderr { - pub type OutputStream = OutputStream; - } - pub mod r#stdin { - pub type InputStream = InputStream; - } - pub mod r#stdout { - pub type OutputStream = OutputStream; - } - pub trait Stderr { - fn r#get_stderr(&mut self) -> r#stderr::OutputStream; - } - pub trait Stdin { - fn r#get_stdin(&mut self) -> r#stdin::InputStream; - } - pub trait Stdout { - fn r#get_stdout(&mut self) -> r#stdout::OutputStream; - } - } - pub mod r#clocks { - pub mod r#monotonic_clock { - pub type Pollable = Pollable; - pub type Instant = u64; - pub type Duration = u64; - } - pub trait MonotonicClock { - fn r#now(&mut self) -> r#monotonic_clock::Instant; - fn r#resolution(&mut self) -> r#monotonic_clock::Duration; - fn r#subscribe_instant( - &mut self, - r#when: r#monotonic_clock::Instant, - ) -> r#monotonic_clock::Pollable; - fn r#subscribe_duration( - &mut self, - r#when: r#monotonic_clock::Duration, - ) -> r#monotonic_clock::Pollable; - } - } - pub mod r#http { - pub mod r#incoming_handler { - pub type IncomingRequest = IncomingRequest; - pub type ResponseOutparam = ResponseOutparam; - } - pub mod r#outgoing_handler { - pub type OutgoingRequest = OutgoingRequest; - pub type RequestOptions = RequestOptions; - pub type FutureIncomingResponse = FutureIncomingResponse; - pub type ErrorCode = ErrorCode; - } - pub mod r#types { - pub trait Fields { - type T: ::core::marker::Send; - fn new(&mut self) -> Self::T; - fn r#from_list( - &mut self, - r#entries: alloc::vec::Vec<(self::FieldName, self::FieldValue)>, - ) -> ::core::result::Result; - fn r#get( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#name: self::FieldName, - ) -> alloc::vec::Vec; - fn r#has( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#name: self::FieldName, - ) -> bool; - fn r#set( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#name: self::FieldName, - r#value: alloc::vec::Vec, - ) -> ::core::result::Result<(), self::HeaderError>; - fn r#delete( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#name: self::FieldName, - ) -> ::core::result::Result<(), self::HeaderError>; - fn r#append( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#name: self::FieldName, - r#value: self::FieldValue, - ) -> ::core::result::Result<(), self::HeaderError>; - fn r#entries( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> alloc::vec::Vec<(self::FieldName, self::FieldValue)>; - fn r#clone( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> Self::T; - } - pub trait FutureIncomingResponse { - type T: ::core::marker::Send; - fn r#subscribe( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Pollable; - fn r#get( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option< - ::core::result::Result< - ::core::result::Result, - (), - >, - >; - } - pub trait FutureTrailers { - type T: ::core::marker::Send; - fn r#subscribe( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Pollable; - fn r#get( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option< - ::core::result::Result< - ::core::result::Result< - ::core::option::Option>, - self::ErrorCode, - >, - (), - >, - >; - } - pub trait IncomingBody { - type T: ::core::marker::Send; - fn r#stream( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result, ()>; - fn r#finish(&mut self, r#this: Self::T) -> FutureTrailers; - } - pub trait IncomingRequest { - type T: ::core::marker::Send; - fn r#method( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Method; - fn r#path_with_query( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option; - fn r#scheme( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option; - fn r#authority( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option; - fn r#headers( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Headers; - fn r#consume( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result; - } - pub trait IncomingResponse { - type T: ::core::marker::Send; - fn r#status( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::StatusCode; - fn r#headers( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Headers; - fn r#consume( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result; - } - pub trait OutgoingBody { - type T: ::core::marker::Send; - fn r#write( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result, ()>; - fn r#finish( - &mut self, - r#this: Self::T, - r#trailers: ::core::option::Option>, - ) -> ::core::result::Result<(), self::ErrorCode>; - } - pub trait OutgoingRequest { - type T: ::core::marker::Send; - fn new(&mut self, r#headers: self::Headers) -> Self::T; - fn r#body( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result; - fn r#method( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Method; - fn r#set_method( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#method: self::Method, - ) -> ::core::result::Result<(), ()>; - fn r#path_with_query( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option; - fn r#set_path_with_query( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#path_with_query: ::core::option::Option, - ) -> ::core::result::Result<(), ()>; - fn r#scheme( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option; - fn r#set_scheme( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#scheme: ::core::option::Option, - ) -> ::core::result::Result<(), ()>; - fn r#authority( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option; - fn r#set_authority( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#authority: ::core::option::Option, - ) -> ::core::result::Result<(), ()>; - fn r#headers( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Headers; - } - pub trait OutgoingResponse { - type T: ::core::marker::Send; - fn new(&mut self, r#headers: self::Headers) -> Self::T; - fn r#status_code( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::StatusCode; - fn r#set_status_code( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#status_code: self::StatusCode, - ) -> ::core::result::Result<(), ()>; - fn r#headers( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Headers; - fn r#body( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result; - } - pub trait RequestOptions { - type T: ::core::marker::Send; - fn new(&mut self) -> Self::T; - fn r#connect_timeout( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option>; - fn r#set_connect_timeout( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#duration: ::core::option::Option>, - ) -> ::core::result::Result<(), ()>; - fn r#first_byte_timeout( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option>; - fn r#set_first_byte_timeout( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#duration: ::core::option::Option>, - ) -> ::core::result::Result<(), ()>; - fn r#between_bytes_timeout( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::option::Option>; - fn r#set_between_bytes_timeout( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#duration: ::core::option::Option>, - ) -> ::core::result::Result<(), ()>; - } - pub trait ResponseOutparam { - type T: ::core::marker::Send; - fn r#set( - &mut self, - r#param: Self::T, - r#response: ::core::result::Result, - ) -> (); - } - pub type Duration = Duration; - pub type InputStream = InputStream; - pub type Pollable = Pollable; - pub type OutputStream = OutputStream; - pub type IoError = Error; - pub type FieldKey = alloc::string::String; - pub type FieldName = self::FieldKey; - pub type FieldValue = alloc::vec::Vec; - #[derive(Debug)] - pub enum HeaderError { - InvalidSyntax, - Forbidden, - Immutable, - } - #[derive(Debug)] - pub enum Method { - Get, - Head, - Post, - Put, - Delete, - Connect, - Options, - Trace, - Patch, - Other(alloc::string::String), - } - #[derive(Debug)] - pub enum Scheme { - HTTP, - HTTPS, - Other(alloc::string::String), - } - pub type Headers = Fields; - #[derive(Debug)] - pub struct DNSErrorPayload { - pub r#rcode: ::core::option::Option, - pub r#info_code: ::core::option::Option, - } - #[derive(Debug)] - pub struct TLSAlertReceivedPayload { - pub r#alert_id: ::core::option::Option, - pub r#alert_message: ::core::option::Option, - } - #[derive(Debug)] - pub struct FieldSizePayload { - pub r#field_name: ::core::option::Option, - pub r#field_size: ::core::option::Option, - } - #[derive(Debug)] - pub enum ErrorCode { - DNSTimeout, - DNSError(self::DNSErrorPayload), - DestinationNotFound, - DestinationUnavailable, - DestinationIPProhibited, - DestinationIPUnroutable, - ConnectionRefused, - ConnectionTerminated, - ConnectionTimeout, - ConnectionReadTimeout, - ConnectionWriteTimeout, - ConnectionLimitReached, - TLSProtocolError, - TLSCertificateError, - TLSAlertReceived(self::TLSAlertReceivedPayload), - HTTPRequestDenied, - HTTPRequestLengthRequired, - HTTPRequestBodySize(::core::option::Option), - HTTPRequestMethodInvalid, - HTTPRequestURIInvalid, - HTTPRequestURITooLong, - HTTPRequestHeaderSectionSize(::core::option::Option), - HTTPRequestHeaderSize(::core::option::Option), - HTTPRequestTrailerSectionSize(::core::option::Option), - HTTPRequestTrailerSize(self::FieldSizePayload), - HTTPResponseIncomplete, - HTTPResponseHeaderSectionSize(::core::option::Option), - HTTPResponseHeaderSize(self::FieldSizePayload), - HTTPResponseBodySize(::core::option::Option), - HTTPResponseTrailerSectionSize(::core::option::Option), - HTTPResponseTrailerSize(self::FieldSizePayload), - HTTPResponseTransferCoding( - ::core::option::Option, - ), - HTTPResponseContentCoding(::core::option::Option), - HTTPResponseTimeout, - HTTPUpgradeFailed, - HTTPProtocolError, - LoopDetected, - ConfigurationError, - InternalError(::core::option::Option), - } - pub type StatusCode = u16; - pub type Trailers = Fields; - } - pub trait IncomingHandler { - fn r#handle( - &mut self, - r#request: r#incoming_handler::IncomingRequest, - r#response_out: r#incoming_handler::ResponseOutparam, - ) -> (); - } - pub trait OutgoingHandler< - ErrorCode, - FutureIncomingResponse, - OutgoingRequest, - RequestOptions, - > { - fn r#handle( - &mut self, - r#request: r#outgoing_handler::OutgoingRequest, - r#options: ::core::option::Option< - r#outgoing_handler::RequestOptions, - >, - ) -> ::core::result::Result< - r#outgoing_handler::FutureIncomingResponse, - r#outgoing_handler::ErrorCode, - >; - } - pub trait Types< - Duration, - Error, - InputStream, - OutputStream, - Pollable, - >: r#types::Fields + r#types::FutureIncomingResponse< - ::T, - ::T, - Pollable, - >>::T, - InputStream, - >>::T, - >>::T, - Pollable, - > + r#types::FutureTrailers< - ::T, - Pollable, - > + r#types::IncomingBody< - ::T, - Pollable, - >>::T, - InputStream, - > + r#types::IncomingRequest< - ::T, - ::T, - Pollable, - >>::T, - InputStream, - >>::T, - > + r#types::IncomingResponse< - ::T, - ::T, - Pollable, - >>::T, - InputStream, - >>::T, - > + r#types::OutgoingBody< - ::T, - OutputStream, - > + r#types::OutgoingRequest< - ::T, - ::T, - OutputStream, - >>::T, - > + r#types::OutgoingResponse< - ::T, - ::T, - OutputStream, - >>::T, - > + r#types::RequestOptions< - Duration, - > + r#types::ResponseOutparam< - ::T, - ::T, - OutputStream, - >>::T, - >>::T, - > { - fn r#http_error_code( - &mut self, - r#err: ::hyperlight_common::resource::BorrowedResourceGuard< - r#types::IoError, - >, - ) -> ::core::option::Option; - } - } - pub mod r#io { - pub mod r#error { - pub trait Error { - type T: ::core::marker::Send; - fn r#to_debug_string( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> alloc::string::String; - } - } - pub mod r#poll { - pub trait Pollable { - type T: ::core::marker::Send; - fn r#ready( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> bool; - fn r#block( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> (); - } - } - pub mod r#streams { - pub trait InputStream { - type T: ::core::marker::Send; - fn r#read( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#len: u64, - ) -> ::core::result::Result< - alloc::vec::Vec, - self::StreamError, - >; - fn r#blocking_read( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#len: u64, - ) -> ::core::result::Result< - alloc::vec::Vec, - self::StreamError, - >; - fn r#skip( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#len: u64, - ) -> ::core::result::Result>; - fn r#blocking_skip( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#len: u64, - ) -> ::core::result::Result>; - fn r#subscribe( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Pollable; - } - pub trait OutputStream { - type T: ::core::marker::Send; - fn r#check_write( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result>; - fn r#write( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#contents: alloc::vec::Vec, - ) -> ::core::result::Result<(), self::StreamError>; - fn r#blocking_write_and_flush( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#contents: alloc::vec::Vec, - ) -> ::core::result::Result<(), self::StreamError>; - fn r#flush( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result<(), self::StreamError>; - fn r#blocking_flush( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> ::core::result::Result<(), self::StreamError>; - fn r#subscribe( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - ) -> self::Pollable; - fn r#write_zeroes( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#len: u64, - ) -> ::core::result::Result<(), self::StreamError>; - fn r#blocking_write_zeroes_and_flush( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#len: u64, - ) -> ::core::result::Result<(), self::StreamError>; - fn r#splice( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#src: ::hyperlight_common::resource::BorrowedResourceGuard< - InputStream, - >, - r#len: u64, - ) -> ::core::result::Result>; - fn r#blocking_splice( - &mut self, - self_: ::hyperlight_common::resource::BorrowedResourceGuard, - r#src: ::hyperlight_common::resource::BorrowedResourceGuard< - InputStream, - >, - r#len: u64, - ) -> ::core::result::Result>; - } - pub type Error = Error; - pub type Pollable = Pollable; - #[derive(Debug)] - pub enum StreamError { - LastOperationFailed(self::Error), - Closed, - } - } - pub trait Error: r#error::Error {} - pub trait Poll: r#poll::Pollable { - fn r#poll( - &mut self, - r#in: alloc::vec::Vec< - ::hyperlight_common::resource::BorrowedResourceGuard< - ::T, - >, - >, - ) -> alloc::vec::Vec; - } - pub trait Streams< - Error, - Pollable, - >: r#streams::InputStream< - Error, - Pollable, - > + r#streams::OutputStream< - Error, - >::T, - Pollable, - > {} - } - pub mod r#random { - pub trait Random { - fn r#get_random_bytes(&mut self, r#len: u64) -> alloc::vec::Vec; - } - } -} -pub(crate) struct RootResources { - resource0: (), - resource1: (), - resource2: (), - resource3: (), - resource4: (), - resource5: (), - resource6: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - ::T, - >>::T, - ::T, - ::T, - >>::T, - >>::T, - >>::T, - ::T, - >>::T, - >, - >, - resource7: (), - resource8: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - >>::T, - >, - >, - resource9: (), - resource10: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - ::T, - >>::T, - ::T, - ::T, - >>::T, - >>::T, - >>::T, - >, - >, - resource11: (), - resource12: (), - resource13: (), - resource14: (), - resource15: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >>::T, - >>::T, - >, - >, - resource16: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >>::T, - >>::T, - >>::T, - >, - >, - resource17: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - >::T, - >, - >, - resource18: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >>::T, - >, - >, - resource19: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >>::T, - >>::T, - >, - >, - resource20: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - >>::T, - ::T, - ::T, - >>::T, - >>::T, - >, - >, - resource21: (), - resource22: (), - resource23: (), - resource24: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - ::T, - >>::T, - ::T, - ::T, - >>::T, - >>::T, - >>::T, - >, - >, - resource25: (), - resource26: (), - resource27: (), - resource28: (), - resource29: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - >, - >, - resource30: (), - resource31: (), - resource32: (), - resource33: (), - resource34: (), - resource35: (), - resource36: (), - resource37: (), - resource38: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >, - >, - resource39: (), - resource40: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - ::T, - >>::T, - >, - >, - resource41: (), - resource42: (), - resource43: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - >, - >, - resource44: (), - resource45: (), - resource46: (), - resource47: ::std::collections::VecDeque< - ::hyperlight_common::resource::ResourceEntry< - ::T, - >, - >, - _phantomI: ::core::marker::PhantomData, -} -impl RootResources { - fn new() -> Self { - RootResources { - resource0: (), - resource1: (), - resource2: (), - resource3: (), - resource4: (), - resource5: (), - resource6: ::std::collections::VecDeque::new(), - resource7: (), - resource8: ::std::collections::VecDeque::new(), - resource9: (), - resource10: ::std::collections::VecDeque::new(), - resource11: (), - resource12: (), - resource13: (), - resource14: (), - resource15: ::std::collections::VecDeque::new(), - resource16: ::std::collections::VecDeque::new(), - resource17: ::std::collections::VecDeque::new(), - resource18: ::std::collections::VecDeque::new(), - resource19: ::std::collections::VecDeque::new(), - resource20: ::std::collections::VecDeque::new(), - resource21: (), - resource22: (), - resource23: (), - resource24: ::std::collections::VecDeque::new(), - resource25: (), - resource26: (), - resource27: (), - resource28: (), - resource29: ::std::collections::VecDeque::new(), - resource30: (), - resource31: (), - resource32: (), - resource33: (), - resource34: (), - resource35: (), - resource36: (), - resource37: (), - resource38: ::std::collections::VecDeque::new(), - resource39: (), - resource40: ::std::collections::VecDeque::new(), - resource41: (), - resource42: (), - resource43: ::std::collections::VecDeque::new(), - resource44: (), - resource45: (), - resource46: (), - resource47: ::std::collections::VecDeque::new(), - _phantomI: ::core::marker::PhantomData, - } - } -} -impl< - I: r#root::r#component::RootImports, - S: ::hyperlight_host::sandbox::Callable, -> r#wasi::r#http::IncomingHandler< - ::T, - ::T, - ::T, - >>::T, - ::T, - ::T, - >>::T, - >>::T, - >>::T, - ::T, - ::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >>::T, - >>::T, - >>::T, -> for RootSandbox { - fn r#handle( - &mut self, - r#request: r#wasi::r#http::r#incoming_handler::IncomingRequest< - ::T, - ::T, - ::T, - >>::T, - ::T, - ::T, - >>::T, - >>::T, - >>::T, - >, - r#response_out: r#wasi::r#http::r#incoming_handler::ResponseOutparam< - ::T, - ::T, - ::T, - ::T, - ::T, - >>::T, - ::T, - >>::T, - >>::T, - >>::T, - >>::T, - >, - ) -> () { - let args = { - let mut rts = self.rt.lock().unwrap(); - ( - { - let i = rts.resource24.len(); - rts.resource24 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(r#request), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }, - { - let i = rts.resource16.len(); - rts.resource16 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - r#response_out, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }, - ) - }; - let ret = ::hyperlight_host::sandbox::Callable::call::< - ::std::vec::Vec, - >(&mut self.sb, "r#wasi::r#http::handle", args); - let ::std::result::Result::Ok(ret) = ret else { - panic!("bad return from guest {:?}", ret) - }; - #[allow(clippy::unused_unit)] () - } -} -pub struct RootSandbox< - T: r#root::r#component::RootImports, - S: ::hyperlight_host::sandbox::Callable, -> { - pub(crate) sb: S, - pub(crate) rt: ::std::sync::Arc<::std::sync::Mutex>>, -} -pub(crate) fn register_host_functions< - I: r#root::r#component::RootImports + ::std::marker::Send + 'static, - S: ::hyperlight_host::func::Registerable, ->(sb: &mut S, i: I) -> ::std::sync::Arc<::std::sync::Mutex>> { - let rts = ::std::sync::Arc::new(::std::sync::Mutex::new(RootResources::new())); - let imports = ::std::sync::Arc::new(::std::sync::Mutex::new(i)); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]pollable.ready", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#poll( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#poll::Pollable::r#ready( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource47[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ alloc::vec![if ret { 1u8 } else { 0u8 }] }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]pollable.block", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#poll( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#poll::Pollable::r#block( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource47[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok(::alloc::vec::Vec::new()) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::poll", - move |r#in: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#poll( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::Poll::r#poll( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let n = u32::from_ne_bytes(r#in[0..4].try_into().unwrap()) - as usize; - let mut in_list = alloc::vec::Vec::new(); - let mut cursor = 4; - for i in 0..n { - let in_elem = &r#in[cursor..]; - let (x, b) = { - let i = u32::from_ne_bytes( - in_elem[0..4].try_into().unwrap(), - ); - let Some(v) = rts.resource47[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - }; - cursor += b; - in_list.push(x); - } - (in_list, cursor) - } - .0, - ); - Ok({ - let mut ret_list = alloc::vec::Vec::new(); - let n = ret.len(); - ret_list.extend(alloc::vec::Vec::from(u32::to_ne_bytes(n as u32))); - for ret_elem in ret { - ret_list - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_elem)) - }) - } - ret_list - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#clocks::now", - move || { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#monotonic_clock( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#clocks::MonotonicClock::r#now( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - Ok({ alloc::vec::Vec::from(u64::to_ne_bytes(ret)) }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#clocks::resolution", - move || { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#monotonic_clock( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#clocks::MonotonicClock::r#resolution( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - Ok({ alloc::vec::Vec::from(u64::to_ne_bytes(ret)) }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#clocks::subscribe-instant", - move |r#when: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#monotonic_clock( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#clocks::MonotonicClock::r#subscribe_instant( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - ( - u64::from_ne_bytes(r#when[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - let i = rts.resource47.len(); - rts.resource47 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#clocks::subscribe-duration", - move |r#when: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#monotonic_clock( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#clocks::MonotonicClock::r#subscribe_duration( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - ( - u64::from_ne_bytes(r#when[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - let i = rts.resource47.len(); - rts.resource47 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#random::get-random-bytes", - move |r#len: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#random( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#random::Random::r#get_random_bytes( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - let mut ret_list = alloc::vec::Vec::new(); - let n = ret.len(); - ret_list.extend(alloc::vec::Vec::from(u32::to_ne_bytes(n as u32))); - for ret_elem in ret { - ret_list - .extend({ alloc::vec::Vec::from(u8::to_ne_bytes(ret_elem)) }) - } - ret_list - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]error.to-debug-string", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#error( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#error::Error::r#to_debug_string( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource43[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let mut ret_string = alloc::vec::Vec::new(); - let ret_bytes = ret.into_bytes(); - ret_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_bytes.len() as u32), - ), - ); - ret_string.extend(ret_bytes); - ret_string - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]input-stream.read", - move |self_: ::std::vec::Vec, r#len: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::InputStream::r#read( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource40[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let mut ret_body_list = alloc::vec::Vec::new(); - let n = ret_body.len(); - ret_body_list - .extend(alloc::vec::Vec::from(u32::to_ne_bytes(n as u32))); - for ret_body_elem in ret_body { - ret_body_list - .extend({ - alloc::vec::Vec::from(u8::to_ne_bytes(ret_body_elem)) - }) - } - ret_body_list - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]input-stream.blocking-read", - move |self_: ::std::vec::Vec, r#len: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::InputStream::r#blocking_read( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource40[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let mut ret_body_list = alloc::vec::Vec::new(); - let n = ret_body.len(); - ret_body_list - .extend(alloc::vec::Vec::from(u32::to_ne_bytes(n as u32))); - for ret_body_elem in ret_body { - ret_body_list - .extend({ - alloc::vec::Vec::from(u8::to_ne_bytes(ret_body_elem)) - }) - } - ret_body_list - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]input-stream.skip", - move |self_: ::std::vec::Vec, r#len: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::InputStream::r#skip( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource40[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]input-stream.blocking-skip", - move |self_: ::std::vec::Vec, r#len: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::InputStream::r#blocking_skip( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource40[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]input-stream.subscribe", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::InputStream::r#subscribe( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource40[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource47.len(); - rts.resource47 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.check-write", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#check_write( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.write", - move |self_: ::std::vec::Vec, r#contents: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#write( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u32::from_ne_bytes(r#contents[0..4].try_into().unwrap()) - as usize; - let mut contents_list = alloc::vec::Vec::new(); - let mut cursor = 4; - for i in 0..n { - let contents_elem = &r#contents[cursor..]; - let (x, b) = { - ( - u8::from_ne_bytes( - contents_elem[0..1usize].try_into().unwrap(), - ), - 1usize, - ) - }; - cursor += b; - contents_list.push(x); - } - (contents_list, cursor) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.blocking-write-and-flush", - move |self_: ::std::vec::Vec, r#contents: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#blocking_write_and_flush( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u32::from_ne_bytes(r#contents[0..4].try_into().unwrap()) - as usize; - let mut contents_list = alloc::vec::Vec::new(); - let mut cursor = 4; - for i in 0..n { - let contents_elem = &r#contents[cursor..]; - let (x, b) = { - ( - u8::from_ne_bytes( - contents_elem[0..1usize].try_into().unwrap(), - ), - 1usize, - ) - }; - cursor += b; - contents_list.push(x); - } - (contents_list, cursor) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.flush", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#flush( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.blocking-flush", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#blocking_flush( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.subscribe", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#subscribe( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource47.len(); - rts.resource47 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.write-zeroes", - move |self_: ::std::vec::Vec, r#len: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#write_zeroes( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.blocking-write-zeroes-and-flush", - move |self_: ::std::vec::Vec, r#len: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#blocking_write_zeroes_and_flush( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.splice", - move | - self_: ::std::vec::Vec, - r#src: ::std::vec::Vec, - r#len: ::std::vec::Vec| - { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#splice( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let i = u32::from_ne_bytes(r#src[0..4].try_into().unwrap()); - let Some(v) = rts.resource40[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#io::[method]output-stream.blocking-splice", - move | - self_: ::std::vec::Vec, - r#src: ::std::vec::Vec, - r#len: ::std::vec::Vec| - { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#streams( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#io::r#streams::OutputStream::r#blocking_splice( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource38[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let i = u32::from_ne_bytes(r#src[0..4].try_into().unwrap()); - let Some(v) = rts.resource40[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u64::from_ne_bytes(r#len[0..8usize].try_into().unwrap()), - 8usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::LastOperationFailed(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - ret_body_ret - .extend({ - let i = rts.resource43.len(); - rts.resource43 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - } - r#wasi::r#io::r#streams::StreamError::< - ::T, - >::Closed => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#cli::get-stdout", - move || { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#stdout( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#cli::Stdout::r#get_stdout( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - Ok({ - let i = rts.resource38.len(); - rts.resource38 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#cli::get-stderr", - move || { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#stderr( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#cli::Stderr::r#get_stderr( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - Ok({ - let i = rts.resource38.len(); - rts.resource38 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#cli::get-stdin", - move || { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#stdin( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#cli::Stdin::r#get_stdin( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - Ok({ - let i = rts.resource40.len(); - rts.resource40 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[constructor]fields", - move || { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::new( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - Ok({ - let i = rts.resource29.len(); - rts.resource29 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[static]fields.from-list", - move |r#entries: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::r#from_list( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let n = u32::from_ne_bytes(r#entries[0..4].try_into().unwrap()) - as usize; - let mut entries_list = alloc::vec::Vec::new(); - let mut cursor = 4; - for i in 0..n { - let entries_elem = &r#entries[cursor..]; - let (x, b) = { - let entries_elem_elem = &entries_elem[0..]; - let mut entries_elem_len = 0; - let (entries_elem_elem0, b) = { - let n = u32::from_ne_bytes( - entries_elem_elem[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&entries_elem_elem[4..4 + n]) - .unwrap(), - ); - (s, n + 4) - }; - entries_elem_len += b; - let entries_elem_elem = &entries_elem_elem[b..]; - let (entries_elem_elem1, b) = { - let n = u32::from_ne_bytes( - entries_elem_elem[0..4].try_into().unwrap(), - ) as usize; - let mut entries_elem_elem_list = alloc::vec::Vec::new(); - let mut cursor = 4; - for i in 0..n { - let entries_elem_elem_elem = &entries_elem_elem[cursor..]; - let (x, b) = { - ( - u8::from_ne_bytes( - entries_elem_elem_elem[0..1usize].try_into().unwrap(), - ), - 1usize, - ) - }; - cursor += b; - entries_elem_elem_list.push(x); - } - (entries_elem_elem_list, cursor) - }; - entries_elem_len += b; - let entries_elem_elem = &entries_elem_elem[b..]; - ((entries_elem_elem0, entries_elem_elem1), entries_elem_len) - }; - cursor += b; - entries_list.push(x); - } - (entries_list, cursor) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let i = rts.resource29.len(); - rts.resource29 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret_body), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::HeaderError::InvalidSyntax => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::HeaderError::Forbidden => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - r#wasi::r#http::r#types::HeaderError::Immutable => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]fields.get", - move |self_: ::std::vec::Vec, r#name: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::r#get( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u32::from_ne_bytes(r#name[0..4].try_into().unwrap()) - as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&r#name[4..4 + n]).unwrap(), - ); - (s, n + 4) - } - .0, - ); - Ok({ - let mut ret_list = alloc::vec::Vec::new(); - let n = ret.len(); - ret_list.extend(alloc::vec::Vec::from(u32::to_ne_bytes(n as u32))); - for ret_elem in ret { - ret_list - .extend({ - let mut ret_elem_list = alloc::vec::Vec::new(); - let n = ret_elem.len(); - ret_elem_list - .extend(alloc::vec::Vec::from(u32::to_ne_bytes(n as u32))); - for ret_elem_elem in ret_elem { - ret_elem_list - .extend({ - alloc::vec::Vec::from(u8::to_ne_bytes(ret_elem_elem)) - }) - } - ret_elem_list - }) - } - ret_list - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]fields.has", - move |self_: ::std::vec::Vec, r#name: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::r#has( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u32::from_ne_bytes(r#name[0..4].try_into().unwrap()) - as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&r#name[4..4 + n]).unwrap(), - ); - (s, n + 4) - } - .0, - ); - Ok({ alloc::vec![if ret { 1u8 } else { 0u8 }] }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]fields.set", - move | - self_: ::std::vec::Vec, - r#name: ::std::vec::Vec, - r#value: ::std::vec::Vec| - { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::r#set( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u32::from_ne_bytes(r#name[0..4].try_into().unwrap()) - as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&r#name[4..4 + n]).unwrap(), - ); - (s, n + 4) - } - .0, - { - let n = u32::from_ne_bytes(r#value[0..4].try_into().unwrap()) - as usize; - let mut value_list = alloc::vec::Vec::new(); - let mut cursor = 4; - for i in 0..n { - let value_elem = &r#value[cursor..]; - let (x, b) = { - let n = u32::from_ne_bytes( - value_elem[0..4].try_into().unwrap(), - ) as usize; - let mut value_elem_list = alloc::vec::Vec::new(); - let mut cursor = 4; - for i in 0..n { - let value_elem_elem = &value_elem[cursor..]; - let (x, b) = { - ( - u8::from_ne_bytes( - value_elem_elem[0..1usize].try_into().unwrap(), - ), - 1usize, - ) - }; - cursor += b; - value_elem_list.push(x); - } - (value_elem_list, cursor) - }; - cursor += b; - value_list.push(x); - } - (value_list, cursor) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::HeaderError::InvalidSyntax => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::HeaderError::Forbidden => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - r#wasi::r#http::r#types::HeaderError::Immutable => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]fields.delete", - move |self_: ::std::vec::Vec, r#name: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::r#delete( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u32::from_ne_bytes(r#name[0..4].try_into().unwrap()) - as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&r#name[4..4 + n]).unwrap(), - ); - (s, n + 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::HeaderError::InvalidSyntax => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::HeaderError::Forbidden => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - r#wasi::r#http::r#types::HeaderError::Immutable => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]fields.append", - move | - self_: ::std::vec::Vec, - r#name: ::std::vec::Vec, - r#value: ::std::vec::Vec| - { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::r#append( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u32::from_ne_bytes(r#name[0..4].try_into().unwrap()) - as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&r#name[4..4 + n]).unwrap(), - ); - (s, n + 4) - } - .0, - { - let n = u32::from_ne_bytes(r#value[0..4].try_into().unwrap()) - as usize; - let mut value_list = alloc::vec::Vec::new(); - let mut cursor = 4; - for i in 0..n { - let value_elem = &r#value[cursor..]; - let (x, b) = { - ( - u8::from_ne_bytes( - value_elem[0..1usize].try_into().unwrap(), - ), - 1usize, - ) - }; - cursor += b; - value_list.push(x); - } - (value_list, cursor) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::HeaderError::InvalidSyntax => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::HeaderError::Forbidden => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - r#wasi::r#http::r#types::HeaderError::Immutable => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]fields.entries", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::r#entries( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let mut ret_list = alloc::vec::Vec::new(); - let n = ret.len(); - ret_list.extend(alloc::vec::Vec::from(u32::to_ne_bytes(n as u32))); - for ret_elem in ret { - ret_list - .extend({ - let mut ret_elem_tuple = alloc::vec::Vec::new(); - let ret_elem_elem = ret_elem.0; - ret_elem_tuple - .extend({ - let mut ret_elem_elem_string = alloc::vec::Vec::new(); - let ret_elem_elem_bytes = ret_elem_elem.into_bytes(); - ret_elem_elem_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_elem_elem_bytes.len() as u32), - ), - ); - ret_elem_elem_string.extend(ret_elem_elem_bytes); - ret_elem_elem_string - }); - let ret_elem_elem = ret_elem.1; - ret_elem_tuple - .extend({ - let mut ret_elem_elem_list = alloc::vec::Vec::new(); - let n = ret_elem_elem.len(); - ret_elem_elem_list - .extend(alloc::vec::Vec::from(u32::to_ne_bytes(n as u32))); - for ret_elem_elem_elem in ret_elem_elem { - ret_elem_elem_list - .extend({ - alloc::vec::Vec::from(u8::to_ne_bytes(ret_elem_elem_elem)) - }) - } - ret_elem_elem_list - }); - ret_elem_tuple - }) - } - ret_list - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]fields.clone", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::Fields::r#clone( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource29.len(); - rts.resource29 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-request.method", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingRequest::r#method( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource24[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let mut ret_ret = alloc::vec::Vec::new(); - match ret { - r#wasi::r#http::r#types::Method::Get => { - ret_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::Method::Head => { - ret_ret.extend(u32::to_ne_bytes(1u32)); - } - r#wasi::r#http::r#types::Method::Post => { - ret_ret.extend(u32::to_ne_bytes(2u32)); - } - r#wasi::r#http::r#types::Method::Put => { - ret_ret.extend(u32::to_ne_bytes(3u32)); - } - r#wasi::r#http::r#types::Method::Delete => { - ret_ret.extend(u32::to_ne_bytes(4u32)); - } - r#wasi::r#http::r#types::Method::Connect => { - ret_ret.extend(u32::to_ne_bytes(5u32)); - } - r#wasi::r#http::r#types::Method::Options => { - ret_ret.extend(u32::to_ne_bytes(6u32)); - } - r#wasi::r#http::r#types::Method::Trace => { - ret_ret.extend(u32::to_ne_bytes(7u32)); - } - r#wasi::r#http::r#types::Method::Patch => { - ret_ret.extend(u32::to_ne_bytes(8u32)); - } - r#wasi::r#http::r#types::Method::Other(ret_body) => { - ret_ret.extend(u32::to_ne_bytes(9u32)); - ret_ret - .extend({ - let mut ret_body_string = alloc::vec::Vec::new(); - let ret_body_bytes = ret_body.into_bytes(); - ret_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_bytes.len() as u32), - ), - ); - ret_body_string.extend(ret_body_bytes); - ret_body_string - }) - } - } - ret_ret - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-request.path-with-query", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingRequest::r#path_with_query( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource24[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_string = alloc::vec::Vec::new(); - let ret_body_bytes = ret_body.into_bytes(); - ret_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_bytes.len() as u32), - ), - ); - ret_body_string.extend(ret_body_bytes); - ret_body_string - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-request.scheme", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingRequest::r#scheme( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource24[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::Scheme::HTTP => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::Scheme::HTTPS => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - r#wasi::r#http::r#types::Scheme::Other(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - ret_body_ret - .extend({ - let mut ret_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_bytes = ret_body_body.into_bytes(); - ret_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_bytes.len() as u32), - ), - ); - ret_body_body_string.extend(ret_body_body_bytes); - ret_body_body_string - }) - } - } - ret_body_ret - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-request.authority", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingRequest::r#authority( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource24[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_string = alloc::vec::Vec::new(); - let ret_body_bytes = ret_body.into_bytes(); - ret_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_bytes.len() as u32), - ), - ); - ret_body_string.extend(ret_body_bytes); - ret_body_string - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-request.headers", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingRequest::r#headers( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource24[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource29.len(); - rts.resource29 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-request.consume", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingRequest::r#consume( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource24[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let i = rts.resource20.len(); - rts.resource20 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret_body), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-body.stream", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingBody::r#stream( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource20[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let i = rts.resource40.len(); - rts.resource40 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret_body), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[static]incoming-body.finish", - move |r#this: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingBody::r#finish( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(r#this[0..4].try_into().unwrap()); - let Some(v) = rts.resource20[i as usize].take() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource8.len(); - rts.resource8 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[constructor]outgoing-request", - move |r#headers: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::new( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(r#headers[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].take() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource19.len(); - rts.resource19 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.body", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#body( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let i = rts.resource18.len(); - rts.resource18 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret_body), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.method", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#method( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let mut ret_ret = alloc::vec::Vec::new(); - match ret { - r#wasi::r#http::r#types::Method::Get => { - ret_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::Method::Head => { - ret_ret.extend(u32::to_ne_bytes(1u32)); - } - r#wasi::r#http::r#types::Method::Post => { - ret_ret.extend(u32::to_ne_bytes(2u32)); - } - r#wasi::r#http::r#types::Method::Put => { - ret_ret.extend(u32::to_ne_bytes(3u32)); - } - r#wasi::r#http::r#types::Method::Delete => { - ret_ret.extend(u32::to_ne_bytes(4u32)); - } - r#wasi::r#http::r#types::Method::Connect => { - ret_ret.extend(u32::to_ne_bytes(5u32)); - } - r#wasi::r#http::r#types::Method::Options => { - ret_ret.extend(u32::to_ne_bytes(6u32)); - } - r#wasi::r#http::r#types::Method::Trace => { - ret_ret.extend(u32::to_ne_bytes(7u32)); - } - r#wasi::r#http::r#types::Method::Patch => { - ret_ret.extend(u32::to_ne_bytes(8u32)); - } - r#wasi::r#http::r#types::Method::Other(ret_body) => { - ret_ret.extend(u32::to_ne_bytes(9u32)); - ret_ret - .extend({ - let mut ret_body_string = alloc::vec::Vec::new(); - let ret_body_bytes = ret_body.into_bytes(); - ret_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_bytes.len() as u32), - ), - ); - ret_body_string.extend(ret_body_bytes); - ret_body_string - }) - } - } - ret_ret - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.set-method", - move |self_: ::std::vec::Vec, r#method: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#set_method( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u32::from_ne_bytes(r#method[0..4].try_into().unwrap()); - let method_body = &r#method[4..]; - match n { - 0u32 => (r#wasi::r#http::r#types::Method::Get, 4), - 1u32 => (r#wasi::r#http::r#types::Method::Head, 4), - 2u32 => (r#wasi::r#http::r#types::Method::Post, 4), - 3u32 => (r#wasi::r#http::r#types::Method::Put, 4), - 4u32 => (r#wasi::r#http::r#types::Method::Delete, 4), - 5u32 => (r#wasi::r#http::r#types::Method::Connect, 4), - 6u32 => (r#wasi::r#http::r#types::Method::Options, 4), - 7u32 => (r#wasi::r#http::r#types::Method::Trace, 4), - 8u32 => (r#wasi::r#http::r#types::Method::Patch, 4), - 9u32 => { - let (method_case_Other, b) = { - let n = u32::from_ne_bytes( - method_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&method_body[4..4 + n]).unwrap(), - ); - (s, n + 4) - }; - ( - r#wasi::r#http::r#types::Method::Other(method_case_Other), - b + 4, - ) - } - _ => panic!("invalid value for variant"), - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.path-with-query", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#path_with_query( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_string = alloc::vec::Vec::new(); - let ret_body_bytes = ret_body.into_bytes(); - ret_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_bytes.len() as u32), - ), - ); - ret_body_string.extend(ret_body_bytes); - ret_body_string - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.set-path-with-query", - move |self_: ::std::vec::Vec, r#path_with_query: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#set_path_with_query( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u8::from_ne_bytes( - r#path_with_query[0..1].try_into().unwrap(), - ); - if n != 0 { - let path_with_query_body = &r#path_with_query[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - path_with_query_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&path_with_query_body[4..4 + n]) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.scheme", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#scheme( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::Scheme::HTTP => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::Scheme::HTTPS => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - } - r#wasi::r#http::r#types::Scheme::Other(ret_body_body) => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - ret_body_ret - .extend({ - let mut ret_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_bytes = ret_body_body.into_bytes(); - ret_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_bytes.len() as u32), - ), - ); - ret_body_body_string.extend(ret_body_body_bytes); - ret_body_body_string - }) - } - } - ret_body_ret - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.set-scheme", - move |self_: ::std::vec::Vec, r#scheme: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#set_scheme( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u8::from_ne_bytes(r#scheme[0..1].try_into().unwrap()); - if n != 0 { - let scheme_body = &r#scheme[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - scheme_body[0..4].try_into().unwrap(), - ); - let scheme_body_body = &scheme_body[4..]; - match n { - 0u32 => (r#wasi::r#http::r#types::Scheme::HTTP, 4), - 1u32 => (r#wasi::r#http::r#types::Scheme::HTTPS, 4), - 2u32 => { - let (scheme_body_case_Other, b) = { - let n = u32::from_ne_bytes( - scheme_body_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&scheme_body_body[4..4 + n]).unwrap(), - ); - (s, n + 4) - }; - ( - r#wasi::r#http::r#types::Scheme::Other( - scheme_body_case_Other, - ), - b + 4, - ) - } - _ => panic!("invalid value for variant"), - } - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.authority", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#authority( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_string = alloc::vec::Vec::new(); - let ret_body_bytes = ret_body.into_bytes(); - ret_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_bytes.len() as u32), - ), - ); - ret_body_string.extend(ret_body_bytes); - ret_body_string - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.set-authority", - move |self_: ::std::vec::Vec, r#authority: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#set_authority( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u8::from_ne_bytes(r#authority[0..1].try_into().unwrap()); - if n != 0 { - let authority_body = &r#authority[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - authority_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&authority_body[4..4 + n]).unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-request.headers", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingRequest::r#headers( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource29.len(); - rts.resource29 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-body.write", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingBody::r#write( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource18[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let i = rts.resource38.len(); - rts.resource38 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret_body), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[static]outgoing-body.finish", - move |r#this: ::std::vec::Vec, r#trailers: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingBody::r#finish( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(r#this[0..4].try_into().unwrap()); - let Some(v) = rts.resource18[i as usize].take() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u8::from_ne_bytes(r#trailers[0..1].try_into().unwrap()); - if n != 0 { - let trailers_body = &r#trailers[1..]; - let (x, b) = { - let i = u32::from_ne_bytes( - trailers_body[0..4].try_into().unwrap(), - ); - let Some(v) = rts.resource29[i as usize].take() else { - panic!(""); - }; - (v, 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::ErrorCode::DNSTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::ErrorCode::DNSError( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_rcode = ret_body_body.r#rcode; - ret_body_body_record - .extend({ - match ret_body_body_field_rcode { - ::core::option::Option::Some( - ret_body_body_field_rcode_body, - ) => { - let mut ret_body_body_field_rcode_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_rcode_ret - .extend({ - let mut ret_body_body_field_rcode_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_rcode_body_bytes = ret_body_body_field_rcode_body - .into_bytes(); - ret_body_body_field_rcode_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_rcode_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_rcode_body_string - .extend(ret_body_body_field_rcode_body_bytes); - ret_body_body_field_rcode_body_string - }); - ret_body_body_field_rcode_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_info_code = ret_body_body - .r#info_code; - ret_body_body_record - .extend({ - match ret_body_body_field_info_code { - ::core::option::Option::Some( - ret_body_body_field_info_code_body, - ) => { - let mut ret_body_body_field_info_code_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_info_code_ret - .extend({ - alloc::vec::Vec::from( - u16::to_ne_bytes(ret_body_body_field_info_code_body), - ) - }); - ret_body_body_field_info_code_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::DestinationNotFound => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationUnavailable => { - ret_body_ret.extend(u32::to_ne_bytes(3u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPProhibited => { - ret_body_ret.extend(u32::to_ne_bytes(4u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPUnroutable => { - ret_body_ret.extend(u32::to_ne_bytes(5u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionRefused => { - ret_body_ret.extend(u32::to_ne_bytes(6u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTerminated => { - ret_body_ret.extend(u32::to_ne_bytes(7u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(8u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionReadTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(9u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionWriteTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(10u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionLimitReached => { - ret_body_ret.extend(u32::to_ne_bytes(11u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSProtocolError => { - ret_body_ret.extend(u32::to_ne_bytes(12u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSCertificateError => { - ret_body_ret.extend(u32::to_ne_bytes(13u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSAlertReceived( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(14u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_alert_id = ret_body_body.r#alert_id; - ret_body_body_record - .extend({ - match ret_body_body_field_alert_id { - ::core::option::Option::Some( - ret_body_body_field_alert_id_body, - ) => { - let mut ret_body_body_field_alert_id_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_alert_id_ret - .extend({ - alloc::vec::Vec::from( - u8::to_ne_bytes(ret_body_body_field_alert_id_body), - ) - }); - ret_body_body_field_alert_id_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_alert_message = ret_body_body - .r#alert_message; - ret_body_body_record - .extend({ - match ret_body_body_field_alert_message { - ::core::option::Option::Some( - ret_body_body_field_alert_message_body, - ) => { - let mut ret_body_body_field_alert_message_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_alert_message_ret - .extend({ - let mut ret_body_body_field_alert_message_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_alert_message_body_bytes = ret_body_body_field_alert_message_body - .into_bytes(); - ret_body_body_field_alert_message_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_alert_message_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_alert_message_body_string - .extend(ret_body_body_field_alert_message_body_bytes); - ret_body_body_field_alert_message_body_string - }); - ret_body_body_field_alert_message_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestDenied => { - ret_body_ret.extend(u32::to_ne_bytes(15u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestLengthRequired => { - ret_body_ret.extend(u32::to_ne_bytes(16u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestBodySize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(17u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestMethodInvalid => { - ret_body_ret.extend(u32::to_ne_bytes(18u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURIInvalid => { - ret_body_ret.extend(u32::to_ne_bytes(19u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURITooLong => { - ret_body_ret.extend(u32::to_ne_bytes(20u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(21u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(22u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_field_field_name = ret_body_body_body - .r#field_name; - ret_body_body_body_record - .extend({ - match ret_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_field_field_name_body_bytes = ret_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_field_field_name_body_string - .extend(ret_body_body_body_field_field_name_body_bytes); - ret_body_body_body_field_field_name_body_string - }); - ret_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_field_field_size = ret_body_body_body - .r#field_size; - ret_body_body_body_record - .extend({ - match ret_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_field_field_size_body), - ) - }); - ret_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_record - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(23u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(24u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseIncomplete => { - ret_body_ret.extend(u32::to_ne_bytes(25u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(26u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(27u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseBodySize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(28u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(29u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(30u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTransferCoding( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(31u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseContentCoding( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(32u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(33u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPUpgradeFailed => { - ret_body_ret.extend(u32::to_ne_bytes(34u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPProtocolError => { - ret_body_ret.extend(u32::to_ne_bytes(35u32)); - } - r#wasi::r#http::r#types::ErrorCode::LoopDetected => { - ret_body_ret.extend(u32::to_ne_bytes(36u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConfigurationError => { - ret_body_ret.extend(u32::to_ne_bytes(37u32)); - } - r#wasi::r#http::r#types::ErrorCode::InternalError( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(38u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[constructor]request-options", - move || { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::RequestOptions::new( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - Ok({ - let i = rts.resource17.len(); - rts.resource17 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]request-options.connect-timeout", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::RequestOptions::r#connect_timeout( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource17[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body)) - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]request-options.set-connect-timeout", - move |self_: ::std::vec::Vec, r#duration: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::RequestOptions::r#set_connect_timeout( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource17[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u8::from_ne_bytes(r#duration[0..1].try_into().unwrap()); - if n != 0 { - let duration_body = &r#duration[1..]; - let (x, b) = { - ( - u64::from_ne_bytes( - duration_body[0..8usize].try_into().unwrap(), - ), - 8usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]request-options.first-byte-timeout", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::RequestOptions::r#first_byte_timeout( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource17[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body)) - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]request-options.set-first-byte-timeout", - move |self_: ::std::vec::Vec, r#duration: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::RequestOptions::r#set_first_byte_timeout( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource17[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u8::from_ne_bytes(r#duration[0..1].try_into().unwrap()); - if n != 0 { - let duration_body = &r#duration[1..]; - let (x, b) = { - ( - u64::from_ne_bytes( - duration_body[0..8usize].try_into().unwrap(), - ), - 8usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]request-options.between-bytes-timeout", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::RequestOptions::r#between_bytes_timeout( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource17[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body)) - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]request-options.set-between-bytes-timeout", - move |self_: ::std::vec::Vec, r#duration: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::RequestOptions::r#set_between_bytes_timeout( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource17[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u8::from_ne_bytes(r#duration[0..1].try_into().unwrap()); - if n != 0 { - let duration_body = &r#duration[1..]; - let (x, b) = { - ( - u64::from_ne_bytes( - duration_body[0..8usize].try_into().unwrap(), - ), - 8usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[static]response-outparam.set", - move |r#param: ::std::vec::Vec, r#response: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::ResponseOutparam::r#set( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(r#param[0..4].try_into().unwrap()); - let Some(v) = rts.resource16[i as usize].take() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let i = u8::from_ne_bytes(r#response[0..1].try_into().unwrap()); - let response_body = &r#response[1..]; - if i == 0 { - let (x, b) = { - let i = u32::from_ne_bytes( - response_body[0..4].try_into().unwrap(), - ); - let Some(v) = rts.resource15[i as usize].take() else { - panic!(""); - }; - (v, 4) - }; - (::core::result::Result::Ok(x), b + 1) - } else { - let (x, b) = { - let n = u32::from_ne_bytes( - response_body[0..4].try_into().unwrap(), - ); - let response_body_body = &response_body[4..]; - match n { - 0u32 => (r#wasi::r#http::r#types::ErrorCode::DNSTimeout, 4), - 1u32 => { - let (response_body_case_DNSError, b) = { - let mut response_body_body_cursor = 0; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_rcode, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_field_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8( - &response_body_body_field_body[4..4 + n], - ) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_info_code, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - ( - u16::from_ne_bytes( - response_body_body_field_body[0..2usize].try_into().unwrap(), - ), - 2usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - ( - r#wasi::r#http::r#types::DNSErrorPayload { - r#rcode: response_body_body_field_rcode, - r#info_code: response_body_body_field_info_code, - }, - response_body_body_cursor, - ) - }; - ( - r#wasi::r#http::r#types::ErrorCode::DNSError( - response_body_case_DNSError, - ), - b + 4, - ) - } - 2u32 => { - (r#wasi::r#http::r#types::ErrorCode::DestinationNotFound, 4) - } - 3u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::DestinationUnavailable, - 4, - ) - } - 4u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::DestinationIPProhibited, - 4, - ) - } - 5u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::DestinationIPUnroutable, - 4, - ) - } - 6u32 => { - (r#wasi::r#http::r#types::ErrorCode::ConnectionRefused, 4) - } - 7u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::ConnectionTerminated, - 4, - ) - } - 8u32 => { - (r#wasi::r#http::r#types::ErrorCode::ConnectionTimeout, 4) - } - 9u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::ConnectionReadTimeout, - 4, - ) - } - 10u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::ConnectionWriteTimeout, - 4, - ) - } - 11u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::ConnectionLimitReached, - 4, - ) - } - 12u32 => { - (r#wasi::r#http::r#types::ErrorCode::TLSProtocolError, 4) - } - 13u32 => { - (r#wasi::r#http::r#types::ErrorCode::TLSCertificateError, 4) - } - 14u32 => { - let (response_body_case_TLSAlertReceived, b) = { - let mut response_body_body_cursor = 0; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_alert_id, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - ( - u8::from_ne_bytes( - response_body_body_field_body[0..1usize].try_into().unwrap(), - ), - 1usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_alert_message, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_field_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8( - &response_body_body_field_body[4..4 + n], - ) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - ( - r#wasi::r#http::r#types::TLSAlertReceivedPayload { - r#alert_id: response_body_body_field_alert_id, - r#alert_message: response_body_body_field_alert_message, - }, - response_body_body_cursor, - ) - }; - ( - r#wasi::r#http::r#types::ErrorCode::TLSAlertReceived( - response_body_case_TLSAlertReceived, - ), - b + 4, - ) - } - 15u32 => { - (r#wasi::r#http::r#types::ErrorCode::HTTPRequestDenied, 4) - } - 16u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestLengthRequired, - 4, - ) - } - 17u32 => { - let (response_body_case_HTTPRequestBodySize, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - ( - u64::from_ne_bytes( - response_body_body_body[0..8usize].try_into().unwrap(), - ), - 8usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestBodySize( - response_body_case_HTTPRequestBodySize, - ), - b + 4, - ) - } - 18u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestMethodInvalid, - 4, - ) - } - 19u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURIInvalid, - 4, - ) - } - 20u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURITooLong, - 4, - ) - } - 21u32 => { - let (response_body_case_HTTPRequestHeaderSectionSize, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - ( - u32::from_ne_bytes( - response_body_body_body[0..4usize].try_into().unwrap(), - ), - 4usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSectionSize( - response_body_case_HTTPRequestHeaderSectionSize, - ), - b + 4, - ) - } - 22u32 => { - let (response_body_case_HTTPRequestHeaderSize, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - let mut response_body_body_body_cursor = 0; - let response_body_body_body_field = &response_body_body_body[response_body_body_body_cursor..]; - let (response_body_body_body_field_field_name, b) = { - let n = u8::from_ne_bytes( - response_body_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body_field_body = &response_body_body_body_field[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_body_field_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8( - &response_body_body_body_field_body[4..4 + n], - ) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_body_cursor += b; - let response_body_body_body_field = &response_body_body_body[response_body_body_body_cursor..]; - let (response_body_body_body_field_field_size, b) = { - let n = u8::from_ne_bytes( - response_body_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body_field_body = &response_body_body_body_field[1..]; - let (x, b) = { - ( - u32::from_ne_bytes( - response_body_body_body_field_body[0..4usize] - .try_into() - .unwrap(), - ), - 4usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_body_cursor += b; - ( - r#wasi::r#http::r#types::FieldSizePayload { - r#field_name: response_body_body_body_field_field_name, - r#field_size: response_body_body_body_field_field_size, - }, - response_body_body_body_cursor, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSize( - response_body_case_HTTPRequestHeaderSize, - ), - b + 4, - ) - } - 23u32 => { - let (response_body_case_HTTPRequestTrailerSectionSize, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - ( - u32::from_ne_bytes( - response_body_body_body[0..4usize].try_into().unwrap(), - ), - 4usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSectionSize( - response_body_case_HTTPRequestTrailerSectionSize, - ), - b + 4, - ) - } - 24u32 => { - let (response_body_case_HTTPRequestTrailerSize, b) = { - let mut response_body_body_cursor = 0; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_field_name, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_field_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8( - &response_body_body_field_body[4..4 + n], - ) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_field_size, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - ( - u32::from_ne_bytes( - response_body_body_field_body[0..4usize].try_into().unwrap(), - ), - 4usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - ( - r#wasi::r#http::r#types::FieldSizePayload { - r#field_name: response_body_body_field_field_name, - r#field_size: response_body_body_field_field_size, - }, - response_body_body_cursor, - ) - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSize( - response_body_case_HTTPRequestTrailerSize, - ), - b + 4, - ) - } - 25u32 => { - ( - r#wasi::r#http::r#types::ErrorCode::HTTPResponseIncomplete, - 4, - ) - } - 26u32 => { - let (response_body_case_HTTPResponseHeaderSectionSize, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - ( - u32::from_ne_bytes( - response_body_body_body[0..4usize].try_into().unwrap(), - ), - 4usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSectionSize( - response_body_case_HTTPResponseHeaderSectionSize, - ), - b + 4, - ) - } - 27u32 => { - let (response_body_case_HTTPResponseHeaderSize, b) = { - let mut response_body_body_cursor = 0; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_field_name, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_field_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8( - &response_body_body_field_body[4..4 + n], - ) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_field_size, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - ( - u32::from_ne_bytes( - response_body_body_field_body[0..4usize].try_into().unwrap(), - ), - 4usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - ( - r#wasi::r#http::r#types::FieldSizePayload { - r#field_name: response_body_body_field_field_name, - r#field_size: response_body_body_field_field_size, - }, - response_body_body_cursor, - ) - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSize( - response_body_case_HTTPResponseHeaderSize, - ), - b + 4, - ) - } - 28u32 => { - let (response_body_case_HTTPResponseBodySize, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - ( - u64::from_ne_bytes( - response_body_body_body[0..8usize].try_into().unwrap(), - ), - 8usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPResponseBodySize( - response_body_case_HTTPResponseBodySize, - ), - b + 4, - ) - } - 29u32 => { - let ( - response_body_case_HTTPResponseTrailerSectionSize, - b, - ) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - ( - u32::from_ne_bytes( - response_body_body_body[0..4usize].try_into().unwrap(), - ), - 4usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSectionSize( - response_body_case_HTTPResponseTrailerSectionSize, - ), - b + 4, - ) - } - 30u32 => { - let (response_body_case_HTTPResponseTrailerSize, b) = { - let mut response_body_body_cursor = 0; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_field_name, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_field_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8( - &response_body_body_field_body[4..4 + n], - ) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - let response_body_body_field = &response_body_body[response_body_body_cursor..]; - let (response_body_body_field_field_size, b) = { - let n = u8::from_ne_bytes( - response_body_body_field[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_field_body = &response_body_body_field[1..]; - let (x, b) = { - ( - u32::from_ne_bytes( - response_body_body_field_body[0..4usize].try_into().unwrap(), - ), - 4usize, - ) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - response_body_body_cursor += b; - ( - r#wasi::r#http::r#types::FieldSizePayload { - r#field_name: response_body_body_field_field_name, - r#field_size: response_body_body_field_field_size, - }, - response_body_body_cursor, - ) - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSize( - response_body_case_HTTPResponseTrailerSize, - ), - b + 4, - ) - } - 31u32 => { - let (response_body_case_HTTPResponseTransferCoding, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&response_body_body_body[4..4 + n]) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTransferCoding( - response_body_case_HTTPResponseTransferCoding, - ), - b + 4, - ) - } - 32u32 => { - let (response_body_case_HTTPResponseContentCoding, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&response_body_body_body[4..4 + n]) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::HTTPResponseContentCoding( - response_body_case_HTTPResponseContentCoding, - ), - b + 4, - ) - } - 33u32 => { - (r#wasi::r#http::r#types::ErrorCode::HTTPResponseTimeout, 4) - } - 34u32 => { - (r#wasi::r#http::r#types::ErrorCode::HTTPUpgradeFailed, 4) - } - 35u32 => { - (r#wasi::r#http::r#types::ErrorCode::HTTPProtocolError, 4) - } - 36u32 => { - (r#wasi::r#http::r#types::ErrorCode::LoopDetected, 4) - } - 37u32 => { - (r#wasi::r#http::r#types::ErrorCode::ConfigurationError, 4) - } - 38u32 => { - let (response_body_case_InternalError, b) = { - let n = u8::from_ne_bytes( - response_body_body[0..1].try_into().unwrap(), - ); - if n != 0 { - let response_body_body_body = &response_body_body[1..]; - let (x, b) = { - let n = u32::from_ne_bytes( - response_body_body_body[0..4].try_into().unwrap(), - ) as usize; - let s = ::alloc::string::ToString::to_string( - ::core::str::from_utf8(&response_body_body_body[4..4 + n]) - .unwrap(), - ); - (s, n + 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - }; - ( - r#wasi::r#http::r#types::ErrorCode::InternalError( - response_body_case_InternalError, - ), - b + 4, - ) - } - _ => panic!("invalid value for variant"), - } - }; - (::core::result::Result::Err(x), b + 1) - } - } - .0, - ); - Ok(::alloc::vec::Vec::new()) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[constructor]outgoing-response", - move |r#headers: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingResponse::new( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(r#headers[0..4].try_into().unwrap()); - let Some(v) = rts.resource29[i as usize].take() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource15.len(); - rts.resource15 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-response.status-code", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingResponse::r#status_code( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource15[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ alloc::vec::Vec::from(u16::to_ne_bytes(ret)) }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-response.set-status-code", - move |self_: ::std::vec::Vec, r#status_code: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingResponse::r#set_status_code( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource15[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - { - ( - u16::from_ne_bytes( - r#status_code[0..2usize].try_into().unwrap(), - ), - 2usize, - ) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-response.headers", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingResponse::r#headers( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource15[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource29.len(); - rts.resource29 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]outgoing-response.body", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::OutgoingResponse::r#body( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource15[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let i = rts.resource18.len(); - rts.resource18 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret_body), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-response.status", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingResponse::r#status( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource10[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ alloc::vec::Vec::from(u16::to_ne_bytes(ret)) }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-response.headers", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingResponse::r#headers( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource10[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource29.len(); - rts.resource29 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]incoming-response.consume", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::IncomingResponse::r#consume( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource10[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let i = rts.resource20.len(); - rts.resource20 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret_body), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]future-trailers.subscribe", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::FutureTrailers::r#subscribe( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource8[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource47.len(); - rts.resource47 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]future-trailers.get", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::FutureTrailers::r#get( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource8[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - match ret_body { - ::core::result::Result::Ok(ret_body_body) => { - let mut ret_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(0), - ); - ret_body_ret - .extend({ - match ret_body_body { - ::core::result::Result::Ok(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(0), - ); - ret_body_body_ret - .extend({ - match ret_body_body_body { - ::core::option::Option::Some(ret_body_body_body_body) => { - let mut ret_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_ret - .extend({ - let i = rts.resource29.len(); - rts.resource29 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_ret - } - ::core::result::Result::Err(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_ret = alloc::vec::Vec::new(); - match ret_body_body_body { - r#wasi::r#http::r#types::ErrorCode::DNSTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::ErrorCode::DNSError( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(1u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_rcode = ret_body_body_body_body - .r#rcode; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_rcode { - ::core::option::Option::Some( - ret_body_body_body_body_field_rcode_body, - ) => { - let mut ret_body_body_body_body_field_rcode_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_rcode_ret - .extend({ - let mut ret_body_body_body_body_field_rcode_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_rcode_body_bytes = ret_body_body_body_body_field_rcode_body - .into_bytes(); - ret_body_body_body_body_field_rcode_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_rcode_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_body_field_rcode_body_string - .extend(ret_body_body_body_body_field_rcode_body_bytes); - ret_body_body_body_body_field_rcode_body_string - }); - ret_body_body_body_body_field_rcode_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_info_code = ret_body_body_body_body - .r#info_code; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_info_code { - ::core::option::Option::Some( - ret_body_body_body_body_field_info_code_body, - ) => { - let mut ret_body_body_body_body_field_info_code_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_info_code_ret - .extend({ - alloc::vec::Vec::from( - u16::to_ne_bytes( - ret_body_body_body_body_field_info_code_body, - ), - ) - }); - ret_body_body_body_body_field_info_code_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::DestinationNotFound => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(2u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationUnavailable => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(3u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPProhibited => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(4u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPUnroutable => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(5u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionRefused => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(6u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTerminated => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(7u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(8u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionReadTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(9u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionWriteTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(10u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionLimitReached => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(11u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSProtocolError => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(12u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSCertificateError => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(13u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSAlertReceived( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(14u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_alert_id = ret_body_body_body_body - .r#alert_id; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_alert_id { - ::core::option::Option::Some( - ret_body_body_body_body_field_alert_id_body, - ) => { - let mut ret_body_body_body_body_field_alert_id_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_alert_id_ret - .extend({ - alloc::vec::Vec::from( - u8::to_ne_bytes(ret_body_body_body_body_field_alert_id_body), - ) - }); - ret_body_body_body_body_field_alert_id_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_alert_message = ret_body_body_body_body - .r#alert_message; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_alert_message { - ::core::option::Option::Some( - ret_body_body_body_body_field_alert_message_body, - ) => { - let mut ret_body_body_body_body_field_alert_message_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_alert_message_ret - .extend({ - let mut ret_body_body_body_body_field_alert_message_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_alert_message_body_bytes = ret_body_body_body_body_field_alert_message_body - .into_bytes(); - ret_body_body_body_body_field_alert_message_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_alert_message_body_bytes.len() - as u32, - ), - ), - ); - ret_body_body_body_body_field_alert_message_body_string - .extend( - ret_body_body_body_body_field_alert_message_body_bytes, - ); - ret_body_body_body_body_field_alert_message_body_string - }); - ret_body_body_body_body_field_alert_message_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestDenied => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(15u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestLengthRequired => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(16u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestBodySize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(17u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u64::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestMethodInvalid => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(18u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURIInvalid => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(19u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURITooLong => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(20u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSectionSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(21u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(22u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_field_field_name = ret_body_body_body_body_body - .r#field_name; - ret_body_body_body_body_body_record - .extend({ - match ret_body_body_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_field_field_name_body_bytes = ret_body_body_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_field_field_name_body_bytes - .len() as u32, - ), - ), - ); - ret_body_body_body_body_body_field_field_name_body_string - .extend( - ret_body_body_body_body_body_field_field_name_body_bytes, - ); - ret_body_body_body_body_body_field_field_name_body_string - }); - ret_body_body_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_body_field_field_size = ret_body_body_body_body_body - .r#field_size; - ret_body_body_body_body_body_record - .extend({ - match ret_body_body_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_field_field_size_body, - ), - ) - }); - ret_body_body_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_body_record - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSectionSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(23u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(24u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name = ret_body_body_body_body - .r#field_name; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name_body_bytes = ret_body_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_name_body_bytes.len() - as u32, - ), - ), - ); - ret_body_body_body_body_field_field_name_body_string - .extend( - ret_body_body_body_body_field_field_name_body_bytes, - ); - ret_body_body_body_body_field_field_name_body_string - }); - ret_body_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_field_size = ret_body_body_body_body - .r#field_size; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_size_body, - ), - ) - }); - ret_body_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseIncomplete => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(25u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSectionSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(26u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(27u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name = ret_body_body_body_body - .r#field_name; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name_body_bytes = ret_body_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_name_body_bytes.len() - as u32, - ), - ), - ); - ret_body_body_body_body_field_field_name_body_string - .extend( - ret_body_body_body_body_field_field_name_body_bytes, - ); - ret_body_body_body_body_field_field_name_body_string - }); - ret_body_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_field_size = ret_body_body_body_body - .r#field_size; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_size_body, - ), - ) - }); - ret_body_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseBodySize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(28u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u64::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSectionSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(29u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(30u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name = ret_body_body_body_body - .r#field_name; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name_body_bytes = ret_body_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_name_body_bytes.len() - as u32, - ), - ), - ); - ret_body_body_body_body_field_field_name_body_string - .extend( - ret_body_body_body_body_field_field_name_body_bytes, - ); - ret_body_body_body_body_field_field_name_body_string - }); - ret_body_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_field_size = ret_body_body_body_body - .r#field_size; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_size_body, - ), - ) - }); - ret_body_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTransferCoding( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(31u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_bytes = ret_body_body_body_body_body - .into_bytes(); - ret_body_body_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_body_body_string - .extend(ret_body_body_body_body_body_bytes); - ret_body_body_body_body_body_string - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseContentCoding( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(32u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_bytes = ret_body_body_body_body_body - .into_bytes(); - ret_body_body_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_body_body_string - .extend(ret_body_body_body_body_body_bytes); - ret_body_body_body_body_body_string - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(33u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPUpgradeFailed => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(34u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPProtocolError => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(35u32)); - } - r#wasi::r#http::r#types::ErrorCode::LoopDetected => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(36u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConfigurationError => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(37u32)); - } - r#wasi::r#http::r#types::ErrorCode::InternalError( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(38u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_bytes = ret_body_body_body_body_body - .into_bytes(); - ret_body_body_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_body_body_string - .extend(ret_body_body_body_body_body_bytes); - ret_body_body_body_body_body_string - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - } - ret_body_body_body_ret - }); - ret_body_body_ret - } - } - }); - ret_body_ret - } - ::core::result::Result::Err(ret_body_body) => { - let mut ret_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_ret - } - } - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]future-incoming-response.subscribe", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::FutureIncomingResponse::r#subscribe( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource6[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - let i = rts.resource47.len(); - rts.resource47 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::[method]future-incoming-response.get", - move |self_: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::r#types::FutureIncomingResponse::r#get( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(self_[0..4].try_into().unwrap()); - let Some(v) = rts.resource6[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - match ret_body { - ::core::result::Result::Ok(ret_body_body) => { - let mut ret_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(0), - ); - ret_body_ret - .extend({ - match ret_body_body { - ::core::result::Result::Ok(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(0), - ); - ret_body_body_ret - .extend({ - let i = rts.resource10.len(); - rts.resource10 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give( - ret_body_body_body, - ), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_body_body_ret - } - ::core::result::Result::Err(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_ret = alloc::vec::Vec::new(); - match ret_body_body_body { - r#wasi::r#http::r#types::ErrorCode::DNSTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::ErrorCode::DNSError( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(1u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_rcode = ret_body_body_body_body - .r#rcode; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_rcode { - ::core::option::Option::Some( - ret_body_body_body_body_field_rcode_body, - ) => { - let mut ret_body_body_body_body_field_rcode_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_rcode_ret - .extend({ - let mut ret_body_body_body_body_field_rcode_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_rcode_body_bytes = ret_body_body_body_body_field_rcode_body - .into_bytes(); - ret_body_body_body_body_field_rcode_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_rcode_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_body_field_rcode_body_string - .extend(ret_body_body_body_body_field_rcode_body_bytes); - ret_body_body_body_body_field_rcode_body_string - }); - ret_body_body_body_body_field_rcode_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_info_code = ret_body_body_body_body - .r#info_code; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_info_code { - ::core::option::Option::Some( - ret_body_body_body_body_field_info_code_body, - ) => { - let mut ret_body_body_body_body_field_info_code_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_info_code_ret - .extend({ - alloc::vec::Vec::from( - u16::to_ne_bytes( - ret_body_body_body_body_field_info_code_body, - ), - ) - }); - ret_body_body_body_body_field_info_code_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::DestinationNotFound => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(2u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationUnavailable => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(3u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPProhibited => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(4u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPUnroutable => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(5u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionRefused => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(6u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTerminated => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(7u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(8u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionReadTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(9u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionWriteTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(10u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionLimitReached => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(11u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSProtocolError => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(12u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSCertificateError => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(13u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSAlertReceived( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(14u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_alert_id = ret_body_body_body_body - .r#alert_id; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_alert_id { - ::core::option::Option::Some( - ret_body_body_body_body_field_alert_id_body, - ) => { - let mut ret_body_body_body_body_field_alert_id_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_alert_id_ret - .extend({ - alloc::vec::Vec::from( - u8::to_ne_bytes(ret_body_body_body_body_field_alert_id_body), - ) - }); - ret_body_body_body_body_field_alert_id_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_alert_message = ret_body_body_body_body - .r#alert_message; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_alert_message { - ::core::option::Option::Some( - ret_body_body_body_body_field_alert_message_body, - ) => { - let mut ret_body_body_body_body_field_alert_message_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_alert_message_ret - .extend({ - let mut ret_body_body_body_body_field_alert_message_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_alert_message_body_bytes = ret_body_body_body_body_field_alert_message_body - .into_bytes(); - ret_body_body_body_body_field_alert_message_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_alert_message_body_bytes.len() - as u32, - ), - ), - ); - ret_body_body_body_body_field_alert_message_body_string - .extend( - ret_body_body_body_body_field_alert_message_body_bytes, - ); - ret_body_body_body_body_field_alert_message_body_string - }); - ret_body_body_body_body_field_alert_message_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestDenied => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(15u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestLengthRequired => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(16u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestBodySize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(17u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u64::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestMethodInvalid => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(18u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURIInvalid => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(19u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURITooLong => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(20u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSectionSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(21u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(22u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_field_field_name = ret_body_body_body_body_body - .r#field_name; - ret_body_body_body_body_body_record - .extend({ - match ret_body_body_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_field_field_name_body_bytes = ret_body_body_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_field_field_name_body_bytes - .len() as u32, - ), - ), - ); - ret_body_body_body_body_body_field_field_name_body_string - .extend( - ret_body_body_body_body_body_field_field_name_body_bytes, - ); - ret_body_body_body_body_body_field_field_name_body_string - }); - ret_body_body_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_body_field_field_size = ret_body_body_body_body_body - .r#field_size; - ret_body_body_body_body_body_record - .extend({ - match ret_body_body_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_field_field_size_body, - ), - ) - }); - ret_body_body_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_body_record - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSectionSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(23u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(24u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name = ret_body_body_body_body - .r#field_name; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name_body_bytes = ret_body_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_name_body_bytes.len() - as u32, - ), - ), - ); - ret_body_body_body_body_field_field_name_body_string - .extend( - ret_body_body_body_body_field_field_name_body_bytes, - ); - ret_body_body_body_body_field_field_name_body_string - }); - ret_body_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_field_size = ret_body_body_body_body - .r#field_size; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_size_body, - ), - ) - }); - ret_body_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseIncomplete => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(25u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSectionSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(26u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(27u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name = ret_body_body_body_body - .r#field_name; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name_body_bytes = ret_body_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_name_body_bytes.len() - as u32, - ), - ), - ); - ret_body_body_body_body_field_field_name_body_string - .extend( - ret_body_body_body_body_field_field_name_body_bytes, - ); - ret_body_body_body_body_field_field_name_body_string - }); - ret_body_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_field_size = ret_body_body_body_body - .r#field_size; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_size_body, - ), - ) - }); - ret_body_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseBodySize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(28u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u64::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSectionSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(29u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_body_body), - ) - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSize( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(30u32)); - ret_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name = ret_body_body_body_body - .r#field_name; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_field_field_name_body_bytes = ret_body_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_name_body_bytes.len() - as u32, - ), - ), - ); - ret_body_body_body_body_field_field_name_body_string - .extend( - ret_body_body_body_body_field_field_name_body_bytes, - ); - ret_body_body_body_body_field_field_name_body_string - }); - ret_body_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_body_field_field_size = ret_body_body_body_body - .r#field_size; - ret_body_body_body_body_record - .extend({ - match ret_body_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_field_field_size_body, - ), - ) - }); - ret_body_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTransferCoding( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(31u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_bytes = ret_body_body_body_body_body - .into_bytes(); - ret_body_body_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_body_body_string - .extend(ret_body_body_body_body_body_bytes); - ret_body_body_body_body_body_string - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseContentCoding( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(32u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_bytes = ret_body_body_body_body_body - .into_bytes(); - ret_body_body_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_body_body_string - .extend(ret_body_body_body_body_body_bytes); - ret_body_body_body_body_body_string - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTimeout => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(33u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPUpgradeFailed => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(34u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPProtocolError => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(35u32)); - } - r#wasi::r#http::r#types::ErrorCode::LoopDetected => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(36u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConfigurationError => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(37u32)); - } - r#wasi::r#http::r#types::ErrorCode::InternalError( - ret_body_body_body_body, - ) => { - ret_body_body_body_ret.extend(u32::to_ne_bytes(38u32)); - ret_body_body_body_ret - .extend({ - match ret_body_body_body_body { - ::core::option::Option::Some( - ret_body_body_body_body_body, - ) => { - let mut ret_body_body_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_body_ret - .extend({ - let mut ret_body_body_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_body_body_bytes = ret_body_body_body_body_body - .into_bytes(); - ret_body_body_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_body_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_body_body_string - .extend(ret_body_body_body_body_body_bytes); - ret_body_body_body_body_body_string - }); - ret_body_body_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - } - ret_body_body_body_ret - }); - ret_body_body_ret - } - } - }); - ret_body_ret - } - ::core::result::Result::Err(ret_body_body) => { - let mut ret_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_ret - } - } - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::http-error-code", - move |r#err: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#types( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::Types::r#http_error_code( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(r#err[0..4].try_into().unwrap()); - let Some(v) = rts.resource43[i as usize].borrow() else { - panic!(""); - }; - (v, 4) - } - .0, - ); - Ok({ - match ret { - ::core::option::Option::Some(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::ErrorCode::DNSTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::ErrorCode::DNSError( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_rcode = ret_body_body.r#rcode; - ret_body_body_record - .extend({ - match ret_body_body_field_rcode { - ::core::option::Option::Some( - ret_body_body_field_rcode_body, - ) => { - let mut ret_body_body_field_rcode_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_rcode_ret - .extend({ - let mut ret_body_body_field_rcode_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_rcode_body_bytes = ret_body_body_field_rcode_body - .into_bytes(); - ret_body_body_field_rcode_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_rcode_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_rcode_body_string - .extend(ret_body_body_field_rcode_body_bytes); - ret_body_body_field_rcode_body_string - }); - ret_body_body_field_rcode_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_info_code = ret_body_body - .r#info_code; - ret_body_body_record - .extend({ - match ret_body_body_field_info_code { - ::core::option::Option::Some( - ret_body_body_field_info_code_body, - ) => { - let mut ret_body_body_field_info_code_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_info_code_ret - .extend({ - alloc::vec::Vec::from( - u16::to_ne_bytes(ret_body_body_field_info_code_body), - ) - }); - ret_body_body_field_info_code_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::DestinationNotFound => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationUnavailable => { - ret_body_ret.extend(u32::to_ne_bytes(3u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPProhibited => { - ret_body_ret.extend(u32::to_ne_bytes(4u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPUnroutable => { - ret_body_ret.extend(u32::to_ne_bytes(5u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionRefused => { - ret_body_ret.extend(u32::to_ne_bytes(6u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTerminated => { - ret_body_ret.extend(u32::to_ne_bytes(7u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(8u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionReadTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(9u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionWriteTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(10u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionLimitReached => { - ret_body_ret.extend(u32::to_ne_bytes(11u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSProtocolError => { - ret_body_ret.extend(u32::to_ne_bytes(12u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSCertificateError => { - ret_body_ret.extend(u32::to_ne_bytes(13u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSAlertReceived( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(14u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_alert_id = ret_body_body.r#alert_id; - ret_body_body_record - .extend({ - match ret_body_body_field_alert_id { - ::core::option::Option::Some( - ret_body_body_field_alert_id_body, - ) => { - let mut ret_body_body_field_alert_id_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_alert_id_ret - .extend({ - alloc::vec::Vec::from( - u8::to_ne_bytes(ret_body_body_field_alert_id_body), - ) - }); - ret_body_body_field_alert_id_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_alert_message = ret_body_body - .r#alert_message; - ret_body_body_record - .extend({ - match ret_body_body_field_alert_message { - ::core::option::Option::Some( - ret_body_body_field_alert_message_body, - ) => { - let mut ret_body_body_field_alert_message_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_alert_message_ret - .extend({ - let mut ret_body_body_field_alert_message_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_alert_message_body_bytes = ret_body_body_field_alert_message_body - .into_bytes(); - ret_body_body_field_alert_message_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_alert_message_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_alert_message_body_string - .extend(ret_body_body_field_alert_message_body_bytes); - ret_body_body_field_alert_message_body_string - }); - ret_body_body_field_alert_message_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestDenied => { - ret_body_ret.extend(u32::to_ne_bytes(15u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestLengthRequired => { - ret_body_ret.extend(u32::to_ne_bytes(16u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestBodySize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(17u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestMethodInvalid => { - ret_body_ret.extend(u32::to_ne_bytes(18u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURIInvalid => { - ret_body_ret.extend(u32::to_ne_bytes(19u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURITooLong => { - ret_body_ret.extend(u32::to_ne_bytes(20u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(21u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(22u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_field_field_name = ret_body_body_body - .r#field_name; - ret_body_body_body_record - .extend({ - match ret_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_field_field_name_body_bytes = ret_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_field_field_name_body_string - .extend(ret_body_body_body_field_field_name_body_bytes); - ret_body_body_body_field_field_name_body_string - }); - ret_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_field_field_size = ret_body_body_body - .r#field_size; - ret_body_body_body_record - .extend({ - match ret_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_field_field_size_body), - ) - }); - ret_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_record - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(23u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(24u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseIncomplete => { - ret_body_ret.extend(u32::to_ne_bytes(25u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(26u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(27u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseBodySize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(28u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(29u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(30u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTransferCoding( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(31u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseContentCoding( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(32u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(33u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPUpgradeFailed => { - ret_body_ret.extend(u32::to_ne_bytes(34u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPProtocolError => { - ret_body_ret.extend(u32::to_ne_bytes(35u32)); - } - r#wasi::r#http::r#types::ErrorCode::LoopDetected => { - ret_body_ret.extend(u32::to_ne_bytes(36u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConfigurationError => { - ret_body_ret.extend(u32::to_ne_bytes(37u32)); - } - r#wasi::r#http::r#types::ErrorCode::InternalError( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(38u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - } - ret_body_ret - }); - ret_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - }, - ) - .unwrap(); - let captured_imports = imports.clone(); - let captured_rts = rts.clone(); - sb.register_host_function( - "r#wasi::r#http::handle", - move |r#request: ::std::vec::Vec, r#options: ::std::vec::Vec| { - let mut rts = captured_rts.lock().unwrap(); - let mut slf = captured_imports.lock().unwrap(); - let mut slf = ::std::ops::DerefMut::deref_mut(&mut slf); - let mut slf = r#root::r#component::RootImports::r#outgoing_handler( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - ); - let ret = r#wasi::r#http::OutgoingHandler::r#handle( - ::std::borrow::BorrowMut::::borrow_mut(&mut slf), - { - let i = u32::from_ne_bytes(r#request[0..4].try_into().unwrap()); - let Some(v) = rts.resource19[i as usize].take() else { - panic!(""); - }; - (v, 4) - } - .0, - { - let n = u8::from_ne_bytes(r#options[0..1].try_into().unwrap()); - if n != 0 { - let options_body = &r#options[1..]; - let (x, b) = { - let i = u32::from_ne_bytes( - options_body[0..4].try_into().unwrap(), - ); - let Some(v) = rts.resource17[i as usize].take() else { - panic!(""); - }; - (v, 4) - }; - (::core::option::Option::Some(x), b + 1) - } else { - (::core::option::Option::None, 1) - } - } - .0, - ); - Ok({ - match ret { - ::core::result::Result::Ok(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(0)); - ret_ret - .extend({ - let i = rts.resource6.len(); - rts.resource6 - .push_back( - ::hyperlight_common::resource::ResourceEntry::give(ret_body), - ); - alloc::vec::Vec::from(u32::to_ne_bytes(i as u32)) - }); - ret_ret - } - ::core::result::Result::Err(ret_body) => { - let mut ret_ret = alloc::vec::Vec::from(u8::to_ne_bytes(1)); - ret_ret - .extend({ - let mut ret_body_ret = alloc::vec::Vec::new(); - match ret_body { - r#wasi::r#http::r#types::ErrorCode::DNSTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(0u32)); - } - r#wasi::r#http::r#types::ErrorCode::DNSError( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(1u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_rcode = ret_body_body.r#rcode; - ret_body_body_record - .extend({ - match ret_body_body_field_rcode { - ::core::option::Option::Some( - ret_body_body_field_rcode_body, - ) => { - let mut ret_body_body_field_rcode_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_rcode_ret - .extend({ - let mut ret_body_body_field_rcode_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_rcode_body_bytes = ret_body_body_field_rcode_body - .into_bytes(); - ret_body_body_field_rcode_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_rcode_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_rcode_body_string - .extend(ret_body_body_field_rcode_body_bytes); - ret_body_body_field_rcode_body_string - }); - ret_body_body_field_rcode_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_info_code = ret_body_body - .r#info_code; - ret_body_body_record - .extend({ - match ret_body_body_field_info_code { - ::core::option::Option::Some( - ret_body_body_field_info_code_body, - ) => { - let mut ret_body_body_field_info_code_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_info_code_ret - .extend({ - alloc::vec::Vec::from( - u16::to_ne_bytes(ret_body_body_field_info_code_body), - ) - }); - ret_body_body_field_info_code_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::DestinationNotFound => { - ret_body_ret.extend(u32::to_ne_bytes(2u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationUnavailable => { - ret_body_ret.extend(u32::to_ne_bytes(3u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPProhibited => { - ret_body_ret.extend(u32::to_ne_bytes(4u32)); - } - r#wasi::r#http::r#types::ErrorCode::DestinationIPUnroutable => { - ret_body_ret.extend(u32::to_ne_bytes(5u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionRefused => { - ret_body_ret.extend(u32::to_ne_bytes(6u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTerminated => { - ret_body_ret.extend(u32::to_ne_bytes(7u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(8u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionReadTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(9u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionWriteTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(10u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConnectionLimitReached => { - ret_body_ret.extend(u32::to_ne_bytes(11u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSProtocolError => { - ret_body_ret.extend(u32::to_ne_bytes(12u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSCertificateError => { - ret_body_ret.extend(u32::to_ne_bytes(13u32)); - } - r#wasi::r#http::r#types::ErrorCode::TLSAlertReceived( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(14u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_alert_id = ret_body_body.r#alert_id; - ret_body_body_record - .extend({ - match ret_body_body_field_alert_id { - ::core::option::Option::Some( - ret_body_body_field_alert_id_body, - ) => { - let mut ret_body_body_field_alert_id_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_alert_id_ret - .extend({ - alloc::vec::Vec::from( - u8::to_ne_bytes(ret_body_body_field_alert_id_body), - ) - }); - ret_body_body_field_alert_id_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_alert_message = ret_body_body - .r#alert_message; - ret_body_body_record - .extend({ - match ret_body_body_field_alert_message { - ::core::option::Option::Some( - ret_body_body_field_alert_message_body, - ) => { - let mut ret_body_body_field_alert_message_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_alert_message_ret - .extend({ - let mut ret_body_body_field_alert_message_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_alert_message_body_bytes = ret_body_body_field_alert_message_body - .into_bytes(); - ret_body_body_field_alert_message_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_alert_message_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_alert_message_body_string - .extend(ret_body_body_field_alert_message_body_bytes); - ret_body_body_field_alert_message_body_string - }); - ret_body_body_field_alert_message_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestDenied => { - ret_body_ret.extend(u32::to_ne_bytes(15u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestLengthRequired => { - ret_body_ret.extend(u32::to_ne_bytes(16u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestBodySize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(17u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestMethodInvalid => { - ret_body_ret.extend(u32::to_ne_bytes(18u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURIInvalid => { - ret_body_ret.extend(u32::to_ne_bytes(19u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestURITooLong => { - ret_body_ret.extend(u32::to_ne_bytes(20u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(21u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestHeaderSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(22u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_body_field_field_name = ret_body_body_body - .r#field_name; - ret_body_body_body_record - .extend({ - match ret_body_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_body_field_field_name_body, - ) => { - let mut ret_body_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_field_field_name_body_bytes = ret_body_body_body_field_field_name_body - .into_bytes(); - ret_body_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_body_field_field_name_body_string - .extend(ret_body_body_body_field_field_name_body_bytes); - ret_body_body_body_field_field_name_body_string - }); - ret_body_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_body_field_field_size = ret_body_body_body - .r#field_size; - ret_body_body_body_record - .extend({ - match ret_body_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_body_field_field_size_body, - ) => { - let mut ret_body_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_field_field_size_body), - ) - }); - ret_body_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_body_record - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(23u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPRequestTrailerSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(24u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseIncomplete => { - ret_body_ret.extend(u32::to_ne_bytes(25u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(26u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseHeaderSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(27u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseBodySize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(28u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u64::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSectionSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(29u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - alloc::vec::Vec::from(u32::to_ne_bytes(ret_body_body_body)) - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTrailerSize( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(30u32)); - ret_body_ret - .extend({ - let mut ret_body_body_record = alloc::vec::Vec::new(); - let ret_body_body_field_field_name = ret_body_body - .r#field_name; - ret_body_body_record - .extend({ - match ret_body_body_field_field_name { - ::core::option::Option::Some( - ret_body_body_field_field_name_body, - ) => { - let mut ret_body_body_field_field_name_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_name_ret - .extend({ - let mut ret_body_body_field_field_name_body_string = alloc::vec::Vec::new(); - let ret_body_body_field_field_name_body_bytes = ret_body_body_field_field_name_body - .into_bytes(); - ret_body_body_field_field_name_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes( - ret_body_body_field_field_name_body_bytes.len() as u32, - ), - ), - ); - ret_body_body_field_field_name_body_string - .extend(ret_body_body_field_field_name_body_bytes); - ret_body_body_field_field_name_body_string - }); - ret_body_body_field_field_name_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - let ret_body_body_field_field_size = ret_body_body - .r#field_size; - ret_body_body_record - .extend({ - match ret_body_body_field_field_size { - ::core::option::Option::Some( - ret_body_body_field_field_size_body, - ) => { - let mut ret_body_body_field_field_size_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_field_field_size_ret - .extend({ - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_field_field_size_body), - ) - }); - ret_body_body_field_field_size_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }); - ret_body_body_record - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTransferCoding( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(31u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseContentCoding( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(32u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - r#wasi::r#http::r#types::ErrorCode::HTTPResponseTimeout => { - ret_body_ret.extend(u32::to_ne_bytes(33u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPUpgradeFailed => { - ret_body_ret.extend(u32::to_ne_bytes(34u32)); - } - r#wasi::r#http::r#types::ErrorCode::HTTPProtocolError => { - ret_body_ret.extend(u32::to_ne_bytes(35u32)); - } - r#wasi::r#http::r#types::ErrorCode::LoopDetected => { - ret_body_ret.extend(u32::to_ne_bytes(36u32)); - } - r#wasi::r#http::r#types::ErrorCode::ConfigurationError => { - ret_body_ret.extend(u32::to_ne_bytes(37u32)); - } - r#wasi::r#http::r#types::ErrorCode::InternalError( - ret_body_body, - ) => { - ret_body_ret.extend(u32::to_ne_bytes(38u32)); - ret_body_ret - .extend({ - match ret_body_body { - ::core::option::Option::Some(ret_body_body_body) => { - let mut ret_body_body_ret = alloc::vec::Vec::from( - u8::to_ne_bytes(1), - ); - ret_body_body_ret - .extend({ - let mut ret_body_body_body_string = alloc::vec::Vec::new(); - let ret_body_body_body_bytes = ret_body_body_body - .into_bytes(); - ret_body_body_body_string - .extend( - alloc::vec::Vec::from( - u32::to_ne_bytes(ret_body_body_body_bytes.len() as u32), - ), - ); - ret_body_body_body_string.extend(ret_body_body_body_bytes); - ret_body_body_body_string - }); - ret_body_body_ret - } - ::core::option::Option::None => { - alloc::vec::Vec::from(u8::to_ne_bytes(0)) - } - } - }) - } - } - ret_body_ret - }); - ret_ret - } - } - }) - }, - ) - .unwrap(); - rts -} -impl< - I: r#root::r#component::RootImports + ::std::marker::Send, - S: ::hyperlight_host::sandbox::Callable, -> r#root::r#component::RootExports for RootSandbox { - type IncomingHandler = Self; - #[allow(refining_impl_trait)] - fn r#incoming_handler<'a>(&'a mut self) -> &'a mut Self { - self - } -} -impl r#root::r#component::Root for ::hyperlight_host::sandbox::UninitializedSandbox { - type Exports = RootSandbox< - I, - ::hyperlight_host::sandbox::initialized_multi_use::MultiUseSandbox, - >; - fn instantiate( - mut self, - i: I, - ) -> Self::Exports { - let rts = register_host_functions(&mut self, i); - let sb = self.evolve().unwrap(); - RootSandbox { sb, rt: rts } - } -} diff --git a/src/main.rs b/src/main.rs index 8f25a1d..f15543e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,28 +1,24 @@ extern crate alloc; -mod bindings { - hyperlight_component_macro::host_bindgen!(); -} +mod wasi_impl; -mod resource; -mod types; -mod worker; +use wasi_impl::{ + Resource, + bindings::{RootSandbox, register_host_functions, wasi, wasi::http::IncomingHandler}, + types, + types::{WasiImpl, http_incoming_body::IncomingBody, io_stream::Stream}, + worker::RUNTIME, +}; use std::{convert::Infallible, net::SocketAddr, str::FromStr, sync::Arc}; -use bindings::RootSandbox; use bytes::Bytes; use http_body_util::{BodyExt, Full}; use hyper::{server::conn::http1, service::service_fn}; use hyper_util::rt::TokioIo; use hyperlight_host::sandbox::SandboxConfiguration; use hyperlight_wasm::LoadedWasmSandbox; -use resource::Resource; use tokio::{net::TcpListener, sync::Mutex}; -use types::{WasiImpl, http_incoming_body::IncomingBody, io_stream::Stream}; -use worker::RUNTIME; - -use crate::bindings::wasi::http::IncomingHandler; fn main() { let args = std::env::args().collect::>(); @@ -46,13 +42,13 @@ fn main() { let mut sb = builder.build().unwrap(); - let state = types::WasiImpl::new(); - let rt = bindings::register_host_functions(&mut sb, state); + let state = WasiImpl::new(); + let rt = register_host_functions(&mut sb, state); let sb = sb.load_runtime().unwrap(); let sb = sb.load_module(wasm_path).unwrap(); - let sb = bindings::RootSandbox { sb, rt }; + let sb = RootSandbox { sb, rt }; let sb = Arc::new(Mutex::new(sb)); RUNTIME.block_on(async move { @@ -92,7 +88,7 @@ async fn hello( mut req: hyper::Request, ) -> Result>, Infallible> { let mut sb = sb.lock().await; - let inst = bindings::root::component::RootExports::incoming_handler(&mut *sb); + let inst = wasi_impl::bindings::root::component::RootExports::incoming_handler(&mut *sb); let body = req.body_mut(); let mut full_body = Vec::new(); @@ -124,9 +120,9 @@ async fn hello( .unwrap_or_default(), ), scheme: Some(if req.uri().scheme_str() == Some("https") { - bindings::wasi::http::types::Scheme::HTTPS + wasi_impl::bindings::wasi::http::types::Scheme::HTTPS } else { - bindings::wasi::http::types::Scheme::HTTP + wasi_impl::bindings::wasi::http::types::Scheme::HTTP }), authority: req .uri() @@ -188,19 +184,19 @@ async fn hello( } } -impl From<&hyper::Method> for bindings::wasi::http::types::Method { +impl From<&hyper::Method> for wasi::http::types::Method { fn from(method: &hyper::Method) -> Self { match method.as_str() { - "GET" => bindings::wasi::http::types::Method::Get, - "POST" => bindings::wasi::http::types::Method::Post, - "PUT" => bindings::wasi::http::types::Method::Put, - "DELETE" => bindings::wasi::http::types::Method::Delete, - "HEAD" => bindings::wasi::http::types::Method::Head, - "OPTIONS" => bindings::wasi::http::types::Method::Options, - "CONNECT" => bindings::wasi::http::types::Method::Connect, - "TRACE" => bindings::wasi::http::types::Method::Trace, - "PATCH" => bindings::wasi::http::types::Method::Patch, - other => bindings::wasi::http::types::Method::Other(other.to_string()), + "GET" => wasi_impl::bindings::wasi::http::types::Method::Get, + "POST" => wasi_impl::bindings::wasi::http::types::Method::Post, + "PUT" => wasi_impl::bindings::wasi::http::types::Method::Put, + "DELETE" => wasi_impl::bindings::wasi::http::types::Method::Delete, + "HEAD" => wasi_impl::bindings::wasi::http::types::Method::Head, + "OPTIONS" => wasi_impl::bindings::wasi::http::types::Method::Options, + "CONNECT" => wasi_impl::bindings::wasi::http::types::Method::Connect, + "TRACE" => wasi_impl::bindings::wasi::http::types::Method::Trace, + "PATCH" => wasi_impl::bindings::wasi::http::types::Method::Patch, + other => wasi_impl::bindings::wasi::http::types::Method::Other(other.to_string()), } } } diff --git a/src/wasi_impl/mod.rs b/src/wasi_impl/mod.rs new file mode 100644 index 0000000..f1218c9 --- /dev/null +++ b/src/wasi_impl/mod.rs @@ -0,0 +1,11 @@ +extern crate alloc; + +pub mod bindings { + hyperlight_component_macro::host_bindgen!(); +} + +pub mod resource; +pub mod types; +pub mod worker; + +pub use resource::Resource; diff --git a/src/resource.rs b/src/wasi_impl/resource.rs similarity index 98% rename from src/resource.rs rename to src/wasi_impl/resource.rs index cab55c7..cc2c4b7 100644 --- a/src/resource.rs +++ b/src/wasi_impl/resource.rs @@ -4,7 +4,7 @@ use std::{ sync::Arc, }; -use crate::{types::io_poll::AnyPollable, worker::RUNTIME}; +use crate::wasi_impl::{types::io_poll::AnyPollable, worker::RUNTIME}; pub struct Resource { inner: Arc>, diff --git a/src/types.rs b/src/wasi_impl/types.rs similarity index 97% rename from src/types.rs rename to src/wasi_impl/types.rs index 4f6aed8..4bdeb4d 100644 --- a/src/types.rs +++ b/src/wasi_impl/types.rs @@ -1,6 +1,6 @@ use std::borrow::BorrowMut; -use crate::bindings::root::component::RootImports; +use crate::wasi_impl::bindings::root::component::RootImports; pub mod buffer; pub mod cli; diff --git a/src/types/buffer.rs b/src/wasi_impl/types/buffer.rs similarity index 100% rename from src/types/buffer.rs rename to src/wasi_impl/types/buffer.rs diff --git a/src/types/cli.rs b/src/wasi_impl/types/cli.rs similarity index 97% rename from src/types/cli.rs rename to src/wasi_impl/types/cli.rs index d36d0ce..09465cd 100644 --- a/src/types/cli.rs +++ b/src/wasi_impl/types/cli.rs @@ -2,7 +2,7 @@ use std::sync::LazyLock; use tokio::io::{AsyncReadExt as _, AsyncWriteExt as _, stderr, stdin, stdout}; -use crate::{bindings::wasi, resource::Resource, worker::RUNTIME}; +use crate::wasi_impl::{bindings::wasi, resource::Resource, worker::RUNTIME}; use super::{WasiImpl, io_stream::Stream}; diff --git a/src/types/clocks_monotonic_clock.rs b/src/wasi_impl/types/clocks_monotonic_clock.rs similarity index 93% rename from src/types/clocks_monotonic_clock.rs rename to src/wasi_impl/types/clocks_monotonic_clock.rs index d4e70c3..39b9b08 100644 --- a/src/types/clocks_monotonic_clock.rs +++ b/src/wasi_impl/types/clocks_monotonic_clock.rs @@ -1,6 +1,6 @@ use std::{sync::LazyLock, time::Duration}; -use crate::{bindings::wasi, resource::Resource}; +use crate::wasi_impl::{bindings::wasi, resource::Resource}; use super::{WasiImpl, io_poll::AnyPollable}; diff --git a/src/types/clocks_wall_clock.rs b/src/wasi_impl/types/clocks_wall_clock.rs similarity index 93% rename from src/types/clocks_wall_clock.rs rename to src/wasi_impl/types/clocks_wall_clock.rs index 5edd602..98fafde 100644 --- a/src/types/clocks_wall_clock.rs +++ b/src/wasi_impl/types/clocks_wall_clock.rs @@ -1,5 +1,5 @@ use super::WasiImpl; -use crate::bindings::wasi; +use crate::wasi_impl::bindings::wasi; impl wasi::clocks::WallClock for WasiImpl { fn now(&mut self) -> wasi::clocks::wall_clock::Datetime { diff --git a/src/types/headers.rs b/src/wasi_impl/types/headers.rs similarity index 100% rename from src/types/headers.rs rename to src/wasi_impl/types/headers.rs diff --git a/src/types/http_future.rs b/src/wasi_impl/types/http_future.rs similarity index 100% rename from src/types/http_future.rs rename to src/wasi_impl/types/http_future.rs diff --git a/src/types/http_future_headers.rs b/src/wasi_impl/types/http_future_headers.rs similarity index 97% rename from src/types/http_future_headers.rs rename to src/wasi_impl/types/http_future_headers.rs index 21fcac4..fd69759 100644 --- a/src/types/http_future_headers.rs +++ b/src/wasi_impl/types/http_future_headers.rs @@ -1,6 +1,6 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn, Resource}, }; diff --git a/src/types/http_future_incoming_response.rs b/src/wasi_impl/types/http_future_incoming_response.rs similarity index 97% rename from src/types/http_future_incoming_response.rs rename to src/wasi_impl/types/http_future_incoming_response.rs index f6174a1..8dcc434 100644 --- a/src/types/http_future_incoming_response.rs +++ b/src/wasi_impl/types/http_future_incoming_response.rs @@ -1,6 +1,6 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn as _, Resource}, }; diff --git a/src/types/http_headers.rs b/src/wasi_impl/types/http_headers.rs similarity index 98% rename from src/types/http_headers.rs rename to src/wasi_impl/types/http_headers.rs index 7859371..5e1b91a 100644 --- a/src/types/http_headers.rs +++ b/src/wasi_impl/types/http_headers.rs @@ -4,7 +4,7 @@ use super::{ WasiImpl, headers::{HeaderError, Headers}, }; -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn, Resource}, }; diff --git a/src/types/http_incoming_body.rs b/src/wasi_impl/types/http_incoming_body.rs similarity index 97% rename from src/types/http_incoming_body.rs rename to src/wasi_impl/types/http_incoming_body.rs index ad5d93b..09e7dc7 100644 --- a/src/types/http_incoming_body.rs +++ b/src/wasi_impl/types/http_incoming_body.rs @@ -1,4 +1,4 @@ -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn, Resource}, }; diff --git a/src/types/http_incoming_request.rs b/src/wasi_impl/types/http_incoming_request.rs similarity index 98% rename from src/types/http_incoming_request.rs rename to src/wasi_impl/types/http_incoming_request.rs index eb2070f..a887782 100644 --- a/src/types/http_incoming_request.rs +++ b/src/wasi_impl/types/http_incoming_request.rs @@ -1,4 +1,4 @@ -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn as _, Resource}, }; diff --git a/src/types/http_incoming_response.rs b/src/wasi_impl/types/http_incoming_response.rs similarity index 97% rename from src/types/http_incoming_response.rs rename to src/wasi_impl/types/http_incoming_response.rs index 3df1c09..3b1b404 100644 --- a/src/types/http_incoming_response.rs +++ b/src/wasi_impl/types/http_incoming_response.rs @@ -1,6 +1,6 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn, Resource}, }; diff --git a/src/types/http_outgoing_body.rs b/src/wasi_impl/types/http_outgoing_body.rs similarity index 98% rename from src/types/http_outgoing_body.rs rename to src/wasi_impl/types/http_outgoing_body.rs index 58b574e..c0a688a 100644 --- a/src/types/http_outgoing_body.rs +++ b/src/wasi_impl/types/http_outgoing_body.rs @@ -1,6 +1,6 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn as _, Resource}, }; diff --git a/src/types/http_outgoing_handler.rs b/src/wasi_impl/types/http_outgoing_handler.rs similarity index 98% rename from src/types/http_outgoing_handler.rs rename to src/wasi_impl/types/http_outgoing_handler.rs index faad04d..ba2a3b1 100644 --- a/src/types/http_outgoing_handler.rs +++ b/src/wasi_impl/types/http_outgoing_handler.rs @@ -1,5 +1,5 @@ -use crate::bindings::wasi::{self}; -use crate::resource::{BlockOn, Resource}; +use crate::wasi_impl::bindings::wasi; +use crate::wasi_impl::resource::{BlockOn, Resource}; use wasi::http::types::ErrorCode; diff --git a/src/types/http_outgoing_request.rs b/src/wasi_impl/types/http_outgoing_request.rs similarity index 99% rename from src/types/http_outgoing_request.rs rename to src/wasi_impl/types/http_outgoing_request.rs index a90e226..84bf8c3 100644 --- a/src/types/http_outgoing_request.rs +++ b/src/wasi_impl/types/http_outgoing_request.rs @@ -1,6 +1,6 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn as _, Resource}, }; diff --git a/src/types/http_outgoing_response.rs b/src/wasi_impl/types/http_outgoing_response.rs similarity index 98% rename from src/types/http_outgoing_response.rs rename to src/wasi_impl/types/http_outgoing_response.rs index 64784b0..d71e953 100644 --- a/src/types/http_outgoing_response.rs +++ b/src/wasi_impl/types/http_outgoing_response.rs @@ -1,6 +1,6 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn, Resource}, }; diff --git a/src/types/http_request_options.rs b/src/wasi_impl/types/http_request_options.rs similarity index 98% rename from src/types/http_request_options.rs rename to src/wasi_impl/types/http_request_options.rs index 2118907..375d91f 100644 --- a/src/types/http_request_options.rs +++ b/src/wasi_impl/types/http_request_options.rs @@ -4,7 +4,7 @@ use hyperlight_common::resource::BorrowedResourceGuard; use super::WasiImpl; -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn, Resource}, }; diff --git a/src/types/http_response_outparam.rs b/src/wasi_impl/types/http_response_outparam.rs similarity index 96% rename from src/types/http_response_outparam.rs rename to src/wasi_impl/types/http_response_outparam.rs index 287688e..cc34e47 100644 --- a/src/types/http_response_outparam.rs +++ b/src/wasi_impl/types/http_response_outparam.rs @@ -1,4 +1,4 @@ -use crate::{ +use crate::wasi_impl::{ bindings::wasi, resource::{BlockOn as _, Resource}, }; diff --git a/src/types/io_error.rs b/src/wasi_impl/types/io_error.rs similarity index 78% rename from src/types/io_error.rs rename to src/wasi_impl/types/io_error.rs index 3e29318..ca6d059 100644 --- a/src/types/io_error.rs +++ b/src/wasi_impl/types/io_error.rs @@ -1,8 +1,8 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::types::WasiImpl; +use crate::wasi_impl::types::WasiImpl; -use crate::bindings::wasi; +use crate::wasi_impl::bindings::wasi; impl wasi::io::error::Error for WasiImpl { type T = anyhow::Error; diff --git a/src/types/io_poll.rs b/src/wasi_impl/types/io_poll.rs similarity index 99% rename from src/types/io_poll.rs rename to src/wasi_impl/types/io_poll.rs index 5cd0b1b..6e2d06d 100644 --- a/src/types/io_poll.rs +++ b/src/wasi_impl/types/io_poll.rs @@ -6,7 +6,7 @@ use std::{ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{ +use crate::wasi_impl::{ bindings::wasi::{self}, resource::{BlockOn, Resource}, }; diff --git a/src/types/io_stream.rs b/src/wasi_impl/types/io_stream.rs similarity index 99% rename from src/types/io_stream.rs rename to src/wasi_impl/types/io_stream.rs index dae84d9..7c2dff5 100644 --- a/src/types/io_stream.rs +++ b/src/wasi_impl/types/io_stream.rs @@ -1,6 +1,6 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{ +use crate::wasi_impl::{ bindings::wasi::{self, io::streams::StreamError}, resource::{BlockOn, Resource}, }; diff --git a/src/types/random.rs b/src/wasi_impl/types/random.rs similarity index 89% rename from src/types/random.rs rename to src/wasi_impl/types/random.rs index f334807..f1a7ad0 100644 --- a/src/types/random.rs +++ b/src/wasi_impl/types/random.rs @@ -1,4 +1,4 @@ -use crate::bindings::wasi; +use crate::wasi_impl::bindings::wasi; use super::WasiImpl; diff --git a/src/types/types.rs b/src/wasi_impl/types/types.rs similarity index 89% rename from src/types/types.rs rename to src/wasi_impl/types/types.rs index 188de7e..da54018 100644 --- a/src/types/types.rs +++ b/src/wasi_impl/types/types.rs @@ -1,6 +1,6 @@ use hyperlight_common::resource::BorrowedResourceGuard; -use crate::{bindings::wasi, resource::Resource}; +use crate::wasi_impl::{bindings::wasi, resource::Resource}; use super::{WasiImpl, io_poll::AnyPollable, io_stream::Stream}; diff --git a/src/worker.rs b/src/wasi_impl/worker.rs similarity index 100% rename from src/worker.rs rename to src/wasi_impl/worker.rs From f7c4dbca9d21aa056fd3481bdf9cdf044182c2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doru=20Bl=C3=A2nzeanu?= Date: Tue, 17 Mar 2026 21:18:01 +0200 Subject: [PATCH 09/10] Update hyperlight version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Doru Blânzeanu --- Cargo.lock | 351 ++++++++++++++++++++++++++-------------------------- Cargo.toml | 20 +-- README.md | 2 +- justfile | 2 +- src/main.rs | 11 +- 5 files changed, 188 insertions(+), 198 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1a7a0db..6adc5ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,7 +17,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.8.42", + "zerocopy", ] [[package]] @@ -244,18 +244,31 @@ version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - [[package]] name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +[[package]] +name = "cargo-hyperlight" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f745c885e25dbf258ac37804773e60fbb7fce9b46c1db020760131d3faffe35c" +dependencies = [ + "anyhow", + "console", + "const_format", + "glob", + "libc", + "os_str_bytes", + "regex", + "semver", + "serde", + "serde_json", + "which", +] + [[package]] name = "cc" version = "1.2.57" @@ -290,7 +303,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -317,6 +330,38 @@ version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" +[[package]] +name = "console" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width", + "windows-sys 0.61.2", +] + +[[package]] +name = "const_format" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "constant_time_eq" version = "0.4.2" @@ -449,11 +494,17 @@ dependencies = [ "libc", "nix", "smallvec", - "thiserror 2.0.18", + "thiserror", "tracing", - "zerocopy 0.8.42", + "zerocopy", ] +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + [[package]] name = "encoding_rs" version = "0.8.35" @@ -705,6 +756,12 @@ dependencies = [ "url", ] +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + [[package]] name = "globset" version = "0.4.18" @@ -905,22 +962,23 @@ dependencies = [ [[package]] name = "hyperlight-common" -version = "0.9.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f54e238983959d8b6df4c3ba649eb0419525ce70c640a81bd187b5c9ee6370" +checksum = "98f80e9aba9fce2a899c9ff0c62dd39cd479fa2f22ef578faed1d510c5becf94" dependencies = [ "anyhow", "flatbuffers", "log", "spin", + "thiserror", "tracing", ] [[package]] name = "hyperlight-component-macro" -version = "0.9.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7503ed5b290f80e869876fcf2f48846432b954c285caace4cddb1edcbafea216" +checksum = "f217d5bbb0d02c9aac81374c3161af2a3a46a5379a604b0799534762a534d75a" dependencies = [ "env_logger", "hyperlight-component-util", @@ -929,14 +987,14 @@ dependencies = [ "proc-macro2", "quote", "syn", - "wasmparser 0.238.1", + "wasmparser 0.243.0", ] [[package]] name = "hyperlight-component-util" -version = "0.9.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c57729c707663f0973658cc96fc34bc7e32b9ceea4c36a1964a306601df69b95" +checksum = "b9b3299460dc5f39d37b8233c9aad7fc52c9548d96a76d35cdcc4f4f49ff6662" dependencies = [ "itertools", "log", @@ -944,14 +1002,14 @@ dependencies = [ "proc-macro2", "quote", "syn", - "wasmparser 0.238.1", + "wasmparser 0.243.0", ] [[package]] name = "hyperlight-host" -version = "0.9.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b93b8262196a19ddf6d43484b94e890e828aac0b99b0b2e55649da6e8df6a1" +checksum = "0f81d712e88785e8860be6b33048fc2c9ad6637864aa50fe95d0037cfa50a4fb" dependencies = [ "anyhow", "bitflags 2.11.0", @@ -969,41 +1027,43 @@ dependencies = [ "libc", "log", "metrics", - "mshv-bindings 0.2.1", - "mshv-bindings 0.3.2", - "mshv-ioctls 0.2.1", - "mshv-ioctls 0.3.2", + "mshv-bindings", + "mshv-ioctls", "page_size", "rand", "rust-embed", "serde_json", "sha256", "termcolor", - "thiserror 2.0.18", + "thiserror", "tracing", "tracing-core", "tracing-log", "uuid", "vmm-sys-util", "windows", - "windows-result 0.3.4", - "windows-sys 0.60.2", + "windows-result", + "windows-sys 0.61.2", "windows-version", ] [[package]] name = "hyperlight-wasm" -version = "0.9.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c0b51415ca0f861ccc14b81bc1bf6e1e821ff573b23828619316e6dc06522a" +checksum = "9f2e95638da8eeab5f884f61609dfadbc41babd1611c3222ac61c2c8fc3cf911" dependencies = [ "anyhow", "blake3", "built", + "cargo-hyperlight", "cfg-if", + "cfg_aliases", "chrono", + "env_logger", "goblin", "hyperlight-host", + "junction", "libc", "log", "metrics", @@ -1028,6 +1088,7 @@ dependencies = [ "hyperlight-component-macro", "hyperlight-host", "hyperlight-wasm", + "once_cell", "reqwest", "tokio", ] @@ -1044,7 +1105,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core", ] [[package]] @@ -1257,6 +1318,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "junction" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfc352a66ba903c23239ef51e809508b6fc2b0f90e3476ac7a9ff47e863ae95" +dependencies = [ + "scopeguard", + "windows-sys 0.61.2", +] + [[package]] name = "kvm-bindings" version = "0.14.0" @@ -1410,49 +1481,25 @@ dependencies = [ [[package]] name = "mshv-bindings" -version = "0.2.1" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f416b4432174e5a3f956a7887f4c1a4acea9511d81def67fcb8473293630ab9e" +checksum = "3cbfd4f32d185152003679339751839da77c17e18fa8882a11051a236f841426" dependencies = [ "libc", "num_enum", "vmm-sys-util", - "zerocopy 0.7.35", -] - -[[package]] -name = "mshv-bindings" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0cb5031f3243a7459b7c13d960d25420980874eebda816db24ce6077e21d43" -dependencies = [ - "libc", - "num_enum", - "vmm-sys-util", - "zerocopy 0.8.42", -] - -[[package]] -name = "mshv-ioctls" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d57586da719aacc905042eea71ff2efb52d16c7228a94af155c9ea45fe09c1c7" -dependencies = [ - "libc", - "mshv-bindings 0.2.1", - "thiserror 1.0.69", - "vmm-sys-util", + "zerocopy", ] [[package]] name = "mshv-ioctls" -version = "0.3.2" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89abe853221fa6f14ad4066affb9abda241a03d65622887d5794e1422d0bd75a" +checksum = "f035616abe1e4cbc026a1a8094ff8d3900f5063fe6608309098bc745926fdfd8" dependencies = [ "libc", - "mshv-bindings 0.3.2", - "thiserror 2.0.18", + "mshv-bindings", + "thiserror", "vmm-sys-util", ] @@ -1577,6 +1624,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "os_str_bytes" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63eceb7b5d757011a87d08eb2123db15d87fb0c281f65d101ce30a1e96c3ad5c" +dependencies = [ + "memchr", +] + [[package]] name = "page_size" version = "0.6.0" @@ -1607,7 +1663,7 @@ dependencies = [ "libc", "redox_syscall 0.5.18", "smallvec", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -1670,7 +1726,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.42", + "zerocopy", ] [[package]] @@ -1706,7 +1762,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.18", + "thiserror", "tokio", "tracing", "web-time", @@ -1727,7 +1783,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.18", + "thiserror", "tinyvec", "tracing", "web-time", @@ -1823,7 +1879,7 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.17", "libredox", - "thiserror 2.0.18", + "thiserror", ] [[package]] @@ -2100,6 +2156,10 @@ name = "semver" version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +dependencies = [ + "serde", + "serde_core", +] [[package]] name = "serde" @@ -2339,33 +2399,13 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.18", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "thiserror-impl", ] [[package]] @@ -2577,6 +2617,12 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + [[package]] name = "unicode-xid" version = "0.2.6" @@ -2791,9 +2837,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.238.1" +version = "0.243.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fa99c8328024423875ae4a55345cfde8f0371327fb2d0f33b0f52a06fc44408" +checksum = "f6d8db401b0528ec316dfbe579e6ab4152d61739cfe076706d2009127970159d" dependencies = [ "bitflags 2.11.0", "hashbrown 0.15.5", @@ -2843,6 +2889,16 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "which" +version = "8.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81995fafaaaf6ae47a7d0cc83c67caf92aeb7e5331650ae6ff856f7c0c60c459" +dependencies = [ + "libc", + "regex", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2876,37 +2932,23 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.61.3" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" dependencies = [ "windows-collections", - "windows-core 0.61.2", + "windows-core", "windows-future", - "windows-link 0.1.3", "windows-numerics", ] [[package]] name = "windows-collections" -version = "0.2.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" dependencies = [ - "windows-core 0.61.2", -] - -[[package]] -name = "windows-core" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", + "windows-core", ] [[package]] @@ -2917,19 +2959,19 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] name = "windows-future" -version = "0.2.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", + "windows-core", + "windows-link", "windows-threading", ] @@ -2955,12 +2997,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.1" @@ -2969,12 +3005,12 @@ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-numerics" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", + "windows-core", + "windows-link", ] [[package]] @@ -2983,18 +3019,9 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link 0.1.3", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] @@ -3003,16 +3030,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -3021,7 +3039,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -3048,7 +3066,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -3073,7 +3091,7 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.2.1", + "windows-link", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", @@ -3086,11 +3104,11 @@ dependencies = [ [[package]] name = "windows-threading" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -3099,7 +3117,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -3325,34 +3343,13 @@ dependencies = [ "synstructure", ] -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive 0.7.35", -] - [[package]] name = "zerocopy" version = "0.8.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2578b716f8a7a858b7f02d5bd870c14bf4ddbbcf3a4c05414ba6503640505e3" dependencies = [ - "zerocopy-derive 0.8.42", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "zerocopy-derive", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 81382a0..8774589 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,16 +3,16 @@ name = "hyperlight-wasm-http-example" edition = "2024" [dependencies] -hyperlight-component-macro = { version = "0.9.0" } -hyperlight-common = { version = "0.9.0" } -hyperlight-host = { version = "0.9.0", default-features = false, features = [ "kvm", "mshv2" ] } -hyperlight-wasm = { version = "0.9.0" } - -hyper = "1.7" -reqwest = { version = "0.12", features = ["stream", "gzip", "brotli", "deflate", "rustls-tls", "blocking"] } -bytes = "1" -tokio = { version = "1.47", features = ["full"] } anyhow = "1.0" +bytes = "1" +getrandom = "0.3.3" http-body-util = "0.1" +hyper = "1.7" hyper-util = { version = "0.1", features = ["full"] } -getrandom = "0.3.3" +hyperlight-component-macro = { version = "0.12.0" } +hyperlight-common = { version = "0.12.0" } +hyperlight-host = { version = "0.12.0", default-features = false, features = [ "kvm", "mshv3" ] } +hyperlight-wasm = { version = "0.12.0" } +once_cell = "1.21.3" +reqwest = { version = "0.12", features = ["stream", "gzip", "brotli", "deflate", "rustls-tls", "blocking"] } +tokio = { version = "1.47", features = ["full"] } diff --git a/README.md b/README.md index 1ad39fa..8478d7c 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ cargo run -- out/sample_wasi_http_rust.aot JS: ```sh -cargo run -- out/sample_wasi_http_js.aot +cargo run -- out/sample-wasi-http-js.aot ``` ## Try it yourself! diff --git a/justfile b/justfile index f15436b..5d39a01 100644 --- a/justfile +++ b/justfile @@ -12,7 +12,7 @@ install-hyperlight-wasm-aot: test -f {{ BIN_DIR }}/hyperlight-wasm-aot || \ cargo install hyperlight-wasm-aot \ --locked \ - --version 0.9.0 \ + --version 0.12.0 \ --root {{ TARGET_DIR }} build-js-component: make-out-dir install-hyperlight-wasm-aot diff --git a/src/main.rs b/src/main.rs index f15543e..abc991c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,6 @@ use bytes::Bytes; use http_body_util::{BodyExt, Full}; use hyper::{server::conn::http1, service::service_fn}; use hyper_util::rt::TokioIo; -use hyperlight_host::sandbox::SandboxConfiguration; use hyperlight_wasm::LoadedWasmSandbox; use tokio::{net::TcpListener, sync::Mutex}; @@ -31,14 +30,8 @@ fn main() { let builder = hyperlight_wasm::SandboxBuilder::new() .with_guest_heap_size(30 * 1024 * 1024) - .with_guest_stack_size(1 * 1024 * 1024); - - // hyperlight wasm currently doesn't expose a way to set the host - // function definition size, so we do it manually here with a - // horrible hack to get a mutable reference to the config - let config = builder.get_config() as *const _ as *mut SandboxConfiguration; - let config = unsafe { config.as_mut().unwrap() }; - config.set_host_function_definition_size(20 * 1024); + .with_guest_stack_size(1 * 1024 * 1024) + .with_function_definition_size(20 * 1024); let mut sb = builder.build().unwrap(); From bd9164f1b26ece7e1a13051268d1ea1085195c79 Mon Sep 17 00:00:00 2001 From: ralph squillace Date: Thu, 9 Apr 2026 12:16:48 +0200 Subject: [PATCH 10/10] moving to 0.14.0; update glibc/wasm-tools --- .devcontainer/Dockerfile | 1 + Cargo.lock | 929 +++++++++++++++++++++++++++++++++++---- Cargo.toml | 8 +- justfile | 2 +- src/main.rs | 3 +- 5 files changed, 843 insertions(+), 100 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8ede957..cb17bfd 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -17,6 +17,7 @@ RUN apt-get update \ gdb \ git \ gnupg \ + libc6 \ lsb-release \ make \ pkg-config \ diff --git a/Cargo.lock b/Cargo.lock index 6adc5ec..0678465 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,6 +44,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -55,9 +61,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.21" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", @@ -76,9 +82,9 @@ checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] @@ -109,6 +115,12 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" + [[package]] name = "arrayref" version = "0.3.9" @@ -133,17 +145,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "async-trait" -version = "0.1.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "atomic-waker" version = "1.1.2" @@ -176,16 +177,16 @@ checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "blake3" -version = "1.8.3" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +checksum = "4d2d5991425dfd0785aed03aedcf0b321d61975c9b5b3689c774a2610ae0b51e" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "cpufeatures", + "cpufeatures 0.3.0", ] [[package]] @@ -228,6 +229,15 @@ dependencies = [ "serde", ] +[[package]] +name = "buddy_system_allocator" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1af5a01adeeade54c9f5060300227a8ee64c05b6376f28e9b8ee3b72dd2056f" +dependencies = [ + "spin", +] + [[package]] name = "built" version = "0.8.0" @@ -243,6 +253,9 @@ name = "bumpalo" version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +dependencies = [ + "allocator-api2", +] [[package]] name = "bytes" @@ -250,6 +263,15 @@ version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + [[package]] name = "cargo-hyperlight" version = "0.1.8" @@ -269,6 +291,30 @@ dependencies = [ "which", ] +[[package]] +name = "cargo-platform" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a0c0e6148f11f01f32650a2ea02d532b2ad4e81d8bd41e6e565b5adc5e6082" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "cargo_metadata" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cc" version = "1.2.57" @@ -293,6 +339,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chacha20" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.0", +] + [[package]] name = "chrono" version = "0.4.44" @@ -306,6 +363,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror", +] + [[package]] name = "colorchoice" version = "1.0.5" @@ -403,6 +469,153 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-assembler-x64" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba33ddc4e157cb1abe9da6c821e8824f99e56d057c2c22536850e0141f281d61" +dependencies = [ + "cranelift-assembler-x64-meta", +] + +[[package]] +name = "cranelift-assembler-x64-meta" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b23dd6ea360e6fb28a3f3b40b7f126509668f58076a4729b2cfd656f26a0ad" +dependencies = [ + "cranelift-srcgen", +] + +[[package]] +name = "cranelift-bforest" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d81afcee8fe27ee2536987df3fadcb2e161af4edb7dbe3ef36838d0ce74382" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-bitset" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb33595f1279fe7af03b28245060e9085caf98b10ed3137461a85796eb83972a" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-codegen" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0230a6ac0660bfe31eb244cbb43dcd4f2b3c1c4e0addc3e0348c6053ea60272e" +dependencies = [ + "bumpalo", + "cranelift-assembler-x64", + "cranelift-bforest", + "cranelift-bitset", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli", + "hashbrown 0.15.5", + "log", + "pulley-interpreter", + "regalloc2", + "rustc-hash", + "serde", + "smallvec", + "target-lexicon", + "wasmtime-internal-math", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d6817fdc15cb8f236fc9d8e610767d3a03327ceca4abff7a14d8e2154c405e" +dependencies = [ + "cranelift-assembler-x64-meta", + "cranelift-codegen-shared", + "cranelift-srcgen", + "heck", + "pulley-interpreter", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0403796328e9e2e7df2b80191cdbb473fd9ea3889eb45ef5632d0fef168ea032" + +[[package]] +name = "cranelift-control" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "188f04092279a3814e0b6235c2f9c2e34028e4beb72da7bfed55cbd184702bcc" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f5e7391167605d505fe66a337e1a69583b3f34b63d359ffa5a430313c555e8" +dependencies = [ + "cranelift-bitset", + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-frontend" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5440792eb2b5ba0a0976df371b9f94031bd853ae56f389de610bca7128a7cb" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e5c05fab6fce38d729088f3fa1060eaa1ad54eefd473588887205ed2ab2f79e" + +[[package]] +name = "cranelift-native" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9a0607a028edf5ba5bba7e7cf5ca1b7f0a030e3ae84dcd401e8b9b05192280" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-srcgen" +version = "0.123.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0f2da72eb2472aaac6cfba4e785af42b1f2d82f5155f30c9c30e8cce351e17" + [[package]] name = "crc32fast" version = "1.5.0" @@ -486,18 +699,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] -name = "elfcore" -version = "2.0.2" +name = "embedded-io" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdaa3d1c27119b3394513f4596894a40cd53cb4acec7fce636a9ca0c4abb171" -dependencies = [ - "libc", - "nix", - "smallvec", - "thiserror", - "tracing", - "zerocopy", -] +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" [[package]] name = "encode_unicode" @@ -526,9 +737,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.9" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" +checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" dependencies = [ "anstream", "anstyle", @@ -553,6 +764,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "2.3.0" @@ -608,6 +825,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "foreign-types" version = "0.3.2" @@ -739,10 +962,22 @@ dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", + "rand_core 0.10.0", "wasip2", "wasip3", ] +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + [[package]] name = "git2" version = "0.20.4" @@ -811,7 +1046,7 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "foldhash", + "foldhash 0.1.5", "serde", ] @@ -820,6 +1055,11 @@ name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", + "serde", + "serde_core", +] [[package]] name = "heck" @@ -827,12 +1067,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "http" version = "1.4.0" @@ -962,9 +1196,9 @@ dependencies = [ [[package]] name = "hyperlight-common" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98f80e9aba9fce2a899c9ff0c62dd39cd479fa2f22ef578faed1d510c5becf94" +checksum = "be2d385987047c64fdb5c95e05ef3b6bd9431001a8fe694abb29b29e99913167" dependencies = [ "anyhow", "flatbuffers", @@ -972,13 +1206,14 @@ dependencies = [ "spin", "thiserror", "tracing", + "tracing-core", ] [[package]] name = "hyperlight-component-macro" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f217d5bbb0d02c9aac81374c3161af2a3a46a5379a604b0799534762a534d75a" +checksum = "fa7ae5cd7c8e5f5b925b07bce45be853ac0be0e6d4e8b2afd17ad8c16aa135c4" dependencies = [ "env_logger", "hyperlight-component-util", @@ -987,29 +1222,87 @@ dependencies = [ "proc-macro2", "quote", "syn", - "wasmparser 0.243.0", + "wasmparser 0.246.2", ] [[package]] name = "hyperlight-component-util" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b3299460dc5f39d37b8233c9aad7fc52c9548d96a76d35cdcc4f4f49ff6662" +checksum = "522ece4723e1c0a81355c07131d6ba5c39c9b4bbc66d8965893957a32a90c029" dependencies = [ "itertools", - "log", "prettyplease", "proc-macro2", "quote", "syn", - "wasmparser 0.243.0", + "tracing", + "wasmparser 0.246.2", +] + +[[package]] +name = "hyperlight-guest" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ee2682d284171d2bd9e80e3e543de310356c1d8ec65e88028b3e08048d15d3d" +dependencies = [ + "anyhow", + "flatbuffers", + "hyperlight-common", + "serde_json", + "tracing", +] + +[[package]] +name = "hyperlight-guest-bin" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3740817f3be98d18edb50eec985461baca0eba5b1f73d0f475b7a539d812e750" +dependencies = [ + "buddy_system_allocator", + "cc", + "cfg-if", + "flatbuffers", + "glob", + "hyperlight-common", + "hyperlight-guest", + "hyperlight-guest-macro", + "hyperlight-guest-tracing", + "linkme", + "log", + "spin", + "tracing", +] + +[[package]] +name = "hyperlight-guest-macro" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f88cbcde1ca986e4f14a85ea0a436659edcb6eb63e8a9d14413ca5cdc8ea86" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "hyperlight-guest-tracing" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d14e9c34c508ecfba1283a552c3eb118d8ee82d863e2e91377a6059f06cf84dd" +dependencies = [ + "hyperlight-common", + "spin", + "tracing", + "tracing-core", ] [[package]] name = "hyperlight-host" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f81d712e88785e8860be6b33048fc2c9ad6637864aa50fe95d0037cfa50a4fb" +checksum = "65c2f9b5a13324c5dd786bf77a7531216207684da1cefc19fb9b697d08346ac0" dependencies = [ "anyhow", "bitflags 2.11.0", @@ -1017,7 +1310,6 @@ dependencies = [ "cfg-if", "cfg_aliases", "crossbeam-channel", - "elfcore", "flatbuffers", "goblin", "hyperlight-common", @@ -1030,10 +1322,9 @@ dependencies = [ "mshv-bindings", "mshv-ioctls", "page_size", - "rand", + "rand 0.10.0", "rust-embed", "serde_json", - "sha256", "termcolor", "thiserror", "tracing", @@ -1049,9 +1340,9 @@ dependencies = [ [[package]] name = "hyperlight-wasm" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2e95638da8eeab5f884f61609dfadbc41babd1611c3222ac61c2c8fc3cf911" +checksum = "aca37852813fba50e7c2d8df90723452af8f4870d71b6929859cf093645b4f02" dependencies = [ "anyhow", "blake3", @@ -1062,13 +1353,17 @@ dependencies = [ "chrono", "env_logger", "goblin", + "hyperlight-common", "hyperlight-host", + "hyperlight-wasm-runtime", "junction", "libc", "log", "metrics", "once_cell", "page_size", + "serde", + "serde_json", "tar", "tracing", "windows", @@ -1093,6 +1388,38 @@ dependencies = [ "tokio", ] +[[package]] +name = "hyperlight-wasm-macro" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef0bcfc8bc4eb6aef70468ead5165d0a4f4cb7860e1c48c73ae4b89b70770ba0" +dependencies = [ + "hyperlight-component-util", + "itertools", + "prettyplease", + "proc-macro2", + "quote", +] + +[[package]] +name = "hyperlight-wasm-runtime" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67725d64fbadb3f196660a2c8fff80af6ecf7e6e6a724f9f23f61b94dad13bd2" +dependencies = [ + "cargo_metadata", + "cc", + "cfg-if", + "cfg_aliases", + "hyperlight-common", + "hyperlight-guest", + "hyperlight-guest-bin", + "hyperlight-wasm-macro", + "spin", + "tracing", + "wasmtime", +] + [[package]] name = "iana-time-zone" version = "0.1.65" @@ -1379,6 +1706,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + [[package]] name = "libredox" version = "0.1.14" @@ -1403,6 +1736,26 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linkme" +version = "0.3.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e3283ed2d0e50c06dd8602e0ab319bb048b6325d0bba739db64ed8205179898" +dependencies = [ + "linkme-impl", +] + +[[package]] +name = "linkme-impl" +version = "0.3.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5cec0ec4228b4853bb129c84dbf093a27e6c7a20526da046defc334a1b017f7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -1436,12 +1789,30 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + [[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +[[package]] +name = "memfd" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" +dependencies = [ + "rustix", +] + [[package]] name = "metrics" version = "0.24.3" @@ -1520,18 +1891,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nix" -version = "0.31.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3" -dependencies = [ - "bitflags 2.11.0", - "cfg-if", - "cfg_aliases", - "libc", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1562,6 +1921,18 @@ dependencies = [ "syn", ] +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "crc32fast", + "hashbrown 0.15.5", + "indexmap", + "memchr", +] + [[package]] name = "once_cell" version = "1.21.4" @@ -1711,6 +2082,18 @@ dependencies = [ "portable-atomic", ] +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + [[package]] name = "potential_utf" version = "0.1.4" @@ -1739,6 +2122,15 @@ dependencies = [ "syn", ] +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro2" version = "1.0.106" @@ -1748,6 +2140,29 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "pulley-interpreter" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "499d922aa0f9faac8d92351416664f1b7acd914008a90fce2f0516d31efddf67" +dependencies = [ + "cranelift-bitset", + "log", + "pulley-macros", + "wasmtime-internal-math", +] + +[[package]] +name = "pulley-macros" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3848fb193d6dffca43a21f24ca9492f22aab88af1223d06bac7f8a0ef405b81" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "quinn" version = "0.11.9" @@ -1777,7 +2192,7 @@ dependencies = [ "bytes", "getrandom 0.3.4", "lru-slab", - "rand", + "rand 0.9.2", "ring", "rustc-hash", "rustls", @@ -1831,7 +2246,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha", - "rand_core", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" +dependencies = [ + "chacha20", + "getrandom 0.4.2", + "rand_core 0.10.0", ] [[package]] @@ -1841,7 +2267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.9.5", ] [[package]] @@ -1853,6 +2279,12 @@ dependencies = [ "getrandom 0.3.4", ] +[[package]] +name = "rand_core" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" + [[package]] name = "redox_syscall" version = "0.5.18" @@ -1882,6 +2314,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "regalloc2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" +dependencies = [ + "allocator-api2", + "bumpalo", + "hashbrown 0.15.5", + "log", + "rustc-hash", + "smallvec", +] + [[package]] name = "regex" version = "1.12.3" @@ -2223,23 +2669,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest", ] -[[package]] -name = "sha256" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f880fc8562bdeb709793f00eb42a2ad0e672c4f883bbe59122b926eca935c8f6" -dependencies = [ - "async-trait", - "bytes", - "hex", - "sha2", - "tokio", -] - [[package]] name = "shellexpand" version = "3.1.2" @@ -2282,6 +2715,9 @@ name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +dependencies = [ + "serde", +] [[package]] name = "socket2" @@ -2368,15 +2804,21 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" dependencies = [ "filetime", "libc", "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" + [[package]] name = "tempfile" version = "3.27.0" @@ -2505,6 +2947,36 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.11+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow", +] + [[package]] name = "tower" version = "0.5.3" @@ -2661,9 +3133,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" +checksum = "5ac8b6f42ead25368cf5b098aeb3dc8a1a2c05a3eee8a9a1a68c640edbfc79d9" dependencies = [ "getrandom 0.4.2", "js-sys", @@ -2800,6 +3272,16 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.236.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7" +dependencies = [ + "leb128fmt", + "wasmparser 0.236.1", +] + [[package]] name = "wasm-encoder" version = "0.244.0" @@ -2818,7 +3300,7 @@ checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", "indexmap", - "wasm-encoder", + "wasm-encoder 0.244.0", "wasmparser 0.244.0", ] @@ -2837,9 +3319,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.243.0" +version = "0.236.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d8db401b0528ec316dfbe579e6ab4152d61739cfe076706d2009127970159d" +checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7" dependencies = [ "bitflags 2.11.0", "hashbrown 0.15.5", @@ -2860,6 +3342,220 @@ dependencies = [ "semver", ] +[[package]] +name = "wasmparser" +version = "0.246.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71cde4757396defafd25417cfb36aa3161027d06d865b0c24baaae229aac005d" +dependencies = [ + "bitflags 2.11.0", + "hashbrown 0.16.1", + "indexmap", + "semver", + "serde", +] + +[[package]] +name = "wasmprinter" +version = "0.236.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2df225df06a6df15b46e3f73ca066ff92c2e023670969f7d50ce7d5e695abbb1" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser 0.236.1", +] + +[[package]] +name = "wasmtime" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a2f8736ddc86e03a9d0e4c477a37939cfc53cd1b052ee38a3133679b87ef830" +dependencies = [ + "anyhow", + "bitflags 2.11.0", + "bumpalo", + "cc", + "cfg-if", + "encoding_rs", + "hashbrown 0.15.5", + "indexmap", + "libc", + "log", + "mach2", + "memfd", + "object", + "postcard", + "pulley-interpreter", + "semver", + "serde", + "serde_derive", + "smallvec", + "target-lexicon", + "wasmparser 0.236.1", + "wasmtime-environ", + "wasmtime-internal-asm-macros", + "wasmtime-internal-component-macro", + "wasmtime-internal-component-util", + "wasmtime-internal-cranelift", + "wasmtime-internal-math", + "wasmtime-internal-slab", + "wasmtime-internal-unwinder", + "wasmtime-internal-versioned-export-macros", + "wasmtime-internal-winch", + "windows-sys 0.60.2", +] + +[[package]] +name = "wasmtime-environ" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733682a327755c77153ac7455b1ba8f2db4d9946c1738f8002fe1fbda1d52e83" +dependencies = [ + "anyhow", + "cranelift-bitset", + "cranelift-entity", + "gimli", + "indexmap", + "log", + "object", + "postcard", + "semver", + "serde", + "serde_derive", + "smallvec", + "target-lexicon", + "wasm-encoder 0.236.1", + "wasmparser 0.236.1", + "wasmprinter", + "wasmtime-internal-component-util", +] + +[[package]] +name = "wasmtime-internal-asm-macros" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68288980a2e02bcb368d436da32565897033ea21918007e3f2bae18843326cf9" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-internal-component-macro" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dea846da68f8e776c8a43bde3386022d7bb74e713b9654f7c0196e5ff2e4684" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn", + "wasmtime-internal-component-util", + "wasmtime-internal-wit-bindgen", + "wit-parser 0.236.1", +] + +[[package]] +name = "wasmtime-internal-component-util" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe1e5735b3c8251510d2a55311562772d6c6fca9438a3d0329eb6e38af4957d6" + +[[package]] +name = "wasmtime-internal-cranelift" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89bb9ef571288e2be6b8a3c4763acc56c348dcd517500b1679d3ffad9e4a757" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "gimli", + "itertools", + "log", + "object", + "pulley-interpreter", + "smallvec", + "target-lexicon", + "thiserror", + "wasmparser 0.236.1", + "wasmtime-environ", + "wasmtime-internal-math", + "wasmtime-internal-versioned-export-macros", +] + +[[package]] +name = "wasmtime-internal-math" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a23b03fb14c64bd0dfcaa4653101f94ade76c34a3027ed2d6b373267536e45b" +dependencies = [ + "libm", +] + +[[package]] +name = "wasmtime-internal-slab" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbff220b88cdb990d34a20b13344e5da2e7b99959a5b1666106bec94b58d6364" + +[[package]] +name = "wasmtime-internal-unwinder" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e1ad30e88988b20c0d1c56ea4b4fbc01a8c614653cbf12ca50c0dcc695e2f7" +dependencies = [ + "anyhow", + "cfg-if", + "log", + "object", +] + +[[package]] +name = "wasmtime-internal-versioned-export-macros" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "549aefdaa1398c2fcfbf69a7b882956bb5b6e8e5b600844ecb91a3b5bf658ca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "wasmtime-internal-winch" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc96a84c5700171aeecf96fa9a9ab234f333f5afb295dabf3f8a812b70fe832" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli", + "object", + "target-lexicon", + "wasmparser 0.236.1", + "wasmtime-environ", + "wasmtime-internal-cranelift", + "winch-codegen", +] + +[[package]] +name = "wasmtime-internal-wit-bindgen" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28dc9efea511598c88564ac1974e0825c07d9c0de902dbf68f227431cd4ff8c" +dependencies = [ + "anyhow", + "bitflags 2.11.0", + "heck", + "indexmap", + "wit-parser 0.236.1", +] + [[package]] name = "web-sys" version = "0.3.91" @@ -2930,6 +3626,26 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winch-codegen" +version = "36.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c0ec09e8eb5e850e432da6271ed8c4a9d459a9db3850c38e98a3ee9d015e79" +dependencies = [ + "anyhow", + "cranelift-assembler-x64", + "cranelift-codegen", + "gimli", + "regalloc2", + "smallvec", + "target-lexicon", + "thiserror", + "wasmparser 0.236.1", + "wasmtime-environ", + "wasmtime-internal-cranelift", + "wasmtime-internal-math", +] + [[package]] name = "windows" version = "0.62.2" @@ -3216,6 +3932,15 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" +[[package]] +name = "winnow" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" +dependencies = [ + "memchr", +] + [[package]] name = "wit-bindgen" version = "0.51.0" @@ -3233,7 +3958,7 @@ checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" dependencies = [ "anyhow", "heck", - "wit-parser", + "wit-parser 0.244.0", ] [[package]] @@ -3280,10 +4005,28 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder", + "wasm-encoder 0.244.0", "wasm-metadata", "wasmparser 0.244.0", - "wit-parser", + "wit-parser 0.244.0", +] + +[[package]] +name = "wit-parser" +version = "0.236.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e4833a20cd6e85d6abfea0e63a399472d6f88c6262957c17f546879a80ba15" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.236.1", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8774589..8074439 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,10 @@ getrandom = "0.3.3" http-body-util = "0.1" hyper = "1.7" hyper-util = { version = "0.1", features = ["full"] } -hyperlight-component-macro = { version = "0.12.0" } -hyperlight-common = { version = "0.12.0" } -hyperlight-host = { version = "0.12.0", default-features = false, features = [ "kvm", "mshv3" ] } -hyperlight-wasm = { version = "0.12.0" } +hyperlight-component-macro = { version = "0.14.0" } +hyperlight-common = { version = "0.14.0" } +hyperlight-host = { version = "0.14.0", default-features = false, features = [ "kvm", "mshv3" ] } +hyperlight-wasm = { version = "0.14.0" } once_cell = "1.21.3" reqwest = { version = "0.12", features = ["stream", "gzip", "brotli", "deflate", "rustls-tls", "blocking"] } tokio = { version = "1.47", features = ["full"] } diff --git a/justfile b/justfile index 5d39a01..278024f 100644 --- a/justfile +++ b/justfile @@ -12,7 +12,7 @@ install-hyperlight-wasm-aot: test -f {{ BIN_DIR }}/hyperlight-wasm-aot || \ cargo install hyperlight-wasm-aot \ --locked \ - --version 0.12.0 \ + --version 0.14.0 \ --root {{ TARGET_DIR }} build-js-component: make-out-dir install-hyperlight-wasm-aot diff --git a/src/main.rs b/src/main.rs index abc991c..e951eb6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,8 +30,7 @@ fn main() { let builder = hyperlight_wasm::SandboxBuilder::new() .with_guest_heap_size(30 * 1024 * 1024) - .with_guest_stack_size(1 * 1024 * 1024) - .with_function_definition_size(20 * 1024); + .with_guest_scratch_size(1 * 1024 * 1024); let mut sb = builder.build().unwrap();