├── .github ├── dependabot.yml └── workflows │ ├── ci.yml │ └── publish-winget.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── src ├── commands │ ├── api │ │ ├── asciinema.rs │ │ └── mod.rs │ ├── auth.rs │ ├── mod.rs │ ├── play.rs │ ├── record.rs │ ├── types.rs │ └── upload.rs ├── main.rs └── terminal │ ├── impl_win │ ├── mod.rs │ ├── process.rs │ └── terminal.rs │ └── mod.rs └── testdata └── play.txt /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | - package-ecosystem: "cargo" 8 | directory: "/" 9 | schedule: 10 | interval: "daily" 11 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | branches: 8 | - main 9 | pull_request: 10 | branches: 11 | - main 12 | 13 | env: 14 | CARGO_TERM_COLOR: always 15 | 16 | jobs: 17 | build: 18 | runs-on: windows-latest 19 | env: 20 | RUST_BACKTRACE: 1 21 | 22 | steps: 23 | - uses: actions/checkout@v4 24 | - uses: Swatinem/rust-cache@v2 25 | - name: Build 26 | run: cargo build --release 27 | - name: Run tests 28 | run: cargo test --verbose 29 | - name: Upload artifact 30 | uses: actions/upload-artifact@v4 31 | with: 32 | name: PowerSession 33 | path: target/release/PowerSession.exe 34 | 35 | publish: 36 | needs: build 37 | runs-on: windows-latest 38 | if: startsWith(github.ref, 'refs/tags/v') 39 | env: 40 | CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} 41 | 42 | steps: 43 | - uses: actions/checkout@v4 44 | - uses: Swatinem/rust-cache@v2 45 | - name: Get PowerSession artifact 46 | uses: actions/download-artifact@v4 47 | with: 48 | name: PowerSession 49 | path: .\target\release 50 | - name: Display 51 | run: ls .\target\release\PowerSession.exe 52 | - name: Release 53 | uses: softprops/action-gh-release@v2.2.2 54 | with: 55 | files: .\target\release\PowerSession.exe 56 | - name: Publish to crates.io 57 | run: cargo publish --verbose 58 | -------------------------------------------------------------------------------- /.github/workflows/publish-winget.yml: -------------------------------------------------------------------------------- 1 | name: Update WinGet Packages 2 | 3 | on: workflow_dispatch 4 | 5 | jobs: 6 | update: 7 | name: Update Package 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Update Packages 11 | uses: michidk/winget-updater@v1 12 | with: 13 | komac-token: ${{ secrets.WINGET_TOKEN }} 14 | identifier: "Watfaq.PowerSession" 15 | repo: "Watfaq/PowerSession-rs" 16 | URL: "https://github.com/Watfaq/PowerSession-rs/releases/download/v{VERSION}/PowerSession.exe" 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .idea/ -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | contact@watfaq.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing to PowerSession 3 | 4 | First off, thanks for taking the time to contribute! ❤️ 5 | 6 | All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 7 | 8 | > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: 9 | > - Star the project 10 | > - Tweet about it 11 | > - Refer this project in your project's readme 12 | > - Mention the project at local meetups and tell your friends/colleagues 13 | 14 | 15 | ## Table of Contents 16 | 17 | - [Code of Conduct](#code-of-conduct) 18 | - [I Have a Question](#i-have-a-question) 19 | - [I Want To Contribute](#i-want-to-contribute) 20 | - [Reporting Bugs](#reporting-bugs) 21 | - [Suggesting Enhancements](#suggesting-enhancements) 22 | - [Your First Code Contribution](#your-first-code-contribution) 23 | - [Improving The Documentation](#improving-the-documentation) 24 | - [Styleguides](#styleguides) 25 | - [Commit Messages](#commit-messages) 26 | - [Join The Project Team](#join-the-project-team) 27 | 28 | 29 | ## Code of Conduct 30 | 31 | This project and everyone participating in it is governed by the 32 | [PowerSession Code of Conduct](https://github.com/Watfaq/PowerSession-rs/blob/main/CODE_OF_CONDUCT.md). 33 | By participating, you are expected to uphold this code. Please report unacceptable behavior 34 | to . 35 | 36 | 37 | ## I Have a Question 38 | 39 | > If you want to ask a question, we assume that you have read the available [Documentation](https://github.com/Watfaq/PowerSession-rs/blob/main/README.md). 40 | 41 | Before you ask a question, it is best to search for existing [Issues](https://github.com/Watfaq/PowerSession-rs/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. 42 | 43 | If you then still feel the need to ask a question and need clarification, we recommend the following: 44 | 45 | - Open an [Issue](https://github.com/Watfaq/PowerSession-rs/issues/new). 46 | - Provide as much context as you can about what you're running into. 47 | - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. 48 | 49 | We will then take care of the issue as soon as possible. 50 | 51 | 65 | 66 | ## I Want To Contribute 67 | 68 | > ### Legal Notice 69 | > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. 70 | 71 | ### Reporting Bugs 72 | 73 | 74 | #### Before Submitting a Bug Report 75 | 76 | A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. 77 | 78 | - Make sure that you are using the latest version. 79 | - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://github.com/Watfaq/PowerSession-rs/blob/main/README.md). If you are looking for support, you might want to check [this section](#i-have-a-question)). 80 | - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/Watfaq/PowerSession-rs/issues?q=label%3Abug). 81 | - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. 82 | - Collect information about the bug: 83 | - Stack trace (Traceback) 84 | - OS, Platform and Version (Windows, Linux, macOS, x86, ARM) 85 | - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. 86 | - Possibly your input and the output 87 | - Can you reliably reproduce the issue? And can you also reproduce it with older versions? 88 | 89 | 90 | #### How Do I Submit a Good Bug Report? 91 | 92 | > You must never report security related issues, vulnerabilities or bugs to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . 93 | 94 | 95 | We use GitHub issues to track bugs and errors. If you run into an issue with the project: 96 | 97 | - Open an [Issue](https://github.com/Watfaq/PowerSession-rs/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) 98 | - Explain the behavior you would expect and the actual behavior. 99 | - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. 100 | - Provide the information you collected in the previous section. 101 | 102 | Once it's filed: 103 | 104 | - The project team will label the issue accordingly. 105 | - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. 106 | - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution). 107 | 108 | 109 | 110 | 111 | ### Suggesting Enhancements 112 | 113 | This section guides you through submitting an enhancement suggestion for PowerSession, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. 114 | 115 | 116 | #### Before Submitting an Enhancement 117 | 118 | - Make sure that you are using the latest version. 119 | - Read the [documentation](https://github.com/Watfaq/PowerSession-rs/blob/main/README.md) carefully and find out if the functionality is already covered, maybe by an individual configuration. 120 | - Perform a [search](https://github.com/Watfaq/PowerSessionissues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. 121 | - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. 122 | 123 | 124 | #### How Do I Submit a Good Enhancement Suggestion? 125 | 126 | Enhancement suggestions are tracked as [GitHub issues](https://github.com/Watfaq/PowerSession-rs/issues). 127 | 128 | - Use a **clear and descriptive title** for the issue to identify the suggestion. 129 | - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. 130 | - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. 131 | - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. 132 | - **Explain why this enhancement would be useful** to most PowerSession users. You may also want to point out the other projects that solved it better and which could serve as inspiration. 133 | 134 | 135 | 136 | ### Your First Code Contribution 137 | 138 | You'll need to have .NET development environment setup on you machine. 139 | 140 | Recommended IDE 141 | 142 | * Rider 143 | * Visual Studio 144 | 145 | 146 | ## Attribution 147 | This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)! 148 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "PowerSession" 7 | version = "0.1.12" 8 | dependencies = [ 9 | "base64", 10 | "clap", 11 | "fern", 12 | "log", 13 | "os_info", 14 | "platform-dirs", 15 | "reqwest", 16 | "rustc_version_runtime", 17 | "serde", 18 | "serde_json", 19 | "uuid", 20 | "windows", 21 | ] 22 | 23 | [[package]] 24 | name = "addr2line" 25 | version = "0.24.2" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 28 | dependencies = [ 29 | "gimli", 30 | ] 31 | 32 | [[package]] 33 | name = "adler2" 34 | version = "2.0.0" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 37 | 38 | [[package]] 39 | name = "anstream" 40 | version = "0.6.18" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" 43 | dependencies = [ 44 | "anstyle", 45 | "anstyle-parse", 46 | "anstyle-query", 47 | "anstyle-wincon", 48 | "colorchoice", 49 | "is_terminal_polyfill", 50 | "utf8parse", 51 | ] 52 | 53 | [[package]] 54 | name = "anstyle" 55 | version = "1.0.10" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" 58 | 59 | [[package]] 60 | name = "anstyle-parse" 61 | version = "0.2.6" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" 64 | dependencies = [ 65 | "utf8parse", 66 | ] 67 | 68 | [[package]] 69 | name = "anstyle-query" 70 | version = "1.1.2" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" 73 | dependencies = [ 74 | "windows-sys 0.59.0", 75 | ] 76 | 77 | [[package]] 78 | name = "anstyle-wincon" 79 | version = "3.0.7" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" 82 | dependencies = [ 83 | "anstyle", 84 | "once_cell", 85 | "windows-sys 0.59.0", 86 | ] 87 | 88 | [[package]] 89 | name = "atomic-waker" 90 | version = "1.1.2" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 93 | 94 | [[package]] 95 | name = "autocfg" 96 | version = "1.4.0" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 99 | 100 | [[package]] 101 | name = "backtrace" 102 | version = "0.3.74" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" 105 | dependencies = [ 106 | "addr2line", 107 | "cfg-if", 108 | "libc", 109 | "miniz_oxide", 110 | "object", 111 | "rustc-demangle", 112 | "windows-targets 0.52.6", 113 | ] 114 | 115 | [[package]] 116 | name = "base64" 117 | version = "0.22.1" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 120 | 121 | [[package]] 122 | name = "bitflags" 123 | version = "2.9.0" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" 126 | 127 | [[package]] 128 | name = "bumpalo" 129 | version = "3.17.0" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" 132 | 133 | [[package]] 134 | name = "bytes" 135 | version = "1.10.1" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" 138 | 139 | [[package]] 140 | name = "cc" 141 | version = "1.2.20" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" 144 | dependencies = [ 145 | "shlex", 146 | ] 147 | 148 | [[package]] 149 | name = "cfg-if" 150 | version = "1.0.0" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 153 | 154 | [[package]] 155 | name = "clap" 156 | version = "4.5.37" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" 159 | dependencies = [ 160 | "clap_builder", 161 | ] 162 | 163 | [[package]] 164 | name = "clap_builder" 165 | version = "4.5.37" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" 168 | dependencies = [ 169 | "anstream", 170 | "anstyle", 171 | "clap_lex", 172 | "strsim", 173 | ] 174 | 175 | [[package]] 176 | name = "clap_lex" 177 | version = "0.7.4" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" 180 | 181 | [[package]] 182 | name = "colorchoice" 183 | version = "1.0.3" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" 186 | 187 | [[package]] 188 | name = "colored" 189 | version = "2.2.0" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" 192 | dependencies = [ 193 | "lazy_static", 194 | "windows-sys 0.59.0", 195 | ] 196 | 197 | [[package]] 198 | name = "core-foundation" 199 | version = "0.9.4" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 202 | dependencies = [ 203 | "core-foundation-sys", 204 | "libc", 205 | ] 206 | 207 | [[package]] 208 | name = "core-foundation-sys" 209 | version = "0.8.7" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 212 | 213 | [[package]] 214 | name = "dirs-next" 215 | version = "1.0.2" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "cf36e65a80337bea855cd4ef9b8401ffce06a7baedf2e85ec467b1ac3f6e82b6" 218 | dependencies = [ 219 | "cfg-if", 220 | "dirs-sys-next", 221 | ] 222 | 223 | [[package]] 224 | name = "dirs-sys-next" 225 | version = "0.1.2" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" 228 | dependencies = [ 229 | "libc", 230 | "redox_users", 231 | "winapi", 232 | ] 233 | 234 | [[package]] 235 | name = "displaydoc" 236 | version = "0.2.5" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 239 | dependencies = [ 240 | "proc-macro2", 241 | "quote", 242 | "syn", 243 | ] 244 | 245 | [[package]] 246 | name = "encoding_rs" 247 | version = "0.8.35" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 250 | dependencies = [ 251 | "cfg-if", 252 | ] 253 | 254 | [[package]] 255 | name = "equivalent" 256 | version = "1.0.2" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 259 | 260 | [[package]] 261 | name = "errno" 262 | version = "0.3.11" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" 265 | dependencies = [ 266 | "libc", 267 | "windows-sys 0.59.0", 268 | ] 269 | 270 | [[package]] 271 | name = "fastrand" 272 | version = "2.3.0" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 275 | 276 | [[package]] 277 | name = "fern" 278 | version = "0.7.1" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" 281 | dependencies = [ 282 | "colored", 283 | "log", 284 | ] 285 | 286 | [[package]] 287 | name = "fnv" 288 | version = "1.0.7" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 291 | 292 | [[package]] 293 | name = "foreign-types" 294 | version = "0.3.2" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 297 | dependencies = [ 298 | "foreign-types-shared", 299 | ] 300 | 301 | [[package]] 302 | name = "foreign-types-shared" 303 | version = "0.1.1" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 306 | 307 | [[package]] 308 | name = "form_urlencoded" 309 | version = "1.2.1" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 312 | dependencies = [ 313 | "percent-encoding", 314 | ] 315 | 316 | [[package]] 317 | name = "futures-channel" 318 | version = "0.3.31" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 321 | dependencies = [ 322 | "futures-core", 323 | "futures-sink", 324 | ] 325 | 326 | [[package]] 327 | name = "futures-core" 328 | version = "0.3.31" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 331 | 332 | [[package]] 333 | name = "futures-io" 334 | version = "0.3.31" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" 337 | 338 | [[package]] 339 | name = "futures-sink" 340 | version = "0.3.31" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 343 | 344 | [[package]] 345 | name = "futures-task" 346 | version = "0.3.31" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 349 | 350 | [[package]] 351 | name = "futures-util" 352 | version = "0.3.31" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 355 | dependencies = [ 356 | "futures-core", 357 | "futures-io", 358 | "futures-sink", 359 | "futures-task", 360 | "memchr", 361 | "pin-project-lite", 362 | "pin-utils", 363 | "slab", 364 | ] 365 | 366 | [[package]] 367 | name = "getrandom" 368 | version = "0.2.16" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" 371 | dependencies = [ 372 | "cfg-if", 373 | "libc", 374 | "wasi 0.11.0+wasi-snapshot-preview1", 375 | ] 376 | 377 | [[package]] 378 | name = "getrandom" 379 | version = "0.3.2" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" 382 | dependencies = [ 383 | "cfg-if", 384 | "libc", 385 | "r-efi", 386 | "wasi 0.14.2+wasi-0.2.4", 387 | ] 388 | 389 | [[package]] 390 | name = "gimli" 391 | version = "0.31.1" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 394 | 395 | [[package]] 396 | name = "h2" 397 | version = "0.4.9" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "75249d144030531f8dee69fe9cea04d3edf809a017ae445e2abdff6629e86633" 400 | dependencies = [ 401 | "atomic-waker", 402 | "bytes", 403 | "fnv", 404 | "futures-core", 405 | "futures-sink", 406 | "http", 407 | "indexmap", 408 | "slab", 409 | "tokio", 410 | "tokio-util", 411 | "tracing", 412 | ] 413 | 414 | [[package]] 415 | name = "hashbrown" 416 | version = "0.15.2" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" 419 | 420 | [[package]] 421 | name = "http" 422 | version = "1.3.1" 423 | source = "registry+https://github.com/rust-lang/crates.io-index" 424 | checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" 425 | dependencies = [ 426 | "bytes", 427 | "fnv", 428 | "itoa", 429 | ] 430 | 431 | [[package]] 432 | name = "http-body" 433 | version = "1.0.1" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 436 | dependencies = [ 437 | "bytes", 438 | "http", 439 | ] 440 | 441 | [[package]] 442 | name = "http-body-util" 443 | version = "0.1.3" 444 | source = "registry+https://github.com/rust-lang/crates.io-index" 445 | checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" 446 | dependencies = [ 447 | "bytes", 448 | "futures-core", 449 | "http", 450 | "http-body", 451 | "pin-project-lite", 452 | ] 453 | 454 | [[package]] 455 | name = "httparse" 456 | version = "1.10.1" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" 459 | 460 | [[package]] 461 | name = "hyper" 462 | version = "1.6.0" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" 465 | dependencies = [ 466 | "bytes", 467 | "futures-channel", 468 | "futures-util", 469 | "h2", 470 | "http", 471 | "http-body", 472 | "httparse", 473 | "itoa", 474 | "pin-project-lite", 475 | "smallvec", 476 | "tokio", 477 | "want", 478 | ] 479 | 480 | [[package]] 481 | name = "hyper-rustls" 482 | version = "0.27.5" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" 485 | dependencies = [ 486 | "futures-util", 487 | "http", 488 | "hyper", 489 | "hyper-util", 490 | "rustls", 491 | "rustls-pki-types", 492 | "tokio", 493 | "tokio-rustls", 494 | "tower-service", 495 | ] 496 | 497 | [[package]] 498 | name = "hyper-tls" 499 | version = "0.6.0" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" 502 | dependencies = [ 503 | "bytes", 504 | "http-body-util", 505 | "hyper", 506 | "hyper-util", 507 | "native-tls", 508 | "tokio", 509 | "tokio-native-tls", 510 | "tower-service", 511 | ] 512 | 513 | [[package]] 514 | name = "hyper-util" 515 | version = "0.1.11" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" 518 | dependencies = [ 519 | "bytes", 520 | "futures-channel", 521 | "futures-util", 522 | "http", 523 | "http-body", 524 | "hyper", 525 | "libc", 526 | "pin-project-lite", 527 | "socket2", 528 | "tokio", 529 | "tower-service", 530 | "tracing", 531 | ] 532 | 533 | [[package]] 534 | name = "icu_collections" 535 | version = "1.5.0" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" 538 | dependencies = [ 539 | "displaydoc", 540 | "yoke", 541 | "zerofrom", 542 | "zerovec", 543 | ] 544 | 545 | [[package]] 546 | name = "icu_locid" 547 | version = "1.5.0" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" 550 | dependencies = [ 551 | "displaydoc", 552 | "litemap", 553 | "tinystr", 554 | "writeable", 555 | "zerovec", 556 | ] 557 | 558 | [[package]] 559 | name = "icu_locid_transform" 560 | version = "1.5.0" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" 563 | dependencies = [ 564 | "displaydoc", 565 | "icu_locid", 566 | "icu_locid_transform_data", 567 | "icu_provider", 568 | "tinystr", 569 | "zerovec", 570 | ] 571 | 572 | [[package]] 573 | name = "icu_locid_transform_data" 574 | version = "1.5.1" 575 | source = "registry+https://github.com/rust-lang/crates.io-index" 576 | checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" 577 | 578 | [[package]] 579 | name = "icu_normalizer" 580 | version = "1.5.0" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" 583 | dependencies = [ 584 | "displaydoc", 585 | "icu_collections", 586 | "icu_normalizer_data", 587 | "icu_properties", 588 | "icu_provider", 589 | "smallvec", 590 | "utf16_iter", 591 | "utf8_iter", 592 | "write16", 593 | "zerovec", 594 | ] 595 | 596 | [[package]] 597 | name = "icu_normalizer_data" 598 | version = "1.5.1" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" 601 | 602 | [[package]] 603 | name = "icu_properties" 604 | version = "1.5.1" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" 607 | dependencies = [ 608 | "displaydoc", 609 | "icu_collections", 610 | "icu_locid_transform", 611 | "icu_properties_data", 612 | "icu_provider", 613 | "tinystr", 614 | "zerovec", 615 | ] 616 | 617 | [[package]] 618 | name = "icu_properties_data" 619 | version = "1.5.1" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" 622 | 623 | [[package]] 624 | name = "icu_provider" 625 | version = "1.5.0" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" 628 | dependencies = [ 629 | "displaydoc", 630 | "icu_locid", 631 | "icu_provider_macros", 632 | "stable_deref_trait", 633 | "tinystr", 634 | "writeable", 635 | "yoke", 636 | "zerofrom", 637 | "zerovec", 638 | ] 639 | 640 | [[package]] 641 | name = "icu_provider_macros" 642 | version = "1.5.0" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" 645 | dependencies = [ 646 | "proc-macro2", 647 | "quote", 648 | "syn", 649 | ] 650 | 651 | [[package]] 652 | name = "idna" 653 | version = "1.0.3" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" 656 | dependencies = [ 657 | "idna_adapter", 658 | "smallvec", 659 | "utf8_iter", 660 | ] 661 | 662 | [[package]] 663 | name = "idna_adapter" 664 | version = "1.2.0" 665 | source = "registry+https://github.com/rust-lang/crates.io-index" 666 | checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" 667 | dependencies = [ 668 | "icu_normalizer", 669 | "icu_properties", 670 | ] 671 | 672 | [[package]] 673 | name = "indexmap" 674 | version = "2.9.0" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" 677 | dependencies = [ 678 | "equivalent", 679 | "hashbrown", 680 | ] 681 | 682 | [[package]] 683 | name = "ipnet" 684 | version = "2.11.0" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" 687 | 688 | [[package]] 689 | name = "is_terminal_polyfill" 690 | version = "1.70.1" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 693 | 694 | [[package]] 695 | name = "itoa" 696 | version = "1.0.15" 697 | source = "registry+https://github.com/rust-lang/crates.io-index" 698 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 699 | 700 | [[package]] 701 | name = "js-sys" 702 | version = "0.3.77" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" 705 | dependencies = [ 706 | "once_cell", 707 | "wasm-bindgen", 708 | ] 709 | 710 | [[package]] 711 | name = "lazy_static" 712 | version = "1.5.0" 713 | source = "registry+https://github.com/rust-lang/crates.io-index" 714 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 715 | 716 | [[package]] 717 | name = "libc" 718 | version = "0.2.172" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" 721 | 722 | [[package]] 723 | name = "libredox" 724 | version = "0.1.3" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" 727 | dependencies = [ 728 | "bitflags", 729 | "libc", 730 | ] 731 | 732 | [[package]] 733 | name = "linux-raw-sys" 734 | version = "0.9.4" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" 737 | 738 | [[package]] 739 | name = "litemap" 740 | version = "0.7.5" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" 743 | 744 | [[package]] 745 | name = "log" 746 | version = "0.4.27" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" 749 | 750 | [[package]] 751 | name = "memchr" 752 | version = "2.7.4" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 755 | 756 | [[package]] 757 | name = "mime" 758 | version = "0.3.17" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 761 | 762 | [[package]] 763 | name = "mime_guess" 764 | version = "2.0.5" 765 | source = "registry+https://github.com/rust-lang/crates.io-index" 766 | checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" 767 | dependencies = [ 768 | "mime", 769 | "unicase", 770 | ] 771 | 772 | [[package]] 773 | name = "miniz_oxide" 774 | version = "0.8.8" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" 777 | dependencies = [ 778 | "adler2", 779 | ] 780 | 781 | [[package]] 782 | name = "mio" 783 | version = "1.0.3" 784 | source = "registry+https://github.com/rust-lang/crates.io-index" 785 | checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" 786 | dependencies = [ 787 | "libc", 788 | "wasi 0.11.0+wasi-snapshot-preview1", 789 | "windows-sys 0.52.0", 790 | ] 791 | 792 | [[package]] 793 | name = "native-tls" 794 | version = "0.2.14" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" 797 | dependencies = [ 798 | "libc", 799 | "log", 800 | "openssl", 801 | "openssl-probe", 802 | "openssl-sys", 803 | "schannel", 804 | "security-framework", 805 | "security-framework-sys", 806 | "tempfile", 807 | ] 808 | 809 | [[package]] 810 | name = "object" 811 | version = "0.36.7" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" 814 | dependencies = [ 815 | "memchr", 816 | ] 817 | 818 | [[package]] 819 | name = "once_cell" 820 | version = "1.21.3" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 823 | 824 | [[package]] 825 | name = "openssl" 826 | version = "0.10.72" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" 829 | dependencies = [ 830 | "bitflags", 831 | "cfg-if", 832 | "foreign-types", 833 | "libc", 834 | "once_cell", 835 | "openssl-macros", 836 | "openssl-sys", 837 | ] 838 | 839 | [[package]] 840 | name = "openssl-macros" 841 | version = "0.1.1" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 844 | dependencies = [ 845 | "proc-macro2", 846 | "quote", 847 | "syn", 848 | ] 849 | 850 | [[package]] 851 | name = "openssl-probe" 852 | version = "0.1.6" 853 | source = "registry+https://github.com/rust-lang/crates.io-index" 854 | checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" 855 | 856 | [[package]] 857 | name = "openssl-sys" 858 | version = "0.9.107" 859 | source = "registry+https://github.com/rust-lang/crates.io-index" 860 | checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" 861 | dependencies = [ 862 | "cc", 863 | "libc", 864 | "pkg-config", 865 | "vcpkg", 866 | ] 867 | 868 | [[package]] 869 | name = "os_info" 870 | version = "3.10.0" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "2a604e53c24761286860eba4e2c8b23a0161526476b1de520139d69cdb85a6b5" 873 | dependencies = [ 874 | "log", 875 | "serde", 876 | "windows-sys 0.52.0", 877 | ] 878 | 879 | [[package]] 880 | name = "percent-encoding" 881 | version = "2.3.1" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 884 | 885 | [[package]] 886 | name = "pin-project-lite" 887 | version = "0.2.16" 888 | source = "registry+https://github.com/rust-lang/crates.io-index" 889 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 890 | 891 | [[package]] 892 | name = "pin-utils" 893 | version = "0.1.0" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 896 | 897 | [[package]] 898 | name = "pkg-config" 899 | version = "0.3.32" 900 | source = "registry+https://github.com/rust-lang/crates.io-index" 901 | checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" 902 | 903 | [[package]] 904 | name = "platform-dirs" 905 | version = "0.3.0" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "e188d043c1a692985f78b5464853a263f1a27e5bd6322bad3a4078ee3c998a38" 908 | dependencies = [ 909 | "dirs-next", 910 | ] 911 | 912 | [[package]] 913 | name = "ppv-lite86" 914 | version = "0.2.21" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" 917 | dependencies = [ 918 | "zerocopy", 919 | ] 920 | 921 | [[package]] 922 | name = "proc-macro2" 923 | version = "1.0.95" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" 926 | dependencies = [ 927 | "unicode-ident", 928 | ] 929 | 930 | [[package]] 931 | name = "quote" 932 | version = "1.0.40" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" 935 | dependencies = [ 936 | "proc-macro2", 937 | ] 938 | 939 | [[package]] 940 | name = "r-efi" 941 | version = "5.2.0" 942 | source = "registry+https://github.com/rust-lang/crates.io-index" 943 | checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" 944 | 945 | [[package]] 946 | name = "rand" 947 | version = "0.9.1" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" 950 | dependencies = [ 951 | "rand_chacha", 952 | "rand_core", 953 | ] 954 | 955 | [[package]] 956 | name = "rand_chacha" 957 | version = "0.9.0" 958 | source = "registry+https://github.com/rust-lang/crates.io-index" 959 | checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" 960 | dependencies = [ 961 | "ppv-lite86", 962 | "rand_core", 963 | ] 964 | 965 | [[package]] 966 | name = "rand_core" 967 | version = "0.9.3" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" 970 | dependencies = [ 971 | "getrandom 0.3.2", 972 | ] 973 | 974 | [[package]] 975 | name = "redox_users" 976 | version = "0.4.6" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" 979 | dependencies = [ 980 | "getrandom 0.2.16", 981 | "libredox", 982 | "thiserror", 983 | ] 984 | 985 | [[package]] 986 | name = "reqwest" 987 | version = "0.12.15" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" 990 | dependencies = [ 991 | "base64", 992 | "bytes", 993 | "encoding_rs", 994 | "futures-channel", 995 | "futures-core", 996 | "futures-util", 997 | "h2", 998 | "http", 999 | "http-body", 1000 | "http-body-util", 1001 | "hyper", 1002 | "hyper-rustls", 1003 | "hyper-tls", 1004 | "hyper-util", 1005 | "ipnet", 1006 | "js-sys", 1007 | "log", 1008 | "mime", 1009 | "mime_guess", 1010 | "native-tls", 1011 | "once_cell", 1012 | "percent-encoding", 1013 | "pin-project-lite", 1014 | "rustls-pemfile", 1015 | "serde", 1016 | "serde_json", 1017 | "serde_urlencoded", 1018 | "sync_wrapper", 1019 | "system-configuration", 1020 | "tokio", 1021 | "tokio-native-tls", 1022 | "tower", 1023 | "tower-service", 1024 | "url", 1025 | "wasm-bindgen", 1026 | "wasm-bindgen-futures", 1027 | "web-sys", 1028 | "windows-registry", 1029 | ] 1030 | 1031 | [[package]] 1032 | name = "ring" 1033 | version = "0.17.14" 1034 | source = "registry+https://github.com/rust-lang/crates.io-index" 1035 | checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" 1036 | dependencies = [ 1037 | "cc", 1038 | "cfg-if", 1039 | "getrandom 0.2.16", 1040 | "libc", 1041 | "untrusted", 1042 | "windows-sys 0.52.0", 1043 | ] 1044 | 1045 | [[package]] 1046 | name = "rustc-demangle" 1047 | version = "0.1.24" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 1050 | 1051 | [[package]] 1052 | name = "rustc_version" 1053 | version = "0.4.1" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" 1056 | dependencies = [ 1057 | "semver", 1058 | ] 1059 | 1060 | [[package]] 1061 | name = "rustc_version_runtime" 1062 | version = "0.3.0" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "2dd18cd2bae1820af0b6ad5e54f4a51d0f3fcc53b05f845675074efcc7af071d" 1065 | dependencies = [ 1066 | "rustc_version", 1067 | "semver", 1068 | ] 1069 | 1070 | [[package]] 1071 | name = "rustix" 1072 | version = "1.0.5" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" 1075 | dependencies = [ 1076 | "bitflags", 1077 | "errno", 1078 | "libc", 1079 | "linux-raw-sys", 1080 | "windows-sys 0.59.0", 1081 | ] 1082 | 1083 | [[package]] 1084 | name = "rustls" 1085 | version = "0.23.26" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "df51b5869f3a441595eac5e8ff14d486ff285f7b8c0df8770e49c3b56351f0f0" 1088 | dependencies = [ 1089 | "once_cell", 1090 | "rustls-pki-types", 1091 | "rustls-webpki", 1092 | "subtle", 1093 | "zeroize", 1094 | ] 1095 | 1096 | [[package]] 1097 | name = "rustls-pemfile" 1098 | version = "2.2.0" 1099 | source = "registry+https://github.com/rust-lang/crates.io-index" 1100 | checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" 1101 | dependencies = [ 1102 | "rustls-pki-types", 1103 | ] 1104 | 1105 | [[package]] 1106 | name = "rustls-pki-types" 1107 | version = "1.11.0" 1108 | source = "registry+https://github.com/rust-lang/crates.io-index" 1109 | checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" 1110 | 1111 | [[package]] 1112 | name = "rustls-webpki" 1113 | version = "0.103.1" 1114 | source = "registry+https://github.com/rust-lang/crates.io-index" 1115 | checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" 1116 | dependencies = [ 1117 | "ring", 1118 | "rustls-pki-types", 1119 | "untrusted", 1120 | ] 1121 | 1122 | [[package]] 1123 | name = "rustversion" 1124 | version = "1.0.20" 1125 | source = "registry+https://github.com/rust-lang/crates.io-index" 1126 | checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" 1127 | 1128 | [[package]] 1129 | name = "ryu" 1130 | version = "1.0.20" 1131 | source = "registry+https://github.com/rust-lang/crates.io-index" 1132 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 1133 | 1134 | [[package]] 1135 | name = "schannel" 1136 | version = "0.1.27" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" 1139 | dependencies = [ 1140 | "windows-sys 0.59.0", 1141 | ] 1142 | 1143 | [[package]] 1144 | name = "security-framework" 1145 | version = "2.11.1" 1146 | source = "registry+https://github.com/rust-lang/crates.io-index" 1147 | checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" 1148 | dependencies = [ 1149 | "bitflags", 1150 | "core-foundation", 1151 | "core-foundation-sys", 1152 | "libc", 1153 | "security-framework-sys", 1154 | ] 1155 | 1156 | [[package]] 1157 | name = "security-framework-sys" 1158 | version = "2.14.0" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" 1161 | dependencies = [ 1162 | "core-foundation-sys", 1163 | "libc", 1164 | ] 1165 | 1166 | [[package]] 1167 | name = "semver" 1168 | version = "1.0.26" 1169 | source = "registry+https://github.com/rust-lang/crates.io-index" 1170 | checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" 1171 | 1172 | [[package]] 1173 | name = "serde" 1174 | version = "1.0.219" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" 1177 | dependencies = [ 1178 | "serde_derive", 1179 | ] 1180 | 1181 | [[package]] 1182 | name = "serde_derive" 1183 | version = "1.0.219" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" 1186 | dependencies = [ 1187 | "proc-macro2", 1188 | "quote", 1189 | "syn", 1190 | ] 1191 | 1192 | [[package]] 1193 | name = "serde_json" 1194 | version = "1.0.140" 1195 | source = "registry+https://github.com/rust-lang/crates.io-index" 1196 | checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" 1197 | dependencies = [ 1198 | "itoa", 1199 | "memchr", 1200 | "ryu", 1201 | "serde", 1202 | ] 1203 | 1204 | [[package]] 1205 | name = "serde_urlencoded" 1206 | version = "0.7.1" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1209 | dependencies = [ 1210 | "form_urlencoded", 1211 | "itoa", 1212 | "ryu", 1213 | "serde", 1214 | ] 1215 | 1216 | [[package]] 1217 | name = "shlex" 1218 | version = "1.3.0" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1221 | 1222 | [[package]] 1223 | name = "slab" 1224 | version = "0.4.9" 1225 | source = "registry+https://github.com/rust-lang/crates.io-index" 1226 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1227 | dependencies = [ 1228 | "autocfg", 1229 | ] 1230 | 1231 | [[package]] 1232 | name = "smallvec" 1233 | version = "1.15.0" 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" 1235 | checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" 1236 | 1237 | [[package]] 1238 | name = "socket2" 1239 | version = "0.5.9" 1240 | source = "registry+https://github.com/rust-lang/crates.io-index" 1241 | checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" 1242 | dependencies = [ 1243 | "libc", 1244 | "windows-sys 0.52.0", 1245 | ] 1246 | 1247 | [[package]] 1248 | name = "stable_deref_trait" 1249 | version = "1.2.0" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1252 | 1253 | [[package]] 1254 | name = "strsim" 1255 | version = "0.11.1" 1256 | source = "registry+https://github.com/rust-lang/crates.io-index" 1257 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1258 | 1259 | [[package]] 1260 | name = "subtle" 1261 | version = "2.6.1" 1262 | source = "registry+https://github.com/rust-lang/crates.io-index" 1263 | checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" 1264 | 1265 | [[package]] 1266 | name = "syn" 1267 | version = "2.0.101" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" 1270 | dependencies = [ 1271 | "proc-macro2", 1272 | "quote", 1273 | "unicode-ident", 1274 | ] 1275 | 1276 | [[package]] 1277 | name = "sync_wrapper" 1278 | version = "1.0.2" 1279 | source = "registry+https://github.com/rust-lang/crates.io-index" 1280 | checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" 1281 | dependencies = [ 1282 | "futures-core", 1283 | ] 1284 | 1285 | [[package]] 1286 | name = "synstructure" 1287 | version = "0.13.1" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" 1290 | dependencies = [ 1291 | "proc-macro2", 1292 | "quote", 1293 | "syn", 1294 | ] 1295 | 1296 | [[package]] 1297 | name = "system-configuration" 1298 | version = "0.6.1" 1299 | source = "registry+https://github.com/rust-lang/crates.io-index" 1300 | checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" 1301 | dependencies = [ 1302 | "bitflags", 1303 | "core-foundation", 1304 | "system-configuration-sys", 1305 | ] 1306 | 1307 | [[package]] 1308 | name = "system-configuration-sys" 1309 | version = "0.6.0" 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" 1311 | checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" 1312 | dependencies = [ 1313 | "core-foundation-sys", 1314 | "libc", 1315 | ] 1316 | 1317 | [[package]] 1318 | name = "tempfile" 1319 | version = "3.19.1" 1320 | source = "registry+https://github.com/rust-lang/crates.io-index" 1321 | checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" 1322 | dependencies = [ 1323 | "fastrand", 1324 | "getrandom 0.3.2", 1325 | "once_cell", 1326 | "rustix", 1327 | "windows-sys 0.59.0", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "thiserror" 1332 | version = "1.0.69" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 1335 | dependencies = [ 1336 | "thiserror-impl", 1337 | ] 1338 | 1339 | [[package]] 1340 | name = "thiserror-impl" 1341 | version = "1.0.69" 1342 | source = "registry+https://github.com/rust-lang/crates.io-index" 1343 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 1344 | dependencies = [ 1345 | "proc-macro2", 1346 | "quote", 1347 | "syn", 1348 | ] 1349 | 1350 | [[package]] 1351 | name = "tinystr" 1352 | version = "0.7.6" 1353 | source = "registry+https://github.com/rust-lang/crates.io-index" 1354 | checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" 1355 | dependencies = [ 1356 | "displaydoc", 1357 | "zerovec", 1358 | ] 1359 | 1360 | [[package]] 1361 | name = "tokio" 1362 | version = "1.44.2" 1363 | source = "registry+https://github.com/rust-lang/crates.io-index" 1364 | checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" 1365 | dependencies = [ 1366 | "backtrace", 1367 | "bytes", 1368 | "libc", 1369 | "mio", 1370 | "pin-project-lite", 1371 | "socket2", 1372 | "windows-sys 0.52.0", 1373 | ] 1374 | 1375 | [[package]] 1376 | name = "tokio-native-tls" 1377 | version = "0.3.1" 1378 | source = "registry+https://github.com/rust-lang/crates.io-index" 1379 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1380 | dependencies = [ 1381 | "native-tls", 1382 | "tokio", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "tokio-rustls" 1387 | version = "0.26.2" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" 1390 | dependencies = [ 1391 | "rustls", 1392 | "tokio", 1393 | ] 1394 | 1395 | [[package]] 1396 | name = "tokio-util" 1397 | version = "0.7.15" 1398 | source = "registry+https://github.com/rust-lang/crates.io-index" 1399 | checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" 1400 | dependencies = [ 1401 | "bytes", 1402 | "futures-core", 1403 | "futures-sink", 1404 | "pin-project-lite", 1405 | "tokio", 1406 | ] 1407 | 1408 | [[package]] 1409 | name = "tower" 1410 | version = "0.5.2" 1411 | source = "registry+https://github.com/rust-lang/crates.io-index" 1412 | checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" 1413 | dependencies = [ 1414 | "futures-core", 1415 | "futures-util", 1416 | "pin-project-lite", 1417 | "sync_wrapper", 1418 | "tokio", 1419 | "tower-layer", 1420 | "tower-service", 1421 | ] 1422 | 1423 | [[package]] 1424 | name = "tower-layer" 1425 | version = "0.3.3" 1426 | source = "registry+https://github.com/rust-lang/crates.io-index" 1427 | checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 1428 | 1429 | [[package]] 1430 | name = "tower-service" 1431 | version = "0.3.3" 1432 | source = "registry+https://github.com/rust-lang/crates.io-index" 1433 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1434 | 1435 | [[package]] 1436 | name = "tracing" 1437 | version = "0.1.41" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 1440 | dependencies = [ 1441 | "pin-project-lite", 1442 | "tracing-core", 1443 | ] 1444 | 1445 | [[package]] 1446 | name = "tracing-core" 1447 | version = "0.1.33" 1448 | source = "registry+https://github.com/rust-lang/crates.io-index" 1449 | checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" 1450 | dependencies = [ 1451 | "once_cell", 1452 | ] 1453 | 1454 | [[package]] 1455 | name = "try-lock" 1456 | version = "0.2.5" 1457 | source = "registry+https://github.com/rust-lang/crates.io-index" 1458 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1459 | 1460 | [[package]] 1461 | name = "unicase" 1462 | version = "2.8.1" 1463 | source = "registry+https://github.com/rust-lang/crates.io-index" 1464 | checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" 1465 | 1466 | [[package]] 1467 | name = "unicode-ident" 1468 | version = "1.0.18" 1469 | source = "registry+https://github.com/rust-lang/crates.io-index" 1470 | checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 1471 | 1472 | [[package]] 1473 | name = "untrusted" 1474 | version = "0.9.0" 1475 | source = "registry+https://github.com/rust-lang/crates.io-index" 1476 | checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 1477 | 1478 | [[package]] 1479 | name = "url" 1480 | version = "2.5.4" 1481 | source = "registry+https://github.com/rust-lang/crates.io-index" 1482 | checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" 1483 | dependencies = [ 1484 | "form_urlencoded", 1485 | "idna", 1486 | "percent-encoding", 1487 | ] 1488 | 1489 | [[package]] 1490 | name = "utf16_iter" 1491 | version = "1.0.5" 1492 | source = "registry+https://github.com/rust-lang/crates.io-index" 1493 | checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" 1494 | 1495 | [[package]] 1496 | name = "utf8_iter" 1497 | version = "1.0.4" 1498 | source = "registry+https://github.com/rust-lang/crates.io-index" 1499 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 1500 | 1501 | [[package]] 1502 | name = "utf8parse" 1503 | version = "0.2.2" 1504 | source = "registry+https://github.com/rust-lang/crates.io-index" 1505 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 1506 | 1507 | [[package]] 1508 | name = "uuid" 1509 | version = "1.16.0" 1510 | source = "registry+https://github.com/rust-lang/crates.io-index" 1511 | checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" 1512 | dependencies = [ 1513 | "getrandom 0.3.2", 1514 | "rand", 1515 | "uuid-macro-internal", 1516 | ] 1517 | 1518 | [[package]] 1519 | name = "uuid-macro-internal" 1520 | version = "1.16.0" 1521 | source = "registry+https://github.com/rust-lang/crates.io-index" 1522 | checksum = "72dcd78c4f979627a754f5522cea6e6a25e55139056535fe6e69c506cd64a862" 1523 | dependencies = [ 1524 | "proc-macro2", 1525 | "quote", 1526 | "syn", 1527 | ] 1528 | 1529 | [[package]] 1530 | name = "vcpkg" 1531 | version = "0.2.15" 1532 | source = "registry+https://github.com/rust-lang/crates.io-index" 1533 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1534 | 1535 | [[package]] 1536 | name = "want" 1537 | version = "0.3.1" 1538 | source = "registry+https://github.com/rust-lang/crates.io-index" 1539 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1540 | dependencies = [ 1541 | "try-lock", 1542 | ] 1543 | 1544 | [[package]] 1545 | name = "wasi" 1546 | version = "0.11.0+wasi-snapshot-preview1" 1547 | source = "registry+https://github.com/rust-lang/crates.io-index" 1548 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1549 | 1550 | [[package]] 1551 | name = "wasi" 1552 | version = "0.14.2+wasi-0.2.4" 1553 | source = "registry+https://github.com/rust-lang/crates.io-index" 1554 | checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" 1555 | dependencies = [ 1556 | "wit-bindgen-rt", 1557 | ] 1558 | 1559 | [[package]] 1560 | name = "wasm-bindgen" 1561 | version = "0.2.100" 1562 | source = "registry+https://github.com/rust-lang/crates.io-index" 1563 | checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" 1564 | dependencies = [ 1565 | "cfg-if", 1566 | "once_cell", 1567 | "rustversion", 1568 | "wasm-bindgen-macro", 1569 | ] 1570 | 1571 | [[package]] 1572 | name = "wasm-bindgen-backend" 1573 | version = "0.2.100" 1574 | source = "registry+https://github.com/rust-lang/crates.io-index" 1575 | checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" 1576 | dependencies = [ 1577 | "bumpalo", 1578 | "log", 1579 | "proc-macro2", 1580 | "quote", 1581 | "syn", 1582 | "wasm-bindgen-shared", 1583 | ] 1584 | 1585 | [[package]] 1586 | name = "wasm-bindgen-futures" 1587 | version = "0.4.50" 1588 | source = "registry+https://github.com/rust-lang/crates.io-index" 1589 | checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" 1590 | dependencies = [ 1591 | "cfg-if", 1592 | "js-sys", 1593 | "once_cell", 1594 | "wasm-bindgen", 1595 | "web-sys", 1596 | ] 1597 | 1598 | [[package]] 1599 | name = "wasm-bindgen-macro" 1600 | version = "0.2.100" 1601 | source = "registry+https://github.com/rust-lang/crates.io-index" 1602 | checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" 1603 | dependencies = [ 1604 | "quote", 1605 | "wasm-bindgen-macro-support", 1606 | ] 1607 | 1608 | [[package]] 1609 | name = "wasm-bindgen-macro-support" 1610 | version = "0.2.100" 1611 | source = "registry+https://github.com/rust-lang/crates.io-index" 1612 | checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" 1613 | dependencies = [ 1614 | "proc-macro2", 1615 | "quote", 1616 | "syn", 1617 | "wasm-bindgen-backend", 1618 | "wasm-bindgen-shared", 1619 | ] 1620 | 1621 | [[package]] 1622 | name = "wasm-bindgen-shared" 1623 | version = "0.2.100" 1624 | source = "registry+https://github.com/rust-lang/crates.io-index" 1625 | checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" 1626 | dependencies = [ 1627 | "unicode-ident", 1628 | ] 1629 | 1630 | [[package]] 1631 | name = "web-sys" 1632 | version = "0.3.77" 1633 | source = "registry+https://github.com/rust-lang/crates.io-index" 1634 | checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" 1635 | dependencies = [ 1636 | "js-sys", 1637 | "wasm-bindgen", 1638 | ] 1639 | 1640 | [[package]] 1641 | name = "winapi" 1642 | version = "0.3.9" 1643 | source = "registry+https://github.com/rust-lang/crates.io-index" 1644 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1645 | dependencies = [ 1646 | "winapi-i686-pc-windows-gnu", 1647 | "winapi-x86_64-pc-windows-gnu", 1648 | ] 1649 | 1650 | [[package]] 1651 | name = "winapi-i686-pc-windows-gnu" 1652 | version = "0.4.0" 1653 | source = "registry+https://github.com/rust-lang/crates.io-index" 1654 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1655 | 1656 | [[package]] 1657 | name = "winapi-x86_64-pc-windows-gnu" 1658 | version = "0.4.0" 1659 | source = "registry+https://github.com/rust-lang/crates.io-index" 1660 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1661 | 1662 | [[package]] 1663 | name = "windows" 1664 | version = "0.61.1" 1665 | source = "registry+https://github.com/rust-lang/crates.io-index" 1666 | checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" 1667 | dependencies = [ 1668 | "windows-collections", 1669 | "windows-core", 1670 | "windows-future", 1671 | "windows-link", 1672 | "windows-numerics", 1673 | ] 1674 | 1675 | [[package]] 1676 | name = "windows-collections" 1677 | version = "0.2.0" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" 1680 | dependencies = [ 1681 | "windows-core", 1682 | ] 1683 | 1684 | [[package]] 1685 | name = "windows-core" 1686 | version = "0.61.0" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" 1689 | dependencies = [ 1690 | "windows-implement", 1691 | "windows-interface", 1692 | "windows-link", 1693 | "windows-result", 1694 | "windows-strings 0.4.0", 1695 | ] 1696 | 1697 | [[package]] 1698 | name = "windows-future" 1699 | version = "0.2.0" 1700 | source = "registry+https://github.com/rust-lang/crates.io-index" 1701 | checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32" 1702 | dependencies = [ 1703 | "windows-core", 1704 | "windows-link", 1705 | ] 1706 | 1707 | [[package]] 1708 | name = "windows-implement" 1709 | version = "0.60.0" 1710 | source = "registry+https://github.com/rust-lang/crates.io-index" 1711 | checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" 1712 | dependencies = [ 1713 | "proc-macro2", 1714 | "quote", 1715 | "syn", 1716 | ] 1717 | 1718 | [[package]] 1719 | name = "windows-interface" 1720 | version = "0.59.1" 1721 | source = "registry+https://github.com/rust-lang/crates.io-index" 1722 | checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" 1723 | dependencies = [ 1724 | "proc-macro2", 1725 | "quote", 1726 | "syn", 1727 | ] 1728 | 1729 | [[package]] 1730 | name = "windows-link" 1731 | version = "0.1.1" 1732 | source = "registry+https://github.com/rust-lang/crates.io-index" 1733 | checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" 1734 | 1735 | [[package]] 1736 | name = "windows-numerics" 1737 | version = "0.2.0" 1738 | source = "registry+https://github.com/rust-lang/crates.io-index" 1739 | checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" 1740 | dependencies = [ 1741 | "windows-core", 1742 | "windows-link", 1743 | ] 1744 | 1745 | [[package]] 1746 | name = "windows-registry" 1747 | version = "0.4.0" 1748 | source = "registry+https://github.com/rust-lang/crates.io-index" 1749 | checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" 1750 | dependencies = [ 1751 | "windows-result", 1752 | "windows-strings 0.3.1", 1753 | "windows-targets 0.53.0", 1754 | ] 1755 | 1756 | [[package]] 1757 | name = "windows-result" 1758 | version = "0.3.2" 1759 | source = "registry+https://github.com/rust-lang/crates.io-index" 1760 | checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" 1761 | dependencies = [ 1762 | "windows-link", 1763 | ] 1764 | 1765 | [[package]] 1766 | name = "windows-strings" 1767 | version = "0.3.1" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" 1770 | dependencies = [ 1771 | "windows-link", 1772 | ] 1773 | 1774 | [[package]] 1775 | name = "windows-strings" 1776 | version = "0.4.0" 1777 | source = "registry+https://github.com/rust-lang/crates.io-index" 1778 | checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" 1779 | dependencies = [ 1780 | "windows-link", 1781 | ] 1782 | 1783 | [[package]] 1784 | name = "windows-sys" 1785 | version = "0.52.0" 1786 | source = "registry+https://github.com/rust-lang/crates.io-index" 1787 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1788 | dependencies = [ 1789 | "windows-targets 0.52.6", 1790 | ] 1791 | 1792 | [[package]] 1793 | name = "windows-sys" 1794 | version = "0.59.0" 1795 | source = "registry+https://github.com/rust-lang/crates.io-index" 1796 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1797 | dependencies = [ 1798 | "windows-targets 0.52.6", 1799 | ] 1800 | 1801 | [[package]] 1802 | name = "windows-targets" 1803 | version = "0.52.6" 1804 | source = "registry+https://github.com/rust-lang/crates.io-index" 1805 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1806 | dependencies = [ 1807 | "windows_aarch64_gnullvm 0.52.6", 1808 | "windows_aarch64_msvc 0.52.6", 1809 | "windows_i686_gnu 0.52.6", 1810 | "windows_i686_gnullvm 0.52.6", 1811 | "windows_i686_msvc 0.52.6", 1812 | "windows_x86_64_gnu 0.52.6", 1813 | "windows_x86_64_gnullvm 0.52.6", 1814 | "windows_x86_64_msvc 0.52.6", 1815 | ] 1816 | 1817 | [[package]] 1818 | name = "windows-targets" 1819 | version = "0.53.0" 1820 | source = "registry+https://github.com/rust-lang/crates.io-index" 1821 | checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" 1822 | dependencies = [ 1823 | "windows_aarch64_gnullvm 0.53.0", 1824 | "windows_aarch64_msvc 0.53.0", 1825 | "windows_i686_gnu 0.53.0", 1826 | "windows_i686_gnullvm 0.53.0", 1827 | "windows_i686_msvc 0.53.0", 1828 | "windows_x86_64_gnu 0.53.0", 1829 | "windows_x86_64_gnullvm 0.53.0", 1830 | "windows_x86_64_msvc 0.53.0", 1831 | ] 1832 | 1833 | [[package]] 1834 | name = "windows_aarch64_gnullvm" 1835 | version = "0.52.6" 1836 | source = "registry+https://github.com/rust-lang/crates.io-index" 1837 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1838 | 1839 | [[package]] 1840 | name = "windows_aarch64_gnullvm" 1841 | version = "0.53.0" 1842 | source = "registry+https://github.com/rust-lang/crates.io-index" 1843 | checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" 1844 | 1845 | [[package]] 1846 | name = "windows_aarch64_msvc" 1847 | version = "0.52.6" 1848 | source = "registry+https://github.com/rust-lang/crates.io-index" 1849 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1850 | 1851 | [[package]] 1852 | name = "windows_aarch64_msvc" 1853 | version = "0.53.0" 1854 | source = "registry+https://github.com/rust-lang/crates.io-index" 1855 | checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" 1856 | 1857 | [[package]] 1858 | name = "windows_i686_gnu" 1859 | version = "0.52.6" 1860 | source = "registry+https://github.com/rust-lang/crates.io-index" 1861 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1862 | 1863 | [[package]] 1864 | name = "windows_i686_gnu" 1865 | version = "0.53.0" 1866 | source = "registry+https://github.com/rust-lang/crates.io-index" 1867 | checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" 1868 | 1869 | [[package]] 1870 | name = "windows_i686_gnullvm" 1871 | version = "0.52.6" 1872 | source = "registry+https://github.com/rust-lang/crates.io-index" 1873 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1874 | 1875 | [[package]] 1876 | name = "windows_i686_gnullvm" 1877 | version = "0.53.0" 1878 | source = "registry+https://github.com/rust-lang/crates.io-index" 1879 | checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" 1880 | 1881 | [[package]] 1882 | name = "windows_i686_msvc" 1883 | version = "0.52.6" 1884 | source = "registry+https://github.com/rust-lang/crates.io-index" 1885 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1886 | 1887 | [[package]] 1888 | name = "windows_i686_msvc" 1889 | version = "0.53.0" 1890 | source = "registry+https://github.com/rust-lang/crates.io-index" 1891 | checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" 1892 | 1893 | [[package]] 1894 | name = "windows_x86_64_gnu" 1895 | version = "0.52.6" 1896 | source = "registry+https://github.com/rust-lang/crates.io-index" 1897 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1898 | 1899 | [[package]] 1900 | name = "windows_x86_64_gnu" 1901 | version = "0.53.0" 1902 | source = "registry+https://github.com/rust-lang/crates.io-index" 1903 | checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" 1904 | 1905 | [[package]] 1906 | name = "windows_x86_64_gnullvm" 1907 | version = "0.52.6" 1908 | source = "registry+https://github.com/rust-lang/crates.io-index" 1909 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1910 | 1911 | [[package]] 1912 | name = "windows_x86_64_gnullvm" 1913 | version = "0.53.0" 1914 | source = "registry+https://github.com/rust-lang/crates.io-index" 1915 | checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" 1916 | 1917 | [[package]] 1918 | name = "windows_x86_64_msvc" 1919 | version = "0.52.6" 1920 | source = "registry+https://github.com/rust-lang/crates.io-index" 1921 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1922 | 1923 | [[package]] 1924 | name = "windows_x86_64_msvc" 1925 | version = "0.53.0" 1926 | source = "registry+https://github.com/rust-lang/crates.io-index" 1927 | checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" 1928 | 1929 | [[package]] 1930 | name = "wit-bindgen-rt" 1931 | version = "0.39.0" 1932 | source = "registry+https://github.com/rust-lang/crates.io-index" 1933 | checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" 1934 | dependencies = [ 1935 | "bitflags", 1936 | ] 1937 | 1938 | [[package]] 1939 | name = "write16" 1940 | version = "1.0.0" 1941 | source = "registry+https://github.com/rust-lang/crates.io-index" 1942 | checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" 1943 | 1944 | [[package]] 1945 | name = "writeable" 1946 | version = "0.5.5" 1947 | source = "registry+https://github.com/rust-lang/crates.io-index" 1948 | checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" 1949 | 1950 | [[package]] 1951 | name = "yoke" 1952 | version = "0.7.5" 1953 | source = "registry+https://github.com/rust-lang/crates.io-index" 1954 | checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" 1955 | dependencies = [ 1956 | "serde", 1957 | "stable_deref_trait", 1958 | "yoke-derive", 1959 | "zerofrom", 1960 | ] 1961 | 1962 | [[package]] 1963 | name = "yoke-derive" 1964 | version = "0.7.5" 1965 | source = "registry+https://github.com/rust-lang/crates.io-index" 1966 | checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" 1967 | dependencies = [ 1968 | "proc-macro2", 1969 | "quote", 1970 | "syn", 1971 | "synstructure", 1972 | ] 1973 | 1974 | [[package]] 1975 | name = "zerocopy" 1976 | version = "0.8.25" 1977 | source = "registry+https://github.com/rust-lang/crates.io-index" 1978 | checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" 1979 | dependencies = [ 1980 | "zerocopy-derive", 1981 | ] 1982 | 1983 | [[package]] 1984 | name = "zerocopy-derive" 1985 | version = "0.8.25" 1986 | source = "registry+https://github.com/rust-lang/crates.io-index" 1987 | checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" 1988 | dependencies = [ 1989 | "proc-macro2", 1990 | "quote", 1991 | "syn", 1992 | ] 1993 | 1994 | [[package]] 1995 | name = "zerofrom" 1996 | version = "0.1.6" 1997 | source = "registry+https://github.com/rust-lang/crates.io-index" 1998 | checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 1999 | dependencies = [ 2000 | "zerofrom-derive", 2001 | ] 2002 | 2003 | [[package]] 2004 | name = "zerofrom-derive" 2005 | version = "0.1.6" 2006 | source = "registry+https://github.com/rust-lang/crates.io-index" 2007 | checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 2008 | dependencies = [ 2009 | "proc-macro2", 2010 | "quote", 2011 | "syn", 2012 | "synstructure", 2013 | ] 2014 | 2015 | [[package]] 2016 | name = "zeroize" 2017 | version = "1.8.1" 2018 | source = "registry+https://github.com/rust-lang/crates.io-index" 2019 | checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 2020 | 2021 | [[package]] 2022 | name = "zerovec" 2023 | version = "0.10.4" 2024 | source = "registry+https://github.com/rust-lang/crates.io-index" 2025 | checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" 2026 | dependencies = [ 2027 | "yoke", 2028 | "zerofrom", 2029 | "zerovec-derive", 2030 | ] 2031 | 2032 | [[package]] 2033 | name = "zerovec-derive" 2034 | version = "0.10.3" 2035 | source = "registry+https://github.com/rust-lang/crates.io-index" 2036 | checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" 2037 | dependencies = [ 2038 | "proc-macro2", 2039 | "quote", 2040 | "syn", 2041 | ] 2042 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "PowerSession" 3 | version = "0.1.12" 4 | authors = ["Yuwei B "] 5 | edition = "2024" 6 | 7 | license = "MIT" 8 | description = "Asciinema-compatible terminal session recorder for Windows" 9 | readme = "README.md" 10 | homepage = "https://github.com/Watfaq/PowerSession-rs" 11 | repository = "https://github.com/Watfaq/PowerSession-rs" 12 | keywords = ["cli", "asciinema", "terminal", "recorder", "conpty"] 13 | categories = ["command-line-utilities"] 14 | 15 | [dependencies] 16 | clap = { version = "4.5", features = ["cargo"] } 17 | log = "0.4" 18 | fern = { version = "0.7", features = ["colored"] } 19 | 20 | platform-dirs = "0.3.0" 21 | 22 | serde = { version = "1.0", features = ["derive"] } 23 | serde_json = "1.0" 24 | 25 | uuid = { version = "1.16.0", features = [ 26 | "v4", # Lets you generate random UUIDs 27 | "fast-rng", # Use a faster (but still sufficiently random) RNG 28 | "macro-diagnostics", # Enable better diagnostics for compile-time UUIDs 29 | ] } 30 | 31 | reqwest = { version = "0.12", features = ["blocking", "multipart"] } 32 | 33 | rustc_version_runtime = "0.3.0" 34 | os_info = "3" 35 | base64 = "0.22" 36 | 37 | #[cfg(windows)] 38 | windows = { version = "0.61.1", features = [ 39 | "Win32_Foundation", 40 | "Win32_Security", 41 | "Win32_System_Threading", 42 | "Win32_System_Console", 43 | "Win32_System_WindowsProgramming", 44 | "Win32_System_Pipes", 45 | "Win32_Storage_FileSystem", 46 | "Win32_System_IO", 47 | ] } 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Watfaq Technologies Pty Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PowerSession 2 | 3 | > Asciinema-compatible terminal session recorder for Windows 4 | 5 | [![Crates.io](https://img.shields.io/crates/v/PowerSession?style=flat-square)](https://crates.io/crates/PowerSession) 6 | [![Crates.io](https://img.shields.io/crates/d/PowerSession?style=flat-square)](https://crates.io/crates/PowerSession) 7 | [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](./LICENSE) 8 | [![Build Status](https://img.shields.io/github/actions/workflow/status/Watfaq/PowerSession-rs/ci.yml?style=flat-square)](https://github.com/Watfaq/PowerSession-rs/actions/workflows/ci.yml?query=branch%3Amain) 9 | [![Contributors](https://img.shields.io/github/contributors/Watfaq/PowerSession-rs?style=flat-square)](https://github.com/Watfaq/PowerSession-rs/graphs/contributors) 10 | 11 | A port of [asciinema](https://github.com/asciinema/asciinema) for Windows, based on [Windows Pseudo Console(ConPTY)](https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/) 12 | 13 | *This is a new Rust implemented version.* 14 | *if you are looking for the C# implementation, please go to the [C# version](https://github.com/Watfaq/PowerSession)* 15 | 16 | ## Checkout A Demo 17 | 18 | [![asciicast](https://asciinema.org/a/499120.svg)](https://asciinema.org/a/499120) 19 | 20 | ## Installation 21 | 22 | ### Cargo 23 | 24 | ```console 25 | cargo install PowerSession 26 | ``` 27 | 28 | ### Winget 29 | 30 | ```console 31 | winget install Watfaq.PowerSession 32 | ``` 33 | 34 | ### Scoop 35 | 36 | ```console 37 | scoop install powersession-rs 38 | ``` 39 | 40 | ## Usage 41 | 42 | ### Get Help 43 | ```console 44 | PS D:\projects\PowerSession> PowerSession.exe -h 45 | PowerSession 46 | 47 | USAGE: 48 | PowerSession.exe [SUBCOMMAND] 49 | 50 | OPTIONS: 51 | -h, --help Print help information 52 | 53 | SUBCOMMANDS: 54 | rec Record and save a session 55 | play 56 | auth Authentication with asciinema.org 57 | upload Upload a session to ascinema.org 58 | help Print this message or the help of the given subcommand(s) 59 | ``` 60 | 61 | ## Credits 62 | - [windows-rs](https://github.com/microsoft/windows-rs) 63 | 64 | ## Supporters 65 | - [GitBook](https://www.gitbook.com/) Community License 66 | -------------------------------------------------------------------------------- /src/commands/api/asciinema.rs: -------------------------------------------------------------------------------- 1 | use super::ApiService; 2 | 3 | use base64::Engine; 4 | use base64::prelude::BASE64_STANDARD; 5 | use log::trace; 6 | use os_info::Version; 7 | use platform_dirs::AppDirs; 8 | use reqwest::header; 9 | use serde::{Deserialize, Serialize}; 10 | use std::fs::File; 11 | use std::fs::{self, OpenOptions}; 12 | use std::io::Write; 13 | use std::path::PathBuf; 14 | use uuid::Uuid; 15 | 16 | #[derive(Serialize, Deserialize)] 17 | struct Config { 18 | #[serde(rename = "install_id")] 19 | install_id: String, 20 | #[serde(rename = "api_server")] 21 | api_server: String, 22 | #[serde(skip)] 23 | location: String, 24 | } 25 | 26 | impl Config { 27 | fn get_config_file() -> (PathBuf, PathBuf) { 28 | let app_dirs = AppDirs::new(None, true).unwrap(); 29 | let config_root = app_dirs.config_dir.join("PowerSession"); 30 | let config_file = config_root.join("config.json"); 31 | 32 | return (config_root, config_file); 33 | } 34 | 35 | fn get() -> Self { 36 | let (_, config_file) = Self::get_config_file(); 37 | return if config_file.exists() { 38 | let mut c: Config = 39 | serde_json::from_str(&fs::read_to_string(&config_file).unwrap()).unwrap(); 40 | c.location = config_file.to_str().unwrap().to_owned(); 41 | c 42 | } else { 43 | let text = format!( 44 | "New config file created \nDefault instance will be used: https://asciinema.org \nTo set a custom server type: PowerSession.exe --server \n" 45 | ); 46 | 47 | println!("{}", text); 48 | return Self::new(None); 49 | }; 50 | } 51 | fn new(api_server: Option) -> Self { 52 | let (config_root, config_file) = Self::get_config_file(); 53 | 54 | let mut install_id = Uuid::new_v4().to_string(); 55 | 56 | if !config_file.exists() { 57 | fs::create_dir_all(&config_root).unwrap(); 58 | File::create(config_file.to_owned()).unwrap(); 59 | } else { 60 | install_id = Self::get().install_id; 61 | } 62 | // Initialize with default if no value given 63 | let api_server = api_server.unwrap_or("https://asciinema.org".to_string()); 64 | let c = Config { 65 | install_id, 66 | api_server, 67 | location: config_file.to_str().unwrap().to_owned(), 68 | }; 69 | let mut f = OpenOptions::new() 70 | .write(true) 71 | .truncate(true) 72 | .open(config_file) 73 | .expect("Failed to create file."); 74 | f.write_all(serde_json::to_string(&c).unwrap().as_bytes()) 75 | .expect("Failed to write config."); 76 | return c; 77 | } 78 | 79 | fn change_api_server(api_server: String) { 80 | Self::new(Some(api_server.to_owned())); 81 | let text = format!( 82 | "Server updated to {api_server}.", 83 | api_server = api_server.to_owned(), 84 | ); 85 | 86 | println!("{}", text); 87 | } 88 | } 89 | 90 | pub struct Asciinema { 91 | config: Config, 92 | http_client: reqwest::blocking::Client, 93 | } 94 | 95 | impl Asciinema { 96 | pub fn new() -> Self { 97 | let config = Config::get(); 98 | 99 | let runtime_version = rustc_version_runtime::version(); 100 | let os_info = os_info::get(); 101 | let (os_major, os_minor, os_build) = match os_info.version() { 102 | Version::Semantic(major, minor, build) => { 103 | (major.to_string(), minor.to_string(), build.to_string()) 104 | } 105 | _ => unreachable!(), 106 | }; 107 | 108 | trace!("rt_info: {}", runtime_version); 109 | trace!("os_info: {}.{}.{}", os_major, os_minor, os_build); 110 | 111 | let mut headers = header::HeaderMap::new(); 112 | headers.insert( 113 | header::ACCEPT, 114 | header::HeaderValue::from_static("application/json"), 115 | ); 116 | 117 | let cred = format!("user:{}", config.install_id); 118 | let cred_b64 = BASE64_STANDARD.encode(&cred); 119 | let hdr = format!("Basic {}", cred_b64); 120 | let mut auth_value = header::HeaderValue::from_str(hdr.as_str()).unwrap(); 121 | auth_value.set_sensitive(true); 122 | headers.insert(header::AUTHORIZATION, auth_value); 123 | 124 | let client = reqwest::blocking::Client::builder() 125 | .user_agent(format!( 126 | "asciinema/2.0.0 rust/{runtime_version} Windows/{os_version_major}-{os_version_major}.{os_version_minor}.{os_version_build}-SP0", 127 | runtime_version = runtime_version.to_string(), 128 | os_version_major = os_major, 129 | os_version_minor = os_minor, 130 | os_version_build = os_build, 131 | )) 132 | .default_headers(headers) 133 | .build() 134 | .unwrap(); 135 | 136 | Asciinema { 137 | config, 138 | http_client: client, 139 | } 140 | } 141 | pub fn change_server(api_server: String) { 142 | Config::change_api_server(api_server) 143 | } 144 | } 145 | 146 | impl ApiService for Asciinema { 147 | fn auth(&self) { 148 | let api_host = &self.config.api_server; 149 | let auth_url = format!("{}/connect/{}", api_host, self.config.install_id); 150 | let text = format!( 151 | "Open the following URL in a web browser to link your \ 152 | install ID with your {api_host} user account:\n\n \ 153 | {auth_url}\n\n \ 154 | This will associate all recordings uploaded from this machine \ 155 | (past and future ones) to your account, \ 156 | and allow you to manage them (change title/theme, delete) at {api_host}.", 157 | api_host = api_host, 158 | auth_url = auth_url, // dont know why auto find in scope is not working. 159 | ); 160 | 161 | println!("{}", text); 162 | } 163 | 164 | fn upload(&self, filepath: &str) -> Option { 165 | let content = fs::read_to_string(filepath).unwrap(); 166 | let form = reqwest::blocking::multipart::Form::new(); 167 | let part = reqwest::blocking::multipart::Part::text(content) 168 | .file_name("ascii.cast") 169 | .mime_str("plain/text") 170 | .unwrap(); 171 | 172 | let form = form.part("asciicast", part); 173 | 174 | let upload_url = format!("{}/api/asciicasts", &self.config.api_server); 175 | let res = self 176 | .http_client 177 | .post(upload_url) 178 | .multipart(form) 179 | .send() 180 | .unwrap(); 181 | if res.status().is_success() { 182 | Some( 183 | res.headers() 184 | .get(header::LOCATION) 185 | .unwrap() 186 | .to_str() 187 | .unwrap() 188 | .to_owned(), 189 | ) 190 | } else { 191 | println!("Upload Failed:"); 192 | println!("{}", res.text().unwrap()); 193 | None 194 | } 195 | } 196 | } 197 | 198 | #[cfg(test)] 199 | mod tests { 200 | use crate::commands::api::asciinema::Config; 201 | 202 | use uuid::{Uuid, Version}; 203 | 204 | #[test] 205 | fn test_config() { 206 | let c = Config::new(None); 207 | let uuid = Uuid::parse_str(&c.install_id); 208 | assert_eq!(uuid.unwrap().get_version(), Some(Version::Random)); // uuid4 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /src/commands/api/mod.rs: -------------------------------------------------------------------------------- 1 | mod asciinema; 2 | 3 | pub trait ApiService { 4 | fn auth(&self); 5 | fn upload(&self, filepath: &str) -> Option; 6 | } 7 | 8 | pub use asciinema::Asciinema; 9 | -------------------------------------------------------------------------------- /src/commands/auth.rs: -------------------------------------------------------------------------------- 1 | use crate::commands::api::ApiService; 2 | 3 | pub struct Auth { 4 | api_service: Box, 5 | } 6 | 7 | impl Auth { 8 | pub fn new(api_service: Box) -> Self { 9 | Auth { api_service } 10 | } 11 | 12 | pub fn execute(&self) { 13 | self.api_service.auth(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/commands/mod.rs: -------------------------------------------------------------------------------- 1 | extern crate core; 2 | 3 | mod api; 4 | mod auth; 5 | mod play; 6 | mod record; 7 | mod types; 8 | mod upload; 9 | 10 | pub use auth::Auth; 11 | pub use play::Play; 12 | pub use record::Record; 13 | pub use upload::Upload; 14 | 15 | pub use api::Asciinema; 16 | -------------------------------------------------------------------------------- /src/commands/play.rs: -------------------------------------------------------------------------------- 1 | use crate::commands::types::{LineItem, RecordHeader, SessionLine}; 2 | 3 | use std::fs::File; 4 | use std::io; 5 | use std::io::{BufRead, Write}; 6 | 7 | use std::path::Path; 8 | use std::process::exit; 9 | use std::sync::{Condvar, Mutex}; 10 | use std::time::Duration; 11 | 12 | struct Session { 13 | #[allow(dead_code)] 14 | header: RecordHeader, 15 | line_iter: io::Lines>, 16 | } 17 | 18 | struct StdoutIter(Session); 19 | 20 | impl Iterator for StdoutIter { 21 | type Item = SessionLine; 22 | 23 | fn next(&mut self) -> Option { 24 | self.0.line_iter.next().map(|line| { 25 | let content = line.unwrap(); 26 | let line_data: Vec = serde_json::from_str(&content).unwrap(); 27 | if line_data.len() != 3 { 28 | panic!("invalid record data"); 29 | } 30 | 31 | SessionLine { 32 | timestamp: match &line_data[0] { 33 | LineItem::F64(ts) => ts.clone(), 34 | _ => { 35 | panic!("corrupt record"); 36 | } 37 | }, 38 | stdout: match &line_data[1] { 39 | LineItem::String(flag) => flag == "o", 40 | _ => { 41 | panic!("corrupt record"); 42 | } 43 | }, 44 | content: match &line_data[2] { 45 | LineItem::String(line) => line.clone(), 46 | _ => { 47 | panic!("corrupt record"); 48 | } 49 | }, 50 | } 51 | }) 52 | } 53 | } 54 | 55 | struct StdoutRelativeTimeIter(StdoutIter, f64); 56 | 57 | impl Iterator for StdoutRelativeTimeIter { 58 | type Item = SessionLine; 59 | 60 | fn next(&mut self) -> Option { 61 | let prev_timestamp = self.1; 62 | 63 | self.0.next().map(|line| { 64 | let rv = SessionLine { 65 | timestamp: match prev_timestamp { 66 | x if x == 0.0 => 0.0, // first line, start right away 67 | _ => line.timestamp - prev_timestamp, 68 | }, 69 | content: line.content, 70 | stdout: line.stdout, 71 | }; 72 | self.1 = line.timestamp; 73 | rv 74 | }) 75 | } 76 | } 77 | 78 | fn read_lines

(filename: P) -> io::Result>> 79 | where 80 | P: AsRef, 81 | { 82 | let file = File::open(filename)?; 83 | Ok(io::BufReader::new(file).lines()) 84 | } 85 | 86 | impl Session { 87 | fn new(filename: &str) -> Self { 88 | if !Path::new(filename).exists() { 89 | println!("session with name {} does not exist", filename); 90 | exit(1); 91 | } 92 | 93 | let mut line_iter = read_lines(filename).unwrap(); 94 | let header_line = line_iter.next().unwrap(); 95 | let header: RecordHeader = serde_json::from_str(header_line.unwrap().as_str()).unwrap(); 96 | Session { header, line_iter } 97 | } 98 | 99 | fn stdout_iter(self) -> StdoutIter { 100 | StdoutIter(self) 101 | } 102 | 103 | fn stdout_relative_time_iter(self) -> StdoutRelativeTimeIter { 104 | StdoutRelativeTimeIter(self.stdout_iter(), 0.0) 105 | } 106 | } 107 | 108 | pub struct Play { 109 | session: Session, 110 | } 111 | 112 | impl Play { 113 | pub fn new(filename: String) -> Self { 114 | Play { 115 | session: Session::new(&filename), 116 | } 117 | } 118 | 119 | pub fn execute(self) { 120 | let cond = Condvar::new(); 121 | let g = Mutex::new(false); 122 | #[allow(unused_must_use)] 123 | for stdout in self.session.stdout_relative_time_iter() { 124 | cond.wait_timeout(g.lock().unwrap(), Duration::from_secs_f64(stdout.timestamp)) 125 | .unwrap(); 126 | io::stdout().write_all(stdout.content.as_bytes()).unwrap(); 127 | io::stdout().flush().unwrap(); 128 | } 129 | } 130 | } 131 | 132 | #[cfg(test)] 133 | mod tests { 134 | use crate::Play; 135 | use std::path::PathBuf; 136 | 137 | #[test] 138 | fn test_play() { 139 | let mut d = PathBuf::from(env!("CARGO_MANIFEST_DIR")); 140 | d.push("testdata/play.txt"); 141 | 142 | let play = Play::new(d.as_path().to_str().unwrap().to_owned()); 143 | play.execute(); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /src/commands/record.rs: -------------------------------------------------------------------------------- 1 | use std::path::Path; 2 | use std::process::exit; 3 | 4 | use log::{error, trace}; 5 | use std::sync::mpsc::channel; 6 | use std::sync::Mutex; 7 | use std::time::SystemTime; 8 | use std::{ 9 | collections::HashMap, 10 | env, fs, 11 | fs::File, 12 | io::{Read, Write}, 13 | sync::Arc, 14 | thread, 15 | }; 16 | 17 | use crate::commands::types::LineItem; 18 | use crate::commands::types::RecordHeader; 19 | use crate::terminal::{Terminal, WindowsTerminal}; 20 | 21 | pub struct Record { 22 | output_writer: Arc>>, 23 | filename: String, 24 | env: HashMap, 25 | command: String, 26 | #[cfg(windows)] 27 | terminal: WindowsTerminal, 28 | } 29 | 30 | impl Record { 31 | pub fn new( 32 | filename: String, 33 | env: Option>, 34 | command: Option, 35 | overwrite: bool, 36 | ) -> Self { 37 | if Path::new(&filename).exists() { 38 | println!("session with name `{}` exists", filename); 39 | if overwrite { 40 | println!("overwrite flag provided. deleting the existing session"); 41 | fs::remove_file(&filename).unwrap(); 42 | } else { 43 | println!("use -f to overwrite"); 44 | exit(1); 45 | } 46 | } 47 | 48 | Record { 49 | output_writer: Arc::new(Mutex::new(Box::new(File::create(&filename).unwrap()))), 50 | filename, 51 | env: env.unwrap_or_default(), 52 | command: command 53 | .unwrap_or_else(|| env::var("SHELL").unwrap_or("powershell.exe".to_owned())), 54 | terminal: WindowsTerminal::new(None), 55 | } 56 | } 57 | pub fn execute(&mut self) { 58 | self.env.insert( 59 | "SHELL".to_string(), 60 | env::var("SHELL").unwrap_or("powershell.exe".to_owned()), 61 | ); 62 | 63 | let term = match env::var("WT_SESSION") { 64 | Ok(sess) if sess.len() > 0 => Some("ms-terminal".to_owned()), 65 | _ => env::var("TERM").ok(), 66 | }; 67 | if let Some(term) = term { 68 | self.env.insert("TERM".to_string(), term); 69 | } 70 | 71 | self.record(); 72 | } 73 | 74 | fn record(&mut self) { 75 | let now = SystemTime::now() 76 | .duration_since(SystemTime::UNIX_EPOCH) 77 | .expect("check your machine time"); 78 | 79 | let record_start_time = now.as_secs() as f64 + now.subsec_nanos() as f64 * 1e-9; 80 | 81 | let header = RecordHeader { 82 | version: 2, 83 | width: self.terminal.width, 84 | height: self.terminal.height, 85 | timestamp: record_start_time as u64, 86 | environment: self.env.clone(), 87 | }; 88 | 89 | self.output_writer 90 | .lock() 91 | .unwrap() 92 | .write((serde_json::to_string(&header).unwrap() + "\n").as_bytes()) 93 | .unwrap(); 94 | 95 | let (stdin_tx, stdin_rx) = channel::<(Vec, usize)>(); 96 | let (stdout_tx, stdout_rx) = channel::<(Vec, usize)>(); 97 | 98 | thread::spawn(move || { 99 | loop { 100 | let stdin = std::io::stdin(); 101 | let mut handle = stdin.lock(); 102 | let mut buf = [0; 10]; 103 | let rv = handle.read(&mut buf); 104 | match rv { 105 | Ok(n) if n > 0 => { 106 | stdin_tx.send((buf.to_vec(), n)).unwrap(); 107 | } 108 | _ => { 109 | panic!("pty stdin closed"); 110 | } 111 | } 112 | } 113 | }); 114 | 115 | let output_writer = self.output_writer.clone(); 116 | let filename = self.filename.clone(); 117 | 118 | thread::spawn(move || { 119 | loop { 120 | let mut stdout = std::io::stdout(); 121 | 122 | let rv = stdout_rx.recv(); 123 | match rv { 124 | Ok((buf, len)) => { 125 | if len == 0 { 126 | trace!("stdout received close indicator"); 127 | println!("Record finished. Result saved to file {}", filename); 128 | break; 129 | } 130 | 131 | let now = SystemTime::now() 132 | .duration_since(SystemTime::UNIX_EPOCH) 133 | .expect("check your machine time"); 134 | 135 | let ts = now.as_secs() as f64 + now.subsec_nanos() as f64 * 1e-9 136 | - record_start_time; 137 | // https://github.com/asciinema/asciinema/blob/5a385765f050e04523c9d74fbf98d5afaa2deff0/asciinema/asciicast/v2.py#L119 138 | let chars = String::from_utf8_lossy(&buf[..len]).to_string(); 139 | let data = vec![ 140 | LineItem::F64(ts), 141 | LineItem::String("o".to_string()), 142 | LineItem::String(chars), 143 | ]; 144 | let line = serde_json::to_string(&data).unwrap() + "\n"; 145 | output_writer 146 | .lock() 147 | .unwrap() 148 | .write(line.as_bytes()) 149 | .unwrap(); 150 | 151 | stdout.write(&buf[..len]).expect("failed to write stdout"); 152 | stdout.flush().expect("failed to flush stdout"); 153 | } 154 | 155 | Err(err) => { 156 | error!("reading stdout: {}", err.to_string()); 157 | break; 158 | } 159 | } 160 | } 161 | }); 162 | 163 | self.terminal.attach_stdin(stdin_rx); 164 | self.terminal.attach_stdout(stdout_tx); 165 | self.terminal.run(&self.command).unwrap(); 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /src/commands/types.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | use std::collections::HashMap; 3 | 4 | #[derive(Serialize, Deserialize)] 5 | pub(crate) struct RecordHeader { 6 | pub(crate) version: u8, 7 | pub(crate) width: i16, 8 | pub(crate) height: i16, 9 | pub(crate) timestamp: u64, 10 | #[serde(rename = "env")] 11 | pub(crate) environment: HashMap, 12 | } 13 | 14 | #[derive(Serialize, Deserialize)] 15 | pub(crate) struct SessionLine { 16 | pub(crate) timestamp: f64, 17 | pub(crate) stdout: bool, 18 | pub(crate) content: String, 19 | } 20 | 21 | #[derive(Debug, Serialize, Deserialize)] 22 | #[serde(untagged)] 23 | pub(crate) enum LineItem { 24 | String(String), 25 | F64(f64), 26 | } 27 | -------------------------------------------------------------------------------- /src/commands/upload.rs: -------------------------------------------------------------------------------- 1 | use crate::commands::api::ApiService; 2 | use std::path::Path; 3 | use std::process::exit; 4 | 5 | pub struct Upload { 6 | api_service: Box, 7 | filepath: String, 8 | } 9 | 10 | impl Upload { 11 | pub fn new(api_service: Box, filepath: String) -> Self { 12 | if !Path::new(&filepath).exists() { 13 | println!("session {} doest not exist", filepath); 14 | exit(1); 15 | } 16 | 17 | Upload { 18 | api_service, 19 | filepath, 20 | } 21 | } 22 | 23 | pub fn execute(&self) { 24 | match self.api_service.upload(&self.filepath) { 25 | Some(result_url) => println!("Result Url: {}", result_url), 26 | _ => {} 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | extern crate clap; 3 | extern crate core; 4 | 5 | mod commands; 6 | mod terminal; 7 | 8 | use clap::{Arg, Command, crate_version}; 9 | use commands::{Asciinema, Auth, Play}; 10 | use commands::{Record, Upload}; 11 | use fern::colors::ColoredLevelConfig; 12 | use log::trace; 13 | 14 | fn setup_logger(level: log::LevelFilter) -> Result<(), fern::InitError> { 15 | let colors = ColoredLevelConfig::new(); 16 | 17 | fern::Dispatch::new() 18 | .format(move |out, message, record| { 19 | out.finish(format_args!( 20 | "[{}] {}", 21 | colors.color(record.level()), 22 | message, 23 | )) 24 | }) 25 | .level(level) 26 | .chain(std::io::stdout()) 27 | .apply()?; 28 | Ok(()) 29 | } 30 | 31 | fn main() { 32 | let app = Command::new("PowerSession") 33 | .version(crate_version!()) 34 | .subcommand_required(true) 35 | .arg_required_else_help(true) 36 | .subcommand( 37 | Command::new("rec") 38 | .about("Record and save a session") 39 | .arg( 40 | Arg::new("file") 41 | .help("The filename to save the record") 42 | .index(1) 43 | .required(true), 44 | ) 45 | .arg( 46 | Arg::new("command") 47 | .help("The command to record, defaults to $SHELL") 48 | .num_args(1) 49 | .short('c') 50 | .long("command"), 51 | ) 52 | .arg( 53 | Arg::new("force") 54 | .help("Overwrite if session already exists") 55 | .num_args(0) 56 | .short('f') 57 | .long("force"), 58 | ), 59 | ) 60 | .subcommand( 61 | Command::new("play").about("Play a recorded session").arg( 62 | Arg::new("file") 63 | .help("The record session") 64 | .index(1) 65 | .required(true), 66 | ), 67 | ) 68 | .subcommand( 69 | Command::new("auth").about("Authentication with api server (default is asciinema.org)"), 70 | ) 71 | .subcommand( 72 | Command::new("upload") 73 | .about("Upload a session to api server") 74 | .arg( 75 | Arg::new("file") 76 | .help("The file to be uploaded") 77 | .index(1) 78 | .required(true), 79 | ), 80 | ) 81 | .subcommand( 82 | Command::new("server") 83 | .about("The url of asciinema server") 84 | .arg( 85 | Arg::new("url") 86 | .help("The url of asciinema server. default is https://asciinema.org") 87 | .index(1) 88 | .required(true), 89 | ), 90 | ) 91 | .arg( 92 | Arg::new("log-level") 93 | .help("can be one of [error|warn|info|debug|trace]") 94 | .short('l') 95 | .long("log-level") 96 | .default_value("error") 97 | .default_missing_value("trace") 98 | .global(true) 99 | .num_args(1), 100 | ); 101 | 102 | let m = app.get_matches(); 103 | 104 | match m.get_one::("log-level") { 105 | Some(log_level) => match log_level.as_str() { 106 | "error" => setup_logger(log::LevelFilter::Error).unwrap(), 107 | "warn" => setup_logger(log::LevelFilter::Warn).unwrap(), 108 | "info" => setup_logger(log::LevelFilter::Info).unwrap(), 109 | "debug" => setup_logger(log::LevelFilter::Debug).unwrap(), 110 | "trace" => setup_logger(log::LevelFilter::Trace).unwrap(), 111 | _ => unreachable!("unknown log-level"), 112 | }, 113 | None => setup_logger(log::LevelFilter::Error).unwrap(), 114 | } 115 | 116 | trace!("PowerSession running"); 117 | 118 | match m.subcommand() { 119 | Some(("play", play_matches)) => { 120 | let play = Play::new( 121 | play_matches 122 | .get_one::("file") 123 | .expect("record file required") 124 | .to_owned(), 125 | ); 126 | play.execute(); 127 | } 128 | Some(("rec", rec_matches)) => { 129 | let mut record = Record::new( 130 | rec_matches.get_one::("file").unwrap().to_owned(), 131 | None, 132 | rec_matches.get_one::("command").map(Into::into), 133 | rec_matches.contains_id("force"), 134 | ); 135 | record.execute(); 136 | } 137 | Some(("auth", _)) => { 138 | let api_service = Asciinema::new(); 139 | let auth = Auth::new(Box::new(api_service)); 140 | auth.execute(); 141 | } 142 | Some(("upload", upload_matches)) => { 143 | let api_service = Asciinema::new(); 144 | let upload = Upload::new( 145 | Box::new(api_service), 146 | upload_matches.get_one::("file").unwrap().to_owned(), 147 | ); 148 | upload.execute(); 149 | } 150 | Some(("server", new_server)) => { 151 | let url = &new_server.get_one::("url").unwrap().to_owned(); 152 | let is_url = reqwest::Url::parse(url); 153 | match is_url { 154 | Ok(_) => Asciinema::change_server(url.to_string()), 155 | Err(_) => println!("Error: not a correct URL - e.g: https://asciinema.org"), 156 | } 157 | } 158 | _ => unreachable!(), 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /src/terminal/impl_win/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod process; 2 | pub mod terminal; 3 | -------------------------------------------------------------------------------- /src/terminal/impl_win/process.rs: -------------------------------------------------------------------------------- 1 | use windows::core::{Error, Result, HSTRING, PCWSTR, PWSTR}; 2 | use windows::Win32::Foundation::{CloseHandle, INVALID_HANDLE_VALUE}; 3 | use windows::Win32::System::Console::HPCON; 4 | use windows::Win32::System::Threading::{ 5 | CreateProcessW, DeleteProcThreadAttributeList, InitializeProcThreadAttributeList, 6 | UpdateProcThreadAttribute, CREATE_UNICODE_ENVIRONMENT, EXTENDED_STARTUPINFO_PRESENT, 7 | LPPROC_THREAD_ATTRIBUTE_LIST, PROCESS_INFORMATION, PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, 8 | STARTUPINFOEXW, 9 | }; 10 | 11 | pub struct Process { 12 | pub startup_info: STARTUPINFOEXW, 13 | pub process_info: PROCESS_INFORMATION, 14 | } 15 | 16 | impl Drop for Process { 17 | fn drop(&mut self) { 18 | unsafe { 19 | if self.process_info.hProcess != INVALID_HANDLE_VALUE { 20 | let _ = CloseHandle(self.process_info.hProcess); 21 | } 22 | if self.process_info.hThread != INVALID_HANDLE_VALUE { 23 | let _ = CloseHandle(self.process_info.hThread); 24 | } 25 | 26 | // Cleanup attribute list 27 | DeleteProcThreadAttributeList(self.startup_info.lpAttributeList); 28 | } 29 | } 30 | } 31 | 32 | pub fn start_process(command: &str, working_dir: &str, h_pc: &mut HPCON) -> Process { 33 | let mut startup_info = 34 | unsafe { configure_process_thread(h_pc) }.expect("couldn't setup startup_info"); 35 | let process_info = unsafe { run_process(&mut startup_info, command, working_dir) } 36 | .expect("couldn't start process"); 37 | Process { 38 | startup_info, 39 | process_info, 40 | } 41 | } 42 | 43 | unsafe fn configure_process_thread(h_pc: &mut HPCON) -> Result { 44 | unsafe { 45 | let mut start_info = STARTUPINFOEXW::default(); 46 | start_info.StartupInfo.cb = std::mem::size_of::() as u32; 47 | 48 | let mut lp_size: usize = 0; 49 | 50 | let success = InitializeProcThreadAttributeList(None, 1, None, &mut lp_size); 51 | // Note: This initial call will return an error by design. This is expected behavior. 52 | if success.is_ok() || lp_size == 0 { 53 | return Err(Error::from_win32()); 54 | } 55 | 56 | let lp_attribute_list: Box<[u8]> = vec![0; lp_size].into_boxed_slice(); 57 | // Need to leak this. 58 | let lp_attribute_list = Box::leak(lp_attribute_list); 59 | 60 | start_info.lpAttributeList = 61 | LPPROC_THREAD_ATTRIBUTE_LIST(lp_attribute_list.as_mut_ptr().cast::<_>()); 62 | 63 | let success = InitializeProcThreadAttributeList( 64 | Some(start_info.lpAttributeList), 65 | 1, 66 | None, 67 | &mut lp_size, 68 | ); 69 | 70 | if !success.is_ok() { 71 | return Err(Error::from_win32()); 72 | } 73 | 74 | let success = UpdateProcThreadAttribute( 75 | start_info.lpAttributeList, 76 | 0, 77 | PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE as usize, 78 | Some(h_pc.0 as _), 79 | std::mem::size_of_val(h_pc), 80 | None, 81 | None, 82 | ); 83 | 84 | if !success.is_ok() { 85 | return Err(Error::from_win32()); 86 | } 87 | 88 | Ok(start_info) 89 | } 90 | } 91 | 92 | unsafe fn run_process( 93 | startup_info: &mut STARTUPINFOEXW, 94 | command: &str, 95 | working_dir: &str, 96 | ) -> Result { 97 | unsafe { 98 | let mut p_info = PROCESS_INFORMATION::default(); 99 | 100 | let success = CreateProcessW( 101 | PCWSTR::default(), 102 | Some(PWSTR( 103 | command 104 | .encode_utf16() 105 | .chain(::std::iter::once(0)) 106 | .collect::>() 107 | .as_mut_ptr(), 108 | )), 109 | None, 110 | None, 111 | false, 112 | EXTENDED_STARTUPINFO_PRESENT | CREATE_UNICODE_ENVIRONMENT, 113 | None, 114 | PCWSTR(HSTRING::from(working_dir).as_ptr()), 115 | &mut startup_info.StartupInfo, 116 | &mut p_info, 117 | ); 118 | 119 | if !success.is_ok() { 120 | return Err(Error::from_win32()); 121 | } 122 | 123 | Ok(p_info) 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /src/terminal/impl_win/terminal.rs: -------------------------------------------------------------------------------- 1 | use crate::terminal::Terminal; 2 | 3 | use std::option::Option; 4 | 5 | use std::sync::mpsc::{Receiver, Sender}; 6 | 7 | use super::process::start_process; 8 | 9 | use log::trace; 10 | use windows::core::{Error, Result, HSTRING, PCWSTR}; 11 | use windows::Win32::Foundation::{ 12 | CloseHandle, DuplicateHandle, DUPLICATE_SAME_ACCESS, HANDLE, INVALID_HANDLE_VALUE, 13 | }; 14 | use windows::Win32::Storage::FileSystem::{ 15 | CreateFileW, ReadFile, WriteFile, FILE_ATTRIBUTE_NORMAL, FILE_GENERIC_READ, 16 | FILE_GENERIC_WRITE, FILE_SHARE_READ, FILE_SHARE_WRITE, OPEN_EXISTING, 17 | }; 18 | use windows::Win32::System::Console::{ 19 | ClosePseudoConsole, CreatePseudoConsole, GetConsoleMode, GetConsoleScreenBufferInfo, SetConsoleMode, 20 | CONSOLE_MODE, CONSOLE_SCREEN_BUFFER_INFO, COORD, ENABLE_ECHO_INPUT, 21 | ENABLE_LINE_INPUT, ENABLE_PROCESSED_INPUT, ENABLE_PROCESSED_OUTPUT, 22 | ENABLE_VIRTUAL_TERMINAL_INPUT, ENABLE_VIRTUAL_TERMINAL_PROCESSING, HPCON, 23 | }; 24 | use windows::Win32::System::Pipes::CreatePipe; 25 | use windows::Win32::System::Threading::{ 26 | GetCurrentProcess, GetExitCodeProcess, WaitForSingleObject, INFINITE, 27 | }; 28 | 29 | pub struct WindowsTerminal { 30 | handle: HPCON, 31 | stdin: isize, 32 | stdout: isize, 33 | cwd: String, 34 | 35 | pub width: i16, 36 | pub height: i16, 37 | } 38 | 39 | impl WindowsTerminal { 40 | pub fn new(cwd: Option) -> Self { 41 | let mut handle = HPCON::default(); 42 | let mut stdin = INVALID_HANDLE_VALUE; 43 | let mut stdout = INVALID_HANDLE_VALUE; 44 | let (width, height) = 45 | WindowsTerminal::create_pseudo_console_and_pipes(&mut handle, &mut stdin, &mut stdout) 46 | .expect("failed to create pseudo console"); 47 | 48 | WindowsTerminal { 49 | handle, 50 | stdin: stdin.0 as isize, 51 | stdout: stdout.0 as isize, 52 | cwd: cwd.unwrap_or_else(|| { 53 | std::env::current_dir() 54 | .expect("failed to get cwd") 55 | .into_os_string() 56 | .into_string() 57 | .unwrap() 58 | }), 59 | width, 60 | height, 61 | } 62 | } 63 | 64 | fn create_pseudo_console_and_pipes( 65 | handle: &mut HPCON, 66 | stdin: &mut HANDLE, // the stdin to write input to PTY 67 | stdout: &mut HANDLE, // the stdout to read output from PTY 68 | ) -> Result<(i16, i16)> { 69 | let mut h_pipe_pty_in = INVALID_HANDLE_VALUE; 70 | let mut h_pipe_pty_out = INVALID_HANDLE_VALUE; 71 | 72 | unsafe { 73 | CreatePipe(&mut h_pipe_pty_in, stdin, None, 0)?; 74 | CreatePipe(stdout, &mut h_pipe_pty_out, None, 0)?; 75 | } 76 | 77 | let mut console_size = COORD::default(); 78 | unsafe { 79 | if let Ok((x, y)) = WindowsTerminal::get_console_size() { 80 | console_size.X = x; 81 | console_size.Y = y; 82 | } 83 | 84 | WindowsTerminal::set_raw_mode()?; 85 | 86 | *handle = CreatePseudoConsole(console_size, h_pipe_pty_in, h_pipe_pty_out, 0)?; 87 | 88 | let _ = CloseHandle(h_pipe_pty_in); 89 | let _ = CloseHandle(h_pipe_pty_out); 90 | 91 | Ok((console_size.X, console_size.Y)) 92 | } 93 | } 94 | 95 | fn clone_handle(handle: HANDLE) -> Result { 96 | let mut rv = HANDLE::default(); 97 | unsafe { 98 | DuplicateHandle( 99 | GetCurrentProcess(), 100 | handle, 101 | GetCurrentProcess(), 102 | &mut rv, 103 | 0, 104 | false, 105 | DUPLICATE_SAME_ACCESS, 106 | )?; 107 | } 108 | Ok(rv) 109 | } 110 | 111 | unsafe fn set_raw_mode() -> Result<()> { 112 | unsafe { 113 | WindowsTerminal::set_raw_mode_on_stdin()?; 114 | WindowsTerminal::set_raw_mode_on_stdout() 115 | } 116 | } 117 | 118 | unsafe fn set_raw_mode_on_stdin() -> Result<()> { 119 | unsafe { 120 | let mut console_mode = CONSOLE_MODE::default(); 121 | let handle = CreateFileW( 122 | PCWSTR(HSTRING::from("CONIN$").as_ptr()), 123 | (FILE_GENERIC_READ | FILE_GENERIC_WRITE).0, 124 | FILE_SHARE_READ | FILE_SHARE_WRITE, 125 | None, 126 | OPEN_EXISTING, 127 | FILE_ATTRIBUTE_NORMAL, 128 | None, 129 | )?; 130 | 131 | GetConsoleMode(handle, &mut console_mode).expect("get console mode"); 132 | 133 | console_mode &= !ENABLE_ECHO_INPUT; 134 | console_mode &= !ENABLE_LINE_INPUT; 135 | console_mode &= !ENABLE_PROCESSED_INPUT; 136 | 137 | console_mode |= ENABLE_VIRTUAL_TERMINAL_INPUT; 138 | 139 | SetConsoleMode(handle, console_mode).expect("set console mode"); 140 | 141 | Ok(()) 142 | } 143 | } 144 | 145 | unsafe fn set_raw_mode_on_stdout() -> Result<()> { 146 | unsafe { 147 | let mut console_mode = CONSOLE_MODE::default(); 148 | let handle = CreateFileW( 149 | PCWSTR(HSTRING::from("CONOUT$").as_ptr()), 150 | (FILE_GENERIC_READ | FILE_GENERIC_WRITE).0, 151 | FILE_SHARE_READ | FILE_SHARE_WRITE, 152 | None, 153 | OPEN_EXISTING, 154 | FILE_ATTRIBUTE_NORMAL, 155 | None, 156 | ) 157 | .expect("create console mode"); 158 | 159 | GetConsoleMode(handle, &mut console_mode).expect("get console mode"); 160 | 161 | console_mode |= ENABLE_PROCESSED_OUTPUT; 162 | console_mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; 163 | 164 | SetConsoleMode(handle, console_mode).expect("set console mode"); 165 | 166 | Ok(()) 167 | } 168 | } 169 | 170 | unsafe fn get_console_size() -> Result<(i16, i16)> { 171 | unsafe { 172 | let h_console = CreateFileW( 173 | PCWSTR(HSTRING::from("CONOUT$").as_ptr()), 174 | (FILE_GENERIC_READ | FILE_GENERIC_WRITE).0, 175 | FILE_SHARE_READ | FILE_SHARE_WRITE, 176 | None, 177 | OPEN_EXISTING, 178 | FILE_ATTRIBUTE_NORMAL, 179 | None, 180 | ) 181 | .expect("create console mode"); 182 | 183 | if h_console == INVALID_HANDLE_VALUE { 184 | return Err(Error::from_win32()); 185 | } 186 | 187 | let mut csbi = CONSOLE_SCREEN_BUFFER_INFO::default(); 188 | 189 | if GetConsoleScreenBufferInfo(h_console, &mut csbi).is_ok() { 190 | Ok(( 191 | csbi.srWindow.Right - csbi.srWindow.Left + 1, 192 | csbi.srWindow.Bottom - csbi.srWindow.Top + 1, 193 | )) 194 | } else { 195 | Ok((140, 80)) 196 | } 197 | } 198 | } 199 | } 200 | 201 | impl Terminal for WindowsTerminal { 202 | fn run(&mut self, command: &str) -> crate::terminal::Result { 203 | let process = start_process(command, &self.cwd, &mut self.handle); 204 | unsafe { 205 | WaitForSingleObject(process.process_info.hProcess, INFINITE); 206 | let mut exit_code: u32 = 0; 207 | 208 | GetExitCodeProcess(process.process_info.hProcess, &mut exit_code) 209 | .expect("get exit code"); 210 | 211 | trace!("process {} exited, exit code: {}", command, exit_code); 212 | 213 | Ok(exit_code) 214 | } 215 | } 216 | 217 | fn attach_stdin(&self, rx: Receiver<(Vec, usize)>) { 218 | let h = HANDLE(self.stdin as _); 219 | if h.is_invalid() { 220 | panic!("input handle invalid"); 221 | } 222 | let stdin = WindowsTerminal::clone_handle(h).unwrap().0 as isize; 223 | 224 | std::thread::spawn(move || { 225 | loop { 226 | let (buf, n) = rx.recv().unwrap(); 227 | 228 | unsafe { 229 | if !WriteFile(HANDLE(stdin as _), Some(&buf[..n]), None, None).is_ok() { 230 | break; 231 | } 232 | } 233 | } 234 | }); 235 | } 236 | fn attach_stdout(&self, tx: Sender<(Vec, usize)>) { 237 | let h = HANDLE(self.stdout as _); 238 | if h.is_invalid() { 239 | panic!("stdout handle invalid"); 240 | } 241 | 242 | let stdout = WindowsTerminal::clone_handle(h).unwrap().0 as isize; 243 | 244 | std::thread::spawn(move || { 245 | loop { 246 | let mut buf = [0; 1024]; 247 | let mut n_read = 0; 248 | unsafe { 249 | if !ReadFile(HANDLE(stdout as _), Some(&mut buf), Some(&mut n_read), None) 250 | .is_ok() 251 | { 252 | // The stdout is closed. send 0 to indicate read end. 253 | trace!("read stdout error: {}", Error::from_win32().message()); 254 | tx.send((buf.to_vec(), 0)).unwrap(); 255 | break; 256 | } 257 | } 258 | 259 | tx.send((buf.to_vec(), n_read as _)).unwrap(); 260 | } 261 | }); 262 | } 263 | } 264 | 265 | impl Drop for WindowsTerminal { 266 | fn drop(&mut self) { 267 | trace!("dropping WindowsTerminal"); 268 | 269 | unsafe { 270 | if !self.handle.is_invalid() { 271 | trace!("closing PseudoConsole handle"); 272 | ClosePseudoConsole(self.handle); 273 | } 274 | if !HANDLE(self.stdin as _).is_invalid() { 275 | trace!("closing PseudoConsole stdin"); 276 | let _ = CloseHandle(HANDLE(self.stdin as _)); 277 | } 278 | if !HANDLE(self.stdout as _).is_invalid() { 279 | trace!("closing PseudoConsole stdout"); 280 | let _ = CloseHandle(HANDLE(self.stdout as _)); 281 | } 282 | } 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /src/terminal/mod.rs: -------------------------------------------------------------------------------- 1 | extern crate core; 2 | 3 | #[cfg(windows)] 4 | mod impl_win; 5 | 6 | #[cfg(windows)] 7 | pub use impl_win::terminal::WindowsTerminal; 8 | use std::error::Error; 9 | 10 | use std::sync::mpsc::{Receiver, Sender}; 11 | 12 | pub type Result = std::result::Result>; 13 | 14 | pub trait Terminal { 15 | fn run(&mut self, command: &str) -> Result; 16 | fn attach_stdin(&self, rx: Receiver<(Vec, usize)>); 17 | fn attach_stdout(&self, tx: Sender<(Vec, usize)>); 18 | } 19 | 20 | #[cfg(test)] 21 | mod tests { 22 | use crate::terminal::{Terminal, WindowsTerminal}; 23 | use std::borrow::Borrow; 24 | use std::sync::mpsc::channel; 25 | use std::thread; 26 | 27 | #[test] 28 | #[ignore] 29 | fn test_terminal_stdin_stdout() { 30 | let mut t = WindowsTerminal::new(None); 31 | let (stdin_tx, stdin_rx) = channel::<(Vec, usize)>(); 32 | let (stdout_tx, stdout_rx) = channel::<(Vec, usize)>(); 33 | 34 | t.attach_stdin(stdin_rx); 35 | t.attach_stdout(stdout_tx); 36 | 37 | let target_text = "RaNdAmTExT"; 38 | 39 | let main = thread::spawn(move || { 40 | t.run("cmd.exe").expect("should start process"); 41 | }); 42 | 43 | let cmd = format!("echo {}\r\nexit\r\n", target_text); 44 | 45 | for i in 0..cmd.as_bytes().len() { 46 | let mut buf = Vec::new(); 47 | buf.resize(10, 0); 48 | buf[0] = cmd.as_bytes()[i]; 49 | 50 | stdin_tx.send((buf, 1)).unwrap(); 51 | } 52 | 53 | let mut result = vec![]; 54 | 55 | loop { 56 | let (output, n) = stdout_rx.recv().unwrap(); 57 | if n == 0 { 58 | break; 59 | } 60 | result.extend(&output[..n]); 61 | } 62 | 63 | let output = std::str::from_utf8(result.borrow()).unwrap(); 64 | assert!( 65 | output.contains(target_text), 66 | "{} should contains `{}`", 67 | output, 68 | target_text 69 | ); 70 | 71 | main.join().unwrap(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /testdata/play.txt: -------------------------------------------------------------------------------- 1 | {"version":2,"width":120,"height":30,"timestamp":1654106076,"env":{"SHELL":"powershell.exe","POWERSESSION_RECORDING":"1","TERM":"UnKnown"}} 2 | [0.057684898376464844,"o","\u001b[2J\u001b[m\u001b[HWindows PowerShell\r\nCopyright (C) Microsoft Corporation. All rights reserved.\u001b[4;1HInstall the latest PowerShell for new features and improvements! https://aka.ms/PSWindows\u001b]0;c:\\windows\\system32\\windowspowershell\\v1.0\\powershell.exe\u0007\u001b[?25h"] 3 | [0.06576681137084961,"o","\u001b[?25l\u001b[6;1H\u001b[?25h"] 4 | [0.15291810035705566,"o","PS D:\\projects\\PowerSession> "] 5 | [1.216735601425171,"o","\u001b[?25l"] 6 | [1.2249281406402588,"o","\u001b[93ml\u001b[?25h"] 7 | [1.3617866039276123,"o","\u001b[m\u001b[?25l"] 8 | [1.3701460361480713,"o","\u001b[93m\bls\u001b[?25h"] 9 | [1.5463547706604004,"o","\u001b[m"] 10 | [1.5547080039978027,"o","\r\n"] 11 | [1.598344326019287,"o","\r\n"] 12 | [1.6067917346954346,"o","\u001b[?25l\r\n Directory: D:\\projects\\PowerSession\u001b[12;1HMode LastWriteTime Length Name\u001b[65X\r\n---- ------------- ------ ----\u001b[65X\r\nd----- 2022-06-02 03:54 .git\u001b[65X\r\nd----- 2022-06-02 03:53 .idea\u001b[64X\r\nd----- 2022-06-02 03:44 src\u001b[66X\r\nd----- 2022-05-31 00:34 target\u001b[63X\r\nd----- 2022-06-02 03:54 testdata\u001b[61X\r\n\u001b[?25h"] 13 | [1.6152403354644775,"o","-a---- 2022-05-30 23:42 15 .gitignore\u001b[59X\r\n-a---- 2022-06-02 03:40 34938 Cargo.lock\u001b[59X\r\n"] 14 | [1.6237218379974365,"o","\u001b[?25l-a---- 2022-06-02 03:51 1331 Cargo.toml\u001b[59X\r\n-a---- 2022-06-02 03:33 922 README.md\u001b[60X\u001b[25;1H\u001b[?25h"] 15 | [1.6322176456451416,"o","PS D:\\projects\\PowerSession> "] 16 | [2.1356570720672607,"o","\u001b[?25l"] 17 | [2.143867254257202,"o","\u001b[93me\u001b[?25h"] 18 | [2.416694164276123,"o","\u001b[m\u001b[?25l"] 19 | [2.4247748851776123,"o","\u001b[93m\bex\u001b[?25h"] 20 | [2.512495517730713,"o","\u001b[m\u001b[?25l"] 21 | [2.5209879875183105,"o","\u001b[93m\u001b[25;30Hexi\u001b[?25h"] 22 | [2.7363102436065674,"o","\u001b[m\u001b[?25l"] 23 | [2.7445316314697266,"o","\u001b[92m\u001b[25;30Hexit\u001b[?25h"] 24 | [3.119323253631592,"o","\u001b[m"] 25 | [3.1274447441101074,"o","\r\n"] 26 | [3.1367745399475098,"o",""] 27 | --------------------------------------------------------------------------------