diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0298256e2..e6bd7a064 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -11,6 +11,7 @@ body: - [Deno](https://github.com/moonrepo/deno-plugin) - [Go](https://github.com/moonrepo/go-plugin) - [Node](https://github.com/moonrepo/node-plugin) + - [Python](https://github.com/moonrepo/python-plugin) - [Rust](https://github.com/moonrepo/rust-plugin) - [Schema](https://github.com/moonrepo/schema-plugin) - type: input diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2389498eb..47b40a540 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,7 @@ jobs: with: components: clippy - run: cargo clippy --workspace --all-targets + - run: cd plugins && cargo clippy --workspace --all-targets test: name: Test runs-on: ${{ matrix.os }} @@ -49,16 +50,16 @@ jobs: with: bins: cargo-wasi, cargo-nextest cache: false - - run: cd plugins && cargo wasi build -p proto_wasm_test - if: ${{ runner.os != 'Windows' }} + - if: ${{ runner.os != 'Windows' }} + run: cd plugins && cargo wasi build -p proto_wasm_test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Windows runs out of disk space - - run: | + - if: ${{ runner.os == 'Windows' }} + run: | cd plugins; cargo wasi build -p proto_wasm_test; node ../.github/actions/delete-target-files.js; - if: ${{ runner.os == 'Windows' }} - run: cargo nextest run --workspace --exclude proto_pdk --profile ci --config-file ./.cargo/nextest.toml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index ca5d4952e..711042f95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,46 @@ # Changelog +## Plugin changelogs + +- [Bun](https://github.com/moonrepo/bun-plugin/blob/master/CHANGELOG.md) +- [Deno](https://github.com/moonrepo/deno-plugin/blob/master/CHANGELOG.md) +- [Go](https://github.com/moonrepo/go-plugin/blob/master/CHANGELOG.md) +- [Node](https://github.com/moonrepo/node-plugin/blob/master/CHANGELOG.md) +- [Python](https://github.com/moonrepo/python-plugin/blob/master/CHANGELOG.md) +- [Rust](https://github.com/moonrepo/rust-plugin/blob/master/CHANGELOG.md) +- [Schema](https://github.com/moonrepo/schema-plugin/blob/master/CHANGELOG.md) + +## Unreleased + +#### 💥 Breaking + +- WASM API + - Updated `exec_command!` to no longer throw on non-zero exit codes. You'll now need to handle failure states manually. + +#### 🚀 Updates + +- Added Python language support via the `python` identifier. +- Added colors to command line `--help` menus. +- Added canary support to all applicable tools. + - New `--canary` flag for `proto install`. + - Canary release will always be the latest, and can be re-installed. +- Updated the following locations to support partial versions and aliases: + - Tool versions in `.prototools`. + - Pinning a default version with `proto install --pin`. + - Setting global version with `proto global`. + - Setting local version with `proto local`. +- TOML API + - Added `install.download_url_canary` and `install.checksum_url_canary` settings. +- WASM API + - Added `command_exists`, `is_musl`, and `get_target_triple` helper functions. + - Added `skip_install` field to `NativeInstallOutput`. + - Added `skip_uninstall` field to `NativeUninstallOutput`. + +#### ⚙️ Internal + +- Now supports `.zst` (or `.zstd`) archive formats. +- Improved version, alias, and requirement handling. + ## 0.16.1 #### 🐞 Fixes diff --git a/Cargo.lock b/Cargo.lock index 0d5f06952..18934353f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -172,13 +172,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -316,28 +316,24 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cached" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b195e4fbc4b6862bbd065b991a34750399c119797efff72492f28a5864de8700" +checksum = "90eb5776f28a149524d1d8623035760b4454ec881e8cf3838fa8d7e1b11254b3" dependencies = [ - "async-trait", "cached_proc_macro", "cached_proc_macro_types", - "futures", "hashbrown 0.13.2", "instant", "once_cell", "thiserror", - "tokio", ] [[package]] name = "cached_proc_macro" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b48814962d2fd604c50d2b9433c2a41a0ab567779ee2c02f7fba6eca1221f082" +checksum = "7da8245dd5f576a41c3b76247b54c15b0e43139ceeb4f732033e15be7c005176" dependencies = [ - "cached_proc_macro_types", "darling 0.14.4", "proc-macro2", "quote", @@ -449,17 +445,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.0", ] [[package]] @@ -479,20 +474,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.1" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c8d502cbaec4595d2e7d5f61e318f05417bd2b66fdc3809498f0d3fdf0bea27" +checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.4.1" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5891c7bc0edb3e1c2204fc5e94009affabeb1821c9e5fdc3959536c5c0bb984d" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" dependencies = [ "anstream", "anstyle", @@ -502,23 +496,23 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.0" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "586a385f7ef2f8b4d86bddaa0c094794e7ccbfe5ffef1f434fe928143fc783a5" +checksum = "4110a1e6af615a9e6d0a36f805d5c99099f8bab9b8042f5bc1fa220a4a89e36f" dependencies = [ - "clap 4.4.1", + "clap 4.4.2", ] [[package]] name = "clap_derive" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -818,7 +812,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -835,7 +829,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -883,7 +877,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -905,7 +899,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -1161,7 +1155,7 @@ checksum = "d2be216330f7304de051e0faf1578880e9e0dc1ecbd2c0fea5765c63a079d0ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -1347,7 +1341,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -1420,7 +1414,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -1985,9 +1979,9 @@ checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memfd" @@ -2036,7 +2030,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -2077,7 +2071,7 @@ checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.45.0", ] @@ -2320,7 +2314,7 @@ dependencies = [ name = "proto_cli" version = "0.16.1" dependencies = [ - "clap 4.4.1", + "clap 4.4.2", "clap_complete", "convert_case", "dialoguer", @@ -2348,7 +2342,7 @@ dependencies = [ [[package]] name = "proto_core" -version = "0.16.4" +version = "0.17.2" dependencies = [ "cached", "extism", @@ -2364,6 +2358,7 @@ dependencies = [ "serde_json", "sha2", "starbase_archive", + "starbase_events", "starbase_sandbox", "starbase_styles", "starbase_utils", @@ -2376,7 +2371,7 @@ dependencies = [ [[package]] name = "proto_pdk" -version = "0.6.5" +version = "0.7.1" dependencies = [ "anyhow", "extism-pdk", @@ -2388,7 +2383,7 @@ dependencies = [ [[package]] name = "proto_pdk_api" -version = "0.6.3" +version = "0.7.1" dependencies = [ "anyhow", "semver", @@ -2400,7 +2395,7 @@ dependencies = [ [[package]] name = "proto_pdk_test_utils" -version = "0.5.9" +version = "0.6.2" dependencies = [ "extism", "proto_core", @@ -2411,14 +2406,14 @@ dependencies = [ [[package]] name = "proto_schema_plugin" -version = "0.11.3" +version = "0.11.4" dependencies = [ "serde", ] [[package]] name = "proto_wasm_plugin" -version = "0.6.3" +version = "0.6.5" dependencies = [ "extism", "proto_pdk_api", @@ -2448,9 +2443,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -2542,13 +2537,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick 1.0.1", "memchr", - "regex-automata 0.3.7", + "regex-automata 0.3.8", "regex-syntax 0.7.5", ] @@ -2563,9 +2558,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick 1.0.1", "memchr", @@ -2586,9 +2581,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "relative-path" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf2521270932c3c7bed1a59151222bd7643c79310f2916f01925e1e16255698" +checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" [[package]] name = "reqwest" @@ -2839,7 +2834,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -3003,9 +2998,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "starbase" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328b77f92b09f8788a894d063cefd3f7876f0bef776baec6946bdd2e75f24117" +checksum = "399c94c128150ef75e2ee780cc70d5aef92f5b44badc6005ac84bb8b9b6ed4a1" dependencies = [ "async-trait", "chrono", @@ -3025,9 +3020,9 @@ dependencies = [ [[package]] name = "starbase_archive" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bb40d408fb474e6d0092eba4fa977aa40c85885931c62219bb12d512e515e8" +checksum = "f85e565b134761413513c0091ed002ffb31ba448ca9542c4c41ca5968a29a9bb" dependencies = [ "flate2", "miette", @@ -3039,13 +3034,14 @@ dependencies = [ "tracing", "xz2", "zip", + "zstd 0.12.4", ] [[package]] name = "starbase_events" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6913545608418518959d13ac9e05568d0d059f53ab3a24cf3283b7958ee5e732" +checksum = "5f172a2185991dbfb2a3446c47749ade52d66d2aaea724d19bd45607527ebd9d" dependencies = [ "async-trait", "miette", @@ -3055,21 +3051,21 @@ dependencies = [ [[package]] name = "starbase_macros" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd2a77f76022474557803637dbefe72e38fa196564e9a1daf3c695c06b1ee222" +checksum = "63159597180d00c01353e4bf4d4401328a30eb618c0130adf7b9371db4df3d3a" dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] name = "starbase_sandbox" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03cea8d1fd34d42fc47979aa670e28f276f395c70a6e446b6e68c8136dd2ae2" +checksum = "62ec8301c49429d3da1105475f4e32ce8fa7c8cf1028c4e4535b0c010be2952a" dependencies = [ "assert_cmd", "assert_fs", @@ -3083,9 +3079,9 @@ dependencies = [ [[package]] name = "starbase_styles" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad293ee0bf20cc69aced802167871210db53994bb6dd4206d9cf48dd7517cd2" +checksum = "251a45da918b41577ab62fb764c9683a0f50fb2b8999a629dbd6c25476a9c411" dependencies = [ "dirs 5.0.1", "miette", @@ -3095,9 +3091,9 @@ dependencies = [ [[package]] name = "starbase_utils" -version = "0.2.21" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09593b70b1d477cd8f6e84c5934e13da13bc788ec9d626822f3edeaaaaaddec5" +checksum = "032493983d1aaa0e6107219e8b17e2b315452f902f0f512c8bd5af6df6704b44" dependencies = [ "dirs 5.0.1", "fs4", @@ -3110,6 +3106,7 @@ dependencies = [ "serde_json", "starbase_styles", "thiserror", + "tokio", "toml 0.7.6", "tracing", "wax", @@ -3162,9 +3159,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" dependencies = [ "proc-macro2", "quote", @@ -3261,22 +3258,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -3300,17 +3297,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "time" version = "0.3.25" @@ -3392,7 +3378,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.31", ] [[package]] @@ -3488,7 +3474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" dependencies = [ "crossbeam-channel", - "time 0.3.25", + "time", "tracing-subscriber", ] @@ -3715,7 +3701,7 @@ dependencies = [ [[package]] name = "warpgate" -version = "0.5.3" +version = "0.5.4" dependencies = [ "extism", "miette", @@ -3743,12 +3729,6 @@ dependencies = [ "serde", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -3990,7 +3970,7 @@ dependencies = [ "sha2", "toml 0.5.11", "windows-sys 0.48.0", - "zstd", + "zstd 0.11.2+zstd.1.5.2", ] [[package]] @@ -4683,7 +4663,16 @@ version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ - "zstd-safe", + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", ] [[package]] @@ -4696,6 +4685,16 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + [[package]] name = "zstd-sys" version = "2.0.7+zstd.1.5.4" diff --git a/Cargo.toml b/Cargo.toml index 1219ed1bf..d07e4b828 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,9 +4,9 @@ members = ["crates/*"] default-members = ["crates/cli"] [workspace.dependencies] -cached = "0.44.0" -clap = "4.4.1" -clap_complete = "4.4.0" +cached = "0.45.1" +clap = "4.4.2" +clap_complete = "4.4.1" convert_case = "0.6.0" extism = "0.5.0" extism-pdk = "0.3.4" @@ -14,7 +14,7 @@ human-sort = "0.2.2" miette = "5.10.0" once_cell = "1.18.0" once_map = "0.4.8" -regex = "1.9.4" +regex = "1.9.5" reqwest = { version = "0.11.20", default-features = false, features = [ "rustls-tls", ] } @@ -22,19 +22,20 @@ semver = "1.0.18" serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.105" sha2 = "0.10.7" -starbase_archive = { version = "0.2.0", features = [ +starbase_archive = { version = "0.2.2", features = [ "tar-gz", "tar-xz", + "tar-zstd", "zip", "zip-deflate", ] } -starbase_sandbox = { version = "0.1.8" } -starbase_styles = "0.1.13" -starbase_utils = { version = "0.2.21", default-features = false, features = [ +starbase_sandbox = { version = "0.1.10" } +starbase_styles = "0.1.15" +starbase_utils = { version = "0.3.1", default-features = false, features = [ "json", "toml", ] } -thiserror = "1.0.47" +thiserror = "1.0.48" tokio = { version = "1.32.0", features = ["full", "tracing"] } tracing = "0.1.37" diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index bee558f53..42f9307ce 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -27,10 +27,10 @@ name = "proto" path = "src/main.rs" [dependencies] -proto_core = { version = "0.16.4", path = "../core" } -proto_pdk_api = { version = "0.6.3", path = "../pdk-api" } -proto_schema_plugin = { version = "0.11.3", path = "../schema-plugin" } -proto_wasm_plugin = { version = "0.6.3", path = "../wasm-plugin" } +proto_core = { version = "0.17.2", path = "../core" } +proto_pdk_api = { version = "0.7.1", path = "../pdk-api" } +proto_schema_plugin = { version = "0.11.4", path = "../schema-plugin" } +proto_wasm_plugin = { version = "0.6.5", path = "../wasm-plugin" } clap = { workspace = true, features = ["derive", "env"] } clap_complete = { workspace = true } convert_case = { workspace = true } @@ -38,12 +38,12 @@ dialoguer = "0.10.4" dirs = "5.0.1" futures = "0.3.28" human-sort = { workspace = true } -indicatif = "0.17.5" +indicatif = "0.17.6" miette = { workspace = true } reqwest = { workspace = true, features = ["stream"] } semver = { workspace = true } serde = { workspace = true } -starbase = "0.2.5" +starbase = "0.2.6" starbase_archive = { workspace = true } starbase_styles = { workspace = true } starbase_utils = { workspace = true } diff --git a/crates/cli/src/app.rs b/crates/cli/src/app.rs index 6d93d2a78..658cf8bf8 100644 --- a/crates/cli/src/app.rs +++ b/crates/cli/src/app.rs @@ -3,7 +3,9 @@ use crate::commands::{ InstallGlobalArgs, ListArgs, ListGlobalArgs, ListRemoteArgs, LocalArgs, PluginsArgs, RemovePluginArgs, RunArgs, SetupArgs, UnaliasArgs, UninstallArgs, UninstallGlobalArgs, }; +use clap::builder::styling::{Color, Style, Styles}; use clap::{Parser, Subcommand, ValueEnum}; +use starbase_styles::color::Color as ColorType; use std::fmt::{Display, Error, Formatter}; #[derive(ValueEnum, Clone, Debug, Default)] @@ -36,17 +38,31 @@ impl Display for LogLevel { } } +fn fg(ty: ColorType) -> Style { + Style::new().fg_color(Some(Color::from(ty as u8))) +} + +fn create_styles() -> Styles { + Styles::default() + .error(fg(ColorType::Red)) + .header(Style::new().bold()) + .invalid(fg(ColorType::Yellow)) + .literal(fg(ColorType::Pink)) // args, options, etc + .placeholder(fg(ColorType::GrayLight)) + .usage(fg(ColorType::Purple).bold()) + .valid(fg(ColorType::Green)) +} + #[derive(Debug, Parser)] #[command( name = "proto", version, about, long_about = None, - disable_colored_help = true, disable_help_subcommand = true, propagate_version = true, next_line_help = false, - rename_all = "camelCase" + styles = create_styles() )] pub struct App { #[arg( diff --git a/crates/cli/src/commands/alias.rs b/crates/cli/src/commands/alias.rs index 2458217da..dc87a7087 100644 --- a/crates/cli/src/commands/alias.rs +++ b/crates/cli/src/commands/alias.rs @@ -1,5 +1,5 @@ use clap::Args; -use proto_core::{is_alias_name, load_tool, Id, ProtoError, VersionType}; +use proto_core::{is_alias_name, load_tool, Id, ProtoError, UnresolvedVersionSpec}; use starbase::system; use starbase_styles::color; use tracing::info; @@ -13,12 +13,12 @@ pub struct AliasArgs { alias: String, #[arg(required = true, help = "Version or alias to associate with")] - semver: VersionType, + spec: UnresolvedVersionSpec, } #[system] pub async fn alias(args: ArgsRef) { - if let VersionType::Alias(inner_alias) = &args.semver { + if let UnresolvedVersionSpec::Alias(inner_alias) = &args.spec { if &args.alias == inner_alias { return Err(ProtoError::Message("Cannot map an alias to itself.".into()))?; } @@ -34,13 +34,13 @@ pub async fn alias(args: ArgsRef) { tool.manifest .aliases - .insert(args.alias.clone(), args.semver.clone()); + .insert(args.alias.clone(), args.spec.clone()); tool.manifest.save()?; info!( "Added alias {} ({}) for {}", color::id(&args.alias), - color::muted_light(args.semver.to_string()), + color::muted_light(args.spec.to_string()), tool.get_name(), ); } diff --git a/crates/cli/src/commands/bin.rs b/crates/cli/src/commands/bin.rs index 70ae64a39..f3f3028a4 100644 --- a/crates/cli/src/commands/bin.rs +++ b/crates/cli/src/commands/bin.rs @@ -1,5 +1,5 @@ use clap::Args; -use proto_core::{detect_version, load_tool, Id, VersionType}; +use proto_core::{detect_version, load_tool, Id, UnresolvedVersionSpec}; use starbase::system; #[derive(Args, Clone, Debug)] @@ -8,7 +8,7 @@ pub struct BinArgs { id: Id, #[arg(help = "Version or alias of tool")] - semver: Option, + spec: Option, #[arg(long, help = "Display shim path when available")] shim: bool, @@ -17,7 +17,7 @@ pub struct BinArgs { #[system] pub async fn bin(args: ArgsRef) { let mut tool = load_tool(&args.id).await?; - let version = detect_version(&tool, args.semver.clone()).await?; + let version = detect_version(&tool, args.spec.clone()).await?; tool.resolve_version(&version).await?; tool.locate_bins().await?; diff --git a/crates/cli/src/commands/clean.rs b/crates/cli/src/commands/clean.rs index fca369a85..ed538a85e 100644 --- a/crates/cli/src/commands/clean.rs +++ b/crates/cli/src/commands/clean.rs @@ -1,10 +1,9 @@ use clap::Args; use dialoguer::Confirm; use proto_core::{ - get_plugins_dir, get_shim_file_name, load_tool, AliasOrVersion, Id, Tool, ToolsConfig, + get_plugins_dir, get_shim_file_name, load_tool, Id, Tool, ToolsConfig, VersionSpec, }; use proto_pdk_api::{CreateShimsInput, CreateShimsOutput}; -use semver::Version; use starbase::diagnostics::IntoDiagnostic; use starbase::{system, SystemResult}; use starbase_styles::color; @@ -53,7 +52,7 @@ pub async fn clean_tool(mut tool: Tool, now: u128, days: u8, yes: bool) -> miett return Ok(0); } - let mut versions_to_clean = HashSet::::new(); + let mut versions_to_clean = HashSet::::new(); debug!("Scanning file system for stale and untracked versions"); @@ -71,7 +70,7 @@ pub async fn clean_tool(mut tool: Tool, now: u128, days: u8, yes: bool) -> miett continue; } - let version = Version::parse(&dir_name).into_diagnostic()?; + let version = VersionSpec::parse(&dir_name)?; if !tool.manifest.versions.contains_key(&version) { debug!( @@ -141,7 +140,7 @@ pub async fn clean_tool(mut tool: Tool, now: u128, days: u8, yes: bool) -> miett .into_diagnostic()? { for version in versions_to_clean { - tool.set_version(AliasOrVersion::Version(version)); + tool.set_version(version); tool.teardown().await?; } diff --git a/crates/cli/src/commands/global.rs b/crates/cli/src/commands/global.rs index c1f9bb46b..758a65db9 100644 --- a/crates/cli/src/commands/global.rs +++ b/crates/cli/src/commands/global.rs @@ -1,5 +1,5 @@ use clap::Args; -use proto_core::{load_tool, AliasOrVersion, Id}; +use proto_core::{load_tool, Id, UnresolvedVersionSpec}; use starbase::system; use starbase_styles::color; use tracing::{debug, info}; @@ -10,18 +10,18 @@ pub struct GlobalArgs { id: Id, #[arg(required = true, help = "Version or alias of tool")] - semver: AliasOrVersion, + spec: UnresolvedVersionSpec, } #[system] pub async fn global(args: ArgsRef) -> SystemResult { let mut tool = load_tool(&args.id).await?; - tool.manifest.default_version = Some(args.semver.clone()); + tool.manifest.default_version = Some(args.spec.clone()); tool.manifest.save()?; debug!( - version = args.semver.to_string(), + version = args.spec.to_string(), manifest = ?tool.manifest.path, "Wrote the global version", ); @@ -29,6 +29,6 @@ pub async fn global(args: ArgsRef) -> SystemResult { info!( "Set the global {} version to {}", tool.get_name(), - color::hash(args.semver.to_string()) + color::hash(args.spec.to_string()) ); } diff --git a/crates/cli/src/commands/install.rs b/crates/cli/src/commands/install.rs index 38b682682..9ef2cfb4d 100644 --- a/crates/cli/src/commands/install.rs +++ b/crates/cli/src/commands/install.rs @@ -2,7 +2,7 @@ use crate::helpers::{create_progress_bar, disable_progress_bars}; use crate::shell; use clap::Args; use miette::IntoDiagnostic; -use proto_core::{load_tool, Id, Tool, VersionType}; +use proto_core::{load_tool, Id, Tool, UnresolvedVersionSpec}; use proto_pdk_api::{InstallHook, SyncShellProfileInput, SyncShellProfileOutput}; use starbase::{system, SystemResult}; use starbase_styles::color; @@ -14,8 +14,19 @@ pub struct InstallArgs { #[arg(required = true, help = "ID of tool")] pub id: Id, - #[arg(default_value = "latest", help = "Version or alias of tool")] - pub semver: Option, + #[arg( + default_value = "latest", + help = "Version or alias of tool", + group = "version-type" + )] + pub spec: Option, + + #[arg( + long, + help = "Install a canary (next, nightly, etc) version", + group = "version-type" + )] + pub canary: bool, #[arg(long, help = "Pin version as the global default")] pub pin: bool, @@ -26,10 +37,14 @@ pub struct InstallArgs { } pub async fn internal_install(args: InstallArgs) -> SystemResult { - let version = args.semver.clone().unwrap_or_default(); let mut tool = load_tool(&args.id).await?; + let version = if args.canary { + UnresolvedVersionSpec::Canary + } else { + args.spec.clone().unwrap_or_default() + }; - if tool.is_setup(&version).await? { + if !version.is_canary() && tool.is_setup(&version).await? { info!( "{} has already been installed at {}", tool.get_name(), @@ -76,7 +91,7 @@ pub async fn internal_install(args: InstallArgs) -> SystemResult { tool.cleanup().await?; if args.pin { - tool.manifest.default_version = Some(tool.get_resolved_version()); + tool.manifest.default_version = Some(tool.get_resolved_version().to_unresolved_spec()); tool.manifest.save()?; } diff --git a/crates/cli/src/commands/install_all.rs b/crates/cli/src/commands/install_all.rs index 3324bf95a..304f5cb9b 100644 --- a/crates/cli/src/commands/install_all.rs +++ b/crates/cli/src/commands/install_all.rs @@ -5,9 +5,7 @@ use crate::{ helpers::create_progress_bar, }; use futures::future::try_join_all; -use proto_core::{ - load_tool_from_locator, AliasOrVersion, ProtoEnvironment, ToolsConfig, UserConfig, -}; +use proto_core::{load_tool_from_locator, ProtoEnvironment, ToolsConfig, UserConfig}; use starbase::system; use starbase_styles::color; use std::env; @@ -40,7 +38,7 @@ pub async fn install_all() { debug!("Detected version {} for {}", version, tool.get_name()); - config.tools.insert(name, AliasOrVersion::Version(version)); + config.tools.insert(name, version.to_unresolved_spec()); } } @@ -64,10 +62,11 @@ pub async fn install_all() { for (id, version) in config.tools { futures.push(internal_install(InstallArgs { + canary: false, id, - semver: Some(version.to_implicit_type()), pin: false, passthrough: vec![], + spec: Some(version), })); } diff --git a/crates/cli/src/commands/list_remote.rs b/crates/cli/src/commands/list_remote.rs index 864aa66f1..be00c5e67 100644 --- a/crates/cli/src/commands/list_remote.rs +++ b/crates/cli/src/commands/list_remote.rs @@ -1,5 +1,5 @@ use clap::Args; -use proto_core::{load_tool, Id, VersionType}; +use proto_core::{load_tool, Id, UnresolvedVersionSpec}; use starbase::system; use std::process; use tracing::debug; @@ -10,14 +10,15 @@ pub struct ListRemoteArgs { id: Id, } -// TODO: only show LTS, dont show pre-releases? #[system] pub async fn list_remote(args: ArgsRef) { let tool = load_tool(&args.id).await?; debug!("Loading versions"); - let resolver = tool.load_version_resolver(&VersionType::default()).await?; + let resolver = tool + .load_version_resolver(&UnresolvedVersionSpec::default()) + .await?; let mut versions = resolver.versions; if versions.is_empty() { diff --git a/crates/cli/src/commands/local.rs b/crates/cli/src/commands/local.rs index 517c612ff..74051c2ae 100644 --- a/crates/cli/src/commands/local.rs +++ b/crates/cli/src/commands/local.rs @@ -1,5 +1,5 @@ use clap::Args; -use proto_core::{load_tool, AliasOrVersion, Id, ToolsConfig}; +use proto_core::{load_tool, Id, ToolsConfig, UnresolvedVersionSpec}; use starbase::system; use starbase_styles::color; use std::{env, path::PathBuf}; @@ -11,7 +11,7 @@ pub struct LocalArgs { id: Id, #[arg(required = true, help = "Version or alias of tool")] - semver: AliasOrVersion, + spec: UnresolvedVersionSpec, } #[system] @@ -20,11 +20,11 @@ pub async fn local(args: ArgsRef) { let local_path = env::current_dir().unwrap_or_else(|_| PathBuf::from(".")); let mut config = ToolsConfig::load_from(local_path)?; - config.tools.insert(args.id.clone(), args.semver.clone()); + config.tools.insert(args.id.clone(), args.spec.clone()); config.save()?; debug!( - version = args.semver.to_string(), + version = args.spec.to_string(), config = ?config.path, "Wrote the local version", ); @@ -32,6 +32,6 @@ pub async fn local(args: ArgsRef) { info!( "Set the local {} version to {}", tool.get_name(), - color::hash(args.semver.to_string()) + color::hash(args.spec.to_string()) ); } diff --git a/crates/cli/src/commands/run.rs b/crates/cli/src/commands/run.rs index b3eb1e33b..cbbb09ee8 100644 --- a/crates/cli/src/commands/run.rs +++ b/crates/cli/src/commands/run.rs @@ -1,9 +1,7 @@ use crate::commands::install::{internal_install, InstallArgs}; use clap::Args; use miette::IntoDiagnostic; -use proto_core::{ - detect_version, load_tool, AliasOrVersion, Id, ProtoError, UserConfig, VersionType, -}; +use proto_core::{detect_version, load_tool, Id, ProtoError, UnresolvedVersionSpec, UserConfig}; use proto_pdk_api::RunHook; use starbase::system; use starbase_styles::color; @@ -18,7 +16,7 @@ pub struct RunArgs { id: Id, #[arg(help = "Version or alias of tool")] - semver: Option, + spec: Option, #[arg(long, help = "Path to an alternate binary to run")] bin: Option, @@ -34,7 +32,7 @@ pub struct RunArgs { #[system] pub async fn run(args: ArgsRef) -> SystemResult { let mut tool = load_tool(&args.id).await?; - let version = detect_version(&tool, args.semver.clone()).await?; + let version = detect_version(&tool, args.spec.clone()).await?; let user_config = UserConfig::load()?; // Check if installed or install @@ -52,10 +50,11 @@ pub async fn run(args: ArgsRef) -> SystemResult { debug!("Auto-install setting is configured, attempting to install"); internal_install(InstallArgs { + canary: false, id: args.id.clone(), - semver: Some(tool.get_resolved_version().to_implicit_type()), pin: false, passthrough: vec![], + spec: Some(tool.get_resolved_version().to_unresolved_spec()), }) .await?; @@ -63,17 +62,13 @@ pub async fn run(args: ArgsRef) -> SystemResult { tool.locate_bins().await?; } - let resolved_version = tool.get_resolved_version(); - // Update the last used timestamp if env::var("PROTO_SKIP_USED_AT").is_err() { - if let AliasOrVersion::Version(version) = &resolved_version { - tool.manifest.track_used_at(version); + tool.manifest.track_used_at(tool.get_resolved_version()); - // Ignore errors in case of race conditions... - // this timestamp isn't *super* important - let _ = tool.manifest.save(); - } + // Ignore errors in case of race conditions... + // this timestamp isn't *super* important + let _ = tool.manifest.save(); } // Determine the binary path to execute @@ -130,7 +125,7 @@ pub async fn run(args: ArgsRef) -> SystemResult { .args(&args.passthrough) .env( format!("{}_VERSION", tool.get_env_var_prefix()), - resolved_version.to_string(), + tool.get_resolved_version().to_string(), ) .env( format!("{}_BIN", tool.get_env_var_prefix()), diff --git a/crates/cli/src/commands/uninstall.rs b/crates/cli/src/commands/uninstall.rs index 354a903cc..8a95ee4ec 100644 --- a/crates/cli/src/commands/uninstall.rs +++ b/crates/cli/src/commands/uninstall.rs @@ -1,6 +1,6 @@ use crate::helpers::{create_progress_bar, disable_progress_bars}; use clap::Args; -use proto_core::{load_tool, Id, VersionType}; +use proto_core::{load_tool, Id, UnresolvedVersionSpec}; use starbase::system; use tracing::{debug, info}; @@ -10,7 +10,7 @@ pub struct UninstallArgs { id: Id, #[arg(required = true, help = "Version or alias of tool")] - semver: VersionType, + semver: UnresolvedVersionSpec, } #[system] diff --git a/crates/cli/tests/alias_test.rs b/crates/cli/tests/alias_test.rs index ff3dfb81c..2bd56e153 100644 --- a/crates/cli/tests/alias_test.rs +++ b/crates/cli/tests/alias_test.rs @@ -1,6 +1,6 @@ mod utils; -use proto_core::{ToolManifest, VersionType}; +use proto_core::{ToolManifest, UnresolvedVersionSpec}; use starbase_sandbox::predicates::prelude::*; use std::collections::BTreeMap; use utils::*; @@ -44,7 +44,10 @@ mod alias { assert_eq!( manifest.aliases, - BTreeMap::from_iter([("example".into(), VersionType::parse("19.0.0").unwrap())]) + BTreeMap::from_iter([( + "example".into(), + UnresolvedVersionSpec::parse("19.0.0").unwrap() + )]) ); } @@ -54,9 +57,10 @@ mod alias { let manifest_file = sandbox.path().join("tools/node/manifest.json"); let mut manifest = ToolManifest::load(&manifest_file).unwrap(); - manifest - .aliases - .insert("example".into(), VersionType::parse("19.0.0").unwrap()); + manifest.aliases.insert( + "example".into(), + UnresolvedVersionSpec::parse("19.0.0").unwrap(), + ); manifest.save().unwrap(); let mut cmd = create_proto_command(sandbox.path()); @@ -71,7 +75,10 @@ mod alias { assert_eq!( manifest.aliases, - BTreeMap::from_iter([("example".into(), VersionType::parse("20.0.0").unwrap())]) + BTreeMap::from_iter([( + "example".into(), + UnresolvedVersionSpec::parse("20.0.0").unwrap() + )]) ); } diff --git a/crates/cli/tests/global_test.rs b/crates/cli/tests/global_test.rs index f83892ecb..3a76c100d 100644 --- a/crates/cli/tests/global_test.rs +++ b/crates/cli/tests/global_test.rs @@ -1,6 +1,6 @@ mod utils; -use proto_core::{AliasOrVersion, ToolManifest}; +use proto_core::{ToolManifest, UnresolvedVersionSpec}; use utils::*; mod global { @@ -26,7 +26,7 @@ mod global { assert_eq!( manifest.default_version, - Some(AliasOrVersion::parse("19.0.0").unwrap()) + Some(UnresolvedVersionSpec::parse("19.0.0").unwrap()) ); } @@ -50,7 +50,27 @@ mod global { assert_eq!( manifest.default_version, - Some(AliasOrVersion::Alias("bundled".into())) + Some(UnresolvedVersionSpec::Alias("bundled".into())) + ); + } + + #[test] + fn can_set_partial_version_as_default() { + let temp = create_empty_sandbox(); + let manifest_file = temp.path().join("tools/npm/manifest.json"); + + assert!(!manifest_file.exists()); + + let mut cmd = create_proto_command(temp.path()); + cmd.arg("global").arg("npm").arg("1.2").assert().success(); + + assert!(manifest_file.exists()); + + let manifest = ToolManifest::load(manifest_file).unwrap(); + + assert_eq!( + manifest.default_version, + Some(UnresolvedVersionSpec::parse("1.2").unwrap()) ); } } diff --git a/crates/cli/tests/install_uninstall_test.rs b/crates/cli/tests/install_uninstall_test.rs index 3eda889ea..4dc5598cf 100644 --- a/crates/cli/tests/install_uninstall_test.rs +++ b/crates/cli/tests/install_uninstall_test.rs @@ -1,6 +1,6 @@ mod utils; -use proto_core::{AliasOrVersion, ToolManifest, Version}; +use proto_core::{ToolManifest, UnresolvedVersionSpec, VersionSpec}; use starbase_sandbox::predicates::prelude::*; use std::collections::HashSet; use utils::*; @@ -134,15 +134,15 @@ mod install_uninstall { assert_eq!( manifest.default_version, - Some(AliasOrVersion::parse("19.0.0").unwrap()) + Some(UnresolvedVersionSpec::parse("19.0.0").unwrap()) ); assert_eq!( manifest.installed_versions, - HashSet::from_iter([Version::parse("19.0.0").unwrap()]) + HashSet::from_iter([VersionSpec::parse("19.0.0").unwrap()]) ); assert!(manifest .versions - .contains_key(&Version::parse("19.0.0").unwrap())); + .contains_key(&VersionSpec::parse("19.0.0").unwrap())); // Uninstall let mut cmd = create_proto_command(temp.path()); @@ -158,7 +158,7 @@ mod install_uninstall { assert_eq!(manifest.installed_versions, HashSet::default()); assert!(!manifest .versions - .contains_key(&Version::parse("19.0.0").unwrap())); + .contains_key(&VersionSpec::parse("19.0.0").unwrap())); } #[test] @@ -167,10 +167,10 @@ mod install_uninstall { let manifest_file = temp.path().join("tools/node/manifest.json"); let mut manifest = ToolManifest::load(&manifest_file).unwrap(); - manifest.default_version = Some(AliasOrVersion::parse("18.0.0").unwrap()); + manifest.default_version = Some(UnresolvedVersionSpec::parse("18.0.0").unwrap()); manifest .installed_versions - .insert(Version::parse("18.0.0").unwrap()); + .insert(VersionSpec::parse("18.0.0").unwrap()); manifest.save().unwrap(); let mut cmd = create_proto_command(temp.path()); @@ -186,13 +186,13 @@ mod install_uninstall { assert_eq!( manifest.default_version, - Some(AliasOrVersion::parse("19.0.0").unwrap()) + Some(UnresolvedVersionSpec::parse("19.0.0").unwrap()) ); assert_eq!( manifest.installed_versions, HashSet::from_iter([ - Version::parse("18.0.0").unwrap(), - Version::parse("19.0.0").unwrap(), + VersionSpec::parse("18.0.0").unwrap(), + VersionSpec::parse("19.0.0").unwrap(), ]) ); } diff --git a/crates/cli/tests/list_test.rs b/crates/cli/tests/list_test.rs index 630b45e0c..ea4df4021 100644 --- a/crates/cli/tests/list_test.rs +++ b/crates/cli/tests/list_test.rs @@ -1,6 +1,6 @@ mod utils; -use proto_core::{AliasOrVersion, ToolManifest, Version}; +use proto_core::{ToolManifest, UnresolvedVersionSpec, VersionSpec}; use utils::*; mod list { @@ -12,16 +12,16 @@ mod list { let mut manifest = ToolManifest::load(temp.path().join("tools/node/manifest.json")).unwrap(); - manifest.default_version = Some(AliasOrVersion::parse("19.0.0").unwrap()); + manifest.default_version = Some(UnresolvedVersionSpec::parse("19.0.0").unwrap()); manifest .installed_versions - .insert(Version::parse("19.0.0").unwrap()); + .insert(VersionSpec::parse("19.0.0").unwrap()); manifest .installed_versions - .insert(Version::parse("18.0.0").unwrap()); + .insert(VersionSpec::parse("18.0.0").unwrap()); manifest .installed_versions - .insert(Version::parse("17.0.0").unwrap()); + .insert(VersionSpec::parse("17.0.0").unwrap()); manifest.save().unwrap(); let mut cmd = create_proto_command(temp.path()); diff --git a/crates/cli/tests/local_test.rs b/crates/cli/tests/local_test.rs index c73fc5d16..3f2408e0a 100644 --- a/crates/cli/tests/local_test.rs +++ b/crates/cli/tests/local_test.rs @@ -63,15 +63,11 @@ npm = "9.0.0" ); let mut cmd = create_proto_command(temp.path()); - cmd.arg("local") - .arg("node") - .arg("19.0.0") - .assert() - .success(); + cmd.arg("local").arg("node").arg("19").assert().success(); assert_eq!( fs::read_to_string(version_file).unwrap(), - r#"node = "19.0.0" + r#"node = "~19" npm = "9.0.0" "# ) @@ -97,4 +93,21 @@ npm = "9.0.0" "npm = \"bundled\"\n" ) } + + #[test] + fn can_set_partial_version() { + let temp = create_empty_sandbox(); + let version_file = temp.path().join(".prototools"); + + assert!(!version_file.exists()); + + let mut cmd = create_proto_command(temp.path()); + cmd.arg("local").arg("npm").arg("1.2").assert().success(); + + assert!(version_file.exists()); + assert_eq!( + fs::read_to_string(version_file).unwrap(), + "npm = \"~1.2\"\n" + ) + } } diff --git a/crates/cli/tests/plugins_test.rs b/crates/cli/tests/plugins_test.rs index 6d9352160..46ed63859 100644 --- a/crates/cli/tests/plugins_test.rs +++ b/crates/cli/tests/plugins_test.rs @@ -2,7 +2,8 @@ mod utils; use futures::Future; use proto_core::{ - load_tool_from_locator, Id, PluginLocator, ProtoEnvironment, Tool, UserConfig, VersionType, + load_tool_from_locator, Id, PluginLocator, ProtoEnvironment, Tool, UnresolvedVersionSpec, + UserConfig, }; use std::env; use std::path::{Path, PathBuf}; @@ -20,7 +21,7 @@ where env::set_var("PROTO_HOME", fixture.path().to_string_lossy().to_string()); - tool.setup(&VersionType::parse("1.0.0").unwrap()) + tool.setup(&UnresolvedVersionSpec::parse("1.0.0").unwrap()) .await .unwrap(); @@ -196,6 +197,16 @@ mod builtins { assert.success(); } + #[test] + fn supports_python() { + let temp = create_empty_sandbox(); + + let mut cmd = create_proto_command(temp.path()); + let assert = cmd.arg("install").arg("python").assert(); + + assert.success(); + } + #[test] fn supports_rust() { let temp = create_empty_sandbox(); diff --git a/crates/cli/tests/run_test.rs b/crates/cli/tests/run_test.rs index 9d739065e..2728f011a 100644 --- a/crates/cli/tests/run_test.rs +++ b/crates/cli/tests/run_test.rs @@ -1,6 +1,6 @@ mod utils; -use proto_core::{ToolManifest, Version}; +use proto_core::{ToolManifest, VersionSpec}; use starbase_sandbox::predicates::prelude::*; use std::{env, fs}; use utils::*; @@ -172,7 +172,7 @@ mod run { .assert(); let manifest = ToolManifest::load(&manifest_file).unwrap(); - let version = Version::parse("19.0.0").unwrap(); + let version = VersionSpec::parse("19.0.0").unwrap(); let last_used_at = manifest.versions.get(&version).unwrap().last_used_at; diff --git a/crates/cli/tests/unalias_test.rs b/crates/cli/tests/unalias_test.rs index a0565a097..cc8d10fe3 100644 --- a/crates/cli/tests/unalias_test.rs +++ b/crates/cli/tests/unalias_test.rs @@ -1,6 +1,6 @@ mod utils; -use proto_core::{ToolManifest, VersionType}; +use proto_core::{ToolManifest, UnresolvedVersionSpec}; use starbase_sandbox::predicates::prelude::*; use std::collections::BTreeMap; use utils::*; @@ -24,9 +24,10 @@ mod unalias { let manifest_file = sandbox.path().join("tools/node/manifest.json"); let mut manifest = ToolManifest::load(&manifest_file).unwrap(); - manifest - .aliases - .insert("example".into(), VersionType::parse("19.0.0").unwrap()); + manifest.aliases.insert( + "example".into(), + UnresolvedVersionSpec::parse("19.0.0").unwrap(), + ); manifest.save().unwrap(); let mut cmd = create_proto_command(sandbox.path()); @@ -47,9 +48,10 @@ mod unalias { let manifest_file = sandbox.path().join("tools/node/manifest.json"); let mut manifest = ToolManifest::load(&manifest_file).unwrap(); - manifest - .aliases - .insert("example".into(), VersionType::parse("19.0.0").unwrap()); + manifest.aliases.insert( + "example".into(), + UnresolvedVersionSpec::parse("19.0.0").unwrap(), + ); manifest.save().unwrap(); let mut cmd = create_proto_command(sandbox.path()); @@ -63,7 +65,10 @@ mod unalias { assert_eq!( manifest.aliases, - BTreeMap::from_iter([("example".into(), VersionType::parse("19.0.0").unwrap())]) + BTreeMap::from_iter([( + "example".into(), + UnresolvedVersionSpec::parse("19.0.0").unwrap() + )]) ); } } diff --git a/crates/cli/tests/utils.rs b/crates/cli/tests/utils.rs index 2cbb405ee..bb018c28e 100644 --- a/crates/cli/tests/utils.rs +++ b/crates/cli/tests/utils.rs @@ -26,7 +26,7 @@ pub fn create_proto_command>(path: T) -> assert_cmd::Command { let mut cmd = create_command_with_name(path, "proto"); cmd.timeout(std::time::Duration::from_secs(180)); cmd.env("PROTO_HOME", path.as_os_str()); - cmd.env("PROTO_LOG", "debug"); + cmd.env("PROTO_LOG", "trace"); // cmd.env("PROTO_TEST", "true"); cmd } diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 7488b2ef1..0733a02e1 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proto_core" -version = "0.16.4" +version = "0.17.2" edition = "2021" license = "MIT" description = "Core proto APIs." @@ -8,9 +8,9 @@ homepage = "https://moonrepo.dev/proto" repository = "https://github.com/moonrepo/proto" [dependencies] -proto_pdk_api = { version = "0.6.3", path = "../pdk-api" } -proto_wasm_plugin = { version = "0.6.3", path = "../wasm-plugin" } -warpgate = { version = "0.5.3", path = "../warpgate" } +proto_pdk_api = { version = "0.7.1", path = "../pdk-api" } +proto_wasm_plugin = { version = "0.6.5", path = "../wasm-plugin" } +warpgate = { version = "0.5.4", path = "../warpgate" } cached = { workspace = true } extism = { workspace = true } human-sort = { workspace = true } @@ -23,6 +23,7 @@ serde = { workspace = true } serde_json = { workspace = true } sha2 = { workspace = true } starbase_archive = { workspace = true } +starbase_events = "0.2.1" starbase_styles = { workspace = true } starbase_utils = { workspace = true, features = ["fs-lock"] } thiserror = { workspace = true } diff --git a/crates/core/src/events.rs b/crates/core/src/events.rs new file mode 100644 index 000000000..2404ae1ff --- /dev/null +++ b/crates/core/src/events.rs @@ -0,0 +1,50 @@ +use crate::version::*; +use starbase_events::Event; + +macro_rules! impl_event { + ($name:ident, $impl:tt) => { + impl_event!($name, (), $impl); + }; + + ($name:ident, $data:ty, $impl:tt) => { + pub struct $name $impl + + impl Event for $name { + type Data = $data; + } + }; +} + +impl_event!(InstallingEvent, { + pub version: VersionSpec, +}); + +impl_event!(InstalledEvent, { + pub version: VersionSpec, +}); + +impl_event!(InstalledGlobalEvent, { + pub dependency: String, +}); + +impl_event!(UninstallingEvent, { + pub version: VersionSpec, +}); + +impl_event!(UninstalledEvent, { + pub version: VersionSpec, +}); + +impl_event!(UninstalledGlobalEvent, { + pub dependency: String, +}); + +impl_event!(CreatedShimsEvent, { + pub global: Vec, + pub local: Vec, +}); + +impl_event!(ResolvedVersionEvent, { + pub candidate: UnresolvedVersionSpec, + pub version: VersionSpec, +}); diff --git a/crates/core/src/helpers.rs b/crates/core/src/helpers.rs index 9beddece4..ebd9509b3 100644 --- a/crates/core/src/helpers.rs +++ b/crates/core/src/helpers.rs @@ -5,6 +5,7 @@ use regex::Regex; use serde::de::DeserializeOwned; use serde::Serialize; use sha2::{Digest, Sha256}; +use starbase_archive::is_supported_archive_extension; use starbase_utils::dirs::home_dir; use starbase_utils::fs::{self, FsError}; use starbase_utils::json::{self, JsonError}; @@ -132,9 +133,7 @@ pub fn is_cache_enabled() -> bool { } pub fn is_archive_file>(path: P) -> bool { - path.as_ref().extension().map_or(false, |ext| { - ext == "zip" || ext == "tar" || ext == "gz" || ext == "tgz" || ext == "xz" || ext == "txz" - }) + is_supported_archive_extension(path.as_ref()) } pub fn hash_file_contents>(path: P) -> miette::Result { diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index e5559bac9..6b0dcb71f 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -1,4 +1,5 @@ mod error; +mod events; mod helpers; mod proto; mod shimmer; @@ -12,6 +13,7 @@ mod version_detector; mod version_resolver; pub use error::*; +pub use events::*; pub use extism::{manifest::Wasm, Manifest as PluginManifest}; pub use helpers::*; pub use proto::*; diff --git a/crates/core/src/proto.rs b/crates/core/src/proto.rs index c70ce3233..56e123ff7 100644 --- a/crates/core/src/proto.rs +++ b/crates/core/src/proto.rs @@ -1,6 +1,8 @@ use crate::helpers::{get_home_dir, get_proto_home}; +use once_cell::sync::OnceCell; use std::env; use std::path::{Path, PathBuf}; +use warpgate::PluginLoader; #[derive(Clone, Debug)] pub struct ProtoEnvironment { @@ -11,6 +13,8 @@ pub struct ProtoEnvironment { pub tools_dir: PathBuf, pub home: PathBuf, // ~ pub root: PathBuf, // ~/.proto + + loader: OnceCell, } impl ProtoEnvironment { @@ -36,6 +40,15 @@ impl ProtoEnvironment { tools_dir: root.join("tools"), home: get_home_dir()?, root: root.to_owned(), + loader: OnceCell::new(), + }) + } + + pub fn get_plugin_loader(&self) -> &PluginLoader { + self.loader.get_or_init(|| { + let mut loader = PluginLoader::new(&self.plugins_dir, &self.temp_dir); + loader.set_seed(env!("CARGO_PKG_VERSION")); + loader }) } } diff --git a/crates/core/src/tool.rs b/crates/core/src/tool.rs index 83768f37c..e02ec7e66 100644 --- a/crates/core/src/tool.rs +++ b/crates/core/src/tool.rs @@ -1,11 +1,12 @@ use crate::error::ProtoError; +use crate::events::*; use crate::helpers::{hash_file_contents, is_cache_enabled, is_offline}; use crate::proto::ProtoEnvironment; use crate::shimmer::{ create_global_shim, create_local_shim, get_shim_file_name, ShimContext, SHIM_VERSION, }; use crate::tool_manifest::ToolManifest; -use crate::version::{AliasOrVersion, VersionType}; +use crate::version::{UnresolvedVersionSpec, VersionSpec}; use crate::version_resolver::VersionResolver; use crate::{ download_from_url, is_archive_file, read_json_file_with_lock, write_json_file_with_lock, @@ -17,6 +18,7 @@ use proto_pdk_api::*; use proto_wasm_plugin::{create_host_functions, HostData}; use serde::Serialize; use starbase_archive::Archiver; +use starbase_events::Emitter; use starbase_styles::color; use starbase_utils::fs; use std::collections::{BTreeMap, HashSet}; @@ -34,7 +36,17 @@ pub struct Tool { pub metadata: ToolMetadataOutput, pub plugin: PluginContainer<'static>, pub proto: ProtoEnvironment, - pub version: Option, + pub version: Option, + + // Events + pub on_created_shims: Emitter, + pub on_installing: Emitter, + pub on_installed: Emitter, + pub on_installed_global: Emitter, + pub on_resolved_version: Emitter, + pub on_uninstalling: Emitter, + pub on_uninstalled: Emitter, + pub on_uninstalled_global: Emitter, bin_path: Option, globals_dir: Option, @@ -83,6 +95,16 @@ impl Tool { )?, proto: proto.to_owned(), version: None, + + // Events + on_created_shims: Emitter::new(), + on_installing: Emitter::new(), + on_installed: Emitter::new(), + on_installed_global: Emitter::new(), + on_resolved_version: Emitter::new(), + on_uninstalling: Emitter::new(), + on_uninstalled: Emitter::new(), + on_uninstalled_global: Emitter::new(), }; debug!( @@ -157,10 +179,8 @@ impl Tool { } /// Return the resolved version or "latest". - pub fn get_resolved_version(&self) -> AliasOrVersion { - self.version - .clone() - .unwrap_or_else(|| AliasOrVersion::Alias("latest".into())) + pub fn get_resolved_version(&self) -> VersionSpec { + self.version.clone().unwrap_or_default() } /// Return a path to a local shim file if it exists. @@ -194,7 +214,7 @@ impl Tool { } /// Explicitly set the version to use. - pub fn set_version(&mut self, version: AliasOrVersion) { + pub fn set_version(&mut self, version: VersionSpec) { self.version = Some(version); } @@ -299,27 +319,30 @@ impl Tool { if let Some(default) = sync_changes.default_version { modified = true; - self.manifest.default_version = Some(AliasOrVersion::parse(&default)?); + self.manifest.default_version = Some(UnresolvedVersionSpec::parse(&default)?); } if let Some(versions) = sync_changes.versions { modified = true; let mut entries = BTreeMap::new(); - - for version in &versions { - entries.insert( - version.to_owned(), - self.manifest - .versions - .get(version) - .cloned() - .unwrap_or_default(), - ); + let mut installed = HashSet::new(); + + for version in versions { + let key = VersionSpec::Version(version); + let value = self + .manifest + .versions + .get(&key) + .cloned() + .unwrap_or_default(); + + installed.insert(key.clone()); + entries.insert(key, value); } self.manifest.versions = entries; - self.manifest.installed_versions = HashSet::from_iter(versions); + self.manifest.installed_versions = installed; } if modified { @@ -337,7 +360,7 @@ impl Tool { /// To reduce network overhead, results will be cached for 24 hours. pub async fn load_version_resolver( &self, - initial_version: &VersionType, + initial_version: &UnresolvedVersionSpec, ) -> miette::Result { debug!(tool = self.id.as_str(), "Loading available versions"); @@ -349,11 +372,11 @@ impl Tool { if cache_path.exists() && (is_cache_enabled() || is_offline()) { let metadata = fs::metadata(&cache_path)?; - // If offline, always use the cache, otherwise only within the last 24 hours + // If offline, always use the cache, otherwise only within the last 12 hours let read_cache = if is_offline() { true } else if let Ok(modified_time) = metadata.modified().or_else(|_| metadata.created()) { - modified_time > SystemTime::now() - Duration::from_secs(60 * 60 * 24) + modified_time > SystemTime::now() - Duration::from_secs(60 * 60 * 12) } else { false }; @@ -392,27 +415,49 @@ impl Tool { /// Given an initial version, resolve it to a fully qualifed and semantic version /// (or alias) according to the tool's ecosystem. - pub async fn resolve_version(&mut self, initial_version: &VersionType) -> miette::Result<()> { + pub async fn resolve_version( + &mut self, + initial_version: &UnresolvedVersionSpec, + ) -> miette::Result<()> { if self.version.is_some() { return Ok(()); } - // If offline but we have a fully qualified semantic version, - // exit early and assume the version is legitimate! - if is_offline() && matches!(initial_version, VersionType::Version(_)) { - self.version = Some(initial_version.to_explicit_version()); - - return Ok(()); - } - debug!( tool = self.id.as_str(), initial_version = initial_version.to_string(), - "Resolving a semantic version", + "Resolving a semantic version or alias", ); + // If offline but we have a fully qualified semantic version, + // exit early and assume the version is legitimate! Additionally, + // canary is a special type that we can simply just use. + if is_offline() && matches!(initial_version, UnresolvedVersionSpec::Version(_)) + || matches!(initial_version, UnresolvedVersionSpec::Canary) + { + let version = initial_version.to_spec(); + + debug!( + tool = self.id.as_str(), + version = version.to_string(), + "Resolved to {}", + version + ); + + self.on_resolved_version + .emit(ResolvedVersionEvent { + candidate: initial_version.to_owned(), + version: version.clone(), + }) + .await?; + + self.version = Some(version); + + return Ok(()); + } + let resolver = self.load_version_resolver(initial_version).await?; - let mut version = AliasOrVersion::default(); + let mut version = VersionSpec::default(); let mut resolved = false; if self.plugin.has_func("resolve_version") { @@ -432,8 +477,7 @@ impl Tool { ); resolved = true; - version = - AliasOrVersion::Version(resolver.resolve(&VersionType::parse(candidate)?)?); + version = resolver.resolve(&UnresolvedVersionSpec::parse(candidate)?)?; } if let Some(candidate) = result.version { @@ -444,12 +488,12 @@ impl Tool { ); resolved = true; - version = AliasOrVersion::parse(candidate)?; + version = VersionSpec::parse(candidate)?; } } if !resolved { - version = AliasOrVersion::Version(resolver.resolve(initial_version)?); + version = resolver.resolve(initial_version)?; } debug!( @@ -459,6 +503,13 @@ impl Tool { version ); + self.on_resolved_version + .emit(ResolvedVersionEvent { + candidate: initial_version.to_owned(), + version: version.clone(), + }) + .await?; + self.version = Some(version); Ok(()) @@ -472,7 +523,7 @@ impl Tool { pub async fn detect_version_from( &self, current_dir: &Path, - ) -> miette::Result> { + ) -> miette::Result> { if !self.plugin.has_func("detect_version_files") { return Ok(None); } @@ -519,7 +570,7 @@ impl Tool { "Detected a version" ); - return Ok(Some(VersionType::try_from(version)?)); + return Ok(Some(UnresolvedVersionSpec::parse(version)?)); } Ok(None) @@ -695,9 +746,6 @@ impl Tool { /// Install a tool into proto, either by downloading and unpacking /// a pre-built archive, or by using a native installation method. pub async fn install(&mut self) -> miette::Result { - let install_dir = self.get_tool_dir(); - let _install_lock = fs::lock_directory(&install_dir)?; - if self.is_installed() { debug!( tool = self.id.as_str(), @@ -707,6 +755,15 @@ impl Tool { return Ok(false); } + let install_dir = self.get_tool_dir(); + let _install_lock = fs::lock_directory(&install_dir).await?; + + self.on_installing + .emit(InstallingEvent { + version: self.get_resolved_version(), + }) + .await?; + // If this function is defined, it acts like an escape hatch and // takes precedence over all other install strategies if self.plugin.has_func("native_install") { @@ -719,12 +776,20 @@ impl Tool { }, )?; - return Ok(result.installed); + if !result.skip_install { + return Ok(result.installed); + } } // Install from a prebuilt archive self.install_from_prebuilt(&install_dir).await?; + self.on_installed + .emit(InstalledEvent { + version: self.get_resolved_version(), + }) + .await?; + debug!( tool = self.id.as_str(), install_dir = ?install_dir, @@ -759,6 +824,12 @@ impl Tool { ))?; } + self.on_installed_global + .emit(InstalledGlobalEvent { + dependency: dependency.to_owned(), + }) + .await?; + Ok(result.installed) } @@ -775,6 +846,12 @@ impl Tool { return Ok(false); } + self.on_uninstalling + .emit(UninstallingEvent { + version: self.get_resolved_version(), + }) + .await?; + if self.plugin.has_func("native_uninstall") { debug!(tool = self.id.as_str(), "Uninstalling tool natively"); @@ -785,7 +862,7 @@ impl Tool { }, )?; - if !result.uninstalled { + if !result.skip_uninstall && !result.uninstalled { return Ok(false); } } @@ -798,6 +875,12 @@ impl Tool { fs::remove_dir_all(install_dir)?; + self.on_uninstalled + .emit(UninstalledEvent { + version: self.get_resolved_version(), + }) + .await?; + debug!(tool = self.id.as_str(), "Successfully uninstalled tool"); Ok(true) @@ -828,11 +911,21 @@ impl Tool { ))?; } + self.on_uninstalled_global + .emit(UninstalledGlobalEvent { + dependency: dependency.to_owned(), + }) + .await?; + Ok(result.uninstalled) } /// Find the absolute file path to the tool's binary that will be executed. pub async fn locate_bins(&mut self) -> miette::Result<()> { + if self.bin_path.is_some() { + return Ok(()); + } + let mut options = LocateBinsOutput::default(); let tool_dir = self.get_tool_dir(); @@ -876,7 +969,7 @@ impl Tool { /// Find the directory global packages are installed to. pub async fn locate_globals_dir(&mut self) -> miette::Result<()> { - if !self.plugin.has_func("locate_bins") { + if !self.plugin.has_func("locate_bins") || self.globals_dir.is_some() { return Ok(()); } @@ -944,30 +1037,33 @@ impl Tool { impl Tool { /// Create the context object required for creating shim files. pub fn create_shim_context(&self) -> ShimContext { - let mut context = ShimContext { + ShimContext { shim_file: &self.id, bin: &self.id, tool_id: &self.id, tool_dir: Some(self.get_tool_dir()), + tool_version: Some(self.get_resolved_version().to_string()), ..ShimContext::default() - }; - - if let AliasOrVersion::Version(version) = self.get_resolved_version() { - context.tool_version = Some(version.to_string()); } - - context } /// Create global and local shim files for the current tool. /// If find only is enabled, will only check if they exist, and not create. pub async fn create_shims(&self, find_only: bool) -> miette::Result<()> { let mut primary_context = self.create_shim_context(); + let mut shim_event = CreatedShimsEvent { + global: vec![], + local: vec![], + }; // If not configured from the plugin, always create the primary global if !self.plugin.has_func("create_shims") { create_global_shim(&self.proto, primary_context, find_only)?; + shim_event.global.push(self.id.to_string()); + + self.on_created_shims.emit(shim_event).await?; + return Ok(()); } @@ -986,6 +1082,7 @@ impl Tool { if !shim_configs.no_primary_global { create_global_shim(&self.proto, primary_context, find_only)?; + shim_event.global.push(self.id.to_string()); } // Create alternate/secondary global shims @@ -997,6 +1094,7 @@ impl Tool { context.after_args = config.after_args.as_deref(); create_global_shim(&self.proto, context, find_only)?; + shim_event.global.push(name.to_owned()); } // Create local shims @@ -1015,8 +1113,11 @@ impl Tool { context.after_args = config.after_args.as_deref(); create_local_shim(context, find_only)?; + shim_event.local.push(name.to_owned()); } + self.on_created_shims.emit(shim_event).await?; + Ok(()) } } @@ -1025,16 +1126,20 @@ impl Tool { impl Tool { fn is_installed(&self) -> bool { - if let Some(AliasOrVersion::Version(version)) = &self.version { - return self.manifest.installed_versions.contains(version) - && self.get_tool_dir().exists(); - } + let dir = self.get_tool_dir(); - false + self.version + .as_ref() + .is_some_and(|v| !v.is_latest() && !v.is_canary()) + && dir.exists() + && !fs::is_dir_locked(dir) } /// Return true if the tool has been setup (installed and binaries are located). - pub async fn is_setup(&mut self, initial_version: &VersionType) -> miette::Result { + pub async fn is_setup( + &mut self, + initial_version: &UnresolvedVersionSpec, + ) -> miette::Result { self.resolve_version(initial_version).await?; let install_dir = self.get_tool_dir(); @@ -1067,24 +1172,23 @@ impl Tool { /// Setup the tool by resolving a semantic version, installing the tool, /// locating binaries, creating shims, and more. - pub async fn setup(&mut self, initial_version: &VersionType) -> miette::Result { + pub async fn setup(&mut self, initial_version: &UnresolvedVersionSpec) -> miette::Result { self.resolve_version(initial_version).await?; if self.install().await? { self.locate_bins().await?; self.setup_shims(true).await?; - // Only insert if a version - if let AliasOrVersion::Version(version) = self.get_resolved_version() { - let mut default = None; - - if let Some(default_version) = &self.metadata.default_version { - default = Some(AliasOrVersion::parse(default_version)?); - } + // Add version to manifest + let mut default = None; - self.manifest.insert_version(&version, default)?; + if let Some(default_version) = &self.metadata.default_version { + default = Some(UnresolvedVersionSpec::parse(default_version)?); } + self.manifest + .insert_version(self.get_resolved_version(), default)?; + // Allow plugins to override manifest self.sync_manifest()?; @@ -1121,9 +1225,7 @@ impl Tool { if self.uninstall().await? { // Only remove if uninstall was successful - if let AliasOrVersion::Version(version) = self.get_resolved_version() { - self.manifest.remove_version(&version)?; - } + self.manifest.remove_version(self.get_resolved_version())?; return Ok(true); } diff --git a/crates/core/src/tool_loader.rs b/crates/core/src/tool_loader.rs index 73860d7dd..fdb25df60 100644 --- a/crates/core/src/tool_loader.rs +++ b/crates/core/src/tool_loader.rs @@ -14,7 +14,7 @@ use std::{ path::Path, }; use tracing::debug; -use warpgate::{to_virtual_path, Id, PluginLoader, PluginLocator}; +use warpgate::{to_virtual_path, Id, PluginLocator}; pub fn inject_default_manifest_config( id: &Id, @@ -60,10 +60,8 @@ pub async fn load_tool_from_locator( let proto = proto.as_ref(); let locator = locator.as_ref(); - let mut loader = PluginLoader::new(&proto.plugins_dir, &proto.temp_dir); - loader.set_seed(env!("CARGO_PKG_VERSION")); - - let plugin_path = loader.load_plugin(&id, locator).await?; + let plugin_loader = proto.get_plugin_loader(); + let plugin_path = plugin_loader.load_plugin(&id, locator).await?; // If a TOML plugin, we need to load the WASM plugin for it, // wrap it, and modify the plugin manifest. @@ -76,7 +74,11 @@ pub async fn load_tool_from_locator( let mut manifest = Tool::create_plugin_manifest( proto, - Wasm::file(loader.load_plugin(id, ToolsConfig::schema_plugin()).await?), + Wasm::file( + plugin_loader + .load_plugin(id, ToolsConfig::schema_plugin()) + .await?, + ), )?; manifest diff --git a/crates/core/src/tool_manifest.rs b/crates/core/src/tool_manifest.rs index 887c55eeb..c576dad5a 100644 --- a/crates/core/src/tool_manifest.rs +++ b/crates/core/src/tool_manifest.rs @@ -1,8 +1,7 @@ use crate::{ helpers::{read_json_file_with_lock, write_json_file_with_lock}, - version::{AliasOrVersion, VersionType}, + version::{UnresolvedVersionSpec, VersionSpec}, }; -use semver::Version; use serde::{Deserialize, Serialize}; use std::{ collections::{BTreeMap, HashSet}, @@ -42,11 +41,14 @@ impl Default for ToolManifestVersion { #[derive(Debug, Default, Deserialize, Serialize)] #[serde(default)] pub struct ToolManifest { - pub aliases: BTreeMap, - pub default_version: Option, - pub installed_versions: HashSet, + // Partial versions allowed + pub aliases: BTreeMap, + pub default_version: Option, + + // Full versions only + pub installed_versions: HashSet, pub shim_version: u8, - pub versions: BTreeMap, + pub versions: BTreeMap, #[serde(skip)] pub path: PathBuf, @@ -85,47 +87,46 @@ impl ToolManifest { pub fn insert_version( &mut self, - version: &Version, - default_version: Option, + version: VersionSpec, + default_version: Option, ) -> miette::Result<()> { if self.default_version.is_none() { - self.default_version = Some( - default_version.unwrap_or_else(|| AliasOrVersion::Version(version.to_owned())), - ); + self.default_version = + Some(default_version.unwrap_or_else(|| version.to_unresolved_spec())); } - self.installed_versions.insert(version.to_owned()); + self.installed_versions.insert(version.clone()); self.versions - .insert(version.to_owned(), ToolManifestVersion::default()); + .insert(version, ToolManifestVersion::default()); self.save()?; Ok(()) } - pub fn remove_version(&mut self, version: &Version) -> miette::Result<()> { - self.installed_versions.remove(version); + pub fn remove_version(&mut self, version: VersionSpec) -> miette::Result<()> { + self.installed_versions.remove(&version); // Remove default version if nothing available if (self.installed_versions.is_empty() && self.default_version.is_some()) - || self.default_version.as_ref().is_some_and(|v| v == version) + || self.default_version.as_ref().is_some_and(|v| v == &version) { info!("Unpinning default global version"); self.default_version = None; } - self.versions.remove(version); + self.versions.remove(&version); self.save()?; Ok(()) } - pub fn track_used_at(&mut self, version: &Version) { + pub fn track_used_at(&mut self, version: VersionSpec) { self.versions - .entry(version.to_owned()) + .entry(version) .and_modify(|v| { v.last_used_at = Some(now()); }) diff --git a/crates/core/src/tools_config.rs b/crates/core/src/tools_config.rs index 7ee2b8970..af8db8ed3 100644 --- a/crates/core/src/tools_config.rs +++ b/crates/core/src/tools_config.rs @@ -1,4 +1,4 @@ -use crate::version::AliasOrVersion; +use crate::version::UnresolvedVersionSpec; use miette::IntoDiagnostic; use serde::{Deserialize, Serialize}; use starbase_utils::{fs, toml}; @@ -18,7 +18,7 @@ fn is_empty(map: &BTreeMap) -> bool { #[serde(default, rename_all = "kebab-case")] pub struct ToolsConfig { #[serde(flatten, skip_serializing_if = "is_empty")] - pub tools: BTreeMap, + pub tools: BTreeMap, #[serde(skip_serializing_if = "is_empty")] pub plugins: BTreeMap, @@ -164,6 +164,15 @@ impl ToolsConfig { } } + if !self.plugins.contains_key("python") { + self.plugins.insert( + Id::raw("python"), + PluginLocator::SourceUrl { + url: "https://github.com/moonrepo/python-plugin/releases/latest/download/python_plugin.wasm".into() + } + ); + } + if !self.plugins.contains_key("rust") { self.plugins.insert( Id::raw("rust"), diff --git a/crates/core/src/version.rs b/crates/core/src/version.rs index 89ac09453..94882ff99 100644 --- a/crates/core/src/version.rs +++ b/crates/core/src/version.rs @@ -10,41 +10,51 @@ use std::str::FromStr; #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(untagged, into = "String", try_from = "String")] -pub enum VersionType { +pub enum UnresolvedVersionSpec { + Canary, Alias(String), - ReqAll(VersionReq), + Req(VersionReq), ReqAny(Vec), Version(Version), } -impl VersionType { +impl UnresolvedVersionSpec { pub fn parse>(value: T) -> miette::Result { Ok(Self::from_str(value.as_ref())?) } - pub fn to_explicit_version(&self) -> AliasOrVersion { + pub fn is_canary(&self) -> bool { + matches!(self, UnresolvedVersionSpec::Canary) + } + + pub fn to_spec(&self) -> VersionSpec { match self { - VersionType::Alias(alias) => AliasOrVersion::Alias(alias.to_owned()), - VersionType::Version(version) => AliasOrVersion::Version(version.to_owned()), + UnresolvedVersionSpec::Canary => VersionSpec::Alias("canary".to_owned()), + UnresolvedVersionSpec::Alias(alias) => VersionSpec::Alias(alias.to_owned()), + UnresolvedVersionSpec::Version(version) => VersionSpec::Version(version.to_owned()), _ => unreachable!(), } } } -impl Default for VersionType { +impl Default for UnresolvedVersionSpec { fn default() -> Self { Self::Alias("latest".into()) } } -impl FromStr for VersionType { +impl FromStr for UnresolvedVersionSpec { type Err = ProtoError; fn from_str(value: &str) -> Result { let value = remove_space_after_gtlt(remove_v_prefix(value.trim().replace(".*", ""))); + if value == "canary" { + return Ok(UnresolvedVersionSpec::Canary); + } + if is_alias_name(&value) { - return Ok(VersionType::Alias(value)); + return Ok(UnresolvedVersionSpec::Alias(value)); } let handle_error = |error: semver::Error| ProtoError::Semver { @@ -64,41 +74,41 @@ impl FromStr for VersionType { any.push(VersionReq::parse(req).map_err(handle_error)?); } - return Ok(VersionType::ReqAny(any)); + return Ok(UnresolvedVersionSpec::ReqAny(any)); } // AND requirements if value.contains(',') { - return Ok(VersionType::ReqAll( + return Ok(UnresolvedVersionSpec::Req( VersionReq::parse(&value).map_err(handle_error)?, )); } else if value.contains(' ') { - return Ok(VersionType::ReqAll( + return Ok(UnresolvedVersionSpec::Req( VersionReq::parse(&value.replace(' ', ", ")).map_err(handle_error)?, )); } Ok(match value.chars().next().unwrap() { '=' | '^' | '~' | '>' | '<' | '*' => { - VersionType::ReqAll(VersionReq::parse(&value).map_err(handle_error)?) + UnresolvedVersionSpec::Req(VersionReq::parse(&value).map_err(handle_error)?) } _ => { let dot_count = value.match_indices('.').collect::>().len(); // If not fully qualified, match using a requirement if dot_count < 2 { - VersionType::ReqAll( + UnresolvedVersionSpec::Req( VersionReq::parse(&format!("~{value}")).map_err(handle_error)?, ) } else { - VersionType::Version(Version::parse(&value).map_err(handle_error)?) + UnresolvedVersionSpec::Version(Version::parse(&value).map_err(handle_error)?) } } }) } } -impl TryFrom for VersionType { +impl TryFrom for UnresolvedVersionSpec { type Error = ProtoError; fn try_from(value: String) -> Result { @@ -106,17 +116,18 @@ impl TryFrom for VersionType { } } -impl Into for VersionType { +impl Into for UnresolvedVersionSpec { fn into(self) -> String { self.to_string() } } -impl Display for VersionType { +impl Display for UnresolvedVersionSpec { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { + Self::Canary => write!(f, "canary"), Self::Alias(alias) => write!(f, "{}", alias), - Self::ReqAll(req) => write!(f, "{}", req), + Self::Req(req) => write!(f, "{}", req), Self::ReqAny(reqs) => write!( f, "{}", @@ -130,43 +141,68 @@ impl Display for VersionType { } } -#[derive(Clone, Deserialize, PartialEq, Serialize)] +impl PartialEq for UnresolvedVersionSpec { + fn eq(&self, other: &VersionSpec) -> bool { + match (self, other) { + (Self::Canary, VersionSpec::Alias(a)) => a == "canary", + (Self::Alias(a1), VersionSpec::Alias(a2)) => a1 == a2, + (Self::Version(v1), VersionSpec::Version(v2)) => v1 == v2, + _ => false, + } + } +} + +#[derive(Clone, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] #[serde(untagged, into = "String", try_from = "String")] -pub enum AliasOrVersion { +pub enum VersionSpec { Alias(String), Version(Version), } -impl AliasOrVersion { +impl VersionSpec { pub fn parse>(value: T) -> miette::Result { Ok(Self::from_str(value.as_ref())?) } - pub fn to_implicit_type(&self) -> VersionType { + pub fn is_canary(&self) -> bool { + match self { + Self::Alias(alias) => alias == "canary", + Self::Version(_) => false, + } + } + + pub fn is_latest(&self) -> bool { + match self { + Self::Alias(alias) => alias == "latest", + Self::Version(_) => false, + } + } + + pub fn to_unresolved_spec(&self) -> UnresolvedVersionSpec { match self { - Self::Alias(alias) => VersionType::Alias(alias.to_owned()), - Self::Version(version) => VersionType::Version(version.to_owned()), + Self::Alias(alias) => UnresolvedVersionSpec::Alias(alias.to_owned()), + Self::Version(version) => UnresolvedVersionSpec::Version(version.to_owned()), } } } -impl Default for AliasOrVersion { +impl Default for VersionSpec { fn default() -> Self { Self::Alias("latest".into()) } } -impl FromStr for AliasOrVersion { +impl FromStr for VersionSpec { type Err = ProtoError; fn from_str(value: &str) -> Result { let value = remove_space_after_gtlt(remove_v_prefix(value.trim().replace(".*", ""))); if is_alias_name(&value) { - return Ok(AliasOrVersion::Alias(value)); + return Ok(VersionSpec::Alias(value)); } - Ok(AliasOrVersion::Version(Version::parse(&value).map_err( + Ok(VersionSpec::Version(Version::parse(&value).map_err( |error| ProtoError::Semver { version: value, error, @@ -175,7 +211,7 @@ impl FromStr for AliasOrVersion { } } -impl TryFrom for AliasOrVersion { +impl TryFrom for VersionSpec { type Error = ProtoError; fn try_from(value: String) -> Result { @@ -183,19 +219,19 @@ impl TryFrom for AliasOrVersion { } } -impl Into for AliasOrVersion { +impl Into for VersionSpec { fn into(self) -> String { self.to_string() } } -impl Debug for AliasOrVersion { +impl Debug for VersionSpec { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self) } } -impl Display for AliasOrVersion { +impl Display for VersionSpec { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Alias(alias) => write!(f, "{}", alias), @@ -204,7 +240,7 @@ impl Display for AliasOrVersion { } } -impl PartialEq<&str> for AliasOrVersion { +impl PartialEq<&str> for VersionSpec { fn eq(&self, other: &&str) -> bool { match self { Self::Alias(alias) => alias == other, @@ -213,7 +249,7 @@ impl PartialEq<&str> for AliasOrVersion { } } -impl PartialEq for AliasOrVersion { +impl PartialEq for VersionSpec { fn eq(&self, other: &Version) -> bool { match self { Self::Version(version) => version == other, diff --git a/crates/core/src/version_detector.rs b/crates/core/src/version_detector.rs index bc451ccd0..d105729d5 100644 --- a/crates/core/src/version_detector.rs +++ b/crates/core/src/version_detector.rs @@ -1,14 +1,14 @@ use crate::error::ProtoError; use crate::tool::Tool; use crate::tools_config::ToolsConfig; -use crate::version::VersionType; +use crate::version::UnresolvedVersionSpec; use std::{env, path::Path}; use tracing::{debug, trace}; pub async fn detect_version( tool: &Tool, - forced_version: Option, -) -> miette::Result { + forced_version: Option, +) -> miette::Result { let mut candidate = forced_version; // Env var takes highest priority @@ -23,7 +23,7 @@ pub async fn detect_version( "Detected version from environment variable", ); - candidate = Some(VersionType::parse(session_version)?); + candidate = Some(UnresolvedVersionSpec::parse(session_version)?); } else { trace!( tool = tool.id.as_str(), @@ -65,7 +65,7 @@ pub async fn detect_version( "Detected version from .prototools file", ); - candidate = Some(local_version.to_implicit_type()); + candidate = Some(local_version.to_owned()); break; } @@ -100,7 +100,7 @@ pub async fn detect_version( "Detected global version from manifest", ); - candidate = Some(global_version.to_implicit_type()); + candidate = Some(global_version.to_owned()); } } diff --git a/crates/core/src/version_resolver.rs b/crates/core/src/version_resolver.rs index ec6d43cca..c283d3fbd 100644 --- a/crates/core/src/version_resolver.rs +++ b/crates/core/src/version_resolver.rs @@ -1,13 +1,14 @@ use crate::error::ProtoError; use crate::tool_manifest::ToolManifest; -use crate::version::VersionType; +use crate::version::UnresolvedVersionSpec; +use crate::VersionSpec; use proto_pdk_api::LoadVersionsOutput; use semver::{Version, VersionReq}; -use std::collections::BTreeMap; +use std::collections::{BTreeMap, HashSet}; #[derive(Debug, Default)] pub struct VersionResolver<'tool> { - pub aliases: BTreeMap, + pub aliases: BTreeMap, pub versions: Vec, manifest: Option<&'tool ToolManifest>, @@ -21,18 +22,23 @@ impl<'tool> VersionResolver<'tool> { for (alias, version) in output.aliases { resolver .aliases - .insert(alias, VersionType::Version(version)); + .insert(alias, UnresolvedVersionSpec::Version(version)); } if let Some(latest) = output.latest { resolver .aliases - .insert("latest".into(), VersionType::Version(latest)); + .insert("latest".into(), UnresolvedVersionSpec::Version(latest)); } + // if let Some(canary) = output.canary { + // resolver + // .aliases + // .insert("canary".into(), UnresolvedVersionSpec::Version(canary)); + // } + // Sort from newest to oldest resolver.versions.sort_by(|a, d| d.cmp(a)); - // resolver.canary_versions.sort_by(|a, d| d.cmp(a)); resolver } @@ -43,12 +49,12 @@ impl<'tool> VersionResolver<'tool> { Ok(()) } - pub fn resolve(&self, candidate: &VersionType) -> miette::Result { + pub fn resolve(&self, candidate: &UnresolvedVersionSpec) -> miette::Result { resolve_version(candidate, &self.versions, &self.aliases, self.manifest) } } -pub fn match_highest_version<'l, I>(req: &'l VersionReq, versions: I) -> Option +pub fn match_highest_version<'l, I>(req: &'l VersionReq, versions: I) -> Option where I: IntoIterator, { @@ -62,52 +68,89 @@ where } } - highest_match + highest_match.map(VersionSpec::Version) +} + +// Filter out aliases because they cannot be matched against +fn extract_installed_versions(installed: &HashSet) -> HashSet<&Version> { + installed + .iter() + .filter_map(|item| match item { + VersionSpec::Alias(_) => None, + VersionSpec::Version(v) => Some(v), + }) + .collect() } pub fn resolve_version( - candidate: &VersionType, + candidate: &UnresolvedVersionSpec, versions: &[Version], - aliases: &BTreeMap, + aliases: &BTreeMap, manifest: Option<&ToolManifest>, -) -> miette::Result { +) -> miette::Result { + let installed_versions = if let Some(manifest) = manifest { + extract_installed_versions(&manifest.installed_versions) + } else { + HashSet::new() + }; + match &candidate { - VersionType::Alias(alias) => { - if let Some(alias_type) = aliases.get(alias) { - return resolve_version(alias_type, versions, aliases, manifest); - } + UnresolvedVersionSpec::Canary => { + return Ok(VersionSpec::Alias("canary".into())); } - VersionType::ReqAll(req) => { - // Prefer installed versions + UnresolvedVersionSpec::Alias(alias) => { + let mut alias_value = None; + if let Some(manifest) = manifest { - if let Some(version) = match_highest_version(req, &manifest.installed_versions) { + alias_value = manifest.aliases.get(alias); + } + + if alias_value.is_none() { + alias_value = aliases.get(alias); + } + + if let Some(value) = alias_value { + return resolve_version(value, versions, aliases, manifest); + } + } + UnresolvedVersionSpec::Req(req) => { + // Check locally installed versions first + if !installed_versions.is_empty() { + if let Some(version) = match_highest_version(req, installed_versions) { return Ok(version); } } + // Otherwise we'll need to download from remote if let Some(version) = match_highest_version(req, versions) { return Ok(version); } } - VersionType::ReqAny(reqs) => { + UnresolvedVersionSpec::ReqAny(reqs) => { for req in reqs { - // Prefer installed versions - if let Some(manifest) = manifest { - if let Some(version) = match_highest_version(req, &manifest.installed_versions) - { + // Check locally installed versions first + if !installed_versions.is_empty() { + if let Some(version) = match_highest_version(req, installed_versions.clone()) { return Ok(version); } } + // Otherwise we'll need to download from remote if let Some(version) = match_highest_version(req, versions) { return Ok(version); } } } - VersionType::Version(ver) => { + UnresolvedVersionSpec::Version(ver) => { + // Check locally installed versions first + if installed_versions.contains(ver) { + return Ok(VersionSpec::Version(ver.to_owned())); + } + + // Otherwise we'll need to download from remote for version in versions { if ver == version { - return Ok(ver.to_owned()); + return Ok(VersionSpec::Version(ver.to_owned())); } } } diff --git a/crates/core/tests/tools_config_test.rs b/crates/core/tests/tools_config_test.rs index 59b1d9962..d16702c23 100644 --- a/crates/core/tests/tools_config_test.rs +++ b/crates/core/tests/tools_config_test.rs @@ -1,4 +1,4 @@ -use proto_core::{AliasOrVersion, ToolsConfig}; +use proto_core::{ToolsConfig, UnresolvedVersionSpec}; use starbase_sandbox::create_empty_sandbox; use std::collections::BTreeMap; use std::str::FromStr; @@ -56,8 +56,14 @@ kebab-case = "source:./camel.toml" assert_eq!( config.tools, BTreeMap::from_iter([ - (Id::raw("node"), AliasOrVersion::from_str("12.0.0").unwrap()), - (Id::raw("rust"), AliasOrVersion::Alias("stable".into())), + ( + Id::raw("node"), + UnresolvedVersionSpec::from_str("12.0.0").unwrap() + ), + ( + Id::raw("rust"), + UnresolvedVersionSpec::Alias("stable".into()) + ), ]) ); @@ -87,12 +93,14 @@ kebab-case = "source:./camel.toml" let sandbox = create_empty_sandbox(); let mut config = ToolsConfig::load_from(sandbox.path()).unwrap(); - config - .tools - .insert(Id::raw("node"), AliasOrVersion::from_str("12.0.0").unwrap()); - config - .tools - .insert(Id::raw("rust"), AliasOrVersion::Alias("stable".into())); + config.tools.insert( + Id::raw("node"), + UnresolvedVersionSpec::from_str("12.0.0").unwrap(), + ); + config.tools.insert( + Id::raw("rust"), + UnresolvedVersionSpec::Alias("stable".into()), + ); config.plugins.insert( Id::raw("foo"), @@ -159,9 +167,18 @@ foo = "source:./test.toml" assert_eq!( config.tools, BTreeMap::from_iter([ - (Id::raw("node"), AliasOrVersion::parse("1.2.3").unwrap()), - (Id::raw("bun"), AliasOrVersion::parse("4.5.6").unwrap()), - (Id::raw("deno"), AliasOrVersion::parse("7.8.9").unwrap()), + ( + Id::raw("node"), + UnresolvedVersionSpec::parse("1.2.3").unwrap() + ), + ( + Id::raw("bun"), + UnresolvedVersionSpec::parse("4.5.6").unwrap() + ), + ( + Id::raw("deno"), + UnresolvedVersionSpec::parse("7.8.9").unwrap() + ), ]) ); diff --git a/crates/core/tests/version_resolver_test.rs b/crates/core/tests/version_resolver_test.rs index b0b49246f..f747d28f8 100644 --- a/crates/core/tests/version_resolver_test.rs +++ b/crates/core/tests/version_resolver_test.rs @@ -1,4 +1,4 @@ -use proto_core::{resolve_version, VersionType}; +use proto_core::{resolve_version, ToolManifest, UnresolvedVersionSpec, VersionSpec}; use semver::Version; use std::collections::BTreeMap; @@ -19,21 +19,49 @@ mod version_resolver { ] } - fn create_aliases() -> BTreeMap { + fn create_aliases() -> BTreeMap { BTreeMap::from_iter([ ( "latest".into(), - VersionType::Version(Version::new(10, 0, 0)), + UnresolvedVersionSpec::Version(Version::new(10, 0, 0)), + ), + ( + "stable".into(), + UnresolvedVersionSpec::Alias("latest".into()), ), - ("stable".into(), VersionType::Alias("latest".into())), ( "no-version".into(), - VersionType::Version(Version::new(20, 0, 0)), + UnresolvedVersionSpec::Version(Version::new(20, 0, 0)), + ), + ( + "no-alias".into(), + UnresolvedVersionSpec::Alias("missing".into()), ), - ("no-alias".into(), VersionType::Alias("missing".into())), ]) } + fn create_manifest() -> ToolManifest { + let mut manifest = ToolManifest::default(); + + manifest.aliases.insert( + "latest-manifest".into(), + UnresolvedVersionSpec::Version(Version::new(8, 0, 0)), + ); + manifest.aliases.insert( + "stable-manifest".into(), + UnresolvedVersionSpec::Alias("stable".into()), + ); + + manifest + .installed_versions + .insert(VersionSpec::parse("3.0.0").unwrap()); + manifest + .installed_versions + .insert(VersionSpec::parse("3.3.3").unwrap()); + + manifest + } + #[test] fn resolves_aliases() { let versions = create_versions(); @@ -41,7 +69,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::Alias("latest".into()), + &UnresolvedVersionSpec::Alias("latest".into()), &versions, &aliases, None, @@ -52,7 +80,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::Alias("stable".into()), + &UnresolvedVersionSpec::Alias("stable".into()), &versions, &aliases, None, @@ -62,6 +90,35 @@ mod version_resolver { ); } + #[test] + fn resolves_aliases_from_manifest() { + let versions = create_versions(); + let aliases = create_aliases(); + let manifest = create_manifest(); + + assert_eq!( + resolve_version( + &UnresolvedVersionSpec::Alias("latest-manifest".into()), + &versions, + &aliases, + Some(&manifest), + ) + .unwrap(), + Version::new(8, 0, 0) + ); + + assert_eq!( + resolve_version( + &UnresolvedVersionSpec::Alias("stable-manifest".into()), + &versions, + &aliases, + Some(&manifest), + ) + .unwrap(), + Version::new(10, 0, 0) + ); + } + #[test] #[should_panic(expected = "Failed to resolve a semantic version for unknown.")] fn errors_unknown_alias() { @@ -69,7 +126,7 @@ mod version_resolver { let aliases = create_aliases(); resolve_version( - &VersionType::Alias("unknown".into()), + &UnresolvedVersionSpec::Alias("unknown".into()), &versions, &aliases, None, @@ -84,7 +141,7 @@ mod version_resolver { let aliases = create_aliases(); resolve_version( - &VersionType::Alias("no-alias".into()), + &UnresolvedVersionSpec::Alias("no-alias".into()), &versions, &aliases, None, @@ -99,7 +156,7 @@ mod version_resolver { let aliases = create_aliases(); resolve_version( - &VersionType::Alias("no-version".into()), + &UnresolvedVersionSpec::Alias("no-version".into()), &versions, &aliases, None, @@ -114,7 +171,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::Version(Version::new(1, 10, 5)), + &UnresolvedVersionSpec::Version(Version::new(1, 10, 5)), &versions, &aliases, None, @@ -125,7 +182,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::Version(Version::new(8, 0, 0)), + &UnresolvedVersionSpec::Version(Version::new(8, 0, 0)), &versions, &aliases, None, @@ -135,6 +192,24 @@ mod version_resolver { ); } + #[test] + fn resolves_versions_from_manifest() { + let versions = create_versions(); + let aliases = create_aliases(); + let manifest = create_manifest(); + + assert_eq!( + resolve_version( + &UnresolvedVersionSpec::Version(Version::new(3, 0, 0)), + &versions, + &aliases, + Some(&manifest), + ) + .unwrap(), + Version::new(3, 0, 0) + ); + } + #[test] fn resolves_partial_versions() { let versions = create_versions(); @@ -142,7 +217,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse("1.2").unwrap(), + &UnresolvedVersionSpec::parse("1.2").unwrap(), &versions, &aliases, None, @@ -153,7 +228,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse("1.0").unwrap(), + &UnresolvedVersionSpec::parse("1.0").unwrap(), &versions, &aliases, None, @@ -163,11 +238,46 @@ mod version_resolver { ); assert_eq!( - resolve_version(&VersionType::parse("1").unwrap(), &versions, &aliases, None,).unwrap(), + resolve_version( + &UnresolvedVersionSpec::parse("1").unwrap(), + &versions, + &aliases, + None, + ) + .unwrap(), Version::new(1, 10, 5) ); } + #[test] + fn resolves_partial_versions_with_manifest() { + let versions = create_versions(); + let aliases = create_aliases(); + let manifest = create_manifest(); + + assert_eq!( + resolve_version( + &UnresolvedVersionSpec::parse("3.3").unwrap(), + &versions, + &aliases, + Some(&manifest), + ) + .unwrap(), + Version::new(3, 3, 3) + ); + + assert_eq!( + resolve_version( + &UnresolvedVersionSpec::parse("3").unwrap(), + &versions, + &aliases, + Some(&manifest), + ) + .unwrap(), + Version::new(3, 3, 3) + ); + } + #[test] fn removes_v_prefix() { let versions = create_versions(); @@ -175,7 +285,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse("v8.0.0").unwrap(), + &UnresolvedVersionSpec::parse("v8.0.0").unwrap(), &versions, &aliases, None, @@ -186,7 +296,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse("V8").unwrap(), + &UnresolvedVersionSpec::parse("V8").unwrap(), &versions, &aliases, None, @@ -203,7 +313,7 @@ mod version_resolver { let aliases = create_aliases(); resolve_version( - &VersionType::Version(Version::new(20, 0, 0)), + &UnresolvedVersionSpec::Version(Version::new(20, 0, 0)), &versions, &aliases, None, @@ -218,7 +328,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse("^8").unwrap(), + &UnresolvedVersionSpec::parse("^8").unwrap(), &versions, &aliases, None, @@ -229,7 +339,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse("~1.1").unwrap(), + &UnresolvedVersionSpec::parse("~1.1").unwrap(), &versions, &aliases, None, @@ -240,7 +350,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse(">1 <10").unwrap(), + &UnresolvedVersionSpec::parse(">1 <10").unwrap(), &versions, &aliases, None, @@ -251,7 +361,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse(">1, <10").unwrap(), + &UnresolvedVersionSpec::parse(">1, <10").unwrap(), &versions, &aliases, None, @@ -263,7 +373,7 @@ mod version_resolver { // Highest match assert_eq!( resolve_version( - &VersionType::parse("^1").unwrap(), + &UnresolvedVersionSpec::parse("^1").unwrap(), &versions, &aliases, None, @@ -274,7 +384,13 @@ mod version_resolver { // Star (latest) assert_eq!( - resolve_version(&VersionType::parse("*").unwrap(), &versions, &aliases, None,).unwrap(), + resolve_version( + &UnresolvedVersionSpec::parse("*").unwrap(), + &versions, + &aliases, + None, + ) + .unwrap(), Version::new(10, 0, 0) ); } @@ -286,7 +402,7 @@ mod version_resolver { let aliases = create_aliases(); resolve_version( - &VersionType::parse("^20").unwrap(), + &UnresolvedVersionSpec::parse("^20").unwrap(), &versions, &aliases, None, @@ -301,7 +417,7 @@ mod version_resolver { assert_eq!( resolve_version( - &VersionType::parse("^1 || ^6 || ^8").unwrap(), + &UnresolvedVersionSpec::parse("^1 || ^6 || ^8").unwrap(), &versions, &aliases, None, @@ -318,7 +434,7 @@ mod version_resolver { let aliases = create_aliases(); resolve_version( - &VersionType::parse("^3 || ^5 || ^9").unwrap(), + &UnresolvedVersionSpec::parse("^3 || ^5 || ^9").unwrap(), &versions, &aliases, None, @@ -332,7 +448,13 @@ mod version_resolver { let aliases = create_aliases(); for req in [">= 1.5.9", "> 1.5.0", ">= 1.2", "> 1.2", "< 1.2", "<= 1.2"] { - resolve_version(&VersionType::parse(req).unwrap(), &versions, &aliases, None).unwrap(); + resolve_version( + &UnresolvedVersionSpec::parse(req).unwrap(), + &versions, + &aliases, + None, + ) + .unwrap(); } } } diff --git a/crates/core/tests/version_test.rs b/crates/core/tests/version_test.rs index a3cf93530..2ff7cad0c 100644 --- a/crates/core/tests/version_test.rs +++ b/crates/core/tests/version_test.rs @@ -1,4 +1,4 @@ -use proto_core::VersionType; +use proto_core::UnresolvedVersionSpec; use semver::{Version, VersionReq}; use std::str::FromStr; @@ -8,16 +8,16 @@ mod version_type { #[test] fn parses_alias() { assert_eq!( - VersionType::from_str("stable").unwrap(), - VersionType::Alias("stable".to_owned()) + UnresolvedVersionSpec::from_str("stable").unwrap(), + UnresolvedVersionSpec::Alias("stable".to_owned()) ); assert_eq!( - VersionType::from_str("latest").unwrap(), - VersionType::Alias("latest".to_owned()) + UnresolvedVersionSpec::from_str("latest").unwrap(), + UnresolvedVersionSpec::Alias("latest".to_owned()) ); assert_eq!( - VersionType::from_str("lts-2014").unwrap(), - VersionType::Alias("lts-2014".to_owned()) + UnresolvedVersionSpec::from_str("lts-2014").unwrap(), + UnresolvedVersionSpec::Alias("lts-2014".to_owned()) ); } @@ -25,8 +25,8 @@ mod version_type { fn parses_req() { for req in ["=1.2.3", "^1.2", "~1", ">1.2.0", "<1", "*", ">1, <=1.5"] { assert_eq!( - VersionType::from_str(req).unwrap(), - VersionType::ReqAll(VersionReq::parse(req).unwrap()) + UnresolvedVersionSpec::from_str(req).unwrap(), + UnresolvedVersionSpec::Req(VersionReq::parse(req).unwrap()) ); } } @@ -34,24 +34,24 @@ mod version_type { #[test] fn parses_req_spaces() { assert_eq!( - VersionType::from_str("> 10").unwrap(), - VersionType::ReqAll(VersionReq::parse(">10").unwrap()) + UnresolvedVersionSpec::from_str("> 10").unwrap(), + UnresolvedVersionSpec::Req(VersionReq::parse(">10").unwrap()) ); assert_eq!( - VersionType::from_str("1.2 , 2").unwrap(), - VersionType::ReqAll(VersionReq::parse("1.2, 2").unwrap()) + UnresolvedVersionSpec::from_str("1.2 , 2").unwrap(), + UnresolvedVersionSpec::Req(VersionReq::parse("1.2, 2").unwrap()) ); assert_eq!( - VersionType::from_str(">= 1.2 < 2").unwrap(), - VersionType::ReqAll(VersionReq::parse(">=1.2, <2").unwrap()) + UnresolvedVersionSpec::from_str(">= 1.2 < 2").unwrap(), + UnresolvedVersionSpec::Req(VersionReq::parse(">=1.2, <2").unwrap()) ); } #[test] fn parses_req_any() { assert_eq!( - VersionType::from_str("^1 || ~2 || =3").unwrap(), - VersionType::ReqAny(vec![ + UnresolvedVersionSpec::from_str("^1 || ~2 || =3").unwrap(), + UnresolvedVersionSpec::ReqAny(vec![ VersionReq::parse("~2").unwrap(), VersionReq::parse("^1").unwrap(), VersionReq::parse("=3").unwrap(), @@ -62,16 +62,16 @@ mod version_type { #[test] fn sorts_any_req() { assert_eq!( - VersionType::from_str("^1 || ^2 || ^3").unwrap(), - VersionType::ReqAny(vec![ + UnresolvedVersionSpec::from_str("^1 || ^2 || ^3").unwrap(), + UnresolvedVersionSpec::ReqAny(vec![ VersionReq::parse("^3").unwrap(), VersionReq::parse("^2").unwrap(), VersionReq::parse("^1").unwrap(), ]) ); assert_eq!( - VersionType::from_str("^1.1 || ^1.10 || ^1.10.1 || ^1.2").unwrap(), - VersionType::ReqAny(vec![ + UnresolvedVersionSpec::from_str("^1.1 || ^1.10 || ^1.10.1 || ^1.2").unwrap(), + UnresolvedVersionSpec::ReqAny(vec![ VersionReq::parse("^1.10.1").unwrap(), VersionReq::parse("^1.10").unwrap(), VersionReq::parse("^1.2").unwrap(), @@ -84,8 +84,8 @@ mod version_type { fn parses_version() { for req in ["1.2.3", "4.5.6", "7.8.9-alpha", "10.11.12+build"] { assert_eq!( - VersionType::from_str(req).unwrap(), - VersionType::Version(Version::parse(req).unwrap()) + UnresolvedVersionSpec::from_str(req).unwrap(), + UnresolvedVersionSpec::Version(Version::parse(req).unwrap()) ); } } @@ -93,24 +93,24 @@ mod version_type { #[test] fn parses_version_with_v() { assert_eq!( - VersionType::from_str("v1.2.3").unwrap(), - VersionType::Version(Version::parse("1.2.3").unwrap()) + UnresolvedVersionSpec::from_str("v1.2.3").unwrap(), + UnresolvedVersionSpec::Version(Version::parse("1.2.3").unwrap()) ); } #[test] fn no_patch_becomes_req() { assert_eq!( - VersionType::from_str("1.2").unwrap(), - VersionType::ReqAll(VersionReq::parse("~1.2").unwrap()) + UnresolvedVersionSpec::from_str("1.2").unwrap(), + UnresolvedVersionSpec::Req(VersionReq::parse("~1.2").unwrap()) ); } #[test] fn no_minor_becomes_req() { assert_eq!( - VersionType::from_str("1").unwrap(), - VersionType::ReqAll(VersionReq::parse("~1").unwrap()) + UnresolvedVersionSpec::from_str("1").unwrap(), + UnresolvedVersionSpec::Req(VersionReq::parse("~1").unwrap()) ); } } diff --git a/crates/pdk-api/Cargo.toml b/crates/pdk-api/Cargo.toml index 08eafc273..af61d3a73 100644 --- a/crates/pdk-api/Cargo.toml +++ b/crates/pdk-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proto_pdk_api" -version = "0.6.3" +version = "0.7.1" edition = "2021" license = "MIT" description = "Core APIs for creating proto WASM plugins." diff --git a/crates/pdk-api/src/api.rs b/crates/pdk-api/src/api.rs index e923741c5..f75c207d7 100644 --- a/crates/pdk-api/src/api.rs +++ b/crates/pdk-api/src/api.rs @@ -151,6 +151,9 @@ json_struct!( pub struct NativeInstallOutput { /// Whether the install was successful. pub installed: bool, + + /// Whether to skip the install process or not. + pub skip_install: bool, } ); @@ -167,6 +170,9 @@ json_struct!( pub struct NativeUninstallOutput { /// Whether the install was successful. pub uninstalled: bool, + + /// Whether to skip the uninstall process or not. + pub skip_uninstall: bool, } ); @@ -376,6 +382,10 @@ json_struct!( json_struct!( /// Output returned by the `load_versions` function. pub struct LoadVersionsOutput { + /// Latest canary version. + #[serde(skip_serializing_if = "Option::is_none")] + pub canary: Option, + /// Latest stable version. #[serde(skip_serializing_if = "Option::is_none")] pub latest: Option, @@ -385,9 +395,6 @@ json_struct!( /// List of available production versions to install. pub versions: Vec, - - /// List of available canary versions to install. - pub canary_versions: Vec, } ); diff --git a/crates/pdk-api/src/error.rs b/crates/pdk-api/src/error.rs index 74cd56be1..c3cba1e15 100644 --- a/crates/pdk-api/src/error.rs +++ b/crates/pdk-api/src/error.rs @@ -8,6 +8,9 @@ pub enum PluginError { #[error("Unable to install {tool}, unsupported architecture {arch}.")] UnsupportedArch { tool: String, arch: String }, + #[error("{tool} does not support canary/nightly versions.")] + UnsupportedCanary { tool: String }, + #[error("Unable to install {tool}, unsupported OS {os}.")] UnsupportedOS { tool: String, os: String }, diff --git a/crates/pdk-api/src/host_funcs.rs b/crates/pdk-api/src/host_funcs.rs index 9c55a8743..19ec141cf 100644 --- a/crates/pdk-api/src/host_funcs.rs +++ b/crates/pdk-api/src/host_funcs.rs @@ -75,6 +75,7 @@ impl ExecCommandInput { json_struct!( /// Output returned from the `exec_command` host function. pub struct ExecCommandOutput { + pub command: String, pub exit_code: i32, pub stderr: String, pub stdout: String, diff --git a/crates/pdk-test-utils/Cargo.toml b/crates/pdk-test-utils/Cargo.toml index af3bad2d1..8e997f3b6 100644 --- a/crates/pdk-test-utils/Cargo.toml +++ b/crates/pdk-test-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proto_pdk_test_utils" -version = "0.5.9" +version = "0.6.2" edition = "2021" license = "MIT" description = "Utilities for testing proto WASM plugins." @@ -8,8 +8,8 @@ homepage = "https://moonrepo.dev/proto" repository = "https://github.com/moonrepo/proto" [dependencies] -proto_core = { version = "0.16.4", path = "../core" } -proto_pdk_api = { version = "0.6.3", path = "../pdk-api" } -proto_wasm_plugin = { version = "0.6.3", path = "../wasm-plugin" } +proto_core = { version = "0.17.2", path = "../core" } +proto_pdk_api = { version = "0.7.1", path = "../pdk-api" } +proto_wasm_plugin = { version = "0.6.5", path = "../wasm-plugin" } extism = { workspace = true } serde_json = { workspace = true } diff --git a/crates/pdk-test-utils/src/lib.rs b/crates/pdk-test-utils/src/lib.rs index 4eeeb3945..4598b6254 100644 --- a/crates/pdk-test-utils/src/lib.rs +++ b/crates/pdk-test-utils/src/lib.rs @@ -4,8 +4,8 @@ mod wrapper; pub use macros::*; pub use proto_core as core; pub use proto_core::{ - AliasOrVersion, Id, ProtoEnvironment, Tool, ToolManifest, ToolsConfig, UserConfig, Version, - VersionReq, VersionType, + Id, ProtoEnvironment, Tool, ToolManifest, ToolsConfig, UnresolvedVersionSpec, UserConfig, + Version, VersionReq, VersionSpec, }; pub use proto_pdk_api::*; pub use wrapper::WasmTestWrapper; diff --git a/crates/pdk-test-utils/src/macros.rs b/crates/pdk-test-utils/src/macros.rs index 0724e016c..d934376c1 100644 --- a/crates/pdk-test-utils/src/macros.rs +++ b/crates/pdk-test-utils/src/macros.rs @@ -6,7 +6,7 @@ macro_rules! generate_download_install_tests { ($id:literal, $version:literal, $schema:expr) => { #[tokio::test] async fn downloads_verifies_installs_tool() { - let sandbox = create_empty_sandbox(); + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { @@ -15,7 +15,7 @@ macro_rules! generate_download_install_tests { plugin .tool - .setup(&proto_pdk_test_utils::VersionType::parse($version).unwrap()) + .setup(&proto_pdk_test_utils::UnresolvedVersionSpec::parse($version).unwrap()) .await .unwrap(); @@ -43,7 +43,7 @@ macro_rules! generate_download_install_tests { #[tokio::test] async fn downloads_prebuilt_and_checksum_to_temp() { - let sandbox = create_empty_sandbox(); + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { @@ -51,7 +51,7 @@ macro_rules! generate_download_install_tests { }; let mut tool = plugin.tool; - tool.version = Some(proto_pdk_test_utils::AliasOrVersion::parse($version).unwrap()); + tool.version = Some(proto_pdk_test_utils::VersionSpec::parse($version).unwrap()); let download_file = tool .install_from_prebuilt(&tool.get_tool_dir()) @@ -63,20 +63,22 @@ macro_rules! generate_download_install_tests { #[tokio::test] async fn doesnt_install_if_already_installed() { - let sandbox = create_empty_sandbox(); + if $version == "canary" { + // Canary always overwrites instead of aborting + return; + } + + let sandbox = starbase_sandbox::create_empty_sandbox(); let plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { create_plugin($id, sandbox.path()) }; let mut tool = plugin.tool; - let version_inst = proto_pdk_test_utils::Version::parse($version).unwrap(); + let spec = proto_pdk_test_utils::VersionSpec::parse($version).unwrap(); - tool.version = Some(proto_pdk_test_utils::AliasOrVersion::Version( - version_inst.clone(), - )); - - tool.manifest.installed_versions.insert(version_inst); + tool.version = Some(spec.clone()); + tool.manifest.installed_versions.insert(spec); std::fs::create_dir_all(&tool.get_tool_dir()).unwrap(); @@ -93,7 +95,7 @@ macro_rules! generate_resolve_versions_tests { ($id:literal, { $( $k:literal => $v:literal, )* }, $schema:expr) => { #[tokio::test] async fn resolves_latest_alias() { - let sandbox = create_empty_sandbox(); + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { @@ -101,7 +103,7 @@ macro_rules! generate_resolve_versions_tests { }; plugin.tool.resolve_version( - &proto_pdk_test_utils::VersionType::parse("latest").unwrap(), + &proto_pdk_test_utils::UnresolvedVersionSpec::parse("latest").unwrap(), ).await.unwrap(); assert_ne!(plugin.tool.get_resolved_version(), "latest"); @@ -109,7 +111,7 @@ macro_rules! generate_resolve_versions_tests { #[tokio::test] async fn resolve_version_or_alias() { - let sandbox = create_empty_sandbox(); + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { @@ -118,7 +120,7 @@ macro_rules! generate_resolve_versions_tests { $( plugin.tool.resolve_version( - &proto_pdk_test_utils::VersionType::parse($k).unwrap(), + &proto_pdk_test_utils::UnresolvedVersionSpec::parse($k).unwrap(), ).await.unwrap(); assert_eq!( @@ -132,7 +134,7 @@ macro_rules! generate_resolve_versions_tests { // #[tokio::test] // async fn resolve_custom_alias() { // - // let sandbox = create_empty_sandbox(); + // let sandbox = starbase_sandbox::create_empty_sandbox(); // sandbox.create_file( // format!(".proto/tools/{}/manifest.json", $id), @@ -150,7 +152,7 @@ macro_rules! generate_resolve_versions_tests { #[tokio::test] #[should_panic(expected = "Failed to resolve a semantic version for unknown")] async fn errors_invalid_alias() { - let sandbox = create_empty_sandbox(); + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { @@ -158,14 +160,14 @@ macro_rules! generate_resolve_versions_tests { }; plugin.tool.resolve_version( - &proto_pdk_test_utils::VersionType::parse("unknown").unwrap(), + &proto_pdk_test_utils::UnresolvedVersionSpec::parse("unknown").unwrap(), ).await.unwrap(); } #[tokio::test] #[should_panic(expected = "Failed to resolve a semantic version for 99.99.99")] async fn errors_invalid_version() { - let sandbox = create_empty_sandbox(); + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { @@ -173,7 +175,7 @@ macro_rules! generate_resolve_versions_tests { }; plugin.tool.resolve_version( - &proto_pdk_test_utils::VersionType::parse("99.99.99").unwrap(), + &proto_pdk_test_utils::UnresolvedVersionSpec::parse("99.99.99").unwrap(), ).await.unwrap(); } }; @@ -190,7 +192,7 @@ macro_rules! generate_global_shims_test { ($id:literal, [ $($bin:literal),* ], $schema:expr) => { #[tokio::test] async fn creates_global_shims() { - let sandbox = create_empty_sandbox(); + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { @@ -199,7 +201,7 @@ macro_rules! generate_global_shims_test { plugin.tool.create_shims(false).await.unwrap(); - assert_snapshot!(std::fs::read_to_string( + starbase_sandbox::assert_snapshot!(std::fs::read_to_string( sandbox.path().join(".proto/bin").join(if cfg!(windows) { format!("{}.cmd", $id) } else { @@ -208,7 +210,7 @@ macro_rules! generate_global_shims_test { ).unwrap()); $( - assert_snapshot!(std::fs::read_to_string( + starbase_sandbox::assert_snapshot!(std::fs::read_to_string( sandbox.path().join(".proto/bin").join(if cfg!(windows) { format!("{}.cmd", $bin) } else { @@ -227,8 +229,8 @@ macro_rules! generate_local_shims_test { }; ($id:literal, [ $($bin:literal),* ], $schema:expr) => { #[tokio::test] - async fn creates_global_shims() { - let sandbox = create_empty_sandbox(); + async fn creates_local_shims() { + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { @@ -238,7 +240,7 @@ macro_rules! generate_local_shims_test { plugin.tool.create_shims(false).await.unwrap(); $( - assert_snapshot!(std::fs::read_to_string( + starbase_sandbox::assert_snapshot!(std::fs::read_to_string( sandbox.path().join(".proto/tools").join($id).join("latest/shims").join(if cfg!(windows) { format!("{}.ps1", $bin) } else { @@ -261,7 +263,7 @@ macro_rules! generate_globals_test { ($id:literal, $dep:literal, $env:expr, $schema:expr) => { #[tokio::test] async fn installs_and_uninstalls_globals() { - let sandbox = create_empty_sandbox(); + let sandbox = starbase_sandbox::create_empty_sandbox(); let mut plugin = if let Some(schema) = $schema { create_schema_plugin($id, sandbox.path(), schema) } else { diff --git a/crates/pdk/Cargo.toml b/crates/pdk/Cargo.toml index 470dba46e..ab737978b 100644 --- a/crates/pdk/Cargo.toml +++ b/crates/pdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proto_pdk" -version = "0.6.5" +version = "0.7.1" edition = "2021" license = "MIT" description = "A plugin development kit for creating proto WASM plugins." @@ -8,7 +8,7 @@ homepage = "https://moonrepo.dev/proto" repository = "https://github.com/moonrepo/proto" [dependencies] -proto_pdk_api = { version = "0.6.3", path = "../pdk-api" } +proto_pdk_api = { version = "0.7.1", path = "../pdk-api" } anyhow = "1.0.75" extism-pdk = { workspace = true } once_cell = { workspace = true } diff --git a/crates/pdk/src/helpers.rs b/crates/pdk/src/helpers.rs index 81ec3dfa0..9c9e15da7 100644 --- a/crates/pdk/src/helpers.rs +++ b/crates/pdk/src/helpers.rs @@ -1,3 +1,4 @@ +use crate::exec_command; use extism_pdk::http::request; use extism_pdk::*; use once_cell::sync::Lazy; @@ -48,8 +49,21 @@ where fetch(HttpRequest::new(url.as_ref()), None, false) } +/// Fetch the provided URL and return the text response. +pub fn fetch_url_text(url: U) -> anyhow::Result +where + U: AsRef, +{ + let req = HttpRequest::new(url.as_ref()); + let res = request::(&req, None) + .map_err(|e| anyhow::anyhow!("Failed to make request to {}: {e}", req.url))?; + + String::from_bytes(res.body()) +} + /// Fetch the provided URL, deserialize the response as JSON, -/// and cache the response in memory for the duration of the WASM instance. +/// and cache the response in memory for the duration of the WASM function call. +/// Caches *does not* persist across function calls. pub fn fetch_url_with_cache(url: U) -> anyhow::Result where R: DeserializeOwned, @@ -64,22 +78,24 @@ pub fn load_git_tags(url: U) -> anyhow::Result> where U: AsRef, { - let output = unsafe { - exec_command(Json(ExecCommandInput::pipe( - "git", - [ - "ls-remote", - "--tags", - "--sort", - "version:refname", - url.as_ref(), - ], - )))? - .0 - }; + let output = exec_command!( + pipe, + "git", + [ + "ls-remote", + "--tags", + "--sort", + "version:refname", + url.as_ref(), + ] + ); let mut tags: Vec = vec![]; + if output.exit_code != 0 { + return Ok(tags); + } + for line in output.stdout.split('\n') { let parts = line.split('\t').collect::>(); @@ -132,6 +148,47 @@ pub fn check_supported_os_and_arch( Ok(()) } +/// Check whether a command exists or not on the host machine. +pub fn command_exists(env: &HostEnvironment, command: &str) -> bool { + let result = if env.os == HostOS::Windows { + let line = format!("Get-Command {command}"); + + exec_command!(raw, "powershell", ["-Command", &line]) + } else { + exec_command!(raw, "which", [command]) + }; + + result.is_ok_and(|res| res.0.exit_code == 0) +} + +/// Detect whether the current OS is utilizing musl instead of gnu. +pub fn is_musl(env: &HostEnvironment) -> bool { + if !env.os.is_linux() { + return false; + } + + exec_command!(raw, "ldd", ["--version"]) + .is_ok_and(|res| res.0.exit_code == 0 && res.0.stdout.contains("musl")) +} + +/// Return a Rust target triple for the current host OS and architecture. +pub fn get_target_triple(env: &HostEnvironment, name: &str) -> Result { + match env.os { + HostOS::Linux => Ok(format!( + "{}-unknown-linux-{}", + env.arch.to_rust_arch(), + if is_musl(env) { "musl" } else { "gnu" } + )), + HostOS::MacOS => Ok(format!("{}-apple-darwin", env.arch.to_rust_arch())), + HostOS::Windows => Ok(format!("{}-pc-windows-msvc", env.arch.to_rust_arch())), + _ => Err(PluginError::UnsupportedTarget { + tool: name.into(), + arch: env.arch.to_string(), + os: env.os.to_string(), + }), + } +} + /// Get the active tool ID for the current WASM instance. pub fn get_tool_id() -> String { config::get("proto_tool_id").expect("Missing tool ID!") diff --git a/crates/pdk/src/macros.rs b/crates/pdk/src/macros.rs index 4e0007662..75e8b1377 100644 --- a/crates/pdk/src/macros.rs +++ b/crates/pdk/src/macros.rs @@ -18,15 +18,17 @@ macro_rules! permutations { #[macro_export] macro_rules! exec_command { + (raw, $cmd:expr, $args:expr) => { + exec_command!(raw, ExecCommandInput::pipe($cmd, $args)) + }; + (raw, $input:expr) => { + unsafe { exec_command(Json($input)) } + }; (pipe, $cmd:expr, $args:expr) => { - unsafe { - exec_command(Json(ExecCommandInput::pipe($cmd, $args)))?.0 - } + exec_command!(ExecCommandInput::pipe($cmd, $args)) }; (inherit, $cmd:expr, $args:expr) => { - unsafe { - exec_command(Json(ExecCommandInput::inherit($cmd, $args)))?.0 - } + exec_command!(ExecCommandInput::inherit($cmd, $args)) }; ($cmd:expr, [ $($arg:literal),* ]) => { exec_command!(pipe, $cmd, [ $($arg),* ]) @@ -57,13 +59,19 @@ macro_rules! host_log { #[macro_export] macro_rules! err { - ($msg:expr) => { - Err(WithReturnCode::new(PluginError::Message($msg).into(), 1)) + ($msg:literal) => { + Err(WithReturnCode::new( + PluginError::Message($msg.into()).into(), + 1, + )) }; - ($msg:expr, $code:expr) => { + ($msg:literal, $($arg:tt)*) => { Err(WithReturnCode::new( - PluginError::Message($msg).into(), - $code, + PluginError::Message(format!($msg, $($arg)*)).into(), + 1, )) }; + ($msg:expr) => { + Err(WithReturnCode::new($msg, 1)) + }; } diff --git a/crates/schema-plugin/Cargo.toml b/crates/schema-plugin/Cargo.toml index bddd19d92..db9421f83 100644 --- a/crates/schema-plugin/Cargo.toml +++ b/crates/schema-plugin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proto_schema_plugin" -version = "0.11.3" +version = "0.11.4" edition = "2021" license = "MIT" description = "Utilities for working with proto's TOML plugins." diff --git a/crates/schema-plugin/src/schema.rs b/crates/schema-plugin/src/schema.rs index ce34f4ca8..7bfa11944 100644 --- a/crates/schema-plugin/src/schema.rs +++ b/crates/schema-plugin/src/schema.rs @@ -21,7 +21,9 @@ pub struct DetectSchema { pub struct InstallSchema { pub arch: HashMap, pub checksum_url: Option, + pub checksum_url_canary: Option, pub download_url: String, + pub download_url_canary: Option, } #[derive(Debug, Default, Deserialize)] diff --git a/crates/warpgate/Cargo.toml b/crates/warpgate/Cargo.toml index d44348193..85cb032c4 100644 --- a/crates/warpgate/Cargo.toml +++ b/crates/warpgate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "warpgate" -version = "0.5.3" +version = "0.5.4" edition = "2021" license = "MIT" description = "Download, resolve, and manage Extism WASM plugins at runtime." diff --git a/crates/warpgate/src/helpers.rs b/crates/warpgate/src/helpers.rs index a2f950da8..a82b431e0 100644 --- a/crates/warpgate/src/helpers.rs +++ b/crates/warpgate/src/helpers.rs @@ -86,7 +86,7 @@ pub fn move_or_unpack_download(temp_file: &Path, dest_file: &Path) -> miette::Re } // Unpack archives to temp and move the wasm file - Some("tar" | "gz" | "xz" | "tgz" | "txz" | "zip") => { + Some("tar" | "gz" | "xz" | "tgz" | "txz" | "zst" | "zstd" | "zip") => { let out_dir = temp_file.parent().unwrap().join("out"); Archiver::new(&out_dir, dest_file).unpack_from_ext()?; diff --git a/crates/warpgate/src/loader.rs b/crates/warpgate/src/loader.rs index 1c36b561d..5f76ce7a3 100644 --- a/crates/warpgate/src/loader.rs +++ b/crates/warpgate/src/loader.rs @@ -16,6 +16,7 @@ use tracing::trace; /// A system for loading plugins from a locator strategy, /// and caching the `.wasm` file to the host's file system. +#[derive(Clone, Debug)] pub struct PluginLoader { /// Location where downloaded `.wasm` plugins are stored. plugins_dir: PathBuf, @@ -252,6 +253,8 @@ impl PluginLoader { | asset.name.ends_with(".tgz") | asset.name.ends_with(".tar.xz") | asset.name.ends_with(".txz") + | asset.name.ends_with(".zst") + | asset.name.ends_with(".zstd") | asset.name.ends_with(".zip"))) { trace!( diff --git a/crates/wasm-plugin/Cargo.toml b/crates/wasm-plugin/Cargo.toml index 871399d16..8ffce9a64 100644 --- a/crates/wasm-plugin/Cargo.toml +++ b/crates/wasm-plugin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proto_wasm_plugin" -version = "0.6.3" +version = "0.6.5" edition = "2021" license = "MIT" description = "Utilities for working with proto's WASM plugins." @@ -8,7 +8,7 @@ homepage = "https://moonrepo.dev/proto" repository = "https://github.com/moonrepo/proto" [dependencies] -proto_pdk_api = { version = "0.6.3", path = "../pdk-api" } +proto_pdk_api = { version = "0.7.1", path = "../pdk-api" } extism = { workspace = true } serde_json = { workspace = true } tracing = { workspace = true } diff --git a/crates/wasm-plugin/src/host_funcs.rs b/crates/wasm-plugin/src/host_funcs.rs index 3b4f8ba81..784e10aff 100644 --- a/crates/wasm-plugin/src/host_funcs.rs +++ b/crates/wasm-plugin/src/host_funcs.rs @@ -1,5 +1,5 @@ use extism::{CurrentPlugin, Error, Function, InternalExt, UserData, Val, ValType}; -use proto_pdk_api::{ExecCommandInput, ExecCommandOutput, HostLogInput, PluginError}; +use proto_pdk_api::{ExecCommandInput, ExecCommandOutput, HostLogInput}; use std::path::PathBuf; use std::process::Command; use tracing::trace; @@ -85,6 +85,7 @@ fn exec_command( let result = command.spawn()?.wait()?; ExecCommandOutput { + command: input.command.clone(), exit_code: result.code().unwrap_or(0), stderr: String::new(), stdout: String::new(), @@ -93,6 +94,7 @@ fn exec_command( let result = command.output()?; ExecCommandOutput { + command: input.command.clone(), exit_code: result.status.code().unwrap_or(0), stderr: String::from_utf8_lossy(&result.stderr).to_string(), stdout: String::from_utf8_lossy(&result.stdout).to_string(), @@ -108,19 +110,6 @@ fn exec_command( "Executed command from plugin" ); - if output.exit_code != 0 { - let mut command_line = vec![input.command]; - command_line.extend(input.args); - - return Err(PluginError::Message(format!( - "Command `{}` failed with a {} exit code: {}", - command_line.join(" "), - output.exit_code, - output.stderr - )) - .into()); - } - let output_str = serde_json::to_string(&output)?; let ptr = plugin.memory_alloc_bytes(output_str)?; diff --git a/plugins/Cargo.lock b/plugins/Cargo.lock index f6cf37c71..f44149769 100644 --- a/plugins/Cargo.lock +++ b/plugins/Cargo.lock @@ -2,6 +2,30 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli 0.27.3", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli 0.28.0", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" version = "0.8.3" @@ -15,376 +39,3881 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.75" +name = "aho-corasick" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +dependencies = [ + "memchr", +] [[package]] -name = "autocfg" -version = "1.1.0" +name = "ambient-authority" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" [[package]] -name = "base64" -version = "0.21.2" +name = "android-tzdata" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] -name = "bitflags" -version = "1.3.2" +name = "android_system_properties" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] [[package]] -name = "byteorder" -version = "1.4.3" +name = "anstyle" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] -name = "cfg-if" -version = "1.0.0" +name = "anyhow" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] -name = "extism-manifest" -version = "0.5.0" +name = "arbitrary" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22b0e600ec289630715ffdc11aca36a26297c3ab7908f14d5bbf3770d102bce7" +checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "assert_cmd" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6" dependencies = [ - "base64", - "serde", + "anstyle", + "bstr 1.6.2", + "doc-comment", + "predicates", + "predicates-core", + "predicates-tree", + "wait-timeout", ] [[package]] -name = "extism-pdk" -version = "0.3.4" +name = "assert_fs" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c20fe9cafa572607e22192bf2040849e7456664895bdc589c89387876e2067" +checksum = "f070617a68e5c2ed5d06ee8dd620ee18fb72b99f6c094bed34cf8ab07c875b48" dependencies = [ - "anyhow", - "base64", - "extism-manifest", - "extism-pdk-derive", - "rmp-serde", - "serde", - "serde_json", + "anstyle", + "doc-comment", + "globwalk", + "predicates", + "predicates-core", + "predicates-tree", + "tempfile", ] [[package]] -name = "extism-pdk-derive" -version = "0.3.1" +name = "async-trait" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2be216330f7304de051e0faf1578880e9e0dc1ecbd2c0fea5765c63a079d0ba" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.31", ] [[package]] -name = "getrandom" -version = "0.2.10" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "cfg-if", + "hermit-abi 0.1.19", "libc", - "wasi", + "winapi", ] [[package]] -name = "hashbrown" -version = "0.14.0" +name = "autocfg" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" -dependencies = [ - "ahash", -] +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "itoa" -version = "1.0.8" +name = "backtrace" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line 0.21.0", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object 0.32.1", + "rustc-demangle", +] [[package]] -name = "libc" -version = "0.2.147" +name = "base64" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] -name = "lock_api" -version = "0.4.10" +name = "bincode" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "autocfg", - "scopeguard", + "serde", ] [[package]] -name = "num-traits" -version = "0.2.15" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "once_cell" -version = "1.18.0" +name = "bitflags" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] -name = "once_map" -version = "0.4.8" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169e72192bc84493725bfca5d47da4ee2abc8acf155586d8127eb17f022497f4" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "ahash", - "hashbrown", - "parking_lot", - "stable_deref_trait", + "generic-array", ] [[package]] -name = "parking_lot" -version = "0.12.1" +name = "brownstone" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "c5839ee4f953e811bfdcf223f509cb2c6a3e1447959b0bff459405575bc17f22" dependencies = [ - "lock_api", - "parking_lot_core", + "arrayvec", ] [[package]] -name = "parking_lot_core" -version = "0.9.8" +name = "bstr" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", + "lazy_static", + "memchr", + "regex-automata 0.1.10", ] [[package]] -name = "paste" -version = "1.0.13" +name = "bstr" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +dependencies = [ + "memchr", + "regex-automata 0.3.8", + "serde", +] [[package]] -name = "proc-macro2" -version = "1.0.63" +name = "bumpalo" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" -dependencies = [ - "unicode-ident", -] +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] -name = "proto_pdk" -version = "0.6.4" -dependencies = [ - "anyhow", - "extism-pdk", - "once_cell", - "once_map", - "proto_pdk_api", - "serde", -] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] -name = "proto_pdk_api" -version = "0.6.2" -dependencies = [ - "anyhow", - "semver", - "serde", - "serde_json", - "thiserror", - "warpgate_api", -] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] -name = "proto_wasm_test" -version = "0.2.0" +name = "cached" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b195e4fbc4b6862bbd065b991a34750399c119797efff72492f28a5864de8700" dependencies = [ - "extism-pdk", - "proto_pdk", - "serde", + "async-trait", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown 0.13.2", + "instant", + "once_cell", + "thiserror", + "tokio", ] [[package]] -name = "quote" -version = "1.0.29" +name = "cached_proc_macro" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "b48814962d2fd604c50d2b9433c2a41a0ab567779ee2c02f7fba6eca1221f082" dependencies = [ + "cached_proc_macro_types", + "darling 0.14.4", "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "redox_syscall" -version = "0.3.5" +name = "cached_proc_macro_types" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" + +[[package]] +name = "cap-fs-ext" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bc48200a1a0fa6fba138b1802ad7def18ec1cdd92f7b2a04e21f1bd887f7b9" dependencies = [ - "bitflags", + "cap-primitives", + "cap-std", + "io-lifetimes 1.0.11", + "windows-sys 0.48.0", ] [[package]] -name = "rmp" -version = "0.8.11" +name = "cap-primitives" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +checksum = "a4b6df5b295dca8d56f35560be8c391d59f0420f72e546997154e24e765e6451" dependencies = [ - "byteorder", - "num-traits", - "paste", + "ambient-authority", + "fs-set-times", + "io-extras", + "io-lifetimes 1.0.11", + "ipnet", + "maybe-owned", + "rustix 0.37.23", + "windows-sys 0.48.0", + "winx 0.35.1", ] [[package]] -name = "rmp-serde" -version = "1.1.1" +name = "cap-rand" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b13be192e0220b8afb7222aa5813cb62cc269ebb5cac346ca6487681d2913e" +checksum = "4d25555efacb0b5244cf1d35833d55d21abc916fff0eaad254b8e2453ea9b8ab" dependencies = [ - "byteorder", - "rmp", - "serde", + "ambient-authority", + "rand", ] [[package]] -name = "ryu" -version = "1.0.14" +name = "cap-std" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "3373a62accd150b4fcba056d4c5f3b552127f0ec86d3c8c102d60b978174a012" +dependencies = [ + "cap-primitives", + "io-extras", + "io-lifetimes 1.0.11", + "rustix 0.37.23", +] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "cap-time-ext" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "e95002993b7baee6b66c8950470e59e5226a23b3af39fc59c47fe416dd39821a" +dependencies = [ + "cap-primitives", + "once_cell", + "rustix 0.37.23", + "winx 0.35.1", +] [[package]] -name = "semver" -version = "1.0.18" +name = "cbindgen" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "4b922faaf31122819ec80c4047cc684c6979a087366c069611e33649bf98e18d" dependencies = [ + "clap", + "heck", + "indexmap 1.9.3", + "log", + "proc-macro2", + "quote", "serde", + "serde_json", + "syn 1.0.109", + "tempfile", + "toml 0.5.11", ] [[package]] -name = "serde" -version = "1.0.188" +name = "cc" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "serde_derive", + "jobserver", + "libc", ] [[package]] -name = "serde_derive" -version = "1.0.188" +name = "cfg-if" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" dependencies = [ - "proc-macro2", - "quote", - "syn", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.48.1", ] [[package]] -name = "serde_json" -version = "1.0.105" +name = "clap" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ - "itoa", - "ryu", - "serde", + "atty", + "bitflags 1.3.2", + "clap_lex", + "indexmap 1.9.3", + "strsim", + "termcolor", + "textwrap", ] [[package]] -name = "smallvec" -version = "1.11.0" +name = "clap_lex" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "clean-path" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "aaa6b4b263a5d737e9bf6b7c09b72c41a5480aec4d7219af827f6564e950b6a5" [[package]] -name = "syn" -version = "2.0.28" +name = "console" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "encode_unicode", + "lazy_static", + "libc", + "windows-sys 0.45.0", ] [[package]] -name = "thiserror" -version = "1.0.47" +name = "const_format" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" dependencies = [ - "thiserror-impl", + "const_format_proc_macros", ] [[package]] -name = "thiserror-impl" -version = "1.0.47" +name = "const_format_proc_macros" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" dependencies = [ "proc-macro2", "quote", - "syn", + "unicode-xid", ] [[package]] -name = "unicode-ident" -version = "1.0.10" +name = "core-foundation-sys" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] -name = "version_check" -version = "0.9.4" +name = "cpp_demangle" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-bforest" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1380172556902242d32f78ed08c98aac4f5952aef22d3684aed5c66a5db0a6fc" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037cca234e1ad0766fdfe43b527ec14e100414b4ccf4bb614977aa9754958f57" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli 0.27.3", + "hashbrown 0.13.2", + "log", + "regalloc2", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375e6afa8b9a304999ea8cf58424414b8e55e004571265a4f0826eba8b74f18" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca590e72ccb8da963def6e36460cce4412032b1f03c31d1a601838d305abdc39" + +[[package]] +name = "cranelift-control" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2d38eea4373639f4b6236a40f69820fed16c5511093cd3783bf8491a93d9cf" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e3173c1434af23c00e4964722cf93ca8f0e6287289bf5d52110597c3ba2ea09" +dependencies = [ + "serde", +] + +[[package]] +name = "cranelift-frontend" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aec4a3a33825062eccf6eec73e852c8773220f6e4798925e19696562948beb1f" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5146b5cea4b21095a021d964b0174cf6ff5530f83e8d0a822683c7559e360b66" + +[[package]] +name = "cranelift-native" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cec3717ce554d3936b2101aa8eae1a2a410bd6da0f4df698a4b008fe9cf1e9" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.98.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fd2f9f1bf29ce6639ae2f477a2fe20bad0bd09289df13efeb890e8e4b9f807" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools", + "log", + "smallvec", + "wasmparser 0.107.0", + "wasmtime-types", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.9.0", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.31", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core 0.20.3", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "destructure_traitobject" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c877555693c14d2f84191cfd3ad8582790fc52b5e2274b40b59cf5f5cea25c7" + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "extism" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0fcd6ad10f959f7f35680feda30bdcb7c1f6e0584e8358b09d735ff2c232f58" +dependencies = [ + "anyhow", + "extism-manifest", + "extism-runtime", + "log", + "serde_json", + "uuid", +] + +[[package]] +name = "extism-manifest" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22b0e600ec289630715ffdc11aca36a26297c3ab7908f14d5bbf3770d102bce7" +dependencies = [ + "base64", + "serde", +] + +[[package]] +name = "extism-pdk" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c20fe9cafa572607e22192bf2040849e7456664895bdc589c89387876e2067" +dependencies = [ + "anyhow", + "base64", + "extism-manifest", + "extism-pdk-derive", + "rmp-serde", + "serde", + "serde_json", +] + +[[package]] +name = "extism-pdk-derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2be216330f7304de051e0faf1578880e9e0dc1ecbd2c0fea5765c63a079d0ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "extism-runtime" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be84fc8659ebaa268478a52f98e7066e4352fc7a90b74ec3aa52e7ac03eecd4" +dependencies = [ + "anyhow", + "cbindgen", + "extism-manifest", + "glob", + "libc", + "log", + "log4rs", + "serde", + "serde_json", + "sha2", + "toml 0.7.6", + "ureq", + "url", + "uuid", + "wasmtime", + "wasmtime-wasi", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fd-lock" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b0377f1edc77dbd1118507bc7a66e4ab64d2b90c66f90726dc801e73a8c68f9" +dependencies = [ + "cfg-if", + "rustix 0.38.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "file-per-thread-logger" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3cc21c33af89af0930c8cae4ade5e6fdc17b5d2c97b3d2e2edb67a1cf683f3" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "flate2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs-set-times" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d167b646a876ba8fda6b50ac645cfd96242553cbaf0ca4fccaa39afcbf0801f" +dependencies = [ + "io-lifetimes 1.0.11", + "rustix 0.38.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "fs4" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" +dependencies = [ + "rustix 0.38.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "fxprof-processed-profile" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +dependencies = [ + "bitflags 2.4.0", + "debugid", + "fxhash", + "serde", + "serde_json", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +dependencies = [ + "fallible-iterator", + "indexmap 1.9.3", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "globset" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +dependencies = [ + "aho-corasick", + "bstr 1.6.2", + "fnv", + "log", + "regex", +] + +[[package]] +name = "globwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +dependencies = [ + "bitflags 1.3.2", + "ignore", + "walkdir", +] + +[[package]] +name = "h2" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "human-sort" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140a09c9305e6d5e557e2ed7cbc68e05765a7d4213975b87cb04920689cc6219" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.4.9", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ignore" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +dependencies = [ + "globset", + "lazy_static", + "log", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + +[[package]] +name = "indent_write" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "insta" +version = "1.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0770b0a3d4c70567f0d58331f3088b0e4c4f56c9b8d764efe654b4a5d46de3a" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "similar", + "yaml-rust", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-extras" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde93d48f0d9277f977a333eca8313695ddd5301dc96f7e02aeddcb0dd99096f" +dependencies = [ + "io-lifetimes 1.0.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.2", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "io-lifetimes" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffb4def18c48926ccac55c1223e02865ce1a821751a95920448662696e7472c" + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.2", + "rustix 0.38.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "is_ci" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" + +[[package]] +name = "ittapi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41e0d0b7b3b53d92a7e8b80ede3400112a6b8b4c98d1f5b8b16bb787c780582c" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f8763c96e54e6d6a0dccc2990d8b5e33e3313aaeae6185921a3f4c1614a77c" +dependencies = [ + "cc", +] + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "joinery" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json_comments" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ee439ee368ba4a77ac70d04f14015415af8600d6c894dc1f11bd79758c57d5" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "serde", +] + +[[package]] +name = "log-mdc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" + +[[package]] +name = "log4rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d36ca1786d9e79b8193a68d480a0907b612f109537115c6ff655a3a1967533fd" +dependencies = [ + "anyhow", + "arc-swap", + "chrono", + "derivative", + "fnv", + "humantime", + "libc", + "log", + "log-mdc", + "parking_lot", + "serde", + "serde-value", + "serde_json", + "serde_yaml", + "thiserror", + "thread-id", + "typemap-ors", + "winapi", +] + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" + +[[package]] +name = "memchr" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" + +[[package]] +name = "memfd" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +dependencies = [ + "rustix 0.37.23", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miette" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +dependencies = [ + "miette-derive", + "once_cell", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom-supreme" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd3ae6c901f1959588759ff51c95d24b491ecb9ff91aa9c2ef4acc5b1dcab27" +dependencies = [ + "brownstone", + "indent_write", + "joinery", + "memchr", + "nom", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.2", + "libc", +] + +[[package]] +name = "object" +version = "0.30.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +dependencies = [ + "crc32fast", + "hashbrown 0.13.2", + "indexmap 1.9.3", + "memchr", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "once_map" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "169e72192bc84493725bfca5d47da4ee2abc8acf155586d8127eb17f022497f4" +dependencies = [ + "ahash", + "hashbrown 0.14.0", + "parking_lot", + "stable_deref_trait", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-float" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" +dependencies = [ + "num-traits", +] + +[[package]] +name = "os_str_bytes" +version = "6.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets 0.48.1", +] + +[[package]] +name = "paste" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "pori" +version = "0.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a63d338dec139f56dacc692ca63ad35a6be6a797442479b55acd611d79e906" +dependencies = [ + "nom", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "predicates" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9" +dependencies = [ + "anstyle", + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proto_core" +version = "0.16.4" +dependencies = [ + "cached", + "extism", + "human-sort", + "miette", + "once_cell", + "proto_pdk_api", + "proto_wasm_plugin", + "regex", + "reqwest", + "semver", + "serde", + "serde_json", + "sha2", + "starbase_archive", + "starbase_events", + "starbase_styles", + "starbase_utils", + "thiserror", + "tinytemplate", + "tracing", + "url", + "warpgate", +] + +[[package]] +name = "proto_pdk" +version = "0.6.5" +dependencies = [ + "anyhow", + "extism-pdk", + "once_cell", + "once_map", + "proto_pdk_api", + "serde", +] + +[[package]] +name = "proto_pdk_api" +version = "0.6.3" +dependencies = [ + "anyhow", + "semver", + "serde", + "serde_json", + "thiserror", + "warpgate_api", +] + +[[package]] +name = "proto_pdk_test_utils" +version = "0.5.9" +dependencies = [ + "extism", + "proto_core", + "proto_pdk_api", + "proto_wasm_plugin", + "serde_json", +] + +[[package]] +name = "proto_wasm_plugin" +version = "0.6.3" +dependencies = [ + "extism", + "proto_pdk_api", + "serde_json", + "tracing", +] + +[[package]] +name = "proto_wasm_test" +version = "0.2.0" +dependencies = [ + "extism-pdk", + "proto_pdk", + "proto_pdk_test_utils", + "serde", + "starbase_sandbox", + "tokio", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "pulldown-cmark" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" +dependencies = [ + "bitflags 1.3.2", + "memchr", + "unicase", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "regalloc2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b4dcbd3a2ae7fb94b5813fa0e957c6ab51bf5d0a8ee1b69e0c2d0f1e6eb8485" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.3.8", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-automata" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "relative-path" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" + +[[package]] +name = "reqwest" +version = "0.11.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.2", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rmp" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b13be192e0220b8afb7222aa5813cb62cc269ebb5cac346ca6487681d2913e" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.37.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes 1.0.11", + "itoa", + "libc", + "linux-raw-sys 0.3.8", + "once_cell", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.4", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "serde_json" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +dependencies = [ + "indexmap 1.9.3", + "ryu", + "serde", + "yaml-rust", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shellexpand" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" +dependencies = [ + "dirs 4.0.0", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "starbase_archive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f85e565b134761413513c0091ed002ffb31ba448ca9542c4c41ca5968a29a9bb" +dependencies = [ + "flate2", + "miette", + "rustc-hash", + "starbase_styles", + "starbase_utils", + "tar", + "thiserror", + "tracing", + "xz2", + "zip", + "zstd 0.12.4", +] + +[[package]] +name = "starbase_events" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f172a2185991dbfb2a3446c47749ade52d66d2aaea724d19bd45607527ebd9d" +dependencies = [ + "async-trait", + "miette", + "starbase_macros", + "tokio", +] + +[[package]] +name = "starbase_macros" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63159597180d00c01353e4bf4d4401328a30eb618c0130adf7b9371db4df3d3a" +dependencies = [ + "darling 0.20.3", + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "starbase_sandbox" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec8301c49429d3da1105475f4e32ce8fa7c8cf1028c4e4535b0c010be2952a" +dependencies = [ + "assert_cmd", + "assert_fs", + "clean-path", + "insta", + "once_cell", + "predicates", + "pretty_assertions", + "starbase_utils", +] + +[[package]] +name = "starbase_styles" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251a45da918b41577ab62fb764c9683a0f50fb2b8999a629dbd6c25476a9c411" +dependencies = [ + "dirs 5.0.1", + "owo-colors", + "supports-color", +] + +[[package]] +name = "starbase_utils" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "032493983d1aaa0e6107219e8b17e2b315452f902f0f512c8bd5af6df6704b44" +dependencies = [ + "dirs 5.0.1", + "fs4", + "json_comments", + "miette", + "once_cell", + "regex", + "relative-path", + "serde", + "serde_json", + "starbase_styles", + "thiserror", + "tokio", + "toml 0.7.6", + "tracing", + "wax", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "supports-color" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4950e7174bffabe99455511c39707310e7e9b440364a2fcb1cc21521be57b354" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-interface" +version = "0.25.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10081a99cbecbc363d381b9503563785f0b02735fccbb0d4c1a2cb3d39f7e7fe" +dependencies = [ + "bitflags 2.4.0", + "cap-fs-ext", + "cap-std", + "fd-lock", + "io-lifetimes 2.0.2", + "rustix 0.38.11", + "windows-sys 0.48.0", + "winx 0.36.2", +] + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix 0.38.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "thread-id" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79474f573561cdc4871a0de34a51c92f7f5a56039113fbb5b9c9f96bdb756669" +dependencies = [ + "libc", + "redox_syscall 0.2.16", + "winapi", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.3", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typemap-ors" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68c24b707f02dd18f1e4ccceb9d49f2058c2fb86384ef9972592904d7a28867" +dependencies = [ + "unsafe-any-ors", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "unsafe-any-ors" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a303d30665362d9680d7d91d78b23f5f899504d4f08b3c4cf08d055d87c0ad" +dependencies = [ + "destructure_traitobject", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "ureq" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" +dependencies = [ + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-webpki 0.100.2", + "url", + "webpki-roots 0.23.1", +] + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "warpgate" +version = "0.5.3" +dependencies = [ + "extism", + "miette", + "once_cell", + "once_map", + "regex", + "reqwest", + "serde", + "serde_json", + "sha2", + "starbase_archive", + "starbase_styles", + "starbase_utils", + "thiserror", + "tracing", + "warpgate_api", +] + +[[package]] +name = "warpgate_api" +version = "0.1.3" +dependencies = [ + "serde", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi-cap-std-sync" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0fb9a3b1143c8f549b64d707aef869d134fb681f17fb316f0d796537b670ef" +dependencies = [ + "anyhow", + "async-trait", + "cap-fs-ext", + "cap-rand", + "cap-std", + "cap-time-ext", + "fs-set-times", + "io-extras", + "io-lifetimes 1.0.11", + "is-terminal", + "once_cell", + "rustix 0.37.23", + "system-interface", + "tracing", + "wasi-common", + "windows-sys 0.48.0", +] + +[[package]] +name = "wasi-common" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41512a0523d86be06d7cf606e1bafd0238948b237ce832179f85dfdbce217e1a" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "cap-rand", + "cap-std", + "io-extras", + "log", + "rustix 0.37.23", + "thiserror", + "tracing", + "wasmtime", + "wiggle", + "windows-sys 0.48.0", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.31", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.31", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "wasm-encoder" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-encoder" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba64e81215916eaeb48fee292f29401d69235d62d8b8fd92a7b2844ec5ae5f7" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasmparser" +version = "0.107.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +dependencies = [ + "indexmap 1.9.3", + "semver", +] + +[[package]] +name = "wasmparser" +version = "0.112.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e986b010f47fcce49cf8ea5d5f9e5d2737832f12b53ae8ae785bbe895d0877bf" +dependencies = [ + "indexmap 2.0.0", + "semver", +] + +[[package]] +name = "wasmprinter" +version = "0.2.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ddf5892036cd4b780d505eff1194a0cbc10ed896097656fdcea3744b5e7c2f" +dependencies = [ + "anyhow", + "wasmparser 0.112.0", +] + +[[package]] +name = "wasmtime" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b1f817f2ca5070983c71f1205fbab5848c9073df7f4e1af9fdceb4cc4a1b8e5" +dependencies = [ + "anyhow", + "async-trait", + "bincode", + "bumpalo", + "cfg-if", + "encoding_rs", + "fxprof-processed-profile", + "indexmap 1.9.3", + "libc", + "log", + "object 0.30.4", + "once_cell", + "paste", + "psm", + "rayon", + "serde", + "serde_json", + "target-lexicon", + "wasmparser 0.107.0", + "wasmtime-cache", + "wasmtime-component-macro", + "wasmtime-component-util", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit", + "wasmtime-runtime", + "wasmtime-winch", + "wat", + "windows-sys 0.48.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f82fbfda4610e9225238c62574ecded8e9d6ad3a12f387ac45819ecad5c3f9b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-cache" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f5b87f1ed383d6c219c04467ab6ae87990d6c2815d5a990138990a7fcbab95" +dependencies = [ + "anyhow", + "base64", + "bincode", + "directories-next", + "file-per-thread-logger", + "log", + "rustix 0.37.23", + "serde", + "sha2", + "toml 0.5.11", + "windows-sys 0.48.0", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "wasmtime-component-macro" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27b96c540c78e12b60025fcbc0ba8a55bff1b32885a5e8eae2df765a6bc97ac" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-component-util" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0928fe66c22bf8887e2fb524b7647308b8ce836a333af8504e4f1d80b8ea849f" + +[[package]] +name = "wasmtime-cranelift" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659f6e58662d1131f250339acd03aa49377f9351474282699985b79ca4d4a7c" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.27.3", + "log", + "object 0.30.4", + "target-lexicon", + "thiserror", + "wasmparser 0.107.0", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74171de083bf2ecb716c507900f825e2b858346c714fbf48f4763ea760f998a8" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-control", + "cranelift-native", + "gimli 0.27.3", + "object 0.30.4", + "target-lexicon", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-environ" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b124cbac1a3e04a744c76b3f77919343ef16dc4c818a2406dd7b689b16a54639" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli 0.27.3", + "indexmap 1.9.3", + "log", + "object 0.30.4", + "serde", + "target-lexicon", + "thiserror", + "wasm-encoder 0.29.0", + "wasmparser 0.107.0", + "wasmprinter", + "wasmtime-component-util", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-fiber" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92ffb8869395c63100ffefbd71cf9489e7e9218e63a3798dcfe93fa8945f9cf" +dependencies = [ + "cc", + "cfg-if", + "rustix 0.37.23", + "wasmtime-asm-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "wasmtime-jit" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ff15f426c2378f32ffb6d9b4370e3504231492e93f6968e8b5102c3256bbc4" +dependencies = [ + "addr2line 0.19.0", + "anyhow", + "bincode", + "cfg-if", + "cpp_demangle", + "gimli 0.27.3", + "ittapi", + "log", + "object 0.30.4", + "rustc-demangle", + "rustix 0.37.23", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.48.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c549e219102426aa1f90bd18e56a3195ed1e696c318abb3f501c1f4924b530ac" +dependencies = [ + "object 0.30.4", + "once_cell", + "rustix 0.37.23", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cf02fedda287a409cff80ad40a7c6c0f0771e99b0cd5e2b79d9cb7ecdc1b2f4" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.48.0", +] + [[package]] -name = "warpgate_api" -version = "0.1.2" +name = "wasmtime-runtime" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc38c6229a5d3b8a2528eb33eb11d3e7ebf570259c7cd2f01e8668fe783ea443" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "encoding_rs", + "indexmap 1.9.3", + "libc", + "log", + "mach", + "memfd", + "memoffset 0.8.0", + "paste", + "rand", + "rustix 0.37.23", + "sptr", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit-debug", + "windows-sys 0.48.0", +] + +[[package]] +name = "wasmtime-types" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "768f6c5e7afc3a02eff2753196741db8e5ac5faf26a1e2204d7341b30a637c6f" dependencies = [ + "cranelift-entity", "serde", + "thiserror", + "wasmparser 0.107.0", ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "wasmtime-wasi" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ff7bb52cc5f9f3878cb012c5e42296e2fbb96e5407301b1e8e7007deec8dca9c" +dependencies = [ + "anyhow", + "async-trait", + "bitflags 1.3.2", + "cap-fs-ext", + "cap-rand", + "cap-std", + "cap-time-ext", + "fs-set-times", + "io-extras", + "libc", + "rustix 0.37.23", + "system-interface", + "thiserror", + "tracing", + "wasi-cap-std-sync", + "wasi-common", + "wasmtime", + "wiggle", + "windows-sys 0.48.0", +] + +[[package]] +name = "wasmtime-winch" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2249faeb887b8b7e7b1797c460ac76160654aea3b8d5842093a771d77fc3819" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli 0.27.3", + "object 0.30.4", + "target-lexicon", + "wasmparser 0.107.0", + "wasmtime-cranelift-shared", + "wasmtime-environ", + "winch-codegen", +] + +[[package]] +name = "wasmtime-wit-bindgen" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a4a005a6a2d5faa7cd953d389da8ae979cb571fe40edec7769649d8c98d874" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wast" +version = "35.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" +dependencies = [ + "leb128", +] + +[[package]] +name = "wast" +version = "64.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a259b226fd6910225aa7baeba82f9d9933b6d00f2ce1b49b80fa4214328237cc" +dependencies = [ + "leb128", + "memchr", + "unicode-width", + "wasm-encoder 0.32.0", +] + +[[package]] +name = "wat" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53253d920ab413fca1c7dc2161d601c79b4fdf631d0ba51dd4343bf9b556c3f6" +dependencies = [ + "wast 64.0.0", +] + +[[package]] +name = "wax" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c7a3bac6110ac062b7b422a442b7ee23e07209e2784a036654cab1e71bbafc" +dependencies = [ + "bstr 0.2.17", + "const_format", + "itertools", + "nom", + "nom-supreme", + "pori", + "regex", + "smallvec", + "thiserror", + "walkdir", +] + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" +dependencies = [ + "rustls-webpki 0.100.2", +] + +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + +[[package]] +name = "wiggle" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89f0d9c91096db5e250cb803500bddfdd65ae3268a9e09283b75d3b513ede7a" +dependencies = [ + "anyhow", + "async-trait", + "bitflags 1.3.2", + "thiserror", + "tracing", + "wasmtime", + "wiggle-macro", +] + +[[package]] +name = "wiggle-generate" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b5552356799612587de885e02b7e7e7d39e41657af1ddb985d18fbe5ac1642" +dependencies = [ + "anyhow", + "heck", + "proc-macro2", + "quote", + "shellexpand", + "syn 1.0.109", + "witx", +] + +[[package]] +name = "wiggle-macro" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ca58f5cfecefaec28b09bfb6197a52dbd24df4656154bd377a166f1031d9b17" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "wiggle-generate", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winch-codegen" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21de111a36e8f367416862fdf6f10caa411cc07a6e21b614eedbf9388c2a3dc9" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli 0.27.3", + "regalloc2", + "smallvec", + "target-lexicon", + "wasmparser 0.107.0", + "wasmtime-environ", +] + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] [[package]] name = "windows-targets" @@ -392,53 +3921,257 @@ version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "winx" +version = "0.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c52a121f0fbf9320d5f2a9a5d82f6cb7557eda5e8b47fc3e7f359ec866ae960" +dependencies = [ + "bitflags 1.3.2", + "io-lifetimes 1.0.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "winx" +version = "0.36.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357bb8e2932df531f83b052264b050b81ba0df90ee5a59b2d1d3949f344f81e5" +dependencies = [ + "bitflags 2.4.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "wit-parser" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 1.9.3", + "log", + "pulldown-cmark", + "semver", + "unicode-xid", + "url", +] + +[[package]] +name = "witx" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" +dependencies = [ + "anyhow", + "log", + "thiserror", + "wast 35.0.2", +] + +[[package]] +name = "xattr" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +dependencies = [ + "libc", +] + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.8+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +dependencies = [ + "cc", + "libc", + "pkg-config", +] diff --git a/plugins/Cargo.toml b/plugins/Cargo.toml index e3b75262b..414bf8076 100644 --- a/plugins/Cargo.toml +++ b/plugins/Cargo.toml @@ -3,5 +3,6 @@ resolver = "2" members = ["wasm-test"] [workspace.dependencies] -extism-pdk = "0.3.3" -serde = { version = "1.0.167", features = ["derive"] } +extism-pdk = "0.3.4" +serde = { version = "1.0.188", features = ["derive"] } +tokio = "1.32.0" diff --git a/plugins/wasm-test/Cargo.toml b/plugins/wasm-test/Cargo.toml index 29f987536..c7e82d56a 100644 --- a/plugins/wasm-test/Cargo.toml +++ b/plugins/wasm-test/Cargo.toml @@ -12,3 +12,8 @@ crate-type = ['cdylib'] proto_pdk = { path = "../../crates/pdk" } extism-pdk = { workspace = true } serde = { workspace = true } + +[dev-dependencies] +proto_pdk_test_utils = { path = "../../crates/pdk-test-utils" } +starbase_sandbox = "*" +tokio = { workspace = true } diff --git a/plugins/wasm-test/src/lib.rs b/plugins/wasm-test/src/lib.rs index f029b095b..87bce0f01 100644 --- a/plugins/wasm-test/src/lib.rs +++ b/plugins/wasm-test/src/lib.rs @@ -84,7 +84,6 @@ pub fn download_prebuilt( download_name: Some(filename), checksum_url: Some(format!("https://nodejs.org/dist/v{version}/SHASUMS256.txt")), checksum_name: None, - ..DownloadPrebuiltOutput::default() })) } diff --git a/plugins/wasm-test/tests/macros_test.rs b/plugins/wasm-test/tests/macros_test.rs new file mode 100644 index 000000000..a3f5100aa --- /dev/null +++ b/plugins/wasm-test/tests/macros_test.rs @@ -0,0 +1,16 @@ +use proto_pdk_test_utils::*; + +// This just tests that the macro generated code is correct, +// and doesn't actually pass. + +generate_download_install_tests!("wasm-test", "1.2.3"); + +generate_resolve_versions_tests!("wasm-test", { + "latest" => "1.2.3", +}); + +generate_global_shims_test!("wasm-test"); + +generate_local_shims_test!("wasm-test", ["other"]); + +generate_globals_test!("wasm-test", "dependency");