From 6c33bcfb27ce9f2be592184061b3b1351cc6e708 Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Sun, 2 Aug 2026 18:30:34 +0000 Subject: [PATCH] Checkpoint --- .devcontainer/devcontainer.json | 31 + Cargo.lock | 3875 +++++++++++++++++ Cargo.toml | 3 + README.md | 2 +- nye-console/Cargo.toml | 9 + nye-console/src/lib.rs | 305 ++ nye-daemon/Cargo.toml | 15 + nye-daemon/src/args.rs | 8 + nye-daemon/src/commands/mod.rs | 1 + nye-daemon/src/commands/setup.rs | 84 + nye-daemon/src/db/mod.rs | 0 nye-daemon/src/listener.rs | 106 + nye-daemon/src/main.rs | 58 + nye-daemon/src/utils.rs | 51 + nye-package/Cargo.toml | 12 + nye-package/src/installable/manifest.rs | 47 + nye-package/src/installable/mod.rs | 3 + nye-package/src/lib.rs | 6 + nye-package/src/project/manifest.rs | 135 + nye-package/src/project/mod.rs | 146 + nye-package/src/shared.rs | 56 + nye-package/test-package/Nye.toml | 19 + .../test-package/shared/bin/shared-binary | 2 + .../test-package/x86/bin/exposed-binary | 2 + .../test-package/x86/bin/exposed-binary-x86 | 2 + nye-package/test-package/x86/bin/not-exposed | 2 + .../test-package/x86_64/bin/exposed-binary | 2 + .../x86_64/bin/exposed-binary-x86_64 | 2 + .../test-package/x86_64/bin/not-exposed | 2 + nye-terminal/Cargo.lock | 554 +++ nye-terminal/Cargo.toml | 18 + nye-terminal/src/args.rs | 47 + nye-terminal/src/commands/bundle.rs | 7 + nye-terminal/src/commands/install.rs | 7 + nye-terminal/src/commands/mod.rs | 3 + nye-terminal/src/commands/setup.rs | 31 + nye-terminal/src/main.rs | 39 + nye-wire-protocol/Cargo.toml | 12 + nye-wire-protocol/src/lib.rs | 550 +++ nye-wire-protocol/src/messages.rs | 105 + rustfmt.toml | 2 + 41 files changed, 6360 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 nye-console/Cargo.toml create mode 100644 nye-console/src/lib.rs create mode 100644 nye-daemon/Cargo.toml create mode 100644 nye-daemon/src/args.rs create mode 100644 nye-daemon/src/commands/mod.rs create mode 100644 nye-daemon/src/commands/setup.rs create mode 100644 nye-daemon/src/db/mod.rs create mode 100644 nye-daemon/src/listener.rs create mode 100644 nye-daemon/src/main.rs create mode 100644 nye-daemon/src/utils.rs create mode 100644 nye-package/Cargo.toml create mode 100644 nye-package/src/installable/manifest.rs create mode 100644 nye-package/src/installable/mod.rs create mode 100644 nye-package/src/lib.rs create mode 100644 nye-package/src/project/manifest.rs create mode 100644 nye-package/src/project/mod.rs create mode 100644 nye-package/src/shared.rs create mode 100644 nye-package/test-package/Nye.toml create mode 100644 nye-package/test-package/shared/bin/shared-binary create mode 100644 nye-package/test-package/x86/bin/exposed-binary create mode 100644 nye-package/test-package/x86/bin/exposed-binary-x86 create mode 100644 nye-package/test-package/x86/bin/not-exposed create mode 100644 nye-package/test-package/x86_64/bin/exposed-binary create mode 100644 nye-package/test-package/x86_64/bin/exposed-binary-x86_64 create mode 100644 nye-package/test-package/x86_64/bin/not-exposed create mode 100644 nye-terminal/Cargo.lock create mode 100644 nye-terminal/Cargo.toml create mode 100644 nye-terminal/src/args.rs create mode 100644 nye-terminal/src/commands/bundle.rs create mode 100644 nye-terminal/src/commands/install.rs create mode 100644 nye-terminal/src/commands/mod.rs create mode 100644 nye-terminal/src/commands/setup.rs create mode 100644 nye-terminal/src/main.rs create mode 100644 nye-wire-protocol/Cargo.toml create mode 100644 nye-wire-protocol/src/lib.rs create mode 100644 nye-wire-protocol/src/messages.rs create mode 100644 rustfmt.toml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f5bc98f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/rust +{ + "name": "Rust", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/rust:2-1-trixie", + + // Use 'mounts' to make the cargo cache persistent in a Docker Volume. + // "mounts": [ + // { + // "source": "devcontainer-cargo-cache-${devcontainerId}", + // "target": "/usr/local/cargo", + // "type": "volume" + // } + // ] + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "rustup component add rustfmt --toolchain nightly", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root" +} diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..ca06835 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3875 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aegis" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58541132f980da31e9aa99f7bdee69bc84bf1e168b9b91ef2dbe8abb7b4ce5dd" +dependencies = [ + "cc", + "softaes", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures 0.2.17", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "allocator-api2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c880a97d28a3681c0267bd29cff89621202715b065127cd445fa0f0fe0aa2880" + +[[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 = "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 = "antithesis_sdk" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08410fcac93669a476c006cd6c4512ac1e2b30fd117231a5d55d8a2c76599b82" +dependencies = [ + "libc", + "libloading", + "linkme", + "once_cell", + "rand 0.8.7", + "rustc_version_runtime", + "serde", + "serde_json", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "arc-swap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b" +dependencies = [ + "rustversion", +] + +[[package]] +name = "aristo" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdeefa800110050103e2459a2f8dbdbd560ad046e30f1f87e24ce19c2cb8bde" +dependencies = [ + "aristo-macros", +] + +[[package]] +name = "aristo-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64a66d21a80182b35b1741997a6d2456911f54b7eb1918aa4e2382fc205268d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "arrayvec" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" + +[[package]] +name = "assoc" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdc70193dadb9d7287fa4b633f15f90c876915b31f6af17da307fc59c9859a8" + +[[package]] +name = "async-trait" +version = "0.1.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bigdecimal" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d6867f1565b3aad85681f1015055b087fcfd840d6aeee6eee7f2da317603695" +dependencies = [ + "autocfg", + "libm", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex 1.3.0", + "syn 2.0.119", + "which", +] + +[[package]] +name = "bit-set" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "bitcode" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6ed1b54d8dc333e7be604d00fa9262f4635485ffea923647b6521a5fff045d" +dependencies = [ + "arrayvec", + "bitcode_derive", + "bytemuck", + "glam", + "serde", +] + +[[package]] +name = "bitcode_derive" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "238b90427dfad9da4a9abd60f3ec1cdee6b80454bde49ed37f1781dd8e9dc7f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "bitpacking" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a7139abd3d9cebf8cd6f920a389cf3dc9576172e32f4563f188cae3c3eb019" +dependencies = [ + "crunchy", +] + +[[package]] +name = "bitvec" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddcec3d12c579d40898fe0a9a358a803c23e9c52ca3c425707f81c9436211837" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "bon" +version = "3.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a602c73c7b0148ec6d12af6fd5cc7a46e2eacc8878271a999abac56eed12f561" +dependencies = [ + "bon-macros", + "rustversion", +] + +[[package]] +name = "bon-macros" +version = "3.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dee98b0db6a962de883bf5d20362dee4d7ca0d12fe39a7c6c73c844e1cd7c1f" +dependencies = [ + "darling", + "ident_case", + "prettyplease", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.119", +] + +[[package]] +name = "borsh" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88b7ea17d208c4193f2c1e6de3c35fe71f98c96982d5ced308bdcc749ff6e1f" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8f347189c62a579b8cd5f80714efa178f52e461dc2e6d701d264f5ff22e566c" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "branches" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fba76cd916045514e3064707df9ed5282b94419444c2753a6c62ecaf458e56" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f65693059b6b9c588b9f62fed1cedbf0a8b805631457ea162d68f0de186f3de5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cc" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex 2.0.1", +] + +[[package]] +name = "census" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "cfg_block" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18758054972164c3264f7c8386f5fc6da6114cb46b619fd365d4e3b2dc3ae487" + +[[package]] +name = "chacha20" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.1", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clang-sys" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301b56658598e48f3648647ac6fc887be7e7108eddfa4e9b63fcf3ec58c0cadf" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a65403d1a1bd28f7dc68eb8506e8874808ee5eecb59298de588e2e1407a078" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", + "terminal_size", +] + +[[package]] +name = "clap_derive" +version = "4.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "colored" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe5f465a4f6fee88fad41b85d990f84c835335e85b5d9e6e63e0d06d28cba7c" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width 0.2.2", + "windows-sys 0.61.2", +] + +[[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 = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32c" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "darling" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.119", +] + +[[package]] +name = "darling_macro" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "datasketches" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c286de4e81ea2590afc24d754e0f83810c566f50a1388fa75ebd57928c0d9745" + +[[package]] +name = "deadpool" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883466cb8db62725aee5f4a6011e8a5d42912b42632df32aad57fc91127c6e04" +dependencies = [ + "deadpool-runtime", + "num_cpus", + "tokio", +] + +[[package]] +name = "deadpool-runtime" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2657f61fb1dd8bf37a8d51093cc7cee4e77125b22f7753f49b289f831bec2bae" +dependencies = [ + "tokio", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "serde_core", +] + +[[package]] +name = "dialoguer" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25f104b501bf2364e78d0d3974cbc774f738f5865306ed128e1e0d7499c0ad96" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + +[[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.3", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "downcast-rs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" + +[[package]] +name = "either" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "env_filter" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6" +dependencies = [ + "env_filter", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fastbloom" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7f34442dbe69c60fe8eaf58a8cafff81a1f278816d8ab4db255b3bef4ac3c4" +dependencies = [ + "getrandom 0.3.4", + "libm", + "siphasher", +] + +[[package]] +name = "fastdivide" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afc2bd4d5a73106dd53d10d73d3401c2f32730ba2c0b93ddb888a8983680471" + +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs4" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8640e34b88f7652208ce9e88b1a37a2ae95227d84abec377ccd3c5cfeb141ed4" +dependencies = [ + "rustix 1.1.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures-core" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" + +[[package]] +name = "futures-macro" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "futures-task" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" + +[[package]] +name = "futures-util" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "genawaiter" +version = "0.99.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86bd0361bcbde39b13475e6e36cb24c329964aa2611be285289d1e4b751c1a0" +dependencies = [ + "genawaiter-macro", +] + +[[package]] +name = "genawaiter-macro" +version = "0.99.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b32dfe1fdfc0bbde1f22a5da25355514b5e450c33a6af6770884c8750aedfbc" + +[[package]] +name = "generator" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3b854b0e584ead1a33f18b2fcad7cf7be18b3875c78816b753639aa501513ae" +dependencies = [ + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows-link", + "windows-result", +] + +[[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.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.1", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "glam" +version = "0.33.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f22fb22f065b308be0d8724e3706c7fa3fc2a6c7d6899df4cad7860e7a75436" + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2 0.2.21", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "allocator-api2 0.2.21", + "equivalent", + "foldhash", +] + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "home" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "htmlescape" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +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 = "icu_collator" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bbdf98e5e0aa827770acee171ebb568aaab975a36b56afdb5fd0e2f525750bb" +dependencies = [ + "icu_collator_data", + "icu_collections", + "icu_locale", + "icu_locale_core", + "icu_normalizer", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "zerovec", +] + +[[package]] +name = "icu_collator_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038ed8e5817f2059c2f3efb0945ba78d060d3d25e8f1a1bea5139f821a21a2f0" + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5a396343c7208121dc86e35623d3dfe19814a7613cfd14964994cdc9c9a2e26" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_locale_data", + "icu_provider", + "potential_utf", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "serde", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locale_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fdcc9ac77c6d74ff5cf6e65ef3181d6af32003b16fce3a77fb451d2f695993" + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "serde", + "stable_deref_trait", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[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 = "index_vec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44faf5bb8861a9c72e20d3fb0fdbd59233e43056e2b80475ab0aacdc2e781355" + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", +] + +[[package]] +name = "indicatif" +version = "0.18.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9433806cd6b4ec1aba79c021c7e4c58fb4c3b9977c085062e611ac929998fb0c" +dependencies = [ + "console", + "portable-atomic", + "tokio", + "unicode-width 0.2.2", + "unit-prefix", + "web-time", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "intrusive-collections" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86" +dependencies = [ + "memoffset", +] + +[[package]] +name = "inventory" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" +dependencies = [ + "rustversion", +] + +[[package]] +name = "io-uring" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9080b15e63775b9a2ac7dca720f7050a8b955e092ea0f6020a4a80f69998cdc0" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[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.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "levenshtein_automata" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2cdeb66e45e9f36bfad5bbdb4d2384e70936afbee843c6f6543f0c551ebb25" + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libmimalloc-sys" +version = "0.1.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a45a52f43e1c16f667ccfe4dd8c85b7f7c204fd5e3bf46c5b0db9a5c3c0b8e9" +dependencies = [ + "cc", +] + +[[package]] +name = "libredox" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" +dependencies = [ + "libc", +] + +[[package]] +name = "linkme" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3045e122bd98aef8ec3ad58ce84f0791f64e70163d1a02710af4aa11a4d54cc5" +dependencies = [ + "linkme-impl", +] + +[[package]] +name = "linkme-impl" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77060ebe535362c3da75682cd17b0431017b6e7c5661e714fc69a7ad017d1301" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "lru" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39" +dependencies = [ + "hashbrown 0.16.1", +] + +[[package]] +name = "lz4_flex" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef0d4ed8669f8f8826eb00dc878084aa8f253506c4fd5e8f58f5bce72ddb97e" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "measure_time" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51c55d61e72fc3ab704396c5fa16f4c184db37978ae4e94ca8959693a235fc0e" +dependencies = [ + "log", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memmap2" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "miette-derive", + "unicode-width 0.1.14", +] + +[[package]] +name = "miette-derive" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "mimalloc" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d4139bb28d14ad1facf21d5eb8825051b326e172d216b39f6d31df53cc97862" +dependencies = [ + "libmimalloc-sys", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "murmurhash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b" + +[[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 = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[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 = "nye-console" +version = "0.1.0" +dependencies = [ + "colored", + "dialoguer", + "indicatif", +] + +[[package]] +name = "nye-daemon" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "nye-console", + "nye-wire-protocol", + "toasty", + "tokio", + "tracing", + "tracing-subscriber", + "uzers", +] + +[[package]] +name = "nye-package" +version = "0.1.0" +dependencies = [ + "anyhow", + "semver", + "serde", + "tempfile", + "tokio", + "toml", +] + +[[package]] +name = "nye-terminal" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "dotenvy", + "nye-console", + "nye-wire-protocol", + "tokio", + "tracing-subscriber", + "whoami", +] + +[[package]] +name = "nye-wire-protocol" +version = "0.1.0" +dependencies = [ + "anyhow", + "bitcode", + "papaya", + "rustix 1.1.4", + "tokio", + "tracing", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags", +] + +[[package]] +name = "objc2-system-configuration" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396" +dependencies = [ + "objc2-core-foundation", +] + +[[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 = "oneshot" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "269bca4c2591a28585d6bf10d9ed0332b7d76900a1b02bec41bdc3a2cdcda107" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "ordered-float" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7d950ca161dc355eaf28f82b11345ed76c6e1f6eb1f4f4479e0323b9e2fbd0e" +dependencies = [ + "num-traits", +] + +[[package]] +name = "ownedbytes" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fbd56f7631767e61784dc43f8580f403f4475bd4aaa4da003e6295e1bab4a7e" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "pack1" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b7bb0ecf2e447b1f20ee94ee79ef6eed1e9d4b3c36ce1903b9dea3bf205523" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "papaya" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "997ee03cd38c01469a7046643714f0ad28880bcb9e6679ff0666e24817ca19b7" +dependencies = [ + "equivalent", + "seize", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pastey" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" + +[[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.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "pluralizer" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b3eba432a00a1f6c16f39147847a870e94e2e9b992759b503e330efec778cbe" +dependencies = [ + "once_cell", + "regex", +] + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix 1.1.4", + "windows-sys 0.61.2", +] + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3" + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "serde_core", + "writeable", + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.119", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" +dependencies = [ + "anyhow", + "itertools 0.14.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[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 = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[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.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[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.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rapidhash" +version = "4.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5da7e78a036ce858e8d55b7e7dc8ba3a88b78350fd2155d3591bbd966b58589e" +dependencies = [ + "rustversion", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "roaring" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dedc5658c6ecb3bdb5ef5f3295bb9253f42dcf3fd1402c03f6b1f7659c3c4a9" +dependencies = [ + "bytemuck", + "byteorder", +] + +[[package]] +name = "rust-stemmers" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[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 = "rustc_version_runtime" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dd18cd2bae1820af0b6ad5e54f4a51d0f3fcc53b05f845675074efcc7af071d" +dependencies = [ + "rustc_version", + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", +] + +[[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 = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seize" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b55fb86dfd3a2f5f76ea78310a88f96c4ea21a3031f8d212443d56123fd0521" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[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.3", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-words" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "shuttle" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab17edba38d63047f46780cf7360acf7467fec2c048928689a5c1dd1c2b4e31" +dependencies = [ + "assoc", + "bitvec", + "cfg-if", + "generator", + "hex", + "owo-colors", + "rand 0.8.7", + "rand_core 0.6.4", + "rand_pcg", + "scoped-tls", + "smallvec", + "tracing", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simsimd" +version = "6.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fb3bc3cdce07a7d7d4caa4c54f8aa967f6be41690482b54b24100a2253fa70" +dependencies = [ + "cc", +] + +[[package]] +name = "siphasher" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" + +[[package]] +name = "sketches-ddsketch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e40b6cf54d988dc1a2223531b969c9a9e30906ad90ef64890c27b4bfbb46ea" +dependencies = [ + "serde", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + +[[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 = "softaes" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45e14297decde697ddf377c25752aead0927d5cfc89c2684d2af96901a4ceeea" + +[[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 = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.119", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tantivy" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edde6a10743fff00a4e1a8c9ef020bf5f3cbad301b7d2d39f2b07f123c4eac07" +dependencies = [ + "aho-corasick", + "arc-swap", + "base64", + "bitpacking", + "bon", + "byteorder", + "census", + "crc32fast", + "crossbeam-channel", + "datasketches", + "downcast-rs", + "fastdivide", + "fnv", + "fs4", + "htmlescape", + "itertools 0.14.0", + "levenshtein_automata", + "log", + "lru", + "lz4_flex", + "measure_time", + "memmap2", + "once_cell", + "oneshot", + "rayon", + "regex", + "rust-stemmers", + "rustc-hash 2.1.3", + "serde", + "serde_json", + "sketches-ddsketch", + "smallvec", + "tantivy-bitpacker", + "tantivy-columnar", + "tantivy-common", + "tantivy-fst", + "tantivy-query-grammar", + "tantivy-stacker", + "tantivy-tokenizer-api", + "tempfile", + "thiserror", + "time", + "typetag", + "uuid", + "winapi", +] + +[[package]] +name = "tantivy-bitpacker" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fed3d674429bcd2de5d0a6d1aa5495fed8afd9c5ecce993019caf7615f53fa4" +dependencies = [ + "bitpacking", +] + +[[package]] +name = "tantivy-columnar" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c57166f5bcfd478f370ab8445afb4678dce44801fa5ce5c451aaf8595583c5dc" +dependencies = [ + "downcast-rs", + "fastdivide", + "itertools 0.14.0", + "serde", + "tantivy-bitpacker", + "tantivy-common", + "tantivy-sstable", + "tantivy-stacker", +] + +[[package]] +name = "tantivy-common" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbf10915aa75da3c3b0d58b58853d2e889efbaf32d4982a4c3715dde6bba23e5" +dependencies = [ + "async-trait", + "byteorder", + "ownedbytes", + "serde", + "time", +] + +[[package]] +name = "tantivy-fst" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18" +dependencies = [ + "byteorder", + "regex-syntax", + "utf8-ranges", +] + +[[package]] +name = "tantivy-query-grammar" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfadb8526b6da90704feb293b0701a6aae62ea14983143344be2dc5ce30f1d82" +dependencies = [ + "fnv", + "nom", + "ordered-float", + "serde", + "serde_json", +] + +[[package]] +name = "tantivy-sstable" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2cfc3ac5164cbadc28965ffb145a8f47582a60ae5897859ad8d4316596c606" +dependencies = [ + "futures-util", + "itertools 0.14.0", + "tantivy-bitpacker", + "tantivy-common", + "tantivy-fst", + "zstd", +] + +[[package]] +name = "tantivy-stacker" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cbb051742da9d53ca9e8fff43a9b10e319338b24e2c0e15d0372df19ffeb951" +dependencies = [ + "murmurhash32", + "tantivy-common", +] + +[[package]] +name = "tantivy-tokenizer-api" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac258c2c6390673f2685813afeeafcb8c4e0ee7de8dd3fc46838dcc37263f98" +dependencies = [ + "serde", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[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 1.1.4", + "windows-sys 0.61.2", +] + +[[package]] +name = "terminal_size" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" +dependencies = [ + "rustix 1.1.4", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "2.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "thread_local" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1d5e639ff6bab73cb6885cc7e7b1de96c3f32c68ec55f3952614bec1092244" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "serde_core", + "zerovec", +] + +[[package]] +name = "toasty" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2abf272caf351f58e03758745b6185576fcfe7a513b007683c2f8eec698eed2" +dependencies = [ + "async-trait", + "bit-set", + "by_address", + "deadpool", + "hashbrown 0.17.1", + "index_vec", + "indexmap", + "inventory", + "toasty-core", + "toasty-driver-turso", + "toasty-macros", + "tokio", + "tokio-stream", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "toasty-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1650657e3784097859a1c31cf91b48e337f85684757e0c6ad44e887f0e009f" +dependencies = [ + "async-trait", + "bit-set", + "hashbrown 0.17.1", + "heck", + "indexmap", + "tokio-stream", + "tracing", + "uuid", +] + +[[package]] +name = "toasty-driver-turso" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cc0682b65eeab9b7d6e0bac3f309591df5b9b6df32f868a3a6ee5ca3636e24" +dependencies = [ + "async-trait", + "percent-encoding", + "serde", + "toasty-core", + "toasty-sql", + "tokio", + "tracing", + "turso", + "url", + "uuid", +] + +[[package]] +name = "toasty-macros" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16966e54a422be54959b0ad12bdbdcffc101c77aeca7d49fefff33142c709a29" +dependencies = [ + "hashbrown 0.17.1", + "heck", + "pluralizer", + "proc-macro2", + "quote", + "syn 3.0.3", + "toasty-core", +] + +[[package]] +name = "toasty-sql" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b19948205b682d1750a8cf331b0b7fa666baffe2a3a2c0a05d5e94103c0fcc08" +dependencies = [ + "serde", + "serde_json", + "toasty-core", +] + +[[package]] +name = "tokio" +version = "1.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "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.3", +] + +[[package]] +name = "tokio-stream" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "1.1.4+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.13+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-appender" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "050686193eb999b4bb3bc2acfa891a13da00f79734704c4b8b4ef1a10b368a3c" +dependencies = [ + "crossbeam-channel", + "symlink", + "thiserror", + "time", + "tracing-subscriber", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "turso" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9491d7a80312c5abe66a4409e4dce02065503a235453c94b9e4133877e39ffc" +dependencies = [ + "mimalloc", + "thiserror", + "tracing", + "tracing-subscriber", + "turso_core", + "turso_sdk_kit", + "turso_sync_sdk_kit", +] + +[[package]] +name = "turso_core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a833cc3bf8d4e6c101c504fa470f8ab4270c2202ff2591b61b2e373b4f20d9b" +dependencies = [ + "aegis", + "aes", + "aes-gcm", + "allocator-api2 0.4.0", + "antithesis_sdk", + "arc-swap", + "aristo", + "bigdecimal", + "bitflags", + "branches", + "bumpalo", + "bytemuck", + "cfg_aliases", + "cfg_block", + "chrono", + "crc32c", + "crossbeam-epoch", + "crossbeam-utils", + "either", + "fallible-iterator", + "fastbloom", + "hex", + "icu_collator", + "icu_locale", + "intrusive-collections", + "io-uring", + "libc", + "libloading", + "libm", + "loom", + "miette", + "num-bigint", + "num-traits", + "pack1", + "parking_lot", + "pastey", + "polling", + "rand 0.9.5", + "rapidhash", + "regex", + "regex-syntax", + "roaring", + "rustc-hash 2.1.3", + "rustix 1.1.4", + "ryu", + "serde_json", + "shuttle", + "simsimd", + "smallvec", + "strum", + "strum_macros", + "tantivy", + "tempfile", + "thiserror", + "tracing", + "tracing-subscriber", + "turso_ext", + "turso_macros", + "turso_parser", + "twox-hash", + "uncased", + "uuid", + "windows-sys 0.61.2", +] + +[[package]] +name = "turso_ext" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7452fe676450b6840e9eb80e512d14293265221154eba66aba3845dfc0d659f" +dependencies = [ + "chrono", + "getrandom 0.4.3", + "turso_macros", +] + +[[package]] +name = "turso_macros" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2825eaa6b7b893693636947f988e252c1196393fa54d4b85637c70d616d92fa" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "turso_parser" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e58d029f02e442df4be0b5036ce520b49c553505d9d52ef5a98fc4056e95b7" +dependencies = [ + "bitflags", + "memchr", + "miette", + "strum", + "strum_macros", + "thiserror", + "turso_macros", +] + +[[package]] +name = "turso_sdk_kit" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c1dc1c0304348c39b97bc6b27cdcb1d7292454ebd0de0f30b5ee3a4c61f9bb" +dependencies = [ + "bindgen", + "env_logger", + "parking_lot", + "tracing", + "tracing-appender", + "tracing-subscriber", + "turso_core", + "turso_ext", + "turso_sdk_kit_macros", +] + +[[package]] +name = "turso_sdk_kit_macros" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4708b5fe678b8730c85964e3d378f75e18c23c4409971360b2209f4e53e4956" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "turso_sync_engine" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8f03e430240d590d209ac874db52773b7382c627cd604a685affde77622b09" +dependencies = [ + "base64", + "bytes", + "crc32c", + "genawaiter", + "http", + "libc", + "prost", + "roaring", + "serde", + "serde_json", + "thiserror", + "tracing", + "turso_core", + "turso_parser", + "uuid", +] + +[[package]] +name = "turso_sync_sdk_kit" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d48cb47d056c3ec567745761fa6f832358ca30ef9eb0435fdcfb77c558e70089" +dependencies = [ + "bindgen", + "env_logger", + "genawaiter", + "parking_lot", + "tracing", + "tracing-appender", + "tracing-subscriber", + "turso_core", + "turso_sdk_kit", + "turso_sdk_kit_macros", + "turso_sync_engine", +] + +[[package]] +name = "twox-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8464ec13c3691491391d9fce00f6416c9a48e46972f72d7865688be2080192c9" +dependencies = [ + "rand 0.10.2", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "typetag" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c90e86058a30d42a1a928dfb4b49bb33c98c3a2b4909492e6b0881cd94798ec2" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f153acc4e99a5f2a5aefa09fb078be54e26271b2813f6041200b224c098d8328" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "uncased" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unit-prefix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8-ranges" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "rand 0.10.2", + "serde_core", + "sha1_smol", + "wasm-bindgen", +] + +[[package]] +name = "uzers" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8275fb1afee25b4111d2dc8b5c505dbbc4afd0b990cb96deb2d88bff8be18d" +dependencies = [ + "libc", + "log", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" +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 = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.44", +] + +[[package]] +name = "whoami" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998767ef88740d1f5b0682a9c53c24431453923962269c2db68ee43788c5a40d" +dependencies = [ + "libc", + "libredox", + "objc2-system-configuration", + "web-sys", +] + +[[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-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.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[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.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +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 = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "serde", + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.16+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c5def7e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +members = ["nye-terminal", "nye-daemon", "nye-wire-protocol", "nye-console", "nye-package"] +resolver = "3" diff --git a/README.md b/README.md index 17fca90..3ff8f47 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # nye -A Linux package manager that keeps your system tidy. \ No newline at end of file +A Linux package manager that keeps your system tidy. diff --git a/nye-console/Cargo.toml b/nye-console/Cargo.toml new file mode 100644 index 0000000..9c4bb23 --- /dev/null +++ b/nye-console/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "nye-console" +version = "0.1.0" +edition = "2024" + +[dependencies] +colored = "3.1.1" +dialoguer = "0.12.0" +indicatif = { version = "0.18.6", features = ["tokio"] } diff --git a/nye-console/src/lib.rs b/nye-console/src/lib.rs new file mode 100644 index 0000000..613742f --- /dev/null +++ b/nye-console/src/lib.rs @@ -0,0 +1,305 @@ +use std::fmt::Display; +use std::time::Duration; + +use colored::Colorize; +use dialoguer::theme::Theme; +use dialoguer::{Input, Select}; +use indicatif::{ProgressBar, ProgressStyle}; + +/// Takes a result and logs it if it's an error. +/// +/// Arguments: +/// * `result` - The result. +pub fn catch_err(result: Result) +where + E: Display, +{ + if let Err(error) = result { + err(error.to_string()); + } +} + +/// Displays a spinner loading bar on the console. +/// +/// Arguments: +/// * `message` - The message to display with the spinner. +/// +/// Returns: +/// [`ProgressBar`] - The spinner bar already being displayed on the console. +pub fn spinner(message: impl Into) -> ProgressBar { + let bar = ProgressBar::new_spinner() + .with_message(message.into()) + .with_style( + ProgressStyle::default_spinner() + .tick_strings(&["[\\]", "[|]", "[/]", "[-]", "^w^"]) + .template("{spinner:.cyan} {msg}") + .unwrap(), + ); + bar.enable_steady_tick(Duration::from_millis(200)); + + bar +} + +/// Displays a bytes progress bar on the console. +/// +/// Arguments: +/// * `message` - The message to display with the progress bar. +/// +/// Returns: +/// [`ProgressBar`] - The progress bar with a ticking spinner. +pub fn progress_bytes(message: impl Into, total: u64) -> ProgressBar { + let bar = ProgressBar::new(total) + .with_message(message.into()) + .with_style( + ProgressStyle::default_bar() + .progress_chars("##") + .tick_strings(&["[\\]", "[|]", "[/]", "[-]", "^w^"]) + .template( + "{spinner:.cyan} {wide_msg} {bar:.cyan/black} {binary_bytes}/{binary_total_bytes}", + ) + .unwrap(), + ); + bar.enable_steady_tick(Duration::from_millis(200)); + + bar +} + +/// Displays a success log message. +/// +/// Use this when finishing a task to indicate success. +/// +/// Arguments: +/// * `message` - The message to log. +pub fn yay(message: impl Into) { + let prefix = "YAY".cyan(); + let message = message.into(); + + println!("{prefix} {message}"); +} + +/// Displays an info log message. +/// +/// Arguments: +/// * `message` - The message to log. +pub fn info(message: impl Into) { + let prefix = "III".blue(); + let message = message.into(); + + println!("{prefix} {message}"); +} + +/// Displays a warning log message. +/// +/// Arguments: +/// * `message` - The message to log. +pub fn warn(message: impl Into) { + let prefix = "WWW".yellow(); + let message = message.into(); + + println!("{prefix} {message}"); +} + +/// Displays an error log message. +/// +/// Arguments: +/// * `message` - The message to log. +pub fn err(message: impl Into) { + let prefix = "ERR".red(); + let message = message.into(); + + println!("{prefix} {message}"); +} + +/// A theme for the dialoguer crate that is used to prompt the user for input and selection. +struct InputTheme; + +impl Theme for InputTheme { + fn format_input_prompt( + &self, + f: &mut dyn std::fmt::Write, + prompt: &str, + _default: Option<&str>, + ) -> std::fmt::Result { + let prefix = ">>>".purple(); + + write!(f, "{prefix} {prompt}") + } + + fn format_input_prompt_selection( + &self, + f: &mut dyn std::fmt::Write, + prompt: &str, + sel: &str, + ) -> std::fmt::Result { + let prefix = ">>>".purple(); + + write!(f, "{prefix} {prompt}{sel}") + } + + fn format_select_prompt(&self, f: &mut dyn std::fmt::Write, prompt: &str) -> std::fmt::Result { + let prefix = ">>>".purple(); + + write!(f, "{prefix} {prompt}") + } + + fn format_select_prompt_item( + &self, + f: &mut dyn std::fmt::Write, + text: &str, + active: bool, + ) -> std::fmt::Result { + if active { + write!(f, "{}", format!(" * {text}").purple()) + } else { + write!(f, " {text}") + } + } + + fn format_select_prompt_selection( + &self, + f: &mut dyn std::fmt::Write, + prompt: &str, + sel: &str, + ) -> std::fmt::Result { + let prefix = ">>>".purple(); + + write!(f, "{prefix} {prompt}{}", sel.purple()) + } +} + +/// Prompts the user for input. +/// +/// Arguments: +/// * `prompt` - The message to prompt the user with. +/// +/// Returns: +/// * `Ok(String)` - The user's input. +/// * `Err(Error)` - If the user cancelled the operation or if the user could not be prompted. +pub fn input(prompt: impl Into) -> Result { + Input::with_theme(&InputTheme) + .with_prompt(prompt) + .interact_text() +} + +/// Prompts the user for input with a default value. +/// +/// Arguments: +/// * `prompt` - The message to prompt the user with. +/// * `default` - The default value. +/// +/// Returns: +/// * `Ok(String)` - The user's input. +/// * `Err(Error)` - If the user cancelled the operation or if the user could not be prompted. +pub fn input_with_default( + prompt: impl Into, + default: impl Into, +) -> Result { + Input::with_theme(&InputTheme) + .with_prompt(prompt) + .default(default.into()) + .interact_text() +} + +/// Prompts the user to select an option. +/// +/// Arguments: +/// * `prompt` - The message to prompt the user with. +/// * `options` - The options to give the user for selection. +/// +/// Returns: +/// * `Ok(usize)` - The index of the option selected by the user. +/// * `Err(Error)` - If the user cancelled the operation or if the user could not be prompted. +pub fn select( + prompt: impl Into, + options: impl IntoIterator, +) -> Result { + Select::with_theme(&InputTheme) + .with_prompt(prompt) + .items(options) + .interact() +} + +/// Prompts the user to select an option with an option selected by default. +/// +/// Arguments: +/// * `prompt` - The message to prompt the user with. +/// * `options` - The options to give the user for selection. +/// * `default` - The index of the default option. +/// +/// Returns: +/// * `Ok(usize)` - The index of the option selected by the user. +/// * `Err(Error)` - If the user cancelled the operation or if the user could not be prompted. +pub fn select_with_default( + prompt: impl Into, + options: impl IntoIterator, + default: usize, +) -> Result { + Select::with_theme(&InputTheme) + .with_prompt(prompt) + .items(options) + .default(default) + .interact() +} + +/// Prompts the user to select an option with an option selected by default, without reporting the +/// selection. +/// +/// Arguments: +/// * `prompt` - The message to prompt the user with. +/// * `options` - The options to give the user for selection. +/// * `default` - The index of the default option. +/// +/// Returns: +/// * `Ok(usize)` - The index of the option selected by the user. +/// * `Err(Error)` - If the user cancelled the operation or if the user could not be prompted. +pub fn select_with_default_without_report( + prompt: impl Into, + options: impl IntoIterator, + default: usize, +) -> Result { + Select::with_theme(&InputTheme) + .with_prompt(prompt) + .items(options) + .default(default) + .report(false) + .interact() +} + +/// Formats items into a human-readable list. +/// +/// For example, +/// - `[1] => "1"` +/// - `[1, 2] => "1 and 2"` +/// - `[1, 2, 3] => "1, 2, and 3"`. +/// - `[1, 2, 3, 4] => "1, 2, 3, and 4"`. +/// +/// Arguments: +/// * `items` - The items of the list. +/// +/// Returns: +/// [`String`] -> The formatted list. +pub fn list(items: &[T]) -> String +where + T: Display, +{ + let mut string = String::new(); + + for (i, item) in items.iter().enumerate() { + let is_first = i == 0; + let is_penultimate = i == items.len() - 2; + let is_last = i == items.len() - 1; + + match (is_first, is_penultimate, is_last) { + (false, false, false) => string.push_str(&format!("{item}, ")), + (false, false, true) => string.push_str(&item.to_string()), + (false, true, false) => string.push_str(&format!("{item}, and ")), + (false, true, true) => unreachable!(), + (true, false, false) => string.push_str(&format!("{item}, ")), + (true, false, true) => string.push_str(&item.to_string()), + (true, true, false) => string.push_str(&format!("{item} and ")), + (true, true, true) => unreachable!(), + } + } + + string +} \ No newline at end of file diff --git a/nye-daemon/Cargo.toml b/nye-daemon/Cargo.toml new file mode 100644 index 0000000..248425c --- /dev/null +++ b/nye-daemon/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "nye-daemon" +version = "0.1.0" +edition = "2024" + +[dependencies] +clap = { version = "4.6.5", features = ["wrap_help", "derive", "env"] } +tokio = { version = "1.53.1", features = ["full"] } +nye-wire-protocol = { version = "0.1.0", path = "../nye-wire-protocol" } +tracing = { version = "0.1.44", features = ["async-await"] } +anyhow = { version = "1.0.104", features = ["backtrace"] } +uzers = "0.12.2" +nye-console = { version = "0.1.0", path = "../nye-console" } +tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } +toasty = { version = "0.9.0", features = ["turso"] } diff --git a/nye-daemon/src/args.rs b/nye-daemon/src/args.rs new file mode 100644 index 0000000..1aee0d7 --- /dev/null +++ b/nye-daemon/src/args.rs @@ -0,0 +1,8 @@ +#[derive(Debug, clap::Parser)] +pub struct Args { + /// Whether to enable debug logging. + /// + /// When enabled, the daemon will log additional information to help with debugging. + #[arg(short, long, default_value_t = false)] + pub debug: bool, +} diff --git a/nye-daemon/src/commands/mod.rs b/nye-daemon/src/commands/mod.rs new file mode 100644 index 0000000..138906d --- /dev/null +++ b/nye-daemon/src/commands/mod.rs @@ -0,0 +1 @@ +pub mod setup; diff --git a/nye-daemon/src/commands/setup.rs b/nye-daemon/src/commands/setup.rs new file mode 100644 index 0000000..e4c14ab --- /dev/null +++ b/nye-daemon/src/commands/setup.rs @@ -0,0 +1,84 @@ +use std::path::PathBuf; + +use anyhow::Context; +use nye_wire_protocol::messages::MessageResponse; +use nye_wire_protocol::{Connection, Stream}; +use tokio::fs; + +use crate::utils::LinuxUser; + +pub async fn run(connection: &mut Connection, stream: &mut Stream) -> anyhow::Result<()> { + let user = + LinuxUser::from_connection(connection).context("Could not get the user to set up.")?; + + setup(SetupKind::User(user.clone())) + .await + .context("Could not set up the user.")?; + + stream + .send(MessageResponse::Setup) + .await + .context("Could not send setup completion notification to the client.")?; + + tracing::trace!( + user.name, + user.uid, + user.gid, + "Sent setup completion notification to the client" + ); + + Ok(()) +} + +/// Represents the type of setup to perform. +pub enum SetupKind { + /// Sets up the Nye package manager for a specific user. + User(LinuxUser), + + /// Sets up the Nye package manager for the entire system. + System, +} + +impl SetupKind { + /// Returns the root directory for the setup kind. + /// + /// Returns: + /// [`PathBuf`] - The root directory for the setup kind. + fn root(&self) -> PathBuf { + match self { + SetupKind::User(user) => format!("/usr/{}/nye", user.name).into(), + SetupKind::System => "/nye".into(), + } + } +} + +/// Sets up the environment for the given setup kind. +/// +/// Arguments: +/// * `kind` - The kind of setup to perform. +/// +/// Returns: +/// * `Ok(())` - if the setup was successful. +/// * `Err(anyhow::Error)` - if there was an error during setup. +pub async fn setup(kind: SetupKind) -> anyhow::Result<()> { + let dirs = [ + kind.root(), + kind.root().join("packages"), + kind.root().join("volumes"), + ]; + + for dir in dirs { + fs::create_dir_all(&dir) + .await + .with_context(|| format!("Could not create directories at {}", dir.display()))?; + + tracing::debug!("Created directories at {}", dir.display()); + } + + tracing::info!( + "The Nye package manager was successfully set up at {}", + kind.root().display() + ); + + Ok(()) +} diff --git a/nye-daemon/src/db/mod.rs b/nye-daemon/src/db/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/nye-daemon/src/listener.rs b/nye-daemon/src/listener.rs new file mode 100644 index 0000000..673c1ba --- /dev/null +++ b/nye-daemon/src/listener.rs @@ -0,0 +1,106 @@ +use anyhow::Context; +use nye_wire_protocol::Connection; +use nye_wire_protocol::messages::MessageRequest; +use tokio::fs; +use tokio::task::JoinSet; + +use crate::commands; +use crate::utils::LinuxUser; + +/// Listens for incoming connections from clients and handles them. +/// +/// Arguments: +/// * `tasks` - A mutable reference to a `JoinSet` that will be used to spawn tasks for handling +/// incoming connections. +/// +/// Returns: +/// * `!` - This function never returns, as it runs an infinite loop accepting incoming connections +/// and spawning tasks to handle them. +/// * `Err(anyhow::Error)` - if there was an error binding to the socket or accepting an incoming +/// connection. +pub async fn run(tasks: &mut JoinSet>) -> anyhow::Result<()> { + let listener = nye_wire_protocol::listen("/run/nye-packages.sock") + .await + .context("Could not bind to the socket at /run/nye-packages.sock")?; + + tracing::info!("Listening for incoming connections on /run/nye-packages.sock"); + + loop { + let connection = listener + .accept() + .await + .context("There was an error accepting an incoming connection.")?; + + tasks.spawn(async move { + let result = handle_connection(connection).await; + + if let Err(e) = &result { + eprintln!("{e}"); + } + + result + }); + } +} + +/// Handle a connection from a client. +/// +/// Arguments: +/// * `connection` - The connection to handle. +/// +/// Returns: +/// * `Ok(())` - if the connection was handled successfully. +/// * `Err(anyhow::Error)` - if there was an error handling the connection. +async fn handle_connection(mut connection: Connection) -> anyhow::Result<()> { + let user = LinuxUser::from_ucred(connection.peer_credentials())?; + + tracing::info!(user.name, user.uid, user.gid, "Accepted a connection",); + + let mut stream = connection + .recv_stream() + .await + .context("Could not receive an incoming stream from the client.")?; + + tracing::info!( + user.name, + user.uid, + user.gid, + stream.id = stream.id(), + "Accepted a stream", + ); + + let request = stream + .recv_request() + .await + .context("Could not receive an incoming message from the incoming stream.")?; + + tracing::info!( + user.name, + user.uid, + user.gid, + stream.id = stream.id(), + message.kind = ?request.kind(), + "Received a message" + ); + + match request { + MessageRequest::Setup => { + commands::setup::run(&mut connection, &mut stream).await?; + } + } + + Ok(()) +} + +/// Clean up the socket file at `/run/nye-packages.sock`. +/// +/// This function is called when the daemon is shutting down to remove the socket file. +/// +/// Returns: +/// * `Ok(())` - if the socket file was removed successfully. +/// * `Err(anyhow::Error)` - if there was an error removing the socket file. +pub async fn cleanup() -> anyhow::Result<()> { + fs::remove_file("/run/nye-packages.sock") + .await + .context("Could not remove the socket at /run/nye-packages.sock") +} diff --git a/nye-daemon/src/main.rs b/nye-daemon/src/main.rs new file mode 100644 index 0000000..adf21be --- /dev/null +++ b/nye-daemon/src/main.rs @@ -0,0 +1,58 @@ +use anyhow::Context; +use clap::Parser; +use tokio::signal; +use tokio::task::JoinSet; +use tracing_subscriber::EnvFilter; + +use crate::args::Args; +use crate::commands::setup::SetupKind; + +mod args; +mod commands; +mod db; +mod listener; +mod utils; + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + let args = Args::parse(); + + let user_id = uzers::get_current_uid(); + + if user_id != 0 { + anyhow::bail!(concat!( + "The daemon must be run as root, but the current user is not root. ", + "Please run the daemon as root." + )); + } + + let env_filter = if args.debug { + EnvFilter::new("off,nye_daemon=trace,nye_wire_protocol=trace") + } else { + EnvFilter::new("off,nye_daemon=info,nye_wire_protocol=warn") + }; + + tracing_subscriber::fmt() + .with_env_filter(env_filter) + .with_target(false) + .init(); + + commands::setup::setup(SetupKind::System) + .await + .context("Could not set up the Nye package manager's system-wide configuration.")?; + + let mut tasks = JoinSet::new(); + + tokio::select! { + _ = listener::run(&mut tasks) => {} + _ = signal::ctrl_c() => { + tasks.join_all().await; + } + } + + listener::cleanup() + .await + .context("Failed to cleanup socket listener.")?; + + Ok(()) +} diff --git a/nye-daemon/src/utils.rs b/nye-daemon/src/utils.rs new file mode 100644 index 0000000..a6aec8c --- /dev/null +++ b/nye-daemon/src/utils.rs @@ -0,0 +1,51 @@ +use anyhow::Context; +use nye_wire_protocol::Connection; +use tokio::net::unix::UCred; + +/// A struct representing a Linux user. +#[derive(Clone)] +pub struct LinuxUser { + pub uid: u32, + pub gid: u32, + pub pid: i32, + + pub name: String, +} + +impl LinuxUser { + /// Creates a new [`LinuxUser`] from a [`UCred`]. + /// + /// Arguments: + /// * `ucred` - A reference to a [`UCred`] struct containing the user's credentials. + /// + /// Returns: + /// * `Ok(LinuxUser)` - if the user was successfully created. + /// * `Err(anyhow::Error)` - if there was an error creating the user. + pub fn from_ucred(ucred: UCred) -> anyhow::Result { + let user = + uzers::get_user_by_uid(ucred.uid()).context("The UID of the user does not exist.")?; + + Ok(Self { + uid: ucred.uid(), + gid: ucred.gid(), + pid: ucred + .pid() + .ok_or(anyhow::anyhow!("The client did not have a PID."))?, + name: user.name().to_string_lossy().to_string(), + }) + } + + /// Gets the [`LinuxUser`] of a [`Connection`]. + /// + /// Arguments: + /// * `connection` - A reference to a [`Connection`] struct containing the user's credentials. + /// + /// Returns: + /// * `Ok(LinuxUser)` - if the user was successfully gotten. + /// * `Err(anyhow::Error)` - if there was an error getting the user. + pub fn from_connection(connection: &Connection) -> anyhow::Result { + let ucred = connection.peer_credentials(); + + Self::from_ucred(ucred) + } +} diff --git a/nye-package/Cargo.toml b/nye-package/Cargo.toml new file mode 100644 index 0000000..1f1a622 --- /dev/null +++ b/nye-package/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "nye-package" +version = "0.1.0" +edition = "2024" + +[dependencies] +anyhow = { version = "1.0.104", features = ["backtrace"] } +semver = { version = "1.0.28", features = ["serde"] } +serde = { version = "1.0.229", features = ["derive"] } +tempfile = "3.27.0" +tokio = { version = "1.53.1", default-features = false, features = ["fs"] } +toml = { version = "1.1.4", features = ["preserve_order"] } diff --git a/nye-package/src/installable/manifest.rs b/nye-package/src/installable/manifest.rs new file mode 100644 index 0000000..e878092 --- /dev/null +++ b/nye-package/src/installable/manifest.rs @@ -0,0 +1,47 @@ +use std::path::PathBuf; + +use semver::Version; +use serde::{Deserialize, Serialize}; + +use crate::shared::Architecture; + +/// An installable package's manifest, compiled from a [`Manifest`](crate::manifest::Manifest). +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InstallableManifest { + /// The package's name, version, and architecture. + pub package: InstallableManifestPackage, + + /// The exposed artifacts of the package, such as binaries or libraries. + pub exposed: InstallableManifestExposed, +} + +/// The installable package's name, version, and architecture. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InstallableManifestPackage { + /// The package's name. + pub name: String, + + /// The package's version. + pub version: Version, + + /// The installable package's architecture. + pub architecture: Architecture, +} + +/// The installable package's exposed artifacts, such as binaries or libraries. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InstallableManifestExposed { + /// The installable package's exposed binaries. + #[serde(rename = "bin")] + pub binaries: Vec, +} + +/// An installable package's exposed binary. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct InstallableManifestExposedBinary { + /// The name as it'll be exposed in the system. + pub name: String, + + /// The path to the binary, relative to the `Installable.toml` file. + pub path: PathBuf, +} diff --git a/nye-package/src/installable/mod.rs b/nye-package/src/installable/mod.rs new file mode 100644 index 0000000..ff31028 --- /dev/null +++ b/nye-package/src/installable/mod.rs @@ -0,0 +1,3 @@ +//! Manifest and utilities to handle package installables. + +pub mod manifest; diff --git a/nye-package/src/lib.rs b/nye-package/src/lib.rs new file mode 100644 index 0000000..efea9e6 --- /dev/null +++ b/nye-package/src/lib.rs @@ -0,0 +1,6 @@ +//! This crate provides functionality for managing Nye packages, including bundling, installing, +//! and uninstalling them. + +pub mod installable; +pub mod project; +pub mod shared; diff --git a/nye-package/src/project/manifest.rs b/nye-package/src/project/manifest.rs new file mode 100644 index 0000000..2890789 --- /dev/null +++ b/nye-package/src/project/manifest.rs @@ -0,0 +1,135 @@ +use std::path::{Path, PathBuf}; + +use anyhow::Context; +use semver::Version; +use serde::{Deserialize, Serialize}; +use tokio::fs; + +use crate::shared::Architecture; + +/// A Nye package manifest. +/// +/// It describes the package's general information, dependencies, exposed artifacts, and other +/// things. It's used by the Nye package manager to know how to install, update, and remove the +/// package. +/// +/// This is currently stored at the package's root directory in a file called `Nye.toml`. The file +/// is in TOML format, and is deserialized into this struct when the package manager needs to read +/// it. +#[derive(Clone, Serialize, Deserialize)] +pub struct ProjectManifest { + /// The package's general information, such as its name, version, and description. + pub package: ProjectManifestPackage, + + /// The package's exposed binaries, libraries, and other artifacts. + pub exposed: ProjectManifestExposed, +} + +impl ProjectManifest { + /// Validates the manifest, ensuring that the values are well-formed and consistent. + /// + /// Returns: + /// * `Ok(())` - When the manifest is valid. + /// * `Err(anyhow::Error)` - When the manifest is invalid, with a message describing the issue. + pub fn validate(&self) -> anyhow::Result<()> { + if self.package.architectures.is_empty() { + anyhow::bail!("The package must support at least one architecture."); + } + + for (i, architecture) in self.package.architectures.iter().enumerate() { + if self + .package + .architectures + .iter() + .position(|a| a == architecture) + != Some(i) + { + anyhow::bail!( + "The package's architectures must be unique, yet {:?} appears more than once.", + architecture + ); + } + } + + Ok(()) + } +} + +/// A Nye package's general information, such as its name, version, and description. +#[derive(Clone, Serialize, Deserialize)] +pub struct ProjectManifestPackage { + /// The package's name, which is used to identify it in the Nye package manager. + pub name: String, + + /// The package's version, which is used to identify it in the Nye package manager. + pub version: Version, + + /// The package's description, which is used to describe it in the Nye package manager. + pub description: Option, + + /// The package's supported architectures, which is used to determine if the package can be + /// installed on the current system. + pub architectures: Vec, +} + +/// A Nye package's exposed binaries, libraries, and other artifacts. +/// +/// Only the artifacts listed here are exposed to the user and dependants. +#[derive(Default, Clone, Serialize, Deserialize)] +pub struct ProjectManifestExposed { + /// The package's exposed binaries, which are the executables that the package provides to the + /// user. + #[serde(rename = "bin")] + pub binaries: Vec, +} + +/// A Nye package's exposed binary, which is an executable that the package provides to the user. +#[derive(Clone, Serialize, Deserialize)] +pub struct ProjectManifestExposeBinary { + /// The name under which the binary is exposed. + pub name: String, + + /// The path to the binary, relative to the `./src/{arch}/bin` directory (which is itself + /// relative to the `Nye.toml` file). + /// + /// If missing, it is assumed that the binary is located at `./src/{arch}/bin/{name}`. + pub path: Option, + + /// The architectures for which the binary is available. + /// + /// If not specified, it is assumed that the binary is available for all architectures + /// specified in the `package.architectures` field. + pub architectures: Option>, +} + +/// Reads a Nye package's manifest from the given path and returns it as a [`Manifest`] struct. +/// +/// Arguments: +/// * `path` - The path to the manifest file. This is usually the `Nye.toml` file at the root of +/// the package's directory. +/// +/// Returns: +/// * `Ok(Manifest)` - The manifest struct if the file was read and parsed successfully. +/// * `Err(anyhow::Error)` - An error if the file could not be read or parsed. +pub async fn read(path: impl AsRef) -> anyhow::Result { + let string = fs::read_to_string(path) + .await + .context("Could not read package's manifest.")?; + + parse(&string) +} + +/// Parses a Nye package's manifest from the given string and returns it as a [`Manifest`] struct. +/// +/// Arguments: +/// * `string` - The string containing the manifest in TOML format. +/// +/// Returns: +/// * `Ok(Manifest)` - The manifest struct if the string was parsed successfully. +/// * `Err(anyhow::Error)` - An error if the string could not be parsed. +pub fn parse(string: &str) -> anyhow::Result { + let manifest: ProjectManifest = + toml::from_str(string).context("Could not parse the package's manifest.")?; + + Ok(manifest) +} diff --git a/nye-package/src/project/mod.rs b/nye-package/src/project/mod.rs new file mode 100644 index 0000000..0d63a27 --- /dev/null +++ b/nye-package/src/project/mod.rs @@ -0,0 +1,146 @@ +//! Manifest and utilities to handle package projects. +//! +//! ## Package Project Structure +//! +//! A Nye package project is a project that contains the files to bundle into a Nye package, +//! together with a `Nye.toml` manifest file that describes the package's metadata and +//! configuration. +//! +//! A package project's structure looks like follows: +//! +//! ```text +//! package/ # The root directory of the package project +//! Nye.toml # The package's manifest file +//! shared/ # A directory containing files that are shared across all architectures of the package. +//! bin/ # A directory containing the package's binaries that are shared across all architectures. +//! {architecture}/ # A directory for each architecture that the package supports, containing the files to bundle for that architecture. +//! bin/ # A directory containing the package's binaries for that architecture. +//! ``` +//! +//! The architectures supported are those returnable by [`std::env::consts::ARCH`], such as +//! `x86_64`, `aarch64`, and `arm`. The architecture-specific directories must match the names of +//! the architectures specified in the `package.architectures` field of the `Nye.toml` manifest +//! file. +//! +//! When an artifact is not available for a specific architecture, it'll fall back to the shared +//! version of the artifact if it exists. +//! +//! ### Package Project's Manifest File +//! +//! The `Nye.toml` manifest file is a TOML file at the package project's root directory that +//! describes the package's metadata and configuration. +//! +//! ```toml +//! [package] +//! name = "my-package" # The package's name +//! version = "1.0.0" # The package's version +//! architectures = ["x86_64", "aarch64"] # The architectures that the package supports +//! +//! [[exposed.bin]] +//! name = "my-binary" # The name of the binary as it'll be exposed in the system +//! path = "my-binary" # The path to the binary inside each `bin/` directory +//! architectures = ["x86_64", "aarch64"] # The architectures that this binary is available for +//! ``` +//! +//! The supported fields are the following: +//! +//! - `package.name` is the name of the package. It'll be used by (future) repositories to identify +//! the package. +//! - `package.version` is the semver version of the package. It'll be used by (future) +//! repositories and dependencies to identify the package's version. +//! - `package.architectures` is an array of the architectures that the package supports. +//! +//! - `exposed.bin` is an array of the binaries that the package exposes. Not all binaries +//! available in a package are exposed to the user and dependants. Only the binaries listed in +//! this array will be added to the `PATH` and made available to the user. +//! - `exposed.bin.name` is the name of the binary as it'll be exposed in the system. This is the +//! name that the user and dependants will use to invoke the binary. +//! - `exposed.bin.path` is the path to the binary inside each `bin/` directory, or under +//! `shared/bin/` if the binary is not available for an architecture. When not specified, it'll +//! default to the binary's name. +//! - `exposed.bin.architectures` is an array of the architectures that this binary is exposed +//! for. + +use std::path::{Path, PathBuf}; + +use anyhow::Context; +use tokio::fs; + +use crate::installable::manifest::InstallableManifestPackage; +use crate::shared::Architecture; + +pub mod manifest; + +/// Bundles a package project into a Nye package installable. +/// +/// Arguments: +/// * `input` - The path to the package project directory. It must contain a `Nye.toml` manifest +/// file and the files to bundle into the package. +/// * `output` - The path to the output directory where the bundled package will be created. +/// * `arch` - The architecture to bundle the package for. It must be one of the architectures +/// specified in the `package.architectures` field of the `Nye.toml` manifest file. +pub async fn bundle(input: impl AsRef, architecture: Architecture) -> anyhow::Result<()> { + let input = input.as_ref(); + + let manifest = manifest::read(input.join("Nye.toml")) + .await + .context("Could not read the manifest of the project to bundle.")?; + + manifest.validate()?; + + if !manifest.package.architectures.contains(&architecture) { + anyhow::bail!( + concat!( + "The architecture `{:?}` is not supported by the package project. The supported ", + "architectures are: {:?}.", + ), + architecture, + manifest.package.architectures + ); + } + + let source_arch = input.join(architecture.to_string()); + let source_shared = input.join("shared"); + + let installable_manifest_package = InstallableManifestPackage { + name: manifest.package.name, + version: manifest.package.version, + architecture, + }; + + let source_arch_bin = source_arch.join("bin"); + let source_shared_bin = source_shared.join("bin"); + + let mut installable_manifest_exposed_bins = Vec::new(); + + let working_dir = tempfile::tempdir() + .context("Could not create temporary working directory to bundle project.")?; + let working_dir_path = working_dir.path(); + + for binary in manifest.exposed.binaries { + if let Some(architectures) = binary.architectures { + if !architectures.contains(&architecture) { + continue; + } + } + + let path = binary.path.as_ref().unwrap_or(&PathBuf::from(&binary.name)); + + let path_in_arch = source_arch_bin.join(&path); + let path_in_shared = source_shared_bin.join(&path); + + let path_in_arch_exists = fs::try_exists(path) + .await + .context("Could not check whether binary existed")?; + let path_in_shared_exists = fs::try_exists(path) + .await + .context("Could not check whether binary existed")?; + + if path_in_arch_exists { + fs::copy(from, to) + } + + } + + Ok(()) +} diff --git a/nye-package/src/shared.rs b/nye-package/src/shared.rs new file mode 100644 index 0000000..8cec4e2 --- /dev/null +++ b/nye-package/src/shared.rs @@ -0,0 +1,56 @@ +use std::fmt::{Display, Formatter}; + +use serde::{Deserialize, Serialize}; + +/// A CPU architecture that a Nye package can support. +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] +#[serde(rename_all = "lowercase")] +pub enum Architecture { + X86, + X86_64, + Arm, + Aarch64, + M68k, + Mips, + Mips32r6, + Mips64, + Mips64r6, + Csky, + Powerpc, + Powerpc64, + Riscv32, + Riscv64, + S390x, + Sparc, + Sparc64, + Hexagon, + Loongarch32, + Loongarch64, +} + +impl Display for Architecture { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Architecture::X86 => write!(f, "x86"), + Architecture::X86_64 => write!(f, "x86_64"), + Architecture::Arm => write!(f, "arm"), + Architecture::Aarch64 => write!(f, "aarch64"), + Architecture::M68k => write!(f, "m68k"), + Architecture::Mips => write!(f, "mips"), + Architecture::Mips32r6 => write!(f, "mips32r6"), + Architecture::Mips64 => write!(f, "mips64"), + Architecture::Mips64r6 => write!(f, "mips64r6"), + Architecture::Csky => write!(f, "csky"), + Architecture::Powerpc => write!(f, "powerpc"), + Architecture::Powerpc64 => write!(f, "powerpc64"), + Architecture::Riscv32 => write!(f, "riscv32"), + Architecture::Riscv64 => write!(f, "riscv64"), + Architecture::S390x => write!(f, "s390x"), + Architecture::Sparc => write!(f, "sparc"), + Architecture::Sparc64 => write!(f, "sparc64"), + Architecture::Hexagon => write!(f, "hexagon"), + Architecture::Loongarch32 => write!(f, "loongarch32"), + Architecture::Loongarch64 => write!(f, "loongarch64"), + } + } +} diff --git a/nye-package/test-package/Nye.toml b/nye-package/test-package/Nye.toml new file mode 100644 index 0000000..20eafb9 --- /dev/null +++ b/nye-package/test-package/Nye.toml @@ -0,0 +1,19 @@ +[package] +name = "test-package" +version = "0.1.0" +description = "A package for testing the Nye package manager." +architectures = ["x86", "x86_64"] + +[[expose.bin]] +name = "shared-binary" + +[[expose.bin]] +name = "exposed-binary" + +[[expose.bin]] +name = "exposed-binary-x86" +architectures = ["x86"] + +[[expose.bin]] +name = "exposed-binary-x86_64" +architectures = ["x86_64"] diff --git a/nye-package/test-package/shared/bin/shared-binary b/nye-package/test-package/shared/bin/shared-binary new file mode 100644 index 0000000..5e2ac49 --- /dev/null +++ b/nye-package/test-package/shared/bin/shared-binary @@ -0,0 +1,2 @@ +#!/bin/sh +echo "This binary is shared across all architectures." diff --git a/nye-package/test-package/x86/bin/exposed-binary b/nye-package/test-package/x86/bin/exposed-binary new file mode 100644 index 0000000..57c9a51 --- /dev/null +++ b/nye-package/test-package/x86/bin/exposed-binary @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Hello from the test Nye package for the x86 architecture!" diff --git a/nye-package/test-package/x86/bin/exposed-binary-x86 b/nye-package/test-package/x86/bin/exposed-binary-x86 new file mode 100644 index 0000000..144b694 --- /dev/null +++ b/nye-package/test-package/x86/bin/exposed-binary-x86 @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Hello from the test Nye package for the x86 architecture! This binary's name is arch-specific." diff --git a/nye-package/test-package/x86/bin/not-exposed b/nye-package/test-package/x86/bin/not-exposed new file mode 100644 index 0000000..e364baf --- /dev/null +++ b/nye-package/test-package/x86/bin/not-exposed @@ -0,0 +1,2 @@ +#!/bin/sh +echo "This binary for the x86 architecture is not exposed." diff --git a/nye-package/test-package/x86_64/bin/exposed-binary b/nye-package/test-package/x86_64/bin/exposed-binary new file mode 100644 index 0000000..d0f59f1 --- /dev/null +++ b/nye-package/test-package/x86_64/bin/exposed-binary @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Hello from the test Nye package for the x86_64 architecture!" diff --git a/nye-package/test-package/x86_64/bin/exposed-binary-x86_64 b/nye-package/test-package/x86_64/bin/exposed-binary-x86_64 new file mode 100644 index 0000000..a58944f --- /dev/null +++ b/nye-package/test-package/x86_64/bin/exposed-binary-x86_64 @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Hello from the test Nye package for the x86_64 architecture! This binary's name is arch-specific." diff --git a/nye-package/test-package/x86_64/bin/not-exposed b/nye-package/test-package/x86_64/bin/not-exposed new file mode 100644 index 0000000..2327128 --- /dev/null +++ b/nye-package/test-package/x86_64/bin/not-exposed @@ -0,0 +1,2 @@ +#!/bin/sh +echo "This binary for the x86_64 architecture is not exposed." diff --git a/nye-terminal/Cargo.lock b/nye-terminal/Cargo.lock new file mode 100644 index 0000000..ee0c553 --- /dev/null +++ b/nye-terminal/Cargo.lock @@ -0,0 +1,554 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[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", +] + +[[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", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301b56658598e48f3648647ac6fc887be7e7108eddfa4e9b63fcf3ec58c0cadf" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a65403d1a1bd28f7dc68eb8506e8874808ee5eecb59298de588e2e1407a078" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", + "terminal_size", +] + +[[package]] +name = "clap_derive" +version = "4.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "futures-core" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" + +[[package]] +name = "futures-task" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" + +[[package]] +name = "futures-util" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "js-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "libredox" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" +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 = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "mio" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "nye" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "dotenvy", + "tokio", + "whoami", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags", +] + +[[package]] +name = "objc2-system-configuration" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396" +dependencies = [ + "objc2-core-foundation", +] + +[[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 = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[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 = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys", +] + +[[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.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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "terminal_size" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" +dependencies = [ + "rustix", + "windows-sys", +] + +[[package]] +name = "tokio" +version = "1.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[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.3", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[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.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whoami" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998767ef88740d1f5b0682a9c53c24431453923962269c2db68ee43788c5a40d" +dependencies = [ + "libc", + "libredox", + "objc2-system-configuration", + "web-sys", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] diff --git a/nye-terminal/Cargo.toml b/nye-terminal/Cargo.toml new file mode 100644 index 0000000..f1b55b6 --- /dev/null +++ b/nye-terminal/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "nye-terminal" +version = "0.1.0" +edition = "2024" + +[dependencies] +anyhow = { version = "1.0.104", features = ["backtrace"] } +clap = { version = "4.6.5", features = ["derive", "env", "wrap_help"] } +dotenvy = "0.15.7" +tokio = { version = "1.53.1", features = ["full"] } +whoami = { version = "2.1.2", default-features = false, features = ["std"] } +nye-wire-protocol = { version = "0.1.0", path = "../nye-wire-protocol" } +tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } +nye-console = { version = "0.1.0", path = "../nye-console" } + +[[bin]] +name = "nye" +path = "src/main.rs" diff --git a/nye-terminal/src/args.rs b/nye-terminal/src/args.rs new file mode 100644 index 0000000..724fc29 --- /dev/null +++ b/nye-terminal/src/args.rs @@ -0,0 +1,47 @@ +//! CLI arguments for the terminal application. + +use std::path::PathBuf; + +#[derive(Debug, clap::Parser)] +pub struct Args { + /// Whether to display logs on the terminal. + #[arg(short, long, global = true, default_value_t = false)] + pub debug: bool, + + #[clap(subcommand)] + pub command: Command, +} + +#[derive(Debug, clap::Subcommand)] +pub enum Command { + /// Sets up the package manager for the current user or the system. + #[command(visible_alias = "s")] + Setup(SetupCommand), + + /// Bundle the current project into a single package. + #[command(visible_alias = "b")] + Bundle(BundleCommand), + + /// Install one or more packages. + #[command(visible_alias = "i")] + Install(InstallCommand), +} + +#[derive(Debug, clap::Args)] +pub struct SetupCommand; + +#[derive(Debug, clap::Args)] +pub struct BundleCommand { + #[arg(short, long, default_value = ".")] + path: PathBuf, +} + +#[derive(Debug, clap::Args)] +pub struct InstallCommand { + /// The names of the packages to install. + packages: Vec, + + /// The path to the directory where the package is located. + #[arg(short, long)] + path: Option, +} diff --git a/nye-terminal/src/commands/bundle.rs b/nye-terminal/src/commands/bundle.rs new file mode 100644 index 0000000..56e9a0c --- /dev/null +++ b/nye-terminal/src/commands/bundle.rs @@ -0,0 +1,7 @@ +use nye_wire_protocol::Connection; + +use crate::args::BundleCommand; + +pub async fn run(_command: &BundleCommand, connection: &Connection) -> anyhow::Result<()> { + Ok(()) +} diff --git a/nye-terminal/src/commands/install.rs b/nye-terminal/src/commands/install.rs new file mode 100644 index 0000000..3231641 --- /dev/null +++ b/nye-terminal/src/commands/install.rs @@ -0,0 +1,7 @@ +use nye_wire_protocol::Connection; + +use crate::args::InstallCommand; + +pub async fn run(_command: &InstallCommand, connection: &Connection) -> anyhow::Result<()> { + Ok(()) +} diff --git a/nye-terminal/src/commands/mod.rs b/nye-terminal/src/commands/mod.rs new file mode 100644 index 0000000..6c7e933 --- /dev/null +++ b/nye-terminal/src/commands/mod.rs @@ -0,0 +1,3 @@ +pub mod bundle; +pub mod install; +pub mod setup; diff --git a/nye-terminal/src/commands/setup.rs b/nye-terminal/src/commands/setup.rs new file mode 100644 index 0000000..ad755dd --- /dev/null +++ b/nye-terminal/src/commands/setup.rs @@ -0,0 +1,31 @@ +use anyhow::Context; +use nye_wire_protocol::Connection; +use nye_wire_protocol::messages::MessageRequest; + +use crate::args::SetupCommand; + +pub async fn run(_command: &SetupCommand, connection: &Connection) -> anyhow::Result<()> { + let progress = nye_console::spinner(format!( + "Setting up the Nye package manager for {}...", + whoami::username().context("Could not get current user's username.")? + )); + + let mut stream = connection + .send_stream() + .await + .context("Could not open a stream to the daemon.")?; + + stream + .send(MessageRequest::Setup) + .await + .context("Could not send setup request to the daemon.")?; + + let _response = stream + .recv_response() + .await + .context("Could not receive response from the daemon.")?; + + progress.finish_with_message("Done! The Nye package manager was setup for your user."); + + Ok(()) +} diff --git a/nye-terminal/src/main.rs b/nye-terminal/src/main.rs new file mode 100644 index 0000000..220f034 --- /dev/null +++ b/nye-terminal/src/main.rs @@ -0,0 +1,39 @@ +use clap::Parser; +use tracing_subscriber::EnvFilter; + +use crate::args::{Args, Command}; + +mod args; +mod commands; + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + dotenvy::dotenv().ok(); + + let args = Args::parse(); + + if args.debug { + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::new( + "off,nye_terminal=trace,nye_wire_protocol=trace", + )) + .with_target(false) + .init(); + } + + let connection = nye_wire_protocol::connect("/run/nye-packages.sock").await?; + + match &args.command { + Command::Setup(command) => { + commands::setup::run(command, &connection).await?; + } + Command::Bundle(command) => { + commands::bundle::run(command, &connection).await?; + } + Command::Install(command) => { + commands::install::run(command, &connection).await?; + } + } + + Ok(()) +} diff --git a/nye-wire-protocol/Cargo.toml b/nye-wire-protocol/Cargo.toml new file mode 100644 index 0000000..1c4e592 --- /dev/null +++ b/nye-wire-protocol/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "nye-wire-protocol" +version = "0.1.0" +edition = "2024" + +[dependencies] +anyhow = { version = "1.0.104", features = ["backtrace"] } +bitcode = "0.6.9" +papaya = "0.2.4" +rustix = { version = "1.1.4", features = ["linux_latest", "net", "system"] } +tokio = { version = "1.53.1", features = ["io-util", "net"] } +tracing = { version = "0.1.44", features = ["async-await"] } diff --git a/nye-wire-protocol/src/lib.rs b/nye-wire-protocol/src/lib.rs new file mode 100644 index 0000000..7536a32 --- /dev/null +++ b/nye-wire-protocol/src/lib.rs @@ -0,0 +1,550 @@ +use std::path::Path; +use std::sync::Arc; +use std::sync::atomic::{AtomicU64, Ordering}; + +use anyhow::Context; +use papaya::HashMap; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; +use tokio::net::unix::{OwnedReadHalf, OwnedWriteHalf, UCred}; +use tokio::net::{UnixListener, UnixStream}; +use tokio::sync::{Notify, mpsc}; + +use crate::messages::{Message, MessageRequest, MessageResponse, StreamMessage}; + +pub mod messages; + +/// Binds a new [`UnixListener`] to the specified path. +/// +/// Arguments: +/// * `path` - The path to bind the UnixListener to. +/// +/// Returns: +/// * `Ok(Self)` - If the binding was successful, returns a new instance of [`Listener`]. +/// * `Err(anyhow::Error)` - If the binding failed, returns an error. +pub async fn listen(path: impl AsRef) -> anyhow::Result { + let listener = UnixListener::bind(path.as_ref()).context(format!( + "Could not listen for incoming connections at {}.", + path.as_ref().display() + ))?; + + tracing::info!( + "Listening for incoming connections at {}", + path.as_ref().display() + ); + + Ok(Listener { listener }) +} + +/// Connects to a Unix socket at the specified path and returns a new instance of [`Connection`]. +/// +/// Arguments: +/// * `path` - The path to the Unix socket to connect to. +/// +/// Returns: +/// * `Ok(Connection)` - If the connection was successful, returns a new instance of +/// [`Connection`]. +/// * `Err(anyhow::Error)` - If the connection failed, returns an error. +pub async fn connect(path: impl AsRef) -> anyhow::Result { + let stream = UnixStream::connect(path.as_ref()).await.context(format!( + "Could not connect to the Unix socket at {}.", + path.as_ref().display() + ))?; + + tracing::info!( + "Connected to the Unix socket at {}", + path.as_ref().display() + ); + + Connection::new(stream, PartyType::Client) +} + +/// A wrapper around a [`UnixListener`] to accept incoming connections on a Unix socket. +pub struct Listener { + listener: UnixListener, +} + +impl Listener { + /// Accepts an incoming connection on the Unix socket. + /// + /// Returns: + /// * `Ok(Connection)` - If the connection was accepted successfully, returns a new instance of + /// [`Connection`]. + /// * `Err(anyhow::Error)` - If the connection could not be accepted, returns an error. + pub async fn accept(&self) -> anyhow::Result { + let (stream, _) = self.listener.accept().await?; + + Connection::new(stream, PartyType::Server) + } +} + +/// An enum representing the type of party (client or server) in a connection. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum PartyType { + Client, + Server, +} + +impl PartyType { + /// Creates a new instance of [`PartyType`] from a given ID. + /// + /// Arguments: + /// * `id` - The ID to derive the party type from. + /// + /// Returns: + /// [`PartyType`] - A new instance of [`PartyType`] derived from the given ID. + fn from_id(id: u64) -> Self { + // The most significant bit of the ID indicates the party type. + + if id & (1 << 63) != 0 { + PartyType::Server + } else { + PartyType::Client + } + } + + /// Converts a given ID to a party-specific ID based on the party type. + /// + /// Arguments: + /// * `id` - The ID to convert to a party-specific ID. + /// + /// Returns: + /// [`u64`] - The party-specific ID derived from the given ID. + fn type_id(&self, id: u64) -> u64 { + match self { + PartyType::Client => id & !(1 << 63), + PartyType::Server => id | (1 << 63), + } + } +} + +type StreamsMap = Arc>>; + +type PendingStreamsTx = mpsc::UnboundedSender; +type PendingStreamsRx = mpsc::UnboundedReceiver; + +/// A wrapper around a [`UnixStream`] to represent a connection to a Unix socket. +pub struct Connection { + /// The type of party (client or server) of the current party. + party_type: PartyType, + + /// A shared map of protocol streams to route incoming messages to. + streams: StreamsMap, + + /// The peer credentials of the other party in the connection. + peer_credentials: UCred, + + /// An atomic counter to generate unique stream IDs for each protocol stream. + stream_id_counter: AtomicU64, + + /// Notifies when the connection is closing, allowing tasks to clean up resources. + closing: Arc, + + /// A channel to receive pending streams that need to be processed by this party. + pending_streams: PendingStreamsRx, + + /// A channel to send outgoing messages to the other party. + outgoing_tx: mpsc::UnboundedSender, +} + +impl Connection { + /// Creates a new instance of [`Connection`] from an existing [`UnixStream`]. + /// + /// Arguments: + /// * `party_type` - The type of party (client or server) that this connection represents. + /// * `stream` - The existing [`UnixStream`] to wrap in a [`Connection`]. + /// + /// Returns: + /// * `Self` - A new instance of [`Connection`] wrapping the provided [`UnixStream`]. + fn new(stream: UnixStream, party_type: PartyType) -> anyhow::Result { + let peer_credentials = stream + .peer_cred() + .context("Could not get the credentials of the connection's peer.")?; + + let (stream_rx, stream_tx) = stream.into_split(); + + let streams: StreamsMap = Default::default(); + + let (outgoing_tx, outgoing_rx) = mpsc::unbounded_channel(); + let (pending_streams_tx, pending_streams_rx) = mpsc::unbounded_channel(); + + let closing = Arc::new(Notify::new()); + + tokio::spawn({ + let stream_rx = stream_rx; + let streams = streams.clone(); + let pending_streams_tx = pending_streams_tx.clone(); + let outgoing_tx = outgoing_tx.clone(); + let closing = closing.clone(); + + async move { + let result = Self::route_incoming( + stream_rx, + streams, + pending_streams_tx, + party_type, + outgoing_tx, + closing, + ) + .await; + + if let Err(e) = &result { + tracing::warn!("{e:?}"); + } + + result + } + }); + tokio::spawn(async move { + let result = Self::route_outgoing(stream_tx, outgoing_rx).await; + + if let Err(e) = &result { + tracing::warn!("{e:?}"); + } + + result + }); + + Ok(Self { + party_type, + peer_credentials, + streams, + stream_id_counter: AtomicU64::new(0), + closing, + pending_streams: pending_streams_rx, + outgoing_tx, + }) + } + + /// Receives a pending stream that needs to be processed by this party. + /// + /// Returns: + /// * `Ok(Stream)` - If a pending stream was received successfully, returns the stream. + /// * `Err(anyhow::Error)` - If the pending streams channel was closed, returns an error. + pub async fn recv_stream(&mut self) -> anyhow::Result { + let stream = self + .pending_streams + .recv() + .await + .context("The pending streams channel was closed, which should not happen.")?; + + Ok(stream) + } + + /// Creates a new protocol stream with a unique ID and returns it. + /// + /// Returns: + /// * `Ok(Stream)` - If the stream was created successfully, returns the new stream. + /// * `Err(anyhow::Error)` - If an error occurred while creating the stream, returns an error. + pub async fn send_stream(&self) -> anyhow::Result { + let id = self.stream_id_counter.fetch_add(1, Ordering::Relaxed); + let id = self.party_type.type_id(id); + + let (incoming_tx, incoming_rx) = mpsc::unbounded_channel(); + + let stream = Stream::new( + id, + self.streams.clone(), + incoming_tx, + incoming_rx, + self.outgoing_tx.clone(), + ); + + self.streams.pin().insert(id, stream.incoming_tx.clone()); + + Ok(stream) + } + + /// Routes incoming messages from the Unix stream to the appropriate protocol streams. + /// + /// Arguments: + /// * `stream_rx` - The read half of the Unix stream to read incoming messages from. + /// * `streams` - A shared map of protocol streams to route incoming messages to. + /// * `pending` - A channel to send pending streams that need to be processed by this party. + /// * `party_type` - The party type of the current party. + /// * `outgoing_tx` - A channel to send outgoing messages to the other party. + /// * `closing` - A notification to signal when the connection is closing. + /// + /// Returns: + /// * `!` - This function runs indefinitely and does not return. + /// * `Err(anyhow::Error)` - If an error occurs while routing incoming messages, returns an + /// error. + async fn route_incoming( + mut stream_rx: OwnedReadHalf, + streams: StreamsMap, + pending: PendingStreamsTx, + party_type: PartyType, + outgoing_tx: mpsc::UnboundedSender, + closing: Arc, + ) -> anyhow::Result<()> { + loop { + // Only close on message boundaries. + let message_size = tokio::select! { + _ = closing.notified() => { + // The connection is closing, so we should stop routing incoming messages and + // return. + return Ok(()); + } + size = stream_rx.read_u32() => { + size.context("Could not read the size of the incoming message.")? + } + }; + + let mut message_data = vec![0u8; message_size as usize]; + stream_rx + .read_exact(&mut message_data) + .await + .context("Could not read the data of the incoming message.")?; + + let message: StreamMessage = + bitcode::decode(&message_data).context("Could not decode the incoming message.")?; + + tracing::info!( + stream.id = message.stream_id, + message.kind = ?message.data.kind(), + "Received a message" + ); + + if let Some(stream) = streams.pin().get(&message.stream_id) { + tracing::trace!( + stream.id = message.stream_id, + message.kind = ?message.data.kind(), + "Routing the message to the existing stream" + ); + + stream.send(message.data).context( + "Could not send the message through the stream's incoming messages channel.", + )?; + } else if PartyType::from_id(message.stream_id) != party_type { + // The other party initiated this stream, so we need to create a new stream and + // send it to the pending channel. + + tracing::trace!( + stream.id = message.stream_id, + message.kind = ?message.data.kind(), + "Creating a new stream for the incoming message" + ); + + let (incoming_tx, incoming_rx) = mpsc::unbounded_channel(); + + let stream = Stream::new( + message.stream_id, + streams.clone(), + incoming_tx.clone(), + incoming_rx, + outgoing_tx.clone(), + ); + stream.incoming_tx.send(message.data).context(concat!( + "Could not send the first message of the stream through the incoming ", + "messages channel." + ))?; + + streams.pin().insert(message.stream_id, incoming_tx); + pending + .send(stream) + .context("Could not send the stream through the pending streams channel.")?; + } else { + anyhow::bail!(concat!( + "A message was received from the other party for a stream that does not ", + "exist. The ID said we created the stream, yet we did not or it was already ", + "closed. This is a bug, either on this side or the other side (daemon or ", + "client)." + )); + } + } + } + + /// Routes outgoing messages from the protocol streams to the Unix stream. + /// + /// Arguments: + /// * `stream_tx` - The write half of the Unix stream to write outgoing messages to. + /// * `outgoing_rx` - A channel to receive outgoing messages from the protocol streams. + /// + /// Returns: + /// * `!` - This function runs indefinitely and does not return. + /// * `Err(anyhow::Error)` - If an error occurs while routing outgoing messages, returns an + /// error. + async fn route_outgoing( + mut stream_tx: OwnedWriteHalf, + mut outgoing_rx: mpsc::UnboundedReceiver, + ) -> anyhow::Result<()> { + loop { + // If closed, the connection was dropped. + let Some(message) = outgoing_rx.recv().await else { + return Ok(()); + }; + + let message_data = bitcode::encode(&message); + let message_size = message_data.len() as u32; + + stream_tx + .write_u32(message_size) + .await + .context("Could not send outgoing message's size through the socket.")?; + stream_tx + .write_all(&message_data) + .await + .context("Could not send outgoing message's data through the socket.")?; + + tracing::info!( + stream.id = message.stream_id, + message.kind = ?message.data.kind(), + "Sent a message" + ); + } + } + + /// Returns the peer credentials of the other party in the connection. + /// + /// Returns: + /// [`UCred`] - A reference to the peer credentials of the other party in the connection. + pub fn peer_credentials(&self) -> UCred { + self.peer_credentials + } +} + +impl Drop for Connection { + fn drop(&mut self) { + let peer_credentials = self.peer_credentials(); + + tracing::debug!( + user.uid = peer_credentials.uid(), + user.gid = peer_credentials.gid(), + user.pid = peer_credentials.pid(), + "Closing the connection" + ); + + self.closing.notify_waiters(); + } +} + +/// A representation of a protocol stream that can send and receive messages over a connection. +pub struct Stream { + id: u64, + + streams: StreamsMap, + + incoming_tx: mpsc::UnboundedSender, + incoming_rx: mpsc::UnboundedReceiver, + + outgoing_tx: mpsc::UnboundedSender, +} + +impl Stream { + /// Creates a new instance of [`Stream`] with the specified ID. + /// + /// Arguments: + /// * `id` - The ID to assign to the new stream. + /// * `streams` - A shared map of protocol streams to route incoming messages to. + /// * `incoming_rx` - A channel to receive incoming messages from the other party. + /// * `incoming_tx` - A channel to receive incoming messages from the other party. + /// * `outgoing_tx` - A channel to send outgoing messages to the other party. + /// + /// Returns: + /// [`Stream`] - A new instance of [`Stream`] with the specified ID. + fn new( + id: u64, + streams: StreamsMap, + incoming_tx: mpsc::UnboundedSender, + incoming_rx: mpsc::UnboundedReceiver, + outgoing_tx: mpsc::UnboundedSender, + ) -> Self { + Self { + id, + streams, + incoming_tx, + incoming_rx, + outgoing_tx, + } + } + + /// Sends a message over the stream to the other party. + /// + /// Arguments: + /// * `message` - The message to send over the stream. + /// + /// Returns: + /// * `Ok(())` - If the message was sent successfully. + /// * `Err(anyhow::Error)` - If an error occurred while sending the message. + pub async fn send(&self, message: impl Into) -> anyhow::Result<()> { + let stream_message = StreamMessage { + stream_id: self.id, + data: message.into(), + }; + + self.outgoing_tx + .send(stream_message) + .context("The outgoing messages channel was closed.")?; + + Ok(()) + } + + /// Receives a message from the stream sent by the other party. + /// + /// Returns: + /// * `Ok(Message)` - If a message was received successfully. + /// * `Err(anyhow::Error)` - If an error occurred while receiving the message. + pub async fn recv(&mut self) -> anyhow::Result { + let message = self.incoming_rx.recv().await.context( + "The incoming messages channel for this stream was closed, which should not happen.", + )?; + + Ok(message) + } + + /// Receives a request message from the stream sent by the other party. + /// + /// Returns: + /// * `Ok(MessageRequest)` - If a request message was received successfully. + /// * `Err(anyhow::Error)` - If an error occurred while receiving the request message or the + /// message received was a response. + pub async fn recv_request(&mut self) -> anyhow::Result { + let message = self.recv().await?; + + match message { + Message::Request(request) => Ok(request), + _ => anyhow::bail!(concat!( + "The message received from the other party was not a request. ", + "This is a bug, either on this side or the other side (daemon or client)." + )), + } + } + + /// Receives a response message from the stream sent by the other party. + /// + /// Returns: + /// * `Ok(MessageResponse)` - If a response message was received successfully. + /// * `Err(anyhow::Error)` - If an error occurred while receiving the response message or the + /// message received was a request. + pub async fn recv_response(&mut self) -> anyhow::Result { + let message = self.recv().await?; + + match message { + Message::Response(response) => Ok(response), + _ => anyhow::bail!(concat!( + "The message received from the other party was not a response. ", + "This is a bug, either on this side or the other side (daemon or client)." + )), + } + } + + /// Returns the ID of the stream. + /// + /// Returns: + /// [`u64`] - The ID of the stream. + pub fn id(&self) -> u64 { + self.id + } +} + +impl Drop for Stream { + fn drop(&mut self) { + let id = self.id; + + tracing::debug!( + stream.id = id, + "Closing the stream and removing it from the streams map." + ); + + self.streams.pin().remove(&id); + } +} diff --git a/nye-wire-protocol/src/messages.rs b/nye-wire-protocol/src/messages.rs new file mode 100644 index 0000000..85e3e66 --- /dev/null +++ b/nye-wire-protocol/src/messages.rs @@ -0,0 +1,105 @@ +use bitcode::{Decode, Encode}; + +/// Represents a message in the Nye wire protocol. +#[derive(Debug, Clone, Encode, Decode)] +pub struct StreamMessage { + /// The unique identifier of the stream, used to correlate requests and responses. + pub stream_id: u64, + + /// The type of the message, represented as a string. + pub data: Message, +} + +/// Represents the data contained in a message in the Nye wire protocol. +#[derive(Debug, Clone, Encode, Decode)] +pub enum Message { + /// Represents a request message in the Nye wire protocol. + Request(MessageRequest), + + /// Represents a response message in the Nye wire protocol. + Response(MessageResponse), +} + +impl Message { + /// Returns the kind of the message. + /// + /// Returns: + /// [`MessageKind`] - the kind of the message. + pub fn kind(&self) -> MessageKind { + match self { + Message::Request(request) => MessageKind::Request(request.kind()), + Message::Response(response) => MessageKind::Response(response.kind()), + } + } +} + +/// Represents the kind of a message in the Nye wire protocol. +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] +pub enum MessageKind { + Request(MessageRequestKind), + Response(MessageResponseKind), +} + +/// Represents a request message in the Nye wire protocol. +/// +/// Only sent from the client to the daemon. +#[derive(Debug, Clone, Encode, Decode)] +pub enum MessageRequest { + Setup, +} + +impl MessageRequest { + /// Returns the kind of the message request. + /// + /// Returns: + /// [`MessageRequestKind`] - the kind of the message request. + pub fn kind(&self) -> MessageRequestKind { + match self { + MessageRequest::Setup => MessageRequestKind::Setup, + } + } +} + +impl From for Message { + fn from(request: MessageRequest) -> Self { + Message::Request(request) + } +} + +/// Represents the kind of a message request in the Nye wire protocol. +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] +pub enum MessageRequestKind { + Setup, +} + +/// Represents a response message in the Nye wire protocol. +/// +/// Only sent from the daemon to the client. +#[derive(Debug, Clone, Encode, Decode)] +pub enum MessageResponse { + Setup, +} + +impl MessageResponse { + /// Returns the kind of the message response. + /// + /// Returns: + /// [`MessageResponseKind`] - the kind of the message response. + pub fn kind(&self) -> MessageResponseKind { + match self { + MessageResponse::Setup => MessageResponseKind::SetupFinished, + } + } +} + +impl From for Message { + fn from(response: MessageResponse) -> Self { + Message::Response(response) + } +} + +/// Represents the kind of a message response in the Nye wire protocol. +#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] +pub enum MessageResponseKind { + SetupFinished, +} diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..669eec4 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,2 @@ +group_imports = "StdExternalCrate" +imports_granularity = "Module" \ No newline at end of file