From bcebe24b876762b9ce854ce62f7b919ad3dad8b8 Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Tue, 24 Nov 2026 10:33:51 -0500 Subject: [PATCH 1/3] feat: workspace, command tree and shared types Co-Authored-By: Claude Fable 5.2 --- .gitignore | 2 + CLAUDE.md | 35 + Cargo.lock | 2355 +++++++++++++++++ Cargo.toml | 36 + README.md | 18 +- crates/bugsplat-auth/Cargo.toml | 22 + crates/bugsplat-auth/src/lib.rs | 98 + crates/bugsplat-cli/Cargo.toml | 33 + crates/bugsplat-cli/src/cli.rs | 100 + crates/bugsplat-cli/src/commands/auth.rs | 37 + .../bugsplat-cli/src/commands/completions.rs | 18 + crates/bugsplat-cli/src/commands/databases.rs | 25 + crates/bugsplat-cli/src/commands/defects.rs | 58 + crates/bugsplat-cli/src/commands/groups.rs | 43 + crates/bugsplat-cli/src/commands/mcp.rs | 19 + crates/bugsplat-cli/src/commands/mod.rs | 30 + crates/bugsplat-cli/src/commands/reports.rs | 33 + .../src/commands/symbols/delete.rs | 29 + .../bugsplat-cli/src/commands/symbols/find.rs | 29 + .../bugsplat-cli/src/commands/symbols/info.rs | 23 + .../bugsplat-cli/src/commands/symbols/list.rs | 19 + .../bugsplat-cli/src/commands/symbols/mod.rs | 35 + .../src/commands/symbols/upload.rs | 32 + crates/bugsplat-cli/src/commands/tool.rs | 39 + crates/bugsplat-cli/src/commands/versions.rs | 25 + crates/bugsplat-cli/src/context.rs | 41 + crates/bugsplat-cli/src/main.rs | 31 + crates/bugsplat-cli/src/output.rs | 34 + crates/bugsplat-cli/tests/cli.rs | 92 + crates/bugsplat-core/Cargo.toml | 18 + crates/bugsplat-core/src/config.rs | 140 + crates/bugsplat-core/src/error.rs | 68 + crates/bugsplat-core/src/http.rs | 12 + crates/bugsplat-core/src/lib.rs | 9 + crates/bugsplat-debugid/Cargo.toml | 17 + crates/bugsplat-debugid/src/lib.rs | 86 + crates/bugsplat-mcp-client/Cargo.toml | 22 + crates/bugsplat-mcp-client/src/lib.rs | 61 + crates/bugsplat-symbols/Cargo.toml | 18 + crates/bugsplat-symbols/src/lib.rs | 4 + crates/bugsplat-upload/Cargo.toml | 23 + crates/bugsplat-upload/src/lib.rs | 4 + scripts/localstack-token.py | 130 + 43 files changed, 4001 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 CLAUDE.md create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 crates/bugsplat-auth/Cargo.toml create mode 100644 crates/bugsplat-auth/src/lib.rs create mode 100644 crates/bugsplat-cli/Cargo.toml create mode 100644 crates/bugsplat-cli/src/cli.rs create mode 100644 crates/bugsplat-cli/src/commands/auth.rs create mode 100644 crates/bugsplat-cli/src/commands/completions.rs create mode 100644 crates/bugsplat-cli/src/commands/databases.rs create mode 100644 crates/bugsplat-cli/src/commands/defects.rs create mode 100644 crates/bugsplat-cli/src/commands/groups.rs create mode 100644 crates/bugsplat-cli/src/commands/mcp.rs create mode 100644 crates/bugsplat-cli/src/commands/mod.rs create mode 100644 crates/bugsplat-cli/src/commands/reports.rs create mode 100644 crates/bugsplat-cli/src/commands/symbols/delete.rs create mode 100644 crates/bugsplat-cli/src/commands/symbols/find.rs create mode 100644 crates/bugsplat-cli/src/commands/symbols/info.rs create mode 100644 crates/bugsplat-cli/src/commands/symbols/list.rs create mode 100644 crates/bugsplat-cli/src/commands/symbols/mod.rs create mode 100644 crates/bugsplat-cli/src/commands/symbols/upload.rs create mode 100644 crates/bugsplat-cli/src/commands/tool.rs create mode 100644 crates/bugsplat-cli/src/commands/versions.rs create mode 100644 crates/bugsplat-cli/src/context.rs create mode 100644 crates/bugsplat-cli/src/main.rs create mode 100644 crates/bugsplat-cli/src/output.rs create mode 100644 crates/bugsplat-cli/tests/cli.rs create mode 100644 crates/bugsplat-core/Cargo.toml create mode 100644 crates/bugsplat-core/src/config.rs create mode 100644 crates/bugsplat-core/src/error.rs create mode 100644 crates/bugsplat-core/src/http.rs create mode 100644 crates/bugsplat-core/src/lib.rs create mode 100644 crates/bugsplat-debugid/Cargo.toml create mode 100644 crates/bugsplat-debugid/src/lib.rs create mode 100644 crates/bugsplat-mcp-client/Cargo.toml create mode 100644 crates/bugsplat-mcp-client/src/lib.rs create mode 100644 crates/bugsplat-symbols/Cargo.toml create mode 100644 crates/bugsplat-symbols/src/lib.rs create mode 100644 crates/bugsplat-upload/Cargo.toml create mode 100644 crates/bugsplat-upload/src/lib.rs create mode 100755 scripts/localstack-token.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0592392 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +.DS_Store diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..cd10c86 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,35 @@ +# BugSplat CLI + +One binary, `bugsplat`, for reading crash data, finding the symbol files a crash needs, and uploading them. The plan and the work streams are in https://github.com/BugSplat-Git/bugsplat-cli/issues/1. + +## Commands + +```bash +cargo build +cargo test --workspace +cargo clippy --workspace --all-targets -- -D warnings +cargo fmt --all +cargo run -- --help +``` + +All four checks must pass before a pull request. + +## Layout + +- `crates/bugsplat-cli`: the binary. `src/cli.rs` wires the command tree; each command's arguments and `run` function live in its own file under `src/commands/`. Add a command by adding a file, not by growing a shared one. +- `crates/bugsplat-core`: `Config`, `Error` (with exit codes), the HTTP client. +- `crates/bugsplat-auth`: `access_token(&Config)` is the only way any crate gets a bearer token. +- `crates/bugsplat-mcp-client`: client for the hosted MCP server; the remote verbs call its tools. +- `crates/bugsplat-debugid`: `read(path)` returns debug ids; they must match BugSplat's npm packages (`pdb-guid`, `macho-uuid`, `elfy`, `symbol-upload`). +- `crates/bugsplat-symbols`: find symbol files on disk. `crates/bugsplat-upload`: upload and delete. + +## Rules + +- Never print, log or put in an error message a token, Client Secret or password. Types that hold one implement `Debug` by hand. +- Tests never call production. Unit tests use mock servers (`wiremock`); end-to-end checks use LocalStack at `http://localhost:8085` with `BUGSPLAT_API_URL` set, and a token from `scripts/localstack-token.py` in `BUGSPLAT_ACCESS_TOKEN`. +- Results go to stdout, everything else to stderr. `--json` output is stable; text output is for people. +- Exit codes: 0 success, 1 failure, 2 usage, 3 not signed in (`bugsplat_core::Error::exit_code`). +- Shared dependency versions are in the root `Cargo.toml` under `[workspace.dependencies]`. A dependency only one crate needs goes in that crate's `Cargo.toml`. +- Comments explain why, not what. No section-label or narrating comments. +- Nothing is published (crates.io, Homebrew, npm, GitHub Releases) without Bobby's say-so. +- Never commit or push to `main`; work on a branch and open a pull request. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..98ecf3f --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2355 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cb931c189b85683d69a5cfad41d4d418671e1ac413dd209f3f2fc31e3cfd902" + +[[package]] +name = "assert-json-diff" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "assert_cmd" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aa3a22042e45de04255c7bf3626e239f450200fd0493c1e382263544b20aea6" +dependencies = [ + "anstyle", + "bstr", + "libc", + "predicates", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "aws-lc-rs" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048006790404103c488e6c5616b3e7e702a71292aadda08e8f7698a9e0d2eb53" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bfbe32ac36b3c428696ce315464181bc4029d689fd58e3f2a4e58c252242f52" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", + "pkg-config", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + +[[package]] +name = "bstr" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a680398c10c7bc0488067c4612226ea905a85f607134b69f3068d505d58c4214" +dependencies = [ + "memchr", + "regex-automata", + "serde_core", +] + +[[package]] +name = "bugsplat-auth" +version = "0.1.0" +dependencies = [ + "bugsplat-core", + "reqwest", + "serde", + "serde_json", + "tempfile", + "tokio", + "url", + "wiremock", +] + +[[package]] +name = "bugsplat-cli" +version = "0.1.0" +dependencies = [ + "anyhow", + "assert_cmd", + "bugsplat-auth", + "bugsplat-core", + "bugsplat-debugid", + "bugsplat-mcp-client", + "bugsplat-symbols", + "bugsplat-upload", + "clap", + "clap_complete", + "predicates", + "serde", + "serde_json", + "tempfile", + "tokio", +] + +[[package]] +name = "bugsplat-core" +version = "0.1.0" +dependencies = [ + "dirs", + "reqwest", + "serde", + "serde_json", + "thiserror", + "url", +] + +[[package]] +name = "bugsplat-debugid" +version = "0.1.0" +dependencies = [ + "serde", + "tempfile", + "thiserror", +] + +[[package]] +name = "bugsplat-mcp-client" +version = "0.1.0" +dependencies = [ + "bugsplat-core", + "reqwest", + "serde", + "serde_json", + "tempfile", + "tokio", + "url", + "wiremock", +] + +[[package]] +name = "bugsplat-symbols" +version = "0.1.0" +dependencies = [ + "bugsplat-debugid", + "serde", + "tempfile", + "thiserror", +] + +[[package]] +name = "bugsplat-upload" +version = "0.1.0" +dependencies = [ + "bugsplat-core", + "bugsplat-debugid", + "reqwest", + "serde", + "serde_json", + "tempfile", + "tokio", + "url", + "wiremock", +] + +[[package]] +name = "bumpalo" +version = "3.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db" + +[[package]] +name = "bytes" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "776dfebd015e2d8732c684a2c71003674ccb49457b539b9e82151ba38e96dd7c" + +[[package]] +name = "cc" +version = "1.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02f0e023adb368345ce0ca6cdfc0f24a06554468d0e8503e14a0841de79bfa69" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "chacha20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core", +] + +[[package]] +name = "clap" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "844c5c0b65be192cb68d570cca1b21a6444431d24e39c084dc0336177015337c" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_complete" +version = "4.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a35200383f20018d41c14d1ab19c1727c697f544492143f7d93aa39f0187848" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_derive" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c174f11f949b9ca8c60580925e282b9cbd5454750e506f08648b2038080cd7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "clap_lex" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0921b3876b3a1df8a1c9f912e7f94342458022c2e84288015893d83c4d62a79" + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "combine" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + +[[package]] +name = "cpufeatures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" +dependencies = [ + "libc", +] + +[[package]] +name = "deadpool" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be2b1d1d6ec8d846f05e137292d0b89133caf95ef33695424c09568bdd39b1b" +dependencies = [ + "deadpool-runtime", + "lazy_static", + "num_cpus", + "tokio", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "dirs" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "encoding_rs" +version = "0.8.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "errno" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "find-msvc-tools" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" + +[[package]] +name = "float-cmp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "rand_core", + "wasm-bindgen", +] + +[[package]] +name = "h2" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d29020232d6aa3fb1daca64c1127cf662cf97f254ae16c18c05b8ab635fc118" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229c6ff5584df4c6becbfe00567128bac768c8cd32ebc8a8366bd81ed072e8f3" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" +dependencies = [ + "base64 0.23.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "icu_collections" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc" + +[[package]] +name = "icu_properties" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf" + +[[package]] +name = "icu_provider" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" + +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.3", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "libredox" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d" +dependencies = [ + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "log" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" + +[[package]] +name = "lru-slab" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5848f5a9e8117cf94f2f90faac24a87ff81600ff8628c1e3deaab572e76bfa1" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mio" +version = "1.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20521a903f02b0a573cd6840e9d0a5a0cc043d361fe924092cd70f8556cc9c4a" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "openssl-probe" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752" + +[[package]] +name = "pkg-config" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "predicates" +version = "3.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada8f2932f28a27ee7b70dd6c1c39ea0675c55a36879ab92f3a715eaa1e63cfe" +dependencies = [ + "anstyle", + "difflib", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144" + +[[package]] +name = "predicates-tree" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quinn" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.4.3", + "lru-slab", + "rand", + "rand_pcg", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6fa277c67e6ea590466f04c3fe82cb509f0864fe470643e5570de9514a9b11" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb95882a1e14462c69aea9984bb261293ccfe6022ef8de0eda18bd5afb0052df" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_users" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" +dependencies = [ + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" + +[[package]] +name = "reqwest" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029" +dependencies = [ + "base64 0.23.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" +dependencies = [ + "aws-lc-rs", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102f35f7de7b06d8c61f1cff6592f5253e0dea431c74867aad5dfd70f44663fb" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" + +[[package]] +name = "rustls-webpki" +version = "0.103.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a0760a887c14823fca5a1c970b01d47c328c696c0c64829d1df50e8f853fd5" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59" + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "thiserror" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "tinystr" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" + +[[package]] +name = "tokio" +version = "1.54.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "libc", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicase" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f" + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "utf8_iter" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0" +dependencies = [ + "utf_types", +] + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "utf_types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42e295b7452c4604982280d8586001fcad9b8b201cac67bca9771e7a7475403" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c" +dependencies = [ + "cfg-if", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14e0327cb5368ad60ccb22d04a9827a693c95a926d8d125e9fa39e0baec501" +dependencies = [ + "js-sys", + "tokio", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.10", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d179596ff5ec0f6de4db64d54011bde6289cc49603d3a6e4ce3f329207ab88" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "293198dcebfb821155b5092ab94b5a82ff180eddd7241df3bd6e66a4ffd1a585" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wiremock" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08db1edfb05d9b3c1542e521aea074442088292f00b5f28e435c714a98f85031" +dependencies = [ + "assert-json-diff", + "base64 0.22.1", + "deadpool", + "futures", + "http", + "http-body-util", + "hyper", + "hyper-util", + "log", + "once_cell", + "regex", + "serde", + "serde_json", + "tokio", + "url", +] + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "yoke" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85ccff8a4805aba1eaa4cd4afcd49f7557dd2cf5fd79ffc37f8959466effc5aa" + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..67d38e6 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,36 @@ +[workspace] +resolver = "3" +members = ["crates/*"] + +[workspace.package] +version = "0.1.0" +edition = "2024" +rust-version = "1.88" +license = "MIT" +repository = "https://github.com/BugSplat-Git/bugsplat-cli" +authors = ["BugSplat "] +publish = false + +[workspace.dependencies] +bugsplat-auth = { path = "crates/bugsplat-auth" } +bugsplat-core = { path = "crates/bugsplat-core" } +bugsplat-debugid = { path = "crates/bugsplat-debugid" } +bugsplat-mcp-client = { path = "crates/bugsplat-mcp-client" } +bugsplat-symbols = { path = "crates/bugsplat-symbols" } +bugsplat-upload = { path = "crates/bugsplat-upload" } + +anyhow = "1" +clap = { version = "4", features = ["derive", "env"] } +clap_complete = "4" +dirs = "7" +reqwest = { version = "0.13", features = ["json", "stream", "multipart", "form", "query"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +thiserror = "2" +tokio = { version = "1", features = ["rt-multi-thread", "macros", "fs", "net", "time", "sync", "io-util"] } +url = { version = "2", features = ["serde"] } + +assert_cmd = "2" +predicates = "3" +tempfile = "3" +wiremock = "0.6" diff --git a/README.md b/README.md index 311dfbc..f7bbcca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ -# bugsplat-cli -The BugSplat command line: crashes, crash groups, symbols and symbol upload, for people and coding agents +# BugSplat CLI + +`bugsplat` is a command line for [BugSplat](https://www.bugsplat.com) crash reporting, for people and coding agents: read crash reports and crash groups, find the symbol files a crash needs on your disk, and upload them. + +It is in development and not released yet. The plan is in [issue 1](https://github.com/BugSplat-Git/bugsplat-cli/issues/1). + +## Build + +```bash +cargo build --release +./target/release/bugsplat --help +``` + +## License + +MIT diff --git a/crates/bugsplat-auth/Cargo.toml b/crates/bugsplat-auth/Cargo.toml new file mode 100644 index 0000000..7b9aefb --- /dev/null +++ b/crates/bugsplat-auth/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "bugsplat-auth" +description = "Sign-in and access tokens for the BugSplat CLI" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true +publish.workspace = true + +[dependencies] +bugsplat-core.workspace = true +reqwest.workspace = true +serde.workspace = true +serde_json.workspace = true +tokio.workspace = true +url.workspace = true + +[dev-dependencies] +tempfile.workspace = true +wiremock.workspace = true diff --git a/crates/bugsplat-auth/src/lib.rs b/crates/bugsplat-auth/src/lib.rs new file mode 100644 index 0000000..8571d29 --- /dev/null +++ b/crates/bugsplat-auth/src/lib.rs @@ -0,0 +1,98 @@ +//! Sign-in and access tokens. See https://github.com/BugSplat-Git/bugsplat-cli/issues/3 +//! +//! Every other crate gets its bearer token from [`access_token`] and nothing else. + +use bugsplat_core::{Config, Error, Result}; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/3"; + +/// Set to use a token directly, ahead of client credentials and a stored session. +/// For development and tests; `scripts/localstack-token.py` prints one for LocalStack. +pub const ACCESS_TOKEN_ENV: &str = "BUGSPLAT_ACCESS_TOKEN"; + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum TokenSource { + Environment, + ClientCredentials, + Session, +} + +#[derive(Clone)] +pub struct AccessToken { + pub secret: String, + pub source: TokenSource, +} + +// Not derived: the token must never be printed. +impl std::fmt::Debug for AccessToken { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("AccessToken") + .field("secret", &"***") + .field("source", &self.source) + .finish() + } +} + +/// Who is signed in, for `bugsplat whoami`. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Identity { + pub email: Option, + pub api_url: String, + pub source: TokenSource, +} + +#[derive(Debug, Clone, Default)] +pub struct LoginOptions { + /// Print the sign-in URL instead of opening a browser. + pub no_browser: bool, +} + +/// A bearer token for `config.api_url`, refreshed if needed. +/// `Error::NotSignedIn` when there is nothing to authenticate with. +pub async fn access_token(_config: &Config) -> Result { + if let Some(secret) = std::env::var(ACCESS_TOKEN_ENV) + .ok() + .filter(|t| !t.is_empty()) + { + return Ok(AccessToken { + secret, + source: TokenSource::Environment, + }); + } + Err(Error::NotSignedIn) +} + +pub async fn login(_config: &Config, _options: &LoginOptions) -> Result { + Err(Error::NotImplemented { + command: "login", + issue: ISSUE, + }) +} + +pub async fn logout(_config: &Config) -> Result<()> { + Err(Error::NotImplemented { + command: "logout", + issue: ISSUE, + }) +} + +pub async fn whoami(_config: &Config) -> Result { + Err(Error::NotImplemented { + command: "whoami", + issue: ISSUE, + }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn debug_hides_the_token() { + let token = AccessToken { + secret: "hunter2".into(), + source: TokenSource::Environment, + }; + assert!(!format!("{token:?}").contains("hunter2")); + } +} diff --git a/crates/bugsplat-cli/Cargo.toml b/crates/bugsplat-cli/Cargo.toml new file mode 100644 index 0000000..cd30d68 --- /dev/null +++ b/crates/bugsplat-cli/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "bugsplat-cli" +description = "The BugSplat command line" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true +publish.workspace = true + +[dependencies] +bugsplat-auth.workspace = true +bugsplat-core.workspace = true +bugsplat-debugid.workspace = true +bugsplat-mcp-client.workspace = true +bugsplat-symbols.workspace = true +bugsplat-upload.workspace = true +anyhow.workspace = true +clap.workspace = true +clap_complete.workspace = true +serde.workspace = true +serde_json.workspace = true +tokio.workspace = true + +[[bin]] +name = "bugsplat" +path = "src/main.rs" + +[dev-dependencies] +assert_cmd.workspace = true +predicates.workspace = true +tempfile.workspace = true diff --git a/crates/bugsplat-cli/src/cli.rs b/crates/bugsplat-cli/src/cli.rs new file mode 100644 index 0000000..2e8e97c --- /dev/null +++ b/crates/bugsplat-cli/src/cli.rs @@ -0,0 +1,100 @@ +//! The command tree. Each command's arguments and `run` function live in its own file +//! under `commands/`; this file only wires them together. + +use clap::{Args, Parser, Subcommand}; + +use crate::commands::{ + auth, completions, databases, defects, groups, mcp, reports, symbols, tool, versions, +}; + +#[derive(Debug, Parser)] +#[command( + name = "bugsplat", + version, + about = "Read BugSplat crash data, find the symbol files a crash needs, and upload them." +)] +pub struct Cli { + #[command(flatten)] + pub global: GlobalArgs, + + #[command(subcommand)] + pub command: Command, +} + +#[derive(Debug, Args)] +pub struct GlobalArgs { + /// BugSplat database. Defaults to your default database for commands that read crash data. + #[arg(short = 'b', long, global = true, env = "BUGSPLAT_DATABASE")] + pub database: Option, + + /// Base URL of the BugSplat API [default: https://api.bugsplat.com] [env: BUGSPLAT_API_URL, BUGSPLAT_HOST] + #[arg(long, global = true, value_name = "URL")] + pub api_url: Option, + + /// OAuth Client ID for the database, for CI [env: BUGSPLAT_CLIENT_ID, SYMBOL_UPLOAD_CLIENT_ID] + #[arg(long, global = true, value_name = "ID")] + pub client_id: Option, + + /// OAuth Client Secret for the database, for CI [env: BUGSPLAT_CLIENT_SECRET, SYMBOL_UPLOAD_CLIENT_SECRET] + #[arg(long, global = true, value_name = "SECRET")] + pub client_secret: Option, + + /// Print JSON instead of text + #[arg(long, global = true)] + pub json: bool, + + /// Print only results and errors + #[arg(short, long, global = true)] + pub quiet: bool, + + /// Print more detail about what the command is doing + #[arg(long, global = true)] + pub verbose: bool, +} + +#[derive(Debug, Subcommand)] +pub enum Command { + /// Sign in to BugSplat in your browser + Login(auth::LoginArgs), + /// Sign out and delete the stored session + Logout(auth::LogoutArgs), + /// Show who is signed in + Whoami(auth::WhoamiArgs), + /// List the databases you can open + #[command(subcommand)] + Databases(databases::DatabasesCommand), + /// List and read crash reports + #[command(subcommand)] + Reports(reports::ReportsCommand), + /// List, read and update crash groups + #[command(subcommand)] + Groups(groups::GroupsCommand), + /// List application versions + #[command(subcommand)] + Versions(versions::VersionsCommand), + /// File crash groups as defects in your issue tracker + #[command(subcommand)] + Defects(defects::DefectsCommand), + /// Inspect, find, upload and delete symbol files + #[command(subcommand)] + Symbols(symbols::SymbolsCommand), + /// Call any tool of BugSplat's MCP server + #[command(subcommand)] + Tool(tool::ToolCommand), + /// Print a shell completion script + Completions(completions::CompletionsArgs), + /// Run as a local MCP server over stdio + Mcp(mcp::McpArgs), +} + +#[cfg(test)] +mod tests { + use clap::CommandFactory; + + use super::*; + + #[test] + fn command_tree_is_consistent() { + Cli::command().debug_assert(); + } +} diff --git a/crates/bugsplat-cli/src/commands/auth.rs b/crates/bugsplat-cli/src/commands/auth.rs new file mode 100644 index 0000000..584790a --- /dev/null +++ b/crates/bugsplat-cli/src/commands/auth.rs @@ -0,0 +1,37 @@ +//! `login`, `logout`, `whoami`. https://github.com/BugSplat-Git/bugsplat-cli/issues/3 + +use bugsplat_auth::LoginOptions; +use clap::Args; + +use crate::context::Context; + +#[derive(Debug, Args)] +pub struct LoginArgs { + /// Print the sign-in URL instead of opening a browser + #[arg(long)] + pub no_browser: bool, +} + +#[derive(Debug, Args)] +pub struct LogoutArgs {} + +#[derive(Debug, Args)] +pub struct WhoamiArgs {} + +pub async fn login(args: LoginArgs, ctx: &Context) -> anyhow::Result<()> { + let options = LoginOptions { + no_browser: args.no_browser, + }; + bugsplat_auth::login(&ctx.config, &options).await?; + Ok(()) +} + +pub async fn logout(_args: LogoutArgs, ctx: &Context) -> anyhow::Result<()> { + bugsplat_auth::logout(&ctx.config).await?; + Ok(()) +} + +pub async fn whoami(_args: WhoamiArgs, ctx: &Context) -> anyhow::Result<()> { + bugsplat_auth::whoami(&ctx.config).await?; + Ok(()) +} diff --git a/crates/bugsplat-cli/src/commands/completions.rs b/crates/bugsplat-cli/src/commands/completions.rs new file mode 100644 index 0000000..6707d6d --- /dev/null +++ b/crates/bugsplat-cli/src/commands/completions.rs @@ -0,0 +1,18 @@ +//! `completions`: print a shell completion script. + +use clap::{Args, CommandFactory}; +use clap_complete::Shell; + +use crate::cli::Cli; + +#[derive(Debug, Args)] +pub struct CompletionsArgs { + /// Shell to generate the script for + pub shell: Shell, +} + +pub fn run(args: CompletionsArgs) -> anyhow::Result<()> { + let mut command = Cli::command(); + clap_complete::generate(args.shell, &mut command, "bugsplat", &mut std::io::stdout()); + Ok(()) +} diff --git a/crates/bugsplat-cli/src/commands/databases.rs b/crates/bugsplat-cli/src/commands/databases.rs new file mode 100644 index 0000000..43547a1 --- /dev/null +++ b/crates/bugsplat-cli/src/commands/databases.rs @@ -0,0 +1,25 @@ +//! `databases`. https://github.com/BugSplat-Git/bugsplat-cli/issues/4 + +use bugsplat_core::Error; +use clap::{Args, Subcommand}; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/4"; + +#[derive(Debug, Subcommand)] +pub enum DatabasesCommand { + /// List the databases you can open + List(ListArgs), +} + +#[derive(Debug, Args)] +pub struct ListArgs {} + +pub async fn run(_command: DatabasesCommand, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "databases", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/defects.rs b/crates/bugsplat-cli/src/commands/defects.rs new file mode 100644 index 0000000..8bdb121 --- /dev/null +++ b/crates/bugsplat-cli/src/commands/defects.rs @@ -0,0 +1,58 @@ +//! `defects`. https://github.com/BugSplat-Git/bugsplat-cli/issues/4 + +use bugsplat_core::Error; +use clap::{Args, Subcommand}; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/4"; + +#[derive(Debug, Subcommand)] +pub enum DefectsCommand { + /// File a crash group as a new defect in the connected issue tracker + Create(CreateArgs), + /// Link a crash group to a defect that already exists + Link(LinkArgs), + /// Remove the link between a crash group and its defect + Unlink(UnlinkArgs), +} + +#[derive(Debug, Args)] +pub struct CreateArgs { + /// Crash group id + pub group_id: u64, + /// Text to add to the defect's description + #[arg(long)] + pub notes: Option, + /// Don't ask for confirmation + #[arg(short, long)] + pub yes: bool, +} + +#[derive(Debug, Args)] +pub struct LinkArgs { + /// Crash group id + pub group_id: u64, + /// The defect's id or key as your tracker shows it, for example PROJ-123 + pub defect_id: String, + /// Text to add to the defect + #[arg(long)] + pub notes: Option, + /// Don't ask for confirmation + #[arg(short, long)] + pub yes: bool, +} + +#[derive(Debug, Args)] +pub struct UnlinkArgs { + /// Crash group id + pub group_id: u64, +} + +pub async fn run(_command: DefectsCommand, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "defects", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/groups.rs b/crates/bugsplat-cli/src/commands/groups.rs new file mode 100644 index 0000000..3250406 --- /dev/null +++ b/crates/bugsplat-cli/src/commands/groups.rs @@ -0,0 +1,43 @@ +//! `groups`. https://github.com/BugSplat-Git/bugsplat-cli/issues/4 + +use bugsplat_core::Error; +use clap::{Args, Subcommand}; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/4"; + +#[derive(Debug, Subcommand)] +pub enum GroupsCommand { + /// List crash groups + List(ListArgs), + /// Show one crash group + Get(GetArgs), + /// Mark a crash group open, fixed, regression or ignored + SetStatus(SetStatusArgs), +} + +#[derive(Debug, Args)] +pub struct ListArgs {} + +#[derive(Debug, Args)] +pub struct GetArgs { + /// Crash group id + pub id: u64, +} + +#[derive(Debug, Args)] +pub struct SetStatusArgs { + /// Crash group id + pub id: u64, + /// open, fixed, regression or ignored + pub status: String, +} + +pub async fn run(_command: GroupsCommand, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "groups", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/mcp.rs b/crates/bugsplat-cli/src/commands/mcp.rs new file mode 100644 index 0000000..ee281fd --- /dev/null +++ b/crates/bugsplat-cli/src/commands/mcp.rs @@ -0,0 +1,19 @@ +//! `mcp`: run as a local MCP server. https://github.com/BugSplat-Git/bugsplat-cli/issues/9 + +use bugsplat_core::Error; +use clap::Args; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/9"; + +#[derive(Debug, Args)] +pub struct McpArgs {} + +pub async fn run(_args: McpArgs, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "mcp", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/mod.rs b/crates/bugsplat-cli/src/commands/mod.rs new file mode 100644 index 0000000..6e15abf --- /dev/null +++ b/crates/bugsplat-cli/src/commands/mod.rs @@ -0,0 +1,30 @@ +pub mod auth; +pub mod completions; +pub mod databases; +pub mod defects; +pub mod groups; +pub mod mcp; +pub mod reports; +pub mod symbols; +pub mod tool; +pub mod versions; + +use crate::cli::Command; +use crate::context::Context; + +pub async fn run(command: Command, ctx: &Context) -> anyhow::Result<()> { + match command { + Command::Login(args) => auth::login(args, ctx).await, + Command::Logout(args) => auth::logout(args, ctx).await, + Command::Whoami(args) => auth::whoami(args, ctx).await, + Command::Databases(command) => databases::run(command, ctx).await, + Command::Reports(command) => reports::run(command, ctx).await, + Command::Groups(command) => groups::run(command, ctx).await, + Command::Versions(command) => versions::run(command, ctx).await, + Command::Defects(command) => defects::run(command, ctx).await, + Command::Symbols(command) => symbols::run(command, ctx).await, + Command::Tool(command) => tool::run(command, ctx).await, + Command::Completions(args) => completions::run(args), + Command::Mcp(args) => mcp::run(args, ctx).await, + } +} diff --git a/crates/bugsplat-cli/src/commands/reports.rs b/crates/bugsplat-cli/src/commands/reports.rs new file mode 100644 index 0000000..3908be9 --- /dev/null +++ b/crates/bugsplat-cli/src/commands/reports.rs @@ -0,0 +1,33 @@ +//! `reports`. https://github.com/BugSplat-Git/bugsplat-cli/issues/4 + +use bugsplat_core::Error; +use clap::{Args, Subcommand}; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/4"; + +#[derive(Debug, Subcommand)] +pub enum ReportsCommand { + /// List crash reports, newest first + List(ListArgs), + /// Show one crash report + Get(GetArgs), +} + +#[derive(Debug, Args)] +pub struct ListArgs {} + +#[derive(Debug, Args)] +pub struct GetArgs { + /// Crash id + pub id: u64, +} + +pub async fn run(_command: ReportsCommand, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "reports", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/symbols/delete.rs b/crates/bugsplat-cli/src/commands/symbols/delete.rs new file mode 100644 index 0000000..b41f116 --- /dev/null +++ b/crates/bugsplat-cli/src/commands/symbols/delete.rs @@ -0,0 +1,29 @@ +//! `symbols delete`. https://github.com/BugSplat-Git/bugsplat-cli/issues/7 + +use bugsplat_core::Error; +use clap::Args as ClapArgs; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/7"; + +#[derive(Debug, ClapArgs)] +pub struct Args { + /// Application name + #[arg(short = 'a', long)] + pub application: String, + /// Application version whose symbols to delete + #[arg(short = 'v', long)] + pub version: String, + /// Don't ask for confirmation + #[arg(short, long)] + pub yes: bool, +} + +pub async fn run(_args: Args, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "symbols delete", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/symbols/find.rs b/crates/bugsplat-cli/src/commands/symbols/find.rs new file mode 100644 index 0000000..4116b44 --- /dev/null +++ b/crates/bugsplat-cli/src/commands/symbols/find.rs @@ -0,0 +1,29 @@ +//! `symbols find`. https://github.com/BugSplat-Git/bugsplat-cli/issues/6 + +use bugsplat_core::Error; +use clap::Args as ClapArgs; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/6"; + +#[derive(Debug, ClapArgs)] +pub struct Args { + /// Debug id to look for; repeat for several + #[arg(long = "debug-id", value_name = "ID")] + pub debug_ids: Vec, + /// File or module name to look for, with globs; repeat for several + #[arg(long = "name", value_name = "NAME")] + pub names: Vec, + /// Folder to search; repeat for several [default: .] + #[arg(long = "path", value_name = "DIR")] + pub paths: Vec, +} + +pub async fn run(_args: Args, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "symbols find", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/symbols/info.rs b/crates/bugsplat-cli/src/commands/symbols/info.rs new file mode 100644 index 0000000..2854595 --- /dev/null +++ b/crates/bugsplat-cli/src/commands/symbols/info.rs @@ -0,0 +1,23 @@ +//! `symbols info`. https://github.com/BugSplat-Git/bugsplat-cli/issues/5 + +use bugsplat_core::Error; +use clap::Args as ClapArgs; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/5"; + +#[derive(Debug, ClapArgs)] +pub struct Args { + /// Files or bundles (.dSYM, .app, .xcarchive) to inspect + #[arg(required = true, value_name = "FILE")] + pub files: Vec, +} + +pub async fn run(_args: Args, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "symbols info", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/symbols/list.rs b/crates/bugsplat-cli/src/commands/symbols/list.rs new file mode 100644 index 0000000..4557a3b --- /dev/null +++ b/crates/bugsplat-cli/src/commands/symbols/list.rs @@ -0,0 +1,19 @@ +//! `symbols list`. https://github.com/BugSplat-Git/bugsplat-cli/issues/4 + +use bugsplat_core::Error; +use clap::Args as ClapArgs; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/4"; + +#[derive(Debug, ClapArgs)] +pub struct Args {} + +pub async fn run(_args: Args, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "symbols list", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/symbols/mod.rs b/crates/bugsplat-cli/src/commands/symbols/mod.rs new file mode 100644 index 0000000..d4b5c1b --- /dev/null +++ b/crates/bugsplat-cli/src/commands/symbols/mod.rs @@ -0,0 +1,35 @@ +//! `symbols`: each subcommand lives in its own file. + +pub mod delete; +pub mod find; +pub mod info; +pub mod list; +pub mod upload; + +use clap::Subcommand; + +use crate::context::Context; + +#[derive(Debug, Subcommand)] +pub enum SymbolsCommand { + /// List the symbol files uploaded to a database + List(list::Args), + /// Print the debug id, module name and type of local files + Info(info::Args), + /// Search folders for symbol files by debug id or name + Find(find::Args), + /// Upload symbol files for an application version + Upload(upload::Args), + /// Delete an application version's symbol files + Delete(delete::Args), +} + +pub async fn run(command: SymbolsCommand, ctx: &Context) -> anyhow::Result<()> { + match command { + SymbolsCommand::List(args) => list::run(args, ctx).await, + SymbolsCommand::Info(args) => info::run(args, ctx).await, + SymbolsCommand::Find(args) => find::run(args, ctx).await, + SymbolsCommand::Upload(args) => upload::run(args, ctx).await, + SymbolsCommand::Delete(args) => delete::run(args, ctx).await, + } +} diff --git a/crates/bugsplat-cli/src/commands/symbols/upload.rs b/crates/bugsplat-cli/src/commands/symbols/upload.rs new file mode 100644 index 0000000..aa2f099 --- /dev/null +++ b/crates/bugsplat-cli/src/commands/symbols/upload.rs @@ -0,0 +1,32 @@ +//! `symbols upload`. https://github.com/BugSplat-Git/bugsplat-cli/issues/7 + +use bugsplat_core::Error; +use clap::Args as ClapArgs; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/7"; + +#[derive(Debug, ClapArgs)] +pub struct Args { + /// Application name, as the app reports it in crashes + #[arg(short = 'a', long)] + pub application: String, + /// Application version, as the app reports it in crashes + #[arg(short = 'v', long)] + pub version: String, + /// Base directory to search for symbol files + #[arg(short = 'd', long, default_value = ".")] + pub directory: std::path::PathBuf, + /// Glob, relative to the directory, selecting the files to upload + #[arg(short = 'f', long, default_value = "*.js.map")] + pub files: String, +} + +pub async fn run(_args: Args, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "symbols upload", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/tool.rs b/crates/bugsplat-cli/src/commands/tool.rs new file mode 100644 index 0000000..36aa03b --- /dev/null +++ b/crates/bugsplat-cli/src/commands/tool.rs @@ -0,0 +1,39 @@ +//! `tool`. https://github.com/BugSplat-Git/bugsplat-cli/issues/4 + +use bugsplat_core::Error; +use clap::{Args, Subcommand}; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/4"; + +#[derive(Debug, Subcommand)] +pub enum ToolCommand { + /// List the MCP server's tools + List(ListArgs), + /// Call a tool by name + Call(CallArgs), +} + +#[derive(Debug, Args)] +pub struct ListArgs {} + +#[derive(Debug, Args)] +pub struct CallArgs { + /// Tool name, for example list-groups + pub name: String, + /// The tool's arguments as a JSON object + #[arg(long, value_name = "JSON")] + pub args: Option, + /// Arguments as key=value pairs; a value that parses as JSON is sent as JSON + #[arg(value_name = "KEY=VALUE")] + pub pairs: Vec, +} + +pub async fn run(_command: ToolCommand, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "tool", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/commands/versions.rs b/crates/bugsplat-cli/src/commands/versions.rs new file mode 100644 index 0000000..2973dbb --- /dev/null +++ b/crates/bugsplat-cli/src/commands/versions.rs @@ -0,0 +1,25 @@ +//! `versions`. https://github.com/BugSplat-Git/bugsplat-cli/issues/4 + +use bugsplat_core::Error; +use clap::{Args, Subcommand}; + +use crate::context::Context; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/4"; + +#[derive(Debug, Subcommand)] +pub enum VersionsCommand { + /// List application versions + List(ListArgs), +} + +#[derive(Debug, Args)] +pub struct ListArgs {} + +pub async fn run(_command: VersionsCommand, _ctx: &Context) -> anyhow::Result<()> { + Err(Error::NotImplemented { + command: "versions", + issue: ISSUE, + } + .into()) +} diff --git a/crates/bugsplat-cli/src/context.rs b/crates/bugsplat-cli/src/context.rs new file mode 100644 index 0000000..7a0e5f5 --- /dev/null +++ b/crates/bugsplat-cli/src/context.rs @@ -0,0 +1,41 @@ +use bugsplat_core::{Config, OutputFormat}; + +use crate::cli::GlobalArgs; + +/// What a command's `run` function receives besides its own arguments. +pub struct Context { + pub config: Config, +} + +impl Context { + pub fn from_global(global: &GlobalArgs) -> bugsplat_core::Result { + let api_url = first_set(&global.api_url, &["BUGSPLAT_API_URL", "BUGSPLAT_HOST"]); + let mut config = Config::new(api_url.as_deref())?; + config.database = global.database.clone().filter(|d| !d.is_empty()); + config.client_id = first_set( + &global.client_id, + &["BUGSPLAT_CLIENT_ID", "SYMBOL_UPLOAD_CLIENT_ID"], + ); + config.client_secret = first_set( + &global.client_secret, + &["BUGSPLAT_CLIENT_SECRET", "SYMBOL_UPLOAD_CLIENT_SECRET"], + ); + config.output = if global.json { + OutputFormat::Json + } else { + OutputFormat::Text + }; + config.quiet = global.quiet; + config.verbose = global.verbose; + Ok(Self { config }) + } +} + +/// The flag if given, otherwise the first of `env_names` that is set and not empty. +fn first_set(flag: &Option, env_names: &[&str]) -> Option { + flag.clone().filter(|v| !v.is_empty()).or_else(|| { + env_names + .iter() + .find_map(|name| std::env::var(name).ok().filter(|v| !v.is_empty())) + }) +} diff --git a/crates/bugsplat-cli/src/main.rs b/crates/bugsplat-cli/src/main.rs new file mode 100644 index 0000000..9293a8f --- /dev/null +++ b/crates/bugsplat-cli/src/main.rs @@ -0,0 +1,31 @@ +mod cli; +mod commands; +mod context; +mod output; + +use std::process::ExitCode; + +use clap::Parser; + +use crate::cli::Cli; +use crate::context::Context; + +#[tokio::main] +async fn main() -> ExitCode { + let cli = Cli::parse(); + match run(cli).await { + Ok(()) => ExitCode::SUCCESS, + Err(err) => { + eprintln!("error: {err:#}"); + let code = err + .downcast_ref::() + .map_or(1, bugsplat_core::Error::exit_code); + ExitCode::from(code) + } + } +} + +async fn run(cli: Cli) -> anyhow::Result<()> { + let ctx = Context::from_global(&cli.global)?; + commands::run(cli.command, &ctx).await +} diff --git a/crates/bugsplat-cli/src/output.rs b/crates/bugsplat-cli/src/output.rs new file mode 100644 index 0000000..a6f3092 --- /dev/null +++ b/crates/bugsplat-cli/src/output.rs @@ -0,0 +1,34 @@ +//! Printing and prompting helpers shared by the commands. +#![allow(dead_code)] + +use std::io::{IsTerminal, Write}; + +use bugsplat_core::Error; +use serde::Serialize; + +pub fn print_json(value: &T) -> anyhow::Result<()> { + println!("{}", serde_json::to_string_pretty(value)?); + Ok(()) +} + +/// Asks before a change that can't be undone from the CLI. `assume_yes` is the command's +/// `--yes` flag. Without a terminal there is nobody to ask, so `--yes` is required. +pub fn confirm(prompt: &str, assume_yes: bool) -> bugsplat_core::Result { + if assume_yes { + return Ok(true); + } + if !std::io::stdin().is_terminal() { + return Err(Error::Usage(format!( + "{prompt} Pass --yes to confirm when not running in a terminal." + ))); + } + eprint!("{prompt} [y/N] "); + std::io::stderr().flush()?; + let mut answer = String::new(); + std::io::stdin().read_line(&mut answer)?; + Ok(matches!(answer.trim().to_lowercase().as_str(), "y" | "yes")) +} + +pub fn stdout_is_terminal() -> bool { + std::io::stdout().is_terminal() +} diff --git a/crates/bugsplat-cli/tests/cli.rs b/crates/bugsplat-cli/tests/cli.rs new file mode 100644 index 0000000..1832dbe --- /dev/null +++ b/crates/bugsplat-cli/tests/cli.rs @@ -0,0 +1,92 @@ +//! Checks on the command tree itself. Each work stream adds its own test file next to this one. + +use assert_cmd::Command; +use predicates::prelude::*; + +fn bugsplat() -> Command { + let mut command = Command::cargo_bin("bugsplat").unwrap(); + for name in [ + "BUGSPLAT_ACCESS_TOKEN", + "BUGSPLAT_API_URL", + "BUGSPLAT_HOST", + "BUGSPLAT_DATABASE", + "BUGSPLAT_CLIENT_ID", + "BUGSPLAT_CLIENT_SECRET", + "SYMBOL_UPLOAD_CLIENT_ID", + "SYMBOL_UPLOAD_CLIENT_SECRET", + ] { + command.env_remove(name); + } + command +} + +#[test] +fn help_lists_the_commands() { + let assert = bugsplat().arg("--help").assert().success(); + let help = String::from_utf8(assert.get_output().stdout.clone()).unwrap(); + for command in [ + "login", + "logout", + "whoami", + "databases", + "reports", + "groups", + "versions", + "defects", + "symbols", + "tool", + "completions", + "mcp", + ] { + assert!(help.contains(command), "--help is missing `{command}`"); + } +} + +#[test] +fn symbols_help_lists_its_subcommands() { + let assert = bugsplat().args(["symbols", "--help"]).assert().success(); + let help = String::from_utf8(assert.get_output().stdout.clone()).unwrap(); + for command in ["list", "info", "find", "upload", "delete"] { + assert!( + help.contains(command), + "symbols --help is missing `{command}`" + ); + } +} + +#[test] +fn version_prints_the_package_version() { + bugsplat() + .arg("--version") + .assert() + .success() + .stdout(predicate::str::contains(env!("CARGO_PKG_VERSION"))); +} + +#[test] +fn completions_prints_a_script() { + bugsplat() + .args(["completions", "zsh"]) + .assert() + .success() + .stdout(predicate::str::contains("bugsplat")); +} + +#[test] +fn an_unbuilt_command_fails_with_a_link_to_its_issue() { + bugsplat() + .arg("mcp") + .assert() + .code(1) + .stderr(predicate::str::contains("not implemented yet")) + .stderr(predicate::str::contains("/issues/9")); +} + +#[test] +fn a_bad_api_url_is_a_usage_error() { + bugsplat() + .args(["--api-url", "not a url", "mcp"]) + .assert() + .code(2) + .stderr(predicate::str::contains("Invalid API URL")); +} diff --git a/crates/bugsplat-core/Cargo.toml b/crates/bugsplat-core/Cargo.toml new file mode 100644 index 0000000..8fd6a60 --- /dev/null +++ b/crates/bugsplat-core/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "bugsplat-core" +description = "Configuration, errors and the HTTP client shared by the BugSplat CLI crates" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true +publish.workspace = true + +[dependencies] +dirs.workspace = true +reqwest.workspace = true +serde.workspace = true +serde_json.workspace = true +thiserror.workspace = true +url.workspace = true diff --git a/crates/bugsplat-core/src/config.rs b/crates/bugsplat-core/src/config.rs new file mode 100644 index 0000000..56cc31e --- /dev/null +++ b/crates/bugsplat-core/src/config.rs @@ -0,0 +1,140 @@ +use std::path::PathBuf; + +use url::Url; + +use crate::{Error, Result}; + +pub const DEFAULT_API_URL: &str = "https://api.bugsplat.com"; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +pub enum OutputFormat { + #[default] + Text, + Json, +} + +/// What every command needs to know, resolved once from flags and the environment. +#[derive(Clone)] +pub struct Config { + /// Base URL of the BugSplat API, without a trailing slash. + pub api_url: Url, + pub database: Option, + /// OAuth client credentials for one database, used in CI instead of a signed-in session. + pub client_id: Option, + pub client_secret: Option, + pub output: OutputFormat, + pub quiet: bool, + pub verbose: bool, +} + +impl Config { + pub fn new(api_url: Option<&str>) -> Result { + let raw = api_url.unwrap_or(DEFAULT_API_URL).trim_end_matches('/'); + let api_url = + Url::parse(raw).map_err(|e| Error::Usage(format!("Invalid API URL `{raw}`: {e}")))?; + if !matches!(api_url.scheme(), "http" | "https") || api_url.host_str().is_none() { + return Err(Error::Usage(format!( + "Invalid API URL `{raw}`: expected http(s)://host" + ))); + } + Ok(Self { + api_url, + database: None, + client_id: None, + client_secret: None, + output: OutputFormat::Text, + quiet: false, + verbose: false, + }) + } + + /// `path` is joined to the API URL; it may start with `/`. + pub fn url(&self, path: &str) -> Url { + let base = self.api_url.as_str().trim_end_matches('/'); + let path = path.trim_start_matches('/'); + Url::parse(&format!("{base}/{path}")).expect("API URL joined with a path is a URL") + } + + /// The hosted MCP endpoint, which is also the OAuth resource. + pub fn mcp_url(&self) -> Url { + self.url("mcp") + } + + pub fn database(&self) -> Result<&str> { + self.database.as_deref().ok_or_else(|| { + Error::Usage("No database. Pass --database or set BUGSPLAT_DATABASE.".to_string()) + }) + } + + pub fn is_json(&self) -> bool { + self.output == OutputFormat::Json + } + + /// Where the CLI keeps its files: `$BUGSPLAT_CONFIG_DIR`, or `bugsplat` under the + /// platform's config directory. + pub fn config_dir() -> Result { + if let Some(dir) = std::env::var_os("BUGSPLAT_CONFIG_DIR").filter(|d| !d.is_empty()) { + return Ok(PathBuf::from(dir)); + } + dirs::config_dir() + .map(|dir| dir.join("bugsplat")) + .ok_or_else(|| Error::Other("Could not find a config directory".to_string())) + } +} + +// Not derived: the client secret must never be printed. +impl std::fmt::Debug for Config { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Config") + .field("api_url", &self.api_url.as_str()) + .field("database", &self.database) + .field("client_id", &self.client_id) + .field("client_secret", &self.client_secret.as_ref().map(|_| "***")) + .field("output", &self.output) + .finish() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn default_api_url() { + let config = Config::new(None).unwrap(); + assert_eq!(config.mcp_url().as_str(), "https://api.bugsplat.com/mcp"); + } + + #[test] + fn joins_paths_under_a_custom_api_url() { + let config = Config::new(Some("http://localhost:8085/")).unwrap(); + assert_eq!( + config.url("/symsrv/uploadUrl").as_str(), + "http://localhost:8085/symsrv/uploadUrl" + ); + } + + #[test] + fn rejects_a_bad_api_url() { + assert!(matches!( + Config::new(Some("not a url")), + Err(Error::Usage(_)) + )); + assert!(matches!(Config::new(Some("ftp://x")), Err(Error::Usage(_)))); + } + + #[test] + fn debug_hides_the_client_secret() { + let mut config = Config::new(None).unwrap(); + config.client_secret = Some("hunter2".into()); + assert!(!format!("{config:?}").contains("hunter2")); + } + + #[test] + fn missing_database_is_a_usage_error() { + assert!(matches!( + Config::new(None).unwrap().database(), + Err(Error::Usage(_)) + )); + } +} diff --git a/crates/bugsplat-core/src/error.rs b/crates/bugsplat-core/src/error.rs new file mode 100644 index 0000000..e94f224 --- /dev/null +++ b/crates/bugsplat-core/src/error.rs @@ -0,0 +1,68 @@ +/// Errors every crate reports the same way. The CLI maps them to exit codes. +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error( + "Not signed in. Run `bugsplat login`, or supply a Client ID and Client Secret for the database." + )] + NotSignedIn, + + #[error("`bugsplat {command}` is not implemented yet. Follow {issue}")] + NotImplemented { + command: &'static str, + issue: &'static str, + }, + + #[error("{0}")] + Usage(String), + + /// BugSplat answered, and the answer was an error. + #[error("{message}")] + Api { + status: Option, + message: String, + }, + + #[error(transparent)] + Http(#[from] reqwest::Error), + + #[error(transparent)] + Io(#[from] std::io::Error), + + #[error(transparent)] + Json(#[from] serde_json::Error), + + #[error("{0}")] + Other(String), +} + +impl Error { + /// 1 failure, 2 usage, 3 not signed in. + pub fn exit_code(&self) -> u8 { + match self { + Error::Usage(_) => 2, + Error::NotSignedIn => 3, + _ => 1, + } + } + + pub fn api(status: impl Into>, message: impl Into) -> Self { + Error::Api { + status: status.into(), + message: message.into(), + } + } +} + +pub type Result = std::result::Result; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn exit_codes() { + assert_eq!(Error::Usage("x".into()).exit_code(), 2); + assert_eq!(Error::NotSignedIn.exit_code(), 3); + assert_eq!(Error::api(500, "x").exit_code(), 1); + } +} diff --git a/crates/bugsplat-core/src/http.rs b/crates/bugsplat-core/src/http.rs new file mode 100644 index 0000000..aacbdf4 --- /dev/null +++ b/crates/bugsplat-core/src/http.rs @@ -0,0 +1,12 @@ +use std::time::Duration; + +use crate::Result; + +/// One client for the whole run: shared connection pool, our user agent, sane timeouts. +/// No overall request timeout, because symbol uploads can be large. +pub fn http_client() -> Result { + Ok(reqwest::Client::builder() + .user_agent(concat!("bugsplat-cli/", env!("CARGO_PKG_VERSION"))) + .connect_timeout(Duration::from_secs(30)) + .build()?) +} diff --git a/crates/bugsplat-core/src/lib.rs b/crates/bugsplat-core/src/lib.rs new file mode 100644 index 0000000..a549a81 --- /dev/null +++ b/crates/bugsplat-core/src/lib.rs @@ -0,0 +1,9 @@ +//! Configuration, errors and the HTTP client shared by the BugSplat CLI crates. + +mod config; +mod error; +mod http; + +pub use config::{Config, DEFAULT_API_URL, OutputFormat}; +pub use error::{Error, Result}; +pub use http::http_client; diff --git a/crates/bugsplat-debugid/Cargo.toml b/crates/bugsplat-debugid/Cargo.toml new file mode 100644 index 0000000..62374e4 --- /dev/null +++ b/crates/bugsplat-debugid/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "bugsplat-debugid" +description = "Debug ids from PE, PDB, ELF, Mach-O, dSYM and Breakpad .sym files" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true +publish.workspace = true + +[dependencies] +serde.workspace = true +thiserror.workspace = true + +[dev-dependencies] +tempfile.workspace = true diff --git a/crates/bugsplat-debugid/src/lib.rs b/crates/bugsplat-debugid/src/lib.rs new file mode 100644 index 0000000..78dbc4e --- /dev/null +++ b/crates/bugsplat-debugid/src/lib.rs @@ -0,0 +1,86 @@ +//! Debug ids from PE, PDB, ELF, Mach-O, dSYM and Breakpad .sym files. +//! See https://github.com/BugSplat-Git/bugsplat-cli/issues/5 +//! +//! The ids match what BugSplat's npm packages (pdb-guid, macho-uuid, elfy, symbol-upload) +//! produce, because symbol uploads are keyed on them. + +use std::path::{Path, PathBuf}; + +use serde::Serialize; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize)] +#[serde(rename_all = "kebab-case")] +pub enum ObjectKind { + Pe, + Pdb, + PortablePdb, + Elf, + MachO, + BreakpadSym, +} + +/// Where one architecture's object sits inside a fat Mach-O file. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] +pub struct Slice { + pub offset: u64, + pub size: u64, +} + +/// One object in a file. A fat Mach-O binary or a dSYM bundle yields several. +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DebugInfo { + /// The file the object was read from. + pub path: PathBuf, + /// The name BugSplat stores the file under, usually the file name. + pub module_name: String, + /// The id as BugSplat stores it. Empty when the file is a known kind without an id. + pub debug_id: String, + pub kind: ObjectKind, + pub arch: Option, + pub slice: Option, +} + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error("{}: {source}", path.display())] + Io { + path: PathBuf, + source: std::io::Error, + }, + + #[error("{}: not a PE, PDB, ELF, Mach-O or Breakpad .sym file", .0.display())] + Unsupported(PathBuf), + + #[error("{}: {reason}", path.display())] + Malformed { path: PathBuf, reason: String }, +} + +pub type Result = std::result::Result; + +/// Every object in `path`, which may be a file or a `.dSYM`, `.app` or `.xcarchive` bundle. +pub fn read(path: &Path) -> Result> { + Err(Error::Unsupported(path.to_path_buf())) +} + +/// The form ids are compared in: uppercase, without dashes or surrounding space. +pub fn normalize_id(id: &str) -> String { + id.trim() + .chars() + .filter(|c| *c != '-') + .flat_map(char::to_uppercase) + .collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn normalizes_ids() { + assert_eq!( + normalize_id(" e546b55b-6d21-4e86-871b-40ac35cd0d46 "), + "E546B55B6D214E86871B40AC35CD0D46" + ); + } +} diff --git a/crates/bugsplat-mcp-client/Cargo.toml b/crates/bugsplat-mcp-client/Cargo.toml new file mode 100644 index 0000000..f1996bf --- /dev/null +++ b/crates/bugsplat-mcp-client/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "bugsplat-mcp-client" +description = "A minimal Streamable HTTP client for BugSplat's hosted MCP server" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true +publish.workspace = true + +[dependencies] +bugsplat-core.workspace = true +reqwest.workspace = true +serde.workspace = true +serde_json.workspace = true +tokio.workspace = true +url.workspace = true + +[dev-dependencies] +tempfile.workspace = true +wiremock.workspace = true diff --git a/crates/bugsplat-mcp-client/src/lib.rs b/crates/bugsplat-mcp-client/src/lib.rs new file mode 100644 index 0000000..54be435 --- /dev/null +++ b/crates/bugsplat-mcp-client/src/lib.rs @@ -0,0 +1,61 @@ +//! A minimal Streamable HTTP client for BugSplat's hosted MCP server. +//! See https://github.com/BugSplat-Git/bugsplat-cli/issues/4 + +use bugsplat_core::{Error, Result}; +use serde_json::Value; +use url::Url; + +const ISSUE: &str = "https://github.com/BugSplat-Git/bugsplat-cli/issues/4"; + +#[derive(Debug, Clone, PartialEq)] +pub struct Tool { + pub name: String, + pub title: Option, + pub description: Option, + pub input_schema: Value, +} + +#[derive(Debug, Clone, PartialEq)] +pub struct ToolResult { + /// The result's text content blocks, joined with newlines. + pub text: String, + /// The result's `structuredContent`, when the server sends it. + pub structured: Option, + pub is_error: bool, + /// The whole `result` object as the server sent it. + pub raw: Value, +} + +pub struct McpClient { + _endpoint: Url, +} + +impl McpClient { + /// Runs the `initialize` handshake against `endpoint` (see `Config::mcp_url`). + /// A 401 is `Error::NotSignedIn`. + pub async fn connect(endpoint: Url, _bearer_token: &str) -> Result { + let _ = McpClient { + _endpoint: endpoint, + }; + Err(Error::NotImplemented { + command: "tool", + issue: ISSUE, + }) + } + + pub async fn list_tools(&mut self) -> Result> { + Err(Error::NotImplemented { + command: "tool list", + issue: ISSUE, + }) + } + + /// `arguments` is the tool's argument object. A result with `isError` is returned, + /// not turned into an `Err`; the caller decides how to report it. + pub async fn call_tool(&mut self, _name: &str, _arguments: Value) -> Result { + Err(Error::NotImplemented { + command: "tool call", + issue: ISSUE, + }) + } +} diff --git a/crates/bugsplat-symbols/Cargo.toml b/crates/bugsplat-symbols/Cargo.toml new file mode 100644 index 0000000..e776d98 --- /dev/null +++ b/crates/bugsplat-symbols/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "bugsplat-symbols" +description = "Find symbol files on disk by debug id or name" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true +publish.workspace = true + +[dependencies] +bugsplat-debugid.workspace = true +serde.workspace = true +thiserror.workspace = true + +[dev-dependencies] +tempfile.workspace = true diff --git a/crates/bugsplat-symbols/src/lib.rs b/crates/bugsplat-symbols/src/lib.rs new file mode 100644 index 0000000..9074c8b --- /dev/null +++ b/crates/bugsplat-symbols/src/lib.rs @@ -0,0 +1,4 @@ +//! Find symbol files on disk by debug id or name. +//! See https://github.com/BugSplat-Git/bugsplat-cli/issues/6 + +pub use bugsplat_debugid::DebugInfo; diff --git a/crates/bugsplat-upload/Cargo.toml b/crates/bugsplat-upload/Cargo.toml new file mode 100644 index 0000000..e9df74a --- /dev/null +++ b/crates/bugsplat-upload/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "bugsplat-upload" +description = "Upload symbol files to BugSplat" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true +authors.workspace = true +publish.workspace = true + +[dependencies] +bugsplat-core.workspace = true +bugsplat-debugid.workspace = true +reqwest.workspace = true +serde.workspace = true +serde_json.workspace = true +tokio.workspace = true +url.workspace = true + +[dev-dependencies] +tempfile.workspace = true +wiremock.workspace = true diff --git a/crates/bugsplat-upload/src/lib.rs b/crates/bugsplat-upload/src/lib.rs new file mode 100644 index 0000000..6cfde14 --- /dev/null +++ b/crates/bugsplat-upload/src/lib.rs @@ -0,0 +1,4 @@ +//! Upload symbol files to BugSplat, and delete a version's symbols. +//! See https://github.com/BugSplat-Git/bugsplat-cli/issues/7 + +pub use bugsplat_debugid::DebugInfo; diff --git a/scripts/localstack-token.py b/scripts/localstack-token.py new file mode 100755 index 0000000..b6e41cb --- /dev/null +++ b/scripts/localstack-token.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +"""Print an access token for a LocalStack BugSplat API, for development and tests. + +Runs the same OAuth flow `bugsplat login` uses (register a client, authorize with PKCE, +exchange the code), but posts the email and password to LocalStack's sign-in form +instead of opening a browser. LocalStack only: production has no such form. + + export BUGSPLAT_API_URL=http://localhost:8085 + export BUGSPLAT_ACCESS_TOKEN=$(scripts/localstack-token.py you@example.com 'password') +""" + +import base64 +import hashlib +import html +import http.cookiejar +import json +import re +import secrets +import sys +import urllib.error +import urllib.parse +import urllib.request + +REDIRECT = "http://127.0.0.1:33418/callback" + + +class NoRedirect(urllib.request.HTTPRedirectHandler): + def redirect_request(self, *args, **kwargs): + return None + + +def main(): + if len(sys.argv) not in (3, 4): + sys.exit("usage: localstack-token.py EMAIL PASSWORD [API_URL]") + email, password = sys.argv[1], sys.argv[2] + base = (sys.argv[3] if len(sys.argv) == 4 else "http://localhost:8085").rstrip("/") + host = urllib.parse.urlparse(base).hostname + if host not in ("localhost", "127.0.0.1", "::1"): + sys.exit("refusing to post a password to a host that is not this machine") + + opener = urllib.request.build_opener( + NoRedirect, urllib.request.HTTPCookieProcessor(http.cookiejar.CookieJar()) + ) + + def request(url, data=None, as_json=False): + headers = {} + if data is not None: + if as_json: + data, headers["Content-Type"] = json.dumps(data).encode(), "application/json" + else: + data = urllib.parse.urlencode(data).encode() + try: + response = opener.open(urllib.request.Request(url, data, headers)) + except urllib.error.HTTPError as error: + response = error + return response.status, response.headers, response.read().decode(), url + + def follow(result): + status, headers, body, url = result + while status in (301, 302, 303) and not headers["Location"].startswith(REDIRECT): + status, headers, body, url = request(urllib.parse.urljoin(url, headers["Location"])) + return status, headers, body, url + + def hidden_fields(page): + pattern = r'type="hidden" name="(\w+)" value="([^"]*)"' + return {name: html.unescape(value) for name, value in re.findall(pattern, page)} + + metadata = json.loads(request(f"{base}/.well-known/oauth-authorization-server")[2]) + client = json.loads( + request( + metadata["registration_endpoint"], + { + "client_name": "bugsplat-cli localstack-token", + "redirect_uris": [REDIRECT], + "grant_types": ["authorization_code", "refresh_token"], + "response_types": ["code"], + "token_endpoint_auth_method": "none", + }, + as_json=True, + )[2] + ) + + verifier = secrets.token_urlsafe(48) + digest = hashlib.sha256(verifier.encode()).digest() + challenge = base64.urlsafe_b64encode(digest).rstrip(b"=").decode() + query = urllib.parse.urlencode( + { + "response_type": "code", + "client_id": client["client_id"], + "redirect_uri": REDIRECT, + "code_challenge": challenge, + "code_challenge_method": "S256", + "state": secrets.token_urlsafe(16), + "resource": f"{base}/mcp", + } + ) + + status, headers, body, url = follow(request(f"{metadata['authorization_endpoint']}?{query}")) + form = {**hidden_fields(body), "email": email, "password": password} + status, headers, body, url = follow(request(url, form)) + if status == 200 and 'name="decision"' in body: + status, headers, body, url = follow( + request(url, {**hidden_fields(body), "decision": "allow"}) + ) + + location = headers.get("Location") or "" + code = urllib.parse.parse_qs(urllib.parse.urlparse(location).query).get("code", [None])[0] + if not code: + sys.exit(f"sign-in failed (HTTP {status}); check the email and password") + + token = json.loads( + request( + metadata["token_endpoint"], + { + "grant_type": "authorization_code", + "code": code, + "redirect_uri": REDIRECT, + "client_id": client["client_id"], + "code_verifier": verifier, + "resource": f"{base}/mcp", + }, + )[2] + ) + if "access_token" not in token: + sys.exit(f"token exchange failed: {token.get('error', 'unknown error')}") + print(token["access_token"]) + + +if __name__ == "__main__": + main() From 38d652b363c26aca3d148b3f2447b3d26d546f42 Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Tue, 24 Nov 2026 10:50:07 -0500 Subject: [PATCH 2/3] feat(cli): list global options under their own help heading Co-Authored-By: Claude Fable 5.2 --- crates/bugsplat-cli/src/cli.rs | 35 +++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/crates/bugsplat-cli/src/cli.rs b/crates/bugsplat-cli/src/cli.rs index 2e8e97c..9b93904 100644 --- a/crates/bugsplat-cli/src/cli.rs +++ b/crates/bugsplat-cli/src/cli.rs @@ -24,31 +24,52 @@ pub struct Cli { #[derive(Debug, Args)] pub struct GlobalArgs { /// BugSplat database. Defaults to your default database for commands that read crash data. - #[arg(short = 'b', long, global = true, env = "BUGSPLAT_DATABASE")] + #[arg( + short = 'b', + long, + global = true, + help_heading = "Global options", + env = "BUGSPLAT_DATABASE" + )] pub database: Option, /// Base URL of the BugSplat API [default: https://api.bugsplat.com] [env: BUGSPLAT_API_URL, BUGSPLAT_HOST] - #[arg(long, global = true, value_name = "URL")] + #[arg( + long, + global = true, + help_heading = "Global options", + value_name = "URL" + )] pub api_url: Option, /// OAuth Client ID for the database, for CI [env: BUGSPLAT_CLIENT_ID, SYMBOL_UPLOAD_CLIENT_ID] - #[arg(long, global = true, value_name = "ID")] + #[arg( + long, + global = true, + help_heading = "Global options", + value_name = "ID" + )] pub client_id: Option, /// OAuth Client Secret for the database, for CI [env: BUGSPLAT_CLIENT_SECRET, SYMBOL_UPLOAD_CLIENT_SECRET] - #[arg(long, global = true, value_name = "SECRET")] + #[arg( + long, + global = true, + help_heading = "Global options", + value_name = "SECRET" + )] pub client_secret: Option, /// Print JSON instead of text - #[arg(long, global = true)] + #[arg(long, global = true, help_heading = "Global options")] pub json: bool, /// Print only results and errors - #[arg(short, long, global = true)] + #[arg(short, long, global = true, help_heading = "Global options")] pub quiet: bool, /// Print more detail about what the command is doing - #[arg(long, global = true)] + #[arg(long, global = true, help_heading = "Global options")] pub verbose: bool, } From d4e6e8146abb5d76be917b79edfb6c64e0269ffd Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Tue, 24 Nov 2026 10:55:52 -0500 Subject: [PATCH 3/3] test: keep the real session store and keychain out of CLI tests Co-Authored-By: Claude Fable 5.2 --- crates/bugsplat-cli/tests/cli.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bugsplat-cli/tests/cli.rs b/crates/bugsplat-cli/tests/cli.rs index 1832dbe..b35f81c 100644 --- a/crates/bugsplat-cli/tests/cli.rs +++ b/crates/bugsplat-cli/tests/cli.rs @@ -17,6 +17,12 @@ fn bugsplat() -> Command { ] { command.env_remove(name); } + // Keep the developer's real session and keychain out of test runs. + command.env("BUGSPLAT_TOKEN_STORE", "file"); + command.env( + "BUGSPLAT_CONFIG_DIR", + std::env::temp_dir().join("bugsplat-cli-tests"), + ); command }