From a210ab86ee43dea3b4d9d0f2af5750c5a4adf096 Mon Sep 17 00:00:00 2001 From: "1992414357@qq.com" <1992414357@qq.com> Date: Fri, 13 Jun 2025 19:20:06 +0800 Subject: . --- apps/console/Cargo.lock | 1482 ++++++++++++++++++++++++++++++++++++++++++ apps/console/Cargo.toml | 16 + apps/console/src/bin/padc.rs | 742 +++++++++++++++++++++ apps/console/src/lib.rs | 1 + apps/console/src/utils.rs | 107 +++ 5 files changed, 2348 insertions(+) create mode 100644 apps/console/Cargo.lock create mode 100644 apps/console/Cargo.toml create mode 100644 apps/console/src/bin/padc.rs create mode 100644 apps/console/src/lib.rs create mode 100644 apps/console/src/utils.rs (limited to 'apps/console') diff --git a/apps/console/Cargo.lock b/apps/console/Cargo.lock new file mode 100644 index 0000000..17c623e --- /dev/null +++ b/apps/console/Cargo.lock @@ -0,0 +1,1482 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +dependencies = [ + "anstyle", + "once_cell", + "windows-sys 0.59.0", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "bincode" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" +dependencies = [ + "bincode_derive", + "serde", + "unty", +] + +[[package]] +name = "bincode_derive" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" +dependencies = [ + "virtue", +] + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4ac86a9e5bc1e2b3449ab9d7d3a6a405e3d1bb28d7b9be8614f55846ae3766" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "clap" +version = "4.5.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "clearscreen" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c41dc435a7b98e4608224bbf65282309f5403719df9113621b30f8b6f74e2f4" +dependencies = [ + "nix", + "terminfo", + "thiserror 2.0.12", + "which", + "windows-sys 0.59.0", +] + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csv" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" +dependencies = [ + "memchr", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "env_home" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" + +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "hashbrown" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "humantime" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nogamepads-console" +version = "0.1.0" +dependencies = [ + "clap", + "nogamepads-core", + "prettytable-rs", + "rand 0.9.1", + "rpassword", + "serde", + "serde_yaml", +] + +[[package]] +name = "nogamepads-core" +version = "0.1.0" +dependencies = [ + "bincode", + "chrono", + "clap", + "clearscreen", + "env_logger", + "hex", + "log", + "serde", + "sha1", + "shell-words", + "tokio", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettytable-rs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eea25e07510aa6ab6547308ebe3c036016d162b8da920dbb079e3ba8acf3d95a" +dependencies = [ + "csv", + "encode_unicode", + "is-terminal", + "lazy_static", + "term", + "unicode-width", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "redox_syscall" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rpassword" +version = "7.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d4c8b64f049c6721ec8ccec37ddfc3d641c4a7fca57e8f2a89de509c73df39" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.59.0", +] + +[[package]] +name = "rtoolbox" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cc970b249fbe527d6e02e0a227762c9108b2f49d81094fe357ffc6d14d7f6f" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" + +[[package]] +name = "socket2" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminfo" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662" +dependencies = [ + "fnv", + "nom", + "phf", + "phf_codegen", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio" +version = "1.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "virtue" +version = "0.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "which" +version = "7.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d643ce3fd3e5b54854602a080f34fb10ab75e0b813ee32d00ca2b44fa74762" +dependencies = [ + "either", + "env_home", + "rustix", + "winsafe", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +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.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[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 = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/apps/console/Cargo.toml b/apps/console/Cargo.toml new file mode 100644 index 0000000..8eef70d --- /dev/null +++ b/apps/console/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "nogamepads-console" +description = "This crate provides a set of tools for simulating and deploying the client and server of the NoGamepads library." +edition = "2024" +version.workspace = true + +[dependencies] +nogamepads = { path = "../../../NoGamepads" } +nogamepads-core = { path = "../../core" } +clap = { version = "4.5.38", features = ["derive"] } +clap_complete = "4.5.52" +serde = { version = "1.0.219", features = ["derive"] } +serde_yaml = "0.9.34" +tokio = { version = "1.45.0", features = ["full"] } +crossterm = "0.29.0" +log = "0.4.27" \ No newline at end of file diff --git a/apps/console/src/bin/padc.rs b/apps/console/src/bin/padc.rs new file mode 100644 index 0000000..e44f0f9 --- /dev/null +++ b/apps/console/src/bin/padc.rs @@ -0,0 +1,742 @@ +use clap::{Args, ColorChoice, CommandFactory, Parser, Subcommand}; +use nogamepads::string_utils::process_id_text; +use nogamepads_console::utils::{confirm, read_password, read_password_and_confirm}; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::env::current_dir; +use std::fs::File; +use std::io; +use std::io::{BufReader, Write}; +use std::net::SocketAddr; +use std::path::PathBuf; +use std::process::exit; +use std::str::FromStr; +use std::sync::{Arc, Mutex}; +use std::sync::atomic::Ordering::SeqCst; +use std::time::Duration; +use clap_complete::{generate, Shell}; +use log::{info, LevelFilter}; +use tokio::{select, spawn}; +use tokio::signal::ctrl_c; +use tokio::time::sleep; +use nogamepads::entry_mutex; +use nogamepads::logger_utils::logger_build; +use nogamepads_core::data::controller::controller_cli::{process_controller_cli, ControllerCli}; +use nogamepads_core::data::controller::controller_data::ControllerData; +use nogamepads_core::data::game::game_cli::{process_game_cli, GameCli}; +use nogamepads_core::data::game::game_data::{GameData, GameRuntimeDataArchive}; +use nogamepads_core::data::player::player_data::Player; +use nogamepads_core::service::cli_addition::runtime_consoles::RuntimeConsole; +use nogamepads_core::service::service_runner::{NoGamepadsService, ServiceRunner}; +use nogamepads_core::service::tcp_network::DEFAULT_PORT; +use nogamepads_core::service::tcp_network::pad_client::pad_client_service::PadClientNetwork; +use nogamepads_core::service::tcp_network::pad_server::pad_server_service::PadServerNetwork; +use nogamepads_core::service::tcp_network::utils::tokio_utils::build_tokio_runtime; + +#[derive(Parser, Debug)] +#[command(version, color = ColorChoice::Auto)] +struct Padc { + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand, Debug)] +enum Commands { + + GenerateCompletion { + #[arg(value_enum)] + shell: Shell, + }, + + #[command(subcommand, about = "Manage accounts")] + Account(AccountCommands), + + #[command(about = "List accounts")] + Accounts, + + #[command(subcommand, about = "Manage game infos")] + Game(GameCommands), + + #[command(about = "List all games")] + Games, + + #[command(about = "Connect to a service")] + Connect(ConnectArgs), + + #[command(about = "Start a service")] + Listen(ListenArgs) +} + +#[derive(Subcommand, Debug)] +enum AccountCommands { + + #[command(about = "Add a account")] + Add(AccountArgs), + + #[command(about = "Remove a account")] + Remove(AccountArgs), + + #[command(about = "Edit the profile of account")] + Edit(EditAccountArgs) +} + +#[derive(Args, Debug)] +struct AccountArgs{ + + #[arg(value_name = "Account")] + account: String, + + #[arg(short, long, value_name = "Password")] + password: Option +} + +#[derive(Args, Debug)] +struct EditAccountArgs{ + + #[arg(value_name = "Account")] + account: String, + + #[arg(short, long, help = "Nickname")] + nickname: Option, + + #[arg(short = 'c', long = "color", num_args = 3, value_names = ["H", "S", "V"], help = "Player color, h(0 - 360), s(0 - 1), v(0 - 1)")] + color: Option> +} + +#[derive(Subcommand, Debug)] +enum GameCommands { + + #[command(about = "Add a game")] + Add(GameArgs), + + #[command(about = "Remove a game")] + Remove(GameArgs), + + #[command(about = "Edit the profile of game")] + Edit(EditGameArgs), + + #[command(subcommand, about = "Register keys to game")] + Register(RegisterKeysCommands) +} + +#[derive(Args, Debug)] +struct GameArgs { + + #[arg(value_name = "Game Name")] + name: String, + + #[arg(short, long)] + confirm: bool +} + +#[derive(Args, Debug)] +struct EditGameArgs { + + #[arg(value_name = "Game Name")] + name: String, + + #[arg(value_name = "Key")] + key: String, + + #[arg(value_name = "Value")] + value: String, +} + +#[derive(Subcommand, Debug)] +enum RegisterKeysCommands { + + #[command(subcommand, about = "Register a button")] + Button(KeyManageCommands), + + #[command(subcommand, about = "Register a axis")] + Axis(KeyManageCommands), + + #[command(subcommand, about = "Register a direction")] + Direction(KeyManageCommands) +} + +#[derive(Subcommand, Debug)] +enum KeyManageCommands { + + #[command(about = "Add or rename a key")] + Add(AddKeyArgs), + + #[command(about = "Remove a key")] + Remove(RemoveKeyArgs), + + #[command(about = "List all")] + List(ListKeyArgs) +} + +#[derive(Args, Debug)] +struct AddKeyArgs{ + + #[arg(value_name = "Game Name")] + name: String, + + #[arg(value_name = "Key")] + key: u8, + + #[arg(value_name = "Name")] + key_name: String +} + +#[derive(Args, Debug)] +struct RemoveKeyArgs{ + + #[arg(value_name = "Game Name")] + name: String, + + #[arg(value_name = "Key")] + key: u8, +} + +#[derive(Args, Debug)] +struct ListKeyArgs{ + + #[arg(value_name = "Game Name")] + name: String +} + +#[derive(Args, Debug)] +struct ConnectArgs { + + #[arg(short, long, value_name = "Account")] + account: Option, + + #[arg(short, long, value_name = "Address")] + tcp_addr: Option, + + #[arg(short, long, value_name = "Methods")] + method: Option, + + #[arg(long)] + cmd: bool, + + #[arg(long)] + debug: bool, +} + +#[derive(Args, Debug, Clone)] +struct ListenArgs { + + #[arg(value_name = "Game")] + game: String, + + #[arg(short = 'a', long, value_name = "Address")] + tcp_addr: Option, + + #[arg(long)] + cmd: bool, + + #[arg(long)] + tcp: bool, + + #[arg(long)] + bluetooth: bool, + + #[arg(long)] + usb: bool, + + #[arg(long)] + debug: bool, +} + +#[derive(Default, Serialize, Deserialize, PartialEq, Debug)] +struct LocalData { + game_data: LocalGameData, + controller_data: LocalControllerData, +} + +#[derive(Default, Serialize, Deserialize, PartialEq, Debug)] +struct LocalGameData { + games: HashMap +} + +#[derive(Default, Serialize, Deserialize, PartialEq, Debug)] +struct LocalControllerData { + players: HashMap +} + +fn main () { + let cli = Padc::parse(); + + let mut data = read(); + + match cli.command { + Commands::GenerateCompletion {shell} => { + let cmd = Padc::command(); + generate(shell, &mut cmd.clone(), "padc", &mut io::stdout()); + } + + Commands::Account(cmds) => { + match cmds { + AccountCommands::Add(args) => { + add_player(&mut data, args.account, args.password); + } + + AccountCommands::Remove(args) => { + remove_player(&mut data, args.account, args.password); + } + + AccountCommands::Edit(args) => { + edit_player(&mut data, args); + } + } + } + + Commands::Accounts => { + for player in data.controller_data.players.values() { + let id = &player.account.id; + if player.customize.is_some() { + let nickname = &player.clone().customize.unwrap().nickname; + println!("{}({})", id, nickname); + } else { + println!("{}", id); + } + } + } + + Commands::Game(cmds) => { + match cmds { + GameCommands::Add(args) => { + let name = process_id_text(args.name); + data.game_data.games.entry(name.clone()) + .or_insert_with(GameData::default); + println!("Game configuration added or reset: \"{}\"", name.clone()); + } + + GameCommands::Remove(args) => { + if ! args.confirm { + if ! confirm("Confirm ") { + exit(1); + } + } + + let name = process_id_text(args.name); + let game = data.game_data.games.remove(&name); + if game.is_none() { + eprintln!("Removal of the game \"{}\" failed: game not found.", name.clone()); + } else { + println!("The game \"{}\" has been removed.", name.clone()); + } + } + + GameCommands::Edit(args) => { + let name = process_id_text(args.name); + let game = data.game_data.games.get_mut(&name); + if game.is_none() { + eprintln!("Edit the game \"{}\" failed: game not found.", name.clone()); + } else { + let game = game.unwrap(); + game.info(args.key.clone(), args.value.clone()); + println!("Set the game info \"{}\" to \"{}\".", args.key, args.value); + } + } + + GameCommands::Register(cmds) => { + match cmds { + RegisterKeysCommands::Button(cmds) => { + manage_keys(&mut data, cmds, + |game| &mut game.control.button_keys); + } + + RegisterKeysCommands::Axis(cmds) => { + manage_keys(&mut data, cmds, + |game| &mut game.control.axis_keys); + } + + RegisterKeysCommands::Direction(cmds) => { + manage_keys(&mut data, cmds, + |game| &mut game.control.direction_keys); + } + } + } + } + } + + Commands::Games => { + for (key, _) in data.game_data.games.iter() { + println!("{}", key); + } + } + + Commands::Connect(args) => { + connect(&mut data, args); + } + + Commands::Listen(args) => { + let archive = listen(&mut data, args.clone()); + if let Some(archive) = archive { + if let Some(game) = data.game_data.games.get_mut(&process_id_text(args.game)) { + game.archive = archive; + info!("Game data archived."); + } + } + } + } + + write(data); +} + +fn connect(data: &mut LocalData, args: ConnectArgs) { + + let mut result: Option<&Player> = None; + if args.account.is_some() { + // Account specified + let id = &args.account.unwrap(); + let player = data.controller_data.players.get(id); + + // Account not found + if player.is_none() { + eprintln!("Account not found: \"{}\"", id); + exit(1); + } else { + // Account exists + result = Some(player.unwrap()); + } + } else { + // Account not specified + for found in data.controller_data.players.values() { + // Found a replaceable account + result = Some(found); + println!("Account not specified! Using account \"{}\" instead!", found.account.id); + break; + } + // No replaceable account found + if result.is_none() { + eprintln!("Cannot find any replaceable account! Please ensure at least one account exists locally!"); + exit(1); + } + } + + let player = result.unwrap().clone(); + + let mut controller = ControllerData::default(); + controller.bind_player(player); + + let runtime = controller.runtime(); + + let method = args.method.unwrap_or("tcp".to_string()); + let mut entry: Option = None; + + match method.trim().to_lowercase().as_str() { + "tcp" => { + println!("Using TCP connection."); + let mut client = PadClientNetwork::build(Arc::clone(&runtime)); + let addr = args.tcp_addr.unwrap_or(format!("127.0.0.1:{}", DEFAULT_PORT)); + client.bind_addr(SocketAddr::from_str(&addr).unwrap_or( + SocketAddr::from(([127, 0, 0, 1], DEFAULT_PORT)), + )); + + entry = Some(client.build_entry()); + }, + + "bluetooth" => { + println!("Using Bluetooth connection."); + // TODO :: BLUETOOTH METHOD + }, + + "usb" => { + println!("Using USB connection."); + // TODO :: USB METHOD + }, + + _ => { + eprintln!("Unknown connection method: \"{}\"", method); + exit(1); + } + } + + if let Some(entry) = entry { + let mut services = Vec::new(); + services.push(entry); + + if args.cmd { + println!("Enable command line."); + + services.push(RuntimeConsole::build( + ControllerCli::command(), "ControllerCli".to_string(), Arc::clone(&runtime), + + // Process command line + |runtime, cmd| { + process_controller_cli(runtime, cmd) + }, + + // Check close + |runtime| { + let mut close = false; + entry_mutex!(runtime, |guard| { + close = guard.close.load(SeqCst); + }); + close + }, + + // Close + |runtime| { + entry_mutex!(runtime, |guard| { + guard.close(); + }); + }, + + ).build_entry()); + } + + if args.debug { + logger_build(LevelFilter::Trace); + } else { + logger_build(LevelFilter::Info); + } + + ServiceRunner::run(services); + } +} + +fn listen(data: &mut LocalData, args: ListenArgs) -> Option { + let id = process_id_text(args.game); + let game = data.game_data.games.get(&id); + if game.is_none() { + eprintln!("Game not found: \"{}\"", id); + exit(1); + } + + let game_data = game.unwrap().clone(); + + let runtime = game_data.runtime(); + + let mut services = Vec::new(); + + if args.tcp { + let mut server = PadServerNetwork::build(Arc::clone(&runtime)); + if args.tcp_addr.is_some() { + let addr = SocketAddr::from_str(&args.tcp_addr.unwrap()) + .unwrap_or(SocketAddr::from(([127, 0, 0, 1], DEFAULT_PORT))); + server.bind_ip(addr.ip()); + server.bind_port(addr.port()); + } + services.push(server.build_entry()); + println!("Setup TCP Service!") + } + + if args.bluetooth { + + } + + if args.usb { + + } + + if args.cmd { + services.push(RuntimeConsole::build( + GameCli::command(), "GameCli".to_string(), Arc::clone(&runtime), + + // Process command line + |runtime, cmd| { + process_game_cli(runtime, cmd) + }, + + // Check close + |runtime| { + let mut close = false; + entry_mutex!(runtime, |guard| { + close = guard.data.close.load(SeqCst); + }); + close + }, + + // Close + |runtime| { + entry_mutex!(runtime, |guard| { + guard.close_game(); + }); + }, + + ).build_entry()); + } + + if args.debug { + logger_build(LevelFilter::Trace); + } else { + logger_build(LevelFilter::Info); + } + + ServiceRunner::run(services); + + let mut archived_data: Option = None; + if let Ok(mutex) = Arc::try_unwrap(runtime) { + let rt = mutex.into_inner() + .unwrap_or_else(|poison_error| poison_error.into_inner()); + archived_data = Some(GameRuntimeDataArchive::from(rt.data)); + } + archived_data +} + +fn add_player(data: &mut LocalData, account_args: String, password_args: Option) { + if data.controller_data.players.contains_key(process_id_text(account_args.clone()).as_str()) { + eprintln!("This account already exists. Please do not create it again."); + exit(1); + } else { + // Read password + let mut password = "".to_string(); + if password_args.is_none() { + let input = read_password_and_confirm("Enter password: ", "Confirm: "); + if input.is_some() { + password = input.unwrap(); + } + } else if password_args.is_some() { + password = password_args.unwrap(); + } + + // Create player + let player = Player::register(account_args, password); + let player_key = player.clone().account.id; + + data.controller_data.players.insert(player_key, player.clone()); + } +} + +fn remove_player(data: &mut LocalData, account_args: String, password_args: Option) { + // Read password + let mut password = "".to_string(); + if password_args.is_none() { + password = read_password("Enter password: ").unwrap_or("".to_string()); + } else if password_args.is_some() { + password = password_args.unwrap(); + } + + // Remove + let player_id = process_id_text(account_args.clone()); + + let player = data.controller_data.players.get(&player_id); + if player.is_none() { + eprintln!("Failed to remove account \"{}\": Account not found.", account_args.clone()); + exit(1); + } + let player = player.unwrap(); + + if player.check(password.clone()) { + data.controller_data.players.remove(player_id.as_str()); + println!("The account \"{}\" has been removed!", player_id); + } else { + eprintln!("Failed to remove account \"{}\": Password is incorrect!", player_id) + } +} + +fn edit_player(data: &mut LocalData, args: EditAccountArgs) { + let account_id = process_id_text(args.account); + if ! data.controller_data.players.contains_key(&account_id) { + eprintln!("Edit failed: Account \"{}\" not found!", account_id); + exit(1); + } + + let player = data.controller_data.players.get_mut(&account_id).unwrap(); + + if args.nickname.is_some() { + let nickname = args.nickname.unwrap(); + player.nickname(&nickname); + println!("Change the nickname of account \"{}\" to \"{}\"", account_id, &nickname); + } + + if args.color.is_some() { + let color = args.color.unwrap(); + let hue = color[0].round().clamp(0.0, 360.0); + let sat = color[1].clamp(0.0, 1.0); + let val = color[2].clamp(0.0, 1.0); + player.hsv(hue as i32, sat, val); + println!("Change the color of account \"{}\" to \"{}\"", account_id, hsv_to_hex(hue as i32, sat, val)); + } +} + +macro_rules! check_game { + ($data:expr, $args:expr, |$game:ident| $code:block) => { + let name = process_id_text($args.name); + let game = $data.game_data.games.get_mut(&name); + if game.is_none() { + eprintln!("Edit the game \"{}\" failed: game not found.", name.clone()); + exit(1); + } else { + let $game = game.unwrap(); + $code + } + }; +} + +fn manage_keys(data: &mut LocalData, cmds: KeyManageCommands, get_map: fn(game: &mut GameData) -> &mut HashMap) { + match cmds { + KeyManageCommands::Add(args) => { + check_game!(data, args, |game| { + get_map(game).entry(args.key) + .or_insert_with(|| args.key_name.clone()); + println!("Registered key \"{}\"", args.key_name); + }); + } + + KeyManageCommands::Remove(args) => { + check_game!(data, args, |game| { + let result = get_map(game).remove(&args.key); + if result.is_some() { + println!("Removed key \"{}\"", result.unwrap()); + } + }); + } + + KeyManageCommands::List(args) => { + check_game!(data, args, |game| { + for (key, key_name) in get_map(game).iter() { + println!("{} - \"{}\"", key, key_name); + } + }); + } + } +} + +fn local_config() -> PathBuf { + current_dir().unwrap().join("../../../../nogamepads.yaml") +} + +fn read() -> LocalData { + let file_path = local_config(); + + if ! file_path.exists() { + let data = LocalData::default(); + let content = serde_yaml::to_string(&data).unwrap(); + File::create(&file_path).unwrap().write_all(content.as_bytes()).unwrap(); + data + } else { + let file = File::open(&file_path).unwrap(); + let reader = BufReader::new(file); + serde_yaml::from_reader(reader).unwrap() + } +} + +fn write(config: LocalData) { + let file_path = local_config(); + let content = serde_yaml::to_string(&config).unwrap(); + + File::create(file_path).unwrap().write_all(content.as_bytes()).unwrap(); +} + +fn hsv_to_hex(h: i32, s: f64, v: f64) -> String { + let h = (h as f64).clamp(0.0, 360.0); + let s = s.clamp(0.0, 1.0); + let v = v.clamp(0.0, 1.0); + + let c = v * s; + let x = c * (1.0 - ((h / 60.0) % 2.0 - 1.0).abs()); + let m = v - c; + + let (r, g, b) = match (h / 60.0) as usize { + 0 => (c, x, 0.0), + 1 => (x, c, 0.0), + 2 => (0.0, c, x), + 3 => (0.0, x, c), + 4 => (x, 0.0, c), + 5 => (c, 0.0, x), + _ => (0.0, 0.0, 0.0), + }; + + let r = ((r + m) * 255.0).round() as u8; + let g = ((g + m) * 255.0).round() as u8; + let b = ((b + m) * 255.0).round() as u8; + format!("#{:02X}{:02X}{:02X}", r, g, b) +} \ No newline at end of file diff --git a/apps/console/src/lib.rs b/apps/console/src/lib.rs new file mode 100644 index 0000000..fab870e --- /dev/null +++ b/apps/console/src/lib.rs @@ -0,0 +1 @@ +pub mod utils; \ No newline at end of file diff --git a/apps/console/src/utils.rs b/apps/console/src/utils.rs new file mode 100644 index 0000000..1e65f0e --- /dev/null +++ b/apps/console/src/utils.rs @@ -0,0 +1,107 @@ +use std::io::{self, Read, Write}; +use crossterm::terminal; +use tokio::task; + +pub fn read_password(prompt: &str) -> Option { + print!("{}", prompt); + io::stdout().flush().unwrap(); + + let raw_mode_enabled = terminal::enable_raw_mode().is_ok(); + if !raw_mode_enabled { + eprintln!("Warning: Password will be displayed in plain text"); + } + + let mut buffer = Vec::new(); + loop { + let mut byte = [0]; + if io::stdin().read(&mut byte).is_err() || byte[0] == b'\n' || byte[0] == b'\r' { + break; + } + + match byte[0] { + 8 | 127 => { + if buffer.pop().is_some() { + print!("\x08 \x08"); + io::stdout().flush().unwrap(); + } + } + 3 => { + println!(); + return None; + } + _ => { + buffer.push(byte[0]); + print!("*"); + io::stdout().flush().unwrap(); + } + } + } + + if raw_mode_enabled { + terminal::disable_raw_mode().unwrap(); + } + println!(); + + Some(String::from_utf8_lossy(&buffer).into_owned()) +} + +pub fn read_password_and_confirm( + prompt: &str, + confirm_prompt: &str +) -> Option { + loop { + let pw1 = read_password(prompt).unwrap(); + let pw2 = read_password(confirm_prompt).unwrap(); + + if pw1 == pw2 { + return Some(pw1); + } + eprintln!("The passwords entered twice do not match, please try again."); + } +} + +pub fn confirm(prompt: &str) -> bool { + let prompt = format!("{} [Y/n]: ", prompt); + loop { + let input = read_password(&prompt).unwrap_or_default(); + match input.to_lowercase().as_str() { + "y" | "yes" | "" => return true, + "n" | "no" => return false, + _ => eprintln!("Invalid input, please enter Y or n."), + } + } +} + +pub async fn read_password_async(prompt: &str) -> Option { + let prompt = prompt.to_owned(); + task::spawn_blocking(move || read_password(&prompt)) + .await + .unwrap_or_else(|_| None) +} + +pub async fn read_password_and_confirm_async( + prompt: &str, + confirm_prompt: &str +) -> Option { + loop { + let pw1 = read_password_async(prompt).await.unwrap(); + let pw2 = read_password_async(confirm_prompt).await.unwrap(); + + if pw1 == pw2 { + return Some(pw1); + } + eprintln!("The passwords entered twice do not match, please try again."); + } +} + +pub async fn confirm_async(prompt: &str) -> bool { + let prompt = format!("{} [Y/n]: ", prompt); + loop { + let input = read_password_async(&prompt).await.unwrap_or_default(); + match input.to_lowercase().as_str() { + "y" | "yes" | "" => return true, + "n" | "no" => return false, + _ => eprintln!("Invalid input, please enter Y or n."), + } + } +} \ No newline at end of file -- cgit